@agent-native/toolkit 0.198.2 → 0.198.3-nightly-20260930154911
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/dist/app/agentkit/react/components.d.ts.map +1 -1
- package/dist/app/agentkit/react/components.js +13 -5
- package/dist/app/agentkit/react/components.js.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.js +20 -6
- package/dist/app/chat/AgentKitAssistantChat.js.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.js +211 -0
- package/dist/app/i18n/catalogs/ar-SA.js.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.js +147 -0
- package/dist/app/i18n/catalogs/de-DE.js.map +1 -1
- package/dist/app/i18n/catalogs/en-US.d.ts +147 -0
- package/dist/app/i18n/catalogs/en-US.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/en-US.js +147 -0
- package/dist/app/i18n/catalogs/en-US.js.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.js +163 -0
- package/dist/app/i18n/catalogs/es-ES.js.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.js +163 -0
- package/dist/app/i18n/catalogs/fr-FR.js.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.js +147 -0
- package/dist/app/i18n/catalogs/hi-IN.js.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.js +131 -0
- package/dist/app/i18n/catalogs/ja-JP.js.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.js +131 -0
- package/dist/app/i18n/catalogs/ko-KR.js.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.js +163 -0
- package/dist/app/i18n/catalogs/pt-BR.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.js +131 -0
- package/dist/app/i18n/catalogs/zh-CN.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.js +131 -0
- package/dist/app/i18n/catalogs/zh-TW.js.map +1 -1
- package/dist/app/observability/ObservabilityDashboard.d.ts.map +1 -1
- package/dist/app/observability/ObservabilityDashboard.js +101 -109
- package/dist/app/observability/ObservabilityDashboard.js.map +1 -1
- package/dist/app/observability/RunInsights.d.ts +22 -0
- package/dist/app/observability/RunInsights.d.ts.map +1 -0
- package/dist/app/observability/RunInsights.js +658 -0
- package/dist/app/observability/RunInsights.js.map +1 -0
- package/dist/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/composer/RealtimeVoiceMode.js +1 -1
- package/dist/composer/RealtimeVoiceMode.js.map +1 -1
- package/package.json +5 -5
- package/src/app/agent-page/ConnectionsTab.spec.tsx +0 -3
- package/src/app/agentkit/react/components.spec.tsx +2 -1
- package/src/app/agentkit/react/components.tsx +14 -5
- package/src/app/agentkit/react/composer-context.spec.tsx +4 -1
- package/src/app/agentkit/react/suggestions.spec.tsx +51 -1
- package/src/app/chat/AgentKitAssistantChat.spec.tsx +57 -0
- package/src/app/chat/AgentKitAssistantChat.tsx +44 -8
- package/src/app/chat/AgentPanel.header.spec.ts +22 -22
- package/src/app/chat/agentkit-chat/action-widget.spec.tsx +17 -2
- package/src/app/chat/agentkit-chat/approval-card.spec.tsx +2 -2
- package/src/app/chat/agentkit-chat/connections.spec.tsx +1 -1
- package/src/app/chat/chat/markdown-renderer.spec.tsx +1 -1
- package/src/app/chat/chat/tool-call-display.spec.tsx +25 -2
- package/src/app/chat/chat/widgets/DataTableWidget.spec.tsx +38 -26
- package/src/app/chat/chat/widgets/agent-team-progress-widget.spec.tsx +7 -1
- package/src/app/chat/chat/widgets/builtin-connect-required-renderer.spec.tsx +24 -1
- package/src/app/chat/chat/widgets/record-change-widget.spec.tsx +16 -1
- package/src/app/chat/thinking-display.spec.tsx +1 -1
- package/src/app/db-admin/useAgentSync.spec.tsx +1 -1
- package/src/app/extensions/ExtensionViewer.spec.tsx +2 -1
- package/src/app/i18n/catalogs/ar-SA.ts +282 -0
- package/src/app/i18n/catalogs/de-DE.ts +198 -0
- package/src/app/i18n/catalogs/en-US.ts +187 -0
- package/src/app/i18n/catalogs/es-ES.ts +221 -0
- package/src/app/i18n/catalogs/fr-FR.ts +219 -0
- package/src/app/i18n/catalogs/hi-IN.ts +182 -0
- package/src/app/i18n/catalogs/ja-JP.ts +160 -0
- package/src/app/i18n/catalogs/ko-KR.ts +160 -0
- package/src/app/i18n/catalogs/pt-BR.ts +220 -0
- package/src/app/i18n/catalogs/zh-CN.ts +154 -0
- package/src/app/i18n/catalogs/zh-TW.ts +154 -0
- package/src/app/integrations/BuilderIntegrationPage.spec.tsx +3 -3
- package/src/app/integrations/ChannelsPage.spec.tsx +3 -3
- package/src/app/integrations/IntegrationsPage.spec.tsx +3 -3
- package/src/app/integrations/IntegrationsPanel.spec.tsx +7 -4
- package/src/app/observability/ObservabilityDashboard.review.spec.tsx +211 -52
- package/src/app/observability/ObservabilityDashboard.spec.tsx +80 -20
- package/src/app/observability/ObservabilityDashboard.tsx +240 -400
- package/src/app/observability/RunInsights.tsx +1603 -0
- package/src/app/observability/ThumbsFeedback.spec.tsx +29 -12
- package/src/app/onboarding/FirstRunOnboarding.spec.tsx +25 -5
- package/src/app/onboarding/first-run-startup-gate.spec.tsx +12 -7
- package/src/app/resources/McpConnectionSuggestion.render.spec.tsx +43 -5
- package/src/app/resources/McpIntegrationDialog.spec.tsx +20 -14
- package/src/app/resources/ResourcesPanel.spec.ts +9 -7
- package/src/app/review/ReviewThreadPanel.spec.tsx +2 -2
- package/src/app/settings/SecretsSection.spec.tsx +12 -3
- package/src/app/settings/SettingsTabsPage.spec.tsx +4 -1
- package/src/app/settings/VoiceTranscriptionSection.spec.tsx +12 -1
- package/src/app/settings/account/PreferencesSettings.spec.tsx +13 -1
- package/src/app/settings/account/ProfileSettings.spec.tsx +13 -1
- package/src/app/settings/account/SecuritySettings.spec.tsx +12 -1
- package/src/app/settings/shell/SettingsShell.spec.tsx +35 -15
- package/src/app/settings/shell/pages/app-group-pages.spec.tsx +7 -0
- package/src/app/settings/shell/pages/audit.spec.tsx +5 -2
- package/src/app/settings/shell/pages/resource-pages.spec.tsx +25 -16
- package/src/app/settings/shell/pages/sub-agents.spec.tsx +24 -15
- package/src/app/settings/usage/UsagePage.spec.tsx +4 -0
- package/src/app/setup-connections/BuilderConnectCard.spec.tsx +27 -8
- package/src/app/sharing/ShareButton.spec.tsx +7 -3
- package/src/app/sharing/ShareDialog.spec.tsx +4 -4
- package/src/app/sharing/useShareButtonController.spec.tsx +1 -1
- package/src/app/sharing/useShareDialogController.spec.tsx +2 -2
- package/src/app/transcription/BuilderTranscriptionCta.spec.tsx +1 -1
- package/src/composer/RealtimeVoiceMode.spec.tsx +1 -0
- package/src/composer/RealtimeVoiceMode.tsx +1 -5
|
@@ -1276,6 +1276,159 @@ const messages: ToolkitAgentChatTranslation = {
|
|
|
1276
1276
|
"usage.providerSpendDetail": "Builder 計費以外的供應商使用量或舊呼叫",
|
|
1277
1277
|
"usage.providerSpendToday": "今日其他或未分類的使用量:{{amount}}",
|
|
1278
1278
|
"usage.driverCreditsAndUsd": "Builder 點數 / USD",
|
|
1279
|
+
"observability.insights.verdictSmooth": "運作順暢",
|
|
1280
|
+
"observability.insights.verdictLook_other": "{{count}} 項值得關注",
|
|
1281
|
+
"observability.insights.verdictProblems_other": "{{count}} 個問題",
|
|
1282
|
+
"observability.insights.spentSummary_other":
|
|
1283
|
+
"過去 {{days}} 天內在 {{count}} 個提示詞上花費了 {{amount}}。",
|
|
1284
|
+
"observability.insights.handledLabel": "由 Agent-Native 處理:",
|
|
1285
|
+
"observability.insights.handledHeading": "由 Agent-Native 處理",
|
|
1286
|
+
"observability.insights.handledParallel":
|
|
1287
|
+
"同時執行了 {{count}} 個工具呼叫,比逐個執行快了約 {{duration}}。",
|
|
1288
|
+
"observability.insights.handledRecovered_other":
|
|
1289
|
+
"從 {{count}} 個工具錯誤中恢復,未中斷執行。",
|
|
1290
|
+
"observability.insights.avgPerPrompt": "每個提示詞的平均值",
|
|
1291
|
+
"observability.insights.completed": "已完成",
|
|
1292
|
+
"observability.insights.completedDetail": "最近 {{total}} 個中的 {{done}} 個",
|
|
1293
|
+
"observability.insights.completedRecovered_other":
|
|
1294
|
+
"從 {{count}} 個工具錯誤恢復後,最近 {{total}} 個中完成了 {{done}} 個",
|
|
1295
|
+
"observability.insights.typicalTime": "典型耗時",
|
|
1296
|
+
"observability.insights.median": "中位數",
|
|
1297
|
+
"observability.insights.sampleNote":
|
|
1298
|
+
"完成率、典型耗時、Agent-Native 處理的內容與發現均根據 {{total}} 則提示中最新的 {{shown}} 則。",
|
|
1299
|
+
"observability.insights.changeSame": "與上一週期相同",
|
|
1300
|
+
"observability.insights.changeUp": "↑ 較上一週期 {{percent}}%",
|
|
1301
|
+
"observability.insights.changeDown": "↓ 較上一週期 {{percent}}%",
|
|
1302
|
+
"observability.insights.kindProblem": "問題",
|
|
1303
|
+
"observability.insights.kindSaving": "可節省",
|
|
1304
|
+
"observability.insights.kindInfo": "小提示",
|
|
1305
|
+
"observability.insights.fixLabel": "修復方法:",
|
|
1306
|
+
"observability.insights.openPrompt": "開啟該提示詞",
|
|
1307
|
+
"observability.insights.seePrompts_other": "檢視這 {{count}} 個提示詞",
|
|
1308
|
+
"observability.insights.erroredTitle_other": "{{count}} 個提示詞以錯誤結束",
|
|
1309
|
+
"observability.insights.erroredBody": "代理在完成之前停止了。",
|
|
1310
|
+
"observability.insights.erroredFix": "開啟提示詞檢視它停止前執行的最後一步。",
|
|
1311
|
+
"observability.insights.toolFailedTitle_other":
|
|
1312
|
+
"{{tool}} 工具在 {{count}} 個提示詞中失敗",
|
|
1313
|
+
"observability.insights.toolFailedSaid": "它說:「{{error}}」",
|
|
1314
|
+
"observability.insights.toolFailedGeneric": "該工具報告了一個錯誤。",
|
|
1315
|
+
"observability.insights.toolRecoveredAll": "代理每次都成功恢復並完成了任務。",
|
|
1316
|
+
"observability.insights.toolRecoveredSome":
|
|
1317
|
+
"代理在其中 {{count}} 次恢復並完成了任務。",
|
|
1318
|
+
"observability.insights.restartTitle":
|
|
1319
|
+
"重新開始花費了約 {{amount}}(佔總支出的 {{percent}}%)",
|
|
1320
|
+
"observability.insights.restartBody":
|
|
1321
|
+
"在最近 {{total}} 個提示詞中的 {{count}} 個中,代理在{{reason}}後重新傳送了整段對話,而不是複用已傳送的內容。",
|
|
1322
|
+
"observability.insights.reasonToolLookup": "取得新工具",
|
|
1323
|
+
"observability.insights.reasonPrefixChanged": "指令開頭的內容發生了變化",
|
|
1324
|
+
"observability.insights.fixToolLookup":
|
|
1325
|
+
"使用 initialToolNames 預載入此應用所用的工具,讓工具列表在整個提示詞期間保持不變。",
|
|
1326
|
+
"observability.insights.fixPrefixChanged":
|
|
1327
|
+
"不要把時間戳或每步狀態等會變化的內容放進系統提示詞。",
|
|
1328
|
+
"observability.insights.priciestTitle":
|
|
1329
|
+
"有一個提示詞佔用了近期支出的 {{percent}}%",
|
|
1330
|
+
"observability.insights.priciestBody_other":
|
|
1331
|
+
"「{{prompt}}」耗費了 {{amount}},共 {{count}} 步。",
|
|
1332
|
+
"observability.insights.untitledPrompt": "未命名提示詞",
|
|
1333
|
+
"observability.insights.promptsHeading": "提示詞",
|
|
1334
|
+
"observability.insights.showing": "顯示 {{count}} 個",
|
|
1335
|
+
"observability.insights.sortNewest": "最新",
|
|
1336
|
+
"observability.insights.sortCost": "花費最高",
|
|
1337
|
+
"observability.insights.emptyPrompts":
|
|
1338
|
+
"此時間段內還沒有提示詞。完成後幾秒就會顯示在這裡。",
|
|
1339
|
+
"observability.insights.promptNotSaved": "提示詞文字未儲存",
|
|
1340
|
+
"observability.insights.ratedHelpful": "評為有幫助",
|
|
1341
|
+
"observability.insights.ratedUnhelpful": "評為沒有幫助",
|
|
1342
|
+
"observability.insights.notRated": "未評分",
|
|
1343
|
+
"observability.insights.stoppedWithError": "因錯誤而停止",
|
|
1344
|
+
"observability.insights.detailsUnavailable": "步驟詳情已不可用",
|
|
1345
|
+
"observability.insights.answered": "已回答",
|
|
1346
|
+
"observability.insights.finished": "已完成",
|
|
1347
|
+
"observability.insights.startedOverShort": "重新開始 {{count}}×",
|
|
1348
|
+
"observability.insights.recoveredShort_other":
|
|
1349
|
+
"從 {{count}} 個工具錯誤中恢復",
|
|
1350
|
+
"observability.insights.toolsFailedShort_other": "{{count}} 個工具失敗",
|
|
1351
|
+
"observability.insights.headerDuration": "耗時 {{duration}}",
|
|
1352
|
+
"observability.insights.stepsCount_other": "{{count}} 步",
|
|
1353
|
+
"observability.insights.whatItDid": "執行內容:",
|
|
1354
|
+
"observability.insights.replyNotSaved": "此提示詞的回覆文字未儲存。",
|
|
1355
|
+
"observability.insights.showAll": "顯示全部",
|
|
1356
|
+
"observability.insights.showLess": "收起",
|
|
1357
|
+
"observability.insights.moreTools": "+{{count}} 更多",
|
|
1358
|
+
"observability.insights.failedSuffix": "失敗",
|
|
1359
|
+
"observability.insights.timesCount": "{{label}} ×{{count}}",
|
|
1360
|
+
"observability.insights.startedOverNote_other":
|
|
1361
|
+
"在{{reason}}後重新開始了 {{count}} 次,共花費約 {{total}} 中的 {{amount}}。",
|
|
1362
|
+
"observability.insights.toolFailedNote_other":
|
|
1363
|
+
"{{tool}} 工具失敗了 {{count}} 次。",
|
|
1364
|
+
"observability.insights.toolFailedRecoveredNote_other":
|
|
1365
|
+
"{{tool}} 工具失敗了 {{count}} 次,但代理繼續執行並完成了任務。",
|
|
1366
|
+
"observability.insights.showSteps_other": "顯示這 {{count}} 步",
|
|
1367
|
+
"observability.insights.hideSteps": "隱藏步驟",
|
|
1368
|
+
"observability.insights.costDetails": "費用詳情與檢查",
|
|
1369
|
+
"observability.insights.turnReply": "撰寫了回覆",
|
|
1370
|
+
"observability.insights.turnThought": "進行了思考",
|
|
1371
|
+
"observability.insights.startedOverTag": "重新開始",
|
|
1372
|
+
"observability.insights.toolFailedTag": "工具失敗",
|
|
1373
|
+
"observability.insights.turnContext":
|
|
1374
|
+
"傳送了 {{tokens}} 個上下文 token,其中 {{percent}}% 來自此前的複用。",
|
|
1375
|
+
"observability.insights.turnExpired":
|
|
1376
|
+
"儲存的上下文在暫停後已過期,這是正常現象。",
|
|
1377
|
+
"observability.insights.turnOutput": "生成了 {{tokens}} 個 token。",
|
|
1378
|
+
"observability.insights.turnRestart":
|
|
1379
|
+
"在{{reason}}後重新開始,比複用上下文多花費約 {{amount}}。",
|
|
1380
|
+
"observability.insights.noCacheCompare":
|
|
1381
|
+
"按標準價格計算,複用此前的上下文使該提示詞的費用從 {{noCache}} 降至 {{estimated}}。",
|
|
1382
|
+
"observability.insights.partReused": "複用的上下文",
|
|
1383
|
+
"observability.insights.partSaved": "已快取",
|
|
1384
|
+
"observability.insights.partNew": "新上下文",
|
|
1385
|
+
"observability.insights.partOutput": "模型生成",
|
|
1386
|
+
"observability.insights.checksHeading": "自動檢查",
|
|
1387
|
+
"observability.insights.checksNone": "沒有記錄任何檢查。",
|
|
1388
|
+
"observability.insights.checksGraded": "(由模型評分)",
|
|
1389
|
+
"observability.insights.checksNote":
|
|
1390
|
+
"框架檢查關注執行過程本身(錯誤、步驟、速度),而不判斷結果是否理想。",
|
|
1391
|
+
"observability.insights.lookedForTools": "查找了更多工具",
|
|
1392
|
+
"observability.insights.prevPrompt": "上一個提示詞 (K)",
|
|
1393
|
+
"observability.insights.nextPrompt": "下一個提示詞 (J)",
|
|
1394
|
+
"observability.insights.toolVerb.add": "新增了 {{object}}",
|
|
1395
|
+
"observability.insights.toolVerb.analyze": "分析了 {{object}}",
|
|
1396
|
+
"observability.insights.toolVerb.apply": "套用了 {{object}}",
|
|
1397
|
+
"observability.insights.toolVerb.capture": "擷取了 {{object}}",
|
|
1398
|
+
"observability.insights.toolVerb.check": "檢查了 {{object}}",
|
|
1399
|
+
"observability.insights.toolVerb.connect": "連線了 {{object}}",
|
|
1400
|
+
"observability.insights.toolVerb.create": "建立了 {{object}}",
|
|
1401
|
+
"observability.insights.toolVerb.delete": "刪除了 {{object}}",
|
|
1402
|
+
"observability.insights.toolVerb.duplicate": "複製了 {{object}}",
|
|
1403
|
+
"observability.insights.toolVerb.edit": "編輯了 {{object}}",
|
|
1404
|
+
"observability.insights.toolVerb.export": "匯出了 {{object}}",
|
|
1405
|
+
"observability.insights.toolVerb.fetch": "取得了 {{object}}",
|
|
1406
|
+
"observability.insights.toolVerb.find": "找到了 {{object}}",
|
|
1407
|
+
"observability.insights.toolVerb.generate": "生成了 {{object}}",
|
|
1408
|
+
"observability.insights.toolVerb.index": "索引了 {{object}}",
|
|
1409
|
+
"observability.insights.toolVerb.insert": "插入了 {{object}}",
|
|
1410
|
+
"observability.insights.toolVerb.list": "列出了 {{object}}",
|
|
1411
|
+
"observability.insights.toolVerb.move": "移動了 {{object}}",
|
|
1412
|
+
"observability.insights.toolVerb.navigate": "導航到了 {{object}}",
|
|
1413
|
+
"observability.insights.toolVerb.open": "開啟了 {{object}}",
|
|
1414
|
+
"observability.insights.toolVerb.present": "展示了 {{object}}",
|
|
1415
|
+
"observability.insights.toolVerb.propose": "提出了 {{object}}",
|
|
1416
|
+
"observability.insights.toolVerb.query": "查詢了 {{object}}",
|
|
1417
|
+
"observability.insights.toolVerb.read": "讀取了 {{object}}",
|
|
1418
|
+
"observability.insights.toolVerb.remove": "移除了 {{object}}",
|
|
1419
|
+
"observability.insights.toolVerb.rename": "重新命名了 {{object}}",
|
|
1420
|
+
"observability.insights.toolVerb.reply": "回覆了 {{object}}",
|
|
1421
|
+
"observability.insights.toolVerb.resolve": "解決了 {{object}}",
|
|
1422
|
+
"observability.insights.toolVerb.run": "執行了 {{object}}",
|
|
1423
|
+
"observability.insights.toolVerb.save": "儲存了 {{object}}",
|
|
1424
|
+
"observability.insights.toolVerb.search": "搜尋了 {{object}}",
|
|
1425
|
+
"observability.insights.toolVerb.send": "傳送了 {{object}}",
|
|
1426
|
+
"observability.insights.toolVerb.set": "設定了 {{object}}",
|
|
1427
|
+
"observability.insights.toolVerb.take": "截取了 {{object}}",
|
|
1428
|
+
"observability.insights.toolVerb.update": "更新了 {{object}}",
|
|
1429
|
+
"observability.insights.toolVerb.upload": "上傳了 {{object}}",
|
|
1430
|
+
"observability.insights.toolVerb.view": "檢視了 {{object}}",
|
|
1431
|
+
"observability.insights.toolVerb.write": "寫入了 {{object}}",
|
|
1279
1432
|
"billing.builderCreditLimitTitle": "Builder 點數已用完",
|
|
1280
1433
|
"billing.builderCreditLimitEmailBody":
|
|
1281
1434
|
"由於您連結的 Builder 帳戶點數已用完,一項 AI 請求已停止。升級 Builder 方案即可繼續使用。",
|
|
@@ -2488,6 +2641,7 @@ const messages: ToolkitAgentChatTranslation = {
|
|
|
2488
2641
|
"settingsSubAgents.registryLink": "瀏覽 Global A2A Registry",
|
|
2489
2642
|
"settingsSubAgents.connectTitle": "連接 {{name}}",
|
|
2490
2643
|
"settingsSubAgents.close": "關閉",
|
|
2644
|
+
"observability.insights.rawTrace": "原始追蹤(所有 span 及其輸入與輸出)",
|
|
2491
2645
|
};
|
|
2492
2646
|
|
|
2493
2647
|
export default messages;
|
|
@@ -25,8 +25,8 @@ const actionMocks = vi.hoisted(() => ({
|
|
|
25
25
|
vi.mock("../settings/useBuilderStatus.js", () => ({
|
|
26
26
|
useBuilderConnectFlow: () => flowMock.current,
|
|
27
27
|
}));
|
|
28
|
-
vi.mock("
|
|
29
|
-
vi.mock("
|
|
28
|
+
vi.mock("@agent-native/core/client/use-action", () => actionMocks);
|
|
29
|
+
vi.mock("@agent-native/core/client/org/hooks", () => ({
|
|
30
30
|
useOrg: () => ({ data: { orgName: "Acme" } }),
|
|
31
31
|
}));
|
|
32
32
|
vi.mock("../settings/deferred-builder-connect-popover.js", () => ({
|
|
@@ -38,7 +38,7 @@ vi.mock("../settings/deferred-builder-connect-popover.js", () => ({
|
|
|
38
38
|
onConnect: (provisionAccount: boolean) => void;
|
|
39
39
|
}) => React.cloneElement(children, { onClick: () => onConnect(false) }),
|
|
40
40
|
}));
|
|
41
|
-
vi.mock("
|
|
41
|
+
vi.mock("@agent-native/core/client/i18n", () => ({
|
|
42
42
|
useT:
|
|
43
43
|
() =>
|
|
44
44
|
(key: string, options?: Record<string, unknown>): string => {
|
|
@@ -20,11 +20,11 @@ const actions = vi.hoisted(() => ({
|
|
|
20
20
|
}));
|
|
21
21
|
|
|
22
22
|
const agent = vi.hoisted(() => ({ submitToAgent: vi.fn() }));
|
|
23
|
-
vi.mock("../
|
|
23
|
+
vi.mock("../shared/index.js", () => agent);
|
|
24
24
|
|
|
25
25
|
// The hooks' transport belongs to the framework. The page's contract is which
|
|
26
26
|
// action it calls with what, and what it does with the answer.
|
|
27
|
-
vi.mock("
|
|
27
|
+
vi.mock("@agent-native/core/client/use-action", async () => {
|
|
28
28
|
const { useMutation, useQuery, useQueryClient } =
|
|
29
29
|
await import("@tanstack/react-query");
|
|
30
30
|
const call = (name: string, params: unknown) =>
|
|
@@ -53,7 +53,7 @@ vi.mock("../use-action.js", async () => {
|
|
|
53
53
|
};
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
vi.mock("
|
|
56
|
+
vi.mock("@agent-native/core/client/i18n", () => ({
|
|
57
57
|
useT:
|
|
58
58
|
() =>
|
|
59
59
|
(key: string, options?: Record<string, unknown>): string => {
|
|
@@ -24,13 +24,13 @@ const dialogMocks = vi.hoisted(() => ({
|
|
|
24
24
|
}));
|
|
25
25
|
|
|
26
26
|
vi.mock("../resources/McpIntegrationDialog.js", () => dialogMocks);
|
|
27
|
-
vi.mock("
|
|
27
|
+
vi.mock("@agent-native/core/client/resources/use-mcp-servers", () => mcpMocks);
|
|
28
28
|
vi.mock("../settings/useBuilderStatus.js", () => builderMocks);
|
|
29
|
-
vi.mock("
|
|
29
|
+
vi.mock("@agent-native/core/client/integrations/useIntegrationStatus", () => ({
|
|
30
30
|
useIntegrationStatus: () => ({ statuses: [], loading: false, refetch() {} }),
|
|
31
31
|
}));
|
|
32
32
|
|
|
33
|
-
vi.mock("
|
|
33
|
+
vi.mock("@agent-native/core/client/i18n", () => ({
|
|
34
34
|
useT:
|
|
35
35
|
() =>
|
|
36
36
|
(key: string, options?: Record<string, unknown>): string => {
|
|
@@ -22,7 +22,7 @@ vi.mock("../resources/McpIntegrationDialog.js", () => ({
|
|
|
22
22
|
McpIntegrationDialog: () => null,
|
|
23
23
|
}));
|
|
24
24
|
|
|
25
|
-
vi.mock("
|
|
25
|
+
vi.mock("@agent-native/core/client/resources/mcp-integration-catalog", () => ({
|
|
26
26
|
isMcpIntegrationCatalogAvailable: () => false,
|
|
27
27
|
getDefaultMcpIntegrations: () => [
|
|
28
28
|
{
|
|
@@ -54,11 +54,14 @@ vi.mock("../resources/mcp-integration-catalog.js", () => ({
|
|
|
54
54
|
],
|
|
55
55
|
}));
|
|
56
56
|
|
|
57
|
-
vi.mock("
|
|
57
|
+
vi.mock("@agent-native/core/client/resources/use-mcp-servers", () => mcpMocks);
|
|
58
58
|
|
|
59
|
-
vi.mock(
|
|
59
|
+
vi.mock(
|
|
60
|
+
"@agent-native/core/client/integrations/useIntegrationStatus",
|
|
61
|
+
() => integrationMocks,
|
|
62
|
+
);
|
|
60
63
|
|
|
61
|
-
vi.mock("
|
|
64
|
+
vi.mock("@agent-native/core/client/i18n", () => ({
|
|
62
65
|
useT: () => (key: string, options?: Record<string, unknown>) => {
|
|
63
66
|
const messages: Record<string, string> = {
|
|
64
67
|
"mcpIntegrations.connectionError": "Connection error",
|
|
@@ -12,7 +12,6 @@ const {
|
|
|
12
12
|
mockSubmitFeedback,
|
|
13
13
|
mockSaveInstructionUpdate,
|
|
14
14
|
mockSendToAgentChat,
|
|
15
|
-
mockTraces,
|
|
16
15
|
mockTraceDetail,
|
|
17
16
|
mockOpenThread,
|
|
18
17
|
mockUseActionQuery,
|
|
@@ -24,7 +23,6 @@ const {
|
|
|
24
23
|
mockSubmitFeedback: vi.fn(),
|
|
25
24
|
mockSaveInstructionUpdate: vi.fn(),
|
|
26
25
|
mockSendToAgentChat: vi.fn(),
|
|
27
|
-
mockTraces: vi.fn(),
|
|
28
26
|
mockTraceDetail: vi.fn(),
|
|
29
27
|
mockOpenThread: vi.fn(),
|
|
30
28
|
mockUseActionQuery: vi.fn(),
|
|
@@ -76,7 +74,6 @@ vi.mock("./useObservability.js", () => ({
|
|
|
76
74
|
},
|
|
77
75
|
isLoading: false,
|
|
78
76
|
}),
|
|
79
|
-
useTraces: (...args: unknown[]) => mockTraces(...args),
|
|
80
77
|
useTraceDetail: (...args: unknown[]) => mockTraceDetail(...args),
|
|
81
78
|
usePromoteTraceEval: () => ({
|
|
82
79
|
mutate: vi.fn(),
|
|
@@ -125,12 +122,15 @@ vi.mock("./useObservability.js", () => ({
|
|
|
125
122
|
|
|
126
123
|
import { AgentNativeI18nProvider } from "@agent-native/core/client/i18n";
|
|
127
124
|
|
|
125
|
+
import { createToolkitI18nCatalog } from "../i18n.js";
|
|
128
126
|
import {
|
|
129
127
|
ObservabilityDashboard,
|
|
130
128
|
resolveReviewArtifactHref,
|
|
131
129
|
resolveReviewArtifactOpenHref,
|
|
132
130
|
} from "./ObservabilityDashboard.js";
|
|
133
131
|
|
|
132
|
+
const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
|
|
133
|
+
|
|
134
134
|
describe("human review artifact links", () => {
|
|
135
135
|
it("keeps artifact links on the matching first-party app and environment", () => {
|
|
136
136
|
expect(
|
|
@@ -442,50 +442,84 @@ describe("ObservabilityDashboard human review", () => {
|
|
|
442
442
|
vi.unstubAllGlobals();
|
|
443
443
|
});
|
|
444
444
|
|
|
445
|
-
it("
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
445
|
+
it("explains a prompt in plain language and still exposes its raw spans and conversation", async () => {
|
|
446
|
+
const run = {
|
|
447
|
+
runId: "run-1",
|
|
448
|
+
threadId: "thread-1",
|
|
449
|
+
createdAt: Date.now(),
|
|
450
|
+
ownerEmail: "owner@example.com",
|
|
451
|
+
label: "chat",
|
|
452
|
+
model: "test-model",
|
|
453
|
+
prompt: "Find the latest releases",
|
|
454
|
+
status: "success",
|
|
455
|
+
tokens: {
|
|
456
|
+
inputTokens: 2,
|
|
457
|
+
outputTokens: 3,
|
|
458
|
+
cacheReadTokens: 0,
|
|
459
|
+
cacheWriteTokens: 0,
|
|
460
|
+
},
|
|
461
|
+
cost: {
|
|
462
|
+
cacheReadCents: 0,
|
|
463
|
+
cacheWriteCents: 0,
|
|
464
|
+
uncachedInputCents: 1,
|
|
465
|
+
outputCents: 1,
|
|
466
|
+
totalCents: 2,
|
|
467
|
+
estimatedCents: 2,
|
|
468
|
+
noCacheCents: 2,
|
|
469
|
+
},
|
|
470
|
+
modelCalls: 1,
|
|
471
|
+
tools: [
|
|
472
|
+
{ name: "search", calls: 1, failed: 0, error: null },
|
|
449
473
|
{
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
toolCalls: 1,
|
|
455
|
-
successfulTools: 1,
|
|
456
|
-
failedTools: 0,
|
|
457
|
-
totalDurationMs: 100,
|
|
458
|
-
totalCostCentsX100: 0,
|
|
459
|
-
totalInputTokens: 2,
|
|
460
|
-
totalOutputTokens: 3,
|
|
461
|
-
model: "test-model",
|
|
462
|
-
createdAt: Date.now(),
|
|
474
|
+
name: "broken-search",
|
|
475
|
+
calls: 1,
|
|
476
|
+
failed: 1,
|
|
477
|
+
error: "Search provider returned 503",
|
|
463
478
|
},
|
|
464
479
|
],
|
|
465
|
-
|
|
480
|
+
restarts: {
|
|
481
|
+
count: 0,
|
|
482
|
+
cents: 0,
|
|
483
|
+
byCause: {
|
|
484
|
+
"tool-lookup": { count: 0, cents: 0 },
|
|
485
|
+
"prefix-changed": { count: 0, cents: 0 },
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
parallel: { calls: 0, savedMs: 0 },
|
|
489
|
+
recoveredErrors: 1,
|
|
490
|
+
durationMs: 100,
|
|
491
|
+
feedback: null,
|
|
492
|
+
};
|
|
493
|
+
mockUseActionQuery.mockImplementation((actionName) =>
|
|
494
|
+
actionName === "get-usage-insights"
|
|
495
|
+
? {
|
|
496
|
+
data: {
|
|
497
|
+
sinceDays: 7,
|
|
498
|
+
current: { runs: 1, tokens: run.tokens, cost: run.cost },
|
|
499
|
+
previous: { runs: 0, tokens: run.tokens, cost: run.cost },
|
|
500
|
+
runs: [run],
|
|
501
|
+
},
|
|
502
|
+
}
|
|
503
|
+
: actionName === "get-usage-run"
|
|
504
|
+
? {
|
|
505
|
+
isLoading: false,
|
|
506
|
+
data: {
|
|
507
|
+
...run,
|
|
508
|
+
reply: "Here are the three latest releases.",
|
|
509
|
+
turns: [],
|
|
510
|
+
scores: [],
|
|
511
|
+
},
|
|
512
|
+
}
|
|
513
|
+
: { data: undefined, isError: false, isSuccess: false },
|
|
514
|
+
);
|
|
466
515
|
mockTraceDetail.mockReturnValue({
|
|
467
516
|
isLoading: false,
|
|
468
517
|
data: {
|
|
469
|
-
summary: {
|
|
470
|
-
runId: "run-1",
|
|
471
|
-
threadId: "thread-1",
|
|
472
|
-
totalSpans: 2,
|
|
473
|
-
llmCalls: 1,
|
|
474
|
-
toolCalls: 1,
|
|
475
|
-
successfulTools: 1,
|
|
476
|
-
failedTools: 0,
|
|
477
|
-
totalDurationMs: 100,
|
|
478
|
-
totalCostCentsX100: 0,
|
|
479
|
-
totalInputTokens: 2,
|
|
480
|
-
totalOutputTokens: 3,
|
|
481
|
-
model: "test-model",
|
|
482
|
-
createdAt: Date.now(),
|
|
483
|
-
},
|
|
518
|
+
summary: { runId: "run-1", threadId: "thread-1" },
|
|
484
519
|
spans: [
|
|
485
520
|
{
|
|
486
521
|
id: "span-success",
|
|
487
522
|
runId: "run-1",
|
|
488
|
-
orgId: "org-a",
|
|
489
523
|
threadId: "thread-1",
|
|
490
524
|
parentSpanId: null,
|
|
491
525
|
spanType: "tool_call",
|
|
@@ -529,13 +563,21 @@ describe("ObservabilityDashboard human review", () => {
|
|
|
529
563
|
await act(async () => {
|
|
530
564
|
root.render(
|
|
531
565
|
<QueryClientProvider client={queryClient}>
|
|
532
|
-
<AgentNativeI18nProvider
|
|
566
|
+
<AgentNativeI18nProvider
|
|
567
|
+
catalog={toolkitI18nCatalog}
|
|
568
|
+
persistPreference={false}
|
|
569
|
+
>
|
|
533
570
|
<ObservabilityDashboard />
|
|
534
571
|
</AgentNativeI18nProvider>
|
|
535
572
|
</QueryClientProvider>,
|
|
536
573
|
);
|
|
537
574
|
});
|
|
538
575
|
|
|
576
|
+
const buttonWithText = (text: string) =>
|
|
577
|
+
Array.from(document.querySelectorAll<HTMLButtonElement>("button")).find(
|
|
578
|
+
(button) => button.textContent?.includes(text),
|
|
579
|
+
);
|
|
580
|
+
|
|
539
581
|
const experimentsTab = Array.from(
|
|
540
582
|
container.querySelectorAll<HTMLButtonElement>("button"),
|
|
541
583
|
).find((button) => button.textContent?.includes("Experiments"));
|
|
@@ -552,33 +594,150 @@ describe("ObservabilityDashboard human review", () => {
|
|
|
552
594
|
container.querySelector<HTMLAnchorElement>('a[href*="#conversations"]'),
|
|
553
595
|
).toBeTruthy();
|
|
554
596
|
|
|
555
|
-
|
|
556
|
-
|
|
597
|
+
await act(async () => buttonWithText("Find the latest releases")?.click());
|
|
598
|
+
expect(document.body.textContent).toContain(
|
|
599
|
+
"Here are the three latest releases.",
|
|
600
|
+
);
|
|
601
|
+
expect(document.body.textContent).toContain(
|
|
602
|
+
"but the agent kept going and finished",
|
|
557
603
|
);
|
|
558
|
-
await act(async () => (runRow as HTMLTableRowElement | undefined)?.click());
|
|
559
604
|
|
|
605
|
+
await act(async () => buttonWithText("Raw trace")?.click());
|
|
560
606
|
const detailsButton = (spanName: string) =>
|
|
561
607
|
Array.from(
|
|
562
|
-
|
|
608
|
+
document.querySelectorAll<HTMLButtonElement>(
|
|
563
609
|
'button[aria-label="View details"]',
|
|
564
610
|
),
|
|
565
611
|
).find((button) => button.closest("tr")?.textContent?.includes(spanName));
|
|
566
612
|
|
|
567
613
|
await act(async () => detailsButton("search")?.click());
|
|
568
|
-
expect(
|
|
569
|
-
expect(
|
|
614
|
+
expect(document.body.textContent).toContain('"latest releases"');
|
|
615
|
+
expect(document.body.textContent).toContain("Found 3 results");
|
|
570
616
|
|
|
571
617
|
await act(async () => detailsButton("broken-search")?.click());
|
|
572
|
-
expect(
|
|
618
|
+
expect(document.body.textContent).toContain("Search provider returned 503");
|
|
573
619
|
|
|
574
|
-
await act(async () =>
|
|
575
|
-
Array.from(container.querySelectorAll<HTMLButtonElement>("button"))
|
|
576
|
-
.find((button) =>
|
|
577
|
-
button.textContent?.includes("Open full conversation"),
|
|
578
|
-
)
|
|
579
|
-
?.click(),
|
|
580
|
-
);
|
|
620
|
+
await act(async () => buttonWithText("Open full conversation")?.click());
|
|
581
621
|
expect(mockOpenThread).toHaveBeenCalledWith({ threadId: "thread-1" });
|
|
622
|
+
expect(buttonWithText("Open full conversation")).toBeUndefined();
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
it("reports a failed insights load with a retry instead of loading forever", async () => {
|
|
626
|
+
const refetch = vi.fn();
|
|
627
|
+
mockUseActionQuery.mockImplementation((actionName) =>
|
|
628
|
+
actionName === "get-usage-insights"
|
|
629
|
+
? {
|
|
630
|
+
data: undefined,
|
|
631
|
+
isError: true,
|
|
632
|
+
isSuccess: false,
|
|
633
|
+
isFetching: false,
|
|
634
|
+
refetch,
|
|
635
|
+
}
|
|
636
|
+
: { data: undefined, isError: false, isSuccess: false },
|
|
637
|
+
);
|
|
638
|
+
|
|
639
|
+
await act(async () => {
|
|
640
|
+
root.render(
|
|
641
|
+
<QueryClientProvider client={queryClient}>
|
|
642
|
+
<AgentNativeI18nProvider
|
|
643
|
+
catalog={toolkitI18nCatalog}
|
|
644
|
+
persistPreference={false}
|
|
645
|
+
>
|
|
646
|
+
<ObservabilityDashboard />
|
|
647
|
+
</AgentNativeI18nProvider>
|
|
648
|
+
</QueryClientProvider>,
|
|
649
|
+
);
|
|
650
|
+
});
|
|
651
|
+
expect(container.querySelector('[role="alert"]')?.textContent).toBe(
|
|
652
|
+
"Couldn't load this. Please try again.",
|
|
653
|
+
);
|
|
654
|
+
|
|
655
|
+
const buttonWithText = (text: string) =>
|
|
656
|
+
Array.from(container.querySelectorAll("button")).find((button) =>
|
|
657
|
+
button.textContent?.includes(text),
|
|
658
|
+
);
|
|
659
|
+
await act(async () => buttonWithText("Retry")?.click());
|
|
660
|
+
expect(refetch).toHaveBeenCalledTimes(1);
|
|
661
|
+
|
|
662
|
+
await act(async () => activateTab(buttonWithText("Conversations")));
|
|
663
|
+
expect(container.querySelector('[role="alert"]')?.textContent).toBe(
|
|
664
|
+
"Couldn't load this. Please try again.",
|
|
665
|
+
);
|
|
666
|
+
expect(buttonWithText("Retry")).toBeTruthy();
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
it("says the overview stats cover only the latest prompts when the period has more", async () => {
|
|
670
|
+
const tokens = {
|
|
671
|
+
inputTokens: 2,
|
|
672
|
+
outputTokens: 3,
|
|
673
|
+
cacheReadTokens: 0,
|
|
674
|
+
cacheWriteTokens: 0,
|
|
675
|
+
};
|
|
676
|
+
const cost = {
|
|
677
|
+
cacheReadCents: 0,
|
|
678
|
+
cacheWriteCents: 0,
|
|
679
|
+
uncachedInputCents: 1,
|
|
680
|
+
outputCents: 1,
|
|
681
|
+
totalCents: 2,
|
|
682
|
+
estimatedCents: 2,
|
|
683
|
+
noCacheCents: 2,
|
|
684
|
+
};
|
|
685
|
+
mockUseActionQuery.mockImplementation((actionName) =>
|
|
686
|
+
actionName === "get-usage-insights"
|
|
687
|
+
? {
|
|
688
|
+
data: {
|
|
689
|
+
sinceDays: 7,
|
|
690
|
+
current: { runs: 30, tokens, cost },
|
|
691
|
+
previous: { runs: 0, tokens, cost },
|
|
692
|
+
runs: [
|
|
693
|
+
{
|
|
694
|
+
runId: "run-1",
|
|
695
|
+
threadId: "thread-1",
|
|
696
|
+
createdAt: Date.now(),
|
|
697
|
+
ownerEmail: "owner@example.com",
|
|
698
|
+
label: "chat",
|
|
699
|
+
model: "test-model",
|
|
700
|
+
prompt: "Find the latest releases",
|
|
701
|
+
status: "success",
|
|
702
|
+
tokens,
|
|
703
|
+
cost,
|
|
704
|
+
modelCalls: 1,
|
|
705
|
+
tools: [],
|
|
706
|
+
restarts: {
|
|
707
|
+
count: 0,
|
|
708
|
+
cents: 0,
|
|
709
|
+
byCause: {
|
|
710
|
+
"tool-lookup": { count: 0, cents: 0 },
|
|
711
|
+
"prefix-changed": { count: 0, cents: 0 },
|
|
712
|
+
},
|
|
713
|
+
},
|
|
714
|
+
parallel: { calls: 0, savedMs: 0 },
|
|
715
|
+
recoveredErrors: 0,
|
|
716
|
+
durationMs: 100,
|
|
717
|
+
feedback: null,
|
|
718
|
+
},
|
|
719
|
+
],
|
|
720
|
+
},
|
|
721
|
+
}
|
|
722
|
+
: { data: undefined, isError: false, isSuccess: false },
|
|
723
|
+
);
|
|
724
|
+
|
|
725
|
+
await act(async () => {
|
|
726
|
+
root.render(
|
|
727
|
+
<QueryClientProvider client={queryClient}>
|
|
728
|
+
<AgentNativeI18nProvider
|
|
729
|
+
catalog={toolkitI18nCatalog}
|
|
730
|
+
persistPreference={false}
|
|
731
|
+
>
|
|
732
|
+
<ObservabilityDashboard />
|
|
733
|
+
</AgentNativeI18nProvider>
|
|
734
|
+
</QueryClientProvider>,
|
|
735
|
+
);
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
expect(container.textContent).toContain(
|
|
739
|
+
"Completion, typical time, what Agent-Native handled and the findings use the latest 1 of 30 prompts.",
|
|
740
|
+
);
|
|
582
741
|
});
|
|
583
742
|
|
|
584
743
|
it("hides organization human review outside the admin settings surface", async () => {
|