@sixb/app 0.2.1 → 0.2.4
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/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-tool-row.d.ts.map +1 -1
- package/dist/agent/background/interpret.d.ts +1 -1
- package/dist/agent/background/interpret.d.ts.map +1 -1
- package/dist/agent/components/composer-place.d.ts +3 -1
- package/dist/agent/components/composer-place.d.ts.map +1 -1
- package/dist/agent/components/composer.d.ts +20 -1
- package/dist/agent/components/composer.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 +7 -2
- 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 +5 -0
- package/dist/agent/components/transcript.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/agent-exchange.d.ts +16 -0
- package/dist/agent/delegation/agent-exchange.d.ts.map +1 -0
- package/dist/agent/delegation/child-card.d.ts +3 -3
- package/dist/agent/delegation/child-card.d.ts.map +1 -1
- package/dist/agent/delegation/child-parts.d.ts +1 -10
- package/dist/agent/delegation/child-parts.d.ts.map +1 -1
- package/dist/agent/delegation/child-work.d.ts.map +1 -1
- package/dist/agent/delegation/interpret.d.ts +4 -10
- package/dist/agent/delegation/interpret.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/file-edits/file-edit-tool-view.d.ts +10 -0
- package/dist/agent/file-edits/file-edit-tool-view.d.ts.map +1 -0
- package/dist/agent/file-edits/interpret.d.ts +25 -0
- package/dist/agent/file-edits/interpret.d.ts.map +1 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts +16 -4
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-new-thread-place.d.ts +39 -17
- package/dist/agent/hooks/use-new-thread-place.d.ts.map +1 -1
- package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +59 -4
- 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 +96 -8
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/message-agent/interpret.d.ts +2 -2
- package/dist/agent/message-agent/interpret.d.ts.map +1 -1
- package/dist/agent/publish-artifact/interpret.d.ts +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/questions/interpret.d.ts +31 -0
- package/dist/agent/questions/interpret.d.ts.map +1 -0
- package/dist/agent/questions/question-card.d.ts +16 -0
- package/dist/agent/questions/question-card.d.ts.map +1 -0
- package/dist/agent/questions/question-composer.d.ts +15 -0
- package/dist/agent/questions/question-composer.d.ts.map +1 -0
- package/dist/agent/read/interpret.d.ts +8 -1
- package/dist/agent/read/interpret.d.ts.map +1 -1
- package/dist/agent/read/read-tool-view.d.ts.map +1 -1
- package/dist/agent/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/waits.d.ts +14 -0
- package/dist/agent/waits.d.ts.map +1 -0
- 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 +17 -7
- 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 +476 -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 +50 -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 +77 -20
- package/dist/artifacts/renderers/canvas/board.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/canvas.d.ts +14 -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/controls.d.ts +15 -4
- package/dist/artifacts/renderers/canvas/controls.d.ts.map +1 -1
- 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 +54 -5
- package/dist/artifacts/renderers/canvas/focus.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/gestures.d.ts +46 -0
- package/dist/artifacts/renderers/canvas/gestures.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/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/page-resize.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/page-resize.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-size-controls.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/page-size-controls.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-size.d.ts +93 -0
- package/dist/artifacts/renderers/canvas/page-size.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-zoom.d.ts +64 -0
- package/dist/artifacts/renderers/canvas/page-zoom.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/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/shown-size.d.ts +26 -0
- package/dist/artifacts/renderers/canvas/shown-size.d.ts.map +1 -0
- 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-00wggsst.js +7 -0
- package/dist/chunk-00wggsst.js.map +10 -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-7fj9cfkw.js → chunk-970s5nkn.js} +1 -1
- package/dist/{chunk-4mprsd2n.js → chunk-fg6thecb.js} +25 -1
- package/dist/chunk-fg6thecb.js.map +10 -0
- package/dist/{chunk-ytadd0b5.js → chunk-kymx9y5e.js} +8126 -4257
- package/dist/chunk-kymx9y5e.js.map +211 -0
- package/dist/{chunk-j8g956dt.js → chunk-pxd07kvx.js} +1 -1
- package/dist/{chunk-kwbw4dyk.js → chunk-ryed2jq8.js} +1 -1
- package/dist/chunk-yrcm1pbg.js +5975 -0
- package/dist/chunk-yrcm1pbg.js.map +34 -0
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +932 -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/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 +0 -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 +8188 -4841
- package/dist/pages.js.map +56 -47
- 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 -1
- package/src/agent/agent-chat.tsx +52 -8
- package/src/agent/agent-panel.tsx +12 -0
- package/src/agent/agent-surface.tsx +4 -0
- package/src/agent/artifact-card.tsx +84 -16
- package/src/agent/artifact-panel.tsx +63 -43
- package/src/agent/background/background-tool-row.tsx +24 -10
- package/src/agent/background/interpret.ts +60 -51
- package/src/agent/components/agent-message-body.tsx +1 -1
- package/src/agent/components/composer-place.tsx +77 -53
- package/src/agent/components/composer.tsx +92 -7
- package/src/agent/components/context-chips.tsx +72 -2
- package/src/agent/components/conversation-panel.tsx +30 -10
- package/src/agent/components/message-parts.tsx +29 -6
- package/src/agent/components/thread-artifacts-menu.tsx +22 -5
- package/src/agent/components/transcript.tsx +45 -27
- package/src/agent/composer-insertion.ts +36 -0
- package/src/agent/delegation/agent-exchange.tsx +53 -0
- package/src/agent/delegation/child-card.tsx +6 -40
- package/src/agent/delegation/child-parts.tsx +1 -84
- package/src/agent/delegation/child-work.tsx +19 -5
- package/src/agent/delegation/interpret.ts +33 -54
- package/src/agent/delegation/model.ts +1 -1
- package/src/agent/file-edits/file-edit-tool-view.tsx +126 -0
- package/src/agent/file-edits/interpret.ts +120 -0
- package/src/agent/hooks/use-agent-conversation.ts +61 -10
- package/src/agent/hooks/use-new-thread-place.ts +149 -25
- package/src/agent/i18n/en.ts +60 -4
- package/src/agent/i18n/fr.ts +51 -4
- package/src/agent/message-agent/interpret.ts +4 -3
- package/src/agent/publish-artifact/interpret.ts +37 -6
- 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/questions/interpret.ts +90 -0
- package/src/agent/questions/question-card.tsx +57 -0
- package/src/agent/questions/question-composer.tsx +257 -0
- package/src/agent/react-router.tsx +2 -2
- package/src/agent/read/interpret.ts +34 -1
- package/src/agent/read/read-tool-view.tsx +20 -4
- package/src/agent/tool-views/built-in.tsx +22 -8
- package/src/agent/types.ts +4 -0
- package/src/agent/waits.ts +50 -0
- package/src/artifacts/artifact-page.tsx +42 -17
- package/src/artifacts/artifact-viewer.tsx +56 -0
- package/src/artifacts/artifacts.css +116 -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 +21 -7
- package/src/artifacts/file-source.ts +10 -3
- package/src/artifacts/frame.tsx +53 -14
- 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 +469 -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 +839 -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 +373 -35
- package/src/artifacts/renderers/canvas/canvas.tsx +441 -75
- 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/controls.tsx +64 -30
- 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 +321 -26
- package/src/artifacts/renderers/canvas/gestures.ts +265 -0
- package/src/artifacts/renderers/canvas/items.tsx +179 -52
- package/src/artifacts/renderers/canvas/layout.ts +99 -47
- package/src/artifacts/renderers/canvas/page-resize.tsx +542 -0
- package/src/artifacts/renderers/canvas/page-size-controls.tsx +193 -0
- package/src/artifacts/renderers/canvas/page-size.ts +218 -0
- package/src/artifacts/renderers/canvas/page-zoom.ts +280 -0
- package/src/artifacts/renderers/canvas/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/shown-size.ts +105 -0
- 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 +219 -147
- package/src/build.ts +96 -11
- package/src/codegen.ts +83 -5
- package/src/createCustomApp.ts +20 -7
- package/src/index.ts +14 -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/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 +0 -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 +16 -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-4j3c3p72.js +0 -1487
- package/dist/chunk-4j3c3p72.js.map +0 -18
- package/dist/chunk-4mprsd2n.js.map +0 -10
- package/dist/chunk-ytadd0b5.js.map +0 -188
- /package/dist/{chunk-7fj9cfkw.js.map → chunk-970s5nkn.js.map} +0 -0
- /package/dist/{chunk-j8g956dt.js.map → chunk-pxd07kvx.js.map} +0 -0
- /package/dist/{chunk-kwbw4dyk.js.map → chunk-ryed2jq8.js.map} +0 -0
package/src/artifacts/frame.tsx
CHANGED
|
@@ -27,9 +27,11 @@ import { type ArtifactVersion, useArtifactTheme } from "./queries"
|
|
|
27
27
|
|
|
28
28
|
/** Asks the deck in the frame to do something; resolves when it has. */
|
|
29
29
|
export interface ArtifactFrameHandle {
|
|
30
|
+
/** `transfer` hands objects over with the request, as `edit` hands over its port. */
|
|
30
31
|
send<Method extends FrameRequest["method"]>(
|
|
31
32
|
method: Method,
|
|
32
|
-
params: Extract<FrameRequest, { method: Method }>["params"]
|
|
33
|
+
params: Extract<FrameRequest, { method: Method }>["params"],
|
|
34
|
+
transfer?: Transferable[]
|
|
33
35
|
): Promise<void>
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -39,6 +41,13 @@ const FRAME_REUSE_MS = 40 * 60 * 1000
|
|
|
39
41
|
/** How long a deck has to say it is ready before a frame that reports failure gives up on it. */
|
|
40
42
|
const READY_TIMEOUT_MS = 20_000
|
|
41
43
|
|
|
44
|
+
/**
|
|
45
|
+
* How long a frame that finished loading has left to say it is ready: the runtime says so once the
|
|
46
|
+
* page is parsed, before it loads, so one that loaded without saying it is not the page, such as
|
|
47
|
+
* the browser's error page for a frame it blocked.
|
|
48
|
+
*/
|
|
49
|
+
const LOADED_READY_MS = 2_000
|
|
50
|
+
|
|
42
51
|
/**
|
|
43
52
|
* A version in a sandboxed frame, served from the API under a short-lived link. The frame has an
|
|
44
53
|
* opaque origin, so its page cannot read the app's cookies or call the API as the reader: it
|
|
@@ -67,6 +76,7 @@ export function ArtifactFrame({
|
|
|
67
76
|
handle,
|
|
68
77
|
start,
|
|
69
78
|
decorative = false,
|
|
79
|
+
editable = false,
|
|
70
80
|
fallback,
|
|
71
81
|
failure,
|
|
72
82
|
overlay,
|
|
@@ -79,6 +89,11 @@ export function ArtifactFrame({
|
|
|
79
89
|
readonly start?: FrameStart
|
|
80
90
|
/** A picture of the deck, as a thumbnail is: it takes no focus, clicks, or reading. */
|
|
81
91
|
readonly decorative?: boolean
|
|
92
|
+
/**
|
|
93
|
+
* A canvas's board served for editing, its elements marked by address: the frame then picks
|
|
94
|
+
* and types into them once asked to with `edit`.
|
|
95
|
+
*/
|
|
96
|
+
readonly editable?: boolean
|
|
82
97
|
readonly onEvent?: (event: FrameEvent) => void
|
|
83
98
|
readonly className?: string
|
|
84
99
|
/** What shows where the frame will be while it loads, and under it as it fades in. */
|
|
@@ -107,6 +122,7 @@ export function ArtifactFrame({
|
|
|
107
122
|
const [ready, setReady] = useState<string | null>(null)
|
|
108
123
|
const [shown, setShown] = useState<string | null>(null)
|
|
109
124
|
const [timedOut, setTimedOut] = useState<string | null>(null)
|
|
125
|
+
const [loaded, setLoaded] = useState<string | null>(null)
|
|
110
126
|
const reportsFailure = failure !== undefined
|
|
111
127
|
const queries = useQueryClient()
|
|
112
128
|
// What the frame shows when it calls: a pinned version runs that version's queries.
|
|
@@ -124,14 +140,16 @@ export function ArtifactFrame({
|
|
|
124
140
|
|
|
125
141
|
// Each frame keeps the link it loaded until it loads again: every frame of a version shares the
|
|
126
142
|
// query, and a link minted for a later mount would otherwise load every mounted frame again, at
|
|
127
|
-
// its start.
|
|
128
|
-
const identity =
|
|
143
|
+
// its start. A link serves one revision, so an open version that changed loads the new one.
|
|
144
|
+
const identity = frameIdentity(version)
|
|
129
145
|
const [kept, setKept] = useState<{ readonly identity: string; readonly path: string } | null>(
|
|
130
146
|
null
|
|
131
147
|
)
|
|
132
148
|
if (frame.data && kept?.identity !== identity) setKept({ identity, path: frame.data.path })
|
|
133
149
|
const path = kept?.identity === identity ? kept.path : undefined
|
|
134
|
-
const source = path
|
|
150
|
+
const source = path
|
|
151
|
+
? `${frameUrl(path, entry)}${editable ? "?sixb-edit" : ""}${frameStartHash(start ?? {})}`
|
|
152
|
+
: undefined
|
|
135
153
|
const sourceRef = useRef(source)
|
|
136
154
|
sourceRef.current = source
|
|
137
155
|
const pathRef = useRef(path)
|
|
@@ -139,7 +157,7 @@ export function ArtifactFrame({
|
|
|
139
157
|
|
|
140
158
|
const readNames = read.source === source ? read.names : NO_QUERIES
|
|
141
159
|
|
|
142
|
-
const send = useCallback<ArtifactFrameHandle["send"]>((method, params) => {
|
|
160
|
+
const send = useCallback<ArtifactFrameHandle["send"]>((method, params, transfer = []) => {
|
|
143
161
|
const target = iframe.current?.contentWindow
|
|
144
162
|
if (!target) return Promise.reject(new Error("[SixbApp] The frame is not loaded."))
|
|
145
163
|
nextId.current += 1
|
|
@@ -147,7 +165,7 @@ export function ArtifactFrame({
|
|
|
147
165
|
return new Promise<void>((resolve, reject) => {
|
|
148
166
|
pending.current.set(id, { resolve, reject })
|
|
149
167
|
// The frame's origin is opaque, so a target origin cannot name it.
|
|
150
|
-
target.postMessage({ protocol: FRAME_PROTOCOL, id, method, params }, "*")
|
|
168
|
+
target.postMessage({ protocol: FRAME_PROTOCOL, id, method, params }, "*", transfer)
|
|
151
169
|
})
|
|
152
170
|
}, [])
|
|
153
171
|
useImperativeHandle(handle, () => ({ send }), [send])
|
|
@@ -230,7 +248,8 @@ export function ArtifactFrame({
|
|
|
230
248
|
return
|
|
231
249
|
}
|
|
232
250
|
const event = parseFrameEvent(data)
|
|
233
|
-
|
|
251
|
+
// Editing reports only through the port it was handed: the page's scripts post here too.
|
|
252
|
+
if (!event || event.event.startsWith("edit.")) return
|
|
234
253
|
if (event.event === "link") {
|
|
235
254
|
openWebLink(iframe.current, event.params.url)
|
|
236
255
|
return
|
|
@@ -252,7 +271,7 @@ export function ArtifactFrame({
|
|
|
252
271
|
|
|
253
272
|
if (link.path === pathRef.current) return send("reload", {})
|
|
254
273
|
|
|
255
|
-
setKept({ identity:
|
|
274
|
+
setKept({ identity: frameIdentity(version), path: link.path })
|
|
256
275
|
}, [queries, send, version])
|
|
257
276
|
|
|
258
277
|
useQueryChanges(version, readNames, (name) => {
|
|
@@ -289,20 +308,24 @@ export function ArtifactFrame({
|
|
|
289
308
|
}, [artifactTheme, isReady, sendTheme])
|
|
290
309
|
|
|
291
310
|
// A picture of the deck takes no focus, and neither does what it holds: `tabIndex` alone would
|
|
292
|
-
// leave its links in the page's tab order.
|
|
311
|
+
// leave its links in the page's tab order. A canvas's board becomes one, and stops being one,
|
|
312
|
+
// without loading again.
|
|
293
313
|
const attach = useCallback(
|
|
294
314
|
(element: HTMLIFrameElement | null) => {
|
|
295
315
|
iframe.current = element
|
|
296
|
-
if (element
|
|
316
|
+
if (element) element.inert = decorative
|
|
297
317
|
},
|
|
298
318
|
[decorative]
|
|
299
319
|
)
|
|
300
320
|
|
|
301
321
|
useEffect(() => {
|
|
302
322
|
if (!reportsFailure || !source || ready === source) return
|
|
303
|
-
const timer = setTimeout(
|
|
323
|
+
const timer = setTimeout(
|
|
324
|
+
() => setTimedOut(source),
|
|
325
|
+
loaded === source ? LOADED_READY_MS : READY_TIMEOUT_MS
|
|
326
|
+
)
|
|
304
327
|
return () => clearTimeout(timer)
|
|
305
|
-
}, [reportsFailure, source, ready])
|
|
328
|
+
}, [reportsFailure, source, ready, loaded])
|
|
306
329
|
// A link that fails for a later mount leaves a frame that has one as it is.
|
|
307
330
|
const failed =
|
|
308
331
|
reportsFailure && (source === undefined ? frame.isError : timedOut === source && !isReady)
|
|
@@ -317,6 +340,7 @@ export function ArtifactFrame({
|
|
|
317
340
|
src={source}
|
|
318
341
|
title={title}
|
|
319
342
|
loading={reportsFailure ? "eager" : "lazy"}
|
|
343
|
+
onLoad={() => setLoaded(source)}
|
|
320
344
|
className={cn(
|
|
321
345
|
"absolute inset-0 size-full border-0 bg-transparent transition-opacity duration-200 ease-out motion-reduce:transition-none",
|
|
322
346
|
shown === source ? "opacity-100" : "opacity-0"
|
|
@@ -356,10 +380,18 @@ function openWebLink(frame: HTMLIFrameElement, url: string): void {
|
|
|
356
380
|
|
|
357
381
|
const NO_QUERIES: readonly string[] = []
|
|
358
382
|
|
|
359
|
-
/**
|
|
383
|
+
/** What a frame shows: a version at one revision, which its link serves. */
|
|
384
|
+
function frameIdentity(version: ArtifactVersion): string {
|
|
385
|
+
return `${version.artifactId}@${version.version}r${version.revision}`
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* A version's frame link, shared by its frames and reused while it has most of its hour left. A
|
|
390
|
+
* link serves the revision it was minted at: an open version that changed asks for another.
|
|
391
|
+
*/
|
|
360
392
|
function frameLink(version: ArtifactVersion) {
|
|
361
393
|
return queryOptions({
|
|
362
|
-
queryKey:
|
|
394
|
+
queryKey: frameLinkKey(version),
|
|
363
395
|
queryFn: async () => {
|
|
364
396
|
const { data } = await createArtifactFrame({
|
|
365
397
|
path: { artifactId: version.artifactId, version: String(version.version) },
|
|
@@ -373,6 +405,13 @@ function frameLink(version: ArtifactVersion) {
|
|
|
373
405
|
})
|
|
374
406
|
}
|
|
375
407
|
|
|
408
|
+
/** Where a version's frame link is cached, at its revision; a test seeds it there. */
|
|
409
|
+
export function frameLinkKey(
|
|
410
|
+
version: Pick<ArtifactVersion, "artifactId" | "version" | "revision">
|
|
411
|
+
) {
|
|
412
|
+
return ["artifact-frame", version.artifactId, version.version, version.revision] as const
|
|
413
|
+
}
|
|
414
|
+
|
|
376
415
|
/** The frame's entry on the API, which may be another origin than the app's. */
|
|
377
416
|
function frameUrl(path: string, entry: string): string {
|
|
378
417
|
const base = client.getConfig().baseUrl || window.location.origin
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isSixbApiError, type ListArtifactsResponse } from "@sixb/client"
|
|
2
|
-
import {
|
|
2
|
+
import { listArtifactsInfiniteOptions } from "@sixb/client/hooks"
|
|
3
3
|
import { ARTIFACT_KINDS, type ArtifactKind } from "@sixb/core/artifacts"
|
|
4
4
|
import { ToggleGroup, ToggleGroupItem } from "@sixb/ui/components"
|
|
5
5
|
import { useLocale } from "@sixb/ui/lib/i18n"
|
|
6
6
|
import { cn } from "@sixb/ui/lib/utils"
|
|
7
|
-
import { useInfiniteQuery
|
|
7
|
+
import { useInfiniteQuery } from "@tanstack/react-query"
|
|
8
8
|
import { Layers } from "lucide-react"
|
|
9
9
|
import {
|
|
10
10
|
type ReactNode,
|
|
@@ -23,7 +23,7 @@ import { ArtifactLabel, ArtifactPreview, SlideFace } from "./card-preview"
|
|
|
23
23
|
import { ArtifactFrame } from "./frame"
|
|
24
24
|
import { ArtifactKindIcon } from "./kind-icon"
|
|
25
25
|
import { useArtifactMessages } from "./messages"
|
|
26
|
-
import { type ArtifactVersion, useArtifactTheme } from "./queries"
|
|
26
|
+
import { type ArtifactVersion, useArtifactTheme, useArtifactVersion } from "./queries"
|
|
27
27
|
import { PageScreen } from "./renderers/page"
|
|
28
28
|
import { artifactThemeAttributes } from "./theme"
|
|
29
29
|
|
|
@@ -195,14 +195,11 @@ function GalleryCard({ artifact }: { readonly artifact: ArtifactSummary }) {
|
|
|
195
195
|
const pane = useRef<HTMLDivElement | null>(null)
|
|
196
196
|
const [seen, setSeen] = useState(() => typeof IntersectionObserver === "undefined")
|
|
197
197
|
useNearScreen(pane, "400px 0px", () => setSeen(true), !seen)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}),
|
|
202
|
-
// A version never changes once published; the card reads it when it nears the screen.
|
|
198
|
+
// The card reads the latest version when it nears the screen, and again once the list knows the
|
|
199
|
+
// artifact has changed since.
|
|
200
|
+
const version = useArtifactVersion(artifact.id, artifact.latestVersion, {
|
|
203
201
|
enabled: seen,
|
|
204
|
-
|
|
205
|
-
retry: false,
|
|
202
|
+
revision: artifact.revision,
|
|
206
203
|
})
|
|
207
204
|
return (
|
|
208
205
|
<Link
|
|
@@ -244,7 +241,8 @@ function GalleryCard({ artifact }: { readonly artifact: ArtifactSummary }) {
|
|
|
244
241
|
>
|
|
245
242
|
{format.relative(artifact.updatedAt)}
|
|
246
243
|
</time>
|
|
247
|
-
{
|
|
244
|
+
{/* A created version is named; the current one changes in place, and goes unnamed. */}
|
|
245
|
+
{version.data?.frozen ? (
|
|
248
246
|
<>
|
|
249
247
|
<span aria-hidden="true">·</span>
|
|
250
248
|
<span className="shrink-0">{messages.viewer.version(artifact.latestVersion)}</span>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cn } from "@sixb/ui/lib/utils"
|
|
2
|
+
import { useArtifactMessages } from "./messages"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Beside a name a shared link's visitor typed: they have no account, so the name is only theirs to
|
|
6
|
+
* say. Everyone sees it, the guest included, so nobody takes them for a member of the same name.
|
|
7
|
+
*/
|
|
8
|
+
export function GuestBadge({ className }: { readonly className?: string }) {
|
|
9
|
+
const messages = useArtifactMessages().canvas.comments
|
|
10
|
+
return (
|
|
11
|
+
<span
|
|
12
|
+
title={messages.guestHint}
|
|
13
|
+
className={cn(
|
|
14
|
+
"inline-flex h-4 shrink-0 items-center rounded-full bg-muted px-1.5 text-[10.5px] leading-none font-medium tracking-[0.01em] text-muted-foreground ring-1 ring-border/70 ring-inset",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
>
|
|
18
|
+
{messages.guest}
|
|
19
|
+
</span>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
@@ -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
|
+
}
|