@agent-native/toolkit 0.201.1 → 0.202.0-nightly-20261006033736
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/agent-native.eject.json +39 -12
- package/dist/app/agentkit/react/components.d.ts.map +1 -1
- package/dist/app/agentkit/react/components.js +292 -23
- package/dist/app/agentkit/react/components.js.map +1 -1
- package/dist/app/agentkit/react/context.d.ts +5 -0
- package/dist/app/agentkit/react/context.d.ts.map +1 -1
- package/dist/app/agentkit/react/context.js +5 -0
- package/dist/app/agentkit/react/context.js.map +1 -1
- package/dist/app/agentkit/react/styles.css +78 -3
- package/dist/app/auth/AuthPage.d.ts.map +1 -1
- package/dist/app/auth/AuthPage.js +7 -14
- package/dist/app/auth/AuthPage.js.map +1 -1
- package/dist/app/auth/server.d.ts +6 -0
- package/dist/app/auth/server.d.ts.map +1 -0
- package/dist/app/auth/server.js +19 -0
- package/dist/app/auth/server.js.map +1 -0
- package/dist/app/chat/AgentKitAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.js +164 -83
- package/dist/app/chat/AgentKitAssistantChat.js.map +1 -1
- package/dist/app/chat/AgentSidebar.d.ts +2 -1
- package/dist/app/chat/AgentSidebar.d.ts.map +1 -1
- package/dist/app/chat/AgentSidebar.js +2 -2
- package/dist/app/chat/AgentSidebar.js.map +1 -1
- package/dist/app/chat/agentkit-chat/guided-questions.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/guided-questions.js +13 -3
- package/dist/app/chat/agentkit-chat/guided-questions.js.map +1 -1
- package/dist/app/chat/chat/surface-types.d.ts +2 -0
- package/dist/app/chat/chat/surface-types.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.js +41 -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 +41 -0
- package/dist/app/i18n/catalogs/de-DE.js.map +1 -1
- package/dist/app/i18n/catalogs/en-US.d.ts +41 -0
- package/dist/app/i18n/catalogs/en-US.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/en-US.js +41 -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 +41 -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 +41 -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 +41 -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 +41 -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 +41 -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 +41 -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 +41 -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 +41 -0
- package/dist/app/i18n/catalogs/zh-TW.js.map +1 -1
- package/dist/app/shared/StarfieldBackground.d.ts +1 -6
- package/dist/app/shared/StarfieldBackground.d.ts.map +1 -1
- package/dist/app/shared/StarfieldBackground.js +1 -368
- package/dist/app/shared/StarfieldBackground.js.map +1 -1
- package/dist/app/shared/WaveBackground.d.ts +5 -0
- package/dist/app/shared/WaveBackground.d.ts.map +1 -0
- package/dist/app/shared/WaveBackground.js +34 -0
- package/dist/app/shared/WaveBackground.js.map +1 -0
- package/dist/app/shared/WebGlWaveBackground.d.ts +9 -0
- package/dist/app/shared/WebGlWaveBackground.d.ts.map +1 -0
- package/dist/app/shared/WebGlWaveBackground.js +433 -0
- package/dist/app/shared/WebGlWaveBackground.js.map +1 -0
- package/dist/app/shared/index.d.ts +1 -0
- package/dist/app/shared/index.d.ts.map +1 -1
- package/dist/app/shared/index.js +1 -0
- package/dist/app/shared/index.js.map +1 -1
- package/dist/app/shared/ocean/bloom-blur.wgsl +43 -0
- package/dist/app/shared/ocean/bloom-blur.wgsl.js +1 -0
- package/dist/app/shared/ocean/bloom-bright.wgsl +21 -0
- package/dist/app/shared/ocean/bloom-bright.wgsl.js +1 -0
- package/dist/app/shared/ocean/bloom-composite.wgsl +40 -0
- package/dist/app/shared/ocean/bloom-composite.wgsl.js +1 -0
- package/dist/app/shared/ocean/brand-colors.d.ts +9 -0
- package/dist/app/shared/ocean/brand-colors.d.ts.map +1 -0
- package/dist/app/shared/ocean/brand-colors.js +45 -0
- package/dist/app/shared/ocean/brand-colors.js.map +1 -0
- package/dist/app/shared/ocean/camera.d.ts +5 -0
- package/dist/app/shared/ocean/camera.d.ts.map +1 -0
- package/dist/app/shared/ocean/camera.js +24 -0
- package/dist/app/shared/ocean/camera.js.map +1 -0
- package/dist/app/shared/ocean/hero-ocean-background.d.ts +8 -0
- package/dist/app/shared/ocean/hero-ocean-background.d.ts.map +1 -0
- package/dist/app/shared/ocean/hero-ocean-background.js +186 -0
- package/dist/app/shared/ocean/hero-ocean-background.js.map +1 -0
- package/dist/app/shared/ocean/ifft-stage.wgsl +36 -0
- package/dist/app/shared/ocean/ifft-stage.wgsl.js +1 -0
- package/dist/app/shared/ocean/initial-spectrum.wgsl +36 -0
- package/dist/app/shared/ocean/initial-spectrum.wgsl.js +1 -0
- package/dist/app/shared/ocean/noise.wgsl +24 -0
- package/dist/app/shared/ocean/noise.wgsl.js +1 -0
- package/dist/app/shared/ocean/normal-foam.wgsl +32 -0
- package/dist/app/shared/ocean/normal-foam.wgsl.js +1 -0
- package/dist/app/shared/ocean/ocean-colors.d.ts +6 -0
- package/dist/app/shared/ocean/ocean-colors.d.ts.map +1 -0
- package/dist/app/shared/ocean/ocean-colors.js +6 -0
- package/dist/app/shared/ocean/ocean-colors.js.map +1 -0
- package/dist/app/shared/ocean/ocean-common.wgsl +15 -0
- package/dist/app/shared/ocean/ocean-common.wgsl.js +1 -0
- package/dist/app/shared/ocean/ocean-graph.d.ts +12 -0
- package/dist/app/shared/ocean/ocean-graph.d.ts.map +1 -0
- package/dist/app/shared/ocean/ocean-graph.js +16 -0
- package/dist/app/shared/ocean/ocean-graph.js.map +1 -0
- package/dist/app/shared/ocean/particles.wgsl +139 -0
- package/dist/app/shared/ocean/particles.wgsl.js +1 -0
- package/dist/app/shared/ocean/present.wgsl +40 -0
- package/dist/app/shared/ocean/present.wgsl.js +1 -0
- package/dist/app/shared/ocean/renderer.d.ts +66 -0
- package/dist/app/shared/ocean/renderer.d.ts.map +1 -0
- package/dist/app/shared/ocean/renderer.js +535 -0
- package/dist/app/shared/ocean/renderer.js.map +1 -0
- package/dist/app/shared/ocean/spectrum.wgsl +35 -0
- package/dist/app/shared/ocean/spectrum.wgsl.js +1 -0
- package/dist/app/shared/ocean/tuning.d.ts +48 -0
- package/dist/app/shared/ocean/tuning.d.ts.map +1 -0
- package/dist/app/shared/ocean/tuning.js +74 -0
- package/dist/app/shared/ocean/tuning.js.map +1 -0
- package/dist/app/shared/ocean/webgpu-support.d.ts +3 -0
- package/dist/app/shared/ocean/webgpu-support.d.ts.map +1 -0
- package/dist/app/shared/ocean/webgpu-support.js +13 -0
- package/dist/app/shared/ocean/webgpu-support.js.map +1 -0
- package/dist/app/sharing/AccessRequestApprovalPage.d.ts +23 -0
- package/dist/app/sharing/AccessRequestApprovalPage.d.ts.map +1 -0
- package/dist/app/sharing/AccessRequestApprovalPage.js +95 -0
- package/dist/app/sharing/AccessRequestApprovalPage.js.map +1 -0
- package/dist/app/sharing/AccessRequestsSection.d.ts +5 -0
- package/dist/app/sharing/AccessRequestsSection.d.ts.map +1 -0
- package/dist/app/sharing/AccessRequestsSection.js +47 -0
- package/dist/app/sharing/AccessRequestsSection.js.map +1 -0
- package/dist/app/sharing/ResourceAccessScreen.d.ts +53 -0
- package/dist/app/sharing/ResourceAccessScreen.d.ts.map +1 -0
- package/dist/app/sharing/ResourceAccessScreen.js +132 -0
- package/dist/app/sharing/ResourceAccessScreen.js.map +1 -0
- package/dist/app/sharing/ShareButton.d.ts.map +1 -1
- package/dist/app/sharing/ShareButton.js +4 -2
- package/dist/app/sharing/ShareButton.js.map +1 -1
- package/dist/app/sharing/ShareDialog.d.ts.map +1 -1
- package/dist/app/sharing/ShareDialog.js +7 -5
- package/dist/app/sharing/ShareDialog.js.map +1 -1
- package/dist/app/sharing/index.d.ts +2 -0
- package/dist/app/sharing/index.d.ts.map +1 -1
- package/dist/app/sharing/index.js +2 -0
- package/dist/app/sharing/index.js.map +1 -1
- package/dist/app/styles/agent-native.css +21 -1
- package/dist/app/styles/tokens/agent-kit.css +3 -1
- package/dist/composer/AgentSuggestionBar.d.ts +1 -1
- package/dist/composer/AgentSuggestionBar.d.ts.map +1 -1
- package/dist/composer/AgentSuggestionBar.js +75 -6
- package/dist/composer/AgentSuggestionBar.js.map +1 -1
- package/package.json +14 -4
- package/src/app/agentkit/react/components.tsx +492 -60
- package/src/app/agentkit/react/context.tsx +10 -0
- package/src/app/agentkit/react/lifecycle.spec.tsx +487 -1
- package/src/app/agentkit/react/styles.css +78 -3
- package/src/app/auth/AuthPage.spec.tsx +11 -7
- package/src/app/auth/AuthPage.tsx +16 -35
- package/src/app/auth/server.spec.ts +68 -0
- package/src/app/auth/server.ts +29 -0
- package/src/app/chat/AgentKitAssistantChat.spec.tsx +287 -290
- package/src/app/chat/AgentKitAssistantChat.tsx +219 -116
- package/src/app/chat/AgentSidebar.tsx +3 -0
- package/src/app/chat/agentkit-chat/guided-questions.flow.spec.tsx +85 -0
- package/src/app/chat/agentkit-chat/guided-questions.tsx +12 -5
- package/src/app/chat/chat/surface-types.ts +2 -0
- package/src/app/i18n/catalogs/ar-SA.ts +44 -0
- package/src/app/i18n/catalogs/de-DE.ts +55 -0
- package/src/app/i18n/catalogs/en-US.ts +46 -0
- package/src/app/i18n/catalogs/es-ES.ts +53 -0
- package/src/app/i18n/catalogs/fr-FR.ts +53 -0
- package/src/app/i18n/catalogs/hi-IN.ts +47 -0
- package/src/app/i18n/catalogs/ja-JP.ts +54 -0
- package/src/app/i18n/catalogs/ko-KR.ts +50 -0
- package/src/app/i18n/catalogs/pt-BR.ts +52 -0
- package/src/app/i18n/catalogs/zh-CN.ts +42 -0
- package/src/app/i18n/catalogs/zh-TW.ts +43 -0
- package/src/app/shared/StarfieldBackground.tsx +4 -423
- package/src/app/shared/WaveBackground.spec.tsx +104 -0
- package/src/app/shared/WaveBackground.tsx +60 -0
- package/src/app/shared/WebGlWaveBackground.spec.tsx +106 -0
- package/src/app/shared/WebGlWaveBackground.tsx +499 -0
- package/src/app/shared/index.ts +1 -0
- package/src/app/shared/ocean/bloom-blur.wgsl +43 -0
- package/src/app/shared/ocean/bloom-bright.wgsl +21 -0
- package/src/app/shared/ocean/bloom-composite.wgsl +40 -0
- package/src/app/shared/ocean/brand-colors.ts +49 -0
- package/src/app/shared/ocean/camera.ts +28 -0
- package/src/app/shared/ocean/hero-ocean-background.spec.tsx +369 -0
- package/src/app/shared/ocean/hero-ocean-background.tsx +238 -0
- package/src/app/shared/ocean/ifft-stage.wgsl +36 -0
- package/src/app/shared/ocean/initial-spectrum.wgsl +36 -0
- package/src/app/shared/ocean/noise.wgsl +24 -0
- package/src/app/shared/ocean/normal-foam.wgsl +32 -0
- package/src/app/shared/ocean/ocean-colors.ts +11 -0
- package/src/app/shared/ocean/ocean-common.wgsl +15 -0
- package/src/app/shared/ocean/ocean-graph.ts +29 -0
- package/src/app/shared/ocean/particles.wgsl +139 -0
- package/src/app/shared/ocean/present.wgsl +40 -0
- package/src/app/shared/ocean/renderer.spec.ts +100 -0
- package/src/app/shared/ocean/renderer.ts +693 -0
- package/src/app/shared/ocean/spectrum.wgsl +35 -0
- package/src/app/shared/ocean/tuning.ts +131 -0
- package/src/app/shared/ocean/webgpu-support.ts +12 -0
- package/src/app/sharing/AccessRequestApprovalPage.spec.tsx +276 -0
- package/src/app/sharing/AccessRequestApprovalPage.tsx +307 -0
- package/src/app/sharing/AccessRequestsSection.tsx +163 -0
- package/src/app/sharing/ResourceAccessScreen.spec.tsx +235 -0
- package/src/app/sharing/ResourceAccessScreen.tsx +331 -0
- package/src/app/sharing/ShareButton.spec.tsx +171 -5
- package/src/app/sharing/ShareButton.tsx +15 -2
- package/src/app/sharing/ShareDialog.spec.tsx +71 -2
- package/src/app/sharing/ShareDialog.tsx +24 -2
- package/src/app/sharing/index.ts +2 -0
- package/src/app/styles/agent-native.css +21 -1
- package/src/app/styles/agent-native.spec.ts +16 -3
- package/src/app/styles/tokens/agent-kit.css +3 -1
- package/src/composer/AgentSuggestionBar.overflow.spec.tsx +277 -0
- package/src/composer/AgentSuggestionBar.tsx +113 -8
- package/src/wgsl-env.d.ts +6 -0
package/agent-native.eject.json
CHANGED
|
@@ -270,7 +270,9 @@
|
|
|
270
270
|
"remark-gfm",
|
|
271
271
|
"shiki",
|
|
272
272
|
"sonner",
|
|
273
|
-
"tailwind-merge"
|
|
273
|
+
"tailwind-merge",
|
|
274
|
+
"vgpu",
|
|
275
|
+
"@webgpu/types"
|
|
274
276
|
],
|
|
275
277
|
"verification": ["pnpm typecheck"],
|
|
276
278
|
"protectedImports": [
|
|
@@ -377,7 +379,9 @@
|
|
|
377
379
|
"remark-gfm",
|
|
378
380
|
"shiki",
|
|
379
381
|
"sonner",
|
|
380
|
-
"tailwind-merge"
|
|
382
|
+
"tailwind-merge",
|
|
383
|
+
"vgpu",
|
|
384
|
+
"@webgpu/types"
|
|
381
385
|
],
|
|
382
386
|
"verification": ["pnpm typecheck"],
|
|
383
387
|
"protectedImports": [
|
|
@@ -458,7 +462,9 @@
|
|
|
458
462
|
"remark-gfm",
|
|
459
463
|
"shiki",
|
|
460
464
|
"sonner",
|
|
461
|
-
"tailwind-merge"
|
|
465
|
+
"tailwind-merge",
|
|
466
|
+
"vgpu",
|
|
467
|
+
"@webgpu/types"
|
|
462
468
|
],
|
|
463
469
|
"verification": ["pnpm typecheck"],
|
|
464
470
|
"protectedImports": [
|
|
@@ -580,7 +586,9 @@
|
|
|
580
586
|
"remark-gfm",
|
|
581
587
|
"shiki",
|
|
582
588
|
"sonner",
|
|
583
|
-
"tailwind-merge"
|
|
589
|
+
"tailwind-merge",
|
|
590
|
+
"vgpu",
|
|
591
|
+
"@webgpu/types"
|
|
584
592
|
],
|
|
585
593
|
"verification": ["pnpm typecheck"],
|
|
586
594
|
"protectedImports": [
|
|
@@ -663,15 +671,21 @@
|
|
|
663
671
|
"label": "Toolkit app Auth",
|
|
664
672
|
"catalog": "toolkit-ui",
|
|
665
673
|
"catalogItems": ["app-auth"],
|
|
666
|
-
"entrypoints": ["./app/auth"],
|
|
674
|
+
"entrypoints": ["./app/auth", "./app/auth/server"],
|
|
667
675
|
"strategy": "source-copy",
|
|
668
|
-
"sourceEntries": [
|
|
676
|
+
"sourceEntries": [
|
|
677
|
+
"src/app/auth/server.ts",
|
|
678
|
+
"src/app/auth",
|
|
679
|
+
"src/wgsl-env.d.ts"
|
|
680
|
+
],
|
|
669
681
|
"targetRoot": "app/components/agent-native/toolkit",
|
|
670
682
|
"dependencies": [
|
|
671
683
|
"@agent-native/core",
|
|
672
684
|
"@tabler/icons-react",
|
|
673
685
|
"react",
|
|
674
|
-
"react-dom"
|
|
686
|
+
"react-dom",
|
|
687
|
+
"vgpu",
|
|
688
|
+
"@webgpu/types"
|
|
675
689
|
],
|
|
676
690
|
"verification": ["pnpm typecheck"],
|
|
677
691
|
"protectedImports": [
|
|
@@ -691,6 +705,7 @@
|
|
|
691
705
|
"@agent-native/core/shared/runtime-config",
|
|
692
706
|
"@agent-native/core/shared/sign-in-journey",
|
|
693
707
|
"@agent-native/core/shared/ssr-session-bootstrap",
|
|
708
|
+
"@agent-native/core/server",
|
|
694
709
|
"@agent-native/core/shared/test-traffic"
|
|
695
710
|
]
|
|
696
711
|
},
|
|
@@ -846,7 +861,9 @@
|
|
|
846
861
|
"remark-gfm",
|
|
847
862
|
"shiki",
|
|
848
863
|
"sonner",
|
|
849
|
-
"tailwind-merge"
|
|
864
|
+
"tailwind-merge",
|
|
865
|
+
"vgpu",
|
|
866
|
+
"@webgpu/types"
|
|
850
867
|
],
|
|
851
868
|
"verification": ["pnpm typecheck"],
|
|
852
869
|
"protectedImports": [
|
|
@@ -954,7 +971,9 @@
|
|
|
954
971
|
"remark-gfm",
|
|
955
972
|
"shiki",
|
|
956
973
|
"sonner",
|
|
957
|
-
"tailwind-merge"
|
|
974
|
+
"tailwind-merge",
|
|
975
|
+
"vgpu",
|
|
976
|
+
"@webgpu/types"
|
|
958
977
|
],
|
|
959
978
|
"verification": ["pnpm typecheck"],
|
|
960
979
|
"protectedImports": [
|
|
@@ -1082,7 +1101,9 @@
|
|
|
1082
1101
|
"remark-gfm",
|
|
1083
1102
|
"shiki",
|
|
1084
1103
|
"sonner",
|
|
1085
|
-
"tailwind-merge"
|
|
1104
|
+
"tailwind-merge",
|
|
1105
|
+
"vgpu",
|
|
1106
|
+
"@webgpu/types"
|
|
1086
1107
|
],
|
|
1087
1108
|
"verification": ["pnpm typecheck"],
|
|
1088
1109
|
"protectedImports": [
|
|
@@ -1200,7 +1221,9 @@
|
|
|
1200
1221
|
"remark-gfm",
|
|
1201
1222
|
"shiki",
|
|
1202
1223
|
"sonner",
|
|
1203
|
-
"tailwind-merge"
|
|
1224
|
+
"tailwind-merge",
|
|
1225
|
+
"vgpu",
|
|
1226
|
+
"@webgpu/types"
|
|
1204
1227
|
],
|
|
1205
1228
|
"verification": ["pnpm typecheck"],
|
|
1206
1229
|
"protectedImports": [
|
|
@@ -1240,14 +1263,18 @@
|
|
|
1240
1263
|
"@agent-native/core",
|
|
1241
1264
|
"@radix-ui/react-select",
|
|
1242
1265
|
"@tabler/icons-react",
|
|
1243
|
-
"react"
|
|
1266
|
+
"react",
|
|
1267
|
+
"react-router"
|
|
1244
1268
|
],
|
|
1245
1269
|
"verification": ["pnpm typecheck"],
|
|
1246
1270
|
"protectedImports": [
|
|
1247
1271
|
"@agent-native/core/client/analytics",
|
|
1272
|
+
"@agent-native/core/client/hooks",
|
|
1248
1273
|
"@agent-native/core/client/i18n",
|
|
1274
|
+
"@agent-native/core/client/sharing/useAccessRequestReview",
|
|
1249
1275
|
"@agent-native/core/client/sharing/useShareButtonController",
|
|
1250
1276
|
"@agent-native/core/client/sharing/useShareDialogController",
|
|
1277
|
+
"@agent-native/core/client/sign-in-return",
|
|
1251
1278
|
"@agent-native/core/client/use-action",
|
|
1252
1279
|
"@agent-native/core/client/use-avatar"
|
|
1253
1280
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/app/agentkit/react/components.tsx"],"names":[],"mappings":"AAuCA,OAAO,EAEL,SAAS,EAUT,KAAK,SAAS,EAKd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAUL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAG1B,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAU3E,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAE3B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAC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AAE,UAAU,CAAC,CAAC;IACxD,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4EAA4E;IAC5E,sBAAsB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC7C,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,cAAc,GAAG,WAAW,CAAC,EACzE,SAAS,SAAuC,WAKjD;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,QAAe,EACf,aAAa,EACb,mBAA2B,EAC3B,sBAAiC,EACjC,UAAiB,EACjB,SAAS,GACV,EAAE,iBAAiB,+BAuvBnB;AAED,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { createAgentKitComposerSubmission, snapshotComposerValue, } from "./comp
|
|
|
9
9
|
import { splitAgentKitMessageContext } from "@agent-native/agentkit";
|
|
10
10
|
import { AgentKitCapabilityError, hasActiveAgentRuns, isCurrentAgentSuggestion, selectAgentSuggestions, } from "@agent-native/agentkit/client";
|
|
11
11
|
import { inferAgentActivityKind, } from "@agent-native/agentkit/protocol";
|
|
12
|
-
import { useAgentCapability, useAgentConnection, useAgentKit, useAgentKitControl, useAgentKitMutation, useAgentThread, } from "./context.js";
|
|
12
|
+
import { defaultAgentKitLabels, useAgentCapability, useAgentConnection, useAgentKit, useAgentKitControl, useAgentKitMutation, useAgentThread, } from "./context.js";
|
|
13
13
|
import { AgentStreamingText } from "./streaming-text.js";
|
|
14
14
|
/** Isolates custom renderers so one extension cannot take down the chat. */
|
|
15
15
|
export class AgentKitErrorBoundary extends Component {
|
|
@@ -221,15 +221,236 @@ function interactionIcon(kind) {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
export function AgentObjectReferenceView({ value: object, }) {
|
|
224
|
-
const { onOpenObject } = useAgentKit();
|
|
225
|
-
const
|
|
224
|
+
const { onOpenObject, labels } = useAgentKit();
|
|
225
|
+
const thread = useAgentThread();
|
|
226
|
+
const content = (_jsxs(_Fragment, { children: [_jsx("span", { className: "agentkit-object-label", children: resolveObjectLabel(object, thread, labels.assistant) }), typeof object.metadata?.added === "number" ? (_jsxs("span", { className: "agentkit-diff-added", children: ["+", object.metadata.added] })) : null, typeof object.metadata?.removed === "number" ? (_jsxs("span", { className: "agentkit-diff-removed", children: ["\u2212", object.metadata.removed] })) : null] }));
|
|
226
227
|
return onOpenObject ? (_jsx("button", { type: "button", className: "agentkit-object", onClick: () => onOpenObject(object), children: content })) : (_jsx("span", { className: "agentkit-object", children: content }));
|
|
227
228
|
}
|
|
228
229
|
export function AgentParticipantView({ value: agent, }) {
|
|
229
|
-
|
|
230
|
+
const { labels } = useAgentKit();
|
|
231
|
+
const thread = useAgentThread();
|
|
232
|
+
return (_jsx(AgentIdentityChip, { id: agent.id, name: resolveAgentName(thread, agent.id, [agent.origin], labels.assistant, agent.name), fallbackName: labels.assistant, kind: agent.kind, status: agent.status }));
|
|
233
|
+
}
|
|
234
|
+
const UUID_PATTERN = /(^|[^0-9a-f])([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?=$|[^0-9a-f])/gi;
|
|
235
|
+
const ACTIVITY_TOOL_VALUE_LIMIT = 2_000;
|
|
236
|
+
const ACTIVITY_TOOL_NODE_LIMIT = 160;
|
|
237
|
+
const ACTIVITY_TOOL_DEPTH_LIMIT = 8;
|
|
238
|
+
function isUuid(value) {
|
|
239
|
+
if (value.length > 64)
|
|
240
|
+
return false;
|
|
241
|
+
return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value.trim());
|
|
242
|
+
}
|
|
243
|
+
function hideUuids(value) {
|
|
244
|
+
return value.replace(UUID_PATTERN, "$1");
|
|
245
|
+
}
|
|
246
|
+
function readableText(value) {
|
|
247
|
+
if (!value)
|
|
248
|
+
return "";
|
|
249
|
+
return hideUuids(value)
|
|
250
|
+
.replace(/\s+/g, " ")
|
|
251
|
+
.replace(/\s+([,.;:!?])/g, "$1")
|
|
252
|
+
.replace(/[,.;:!?]\s*$/g, "")
|
|
253
|
+
.trim();
|
|
254
|
+
}
|
|
255
|
+
function humanizeAgentKind(kind) {
|
|
256
|
+
const readableKind = readableText(kind.replace(/^agent-native\//i, "").replace(/^mcp__/i, ""));
|
|
257
|
+
if (!readableKind)
|
|
258
|
+
return "";
|
|
259
|
+
return readableKind
|
|
260
|
+
.replace(/[._-]+/g, " ")
|
|
261
|
+
.replace(/\b\w/g, (character) => character.toUpperCase());
|
|
262
|
+
}
|
|
263
|
+
function humanizeAgentLabel(value) {
|
|
264
|
+
const label = readableText(value);
|
|
265
|
+
if (!label)
|
|
266
|
+
return "";
|
|
267
|
+
if (label.toLowerCase() === "agent-native")
|
|
268
|
+
return "Agent-Native";
|
|
269
|
+
return /\s/.test(label) ? label : humanizeAgentKind(label);
|
|
270
|
+
}
|
|
271
|
+
function resolveAgentName(thread, agentId, references, fallback, preferredName) {
|
|
272
|
+
const participant = agentId ? thread.agents[agentId] : undefined;
|
|
273
|
+
const names = [
|
|
274
|
+
preferredName,
|
|
275
|
+
participant?.name,
|
|
276
|
+
participant?.origin?.label,
|
|
277
|
+
...references
|
|
278
|
+
.filter((reference) => reference?.kind === "agent" && reference.id === agentId)
|
|
279
|
+
.map((reference) => reference?.label),
|
|
280
|
+
participant?.description,
|
|
281
|
+
];
|
|
282
|
+
for (const name of names) {
|
|
283
|
+
const label = name ? humanizeAgentLabel(name) : "";
|
|
284
|
+
if (label)
|
|
285
|
+
return label;
|
|
286
|
+
}
|
|
287
|
+
return fallback;
|
|
288
|
+
}
|
|
289
|
+
function resolveObjectLabel(object, thread, fallback) {
|
|
290
|
+
if (object.kind === "agent") {
|
|
291
|
+
return resolveAgentName(thread, object.id, [object], fallback);
|
|
292
|
+
}
|
|
293
|
+
if (object.kind === "task") {
|
|
294
|
+
const title = humanizeAgentLabel(thread.tasks[object.id]?.title ?? "");
|
|
295
|
+
if (title)
|
|
296
|
+
return title;
|
|
297
|
+
}
|
|
298
|
+
return (humanizeAgentLabel(object.label) ||
|
|
299
|
+
humanizeAgentKind(object.kind) ||
|
|
300
|
+
fallback);
|
|
230
301
|
}
|
|
231
|
-
function
|
|
232
|
-
|
|
302
|
+
function sourceObjectUnlessRepresented(source, displayedAgentIds) {
|
|
303
|
+
if (source?.kind === "agent" && displayedAgentIds.includes(source.id)) {
|
|
304
|
+
return undefined;
|
|
305
|
+
}
|
|
306
|
+
return source;
|
|
307
|
+
}
|
|
308
|
+
function resolveActivityValueLabels(labels = {}) {
|
|
309
|
+
return {
|
|
310
|
+
activityValueIdentifierHidden: labels.activityValueIdentifierHidden ??
|
|
311
|
+
defaultAgentKitLabels.activityValueIdentifierHidden,
|
|
312
|
+
activityValueOmitted: labels.activityValueOmitted ??
|
|
313
|
+
defaultAgentKitLabels.activityValueOmitted,
|
|
314
|
+
activityValueCircular: labels.activityValueCircular ??
|
|
315
|
+
defaultAgentKitLabels.activityValueCircular,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function activityToolValue(value, budget, labels, depth = 0) {
|
|
319
|
+
if (budget.nodes >= ACTIVITY_TOOL_NODE_LIMIT) {
|
|
320
|
+
budget.truncated = true;
|
|
321
|
+
return undefined;
|
|
322
|
+
}
|
|
323
|
+
budget.nodes++;
|
|
324
|
+
if (depth > ACTIVITY_TOOL_DEPTH_LIMIT) {
|
|
325
|
+
budget.truncated = true;
|
|
326
|
+
return labels.activityValueOmitted;
|
|
327
|
+
}
|
|
328
|
+
if (typeof value === "string") {
|
|
329
|
+
if (isUuid(value))
|
|
330
|
+
return labels.activityValueIdentifierHidden;
|
|
331
|
+
const sourceLimit = budget.remainingCharacters + 36;
|
|
332
|
+
let text = hideUuids(value.slice(0, sourceLimit));
|
|
333
|
+
if (value.length > sourceLimit) {
|
|
334
|
+
text = text.slice(0, Math.max(0, text.length - 36));
|
|
335
|
+
budget.truncated = true;
|
|
336
|
+
}
|
|
337
|
+
const safeText = text.slice(0, budget.remainingCharacters);
|
|
338
|
+
budget.remainingCharacters -= safeText.length;
|
|
339
|
+
if (text.length > safeText.length)
|
|
340
|
+
budget.truncated = true;
|
|
341
|
+
if (text.length > 0 && safeText.length === 0) {
|
|
342
|
+
return labels.activityValueOmitted;
|
|
343
|
+
}
|
|
344
|
+
return safeText;
|
|
345
|
+
}
|
|
346
|
+
if (value && typeof value === "object") {
|
|
347
|
+
if (budget.ancestors.has(value)) {
|
|
348
|
+
budget.truncated = true;
|
|
349
|
+
return labels.activityValueCircular;
|
|
350
|
+
}
|
|
351
|
+
budget.ancestors.add(value);
|
|
352
|
+
if (Array.isArray(value)) {
|
|
353
|
+
const items = [];
|
|
354
|
+
let visited = 0;
|
|
355
|
+
for (let index = 0; index < value.length; index++) {
|
|
356
|
+
if (budget.nodes >= ACTIVITY_TOOL_NODE_LIMIT)
|
|
357
|
+
break;
|
|
358
|
+
budget.nodes++;
|
|
359
|
+
visited++;
|
|
360
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
|
|
361
|
+
if (!descriptor || !("value" in descriptor))
|
|
362
|
+
continue;
|
|
363
|
+
const safeValue = activityToolValue(descriptor.value, budget, labels, depth + 1);
|
|
364
|
+
if (safeValue !== undefined)
|
|
365
|
+
items.push(safeValue);
|
|
366
|
+
}
|
|
367
|
+
if (visited < value.length) {
|
|
368
|
+
budget.truncated = true;
|
|
369
|
+
items.push(labels.activityValueOmitted);
|
|
370
|
+
}
|
|
371
|
+
budget.ancestors.delete(value);
|
|
372
|
+
return items.length ? items : undefined;
|
|
373
|
+
}
|
|
374
|
+
const result = Object.create(null);
|
|
375
|
+
let included = 0;
|
|
376
|
+
for (const key in value) {
|
|
377
|
+
if (budget.nodes >= ACTIVITY_TOOL_NODE_LIMIT) {
|
|
378
|
+
budget.truncated = true;
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
budget.nodes++;
|
|
382
|
+
if (!Object.hasOwn(value, key) || isUuid(key))
|
|
383
|
+
continue;
|
|
384
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
385
|
+
if (!descriptor || !("value" in descriptor))
|
|
386
|
+
continue;
|
|
387
|
+
const keyLimit = budget.remainingCharacters + 36;
|
|
388
|
+
let safeKey = hideUuids(key.slice(0, keyLimit));
|
|
389
|
+
if (key.length > keyLimit) {
|
|
390
|
+
safeKey = safeKey.slice(0, Math.max(0, safeKey.length - 36));
|
|
391
|
+
budget.truncated = true;
|
|
392
|
+
}
|
|
393
|
+
const boundedKey = safeKey.slice(0, budget.remainingCharacters);
|
|
394
|
+
if (safeKey.length > boundedKey.length)
|
|
395
|
+
budget.truncated = true;
|
|
396
|
+
safeKey = boundedKey;
|
|
397
|
+
if (!safeKey.trim())
|
|
398
|
+
continue;
|
|
399
|
+
budget.remainingCharacters -= safeKey.length;
|
|
400
|
+
const safeValue = activityToolValue(descriptor.value, budget, labels, depth + 1);
|
|
401
|
+
if (safeValue === undefined)
|
|
402
|
+
continue;
|
|
403
|
+
result[safeKey] = safeValue;
|
|
404
|
+
included++;
|
|
405
|
+
}
|
|
406
|
+
budget.ancestors.delete(value);
|
|
407
|
+
return included ? result : undefined;
|
|
408
|
+
}
|
|
409
|
+
return value;
|
|
410
|
+
}
|
|
411
|
+
function createActivityToolValueBudget() {
|
|
412
|
+
return {
|
|
413
|
+
nodes: 0,
|
|
414
|
+
remainingCharacters: ACTIVITY_TOOL_VALUE_LIMIT - 64,
|
|
415
|
+
ancestors: new WeakSet(),
|
|
416
|
+
truncated: false,
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
function formatActivityText(value, labels = {}) {
|
|
420
|
+
const budget = createActivityToolValueBudget();
|
|
421
|
+
const safeValue = activityToolValue(value, budget, resolveActivityValueLabels(labels));
|
|
422
|
+
if (typeof safeValue !== "string")
|
|
423
|
+
return "";
|
|
424
|
+
return budget.truncated ? `${safeValue}…` : safeValue;
|
|
425
|
+
}
|
|
426
|
+
function formatActivityToolValue(value, labels = {}) {
|
|
427
|
+
const budget = createActivityToolValueBudget();
|
|
428
|
+
const valueLabels = resolveActivityValueLabels(labels);
|
|
429
|
+
const safeValue = activityToolValue(value, budget, valueLabels);
|
|
430
|
+
if (safeValue === undefined) {
|
|
431
|
+
return budget.truncated ? valueLabels.activityValueOmitted : undefined;
|
|
432
|
+
}
|
|
433
|
+
const formatted = formatToolDiagnostic(safeValue);
|
|
434
|
+
if (!formatted?.trim()) {
|
|
435
|
+
return budget.truncated ? valueLabels.activityValueOmitted : undefined;
|
|
436
|
+
}
|
|
437
|
+
if (!budget.truncated && formatted.length <= ACTIVITY_TOOL_VALUE_LIMIT) {
|
|
438
|
+
return formatted;
|
|
439
|
+
}
|
|
440
|
+
const omissionMarker = `\n${valueLabels.activityValueOmitted}`;
|
|
441
|
+
const contentLimit = Math.max(0, ACTIVITY_TOOL_VALUE_LIMIT - omissionMarker.length - 1);
|
|
442
|
+
return `${formatted.slice(0, contentLimit).trimEnd()}…${omissionMarker}`;
|
|
443
|
+
}
|
|
444
|
+
function activityLabel(activity, workingLabel) {
|
|
445
|
+
const label = readableText(activity.label);
|
|
446
|
+
if (label.toLowerCase() === "processing")
|
|
447
|
+
return workingLabel;
|
|
448
|
+
return (humanizeAgentLabel(label) ||
|
|
449
|
+
humanizeAgentKind(activity.kind) ||
|
|
450
|
+
workingLabel);
|
|
451
|
+
}
|
|
452
|
+
function AgentIdentityChip({ id, name, fallbackName = "Agent", kind, status, }) {
|
|
453
|
+
return (_jsx("span", { className: "agentkit-agent", "data-agent-id": id, "data-agent-kind": kind, "data-status": status, children: _jsx("span", { className: "agentkit-agent-name", children: readableText(name) || fallbackName }) }));
|
|
233
454
|
}
|
|
234
455
|
function defaultInteractionLabel(interaction, labels) {
|
|
235
456
|
if (interaction.label)
|
|
@@ -252,7 +473,7 @@ function defaultInteractionLabel(interaction, labels) {
|
|
|
252
473
|
case "closed":
|
|
253
474
|
return labels.agentClosed;
|
|
254
475
|
default:
|
|
255
|
-
return interaction.kind;
|
|
476
|
+
return humanizeAgentKind(interaction.kind) || labels.working;
|
|
256
477
|
}
|
|
257
478
|
}
|
|
258
479
|
export function AgentInteractionItem({ value: interaction, threadId, }) {
|
|
@@ -273,22 +494,55 @@ export function AgentInteractionItem({ value: interaction, threadId, }) {
|
|
|
273
494
|
AgentParticipantView)
|
|
274
495
|
: undefined;
|
|
275
496
|
const ObjectRenderer = slots.object ?? AgentObjectReferenceView;
|
|
276
|
-
const
|
|
277
|
-
|
|
497
|
+
const agentName = resolveAgentName(thread, interaction.agentId, [interaction.source], labels.assistant);
|
|
498
|
+
const targetName = resolveAgentName(thread, interaction.targetAgentId, [interaction.object], labels.assistant);
|
|
499
|
+
const object = interaction.object ??
|
|
500
|
+
sourceObjectUnlessRepresented(interaction.source, [
|
|
501
|
+
interaction.agentId,
|
|
502
|
+
interaction.targetAgentId,
|
|
503
|
+
]);
|
|
504
|
+
const label = readableText(interaction.label);
|
|
505
|
+
const visibleLabel = humanizeAgentLabel(label) ||
|
|
506
|
+
defaultInteractionLabel({ ...interaction, label: undefined }, labels);
|
|
507
|
+
const detail = readableText(interaction.detail);
|
|
508
|
+
return (_jsxs("div", { className: "agentkit-agent-interaction", "data-kind": interaction.kind, "data-scope": interaction.scope, children: [interactionIcon(interaction.kind), agent && AgentRenderer ? (_jsx(AgentRenderer, { value: agent, threadId: threadId })) : (_jsx(AgentIdentityChip, { id: interaction.agentId, name: agentName, fallbackName: labels.assistant })), _jsx("span", { className: "agentkit-agent-interaction-label", children: visibleLabel }), target && TargetRenderer ? (_jsx(TargetRenderer, { value: target, threadId: threadId })) : interaction.targetAgentId ? (_jsx(AgentIdentityChip, { id: interaction.targetAgentId, name: targetName, fallbackName: labels.assistant })) : null, object ? (_jsx(ObjectRenderer, { value: object, threadId: threadId })) : detail ? (_jsx("span", { className: "agentkit-agent-interaction-detail", title: detail, children: detail })) : null] }));
|
|
278
509
|
}
|
|
279
510
|
export function AgentActivityItem({ value: activity, threadId, }) {
|
|
280
511
|
const { slots, registry, labels } = useAgentKit();
|
|
281
512
|
const thread = useAgentThread();
|
|
282
513
|
const [open, setOpen] = useState(false);
|
|
283
|
-
const expandable = Boolean(activity.summary?.length);
|
|
284
514
|
const agent = activity.agentId ? thread.agents[activity.agentId] : undefined;
|
|
515
|
+
const agentName = resolveAgentName(thread, activity.agentId, [activity.source, activity.object], labels.assistant);
|
|
516
|
+
const tool = thread.tools[activity.id];
|
|
517
|
+
const toolInput = tool
|
|
518
|
+
? formatActivityToolValue(tool.input, labels)
|
|
519
|
+
: undefined;
|
|
520
|
+
const toolResult = tool
|
|
521
|
+
? formatActivityToolValue(tool.output, labels)
|
|
522
|
+
: undefined;
|
|
523
|
+
const toolInputLabel = labels.toolInput ?? defaultAgentKitLabels.toolInput;
|
|
524
|
+
const toolResultLabel = labels.toolResult ?? defaultAgentKitLabels.toolResult;
|
|
525
|
+
const expandable = Boolean(activity.summary?.length || toolInput || toolResult);
|
|
285
526
|
const AgentRenderer = agent
|
|
286
527
|
? (registry.agents?.[agent.kind ?? ""] ??
|
|
287
528
|
slots.agent ??
|
|
288
529
|
AgentParticipantView)
|
|
289
530
|
: undefined;
|
|
290
531
|
const ObjectRenderer = slots.object ?? AgentObjectReferenceView;
|
|
291
|
-
|
|
532
|
+
const object = activity.object ??
|
|
533
|
+
sourceObjectUnlessRepresented(activity.source, [activity.agentId]);
|
|
534
|
+
const detail = tool ? "" : readableText(activity.detail);
|
|
535
|
+
return (_jsxs("div", { className: "agentkit-activity-item", "data-activity-kind": activity.kind, "data-status": activity.status, children: [_jsxs("div", { className: "agentkit-activity-row", children: [_jsx(ActivitySourceIcon, { activity: activity, threadId: threadId }), agent && AgentRenderer ? (_jsx(AgentRenderer, { value: agent, threadId: threadId })) : activity.agentId ? (_jsx(AgentIdentityChip, { id: activity.agentId, name: agentName, fallbackName: labels.assistant })) : null, _jsx("span", { className: "agentkit-activity-label", children: activityLabel(activity, labels.working) }), object ? _jsx(ObjectRenderer, { value: object, threadId: threadId }) : null, detail ? (_jsx("span", { className: "agentkit-activity-detail", title: detail, children: detail })) : null, expandable ? (_jsx("button", { type: "button", className: "agentkit-activity-disclosure", "aria-expanded": open, "aria-label": open ? labels.collapseActivity : labels.expandActivity, onClick: () => setOpen((current) => !current), children: _jsx(IconChevronRight, { "aria-hidden": "true", className: "agentkit-icon agentkit-disclosure-icon", "data-open": open ? "true" : "false" }) })) : null] }), open ? (_jsxs("div", { className: "agentkit-activity-summary", children: [activity.summary?.map((part, index) => {
|
|
536
|
+
const safePart = part.type === "text"
|
|
537
|
+
? {
|
|
538
|
+
...part,
|
|
539
|
+
text: part.text.trim()
|
|
540
|
+
? formatActivityText(part.text, labels)
|
|
541
|
+
: "",
|
|
542
|
+
}
|
|
543
|
+
: part;
|
|
544
|
+
return safePart.type === "text" && !safePart.text ? null : (_jsx(AgentMessagePartView, { value: safePart, threadId: threadId }, `${activity.id}-summary-${index}`));
|
|
545
|
+
}), toolInput ? (_jsxs("div", { className: "agentkit-activity-summary-section", children: [_jsx("div", { className: "agentkit-activity-summary-label", children: toolInputLabel }), _jsx("pre", { role: "region", "aria-label": toolInputLabel, tabIndex: 0, className: "agentkit-activity-summary-value", children: toolInput })] })) : null, toolResult ? (_jsxs("div", { className: "agentkit-activity-summary-section", children: [_jsx("div", { className: "agentkit-activity-summary-label", children: toolResultLabel }), _jsx("pre", { role: "region", "aria-label": toolResultLabel, tabIndex: 0, className: "agentkit-activity-summary-value", children: toolResult })] })) : null] })) : null] }));
|
|
292
546
|
}
|
|
293
547
|
function objectReferenceIdentity(object) {
|
|
294
548
|
return object
|
|
@@ -314,23 +568,26 @@ function activityClusterIdentity(activity, sourceId) {
|
|
|
314
568
|
].join("\u0001");
|
|
315
569
|
}
|
|
316
570
|
function RepeatedActivityCluster({ activities, threadId, }) {
|
|
317
|
-
const { slots, registry } = useAgentKit();
|
|
571
|
+
const { slots, registry, labels } = useAgentKit();
|
|
318
572
|
const thread = useAgentThread();
|
|
319
573
|
const [open, setOpen] = useState(false);
|
|
320
574
|
const activity = activities[0];
|
|
321
575
|
if (!activity)
|
|
322
576
|
return null;
|
|
323
577
|
const agent = activity.agentId ? thread.agents[activity.agentId] : undefined;
|
|
578
|
+
const agentName = resolveAgentName(thread, activity.agentId, [activity.source, activity.object], labels.assistant);
|
|
324
579
|
const AgentRenderer = agent
|
|
325
580
|
? (registry.agents?.[agent.kind ?? ""] ??
|
|
326
581
|
slots.agent ??
|
|
327
582
|
AgentParticipantView)
|
|
328
583
|
: undefined;
|
|
329
584
|
const ObjectRenderer = slots.object ?? AgentObjectReferenceView;
|
|
585
|
+
const object = activity.object ??
|
|
586
|
+
sourceObjectUnlessRepresented(activity.source, [activity.agentId]);
|
|
330
587
|
return (_jsxs("details", { className: "agentkit-activity-cluster", "data-activity-kind": activity.kind, open: open, children: [_jsxs("summary", { className: "agentkit-activity-row", onClick: (event) => {
|
|
331
588
|
event.preventDefault();
|
|
332
589
|
setOpen((current) => !current);
|
|
333
|
-
}, children: [_jsx(ActivitySourceIcon, { activity: activity, threadId: threadId }), agent && AgentRenderer ? (_jsx(AgentRenderer, { value: agent, threadId: threadId })) : activity.agentId ? (_jsx(AgentIdentityChip, { id: activity.agentId, name:
|
|
590
|
+
}, children: [_jsx(ActivitySourceIcon, { activity: activity, threadId: threadId }), agent && AgentRenderer ? (_jsx(AgentRenderer, { value: agent, threadId: threadId })) : activity.agentId ? (_jsx(AgentIdentityChip, { id: activity.agentId, name: agentName, fallbackName: labels.assistant })) : null, _jsx("span", { className: "agentkit-activity-label", children: activityLabel(activity, labels.working) }), object ? _jsx(ObjectRenderer, { value: object, threadId: threadId }) : null, _jsxs("span", { className: "agentkit-activity-cluster-count", children: ["\u00D7", activities.length] }), _jsx(IconChevronRight, { "aria-hidden": "true", className: "agentkit-icon agentkit-disclosure-icon", "data-open": open ? "true" : "false" })] }), _jsx("div", { className: "agentkit-activity-cluster-items", children: activities.map((item) => (_jsx(AgentActivityItem, { value: item, threadId: threadId }, item.id))) })] }));
|
|
334
591
|
}
|
|
335
592
|
function formatToolDiagnostic(value) {
|
|
336
593
|
if (value === undefined)
|
|
@@ -344,12 +601,14 @@ function formatToolDiagnostic(value) {
|
|
|
344
601
|
return String(value);
|
|
345
602
|
}
|
|
346
603
|
}
|
|
347
|
-
function toolToActivity(tool) {
|
|
604
|
+
function toolToActivity(tool, labels = {}) {
|
|
348
605
|
const failed = tool.status === "failed";
|
|
349
606
|
const errorMessage = failed
|
|
350
|
-
? ((tool.error?.message?.trim()
|
|
351
|
-
|
|
352
|
-
|
|
607
|
+
? ((tool.error?.message?.trim()
|
|
608
|
+
? formatActivityToolValue(tool.error.message, labels)
|
|
609
|
+
: undefined) ??
|
|
610
|
+
formatActivityToolValue(tool.output, labels) ??
|
|
611
|
+
formatActivityToolValue(tool.error?.details, labels))
|
|
353
612
|
: undefined;
|
|
354
613
|
return {
|
|
355
614
|
id: tool.id,
|
|
@@ -597,7 +856,7 @@ export function AgentActivityGroup({ runId, afterSequence, throughSequence, excl
|
|
|
597
856
|
toolMap.set(event.toolCall.id, tool);
|
|
598
857
|
remember(event.toolCall.id, event.sequence);
|
|
599
858
|
latestEventOrder.set(event.toolCall.id, eventOrder);
|
|
600
|
-
rememberUsefulActivity(toolToActivity(tool), event.sequence, eventOrder);
|
|
859
|
+
rememberUsefulActivity(toolToActivity(tool, labels), event.sequence, eventOrder);
|
|
601
860
|
}
|
|
602
861
|
if (event.type === "tool.delta") {
|
|
603
862
|
if (excludeAgentActivities && delegatedToolIds.has(event.toolCallId)) {
|
|
@@ -606,7 +865,7 @@ export function AgentActivityGroup({ runId, afterSequence, throughSequence, excl
|
|
|
606
865
|
const tool = thread.tools[event.toolCallId];
|
|
607
866
|
if (tool) {
|
|
608
867
|
toolMap.set(tool.id, tool);
|
|
609
|
-
rememberUsefulActivity(toolToActivity(tool), event.sequence, eventOrder);
|
|
868
|
+
rememberUsefulActivity(toolToActivity(tool, labels), event.sequence, eventOrder);
|
|
610
869
|
}
|
|
611
870
|
remember(event.toolCallId, event.sequence);
|
|
612
871
|
latestEventOrder.set(event.toolCallId, eventOrder);
|
|
@@ -623,7 +882,7 @@ export function AgentActivityGroup({ runId, afterSequence, throughSequence, excl
|
|
|
623
882
|
if (activity)
|
|
624
883
|
return [activity];
|
|
625
884
|
const tool = toolMap.get(id);
|
|
626
|
-
return tool ? [toolToActivity(tool)] : [];
|
|
885
|
+
return tool ? [toolToActivity(tool, labels)] : [];
|
|
627
886
|
});
|
|
628
887
|
const durableToolResults = items.flatMap((activity) => {
|
|
629
888
|
const tool = toolMap.get(activity.id);
|
|
@@ -698,7 +957,9 @@ export function AgentActivityGroup({ runId, afterSequence, throughSequence, excl
|
|
|
698
957
|
status: "running",
|
|
699
958
|
})
|
|
700
959
|
: undefined;
|
|
701
|
-
const currentActivityLabel = currentActivity
|
|
960
|
+
const currentActivityLabel = currentActivity
|
|
961
|
+
? activityLabel(currentActivity, labels.working)
|
|
962
|
+
: undefined;
|
|
702
963
|
const displayGroups = [];
|
|
703
964
|
const clusterIdentity = (activity) => {
|
|
704
965
|
const tool = toolMap.get(activity.id);
|
|
@@ -858,12 +1119,13 @@ export function AgentCollaborationFeed({ runId, afterSequence, throughSequence,
|
|
|
858
1119
|
}) }));
|
|
859
1120
|
}
|
|
860
1121
|
export function AgentTaskItem({ value: task, threadId, }) {
|
|
861
|
-
const { slots, registry } = useAgentKit();
|
|
1122
|
+
const { slots, registry, labels } = useAgentKit();
|
|
862
1123
|
const thread = useAgentThread();
|
|
863
1124
|
const ObjectRenderer = slots.object ?? AgentObjectReferenceView;
|
|
864
1125
|
const agent = task.assignedAgentId
|
|
865
1126
|
? thread.agents[task.assignedAgentId]
|
|
866
1127
|
: undefined;
|
|
1128
|
+
const agentName = resolveAgentName(thread, task.assignedAgentId, [task.source, task.object], labels.assistant);
|
|
867
1129
|
const AgentRenderer = agent
|
|
868
1130
|
? (registry.agents?.[agent.kind ?? ""] ??
|
|
869
1131
|
slots.agent ??
|
|
@@ -872,7 +1134,14 @@ export function AgentTaskItem({ value: task, threadId, }) {
|
|
|
872
1134
|
const progress = task.progress
|
|
873
1135
|
? `${task.progress.completed}/${task.progress.total}`
|
|
874
1136
|
: undefined;
|
|
875
|
-
|
|
1137
|
+
const title = humanizeAgentLabel(task.title) ||
|
|
1138
|
+
(task.assignedAgentId ? agentName : labels.tasks);
|
|
1139
|
+
const detail = readableText(task.detail);
|
|
1140
|
+
const object = task.object ??
|
|
1141
|
+
sourceObjectUnlessRepresented(task.source, [task.assignedAgentId]);
|
|
1142
|
+
const showAgent = task.assignedAgentId &&
|
|
1143
|
+
title.toLocaleLowerCase() !== agentName.toLocaleLowerCase();
|
|
1144
|
+
return (_jsxs("div", { className: "agentkit-task-row", "data-status": task.status, children: [_jsx(IconChecklist, { "aria-hidden": "true", className: "agentkit-icon" }), showAgent && agent && AgentRenderer ? (_jsx(AgentRenderer, { value: agent, threadId: threadId })) : showAgent && task.assignedAgentId ? (_jsx(AgentIdentityChip, { id: task.assignedAgentId, name: agentName, fallbackName: labels.assistant })) : null, _jsx("span", { className: "agentkit-task-title", children: title }), object ? _jsx(ObjectRenderer, { value: object, threadId: threadId }) : null, detail ? (_jsx("span", { className: "agentkit-task-detail", title: detail, children: detail })) : null, progress ? (_jsx("span", { className: "agentkit-task-progress", children: progress })) : null] }));
|
|
876
1145
|
}
|
|
877
1146
|
export function AgentTaskGroup({ runId, afterSequence, throughSequence, }) {
|
|
878
1147
|
const { threadId, slots, registry, labels } = useAgentKit();
|