@tiledesk/tiledesk-tybot-connector 2.2.1 → 2.4.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/logs/app1.log
CHANGED
|
@@ -5821,3 +5821,38 @@ info: (TiledeskChatbot) resolve {"botId":"subagentBotID","requestId":"support-gr
|
|
|
5821
5821
|
info: (DirReturnStack) pop {"requestId":"support-group-projectID-296787de7a9d4f17ac1b7b83306907ab","parentId":"parentBotID","parentParticipantId":"devParentBotID","nextBlock":"#aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}
|
|
5822
5822
|
info: (tybotRoute) inbound {"botId":"parentBotID","requestId":"support-group-projectID-296787de7a9d4f17ac1b7b83306907ab","text":"/#aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","sender":"_tdinternal","senderFullname":"_tdinternal"}
|
|
5823
5823
|
info: (TiledeskChatbot) resolve {"botId":"parentBotID","requestId":"support-group-projectID-296787de7a9d4f17ac1b7b83306907ab","text":"/#aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","sender":"_tdinternal","lockedIntent":null}
|
|
5824
|
+
info: AI_MODELS not defined
|
|
5825
|
+
info: AI Models:
|
|
5826
|
+
info: AI_MODELS not defined
|
|
5827
|
+
info: AI Models:
|
|
5828
|
+
info: Starting tilebot server...
|
|
5829
|
+
info: (Tilebot) Starting Tilebot..
|
|
5830
|
+
info: (Tilebot) settings.API_ENDPOINT:http://127.0.0.1:10002
|
|
5831
|
+
info: (Tilebot) settings.TILEBOT_ENDPOINT:http://127.0.0.1:10001
|
|
5832
|
+
info: (Tilebot) Log Level: info
|
|
5833
|
+
info: (Tilebot) MAX_STEPS: 1000
|
|
5834
|
+
info: (Tilebot) MAX_EXECUTION_TIME: 28800000
|
|
5835
|
+
info: (Tilebot) Starting Tilebot connector v2.3.0
|
|
5836
|
+
info: (Tilebot) Using static bots
|
|
5837
|
+
info: (Tilebot) Connecting Redis...
|
|
5838
|
+
info: (Tilebot) Redis connected
|
|
5839
|
+
info: (Tilebot) Tilebot started
|
|
5840
|
+
info: Tilebot route successfully started.
|
|
5841
|
+
info: Tilebot connector listening on port 10001
|
|
5842
|
+
error: Axios error response data: {"error":true}
|
|
5843
|
+
error: (DirReplaceBotV3) error: Request failed with status code 500 {"code":"ERR_BAD_RESPONSE","config":{"adapter":["xhr","http","fetch"],"data":"{\"id\":\"replaceChildBotID\"}","env":{"Blob":null},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Authorization":"JWT XXX","Content-Length":"26","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"maxBodyLength":-1,"maxContentLength":-1,"method":"put","timeout":0,"transformRequest":[null],"transformResponse":[null],"transitional":{"clarifyTimeoutError":false,"forcedJSONParsing":true,"silentJSONParsing":true},"url":"http://127.0.0.1:10002/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN"},"name":"AxiosError","request":{"_closed":true,"_contentLength":null,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"PUT /projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nAuthorization: JWT XXX\r\nUser-Agent: axios/1.7.7\r\nContent-Length: 26\r\nAccept-Encoding: gzip, compress, deflate, br\r\nHost: 127.0.0.1:10002\r\nConnection: close\r\n\r\n","_headerSent":true,"_keepAliveTimeout":0,"_last":true,"_redirectable":{"_currentRequest":"[Circular]","_currentUrl":"http://127.0.0.1:10002/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","_ended":true,"_ending":true,"_events":{},"_eventsCount":3,"_options":{"agents":{},"beforeRedirects":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Authorization":"JWT XXX","Content-Length":"26","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"hostname":"127.0.0.1","maxBodyLength":null,"maxRedirects":21,"method":"PUT","nativeProtocols":{"http:":{"METHODS":["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"],"STATUS_CODES":{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"},"globalAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0},"maxHeaderSize":16384},"https:":{"globalAgent":{"_events":{},"_eventsCount":2,"_sessionCache":{"list":[],"map":{}},"defaultPort":443,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxCachedSessions":100,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"https:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0}}},"path":"/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","pathname":"/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","port":"10002","protocol":"http:"},"_redirectCount":0,"_redirects":[],"_requestBodyBuffers":[],"_requestBodyLength":26,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":true,"defaultEncoding":"utf8","destroyed":false,"emitClose":true,"ended":false,"ending":false,"errorEmitted":false,"errored":null,"finalCalled":false,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":false,"sync":true,"writecb":null,"writelen":0,"writing":false}},"_removedConnection":false,"_removedContLen":false,"_removedTE":false,"_trailer":"","aborted":false,"agent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0},"chunkedEncoding":false,"destroyed":true,"finished":true,"host":"127.0.0.1","maxHeadersCount":null,"maxRequestsOnConnectionReached":false,"method":"PUT","outputData":[],"outputSize":0,"parser":null,"path":"/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","protocol":"http:","res":{"_consuming":false,"_dumped":false,"_events":{"end":[null,null]},"_eventsCount":4,"_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":true,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":true,"resumeScheduled":false,"sync":true},"aborted":false,"client":{"_events":{"close":[null,null]},"_eventsCount":6,"_hadError":false,"_host":null,"_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":true,"closed":true,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":true,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":true,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"complete":true,"httpVersion":"1.1","httpVersionMajor":1,"httpVersionMinor":1,"method":null,"rawHeaders":["X-Powered-By","Express","Content-Type","application/json; charset=utf-8","Content-Length","14","ETag","W/\"e-Tj8n9olBUMQK0x0qT7YAC46tguk\"","Date","Thu, 15 Oct 2026 10:13:59 GMT","Connection","close"],"rawTrailers":[],"redirects":[],"req":"[Circular]","responseUrl":"http://127.0.0.1:10002/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","socket":{"_events":{"close":[null,null]},"_eventsCount":6,"_hadError":false,"_host":null,"_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":true,"closed":true,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":true,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":true,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"statusCode":500,"statusMessage":"Internal Server Error","upgrade":false,"url":""},"reusedSocket":false,"sendDate":false,"shouldKeepAlive":false,"socket":{"_events":{"close":[null,null]},"_eventsCount":6,"_hadError":false,"_host":null,"_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":true,"closed":true,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":true,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":true,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"timeoutCb":null,"upgradeOrConnect":false,"useChunkedEncodingByDefault":true,"writable":true},"response":{"config":{"adapter":["xhr","http","fetch"],"data":"{\"id\":\"replaceChildBotID\"}","env":{"Blob":null},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Authorization":"JWT XXX","Content-Length":"26","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"maxBodyLength":-1,"maxContentLength":-1,"method":"put","timeout":0,"transformRequest":[null],"transformResponse":[null],"transitional":{"clarifyTimeoutError":false,"forcedJSONParsing":true,"silentJSONParsing":true},"url":"http://127.0.0.1:10002/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN"},"data":{"error":true},"headers":{"connection":"close","content-length":"14","content-type":"application/json; charset=utf-8","date":"Thu, 15 Oct 2026 10:13:59 GMT","etag":"W/\"e-Tj8n9olBUMQK0x0qT7YAC46tguk\"","x-powered-by":"Express"},"request":{"_closed":true,"_contentLength":null,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"PUT /projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nAuthorization: JWT XXX\r\nUser-Agent: axios/1.7.7\r\nContent-Length: 26\r\nAccept-Encoding: gzip, compress, deflate, br\r\nHost: 127.0.0.1:10002\r\nConnection: close\r\n\r\n","_headerSent":true,"_keepAliveTimeout":0,"_last":true,"_redirectable":{"_currentRequest":"[Circular]","_currentUrl":"http://127.0.0.1:10002/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","_ended":true,"_ending":true,"_events":{},"_eventsCount":3,"_options":{"agents":{},"beforeRedirects":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Authorization":"JWT XXX","Content-Length":"26","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"hostname":"127.0.0.1","maxBodyLength":null,"maxRedirects":21,"method":"PUT","nativeProtocols":{"http:":{"METHODS":["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"],"STATUS_CODES":{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"},"globalAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0},"maxHeaderSize":16384},"https:":{"globalAgent":{"_events":{},"_eventsCount":2,"_sessionCache":{"list":[],"map":{}},"defaultPort":443,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxCachedSessions":100,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"https:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0}}},"path":"/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","pathname":"/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","port":"10002","protocol":"http:"},"_redirectCount":0,"_redirects":[],"_requestBodyBuffers":[],"_requestBodyLength":26,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":true,"defaultEncoding":"utf8","destroyed":false,"emitClose":true,"ended":false,"ending":false,"errorEmitted":false,"errored":null,"finalCalled":false,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":false,"sync":true,"writecb":null,"writelen":0,"writing":false}},"_removedConnection":false,"_removedContLen":false,"_removedTE":false,"_trailer":"","aborted":false,"agent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0},"chunkedEncoding":false,"destroyed":true,"finished":true,"host":"127.0.0.1","maxHeadersCount":null,"maxRequestsOnConnectionReached":false,"method":"PUT","outputData":[],"outputSize":0,"parser":null,"path":"/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","protocol":"http:","res":{"_consuming":false,"_dumped":false,"_events":{"end":[null,null]},"_eventsCount":4,"_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":true,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":true,"resumeScheduled":false,"sync":true},"aborted":false,"client":{"_events":{"close":[null,null]},"_eventsCount":6,"_hadError":false,"_host":null,"_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":true,"closed":true,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":true,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":true,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"complete":true,"httpVersion":"1.1","httpVersionMajor":1,"httpVersionMinor":1,"method":null,"rawHeaders":["X-Powered-By","Express","Content-Type","application/json; charset=utf-8","Content-Length","14","ETag","W/\"e-Tj8n9olBUMQK0x0qT7YAC46tguk\"","Date","Thu, 15 Oct 2026 10:13:59 GMT","Connection","close"],"rawTrailers":[],"redirects":[],"req":"[Circular]","responseUrl":"http://127.0.0.1:10002/projectID/requests/support-group-projectID-073b6ebc063347c2890b23d48e04329c/replace","socket":{"_events":{"close":[null,null]},"_eventsCount":6,"_hadError":false,"_host":null,"_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":true,"closed":true,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":true,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":true,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"statusCode":500,"statusMessage":"Internal Server Error","upgrade":false,"url":""},"reusedSocket":false,"sendDate":false,"shouldKeepAlive":false,"socket":{"_events":{"close":[null,null]},"_eventsCount":6,"_hadError":false,"_host":null,"_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":true,"closed":true,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":true,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":true,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":true,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"timeoutCb":null,"upgradeOrConnect":false,"useChunkedEncodingByDefault":true,"writable":true},"status":500,"statusText":"Internal Server Error"},"stack":"AxiosError: Request failed with status code 500\n at settle (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:2019:12)\n at IncomingMessage.handleStreamEnd (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:3135:11)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)\n at Axios.request (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:4287:41)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)","status":500}
|
|
5844
|
+
info: Starting tilebot server...
|
|
5845
|
+
info: (Tilebot) Starting Tilebot..
|
|
5846
|
+
info: (Tilebot) settings.API_ENDPOINT:http://127.0.0.1:10002
|
|
5847
|
+
info: (Tilebot) settings.TILEBOT_ENDPOINT:http://127.0.0.1:10001
|
|
5848
|
+
info: (Tilebot) Log Level: info
|
|
5849
|
+
info: (Tilebot) MAX_STEPS: 1000
|
|
5850
|
+
info: (Tilebot) MAX_EXECUTION_TIME: 28800000
|
|
5851
|
+
info: (Tilebot) Starting Tilebot connector v2.3.0
|
|
5852
|
+
info: (Tilebot) Using static bots
|
|
5853
|
+
info: (Tilebot) Connecting Redis...
|
|
5854
|
+
info: (Tilebot) Redis connected
|
|
5855
|
+
info: (Tilebot) Tilebot started
|
|
5856
|
+
info: Tilebot route successfully started.
|
|
5857
|
+
info: Tilebot connector listening on port 10001
|
|
5858
|
+
info: (tybotRoute) skip bot bubble {"botId":"parentBotID","requestId":"support-group-projectID-46a2f439373d4854b3ae46d16afbafa1","text":"Sono Task 1 (version 1)","sender":"bot_subagentBotID"}
|
package/package.json
CHANGED
|
@@ -8,9 +8,8 @@ const winston = require('../../utils/winston');
|
|
|
8
8
|
const httpUtils = require('../../utils/HttpUtils');
|
|
9
9
|
const { Logger } = require('../../Logger');
|
|
10
10
|
const { AnalyticsClient } = require('../../AnalyticsClient');
|
|
11
|
-
const { SubagentStack } = require('../SubagentStack');
|
|
12
11
|
const requestService = require('../../services/RequestService');
|
|
13
|
-
const
|
|
12
|
+
const { pushCallerSnapshot } = require('../pushCallerSnapshot');
|
|
14
13
|
|
|
15
14
|
class DirCallSubAgent {
|
|
16
15
|
|
|
@@ -68,27 +67,10 @@ class DirCallSubAgent {
|
|
|
68
67
|
data.id = botId;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
const subagentStack =
|
|
72
|
-
const intentAction = this.context.reply.actions.find(action => action._tdActionType === "intent");
|
|
73
|
-
|
|
74
|
-
const parentId = this.context.chatbot?.botId;
|
|
75
|
-
const parentParticipantId = participantBotIdFromToken(this.context.token) || parentId;
|
|
76
|
-
|
|
77
|
-
winston.debug("(DirCallSubAgent) push " + JSON.stringify({
|
|
78
|
-
requestId: this.requestId,
|
|
79
|
-
parentId: parentId,
|
|
80
|
-
parentParticipantId: parentParticipantId,
|
|
70
|
+
const { subagentStack } = await pushCallerSnapshot(this.context, "DirCallSubAgent", {
|
|
81
71
|
targetBotId: botId,
|
|
82
|
-
blockName: blockName
|
|
83
|
-
|
|
84
|
-
}));
|
|
85
|
-
const stackData = {
|
|
86
|
-
parentId: parentId,
|
|
87
|
-
parentParticipantId: parentParticipantId,
|
|
88
|
-
parentToken: this.context.token,
|
|
89
|
-
nextBlock: intentAction
|
|
90
|
-
}
|
|
91
|
-
await subagentStack.push(this.requestId, stackData);
|
|
72
|
+
blockName: blockName
|
|
73
|
+
});
|
|
92
74
|
|
|
93
75
|
try {
|
|
94
76
|
const resbody = await requestService.replaceBot(this.context.projectId, this.requestId, data, this.context.token);
|
|
@@ -135,18 +117,4 @@ class DirCallSubAgent {
|
|
|
135
117
|
|
|
136
118
|
}
|
|
137
119
|
|
|
138
|
-
// The bot JWT is signed for the bot that is a participant of the request. After a publish
|
|
139
|
-
// that is the development bot, while chatbot.botId is the published copy running the flow.
|
|
140
|
-
function participantBotIdFromToken(token) {
|
|
141
|
-
if (!token || typeof token !== 'string') {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
const raw = token.startsWith('JWT ') ? token.slice(4) : token;
|
|
145
|
-
const payload = jwt.decode(raw);
|
|
146
|
-
if (!payload || payload.sub !== 'bot' || !payload._id) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
return String(payload._id);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
120
|
module.exports = { DirCallSubAgent };
|
|
@@ -8,6 +8,7 @@ const winston = require('../../utils/winston');
|
|
|
8
8
|
const httpUtils = require('../../utils/HttpUtils');
|
|
9
9
|
const { Logger } = require('../../Logger');
|
|
10
10
|
const { AnalyticsClient } = require('../../AnalyticsClient');
|
|
11
|
+
const { pushCallerSnapshot } = require('../pushCallerSnapshot');
|
|
11
12
|
|
|
12
13
|
class DirReplaceBotV3 {
|
|
13
14
|
|
|
@@ -35,9 +36,9 @@ class DirReplaceBotV3 {
|
|
|
35
36
|
callback();
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
|
-
this.go(action, () => {
|
|
39
|
+
this.go(action, (stop) => {
|
|
39
40
|
this.logger.native("[Replace Bot] Executed");
|
|
40
|
-
callback();
|
|
41
|
+
callback(stop);
|
|
41
42
|
})
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -57,6 +58,18 @@ class DirReplaceBotV3 {
|
|
|
57
58
|
botSlug = filler.fill(botSlug, variables);
|
|
58
59
|
blockName = filler.fill(blockName, variables);
|
|
59
60
|
|
|
61
|
+
let pushed;
|
|
62
|
+
try {
|
|
63
|
+
pushed = await pushCallerSnapshot(this.context, "DirReplaceBotV3", {
|
|
64
|
+
targetBotId: useSlug ? botSlug : botId,
|
|
65
|
+
blockName: blockName
|
|
66
|
+
});
|
|
67
|
+
} catch (error) {
|
|
68
|
+
winston.error("(DirReplaceBotV3) error saving stack: ", error);
|
|
69
|
+
callback(true);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
60
73
|
let data = {};
|
|
61
74
|
if (useSlug && useSlug === true) {
|
|
62
75
|
data.slug = botSlug;
|
|
@@ -77,9 +90,10 @@ class DirReplaceBotV3 {
|
|
|
77
90
|
httpUtils.request(
|
|
78
91
|
HTTPREQUEST, async (err, resbody) => {
|
|
79
92
|
if (err) {
|
|
93
|
+
await pushed.subagentStack.pop(this.requestId);
|
|
80
94
|
winston.error("(DirReplaceBotV3) error: ", err);
|
|
81
95
|
if (callback) {
|
|
82
|
-
callback();
|
|
96
|
+
callback(true);
|
|
83
97
|
return;
|
|
84
98
|
}
|
|
85
99
|
}
|
|
@@ -112,9 +126,12 @@ class DirReplaceBotV3 {
|
|
|
112
126
|
if (err) {
|
|
113
127
|
winston.debug("(DirReplaceBotV3) Error sending hidden message: " + err.message);
|
|
114
128
|
}
|
|
115
|
-
callback();
|
|
129
|
+
callback(true);
|
|
116
130
|
});
|
|
117
131
|
}
|
|
132
|
+
else if (pushed.nextBlock) {
|
|
133
|
+
callback(true);
|
|
134
|
+
}
|
|
118
135
|
else {
|
|
119
136
|
callback();
|
|
120
137
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const jwt = require('jsonwebtoken');
|
|
2
|
+
const winston = require('../utils/winston');
|
|
3
|
+
const { SubagentStack } = require('./SubagentStack');
|
|
4
|
+
|
|
5
|
+
// The bot JWT is signed for the bot that is a participant of the request. After a publish
|
|
6
|
+
// that is the development bot, while chatbot.botId is the published copy running the flow.
|
|
7
|
+
function participantBotIdFromToken(token) {
|
|
8
|
+
if (!token || typeof token !== 'string') {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const raw = token.startsWith('JWT ') ? token.slice(4) : token;
|
|
12
|
+
const payload = jwt.decode(raw);
|
|
13
|
+
if (!payload || payload.sub !== 'bot' || !payload._id) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return String(payload._id);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Saves the caller before handing the request to another bot, so a later
|
|
20
|
+
// returnstack can restore it. Used by callsubagent and every replace.
|
|
21
|
+
async function pushCallerSnapshot(context, label, extra) {
|
|
22
|
+
const subagentStack = new SubagentStack({ tdCache: context.tdcache });
|
|
23
|
+
const intentAction = context.reply.actions.find(action => action._tdActionType === "intent");
|
|
24
|
+
const parentId = context.chatbot?.botId;
|
|
25
|
+
const parentParticipantId = participantBotIdFromToken(context.token) || parentId;
|
|
26
|
+
|
|
27
|
+
winston.debug("(" + label + ") push " + JSON.stringify({
|
|
28
|
+
requestId: context.requestId,
|
|
29
|
+
parentId: parentId,
|
|
30
|
+
parentParticipantId: parentParticipantId,
|
|
31
|
+
...(extra || {}),
|
|
32
|
+
nextBlock: intentAction && intentAction.intentName
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
const stackData = {
|
|
36
|
+
parentId: parentId,
|
|
37
|
+
parentParticipantId: parentParticipantId,
|
|
38
|
+
parentToken: context.token,
|
|
39
|
+
nextBlock: intentAction
|
|
40
|
+
};
|
|
41
|
+
await subagentStack.push(context.requestId, stackData);
|
|
42
|
+
return { subagentStack, nextBlock: intentAction || null };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = { participantBotIdFromToken, pushCallerSnapshot };
|