@sixb/app 0.2.0 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/connector-icons/README.md +1 -0
- package/assets/connector-icons/fleetio.ico +0 -0
- package/dist/agent/activity-label.d.ts.map +1 -1
- package/dist/agent/agent-chat.d.ts +9 -2
- package/dist/agent/agent-chat.d.ts.map +1 -1
- package/dist/agent/agent-panel.d.ts +9 -1
- package/dist/agent/agent-panel.d.ts.map +1 -1
- package/dist/agent/agent-surface.d.ts.map +1 -1
- package/dist/agent/artifact-card.d.ts +3 -1
- package/dist/agent/artifact-card.d.ts.map +1 -1
- package/dist/agent/artifact-panel.d.ts +7 -1
- package/dist/agent/artifact-panel.d.ts.map +1 -1
- package/dist/agent/background/background-card.d.ts +10 -0
- package/dist/agent/background/background-card.d.ts.map +1 -0
- package/dist/agent/background/background-tool-row.d.ts +9 -0
- package/dist/agent/background/background-tool-row.d.ts.map +1 -0
- package/dist/agent/background/context.d.ts +23 -0
- package/dist/agent/background/context.d.ts.map +1 -0
- package/dist/agent/background/interpret.d.ts +116 -0
- package/dist/agent/background/interpret.d.ts.map +1 -0
- package/dist/agent/bash/bash-tool-view.d.ts.map +1 -1
- package/dist/agent/bash/interpret.d.ts +4 -0
- package/dist/agent/bash/interpret.d.ts.map +1 -1
- package/dist/agent/components/composer-menu.d.ts +3 -1
- package/dist/agent/components/composer-menu.d.ts.map +1 -1
- package/dist/agent/components/composer-place.d.ts +13 -0
- package/dist/agent/components/composer-place.d.ts.map +1 -0
- package/dist/agent/components/composer.d.ts +23 -1
- package/dist/agent/components/composer.d.ts.map +1 -1
- package/dist/agent/components/computer-place.d.ts +3 -1
- package/dist/agent/components/computer-place.d.ts.map +1 -1
- package/dist/agent/components/context-chips.d.ts.map +1 -1
- package/dist/agent/components/context-meter.d.ts +1 -1
- package/dist/agent/components/conversation-panel.d.ts +3 -1
- package/dist/agent/components/conversation-panel.d.ts.map +1 -1
- package/dist/agent/components/message-parts.d.ts +3 -1
- package/dist/agent/components/message-parts.d.ts.map +1 -1
- package/dist/agent/components/thread-artifacts-menu.d.ts.map +1 -1
- package/dist/agent/components/transcript.d.ts +6 -0
- package/dist/agent/components/transcript.d.ts.map +1 -1
- package/dist/agent/components/web-fetch-tool-view.d.ts.map +1 -1
- package/dist/agent/composer-insertion.d.ts +24 -0
- package/dist/agent/composer-insertion.d.ts.map +1 -0
- package/dist/agent/delegation/child-parts.d.ts +2 -0
- package/dist/agent/delegation/child-parts.d.ts.map +1 -1
- package/dist/agent/delegation/use-children.d.ts +5 -5
- package/dist/agent/delegation/use-children.d.ts.map +1 -1
- package/dist/agent/hooks/use-agent-conversation.d.ts +24 -4
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-new-thread-place.d.ts +70 -0
- package/dist/agent/hooks/use-new-thread-place.d.ts.map +1 -0
- package/dist/agent/hooks/use-thread-lists.d.ts +40 -0
- package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +74 -0
- package/dist/agent/i18n/en.d.ts.map +1 -1
- package/dist/agent/i18n/fr.d.ts.map +1 -1
- package/dist/agent/i18n/index.d.ts +126 -0
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/observed-conversation.d.ts.map +1 -1
- package/dist/agent/publish-artifact/interpret.d.ts +8 -2
- package/dist/agent/publish-artifact/interpret.d.ts.map +1 -1
- package/dist/agent/publish-artifact/open-artifact-tool-view.d.ts +9 -0
- package/dist/agent/publish-artifact/open-artifact-tool-view.d.ts.map +1 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts +4 -2
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts.map +1 -1
- package/dist/agent/publish-artifact/use-live-publishes.d.ts +3 -3
- package/dist/agent/publish-artifact/use-live-publishes.d.ts.map +1 -1
- package/dist/agent/tool-views/built-in.d.ts.map +1 -1
- package/dist/agent/types.d.ts +3 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/utils/web-fetch.d.ts +33 -1
- package/dist/agent/utils/web-fetch.d.ts.map +1 -1
- package/dist/agent/utils/web-search.d.ts +14 -2
- package/dist/agent/utils/web-search.d.ts.map +1 -1
- package/dist/artifacts/artifact-page.d.ts.map +1 -1
- package/dist/artifacts/artifact-viewer.d.ts +16 -0
- package/dist/artifacts/artifact-viewer.d.ts.map +1 -0
- package/dist/artifacts/card-details.d.ts +1 -1
- package/dist/artifacts/card-details.d.ts.map +1 -1
- package/dist/artifacts/card-preview.d.ts.map +1 -1
- package/dist/artifacts/comments-context.d.ts +48 -0
- package/dist/artifacts/comments-context.d.ts.map +1 -0
- package/dist/artifacts/edit-session.d.ts +6 -6
- package/dist/artifacts/edit-session.d.ts.map +1 -1
- package/dist/artifacts/file-source.d.ts.map +1 -1
- package/dist/artifacts/frame.d.ts +10 -2
- package/dist/artifacts/frame.d.ts.map +1 -1
- package/dist/artifacts/guest-badge.d.ts +8 -0
- package/dist/artifacts/guest-badge.d.ts.map +1 -0
- package/dist/artifacts/held-artifact.d.ts +19 -0
- package/dist/artifacts/held-artifact.d.ts.map +1 -0
- package/dist/artifacts/holders.d.ts +10 -0
- package/dist/artifacts/holders.d.ts.map +1 -0
- package/dist/artifacts/live/boards.d.ts +15 -0
- package/dist/artifacts/live/boards.d.ts.map +1 -0
- package/dist/artifacts/live/canvas.d.ts +79 -0
- package/dist/artifacts/live/canvas.d.ts.map +1 -0
- package/dist/artifacts/live/header.d.ts +29 -0
- package/dist/artifacts/live/header.d.ts.map +1 -0
- package/dist/artifacts/live/hooks.d.ts +21 -0
- package/dist/artifacts/live/hooks.d.ts.map +1 -0
- package/dist/artifacts/live/presence.d.ts +32 -0
- package/dist/artifacts/live/presence.d.ts.map +1 -0
- package/dist/artifacts/live/session.d.ts +130 -0
- package/dist/artifacts/live/session.d.ts.map +1 -0
- package/dist/artifacts/live/view.d.ts +28 -0
- package/dist/artifacts/live/view.d.ts.map +1 -0
- package/dist/artifacts/messages.d.ts +424 -14
- package/dist/artifacts/messages.d.ts.map +1 -1
- package/dist/artifacts/page-queries.d.ts +2 -2
- package/dist/artifacts/page-queries.d.ts.map +1 -1
- package/dist/artifacts/page-state.d.ts.map +1 -1
- package/dist/artifacts/publish-edit.d.ts +24 -14
- package/dist/artifacts/publish-edit.d.ts.map +1 -1
- package/dist/artifacts/queries.d.ts +490 -9
- package/dist/artifacts/queries.d.ts.map +1 -1
- package/dist/artifacts/references/references.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/arrows.d.ts +0 -18
- package/dist/artifacts/renderers/canvas/arrows.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/board-editor.d.ts +43 -0
- package/dist/artifacts/renderers/canvas/board-editor.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board-properties.d.ts +37 -0
- package/dist/artifacts/renderers/canvas/board-properties.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board-source.d.ts +18 -0
- package/dist/artifacts/renderers/canvas/board-source.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board.d.ts +64 -19
- package/dist/artifacts/renderers/canvas/board.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/canvas.d.ts +13 -4
- package/dist/artifacts/renderers/canvas/canvas.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts +84 -0
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/commenting.d.ts +58 -0
- package/dist/artifacts/renderers/canvas/commenting.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/comments-panel.d.ts +27 -0
- package/dist/artifacts/renderers/canvas/comments-panel.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/comments.d.ts +56 -0
- package/dist/artifacts/renderers/canvas/comments.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/draft.d.ts +7 -6
- package/dist/artifacts/renderers/canvas/draft.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/edit-mode.d.ts +19 -2
- package/dist/artifacts/renderers/canvas/edit-mode.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/focus.d.ts +40 -5
- package/dist/artifacts/renderers/canvas/focus.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/items.d.ts +47 -4
- package/dist/artifacts/renderers/canvas/items.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/layout.d.ts +5 -8
- package/dist/artifacts/renderers/canvas/layout.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/presence.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/presence.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/previews.d.ts +54 -0
- package/dist/artifacts/renderers/canvas/previews.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/renderer.d.ts +11 -2
- package/dist/artifacts/renderers/canvas/renderer.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/thumbnail.d.ts +5 -2
- package/dist/artifacts/renderers/canvas/thumbnail.d.ts.map +1 -1
- package/dist/artifacts/version-menu.d.ts +19 -0
- package/dist/artifacts/version-menu.d.ts.map +1 -0
- package/dist/artifacts/view-context.d.ts +43 -0
- package/dist/artifacts/view-context.d.ts.map +1 -0
- package/dist/artifacts/viewer.d.ts.map +1 -1
- package/dist/build.d.ts +5 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/{chunk-fw2bm6dq.js → chunk-001c4gnk.js} +8086 -3870
- package/dist/chunk-001c4gnk.js.map +204 -0
- package/dist/chunk-00wggsst.js +7 -0
- package/dist/chunk-00wggsst.js.map +10 -0
- package/dist/chunk-5crvhjp2.js +4704 -0
- package/dist/chunk-5crvhjp2.js.map +28 -0
- package/dist/{chunk-q69001w3.js → chunk-694m74s7.js} +7 -1
- package/dist/{chunk-q69001w3.js.map → chunk-694m74s7.js.map} +3 -3
- package/dist/{chunk-4mprsd2n.js → chunk-fg6thecb.js} +25 -1
- package/dist/chunk-fg6thecb.js.map +10 -0
- package/dist/{chunk-j9653e83.js → chunk-fwb9mxwm.js} +1 -1
- package/dist/{chunk-km25essq.js → chunk-kes4ygmz.js} +1 -1
- package/dist/{chunk-kwbw4dyk.js → chunk-ryed2jq8.js} +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +930 -309
- package/dist/index.js.map +15 -10
- package/dist/locale-messages.d.ts +12 -0
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +12 -0
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +1 -1
- package/dist/metadata.d.ts +8 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/pages/console/action-run.d.ts.map +1 -1
- package/dist/pages/console/data/connectors.d.ts.map +1 -1
- package/dist/pages/console/data/datasets.d.ts.map +1 -1
- package/dist/pages/console/data/lake-health.d.ts +3 -0
- package/dist/pages/console/data/lake-health.d.ts.map +1 -0
- package/dist/pages/console/data/messages.d.ts +98 -2
- package/dist/pages/console/data/messages.d.ts.map +1 -1
- package/dist/pages/console/data/pipelines.d.ts.map +1 -1
- package/dist/pages/console/data/projections.d.ts.map +1 -1
- package/dist/pages/console/data/shared.d.ts.map +1 -1
- package/dist/pages/console/data/syncs.d.ts.map +1 -1
- package/dist/pages/console/ontology/action-runs.d.ts.map +1 -1
- package/dist/pages/console/ontology/actions.d.ts.map +1 -1
- package/dist/pages/console/ontology/components/action-button.d.ts.map +1 -1
- package/dist/pages/console/ontology/components/artifact-picker.d.ts +36 -0
- package/dist/pages/console/ontology/components/artifact-picker.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/object-query-bar.d.ts.map +1 -1
- package/dist/pages/console/ontology/lib/action-params.d.ts +2 -0
- package/dist/pages/console/ontology/lib/action-params.d.ts.map +1 -1
- package/dist/pages/console/ontology/lineage/properties-panel.d.ts +2 -1
- package/dist/pages/console/ontology/lineage/properties-panel.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-page.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-type.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-types.d.ts.map +1 -1
- package/dist/pages/console/ontology/objects.d.ts.map +1 -1
- package/dist/pages/console/ontology/rules.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflow.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows/run-input-form.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows/schema-shape.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows.d.ts.map +1 -1
- package/dist/pages/console/skeletons.d.ts +30 -0
- package/dist/pages/console/skeletons.d.ts.map +1 -0
- package/dist/pages/console/workflow-run.d.ts.map +1 -1
- package/dist/pages/section-page.d.ts +11 -1
- package/dist/pages/section-page.d.ts.map +1 -1
- package/dist/pages/section-ui.d.ts +25 -3
- package/dist/pages/section-ui.d.ts.map +1 -1
- package/dist/pages/settings/activity/calendar.d.ts.map +1 -1
- package/dist/pages/settings/activity/connections.d.ts.map +1 -1
- package/dist/pages/settings/activity/page.d.ts.map +1 -1
- package/dist/pages/settings/activity/thread.d.ts.map +1 -1
- package/dist/pages/settings/activity/timeline.d.ts +2 -0
- package/dist/pages/settings/activity/timeline.d.ts.map +1 -1
- package/dist/pages/settings/controls.d.ts +4 -0
- package/dist/pages/settings/controls.d.ts.map +1 -1
- package/dist/pages/settings/members.d.ts.map +1 -1
- package/dist/pages/settings/memory-history.d.ts +2 -0
- package/dist/pages/settings/memory-history.d.ts.map +1 -1
- package/dist/pages/settings/memory.d.ts.map +1 -1
- package/dist/pages/settings/service-accounts.d.ts.map +1 -1
- package/dist/pages/settings/sessions.d.ts.map +1 -1
- package/dist/pages/settings/usage/breakdown.d.ts.map +1 -1
- package/dist/pages/settings/usage/limits.d.ts.map +1 -1
- package/dist/pages/settings/usage/messages.d.ts +2 -2
- package/dist/pages/settings/usage/messages.d.ts.map +1 -1
- package/dist/pages/settings/usage/runs.d.ts +8 -2
- package/dist/pages/settings/usage/runs.d.ts.map +1 -1
- package/dist/pages/settings/usage/spend-chart.d.ts.map +1 -1
- package/dist/pages/settings/usage/spend-model.d.ts +5 -0
- package/dist/pages/settings/usage/spend-model.d.ts.map +1 -1
- package/dist/pages/values.d.ts +6 -0
- package/dist/pages/values.d.ts.map +1 -1
- package/dist/pages.d.ts +4 -0
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +8195 -4841
- package/dist/pages.js.map +58 -49
- package/dist/sections/catalog.d.ts.map +1 -1
- package/dist/sections/sections.d.ts.map +1 -1
- package/dist/server.js +294 -23
- package/dist/server.js.map +8 -7
- package/dist/service-worker.d.ts +39 -0
- package/dist/service-worker.d.ts.map +1 -0
- package/dist/shared-session.d.ts +25 -0
- package/dist/shared-session.d.ts.map +1 -0
- package/dist/shell/app-return.d.ts +35 -0
- package/dist/shell/app-return.d.ts.map +1 -0
- package/dist/shell/app-shell.d.ts +1 -1
- package/dist/shell/app-shell.d.ts.map +1 -1
- package/dist/shell/nav-items.d.ts +2 -0
- package/dist/shell/nav-items.d.ts.map +1 -1
- package/dist/shell/phone/back.d.ts +6 -0
- package/dist/shell/phone/back.d.ts.map +1 -0
- package/dist/shell/phone/launch.d.ts +7 -0
- package/dist/shell/phone/launch.d.ts.map +1 -0
- package/dist/shell/phone/more-sheet.d.ts +36 -0
- package/dist/shell/phone/more-sheet.d.ts.map +1 -0
- package/dist/shell/phone/phone-foundations.d.ts +9 -0
- package/dist/shell/phone/phone-foundations.d.ts.map +1 -0
- package/dist/shell/phone/pull-to-refresh.d.ts +9 -0
- package/dist/shell/phone/pull-to-refresh.d.ts.map +1 -0
- package/dist/shell/phone/routes.d.ts +12 -0
- package/dist/shell/phone/routes.d.ts.map +1 -0
- package/dist/shell/phone/screen-motion.d.ts +11 -0
- package/dist/shell/phone/screen-motion.d.ts.map +1 -0
- package/dist/shell/phone/scroll-restoration.d.ts +7 -0
- package/dist/shell/phone/scroll-restoration.d.ts.map +1 -0
- package/dist/shell/phone/startup-image.d.ts +17 -0
- package/dist/shell/phone/startup-image.d.ts.map +1 -0
- package/dist/shell/phone/tab-bar.d.ts +14 -0
- package/dist/shell/phone/tab-bar.d.ts.map +1 -0
- package/dist/shell/phone/top-bar.d.ts +24 -0
- package/dist/shell/phone/top-bar.d.ts.map +1 -0
- package/dist/shell/search-command.d.ts +3 -1
- package/dist/shell/search-command.d.ts.map +1 -1
- package/dist/shell/user-menu.d.ts +2 -0
- package/dist/shell/user-menu.d.ts.map +1 -1
- package/package.json +8 -5
- package/src/agent/activity-label.ts +6 -2
- package/src/agent/agent-chat.tsx +51 -8
- package/src/agent/agent-panel.tsx +12 -0
- package/src/agent/agent-surface.tsx +4 -0
- package/src/agent/agent.css +18 -0
- package/src/agent/artifact-card.tsx +84 -16
- package/src/agent/artifact-panel.tsx +63 -43
- package/src/agent/background/background-card.tsx +308 -0
- package/src/agent/background/background-tool-row.tsx +58 -0
- package/src/agent/background/context.ts +26 -0
- package/src/agent/background/interpret.ts +356 -0
- package/src/agent/bash/bash-tool-view.tsx +9 -4
- package/src/agent/bash/interpret.ts +21 -3
- package/src/agent/components/agent-message-body.tsx +1 -1
- package/src/agent/components/composer-menu.tsx +4 -1
- package/src/agent/components/composer-place.tsx +168 -0
- package/src/agent/components/composer.tsx +101 -3
- package/src/agent/components/computer-place.tsx +18 -1
- package/src/agent/components/context-chips.tsx +72 -2
- package/src/agent/components/conversation-panel.tsx +3 -2
- package/src/agent/components/message-parts.tsx +6 -1
- package/src/agent/components/thread-artifacts-menu.tsx +22 -5
- package/src/agent/components/transcript.tsx +33 -1
- package/src/agent/components/web-fetch-tool-view.tsx +94 -29
- package/src/agent/composer-insertion.ts +36 -0
- package/src/agent/delegation/child-parts.tsx +1 -1
- package/src/agent/hooks/use-agent-conversation.ts +101 -8
- package/src/agent/hooks/use-new-thread-place.ts +294 -0
- package/src/agent/i18n/en.ts +70 -3
- package/src/agent/i18n/fr.ts +70 -3
- package/src/agent/observed-conversation.tsx +3 -0
- package/src/agent/publish-artifact/interpret.ts +27 -5
- package/src/agent/publish-artifact/open-artifact-tool-view.tsx +49 -0
- package/src/agent/publish-artifact/publish-artifact-tool-view.tsx +14 -8
- package/src/agent/publish-artifact/use-live-publishes.ts +7 -11
- package/src/agent/react-router.tsx +2 -2
- package/src/agent/tool-views/built-in.tsx +29 -11
- package/src/agent/types.ts +4 -0
- package/src/agent/utils/web-fetch.ts +89 -10
- package/src/agent/utils/web-search.ts +67 -28
- package/src/artifacts/artifact-page.tsx +42 -17
- package/src/artifacts/artifact-viewer.tsx +56 -0
- package/src/artifacts/artifacts.css +80 -0
- package/src/artifacts/card-details.ts +2 -2
- package/src/artifacts/card-preview.tsx +17 -3
- package/src/artifacts/comments-context.ts +125 -0
- package/src/artifacts/edit-session.tsx +6 -6
- package/src/artifacts/file-source.ts +10 -3
- package/src/artifacts/frame.tsx +50 -12
- package/src/artifacts/gallery.tsx +9 -11
- package/src/artifacts/guest-badge.tsx +21 -0
- package/src/artifacts/held-artifact.tsx +241 -0
- package/src/artifacts/holders.tsx +170 -0
- package/src/artifacts/live/boards.ts +95 -0
- package/src/artifacts/live/canvas.ts +402 -0
- package/src/artifacts/live/header.tsx +137 -0
- package/src/artifacts/live/hooks.ts +94 -0
- package/src/artifacts/live/presence.ts +147 -0
- package/src/artifacts/live/session.ts +520 -0
- package/src/artifacts/live/view.ts +81 -0
- package/src/artifacts/messages.ts +415 -24
- package/src/artifacts/page-queries.ts +2 -3
- package/src/artifacts/page-state.ts +16 -7
- package/src/artifacts/publish-edit.ts +50 -22
- package/src/artifacts/queries.ts +108 -10
- package/src/artifacts/references/references.tsx +6 -9
- package/src/artifacts/renderers/canvas/arrows.tsx +12 -39
- package/src/artifacts/renderers/canvas/board-editor.tsx +817 -0
- package/src/artifacts/renderers/canvas/board-properties.tsx +488 -0
- package/src/artifacts/renderers/canvas/board-source.ts +110 -0
- package/src/artifacts/renderers/canvas/board.tsx +309 -33
- package/src/artifacts/renderers/canvas/canvas.tsx +387 -72
- package/src/artifacts/renderers/canvas/comment-pins.tsx +465 -0
- package/src/artifacts/renderers/canvas/commenting.tsx +319 -0
- package/src/artifacts/renderers/canvas/comments-panel.tsx +574 -0
- package/src/artifacts/renderers/canvas/comments.ts +225 -0
- package/src/artifacts/renderers/canvas/draft.ts +41 -50
- package/src/artifacts/renderers/canvas/edit-mode.tsx +145 -20
- package/src/artifacts/renderers/canvas/focus.tsx +175 -24
- package/src/artifacts/renderers/canvas/items.tsx +179 -52
- package/src/artifacts/renderers/canvas/layout.ts +99 -47
- package/src/artifacts/renderers/canvas/presence.tsx +184 -0
- package/src/artifacts/renderers/canvas/previews.ts +127 -0
- package/src/artifacts/renderers/canvas/renderer.tsx +87 -22
- package/src/artifacts/renderers/canvas/thumbnail.tsx +56 -15
- package/src/artifacts/renderers/canvas/toolbar.tsx +1 -1
- package/src/artifacts/renderers/slides/slides.tsx +1 -1
- package/src/artifacts/version-menu.tsx +438 -0
- package/src/artifacts/view-context.ts +102 -0
- package/src/artifacts/viewer.tsx +205 -147
- package/src/build.ts +96 -11
- package/src/codegen.ts +83 -5
- package/src/createCustomApp.ts +20 -7
- package/src/index.ts +12 -0
- package/src/locale-messages.ts +24 -0
- package/src/metadata.ts +12 -0
- package/src/pages/console/action-run.tsx +20 -0
- package/src/pages/console/data/connectors.tsx +27 -3
- package/src/pages/console/data/datasets.tsx +30 -1
- package/src/pages/console/data/lake-health.tsx +299 -0
- package/src/pages/console/data/messages.ts +143 -2
- package/src/pages/console/data/pipelines.tsx +91 -3
- package/src/pages/console/data/projections.tsx +23 -4
- package/src/pages/console/data/shared.tsx +1 -0
- package/src/pages/console/data/syncs.tsx +39 -2
- package/src/pages/console/ontology/action-runs.tsx +8 -2
- package/src/pages/console/ontology/actions.tsx +39 -15
- package/src/pages/console/ontology/components/action-button.tsx +10 -0
- package/src/pages/console/ontology/components/artifact-picker.tsx +522 -0
- package/src/pages/console/ontology/components/object-query-bar.tsx +21 -5
- package/src/pages/console/ontology/lib/action-params.ts +10 -0
- package/src/pages/console/ontology/lineage/properties-panel.tsx +32 -24
- package/src/pages/console/ontology/object-page.tsx +2 -0
- package/src/pages/console/ontology/object-type.tsx +73 -14
- package/src/pages/console/ontology/object-types.tsx +56 -7
- package/src/pages/console/ontology/objects.tsx +167 -19
- package/src/pages/console/ontology/rules.tsx +186 -30
- package/src/pages/console/ontology/workflow.tsx +130 -74
- package/src/pages/console/ontology/workflows/run-input-form.tsx +21 -2
- package/src/pages/console/ontology/workflows/schema-shape.tsx +3 -0
- package/src/pages/console/ontology/workflows.tsx +34 -21
- package/src/pages/console/skeletons.tsx +99 -0
- package/src/pages/console/workflow-run.tsx +20 -0
- package/src/pages/section-page.tsx +37 -7
- package/src/pages/section-ui.tsx +96 -13
- package/src/pages/settings/activity/calendar.tsx +13 -6
- package/src/pages/settings/activity/connections.tsx +26 -9
- package/src/pages/settings/activity/page.tsx +31 -4
- package/src/pages/settings/activity/thread.tsx +32 -18
- package/src/pages/settings/activity/timeline.tsx +39 -0
- package/src/pages/settings/controls.tsx +19 -1
- package/src/pages/settings/developers.tsx +2 -2
- package/src/pages/settings/members.tsx +42 -9
- package/src/pages/settings/memory-history.tsx +76 -10
- package/src/pages/settings/memory.tsx +47 -5
- package/src/pages/settings/service-accounts.tsx +7 -2
- package/src/pages/settings/sessions.tsx +6 -2
- package/src/pages/settings/usage/breakdown.tsx +62 -2
- package/src/pages/settings/usage/limits.tsx +45 -3
- package/src/pages/settings/usage/messages.ts +2 -2
- package/src/pages/settings/usage/page.tsx +99 -52
- package/src/pages/settings/usage/runs.tsx +105 -8
- package/src/pages/settings/usage/spend-chart.tsx +79 -45
- package/src/pages/settings/usage/spend-model.ts +17 -0
- package/src/pages/values.tsx +72 -6
- package/src/pages.ts +4 -0
- package/src/sections/catalog.ts +6 -0
- package/src/sections/sections.tsx +2 -0
- package/src/service-worker.ts +176 -0
- package/src/shared-session.ts +73 -0
- package/src/shell/app-return.ts +115 -0
- package/src/shell/app-shell.tsx +125 -27
- package/src/shell/nav-items.tsx +2 -0
- package/src/shell/phone/back.ts +16 -0
- package/src/shell/phone/launch.ts +6 -0
- package/src/shell/phone/more-sheet.tsx +249 -0
- package/src/shell/phone/phone-foundations.tsx +43 -0
- package/src/shell/phone/phone.css +660 -0
- package/src/shell/phone/pull-to-refresh.tsx +201 -0
- package/src/shell/phone/routes.ts +34 -0
- package/src/shell/phone/screen-motion.ts +292 -0
- package/src/shell/phone/scroll-restoration.tsx +70 -0
- package/src/shell/phone/startup-image.ts +119 -0
- package/src/shell/phone/tab-bar.tsx +95 -0
- package/src/shell/phone/top-bar.tsx +195 -0
- package/src/shell/search-command.tsx +30 -14
- package/src/shell/user-menu.tsx +2 -1
- package/dist/chunk-4mprsd2n.js.map +0 -10
- package/dist/chunk-fw2bm6dq.js.map +0 -182
- package/dist/chunk-zxthr2q5.js +0 -1487
- package/dist/chunk-zxthr2q5.js.map +0 -18
- /package/dist/{chunk-j9653e83.js.map → chunk-fwb9mxwm.js.map} +0 -0
- /package/dist/{chunk-km25essq.js.map → chunk-kes4ygmz.js.map} +0 -0
- /package/dist/{chunk-kwbw4dyk.js.map → chunk-ryed2jq8.js.map} +0 -0
|
@@ -63,8 +63,8 @@ export function fileExtension(name: string): string | undefined {
|
|
|
63
63
|
* removed. Edits within them leave no trace in the structure, so they say nothing here.
|
|
64
64
|
*/
|
|
65
65
|
export function versionChanges(
|
|
66
|
-
previous: ArtifactVersion,
|
|
67
|
-
current: ArtifactVersion,
|
|
66
|
+
previous: Pick<ArtifactVersion, "outline">,
|
|
67
|
+
current: Pick<ArtifactVersion, "outline">,
|
|
68
68
|
messages: ArtifactMessages
|
|
69
69
|
): string[] {
|
|
70
70
|
const { card } = messages
|
|
@@ -9,7 +9,8 @@ import { fileView } from "./file-view"
|
|
|
9
9
|
import { ArtifactKindIcon, type ArtifactKindName } from "./kind-icon"
|
|
10
10
|
import { useArtifactMessages } from "./messages"
|
|
11
11
|
import { type ArtifactVersion, useArtifactTheme, useFileText, versionFileSource } from "./queries"
|
|
12
|
-
import {
|
|
12
|
+
import { boardPreviewUrl, useBoardPreviews } from "./renderers/canvas/previews"
|
|
13
|
+
import { useCanvas, useCanvasMode } from "./renderers/canvas/renderer"
|
|
13
14
|
import { CanvasThumbnail } from "./renderers/canvas/thumbnail"
|
|
14
15
|
import { PageScreen } from "./renderers/page"
|
|
15
16
|
import { chartData, chartReadsLocked } from "./renderers/sheet/chart-data"
|
|
@@ -165,11 +166,24 @@ function VersionPreview({
|
|
|
165
166
|
)
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
/** A canvas drawn small, once its `canvas.json` is read. */
|
|
169
|
+
/** A canvas drawn small, once its `canvas.json` is read, its boards as their small pictures. */
|
|
169
170
|
function CanvasPreview({ version }: { readonly version: ArtifactVersion }) {
|
|
170
171
|
const canvas = useCanvas(version)
|
|
172
|
+
const previews = useBoardPreviews(version)
|
|
173
|
+
const mode = useCanvasMode(version)
|
|
174
|
+
|
|
175
|
+
const pictures = useMemo(
|
|
176
|
+
() =>
|
|
177
|
+
new Map(
|
|
178
|
+
Object.entries(previews).flatMap(([board, status]) =>
|
|
179
|
+
status === "ready" ? [[board, boardPreviewUrl(version, board, mode, "small")]] : []
|
|
180
|
+
)
|
|
181
|
+
),
|
|
182
|
+
[previews, version, mode]
|
|
183
|
+
)
|
|
184
|
+
|
|
171
185
|
if (canvas === undefined) return <Skeleton pulse />
|
|
172
|
-
return canvas ? <CanvasThumbnail canvas={canvas} /> : <Skeleton />
|
|
186
|
+
return canvas ? <CanvasThumbnail canvas={canvas} pictures={pictures} /> : <Skeleton />
|
|
173
187
|
}
|
|
174
188
|
|
|
175
189
|
function DocumentPreview({ version }: { readonly version: ArtifactVersion }) {
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { type AgentContextInput, MAX_AGENT_APP_STATE_ENTRY_BYTES } from "@sixb/core/agents/context"
|
|
2
|
+
import { quoteArtifactComment } from "@sixb/core/artifacts"
|
|
3
|
+
|
|
4
|
+
// The comments a reader sends the Agent, as context of their message: a chip that names how many
|
|
5
|
+
// and on what, and that shows their words; for the Agent, each comment quoted with where it is,
|
|
6
|
+
// its id and its author, as its skill reads them. What the reader reads stays words, never the
|
|
7
|
+
// addresses and ids the Agent needs.
|
|
8
|
+
|
|
9
|
+
/** What a comments context's id starts with, before the artifact's id. */
|
|
10
|
+
export const COMMENTS_CONTEXT_PREFIX = "artifact-comments:"
|
|
11
|
+
|
|
12
|
+
/** One comment as the context holds it: quoted for the Agent, its words for the chip. */
|
|
13
|
+
export interface ContextComment {
|
|
14
|
+
readonly id: string
|
|
15
|
+
readonly quote: string
|
|
16
|
+
readonly author: string | null
|
|
17
|
+
readonly body: string
|
|
18
|
+
readonly replies: readonly string[]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** What a comments context holds. */
|
|
22
|
+
export interface CommentsContextValue {
|
|
23
|
+
readonly artifactId: string
|
|
24
|
+
readonly title: string
|
|
25
|
+
readonly comments: readonly ContextComment[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** What a comment brings to the context: itself and its replies, as the API gives them. */
|
|
29
|
+
interface SentComment {
|
|
30
|
+
readonly id: string
|
|
31
|
+
readonly anchor: Parameters<typeof quoteArtifactComment>[0]["anchor"]
|
|
32
|
+
readonly body: string
|
|
33
|
+
readonly authorName?: string | null
|
|
34
|
+
readonly author?: { readonly type: string }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Room left in the context for what its id, label and description take. */
|
|
38
|
+
const CONTEXT_ROOM_BYTES = MAX_AGENT_APP_STATE_ENTRY_BYTES - 2 * 1024
|
|
39
|
+
|
|
40
|
+
/** The longest words of a comment or a reply the context keeps. */
|
|
41
|
+
const MAX_WORDS = 1_500
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The context that sends these comments to the Agent, labelled for the chip. As many as fit in a
|
|
45
|
+
* context entry go, in order; `sent` says how many.
|
|
46
|
+
*/
|
|
47
|
+
export function commentsContext(input: {
|
|
48
|
+
readonly artifactId: string
|
|
49
|
+
readonly title: string
|
|
50
|
+
readonly label: (count: number) => string
|
|
51
|
+
readonly threads: readonly {
|
|
52
|
+
readonly comment: SentComment
|
|
53
|
+
readonly replies: readonly SentComment[]
|
|
54
|
+
}[]
|
|
55
|
+
}): { readonly context: AgentContextInput; readonly sent: number } {
|
|
56
|
+
const comments: ContextComment[] = []
|
|
57
|
+
let bytes = 0
|
|
58
|
+
for (const { comment, replies } of input.threads) {
|
|
59
|
+
const body = cut(comment.body)
|
|
60
|
+
const entry: ContextComment = {
|
|
61
|
+
id: comment.id,
|
|
62
|
+
quote: quoteArtifactComment({ ...comment, body, guest: comment.author?.type === "guest" }),
|
|
63
|
+
author: comment.authorName ?? null,
|
|
64
|
+
body,
|
|
65
|
+
replies: replies.map((reply) => cut(reply.body)),
|
|
66
|
+
}
|
|
67
|
+
const size = new TextEncoder().encode(JSON.stringify(entry)).byteLength
|
|
68
|
+
if (comments.length > 0 && bytes + size > CONTEXT_ROOM_BYTES) break
|
|
69
|
+
comments.push(entry)
|
|
70
|
+
bytes += size
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const value = {
|
|
74
|
+
artifactId: input.artifactId,
|
|
75
|
+
title: input.title,
|
|
76
|
+
comments: comments.map((comment) => ({ ...comment, replies: [...comment.replies] })),
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
sent: comments.length,
|
|
80
|
+
context: {
|
|
81
|
+
kind: "app-state",
|
|
82
|
+
id: `${COMMENTS_CONTEXT_PREFIX}${input.artifactId}`,
|
|
83
|
+
label: input.label(comments.length),
|
|
84
|
+
description: `Comments the person chose on the canvas "${input.title}" (${input.artifactId}) for you to address. Each quote names where the comment is, as the canvas guide of the sixb-artifacts skill explains, then its words; replies follow it.`,
|
|
85
|
+
value,
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** The comments a context sends, when it is a comments context; null for any other. */
|
|
91
|
+
export function readCommentsContext(context: AgentContextInput): CommentsContextValue | null {
|
|
92
|
+
if (context.kind !== "app-state" || !context.id.startsWith(COMMENTS_CONTEXT_PREFIX)) return null
|
|
93
|
+
const value = context.value
|
|
94
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return null
|
|
95
|
+
|
|
96
|
+
const comments = (value as Record<string, unknown>).comments
|
|
97
|
+
if (!Array.isArray(comments)) return null
|
|
98
|
+
const read = comments.flatMap((comment): ContextComment[] => {
|
|
99
|
+
if (typeof comment !== "object" || comment === null || Array.isArray(comment)) return []
|
|
100
|
+
const { id, quote, author, body, replies } = comment as Record<string, unknown>
|
|
101
|
+
if (typeof id !== "string" || typeof quote !== "string" || typeof body !== "string") return []
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
id,
|
|
105
|
+
quote,
|
|
106
|
+
author: typeof author === "string" ? author : null,
|
|
107
|
+
body,
|
|
108
|
+
replies: Array.isArray(replies)
|
|
109
|
+
? replies.filter((reply): reply is string => typeof reply === "string")
|
|
110
|
+
: [],
|
|
111
|
+
},
|
|
112
|
+
]
|
|
113
|
+
})
|
|
114
|
+
const { artifactId, title } = value as Record<string, unknown>
|
|
115
|
+
return {
|
|
116
|
+
artifactId: typeof artifactId === "string" ? artifactId : "",
|
|
117
|
+
title: typeof title === "string" ? title : "",
|
|
118
|
+
comments: read,
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function cut(words: string): string {
|
|
123
|
+
const text = words.replace(/\s+/g, " ").trim()
|
|
124
|
+
return text.length > MAX_WORDS ? `${text.slice(0, MAX_WORDS - 1)}…` : text
|
|
125
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UpdateArtifactResponse } from "@sixb/client"
|
|
2
2
|
import { getArtifactVersionQueryKey } from "@sixb/client/hooks"
|
|
3
3
|
import type { QueryClient } from "@tanstack/react-query"
|
|
4
4
|
import { createContext, type ReactNode, useContext, useEffect } from "react"
|
|
@@ -57,16 +57,16 @@ const MEDIA_TYPES: Readonly<Record<string, string>> = {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
60
|
+
* Saves a draft as the artifact's latest, and fills the cache with what it saved: the version, and
|
|
61
|
+
* each file's text, the changed ones from the draft and the rest from the version edited, so it
|
|
62
|
+
* shows at once, without reading again what the reader already has.
|
|
63
63
|
*/
|
|
64
64
|
export async function saveDraft(
|
|
65
65
|
queries: QueryClient,
|
|
66
66
|
version: ArtifactVersion,
|
|
67
67
|
draft: ArtifactDraft,
|
|
68
|
-
options: { readonly
|
|
69
|
-
): Promise<
|
|
68
|
+
options: { readonly baseRevision?: number } = {}
|
|
69
|
+
): Promise<UpdateArtifactResponse> {
|
|
70
70
|
const texts = draft.files()
|
|
71
71
|
const changed = new Map(
|
|
72
72
|
[...texts].map(([path, text]) => [
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
getArtifactFileContent,
|
|
7
7
|
getObservedAgentChildFileContent,
|
|
8
8
|
getObservedAgentMessageFileContent,
|
|
9
|
+
withSharedAccess,
|
|
9
10
|
} from "@sixb/client"
|
|
10
11
|
import { useArtifactMessages } from "./messages"
|
|
11
12
|
|
|
@@ -46,8 +47,10 @@ export function artifactFileSource(input: {
|
|
|
46
47
|
readonly baseUrl?: string
|
|
47
48
|
}): FileSource {
|
|
48
49
|
const routePath = `/api/artifacts/${encodeURIComponent(input.artifactId)}/versions/${input.version}/content`
|
|
50
|
+
// An open version's file changes at its address: the cache key, its bytes' digest, gives each
|
|
51
|
+
// content its own URL, so an image the browser kept is never shown for another.
|
|
49
52
|
const url = (disposition: "inline" | "attachment") =>
|
|
50
|
-
contentUrl(routePath, { path: input.path, disposition }, input.baseUrl)
|
|
53
|
+
contentUrl(routePath, { path: input.path, disposition, v: input.fileRef.digest }, input.baseUrl)
|
|
51
54
|
return {
|
|
52
55
|
id: `artifact:${input.artifactId}@${input.version}/${input.path}`,
|
|
53
56
|
fileRef: input.fileRef,
|
|
@@ -189,11 +192,15 @@ export function useFileName(source: FileSource): string {
|
|
|
189
192
|
return source.name || messages.file
|
|
190
193
|
}
|
|
191
194
|
|
|
195
|
+
/**
|
|
196
|
+
* A file's address, as an `<img>`, a `<video>` or a download link loads it, without the client: a
|
|
197
|
+
* shared link's session names its grant in it, since such a request cannot send the header.
|
|
198
|
+
*/
|
|
192
199
|
function contentUrl(routePath: string, query: Record<string, string>, baseUrl?: string): string {
|
|
193
200
|
const params = new URLSearchParams(query)
|
|
194
201
|
const base = baseUrl ?? client.getConfig().baseUrl
|
|
195
|
-
if (!base && typeof window === "undefined") return `${routePath}?${params}`
|
|
202
|
+
if (!base && typeof window === "undefined") return withSharedAccess(`${routePath}?${params}`)
|
|
196
203
|
const url = new URL(routePath, base ?? window.location.origin)
|
|
197
204
|
url.search = params.toString()
|
|
198
|
-
return url.toString()
|
|
205
|
+
return withSharedAccess(url.toString())
|
|
199
206
|
}
|
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) => {
|
|
@@ -300,9 +319,12 @@ export function ArtifactFrame({
|
|
|
300
319
|
|
|
301
320
|
useEffect(() => {
|
|
302
321
|
if (!reportsFailure || !source || ready === source) return
|
|
303
|
-
const timer = setTimeout(
|
|
322
|
+
const timer = setTimeout(
|
|
323
|
+
() => setTimedOut(source),
|
|
324
|
+
loaded === source ? LOADED_READY_MS : READY_TIMEOUT_MS
|
|
325
|
+
)
|
|
304
326
|
return () => clearTimeout(timer)
|
|
305
|
-
}, [reportsFailure, source, ready])
|
|
327
|
+
}, [reportsFailure, source, ready, loaded])
|
|
306
328
|
// A link that fails for a later mount leaves a frame that has one as it is.
|
|
307
329
|
const failed =
|
|
308
330
|
reportsFailure && (source === undefined ? frame.isError : timedOut === source && !isReady)
|
|
@@ -317,6 +339,7 @@ export function ArtifactFrame({
|
|
|
317
339
|
src={source}
|
|
318
340
|
title={title}
|
|
319
341
|
loading={reportsFailure ? "eager" : "lazy"}
|
|
342
|
+
onLoad={() => setLoaded(source)}
|
|
320
343
|
className={cn(
|
|
321
344
|
"absolute inset-0 size-full border-0 bg-transparent transition-opacity duration-200 ease-out motion-reduce:transition-none",
|
|
322
345
|
shown === source ? "opacity-100" : "opacity-0"
|
|
@@ -356,10 +379,18 @@ function openWebLink(frame: HTMLIFrameElement, url: string): void {
|
|
|
356
379
|
|
|
357
380
|
const NO_QUERIES: readonly string[] = []
|
|
358
381
|
|
|
359
|
-
/**
|
|
382
|
+
/** What a frame shows: a version at one revision, which its link serves. */
|
|
383
|
+
function frameIdentity(version: ArtifactVersion): string {
|
|
384
|
+
return `${version.artifactId}@${version.version}r${version.revision}`
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* A version's frame link, shared by its frames and reused while it has most of its hour left. A
|
|
389
|
+
* link serves the revision it was minted at: an open version that changed asks for another.
|
|
390
|
+
*/
|
|
360
391
|
function frameLink(version: ArtifactVersion) {
|
|
361
392
|
return queryOptions({
|
|
362
|
-
queryKey:
|
|
393
|
+
queryKey: frameLinkKey(version),
|
|
363
394
|
queryFn: async () => {
|
|
364
395
|
const { data } = await createArtifactFrame({
|
|
365
396
|
path: { artifactId: version.artifactId, version: String(version.version) },
|
|
@@ -373,6 +404,13 @@ function frameLink(version: ArtifactVersion) {
|
|
|
373
404
|
})
|
|
374
405
|
}
|
|
375
406
|
|
|
407
|
+
/** Where a version's frame link is cached, at its revision; a test seeds it there. */
|
|
408
|
+
export function frameLinkKey(
|
|
409
|
+
version: Pick<ArtifactVersion, "artifactId" | "version" | "revision">
|
|
410
|
+
) {
|
|
411
|
+
return ["artifact-frame", version.artifactId, version.version, version.revision] as const
|
|
412
|
+
}
|
|
413
|
+
|
|
376
414
|
/** The frame's entry on the API, which may be another origin than the app's. */
|
|
377
415
|
function frameUrl(path: string, entry: string): string {
|
|
378
416
|
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
|
+
}
|