@sixb/app 0.1.13 → 0.1.15
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/README.md +6 -0
- package/dist/agent/activity-label.d.ts.map +1 -1
- package/dist/agent/agent-chat.d.ts +1 -1
- package/dist/agent/agent-chat.d.ts.map +1 -1
- package/dist/agent/agent-context-provider.d.ts +1 -0
- package/dist/agent/agent-context-provider.d.ts.map +1 -1
- package/dist/agent/approvals.d.ts +110 -0
- package/dist/agent/approvals.d.ts.map +1 -0
- package/dist/agent/artifact-panel.d.ts +11 -7
- package/dist/agent/artifact-panel.d.ts.map +1 -1
- package/dist/agent/bash/bash-tool-view.d.ts +13 -0
- package/dist/agent/bash/bash-tool-view.d.ts.map +1 -1
- package/dist/agent/bash/interpret.d.ts +46 -2
- package/dist/agent/bash/interpret.d.ts.map +1 -1
- package/dist/agent/bash/model-media-view.d.ts +14 -0
- package/dist/agent/bash/model-media-view.d.ts.map +1 -0
- package/dist/agent/bash/shell.d.ts.map +1 -1
- package/dist/agent/components/agent-message-body.d.ts +21 -0
- package/dist/agent/components/agent-message-body.d.ts.map +1 -0
- package/dist/agent/components/agent-thread-switcher.d.ts +22 -1
- package/dist/agent/components/agent-thread-switcher.d.ts.map +1 -1
- package/dist/agent/components/approval-card.d.ts +17 -0
- package/dist/agent/components/approval-card.d.ts.map +1 -0
- package/dist/agent/components/approval-mode-chip.d.ts +17 -0
- package/dist/agent/components/approval-mode-chip.d.ts.map +1 -0
- package/dist/agent/components/auto-model-chip.d.ts +24 -0
- package/dist/agent/components/auto-model-chip.d.ts.map +1 -0
- package/dist/agent/components/composer.d.ts +21 -2
- package/dist/agent/components/composer.d.ts.map +1 -1
- package/dist/agent/components/context-chips.d.ts +4 -2
- package/dist/agent/components/context-chips.d.ts.map +1 -1
- package/dist/agent/components/conversation-panel.d.ts +13 -55
- package/dist/agent/components/conversation-panel.d.ts.map +1 -1
- package/dist/agent/components/message-parts.d.ts +17 -3
- package/dist/agent/components/message-parts.d.ts.map +1 -1
- package/dist/agent/components/message-view.d.ts +19 -21
- package/dist/agent/components/message-view.d.ts.map +1 -1
- package/dist/agent/components/model-controls.d.ts +8 -2
- package/dist/agent/components/model-controls.d.ts.map +1 -1
- package/dist/agent/components/model-picker-row.d.ts +5 -1
- package/dist/agent/components/model-picker-row.d.ts.map +1 -1
- package/dist/agent/components/participant-input.d.ts +29 -0
- package/dist/agent/components/participant-input.d.ts.map +1 -0
- package/dist/agent/components/provider-logo.d.ts +5 -4
- package/dist/agent/components/provider-logo.d.ts.map +1 -1
- package/dist/agent/components/reasoning-effort-slider.d.ts +8 -7
- package/dist/agent/components/reasoning-effort-slider.d.ts.map +1 -1
- package/dist/agent/components/sandbox-recovery.d.ts +8 -2
- package/dist/agent/components/sandbox-recovery.d.ts.map +1 -1
- package/dist/agent/components/shared-thread-notice.d.ts +10 -0
- package/dist/agent/components/shared-thread-notice.d.ts.map +1 -0
- package/dist/agent/components/thread-artifacts-menu.d.ts +8 -2
- package/dist/agent/components/thread-artifacts-menu.d.ts.map +1 -1
- package/dist/agent/components/thread-people.d.ts +24 -0
- package/dist/agent/components/thread-people.d.ts.map +1 -0
- package/dist/agent/components/transcript.d.ts +22 -29
- package/dist/agent/components/transcript.d.ts.map +1 -1
- package/dist/agent/conversation.d.ts +201 -0
- package/dist/agent/conversation.d.ts.map +1 -0
- package/dist/agent/delegation/child-card.d.ts +19 -0
- package/dist/agent/delegation/child-card.d.ts.map +1 -0
- package/dist/agent/delegation/child-cards.d.ts +9 -0
- package/dist/agent/delegation/child-cards.d.ts.map +1 -0
- package/dist/agent/delegation/child-group.d.ts +14 -0
- package/dist/agent/delegation/child-group.d.ts.map +1 -0
- package/dist/agent/delegation/child-parts.d.ts +50 -0
- package/dist/agent/delegation/child-parts.d.ts.map +1 -0
- package/dist/agent/delegation/child-work.d.ts +31 -0
- package/dist/agent/delegation/child-work.d.ts.map +1 -0
- package/dist/agent/delegation/context.d.ts +22 -0
- package/dist/agent/delegation/context.d.ts.map +1 -0
- package/dist/agent/delegation/interpret.d.ts +104 -0
- package/dist/agent/delegation/interpret.d.ts.map +1 -0
- package/dist/agent/delegation/model.d.ts +52 -0
- package/dist/agent/delegation/model.d.ts.map +1 -0
- package/dist/agent/delegation/use-children.d.ts +1007 -0
- package/dist/agent/delegation/use-children.d.ts.map +1 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts +692 -131
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-thread-sharing.d.ts +35 -0
- package/dist/agent/hooks/use-thread-sharing.d.ts.map +1 -0
- package/dist/agent/i18n/en.d.ts +313 -0
- 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 +608 -0
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/live-run.d.ts.map +1 -1
- package/dist/agent/memory-paths.d.ts +18 -0
- package/dist/agent/memory-paths.d.ts.map +1 -0
- package/dist/agent/message-agent/interpret.d.ts +21 -0
- package/dist/agent/message-agent/interpret.d.ts.map +1 -0
- package/dist/agent/message-authors.d.ts +56 -0
- package/dist/agent/message-authors.d.ts.map +1 -0
- package/dist/agent/model-selection.d.ts +10 -0
- package/dist/agent/model-selection.d.ts.map +1 -1
- package/dist/agent/observed-conversation.d.ts +26 -0
- package/dist/agent/observed-conversation.d.ts.map +1 -0
- package/dist/agent/observed-thread.d.ts +9 -0
- package/dist/agent/observed-thread.d.ts.map +1 -0
- package/dist/agent/parts.d.ts +5 -0
- package/dist/agent/parts.d.ts.map +1 -1
- package/dist/agent/publish-artifact/use-live-publishes.d.ts +5 -2
- package/dist/agent/publish-artifact/use-live-publishes.d.ts.map +1 -1
- package/dist/agent/read/interpret.d.ts +2 -0
- package/dist/agent/read/interpret.d.ts.map +1 -1
- package/dist/agent/run-presentation.d.ts +11 -0
- package/dist/agent/run-presentation.d.ts.map +1 -1
- package/dist/agent/sharing.d.ts +42 -0
- package/dist/agent/sharing.d.ts.map +1 -0
- package/dist/agent/tool-views/built-in.d.ts +5 -0
- package/dist/agent/tool-views/built-in.d.ts.map +1 -0
- package/dist/agent/tool-views/define.d.ts +79 -0
- package/dist/agent/tool-views/define.d.ts.map +1 -0
- package/dist/agent/tool-views/registry.d.ts +28 -0
- package/dist/agent/tool-views/registry.d.ts.map +1 -0
- package/dist/agent/utils/radio-group.d.ts +11 -0
- package/dist/agent/utils/radio-group.d.ts.map +1 -0
- package/dist/artifacts/card-details.d.ts.map +1 -1
- package/dist/artifacts/card-preview.d.ts.map +1 -1
- package/dist/artifacts/downloads.d.ts +26 -0
- package/dist/artifacts/downloads.d.ts.map +1 -0
- package/dist/artifacts/edit-session.d.ts +36 -0
- package/dist/artifacts/edit-session.d.ts.map +1 -0
- package/dist/artifacts/file-source.d.ts +27 -1
- package/dist/artifacts/file-source.d.ts.map +1 -1
- package/dist/artifacts/file-type-icon.d.ts +14 -0
- package/dist/artifacts/file-type-icon.d.ts.map +1 -0
- package/dist/artifacts/frame-embeds.d.ts +20 -0
- package/dist/artifacts/frame-embeds.d.ts.map +1 -0
- package/dist/artifacts/frame.d.ts +12 -1
- package/dist/artifacts/frame.d.ts.map +1 -1
- package/dist/artifacts/gallery.d.ts.map +1 -1
- package/dist/artifacts/history.d.ts +15 -0
- package/dist/artifacts/history.d.ts.map +1 -0
- package/dist/artifacts/kind-icon.d.ts +7 -0
- package/dist/artifacts/kind-icon.d.ts.map +1 -1
- package/dist/artifacts/messages.d.ts +518 -4
- package/dist/artifacts/messages.d.ts.map +1 -1
- package/dist/artifacts/page-queries.d.ts +22 -0
- package/dist/artifacts/page-queries.d.ts.map +1 -0
- package/dist/artifacts/page-state.d.ts +21 -0
- package/dist/artifacts/page-state.d.ts.map +1 -0
- package/dist/artifacts/people.d.ts +12 -0
- package/dist/artifacts/people.d.ts.map +1 -0
- package/dist/artifacts/person-avatar.d.ts +23 -0
- package/dist/artifacts/person-avatar.d.ts.map +1 -0
- package/dist/artifacts/publish-edit.d.ts +29 -0
- package/dist/artifacts/publish-edit.d.ts.map +1 -0
- package/dist/artifacts/queries.d.ts +77 -1
- package/dist/artifacts/queries.d.ts.map +1 -1
- package/dist/artifacts/references/references.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/arrows.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/arrows.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board.d.ts +54 -0
- package/dist/artifacts/renderers/canvas/board.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/canvas.d.ts +27 -0
- package/dist/artifacts/renderers/canvas/canvas.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/controls.d.ts +8 -0
- package/dist/artifacts/renderers/canvas/controls.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/draft.d.ts +77 -0
- package/dist/artifacts/renderers/canvas/draft.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/edit-mode.d.ts +55 -0
- package/dist/artifacts/renderers/canvas/edit-mode.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/editing.d.ts +40 -0
- package/dist/artifacts/renderers/canvas/editing.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/focus.d.ts +15 -0
- package/dist/artifacts/renderers/canvas/focus.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/items.d.ts +13 -0
- package/dist/artifacts/renderers/canvas/items.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/layout.d.ts +46 -0
- package/dist/artifacts/renderers/canvas/layout.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/renderer.d.ts +13 -0
- package/dist/artifacts/renderers/canvas/renderer.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/thumbnail.d.ts +10 -0
- package/dist/artifacts/renderers/canvas/thumbnail.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/toolbar.d.ts +15 -0
- package/dist/artifacts/renderers/canvas/toolbar.d.ts.map +1 -0
- package/dist/artifacts/renderers/notice.d.ts.map +1 -1
- package/dist/artifacts/renderers/page.d.ts +34 -0
- package/dist/artifacts/renderers/page.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/cell-editor.d.ts +21 -0
- package/dist/artifacts/renderers/sheet/cell-editor.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/cells.d.ts +93 -0
- package/dist/artifacts/renderers/sheet/cells.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart-data.d.ts +27 -7
- package/dist/artifacts/renderers/sheet/chart-data.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/chart-icon.d.ts +5 -0
- package/dist/artifacts/renderers/sheet/chart-icon.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart-locked.d.ts +9 -0
- package/dist/artifacts/renderers/sheet/chart-locked.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart.d.ts +2 -1
- package/dist/artifacts/renderers/sheet/chart.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/column-format.d.ts +28 -0
- package/dist/artifacts/renderers/sheet/column-format.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/column-menu.d.ts +51 -0
- package/dist/artifacts/renderers/sheet/column-menu.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/downloads.d.ts +10 -0
- package/dist/artifacts/renderers/sheet/downloads.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/draft.d.ts +131 -0
- package/dist/artifacts/renderers/sheet/draft.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/filter-panel.d.ts +20 -0
- package/dist/artifacts/renderers/sheet/filter-panel.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/filter.d.ts +40 -0
- package/dist/artifacts/renderers/sheet/filter.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/find-bar.d.ts +42 -0
- package/dist/artifacts/renderers/sheet/find-bar.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/find.d.ts +18 -0
- package/dist/artifacts/renderers/sheet/find.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/fit.d.ts +15 -0
- package/dist/artifacts/renderers/sheet/fit.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/format.d.ts +14 -6
- package/dist/artifacts/renderers/sheet/format.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/frame.d.ts +69 -0
- package/dist/artifacts/renderers/sheet/frame.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/grid.d.ts +69 -6
- package/dist/artifacts/renderers/sheet/grid.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/highlight.d.ts +32 -0
- package/dist/artifacts/renderers/sheet/highlight.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/input.d.ts +30 -0
- package/dist/artifacts/renderers/sheet/input.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/locked.d.ts +17 -0
- package/dist/artifacts/renderers/sheet/locked.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/mini-chart.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/model.d.ts +26 -4
- package/dist/artifacts/renderers/sheet/model.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/selection.d.ts +30 -6
- package/dist/artifacts/renderers/sheet/selection.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/sheet.d.ts +5 -5
- package/dist/artifacts/renderers/sheet/sheet.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/totals.d.ts +16 -0
- package/dist/artifacts/renderers/sheet/totals.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/view.d.ts +44 -0
- package/dist/artifacts/renderers/sheet/view.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/workbook.d.ts +23 -3
- package/dist/artifacts/renderers/sheet/workbook.d.ts.map +1 -1
- package/dist/artifacts/renderers/sheet/xlsx.d.ts +18 -0
- package/dist/artifacts/renderers/sheet/xlsx.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/zip.d.ts +12 -0
- package/dist/artifacts/renderers/sheet/zip.d.ts.map +1 -0
- package/dist/artifacts/renderers/slides/slides.d.ts.map +1 -1
- package/dist/artifacts/tones.d.ts +4 -0
- package/dist/artifacts/tones.d.ts.map +1 -0
- package/dist/artifacts/viewer.d.ts +2 -0
- package/dist/artifacts/viewer.d.ts.map +1 -1
- package/dist/auth.d.ts +6 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/{chunk-gn3k23q5.js → chunk-53z5653y.js} +64 -3
- package/dist/chunk-53z5653y.js.map +11 -0
- package/dist/{chunk-3schcf10.js → chunk-736c9akn.js} +1 -1
- package/dist/{chunk-g3f4cm8x.js → chunk-k4epnkcr.js} +1 -1
- package/dist/{chunk-c7gy61rx.js → chunk-n0cxwvej.js} +165 -4
- package/dist/chunk-n0cxwvej.js.map +10 -0
- package/dist/chunk-qh1panvd.js +1487 -0
- package/dist/chunk-qh1panvd.js.map +18 -0
- package/dist/{chunk-ng0hdnrq.js → chunk-sw3pyqgy.js} +3 -1
- package/dist/chunk-sw3pyqgy.js.map +10 -0
- package/dist/chunk-twjs2sb9.js +29401 -0
- package/dist/chunk-twjs2sb9.js.map +176 -0
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts +1 -0
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +18 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -9
- package/dist/index.js.map +6 -6
- package/dist/locale-messages.d.ts +1 -0
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +1 -0
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +1 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/pages/observability/action-run.d.ts.map +1 -1
- package/dist/pages/observability/activity/messages.d.ts +14 -0
- package/dist/pages/observability/activity/messages.d.ts.map +1 -1
- package/dist/pages/observability/activity/thread.d.ts +6 -0
- package/dist/pages/observability/activity/thread.d.ts.map +1 -0
- package/dist/pages/observability/activity/timeline.d.ts.map +1 -1
- package/dist/pages/observability/ai-usage/calls.d.ts.map +1 -1
- package/dist/pages/observability/ai-usage/format.d.ts +16 -5
- package/dist/pages/observability/ai-usage/format.d.ts.map +1 -1
- package/dist/pages/observability/ai-usage/kinds.d.ts +40 -0
- package/dist/pages/observability/ai-usage/kinds.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/messages.d.ts +74 -12
- package/dist/pages/observability/ai-usage/messages.d.ts.map +1 -1
- package/dist/pages/observability/ai-usage/page.d.ts.map +1 -1
- package/dist/pages/observability/messages.d.ts +4 -0
- package/dist/pages/observability/messages.d.ts.map +1 -1
- package/dist/pages/ontology/actions.d.ts.map +1 -1
- package/dist/pages/ontology/components/action-button.d.ts +6 -0
- package/dist/pages/ontology/components/action-button.d.ts.map +1 -1
- package/dist/pages/ontology/components/user-picker.d.ts +37 -0
- package/dist/pages/ontology/components/user-picker.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/run-input-form.d.ts.map +1 -1
- package/dist/pages/routes.d.ts +2 -0
- package/dist/pages/routes.d.ts.map +1 -1
- package/dist/pages/section-page.d.ts +13 -0
- package/dist/pages/section-page.d.ts.map +1 -1
- package/dist/pages/section-ui.d.ts.map +1 -1
- package/dist/pages/settings/controls.d.ts.map +1 -1
- package/dist/pages/settings/members.d.ts.map +1 -1
- package/dist/pages/settings/memory-contents.d.ts +30 -0
- package/dist/pages/settings/memory-contents.d.ts.map +1 -0
- package/dist/pages/settings/memory-entries.d.ts +42 -0
- package/dist/pages/settings/memory-entries.d.ts.map +1 -0
- package/dist/pages/settings/memory-files.d.ts +49 -0
- package/dist/pages/settings/memory-files.d.ts.map +1 -0
- package/dist/pages/settings/memory-history.d.ts +8 -0
- package/dist/pages/settings/memory-history.d.ts.map +1 -0
- package/dist/pages/settings/memory.d.ts +21 -0
- package/dist/pages/settings/memory.d.ts.map +1 -0
- package/dist/pages/settings/messages.d.ts +206 -0
- package/dist/pages/settings/messages.d.ts.map +1 -1
- package/dist/pages/settings/personal.d.ts +2 -2
- package/dist/pages/settings/personal.d.ts.map +1 -1
- package/dist/pages/settings/sessions.d.ts.map +1 -1
- package/dist/pages/values.d.ts +1 -0
- package/dist/pages/values.d.ts.map +1 -1
- package/dist/pages.d.ts +13 -16
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +6766 -4391
- package/dist/pages.js.map +34 -28
- package/dist/sections/catalog.d.ts.map +1 -1
- package/dist/sections/sections.d.ts.map +1 -1
- package/dist/server.js +79 -44
- package/dist/server.js.map +5 -5
- package/package.json +4 -4
- package/src/agent/activity-label.ts +17 -2
- package/src/agent/agent-chat.tsx +81 -111
- package/src/agent/agent-context-provider.tsx +1 -0
- package/src/agent/agent-panel.tsx +4 -0
- package/src/agent/agent-surface.tsx +4 -0
- package/src/agent/agent.css +115 -3
- package/src/agent/approvals.ts +267 -0
- package/src/agent/artifact-panel.tsx +131 -46
- package/src/agent/bash/bash-tool-view.tsx +98 -6
- package/src/agent/bash/interpret.ts +265 -3
- package/src/agent/bash/model-media-view.tsx +474 -0
- package/src/agent/bash/shell.ts +3 -2
- package/src/agent/components/activity-status.tsx +1 -1
- package/src/agent/components/agent-message-body.tsx +56 -0
- package/src/agent/components/agent-threads.tsx +377 -0
- package/src/agent/components/approval-card.tsx +849 -0
- package/src/agent/components/approval-mode-chip.tsx +120 -0
- package/src/agent/components/auto-model-chip.tsx +219 -0
- package/src/agent/components/composer-menu.tsx +185 -0
- package/src/agent/components/composer.tsx +95 -30
- package/src/agent/components/context-chips.tsx +6 -7
- package/src/agent/components/conversation-panel.tsx +38 -180
- package/src/agent/components/file-attachment-card.tsx +5 -2
- package/src/agent/components/message-parts.tsx +190 -59
- package/src/agent/components/message-view.tsx +289 -228
- package/src/agent/components/model-controls.tsx +162 -128
- package/src/agent/components/model-picker-row.tsx +50 -11
- package/src/agent/components/participant-input.tsx +293 -0
- package/src/agent/components/provider-logo.tsx +6 -1
- package/src/agent/components/reasoning-effort-slider.tsx +37 -35
- package/src/agent/components/sandbox-recovery.tsx +24 -5
- package/src/agent/components/shared-thread-notice.tsx +34 -0
- package/src/agent/components/thread-artifacts-menu.tsx +29 -12
- package/src/agent/components/thread-people.tsx +551 -0
- package/src/agent/components/threads-button.tsx +70 -0
- package/src/agent/components/transcript.tsx +343 -147
- package/src/agent/conversation.ts +658 -0
- package/src/agent/delegation/child-card.tsx +338 -0
- package/src/agent/delegation/child-cards.tsx +141 -0
- package/src/agent/delegation/child-group.tsx +231 -0
- package/src/agent/delegation/child-parts.tsx +286 -0
- package/src/agent/delegation/child-work.tsx +198 -0
- package/src/agent/delegation/context.ts +28 -0
- package/src/agent/delegation/interpret.ts +379 -0
- package/src/agent/delegation/model.ts +235 -0
- package/src/agent/delegation/use-children.ts +235 -0
- package/src/agent/hooks/use-agent-conversation.ts +803 -125
- package/src/agent/hooks/use-people-suggestions.ts +90 -0
- package/src/agent/hooks/use-thread-lists.ts +77 -0
- package/src/agent/hooks/use-thread-sharing.ts +197 -0
- package/src/agent/i18n/en.ts +355 -20
- package/src/agent/i18n/fr.ts +371 -32
- package/src/agent/live-run.ts +23 -40
- package/src/agent/memory-paths.ts +41 -0
- package/src/agent/message-agent/interpret.ts +60 -0
- package/src/agent/message-authors.ts +115 -0
- package/src/agent/model-selection.ts +15 -0
- package/src/agent/observed-conversation.tsx +210 -0
- package/src/agent/observed-thread.ts +13 -0
- package/src/agent/parts.ts +23 -0
- package/src/agent/publish-artifact/use-live-publishes.ts +5 -2
- package/src/agent/react-router.tsx +48 -5
- package/src/agent/read/interpret.ts +18 -0
- package/src/agent/read/read-tool-view.tsx +2 -2
- package/src/agent/run-presentation.ts +41 -1
- package/src/agent/sharing.ts +95 -0
- package/src/agent/thread-navigation.ts +16 -0
- package/src/agent/thread-pages.ts +24 -0
- package/src/agent/tool-views/built-in.tsx +56 -0
- package/src/agent/tool-views/define.ts +150 -0
- package/src/agent/tool-views/registry.tsx +125 -0
- package/src/agent/utils/radio-group.ts +29 -0
- package/src/artifacts/artifacts.css +96 -0
- package/src/artifacts/card-details.ts +9 -1
- package/src/artifacts/card-preview.tsx +23 -12
- package/src/artifacts/downloads.tsx +130 -0
- package/src/artifacts/edit-session.tsx +115 -0
- package/src/artifacts/file-source.ts +94 -4
- package/src/artifacts/file-type-icon.tsx +114 -0
- package/src/artifacts/frame-embeds.tsx +113 -0
- package/src/artifacts/frame.tsx +143 -19
- package/src/artifacts/gallery.tsx +3 -0
- package/src/artifacts/history.ts +42 -0
- package/src/artifacts/kind-icon.tsx +31 -1
- package/src/artifacts/messages.ts +601 -16
- package/src/artifacts/page-queries.ts +80 -0
- package/src/artifacts/page-state.ts +211 -0
- package/src/artifacts/people.ts +19 -0
- package/src/artifacts/person-avatar.tsx +40 -0
- package/src/artifacts/publish-edit.ts +90 -0
- package/src/artifacts/queries.ts +242 -5
- package/src/artifacts/references/references.tsx +219 -18
- package/src/artifacts/renderers/canvas/arrows.tsx +134 -0
- package/src/artifacts/renderers/canvas/board.tsx +108 -0
- package/src/artifacts/renderers/canvas/canvas.tsx +195 -0
- package/src/artifacts/renderers/canvas/controls.tsx +75 -0
- package/src/artifacts/renderers/canvas/draft.ts +322 -0
- package/src/artifacts/renderers/canvas/edit-mode.tsx +301 -0
- package/src/artifacts/renderers/canvas/editing.tsx +187 -0
- package/src/artifacts/renderers/canvas/focus.tsx +128 -0
- package/src/artifacts/renderers/canvas/items.tsx +380 -0
- package/src/artifacts/renderers/canvas/layout.ts +132 -0
- package/src/artifacts/renderers/canvas/renderer.tsx +110 -0
- package/src/artifacts/renderers/canvas/thumbnail.tsx +144 -0
- package/src/artifacts/renderers/canvas/toolbar.tsx +316 -0
- package/src/artifacts/renderers/notice.tsx +3 -1
- package/src/artifacts/renderers/page.tsx +152 -0
- package/src/artifacts/renderers/sheet/cell-editor.tsx +125 -0
- package/src/artifacts/renderers/sheet/cells.tsx +462 -0
- package/src/artifacts/renderers/sheet/chart-data.ts +124 -14
- package/src/artifacts/renderers/sheet/chart-icon.ts +18 -0
- package/src/artifacts/renderers/sheet/chart-locked.tsx +30 -0
- package/src/artifacts/renderers/sheet/chart.tsx +153 -3
- package/src/artifacts/renderers/sheet/column-format.tsx +413 -0
- package/src/artifacts/renderers/sheet/column-menu.tsx +198 -0
- package/src/artifacts/renderers/sheet/downloads.tsx +88 -0
- package/src/artifacts/renderers/sheet/draft.ts +589 -0
- package/src/artifacts/renderers/sheet/filter-panel.tsx +255 -0
- package/src/artifacts/renderers/sheet/filter.ts +182 -0
- package/src/artifacts/renderers/sheet/find-bar.tsx +177 -0
- package/src/artifacts/renderers/sheet/find.ts +50 -0
- package/src/artifacts/renderers/sheet/fit.ts +54 -0
- package/src/artifacts/renderers/sheet/format.ts +48 -7
- package/src/artifacts/renderers/sheet/frame.tsx +531 -0
- package/src/artifacts/renderers/sheet/grid.tsx +1266 -287
- package/src/artifacts/renderers/sheet/highlight.ts +83 -0
- package/src/artifacts/renderers/sheet/input.ts +191 -0
- package/src/artifacts/renderers/sheet/locked.ts +112 -0
- package/src/artifacts/renderers/sheet/mini-chart.tsx +72 -4
- package/src/artifacts/renderers/sheet/model.ts +69 -8
- package/src/artifacts/renderers/sheet/selection.ts +136 -9
- package/src/artifacts/renderers/sheet/sheet.tsx +440 -264
- package/src/artifacts/renderers/sheet/totals.ts +54 -0
- package/src/artifacts/renderers/sheet/view.ts +96 -0
- package/src/artifacts/renderers/sheet/workbook.ts +107 -8
- package/src/artifacts/renderers/sheet/xlsx.ts +516 -0
- package/src/artifacts/renderers/sheet/zip.ts +108 -0
- package/src/artifacts/renderers/slides/slides.tsx +3 -55
- package/src/artifacts/tones.ts +14 -0
- package/src/artifacts/viewer.tsx +915 -96
- package/src/auth.ts +8 -2
- package/src/codegen.ts +29 -12
- package/src/createCustomApp.ts +72 -24
- package/src/index.ts +76 -2
- package/src/locale-messages.ts +2 -0
- package/src/metadata.ts +16 -3
- package/src/pages/home.tsx +3 -1
- package/src/pages/observability/action-run.tsx +5 -1
- package/src/pages/observability/activity/messages.ts +16 -0
- package/src/pages/observability/activity/thread.tsx +150 -0
- package/src/pages/observability/activity/timeline.tsx +40 -3
- package/src/pages/observability/ai-usage/calls.tsx +63 -19
- package/src/pages/observability/ai-usage/format.ts +61 -8
- package/src/pages/observability/ai-usage/kinds.tsx +156 -0
- package/src/pages/observability/ai-usage/messages.ts +91 -14
- package/src/pages/observability/ai-usage/page.tsx +157 -48
- package/src/pages/observability/messages.ts +3 -0
- package/src/pages/ontology/actions.tsx +25 -4
- package/src/pages/ontology/components/action-button.tsx +53 -17
- package/src/pages/ontology/components/user-picker.tsx +161 -0
- package/src/pages/ontology/object-type.tsx +6 -0
- package/src/pages/ontology/workflows/run-input-form.tsx +12 -1
- package/src/pages/routes.ts +5 -0
- package/src/pages/section-page.tsx +27 -0
- package/src/pages/section-ui.tsx +3 -2
- package/src/pages/settings/controls.tsx +10 -2
- package/src/pages/settings/members.tsx +1 -5
- package/src/pages/settings/memory-contents.tsx +173 -0
- package/src/pages/settings/memory-entries.ts +112 -0
- package/src/pages/settings/memory-files.ts +195 -0
- package/src/pages/settings/memory-history.tsx +560 -0
- package/src/pages/settings/memory.tsx +993 -0
- package/src/pages/settings/messages.ts +231 -2
- package/src/pages/settings/personal.tsx +247 -27
- package/src/pages/settings/service-accounts.tsx +1 -1
- package/src/pages/settings/sessions.tsx +1 -4
- package/src/pages/values.tsx +88 -11
- package/src/pages.ts +21 -27
- package/src/sections/catalog.ts +18 -1
- package/src/sections/sections.tsx +2 -0
- package/src/shell/agent-dock.tsx +4 -2
- package/dist/chunk-c7gy61rx.js.map +0 -10
- package/dist/chunk-gn3k23q5.js.map +0 -10
- package/dist/chunk-ng0hdnrq.js.map +0 -10
- package/dist/chunk-xxpdn63v.js +0 -15018
- package/dist/chunk-xxpdn63v.js.map +0 -105
- package/src/agent/agents-page.ts +0 -7
- package/src/agent/components/agent-thread-switcher.tsx +0 -346
- /package/dist/{chunk-3schcf10.js.map → chunk-736c9akn.js.map} +0 -0
- /package/dist/{chunk-g3f4cm8x.js.map → chunk-k4epnkcr.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@sixb/ui/components"
|
|
2
|
-
import { BookOpen, ChevronRight, FileText, type LucideIcon } from "lucide-react"
|
|
2
|
+
import { Bookmark, BookOpen, ChevronRight, FileText, type LucideIcon } from "lucide-react"
|
|
3
3
|
import { ActivityStatusText } from "../components/activity-status"
|
|
4
4
|
import { useAgentMessages } from "../i18n"
|
|
5
5
|
import type { NormalizedTool } from "../parts"
|
|
@@ -12,7 +12,7 @@ export function ReadToolView({ tool }: { tool: NormalizedTool }) {
|
|
|
12
12
|
const description = describeRead(input, output, messages)
|
|
13
13
|
const running = tool.state === "input-streaming" || tool.state === "input-available"
|
|
14
14
|
const error = tool.state === "output-error"
|
|
15
|
-
const Icon = description.skill ? BookOpen : FileText
|
|
15
|
+
const Icon = description.memory ? Bookmark : description.skill ? BookOpen : FileText
|
|
16
16
|
const label = error
|
|
17
17
|
? description.failedTitle
|
|
18
18
|
: running
|
|
@@ -32,6 +32,44 @@ export function findPreStreamFailedRun(
|
|
|
32
32
|
: latest
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/** Diagnostics of a turn that stopped short of its answer, which a continuation can finish. */
|
|
36
|
+
const CONTINUABLE_DIAGNOSTIC_CODES: ReadonlySet<string> = new Set([
|
|
37
|
+
"step_limit_reached",
|
|
38
|
+
"output_limit_reached",
|
|
39
|
+
])
|
|
40
|
+
|
|
41
|
+
export function isContinuableDiagnostic(code: string): boolean {
|
|
42
|
+
return CONTINUABLE_DIAGNOSTIC_CODES.has(code)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Whether the conversation offers Continue: a turn cut short with its progress saved, or, once
|
|
47
|
+
* nothing runs, a newest answer that stopped short of finishing — by its diagnostic, or because its
|
|
48
|
+
* run failed after saving it.
|
|
49
|
+
*/
|
|
50
|
+
export function offersContinue(input: {
|
|
51
|
+
readonly presentation: ActiveTurnPresentation
|
|
52
|
+
readonly isRunning: boolean
|
|
53
|
+
readonly sandboxRecovery: boolean
|
|
54
|
+
readonly messages: readonly AgentMessage[]
|
|
55
|
+
/** The newest run in the thread's history. */
|
|
56
|
+
readonly latestRun?: AgentRun | null
|
|
57
|
+
}): boolean {
|
|
58
|
+
const { presentation } = input
|
|
59
|
+
if (input.sandboxRecovery) return false
|
|
60
|
+
if (presentation.kind === "timeout" || presentation.kind === "interrupted") {
|
|
61
|
+
return presentation.hasProgress
|
|
62
|
+
}
|
|
63
|
+
const latest = input.messages.at(-1)
|
|
64
|
+
return (
|
|
65
|
+
presentation.kind === "idle" &&
|
|
66
|
+
!input.isRunning &&
|
|
67
|
+
latest?.role === "assistant" &&
|
|
68
|
+
(latest.annotations.some((annotation) => isContinuableDiagnostic(annotation.code)) ||
|
|
69
|
+
(input.latestRun?.status === "failed" && latest.runId === input.latestRun.id))
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
35
73
|
// ── Active turn presentation ─────────────────────────────────────────────────────────────────────
|
|
36
74
|
|
|
37
75
|
/** Pick the run the conversation should follow: pending send, thread claim, then durable history. */
|
|
@@ -148,8 +186,10 @@ export function presentActiveTurn(sources: ActiveTurnSources): ActiveTurnPresent
|
|
|
148
186
|
return { kind: "interrupted", run: interruptedRun, hasProgress }
|
|
149
187
|
}
|
|
150
188
|
|
|
189
|
+
// A run that failed after it streamed content answered in part: its reply says it did not finish.
|
|
190
|
+
const answeredLive = live.runId === presentationRun?.id && live.parts.length > 0
|
|
151
191
|
const failedFromHistory =
|
|
152
|
-
!messagesLoading && presentationRun?.status === "failed"
|
|
192
|
+
!messagesLoading && presentationRun?.status === "failed" && !answeredLive
|
|
153
193
|
? findPreStreamFailedRun(
|
|
154
194
|
presentationRun === latestRun ? runs : [presentationRun, ...runs],
|
|
155
195
|
messages
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { CurrentUser } from "../session"
|
|
2
|
+
import type { AgentRun, AgentThread } from "./types"
|
|
3
|
+
|
|
4
|
+
/** How the signed-in person takes part in a conversation: its owner, or someone it was shared with. */
|
|
5
|
+
export type ThreadAccess = "owner" | "participant"
|
|
6
|
+
|
|
7
|
+
/** Someone in a conversation, with the name their account shows when it has one. */
|
|
8
|
+
export interface ThreadPerson {
|
|
9
|
+
readonly principal: { readonly type: string; readonly id: string }
|
|
10
|
+
readonly displayName?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Principal {
|
|
14
|
+
readonly type: string
|
|
15
|
+
readonly id: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function samePrincipal(a: Principal | null | undefined, b: Principal | null | undefined) {
|
|
19
|
+
return Boolean(a && b && a.type === b.type && a.id === b.id)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function userPrincipal(user: CurrentUser | null): Principal | null {
|
|
23
|
+
return user ? { type: "user", id: user.id } : null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The reader's part in a thread. Without a signed-in user (auth off) the app acts for the project,
|
|
28
|
+
* which owns every conversation it can read.
|
|
29
|
+
*/
|
|
30
|
+
export function threadAccess(thread: AgentThread, user: CurrentUser | null): ThreadAccess {
|
|
31
|
+
const me = userPrincipal(user)
|
|
32
|
+
if (!me || samePrincipal(thread.ownerPrincipal, me)) return "owner"
|
|
33
|
+
|
|
34
|
+
return "participant"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The thread's owner, with their name. */
|
|
38
|
+
export function threadOwner(thread: AgentThread): ThreadPerson {
|
|
39
|
+
return {
|
|
40
|
+
principal: thread.ownerPrincipal,
|
|
41
|
+
...nameOf(thread.owner.displayName),
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The people the owner added, with their names. */
|
|
46
|
+
export function threadParticipants(thread: AgentThread): readonly ThreadPerson[] {
|
|
47
|
+
return thread.participants.map((participant) => ({
|
|
48
|
+
principal: participant.principal,
|
|
49
|
+
...nameOf(participant.principal.displayName),
|
|
50
|
+
}))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A person's name, or their id when their account has none, as #825 names authors. */
|
|
54
|
+
export function personName(person: ThreadPerson): string {
|
|
55
|
+
return person.displayName ?? person.principal.id
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Whether a conversation is read by more than its owner. */
|
|
59
|
+
export function isShared(thread: AgentThread | null): boolean {
|
|
60
|
+
return Boolean(thread && thread.participants.length > 0)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Who may retry a run: only whoever asked for it, as it runs again with their rights. Without a
|
|
65
|
+
* signed-in user the project decides; a signed-in reader never retries a run nobody asked for.
|
|
66
|
+
*/
|
|
67
|
+
export function canRetryRun(run: AgentRun, user: CurrentUser | null): boolean {
|
|
68
|
+
const me = userPrincipal(user)
|
|
69
|
+
if (!me) return true
|
|
70
|
+
|
|
71
|
+
return samePrincipal(run.requestedBy, me)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Whether someone other than the reader asked for a run, as far as the reader can tell. */
|
|
75
|
+
export function requestedBySomeoneElse(run: AgentRun | null, user: CurrentUser | null): boolean {
|
|
76
|
+
const me = userPrincipal(user)
|
|
77
|
+
|
|
78
|
+
return Boolean(me && run?.requestedBy && !samePrincipal(run.requestedBy, me))
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Who may stop an answer: the thread's owner any answer, a participant only their own. */
|
|
82
|
+
export function canStopRun(
|
|
83
|
+
run: AgentRun | null,
|
|
84
|
+
access: ThreadAccess,
|
|
85
|
+
user: CurrentUser | null
|
|
86
|
+
): boolean {
|
|
87
|
+
if (access === "owner") return true
|
|
88
|
+
if (!run) return false
|
|
89
|
+
|
|
90
|
+
return canRetryRun(run, user)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function nameOf(displayName: string | undefined) {
|
|
94
|
+
return displayName ? { displayName } : {}
|
|
95
|
+
}
|
|
@@ -9,3 +9,19 @@ export function agentThreadTitle(
|
|
|
9
9
|
): string {
|
|
10
10
|
return thread?.title?.trim() || (thread ? messages.untitled : messages.new)
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
/** The app's page of every thread; each thread opens beneath it. */
|
|
14
|
+
export const THREADS_PATH = "/threads"
|
|
15
|
+
|
|
16
|
+
export function threadPath(threadId: string): string {
|
|
17
|
+
return `${THREADS_PATH}/${encodeURIComponent(threadId)}`
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The page a stored thread link opens. Memory saves name the thread they came from as
|
|
22
|
+
* `/agents/<threadId>`, the form core checks them against; this links straight to its page.
|
|
23
|
+
*/
|
|
24
|
+
export function threadPathFromLink(link: string): string {
|
|
25
|
+
const legacy = /^\/agents\/([^/?#]+)$/.exec(link)
|
|
26
|
+
return legacy?.[1] ? threadPath(decodeURIComponent(legacy[1])) : link
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createElement } from "react"
|
|
2
|
+
import { Navigate, useParams } from "react-router-dom"
|
|
3
|
+
import { AgentChatPage, type AgentChatPageProps, AgentThreadsPage } from "./react-router"
|
|
4
|
+
import { THREADS_PATH, threadPath } from "./thread-navigation"
|
|
5
|
+
|
|
6
|
+
/** The framework's `/threads/:threadId` route: one thread, full page. */
|
|
7
|
+
export function ThreadPage(props: Omit<AgentChatPageProps, "routeBase">) {
|
|
8
|
+
return createElement(AgentChatPage, props)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** The framework's `/threads` route: every thread, to search and open. */
|
|
12
|
+
export const ThreadsPage = AgentThreadsPage
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Threads used to open at `/agents/:threadId`, and memory saves still name their thread that way:
|
|
16
|
+
* those links open the thread at its page.
|
|
17
|
+
*/
|
|
18
|
+
export function AgentThreadRedirect() {
|
|
19
|
+
const { threadId } = useParams()
|
|
20
|
+
return createElement(Navigate, {
|
|
21
|
+
to: threadId ? threadPath(threadId) : THREADS_PATH,
|
|
22
|
+
replace: true,
|
|
23
|
+
})
|
|
24
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ReactNode } from "react"
|
|
2
|
+
import { BashToolView } from "../bash/bash-tool-view"
|
|
3
|
+
import { WebFetchToolView } from "../components/web-fetch-tool-view"
|
|
4
|
+
import { WebSearchToolView } from "../components/web-search-tool-view"
|
|
5
|
+
import type { NormalizedTool } from "../parts"
|
|
6
|
+
import { PublishArtifactToolView } from "../publish-artifact/publish-artifact-tool-view"
|
|
7
|
+
import { ReadToolView } from "../read/read-tool-view"
|
|
8
|
+
import { coerceWebFetchOutput } from "../utils/web-fetch"
|
|
9
|
+
import { coerceWebSearchOutput } from "../utils/web-search"
|
|
10
|
+
import { ViewFileToolView } from "../view-file/view-file-tool-view"
|
|
11
|
+
|
|
12
|
+
type BuiltInToolView = (tool: NormalizedTool) => ReactNode
|
|
13
|
+
|
|
14
|
+
const publishArtifact: BuiltInToolView = (tool) => <PublishArtifactToolView tool={tool} />
|
|
15
|
+
|
|
16
|
+
// The framework's own rows in the work, by tool name. A view returns null to leave the call to the
|
|
17
|
+
// generic inspector, as web results do when their output does not parse.
|
|
18
|
+
const BUILT_IN_TOOL_VIEWS: ReadonlyMap<string, BuiltInToolView> = new Map([
|
|
19
|
+
[
|
|
20
|
+
"bash",
|
|
21
|
+
(tool) => (
|
|
22
|
+
<BashToolView
|
|
23
|
+
tool={{
|
|
24
|
+
state: tool.state,
|
|
25
|
+
input: tool.input,
|
|
26
|
+
inputText: tool.inputText,
|
|
27
|
+
output: tool.output,
|
|
28
|
+
errorText: tool.errorText,
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
),
|
|
32
|
+
],
|
|
33
|
+
["read", (tool) => <ReadToolView tool={tool} />],
|
|
34
|
+
["view_file", (tool) => <ViewFileToolView tool={tool} />],
|
|
35
|
+
["publish_artifact", publishArtifact],
|
|
36
|
+
["publish_artifact_version", publishArtifact],
|
|
37
|
+
[
|
|
38
|
+
"web_fetch",
|
|
39
|
+
(tool) =>
|
|
40
|
+
tool.state !== "output-available" || coerceWebFetchOutput(tool.output) !== null ? (
|
|
41
|
+
<WebFetchToolView tool={tool} />
|
|
42
|
+
) : null,
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
"web_search",
|
|
46
|
+
(tool) =>
|
|
47
|
+
tool.state !== "output-available" || coerceWebSearchOutput(tool.output) !== null ? (
|
|
48
|
+
<WebSearchToolView tool={tool} />
|
|
49
|
+
) : null,
|
|
50
|
+
],
|
|
51
|
+
])
|
|
52
|
+
|
|
53
|
+
/** The framework's row for a call, or null when the generic inspector shows it. */
|
|
54
|
+
export function builtInToolView(tool: NormalizedTool): ReactNode {
|
|
55
|
+
return BUILT_IN_TOOL_VIEWS.get(tool.toolName)?.(tool) ?? null
|
|
56
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { AgentToolDefinition, InferAgentToolInput, InferAgentToolOutput } from "@sixb/core"
|
|
2
|
+
import type { ReactNode } from "react"
|
|
3
|
+
|
|
4
|
+
/** Where a tool's view shows in the chat: in place of its row in the work, or in the answer. */
|
|
5
|
+
export type AgentToolViewPlacement = "work" | "answer"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What a tool's view receives, by the state of the call. A saved message holds only finished
|
|
9
|
+
* calls; a live reply goes through every state.
|
|
10
|
+
*/
|
|
11
|
+
export type AgentToolViewProps<TTool extends AgentToolDefinition = AgentToolDefinition> =
|
|
12
|
+
| {
|
|
13
|
+
/** The model is still writing the input. */
|
|
14
|
+
readonly state: "input-streaming"
|
|
15
|
+
/** The input written so far: partial JSON text. */
|
|
16
|
+
readonly inputText?: string
|
|
17
|
+
readonly input?: undefined
|
|
18
|
+
readonly output?: undefined
|
|
19
|
+
readonly errorText?: undefined
|
|
20
|
+
}
|
|
21
|
+
| {
|
|
22
|
+
/** The input is valid and the tool is running. */
|
|
23
|
+
readonly state: "input-available"
|
|
24
|
+
readonly inputText?: undefined
|
|
25
|
+
readonly input: InferAgentToolInput<TTool>
|
|
26
|
+
readonly output?: undefined
|
|
27
|
+
readonly errorText?: undefined
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
readonly state: "output-available"
|
|
31
|
+
readonly inputText?: undefined
|
|
32
|
+
readonly input: InferAgentToolInput<TTool>
|
|
33
|
+
readonly output: InferAgentToolOutput<TTool>
|
|
34
|
+
readonly errorText?: undefined
|
|
35
|
+
}
|
|
36
|
+
| {
|
|
37
|
+
readonly state: "output-error"
|
|
38
|
+
readonly inputText?: undefined
|
|
39
|
+
/**
|
|
40
|
+
* What the model sent, when the call got that far. Not typed as the tool's input: a call
|
|
41
|
+
* refused for its input carries the input it was refused for, which may not match the schema.
|
|
42
|
+
*/
|
|
43
|
+
readonly input?: unknown
|
|
44
|
+
readonly output?: undefined
|
|
45
|
+
readonly errorText: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Views are stored together whatever their tool. Keep variance erasure at this boundary, so a
|
|
49
|
+
// list of views for different tools is a `readonly AgentToolView[]`.
|
|
50
|
+
type StoredAgentToolViewRender<TTool extends AgentToolDefinition> = {
|
|
51
|
+
bivarianceHack(props: AgentToolViewProps<TTool>): ReactNode
|
|
52
|
+
}["bivarianceHack"]
|
|
53
|
+
|
|
54
|
+
/** How the chat shows one tool's calls. Register it in the `toolViews` export of `app/layout.tsx`. */
|
|
55
|
+
export interface AgentToolView<TTool extends AgentToolDefinition = AgentToolDefinition> {
|
|
56
|
+
readonly kind: "agentToolView"
|
|
57
|
+
readonly toolName: TTool["name"]
|
|
58
|
+
readonly placement: AgentToolViewPlacement
|
|
59
|
+
readonly render: StoredAgentToolViewRender<TTool>
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const AGENT_TOOL_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]{0,63}$/
|
|
63
|
+
const PLACEMENTS: readonly AgentToolViewPlacement[] = ["work", "answer"]
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Define how the chat shows a tool's calls. Type it with the tool's definition, imported as a type
|
|
67
|
+
* so nothing from the server reaches the browser:
|
|
68
|
+
*
|
|
69
|
+
* ```tsx
|
|
70
|
+
* import type { quoteShipping } from "../../agent-tools/quote-shipping"
|
|
71
|
+
*
|
|
72
|
+
* export const quoteView = defineAgentToolView<typeof quoteShipping>("quote_shipping", {
|
|
73
|
+
* placement: "answer",
|
|
74
|
+
* }).render(({ state, output }) => (state === "output-available" ? <Quote {...output} /> : null))
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* The component renders as a React component, so it can use hooks. A view that throws falls back
|
|
78
|
+
* to the tool's built-in row.
|
|
79
|
+
*/
|
|
80
|
+
export function defineAgentToolView<TTool extends AgentToolDefinition>(
|
|
81
|
+
name: TTool["name"],
|
|
82
|
+
options: { readonly placement?: AgentToolViewPlacement } = {}
|
|
83
|
+
): {
|
|
84
|
+
render(component: (props: AgentToolViewProps<TTool>) => ReactNode): AgentToolView<TTool>
|
|
85
|
+
} {
|
|
86
|
+
if (typeof name !== "string" || !AGENT_TOOL_NAME_PATTERN.test(name)) {
|
|
87
|
+
throw new Error(
|
|
88
|
+
`[SixbApp] defineAgentToolView needs the name of a tool: 1-64 characters, starting with a letter or underscore, with only letters, numbers, underscores, or hyphens. Got ${JSON.stringify(name)}.`
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const placement = options.placement ?? "work"
|
|
93
|
+
if (!PLACEMENTS.includes(placement)) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`[SixbApp] The view of tool '${name}' has placement ${JSON.stringify(placement)}. Use "work" or "answer".`
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
render(component) {
|
|
101
|
+
if (typeof component !== "function") {
|
|
102
|
+
throw new Error(
|
|
103
|
+
`[SixbApp] The view of tool '${name}' needs a component: pass one to .render().`
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return Object.freeze({ kind: "agentToolView", toolName: name, placement, render: component })
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function isAgentToolView(value: unknown): value is AgentToolView {
|
|
113
|
+
if (typeof value !== "object" || value === null) return false
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
Reflect.get(value, "kind") === "agentToolView" &&
|
|
117
|
+
typeof Reflect.get(value, "toolName") === "string" &&
|
|
118
|
+
(PLACEMENTS as readonly unknown[]).includes(Reflect.get(value, "placement")) &&
|
|
119
|
+
typeof Reflect.get(value, "render") === "function"
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The views of a layout's `toolViews` export by tool name. Both the build, when it loads the
|
|
125
|
+
* layout, and the provider in the browser read the export through this, so a mistake is reported
|
|
126
|
+
* the same way: `fail` turns what is wrong into the error to throw.
|
|
127
|
+
*/
|
|
128
|
+
export function agentToolViews(
|
|
129
|
+
views: unknown,
|
|
130
|
+
fail: (detail: string) => Error = (detail) =>
|
|
131
|
+
new Error(`[SixbApp] Invalid toolViews in app/layout.tsx: ${detail}`)
|
|
132
|
+
): ReadonlyMap<string, AgentToolView> {
|
|
133
|
+
if (views === undefined) return new Map()
|
|
134
|
+
if (!Array.isArray(views)) {
|
|
135
|
+
throw fail("the named toolViews export must be an array of views from defineAgentToolView.")
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const registry = new Map<string, AgentToolView>()
|
|
139
|
+
views.forEach((view: unknown, index) => {
|
|
140
|
+
if (!isAgentToolView(view)) {
|
|
141
|
+
throw fail(`toolViews[${index}] is not a view from defineAgentToolView.`)
|
|
142
|
+
}
|
|
143
|
+
if (registry.has(view.toolName)) {
|
|
144
|
+
throw fail(`two views for the tool '${view.toolName}'. Keep one view per tool.`)
|
|
145
|
+
}
|
|
146
|
+
registry.set(view.toolName, view)
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
return registry
|
|
150
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { AgentToolDefinition, InferAgentToolInput, InferAgentToolOutput } from "@sixb/core"
|
|
2
|
+
import { Component, createContext, type ReactNode, useContext, useMemo } from "react"
|
|
3
|
+
import type { NormalizedPart, NormalizedTool } from "../parts"
|
|
4
|
+
import { type AgentToolView, type AgentToolViewProps, agentToolViews } from "./define"
|
|
5
|
+
|
|
6
|
+
type AgentToolViews = ReadonlyMap<string, AgentToolView>
|
|
7
|
+
|
|
8
|
+
const AgentToolViewsContext = createContext<AgentToolViews>(new Map())
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Carries the project's `toolViews`, exported by `app/layout.tsx`, to every chat in the app. The
|
|
12
|
+
* generated app mounts it around the layout; without it, chats show the framework's views alone.
|
|
13
|
+
*/
|
|
14
|
+
export function AgentToolViewsProvider({
|
|
15
|
+
views,
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
readonly views: unknown
|
|
19
|
+
readonly children: ReactNode
|
|
20
|
+
}) {
|
|
21
|
+
const registry = useMemo(() => agentToolViews(views), [views])
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<AgentToolViewsContext.Provider value={registry}>{children}</AgentToolViewsContext.Provider>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The project's view of a tool, which takes the place of the framework's. */
|
|
29
|
+
export function useAgentToolView(toolName: string): AgentToolView | undefined {
|
|
30
|
+
return useContext(AgentToolViewsContext).get(toolName)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The views of the turn's tools shown in the answer, in call order. Each call keeps its row in the
|
|
35
|
+
* work; a view that fails shows nothing here.
|
|
36
|
+
*/
|
|
37
|
+
export function AnswerToolViews({ parts }: { readonly parts: readonly NormalizedPart[] }) {
|
|
38
|
+
const views = useContext(AgentToolViewsContext)
|
|
39
|
+
|
|
40
|
+
return parts.map((part, index) => {
|
|
41
|
+
if (part.kind !== "tool") return null
|
|
42
|
+
const view = views.get(part.tool.toolName)
|
|
43
|
+
if (view?.placement !== "answer") return null
|
|
44
|
+
|
|
45
|
+
return <ProjectToolView key={`answer-${index}`} view={view} tool={part.tool} fallback={null} />
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** A call shown through the project's view, or through `fallback` when the view throws. */
|
|
50
|
+
export function ProjectToolView({
|
|
51
|
+
view,
|
|
52
|
+
tool,
|
|
53
|
+
fallback,
|
|
54
|
+
}: {
|
|
55
|
+
readonly view: AgentToolView
|
|
56
|
+
readonly tool: NormalizedTool
|
|
57
|
+
readonly fallback: ReactNode
|
|
58
|
+
}) {
|
|
59
|
+
const View = view.render
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<ToolViewBoundary toolName={view.toolName} state={tool.state} fallback={fallback}>
|
|
63
|
+
<View {...toolViewProps(tool)} />
|
|
64
|
+
</ToolViewBoundary>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
type Input = InferAgentToolInput<AgentToolDefinition>
|
|
69
|
+
type Output = InferAgentToolOutput<AgentToolDefinition>
|
|
70
|
+
|
|
71
|
+
// The browser has the tool's types, not its schema: the view takes what the server saved or
|
|
72
|
+
// streamed for the call as the tool's input and output.
|
|
73
|
+
export function toolViewProps(tool: NormalizedTool): AgentToolViewProps {
|
|
74
|
+
switch (tool.state) {
|
|
75
|
+
case "input-streaming":
|
|
76
|
+
return tool.inputText === undefined
|
|
77
|
+
? { state: tool.state }
|
|
78
|
+
: { state: tool.state, inputText: tool.inputText }
|
|
79
|
+
case "input-available":
|
|
80
|
+
return { state: tool.state, input: tool.input as Input }
|
|
81
|
+
case "output-available":
|
|
82
|
+
return { state: tool.state, input: tool.input as Input, output: tool.output as Output }
|
|
83
|
+
case "output-error":
|
|
84
|
+
return {
|
|
85
|
+
state: tool.state,
|
|
86
|
+
...(tool.input === undefined ? {} : { input: tool.input }),
|
|
87
|
+
errorText: tool.errorText ?? "",
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Keeps a failing view from taking the chat down. A call that moves on to its next state tries
|
|
94
|
+
* the view again, so a view that cannot read a partial input still shows the finished call.
|
|
95
|
+
*/
|
|
96
|
+
class ToolViewBoundary extends Component<
|
|
97
|
+
{
|
|
98
|
+
readonly toolName: string
|
|
99
|
+
readonly state: NormalizedTool["state"]
|
|
100
|
+
readonly fallback: ReactNode
|
|
101
|
+
readonly children: ReactNode
|
|
102
|
+
},
|
|
103
|
+
{ readonly failed: boolean }
|
|
104
|
+
> {
|
|
105
|
+
state = { failed: false }
|
|
106
|
+
|
|
107
|
+
static getDerivedStateFromError() {
|
|
108
|
+
return { failed: true }
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
componentDidCatch(error: unknown) {
|
|
112
|
+
console.error(
|
|
113
|
+
`[SixbApp] The view of tool '${this.props.toolName}' failed to render; the chat shows the tool's built-in row instead.`,
|
|
114
|
+
error
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
componentDidUpdate(previous: { readonly state: NormalizedTool["state"] }) {
|
|
119
|
+
if (this.state.failed && previous.state !== this.props.state) this.setState({ failed: false })
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
render() {
|
|
123
|
+
return this.state.failed ? this.props.fallback : this.props.children
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { KeyboardEvent } from "react"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Arrow keys in a radio group made of buttons: the group is one tab stop (its checked radio, whose
|
|
5
|
+
* `tabIndex` is 0), and the arrows move between its radios. With `select`, moving also chooses, as
|
|
6
|
+
* a native radio group does; without it, as in a menu that closes on a choice, Enter or Space
|
|
7
|
+
* chooses the radio in focus.
|
|
8
|
+
*/
|
|
9
|
+
export function moveRadioFocus(
|
|
10
|
+
event: KeyboardEvent<HTMLElement>,
|
|
11
|
+
options: { readonly select?: boolean } = {}
|
|
12
|
+
): void {
|
|
13
|
+
const step =
|
|
14
|
+
event.key === "ArrowDown" || event.key === "ArrowRight"
|
|
15
|
+
? 1
|
|
16
|
+
: event.key === "ArrowUp" || event.key === "ArrowLeft"
|
|
17
|
+
? -1
|
|
18
|
+
: 0
|
|
19
|
+
if (step === 0) return
|
|
20
|
+
|
|
21
|
+
const radios = [...event.currentTarget.querySelectorAll<HTMLElement>("[role=radio]")]
|
|
22
|
+
if (radios.length === 0) return
|
|
23
|
+
event.preventDefault()
|
|
24
|
+
|
|
25
|
+
const current = radios.indexOf(document.activeElement as HTMLElement)
|
|
26
|
+
const next = radios[(current + step + radios.length) % radios.length]
|
|
27
|
+
next?.focus()
|
|
28
|
+
if (options.select) next?.click()
|
|
29
|
+
}
|
|
@@ -170,3 +170,99 @@
|
|
|
170
170
|
:is(.prose .sixb-embed, .sixb-embed-filled) .sixb-embed-section > .prose > :first-child {
|
|
171
171
|
margin-top: 0;
|
|
172
172
|
}
|
|
173
|
+
|
|
174
|
+
/*
|
|
175
|
+
* A canvas artifact's board (renderers/canvas): the dot grid in the theme's colors. Its items take
|
|
176
|
+
* their colors from the board.
|
|
177
|
+
*/
|
|
178
|
+
.sixb-artboard {
|
|
179
|
+
--xy-background-pattern-dots-color-default: color-mix(
|
|
180
|
+
in oklab,
|
|
181
|
+
var(--muted-foreground) 32%,
|
|
182
|
+
transparent
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/*
|
|
187
|
+
* A board, an embed, or a plain note on a canvas: the page itself, edged by a hairline and lifted
|
|
188
|
+
* by a soft shadow, as a print lies on a table. The hairline is what shows it in dark mode.
|
|
189
|
+
*/
|
|
190
|
+
.sixb-canvas-surface {
|
|
191
|
+
border-radius: 6px;
|
|
192
|
+
background: var(--card);
|
|
193
|
+
box-shadow:
|
|
194
|
+
0 0 0 1px color-mix(in oklab, var(--foreground) 9%, transparent),
|
|
195
|
+
0 1px 2px rgb(0 0 0 / 0.05),
|
|
196
|
+
0 20px 44px -28px rgb(0 0 0 / 0.35);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* An embed on a canvas is the surface's: its own frame gives way, and its link to the row above. */
|
|
200
|
+
.sixb-canvas-embed .sixb-embed-filled {
|
|
201
|
+
border: 0;
|
|
202
|
+
border-radius: 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.sixb-canvas-embed[data-named] .sixb-embed-filled > a {
|
|
206
|
+
display: none;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* A board takes focus from the keyboard, to open it; the ring shows where focus is. */
|
|
210
|
+
.sixb-artboard .react-flow__node:focus-visible {
|
|
211
|
+
outline: 2px solid var(--ring);
|
|
212
|
+
outline-offset: 4px;
|
|
213
|
+
border-radius: 8px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/*
|
|
217
|
+
* A canvas while it is edited (renderers/canvas/edit-mode.tsx). An item shows it can be moved on
|
|
218
|
+
* hover; a dot on each side, shown on hover and while it is selected, drags an arrow out; the
|
|
219
|
+
* selected item's frame resizes it. A section's region takes no press: its heading does, so a
|
|
220
|
+
* press inside a section reaches what it holds, or pans.
|
|
221
|
+
*/
|
|
222
|
+
.sixb-artboard[data-editing] .react-flow__node:not(.react-flow__node-section, .react-flow__node-point):hover:not(.selected) {
|
|
223
|
+
outline: 1.5px solid color-mix(in oklab, var(--primary) 45%, transparent);
|
|
224
|
+
outline-offset: 3px;
|
|
225
|
+
border-radius: 6px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.sixb-artboard .react-flow__node-section {
|
|
229
|
+
pointer-events: none !important;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.sixb-artboard .react-flow__node-section :is(.react-flow__resize-control, .react-flow__handle) {
|
|
233
|
+
pointer-events: all;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.sixb-artboard .react-flow__handle.sixb-connect {
|
|
237
|
+
width: 11px;
|
|
238
|
+
height: 11px;
|
|
239
|
+
border: 1.5px solid var(--primary);
|
|
240
|
+
border-radius: 999px;
|
|
241
|
+
background: var(--background);
|
|
242
|
+
opacity: 0;
|
|
243
|
+
transition: opacity 120ms ease-out, transform 120ms ease-out;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.sixb-artboard .react-flow__node:hover .react-flow__handle.sixb-connect,
|
|
247
|
+
.sixb-artboard .react-flow__handle.sixb-connect[data-selected],
|
|
248
|
+
.sixb-artboard .react-flow__handle.sixb-connect.connectingto {
|
|
249
|
+
opacity: 1;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.sixb-artboard .react-flow__handle.sixb-connect:hover,
|
|
253
|
+
.sixb-artboard .react-flow__handle.sixb-connect.connectingto {
|
|
254
|
+
transform: translate(-50%, -50%) scale(1.25);
|
|
255
|
+
background: var(--primary);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.sixb-artboard .sixb-resize-handle {
|
|
259
|
+
width: 9px;
|
|
260
|
+
height: 9px;
|
|
261
|
+
border: 1.5px solid var(--primary) !important;
|
|
262
|
+
border-radius: 2px;
|
|
263
|
+
background: var(--background) !important;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.sixb-artboard .sixb-resize-line {
|
|
267
|
+
border-color: color-mix(in oklab, var(--primary) 80%, transparent) !important;
|
|
268
|
+
}
|