@sixb/app 0.2.3 → 0.2.5
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/assets/connector-icons/README.md +1 -0
- package/assets/connector-icons/ctm.png +0 -0
- package/dist/agent/activity-label.d.ts.map +1 -1
- package/dist/agent/agent-chat.d.ts +3 -1
- package/dist/agent/agent-chat.d.ts.map +1 -1
- package/dist/agent/agent-panel.d.ts.map +1 -1
- package/dist/agent/artifact-panel.d.ts +3 -1
- package/dist/agent/artifact-panel.d.ts.map +1 -1
- package/dist/agent/background/background-tool-row.d.ts.map +1 -1
- package/dist/agent/background/interpret.d.ts +1 -1
- package/dist/agent/background/interpret.d.ts.map +1 -1
- package/dist/agent/components/composer-settings.d.ts +1 -1
- package/dist/agent/components/composer-settings.d.ts.map +1 -1
- package/dist/agent/components/composer.d.ts +22 -5
- package/dist/agent/components/composer.d.ts.map +1 -1
- package/dist/agent/components/context-meter.d.ts +1 -1
- package/dist/agent/components/context-meter.d.ts.map +1 -1
- package/dist/agent/components/conversation-panel.d.ts +8 -2
- package/dist/agent/components/conversation-panel.d.ts.map +1 -1
- package/dist/agent/components/message-parts.d.ts +2 -1
- package/dist/agent/components/message-parts.d.ts.map +1 -1
- package/dist/agent/components/message-view.d.ts.map +1 -1
- package/dist/agent/components/pending-messages.d.ts +20 -0
- package/dist/agent/components/pending-messages.d.ts.map +1 -0
- package/dist/agent/components/sandbox-recovery.d.ts +11 -2
- package/dist/agent/components/sandbox-recovery.d.ts.map +1 -1
- package/dist/agent/components/threads-button.d.ts +1 -1
- package/dist/agent/components/threads-button.d.ts.map +1 -1
- package/dist/agent/components/transcript.d.ts +5 -0
- package/dist/agent/components/transcript.d.ts.map +1 -1
- package/dist/agent/conversation.d.ts +3 -6
- package/dist/agent/conversation.d.ts.map +1 -1
- package/dist/agent/delegation/agent-exchange.d.ts +16 -0
- package/dist/agent/delegation/agent-exchange.d.ts.map +1 -0
- package/dist/agent/delegation/child-card.d.ts +3 -3
- package/dist/agent/delegation/child-card.d.ts.map +1 -1
- package/dist/agent/delegation/child-parts.d.ts +1 -10
- package/dist/agent/delegation/child-parts.d.ts.map +1 -1
- package/dist/agent/delegation/child-work.d.ts.map +1 -1
- package/dist/agent/delegation/interpret.d.ts +9 -10
- package/dist/agent/delegation/interpret.d.ts.map +1 -1
- package/dist/agent/delegation/use-children.d.ts.map +1 -1
- package/dist/agent/file-edits/file-edit-tool-view.d.ts +10 -0
- package/dist/agent/file-edits/file-edit-tool-view.d.ts.map +1 -0
- package/dist/agent/file-edits/interpret.d.ts +25 -0
- package/dist/agent/file-edits/interpret.d.ts.map +1 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts +16 -4
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
- package/dist/agent/hooks/use-thread-stream.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +114 -5
- package/dist/agent/i18n/en.d.ts.map +1 -1
- package/dist/agent/i18n/fr.d.ts.map +1 -1
- package/dist/agent/i18n/index.d.ts +190 -8
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/inbox-handoff.d.ts +10 -0
- package/dist/agent/inbox-handoff.d.ts.map +1 -0
- package/dist/agent/live-run.d.ts +8 -1
- package/dist/agent/live-run.d.ts.map +1 -1
- package/dist/agent/message-agent/interpret.d.ts +2 -2
- package/dist/agent/message-agent/interpret.d.ts.map +1 -1
- package/dist/agent/publish-artifact/interpret.d.ts +1 -1
- package/dist/agent/publish-artifact/interpret.d.ts.map +1 -1
- package/dist/agent/questions/interpret.d.ts +31 -0
- package/dist/agent/questions/interpret.d.ts.map +1 -0
- package/dist/agent/questions/question-card.d.ts +16 -0
- package/dist/agent/questions/question-card.d.ts.map +1 -0
- package/dist/agent/questions/question-composer.d.ts +15 -0
- package/dist/agent/questions/question-composer.d.ts.map +1 -0
- package/dist/agent/read/interpret.d.ts +8 -1
- package/dist/agent/read/interpret.d.ts.map +1 -1
- package/dist/agent/read/read-tool-view.d.ts.map +1 -1
- package/dist/agent/search/interpret.d.ts +101 -0
- package/dist/agent/search/interpret.d.ts.map +1 -0
- package/dist/agent/search/search-tool-view.d.ts +10 -0
- package/dist/agent/search/search-tool-view.d.ts.map +1 -0
- package/dist/agent/thread-state.d.ts +26 -0
- package/dist/agent/thread-state.d.ts.map +1 -0
- package/dist/agent/tool-views/built-in.d.ts.map +1 -1
- package/dist/agent/tool-views/registry.d.ts +5 -6
- package/dist/agent/tool-views/registry.d.ts.map +1 -1
- package/dist/agent/types.d.ts +5 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/view-file/view-file-tool-view.d.ts +2 -1
- package/dist/agent/view-file/view-file-tool-view.d.ts.map +1 -1
- package/dist/agent/waits.d.ts +14 -0
- package/dist/agent/waits.d.ts.map +1 -0
- package/dist/artifacts/card-preview.d.ts.map +1 -1
- package/dist/artifacts/edit-session.d.ts +11 -1
- package/dist/artifacts/edit-session.d.ts.map +1 -1
- package/dist/artifacts/editor/block-handle.d.ts +20 -0
- package/dist/artifacts/editor/block-handle.d.ts.map +1 -0
- package/dist/artifacts/editor/blocks.d.ts +34 -0
- package/dist/artifacts/editor/blocks.d.ts.map +1 -0
- package/dist/artifacts/editor/callout-view.d.ts +7 -0
- package/dist/artifacts/editor/callout-view.d.ts.map +1 -0
- package/dist/artifacts/editor/document-editor.d.ts +30 -0
- package/dist/artifacts/editor/document-editor.d.ts.map +1 -0
- package/dist/artifacts/editor/figure-view.d.ts +12 -0
- package/dist/artifacts/editor/figure-view.d.ts.map +1 -0
- package/dist/artifacts/editor/find-blocks.d.ts +6 -0
- package/dist/artifacts/editor/find-blocks.d.ts.map +1 -0
- package/dist/artifacts/editor/markdown-document.d.ts +12 -0
- package/dist/artifacts/editor/markdown-document.d.ts.map +1 -0
- package/dist/artifacts/editor/messages.d.ts +4 -0
- package/dist/artifacts/editor/messages.d.ts.map +1 -0
- package/dist/artifacts/editor/schema.d.ts +21 -0
- package/dist/artifacts/editor/schema.d.ts.map +1 -0
- package/dist/artifacts/editor/selection-toolbar.d.ts +35 -0
- package/dist/artifacts/editor/selection-toolbar.d.ts.map +1 -0
- package/dist/artifacts/editor/slash-menu.d.ts +43 -0
- package/dist/artifacts/editor/slash-menu.d.ts.map +1 -0
- package/dist/artifacts/editor/upload.d.ts +12 -0
- package/dist/artifacts/editor/upload.d.ts.map +1 -0
- package/dist/artifacts/file-source.d.ts +5 -0
- package/dist/artifacts/file-source.d.ts.map +1 -1
- package/dist/artifacts/frame-editor/bundle.d.ts +7 -0
- package/dist/artifacts/frame-editor/bundle.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/commands.d.ts +93 -0
- package/dist/artifacts/frame-editor/commands.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/entry.d.ts +2 -0
- package/dist/artifacts/frame-editor/entry.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/frame.d.ts +5 -0
- package/dist/artifacts/frame-editor/frame.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/keys.d.ts +8 -0
- package/dist/artifacts/frame-editor/keys.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/protocol.d.ts +186 -0
- package/dist/artifacts/frame-editor/protocol.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/schema.d.ts +34 -0
- package/dist/artifacts/frame-editor/schema.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/style.d.ts +2 -0
- package/dist/artifacts/frame-editor/style.d.ts.map +1 -0
- package/dist/artifacts/frame.d.ts +2 -2
- package/dist/artifacts/frame.d.ts.map +1 -1
- package/dist/artifacts/live/boards.d.ts +2 -0
- package/dist/artifacts/live/boards.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts +32 -0
- package/dist/artifacts/live/document.d.ts.map +1 -0
- package/dist/artifacts/live/header.d.ts +4 -4
- package/dist/artifacts/live/header.d.ts.map +1 -1
- package/dist/artifacts/live/presence.d.ts.map +1 -1
- package/dist/artifacts/live/session.d.ts +2 -0
- package/dist/artifacts/live/session.d.ts.map +1 -1
- package/dist/artifacts/live/view.d.ts +4 -3
- package/dist/artifacts/live/view.d.ts.map +1 -1
- package/dist/artifacts/messages.d.ts +278 -2
- package/dist/artifacts/messages.d.ts.map +1 -1
- package/dist/artifacts/pdf.d.ts +8 -0
- package/dist/artifacts/pdf.d.ts.map +1 -0
- package/dist/artifacts/queries.d.ts +80 -0
- package/dist/artifacts/queries.d.ts.map +1 -1
- package/dist/artifacts/references/references.d.ts +3 -3
- package/dist/artifacts/references/references.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/board-editor.d.ts +11 -4
- package/dist/artifacts/renderers/canvas/board-editor.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/board.d.ts +14 -2
- package/dist/artifacts/renderers/canvas/board.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/canvas.d.ts +4 -3
- package/dist/artifacts/renderers/canvas/canvas.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts +4 -2
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comments-panel.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comments.d.ts +2 -1
- package/dist/artifacts/renderers/canvas/comments.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/controls.d.ts +15 -4
- package/dist/artifacts/renderers/canvas/controls.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/focus.d.ts +19 -5
- package/dist/artifacts/renderers/canvas/focus.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/gestures.d.ts +46 -0
- package/dist/artifacts/renderers/canvas/gestures.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-resize.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/page-resize.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-size-controls.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/page-size-controls.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-size.d.ts +93 -0
- package/dist/artifacts/renderers/canvas/page-size.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-zoom.d.ts +64 -0
- package/dist/artifacts/renderers/canvas/page-zoom.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/shown-size.d.ts +26 -0
- package/dist/artifacts/renderers/canvas/shown-size.d.ts.map +1 -0
- package/dist/artifacts/renderers/designed-document.d.ts +28 -0
- package/dist/artifacts/renderers/designed-document.d.ts.map +1 -0
- package/dist/artifacts/renderers/document-tree.d.ts +2 -0
- package/dist/artifacts/renderers/document-tree.d.ts.map +1 -1
- package/dist/artifacts/renderers/document.d.ts +9 -1
- package/dist/artifacts/renderers/document.d.ts.map +1 -1
- package/dist/artifacts/renderers/live-frame.d.ts +145 -0
- package/dist/artifacts/renderers/live-frame.d.ts.map +1 -0
- package/dist/artifacts/renderers/page-editor.d.ts +16 -0
- package/dist/artifacts/renderers/page-editor.d.ts.map +1 -0
- package/dist/artifacts/renderers/page.d.ts +10 -1
- package/dist/artifacts/renderers/page.d.ts.map +1 -1
- package/dist/artifacts/viewer.d.ts.map +1 -1
- package/dist/{chunk-001c4gnk.js → chunk-4fex83k2.js} +19965 -13027
- package/dist/chunk-4fex83k2.js.map +239 -0
- package/dist/{chunk-5crvhjp2.js → chunk-4wm09prf.js} +1633 -1999
- package/dist/chunk-4wm09prf.js.map +27 -0
- package/dist/{chunk-fwb9mxwm.js → chunk-5sgac68y.js} +1 -1
- package/dist/{chunk-kes4ygmz.js → chunk-69qgh20f.js} +1 -1
- package/dist/chunk-y51c4tsz.js +11 -0
- package/dist/chunk-y51c4tsz.js.map +10 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +5 -5
- package/dist/pages/console/data/messages.d.ts +6 -0
- package/dist/pages/console/data/messages.d.ts.map +1 -1
- package/dist/pages/console/data/shared.d.ts.map +1 -1
- package/dist/pages.js +12 -5
- package/dist/pages.js.map +6 -6
- package/dist/shell/search-command.d.ts.map +1 -1
- package/package.json +22 -5
- package/src/agent/activity-label.ts +9 -1
- package/src/agent/agent-chat.tsx +57 -37
- package/src/agent/agent-execution-trace.tsx +2 -2
- package/src/agent/agent-panel.tsx +6 -4
- package/src/agent/agent.css +254 -0
- package/src/agent/artifact-panel.tsx +77 -22
- package/src/agent/background/background-tool-row.tsx +24 -10
- package/src/agent/background/interpret.ts +60 -51
- package/src/agent/components/composer-settings.tsx +20 -10
- package/src/agent/components/composer.tsx +342 -104
- package/src/agent/components/context-meter.tsx +7 -3
- package/src/agent/components/conversation-panel.tsx +96 -37
- package/src/agent/components/message-parts.tsx +390 -64
- package/src/agent/components/message-view.tsx +12 -2
- package/src/agent/components/pending-messages.tsx +338 -0
- package/src/agent/components/sandbox-recovery.tsx +36 -17
- package/src/agent/components/threads-button.tsx +3 -2
- package/src/agent/components/transcript.tsx +92 -45
- package/src/agent/conversation.ts +203 -54
- package/src/agent/delegation/agent-exchange.tsx +53 -0
- package/src/agent/delegation/child-card.tsx +6 -40
- package/src/agent/delegation/child-parts.tsx +1 -84
- package/src/agent/delegation/child-work.tsx +19 -5
- package/src/agent/delegation/interpret.ts +64 -61
- package/src/agent/delegation/model.ts +1 -1
- package/src/agent/file-edits/file-edit-tool-view.tsx +126 -0
- package/src/agent/file-edits/interpret.ts +120 -0
- package/src/agent/hooks/use-agent-conversation.ts +360 -92
- package/src/agent/hooks/use-thread-stream.ts +10 -0
- package/src/agent/i18n/en.ts +134 -16
- package/src/agent/i18n/fr.ts +122 -16
- package/src/agent/inbox-handoff.ts +47 -0
- package/src/agent/live-run.ts +23 -2
- package/src/agent/message-agent/interpret.ts +4 -3
- package/src/agent/publish-artifact/interpret.ts +14 -5
- package/src/agent/publish-artifact/publish-artifact-tool-view.tsx +2 -2
- package/src/agent/questions/interpret.ts +90 -0
- package/src/agent/questions/question-card.tsx +57 -0
- package/src/agent/questions/question-composer.tsx +257 -0
- package/src/agent/react-router.tsx +2 -2
- package/src/agent/read/interpret.ts +34 -1
- package/src/agent/read/read-tool-view.tsx +20 -4
- package/src/agent/search/interpret.ts +367 -0
- package/src/agent/search/search-tool-view.tsx +235 -0
- package/src/agent/thread-state.ts +114 -0
- package/src/agent/tool-views/built-in.tsx +33 -6
- package/src/agent/tool-views/registry.tsx +28 -2
- package/src/agent/types.ts +7 -0
- package/src/agent/view-file/view-file-tool-view.tsx +33 -19
- package/src/agent/waits.ts +50 -0
- package/src/artifacts/artifacts.css +434 -0
- package/src/artifacts/card-preview.tsx +6 -1
- package/src/artifacts/edit-session.tsx +15 -1
- package/src/artifacts/editor/block-handle.tsx +278 -0
- package/src/artifacts/editor/blocks.ts +216 -0
- package/src/artifacts/editor/callout-view.tsx +31 -0
- package/src/artifacts/editor/document-editor.tsx +484 -0
- package/src/artifacts/editor/figure-view.tsx +66 -0
- package/src/artifacts/editor/find-blocks.ts +19 -0
- package/src/artifacts/editor/markdown-document.tsx +72 -0
- package/src/artifacts/editor/messages.ts +4 -0
- package/src/artifacts/editor/schema.ts +159 -0
- package/src/artifacts/editor/selection-toolbar.tsx +364 -0
- package/src/artifacts/editor/slash-menu.tsx +251 -0
- package/src/artifacts/editor/upload.ts +40 -0
- package/src/artifacts/file-source.ts +11 -0
- package/src/artifacts/frame-editor/bundle.ts +8 -0
- package/src/artifacts/frame-editor/commands.ts +565 -0
- package/src/artifacts/frame-editor/entry.ts +6 -0
- package/src/artifacts/frame-editor/frame.ts +847 -0
- package/src/artifacts/frame-editor/generated/editor.txt +149 -0
- package/src/artifacts/frame-editor/generated.d.ts +5 -0
- package/src/artifacts/frame-editor/keys.ts +323 -0
- package/src/artifacts/frame-editor/protocol.ts +151 -0
- package/src/artifacts/frame-editor/schema.ts +293 -0
- package/src/artifacts/frame-editor/style.ts +58 -0
- package/src/artifacts/frame.tsx +14 -5
- package/src/artifacts/live/boards.ts +46 -3
- package/src/artifacts/live/document.ts +89 -0
- package/src/artifacts/live/header.tsx +9 -14
- package/src/artifacts/live/presence.ts +5 -1
- package/src/artifacts/live/session.ts +4 -2
- package/src/artifacts/live/view.ts +14 -8
- package/src/artifacts/messages.ts +192 -2
- package/src/artifacts/pdf.ts +50 -0
- package/src/artifacts/references/references.tsx +46 -11
- package/src/artifacts/renderers/canvas/board-editor.tsx +44 -155
- package/src/artifacts/renderers/canvas/board.tsx +70 -8
- package/src/artifacts/renderers/canvas/canvas.tsx +66 -15
- package/src/artifacts/renderers/canvas/comment-pins.tsx +5 -0
- package/src/artifacts/renderers/canvas/comments-panel.tsx +58 -1
- package/src/artifacts/renderers/canvas/comments.ts +8 -4
- package/src/artifacts/renderers/canvas/controls.tsx +64 -30
- package/src/artifacts/renderers/canvas/focus.tsx +200 -56
- package/src/artifacts/renderers/canvas/gestures.ts +265 -0
- package/src/artifacts/renderers/canvas/page-resize.tsx +542 -0
- package/src/artifacts/renderers/canvas/page-size-controls.tsx +193 -0
- package/src/artifacts/renderers/canvas/page-size.ts +218 -0
- package/src/artifacts/renderers/canvas/page-zoom.ts +280 -0
- package/src/artifacts/renderers/canvas/shown-size.ts +105 -0
- package/src/artifacts/renderers/designed-document.tsx +277 -0
- package/src/artifacts/renderers/document-tree.ts +9 -0
- package/src/artifacts/renderers/document.tsx +13 -102
- package/src/artifacts/renderers/live-frame.ts +163 -0
- package/src/artifacts/renderers/page-editor.tsx +613 -0
- package/src/artifacts/renderers/page.tsx +21 -4
- package/src/artifacts/viewer.tsx +101 -41
- package/src/index.ts +8 -0
- package/src/pages/console/data/messages.ts +6 -0
- package/src/pages/console/data/projections.tsx +4 -0
- package/src/pages/console/data/shared.tsx +1 -0
- package/src/pages/console/ontology/lineage/trail.tsx +3 -0
- package/src/shell/search-command.tsx +2 -0
- package/dist/chunk-001c4gnk.js.map +0 -204
- package/dist/chunk-5crvhjp2.js.map +0 -28
- /package/dist/{chunk-fwb9mxwm.js.map → chunk-5sgac68y.js.map} +0 -0
- /package/dist/{chunk-kes4ygmz.js.map → chunk-69qgh20f.js.map} +0 -0
|
@@ -1,8 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Collapsible,
|
|
3
|
+
CollapsibleContent,
|
|
4
|
+
CollapsibleTrigger,
|
|
5
|
+
Drawer,
|
|
6
|
+
DrawerContent,
|
|
7
|
+
DrawerDescription,
|
|
8
|
+
DrawerTitle,
|
|
9
|
+
DrawerTrigger,
|
|
10
|
+
Markdown,
|
|
11
|
+
type MarkdownProps,
|
|
12
|
+
PHONE_QUERY,
|
|
13
|
+
} from "@sixb/ui/components"
|
|
2
14
|
import { useLocale } from "@sixb/ui/lib/i18n"
|
|
3
15
|
import { cn } from "@sixb/ui/lib/utils"
|
|
4
|
-
import {
|
|
5
|
-
|
|
16
|
+
import {
|
|
17
|
+
ArrowDown,
|
|
18
|
+
ArrowUpRight,
|
|
19
|
+
BookmarkCheck,
|
|
20
|
+
ChevronRight,
|
|
21
|
+
FileX,
|
|
22
|
+
Wrench,
|
|
23
|
+
X,
|
|
24
|
+
} from "lucide-react"
|
|
25
|
+
import {
|
|
26
|
+
memo,
|
|
27
|
+
type ReactNode,
|
|
28
|
+
useCallback,
|
|
29
|
+
useEffect,
|
|
30
|
+
useLayoutEffect,
|
|
31
|
+
useRef,
|
|
32
|
+
useState,
|
|
33
|
+
type WheelEvent,
|
|
34
|
+
} from "react"
|
|
6
35
|
import { formatFileSize } from "../../artifacts/file-size"
|
|
7
36
|
import { ReferencingMarkdown } from "../../artifacts/references/references"
|
|
8
37
|
import { viewerTargetKey } from "../../artifacts/target"
|
|
@@ -13,6 +42,7 @@ import { useArtifactPanel } from "../artifact-panel"
|
|
|
13
42
|
import { generatedMedia } from "../bash/bash-tool-view"
|
|
14
43
|
import { savedMemories } from "../bash/interpret"
|
|
15
44
|
import { ModelMediaView } from "../bash/model-media-view"
|
|
45
|
+
import { ChildAsked } from "../delegation/agent-exchange"
|
|
16
46
|
import { ChildCards } from "../delegation/child-cards"
|
|
17
47
|
import { describeDelegationTool, spawnedChildren } from "../delegation/interpret"
|
|
18
48
|
import { useAgentMessages } from "../i18n"
|
|
@@ -24,16 +54,21 @@ import {
|
|
|
24
54
|
toolResultValue,
|
|
25
55
|
} from "../parts"
|
|
26
56
|
import { turnArtifacts, unpublishedTitles } from "../publish-artifact/interpret"
|
|
57
|
+
import { isAskTool } from "../questions/interpret"
|
|
58
|
+
import { QuestionCards } from "../questions/question-card"
|
|
27
59
|
import { builtInToolView } from "../tool-views/built-in"
|
|
28
60
|
import { AnswerToolViews, ProjectToolView, useAgentToolView } from "../tool-views/registry"
|
|
29
61
|
import { coerceWebSearchOutput, collectWebSources } from "../utils/web-search"
|
|
62
|
+
import { waitsForChildren } from "../waits"
|
|
30
63
|
import { ACTIVITY_STATUS_ROW_CLASS_NAME, ActivityStatusText } from "./activity-status"
|
|
31
64
|
import { ApprovalCards } from "./approval-card"
|
|
32
65
|
import { FileAttachmentCard } from "./file-attachment-card"
|
|
33
66
|
import { WebSources } from "./web-sources"
|
|
34
67
|
|
|
35
68
|
/** Calls a sub-agent's row stands for, in the conversation and in its thread. */
|
|
36
|
-
|
|
69
|
+
function isDelegationRow(tool: NormalizedTool): boolean {
|
|
70
|
+
return tool.toolName === "spawn_agent" || waitsForChildren(tool)
|
|
71
|
+
}
|
|
37
72
|
|
|
38
73
|
/**
|
|
39
74
|
* Render an assistant body from normalized parts. Narration text stays on the main reading path;
|
|
@@ -87,9 +122,9 @@ export function AssistantBody({
|
|
|
87
122
|
(part) =>
|
|
88
123
|
!(
|
|
89
124
|
part.kind === "tool" &&
|
|
90
|
-
((
|
|
91
|
-
|
|
92
|
-
(!nested &&
|
|
125
|
+
((isDelegationRow(part.tool) && childQuestions(part.tool).length === 0) ||
|
|
126
|
+
(!nested && heldCallsInParts([part]).length > 0) ||
|
|
127
|
+
(!nested && part.tool.toolName === "ask"))
|
|
93
128
|
)
|
|
94
129
|
)
|
|
95
130
|
if (shown.some((part) => part.kind !== "step-start")) {
|
|
@@ -101,6 +136,11 @@ export function AssistantBody({
|
|
|
101
136
|
|
|
102
137
|
const held = heldCallsInParts(work)
|
|
103
138
|
if (held.length > 0) blocks.push(<ApprovalCards key={`approvals-${key++}`} calls={held} />)
|
|
139
|
+
// The Agent's questions to the user are the reply's last word, each a card to answer.
|
|
140
|
+
const asked = work.flatMap((part) =>
|
|
141
|
+
part.kind === "tool" && part.tool.toolName === "ask" ? [part.tool] : []
|
|
142
|
+
)
|
|
143
|
+
if (asked.length > 0) blocks.push(<QuestionCards key={`questions-${key++}`} tools={asked} />)
|
|
104
144
|
const spawned = spawnedChildren(work)
|
|
105
145
|
if (spawned.length > 0) blocks.push(<ChildCards key={`children-${key++}`} spawned={spawned} />)
|
|
106
146
|
}
|
|
@@ -120,6 +160,13 @@ export function AssistantBody({
|
|
|
120
160
|
blocks.push(<FileBlock key={`block-${key++}`} part={part} />)
|
|
121
161
|
return
|
|
122
162
|
}
|
|
163
|
+
// In a sub-agent's panel, its question to the Agent is part of the conversation, not the work.
|
|
164
|
+
if (nested && part.kind === "tool" && isAskTool(part.tool.toolName)) {
|
|
165
|
+
flushText()
|
|
166
|
+
flushWork(false)
|
|
167
|
+
blocks.push(<ChildAsked key={`block-${key++}`} tool={part.tool} />)
|
|
168
|
+
return
|
|
169
|
+
}
|
|
123
170
|
// reasoning | tool | step-start — buffered together into one work run.
|
|
124
171
|
flushText()
|
|
125
172
|
workBuffer.push(part)
|
|
@@ -196,18 +243,48 @@ const FileBlock = memo(function FileBlock({
|
|
|
196
243
|
* the newest step, keeping the main transcript informative without exposing debug detail. Inside,
|
|
197
244
|
* items flow in one indented column and can expand inline when deeper inspection is useful.
|
|
198
245
|
*/
|
|
199
|
-
|
|
200
|
-
parts
|
|
201
|
-
inProgress
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
246
|
+
interface WorkGroupProps {
|
|
247
|
+
readonly parts: readonly NormalizedPart[]
|
|
248
|
+
readonly inProgress: boolean
|
|
249
|
+
/** In a sub-agent's thread: closed like the chat's work line, without an inner scroll. */
|
|
250
|
+
readonly nested?: boolean
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function sameElements<T>(a: readonly T[], b: readonly T[]): boolean {
|
|
254
|
+
if (a === b) return true
|
|
255
|
+
if (a.length !== b.length) return false
|
|
256
|
+
for (let i = 0; i < a.length; i++) {
|
|
257
|
+
if (!Object.is(a[i], b[i])) return false
|
|
258
|
+
}
|
|
259
|
+
return true
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const DETACH_THRESHOLD_PX = 24
|
|
263
|
+
const REATTACH_THRESHOLD_PX = 12
|
|
264
|
+
const REASONING_COMPONENTS: MarkdownProps["components"] = { img: () => null }
|
|
265
|
+
|
|
266
|
+
function usePhoneSheet(enabled: boolean): boolean {
|
|
267
|
+
const [phone, setPhone] = useState(false)
|
|
268
|
+
|
|
269
|
+
useEffect(() => {
|
|
270
|
+
if (!enabled || typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
271
|
+
setPhone(false)
|
|
272
|
+
return
|
|
273
|
+
}
|
|
274
|
+
const mql = window.matchMedia(PHONE_QUERY)
|
|
275
|
+
const onChange = () => setPhone(mql.matches)
|
|
276
|
+
setPhone(mql.matches)
|
|
277
|
+
mql.addEventListener("change", onChange)
|
|
278
|
+
return () => mql.removeEventListener("change", onChange)
|
|
279
|
+
}, [enabled])
|
|
280
|
+
|
|
281
|
+
return enabled && phone
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function WorkGroupView({ parts, inProgress, nested = false }: WorkGroupProps) {
|
|
209
285
|
const messages = useAgentMessages()
|
|
210
286
|
const [open, setOpen] = useState(false)
|
|
287
|
+
const phoneSheet = usePhoneSheet(!nested)
|
|
211
288
|
const sources = collectWebSources(parts)
|
|
212
289
|
const searches = parts.flatMap((part) =>
|
|
213
290
|
part.kind === "tool" && part.tool.toolName === "web_search" ? [part.tool] : []
|
|
@@ -232,39 +309,16 @@ function WorkGroup({
|
|
|
232
309
|
// while it waits on the reader, and once it is done.
|
|
233
310
|
const label = hasTools ? messages.activity.steps(toolCount) : messages.activity.reasoning
|
|
234
311
|
|
|
235
|
-
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
) : (
|
|
246
|
-
<span>{label}</span>
|
|
247
|
-
)}
|
|
248
|
-
<ChevronRight className="size-3.5 shrink-0 opacity-50 transition-all group-hover:opacity-100 group-focus-visible:opacity-100 group-data-[state=open]:rotate-90 group-data-[state=open]:opacity-100" />
|
|
249
|
-
</CollapsibleTrigger>
|
|
250
|
-
<CollapsibleContent>
|
|
251
|
-
<div
|
|
252
|
-
className={cn(
|
|
253
|
-
"mt-2 ml-1 flex flex-col gap-3 border-l border-border py-0.5 pr-2 pl-3.5",
|
|
254
|
-
!nested && "scrollbar-thin max-h-[min(24rem,50vh)] overflow-y-auto overscroll-contain"
|
|
255
|
-
)}
|
|
256
|
-
>
|
|
257
|
-
{parts.map((part, index) => {
|
|
258
|
-
if (part.kind === "reasoning") {
|
|
259
|
-
return <GroupReasoning key={index} text={part.text} streaming={part.streaming} />
|
|
260
|
-
}
|
|
261
|
-
if (part.kind === "tool") {
|
|
262
|
-
return <ToolCallRow key={index} tool={part.tool} parts={parts} />
|
|
263
|
-
}
|
|
264
|
-
return null
|
|
265
|
-
})}
|
|
266
|
-
</div>
|
|
267
|
-
</CollapsibleContent>
|
|
312
|
+
const triggerLabel = inProgress ? (
|
|
313
|
+
<ActivityStatusText label={liveLabel} className="shimmer motion-reduce:animate-none" />
|
|
314
|
+
) : (
|
|
315
|
+
<span>{label}</span>
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
const stepsContent = <WorkStepsList parts={parts} />
|
|
319
|
+
|
|
320
|
+
const afterTrigger = (
|
|
321
|
+
<>
|
|
268
322
|
{made.length > 0 ? (
|
|
269
323
|
<div className="mt-3 flex flex-col gap-5">
|
|
270
324
|
{made.map(({ media, running }, index) => (
|
|
@@ -282,20 +336,287 @@ function WorkGroup({
|
|
|
282
336
|
{searchFailed ? messages.activity.searchFailedHint : messages.activity.noSources}
|
|
283
337
|
</p>
|
|
284
338
|
) : null}
|
|
339
|
+
</>
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
if (phoneSheet) {
|
|
343
|
+
return (
|
|
344
|
+
<div className="max-w-full">
|
|
345
|
+
<Drawer open={open} onOpenChange={setOpen}>
|
|
346
|
+
<DrawerTrigger asChild>
|
|
347
|
+
<button
|
|
348
|
+
type="button"
|
|
349
|
+
data-state={open ? "open" : "closed"}
|
|
350
|
+
className={cn(
|
|
351
|
+
ACTIVITY_STATUS_ROW_CLASS_NAME,
|
|
352
|
+
"outline-none transition-colors hover:bg-muted/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
|
|
353
|
+
)}
|
|
354
|
+
>
|
|
355
|
+
{triggerLabel}
|
|
356
|
+
<ChevronRight className="size-3.5 shrink-0 opacity-50 transition-all group-hover:opacity-100 group-focus-visible:opacity-100 group-data-[state=open]:rotate-90 group-data-[state=open]:opacity-100" />
|
|
357
|
+
</button>
|
|
358
|
+
</DrawerTrigger>
|
|
359
|
+
<DrawerContent data-work-sheet="" className="max-h-[82dvh] outline-none">
|
|
360
|
+
<div className="flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-4 pt-3 pb-2.5">
|
|
361
|
+
<div className="flex min-w-0 flex-1 items-center gap-2">
|
|
362
|
+
<DrawerTitle className="min-w-0 truncate text-sm font-semibold text-foreground">
|
|
363
|
+
{inProgress ? (
|
|
364
|
+
<ActivityStatusText
|
|
365
|
+
label={liveLabel}
|
|
366
|
+
className="shimmer motion-reduce:animate-none"
|
|
367
|
+
/>
|
|
368
|
+
) : (
|
|
369
|
+
label
|
|
370
|
+
)}
|
|
371
|
+
</DrawerTitle>
|
|
372
|
+
{inProgress && hasTools ? (
|
|
373
|
+
<span className="shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium tabular-nums text-muted-foreground">
|
|
374
|
+
{label}
|
|
375
|
+
</span>
|
|
376
|
+
) : null}
|
|
377
|
+
</div>
|
|
378
|
+
<DrawerDescription className="sr-only">{label}</DrawerDescription>
|
|
379
|
+
<button
|
|
380
|
+
type="button"
|
|
381
|
+
onClick={() => setOpen(false)}
|
|
382
|
+
aria-label={messages.artifacts.close}
|
|
383
|
+
className="flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
384
|
+
>
|
|
385
|
+
<X className="size-4" aria-hidden="true" />
|
|
386
|
+
</button>
|
|
387
|
+
</div>
|
|
388
|
+
<WorkStepsScroll inProgress={inProgress} mobile>
|
|
389
|
+
{stepsContent}
|
|
390
|
+
</WorkStepsScroll>
|
|
391
|
+
</DrawerContent>
|
|
392
|
+
</Drawer>
|
|
393
|
+
{afterTrigger}
|
|
394
|
+
</div>
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return (
|
|
399
|
+
<Collapsible open={open} onOpenChange={setOpen} className="max-w-full">
|
|
400
|
+
<CollapsibleTrigger
|
|
401
|
+
className={cn(
|
|
402
|
+
ACTIVITY_STATUS_ROW_CLASS_NAME,
|
|
403
|
+
"outline-none transition-colors hover:bg-muted/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
|
|
404
|
+
)}
|
|
405
|
+
>
|
|
406
|
+
{triggerLabel}
|
|
407
|
+
<ChevronRight className="size-3.5 shrink-0 opacity-50 transition-all group-hover:opacity-100 group-focus-visible:opacity-100 group-data-[state=open]:rotate-90 group-data-[state=open]:opacity-100" />
|
|
408
|
+
</CollapsibleTrigger>
|
|
409
|
+
<CollapsibleContent>
|
|
410
|
+
{nested ? (
|
|
411
|
+
<div className="mt-2 ml-1 flex flex-col gap-3 border-l border-border py-0.5 pr-2 pl-3.5">
|
|
412
|
+
{stepsContent}
|
|
413
|
+
</div>
|
|
414
|
+
) : (
|
|
415
|
+
<WorkStepsScroll inProgress={inProgress}>{stepsContent}</WorkStepsScroll>
|
|
416
|
+
)}
|
|
417
|
+
</CollapsibleContent>
|
|
418
|
+
{afterTrigger}
|
|
285
419
|
</Collapsible>
|
|
286
420
|
)
|
|
287
421
|
}
|
|
288
422
|
|
|
289
|
-
|
|
290
|
-
|
|
423
|
+
function WorkStepsList({ parts }: { readonly parts: readonly NormalizedPart[] }) {
|
|
424
|
+
return (
|
|
425
|
+
<>
|
|
426
|
+
{parts.map((part, index) => {
|
|
427
|
+
if (part.kind === "reasoning") {
|
|
428
|
+
return <GroupReasoning key={index} text={part.text} streaming={part.streaming} />
|
|
429
|
+
}
|
|
430
|
+
if (part.kind === "tool") {
|
|
431
|
+
return <ToolCallRow key={index} tool={part.tool} parts={parts} />
|
|
432
|
+
}
|
|
433
|
+
return null
|
|
434
|
+
})}
|
|
435
|
+
</>
|
|
436
|
+
)
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function WorkStepsScroll({
|
|
440
|
+
inProgress,
|
|
441
|
+
mobile = false,
|
|
442
|
+
children,
|
|
443
|
+
}: {
|
|
444
|
+
readonly inProgress: boolean
|
|
445
|
+
readonly mobile?: boolean
|
|
446
|
+
readonly children: ReactNode
|
|
447
|
+
}) {
|
|
448
|
+
const messages = useAgentMessages().activity
|
|
449
|
+
const scrollRef = useRef<HTMLDivElement>(null)
|
|
450
|
+
const contentRef = useRef<HTMLDivElement>(null)
|
|
451
|
+
const followingRef = useRef(inProgress)
|
|
452
|
+
const lastScrollTopRef = useRef(0)
|
|
453
|
+
const [detached, setDetached] = useState(false)
|
|
454
|
+
|
|
455
|
+
const syncEdges = useCallback((box: HTMLDivElement) => {
|
|
456
|
+
const remaining = box.scrollHeight - box.scrollTop - box.clientHeight
|
|
457
|
+
box.toggleAttribute("data-fade-top", box.scrollTop > 2)
|
|
458
|
+
box.toggleAttribute("data-fade-bottom", remaining > 2)
|
|
459
|
+
return remaining
|
|
460
|
+
}, [])
|
|
461
|
+
|
|
462
|
+
const pinToBottom = useCallback(
|
|
463
|
+
(box: HTMLDivElement) => {
|
|
464
|
+
box.scrollTop = Math.max(0, box.scrollHeight - box.clientHeight)
|
|
465
|
+
lastScrollTopRef.current = box.scrollTop
|
|
466
|
+
syncEdges(box)
|
|
467
|
+
},
|
|
468
|
+
[syncEdges]
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
// Active turns open pinned to the live bottom before paint; settled turns open at the top.
|
|
472
|
+
useLayoutEffect(() => {
|
|
473
|
+
const box = scrollRef.current
|
|
474
|
+
if (!box) return
|
|
475
|
+
if (inProgress) {
|
|
476
|
+
followingRef.current = true
|
|
477
|
+
setDetached(false)
|
|
478
|
+
pinToBottom(box)
|
|
479
|
+
} else {
|
|
480
|
+
followingRef.current = false
|
|
481
|
+
setDetached(false)
|
|
482
|
+
lastScrollTopRef.current = box.scrollTop
|
|
483
|
+
syncEdges(box)
|
|
484
|
+
}
|
|
485
|
+
}, [inProgress, pinToBottom, syncEdges])
|
|
486
|
+
|
|
487
|
+
// Follow newly streamed reasoning deltas and tool rows until the reader scrolls upward.
|
|
488
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: children drives synchronous follow on stream updates
|
|
489
|
+
useLayoutEffect(() => {
|
|
490
|
+
const box = scrollRef.current
|
|
491
|
+
if (!box) return
|
|
492
|
+
if (inProgress && followingRef.current) {
|
|
493
|
+
pinToBottom(box)
|
|
494
|
+
} else {
|
|
495
|
+
syncEdges(box)
|
|
496
|
+
}
|
|
497
|
+
}, [children, inProgress, pinToBottom, syncEdges])
|
|
498
|
+
|
|
499
|
+
useEffect(() => {
|
|
500
|
+
const box = scrollRef.current
|
|
501
|
+
const inner = contentRef.current
|
|
502
|
+
if (!box || !inner) return
|
|
503
|
+
|
|
504
|
+
const onResize = () => {
|
|
505
|
+
if (inProgress && followingRef.current) {
|
|
506
|
+
pinToBottom(box)
|
|
507
|
+
} else {
|
|
508
|
+
const remaining = syncEdges(box)
|
|
509
|
+
if (inProgress && !followingRef.current && remaining > DETACH_THRESHOLD_PX) {
|
|
510
|
+
setDetached((prev) => (prev ? prev : true))
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const onScroll = () => {
|
|
516
|
+
const movedUp = box.scrollTop < lastScrollTopRef.current - 1
|
|
517
|
+
lastScrollTopRef.current = box.scrollTop
|
|
518
|
+
const remaining = syncEdges(box)
|
|
519
|
+
if (remaining <= REATTACH_THRESHOLD_PX) {
|
|
520
|
+
followingRef.current = true
|
|
521
|
+
setDetached((prev) => (prev ? false : prev))
|
|
522
|
+
} else if (movedUp && remaining > DETACH_THRESHOLD_PX) {
|
|
523
|
+
followingRef.current = false
|
|
524
|
+
if (inProgress) setDetached((prev) => (prev ? prev : true))
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
const observer = new ResizeObserver(onResize)
|
|
529
|
+
observer.observe(inner)
|
|
530
|
+
observer.observe(box)
|
|
531
|
+
box.addEventListener("scroll", onScroll, { passive: true })
|
|
532
|
+
return () => {
|
|
533
|
+
observer.disconnect()
|
|
534
|
+
box.removeEventListener("scroll", onScroll)
|
|
535
|
+
}
|
|
536
|
+
}, [inProgress, pinToBottom, syncEdges])
|
|
537
|
+
|
|
538
|
+
const releaseOnUpwardWheel = (event: WheelEvent<HTMLDivElement>) => {
|
|
539
|
+
if (event.deltaY >= 0) return
|
|
540
|
+
const box = scrollRef.current
|
|
541
|
+
if (!box || box.scrollHeight <= box.clientHeight) return
|
|
542
|
+
followingRef.current = false
|
|
543
|
+
if (inProgress && box.scrollHeight - box.scrollTop - box.clientHeight > REATTACH_THRESHOLD_PX) {
|
|
544
|
+
setDetached(true)
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
const jumpToLatest = () => {
|
|
549
|
+
const box = scrollRef.current
|
|
550
|
+
followingRef.current = true
|
|
551
|
+
setDetached(false)
|
|
552
|
+
if (box) pinToBottom(box)
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
return (
|
|
556
|
+
<div className={cn("relative min-h-0", mobile && "flex flex-1 flex-col")}>
|
|
557
|
+
<div
|
|
558
|
+
ref={scrollRef}
|
|
559
|
+
data-work-scroll=""
|
|
560
|
+
onWheel={releaseOnUpwardWheel}
|
|
561
|
+
className={cn(
|
|
562
|
+
"sixb-work-scroll scrollbar-thin overflow-y-auto overscroll-contain",
|
|
563
|
+
mobile
|
|
564
|
+
? "max-h-[min(64dvh,32rem)] px-4 pt-3 pb-[max(1rem,env(safe-area-inset-bottom))]"
|
|
565
|
+
: "mt-2 ml-1 max-h-[min(24rem,50vh)] border-l border-border py-0.5 pr-2 pl-3.5"
|
|
566
|
+
)}
|
|
567
|
+
>
|
|
568
|
+
<div ref={contentRef} className="flex flex-col gap-3">
|
|
569
|
+
{children}
|
|
570
|
+
</div>
|
|
571
|
+
</div>
|
|
572
|
+
{inProgress && detached ? (
|
|
573
|
+
<button
|
|
574
|
+
type="button"
|
|
575
|
+
data-work-latest=""
|
|
576
|
+
onClick={jumpToLatest}
|
|
577
|
+
className="sixb-work-latest absolute bottom-2 left-1/2 z-10 flex h-7 -translate-x-1/2 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium text-foreground outline-none transition-transform hover:scale-[1.02] active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-ring"
|
|
578
|
+
>
|
|
579
|
+
<span
|
|
580
|
+
className="size-1.5 rounded-full bg-sky-500 motion-safe:animate-pulse"
|
|
581
|
+
aria-hidden="true"
|
|
582
|
+
/>
|
|
583
|
+
<span>{messages.latest}</span>
|
|
584
|
+
<ArrowDown className="size-3 text-muted-foreground" aria-hidden="true" />
|
|
585
|
+
</button>
|
|
586
|
+
) : null}
|
|
587
|
+
</div>
|
|
588
|
+
)
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function sameWorkGroup(prev: WorkGroupProps, next: WorkGroupProps): boolean {
|
|
592
|
+
return (
|
|
593
|
+
prev.inProgress === next.inProgress &&
|
|
594
|
+
(prev.nested ?? false) === (next.nested ?? false) &&
|
|
595
|
+
sameElements(prev.parts, next.parts)
|
|
596
|
+
)
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
const WorkGroup = memo(WorkGroupView, sameWorkGroup)
|
|
600
|
+
|
|
601
|
+
/** Reasoning inside a work group: structured Markdown notes subordinate to the main answer. */
|
|
602
|
+
const GroupReasoning = memo(function GroupReasoning({
|
|
603
|
+
text,
|
|
604
|
+
streaming,
|
|
605
|
+
}: {
|
|
606
|
+
text: string
|
|
607
|
+
streaming: boolean
|
|
608
|
+
}) {
|
|
291
609
|
if (!text.trim()) return null
|
|
292
610
|
return (
|
|
293
|
-
<
|
|
611
|
+
<Markdown
|
|
612
|
+
className="sixb-reasoning-prose"
|
|
613
|
+
components={REASONING_COMPONENTS}
|
|
614
|
+
data-streaming={streaming ? "true" : undefined}
|
|
615
|
+
>
|
|
294
616
|
{text}
|
|
295
|
-
|
|
296
|
-
</p>
|
|
617
|
+
</Markdown>
|
|
297
618
|
)
|
|
298
|
-
}
|
|
619
|
+
})
|
|
299
620
|
|
|
300
621
|
/**
|
|
301
622
|
* A single tool call within a work group. A project view placed in the work takes the row; else
|
|
@@ -303,14 +624,13 @@ function GroupReasoning({ text, streaming }: { text: string; streaming: boolean
|
|
|
303
624
|
* inspector. All keep their bodies borderless and inline so an expanded result flows within the
|
|
304
625
|
* group rather than reading as a nested dropdown.
|
|
305
626
|
*/
|
|
306
|
-
|
|
307
|
-
tool
|
|
308
|
-
parts,
|
|
309
|
-
}: {
|
|
310
|
-
tool: NormalizedTool
|
|
627
|
+
interface ToolCallRowProps {
|
|
628
|
+
readonly tool: NormalizedTool
|
|
311
629
|
/** The rest of its work, which names the children a wait is for. */
|
|
312
|
-
parts: readonly NormalizedPart[]
|
|
313
|
-
}
|
|
630
|
+
readonly parts: readonly NormalizedPart[]
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function ToolCallRowView({ tool, parts }: ToolCallRowProps) {
|
|
314
634
|
const view = useAgentToolView(tool.toolName)
|
|
315
635
|
const row =
|
|
316
636
|
view?.placement === "work" ? (
|
|
@@ -332,6 +652,12 @@ function ToolCallRow({
|
|
|
332
652
|
)
|
|
333
653
|
}
|
|
334
654
|
|
|
655
|
+
function sameToolCallRow(prev: ToolCallRowProps, next: ToolCallRowProps): boolean {
|
|
656
|
+
return Object.is(prev.tool, next.tool) && sameElements(prev.parts, next.parts)
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
const ToolCallRow = memo(ToolCallRowView, sameToolCallRow)
|
|
660
|
+
|
|
335
661
|
/**
|
|
336
662
|
* Under a call whose output was too large for the model's context, the whole output it saved: it
|
|
337
663
|
* opens beside the conversation, or in a new tab where there is no panel.
|
|
@@ -425,7 +751,7 @@ export function BuiltInToolRow({
|
|
|
425
751
|
className={cn(
|
|
426
752
|
"min-w-0 font-medium",
|
|
427
753
|
// A sub-agent's question reads in full.
|
|
428
|
-
tool.toolName
|
|
754
|
+
isAskTool(tool.toolName) ? "text-left break-words" : "truncate"
|
|
429
755
|
)}
|
|
430
756
|
>
|
|
431
757
|
{title}
|
|
@@ -20,11 +20,12 @@ import {
|
|
|
20
20
|
RotateCcw,
|
|
21
21
|
Unplug,
|
|
22
22
|
} from "lucide-react"
|
|
23
|
-
import { memo, type ReactNode } from "react"
|
|
23
|
+
import { memo, type ReactNode, useLayoutEffect, useRef } from "react"
|
|
24
24
|
import type { FileSource } from "../../artifacts/file-source"
|
|
25
25
|
import type { AgentConversationMessage } from "../conversation"
|
|
26
26
|
import { useAgentMessages } from "../i18n"
|
|
27
27
|
import type { AgentMessages } from "../i18n/en"
|
|
28
|
+
import { riseFromTray } from "../inbox-handoff"
|
|
28
29
|
import { type AuthorLabel, useMessageAuthors } from "../message-authors"
|
|
29
30
|
import { isContinuableDiagnostic } from "../run-presentation"
|
|
30
31
|
import type { AgentFileRef } from "../types"
|
|
@@ -74,10 +75,19 @@ function UserMessage({
|
|
|
74
75
|
const text = textOf(message)
|
|
75
76
|
const files = message.parts.flatMap((part) => (part.type === "file" ? [part] : []))
|
|
76
77
|
const pending = message.status === "pending"
|
|
78
|
+
const ref = useRef<HTMLDivElement>(null)
|
|
79
|
+
|
|
80
|
+
// A message the turn just read comes from the tray into its place; its saved copy, which keeps
|
|
81
|
+
// the row, stays put.
|
|
82
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: only as it first appears
|
|
83
|
+
useLayoutEffect(() => {
|
|
84
|
+
if (message.status === "streaming" && ref.current) riseFromTray(ref.current, message.key)
|
|
85
|
+
}, [])
|
|
86
|
+
|
|
77
87
|
if (!text && files.length === 0 && message.context.length === 0) return null
|
|
78
88
|
|
|
79
89
|
return (
|
|
80
|
-
<div className="flex flex-col items-end gap-1.5">
|
|
90
|
+
<div ref={ref} className="flex flex-col items-end gap-1.5">
|
|
81
91
|
{continued ? null : <AuthorLine author={authors?.labelOf(message.author)} />}
|
|
82
92
|
<ContextChips
|
|
83
93
|
entries={message.context}
|