@sixb/app 0.2.1 → 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/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/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 +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/composer-insertion.d.ts +24 -0
- package/dist/agent/composer-insertion.d.ts.map +1 -0
- 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 +10 -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 +14 -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 +20 -0
- package/dist/agent/i18n/index.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/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-ytadd0b5.js → chunk-001c4gnk.js} +6871 -3756
- 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-j8g956dt.js → chunk-fwb9mxwm.js} +1 -1
- package/dist/{chunk-7fj9cfkw.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/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/agent-chat.tsx +51 -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/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 +3 -2
- package/src/agent/components/message-parts.tsx +6 -1
- package/src/agent/components/thread-artifacts-menu.tsx +22 -5
- package/src/agent/composer-insertion.ts +36 -0
- package/src/agent/hooks/use-agent-conversation.ts +41 -10
- package/src/agent/hooks/use-new-thread-place.ts +149 -25
- package/src/agent/i18n/en.ts +14 -0
- package/src/agent/i18n/fr.ts +12 -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 +3 -0
- package/src/agent/types.ts +4 -0
- 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/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-j8g956dt.js.map → chunk-fwb9mxwm.js.map} +0 -0
- /package/dist/{chunk-7fj9cfkw.js.map → chunk-kes4ygmz.js.map} +0 -0
- /package/dist/{chunk-kwbw4dyk.js.map → chunk-ryed2jq8.js.map} +0 -0
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picks an artifact for a `ref.artifact()` value. The value stays the artifact's id, so the forms
|
|
3
|
+
* that parse it work as they do for a member's id.
|
|
4
|
+
*
|
|
5
|
+
* It lists the artifacts the reader can open, as the gallery does: their own and those a
|
|
6
|
+
* conversation they read shares, most recently updated first. A link to an artifact pasted in the
|
|
7
|
+
* search offers that one, so an artifact found elsewhere is one paste away. A property takes only
|
|
8
|
+
* an artifact its writer can change: one the reader can only read is shown, and why, not offered.
|
|
9
|
+
*/
|
|
10
|
+
import type { GetArtifactResponse, ListArtifactsResponse } from "@sixb/client"
|
|
11
|
+
import { getArtifactOptions, listArtifactsInfiniteOptions } from "@sixb/client/hooks"
|
|
12
|
+
import {
|
|
13
|
+
Button,
|
|
14
|
+
Command,
|
|
15
|
+
CommandGroup,
|
|
16
|
+
CommandInput,
|
|
17
|
+
CommandItem,
|
|
18
|
+
CommandList,
|
|
19
|
+
Drawer,
|
|
20
|
+
DrawerContent,
|
|
21
|
+
DrawerDescription,
|
|
22
|
+
DrawerTitle,
|
|
23
|
+
Popover,
|
|
24
|
+
PopoverContent,
|
|
25
|
+
PopoverTrigger,
|
|
26
|
+
} from "@sixb/ui/components"
|
|
27
|
+
import { useIsMobile } from "@sixb/ui/hooks"
|
|
28
|
+
import { cn } from "@sixb/ui/lib/utils"
|
|
29
|
+
import { useInfiniteQuery, useQuery } from "@tanstack/react-query"
|
|
30
|
+
import { Check, ChevronsUpDown, FileX, Layers, Lock, TriangleAlert, X } from "lucide-react"
|
|
31
|
+
import { type ReactNode, type UIEvent, useEffect, useMemo, useRef, useState } from "react"
|
|
32
|
+
import { type HeldArtifactProblem, heldArtifactProblem } from "../../../../artifacts/held-artifact"
|
|
33
|
+
import { ArtifactKindIcon } from "../../../../artifacts/kind-icon"
|
|
34
|
+
import { useArtifactMessages } from "../../../../artifacts/messages"
|
|
35
|
+
import { useFormat } from "../../../section-ui"
|
|
36
|
+
|
|
37
|
+
type ArtifactSummary = ListArtifactsResponse["artifacts"][number] | GetArtifactResponse["artifact"]
|
|
38
|
+
|
|
39
|
+
const PAGE_SIZE = 50
|
|
40
|
+
|
|
41
|
+
/** A search reads at most this many pages of the list, so it ends on a project with many. */
|
|
42
|
+
const SEARCH_PAGES = 10
|
|
43
|
+
|
|
44
|
+
/** How near the end of the list a scroll loads more. */
|
|
45
|
+
const LOAD_MORE_THRESHOLD_PX = 80
|
|
46
|
+
|
|
47
|
+
// An artifact's page, a conversation with it open beside, or its id alone.
|
|
48
|
+
const ARTIFACT_IN_TEXT = /(?:^|\/artifacts\/|[?&]artifact=)(art_[0-9a-z]{10})(?=$|[/?#&\s])/
|
|
49
|
+
|
|
50
|
+
/** The artifact a pasted link or id names, such as `https://…/artifacts/art_k3m9q2x7tp?v=2`. */
|
|
51
|
+
export function artifactIdIn(text: string): string | null {
|
|
52
|
+
return ARTIFACT_IN_TEXT.exec(text.trim())?.[1] ?? null
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Whether a title holds every word of a search, ignoring case and accents. */
|
|
56
|
+
export function titleMatches(title: string, search: string): boolean {
|
|
57
|
+
const folded = fold(title)
|
|
58
|
+
return fold(search)
|
|
59
|
+
.split(/\s+/)
|
|
60
|
+
.filter(Boolean)
|
|
61
|
+
.every((word) => folded.includes(word))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function fold(text: string): string {
|
|
65
|
+
return text
|
|
66
|
+
.toLocaleLowerCase()
|
|
67
|
+
.normalize("NFD")
|
|
68
|
+
.replace(/\p{Diacritic}/gu, "")
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function ArtifactPicker({
|
|
72
|
+
id,
|
|
73
|
+
value,
|
|
74
|
+
onChange,
|
|
75
|
+
disabled,
|
|
76
|
+
required,
|
|
77
|
+
"aria-describedby": ariaDescribedBy,
|
|
78
|
+
}: {
|
|
79
|
+
readonly id: string
|
|
80
|
+
/** The chosen artifact's id, or "" for none. */
|
|
81
|
+
readonly value: string
|
|
82
|
+
readonly onChange: (artifactId: string) => void
|
|
83
|
+
readonly disabled?: boolean
|
|
84
|
+
readonly required?: boolean
|
|
85
|
+
readonly "aria-describedby"?: string
|
|
86
|
+
}) {
|
|
87
|
+
const messages = useArtifactMessages().picker
|
|
88
|
+
const mobile = useIsMobile()
|
|
89
|
+
const [open, setOpen] = useState(false)
|
|
90
|
+
const triggerRef = useRef<HTMLButtonElement | null>(null)
|
|
91
|
+
|
|
92
|
+
// A value set before the list loaded, or one it does not hold, is named by its own lookup.
|
|
93
|
+
const chosenId = value.trim()
|
|
94
|
+
const chosen = useQuery({
|
|
95
|
+
...getArtifactOptions({ path: { artifactId: chosenId } }),
|
|
96
|
+
enabled: chosenId !== "",
|
|
97
|
+
retry: false,
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const choose = (artifactId: string) => {
|
|
101
|
+
onChange(artifactId)
|
|
102
|
+
setOpen(false)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const clearable = chosenId !== "" && !disabled
|
|
106
|
+
|
|
107
|
+
const trigger = (
|
|
108
|
+
<Button
|
|
109
|
+
type="button"
|
|
110
|
+
variant="outline"
|
|
111
|
+
id={id}
|
|
112
|
+
ref={triggerRef}
|
|
113
|
+
role="combobox"
|
|
114
|
+
aria-expanded={open}
|
|
115
|
+
aria-describedby={ariaDescribedBy}
|
|
116
|
+
aria-required={required || undefined}
|
|
117
|
+
disabled={disabled}
|
|
118
|
+
onClick={mobile ? () => setOpen(true) : undefined}
|
|
119
|
+
className={cn(
|
|
120
|
+
"w-full justify-between gap-2 bg-background font-normal",
|
|
121
|
+
clearable ? "pr-[3.25rem]" : "pr-3"
|
|
122
|
+
)}
|
|
123
|
+
>
|
|
124
|
+
<ChosenLabel
|
|
125
|
+
artifact={chosen.data?.artifact}
|
|
126
|
+
loading={chosen.isLoading}
|
|
127
|
+
problem={chosenId !== "" && chosen.isError ? heldArtifactProblem(chosen.error) : null}
|
|
128
|
+
/>
|
|
129
|
+
<ChevronsUpDown className="size-4 shrink-0 opacity-50" aria-hidden="true" />
|
|
130
|
+
</Button>
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
// Clearing sits over the trigger rather than in it: a button cannot hold another.
|
|
134
|
+
const clear = clearable ? (
|
|
135
|
+
<button
|
|
136
|
+
type="button"
|
|
137
|
+
onClick={() => {
|
|
138
|
+
onChange("")
|
|
139
|
+
triggerRef.current?.focus()
|
|
140
|
+
}}
|
|
141
|
+
aria-label={messages.clear}
|
|
142
|
+
title={messages.clear}
|
|
143
|
+
className="absolute top-1/2 right-8 flex size-6 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
|
|
144
|
+
>
|
|
145
|
+
<X className="size-3.5" aria-hidden="true" />
|
|
146
|
+
</button>
|
|
147
|
+
) : null
|
|
148
|
+
|
|
149
|
+
const list = (
|
|
150
|
+
<ArtifactPickerList chosenId={chosenId} chosen={chosen.data?.artifact} onChoose={choose} />
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
if (mobile) {
|
|
154
|
+
return (
|
|
155
|
+
<div className="relative">
|
|
156
|
+
{trigger}
|
|
157
|
+
{clear}
|
|
158
|
+
<Drawer open={open} onOpenChange={setOpen}>
|
|
159
|
+
<DrawerContent className="max-h-[85dvh]">
|
|
160
|
+
<DrawerTitle className="px-4 pt-3 pb-2 text-[15px] font-semibold">
|
|
161
|
+
{messages.title}
|
|
162
|
+
</DrawerTitle>
|
|
163
|
+
<DrawerDescription className="sr-only">{messages.search}</DrawerDescription>
|
|
164
|
+
<div className="flex min-h-0 flex-1 flex-col px-2 pb-[max(0.75rem,env(safe-area-inset-bottom))]">
|
|
165
|
+
{open ? list : null}
|
|
166
|
+
</div>
|
|
167
|
+
</DrawerContent>
|
|
168
|
+
</Drawer>
|
|
169
|
+
</div>
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Inside a dialog, the list renders there, so the dialog keeps the focus and the clicks.
|
|
174
|
+
const container = triggerRef.current?.closest<HTMLElement>("[data-slot='dialog-content']")
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<div className="relative">
|
|
178
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
179
|
+
<PopoverTrigger asChild>{trigger}</PopoverTrigger>
|
|
180
|
+
<PopoverContent
|
|
181
|
+
container={container}
|
|
182
|
+
align="start"
|
|
183
|
+
collisionPadding={12}
|
|
184
|
+
aria-label={messages.title}
|
|
185
|
+
className="w-[max(var(--radix-popover-trigger-width),22rem)] max-w-[calc(100vw-1.5rem)] overflow-hidden p-0"
|
|
186
|
+
>
|
|
187
|
+
{list}
|
|
188
|
+
</PopoverContent>
|
|
189
|
+
</Popover>
|
|
190
|
+
{clear}
|
|
191
|
+
</div>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** What the trigger says: the chosen artifact, why it cannot be named, or what to do. */
|
|
196
|
+
function ChosenLabel({
|
|
197
|
+
artifact,
|
|
198
|
+
loading,
|
|
199
|
+
problem,
|
|
200
|
+
}: {
|
|
201
|
+
readonly artifact: ArtifactSummary | undefined
|
|
202
|
+
readonly loading: boolean
|
|
203
|
+
readonly problem: HeldArtifactProblem | null
|
|
204
|
+
}) {
|
|
205
|
+
const messages = useArtifactMessages()
|
|
206
|
+
|
|
207
|
+
if (artifact) {
|
|
208
|
+
return (
|
|
209
|
+
<span className="flex min-w-0 items-center gap-2">
|
|
210
|
+
<ArtifactKindIcon kind={artifact.kind} className="size-4 shrink-0 text-muted-foreground" />
|
|
211
|
+
<span className="truncate">{artifact.title}</span>
|
|
212
|
+
</span>
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (loading) {
|
|
217
|
+
return <span className="h-3 w-32 animate-pulse rounded bg-muted motion-reduce:animate-none" />
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (problem) {
|
|
221
|
+
const Icon = problem === "notShared" ? Lock : FileX
|
|
222
|
+
return (
|
|
223
|
+
<span className="flex min-w-0 items-center gap-2 text-muted-foreground">
|
|
224
|
+
<Icon className="size-4 shrink-0" aria-hidden="true" />
|
|
225
|
+
<span className="truncate">
|
|
226
|
+
{problem === "gone"
|
|
227
|
+
? messages.held.gone
|
|
228
|
+
: problem === "notShared"
|
|
229
|
+
? messages.held.notShared
|
|
230
|
+
: messages.held.loadFailed}
|
|
231
|
+
</span>
|
|
232
|
+
</span>
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return <span className="truncate text-muted-foreground">{messages.picker.choose}</span>
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* The search and the artifacts under it: the chosen one first, then the others most recently
|
|
241
|
+
* updated first, or the one a pasted link names. More load as the list scrolls to its end, and a
|
|
242
|
+
* search reads further until it has found what the list holds.
|
|
243
|
+
*/
|
|
244
|
+
export function ArtifactPickerList({
|
|
245
|
+
chosenId,
|
|
246
|
+
chosen,
|
|
247
|
+
onChoose,
|
|
248
|
+
}: {
|
|
249
|
+
readonly chosenId: string
|
|
250
|
+
readonly chosen: ArtifactSummary | undefined
|
|
251
|
+
readonly onChoose: (artifactId: string) => void
|
|
252
|
+
}) {
|
|
253
|
+
const messages = useArtifactMessages().picker
|
|
254
|
+
const [search, setSearch] = useState("")
|
|
255
|
+
const linkedId = artifactIdIn(search)
|
|
256
|
+
const searching = search.trim() !== "" && linkedId === null
|
|
257
|
+
|
|
258
|
+
const list = useInfiniteQuery({
|
|
259
|
+
...listArtifactsInfiniteOptions({ query: { limit: String(PAGE_SIZE) } }),
|
|
260
|
+
// The next page's offset, as the query carries it.
|
|
261
|
+
initialPageParam: "0",
|
|
262
|
+
getNextPageParam: (last: ListArtifactsResponse, pages: readonly ListArtifactsResponse[]) =>
|
|
263
|
+
last.hasMore ? String(pages.length * PAGE_SIZE) : undefined,
|
|
264
|
+
retry: false,
|
|
265
|
+
})
|
|
266
|
+
const linked = useQuery({
|
|
267
|
+
...getArtifactOptions({ path: { artifactId: linkedId ?? "" } }),
|
|
268
|
+
enabled: linkedId !== null,
|
|
269
|
+
retry: false,
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
// An artifact updated while the list is read moves up, and can be on two pages: it shows once.
|
|
273
|
+
const artifacts = useMemo(() => {
|
|
274
|
+
const byId = new Map<string, ArtifactSummary>()
|
|
275
|
+
for (const artifact of list.data?.pages.flatMap((page) => page.artifacts) ?? []) {
|
|
276
|
+
if (!byId.has(artifact.id)) byId.set(artifact.id, artifact)
|
|
277
|
+
}
|
|
278
|
+
return [...byId.values()]
|
|
279
|
+
}, [list.data])
|
|
280
|
+
|
|
281
|
+
const shown = searching
|
|
282
|
+
? artifacts.filter((artifact) => titleMatches(artifact.title, search))
|
|
283
|
+
: artifacts.filter((artifact) => artifact.id !== chosenId)
|
|
284
|
+
|
|
285
|
+
const pages = list.data?.pages.length ?? 0
|
|
286
|
+
const { hasNextPage, isFetchingNextPage, fetchNextPage } = list
|
|
287
|
+
const readFurther = searching && hasNextPage && !isFetchingNextPage && pages < SEARCH_PAGES
|
|
288
|
+
useEffect(() => {
|
|
289
|
+
if (readFurther) void fetchNextPage()
|
|
290
|
+
}, [readFurther, fetchNextPage])
|
|
291
|
+
|
|
292
|
+
const loadMoreNearEnd = (event: UIEvent<HTMLDivElement>) => {
|
|
293
|
+
const element = event.currentTarget
|
|
294
|
+
const nearEnd =
|
|
295
|
+
element.scrollHeight - element.scrollTop - element.clientHeight <= LOAD_MORE_THRESHOLD_PX
|
|
296
|
+
if (nearEnd && !searching && hasNextPage && !isFetchingNextPage) void fetchNextPage()
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const body = (): ReactNode => {
|
|
300
|
+
if (linkedId !== null) {
|
|
301
|
+
return (
|
|
302
|
+
<CommandGroup heading={messages.fromLink}>
|
|
303
|
+
{linked.data?.access === "read" ? (
|
|
304
|
+
<ReadOnlyRow artifact={linked.data.artifact} />
|
|
305
|
+
) : linked.data ? (
|
|
306
|
+
<ArtifactRow
|
|
307
|
+
artifact={linked.data.artifact}
|
|
308
|
+
chosen={linked.data.artifact.id === chosenId}
|
|
309
|
+
onChoose={onChoose}
|
|
310
|
+
/>
|
|
311
|
+
) : linked.isLoading ? (
|
|
312
|
+
<RowSkeletons count={1} />
|
|
313
|
+
) : (
|
|
314
|
+
<Notice icon={FileX} title={messages.linkUnavailable} />
|
|
315
|
+
)}
|
|
316
|
+
</CommandGroup>
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (list.isPending) return <RowSkeletons count={4} />
|
|
321
|
+
|
|
322
|
+
if (list.isError) {
|
|
323
|
+
return (
|
|
324
|
+
<Notice
|
|
325
|
+
icon={TriangleAlert}
|
|
326
|
+
title={messages.loadFailed}
|
|
327
|
+
action={{ label: messages.retry, onClick: () => void list.refetch() }}
|
|
328
|
+
/>
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (artifacts.length === 0) {
|
|
333
|
+
return <Notice icon={Layers} title={messages.none} description={messages.noneDescription} />
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const chosenRow =
|
|
337
|
+
!searching && chosen ? (
|
|
338
|
+
<CommandGroup heading={messages.chosen}>
|
|
339
|
+
<ArtifactRow artifact={chosen} chosen onChoose={onChoose} />
|
|
340
|
+
</CommandGroup>
|
|
341
|
+
) : null
|
|
342
|
+
|
|
343
|
+
if (shown.length === 0) {
|
|
344
|
+
return (
|
|
345
|
+
<>
|
|
346
|
+
{chosenRow}
|
|
347
|
+
{searching ? (
|
|
348
|
+
readFurther || isFetchingNextPage ? (
|
|
349
|
+
<RowSkeletons count={2} />
|
|
350
|
+
) : (
|
|
351
|
+
<Notice icon={Layers} title={messages.noMatch} />
|
|
352
|
+
)
|
|
353
|
+
) : null}
|
|
354
|
+
</>
|
|
355
|
+
)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return (
|
|
359
|
+
<>
|
|
360
|
+
{chosenRow}
|
|
361
|
+
<CommandGroup heading={searching ? undefined : messages.recent}>
|
|
362
|
+
{shown.map((artifact) => (
|
|
363
|
+
<ArtifactRow
|
|
364
|
+
key={artifact.id}
|
|
365
|
+
artifact={artifact}
|
|
366
|
+
chosen={artifact.id === chosenId}
|
|
367
|
+
onChoose={onChoose}
|
|
368
|
+
/>
|
|
369
|
+
))}
|
|
370
|
+
</CommandGroup>
|
|
371
|
+
{isFetchingNextPage ? <RowSkeletons count={2} /> : null}
|
|
372
|
+
</>
|
|
373
|
+
)
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return (
|
|
377
|
+
// The list is searched here, by title, and a pasted link is never a title to filter by.
|
|
378
|
+
<Command shouldFilter={false} loop className="bg-transparent">
|
|
379
|
+
<CommandInput value={search} onValueChange={setSearch} placeholder={messages.search} />
|
|
380
|
+
<CommandList
|
|
381
|
+
onScroll={loadMoreNearEnd}
|
|
382
|
+
// About six rows beside a field; a phone's sheet gives it more.
|
|
383
|
+
className="max-h-[min(22rem,60dvh)] overscroll-contain p-1 md:max-h-[min(19.5rem,45dvh)]"
|
|
384
|
+
>
|
|
385
|
+
{body()}
|
|
386
|
+
</CommandList>
|
|
387
|
+
</Command>
|
|
388
|
+
)
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** One artifact to choose: its kind, its title, and when it last changed. */
|
|
392
|
+
function ArtifactRow({
|
|
393
|
+
artifact,
|
|
394
|
+
chosen,
|
|
395
|
+
onChoose,
|
|
396
|
+
}: {
|
|
397
|
+
readonly artifact: ArtifactSummary
|
|
398
|
+
readonly chosen: boolean
|
|
399
|
+
readonly onChoose: (artifactId: string) => void
|
|
400
|
+
}) {
|
|
401
|
+
const messages = useArtifactMessages()
|
|
402
|
+
const format = useFormat()
|
|
403
|
+
|
|
404
|
+
return (
|
|
405
|
+
<CommandItem
|
|
406
|
+
value={artifact.id}
|
|
407
|
+
onSelect={() => onChoose(artifact.id)}
|
|
408
|
+
className="gap-3 rounded-lg px-2 py-1.5"
|
|
409
|
+
>
|
|
410
|
+
<KindTile kind={artifact.kind} />
|
|
411
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
412
|
+
<span className="truncate text-[13.5px] leading-snug font-medium text-foreground">
|
|
413
|
+
{artifact.title}
|
|
414
|
+
</span>
|
|
415
|
+
<span className="truncate text-xs leading-snug text-muted-foreground">
|
|
416
|
+
{messages.kinds[artifact.kind]} ·{" "}
|
|
417
|
+
{messages.picker.updated(format.relative(artifact.updatedAt))}
|
|
418
|
+
</span>
|
|
419
|
+
</span>
|
|
420
|
+
<Check
|
|
421
|
+
className={cn("size-4 text-foreground", chosen ? "opacity-100" : "opacity-0")}
|
|
422
|
+
aria-hidden="true"
|
|
423
|
+
/>
|
|
424
|
+
</CommandItem>
|
|
425
|
+
)
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* An artifact a pasted link names that the reader can read but not change: shown, so they know the
|
|
430
|
+
* link worked, with why it cannot be chosen and what to do. Not an option, so keys pass it by.
|
|
431
|
+
*/
|
|
432
|
+
function ReadOnlyRow({ artifact }: { readonly artifact: ArtifactSummary }) {
|
|
433
|
+
const messages = useArtifactMessages().picker
|
|
434
|
+
|
|
435
|
+
return (
|
|
436
|
+
<div role="status" className="flex items-start gap-3 rounded-lg px-2 py-1.5">
|
|
437
|
+
<KindTile kind={artifact.kind} muted />
|
|
438
|
+
<span className="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
439
|
+
<span className="truncate text-[13.5px] leading-snug font-medium text-foreground/70">
|
|
440
|
+
{artifact.title}
|
|
441
|
+
</span>
|
|
442
|
+
<span className="flex items-center gap-1.5 text-xs leading-snug text-muted-foreground">
|
|
443
|
+
<Lock className="size-3 shrink-0" aria-hidden="true" />
|
|
444
|
+
{messages.readOnly}
|
|
445
|
+
</span>
|
|
446
|
+
<span className="text-xs leading-snug text-muted-foreground/80">
|
|
447
|
+
{messages.readOnlyHint}
|
|
448
|
+
</span>
|
|
449
|
+
</span>
|
|
450
|
+
</div>
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/** An artifact's kind as a row leads with it. */
|
|
455
|
+
function KindTile({
|
|
456
|
+
kind,
|
|
457
|
+
muted = false,
|
|
458
|
+
}: {
|
|
459
|
+
readonly kind: ArtifactSummary["kind"]
|
|
460
|
+
readonly muted?: boolean
|
|
461
|
+
}) {
|
|
462
|
+
return (
|
|
463
|
+
<span
|
|
464
|
+
className={cn(
|
|
465
|
+
"flex size-8 shrink-0 items-center justify-center rounded-lg bg-card shadow-[0_1px_1px_rgb(0_0_0/0.04)] ring-1 ring-border/80 ring-inset",
|
|
466
|
+
muted ? "text-muted-foreground" : "text-foreground/75"
|
|
467
|
+
)}
|
|
468
|
+
>
|
|
469
|
+
<ArtifactKindIcon kind={kind} className="size-[15px]" />
|
|
470
|
+
</span>
|
|
471
|
+
)
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function RowSkeletons({ count }: { readonly count: number }) {
|
|
475
|
+
return (
|
|
476
|
+
<div aria-hidden="true" className="flex flex-col">
|
|
477
|
+
{Array.from({ length: count }, (_, index) => (
|
|
478
|
+
<div key={index} className="flex items-center gap-3 px-2 py-1.5">
|
|
479
|
+
<span className="size-8 shrink-0 animate-pulse rounded-lg bg-muted motion-reduce:animate-none" />
|
|
480
|
+
<span className="flex min-w-0 flex-1 flex-col gap-1.5">
|
|
481
|
+
<span className="h-3 w-1/2 rounded bg-muted" />
|
|
482
|
+
<span className="h-2.5 w-1/3 rounded bg-muted/70" />
|
|
483
|
+
</span>
|
|
484
|
+
</div>
|
|
485
|
+
))}
|
|
486
|
+
</div>
|
|
487
|
+
)
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/** A line in the list's place: nothing to show, nothing found, or a failure to try again. */
|
|
491
|
+
function Notice({
|
|
492
|
+
icon: Icon,
|
|
493
|
+
title,
|
|
494
|
+
description,
|
|
495
|
+
action,
|
|
496
|
+
}: {
|
|
497
|
+
readonly icon: typeof Layers
|
|
498
|
+
readonly title: string
|
|
499
|
+
readonly description?: string
|
|
500
|
+
readonly action?: { readonly label: string; readonly onClick: () => void }
|
|
501
|
+
}) {
|
|
502
|
+
return (
|
|
503
|
+
<div role="status" className="flex flex-col items-center gap-2 px-4 py-7 text-center">
|
|
504
|
+
<span className="flex size-9 items-center justify-center rounded-full bg-muted text-muted-foreground">
|
|
505
|
+
<Icon className="size-4" aria-hidden="true" />
|
|
506
|
+
</span>
|
|
507
|
+
<p className="text-[13.5px] font-medium text-foreground">{title}</p>
|
|
508
|
+
{description ? (
|
|
509
|
+
<p className="max-w-[30ch] text-xs text-muted-foreground">{description}</p>
|
|
510
|
+
) : null}
|
|
511
|
+
{action ? (
|
|
512
|
+
<button
|
|
513
|
+
type="button"
|
|
514
|
+
onClick={action.onClick}
|
|
515
|
+
className="mt-1 rounded-full border border-border px-3 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring"
|
|
516
|
+
>
|
|
517
|
+
{action.label}
|
|
518
|
+
</button>
|
|
519
|
+
) : null}
|
|
520
|
+
</div>
|
|
521
|
+
)
|
|
522
|
+
}
|
|
@@ -2,6 +2,8 @@ import type { ObjectQueryFacetResult } from "@sixb/client"
|
|
|
2
2
|
import { Alert, AlertDescription, Badge, Button } from "@sixb/ui/components"
|
|
3
3
|
import { cn } from "@sixb/ui/lib/utils"
|
|
4
4
|
import { AlertCircle, X } from "lucide-react"
|
|
5
|
+
import type { ReactNode } from "react"
|
|
6
|
+
import { SkeletonBlock } from "../../skeletons"
|
|
5
7
|
import { formatCount, formatValue } from "../lib/format-value"
|
|
6
8
|
import {
|
|
7
9
|
createFilterId,
|
|
@@ -125,16 +127,19 @@ function FacetSuggestions({
|
|
|
125
127
|
.slice(0, 8)
|
|
126
128
|
|
|
127
129
|
if (loading && suggestions.length === 0) {
|
|
128
|
-
return
|
|
130
|
+
return (
|
|
131
|
+
<FacetSuggestionsRow>
|
|
132
|
+
{["w-28", "w-24", "w-32"].map((width) => (
|
|
133
|
+
<SkeletonBlock key={width} className={cn("h-7 rounded-full", width)} />
|
|
134
|
+
))}
|
|
135
|
+
</FacetSuggestionsRow>
|
|
136
|
+
)
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
if (suggestions.length === 0) return null
|
|
132
140
|
|
|
133
141
|
return (
|
|
134
|
-
<
|
|
135
|
-
<span className="mr-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">
|
|
136
|
-
Try
|
|
137
|
-
</span>
|
|
142
|
+
<FacetSuggestionsRow>
|
|
138
143
|
{suggestions.map(({ property, bucket }) => {
|
|
139
144
|
return (
|
|
140
145
|
<button
|
|
@@ -161,6 +166,17 @@ function FacetSuggestions({
|
|
|
161
166
|
</button>
|
|
162
167
|
)
|
|
163
168
|
})}
|
|
169
|
+
</FacetSuggestionsRow>
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function FacetSuggestionsRow({ children }: { children: ReactNode }) {
|
|
174
|
+
return (
|
|
175
|
+
<div className="flex flex-wrap items-center gap-1.5 pt-1">
|
|
176
|
+
<span className="mr-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">
|
|
177
|
+
Try
|
|
178
|
+
</span>
|
|
179
|
+
{children}
|
|
164
180
|
</div>
|
|
165
181
|
)
|
|
166
182
|
}
|
|
@@ -28,6 +28,7 @@ export type ActionParamInputDescriptor =
|
|
|
28
28
|
| { kind: "boolean" }
|
|
29
29
|
| { kind: "fileRef" }
|
|
30
30
|
| { kind: "userRef" }
|
|
31
|
+
| { kind: "artifactRef" }
|
|
31
32
|
| { kind: "json" }
|
|
32
33
|
| { kind: "enum"; values: readonly unknown[]; valueType: "string" | "integer" }
|
|
33
34
|
| { kind: "objectRef"; objectTypeId: string }
|
|
@@ -119,6 +120,7 @@ export function describeActionParamInput(schema: unknown): ActionParamInputDescr
|
|
|
119
120
|
return { kind: "fileRef" }
|
|
120
121
|
}
|
|
121
122
|
if (resolved === "userRef") return { kind: "userRef" }
|
|
123
|
+
if (resolved === "artifactRef") return { kind: "artifactRef" }
|
|
122
124
|
if (isRecord(resolved)) {
|
|
123
125
|
if (resolved.type === "objectRef" && typeof resolved.objectTypeId === "string") {
|
|
124
126
|
return { kind: "objectRef", objectTypeId: resolved.objectTypeId }
|
|
@@ -157,6 +159,7 @@ function parseObjectActionParamValue(param: ObjectActionParam, rawValue: string)
|
|
|
157
159
|
return fileRef
|
|
158
160
|
}
|
|
159
161
|
if (param.type === "userRef") return userRefFromId(rawValue)
|
|
162
|
+
if (param.type === "artifactRef") return artifactRefFromId(rawValue)
|
|
160
163
|
return rawValue
|
|
161
164
|
}
|
|
162
165
|
|
|
@@ -198,6 +201,8 @@ function parseActionParamValue(param: ActionParam, rawValue: string): unknown {
|
|
|
198
201
|
return { objectTypeId: input.objectTypeId, primaryId: rawValue }
|
|
199
202
|
case "userRef":
|
|
200
203
|
return userRefFromId(rawValue)
|
|
204
|
+
case "artifactRef":
|
|
205
|
+
return artifactRefFromId(rawValue)
|
|
201
206
|
case "text":
|
|
202
207
|
return rawValue
|
|
203
208
|
}
|
|
@@ -208,6 +213,11 @@ function userRefFromId(id: string): { type: "user"; id: string } {
|
|
|
208
213
|
return { type: "user", id }
|
|
209
214
|
}
|
|
210
215
|
|
|
216
|
+
/** The form holds an artifact id, as the picker chose it; the request carries the reference. */
|
|
217
|
+
function artifactRefFromId(id: string): { type: "artifact"; id: string } {
|
|
218
|
+
return { type: "artifact", id }
|
|
219
|
+
}
|
|
220
|
+
|
|
211
221
|
function parseIntegerEnumValue(rawValue: string, values: readonly unknown[]): number {
|
|
212
222
|
const value = Number(rawValue)
|
|
213
223
|
if (!Number.isInteger(value)) {
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { TooltipProvider } from "@sixb/ui/components"
|
|
2
2
|
import { useEffect, useRef, useState } from "react"
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ArtifactCardsContext,
|
|
5
|
+
type FileLinksAt,
|
|
6
|
+
ValuePanel,
|
|
7
|
+
type ValueSchema,
|
|
8
|
+
} from "../../../values"
|
|
4
9
|
import { explainProperty, type ObjectLineage } from "./model"
|
|
5
10
|
import { PropertySourceLabel } from "./property-source"
|
|
6
11
|
import { ValueLineagePanel } from "./value-lineage-panel"
|
|
7
12
|
|
|
8
13
|
/**
|
|
9
14
|
* An object's properties, each name marked with where its value comes from and opening the trail
|
|
10
|
-
* behind it. Until the lineage arrives, and for the primary key, names read as plain labels.
|
|
15
|
+
* behind it. Until the lineage arrives, and for the primary key, names read as plain labels. An
|
|
16
|
+
* artifact a property holds shows as a card that opens it.
|
|
11
17
|
*/
|
|
12
18
|
export function PropertiesPanel({
|
|
13
19
|
title,
|
|
@@ -45,29 +51,31 @@ export function PropertiesPanel({
|
|
|
45
51
|
return (
|
|
46
52
|
<>
|
|
47
53
|
<TooltipProvider delayDuration={400}>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
<ArtifactCardsContext.Provider value={true}>
|
|
55
|
+
<ValuePanel
|
|
56
|
+
title={title}
|
|
57
|
+
value={properties}
|
|
58
|
+
schema={schema}
|
|
59
|
+
labels={labels}
|
|
60
|
+
fileLinks={fileLinks}
|
|
61
|
+
renderLabel={(key, text) => {
|
|
62
|
+
const property = explainProperty(lineage, key)
|
|
63
|
+
if (!property) return text
|
|
57
64
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
return (
|
|
66
|
+
<PropertySourceLabel
|
|
67
|
+
label={text}
|
|
68
|
+
explained={property}
|
|
69
|
+
onOpen={(event) => {
|
|
70
|
+
opener.current = event.currentTarget
|
|
71
|
+
setPropertyId(key)
|
|
72
|
+
setOpen(true)
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
78
|
+
</ArtifactCardsContext.Provider>
|
|
71
79
|
</TooltipProvider>
|
|
72
80
|
|
|
73
81
|
{lineage ? (
|