@sixb/app 0.1.18 → 0.2.1
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 +2 -2
- package/assets/connector-icons/README.md +2 -1
- package/assets/connector-icons/fleetio.ico +0 -0
- package/dist/agent/activity-label.d.ts.map +1 -1
- package/dist/agent/agent-chat.d.ts.map +1 -1
- package/dist/agent/background/background-card.d.ts +10 -0
- package/dist/agent/background/background-card.d.ts.map +1 -0
- package/dist/agent/background/background-tool-row.d.ts +9 -0
- package/dist/agent/background/background-tool-row.d.ts.map +1 -0
- package/dist/agent/background/context.d.ts +23 -0
- package/dist/agent/background/context.d.ts.map +1 -0
- package/dist/agent/background/interpret.d.ts +116 -0
- package/dist/agent/background/interpret.d.ts.map +1 -0
- package/dist/agent/bash/bash-tool-view.d.ts.map +1 -1
- package/dist/agent/bash/interpret.d.ts +5 -1
- package/dist/agent/bash/interpret.d.ts.map +1 -1
- package/dist/agent/components/agent-message-body.d.ts.map +1 -1
- package/dist/agent/components/composer-menu.d.ts +3 -1
- package/dist/agent/components/composer-menu.d.ts.map +1 -1
- package/dist/agent/components/composer-place.d.ts +11 -0
- package/dist/agent/components/composer-place.d.ts.map +1 -0
- package/dist/agent/components/composer.d.ts +7 -1
- package/dist/agent/components/composer.d.ts.map +1 -1
- package/dist/agent/components/computer-place.d.ts +25 -0
- package/dist/agent/components/computer-place.d.ts.map +1 -0
- package/dist/agent/components/context-meter.d.ts +41 -0
- package/dist/agent/components/context-meter.d.ts.map +1 -0
- package/dist/agent/components/message-parts.d.ts +9 -1
- package/dist/agent/components/message-parts.d.ts.map +1 -1
- package/dist/agent/components/message-view.d.ts +18 -3
- package/dist/agent/components/message-view.d.ts.map +1 -1
- package/dist/agent/components/transcript.d.ts +13 -0
- package/dist/agent/components/transcript.d.ts.map +1 -1
- package/dist/agent/components/web-fetch-tool-view.d.ts.map +1 -1
- package/dist/agent/conversation.d.ts +17 -2
- package/dist/agent/conversation.d.ts.map +1 -1
- package/dist/agent/delegation/child-parts.d.ts +2 -0
- package/dist/agent/delegation/child-parts.d.ts.map +1 -1
- package/dist/agent/delegation/use-children.d.ts +65 -5
- package/dist/agent/delegation/use-children.d.ts.map +1 -1
- package/dist/agent/format.d.ts +4 -0
- package/dist/agent/format.d.ts.map +1 -1
- package/dist/agent/hooks/use-agent-conversation.d.ts +33 -3
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-new-thread-place.d.ts +48 -0
- package/dist/agent/hooks/use-new-thread-place.d.ts.map +1 -0
- package/dist/agent/hooks/use-thread-lists.d.ts +68 -4
- package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
- package/dist/agent/hooks/use-thread-stream.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +125 -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 +224 -0
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/live-run.d.ts +4 -0
- package/dist/agent/live-run.d.ts.map +1 -1
- package/dist/agent/observed-conversation.d.ts.map +1 -1
- package/dist/agent/parts.d.ts +2 -0
- package/dist/agent/parts.d.ts.map +1 -1
- package/dist/agent/run-presentation.d.ts +2 -0
- package/dist/agent/run-presentation.d.ts.map +1 -1
- package/dist/agent/tool-views/built-in.d.ts.map +1 -1
- package/dist/agent/types.d.ts +3 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/utils/web-fetch.d.ts +33 -1
- package/dist/agent/utils/web-fetch.d.ts.map +1 -1
- package/dist/agent/utils/web-search.d.ts +14 -2
- package/dist/agent/utils/web-search.d.ts.map +1 -1
- package/dist/{chunk-pkcm8rn8.js → chunk-4j3c3p72.js} +1 -1
- package/dist/{chunk-sw3pyqgy.js → chunk-4mprsd2n.js} +15 -34
- package/dist/chunk-4mprsd2n.js.map +10 -0
- package/dist/{chunk-gq6xek89.js → chunk-7fj9cfkw.js} +3 -3
- package/dist/chunk-7fj9cfkw.js.map +10 -0
- package/dist/{chunk-md3p7qdt.js → chunk-dgs11da9.js} +3 -3
- package/dist/{chunk-md3p7qdt.js.map → chunk-dgs11da9.js.map} +2 -2
- package/dist/{chunk-hdbmj6f0.js → chunk-j8g956dt.js} +1 -1
- package/dist/{chunk-6n5pdqp0.js → chunk-j98jkx60.js} +3 -3
- package/dist/{chunk-6n5pdqp0.js.map → chunk-j98jkx60.js.map} +2 -2
- package/dist/{chunk-k4epnkcr.js → chunk-kwbw4dyk.js} +1 -1
- package/dist/{chunk-53z5653y.js → chunk-q69001w3.js} +78 -90
- package/dist/chunk-q69001w3.js.map +11 -0
- package/dist/{chunk-btky7c9w.js → chunk-ytadd0b5.js} +4205 -2203
- package/dist/{chunk-btky7c9w.js.map → chunk-ytadd0b5.js.map} +44 -36
- package/dist/codegen.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -16
- package/dist/index.js.map +5 -5
- package/dist/locale-messages.d.ts +8 -20
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +8 -20
- 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 → console}/action-run.d.ts +1 -1
- package/dist/pages/console/action-run.d.ts.map +1 -0
- package/dist/pages/console/data/connectors.d.ts +5 -0
- package/dist/pages/console/data/connectors.d.ts.map +1 -0
- package/dist/pages/{data → console/data}/datasets.d.ts +3 -3
- package/dist/pages/console/data/datasets.d.ts.map +1 -0
- package/dist/pages/console/data/live-updates.d.ts.map +1 -0
- package/dist/pages/{data → console/data}/messages.d.ts +19 -1
- package/dist/pages/console/data/messages.d.ts.map +1 -0
- package/dist/pages/{data → console/data}/pipeline-canvas.d.ts +1 -1
- package/dist/pages/console/data/pipeline-canvas.d.ts.map +1 -0
- package/dist/pages/console/data/pipelines.d.ts +9 -0
- package/dist/pages/console/data/pipelines.d.ts.map +1 -0
- package/dist/pages/console/data/producer.d.ts +21 -0
- package/dist/pages/console/data/producer.d.ts.map +1 -0
- package/dist/pages/{data → console/data}/projections.d.ts +3 -3
- package/dist/pages/console/data/projections.d.ts.map +1 -0
- package/dist/pages/console/data/schema.d.ts.map +1 -0
- package/dist/pages/console/data/shared.d.ts.map +1 -0
- package/dist/pages/console/data/sync-button.d.ts.map +1 -0
- package/dist/pages/console/data/syncs.d.ts +5 -0
- package/dist/pages/console/data/syncs.d.ts.map +1 -0
- package/dist/pages/console/live-updates.d.ts.map +1 -0
- package/dist/pages/{observability → console}/logs.d.ts +2 -2
- package/dist/pages/console/logs.d.ts.map +1 -0
- package/dist/pages/{observability → console}/messages.d.ts +8 -100
- package/dist/pages/console/messages.d.ts.map +1 -0
- package/dist/pages/console/ontology/action-runs.d.ts +16 -0
- package/dist/pages/console/ontology/action-runs.d.ts.map +1 -0
- package/dist/pages/console/ontology/actions.d.ts +6 -0
- package/dist/pages/console/ontology/actions.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/action-button.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/action-param-null-control.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/collection-toolbar.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/common.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/file-ref-upload-field.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/object-filter-popover.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/object-icon.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/object-query-bar.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/telemetry-chart.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/telemetry-grid.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/telemetry-tile.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/telemetry-value.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/usage-bar.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/user-picker.d.ts.map +1 -0
- package/dist/pages/console/ontology/graph.d.ts +6 -0
- package/dist/pages/console/ontology/graph.d.ts.map +1 -0
- package/dist/pages/console/ontology/hooks/object-live-updates.d.ts.map +1 -0
- package/dist/pages/console/ontology/hooks/object-telemetry-updates.d.ts.map +1 -0
- package/dist/pages/console/ontology/hooks/object-type-counts.d.ts.map +1 -0
- package/dist/pages/console/ontology/hooks/rule-live-updates.d.ts.map +1 -0
- package/dist/pages/console/ontology/hooks/workflow-live-updates.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/action-params.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/format-value.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/labels.d.ts.map +1 -0
- package/dist/pages/{ontology → console/ontology}/lib/live-update-keys.d.ts +2 -0
- package/dist/pages/console/ontology/lib/live-update-keys.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/object-query.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/ontology-graph-layout.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/ontology-graph-links.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/telemetry-history.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/time.d.ts.map +1 -0
- package/dist/pages/console/ontology/lib/user-preferences.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/action-name.d.ts +6 -0
- package/dist/pages/console/ontology/lineage/action-name.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/dataset-steps.d.ts +15 -0
- package/dist/pages/console/ontology/lineage/dataset-steps.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/links.d.ts +13 -0
- package/dist/pages/console/ontology/lineage/links.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/messages.d.ts +108 -0
- package/dist/pages/console/ontology/lineage/messages.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/model.d.ts +84 -0
- package/dist/pages/console/ontology/lineage/model.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/properties-panel.d.ts +17 -0
- package/dist/pages/console/ontology/lineage/properties-panel.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/property-source.d.ts +12 -0
- package/dist/pages/console/ontology/lineage/property-source.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/query.d.ts +8 -0
- package/dist/pages/console/ontology/lineage/query.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/requester.d.ts +8 -0
- package/dist/pages/console/ontology/lineage/requester.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/separated.d.ts +16 -0
- package/dist/pages/console/ontology/lineage/separated.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/summary.d.ts +10 -0
- package/dist/pages/console/ontology/lineage/summary.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/trail-step.d.ts +20 -0
- package/dist/pages/console/ontology/lineage/trail-step.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/trail.d.ts +21 -0
- package/dist/pages/console/ontology/lineage/trail.d.ts.map +1 -0
- package/dist/pages/console/ontology/lineage/value-lineage-panel.d.ts +26 -0
- package/dist/pages/console/ontology/lineage/value-lineage-panel.d.ts.map +1 -0
- package/dist/pages/console/ontology/object-page.d.ts.map +1 -0
- package/dist/pages/console/ontology/object-type.d.ts +3 -0
- package/dist/pages/console/ontology/object-type.d.ts.map +1 -0
- package/dist/pages/console/ontology/object-types.d.ts +7 -0
- package/dist/pages/console/ontology/object-types.d.ts.map +1 -0
- package/dist/pages/console/ontology/objects.d.ts +6 -0
- package/dist/pages/console/ontology/objects.d.ts.map +1 -0
- package/dist/pages/{ontology → console/ontology}/rules.d.ts +3 -3
- package/dist/pages/console/ontology/rules.d.ts.map +1 -0
- package/dist/pages/{ontology → console/ontology}/workflow.d.ts +1 -1
- package/dist/pages/console/ontology/workflow.d.ts.map +1 -0
- package/dist/pages/{ontology → console/ontology}/workflows/agent-execution-panel.d.ts +1 -1
- package/dist/pages/console/ontology/workflows/agent-execution-panel.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/intervention-panel.d.ts.map +1 -0
- package/dist/pages/{ontology → console/ontology}/workflows/node-execution-panel.d.ts +1 -1
- package/dist/pages/console/ontology/workflows/node-execution-panel.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/request-run-dialog.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/run-debug-section.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/run-input-form.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/run-progress.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/schema-shape.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/status-badge.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/utils.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows/workflow-card.d.ts.map +1 -0
- package/dist/pages/console/ontology/workflows.d.ts +3 -0
- package/dist/pages/console/ontology/workflows.d.ts.map +1 -0
- package/dist/pages/{observability → console}/workflow-run.d.ts +1 -1
- package/dist/pages/console/workflow-run.d.ts.map +1 -0
- package/dist/pages/routes.d.ts +16 -8
- package/dist/pages/routes.d.ts.map +1 -1
- package/dist/pages/section-page.d.ts +2 -6
- package/dist/pages/section-page.d.ts.map +1 -1
- package/dist/pages/section-ui.d.ts +15 -0
- package/dist/pages/section-ui.d.ts.map +1 -1
- package/dist/pages/settings/activity/calendar.d.ts.map +1 -0
- package/dist/pages/settings/activity/connections.d.ts.map +1 -0
- package/dist/pages/settings/activity/format.d.ts.map +1 -0
- package/dist/pages/{observability → settings}/activity/messages.d.ts +1 -1
- package/dist/pages/settings/activity/messages.d.ts.map +1 -0
- package/dist/pages/settings/activity/meta-items.d.ts.map +1 -0
- package/dist/pages/settings/activity/page.d.ts +6 -0
- package/dist/pages/settings/activity/page.d.ts.map +1 -0
- package/dist/pages/{observability → settings}/activity/period.d.ts +1 -1
- package/dist/pages/settings/activity/period.d.ts.map +1 -0
- package/dist/pages/settings/activity/steps.d.ts.map +1 -0
- package/dist/pages/settings/activity/thread.d.ts +6 -0
- package/dist/pages/settings/activity/thread.d.ts.map +1 -0
- package/dist/pages/settings/activity/timeline.d.ts.map +1 -0
- package/dist/pages/settings/activity/users.d.ts.map +1 -0
- package/dist/pages/settings/controls.d.ts +1 -1
- package/dist/pages/settings/controls.d.ts.map +1 -1
- package/dist/pages/settings/members.d.ts +4 -1
- package/dist/pages/settings/members.d.ts.map +1 -1
- package/dist/pages/settings/memory-editors.d.ts +55 -0
- package/dist/pages/settings/memory-editors.d.ts.map +1 -0
- package/dist/pages/settings/memory-entries.d.ts +2 -5
- package/dist/pages/settings/memory-entries.d.ts.map +1 -1
- package/dist/pages/settings/memory-files.d.ts +17 -14
- package/dist/pages/settings/memory-files.d.ts.map +1 -1
- package/dist/pages/settings/memory-history.d.ts +5 -3
- package/dist/pages/settings/memory-history.d.ts.map +1 -1
- package/dist/pages/settings/memory-note.d.ts +15 -0
- package/dist/pages/settings/memory-note.d.ts.map +1 -0
- package/dist/pages/settings/memory.d.ts +3 -17
- package/dist/pages/settings/memory.d.ts.map +1 -1
- package/dist/pages/settings/messages.d.ts +76 -16
- package/dist/pages/settings/messages.d.ts.map +1 -1
- package/dist/pages/settings/service-accounts.d.ts +8 -2
- package/dist/pages/settings/service-accounts.d.ts.map +1 -1
- package/dist/pages/settings/usage/breakdown.d.ts +17 -0
- package/dist/pages/settings/usage/breakdown.d.ts.map +1 -0
- package/dist/pages/settings/usage/call-detail.d.ts +9 -0
- package/dist/pages/settings/usage/call-detail.d.ts.map +1 -0
- package/dist/pages/settings/usage/filter-menu.d.ts +28 -0
- package/dist/pages/settings/usage/filter-menu.d.ts.map +1 -0
- package/dist/pages/{observability/ai-usage → settings/usage}/format.d.ts +0 -53
- package/dist/pages/settings/usage/format.d.ts.map +1 -0
- package/dist/pages/settings/usage/limits.d.ts.map +1 -0
- package/dist/pages/settings/usage/messages.d.ts +615 -0
- package/dist/pages/settings/usage/messages.d.ts.map +1 -0
- package/dist/pages/settings/usage/page.d.ts +6 -0
- package/dist/pages/settings/usage/page.d.ts.map +1 -0
- package/dist/pages/settings/usage/runs.d.ts +17 -0
- package/dist/pages/settings/usage/runs.d.ts.map +1 -0
- package/dist/pages/settings/usage/segmented.d.ts +11 -0
- package/dist/pages/settings/usage/segmented.d.ts.map +1 -0
- package/dist/pages/settings/usage/spend-chart.d.ts +22 -0
- package/dist/pages/settings/usage/spend-chart.d.ts.map +1 -0
- package/dist/pages/settings/usage/spend-model.d.ts +133 -0
- package/dist/pages/settings/usage/spend-model.d.ts.map +1 -0
- package/dist/pages/values.d.ts +10 -2
- package/dist/pages/values.d.ts.map +1 -1
- package/dist/pages.d.ts +21 -23
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +24976 -22781
- package/dist/pages.js.map +87 -66
- package/dist/sections/catalog.d.ts +10 -6
- package/dist/sections/catalog.d.ts.map +1 -1
- package/dist/sections/counts.d.ts.map +1 -1
- package/dist/sections/sections.d.ts +11 -18
- package/dist/sections/sections.d.ts.map +1 -1
- package/dist/server.js +128 -37
- package/dist/server.js.map +4 -4
- package/dist/session.d.ts +6 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/shared-unavailable.d.ts +14 -0
- package/dist/shared-unavailable.d.ts.map +1 -0
- package/dist/shell/user-menu.d.ts +1 -1
- package/package.json +4 -4
- package/src/agent/activity-label.ts +6 -2
- package/src/agent/agent-chat.tsx +4 -0
- package/src/agent/agent.css +47 -0
- package/src/agent/background/background-card.tsx +308 -0
- package/src/agent/background/background-tool-row.tsx +58 -0
- package/src/agent/background/context.ts +26 -0
- package/src/agent/background/interpret.ts +356 -0
- package/src/agent/bash/bash-tool-view.tsx +9 -4
- package/src/agent/bash/interpret.ts +29 -3
- package/src/agent/components/agent-message-body.tsx +13 -3
- package/src/agent/components/approval-card.tsx +1 -1
- package/src/agent/components/composer-menu.tsx +4 -1
- package/src/agent/components/composer-place.tsx +144 -0
- package/src/agent/components/composer.tsx +18 -0
- package/src/agent/components/computer-place.tsx +136 -0
- package/src/agent/components/context-meter.tsx +419 -0
- package/src/agent/components/conversation-panel.tsx +1 -1
- package/src/agent/components/message-parts.tsx +72 -6
- package/src/agent/components/message-view.tsx +74 -17
- package/src/agent/components/transcript.tsx +62 -5
- package/src/agent/components/web-fetch-tool-view.tsx +94 -29
- package/src/agent/conversation.ts +33 -3
- package/src/agent/delegation/child-parts.tsx +1 -1
- package/src/agent/format.ts +21 -1
- package/src/agent/hooks/use-agent-conversation.ts +200 -6
- package/src/agent/hooks/use-new-thread-place.ts +170 -0
- package/src/agent/hooks/use-thread-stream.ts +7 -0
- package/src/agent/i18n/en.ts +123 -0
- package/src/agent/i18n/fr.ts +121 -0
- package/src/agent/live-run.ts +24 -3
- package/src/agent/observed-conversation.tsx +3 -0
- package/src/agent/parts.ts +10 -0
- package/src/agent/run-presentation.ts +3 -0
- package/src/agent/tool-views/built-in.tsx +26 -11
- package/src/agent/types.ts +4 -0
- package/src/agent/utils/web-fetch.ts +89 -10
- package/src/agent/utils/web-search.ts +67 -28
- package/src/codegen.ts +134 -18
- package/src/index.ts +4 -2
- package/src/locale-messages.ts +12 -31
- package/src/metadata.ts +1 -33
- package/src/pages/{observability → console}/action-run.tsx +11 -10
- package/src/pages/{data → console/data}/connectors.tsx +11 -11
- package/src/pages/{data → console/data}/datasets.tsx +35 -16
- package/src/pages/{data → console/data}/messages.ts +13 -1
- package/src/pages/{data → console/data}/pipeline-canvas.tsx +1 -1
- package/src/pages/{data → console/data}/pipelines.tsx +11 -11
- package/src/pages/console/data/producer.tsx +90 -0
- package/src/pages/{data → console/data}/projections.tsx +11 -11
- package/src/pages/{data → console/data}/schema.tsx +1 -1
- package/src/pages/{data → console/data}/shared.tsx +2 -1
- package/src/pages/{data → console/data}/sync-button.tsx +1 -1
- package/src/pages/{data → console/data}/syncs.tsx +12 -12
- package/src/pages/{observability → console}/logs.tsx +10 -10
- package/src/pages/{observability → console}/messages.ts +9 -107
- package/src/pages/console/ontology/action-runs.tsx +247 -0
- package/src/pages/{ontology → console/ontology}/actions.tsx +57 -10
- package/src/pages/{ontology → console/ontology}/components/action-button.tsx +5 -5
- package/src/pages/{ontology → console/ontology}/graph.tsx +6 -6
- package/src/pages/{ontology → console/ontology}/lib/live-update-keys.ts +10 -1
- package/src/pages/console/ontology/lineage/action-name.ts +19 -0
- package/src/pages/console/ontology/lineage/dataset-steps.tsx +127 -0
- package/src/pages/console/ontology/lineage/links.tsx +45 -0
- package/src/pages/console/ontology/lineage/messages.ts +117 -0
- package/src/pages/console/ontology/lineage/model.ts +176 -0
- package/src/pages/console/ontology/lineage/properties-panel.tsx +95 -0
- package/src/pages/console/ontology/lineage/property-source.tsx +60 -0
- package/src/pages/console/ontology/lineage/query.ts +21 -0
- package/src/pages/console/ontology/lineage/requester.tsx +73 -0
- package/src/pages/console/ontology/lineage/separated.tsx +33 -0
- package/src/pages/console/ontology/lineage/summary.tsx +58 -0
- package/src/pages/console/ontology/lineage/trail-step.tsx +71 -0
- package/src/pages/console/ontology/lineage/trail.tsx +346 -0
- package/src/pages/console/ontology/lineage/value-lineage-panel.tsx +146 -0
- package/src/pages/{ontology → console/ontology}/object-page.tsx +22 -14
- package/src/pages/{ontology → console/ontology}/object-type.tsx +6 -6
- package/src/pages/{ontology → console/ontology}/object-types.tsx +7 -7
- package/src/pages/{ontology → console/ontology}/objects.tsx +6 -6
- package/src/pages/{ontology → console/ontology}/rules.tsx +10 -10
- package/src/pages/{ontology → console/ontology}/workflow.tsx +9 -9
- package/src/pages/{ontology → console/ontology}/workflows/agent-execution-panel.tsx +3 -3
- package/src/pages/{ontology → console/ontology}/workflows/intervention-panel.tsx +1 -1
- package/src/pages/{ontology → console/ontology}/workflows/node-execution-panel.tsx +2 -2
- package/src/pages/{ontology → console/ontology}/workflows/request-run-dialog.tsx +1 -1
- package/src/pages/{ontology → console/ontology}/workflows/run-debug-section.tsx +1 -1
- package/src/pages/{ontology → console/ontology}/workflows/utils.ts +2 -2
- package/src/pages/{ontology → console/ontology}/workflows/workflow-card.tsx +2 -2
- package/src/pages/{ontology → console/ontology}/workflows.tsx +5 -5
- package/src/pages/{observability → console}/workflow-run.tsx +18 -13
- package/src/pages/routes.ts +38 -16
- package/src/pages/section-page.tsx +3 -13
- package/src/pages/section-ui.tsx +74 -0
- package/src/pages/{observability → settings}/activity/messages.ts +1 -1
- package/src/pages/{observability → settings}/activity/page.tsx +3 -3
- package/src/pages/{observability → settings}/activity/period.ts +1 -1
- package/src/pages/{observability → settings}/activity/thread.tsx +5 -5
- package/src/pages/{observability → settings}/activity/timeline.tsx +2 -2
- package/src/pages/settings/controls.tsx +9 -4
- package/src/pages/settings/members.tsx +493 -203
- package/src/pages/settings/memory-editors.tsx +310 -0
- package/src/pages/settings/memory-entries.ts +10 -22
- package/src/pages/settings/memory-files.ts +37 -53
- package/src/pages/settings/memory-history.tsx +185 -194
- package/src/pages/settings/memory-note.tsx +710 -0
- package/src/pages/settings/memory.tsx +287 -776
- package/src/pages/settings/messages.ts +95 -26
- package/src/pages/settings/service-accounts.tsx +14 -12
- package/src/pages/settings/usage/breakdown.tsx +424 -0
- package/src/pages/settings/usage/call-detail.tsx +283 -0
- package/src/pages/settings/usage/filter-menu.tsx +183 -0
- package/src/pages/{observability/ai-usage → settings/usage}/format.ts +0 -156
- package/src/pages/settings/usage/messages.ts +566 -0
- package/src/pages/settings/usage/page.tsx +567 -0
- package/src/pages/settings/usage/runs.tsx +774 -0
- package/src/pages/settings/usage/segmented.tsx +38 -0
- package/src/pages/settings/usage/spend-chart.tsx +334 -0
- package/src/pages/settings/usage/spend-model.ts +336 -0
- package/src/pages/values.tsx +25 -3
- package/src/pages.ts +26 -30
- package/src/sections/catalog.ts +93 -89
- package/src/sections/counts.ts +31 -12
- package/src/sections/sections.tsx +29 -48
- package/src/session.ts +12 -0
- package/src/shared-unavailable.ts +13 -0
- package/src/shell/user-menu.tsx +1 -1
- package/dist/chunk-53z5653y.js.map +0 -11
- package/dist/chunk-gq6xek89.js.map +0 -10
- package/dist/chunk-sw3pyqgy.js.map +0 -10
- package/dist/chunk-yvhzn4ye.js +0 -98
- package/dist/chunk-yvhzn4ye.js.map +0 -10
- package/dist/pages/data/connectors.d.ts +0 -5
- package/dist/pages/data/connectors.d.ts.map +0 -1
- package/dist/pages/data/datasets.d.ts.map +0 -1
- package/dist/pages/data/live-updates.d.ts.map +0 -1
- package/dist/pages/data/messages.d.ts.map +0 -1
- package/dist/pages/data/pipeline-canvas.d.ts.map +0 -1
- package/dist/pages/data/pipelines.d.ts +0 -9
- package/dist/pages/data/pipelines.d.ts.map +0 -1
- package/dist/pages/data/projections.d.ts.map +0 -1
- package/dist/pages/data/schema.d.ts.map +0 -1
- package/dist/pages/data/shared.d.ts.map +0 -1
- package/dist/pages/data/sync-button.d.ts.map +0 -1
- package/dist/pages/data/syncs.d.ts +0 -5
- package/dist/pages/data/syncs.d.ts.map +0 -1
- package/dist/pages/observability/action-run.d.ts.map +0 -1
- package/dist/pages/observability/activity/calendar.d.ts.map +0 -1
- package/dist/pages/observability/activity/connections.d.ts.map +0 -1
- package/dist/pages/observability/activity/format.d.ts.map +0 -1
- package/dist/pages/observability/activity/messages.d.ts.map +0 -1
- package/dist/pages/observability/activity/meta-items.d.ts.map +0 -1
- package/dist/pages/observability/activity/page.d.ts +0 -6
- package/dist/pages/observability/activity/page.d.ts.map +0 -1
- package/dist/pages/observability/activity/period.d.ts.map +0 -1
- package/dist/pages/observability/activity/steps.d.ts.map +0 -1
- package/dist/pages/observability/activity/thread.d.ts +0 -6
- package/dist/pages/observability/activity/thread.d.ts.map +0 -1
- package/dist/pages/observability/activity/timeline.d.ts.map +0 -1
- package/dist/pages/observability/activity/users.d.ts.map +0 -1
- package/dist/pages/observability/ai-usage/calls.d.ts +0 -27
- package/dist/pages/observability/ai-usage/calls.d.ts.map +0 -1
- package/dist/pages/observability/ai-usage/charts.d.ts +0 -23
- package/dist/pages/observability/ai-usage/charts.d.ts.map +0 -1
- package/dist/pages/observability/ai-usage/format.d.ts.map +0 -1
- package/dist/pages/observability/ai-usage/kinds.d.ts +0 -40
- package/dist/pages/observability/ai-usage/kinds.d.ts.map +0 -1
- package/dist/pages/observability/ai-usage/limits.d.ts.map +0 -1
- package/dist/pages/observability/ai-usage/messages.d.ts +0 -493
- package/dist/pages/observability/ai-usage/messages.d.ts.map +0 -1
- package/dist/pages/observability/ai-usage/page.d.ts +0 -6
- package/dist/pages/observability/ai-usage/page.d.ts.map +0 -1
- package/dist/pages/observability/live-updates.d.ts.map +0 -1
- package/dist/pages/observability/logs.d.ts.map +0 -1
- package/dist/pages/observability/messages.d.ts.map +0 -1
- package/dist/pages/observability/runs.d.ts +0 -7
- package/dist/pages/observability/runs.d.ts.map +0 -1
- package/dist/pages/observability/workflow-run.d.ts.map +0 -1
- package/dist/pages/ontology/actions.d.ts +0 -3
- package/dist/pages/ontology/actions.d.ts.map +0 -1
- package/dist/pages/ontology/components/action-button.d.ts.map +0 -1
- package/dist/pages/ontology/components/action-param-null-control.d.ts.map +0 -1
- package/dist/pages/ontology/components/collection-toolbar.d.ts.map +0 -1
- package/dist/pages/ontology/components/common.d.ts.map +0 -1
- package/dist/pages/ontology/components/file-ref-upload-field.d.ts.map +0 -1
- package/dist/pages/ontology/components/object-filter-popover.d.ts.map +0 -1
- package/dist/pages/ontology/components/object-icon.d.ts.map +0 -1
- package/dist/pages/ontology/components/object-query-bar.d.ts.map +0 -1
- package/dist/pages/ontology/components/telemetry-chart.d.ts.map +0 -1
- package/dist/pages/ontology/components/telemetry-grid.d.ts.map +0 -1
- package/dist/pages/ontology/components/telemetry-tile.d.ts.map +0 -1
- package/dist/pages/ontology/components/telemetry-value.d.ts.map +0 -1
- package/dist/pages/ontology/components/usage-bar.d.ts.map +0 -1
- package/dist/pages/ontology/components/user-picker.d.ts.map +0 -1
- package/dist/pages/ontology/graph.d.ts +0 -6
- package/dist/pages/ontology/graph.d.ts.map +0 -1
- package/dist/pages/ontology/hooks/object-live-updates.d.ts.map +0 -1
- package/dist/pages/ontology/hooks/object-telemetry-updates.d.ts.map +0 -1
- package/dist/pages/ontology/hooks/object-type-counts.d.ts.map +0 -1
- package/dist/pages/ontology/hooks/rule-live-updates.d.ts.map +0 -1
- package/dist/pages/ontology/hooks/workflow-live-updates.d.ts.map +0 -1
- package/dist/pages/ontology/lib/action-params.d.ts.map +0 -1
- package/dist/pages/ontology/lib/format-value.d.ts.map +0 -1
- package/dist/pages/ontology/lib/labels.d.ts.map +0 -1
- package/dist/pages/ontology/lib/live-update-keys.d.ts.map +0 -1
- package/dist/pages/ontology/lib/object-query.d.ts.map +0 -1
- package/dist/pages/ontology/lib/ontology-graph-layout.d.ts.map +0 -1
- package/dist/pages/ontology/lib/ontology-graph-links.d.ts.map +0 -1
- package/dist/pages/ontology/lib/telemetry-history.d.ts.map +0 -1
- package/dist/pages/ontology/lib/time.d.ts.map +0 -1
- package/dist/pages/ontology/lib/user-preferences.d.ts.map +0 -1
- package/dist/pages/ontology/object-page.d.ts.map +0 -1
- package/dist/pages/ontology/object-type.d.ts +0 -3
- package/dist/pages/ontology/object-type.d.ts.map +0 -1
- package/dist/pages/ontology/object-types.d.ts +0 -7
- package/dist/pages/ontology/object-types.d.ts.map +0 -1
- package/dist/pages/ontology/objects.d.ts +0 -6
- package/dist/pages/ontology/objects.d.ts.map +0 -1
- package/dist/pages/ontology/rules.d.ts.map +0 -1
- package/dist/pages/ontology/workflow.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/agent-execution-panel.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/intervention-panel.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/node-execution-panel.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/request-run-dialog.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/run-debug-section.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/run-input-form.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/run-progress.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/schema-shape.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/status-badge.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/utils.d.ts.map +0 -1
- package/dist/pages/ontology/workflows/workflow-card.d.ts.map +0 -1
- package/dist/pages/ontology/workflows.d.ts +0 -3
- package/dist/pages/ontology/workflows.d.ts.map +0 -1
- package/dist/pages/settings/memory-contents.d.ts +0 -30
- package/dist/pages/settings/memory-contents.d.ts.map +0 -1
- package/src/pages/observability/ai-usage/calls.tsx +0 -585
- package/src/pages/observability/ai-usage/charts.tsx +0 -126
- package/src/pages/observability/ai-usage/kinds.tsx +0 -156
- package/src/pages/observability/ai-usage/messages.ts +0 -523
- package/src/pages/observability/ai-usage/page.tsx +0 -923
- package/src/pages/observability/runs.tsx +0 -732
- package/src/pages/settings/memory-contents.tsx +0 -173
- /package/dist/{chunk-pkcm8rn8.js.map → chunk-4j3c3p72.js.map} +0 -0
- /package/dist/{chunk-hdbmj6f0.js.map → chunk-j8g956dt.js.map} +0 -0
- /package/dist/{chunk-k4epnkcr.js.map → chunk-kwbw4dyk.js.map} +0 -0
- /package/dist/pages/{data → console/data}/live-updates.d.ts +0 -0
- /package/dist/pages/{data → console/data}/schema.d.ts +0 -0
- /package/dist/pages/{data → console/data}/shared.d.ts +0 -0
- /package/dist/pages/{data → console/data}/sync-button.d.ts +0 -0
- /package/dist/pages/{observability → console}/live-updates.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/action-button.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/action-param-null-control.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/collection-toolbar.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/common.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/file-ref-upload-field.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/object-filter-popover.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/object-icon.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/object-query-bar.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/telemetry-chart.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/telemetry-grid.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/telemetry-tile.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/telemetry-value.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/usage-bar.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/components/user-picker.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/hooks/object-live-updates.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/hooks/object-telemetry-updates.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/hooks/object-type-counts.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/hooks/rule-live-updates.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/hooks/workflow-live-updates.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/action-params.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/format-value.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/labels.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/object-query.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/ontology-graph-layout.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/ontology-graph-links.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/telemetry-history.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/time.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/lib/user-preferences.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/object-page.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/intervention-panel.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/request-run-dialog.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/run-debug-section.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/run-input-form.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/run-progress.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/schema-shape.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/status-badge.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/utils.d.ts +0 -0
- /package/dist/pages/{ontology → console/ontology}/workflows/workflow-card.d.ts +0 -0
- /package/dist/pages/{observability → settings}/activity/calendar.d.ts +0 -0
- /package/dist/pages/{observability → settings}/activity/connections.d.ts +0 -0
- /package/dist/pages/{observability → settings}/activity/format.d.ts +0 -0
- /package/dist/pages/{observability → settings}/activity/meta-items.d.ts +0 -0
- /package/dist/pages/{observability → settings}/activity/steps.d.ts +0 -0
- /package/dist/pages/{observability → settings}/activity/timeline.d.ts +0 -0
- /package/dist/pages/{observability → settings}/activity/users.d.ts +0 -0
- /package/dist/pages/{observability/ai-usage → settings/usage}/limits.d.ts +0 -0
- /package/src/pages/{data → console/data}/live-updates.ts +0 -0
- /package/src/pages/{observability → console}/live-updates.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/components/action-param-null-control.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/collection-toolbar.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/common.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/file-ref-upload-field.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/object-filter-popover.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/object-icon.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/object-query-bar.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/telemetry-chart.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/telemetry-grid.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/telemetry-tile.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/telemetry-value.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/usage-bar.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/components/user-picker.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/hooks/object-live-updates.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/hooks/object-telemetry-updates.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/hooks/object-type-counts.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/hooks/rule-live-updates.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/hooks/workflow-live-updates.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/action-params.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/format-value.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/labels.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/object-query.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/ontology-graph-layout.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/ontology-graph-links.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/telemetry-history.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/time.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/lib/user-preferences.ts +0 -0
- /package/src/pages/{ontology → console/ontology}/workflows/run-input-form.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/workflows/run-progress.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/workflows/schema-shape.tsx +0 -0
- /package/src/pages/{ontology → console/ontology}/workflows/status-badge.tsx +0 -0
- /package/src/pages/{observability → settings}/activity/calendar.tsx +0 -0
- /package/src/pages/{observability → settings}/activity/connections.tsx +0 -0
- /package/src/pages/{observability → settings}/activity/format.ts +0 -0
- /package/src/pages/{observability → settings}/activity/meta-items.tsx +0 -0
- /package/src/pages/{observability → settings}/activity/steps.ts +0 -0
- /package/src/pages/{observability → settings}/activity/users.tsx +0 -0
- /package/src/pages/{observability/ai-usage → settings/usage}/limits.tsx +0 -0
package/src/agent/format.ts
CHANGED
|
@@ -46,6 +46,17 @@ export function formatRelativeTime(
|
|
|
46
46
|
const then = new Date(iso).getTime()
|
|
47
47
|
if (Number.isNaN(then)) return ""
|
|
48
48
|
|
|
49
|
+
return (
|
|
50
|
+
relativeTime(then, messages) ??
|
|
51
|
+
new Date(then).toLocaleDateString(locale, { month: "short", day: "numeric" })
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** "now", "5m", "3h" or "2d" since `then`; null from a week on, when a date reads better. */
|
|
56
|
+
export function relativeTime(
|
|
57
|
+
then: number,
|
|
58
|
+
messages: AgentMessages["time"] = en.time
|
|
59
|
+
): string | null {
|
|
49
60
|
const diffMs = Date.now() - then
|
|
50
61
|
const seconds = Math.round(diffMs / 1000)
|
|
51
62
|
if (seconds < 45) return messages.now
|
|
@@ -56,5 +67,14 @@ export function formatRelativeTime(
|
|
|
56
67
|
const days = Math.round(hours / 24)
|
|
57
68
|
if (days < 7) return messages.days(days)
|
|
58
69
|
|
|
59
|
-
return
|
|
70
|
+
return null
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** A token count as a context meter shows it: `950`, `9.5k`, `38k`, `984k`, `1.2M`. */
|
|
74
|
+
export function formatTokenCount(tokens: number, locale = "en"): string {
|
|
75
|
+
const decimal = (value: number) => value.toLocaleString(locale, { maximumFractionDigits: 1 })
|
|
76
|
+
if (tokens < 1_000) return decimal(Math.round(tokens))
|
|
77
|
+
if (tokens < 10_000) return `${decimal(Math.round(tokens / 100) / 10)}k`
|
|
78
|
+
if (tokens < 999_500) return `${Math.round(tokens / 1_000)}k`
|
|
79
|
+
return `${decimal(Math.round(tokens / 100_000) / 10)}M`
|
|
60
80
|
}
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
getAgentOptions,
|
|
7
7
|
getAgentPreferencesOptions,
|
|
8
8
|
getAgentPreferencesQueryKey,
|
|
9
|
+
getAgentThreadContextOptions,
|
|
10
|
+
getAgentThreadContextQueryKey,
|
|
9
11
|
getAgentThreadOptions,
|
|
10
12
|
getAgentThreadQueryKey,
|
|
11
13
|
listAgentApprovalsQueryKey,
|
|
@@ -17,12 +19,15 @@ import {
|
|
|
17
19
|
listAgentThreadRunsQueryKey,
|
|
18
20
|
listAgentThreadsQueryKey,
|
|
19
21
|
listModelsOptions,
|
|
22
|
+
moveAgentThreadToCloudMutation,
|
|
20
23
|
postAgentThreadMessageMutation,
|
|
21
24
|
recreateAgentThreadSandboxMutation,
|
|
22
25
|
retryAgentRunMutation,
|
|
23
26
|
setAgentThreadApprovalModeMutation,
|
|
27
|
+
stopAgentBackgroundCommandMutation,
|
|
24
28
|
updateAgentPreferencesMutation,
|
|
25
29
|
useAgentActivityStream,
|
|
30
|
+
useDesktop,
|
|
26
31
|
} from "@sixb/client/hooks"
|
|
27
32
|
import { MODEL_REASONING_LEVELS, type ModelReasoningLevel } from "@sixb/core/models"
|
|
28
33
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
|
|
@@ -39,7 +44,9 @@ import {
|
|
|
39
44
|
reportedApprovalOutcomes,
|
|
40
45
|
type TranscriptApprovals,
|
|
41
46
|
} from "../approvals"
|
|
47
|
+
import type { TranscriptBackground } from "../background/context"
|
|
42
48
|
import type { ComposerProps } from "../components/composer"
|
|
49
|
+
import { type ComputerOfflineNoticeProps, shownFolder } from "../components/computer-place"
|
|
43
50
|
import type { SandboxRecoveryProps } from "../components/sandbox-recovery"
|
|
44
51
|
import type { TranscriptProps } from "../components/transcript"
|
|
45
52
|
import { conversationMessages, conversationTurn, type PendingUserMessage } from "../conversation"
|
|
@@ -56,6 +63,7 @@ import {
|
|
|
56
63
|
} from "../model-selection"
|
|
57
64
|
import { type RequesterSettings, sendWithRequesterSettings } from "../requester-settings"
|
|
58
65
|
import {
|
|
66
|
+
CONTEXT_LIMIT_EXCEEDED,
|
|
59
67
|
EXTENDED_WAITING_STATUS_MS,
|
|
60
68
|
isActiveAgentRunStatus,
|
|
61
69
|
offersContinue,
|
|
@@ -76,6 +84,7 @@ import {
|
|
|
76
84
|
userPrincipal,
|
|
77
85
|
} from "../sharing"
|
|
78
86
|
import type { AgentContextEntryInput, AgentFileRef, AgentRun, LanguageModel } from "../types"
|
|
87
|
+
import { ComputerUnavailableError, useNewThreadPlace } from "./use-new-thread-place"
|
|
79
88
|
import { useAgentThreadLists } from "./use-thread-lists"
|
|
80
89
|
import { useThreadStream } from "./use-thread-stream"
|
|
81
90
|
|
|
@@ -111,6 +120,7 @@ export interface UseAgentConversationInput {
|
|
|
111
120
|
export type ConversationComposerProps = Pick<
|
|
112
121
|
ComposerProps,
|
|
113
122
|
| "onSend"
|
|
123
|
+
| "newThreadPlace"
|
|
114
124
|
| "error"
|
|
115
125
|
| "disabled"
|
|
116
126
|
| "pending"
|
|
@@ -137,6 +147,7 @@ export type ConversationComposerProps = Pick<
|
|
|
137
147
|
| "onApprovalModeChange"
|
|
138
148
|
| "awaitingApproval"
|
|
139
149
|
| "dictation"
|
|
150
|
+
| "contextMeter"
|
|
140
151
|
>
|
|
141
152
|
|
|
142
153
|
export type AgentConversation = ReturnType<typeof useAgentConversation>
|
|
@@ -147,6 +158,8 @@ export type AgentConversationSendError =
|
|
|
147
158
|
| { readonly code: "busy"; readonly someoneElse: boolean }
|
|
148
159
|
/** The conversation's sandbox must be recovered before another answer. */
|
|
149
160
|
| { readonly code: "sandbox" }
|
|
161
|
+
/** It's to run on this computer, and what runs it there can't start. */
|
|
162
|
+
| { readonly code: "computer" }
|
|
150
163
|
| { readonly code: "send" | "retry" | "stop" | "approvalMode" }
|
|
151
164
|
|
|
152
165
|
/** The conversation's messages could not be read. */
|
|
@@ -166,6 +179,15 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
166
179
|
const agentMessages = useAgentMessages()
|
|
167
180
|
const labels = agentMessages.chat
|
|
168
181
|
const queryClient = useQueryClient()
|
|
182
|
+
const {
|
|
183
|
+
place: newThreadPlace,
|
|
184
|
+
waiting: newThreadPlaceWaiting,
|
|
185
|
+
computerId: desktopComputerId,
|
|
186
|
+
resolveBody: resolvePlaceBody,
|
|
187
|
+
} = useNewThreadPlace()
|
|
188
|
+
const desktopComputer = useDesktop()?.computer
|
|
189
|
+
// Asking for a folder can take as long as the person does: the composer holds meanwhile.
|
|
190
|
+
const [resolvingPlace, setResolvingPlace] = useState(false)
|
|
169
191
|
const user = useCurrentUser()
|
|
170
192
|
const agentQuery = useQuery(getAgentOptions())
|
|
171
193
|
const modelsQuery = useQuery(listModelsOptions())
|
|
@@ -192,6 +214,17 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
192
214
|
// A held call changed: its card, and the thread list's count of what waits for the reader. Its
|
|
193
215
|
// turn's runs follow from their own events.
|
|
194
216
|
onApprovalActivity: (event) => void refreshApprovals(event.threadId),
|
|
217
|
+
// Its owner's sixb opened or closed where the open conversation runs: its badge follows. So do
|
|
218
|
+
// its background commands, which may run where it ran before it moved.
|
|
219
|
+
onComputerActivity: (event) => {
|
|
220
|
+
const place = thread?.computer
|
|
221
|
+
const here = place?.id === event.computerId && place.folder === event.folder
|
|
222
|
+
if (threadId && (here || thread?.backgroundCommands)) void refreshThread(threadId)
|
|
223
|
+
},
|
|
224
|
+
// It moved from another tab or from sixb: the badge and notice follow.
|
|
225
|
+
onThreadMoved: (event) => {
|
|
226
|
+
if (event.threadId === threadId) void refreshThread(threadId)
|
|
227
|
+
},
|
|
195
228
|
// On every (re)subscription: catch up with what changed while the socket was away.
|
|
196
229
|
onSubscribed: () => {
|
|
197
230
|
void queryClient.invalidateQueries({ queryKey: listAgentApprovalsQueryKey() })
|
|
@@ -224,8 +257,10 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
224
257
|
...getAgentThreadOptions({ path: { threadId: threadId ?? "" } }),
|
|
225
258
|
enabled: threadId !== null,
|
|
226
259
|
refetchInterval: recoveryPollMs,
|
|
227
|
-
// A shared thread can lose its reader without an event
|
|
228
|
-
|
|
260
|
+
// A shared thread can lose its reader without an event, and a computer's sixb can stop
|
|
261
|
+
// without saying so: read it again when they come back.
|
|
262
|
+
refetchOnWindowFocus: (query) =>
|
|
263
|
+
isShared(query.state.data ?? null) || query.state.data?.computer !== undefined,
|
|
229
264
|
})
|
|
230
265
|
// A 404 after a read means the reader no longer reads it, such as a participant someone removed:
|
|
231
266
|
// the last copy the query keeps must not stand in for it.
|
|
@@ -241,6 +276,10 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
241
276
|
const removedFromThread =
|
|
242
277
|
threadGone && threadQuery.data !== undefined && threadAccess(threadQuery.data, user) !== "owner"
|
|
243
278
|
const access = thread ? threadAccess(thread, user) : "owner"
|
|
279
|
+
// The reader's own conversation on their computer, with no sixb open in its folder: a message
|
|
280
|
+
// waits for it, or the conversation moves to the cloud.
|
|
281
|
+
const computerOffline =
|
|
282
|
+
access === "owner" && thread?.runsOn === "computer" && thread.computer?.online !== true
|
|
244
283
|
|
|
245
284
|
const messagesQuery = useQuery({
|
|
246
285
|
...listAgentThreadMessagesOptions({
|
|
@@ -264,6 +303,23 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
264
303
|
const runs = useMemo(() => runsQuery.data?.runs ?? [], [runsQuery.data])
|
|
265
304
|
const latestRun = runs[0] ?? null
|
|
266
305
|
|
|
306
|
+
// Measured against the model the next message goes to; on Auto, the latest turn's.
|
|
307
|
+
const meteredModel = modelSelection.auto ? undefined : selectedModel
|
|
308
|
+
const contextQuery = useQuery({
|
|
309
|
+
...getAgentThreadContextOptions({
|
|
310
|
+
path: { threadId: threadId ?? "" },
|
|
311
|
+
query: meteredModel ? { provider: meteredModel.provider, modelId: meteredModel.modelId } : {},
|
|
312
|
+
}),
|
|
313
|
+
enabled: threadId !== null,
|
|
314
|
+
// Turns and compactions invalidate it; nothing else changes it.
|
|
315
|
+
staleTime: 5 * 60_000,
|
|
316
|
+
// Another model's limits keep the meter in place until they arrive; another thread's never do.
|
|
317
|
+
placeholderData: (previous, previousQuery) =>
|
|
318
|
+
previousQuery?.queryKey[0].path.threadId === threadId ? previous : undefined,
|
|
319
|
+
// A meter that cannot be read is left out: it never stands in the way of the conversation.
|
|
320
|
+
retry: false,
|
|
321
|
+
})
|
|
322
|
+
|
|
267
323
|
const approvalsQuery = useQuery({
|
|
268
324
|
...listAgentThreadApprovalsOptions({
|
|
269
325
|
path: { threadId: threadId ?? "" },
|
|
@@ -328,6 +384,17 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
328
384
|
? selectActiveRunId({ pendingRun, threadActiveRunId: thread?.activeRunId ?? null, latestRun })
|
|
329
385
|
: null
|
|
330
386
|
const { live, run: streamRun, reconnecting } = useThreadStream({ threadId, runId: activeRunId })
|
|
387
|
+
// A compaction that ended changed what the conversation weighs: measure it again.
|
|
388
|
+
const wasCompactingRef = useRef(false)
|
|
389
|
+
useEffect(() => {
|
|
390
|
+
const ended = wasCompactingRef.current && !live.compacting
|
|
391
|
+
wasCompactingRef.current = live.compacting
|
|
392
|
+
if (!ended || threadId === null) return
|
|
393
|
+
|
|
394
|
+
void queryClient.invalidateQueries({
|
|
395
|
+
queryKey: getAgentThreadContextQueryKey({ path: { threadId } }),
|
|
396
|
+
})
|
|
397
|
+
}, [live.compacting, threadId, queryClient])
|
|
331
398
|
const finalizedMessageInDurable =
|
|
332
399
|
live.finalizedMessageId !== null &&
|
|
333
400
|
savedMessages.some((message) => message.id === live.finalizedMessageId)
|
|
@@ -375,6 +442,8 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
375
442
|
const cancelRun = useMutation(cancelAgentRunMutation())
|
|
376
443
|
const retryRun = useMutation(retryAgentRunMutation())
|
|
377
444
|
const recreateSandbox = useMutation(recreateAgentThreadSandboxMutation())
|
|
445
|
+
const moveToCloud = useMutation(moveAgentThreadToCloudMutation())
|
|
446
|
+
const stopBackgroundCommand = useMutation(stopAgentBackgroundCommandMutation())
|
|
378
447
|
const decideApproval = useMutation(decideAgentApprovalMutation())
|
|
379
448
|
// Each runs after the one before, so the last choice is the one the server keeps.
|
|
380
449
|
const saveThreadApprovalMode = useMutation({
|
|
@@ -476,9 +545,16 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
476
545
|
}
|
|
477
546
|
|
|
478
547
|
if (!currentAgent) return
|
|
548
|
+
setResolvingPlace(true)
|
|
549
|
+
const place = await resolvePlaceBody().finally(() => setResolvingPlace(false))
|
|
550
|
+
if (!place) {
|
|
551
|
+
// They cancelled choosing a folder: nothing was sent, and their message goes back.
|
|
552
|
+
setDraftReseed((current) => ({ text, attachments, context, nonce: current.nonce + 1 }))
|
|
553
|
+
return
|
|
554
|
+
}
|
|
479
555
|
const title = deriveTitle(text, attachments)
|
|
480
556
|
const created = await createThread.mutateAsync({
|
|
481
|
-
body: title ? { title } : {},
|
|
557
|
+
body: { ...(title ? { title } : {}), ...place },
|
|
482
558
|
})
|
|
483
559
|
createdThreadId = created.thread.id
|
|
484
560
|
setPendingUser({
|
|
@@ -590,6 +666,9 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
590
666
|
queryClient.invalidateQueries({
|
|
591
667
|
queryKey: listAgentThreadApprovalsQueryKey({ path: { threadId } }),
|
|
592
668
|
}),
|
|
669
|
+
queryClient.invalidateQueries({
|
|
670
|
+
queryKey: getAgentThreadContextQueryKey({ path: { threadId } }),
|
|
671
|
+
}),
|
|
593
672
|
])
|
|
594
673
|
|
|
595
674
|
const keepThreadApprovalMode = async (threadId: string, mode: AgentApprovalMode) => {
|
|
@@ -705,6 +784,22 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
705
784
|
}
|
|
706
785
|
}
|
|
707
786
|
|
|
787
|
+
const handleContinueInCloud = () => {
|
|
788
|
+
if (!thread || thread.runsOn !== "computer" || access !== "owner") return
|
|
789
|
+
moveToCloud.mutate(
|
|
790
|
+
{ path: { threadId: thread.id } },
|
|
791
|
+
{
|
|
792
|
+
onSuccess: (moved) => {
|
|
793
|
+
queryClient.setQueryData(getAgentThreadQueryKey({ path: { threadId: moved.id } }), moved)
|
|
794
|
+
void queryClient.invalidateQueries({
|
|
795
|
+
queryKey: listAgentThreadRunsQueryKey({ path: { threadId: moved.id } }),
|
|
796
|
+
})
|
|
797
|
+
void refreshThreads()
|
|
798
|
+
},
|
|
799
|
+
}
|
|
800
|
+
)
|
|
801
|
+
}
|
|
802
|
+
|
|
708
803
|
const handleRecreateSandbox = () => {
|
|
709
804
|
if (!thread?.sandboxState || isRunning || access !== "owner") return
|
|
710
805
|
recreateSandbox.mutate(
|
|
@@ -788,7 +883,7 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
788
883
|
const anchorCurrentTurn = Boolean(
|
|
789
884
|
(pendingUser && pendingUser.threadId === threadId) || (pendingRun && pendingSend?.anchor)
|
|
790
885
|
)
|
|
791
|
-
const composerPending = postMessage.isPending || createThread.isPending
|
|
886
|
+
const composerPending = postMessage.isPending || createThread.isPending || resolvingPlace
|
|
792
887
|
const currentSendError: AgentConversationSendError | null =
|
|
793
888
|
sendError && sendError.threadId === threadId
|
|
794
889
|
? sendError.failure === "busy"
|
|
@@ -806,10 +901,11 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
806
901
|
const answeringForName = answeringFor ? knownName(answeringFor, thread, authors) : undefined
|
|
807
902
|
const answeringName = answeringFor ? (answeringForName ?? answeringFor.id) : null
|
|
808
903
|
|
|
809
|
-
// A turn that never answered can run again, by whoever asked for it, once the sandbox works
|
|
904
|
+
// A turn that never answered can run again, by whoever asked for it, once the sandbox works,
|
|
905
|
+
// unless it would fail the same way: a conversation too long for its model.
|
|
810
906
|
const canRetry =
|
|
811
907
|
!sandboxRecovery &&
|
|
812
|
-
(presentation.kind === "failed" ||
|
|
908
|
+
((presentation.kind === "failed" && presentation.run.error?.code !== CONTEXT_LIMIT_EXCEEDED) ||
|
|
813
909
|
((presentation.kind === "timeout" || presentation.kind === "interrupted") &&
|
|
814
910
|
!presentation.hasProgress)) &&
|
|
815
911
|
canRetryRun(presentation.run, user)
|
|
@@ -846,7 +942,9 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
846
942
|
retrying: retryRun.isPending,
|
|
847
943
|
continuing: continuingThreadId !== null && continuingThreadId === threadId,
|
|
848
944
|
waitingLonger,
|
|
945
|
+
waitingFor: computerOffline ? (thread?.computer?.name ?? null) : null,
|
|
849
946
|
compacting: live.compacting,
|
|
947
|
+
contextFull: live.contextFull,
|
|
850
948
|
reconnecting: live.active && reconnecting,
|
|
851
949
|
answeringFor: answeringFor
|
|
852
950
|
? {
|
|
@@ -922,9 +1020,57 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
922
1020
|
[runs, access, user]
|
|
923
1021
|
)
|
|
924
1022
|
|
|
1023
|
+
// Where the conversation moved, after the last message saved before then: the files earlier
|
|
1024
|
+
// turns worked on stayed behind.
|
|
1025
|
+
const movedAt = thread?.movedAt
|
|
1026
|
+
const savedBefore = movedAt
|
|
1027
|
+
? new Set(savedMessages.filter((saved) => saved.createdAt <= movedAt).map(({ id }) => id))
|
|
1028
|
+
: null
|
|
1029
|
+
// The last one the transcript shows: not every saved message is drawn.
|
|
1030
|
+
const movedAfterId =
|
|
1031
|
+
savedBefore && messages.filter(({ id }) => id !== null && savedBefore.has(id)).at(-1)?.id
|
|
1032
|
+
const moved =
|
|
1033
|
+
thread && movedAfterId
|
|
1034
|
+
? {
|
|
1035
|
+
afterMessageId: movedAfterId,
|
|
1036
|
+
label:
|
|
1037
|
+
thread.runsOn !== "computer"
|
|
1038
|
+
? agentMessages.computer.movedToCloud
|
|
1039
|
+
: thread.computer
|
|
1040
|
+
? agentMessages.computer.movedToFolder(shownFolder(thread.computer.folder))
|
|
1041
|
+
: agentMessages.computer.movedElsewhere,
|
|
1042
|
+
}
|
|
1043
|
+
: null
|
|
1044
|
+
|
|
1045
|
+
// Its background commands: what its owner's sixb reports of them, and their Stop, to its owner
|
|
1046
|
+
// alone, as the computer is theirs. A command started in a folder runs on there once the thread
|
|
1047
|
+
// moved to another, or to the cloud.
|
|
1048
|
+
const computer = thread?.computer
|
|
1049
|
+
const backgroundCommands = thread?.backgroundCommands
|
|
1050
|
+
const runsOnComputer = thread?.runsOn === "computer"
|
|
1051
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the mutation and the refresh are the conversation's
|
|
1052
|
+
const transcriptBackground = useMemo((): TranscriptBackground => {
|
|
1053
|
+
const live = backgroundCommands ?? (computer ? [] : null)
|
|
1054
|
+
return {
|
|
1055
|
+
source: { onComputer: runsOnComputer, live, online: computer?.online ?? false },
|
|
1056
|
+
...(live !== null && threadId !== null
|
|
1057
|
+
? {
|
|
1058
|
+
stop: async (command) => {
|
|
1059
|
+
await stopBackgroundCommand.mutateAsync({
|
|
1060
|
+
path: { threadId, commandId: command.id },
|
|
1061
|
+
body: { startedAt: command.startedAt },
|
|
1062
|
+
})
|
|
1063
|
+
await refreshThread(threadId)
|
|
1064
|
+
},
|
|
1065
|
+
}
|
|
1066
|
+
: {}),
|
|
1067
|
+
}
|
|
1068
|
+
}, [computer, backgroundCommands, runsOnComputer, threadId])
|
|
1069
|
+
|
|
925
1070
|
const transcriptProps: TranscriptProps = {
|
|
926
1071
|
threadId,
|
|
927
1072
|
messages,
|
|
1073
|
+
moved,
|
|
928
1074
|
turn,
|
|
929
1075
|
anchorCurrentTurn,
|
|
930
1076
|
onRetry: canRetry ? retry : undefined,
|
|
@@ -932,6 +1078,7 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
932
1078
|
approvals: transcriptApprovals,
|
|
933
1079
|
approvalOutcomes,
|
|
934
1080
|
delegation: transcriptDelegation,
|
|
1081
|
+
background: transcriptBackground,
|
|
935
1082
|
}
|
|
936
1083
|
|
|
937
1084
|
const modelControlsProps = {
|
|
@@ -950,6 +1097,9 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
950
1097
|
|
|
951
1098
|
const composerProps: ConversationComposerProps = {
|
|
952
1099
|
onSend: send,
|
|
1100
|
+
...(threadId === null && (newThreadPlace || newThreadPlaceWaiting)
|
|
1101
|
+
? { newThreadPlace: newThreadPlace ?? "waiting" }
|
|
1102
|
+
: {}),
|
|
953
1103
|
error: currentSendError
|
|
954
1104
|
? failureMessage(currentSendError, labels, agentMessages.approvalModes.saveFailed)
|
|
955
1105
|
: undefined,
|
|
@@ -973,8 +1123,35 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
973
1123
|
onApprovalModeChange: setApprovalMode,
|
|
974
1124
|
awaitingApproval,
|
|
975
1125
|
dictation: projectDictation(modelsQuery.data),
|
|
1126
|
+
contextMeter: {
|
|
1127
|
+
context: threadId !== null ? contextQuery.data : undefined,
|
|
1128
|
+
modelName: meteredModelName(models, contextQuery.data?.model),
|
|
1129
|
+
condensing: live.compacting,
|
|
1130
|
+
},
|
|
976
1131
|
}
|
|
977
1132
|
|
|
1133
|
+
const movingThisThread = moveToCloud.variables?.path.threadId === thread?.id
|
|
1134
|
+
const computerNoticeProps: ComputerOfflineNoticeProps | null = computerOffline
|
|
1135
|
+
? {
|
|
1136
|
+
computer: thread?.computer ?? null,
|
|
1137
|
+
// One mutation serves every conversation this view opens: only this one's state shows.
|
|
1138
|
+
pending: movingThisThread && moveToCloud.isPending,
|
|
1139
|
+
error:
|
|
1140
|
+
!movingThisThread || !moveToCloud.isError
|
|
1141
|
+
? null
|
|
1142
|
+
: isSixbApiError(moveToCloud.error) && moveToCloud.error.code === "active_run_exists"
|
|
1143
|
+
? "busy"
|
|
1144
|
+
: "failed",
|
|
1145
|
+
onContinueInCloud: handleContinueInCloud,
|
|
1146
|
+
...(desktopComputer && thread?.computer && thread.computer.id === desktopComputerId
|
|
1147
|
+
? {
|
|
1148
|
+
onRunHere: () =>
|
|
1149
|
+
void desktopComputer.allowFolder(thread.computer?.folder ?? "").catch(() => {}),
|
|
1150
|
+
}
|
|
1151
|
+
: {}),
|
|
1152
|
+
}
|
|
1153
|
+
: null
|
|
1154
|
+
|
|
978
1155
|
const sandboxRecoveryProps: SandboxRecoveryProps | null = sandboxRecovery
|
|
979
1156
|
? {
|
|
980
1157
|
pending: recreateSandbox.isPending,
|
|
@@ -1055,12 +1232,26 @@ export function useAgentConversation({ threadId, onThreadCreated }: UseAgentConv
|
|
|
1055
1232
|
composerProps,
|
|
1056
1233
|
/** Spread into `<SandboxRecovery>` while set: the composer stays disabled until it is resolved. */
|
|
1057
1234
|
sandboxRecoveryProps,
|
|
1235
|
+
/** Where the reader's own conversation runs on their computer, for its badge. */
|
|
1236
|
+
computer: access === "owner" ? (thread?.computer ?? null) : null,
|
|
1237
|
+
/** Spread into `<ComputerOfflineNotice>` while its computer is offline. */
|
|
1238
|
+
computerNoticeProps,
|
|
1058
1239
|
}
|
|
1059
1240
|
}
|
|
1060
1241
|
|
|
1061
1242
|
/** Why a turn did not start or stop, or the mode did not change. */
|
|
1062
1243
|
type TurnFailure = AgentConversationSendError["code"]
|
|
1063
1244
|
|
|
1245
|
+
/** The picker's name for the model a conversation's context is measured against. */
|
|
1246
|
+
function meteredModelName(
|
|
1247
|
+
models: readonly LanguageModel[],
|
|
1248
|
+
ref: { readonly provider: string; readonly modelId: string } | undefined
|
|
1249
|
+
): string | undefined {
|
|
1250
|
+
if (!ref) return undefined
|
|
1251
|
+
return models.find((model) => model.provider === ref.provider && model.modelId === ref.modelId)
|
|
1252
|
+
?.name
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1064
1255
|
/** Why a decision did not go through. Once the call ran, the decision stands and never throws. */
|
|
1065
1256
|
function decisionFailure(error: unknown): AgentApprovalDecisionFailure {
|
|
1066
1257
|
if (!isSixbApiError(error)) return "failed"
|
|
@@ -1072,6 +1263,7 @@ function decisionFailure(error: unknown): AgentApprovalDecisionFailure {
|
|
|
1072
1263
|
|
|
1073
1264
|
/** A message that did not go out: another answer holds the thread, the sandbox is away, or else. */
|
|
1074
1265
|
function sendFailure(error: unknown): TurnFailure {
|
|
1266
|
+
if (error instanceof ComputerUnavailableError) return "computer"
|
|
1075
1267
|
if (!isSixbApiError(error) || error.status !== 409) return "send"
|
|
1076
1268
|
if (error.code === "active_run_exists") return "busy"
|
|
1077
1269
|
if (error.code === "sandbox_execution_unavailable") return "sandbox"
|
|
@@ -1093,6 +1285,8 @@ function failureMessage(
|
|
|
1093
1285
|
return failure.someoneElse ? labels.busyOther : labels.busy
|
|
1094
1286
|
case "sandbox":
|
|
1095
1287
|
return labels.sandboxUnavailable
|
|
1288
|
+
case "computer":
|
|
1289
|
+
return labels.computerUnavailable
|
|
1096
1290
|
case "retry":
|
|
1097
1291
|
return labels.retryFailed
|
|
1098
1292
|
case "stop":
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { type DesktopComputer, type DesktopComputerAccess, useDesktop } from "@sixb/client/hooks"
|
|
2
|
+
import { useCallback, useEffect, useState } from "react"
|
|
3
|
+
|
|
4
|
+
const STORAGE_KEY = "sixb.agent.new-thread-place"
|
|
5
|
+
|
|
6
|
+
/** The last choice, on this computer: where a new conversation starts. */
|
|
7
|
+
interface StoredPlace {
|
|
8
|
+
readonly cloud: boolean
|
|
9
|
+
readonly folder: string | null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function readStored(): StoredPlace {
|
|
13
|
+
try {
|
|
14
|
+
const stored = JSON.parse(localStorage.getItem(STORAGE_KEY) ?? "null") as Partial<StoredPlace>
|
|
15
|
+
return { cloud: stored?.cloud === true, folder: stored?.folder ?? null }
|
|
16
|
+
} catch {
|
|
17
|
+
return { cloud: false, folder: null }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A message that's to run on this computer, and what runs it there can't start. */
|
|
22
|
+
export class ComputerUnavailableError extends Error {
|
|
23
|
+
constructor(cause: unknown) {
|
|
24
|
+
super("[SixbApp] What runs the agent on this computer couldn't start.", { cause })
|
|
25
|
+
this.name = "ComputerUnavailableError"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** What a new conversation is created with to run on this computer: nothing, for the cloud. */
|
|
30
|
+
export type NewThreadPlaceBody =
|
|
31
|
+
| { readonly runsOn?: undefined }
|
|
32
|
+
| {
|
|
33
|
+
readonly runsOn: "computer"
|
|
34
|
+
readonly computer: DesktopComputer & { readonly folder: string }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The composer's choice of where a new conversation runs. */
|
|
38
|
+
export interface NewThreadPlace {
|
|
39
|
+
/** Null while what runs the agent here can't start: the cloud is still a choice. */
|
|
40
|
+
readonly computerName: string | null
|
|
41
|
+
readonly cloud: boolean
|
|
42
|
+
/** Null before the person has chosen one: the first message asks. */
|
|
43
|
+
readonly folder: string | null
|
|
44
|
+
/** Folders chosen before, to choose from again. */
|
|
45
|
+
readonly folders: readonly string[]
|
|
46
|
+
readonly chooseCloud: () => void
|
|
47
|
+
readonly chooseFolder: (folder: string) => void
|
|
48
|
+
/** Ask the person for a folder, and use it. */
|
|
49
|
+
readonly pickFolder: () => Promise<void>
|
|
50
|
+
readonly forgetFolder: (folder: string) => void
|
|
51
|
+
readonly refreshFolders: () => void
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Where a new conversation runs, in a desktop app that can run the agent here: this computer unless
|
|
56
|
+
* the person chooses the cloud. In a browser there's nothing to choose, and this says so.
|
|
57
|
+
*/
|
|
58
|
+
export function useNewThreadPlace(): {
|
|
59
|
+
/** Null where the only place is the cloud, or until it's known that there's another. */
|
|
60
|
+
readonly place: NewThreadPlace | null
|
|
61
|
+
/** A desktop app that hasn't said yet whether it can run the agent here. */
|
|
62
|
+
readonly waiting: boolean
|
|
63
|
+
/** This computer, once the desktop app has said: what tells a conversation that runs on it. */
|
|
64
|
+
readonly computerId: string | null
|
|
65
|
+
/**
|
|
66
|
+
* What to create the next conversation with, asking for a folder if none is chosen. Null when the
|
|
67
|
+
* person cancels, so that their message stays in the composer.
|
|
68
|
+
*/
|
|
69
|
+
readonly resolveBody: () => Promise<NewThreadPlaceBody | null>
|
|
70
|
+
} {
|
|
71
|
+
const access: DesktopComputerAccess | null = useDesktop()?.computer ?? null
|
|
72
|
+
// Undefined until the desktop app answers; null where it can't run the agent.
|
|
73
|
+
const [computer, setComputer] = useState<DesktopComputer | null | undefined>(undefined)
|
|
74
|
+
const [cannotStart, setCannotStart] = useState(false)
|
|
75
|
+
// Null until the runner has said: a folder chosen before isn't taken as gone meanwhile.
|
|
76
|
+
const [folders, setFolders] = useState<readonly string[] | null>(null)
|
|
77
|
+
const [stored, setStored] = useState(readStored)
|
|
78
|
+
|
|
79
|
+
const remember = useCallback((next: StoredPlace) => {
|
|
80
|
+
setStored(next)
|
|
81
|
+
try {
|
|
82
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(next))
|
|
83
|
+
} catch {
|
|
84
|
+
// Private storage: the choice lasts as long as the page.
|
|
85
|
+
}
|
|
86
|
+
}, [])
|
|
87
|
+
|
|
88
|
+
const refreshFolders = useCallback(() => {
|
|
89
|
+
void access?.folders().then(setFolders, () => {})
|
|
90
|
+
}, [access])
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (!access) return
|
|
94
|
+
let current = true
|
|
95
|
+
const refresh = () => {
|
|
96
|
+
void access.about().then(
|
|
97
|
+
(found) => {
|
|
98
|
+
if (!current) return
|
|
99
|
+
setComputer(found)
|
|
100
|
+
setCannotStart(false)
|
|
101
|
+
},
|
|
102
|
+
() => {
|
|
103
|
+
if (current) setCannotStart(true)
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
refreshFolders()
|
|
107
|
+
}
|
|
108
|
+
refresh()
|
|
109
|
+
// A runner that couldn't start when this first asked may have since.
|
|
110
|
+
window.addEventListener("focus", refresh)
|
|
111
|
+
return () => {
|
|
112
|
+
current = false
|
|
113
|
+
window.removeEventListener("focus", refresh)
|
|
114
|
+
}
|
|
115
|
+
}, [access, refreshFolders])
|
|
116
|
+
|
|
117
|
+
if (!access) {
|
|
118
|
+
return { place: null, waiting: false, computerId: null, resolveBody: async () => ({}) }
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const pick = async (): Promise<string | null> => {
|
|
122
|
+
const folder = await access.pickFolder()
|
|
123
|
+
if (folder) {
|
|
124
|
+
remember({ cloud: false, folder })
|
|
125
|
+
refreshFolders()
|
|
126
|
+
}
|
|
127
|
+
return folder
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Asks the runner rather than reading what's shown: a message sent before it has answered goes
|
|
131
|
+
// where the person last chose, not to the cloud by default. One it can't start for says so.
|
|
132
|
+
const resolveBody = async (): Promise<NewThreadPlaceBody | null> => {
|
|
133
|
+
if (stored.cloud) return {}
|
|
134
|
+
const found = await access.about().catch((cause: unknown) => {
|
|
135
|
+
throw new ComputerUnavailableError(cause)
|
|
136
|
+
})
|
|
137
|
+
if (!found) return {}
|
|
138
|
+
// A folder that's no longer allowed here, or no longer there, or a sign-in that ended: asking
|
|
139
|
+
// again allows it, and signs in. Anything else would leave the message waiting on nothing.
|
|
140
|
+
const allowed = await access.folders()
|
|
141
|
+
const folder = stored.folder && allowed.includes(stored.folder) ? stored.folder : await pick()
|
|
142
|
+
return folder ? { runsOn: "computer", computer: { ...found, folder } } : null
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (computer === null || (computer === undefined && !cannotStart)) {
|
|
146
|
+
return { place: null, waiting: computer === undefined, computerId: null, resolveBody }
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
waiting: false,
|
|
151
|
+
computerId: computer?.id ?? null,
|
|
152
|
+
place: {
|
|
153
|
+
computerName: computer?.name ?? null,
|
|
154
|
+
cloud: stored.cloud,
|
|
155
|
+
folder: stored.folder && (!folders || folders.includes(stored.folder)) ? stored.folder : null,
|
|
156
|
+
folders: folders ?? [],
|
|
157
|
+
chooseCloud: () => remember({ ...stored, cloud: true }),
|
|
158
|
+
chooseFolder: (folder) => remember({ cloud: false, folder }),
|
|
159
|
+
pickFolder: async () => {
|
|
160
|
+
await pick()
|
|
161
|
+
},
|
|
162
|
+
forgetFolder: (folder) => {
|
|
163
|
+
void access.forgetFolder(folder).then(refreshFolders, () => {})
|
|
164
|
+
if (stored.folder === folder) remember({ ...stored, folder: null })
|
|
165
|
+
},
|
|
166
|
+
refreshFolders,
|
|
167
|
+
},
|
|
168
|
+
resolveBody,
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AgentRunSnapshot } from "@sixb/client"
|
|
2
2
|
import {
|
|
3
3
|
getAgentRunQueryKey,
|
|
4
|
+
getAgentThreadContextQueryKey,
|
|
4
5
|
getAgentThreadQueryKey,
|
|
5
6
|
listAgentThreadMessagesQueryKey,
|
|
6
7
|
listAgentThreadRunsQueryKey,
|
|
@@ -87,6 +88,9 @@ export function useThreadStream(options: UseThreadStreamOptions): UseThreadStrea
|
|
|
87
88
|
queryClient.invalidateQueries({
|
|
88
89
|
queryKey: listAgentThreadRunsQueryKey({ path: { threadId } }),
|
|
89
90
|
}),
|
|
91
|
+
queryClient.invalidateQueries({
|
|
92
|
+
queryKey: getAgentThreadContextQueryKey({ path: { threadId } }),
|
|
93
|
+
}),
|
|
90
94
|
]
|
|
91
95
|
: []),
|
|
92
96
|
])
|
|
@@ -112,6 +116,9 @@ export function useThreadStream(options: UseThreadStreamOptions): UseThreadStrea
|
|
|
112
116
|
queryClient.invalidateQueries({
|
|
113
117
|
queryKey: listAgentThreadRunsQueryKey({ path: { threadId } }),
|
|
114
118
|
}),
|
|
119
|
+
queryClient.invalidateQueries({
|
|
120
|
+
queryKey: getAgentThreadContextQueryKey({ path: { threadId } }),
|
|
121
|
+
}),
|
|
115
122
|
]
|
|
116
123
|
: []),
|
|
117
124
|
])
|