@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
|
@@ -3,8 +3,8 @@ import { useLocale } from "@sixb/ui/lib/i18n"
|
|
|
3
3
|
import { cn } from "@sixb/ui/lib/utils"
|
|
4
4
|
import { Bot, FileText, type LucideIcon, MousePointerClick, Workflow, Zap } from "lucide-react"
|
|
5
5
|
import { Fragment, useMemo, useState } from "react"
|
|
6
|
-
import { Link } from "react-router-dom"
|
|
7
|
-
import { actionRunHref, objectHref, workflowRunHref } from "../../routes"
|
|
6
|
+
import { Link, useLocation } from "react-router-dom"
|
|
7
|
+
import { actionRunHref, objectHref, observedThreadHref, workflowRunHref } from "../../routes"
|
|
8
8
|
import {
|
|
9
9
|
formatDuration,
|
|
10
10
|
humanize,
|
|
@@ -256,10 +256,20 @@ function EntryContent({
|
|
|
256
256
|
return (
|
|
257
257
|
<>
|
|
258
258
|
<div className="flex flex-wrap items-center gap-x-2 gap-y-1">
|
|
259
|
-
|
|
259
|
+
{entry.thread ? (
|
|
260
|
+
<ConversationLink threadId={entry.threadId} title={entry.thread.title} />
|
|
261
|
+
) : (
|
|
262
|
+
<span className="text-[0.8125rem] font-medium">{messages.agentRun}</span>
|
|
263
|
+
)}
|
|
260
264
|
<EntryStatus status={entry.status} />
|
|
261
265
|
</div>
|
|
262
266
|
<p className="flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground">
|
|
267
|
+
{entry.thread ? (
|
|
268
|
+
<>
|
|
269
|
+
<span>{messages.agentRun}</span>
|
|
270
|
+
<MetaDot />
|
|
271
|
+
</>
|
|
272
|
+
) : null}
|
|
263
273
|
<span>{messages.messages(entry.messages, count(entry.messages))}</span>
|
|
264
274
|
{entry.cost && entry.cost.amounts.length > 0 ? (
|
|
265
275
|
<>
|
|
@@ -308,6 +318,33 @@ function RoutePattern({
|
|
|
308
318
|
)
|
|
309
319
|
}
|
|
310
320
|
|
|
321
|
+
/**
|
|
322
|
+
* A conversation by its title, opening it read-only. Only a reader who may read it gets one: the
|
|
323
|
+
* entry names its thread for them alone.
|
|
324
|
+
*/
|
|
325
|
+
function ConversationLink({
|
|
326
|
+
threadId,
|
|
327
|
+
title,
|
|
328
|
+
}: {
|
|
329
|
+
readonly threadId: string
|
|
330
|
+
readonly title: string | undefined
|
|
331
|
+
}) {
|
|
332
|
+
const messages = useActivityMessages()
|
|
333
|
+
const location = useLocation()
|
|
334
|
+
const name = title?.trim() || messages.thread.untitled
|
|
335
|
+
|
|
336
|
+
return (
|
|
337
|
+
<Link
|
|
338
|
+
to={observedThreadHref(threadId)}
|
|
339
|
+
state={{ from: `${location.pathname}${location.search}` }}
|
|
340
|
+
title={messages.visit.openConversation}
|
|
341
|
+
className="min-w-0 truncate text-[0.8125rem] font-medium underline-offset-2 hover:underline"
|
|
342
|
+
>
|
|
343
|
+
{name}
|
|
344
|
+
</Link>
|
|
345
|
+
)
|
|
346
|
+
}
|
|
347
|
+
|
|
311
348
|
/** A run's name, linking to its page in Observability › Runs when the viewer may read it. */
|
|
312
349
|
function RunName({ name, href }: { readonly name: string; readonly href: string | undefined }) {
|
|
313
350
|
const messages = useActivityMessages().visit
|
|
@@ -11,9 +11,11 @@ import { useQuery } from "@tanstack/react-query"
|
|
|
11
11
|
import { ArrowUpRight, Bot, ChevronRight, GitBranch, Layers, Workflow, Zap } from "lucide-react"
|
|
12
12
|
import { type ReactNode, useState } from "react"
|
|
13
13
|
import { Link } from "react-router-dom"
|
|
14
|
+
import { threadPath } from "../../../agent/thread-navigation"
|
|
14
15
|
import { actionRunHref, workflowRunHref } from "../../routes"
|
|
15
16
|
import { PageSection, Panel, Pill, type Tone } from "../../section-ui"
|
|
16
17
|
import { formatMoney } from "./format"
|
|
18
|
+
import { KindLabel, useUsageFormat } from "./kinds"
|
|
17
19
|
import { type AiUsageMessages, useAiUsageMessages } from "./messages"
|
|
18
20
|
|
|
19
21
|
type Group = ListAiModelCallGroupsResponse["items"][number]
|
|
@@ -140,7 +142,7 @@ function groupLabel(group: Group, messages: AiUsageMessages["calls"]): string {
|
|
|
140
142
|
function groupHref(group: Group): string | undefined {
|
|
141
143
|
const source = group.attribution
|
|
142
144
|
if (source?.kind === "agent") {
|
|
143
|
-
return group.canOpenThread ?
|
|
145
|
+
return group.canOpenThread ? threadPath(source.threadId) : undefined
|
|
144
146
|
}
|
|
145
147
|
if (source?.kind === "workflowAgent" || source?.kind === "workflow") {
|
|
146
148
|
return workflowRunHref(source.workflowRunId)
|
|
@@ -365,7 +367,8 @@ export function ModelCallRow({
|
|
|
365
367
|
}) {
|
|
366
368
|
const messages = useAiUsageMessages().calls
|
|
367
369
|
const format = useCallFormat()
|
|
368
|
-
const
|
|
370
|
+
const lines = useUsageFormat().lines(call.usage.usage, call.usage.modelKind)
|
|
371
|
+
const price = pricedAs(call, messages, format.money)
|
|
369
372
|
return (
|
|
370
373
|
<div className={cn(grid, "py-1.5 pr-4 text-xs", nested ? "pl-20" : "pl-14")}>
|
|
371
374
|
<span
|
|
@@ -378,9 +381,7 @@ export function ModelCallRow({
|
|
|
378
381
|
<ModelName
|
|
379
382
|
models={[{ providerId: call.usage.providerId, modelId: call.usage.requestedModelId }]}
|
|
380
383
|
/>
|
|
381
|
-
{call.usage.modelKind
|
|
382
|
-
<span className="block text-muted-foreground">{messages.transcription}</span>
|
|
383
|
-
) : null}
|
|
384
|
+
<KindLabel kind={call.usage.modelKind} variant={price.variant} />
|
|
384
385
|
{call.usage.requestedReasoning === undefined ? null : (
|
|
385
386
|
<span className="block text-muted-foreground">
|
|
386
387
|
{typeof call.usage.requestedReasoning === "string"
|
|
@@ -390,17 +391,14 @@ export function ModelCallRow({
|
|
|
390
391
|
)}
|
|
391
392
|
</span>
|
|
392
393
|
<span className="hidden text-right font-mono text-muted-foreground md:block">1</span>
|
|
393
|
-
<
|
|
394
|
-
{audioDurationMs !== undefined ? (
|
|
395
|
-
<span className="block">{messages.audio(format.number(audioDurationMs / 1000, 3))}</span>
|
|
396
|
-
) : null}
|
|
397
|
-
{totalTokens !== undefined ? (
|
|
398
|
-
<span className="block">{messages.tokens(format.number(totalTokens))}</span>
|
|
399
|
-
) : null}
|
|
400
|
-
{audioDurationMs === undefined && totalTokens === undefined ? "—" : null}
|
|
401
|
-
</span>
|
|
394
|
+
<UsageLines lines={lines} />
|
|
402
395
|
<span className="text-right font-mono whitespace-nowrap tabular-nums">
|
|
403
396
|
{call.cost && call.cost.status !== "unpriceable" ? format.money(call.cost.money) : "—"}
|
|
397
|
+
{price.each ? (
|
|
398
|
+
<span className="block truncate text-[0.6875rem] text-muted-foreground">
|
|
399
|
+
{price.each}
|
|
400
|
+
</span>
|
|
401
|
+
) : null}
|
|
404
402
|
</span>
|
|
405
403
|
<span className="hidden md:block">
|
|
406
404
|
<Valuation call={call} />
|
|
@@ -418,6 +416,7 @@ function Summary({
|
|
|
418
416
|
}) {
|
|
419
417
|
const messages = useAiUsageMessages().calls
|
|
420
418
|
const format = useCallFormat()
|
|
419
|
+
const usage = useUsageFormat()
|
|
421
420
|
const withoutCost = summary.costs.unvaluedCallCount + summary.costs.unpriceableCallCount
|
|
422
421
|
return (
|
|
423
422
|
<>
|
|
@@ -427,11 +426,7 @@ function Summary({
|
|
|
427
426
|
<span className="hidden text-right font-mono text-xs tabular-nums md:block">
|
|
428
427
|
{format.number(summary.modelCallCount)}
|
|
429
428
|
</span>
|
|
430
|
-
<
|
|
431
|
-
{summary.totalTokens === undefined
|
|
432
|
-
? "—"
|
|
433
|
-
: messages.tokens(format.number(summary.totalTokens))}
|
|
434
|
-
</span>
|
|
429
|
+
<UsageLines lines={usage.lines(summary)} className="text-xs" />
|
|
435
430
|
<span className="text-right font-mono text-xs whitespace-nowrap tabular-nums">
|
|
436
431
|
{summary.costs.amounts.length
|
|
437
432
|
? summary.costs.amounts.map((money) => (
|
|
@@ -454,6 +449,55 @@ function Summary({
|
|
|
454
449
|
)
|
|
455
450
|
}
|
|
456
451
|
|
|
452
|
+
/** What a call or a run used, one meter a line: tokens, images, characters, audio. */
|
|
453
|
+
function UsageLines({
|
|
454
|
+
lines,
|
|
455
|
+
className,
|
|
456
|
+
}: {
|
|
457
|
+
readonly lines: readonly string[]
|
|
458
|
+
readonly className?: string
|
|
459
|
+
}) {
|
|
460
|
+
return (
|
|
461
|
+
<span className={cn("hidden text-right font-mono tabular-nums md:block", className)}>
|
|
462
|
+
{lines.length === 0
|
|
463
|
+
? "—"
|
|
464
|
+
: lines.map((line) => (
|
|
465
|
+
<span key={line} className="block whitespace-nowrap">
|
|
466
|
+
{line}
|
|
467
|
+
</span>
|
|
468
|
+
))}
|
|
469
|
+
</span>
|
|
470
|
+
)
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* How a call was priced, when a unit price says more than its total ("2 × USD 0.048"), and the
|
|
475
|
+
* price variant it matched ("1024x1024"). A provider-reported cost keeps the local estimate's
|
|
476
|
+
* breakdown beside it.
|
|
477
|
+
*/
|
|
478
|
+
function pricedAs(
|
|
479
|
+
call: ModelCall,
|
|
480
|
+
messages: AiUsageMessages["calls"],
|
|
481
|
+
money: (value: { readonly currency: string; readonly amountNanos: string }) => string
|
|
482
|
+
): { readonly each?: string; readonly variant?: string } {
|
|
483
|
+
const cost = call.cost
|
|
484
|
+
if (cost?.status !== "rated") return {}
|
|
485
|
+
const components =
|
|
486
|
+
cost.components.length > 0
|
|
487
|
+
? cost.components
|
|
488
|
+
: cost.estimate?.status === "rated"
|
|
489
|
+
? cost.estimate.components
|
|
490
|
+
: []
|
|
491
|
+
const variant = components.find((component) => component.variant)?.variant
|
|
492
|
+
const images = components.find((component) => component.meter === "images.output")
|
|
493
|
+
if (!images || BigInt(images.quantity) <= 1n) return variant ? { variant } : {}
|
|
494
|
+
const unit = money({
|
|
495
|
+
currency: cost.money.currency,
|
|
496
|
+
amountNanos: (BigInt(images.rateAmountNanosPerMillion) / 1_000_000n).toString(),
|
|
497
|
+
})
|
|
498
|
+
return { each: messages.unitPrice(images.quantity, unit), ...(variant ? { variant } : {}) }
|
|
499
|
+
}
|
|
500
|
+
|
|
457
501
|
function ModelName({ models }: { readonly models: Execution["models"] }) {
|
|
458
502
|
const messages = useAiUsageMessages().calls
|
|
459
503
|
const model = models[0]
|
|
@@ -188,28 +188,54 @@ export function periodTokens(
|
|
|
188
188
|
return period.modelCallCount === 0 ? 0 : period.usage[key]
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
// Billed per image, character, audio second or search: these calls mostly report no tokens.
|
|
192
|
+
const tokenlessKinds: ReadonlySet<string> = new Set([
|
|
193
|
+
"image",
|
|
194
|
+
"speech",
|
|
195
|
+
"transcription",
|
|
196
|
+
"reranking",
|
|
197
|
+
])
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The calls a token count is owed by: every call of a token-billed kind, and the tokenless calls
|
|
201
|
+
* that reported tokens anyway. Calls recorded before kinds were kept count as token-billed.
|
|
202
|
+
*/
|
|
203
|
+
export function tokenBilledCalls(overview: Pick<Overview, "kinds" | "totals">): number {
|
|
204
|
+
if (overview.kinds.length === 0) return overview.totals.modelCallCount
|
|
205
|
+
return overview.kinds.reduce(
|
|
206
|
+
(calls, kind) =>
|
|
207
|
+
calls +
|
|
208
|
+
(kind.modelKind !== undefined && tokenlessKinds.has(kind.modelKind)
|
|
209
|
+
? kind.usageCoverage.completeCallCount
|
|
210
|
+
: kind.modelCallCount),
|
|
211
|
+
0
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
191
215
|
/**
|
|
192
|
-
* One meter as a share of another, only when both cover every call
|
|
193
|
-
* still describe different calls.
|
|
216
|
+
* One meter as a share of another, only when both cover every call that owes them: equal
|
|
217
|
+
* reporting counts could still describe different calls.
|
|
194
218
|
*/
|
|
195
219
|
export function usageShare(
|
|
196
220
|
aggregate: Aggregate,
|
|
197
221
|
numerator: UsageField,
|
|
198
|
-
denominator: UsageField
|
|
222
|
+
denominator: UsageField,
|
|
223
|
+
expected = aggregate.modelCallCount
|
|
199
224
|
): number | undefined {
|
|
200
225
|
const counts = aggregate.usageCoverage.fieldCallCounts
|
|
201
|
-
if (counts[numerator] !==
|
|
202
|
-
if (counts[denominator] !==
|
|
226
|
+
if (counts[numerator] !== expected) return undefined
|
|
227
|
+
if (counts[denominator] !== expected) return undefined
|
|
203
228
|
const top = aggregate.usage[numerator]
|
|
204
229
|
const bottom = aggregate.usage[denominator]
|
|
205
230
|
if (top === undefined || bottom === undefined || bottom === 0) return undefined
|
|
206
231
|
return (top / bottom) * 100
|
|
207
232
|
}
|
|
208
233
|
|
|
209
|
-
/** How completely calls
|
|
234
|
+
/** How completely the calls that owe usage reported it: every one, some, or none. */
|
|
210
235
|
export function reportingCoverage(
|
|
211
236
|
aggregate: Aggregate,
|
|
212
|
-
field?: UsageField
|
|
237
|
+
field?: UsageField,
|
|
238
|
+
expected = aggregate.modelCallCount
|
|
213
239
|
): { readonly status: "complete" | "partial" | "unavailable"; readonly count: number } {
|
|
214
240
|
const count = field
|
|
215
241
|
? aggregate.usageCoverage.fieldCallCounts[field]
|
|
@@ -218,7 +244,7 @@ export function reportingCoverage(
|
|
|
218
244
|
? aggregate.usage[field] !== undefined
|
|
219
245
|
: aggregate.usage.totalTokens !== undefined
|
|
220
246
|
return {
|
|
221
|
-
status: count
|
|
247
|
+
status: count >= expected ? "complete" : available ? "partial" : "unavailable",
|
|
222
248
|
count,
|
|
223
249
|
}
|
|
224
250
|
}
|
|
@@ -247,6 +273,33 @@ export function formatCompact(value: number | undefined, locale = "en"): string
|
|
|
247
273
|
: new Intl.NumberFormat(locale, { notation: "compact", maximumFractionDigits: 1 }).format(value)
|
|
248
274
|
}
|
|
249
275
|
|
|
276
|
+
/** A duration as people say it: "1.25 s", "21 min 25 s", "1 h 4 min". */
|
|
277
|
+
export function formatDuration(
|
|
278
|
+
milliseconds: number,
|
|
279
|
+
units: {
|
|
280
|
+
readonly seconds: (value: string) => string
|
|
281
|
+
readonly minutes: (minutes: string, seconds: string) => string
|
|
282
|
+
readonly hours: (hours: string, minutes: string) => string
|
|
283
|
+
},
|
|
284
|
+
locale = "en"
|
|
285
|
+
): string {
|
|
286
|
+
const seconds = milliseconds / 1000
|
|
287
|
+
if (seconds < 60) {
|
|
288
|
+
return units.seconds(seconds.toLocaleString(locale, { maximumFractionDigits: 2 }))
|
|
289
|
+
}
|
|
290
|
+
const whole = Math.round(seconds)
|
|
291
|
+
if (whole < 3600) {
|
|
292
|
+
return units.minutes(
|
|
293
|
+
Math.floor(whole / 60).toLocaleString(locale),
|
|
294
|
+
(whole % 60).toLocaleString(locale)
|
|
295
|
+
)
|
|
296
|
+
}
|
|
297
|
+
return units.hours(
|
|
298
|
+
Math.floor(whole / 3600).toLocaleString(locale),
|
|
299
|
+
Math.floor((whole % 3600) / 60).toLocaleString(locale)
|
|
300
|
+
)
|
|
301
|
+
}
|
|
302
|
+
|
|
250
303
|
export function formatPercent(value: number | undefined, locale = "en"): string {
|
|
251
304
|
if (value === undefined) return "—"
|
|
252
305
|
const digits = value >= 99.95 ? 0 : 1
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { useLocale } from "@sixb/ui/lib/i18n"
|
|
2
|
+
import {
|
|
3
|
+
ArrowDownWideNarrow,
|
|
4
|
+
AudioLines,
|
|
5
|
+
Binary,
|
|
6
|
+
Captions,
|
|
7
|
+
CircleDashed,
|
|
8
|
+
Clapperboard,
|
|
9
|
+
ImageIcon,
|
|
10
|
+
type LucideIcon,
|
|
11
|
+
MessagesSquare,
|
|
12
|
+
Scale,
|
|
13
|
+
} from "lucide-react"
|
|
14
|
+
import { amountFor, formatCompact, formatDuration, nanosToNumber, type Overview } from "./format"
|
|
15
|
+
import { useAiUsageMessages } from "./messages"
|
|
16
|
+
|
|
17
|
+
export type ModelKind = NonNullable<Overview["kinds"][number]["modelKind"]>
|
|
18
|
+
|
|
19
|
+
const icons: Readonly<Record<ModelKind | "unclassified", LucideIcon>> = {
|
|
20
|
+
language: MessagesSquare,
|
|
21
|
+
embedding: Binary,
|
|
22
|
+
decision: Scale,
|
|
23
|
+
reranking: ArrowDownWideNarrow,
|
|
24
|
+
image: ImageIcon,
|
|
25
|
+
speech: AudioLines,
|
|
26
|
+
transcription: Captions,
|
|
27
|
+
video: Clapperboard,
|
|
28
|
+
unclassified: CircleDashed,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The meters a call or a group of calls reported, as the page measures them. */
|
|
32
|
+
interface Measured {
|
|
33
|
+
readonly totalTokens?: number
|
|
34
|
+
readonly outputImages?: number
|
|
35
|
+
readonly inputCharacters?: number
|
|
36
|
+
readonly audioDurationMs?: number
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Each kind in its own unit: tokens, images, characters, audio or searches. */
|
|
40
|
+
export function useUsageFormat() {
|
|
41
|
+
const messages = useAiUsageMessages()
|
|
42
|
+
const locale = useLocale()
|
|
43
|
+
const number = (value: number) => value.toLocaleString(locale)
|
|
44
|
+
const duration = (milliseconds: number) => formatDuration(milliseconds, messages.units, locale)
|
|
45
|
+
return {
|
|
46
|
+
/** Every meter the usage reported, one line each. */
|
|
47
|
+
lines(usage: Measured, kind?: ModelKind): string[] {
|
|
48
|
+
const lines = [
|
|
49
|
+
usage.totalTokens === undefined
|
|
50
|
+
? undefined
|
|
51
|
+
: messages.units.tokens(number(usage.totalTokens)),
|
|
52
|
+
usage.outputImages === undefined
|
|
53
|
+
? undefined
|
|
54
|
+
: messages.units.images(usage.outputImages, number(usage.outputImages)),
|
|
55
|
+
usage.inputCharacters === undefined
|
|
56
|
+
? undefined
|
|
57
|
+
: messages.units.characters(usage.inputCharacters, number(usage.inputCharacters)),
|
|
58
|
+
usage.audioDurationMs === undefined
|
|
59
|
+
? undefined
|
|
60
|
+
: messages.units.audio(duration(usage.audioDurationMs)),
|
|
61
|
+
].filter((line): line is string => line !== undefined)
|
|
62
|
+
// A rerank reports nothing; it is one search.
|
|
63
|
+
return lines.length === 0 && kind === "reranking" ? [messages.units.searches(1, "1")] : lines
|
|
64
|
+
},
|
|
65
|
+
/** The one figure that says what a kind produced over many calls, and its unit. */
|
|
66
|
+
headline(
|
|
67
|
+
kind: ModelKind | undefined,
|
|
68
|
+
aggregate: Overview["totals"]
|
|
69
|
+
): { readonly value: string; readonly unit?: string } {
|
|
70
|
+
const usage = aggregate.usage
|
|
71
|
+
const counted = (count: number, phrase: (count: number, formatted: string) => string) => {
|
|
72
|
+
const value = formatCompact(count, locale)
|
|
73
|
+
const text = phrase(count, value)
|
|
74
|
+
return text.startsWith(value)
|
|
75
|
+
? { value, unit: text.slice(value.length).trim() }
|
|
76
|
+
: { value: text }
|
|
77
|
+
}
|
|
78
|
+
if (kind === "image" && usage.outputImages !== undefined) {
|
|
79
|
+
return counted(usage.outputImages, messages.units.images)
|
|
80
|
+
}
|
|
81
|
+
if (kind === "speech" && usage.inputCharacters !== undefined) {
|
|
82
|
+
return counted(usage.inputCharacters, messages.units.characters)
|
|
83
|
+
}
|
|
84
|
+
if (kind === "transcription" && usage.audioDurationMs !== undefined) {
|
|
85
|
+
return { value: duration(usage.audioDurationMs) }
|
|
86
|
+
}
|
|
87
|
+
if (kind === "reranking") return counted(aggregate.modelCallCount, messages.units.searches)
|
|
88
|
+
if (usage.totalTokens !== undefined) {
|
|
89
|
+
return counted(usage.totalTokens, (_, formatted) => messages.units.tokens(formatted))
|
|
90
|
+
}
|
|
91
|
+
return counted(aggregate.modelCallCount, messages.kinds.calls)
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** A kind's icon and name beside a call that is not plain generation, with its price variant. */
|
|
97
|
+
export function KindLabel({
|
|
98
|
+
kind,
|
|
99
|
+
variant,
|
|
100
|
+
}: {
|
|
101
|
+
readonly kind: ModelKind | undefined
|
|
102
|
+
readonly variant?: string
|
|
103
|
+
}) {
|
|
104
|
+
const names = useAiUsageMessages().kinds.names
|
|
105
|
+
if (kind === undefined || kind === "language") return null
|
|
106
|
+
const Icon = icons[kind]
|
|
107
|
+
return (
|
|
108
|
+
<span className="mt-0.5 flex min-w-0 items-center gap-1 text-muted-foreground">
|
|
109
|
+
<Icon className="size-3 shrink-0" aria-hidden />
|
|
110
|
+
<span className="truncate">{variant ? `${names[kind]} · ${variant}` : names[kind]}</span>
|
|
111
|
+
</span>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface KindBreakdownRow {
|
|
116
|
+
readonly key: string
|
|
117
|
+
readonly label: string
|
|
118
|
+
readonly icon: LucideIcon
|
|
119
|
+
/** What the kind produced, such as "58 images". */
|
|
120
|
+
readonly detail: string
|
|
121
|
+
readonly value: number
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Cost by kind, for the breakdown card: each kind with what it produced in its own unit. Calls
|
|
126
|
+
* recorded before kinds were kept come last, whatever they cost.
|
|
127
|
+
*/
|
|
128
|
+
export function useKindBreakdown(
|
|
129
|
+
overview: Overview,
|
|
130
|
+
currency: string | undefined
|
|
131
|
+
): readonly KindBreakdownRow[] {
|
|
132
|
+
const names = useAiUsageMessages().kinds.names
|
|
133
|
+
const usage = useUsageFormat()
|
|
134
|
+
return overview.kinds
|
|
135
|
+
.flatMap((kind) => {
|
|
136
|
+
const cost = amountFor(kind.costs.amounts, currency)
|
|
137
|
+
if (!cost) return []
|
|
138
|
+
const key = kind.modelKind ?? "unclassified"
|
|
139
|
+
const headline = usage.headline(kind.modelKind, kind)
|
|
140
|
+
return [
|
|
141
|
+
{
|
|
142
|
+
key,
|
|
143
|
+
label: names[key],
|
|
144
|
+
icon: icons[key],
|
|
145
|
+
detail: headline.unit ? `${headline.value} ${headline.unit}` : headline.value,
|
|
146
|
+
value: nanosToNumber(cost.amountNanos),
|
|
147
|
+
unclassified: kind.modelKind === undefined,
|
|
148
|
+
},
|
|
149
|
+
]
|
|
150
|
+
})
|
|
151
|
+
.sort(
|
|
152
|
+
(left, right) =>
|
|
153
|
+
Number(left.unclassified) - Number(right.unclassified) || right.value - left.value
|
|
154
|
+
)
|
|
155
|
+
.map(({ unclassified: _, ...row }) => row)
|
|
156
|
+
}
|
|
@@ -30,10 +30,6 @@ export const en = {
|
|
|
30
30
|
`${plural("en", models, { one: "1 model", other: `${models} models` })} · ${plural("en", providers, { one: "1 provider", other: `${providers} providers` })}`,
|
|
31
31
|
coverage: "Pricing coverage",
|
|
32
32
|
coverageDetail: (rated: string, total: string) => `${rated} of ${total} calls valued`,
|
|
33
|
-
audio: "Audio duration",
|
|
34
|
-
audioDetail: (count: number, calls: string) =>
|
|
35
|
-
plural("en", count, { one: "Reported for 1 call", other: `Reported for ${calls} calls` }),
|
|
36
|
-
seconds: (value: string) => `${value} s`,
|
|
37
33
|
},
|
|
38
34
|
reporting: {
|
|
39
35
|
none: "No model calls",
|
|
@@ -44,6 +40,47 @@ export const en = {
|
|
|
44
40
|
unavailable: (count: string, total: string) =>
|
|
45
41
|
`Unavailable — complete usage reported for ${count} of ${total} calls`,
|
|
46
42
|
field: (count: string, total: string) => `Usage reported for ${count} of ${total} calls`,
|
|
43
|
+
// When images, speech, transcription or reranking ran too: those report no tokens.
|
|
44
|
+
tokenBilled: {
|
|
45
|
+
complete: (_count: string, total: string) =>
|
|
46
|
+
`Complete — reported by all ${total} token-billed calls`,
|
|
47
|
+
partial: (count: string, total: string) =>
|
|
48
|
+
`Partial — reported by ${count} of ${total} token-billed calls`,
|
|
49
|
+
unavailable: (count: string, total: string) =>
|
|
50
|
+
`Unavailable — reported by ${count} of ${total} token-billed calls`,
|
|
51
|
+
field: (count: string, total: string) =>
|
|
52
|
+
`Usage reported for ${count} of ${total} token-billed calls`,
|
|
53
|
+
fieldAll: "Reported by all token-billed calls",
|
|
54
|
+
},
|
|
55
|
+
period: (count: string, total: string) => `Tokens reported for ${count} of ${total} calls`,
|
|
56
|
+
},
|
|
57
|
+
units: {
|
|
58
|
+
tokens: (count: string) => `${count} tokens`,
|
|
59
|
+
images: (count: number, formatted: string) =>
|
|
60
|
+
plural("en", count, { one: "1 image", other: `${formatted} images` }),
|
|
61
|
+
characters: (count: number, formatted: string) =>
|
|
62
|
+
plural("en", count, { one: "1 character", other: `${formatted} characters` }),
|
|
63
|
+
searches: (count: number, formatted: string) =>
|
|
64
|
+
plural("en", count, { one: "1 search", other: `${formatted} searches` }),
|
|
65
|
+
audio: (duration: string) => `${duration} of audio`,
|
|
66
|
+
seconds: (value: string) => `${value} s`,
|
|
67
|
+
minutes: (minutes: string, seconds: string) => `${minutes} min ${seconds} s`,
|
|
68
|
+
hours: (hours: string, minutes: string) => `${hours} h ${minutes} min`,
|
|
69
|
+
},
|
|
70
|
+
kinds: {
|
|
71
|
+
names: {
|
|
72
|
+
language: "Language",
|
|
73
|
+
embedding: "Embeddings",
|
|
74
|
+
decision: "Decisions",
|
|
75
|
+
reranking: "Reranking",
|
|
76
|
+
image: "Images",
|
|
77
|
+
speech: "Speech",
|
|
78
|
+
transcription: "Transcription",
|
|
79
|
+
video: "Video",
|
|
80
|
+
unclassified: "Unclassified",
|
|
81
|
+
},
|
|
82
|
+
calls: (count: number, formatted: string) =>
|
|
83
|
+
plural("en", count, { one: "1 call", other: `${formatted} calls` }),
|
|
47
84
|
},
|
|
48
85
|
partialTitle: "Accounting coverage is partial",
|
|
49
86
|
partialTokens: (reporting: string) => `${reporting}; token totals include only known counts`,
|
|
@@ -60,6 +97,10 @@ export const en = {
|
|
|
60
97
|
noCostRange: "No valued calls in this range",
|
|
61
98
|
costByModel: "Cost by model",
|
|
62
99
|
costByModelDescription: "The highest recorded cost",
|
|
100
|
+
costByKind: "Cost by kind",
|
|
101
|
+
breakdownBy: "Break the cost down by",
|
|
102
|
+
byModel: "Model",
|
|
103
|
+
byKind: "Kind",
|
|
63
104
|
tokens: "Token usage",
|
|
64
105
|
tokensDescription: (reporting: string) => `Known input and output tokens. ${reporting}`,
|
|
65
106
|
input: "Input",
|
|
@@ -114,10 +155,8 @@ export const en = {
|
|
|
114
155
|
workflow: (id: string) => `Workflow · ${id}`,
|
|
115
156
|
action: (id: string) => `Action · ${id}`,
|
|
116
157
|
request: (id: string) => `Request · ${id}`,
|
|
117
|
-
tokens: (count: string) => `${count} tokens`,
|
|
118
|
-
audio: (seconds: string) => `${seconds} s audio`,
|
|
119
|
-
transcription: "Transcription",
|
|
120
158
|
reasoning: (level: string) => `${level} reasoning`,
|
|
159
|
+
unitPrice: (quantity: string, price: string) => `${quantity} × ${price}`,
|
|
121
160
|
reasoningBudget: (count: string) => `${count}-token reasoning budget`,
|
|
122
161
|
withoutCost: (count: string) => `${count} without cost`,
|
|
123
162
|
costAvailable: "Cost available",
|
|
@@ -250,10 +289,6 @@ export const fr: Translation<AiUsageMessages> = {
|
|
|
250
289
|
`${plural("fr", models, { one: "1 modèle", other: `${models} modèles` })} · ${plural("fr", providers, { one: "1 fournisseur", other: `${providers} fournisseurs` })}`,
|
|
251
290
|
coverage: "Couverture tarifaire",
|
|
252
291
|
coverageDetail: (rated: string, total: string) => `${rated} appels valorisés sur ${total}`,
|
|
253
|
-
audio: "Durée audio",
|
|
254
|
-
audioDetail: (count: number, calls: string) =>
|
|
255
|
-
plural("fr", count, { one: "Déclarée pour 1 appel", other: `Déclarée pour ${calls} appels` }),
|
|
256
|
-
seconds: (value: string) => `${value} s`,
|
|
257
292
|
},
|
|
258
293
|
reporting: {
|
|
259
294
|
none: "Aucun appel de modèle",
|
|
@@ -264,6 +299,46 @@ export const fr: Translation<AiUsageMessages> = {
|
|
|
264
299
|
unavailable: (count: string, total: string) =>
|
|
265
300
|
`Indisponible — usage complet déclaré pour ${count} appels sur ${total}`,
|
|
266
301
|
field: (count: string, total: string) => `Usage déclaré pour ${count} appels sur ${total}`,
|
|
302
|
+
tokenBilled: {
|
|
303
|
+
complete: (_count: string, total: string) =>
|
|
304
|
+
`Complet — déclaré par les ${total} appels facturés en jetons`,
|
|
305
|
+
partial: (count: string, total: string) =>
|
|
306
|
+
`Partiel — déclaré par ${count} des ${total} appels facturés en jetons`,
|
|
307
|
+
unavailable: (count: string, total: string) =>
|
|
308
|
+
`Indisponible — déclaré par ${count} des ${total} appels facturés en jetons`,
|
|
309
|
+
field: (count: string, total: string) =>
|
|
310
|
+
`Usage déclaré pour ${count} des ${total} appels facturés en jetons`,
|
|
311
|
+
fieldAll: "Déclaré par tous les appels facturés en jetons",
|
|
312
|
+
},
|
|
313
|
+
period: (count: string, total: string) => `Jetons déclarés pour ${count} appels sur ${total}`,
|
|
314
|
+
},
|
|
315
|
+
units: {
|
|
316
|
+
tokens: (count: string) => `${count} jetons`,
|
|
317
|
+
images: (count: number, formatted: string) =>
|
|
318
|
+
plural("fr", count, { one: "1 image", other: `${formatted} images` }),
|
|
319
|
+
characters: (count: number, formatted: string) =>
|
|
320
|
+
plural("fr", count, { one: "1 caractère", other: `${formatted} caractères` }),
|
|
321
|
+
searches: (count: number, formatted: string) =>
|
|
322
|
+
plural("fr", count, { one: "1 recherche", other: `${formatted} recherches` }),
|
|
323
|
+
audio: (duration: string) => `${duration} d’audio`,
|
|
324
|
+
seconds: (value: string) => `${value} s`,
|
|
325
|
+
minutes: (minutes: string, seconds: string) => `${minutes} min ${seconds} s`,
|
|
326
|
+
hours: (hours: string, minutes: string) => `${hours} h ${minutes} min`,
|
|
327
|
+
},
|
|
328
|
+
kinds: {
|
|
329
|
+
names: {
|
|
330
|
+
language: "Langage",
|
|
331
|
+
embedding: "Embeddings",
|
|
332
|
+
decision: "Décisions",
|
|
333
|
+
reranking: "Reclassement",
|
|
334
|
+
image: "Images",
|
|
335
|
+
speech: "Synthèse vocale",
|
|
336
|
+
transcription: "Transcription",
|
|
337
|
+
video: "Vidéo",
|
|
338
|
+
unclassified: "Non classés",
|
|
339
|
+
},
|
|
340
|
+
calls: (count: number, formatted: string) =>
|
|
341
|
+
plural("fr", count, { one: "1 appel", other: `${formatted} appels` }),
|
|
267
342
|
},
|
|
268
343
|
partialTitle: "La comptabilité est partielle",
|
|
269
344
|
partialTokens: (reporting: string) =>
|
|
@@ -281,6 +356,10 @@ export const fr: Translation<AiUsageMessages> = {
|
|
|
281
356
|
noCostRange: "Aucun appel valorisé sur cette période",
|
|
282
357
|
costByModel: "Coût par modèle",
|
|
283
358
|
costByModelDescription: "Les coûts enregistrés les plus élevés",
|
|
359
|
+
costByKind: "Coût par type",
|
|
360
|
+
breakdownBy: "Répartir le coût par",
|
|
361
|
+
byModel: "Modèle",
|
|
362
|
+
byKind: "Type",
|
|
284
363
|
tokens: "Jetons utilisés",
|
|
285
364
|
tokensDescription: (reporting: string) => `Jetons d’entrée et de sortie connus. ${reporting}`,
|
|
286
365
|
input: "Entrée",
|
|
@@ -336,10 +415,8 @@ export const fr: Translation<AiUsageMessages> = {
|
|
|
336
415
|
workflow: (id: string) => `Workflow · ${id}`,
|
|
337
416
|
action: (id: string) => `Action · ${id}`,
|
|
338
417
|
request: (id: string) => `Requête · ${id}`,
|
|
339
|
-
tokens: (count: string) => `${count} jetons`,
|
|
340
|
-
audio: (seconds: string) => `${seconds} s d’audio`,
|
|
341
|
-
transcription: "Transcription",
|
|
342
418
|
reasoning: (level: string) => `raisonnement ${level}`,
|
|
419
|
+
unitPrice: (quantity: string, price: string) => `${quantity} × ${price}`,
|
|
343
420
|
reasoningBudget: (count: string) => `budget de raisonnement de ${count} jetons`,
|
|
344
421
|
withoutCost: (count: string) => `${count} sans coût`,
|
|
345
422
|
costAvailable: "Coût disponible",
|