@sixb/app 0.2.0 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/connector-icons/README.md +1 -0
- package/assets/connector-icons/fleetio.ico +0 -0
- package/dist/agent/activity-label.d.ts.map +1 -1
- package/dist/agent/agent-chat.d.ts +9 -2
- package/dist/agent/agent-chat.d.ts.map +1 -1
- package/dist/agent/agent-panel.d.ts +9 -1
- package/dist/agent/agent-panel.d.ts.map +1 -1
- package/dist/agent/agent-surface.d.ts.map +1 -1
- package/dist/agent/artifact-card.d.ts +3 -1
- package/dist/agent/artifact-card.d.ts.map +1 -1
- package/dist/agent/artifact-panel.d.ts +7 -1
- package/dist/agent/artifact-panel.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 +4 -0
- package/dist/agent/bash/interpret.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 +13 -0
- package/dist/agent/components/composer-place.d.ts.map +1 -0
- package/dist/agent/components/composer.d.ts +23 -1
- package/dist/agent/components/composer.d.ts.map +1 -1
- package/dist/agent/components/computer-place.d.ts +3 -1
- package/dist/agent/components/computer-place.d.ts.map +1 -1
- package/dist/agent/components/context-chips.d.ts.map +1 -1
- package/dist/agent/components/context-meter.d.ts +1 -1
- package/dist/agent/components/conversation-panel.d.ts +3 -1
- package/dist/agent/components/conversation-panel.d.ts.map +1 -1
- package/dist/agent/components/message-parts.d.ts +3 -1
- package/dist/agent/components/message-parts.d.ts.map +1 -1
- package/dist/agent/components/thread-artifacts-menu.d.ts.map +1 -1
- package/dist/agent/components/transcript.d.ts +6 -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/composer-insertion.d.ts +24 -0
- package/dist/agent/composer-insertion.d.ts.map +1 -0
- 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 +5 -5
- package/dist/agent/delegation/use-children.d.ts.map +1 -1
- package/dist/agent/hooks/use-agent-conversation.d.ts +24 -4
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-new-thread-place.d.ts +70 -0
- package/dist/agent/hooks/use-new-thread-place.d.ts.map +1 -0
- package/dist/agent/hooks/use-thread-lists.d.ts +40 -0
- package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +74 -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 +126 -0
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/observed-conversation.d.ts.map +1 -1
- package/dist/agent/publish-artifact/interpret.d.ts +8 -2
- package/dist/agent/publish-artifact/interpret.d.ts.map +1 -1
- package/dist/agent/publish-artifact/open-artifact-tool-view.d.ts +9 -0
- package/dist/agent/publish-artifact/open-artifact-tool-view.d.ts.map +1 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts +4 -2
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts.map +1 -1
- package/dist/agent/publish-artifact/use-live-publishes.d.ts +3 -3
- package/dist/agent/publish-artifact/use-live-publishes.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/artifacts/artifact-page.d.ts.map +1 -1
- package/dist/artifacts/artifact-viewer.d.ts +16 -0
- package/dist/artifacts/artifact-viewer.d.ts.map +1 -0
- package/dist/artifacts/card-details.d.ts +1 -1
- package/dist/artifacts/card-details.d.ts.map +1 -1
- package/dist/artifacts/card-preview.d.ts.map +1 -1
- package/dist/artifacts/comments-context.d.ts +48 -0
- package/dist/artifacts/comments-context.d.ts.map +1 -0
- package/dist/artifacts/edit-session.d.ts +6 -6
- package/dist/artifacts/edit-session.d.ts.map +1 -1
- package/dist/artifacts/file-source.d.ts.map +1 -1
- package/dist/artifacts/frame.d.ts +10 -2
- package/dist/artifacts/frame.d.ts.map +1 -1
- package/dist/artifacts/guest-badge.d.ts +8 -0
- package/dist/artifacts/guest-badge.d.ts.map +1 -0
- package/dist/artifacts/held-artifact.d.ts +19 -0
- package/dist/artifacts/held-artifact.d.ts.map +1 -0
- package/dist/artifacts/holders.d.ts +10 -0
- package/dist/artifacts/holders.d.ts.map +1 -0
- package/dist/artifacts/live/boards.d.ts +15 -0
- package/dist/artifacts/live/boards.d.ts.map +1 -0
- package/dist/artifacts/live/canvas.d.ts +79 -0
- package/dist/artifacts/live/canvas.d.ts.map +1 -0
- package/dist/artifacts/live/header.d.ts +29 -0
- package/dist/artifacts/live/header.d.ts.map +1 -0
- package/dist/artifacts/live/hooks.d.ts +21 -0
- package/dist/artifacts/live/hooks.d.ts.map +1 -0
- package/dist/artifacts/live/presence.d.ts +32 -0
- package/dist/artifacts/live/presence.d.ts.map +1 -0
- package/dist/artifacts/live/session.d.ts +130 -0
- package/dist/artifacts/live/session.d.ts.map +1 -0
- package/dist/artifacts/live/view.d.ts +28 -0
- package/dist/artifacts/live/view.d.ts.map +1 -0
- package/dist/artifacts/messages.d.ts +424 -14
- package/dist/artifacts/messages.d.ts.map +1 -1
- package/dist/artifacts/page-queries.d.ts +2 -2
- package/dist/artifacts/page-queries.d.ts.map +1 -1
- package/dist/artifacts/page-state.d.ts.map +1 -1
- package/dist/artifacts/publish-edit.d.ts +24 -14
- package/dist/artifacts/publish-edit.d.ts.map +1 -1
- package/dist/artifacts/queries.d.ts +490 -9
- 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 +0 -18
- package/dist/artifacts/renderers/canvas/arrows.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/board-editor.d.ts +43 -0
- package/dist/artifacts/renderers/canvas/board-editor.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board-properties.d.ts +37 -0
- package/dist/artifacts/renderers/canvas/board-properties.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board-source.d.ts +18 -0
- package/dist/artifacts/renderers/canvas/board-source.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board.d.ts +64 -19
- package/dist/artifacts/renderers/canvas/board.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/canvas.d.ts +13 -4
- package/dist/artifacts/renderers/canvas/canvas.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts +84 -0
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/commenting.d.ts +58 -0
- package/dist/artifacts/renderers/canvas/commenting.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/comments-panel.d.ts +27 -0
- package/dist/artifacts/renderers/canvas/comments-panel.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/comments.d.ts +56 -0
- package/dist/artifacts/renderers/canvas/comments.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/draft.d.ts +7 -6
- package/dist/artifacts/renderers/canvas/draft.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/edit-mode.d.ts +19 -2
- package/dist/artifacts/renderers/canvas/edit-mode.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/focus.d.ts +40 -5
- package/dist/artifacts/renderers/canvas/focus.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/items.d.ts +47 -4
- package/dist/artifacts/renderers/canvas/items.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/layout.d.ts +5 -8
- package/dist/artifacts/renderers/canvas/layout.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/presence.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/presence.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/previews.d.ts +54 -0
- package/dist/artifacts/renderers/canvas/previews.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/renderer.d.ts +11 -2
- package/dist/artifacts/renderers/canvas/renderer.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/thumbnail.d.ts +5 -2
- package/dist/artifacts/renderers/canvas/thumbnail.d.ts.map +1 -1
- package/dist/artifacts/version-menu.d.ts +19 -0
- package/dist/artifacts/version-menu.d.ts.map +1 -0
- package/dist/artifacts/view-context.d.ts +43 -0
- package/dist/artifacts/view-context.d.ts.map +1 -0
- package/dist/artifacts/viewer.d.ts.map +1 -1
- package/dist/build.d.ts +5 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/{chunk-fw2bm6dq.js → chunk-001c4gnk.js} +8086 -3870
- package/dist/chunk-001c4gnk.js.map +204 -0
- package/dist/chunk-00wggsst.js +7 -0
- package/dist/chunk-00wggsst.js.map +10 -0
- package/dist/chunk-5crvhjp2.js +4704 -0
- package/dist/chunk-5crvhjp2.js.map +28 -0
- package/dist/{chunk-q69001w3.js → chunk-694m74s7.js} +7 -1
- package/dist/{chunk-q69001w3.js.map → chunk-694m74s7.js.map} +3 -3
- package/dist/{chunk-4mprsd2n.js → chunk-fg6thecb.js} +25 -1
- package/dist/chunk-fg6thecb.js.map +10 -0
- package/dist/{chunk-j9653e83.js → chunk-fwb9mxwm.js} +1 -1
- package/dist/{chunk-km25essq.js → chunk-kes4ygmz.js} +1 -1
- package/dist/{chunk-kwbw4dyk.js → chunk-ryed2jq8.js} +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +930 -309
- package/dist/index.js.map +15 -10
- package/dist/locale-messages.d.ts +12 -0
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +12 -0
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +1 -1
- package/dist/metadata.d.ts +8 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/pages/console/action-run.d.ts.map +1 -1
- package/dist/pages/console/data/connectors.d.ts.map +1 -1
- package/dist/pages/console/data/datasets.d.ts.map +1 -1
- package/dist/pages/console/data/lake-health.d.ts +3 -0
- package/dist/pages/console/data/lake-health.d.ts.map +1 -0
- package/dist/pages/console/data/messages.d.ts +98 -2
- package/dist/pages/console/data/messages.d.ts.map +1 -1
- package/dist/pages/console/data/pipelines.d.ts.map +1 -1
- package/dist/pages/console/data/projections.d.ts.map +1 -1
- package/dist/pages/console/data/shared.d.ts.map +1 -1
- package/dist/pages/console/data/syncs.d.ts.map +1 -1
- package/dist/pages/console/ontology/action-runs.d.ts.map +1 -1
- package/dist/pages/console/ontology/actions.d.ts.map +1 -1
- package/dist/pages/console/ontology/components/action-button.d.ts.map +1 -1
- package/dist/pages/console/ontology/components/artifact-picker.d.ts +36 -0
- package/dist/pages/console/ontology/components/artifact-picker.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/object-query-bar.d.ts.map +1 -1
- package/dist/pages/console/ontology/lib/action-params.d.ts +2 -0
- package/dist/pages/console/ontology/lib/action-params.d.ts.map +1 -1
- package/dist/pages/console/ontology/lineage/properties-panel.d.ts +2 -1
- package/dist/pages/console/ontology/lineage/properties-panel.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-page.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-type.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-types.d.ts.map +1 -1
- package/dist/pages/console/ontology/objects.d.ts.map +1 -1
- package/dist/pages/console/ontology/rules.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflow.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows/run-input-form.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows/schema-shape.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows.d.ts.map +1 -1
- package/dist/pages/console/skeletons.d.ts +30 -0
- package/dist/pages/console/skeletons.d.ts.map +1 -0
- package/dist/pages/console/workflow-run.d.ts.map +1 -1
- package/dist/pages/section-page.d.ts +11 -1
- package/dist/pages/section-page.d.ts.map +1 -1
- package/dist/pages/section-ui.d.ts +25 -3
- package/dist/pages/section-ui.d.ts.map +1 -1
- package/dist/pages/settings/activity/calendar.d.ts.map +1 -1
- package/dist/pages/settings/activity/connections.d.ts.map +1 -1
- package/dist/pages/settings/activity/page.d.ts.map +1 -1
- package/dist/pages/settings/activity/thread.d.ts.map +1 -1
- package/dist/pages/settings/activity/timeline.d.ts +2 -0
- package/dist/pages/settings/activity/timeline.d.ts.map +1 -1
- package/dist/pages/settings/controls.d.ts +4 -0
- 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-history.d.ts +2 -0
- package/dist/pages/settings/memory-history.d.ts.map +1 -1
- package/dist/pages/settings/memory.d.ts.map +1 -1
- package/dist/pages/settings/service-accounts.d.ts.map +1 -1
- package/dist/pages/settings/sessions.d.ts.map +1 -1
- package/dist/pages/settings/usage/breakdown.d.ts.map +1 -1
- package/dist/pages/settings/usage/limits.d.ts.map +1 -1
- package/dist/pages/settings/usage/messages.d.ts +2 -2
- package/dist/pages/settings/usage/messages.d.ts.map +1 -1
- package/dist/pages/settings/usage/runs.d.ts +8 -2
- package/dist/pages/settings/usage/runs.d.ts.map +1 -1
- package/dist/pages/settings/usage/spend-chart.d.ts.map +1 -1
- package/dist/pages/settings/usage/spend-model.d.ts +5 -0
- package/dist/pages/settings/usage/spend-model.d.ts.map +1 -1
- package/dist/pages/values.d.ts +6 -0
- package/dist/pages/values.d.ts.map +1 -1
- package/dist/pages.d.ts +4 -0
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +8195 -4841
- package/dist/pages.js.map +58 -49
- package/dist/sections/catalog.d.ts.map +1 -1
- package/dist/sections/sections.d.ts.map +1 -1
- package/dist/server.js +294 -23
- package/dist/server.js.map +8 -7
- package/dist/service-worker.d.ts +39 -0
- package/dist/service-worker.d.ts.map +1 -0
- package/dist/shared-session.d.ts +25 -0
- package/dist/shared-session.d.ts.map +1 -0
- package/dist/shell/app-return.d.ts +35 -0
- package/dist/shell/app-return.d.ts.map +1 -0
- package/dist/shell/app-shell.d.ts +1 -1
- package/dist/shell/app-shell.d.ts.map +1 -1
- package/dist/shell/nav-items.d.ts +2 -0
- package/dist/shell/nav-items.d.ts.map +1 -1
- package/dist/shell/phone/back.d.ts +6 -0
- package/dist/shell/phone/back.d.ts.map +1 -0
- package/dist/shell/phone/launch.d.ts +7 -0
- package/dist/shell/phone/launch.d.ts.map +1 -0
- package/dist/shell/phone/more-sheet.d.ts +36 -0
- package/dist/shell/phone/more-sheet.d.ts.map +1 -0
- package/dist/shell/phone/phone-foundations.d.ts +9 -0
- package/dist/shell/phone/phone-foundations.d.ts.map +1 -0
- package/dist/shell/phone/pull-to-refresh.d.ts +9 -0
- package/dist/shell/phone/pull-to-refresh.d.ts.map +1 -0
- package/dist/shell/phone/routes.d.ts +12 -0
- package/dist/shell/phone/routes.d.ts.map +1 -0
- package/dist/shell/phone/screen-motion.d.ts +11 -0
- package/dist/shell/phone/screen-motion.d.ts.map +1 -0
- package/dist/shell/phone/scroll-restoration.d.ts +7 -0
- package/dist/shell/phone/scroll-restoration.d.ts.map +1 -0
- package/dist/shell/phone/startup-image.d.ts +17 -0
- package/dist/shell/phone/startup-image.d.ts.map +1 -0
- package/dist/shell/phone/tab-bar.d.ts +14 -0
- package/dist/shell/phone/tab-bar.d.ts.map +1 -0
- package/dist/shell/phone/top-bar.d.ts +24 -0
- package/dist/shell/phone/top-bar.d.ts.map +1 -0
- package/dist/shell/search-command.d.ts +3 -1
- package/dist/shell/search-command.d.ts.map +1 -1
- package/dist/shell/user-menu.d.ts +2 -0
- package/dist/shell/user-menu.d.ts.map +1 -1
- package/package.json +8 -5
- package/src/agent/activity-label.ts +6 -2
- package/src/agent/agent-chat.tsx +51 -8
- package/src/agent/agent-panel.tsx +12 -0
- package/src/agent/agent-surface.tsx +4 -0
- package/src/agent/agent.css +18 -0
- package/src/agent/artifact-card.tsx +84 -16
- package/src/agent/artifact-panel.tsx +63 -43
- 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 +21 -3
- package/src/agent/components/agent-message-body.tsx +1 -1
- package/src/agent/components/composer-menu.tsx +4 -1
- package/src/agent/components/composer-place.tsx +168 -0
- package/src/agent/components/composer.tsx +101 -3
- package/src/agent/components/computer-place.tsx +18 -1
- package/src/agent/components/context-chips.tsx +72 -2
- package/src/agent/components/conversation-panel.tsx +3 -2
- package/src/agent/components/message-parts.tsx +6 -1
- package/src/agent/components/thread-artifacts-menu.tsx +22 -5
- package/src/agent/components/transcript.tsx +33 -1
- package/src/agent/components/web-fetch-tool-view.tsx +94 -29
- package/src/agent/composer-insertion.ts +36 -0
- package/src/agent/delegation/child-parts.tsx +1 -1
- package/src/agent/hooks/use-agent-conversation.ts +101 -8
- package/src/agent/hooks/use-new-thread-place.ts +294 -0
- package/src/agent/i18n/en.ts +70 -3
- package/src/agent/i18n/fr.ts +70 -3
- package/src/agent/observed-conversation.tsx +3 -0
- package/src/agent/publish-artifact/interpret.ts +27 -5
- package/src/agent/publish-artifact/open-artifact-tool-view.tsx +49 -0
- package/src/agent/publish-artifact/publish-artifact-tool-view.tsx +14 -8
- package/src/agent/publish-artifact/use-live-publishes.ts +7 -11
- package/src/agent/react-router.tsx +2 -2
- package/src/agent/tool-views/built-in.tsx +29 -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/artifacts/artifact-page.tsx +42 -17
- package/src/artifacts/artifact-viewer.tsx +56 -0
- package/src/artifacts/artifacts.css +80 -0
- package/src/artifacts/card-details.ts +2 -2
- package/src/artifacts/card-preview.tsx +17 -3
- package/src/artifacts/comments-context.ts +125 -0
- package/src/artifacts/edit-session.tsx +6 -6
- package/src/artifacts/file-source.ts +10 -3
- package/src/artifacts/frame.tsx +50 -12
- package/src/artifacts/gallery.tsx +9 -11
- package/src/artifacts/guest-badge.tsx +21 -0
- package/src/artifacts/held-artifact.tsx +241 -0
- package/src/artifacts/holders.tsx +170 -0
- package/src/artifacts/live/boards.ts +95 -0
- package/src/artifacts/live/canvas.ts +402 -0
- package/src/artifacts/live/header.tsx +137 -0
- package/src/artifacts/live/hooks.ts +94 -0
- package/src/artifacts/live/presence.ts +147 -0
- package/src/artifacts/live/session.ts +520 -0
- package/src/artifacts/live/view.ts +81 -0
- package/src/artifacts/messages.ts +415 -24
- package/src/artifacts/page-queries.ts +2 -3
- package/src/artifacts/page-state.ts +16 -7
- package/src/artifacts/publish-edit.ts +50 -22
- package/src/artifacts/queries.ts +108 -10
- package/src/artifacts/references/references.tsx +6 -9
- package/src/artifacts/renderers/canvas/arrows.tsx +12 -39
- package/src/artifacts/renderers/canvas/board-editor.tsx +817 -0
- package/src/artifacts/renderers/canvas/board-properties.tsx +488 -0
- package/src/artifacts/renderers/canvas/board-source.ts +110 -0
- package/src/artifacts/renderers/canvas/board.tsx +309 -33
- package/src/artifacts/renderers/canvas/canvas.tsx +387 -72
- package/src/artifacts/renderers/canvas/comment-pins.tsx +465 -0
- package/src/artifacts/renderers/canvas/commenting.tsx +319 -0
- package/src/artifacts/renderers/canvas/comments-panel.tsx +574 -0
- package/src/artifacts/renderers/canvas/comments.ts +225 -0
- package/src/artifacts/renderers/canvas/draft.ts +41 -50
- package/src/artifacts/renderers/canvas/edit-mode.tsx +145 -20
- package/src/artifacts/renderers/canvas/focus.tsx +175 -24
- package/src/artifacts/renderers/canvas/items.tsx +179 -52
- package/src/artifacts/renderers/canvas/layout.ts +99 -47
- package/src/artifacts/renderers/canvas/presence.tsx +184 -0
- package/src/artifacts/renderers/canvas/previews.ts +127 -0
- package/src/artifacts/renderers/canvas/renderer.tsx +87 -22
- package/src/artifacts/renderers/canvas/thumbnail.tsx +56 -15
- package/src/artifacts/renderers/canvas/toolbar.tsx +1 -1
- package/src/artifacts/renderers/slides/slides.tsx +1 -1
- package/src/artifacts/version-menu.tsx +438 -0
- package/src/artifacts/view-context.ts +102 -0
- package/src/artifacts/viewer.tsx +205 -147
- package/src/build.ts +96 -11
- package/src/codegen.ts +83 -5
- package/src/createCustomApp.ts +20 -7
- package/src/index.ts +12 -0
- package/src/locale-messages.ts +24 -0
- package/src/metadata.ts +12 -0
- package/src/pages/console/action-run.tsx +20 -0
- package/src/pages/console/data/connectors.tsx +27 -3
- package/src/pages/console/data/datasets.tsx +30 -1
- package/src/pages/console/data/lake-health.tsx +299 -0
- package/src/pages/console/data/messages.ts +143 -2
- package/src/pages/console/data/pipelines.tsx +91 -3
- package/src/pages/console/data/projections.tsx +23 -4
- package/src/pages/console/data/shared.tsx +1 -0
- package/src/pages/console/data/syncs.tsx +39 -2
- package/src/pages/console/ontology/action-runs.tsx +8 -2
- package/src/pages/console/ontology/actions.tsx +39 -15
- package/src/pages/console/ontology/components/action-button.tsx +10 -0
- package/src/pages/console/ontology/components/artifact-picker.tsx +522 -0
- package/src/pages/console/ontology/components/object-query-bar.tsx +21 -5
- package/src/pages/console/ontology/lib/action-params.ts +10 -0
- package/src/pages/console/ontology/lineage/properties-panel.tsx +32 -24
- package/src/pages/console/ontology/object-page.tsx +2 -0
- package/src/pages/console/ontology/object-type.tsx +73 -14
- package/src/pages/console/ontology/object-types.tsx +56 -7
- package/src/pages/console/ontology/objects.tsx +167 -19
- package/src/pages/console/ontology/rules.tsx +186 -30
- package/src/pages/console/ontology/workflow.tsx +130 -74
- package/src/pages/console/ontology/workflows/run-input-form.tsx +21 -2
- package/src/pages/console/ontology/workflows/schema-shape.tsx +3 -0
- package/src/pages/console/ontology/workflows.tsx +34 -21
- package/src/pages/console/skeletons.tsx +99 -0
- package/src/pages/console/workflow-run.tsx +20 -0
- package/src/pages/section-page.tsx +37 -7
- package/src/pages/section-ui.tsx +96 -13
- package/src/pages/settings/activity/calendar.tsx +13 -6
- package/src/pages/settings/activity/connections.tsx +26 -9
- package/src/pages/settings/activity/page.tsx +31 -4
- package/src/pages/settings/activity/thread.tsx +32 -18
- package/src/pages/settings/activity/timeline.tsx +39 -0
- package/src/pages/settings/controls.tsx +19 -1
- package/src/pages/settings/developers.tsx +2 -2
- package/src/pages/settings/members.tsx +42 -9
- package/src/pages/settings/memory-history.tsx +76 -10
- package/src/pages/settings/memory.tsx +47 -5
- package/src/pages/settings/service-accounts.tsx +7 -2
- package/src/pages/settings/sessions.tsx +6 -2
- package/src/pages/settings/usage/breakdown.tsx +62 -2
- package/src/pages/settings/usage/limits.tsx +45 -3
- package/src/pages/settings/usage/messages.ts +2 -2
- package/src/pages/settings/usage/page.tsx +99 -52
- package/src/pages/settings/usage/runs.tsx +105 -8
- package/src/pages/settings/usage/spend-chart.tsx +79 -45
- package/src/pages/settings/usage/spend-model.ts +17 -0
- package/src/pages/values.tsx +72 -6
- package/src/pages.ts +4 -0
- package/src/sections/catalog.ts +6 -0
- package/src/sections/sections.tsx +2 -0
- package/src/service-worker.ts +176 -0
- package/src/shared-session.ts +73 -0
- package/src/shell/app-return.ts +115 -0
- package/src/shell/app-shell.tsx +125 -27
- package/src/shell/nav-items.tsx +2 -0
- package/src/shell/phone/back.ts +16 -0
- package/src/shell/phone/launch.ts +6 -0
- package/src/shell/phone/more-sheet.tsx +249 -0
- package/src/shell/phone/phone-foundations.tsx +43 -0
- package/src/shell/phone/phone.css +660 -0
- package/src/shell/phone/pull-to-refresh.tsx +201 -0
- package/src/shell/phone/routes.ts +34 -0
- package/src/shell/phone/screen-motion.ts +292 -0
- package/src/shell/phone/scroll-restoration.tsx +70 -0
- package/src/shell/phone/startup-image.ts +119 -0
- package/src/shell/phone/tab-bar.tsx +95 -0
- package/src/shell/phone/top-bar.tsx +195 -0
- package/src/shell/search-command.tsx +30 -14
- package/src/shell/user-menu.tsx +2 -1
- package/dist/chunk-4mprsd2n.js.map +0 -10
- package/dist/chunk-fw2bm6dq.js.map +0 -182
- package/dist/chunk-zxthr2q5.js +0 -1487
- package/dist/chunk-zxthr2q5.js.map +0 -18
- /package/dist/{chunk-j9653e83.js.map → chunk-fwb9mxwm.js.map} +0 -0
- /package/dist/{chunk-km25essq.js.map → chunk-kes4ygmz.js.map} +0 -0
- /package/dist/{chunk-kwbw4dyk.js.map → chunk-ryed2jq8.js.map} +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { isSixbApiError } from "@sixb/client"
|
|
2
|
+
import { cn } from "@sixb/ui/lib/utils"
|
|
3
|
+
import { useQuery } from "@tanstack/react-query"
|
|
4
|
+
import { FileX, Lock, RotateCcw, TriangleAlert } from "lucide-react"
|
|
5
|
+
import { Link } from "react-router-dom"
|
|
6
|
+
import { artifactHref } from "../pages/routes"
|
|
7
|
+
import { ArtifactCardFace } from "./card-preview"
|
|
8
|
+
import { ArtifactKindIcon } from "./kind-icon"
|
|
9
|
+
import { useArtifactMessages } from "./messages"
|
|
10
|
+
import { artifactVersionOptions, useArtifactUpdates } from "./queries"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Artifacts an object holds in a property, as its page shows them: each one a card with a preview of
|
|
14
|
+
* its latest version that opens it. One card or many, they line up as a conversation's cards do.
|
|
15
|
+
*/
|
|
16
|
+
export function HeldArtifactCards({ artifactIds }: { readonly artifactIds: readonly string[] }) {
|
|
17
|
+
return (
|
|
18
|
+
<ul className="grid grid-cols-[repeat(auto-fill,minmax(min(100%,15rem),1fr))] gap-3">
|
|
19
|
+
{artifactIds.map((artifactId, index) => (
|
|
20
|
+
// The same artifact can be held twice in a list.
|
|
21
|
+
<li key={`${artifactId}:${index}`} className="min-w-0">
|
|
22
|
+
<HeldArtifactCard artifactId={artifactId} />
|
|
23
|
+
</li>
|
|
24
|
+
))}
|
|
25
|
+
</ul>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const CARD_CLASS_NAME =
|
|
30
|
+
"flex w-full flex-col overflow-hidden rounded-xl border bg-card text-left shadow-[0_1px_2px_rgb(0_0_0/0.04)]"
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* One held artifact, followed live: what someone saves or the Agent writes shows on the card as it
|
|
34
|
+
* happens. One that is gone, or that the reader cannot open, is a quiet line that says so.
|
|
35
|
+
*/
|
|
36
|
+
function HeldArtifactCard({ artifactId }: { readonly artifactId: string }) {
|
|
37
|
+
const messages = useArtifactMessages().held
|
|
38
|
+
const query = useQuery(artifactVersionOptions(artifactId, "latest"))
|
|
39
|
+
useArtifactUpdates(artifactId)
|
|
40
|
+
|
|
41
|
+
// A read again that fails keeps what was read, unless the artifact is gone for the reader.
|
|
42
|
+
const version = query.data
|
|
43
|
+
const problem = query.error ? heldArtifactProblem(query.error) : null
|
|
44
|
+
const gone = problem === "gone" || problem === "notShared"
|
|
45
|
+
|
|
46
|
+
if (version && !gone) {
|
|
47
|
+
return (
|
|
48
|
+
<Link
|
|
49
|
+
to={artifactHref(artifactId)}
|
|
50
|
+
aria-label={messages.open(version.title)}
|
|
51
|
+
className={cn(
|
|
52
|
+
CARD_CLASS_NAME,
|
|
53
|
+
"group border-border/80 outline-none transition-[border-color,box-shadow] duration-200 hover:border-foreground/20 hover:shadow-[0_4px_14px_rgb(0_0_0/0.07)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
54
|
+
)}
|
|
55
|
+
>
|
|
56
|
+
<ArtifactCardFace
|
|
57
|
+
kind={version.outline.kind}
|
|
58
|
+
title={version.title}
|
|
59
|
+
version={version}
|
|
60
|
+
loading={false}
|
|
61
|
+
/>
|
|
62
|
+
</Link>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (query.isPending) return <HeldArtifactSkeleton label={messages.loading} />
|
|
67
|
+
|
|
68
|
+
return <UnavailableCard problem={problem ?? "failed"} onRetry={() => void query.refetch()} />
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Why a held artifact cannot be shown: it is gone, it is not the reader's to open, or reading it failed. */
|
|
72
|
+
export type HeldArtifactProblem = "gone" | "notShared" | "failed" | "storageUnavailable"
|
|
73
|
+
|
|
74
|
+
export function heldArtifactProblem(error: unknown): HeldArtifactProblem {
|
|
75
|
+
if (!isSixbApiError(error)) return "failed"
|
|
76
|
+
if (error.code === "not_shared" || error.status === 403) return "notShared"
|
|
77
|
+
if (error.status === 404) return "gone"
|
|
78
|
+
// Trying again cannot help until the server is given artifact storage.
|
|
79
|
+
if (error.status === 501) return "storageUnavailable"
|
|
80
|
+
return "failed"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The card's shape while the artifact loads, so the page does not move when it arrives. */
|
|
84
|
+
function HeldArtifactSkeleton({ label }: { readonly label: string }) {
|
|
85
|
+
return (
|
|
86
|
+
<div
|
|
87
|
+
role="status"
|
|
88
|
+
aria-label={label}
|
|
89
|
+
className={cn(CARD_CLASS_NAME, "border-border/60 shadow-none")}
|
|
90
|
+
>
|
|
91
|
+
<span className="block h-[7.75rem] animate-pulse border-b border-border/60 bg-muted/50 motion-reduce:animate-none" />
|
|
92
|
+
<span className="flex items-center gap-2.5 px-3.5 py-3">
|
|
93
|
+
<span className="size-4 shrink-0 rounded bg-muted" />
|
|
94
|
+
<span className="flex min-w-0 flex-1 flex-col gap-1.5">
|
|
95
|
+
<span className="h-3 w-2/3 rounded bg-muted" />
|
|
96
|
+
<span className="h-2.5 w-1/3 rounded bg-muted/70" />
|
|
97
|
+
</span>
|
|
98
|
+
</span>
|
|
99
|
+
</div>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const PROBLEM_ICONS = {
|
|
104
|
+
gone: FileX,
|
|
105
|
+
notShared: Lock,
|
|
106
|
+
failed: TriangleAlert,
|
|
107
|
+
storageUnavailable: TriangleAlert,
|
|
108
|
+
} as const
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* A quiet line in the place of a card the reader cannot open, saying why in their words, never
|
|
112
|
+
* with an id: nothing is there to preview.
|
|
113
|
+
*/
|
|
114
|
+
function UnavailableCard({
|
|
115
|
+
problem,
|
|
116
|
+
onRetry,
|
|
117
|
+
}: {
|
|
118
|
+
readonly problem: HeldArtifactProblem
|
|
119
|
+
readonly onRetry: () => void
|
|
120
|
+
}) {
|
|
121
|
+
const messages = useArtifactMessages()
|
|
122
|
+
const held = messages.held
|
|
123
|
+
const Icon = PROBLEM_ICONS[problem]
|
|
124
|
+
|
|
125
|
+
const [title, description] =
|
|
126
|
+
problem === "gone"
|
|
127
|
+
? [held.gone, held.goneDescription]
|
|
128
|
+
: problem === "notShared"
|
|
129
|
+
? [held.notShared, held.notSharedDescription]
|
|
130
|
+
: [
|
|
131
|
+
held.loadFailed,
|
|
132
|
+
problem === "storageUnavailable" ? messages.viewer.storageUnavailable : "",
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<div className={cn(CARD_CLASS_NAME, "border-dashed border-border bg-muted/20 shadow-none")}>
|
|
137
|
+
<span className="flex min-h-[3.75rem] items-center gap-3 px-3.5 py-3">
|
|
138
|
+
<span
|
|
139
|
+
aria-hidden="true"
|
|
140
|
+
className="flex size-9 shrink-0 items-center justify-center rounded-full bg-background text-muted-foreground ring-1 ring-border/70"
|
|
141
|
+
>
|
|
142
|
+
<Icon className="size-4" />
|
|
143
|
+
</span>
|
|
144
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
145
|
+
<span className="truncate text-[13.5px] leading-snug font-medium text-foreground">
|
|
146
|
+
{title}
|
|
147
|
+
</span>
|
|
148
|
+
{description ? (
|
|
149
|
+
<span className="text-[12px] leading-snug text-muted-foreground">{description}</span>
|
|
150
|
+
) : null}
|
|
151
|
+
</span>
|
|
152
|
+
{problem === "failed" ? (
|
|
153
|
+
<button
|
|
154
|
+
type="button"
|
|
155
|
+
onClick={onRetry}
|
|
156
|
+
className="inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
|
|
157
|
+
>
|
|
158
|
+
<RotateCcw className="size-3.5" aria-hidden="true" />
|
|
159
|
+
{held.retry}
|
|
160
|
+
</button>
|
|
161
|
+
) : null}
|
|
162
|
+
</span>
|
|
163
|
+
</div>
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* A held artifact where a value is a line among others, such as a run's input: its kind and title,
|
|
169
|
+
* opening it. Without `link`, it names the artifact without sending its reader there.
|
|
170
|
+
*/
|
|
171
|
+
export function HeldArtifactChip({
|
|
172
|
+
artifactId,
|
|
173
|
+
link = true,
|
|
174
|
+
}: {
|
|
175
|
+
readonly artifactId: string
|
|
176
|
+
readonly link?: boolean
|
|
177
|
+
}) {
|
|
178
|
+
const messages = useArtifactMessages().held
|
|
179
|
+
const query = useQuery(artifactVersionOptions(artifactId, "latest"))
|
|
180
|
+
const version = query.data
|
|
181
|
+
|
|
182
|
+
const chip =
|
|
183
|
+
"inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-md bg-muted/60 px-2 py-0.5 text-xs font-medium"
|
|
184
|
+
|
|
185
|
+
if (!version) {
|
|
186
|
+
if (query.isPending) {
|
|
187
|
+
return (
|
|
188
|
+
<span role="status" aria-label={messages.loading} className={chip}>
|
|
189
|
+
<span className="size-3 shrink-0 rounded-sm bg-muted-foreground/20" />
|
|
190
|
+
<span className="h-2.5 w-20 animate-pulse rounded bg-muted-foreground/15 motion-reduce:animate-none" />
|
|
191
|
+
</span>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const problem = heldArtifactProblem(query.error)
|
|
196
|
+
const Icon = PROBLEM_ICONS[problem]
|
|
197
|
+
const label =
|
|
198
|
+
problem === "gone"
|
|
199
|
+
? messages.gone
|
|
200
|
+
: problem === "notShared"
|
|
201
|
+
? messages.notShared
|
|
202
|
+
: messages.loadFailed
|
|
203
|
+
return (
|
|
204
|
+
<span className={cn(chip, "font-normal text-muted-foreground")}>
|
|
205
|
+
<Icon className="size-3 shrink-0" aria-hidden="true" />
|
|
206
|
+
<span className="truncate">{label}</span>
|
|
207
|
+
</span>
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const content = (
|
|
212
|
+
<>
|
|
213
|
+
<ArtifactKindIcon
|
|
214
|
+
kind={version.outline.kind}
|
|
215
|
+
className="size-3 shrink-0 text-muted-foreground"
|
|
216
|
+
/>
|
|
217
|
+
<span className="truncate">{version.title}</span>
|
|
218
|
+
</>
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
if (!link) {
|
|
222
|
+
return (
|
|
223
|
+
<span className={chip} title={version.title}>
|
|
224
|
+
{content}
|
|
225
|
+
</span>
|
|
226
|
+
)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return (
|
|
230
|
+
<Link
|
|
231
|
+
to={artifactHref(artifactId)}
|
|
232
|
+
title={version.title}
|
|
233
|
+
className={cn(
|
|
234
|
+
chip,
|
|
235
|
+
"outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring"
|
|
236
|
+
)}
|
|
237
|
+
>
|
|
238
|
+
{content}
|
|
239
|
+
</Link>
|
|
240
|
+
)
|
|
241
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { ListArtifactHoldersResponse } from "@sixb/client"
|
|
2
|
+
import { listArtifactHoldersOptions, listObjectTypesOptions } from "@sixb/client/hooks"
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenu,
|
|
5
|
+
DropdownMenuContent,
|
|
6
|
+
DropdownMenuItem,
|
|
7
|
+
DropdownMenuLabel,
|
|
8
|
+
DropdownMenuTrigger,
|
|
9
|
+
} from "@sixb/ui/components"
|
|
10
|
+
import { cn } from "@sixb/ui/lib/utils"
|
|
11
|
+
import { useQuery } from "@tanstack/react-query"
|
|
12
|
+
import { Box, ChevronDown } from "lucide-react"
|
|
13
|
+
import type { ReactNode } from "react"
|
|
14
|
+
import { Link } from "react-router-dom"
|
|
15
|
+
import { humanizeIdentifier } from "../pages/console/ontology/lib/labels"
|
|
16
|
+
import { objectHref } from "../pages/routes"
|
|
17
|
+
import { useSharedGuest } from "../shared-session"
|
|
18
|
+
import { useArtifactMessages } from "./messages"
|
|
19
|
+
|
|
20
|
+
type Holder = ListArtifactHoldersResponse["holders"][number]
|
|
21
|
+
|
|
22
|
+
/** Who holds an artifact changes rarely, and only by an edit to an object. */
|
|
23
|
+
const HOLDERS_STALE_MS = 60_000
|
|
24
|
+
|
|
25
|
+
const PILL =
|
|
26
|
+
"inline-flex h-6 max-w-[14rem] min-w-0 shrink items-center gap-1.5 rounded-full border border-border/80 bg-card pr-2 pl-1.5 text-xs font-medium text-muted-foreground shadow-[0_1px_1px_rgb(0_0_0/0.03)] outline-none transition-colors hover:border-border hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:border-border data-[state=open]:text-foreground"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The objects an artifact belongs to, beside its title: the one that holds it, as a pill that opens
|
|
30
|
+
* its page, or the first of several with the others a click away. A narrow header, as a phone's,
|
|
31
|
+
* keeps the title's room: the pill is its icon, which lists them. Only those the reader can see
|
|
32
|
+
* are listed; an artifact no object holds, for this reader, shows nothing.
|
|
33
|
+
*/
|
|
34
|
+
export function ArtifactHolders({ artifactId }: { readonly artifactId: string }) {
|
|
35
|
+
const messages = useArtifactMessages().viewer
|
|
36
|
+
const { data } = useQuery({
|
|
37
|
+
...listArtifactHoldersOptions({ path: { artifactId } }),
|
|
38
|
+
staleTime: HOLDERS_STALE_MS,
|
|
39
|
+
retry: false,
|
|
40
|
+
})
|
|
41
|
+
const label = useHolderLabel()
|
|
42
|
+
const guest = useSharedGuest() !== null
|
|
43
|
+
|
|
44
|
+
const holders = data?.holders ?? []
|
|
45
|
+
const [first] = holders
|
|
46
|
+
if (!first) return null
|
|
47
|
+
|
|
48
|
+
const others = holders.length - 1 + (data?.hasMore ? 1 : 0)
|
|
49
|
+
const named =
|
|
50
|
+
others === 0
|
|
51
|
+
? `${messages.belongsTo} ${label(first)}`
|
|
52
|
+
: messages.belongsToMany(holders.length, data?.hasMore ?? false)
|
|
53
|
+
|
|
54
|
+
// A shared link's guest reads the objects their link shares, not the app's pages about them:
|
|
55
|
+
// the pill says what holds the artifact, and goes nowhere.
|
|
56
|
+
if (guest) {
|
|
57
|
+
return (
|
|
58
|
+
<span title={named} aria-label={named} className={cn(PILL, "hover:border-border/80")}>
|
|
59
|
+
<ObjectIcon />
|
|
60
|
+
<span className="hidden truncate @md:inline">{label(first)}</span>
|
|
61
|
+
{others > 0 ? (
|
|
62
|
+
<span className="hidden shrink-0 tabular-nums @md:inline">
|
|
63
|
+
{messages.andMore(others)}
|
|
64
|
+
</span>
|
|
65
|
+
) : null}
|
|
66
|
+
</span>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const wide =
|
|
71
|
+
others === 0 ? (
|
|
72
|
+
<Link
|
|
73
|
+
to={objectHref(first.objectTypeId, first.primaryId)}
|
|
74
|
+
title={named}
|
|
75
|
+
aria-label={named}
|
|
76
|
+
className={PILL}
|
|
77
|
+
>
|
|
78
|
+
<ObjectIcon />
|
|
79
|
+
<span className="truncate">{label(first)}</span>
|
|
80
|
+
</Link>
|
|
81
|
+
) : (
|
|
82
|
+
<HolderMenu holders={holders} label={label} named={named} className={PILL}>
|
|
83
|
+
<ObjectIcon />
|
|
84
|
+
<span className="truncate">{label(first)}</span>
|
|
85
|
+
<span className="shrink-0 tabular-nums">{messages.andMore(others)}</span>
|
|
86
|
+
<ChevronDown className="size-3 shrink-0 opacity-70" aria-hidden="true" />
|
|
87
|
+
</HolderMenu>
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<>
|
|
92
|
+
<span className="hidden min-w-0 @md:contents">{wide}</span>
|
|
93
|
+
<span className="contents @md:hidden">
|
|
94
|
+
<HolderMenu
|
|
95
|
+
holders={holders}
|
|
96
|
+
label={label}
|
|
97
|
+
named={named}
|
|
98
|
+
className={cn(PILL, "w-6 shrink-0 justify-center px-0")}
|
|
99
|
+
>
|
|
100
|
+
<ObjectIcon />
|
|
101
|
+
</HolderMenu>
|
|
102
|
+
</span>
|
|
103
|
+
</>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function ObjectIcon() {
|
|
108
|
+
return (
|
|
109
|
+
<Box className="size-3 shrink-0 text-emerald-600 dark:text-emerald-400" aria-hidden="true" />
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** The holders as a menu, each opening its object's page. */
|
|
114
|
+
function HolderMenu({
|
|
115
|
+
holders,
|
|
116
|
+
label,
|
|
117
|
+
named,
|
|
118
|
+
className,
|
|
119
|
+
children,
|
|
120
|
+
}: {
|
|
121
|
+
readonly holders: readonly Holder[]
|
|
122
|
+
readonly label: (holder: Holder) => string
|
|
123
|
+
/** What the trigger says to assistive technology, and on hover. */
|
|
124
|
+
readonly named: string
|
|
125
|
+
readonly className: string
|
|
126
|
+
readonly children: ReactNode
|
|
127
|
+
}) {
|
|
128
|
+
const messages = useArtifactMessages().viewer
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<DropdownMenu>
|
|
132
|
+
<DropdownMenuTrigger aria-label={named} title={named} className={className}>
|
|
133
|
+
{children}
|
|
134
|
+
</DropdownMenuTrigger>
|
|
135
|
+
|
|
136
|
+
<DropdownMenuContent align="start" className="w-72 max-w-[calc(100vw-1.5rem)]">
|
|
137
|
+
<DropdownMenuLabel>{messages.belongsTo}</DropdownMenuLabel>
|
|
138
|
+
{holders.map((holder) => (
|
|
139
|
+
<DropdownMenuItem
|
|
140
|
+
key={`${holder.objectTypeId}:${holder.primaryId}:${holder.propertyId}`}
|
|
141
|
+
asChild
|
|
142
|
+
className="gap-2.5"
|
|
143
|
+
>
|
|
144
|
+
<Link to={objectHref(holder.objectTypeId, holder.primaryId)}>
|
|
145
|
+
<Box className="size-4 text-emerald-600 dark:text-emerald-400" />
|
|
146
|
+
<span className="min-w-0 flex-1 truncate">{label(holder)}</span>
|
|
147
|
+
</Link>
|
|
148
|
+
</DropdownMenuItem>
|
|
149
|
+
))}
|
|
150
|
+
</DropdownMenuContent>
|
|
151
|
+
</DropdownMenu>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* How a holder reads: the object's title and the property that holds the artifact, as
|
|
157
|
+
* "NLM-23077 · Onboarding plan". An object whose type has no title reads as its type and key.
|
|
158
|
+
*/
|
|
159
|
+
function useHolderLabel(): (holder: Holder) => string {
|
|
160
|
+
const types = useQuery({ ...listObjectTypesOptions(), staleTime: HOLDERS_STALE_MS, retry: false })
|
|
161
|
+
|
|
162
|
+
return (holder) => {
|
|
163
|
+
const type = types.data?.find((candidate) => candidate.id === holder.objectTypeId)
|
|
164
|
+
const property = type?.properties.find((candidate) => candidate.id === holder.propertyId)
|
|
165
|
+
const object =
|
|
166
|
+
holder.title ?? `${type?.name ?? humanizeIdentifier(holder.objectTypeId)} ${holder.primaryId}`
|
|
167
|
+
|
|
168
|
+
return [object, humanizeIdentifier(property?.name || holder.propertyId)].join(" · ")
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { LIVE_FILES } from "@sixb/core/artifacts/live"
|
|
2
|
+
import type { FileRef } from "@sixb/core/blob-storage"
|
|
3
|
+
import { useCallback, useMemo, useSyncExternalStore } from "react"
|
|
4
|
+
import * as Y from "yjs"
|
|
5
|
+
import type { LiveArtifact } from "./session"
|
|
6
|
+
|
|
7
|
+
// A board's page as the live document holds it, read as it changes: someone typing in it, the
|
|
8
|
+
// Agent writing it, or the whole file replaced.
|
|
9
|
+
|
|
10
|
+
/** A board's page in the document now; null when the document holds none at that path as text. */
|
|
11
|
+
export function liveBoardSource(doc: Y.Doc, path: string): string | null {
|
|
12
|
+
const entry = doc.getMap<unknown>(LIVE_FILES).get(path)
|
|
13
|
+
return entry instanceof Y.Text ? entry.toString() : null
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** The files the document holds as stored bytes, by path: the pictures a board may show. */
|
|
17
|
+
export function liveStoredFiles(doc: Y.Doc): ReadonlyMap<string, FileRef> {
|
|
18
|
+
const files = new Map<string, FileRef>()
|
|
19
|
+
doc.getMap<unknown>(LIVE_FILES).forEach((entry, path) => {
|
|
20
|
+
if (entry instanceof Y.Text || entry instanceof Y.Map) return
|
|
21
|
+
if (isFileRef(entry)) files.set(path, entry)
|
|
22
|
+
})
|
|
23
|
+
return files
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function isFileRef(value: unknown): value is FileRef {
|
|
27
|
+
return (
|
|
28
|
+
typeof value === "object" &&
|
|
29
|
+
value !== null &&
|
|
30
|
+
typeof (value as { blobId?: unknown }).blobId === "string"
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Follows a board's page in a live artifact's document: the text it holds now, read again as it
|
|
36
|
+
* changes, and when the file at its path is replaced. Null without a document, or a page there.
|
|
37
|
+
*/
|
|
38
|
+
export function useLiveBoardSource(live: LiveArtifact | null, path: string): string | null {
|
|
39
|
+
const subscribe = useCallback(
|
|
40
|
+
(listener: () => void) => {
|
|
41
|
+
if (!live) return () => {}
|
|
42
|
+
|
|
43
|
+
const files = live.doc.getMap<unknown>(LIVE_FILES)
|
|
44
|
+
let text: Y.Text | null = null
|
|
45
|
+
const follow = () => {
|
|
46
|
+
text?.unobserve(listener)
|
|
47
|
+
const entry = files.get(path)
|
|
48
|
+
text = entry instanceof Y.Text ? entry : null
|
|
49
|
+
text?.observe(listener)
|
|
50
|
+
}
|
|
51
|
+
const onFiles = (event: Y.YMapEvent<unknown>) => {
|
|
52
|
+
if (!event.keysChanged.has(path)) return
|
|
53
|
+
follow()
|
|
54
|
+
listener()
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
follow()
|
|
58
|
+
files.observe(onFiles)
|
|
59
|
+
return () => {
|
|
60
|
+
files.unobserve(onFiles)
|
|
61
|
+
text?.unobserve(listener)
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
[live, path]
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return useSyncExternalStore(
|
|
68
|
+
subscribe,
|
|
69
|
+
() => (live ? liveBoardSource(live.doc, path) : null),
|
|
70
|
+
() => null
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Follows the files a live artifact's document holds as stored bytes, as they are added. */
|
|
75
|
+
export function useLiveStoredFiles(live: LiveArtifact | null): ReadonlyMap<string, FileRef> {
|
|
76
|
+
const subscribe = useCallback(
|
|
77
|
+
(listener: () => void) => {
|
|
78
|
+
if (!live) return () => {}
|
|
79
|
+
const files = live.doc.getMap<unknown>(LIVE_FILES)
|
|
80
|
+
files.observe(listener)
|
|
81
|
+
return () => files.unobserve(listener)
|
|
82
|
+
},
|
|
83
|
+
[live]
|
|
84
|
+
)
|
|
85
|
+
const snapshot = useCallback(() => (live ? storedFilesKey(live.doc) : ""), [live])
|
|
86
|
+
const key = useSyncExternalStore(subscribe, snapshot, () => "")
|
|
87
|
+
|
|
88
|
+
// The key stands for the files: the map is read again only when it changes.
|
|
89
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: read again as the key changes.
|
|
90
|
+
return useMemo(() => (live ? liveStoredFiles(live.doc) : new Map()), [live, key])
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function storedFilesKey(doc: Y.Doc): string {
|
|
94
|
+
return [...liveStoredFiles(doc)].map(([path, ref]) => `${path}:${ref.digest}`).join("\n")
|
|
95
|
+
}
|