@botonic/react 0.48.0 → 0.49.0-alpha.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/lib/cjs/components/button/index.js +3 -2
- package/lib/cjs/components/button/index.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/debug-message.js +2 -0
- package/lib/cjs/components/system-debug-trace/debug-message.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/ai-agent/ai-agent.js +1 -1
- package/lib/cjs/components/system-debug-trace/events/ai-agent/ai-agent.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/ai-agent/parse-tools.d.ts +1 -1
- package/lib/cjs/components/system-debug-trace/events/ai-agent/parse-tools.js +6 -2
- package/lib/cjs/components/system-debug-trace/events/ai-agent/parse-tools.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/ai-agent-router.d.ts +4 -0
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/ai-agent-router.js +23 -0
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/ai-agent-router.js.map +1 -0
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/index.d.ts +2 -0
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/index.js +6 -0
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/index.js.map +1 -0
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/types.d.ts +23 -0
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/types.js +3 -0
- package/lib/cjs/components/system-debug-trace/events/ai-agent-router/types.js.map +1 -0
- package/lib/cjs/components/system-debug-trace/events/constants.d.ts +4 -0
- package/lib/cjs/components/system-debug-trace/events/constants.js +4 -0
- package/lib/cjs/components/system-debug-trace/events/constants.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/events/index.d.ts +1 -0
- package/lib/cjs/components/system-debug-trace/events/index.js +1 -0
- package/lib/cjs/components/system-debug-trace/events/index.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/hooks/use-last-label-position.js +36 -28
- package/lib/cjs/components/system-debug-trace/hooks/use-last-label-position.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/icons/ai-router.d.ts +1 -0
- package/lib/cjs/components/system-debug-trace/icons/ai-router.js +11 -0
- package/lib/cjs/components/system-debug-trace/icons/ai-router.js.map +1 -0
- package/lib/cjs/components/system-debug-trace/icons/index.d.ts +2 -0
- package/lib/cjs/components/system-debug-trace/icons/index.js +2 -0
- package/lib/cjs/components/system-debug-trace/icons/index.js.map +1 -1
- package/lib/cjs/components/system-debug-trace/types.d.ts +2 -2
- package/lib/cjs/debug-system-messages.d.ts +198 -0
- package/lib/cjs/debug-system-messages.js +240 -0
- package/lib/cjs/debug-system-messages.js.map +1 -0
- package/lib/cjs/dev-app.d.ts +199 -0
- package/lib/cjs/dev-app.js +22 -0
- package/lib/cjs/dev-app.js.map +1 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/button/index.js +3 -2
- package/lib/esm/components/button/index.js.map +1 -1
- package/lib/esm/components/system-debug-trace/debug-message.js +2 -0
- package/lib/esm/components/system-debug-trace/debug-message.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/ai-agent/ai-agent.js +1 -1
- package/lib/esm/components/system-debug-trace/events/ai-agent/ai-agent.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/ai-agent/parse-tools.d.ts +1 -1
- package/lib/esm/components/system-debug-trace/events/ai-agent/parse-tools.js +6 -2
- package/lib/esm/components/system-debug-trace/events/ai-agent/parse-tools.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/ai-agent-router.d.ts +4 -0
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/ai-agent-router.js +23 -0
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/ai-agent-router.js.map +1 -0
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/index.d.ts +2 -0
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/index.js +6 -0
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/index.js.map +1 -0
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/types.d.ts +23 -0
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/types.js +3 -0
- package/lib/esm/components/system-debug-trace/events/ai-agent-router/types.js.map +1 -0
- package/lib/esm/components/system-debug-trace/events/constants.d.ts +4 -0
- package/lib/esm/components/system-debug-trace/events/constants.js +4 -0
- package/lib/esm/components/system-debug-trace/events/constants.js.map +1 -1
- package/lib/esm/components/system-debug-trace/events/index.d.ts +1 -0
- package/lib/esm/components/system-debug-trace/events/index.js +1 -0
- package/lib/esm/components/system-debug-trace/events/index.js.map +1 -1
- package/lib/esm/components/system-debug-trace/hooks/use-last-label-position.js +36 -28
- package/lib/esm/components/system-debug-trace/hooks/use-last-label-position.js.map +1 -1
- package/lib/esm/components/system-debug-trace/icons/ai-router.d.ts +1 -0
- package/lib/esm/components/system-debug-trace/icons/ai-router.js +11 -0
- package/lib/esm/components/system-debug-trace/icons/ai-router.js.map +1 -0
- package/lib/esm/components/system-debug-trace/icons/index.d.ts +2 -0
- package/lib/esm/components/system-debug-trace/icons/index.js +2 -0
- package/lib/esm/components/system-debug-trace/icons/index.js.map +1 -1
- package/lib/esm/components/system-debug-trace/types.d.ts +2 -2
- package/lib/esm/debug-system-messages.d.ts +198 -0
- package/lib/esm/debug-system-messages.js +240 -0
- package/lib/esm/debug-system-messages.js.map +1 -0
- package/lib/esm/dev-app.d.ts +199 -0
- package/lib/esm/dev-app.js +22 -0
- package/lib/esm/dev-app.js.map +1 -1
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +3 -1
- package/lib/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/button/index.tsx +3 -2
- package/src/components/system-debug-trace/debug-message.tsx +3 -0
- package/src/components/system-debug-trace/events/ai-agent/ai-agent.tsx +1 -1
- package/src/components/system-debug-trace/events/ai-agent/parse-tools.ts +14 -2
- package/src/components/system-debug-trace/events/ai-agent-router/ai-agent-router.tsx +75 -0
- package/src/components/system-debug-trace/events/ai-agent-router/index.ts +2 -0
- package/src/components/system-debug-trace/events/ai-agent-router/types.ts +26 -0
- package/src/components/system-debug-trace/events/constants.ts +4 -0
- package/src/components/system-debug-trace/events/index.ts +1 -0
- package/src/components/system-debug-trace/hooks/use-last-label-position.ts +42 -32
- package/src/components/system-debug-trace/icons/ai-router.tsx +45 -0
- package/src/components/system-debug-trace/icons/index.ts +2 -0
- package/src/components/system-debug-trace/types.ts +2 -0
- package/src/debug-system-messages.ts +276 -0
- package/src/dev-app.jsx +24 -0
- package/src/index.ts +1 -0
package/lib/esm/dev-app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-app.js","sourceRoot":"","sources":["../../src/dev-app.jsx"],"names":[],"mappings":";;;;AAAA,6CAA6C;AAE7C,+CAAuC;AACvC,2CAAsC;AACtC,oCAAwC;AACxC,uDAAkD;AAClD,+CAA0C;AAE1C,MAAa,MAAO,SAAQ,wBAAU;IACpC,YAAY,EACV,KAAK,GAAG,EAAE,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,OAAO,EACP,UAAU,EACV,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,GAAG,UAAU,EACd;QACC,KAAK,CAAC;YACJ,KAAK;YACL,cAAc;YACd,cAAc;YACd,WAAW;YACX,iBAAiB;YACjB,iBAAiB;YACjB,eAAe;YACf,gBAAgB;YAChB,SAAS;YACT,MAAM;YACN,OAAO;YACP,UAAU;YACV,MAAM;YACN,MAAM;YACN,OAAO;YACP,SAAS;YACT,YAAY;SACb,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,GAAG,GAAG,IAA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AI,CAAC,SAAS,CAAC,IAAI,EAAE;gBACnB,MAAM,EAAE,qBAAO,CAAC,GAAG;gBACnB,OAAO,EAAE,CAAC;aACX,CAAC,CACH,CAAA;QACH,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"dev-app.js","sourceRoot":"","sources":["../../src/dev-app.jsx"],"names":[],"mappings":";;;;AAAA,wCAAqC;AACrC,6CAA6C;AAE7C,mEAA+D;AAC/D,+CAAuC;AACvC,2CAAsC;AACtC,oCAAwC;AACxC,uDAAkD;AAClD,+CAA0C;AAE1C,MAAa,MAAO,SAAQ,wBAAU;IACpC,YAAY,EACV,KAAK,GAAG,EAAE,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,OAAO,EACP,UAAU,EACV,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,GAAG,UAAU,EACd;QACC,KAAK,CAAC;YACJ,KAAK;YACL,cAAc;YACd,cAAc;YACd,WAAW;YACX,iBAAiB;YACjB,iBAAiB;YACjB,eAAe;YACf,gBAAgB;YAChB,SAAS;YACT,MAAM;YACN,OAAO;YACP,UAAU;YACV,MAAM;YACN,MAAM;YACN,OAAO;YACP,SAAS;YACT,YAAY;SACb,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,GAAG,GAAG,IAAI,oBAAQ,CAAC;YACtB,GAAG,UAAU;SACd,CAAC,CAAA;IACJ,CAAC;IAED,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,EAAE;QACtC,IAAI,EACF,KAAK,GAAG,EAAE,EACV,OAAO,EACP,UAAU,EACV,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ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AAC,EAAE,CACpB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;gBACnB,MAAM,EAAE,qBAAO,CAAC,GAAG;gBACnB,OAAO,EAAE,CAAC;aACX,CAAC,CACH,CAAA;QACH,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;CACF;AAvID,wBAuIC"}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { BotonicInputTester, BotonicOutputTester } from './botonic-tester';
|
|
2
2
|
export * from './components';
|
|
3
3
|
export * from './contexts';
|
|
4
|
+
export { DEBUG_SYSTEM_MESSAGES } from './debug-system-messages';
|
|
4
5
|
export { DevApp } from './dev-app';
|
|
5
6
|
export * from './index-types';
|
|
6
7
|
export { msgsToBotonic, msgToBotonic } from './msg-to-botonic';
|
package/lib/esm/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebviewApp = exports.WebchatApp = exports.NodeApp = exports.msgToBotonic = exports.msgsToBotonic = exports.DevApp = exports.BotonicOutputTester = exports.BotonicInputTester = void 0;
|
|
3
|
+
exports.WebviewApp = exports.WebchatApp = exports.NodeApp = exports.msgToBotonic = exports.msgsToBotonic = exports.DevApp = exports.DEBUG_SYSTEM_MESSAGES = exports.BotonicOutputTester = exports.BotonicInputTester = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var botonic_tester_1 = require("./botonic-tester");
|
|
6
6
|
Object.defineProperty(exports, "BotonicInputTester", { enumerable: true, get: function () { return botonic_tester_1.BotonicInputTester; } });
|
|
7
7
|
Object.defineProperty(exports, "BotonicOutputTester", { enumerable: true, get: function () { return botonic_tester_1.BotonicOutputTester; } });
|
|
8
8
|
tslib_1.__exportStar(require("./components"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./contexts"), exports);
|
|
10
|
+
var debug_system_messages_1 = require("./debug-system-messages");
|
|
11
|
+
Object.defineProperty(exports, "DEBUG_SYSTEM_MESSAGES", { enumerable: true, get: function () { return debug_system_messages_1.DEBUG_SYSTEM_MESSAGES; } });
|
|
10
12
|
var dev_app_1 = require("./dev-app");
|
|
11
13
|
Object.defineProperty(exports, "DevApp", { enumerable: true, get: function () { return dev_app_1.DevApp; } });
|
|
12
14
|
tslib_1.__exportStar(require("./index-types"), exports);
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,mDAA0E;AAAjE,oHAAA,kBAAkB,OAAA;AAAE,qHAAA,mBAAmB,OAAA;AAChD,uDAA4B;AAC5B,qDAA0B;AAC1B,qCAAkC;AAAzB,iGAAA,MAAM,OAAA;AACf,wDAA6B;AAC7B,mDAA8D;AAArD,+GAAA,aAAa,OAAA;AAAE,8GAAA,YAAY,OAAA;AACpC,uCAAoC;AAA3B,mGAAA,OAAO,OAAA;AAChB,iDAAsB;AACtB,oDAAyB;AACzB,6CAA0C;AAAjC,yGAAA,UAAU,OAAA;AACnB,6CAA0C;AAAjC,yGAAA,UAAU,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,mDAA0E;AAAjE,oHAAA,kBAAkB,OAAA;AAAE,qHAAA,mBAAmB,OAAA;AAChD,uDAA4B;AAC5B,qDAA0B;AAC1B,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,qCAAkC;AAAzB,iGAAA,MAAM,OAAA;AACf,wDAA6B;AAC7B,mDAA8D;AAArD,+GAAA,aAAa,OAAA;AAAE,8GAAA,YAAY,OAAA;AACpC,uCAAoC;AAA3B,mGAAA,OAAO,OAAA;AAChB,iDAAsB;AACtB,oDAAyB;AACzB,6CAA0C;AAAjC,yGAAA,UAAU,OAAA;AACnB,6CAA0C;AAAjC,yGAAA,UAAU,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Build Chatbots using React",
|
|
6
6
|
"main": "./lib/cjs",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"format": "biome format --write src/ tests/"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@botonic/core": "^0.
|
|
24
|
-
"axios": "^1.
|
|
23
|
+
"@botonic/core": "^0.49.0-alpha.0",
|
|
24
|
+
"axios": "^1.15.2",
|
|
25
25
|
"emoji-picker-react": "^4.12.0",
|
|
26
26
|
"lodash.merge": "^4.6.2",
|
|
27
27
|
"markdown-it": "^12.3.2",
|
|
@@ -44,8 +44,9 @@ export const Button = (props: ButtonProps) => {
|
|
|
44
44
|
payload: props.payload,
|
|
45
45
|
})
|
|
46
46
|
} else if (props.url) {
|
|
47
|
-
const defaultTarget =
|
|
48
|
-
|
|
47
|
+
const defaultTarget = props.target || '_blank'
|
|
48
|
+
const target = isInWebviewApp() ? '_self' : defaultTarget
|
|
49
|
+
window.open(props.url, target)
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
if (props.onClick) {
|
|
@@ -5,6 +5,7 @@ import { useContext, useEffect, useRef, useState } from 'react'
|
|
|
5
5
|
import { WebchatContext } from '../../webchat/context'
|
|
6
6
|
import {
|
|
7
7
|
getAiAgentEventConfig,
|
|
8
|
+
getAiAgentRouterEventConfig,
|
|
8
9
|
getBotActionEventConfig,
|
|
9
10
|
getConditionalChannelEventConfig,
|
|
10
11
|
getConditionalCountryEventConfig,
|
|
@@ -43,6 +44,8 @@ const getEventConfig = (
|
|
|
43
44
|
return getHandoffSuccessEventConfig(debugEvent)
|
|
44
45
|
case EventAction.AiAgent:
|
|
45
46
|
return getAiAgentEventConfig(debugEvent)
|
|
47
|
+
case EventAction.AiAgentRouter:
|
|
48
|
+
return getAiAgentRouterEventConfig(debugEvent)
|
|
46
49
|
case EventAction.Knowledgebase:
|
|
47
50
|
return getKnowledgeBaseEventConfig(debugEvent)
|
|
48
51
|
case EventAction.Fallback:
|
|
@@ -2,7 +2,12 @@ import type { ToolExecuted } from './types'
|
|
|
2
2
|
|
|
3
3
|
export const RETRIEVE_KNOWLEDGE_TOOL = 'retrieve_knowledge'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const TRANSFER_TOOL_PREFIX = 'transfer_to_'
|
|
6
|
+
|
|
7
|
+
export function parseTools(
|
|
8
|
+
tools: ToolExecuted[],
|
|
9
|
+
excludeTransferTools = false
|
|
10
|
+
) {
|
|
6
11
|
const result = {
|
|
7
12
|
retrieveKnowledgeTools: [] as ToolExecuted[],
|
|
8
13
|
otherTools: [] as ToolExecuted[],
|
|
@@ -13,7 +18,14 @@ export function parseTools(tools: ToolExecuted[]) {
|
|
|
13
18
|
|
|
14
19
|
for (const tool of tools) {
|
|
15
20
|
if (tool.tool_name !== RETRIEVE_KNOWLEDGE_TOOL) {
|
|
16
|
-
|
|
21
|
+
if (
|
|
22
|
+
!(
|
|
23
|
+
excludeTransferTools &&
|
|
24
|
+
tool.tool_name.startsWith(TRANSFER_TOOL_PREFIX)
|
|
25
|
+
)
|
|
26
|
+
) {
|
|
27
|
+
result.otherTools.push(tool)
|
|
28
|
+
}
|
|
17
29
|
continue
|
|
18
30
|
}
|
|
19
31
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { EventAction } from '@botonic/core'
|
|
2
|
+
import { AiRouterSvg, HandSvg, HeadSetSvg } from '../../icons'
|
|
3
|
+
import {
|
|
4
|
+
StyledDebugDetail,
|
|
5
|
+
StyledDebugItemWithIcon,
|
|
6
|
+
StyledDebugLabel,
|
|
7
|
+
StyledDebugValue,
|
|
8
|
+
StyledGuardrailLabel,
|
|
9
|
+
StyledGuardrailValue,
|
|
10
|
+
} from '../../styles'
|
|
11
|
+
import type { DebugEventConfig } from '../../types'
|
|
12
|
+
import { LABELS } from '../constants'
|
|
13
|
+
import type { AiAgentRouterDebugEvent } from './types'
|
|
14
|
+
|
|
15
|
+
export const AiAgentRouter = ({
|
|
16
|
+
input_guardrails_triggered,
|
|
17
|
+
available_specialists,
|
|
18
|
+
is_transferred_to_specialist,
|
|
19
|
+
last_agent_name,
|
|
20
|
+
}: AiAgentRouterDebugEvent) => {
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
{available_specialists.length > 0 && (
|
|
24
|
+
<StyledDebugDetail data-line-end>
|
|
25
|
+
<StyledDebugLabel>{LABELS.SPECIALISTS_AVAILABLE}</StyledDebugLabel>
|
|
26
|
+
{available_specialists.map(h => (
|
|
27
|
+
<StyledDebugItemWithIcon key={h.name}>
|
|
28
|
+
<HeadSetSvg />
|
|
29
|
+
{h.name}
|
|
30
|
+
</StyledDebugItemWithIcon>
|
|
31
|
+
))}
|
|
32
|
+
</StyledDebugDetail>
|
|
33
|
+
)}
|
|
34
|
+
|
|
35
|
+
<StyledDebugDetail>
|
|
36
|
+
{is_transferred_to_specialist ? (
|
|
37
|
+
<StyledDebugValue>
|
|
38
|
+
{LABELS.TRANSFERRED_TO}{' '}
|
|
39
|
+
<span style={{ fontWeight: 400 }}>- {last_agent_name}</span>
|
|
40
|
+
</StyledDebugValue>
|
|
41
|
+
) : input_guardrails_triggered.length > 0 ? (
|
|
42
|
+
<>
|
|
43
|
+
{input_guardrails_triggered.map(guardrail => (
|
|
44
|
+
<StyledDebugItemWithIcon key={`input-guardrail-${guardrail}`}>
|
|
45
|
+
<HandSvg />
|
|
46
|
+
<StyledGuardrailLabel>
|
|
47
|
+
{LABELS.GUARDRAIL_TRIGGERED}
|
|
48
|
+
</StyledGuardrailLabel>
|
|
49
|
+
<StyledGuardrailValue>- {guardrail}</StyledGuardrailValue>
|
|
50
|
+
</StyledDebugItemWithIcon>
|
|
51
|
+
))}
|
|
52
|
+
</>
|
|
53
|
+
) : (
|
|
54
|
+
<StyledDebugValue>{LABELS.NO_TRANSFER}</StyledDebugValue>
|
|
55
|
+
)}
|
|
56
|
+
</StyledDebugDetail>
|
|
57
|
+
</>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const getAiAgentRouterEventConfig = (
|
|
62
|
+
data: AiAgentRouterDebugEvent
|
|
63
|
+
): DebugEventConfig => {
|
|
64
|
+
return {
|
|
65
|
+
action: EventAction.AiAgentRouter,
|
|
66
|
+
title: (
|
|
67
|
+
<>
|
|
68
|
+
Router triggered <span>- {data.flow_node_content_id}</span>
|
|
69
|
+
</>
|
|
70
|
+
),
|
|
71
|
+
component: AiAgentRouter,
|
|
72
|
+
icon: <AiRouterSvg />,
|
|
73
|
+
collapsible: true,
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { EventAction } from '@botonic/core'
|
|
2
|
+
import type { ToolExecuted } from '../ai-agent/types'
|
|
3
|
+
import type { ChunkIdsGroupedBySourceData } from '../knowledge-bases-types'
|
|
4
|
+
|
|
5
|
+
export type { ToolExecuted }
|
|
6
|
+
|
|
7
|
+
export interface SpecialistDebugEvent {
|
|
8
|
+
name: string
|
|
9
|
+
description: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AiAgentRouterDebugEvent {
|
|
13
|
+
action: EventAction.AiAgentRouter
|
|
14
|
+
flow_node_content_id: string
|
|
15
|
+
tools_executed: ToolExecuted[]
|
|
16
|
+
memory_length: number
|
|
17
|
+
input_guardrails_triggered: string[]
|
|
18
|
+
output_guardrails_triggered: string[]
|
|
19
|
+
exit: boolean
|
|
20
|
+
starting_agent_name: string
|
|
21
|
+
last_agent_name: string
|
|
22
|
+
available_specialists: SpecialistDebugEvent[]
|
|
23
|
+
is_transferred_to_specialist: boolean
|
|
24
|
+
knowledge_base_chunks_with_sources?: ChunkIdsGroupedBySourceData[]
|
|
25
|
+
messageId?: string
|
|
26
|
+
}
|
|
@@ -25,4 +25,8 @@ export const LABELS = {
|
|
|
25
25
|
OPEN: 'Open',
|
|
26
26
|
CLOSED: 'Closed',
|
|
27
27
|
AGENTS_AVAILABLE: 'Agents available',
|
|
28
|
+
AVAILABLE_TRANSFERS: 'Available transfers',
|
|
29
|
+
SPECIALISTS_AVAILABLE: 'Specialists available',
|
|
30
|
+
NO_TRANSFER: 'No transfer',
|
|
31
|
+
TRANSFERRED_TO: 'Transferred to',
|
|
28
32
|
} as const
|
|
@@ -38,43 +38,53 @@ export function useLastLabelPosition({
|
|
|
38
38
|
return
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (el.tagName === 'STRONG') {
|
|
47
|
-
return true
|
|
48
|
-
}
|
|
41
|
+
// If an explicit line-end marker exists, use its bottom edge
|
|
42
|
+
const lineEndMarker =
|
|
43
|
+
wrapper.querySelector<HTMLElement>('[data-line-end]')
|
|
44
|
+
|
|
45
|
+
let labelBottomPosition: number
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
if (lineEndMarker) {
|
|
48
|
+
const wrapperTop = wrapper.getBoundingClientRect().top
|
|
49
|
+
labelBottomPosition =
|
|
50
|
+
lineEndMarker.getBoundingClientRect().bottom - wrapperTop
|
|
51
|
+
} else {
|
|
52
|
+
// Find all label elements in order (both <strong> for DebugLabel and <span> for GuardrailLabel)
|
|
53
|
+
// We need to get them in DOM order to find the actual last one
|
|
54
|
+
const allElements =
|
|
55
|
+
wrapper.querySelectorAll<HTMLElement>('strong, span')
|
|
56
|
+
const allLabels = Array.from(allElements).filter(el => {
|
|
57
|
+
// Include all <strong> elements (they're DebugLabels)
|
|
58
|
+
if (el.tagName === 'STRONG') {
|
|
59
|
+
return true
|
|
62
60
|
}
|
|
63
|
-
}
|
|
64
|
-
return false
|
|
65
|
-
})
|
|
66
61
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
// For <span>, only include if it's a direct child of a flex container (GuardrailLabel pattern)
|
|
63
|
+
// and has no child elements (just text)
|
|
64
|
+
if (
|
|
65
|
+
el.tagName === 'SPAN' &&
|
|
66
|
+
el.children.length === 0 &&
|
|
67
|
+
el.textContent?.trim()
|
|
68
|
+
) {
|
|
69
|
+
const parent = el.parentElement
|
|
70
|
+
if (parent) {
|
|
71
|
+
const parentStyle = window.getComputedStyle(parent)
|
|
72
|
+
// GuardrailItem has display: flex
|
|
73
|
+
return parentStyle.display === 'flex'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return false
|
|
77
|
+
})
|
|
70
78
|
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
if (allLabels.length === 0) {
|
|
80
|
+
return
|
|
81
|
+
}
|
|
73
82
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
const lastLabel = allLabels[allLabels.length - 1]
|
|
84
|
+
const wrapperTop = wrapper.getBoundingClientRect().top
|
|
85
|
+
labelBottomPosition =
|
|
86
|
+
lastLabel.getBoundingClientRect().bottom - wrapperTop
|
|
87
|
+
}
|
|
78
88
|
|
|
79
89
|
// Set CSS variable for line height calculation
|
|
80
90
|
wrapper.style.setProperty(
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const AiRouterSvg = () => {
|
|
2
|
+
return (
|
|
3
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: This is a SVG icon
|
|
4
|
+
<svg
|
|
5
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
6
|
+
width='18'
|
|
7
|
+
height='18'
|
|
8
|
+
viewBox='0 0 18 18'
|
|
9
|
+
fill='none'
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
d='M3.93749 3.63077C4.42648 3.63077 4.85794 3.22807 4.85794 2.71032C4.85794 2.22132 4.42648 1.78986 3.93749 1.78986C3.41974 1.78986 3.01703 2.22132 3.01703 2.71032C3.01703 3.22807 3.41974 3.63077 3.93749 3.63077ZM6.23863 2.71032C6.23863 3.74582 5.54828 4.63752 4.62783 4.92516V7.77282C5.20312 7.34136 5.92222 7.08248 6.69885 7.08248H9.46022C10.582 7.08248 11.5313 6.16202 11.5313 5.01145V4.92516C10.582 4.63752 9.92044 3.74582 9.92044 2.71032C9.92044 1.44469 10.9272 0.40918 12.2216 0.40918C13.4872 0.40918 14.5227 1.44469 14.5227 2.71032C14.5227 3.74582 13.8323 4.63752 12.9119 4.92516V5.01145C12.9119 6.93865 11.3586 8.4632 9.46022 8.4632H6.69885C5.54828 8.4632 4.62783 9.41237 4.62783 10.5342V10.6492C5.54828 10.9369 6.23863 11.8285 6.23863 12.8353C6.23863 14.1297 5.20312 15.1365 3.93749 15.1365C2.6431 15.1365 1.63635 14.1297 1.63635 12.8353C1.63635 11.8285 2.29793 10.9369 3.24715 10.6492V10.5342V4.92516C2.29793 4.63752 1.63635 3.74582 1.63635 2.71032C1.63635 1.44469 2.6431 0.40918 3.93749 0.40918C5.20312 0.40918 6.23863 1.44469 6.23863 2.71032ZM13.142 2.71032C13.142 2.22132 12.7106 1.78986 12.2216 1.78986C11.7038 1.78986 11.3011 2.22132 11.3011 2.71032C11.3011 3.22807 11.7038 3.63077 12.2216 3.63077C12.7106 3.63077 13.142 3.22807 13.142 2.71032ZM3.93749 13.7558C4.42648 13.7558 4.85794 13.3531 4.85794 12.8353C4.85794 12.3463 4.42648 11.9149 3.93749 11.9149C3.41974 11.9149 3.01703 12.3463 3.01703 12.8353C3.01703 13.3531 3.41974 13.7558 3.93749 13.7558Z'
|
|
13
|
+
fill='url(#ai-router-gradient-0)'
|
|
14
|
+
/>
|
|
15
|
+
<path
|
|
16
|
+
d='M12.5839 10.0164C12.5285 9.89486 12.4069 9.81812 12.2748 9.81812C12.1427 9.81812 12.0211 9.89486 11.9657 10.0164L10.8337 12.4672L8.38215 13.5989C8.25851 13.6565 8.18176 13.778 8.18176 13.9101C8.18176 14.0422 8.25851 14.1637 8.38002 14.2191L10.8316 15.3508L11.9636 17.8017C12.019 17.9232 12.1405 17.9999 12.2727 17.9999C12.4048 17.9999 12.5264 17.9232 12.5818 17.8017L13.7137 15.3508L16.1653 14.2191C16.2868 14.1637 16.3636 14.0422 16.3636 13.9101C16.3636 13.778 16.2868 13.6565 16.1653 13.6011L13.7137 12.4694L12.5818 10.0185L12.5839 10.0164Z'
|
|
17
|
+
fill='url(#ai-router-gradient-1)'
|
|
18
|
+
/>
|
|
19
|
+
<defs>
|
|
20
|
+
<linearGradient
|
|
21
|
+
id='ai-router-gradient-0'
|
|
22
|
+
x1='1.63635'
|
|
23
|
+
y1='7.77282'
|
|
24
|
+
x2='14.5227'
|
|
25
|
+
y2='7.77282'
|
|
26
|
+
gradientUnits='userSpaceOnUse'
|
|
27
|
+
>
|
|
28
|
+
<stop stopColor='#6E49FF' />
|
|
29
|
+
<stop offset='1' stopColor='#CC3559' />
|
|
30
|
+
</linearGradient>
|
|
31
|
+
<linearGradient
|
|
32
|
+
id='ai-router-gradient-1'
|
|
33
|
+
x1='8.18176'
|
|
34
|
+
y1='13.909'
|
|
35
|
+
x2='16.3636'
|
|
36
|
+
y2='13.909'
|
|
37
|
+
gradientUnits='userSpaceOnUse'
|
|
38
|
+
>
|
|
39
|
+
<stop stopColor='#6E49FF' />
|
|
40
|
+
<stop offset='1' stopColor='#CC3559' />
|
|
41
|
+
</linearGradient>
|
|
42
|
+
</defs>
|
|
43
|
+
</svg>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './ai-router'
|
|
1
2
|
export * from './brain'
|
|
2
3
|
export * from './caret-down'
|
|
3
4
|
export * from './caret-up'
|
|
@@ -10,4 +11,5 @@ export * from './life-ring'
|
|
|
10
11
|
export * from './link'
|
|
11
12
|
export * from './quote-right'
|
|
12
13
|
export * from './screwdriver-wrench'
|
|
14
|
+
export * from './split'
|
|
13
15
|
export * from './wand'
|
|
@@ -2,6 +2,7 @@ import type React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
AiAgentDebugEvent,
|
|
5
|
+
AiAgentRouterDebugEvent,
|
|
5
6
|
BotActionDebugEvent,
|
|
6
7
|
ConditionalChannelDebugEvent,
|
|
7
8
|
ConditionalCountryDebugEvent,
|
|
@@ -24,6 +25,7 @@ export interface IconProps {
|
|
|
24
25
|
export type DebugEvent =
|
|
25
26
|
| KeywordDebugEvent
|
|
26
27
|
| AiAgentDebugEvent
|
|
28
|
+
| AiAgentRouterDebugEvent
|
|
27
29
|
| KnowledgeBaseDebugEvent
|
|
28
30
|
| FallbackDebugEvent
|
|
29
31
|
| SmartIntentDebugEvent
|