@flanksource/clicky-ui 0.3.65 → 0.3.66
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/NOTICE.md +4 -2
- package/dist/comments/CommentAuthor.cjs +6 -1
- package/dist/comments/CommentAuthor.cjs.map +1 -1
- package/dist/comments/CommentAuthor.d.ts.map +1 -1
- package/dist/comments/CommentAuthor.js +8 -3
- package/dist/comments/CommentAuthor.js.map +1 -1
- package/dist/comments/CommentComposer.cjs +4 -1
- package/dist/comments/CommentComposer.cjs.map +1 -1
- package/dist/comments/CommentComposer.d.ts.map +1 -1
- package/dist/comments/CommentComposer.js +4 -1
- package/dist/comments/CommentComposer.js.map +1 -1
- package/dist/comments/CommentEditor.cjs +3 -6
- package/dist/comments/CommentEditor.cjs.map +1 -1
- package/dist/comments/CommentEditor.d.ts.map +1 -1
- package/dist/comments/CommentEditor.js +3 -6
- package/dist/comments/CommentEditor.js.map +1 -1
- package/dist/comments/CommentProvider.cjs +3 -1
- package/dist/comments/CommentProvider.cjs.map +1 -1
- package/dist/comments/CommentProvider.d.ts +2 -0
- package/dist/comments/CommentProvider.d.ts.map +1 -1
- package/dist/comments/CommentProvider.js +3 -1
- package/dist/comments/CommentProvider.js.map +1 -1
- package/dist/comments/CommentRail.cjs +31 -18
- package/dist/comments/CommentRail.cjs.map +1 -1
- package/dist/comments/CommentRail.d.ts.map +1 -1
- package/dist/comments/CommentRail.js +31 -18
- package/dist/comments/CommentRail.js.map +1 -1
- package/dist/comments/agent-delivery.cjs +1 -2
- package/dist/comments/agent-delivery.cjs.map +1 -1
- package/dist/comments/agent-delivery.d.ts +1 -1
- package/dist/comments/agent-delivery.d.ts.map +1 -1
- package/dist/comments/agent-delivery.js +1 -2
- package/dist/comments/agent-delivery.js.map +1 -1
- package/dist/comments/annotation-types.d.ts +16 -0
- package/dist/comments/annotation-types.d.ts.map +1 -1
- package/dist/comments/comment-context.cjs.map +1 -1
- package/dist/comments/comment-context.d.ts +2 -1
- package/dist/comments/comment-context.d.ts.map +1 -1
- package/dist/comments/comment-context.js.map +1 -1
- package/dist/comments/comment-types.cjs.map +1 -1
- package/dist/comments/comment-types.d.ts +10 -1
- package/dist/comments/comment-types.d.ts.map +1 -1
- package/dist/comments/comment-types.js.map +1 -1
- package/dist/comments/gavel/CommentAgentSessions.cjs +55 -44
- package/dist/comments/gavel/CommentAgentSessions.cjs.map +1 -1
- package/dist/comments/gavel/CommentAgentSessions.d.ts +5 -2
- package/dist/comments/gavel/CommentAgentSessions.d.ts.map +1 -1
- package/dist/comments/gavel/CommentAgentSessions.js +55 -44
- package/dist/comments/gavel/CommentAgentSessions.js.map +1 -1
- package/dist/comments/gavel/client.cjs +3 -1
- package/dist/comments/gavel/client.cjs.map +1 -1
- package/dist/comments/gavel/client.d.ts.map +1 -1
- package/dist/comments/gavel/client.js +3 -1
- package/dist/comments/gavel/client.js.map +1 -1
- package/dist/comments/gavel/comment-agent-model.cjs +1 -1
- package/dist/comments/gavel/comment-agent-model.cjs.map +1 -1
- package/dist/comments/gavel/comment-agent-model.js +1 -1
- package/dist/comments/gavel/comment-agent-model.js.map +1 -1
- package/dist/comments/gavel/inbox-prompt.cjs +3 -1
- package/dist/comments/gavel/inbox-prompt.cjs.map +1 -1
- package/dist/comments/gavel/inbox-prompt.d.ts.map +1 -1
- package/dist/comments/gavel/inbox-prompt.js +3 -1
- package/dist/comments/gavel/inbox-prompt.js.map +1 -1
- package/dist/comments/gavel/index.d.ts +2 -1
- package/dist/comments/gavel/index.d.ts.map +1 -1
- package/dist/comments/gavel/useGavelComments.cjs +17 -9
- package/dist/comments/gavel/useGavelComments.cjs.map +1 -1
- package/dist/comments/gavel/useGavelComments.d.ts.map +1 -1
- package/dist/comments/gavel/useGavelComments.js +18 -10
- package/dist/comments/gavel/useGavelComments.js.map +1 -1
- package/dist/comments-gavel.cjs +4 -0
- package/dist/comments-gavel.js +3 -1
- package/dist/comments.d.ts +1 -1
- package/dist/comments.d.ts.map +1 -1
- package/dist/components/FilterBar.cjs +12 -5
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +12 -5
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/JsonSchemaForm.cjs +4 -1
- package/dist/components/JsonSchemaForm.cjs.map +1 -1
- package/dist/components/JsonSchemaForm.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm.js +4 -1
- package/dist/components/JsonSchemaForm.js.map +1 -1
- package/dist/components/SecretFormField.cjs +3 -0
- package/dist/components/SecretFormField.cjs.map +1 -1
- package/dist/components/SecretFormField.d.ts.map +1 -1
- package/dist/components/SecretFormField.js +3 -0
- package/dist/components/SecretFormField.js.map +1 -1
- package/dist/components/SecretKeySelector.cjs +28 -2
- package/dist/components/SecretKeySelector.cjs.map +1 -1
- package/dist/components/SecretKeySelector.d.ts +7 -1
- package/dist/components/SecretKeySelector.d.ts.map +1 -1
- package/dist/components/SecretKeySelector.js +28 -2
- package/dist/components/SecretKeySelector.js.map +1 -1
- package/dist/components/SegmentedControl.cjs +4 -1
- package/dist/components/SegmentedControl.cjs.map +1 -1
- package/dist/components/SegmentedControl.d.ts +3 -3
- package/dist/components/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl.js +5 -2
- package/dist/components/SegmentedControl.js.map +1 -1
- package/dist/components/WorkspaceAccessDialog.cjs +273 -99
- package/dist/components/WorkspaceAccessDialog.cjs.map +1 -1
- package/dist/components/WorkspaceAccessDialog.d.ts +4 -2
- package/dist/components/WorkspaceAccessDialog.d.ts.map +1 -1
- package/dist/components/WorkspaceAccessDialog.js +275 -101
- package/dist/components/WorkspaceAccessDialog.js.map +1 -1
- package/dist/components/json-schema-form-accordion-array.cjs +5 -3
- package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
- package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-accordion-array.js +7 -5
- package/dist/components/json-schema-form-accordion-array.js.map +1 -1
- package/dist/components/json-schema-form-cards-array.cjs +1 -0
- package/dist/components/json-schema-form-cards-array.cjs.map +1 -1
- package/dist/components/json-schema-form-cards-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-cards-array.js +2 -1
- package/dist/components/json-schema-form-cards-array.js.map +1 -1
- package/dist/components/json-schema-form-conditionals.cjs +1 -4
- package/dist/components/json-schema-form-conditionals.cjs.map +1 -1
- package/dist/components/json-schema-form-conditionals.d.ts.map +1 -1
- package/dist/components/json-schema-form-conditionals.js +1 -4
- package/dist/components/json-schema-form-conditionals.js.map +1 -1
- package/dist/components/json-schema-form-enum-choice.cjs +4 -3
- package/dist/components/json-schema-form-enum-choice.cjs.map +1 -1
- package/dist/components/json-schema-form-enum-choice.d.ts.map +1 -1
- package/dist/components/json-schema-form-enum-choice.js +4 -3
- package/dist/components/json-schema-form-enum-choice.js.map +1 -1
- package/dist/components/json-schema-form-item-row.cjs +4 -0
- package/dist/components/json-schema-form-item-row.cjs.map +1 -1
- package/dist/components/json-schema-form-item-row.d.ts +3 -0
- package/dist/components/json-schema-form-item-row.d.ts.map +1 -1
- package/dist/components/json-schema-form-item-row.js +5 -2
- package/dist/components/json-schema-form-item-row.js.map +1 -1
- package/dist/components/json-schema-form-item-summary.cjs +10 -0
- package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
- package/dist/components/json-schema-form-item-summary.d.ts +1 -0
- package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
- package/dist/components/json-schema-form-item-summary.js +10 -1
- package/dist/components/json-schema-form-item-summary.js.map +1 -1
- package/dist/components/json-schema-form-listeners.cjs +1 -5
- package/dist/components/json-schema-form-listeners.cjs.map +1 -1
- package/dist/components/json-schema-form-listeners.js +1 -5
- package/dist/components/json-schema-form-listeners.js.map +1 -1
- package/dist/components/json-schema-form-refs.cjs +29 -4
- package/dist/components/json-schema-form-refs.cjs.map +1 -1
- package/dist/components/json-schema-form-refs.js +29 -4
- package/dist/components/json-schema-form-refs.js.map +1 -1
- package/dist/components/json-schema-form-render.cjs +35 -13
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +36 -14
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +3 -1
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +3 -1
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-runtime-types.d.ts +8 -0
- package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +1 -1
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.js +2 -2
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components/json-schema-form-types.d.ts +6 -0
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.cjs +12 -3
- package/dist/components/json-schema-form-utils.cjs.map +1 -1
- package/dist/components/json-schema-form-utils.d.ts +4 -1
- package/dist/components/json-schema-form-utils.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.js +12 -3
- package/dist/components/json-schema-form-utils.js.map +1 -1
- package/dist/components/secret-form-extension.cjs.map +1 -1
- package/dist/components/secret-form-extension.d.ts +2 -0
- package/dist/components/secret-form-extension.d.ts.map +1 -1
- package/dist/components/secret-form-extension.js.map +1 -1
- package/dist/components/useSingleRowTagCount.cjs +16 -13
- package/dist/components/useSingleRowTagCount.cjs.map +1 -1
- package/dist/components/useSingleRowTagCount.d.ts +0 -5
- package/dist/components/useSingleRowTagCount.d.ts.map +1 -1
- package/dist/components/useSingleRowTagCount.js +16 -13
- package/dist/components/useSingleRowTagCount.js.map +1 -1
- package/dist/components.cjs +4 -0
- package/dist/components.d.ts +2 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +3 -1
- package/dist/connections/connectionSchemaFormExtensions.cjs +13 -2
- package/dist/connections/connectionSchemaFormExtensions.cjs.map +1 -1
- package/dist/connections/connectionSchemaFormExtensions.d.ts.map +1 -1
- package/dist/connections/connectionSchemaFormExtensions.js +13 -2
- package/dist/connections/connectionSchemaFormExtensions.js.map +1 -1
- package/dist/data/DataTable.cjs +128 -82
- package/dist/data/DataTable.cjs.map +1 -1
- package/dist/data/DataTable.d.ts +29 -0
- package/dist/data/DataTable.d.ts.map +1 -1
- package/dist/data/DataTable.js +129 -83
- package/dist/data/DataTable.js.map +1 -1
- package/dist/data/DataTableList.cjs +43 -0
- package/dist/data/DataTableList.cjs.map +1 -0
- package/dist/data/DataTableList.d.ts +13 -0
- package/dist/data/DataTableList.d.ts.map +1 -0
- package/dist/data/DataTableList.js +43 -0
- package/dist/data/DataTableList.js.map +1 -0
- package/dist/data/DataTableOverflowCue.cjs +18 -8
- package/dist/data/DataTableOverflowCue.cjs.map +1 -1
- package/dist/data/DataTableOverflowCue.d.ts.map +1 -1
- package/dist/data/DataTableOverflowCue.js +18 -8
- package/dist/data/DataTableOverflowCue.js.map +1 -1
- package/dist/data/Markdown.cjs +11 -1
- package/dist/data/Markdown.cjs.map +1 -1
- package/dist/data/Markdown.d.ts.map +1 -1
- package/dist/data/Markdown.js +11 -1
- package/dist/data/Markdown.js.map +1 -1
- package/dist/data/PromptBanner.cjs +13 -4
- package/dist/data/PromptBanner.cjs.map +1 -1
- package/dist/data/PromptBanner.d.ts.map +1 -1
- package/dist/data/PromptBanner.js +13 -4
- package/dist/data/PromptBanner.js.map +1 -1
- package/dist/data/SelectionActionBar.cjs +20 -5
- package/dist/data/SelectionActionBar.cjs.map +1 -1
- package/dist/data/SelectionActionBar.d.ts +6 -1
- package/dist/data/SelectionActionBar.d.ts.map +1 -1
- package/dist/data/SelectionActionBar.js +20 -5
- package/dist/data/SelectionActionBar.js.map +1 -1
- package/dist/data/StatStrip.cjs +12 -4
- package/dist/data/StatStrip.cjs.map +1 -1
- package/dist/data/StatStrip.d.ts +0 -8
- package/dist/data/StatStrip.d.ts.map +1 -1
- package/dist/data/StatStrip.js +12 -4
- package/dist/data/StatStrip.js.map +1 -1
- package/dist/data/TaskManager.cjs +173 -53
- package/dist/data/TaskManager.cjs.map +1 -1
- package/dist/data/TaskManager.d.ts +9 -1
- package/dist/data/TaskManager.d.ts.map +1 -1
- package/dist/data/TaskManager.js +175 -55
- package/dist/data/TaskManager.js.map +1 -1
- package/dist/data/TaskPoolUsage.cjs +65 -1
- package/dist/data/TaskPoolUsage.cjs.map +1 -1
- package/dist/data/TaskPoolUsage.d.ts +19 -1
- package/dist/data/TaskPoolUsage.d.ts.map +1 -1
- package/dist/data/TaskPoolUsage.js +65 -2
- package/dist/data/TaskPoolUsage.js.map +1 -1
- package/dist/data/ai/SessionInspector.cjs +24 -14
- package/dist/data/ai/SessionInspector.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.collection.cjs +9 -7
- package/dist/data/ai/SessionInspector.collection.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.collection.d.ts +1 -1
- package/dist/data/ai/SessionInspector.collection.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.collection.js +9 -7
- package/dist/data/ai/SessionInspector.collection.js.map +1 -1
- package/dist/data/ai/SessionInspector.d.ts +8 -3
- package/dist/data/ai/SessionInspector.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy-state.cjs +5 -4
- package/dist/data/ai/SessionInspector.hierarchy-state.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy-state.js +6 -5
- package/dist/data/ai/SessionInspector.hierarchy-state.js.map +1 -1
- package/dist/data/ai/SessionInspector.host-tabs.cjs +28 -0
- package/dist/data/ai/SessionInspector.host-tabs.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.host-tabs.d.ts +17 -0
- package/dist/data/ai/SessionInspector.host-tabs.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.host-tabs.js +28 -0
- package/dist/data/ai/SessionInspector.host-tabs.js.map +1 -0
- package/dist/data/ai/SessionInspector.js +24 -14
- package/dist/data/ai/SessionInspector.js.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.cjs +13 -6
- package/dist/data/ai/SessionInspector.legacy.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.d.ts +3 -1
- package/dist/data/ai/SessionInspector.legacy.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.js +13 -6
- package/dist/data/ai/SessionInspector.legacy.js.map +1 -1
- package/dist/data/ai/SessionInspector.remote.cjs +7 -3
- package/dist/data/ai/SessionInspector.remote.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.remote.d.ts +1 -1
- package/dist/data/ai/SessionInspector.remote.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.remote.js +8 -4
- package/dist/data/ai/SessionInspector.remote.js.map +1 -1
- package/dist/data/ai/SessionViewer.input.cjs +78 -1
- package/dist/data/ai/SessionViewer.input.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.input.d.ts +9 -0
- package/dist/data/ai/SessionViewer.input.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.input.js +77 -2
- package/dist/data/ai/SessionViewer.input.js.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.cjs +44 -13
- package/dist/data/ai/SessionViewer.tool-details.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts +7 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.js +44 -13
- package/dist/data/ai/SessionViewer.tool-details.js.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.cjs +7 -3
- package/dist/data/ai/SessionViewer.tool-row.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.js +8 -4
- package/dist/data/ai/SessionViewer.tool-row.js.map +1 -1
- package/dist/data/ai/index.d.ts +1 -1
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.cjs +5 -2
- package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.cjs.map +1 -1
- package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.d.ts.map +1 -1
- package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.js +6 -3
- package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.js.map +1 -1
- package/dist/data/ai/runtime-profiles/RuntimeProfilesWorkspace.cjs +2 -1
- package/dist/data/ai/runtime-profiles/RuntimeProfilesWorkspace.cjs.map +1 -1
- package/dist/data/ai/runtime-profiles/RuntimeProfilesWorkspace.d.ts.map +1 -1
- package/dist/data/ai/runtime-profiles/RuntimeProfilesWorkspace.js +2 -1
- package/dist/data/ai/runtime-profiles/RuntimeProfilesWorkspace.js.map +1 -1
- package/dist/data/ai/runtime-profiles/use-runtime-profile-picker.cjs +2 -1
- package/dist/data/ai/runtime-profiles/use-runtime-profile-picker.cjs.map +1 -1
- package/dist/data/ai/runtime-profiles/use-runtime-profile-picker.d.ts.map +1 -1
- package/dist/data/ai/runtime-profiles/use-runtime-profile-picker.js +2 -1
- package/dist/data/ai/runtime-profiles/use-runtime-profile-picker.js.map +1 -1
- package/dist/data/ai/use-session-scroll.cjs +120 -41
- package/dist/data/ai/use-session-scroll.cjs.map +1 -1
- package/dist/data/ai/use-session-scroll.d.ts +3 -3
- package/dist/data/ai/use-session-scroll.d.ts.map +1 -1
- package/dist/data/ai/use-session-scroll.js +120 -41
- package/dist/data/ai/use-session-scroll.js.map +1 -1
- package/dist/data/cells/timestamp-format.cjs +57 -2
- package/dist/data/cells/timestamp-format.cjs.map +1 -1
- package/dist/data/cells/timestamp-format.d.ts +9 -1
- package/dist/data/cells/timestamp-format.d.ts.map +1 -1
- package/dist/data/cells/timestamp-format.js +56 -3
- package/dist/data/cells/timestamp-format.js.map +1 -1
- package/dist/data/chat/AgentIdentity.cjs +10 -3
- package/dist/data/chat/AgentIdentity.cjs.map +1 -1
- package/dist/data/chat/AgentIdentity.d.ts +2 -1
- package/dist/data/chat/AgentIdentity.d.ts.map +1 -1
- package/dist/data/chat/AgentIdentity.js +10 -3
- package/dist/data/chat/AgentIdentity.js.map +1 -1
- package/dist/data/chat/Conversation.cjs +14 -5
- package/dist/data/chat/Conversation.cjs.map +1 -1
- package/dist/data/chat/Conversation.d.ts.map +1 -1
- package/dist/data/chat/Conversation.js +14 -5
- package/dist/data/chat/Conversation.js.map +1 -1
- package/dist/data/data-table-list.cjs +24 -0
- package/dist/data/data-table-list.cjs.map +1 -0
- package/dist/data/data-table-list.d.ts +31 -0
- package/dist/data/data-table-list.d.ts.map +1 -0
- package/dist/data/data-table-list.js +24 -0
- package/dist/data/data-table-list.js.map +1 -0
- package/dist/data/delimited.cjs +48 -0
- package/dist/data/delimited.cjs.map +1 -0
- package/dist/data/delimited.d.ts +10 -0
- package/dist/data/delimited.d.ts.map +1 -0
- package/dist/data/delimited.js +47 -0
- package/dist/data/delimited.js.map +1 -0
- package/dist/data/git/index.d.ts +1 -0
- package/dist/data/git/index.d.ts.map +1 -1
- package/dist/data/git/pickers/GitPickers.cjs +2 -0
- package/dist/data/git/pickers/GitPickers.cjs.map +1 -1
- package/dist/data/git/pickers/GitPickers.d.ts.map +1 -1
- package/dist/data/git/pickers/GitPickers.js +2 -0
- package/dist/data/git/pickers/GitPickers.js.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.cjs +9 -2
- package/dist/data/git/pickers/GitSourcePicker.cjs.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.d.ts.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.js +9 -2
- package/dist/data/git/pickers/GitSourcePicker.js.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.cjs +60 -6
- package/dist/data/git/pickers/ReferencePicker.cjs.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.d.ts +9 -1
- package/dist/data/git/pickers/ReferencePicker.d.ts.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.js +61 -7
- package/dist/data/git/pickers/ReferencePicker.js.map +1 -1
- package/dist/data/git/pickers/git-ref-group-limits.cjs +14 -0
- package/dist/data/git/pickers/git-ref-group-limits.cjs.map +1 -0
- package/dist/data/git/pickers/git-ref-group-limits.d.ts +11 -0
- package/dist/data/git/pickers/git-ref-group-limits.d.ts.map +1 -0
- package/dist/data/git/pickers/git-ref-group-limits.js +14 -0
- package/dist/data/git/pickers/git-ref-group-limits.js.map +1 -0
- package/dist/data/git/pickers/types.d.ts +2 -0
- package/dist/data/git/pickers/types.d.ts.map +1 -1
- package/dist/data/lint/LintList.cjs +154 -0
- package/dist/data/lint/LintList.cjs.map +1 -0
- package/dist/data/lint/LintList.d.ts +14 -0
- package/dist/data/lint/LintList.d.ts.map +1 -0
- package/dist/data/lint/LintList.js +154 -0
- package/dist/data/lint/LintList.js.map +1 -0
- package/dist/data/lint/LintResults.cjs +31 -10
- package/dist/data/lint/LintResults.cjs.map +1 -1
- package/dist/data/lint/LintResults.d.ts +5 -3
- package/dist/data/lint/LintResults.d.ts.map +1 -1
- package/dist/data/lint/LintResults.js +31 -10
- package/dist/data/lint/LintResults.js.map +1 -1
- package/dist/data/lint/actions.cjs +3 -1
- package/dist/data/lint/actions.cjs.map +1 -1
- package/dist/data/lint/actions.d.ts.map +1 -1
- package/dist/data/lint/actions.js +3 -1
- package/dist/data/lint/actions.js.map +1 -1
- package/dist/data/lint/index.d.ts +2 -0
- package/dist/data/lint/index.d.ts.map +1 -1
- package/dist/data/lint/list-grouping.cjs +39 -0
- package/dist/data/lint/list-grouping.cjs.map +1 -0
- package/dist/data/lint/list-grouping.d.ts +20 -0
- package/dist/data/lint/list-grouping.d.ts.map +1 -0
- package/dist/data/lint/list-grouping.js +39 -0
- package/dist/data/lint/list-grouping.js.map +1 -0
- package/dist/data/task-run-format.cjs +20 -0
- package/dist/data/task-run-format.cjs.map +1 -0
- package/dist/data/task-run-format.d.ts +6 -0
- package/dist/data/task-run-format.d.ts.map +1 -0
- package/dist/data/task-run-format.js +20 -0
- package/dist/data/task-run-format.js.map +1 -0
- package/dist/data/test-runner/TestDetailPanel.cjs +15 -4
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.d.ts.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +16 -5
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/TestList.cjs +87 -0
- package/dist/data/test-runner/TestList.cjs.map +1 -0
- package/dist/data/test-runner/TestList.d.ts +9 -0
- package/dist/data/test-runner/TestList.d.ts.map +1 -0
- package/dist/data/test-runner/TestList.js +87 -0
- package/dist/data/test-runner/TestList.js.map +1 -0
- package/dist/data/test-runner/TestRunner.cjs +21 -2
- package/dist/data/test-runner/TestRunner.cjs.map +1 -1
- package/dist/data/test-runner/TestRunner.d.ts +9 -1
- package/dist/data/test-runner/TestRunner.d.ts.map +1 -1
- package/dist/data/test-runner/TestRunner.js +21 -2
- package/dist/data/test-runner/TestRunner.js.map +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
- package/dist/data/test-runner/TestTreeNode.js +1 -1
- package/dist/data/test-runner/TestTreeNode.js.map +1 -1
- package/dist/data/test-runner/TestViewToggle.cjs +32 -0
- package/dist/data/test-runner/TestViewToggle.cjs.map +1 -0
- package/dist/data/test-runner/TestViewToggle.d.ts +5 -0
- package/dist/data/test-runner/TestViewToggle.d.ts.map +1 -0
- package/dist/data/test-runner/TestViewToggle.js +32 -0
- package/dist/data/test-runner/TestViewToggle.js.map +1 -0
- package/dist/data/test-runner/adapter.cjs +14 -0
- package/dist/data/test-runner/adapter.cjs.map +1 -1
- package/dist/data/test-runner/adapter.d.ts +15 -0
- package/dist/data/test-runner/adapter.d.ts.map +1 -1
- package/dist/data/test-runner/adapter.js +14 -0
- package/dist/data/test-runner/adapter.js.map +1 -1
- package/dist/data/test-runner/context.cjs.map +1 -1
- package/dist/data/test-runner/context.d.ts +5 -0
- package/dist/data/test-runner/context.d.ts.map +1 -1
- package/dist/data/test-runner/context.js.map +1 -1
- package/dist/data/test-runner/index.d.ts +3 -0
- package/dist/data/test-runner/index.d.ts.map +1 -1
- package/dist/data/test-runner/status.cjs +5 -0
- package/dist/data/test-runner/status.cjs.map +1 -1
- package/dist/data/test-runner/status.d.ts +2 -0
- package/dist/data/test-runner/status.d.ts.map +1 -1
- package/dist/data/test-runner/status.js +5 -1
- package/dist/data/test-runner/status.js.map +1 -1
- package/dist/data/traces/index.d.ts +2 -1
- package/dist/data/traces/index.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceBrowser.cjs +173 -0
- package/dist/data/traces/otel/OtelTraceBrowser.cjs.map +1 -0
- package/dist/data/traces/otel/OtelTraceBrowser.d.ts +31 -0
- package/dist/data/traces/otel/OtelTraceBrowser.d.ts.map +1 -0
- package/dist/data/traces/otel/OtelTraceBrowser.js +173 -0
- package/dist/data/traces/otel/OtelTraceBrowser.js.map +1 -0
- package/dist/data/traces/otel/OtelTraceDetail.cjs +6 -4
- package/dist/data/traces/otel/OtelTraceDetail.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.d.ts +5 -1
- package/dist/data/traces/otel/OtelTraceDetail.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.js +6 -4
- package/dist/data/traces/otel/OtelTraceDetail.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.cjs +2 -1
- package/dist/data/traces/otel/OtelTraceSearch.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.d.ts +3 -1
- package/dist/data/traces/otel/OtelTraceSearch.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.js +2 -1
- package/dist/data/traces/otel/OtelTraceSearch.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceTable.cjs +62 -6
- package/dist/data/traces/otel/OtelTraceTable.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceTable.d.ts +22 -1
- package/dist/data/traces/otel/OtelTraceTable.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceTable.js +62 -6
- package/dist/data/traces/otel/OtelTraceTable.js.map +1 -1
- package/dist/data/traces/otel/QueryBar.cjs +23 -10
- package/dist/data/traces/otel/QueryBar.cjs.map +1 -1
- package/dist/data/traces/otel/QueryBar.d.ts +3 -1
- package/dist/data/traces/otel/QueryBar.d.ts.map +1 -1
- package/dist/data/traces/otel/QueryBar.js +23 -10
- package/dist/data/traces/otel/QueryBar.js.map +1 -1
- package/dist/data/traces/otel/browser-state.cjs +86 -0
- package/dist/data/traces/otel/browser-state.cjs.map +1 -0
- package/dist/data/traces/otel/browser-state.d.ts +22 -0
- package/dist/data/traces/otel/browser-state.d.ts.map +1 -0
- package/dist/data/traces/otel/browser-state.js +83 -0
- package/dist/data/traces/otel/browser-state.js.map +1 -0
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +17 -0
- package/dist/data.d.ts +3 -3
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +10 -3
- package/dist/file-findings/file-review/FileReview.cjs +38 -11
- package/dist/file-findings/file-review/FileReview.cjs.map +1 -1
- package/dist/file-findings/file-review/FileReview.d.ts.map +1 -1
- package/dist/file-findings/file-review/FileReview.js +39 -12
- package/dist/file-findings/file-review/FileReview.js.map +1 -1
- package/dist/file-findings/file-review/geometry.cjs +20 -15
- package/dist/file-findings/file-review/geometry.cjs.map +1 -1
- package/dist/file-findings/file-review/geometry.d.ts +5 -3
- package/dist/file-findings/file-review/geometry.d.ts.map +1 -1
- package/dist/file-findings/file-review/geometry.js +21 -16
- package/dist/file-findings/file-review/geometry.js.map +1 -1
- package/dist/file-findings/file-review/patch-comments.cjs +23 -16
- package/dist/file-findings/file-review/patch-comments.cjs.map +1 -1
- package/dist/file-findings/file-review/patch-comments.d.ts +22 -12
- package/dist/file-findings/file-review/patch-comments.d.ts.map +1 -1
- package/dist/file-findings/file-review/patch-comments.js +23 -17
- package/dist/file-findings/file-review/patch-comments.js.map +1 -1
- package/dist/file-findings/file-review/quote-anchor.cjs +23 -9
- package/dist/file-findings/file-review/quote-anchor.cjs.map +1 -1
- package/dist/file-findings/file-review/quote-anchor.d.ts +12 -2
- package/dist/file-findings/file-review/quote-anchor.d.ts.map +1 -1
- package/dist/file-findings/file-review/quote-anchor.js +22 -9
- package/dist/file-findings/file-review/quote-anchor.js.map +1 -1
- package/dist/file-findings/file-review/selection-lines.cjs +17 -8
- package/dist/file-findings/file-review/selection-lines.cjs.map +1 -1
- package/dist/file-findings/file-review/selection-lines.d.ts +3 -2
- package/dist/file-findings/file-review/selection-lines.d.ts.map +1 -1
- package/dist/file-findings/file-review/selection-lines.js +17 -8
- package/dist/file-findings/file-review/selection-lines.js.map +1 -1
- package/dist/file-findings/file-review/table-cell.cjs +95 -0
- package/dist/file-findings/file-review/table-cell.cjs.map +1 -0
- package/dist/file-findings/file-review/table-cell.d.ts +31 -0
- package/dist/file-findings/file-review/table-cell.d.ts.map +1 -0
- package/dist/file-findings/file-review/table-cell.js +92 -0
- package/dist/file-findings/file-review/table-cell.js.map +1 -0
- package/dist/file-findings.cjs +2 -0
- package/dist/file-findings.d.ts +1 -0
- package/dist/file-findings.d.ts.map +1 -1
- package/dist/file-findings.js +2 -1
- package/dist/icons/components/UiFolderGit.cjs +8 -8
- package/dist/icons/components/UiFolderGit.cjs.map +1 -1
- package/dist/icons/components/UiFolderGit.js +8 -8
- package/dist/icons/components/UiFolderGit.js.map +1 -1
- package/dist/icons/components/UiUserSwitch.cjs +51 -0
- package/dist/icons/components/UiUserSwitch.cjs.map +1 -0
- package/dist/icons/components/UiUserSwitch.d.ts +15 -0
- package/dist/icons/components/UiUserSwitch.d.ts.map +1 -0
- package/dist/icons/components/UiUserSwitch.js +48 -0
- package/dist/icons/components/UiUserSwitch.js.map +1 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/registry.cjs +2 -0
- package/dist/icons/registry.cjs.map +1 -1
- package/dist/icons/registry.d.ts.map +1 -1
- package/dist/icons/registry.js +2 -0
- package/dist/icons/registry.js.map +1 -1
- package/dist/icons.cjs +3 -0
- package/dist/icons.js +2 -1
- package/dist/index.cjs +23 -0
- package/dist/index.js +13 -3
- package/dist/jvm/model/threads.cjs +1 -1
- package/dist/jvm/model/threads.cjs.map +1 -1
- package/dist/jvm/model/threads.js +1 -1
- package/dist/jvm/model/threads.js.map +1 -1
- package/dist/lib/random-uuid.cjs +12 -0
- package/dist/lib/random-uuid.cjs.map +1 -0
- package/dist/lib/random-uuid.d.ts +2 -0
- package/dist/lib/random-uuid.d.ts.map +1 -0
- package/dist/lib/random-uuid.js +12 -0
- package/dist/lib/random-uuid.js.map +1 -0
- package/dist/overlay/Modal.cjs +22 -11
- package/dist/overlay/Modal.cjs.map +1 -1
- package/dist/overlay/Modal.d.ts +5 -1
- package/dist/overlay/Modal.d.ts.map +1 -1
- package/dist/overlay/Modal.js +22 -11
- package/dist/overlay/Modal.js.map +1 -1
- package/dist/overlay/ModalProvider.cjs +238 -0
- package/dist/overlay/ModalProvider.cjs.map +1 -0
- package/dist/overlay/ModalProvider.d.ts +10 -0
- package/dist/overlay/ModalProvider.d.ts.map +1 -0
- package/dist/overlay/ModalProvider.js +238 -0
- package/dist/overlay/ModalProvider.js.map +1 -0
- package/dist/overlay/modal-context.cjs +12 -0
- package/dist/overlay/modal-context.cjs.map +1 -0
- package/dist/overlay/modal-context.d.ts +46 -0
- package/dist/overlay/modal-context.d.ts.map +1 -0
- package/dist/overlay/modal-context.js +11 -0
- package/dist/overlay/modal-context.js.map +1 -0
- package/dist/overlay/modal-draft-storage.cjs +51 -0
- package/dist/overlay/modal-draft-storage.cjs.map +1 -0
- package/dist/overlay/modal-draft-storage.d.ts +19 -0
- package/dist/overlay/modal-draft-storage.d.ts.map +1 -0
- package/dist/overlay/modal-draft-storage.js +47 -0
- package/dist/overlay/modal-draft-storage.js.map +1 -0
- package/dist/runtime/barrels.json +8696 -8652
- package/dist/runtime/importmap.json +2116 -2103
- package/dist/styles.css +1 -1
- package/dist/utils.cjs +2 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-runtime-preset-menu.js","names":["_Fragment"],"sources":["../../../../src/data/ai/runtime-preset-menu/use-runtime-preset-menu.tsx"],"sourcesContent":["import { useRef, useState, type ReactNode } from \"react\";\nimport { UiLayers, UiSave } from \"../../../icons\";\nimport {\n newPresetRecord,\n presetForRef,\n} from \"../../../lib/runtime-profile-model\";\nimport { Modal } from \"../../../overlay/Modal\";\nimport type { DropdownMenuItem } from \"../../../overlay/DropdownMenu\";\nimport {\n assertRuntimePresetSpec,\n type RuntimePreset,\n} from \"../runtime-profile\";\nimport { presetsField } from \"../PromptRunEditor/runtimeActions\";\nimport { OrderedPresetSelect } from \"../runtime-profiles/OrderedPresetSelect\";\nimport {\n runtimeBarPresetSpec,\n withRuntimePresetSelection,\n type RuntimePresetMenuValue,\n} from \"./model\";\nimport { SavePresetDialog } from \"./SavePresetDialog\";\n\nexport type RuntimePresetMenuOptions = {\n value: RuntimePresetMenuValue;\n onChange: (next: RuntimePresetMenuValue) => void;\n presets: RuntimePreset[];\n onCreatePreset?:\n | ((draft: RuntimePreset) => Promise<RuntimePreset>)\n | undefined;\n};\n\nexport function useRuntimePresetMenu(options: RuntimePresetMenuOptions): {\n menu: DropdownMenuItem[];\n dialogs: ReactNode;\n} {\n const [ordering, setOrdering] = useState(false);\n const [draft, setDraft] = useState<RuntimePreset>();\n const [created, setCreated] = useState<RuntimePreset[]>([]);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string>();\n const pending = useRef(false);\n const latest = useRef(options);\n latest.current = options;\n const catalog = [\n ...options.presets,\n ...created.filter(\n (preset) => !options.presets.some((entry) => entry.id === preset.id),\n ),\n ];\n const select = (selected: string[]) =>\n options.onChange(\n withRuntimePresetSelection({\n value: options.value,\n selected,\n catalog,\n }),\n );\n const field = presetsField({\n presets: catalog,\n value: options.value.presets,\n onChange: select,\n onReorder: () => setOrdering(true),\n });\n const save = async (next: RuntimePreset) => {\n if (pending.current) return;\n pending.current = true;\n setSaving(true);\n setError(undefined);\n try {\n if (!options.onCreatePreset)\n throw new Error(\"Saving presets is unavailable\");\n const saved = await options.onCreatePreset(next);\n if (!saved.id.trim() || !saved.name.trim())\n throw new Error(\"Saved preset must have an id and name\");\n assertRuntimePresetSpec(saved.spec, \"saved preset spec\");\n setCreated((records) => [\n ...records.filter((preset) => preset.id !== saved.id),\n saved,\n ]);\n const current = latest.current.value;\n const alreadySelected = current.presets.some(\n (ref) =>\n ref === saved.id ||\n presetForRef(ref, [...catalog, saved])?.id === saved.id,\n );\n latest.current.onChange({\n ...current,\n presets: alreadySelected\n ? current.presets\n : [...current.presets, saved.id],\n });\n setDraft(undefined);\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n pending.current = false;\n setSaving(false);\n }\n };\n const menu: DropdownMenuItem[] = [\n {\n label: \"Presets\",\n icon: UiLayers,\n iconClassName: \"text-muted-foreground\",\n children:\n field.items.length > 0\n ? field.items\n : [\n {\n label: \"No presets yet\",\n disabled: true,\n onSelect: () => {},\n },\n ],\n onSelect: () => {},\n },\n ];\n if (options.onCreatePreset)\n menu.push({\n label: \"Save as preset…\",\n icon: UiSave,\n iconClassName: \"text-muted-foreground\",\n onSelect: () => {\n setError(undefined);\n setDraft({\n ...newPresetRecord(catalog,
|
|
1
|
+
{"version":3,"file":"use-runtime-preset-menu.js","names":["_Fragment"],"sources":["../../../../src/data/ai/runtime-preset-menu/use-runtime-preset-menu.tsx"],"sourcesContent":["import { randomUUID } from \"../../../lib/random-uuid\";\nimport { useLayoutEffect, useRef, useState, type ReactNode } from \"react\";\nimport { UiLayers, UiSave } from \"../../../icons\";\nimport {\n newPresetRecord,\n presetForRef,\n} from \"../../../lib/runtime-profile-model\";\nimport { Modal } from \"../../../overlay/Modal\";\nimport type { DropdownMenuItem } from \"../../../overlay/DropdownMenu\";\nimport {\n assertRuntimePresetSpec,\n type RuntimePreset,\n} from \"../runtime-profile\";\nimport { presetsField } from \"../PromptRunEditor/runtimeActions\";\nimport { OrderedPresetSelect } from \"../runtime-profiles/OrderedPresetSelect\";\nimport {\n runtimeBarPresetSpec,\n withRuntimePresetSelection,\n type RuntimePresetMenuValue,\n} from \"./model\";\nimport { SavePresetDialog } from \"./SavePresetDialog\";\n\nexport type RuntimePresetMenuOptions = {\n value: RuntimePresetMenuValue;\n onChange: (next: RuntimePresetMenuValue) => void;\n presets: RuntimePreset[];\n onCreatePreset?:\n | ((draft: RuntimePreset) => Promise<RuntimePreset>)\n | undefined;\n};\n\nexport function useRuntimePresetMenu(options: RuntimePresetMenuOptions): {\n menu: DropdownMenuItem[];\n dialogs: ReactNode;\n} {\n const [ordering, setOrdering] = useState(false);\n const [draft, setDraft] = useState<RuntimePreset>();\n const [created, setCreated] = useState<RuntimePreset[]>([]);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string>();\n const pending = useRef(false);\n const latest = useRef(options);\n useLayoutEffect(() => { latest.current = options; }, [options]);\n const catalog = [\n ...options.presets,\n ...created.filter(\n (preset) => !options.presets.some((entry) => entry.id === preset.id),\n ),\n ];\n const select = (selected: string[]) =>\n options.onChange(\n withRuntimePresetSelection({\n value: options.value,\n selected,\n catalog,\n }),\n );\n const field = presetsField({\n presets: catalog,\n value: options.value.presets,\n onChange: select,\n onReorder: () => setOrdering(true),\n });\n const save = async (next: RuntimePreset) => {\n if (pending.current) return;\n pending.current = true;\n setSaving(true);\n setError(undefined);\n try {\n if (!options.onCreatePreset)\n throw new Error(\"Saving presets is unavailable\");\n const saved = await options.onCreatePreset(next);\n if (!saved.id.trim() || !saved.name.trim())\n throw new Error(\"Saved preset must have an id and name\");\n assertRuntimePresetSpec(saved.spec, \"saved preset spec\");\n setCreated((records) => [\n ...records.filter((preset) => preset.id !== saved.id),\n saved,\n ]);\n const current = latest.current.value;\n const alreadySelected = current.presets.some(\n (ref) =>\n ref === saved.id ||\n presetForRef(ref, [...catalog, saved])?.id === saved.id,\n );\n latest.current.onChange({\n ...current,\n presets: alreadySelected\n ? current.presets\n : [...current.presets, saved.id],\n });\n setDraft(undefined);\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n pending.current = false;\n setSaving(false);\n }\n };\n const menu: DropdownMenuItem[] = [\n {\n label: \"Presets\",\n icon: UiLayers,\n iconClassName: \"text-muted-foreground\",\n children:\n field.items.length > 0\n ? field.items\n : [\n {\n label: \"No presets yet\",\n disabled: true,\n onSelect: () => {},\n },\n ],\n onSelect: () => {},\n },\n ];\n if (options.onCreatePreset)\n menu.push({\n label: \"Save as preset…\",\n icon: UiSave,\n iconClassName: \"text-muted-foreground\",\n onSelect: () => {\n setError(undefined);\n setDraft({\n ...newPresetRecord(catalog, randomUUID()),\n spec: runtimeBarPresetSpec(options.value.spec),\n });\n },\n });\n return {\n menu,\n dialogs: (\n <>\n <Modal\n open={ordering}\n onClose={() => setOrdering(false)}\n title=\"Presets\"\n size=\"lg\"\n closeOnEsc\n >\n <OrderedPresetSelect\n presets={catalog}\n value={options.value.presets}\n onChange={select}\n />\n </Modal>\n {draft && (\n <SavePresetDialog\n draft={draft}\n catalog={catalog}\n saving={saving}\n error={error}\n onChange={(next) => {\n setDraft(next);\n setError(undefined);\n }}\n onSave={(next) => void save(next)}\n onClose={() => {\n if (!pending.current) setDraft(undefined);\n }}\n />\n )}\n </>\n ),\n };\n}\n"],"mappings":";;;;;;;;;;;;;AA+BA,SAAgB,qBAAqB,SAGnC;CACA,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAC9C,MAAM,CAAC,OAAO,YAAY,SAAwB;CAClD,MAAM,CAAC,SAAS,cAAc,SAA0B,CAAC,CAAC;CAC1D,MAAM,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,SAAS,MAAM,EAAE;GACnC,CAAC;GACD,SAAS,KAAA,CAAS;EACpB,SAAS,OAAO;GACd,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;EACjE,UAAU;GACR,QAAQ,UAAU;GAClB,UAAU,KAAK;EACjB;CACF;CACA,MAAM,OAA2B,CAC/B;EACE,OAAO;EACP,MAAM;EACN,eAAe;EACf,UACE,MAAM,MAAM,SAAS,IACjB,MAAM,QACN,CACE;GACE,OAAO;GACP,UAAU;GACV,gBAAgB,CAAC;EACnB,CACF;EACN,gBAAgB,CAAC;CACnB,CACF;CACA,IAAI,QAAQ,gBACV,KAAK,KAAK;EACR,OAAO;EACP,MAAM;EACN,eAAe;EACf,gBAAgB;GACd,SAAS,KAAA,CAAS;GAClB,SAAS;IACP,GAAG,gBAAgB,SAAS,WAAW,CAAC;IACxC,MAAM,qBAAqB,QAAQ,MAAM,IAAI;GAC/C,CAAC;EACH;CACF,CAAC;CACH,OAAO;EACL;EACA,SACE,qBAAAA,YAAA,EAAA,UAAA,CACE,oBAAC,OAAD;GACE,MAAM;GACN,eAAe,YAAY,KAAK;GAChC,OAAM;GACN,MAAK;GACL,YAAA;GAEA,UAAA,oBAAC,qBAAD;IACE,SAAS;IACT,OAAO,QAAQ,MAAM;IACrB,UAAU;GACX,CAAA;EACI,CAAA,GACN,SACC,oBAAC,kBAAD;GACS;GACE;GACD;GACD;GACP,WAAW,SAAS;IAClB,SAAS,IAAI;IACb,SAAS,KAAA,CAAS;GACpB;GACA,SAAS,SAAS,KAAK,KAAK,IAAI;GAChC,eAAe;IACb,IAAI,CAAC,QAAQ,SAAS,SAAS,KAAA,CAAS;GAC1C;EACD,CAAA,CAEH,EAAA,CAAA;CAEN;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const require_random_uuid = require("../../../lib/random-uuid.cjs");
|
|
1
2
|
const require_utils = require("../../../lib/utils.cjs");
|
|
2
3
|
const require_runtime_profile_model = require("../../../lib/runtime-profile-model.cjs");
|
|
3
4
|
const require_PresetWorkspace = require("./PresetWorkspace.cjs");
|
|
@@ -7,7 +8,7 @@ const require_use_permission_catalog = require("./use-permission-catalog.cjs");
|
|
|
7
8
|
const require_use_resolution = require("./use-resolution.cjs");
|
|
8
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
10
|
// src/data/ai/runtime-profiles/RuntimeProfilesWorkspace.tsx
|
|
10
|
-
function RuntimeProfilesWorkspace({ presets, profiles, selectedPresetId, onSelectPreset, store, client, families, sandboxCatalog, secretSelector, persistence, recordMeta, newId = () =>
|
|
11
|
+
function RuntimeProfilesWorkspace({ presets, profiles, selectedPresetId, onSelectPreset, store, client, families, sandboxCatalog, secretSelector, persistence, recordMeta, newId = () => require_random_uuid.randomUUID(), className }) {
|
|
11
12
|
const selectedPreset = presets.find((preset) => preset.id === selectedPresetId);
|
|
12
13
|
const resolution = require_use_resolution.useRuntimePresetResolution(client, selectedPreset, presets);
|
|
13
14
|
const effectiveRuntime = resolution.result?.resolved.spec ?? selectedPreset?.spec ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeProfilesWorkspace.cjs","names":["useRuntimePresetResolution","useRuntimePermissionCatalog","referencedBy","selectionAfterDelete","cn","RuntimePersistenceBar","RuntimeStatusNotice","PresetWorkspace","newPresetRecord","duplicateRecord"],"sources":["../../../../src/data/ai/runtime-profiles/RuntimeProfilesWorkspace.tsx"],"sourcesContent":["import { cn } from \"../../../lib/utils\";\nimport type { SpecRuntimeFamily } from \"../../runtime/runtime-mode\";\nimport type { RuntimePreset, RuntimeProfile } from \"../runtime-profile\";\nimport type {\n SpecRuntimeSandboxCatalog,\n SpecRuntimeSecretSelectorConfig,\n} from \"../SpecRuntimeEditor/types\";\nimport {\n duplicateRecord,\n newPresetRecord,\n referencedBy,\n selectionAfterDelete,\n} from \"../../../lib/runtime-profile-model\";\nimport { PresetWorkspace } from \"./PresetWorkspace\";\nimport { RuntimePersistenceBar } from \"./RuntimePersistenceBar\";\nimport { RuntimeStatusNotice } from \"./RuntimeStatusNotice\";\nimport type {\n RuntimeProfilesClient,\n RuntimeProfilesPersistence,\n RuntimeProfilesStore,\n RuntimeProfilesView,\n RuntimeRecordMeta,\n} from \"./types\";\nimport { useRuntimePermissionCatalog } from \"./use-permission-catalog\";\nimport { useRuntimePresetResolution } from \"./use-resolution\";\n\nexport type RuntimeProfilesWorkspaceProps = {\n presets: RuntimePreset[];\n profiles: RuntimeProfile[];\n view: RuntimeProfilesView;\n onViewChange: (view: RuntimeProfilesView) => void;\n selectedPresetId: string | undefined;\n selectedProfileId: string | undefined;\n onSelectPreset: (id: string | undefined) => void;\n onSelectProfile: (id: string | undefined) => void;\n store: RuntimeProfilesStore;\n client: RuntimeProfilesClient;\n families: SpecRuntimeFamily[];\n sandboxCatalog?: SpecRuntimeSandboxCatalog | undefined;\n secretSelector?: SpecRuntimeSecretSelectorConfig | undefined;\n persistence?: RuntimeProfilesPersistence | undefined;\n recordMeta?: ((id: string) => RuntimeRecordMeta) | undefined;\n newId?: (() => string) | undefined;\n className?: string | undefined;\n};\n\nexport function RuntimeProfilesWorkspace({\n presets,\n profiles,\n selectedPresetId,\n onSelectPreset,\n store,\n client,\n families,\n sandboxCatalog,\n secretSelector,\n persistence,\n recordMeta,\n newId = () =>
|
|
1
|
+
{"version":3,"file":"RuntimeProfilesWorkspace.cjs","names":["randomUUID","useRuntimePresetResolution","useRuntimePermissionCatalog","referencedBy","selectionAfterDelete","cn","RuntimePersistenceBar","RuntimeStatusNotice","PresetWorkspace","newPresetRecord","duplicateRecord"],"sources":["../../../../src/data/ai/runtime-profiles/RuntimeProfilesWorkspace.tsx"],"sourcesContent":["import { randomUUID } from \"../../../lib/random-uuid\";\nimport { cn } from \"../../../lib/utils\";\nimport type { SpecRuntimeFamily } from \"../../runtime/runtime-mode\";\nimport type { RuntimePreset, RuntimeProfile } from \"../runtime-profile\";\nimport type {\n SpecRuntimeSandboxCatalog,\n SpecRuntimeSecretSelectorConfig,\n} from \"../SpecRuntimeEditor/types\";\nimport {\n duplicateRecord,\n newPresetRecord,\n referencedBy,\n selectionAfterDelete,\n} from \"../../../lib/runtime-profile-model\";\nimport { PresetWorkspace } from \"./PresetWorkspace\";\nimport { RuntimePersistenceBar } from \"./RuntimePersistenceBar\";\nimport { RuntimeStatusNotice } from \"./RuntimeStatusNotice\";\nimport type {\n RuntimeProfilesClient,\n RuntimeProfilesPersistence,\n RuntimeProfilesStore,\n RuntimeProfilesView,\n RuntimeRecordMeta,\n} from \"./types\";\nimport { useRuntimePermissionCatalog } from \"./use-permission-catalog\";\nimport { useRuntimePresetResolution } from \"./use-resolution\";\n\nexport type RuntimeProfilesWorkspaceProps = {\n presets: RuntimePreset[];\n profiles: RuntimeProfile[];\n view: RuntimeProfilesView;\n onViewChange: (view: RuntimeProfilesView) => void;\n selectedPresetId: string | undefined;\n selectedProfileId: string | undefined;\n onSelectPreset: (id: string | undefined) => void;\n onSelectProfile: (id: string | undefined) => void;\n store: RuntimeProfilesStore;\n client: RuntimeProfilesClient;\n families: SpecRuntimeFamily[];\n sandboxCatalog?: SpecRuntimeSandboxCatalog | undefined;\n secretSelector?: SpecRuntimeSecretSelectorConfig | undefined;\n persistence?: RuntimeProfilesPersistence | undefined;\n recordMeta?: ((id: string) => RuntimeRecordMeta) | undefined;\n newId?: (() => string) | undefined;\n className?: string | undefined;\n};\n\nexport function RuntimeProfilesWorkspace({\n presets,\n profiles,\n selectedPresetId,\n onSelectPreset,\n store,\n client,\n families,\n sandboxCatalog,\n secretSelector,\n persistence,\n recordMeta,\n newId = () => randomUUID(),\n className,\n}: RuntimeProfilesWorkspaceProps) {\n const selectedPreset = presets.find(\n (preset) => preset.id === selectedPresetId,\n );\n const resolution = useRuntimePresetResolution(\n client,\n selectedPreset,\n presets,\n );\n const effectiveRuntime =\n resolution.result?.resolved.spec ?? selectedPreset?.spec ?? {};\n const permissionCatalog = useRuntimePermissionCatalog(\n client,\n effectiveRuntime,\n families,\n );\n\n const addPreset = (preset: RuntimePreset) => {\n store.createPreset(preset);\n onSelectPreset(preset.id);\n };\n const deletePreset = (id: string) => {\n const preset = presets.find((item) => item.id === id);\n const references = preset ? referencedBy(preset, profiles) : [];\n if (references.length > 0) {\n throw new Error(`cannot delete preset used by ${references.join(\", \")}`);\n }\n store.deletePreset(id);\n onSelectPreset(selectionAfterDelete(presets, id, selectedPresetId));\n };\n\n return (\n <div className={cn(\"space-y-4\", className)}>\n {persistence && (\n <div className=\"flex justify-end\">\n <RuntimePersistenceBar persistence={persistence} />\n </div>\n )}\n <RuntimeStatusNotice\n status={permissionCatalog.status}\n loadingText=\"Loading Tool, MCP, Plugin, and Skill permissions from Captain…\"\n error={permissionCatalog.error}\n onRetry={permissionCatalog.retry}\n retryLabel=\"Retry permissions\"\n />\n <PresetWorkspace\n presets={presets}\n profiles={profiles}\n selectedId={selectedPresetId}\n resolution={resolution}\n tools={resolution.result?.tools ?? []}\n effectivePermissions={resolution.result?.permissions ?? {}}\n families={families}\n sandboxCatalog={sandboxCatalog}\n secretSelector={secretSelector}\n recordMeta={recordMeta}\n onSelect={onSelectPreset}\n onCreate={() => addPreset(newPresetRecord(presets, newId()))}\n onDuplicate={(id) => addPreset(duplicateRecord(presets, id, newId()))}\n onDelete={deletePreset}\n onChange={store.updatePreset}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AA+CA,SAAgB,yBAAyB,EACvC,SACA,UACA,kBACA,gBACA,OACA,QACA,UACA,gBACA,gBACA,aACA,YACA,cAAcA,oBAAAA,WAAW,GACzB,aACgC;CAChC,MAAM,iBAAiB,QAAQ,MAC5B,WAAW,OAAO,OAAO,gBAC5B;CACA,MAAM,aAAaC,uBAAAA,2BACjB,QACA,gBACA,OACF;CACA,MAAM,mBACJ,WAAW,QAAQ,SAAS,QAAQ,gBAAgB,QAAQ,CAAC;CAC/D,MAAM,oBAAoBC,+BAAAA,4BACxB,QACA,kBACA,QACF;CAEA,MAAM,aAAa,WAA0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ceRoot":"","sources":["../../../../src/data/ai/runtime-profiles/RuntimeProfilesWorkspace.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RuntimeProfilesWorkspace.d.ts","sourceRoot":"","sources":["../../../../src/data/ai/runtime-profiles/RuntimeProfilesWorkspace.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EACV,yBAAyB,EACzB,+BAA+B,EAChC,MAAM,4BAA4B,CAAC;AAUpC,OAAO,KAAK,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAIjB,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,YAAY,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAClD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACjD,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAClD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,MAAM,EAAE,qBAAqB,CAAC;IAC9B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACvD,cAAc,CAAC,EAAE,+BAA+B,GAAG,SAAS,CAAC;IAC7D,WAAW,CAAC,EAAE,0BAA0B,GAAG,SAAS,CAAC;IACrD,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,iBAAiB,CAAC,GAAG,SAAS,CAAC;IAC7D,KAAK,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,MAAM,EACN,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,UAAU,EACV,KAA0B,EAC1B,SAAS,GACV,EAAE,6BAA6B,+BAgE/B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { randomUUID } from "../../../lib/random-uuid.js";
|
|
1
2
|
import { cn } from "../../../lib/utils.js";
|
|
2
3
|
import { duplicateRecord, newPresetRecord, referencedBy, selectionAfterDelete } from "../../../lib/runtime-profile-model.js";
|
|
3
4
|
import { PresetWorkspace } from "./PresetWorkspace.js";
|
|
@@ -7,7 +8,7 @@ import { useRuntimePermissionCatalog } from "./use-permission-catalog.js";
|
|
|
7
8
|
import { useRuntimePresetResolution } from "./use-resolution.js";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
// src/data/ai/runtime-profiles/RuntimeProfilesWorkspace.tsx
|
|
10
|
-
function RuntimeProfilesWorkspace({ presets, profiles, selectedPresetId, onSelectPreset, store, client, families, sandboxCatalog, secretSelector, persistence, recordMeta, newId = () =>
|
|
11
|
+
function RuntimeProfilesWorkspace({ presets, profiles, selectedPresetId, onSelectPreset, store, client, families, sandboxCatalog, secretSelector, persistence, recordMeta, newId = () => randomUUID(), className }) {
|
|
11
12
|
const selectedPreset = presets.find((preset) => preset.id === selectedPresetId);
|
|
12
13
|
const resolution = useRuntimePresetResolution(client, selectedPreset, presets);
|
|
13
14
|
const effectiveRuntime = resolution.result?.resolved.spec ?? selectedPreset?.spec ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeProfilesWorkspace.js","names":[],"sources":["../../../../src/data/ai/runtime-profiles/RuntimeProfilesWorkspace.tsx"],"sourcesContent":["import { cn } from \"../../../lib/utils\";\nimport type { SpecRuntimeFamily } from \"../../runtime/runtime-mode\";\nimport type { RuntimePreset, RuntimeProfile } from \"../runtime-profile\";\nimport type {\n SpecRuntimeSandboxCatalog,\n SpecRuntimeSecretSelectorConfig,\n} from \"../SpecRuntimeEditor/types\";\nimport {\n duplicateRecord,\n newPresetRecord,\n referencedBy,\n selectionAfterDelete,\n} from \"../../../lib/runtime-profile-model\";\nimport { PresetWorkspace } from \"./PresetWorkspace\";\nimport { RuntimePersistenceBar } from \"./RuntimePersistenceBar\";\nimport { RuntimeStatusNotice } from \"./RuntimeStatusNotice\";\nimport type {\n RuntimeProfilesClient,\n RuntimeProfilesPersistence,\n RuntimeProfilesStore,\n RuntimeProfilesView,\n RuntimeRecordMeta,\n} from \"./types\";\nimport { useRuntimePermissionCatalog } from \"./use-permission-catalog\";\nimport { useRuntimePresetResolution } from \"./use-resolution\";\n\nexport type RuntimeProfilesWorkspaceProps = {\n presets: RuntimePreset[];\n profiles: RuntimeProfile[];\n view: RuntimeProfilesView;\n onViewChange: (view: RuntimeProfilesView) => void;\n selectedPresetId: string | undefined;\n selectedProfileId: string | undefined;\n onSelectPreset: (id: string | undefined) => void;\n onSelectProfile: (id: string | undefined) => void;\n store: RuntimeProfilesStore;\n client: RuntimeProfilesClient;\n families: SpecRuntimeFamily[];\n sandboxCatalog?: SpecRuntimeSandboxCatalog | undefined;\n secretSelector?: SpecRuntimeSecretSelectorConfig | undefined;\n persistence?: RuntimeProfilesPersistence | undefined;\n recordMeta?: ((id: string) => RuntimeRecordMeta) | undefined;\n newId?: (() => string) | undefined;\n className?: string | undefined;\n};\n\nexport function RuntimeProfilesWorkspace({\n presets,\n profiles,\n selectedPresetId,\n onSelectPreset,\n store,\n client,\n families,\n sandboxCatalog,\n secretSelector,\n persistence,\n recordMeta,\n newId = () =>
|
|
1
|
+
{"version":3,"file":"RuntimeProfilesWorkspace.js","names":[],"sources":["../../../../src/data/ai/runtime-profiles/RuntimeProfilesWorkspace.tsx"],"sourcesContent":["import { randomUUID } from \"../../../lib/random-uuid\";\nimport { cn } from \"../../../lib/utils\";\nimport type { SpecRuntimeFamily } from \"../../runtime/runtime-mode\";\nimport type { RuntimePreset, RuntimeProfile } from \"../runtime-profile\";\nimport type {\n SpecRuntimeSandboxCatalog,\n SpecRuntimeSecretSelectorConfig,\n} from \"../SpecRuntimeEditor/types\";\nimport {\n duplicateRecord,\n newPresetRecord,\n referencedBy,\n selectionAfterDelete,\n} from \"../../../lib/runtime-profile-model\";\nimport { PresetWorkspace } from \"./PresetWorkspace\";\nimport { RuntimePersistenceBar } from \"./RuntimePersistenceBar\";\nimport { RuntimeStatusNotice } from \"./RuntimeStatusNotice\";\nimport type {\n RuntimeProfilesClient,\n RuntimeProfilesPersistence,\n RuntimeProfilesStore,\n RuntimeProfilesView,\n RuntimeRecordMeta,\n} from \"./types\";\nimport { useRuntimePermissionCatalog } from \"./use-permission-catalog\";\nimport { useRuntimePresetResolution } from \"./use-resolution\";\n\nexport type RuntimeProfilesWorkspaceProps = {\n presets: RuntimePreset[];\n profiles: RuntimeProfile[];\n view: RuntimeProfilesView;\n onViewChange: (view: RuntimeProfilesView) => void;\n selectedPresetId: string | undefined;\n selectedProfileId: string | undefined;\n onSelectPreset: (id: string | undefined) => void;\n onSelectProfile: (id: string | undefined) => void;\n store: RuntimeProfilesStore;\n client: RuntimeProfilesClient;\n families: SpecRuntimeFamily[];\n sandboxCatalog?: SpecRuntimeSandboxCatalog | undefined;\n secretSelector?: SpecRuntimeSecretSelectorConfig | undefined;\n persistence?: RuntimeProfilesPersistence | undefined;\n recordMeta?: ((id: string) => RuntimeRecordMeta) | undefined;\n newId?: (() => string) | undefined;\n className?: string | undefined;\n};\n\nexport function RuntimeProfilesWorkspace({\n presets,\n profiles,\n selectedPresetId,\n onSelectPreset,\n store,\n client,\n families,\n sandboxCatalog,\n secretSelector,\n persistence,\n recordMeta,\n newId = () => randomUUID(),\n className,\n}: RuntimeProfilesWorkspaceProps) {\n const selectedPreset = presets.find(\n (preset) => preset.id === selectedPresetId,\n );\n const resolution = useRuntimePresetResolution(\n client,\n selectedPreset,\n presets,\n );\n const effectiveRuntime =\n resolution.result?.resolved.spec ?? selectedPreset?.spec ?? {};\n const permissionCatalog = useRuntimePermissionCatalog(\n client,\n effectiveRuntime,\n families,\n );\n\n const addPreset = (preset: RuntimePreset) => {\n store.createPreset(preset);\n onSelectPreset(preset.id);\n };\n const deletePreset = (id: string) => {\n const preset = presets.find((item) => item.id === id);\n const references = preset ? referencedBy(preset, profiles) : [];\n if (references.length > 0) {\n throw new Error(`cannot delete preset used by ${references.join(\", \")}`);\n }\n store.deletePreset(id);\n onSelectPreset(selectionAfterDelete(presets, id, selectedPresetId));\n };\n\n return (\n <div className={cn(\"space-y-4\", className)}>\n {persistence && (\n <div className=\"flex justify-end\">\n <RuntimePersistenceBar persistence={persistence} />\n </div>\n )}\n <RuntimeStatusNotice\n status={permissionCatalog.status}\n loadingText=\"Loading Tool, MCP, Plugin, and Skill permissions from Captain…\"\n error={permissionCatalog.error}\n onRetry={permissionCatalog.retry}\n retryLabel=\"Retry permissions\"\n />\n <PresetWorkspace\n presets={presets}\n profiles={profiles}\n selectedId={selectedPresetId}\n resolution={resolution}\n tools={resolution.result?.tools ?? []}\n effectivePermissions={resolution.result?.permissions ?? {}}\n families={families}\n sandboxCatalog={sandboxCatalog}\n secretSelector={secretSelector}\n recordMeta={recordMeta}\n onSelect={onSelectPreset}\n onCreate={() => addPreset(newPresetRecord(presets, newId()))}\n onDuplicate={(id) => addPreset(duplicateRecord(presets, id, newId()))}\n onDelete={deletePreset}\n onChange={store.updatePreset}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AA+CA,SAAgB,yBAAyB,EACvC,SACA,UACA,kBACA,gBACA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;GACjB,CAAA;EACE;;AAET"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
const require_random_uuid = require("../../../lib/random-uuid.cjs");
|
|
1
2
|
const require_runtime_profile_model = require("../../../lib/runtime-profile-model.cjs");
|
|
2
3
|
const require_RuntimeProfilePicker_model = require("./RuntimeProfilePicker.model.cjs");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
// src/data/ai/runtime-profiles/use-runtime-profile-picker.ts
|
|
5
6
|
var DETACH_NOTICE = "Detached from the authored profile spec; presets were not resolved.";
|
|
6
|
-
function useRuntimeProfilePicker({ value, onChange, profiles, presets, onSaveProfile, onCreateProfile, onResolveProfile, newId = () =>
|
|
7
|
+
function useRuntimeProfilePicker({ value, onChange, profiles, presets, onSaveProfile, onCreateProfile, onResolveProfile, newId = () => require_random_uuid.randomUUID() }) {
|
|
7
8
|
const [state, setState] = (0, react.useState)(() => require_RuntimeProfilePicker_model.pickerStateFor(value, profiles));
|
|
8
9
|
const [pending, setPending] = (0, react.useState)();
|
|
9
10
|
const [busy, setBusy] = (0, react.useState)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-runtime-profile-picker.cjs","names":["useState","pickerStateFor","profileForRef","isDraftDirty","selectProfile","afterSave","editDraft","saveAsNewDraft","presetsOf","detachedValue"],"sources":["../../../../src/data/ai/runtime-profiles/use-runtime-profile-picker.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport type { AIPromptRunValue } from \"../PromptRunEditor/model\";\nimport type {\n ResolvedRuntimeProfile,\n RuntimePreset,\n RuntimeProfile,\n RuntimeProfileResolveRequest,\n} from \"../runtime-profile\";\nimport { presetsOf } from \"../../../lib/runtime-profile-model\";\nimport {\n afterSave,\n detachedValue,\n editDraft,\n isDraftDirty,\n pickerStateFor,\n profileForRef,\n saveAsNewDraft,\n selectProfile,\n type RuntimeProfileLayer,\n type RuntimeProfilePickerState,\n} from \"./RuntimeProfilePicker.model\";\n\nexport type RuntimeProfilePickerBusy = \"save\" | \"create\" | \"detach\";\n\nexport type RuntimeProfilePickerController = {\n state: RuntimeProfilePickerState;\n dirty: boolean;\n pending: { ref: string | undefined } | undefined;\n busy: RuntimeProfilePickerBusy | undefined;\n error: string | undefined;\n notice: string | undefined;\n canSave: boolean;\n canCreate: boolean;\n select: (ref: string | undefined) => void;\n confirmPending: () => void;\n cancelPending: () => void;\n setLayer: (layer: RuntimeProfileLayer) => void;\n editDraft: (draft: RuntimeProfile) => void;\n save: () => Promise<void>;\n saveAsNew: () => Promise<void>;\n detach: () => Promise<void>;\n};\n\nconst DETACH_NOTICE =\n \"Detached from the authored profile spec; presets were not resolved.\";\n\nexport function useRuntimeProfilePicker({\n value,\n onChange,\n profiles,\n presets,\n onSaveProfile,\n onCreateProfile,\n onResolveProfile,\n newId = () =>
|
|
1
|
+
{"version":3,"file":"use-runtime-profile-picker.cjs","names":["randomUUID","useState","pickerStateFor","profileForRef","isDraftDirty","selectProfile","afterSave","editDraft","saveAsNewDraft","presetsOf","detachedValue"],"sources":["../../../../src/data/ai/runtime-profiles/use-runtime-profile-picker.ts"],"sourcesContent":["import { randomUUID } from \"../../../lib/random-uuid\";\nimport { useEffect, useState } from \"react\";\nimport type { AIPromptRunValue } from \"../PromptRunEditor/model\";\nimport type {\n ResolvedRuntimeProfile,\n RuntimePreset,\n RuntimeProfile,\n RuntimeProfileResolveRequest,\n} from \"../runtime-profile\";\nimport { presetsOf } from \"../../../lib/runtime-profile-model\";\nimport {\n afterSave,\n detachedValue,\n editDraft,\n isDraftDirty,\n pickerStateFor,\n profileForRef,\n saveAsNewDraft,\n selectProfile,\n type RuntimeProfileLayer,\n type RuntimeProfilePickerState,\n} from \"./RuntimeProfilePicker.model\";\n\nexport type RuntimeProfilePickerBusy = \"save\" | \"create\" | \"detach\";\n\nexport type RuntimeProfilePickerController = {\n state: RuntimeProfilePickerState;\n dirty: boolean;\n pending: { ref: string | undefined } | undefined;\n busy: RuntimeProfilePickerBusy | undefined;\n error: string | undefined;\n notice: string | undefined;\n canSave: boolean;\n canCreate: boolean;\n select: (ref: string | undefined) => void;\n confirmPending: () => void;\n cancelPending: () => void;\n setLayer: (layer: RuntimeProfileLayer) => void;\n editDraft: (draft: RuntimeProfile) => void;\n save: () => Promise<void>;\n saveAsNew: () => Promise<void>;\n detach: () => Promise<void>;\n};\n\nconst DETACH_NOTICE =\n \"Detached from the authored profile spec; presets were not resolved.\";\n\nexport function useRuntimeProfilePicker({\n value,\n onChange,\n profiles,\n presets,\n onSaveProfile,\n onCreateProfile,\n onResolveProfile,\n newId = () => randomUUID(),\n}: {\n value: AIPromptRunValue;\n onChange: (value: AIPromptRunValue) => void;\n profiles: RuntimeProfile[];\n presets: RuntimePreset[];\n onSaveProfile?:\n | ((profile: RuntimeProfile) => Promise<RuntimeProfile>)\n | undefined;\n onCreateProfile?:\n | ((profile: RuntimeProfile) => Promise<RuntimeProfile>)\n | undefined;\n onResolveProfile?:\n | ((\n request: RuntimeProfileResolveRequest,\n ) => Promise<ResolvedRuntimeProfile>)\n | undefined;\n newId?: (() => string) | undefined;\n}): RuntimeProfilePickerController {\n const [state, setState] = useState(() => pickerStateFor(value, profiles));\n const [pending, setPending] = useState<{ ref: string | undefined }>();\n const [busy, setBusy] = useState<RuntimeProfilePickerBusy>();\n const [error, setError] = useState<string>();\n const [notice, setNotice] = useState<string>();\n const saved = profileForRef(value.runtimeProfile, profiles);\n const dirty = isDraftDirty(state, profiles);\n\n useEffect(() => {\n const refChanged = value.runtimeProfile !== state.selectedRef;\n const draftMissing =\n saved !== undefined && state.draft?.id !== saved.id && !dirty;\n if (!refChanged && !draftMissing) return;\n setState(pickerStateFor(value, profiles));\n setPending(undefined);\n }, [value.runtimeProfile, saved]);\n\n const apply = (ref: string | undefined) => {\n const profile = profileForRef(ref, profiles);\n setState({\n selectedRef: profile?.id,\n draft: profile ? structuredClone(profile) : undefined,\n layer: \"run\",\n });\n setPending(undefined);\n setError(undefined);\n setNotice(undefined);\n onChange(selectProfile(value, profile));\n };\n\n const run = async (\n kind: RuntimeProfilePickerBusy,\n action: () => Promise<void>,\n ) => {\n setBusy(kind);\n setError(undefined);\n setNotice(undefined);\n try {\n await action();\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n setBusy(undefined);\n }\n };\n\n const persist = async (\n handler: (profile: RuntimeProfile) => Promise<RuntimeProfile>,\n draft: RuntimeProfile,\n ) => {\n const persisted = await handler(draft);\n const next = afterSave(value, state, persisted);\n setState(next.state);\n if (next.value !== value) onChange(next.value);\n };\n\n return {\n state,\n dirty,\n pending,\n busy,\n error,\n notice,\n canSave: onSaveProfile !== undefined,\n canCreate: onCreateProfile !== undefined,\n select: (ref) => {\n if (ref === state.selectedRef) return;\n if (dirty) setPending({ ref });\n else apply(ref);\n },\n confirmPending: () => {\n if (pending) apply(pending.ref);\n },\n cancelPending: () => setPending(undefined),\n setLayer: (layer) => setState((current) => ({ ...current, layer })),\n editDraft: (draft) => setState((current) => editDraft(current, draft)),\n save: () =>\n run(\"save\", async () => {\n if (!onSaveProfile || !state.draft) return;\n await persist(onSaveProfile, state.draft);\n }),\n saveAsNew: () =>\n run(\"create\", async () => {\n if (!onCreateProfile || !state.draft) return;\n await persist(\n onCreateProfile,\n saveAsNewDraft(state.draft, profiles, newId()),\n );\n }),\n detach: () =>\n run(\"detach\", async () => {\n const draft = state.draft;\n if (!draft) return;\n const resolved = onResolveProfile\n ? (\n await onResolveProfile({\n profile: draft,\n presets: presetsOf(draft, presets).found,\n })\n ).resolved.spec\n : draft.spec;\n onChange(detachedValue(value, resolved));\n setState({ selectedRef: undefined, draft: undefined, layer: \"run\" });\n if (!onResolveProfile) setNotice(DETACH_NOTICE);\n }),\n };\n}\n"],"mappings":";;;;;AA4CA,IAAM,gBACJ;AAEF,SAAgB,wBAAwB,EACtC,OACA,UACA,UACA,SACA,eACA,iBACA,kBACA,cAAcA,oBAAAA,WAAW,KAkBQ;CACjC,MAAM,CAAC,OAAO,aAAA,GAAYC,MAAAA,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O;GAAM,CAAC;GACnE,IAAI,CAAC,kBAAkB,UAAU,aAAa;EAChD,CAAC;CACL;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-runtime-profile-picker.d.ts","sourceRoot":"","sources":["../../../../src/data/ai/runtime-profiles/use-runtime-profile-picker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-runtime-profile-picker.d.ts","sourceRoot":"","sources":["../../../../src/data/ai/runtime-profiles/use-runtime-profile-picker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC/B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,yBAAyB,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAAG,SAAS,CAAC;IACjD,IAAI,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAC3C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC/C,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B,CAAC;AAKF,wBAAgB,uBAAuB,CAAC,EACtC,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,KAA0B,GAC3B,EAAE;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,aAAa,CAAC,EACV,CAAC,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,GACtD,SAAS,CAAC;IACd,eAAe,CAAC,EACZ,CAAC,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,GACtD,SAAS,CAAC;IACd,gBAAgB,CAAC,EACb,CAAC,CACC,OAAO,EAAE,4BAA4B,KAClC,OAAO,CAAC,sBAAsB,CAAC,CAAC,GACrC,SAAS,CAAC;IACd,KAAK,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;CACpC,GAAG,8BAA8B,CA2GjC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { randomUUID } from "../../../lib/random-uuid.js";
|
|
1
2
|
import { presetsOf } from "../../../lib/runtime-profile-model.js";
|
|
2
3
|
import { afterSave, detachedValue, editDraft, isDraftDirty, pickerStateFor, profileForRef, saveAsNewDraft, selectProfile } from "./RuntimeProfilePicker.model.js";
|
|
3
4
|
import { useEffect, useState } from "react";
|
|
4
5
|
// src/data/ai/runtime-profiles/use-runtime-profile-picker.ts
|
|
5
6
|
var DETACH_NOTICE = "Detached from the authored profile spec; presets were not resolved.";
|
|
6
|
-
function useRuntimeProfilePicker({ value, onChange, profiles, presets, onSaveProfile, onCreateProfile, onResolveProfile, newId = () =>
|
|
7
|
+
function useRuntimeProfilePicker({ value, onChange, profiles, presets, onSaveProfile, onCreateProfile, onResolveProfile, newId = () => randomUUID() }) {
|
|
7
8
|
const [state, setState] = useState(() => pickerStateFor(value, profiles));
|
|
8
9
|
const [pending, setPending] = useState();
|
|
9
10
|
const [busy, setBusy] = useState();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-runtime-profile-picker.js","names":[],"sources":["../../../../src/data/ai/runtime-profiles/use-runtime-profile-picker.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport type { AIPromptRunValue } from \"../PromptRunEditor/model\";\nimport type {\n ResolvedRuntimeProfile,\n RuntimePreset,\n RuntimeProfile,\n RuntimeProfileResolveRequest,\n} from \"../runtime-profile\";\nimport { presetsOf } from \"../../../lib/runtime-profile-model\";\nimport {\n afterSave,\n detachedValue,\n editDraft,\n isDraftDirty,\n pickerStateFor,\n profileForRef,\n saveAsNewDraft,\n selectProfile,\n type RuntimeProfileLayer,\n type RuntimeProfilePickerState,\n} from \"./RuntimeProfilePicker.model\";\n\nexport type RuntimeProfilePickerBusy = \"save\" | \"create\" | \"detach\";\n\nexport type RuntimeProfilePickerController = {\n state: RuntimeProfilePickerState;\n dirty: boolean;\n pending: { ref: string | undefined } | undefined;\n busy: RuntimeProfilePickerBusy | undefined;\n error: string | undefined;\n notice: string | undefined;\n canSave: boolean;\n canCreate: boolean;\n select: (ref: string | undefined) => void;\n confirmPending: () => void;\n cancelPending: () => void;\n setLayer: (layer: RuntimeProfileLayer) => void;\n editDraft: (draft: RuntimeProfile) => void;\n save: () => Promise<void>;\n saveAsNew: () => Promise<void>;\n detach: () => Promise<void>;\n};\n\nconst DETACH_NOTICE =\n \"Detached from the authored profile spec; presets were not resolved.\";\n\nexport function useRuntimeProfilePicker({\n value,\n onChange,\n profiles,\n presets,\n onSaveProfile,\n onCreateProfile,\n onResolveProfile,\n newId = () =>
|
|
1
|
+
{"version":3,"file":"use-runtime-profile-picker.js","names":[],"sources":["../../../../src/data/ai/runtime-profiles/use-runtime-profile-picker.ts"],"sourcesContent":["import { randomUUID } from \"../../../lib/random-uuid\";\nimport { useEffect, useState } from \"react\";\nimport type { AIPromptRunValue } from \"../PromptRunEditor/model\";\nimport type {\n ResolvedRuntimeProfile,\n RuntimePreset,\n RuntimeProfile,\n RuntimeProfileResolveRequest,\n} from \"../runtime-profile\";\nimport { presetsOf } from \"../../../lib/runtime-profile-model\";\nimport {\n afterSave,\n detachedValue,\n editDraft,\n isDraftDirty,\n pickerStateFor,\n profileForRef,\n saveAsNewDraft,\n selectProfile,\n type RuntimeProfileLayer,\n type RuntimeProfilePickerState,\n} from \"./RuntimeProfilePicker.model\";\n\nexport type RuntimeProfilePickerBusy = \"save\" | \"create\" | \"detach\";\n\nexport type RuntimeProfilePickerController = {\n state: RuntimeProfilePickerState;\n dirty: boolean;\n pending: { ref: string | undefined } | undefined;\n busy: RuntimeProfilePickerBusy | undefined;\n error: string | undefined;\n notice: string | undefined;\n canSave: boolean;\n canCreate: boolean;\n select: (ref: string | undefined) => void;\n confirmPending: () => void;\n cancelPending: () => void;\n setLayer: (layer: RuntimeProfileLayer) => void;\n editDraft: (draft: RuntimeProfile) => void;\n save: () => Promise<void>;\n saveAsNew: () => Promise<void>;\n detach: () => Promise<void>;\n};\n\nconst DETACH_NOTICE =\n \"Detached from the authored profile spec; presets were not resolved.\";\n\nexport function useRuntimeProfilePicker({\n value,\n onChange,\n profiles,\n presets,\n onSaveProfile,\n onCreateProfile,\n onResolveProfile,\n newId = () => randomUUID(),\n}: {\n value: AIPromptRunValue;\n onChange: (value: AIPromptRunValue) => void;\n profiles: RuntimeProfile[];\n presets: RuntimePreset[];\n onSaveProfile?:\n | ((profile: RuntimeProfile) => Promise<RuntimeProfile>)\n | undefined;\n onCreateProfile?:\n | ((profile: RuntimeProfile) => Promise<RuntimeProfile>)\n | undefined;\n onResolveProfile?:\n | ((\n request: RuntimeProfileResolveRequest,\n ) => Promise<ResolvedRuntimeProfile>)\n | undefined;\n newId?: (() => string) | undefined;\n}): RuntimeProfilePickerController {\n const [state, setState] = useState(() => pickerStateFor(value, profiles));\n const [pending, setPending] = useState<{ ref: string | undefined }>();\n const [busy, setBusy] = useState<RuntimeProfilePickerBusy>();\n const [error, setError] = useState<string>();\n const [notice, setNotice] = useState<string>();\n const saved = profileForRef(value.runtimeProfile, profiles);\n const dirty = isDraftDirty(state, profiles);\n\n useEffect(() => {\n const refChanged = value.runtimeProfile !== state.selectedRef;\n const draftMissing =\n saved !== undefined && state.draft?.id !== saved.id && !dirty;\n if (!refChanged && !draftMissing) return;\n setState(pickerStateFor(value, profiles));\n setPending(undefined);\n }, [value.runtimeProfile, saved]);\n\n const apply = (ref: string | undefined) => {\n const profile = profileForRef(ref, profiles);\n setState({\n selectedRef: profile?.id,\n draft: profile ? structuredClone(profile) : undefined,\n layer: \"run\",\n });\n setPending(undefined);\n setError(undefined);\n setNotice(undefined);\n onChange(selectProfile(value, profile));\n };\n\n const run = async (\n kind: RuntimeProfilePickerBusy,\n action: () => Promise<void>,\n ) => {\n setBusy(kind);\n setError(undefined);\n setNotice(undefined);\n try {\n await action();\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n setBusy(undefined);\n }\n };\n\n const persist = async (\n handler: (profile: RuntimeProfile) => Promise<RuntimeProfile>,\n draft: RuntimeProfile,\n ) => {\n const persisted = await handler(draft);\n const next = afterSave(value, state, persisted);\n setState(next.state);\n if (next.value !== value) onChange(next.value);\n };\n\n return {\n state,\n dirty,\n pending,\n busy,\n error,\n notice,\n canSave: onSaveProfile !== undefined,\n canCreate: onCreateProfile !== undefined,\n select: (ref) => {\n if (ref === state.selectedRef) return;\n if (dirty) setPending({ ref });\n else apply(ref);\n },\n confirmPending: () => {\n if (pending) apply(pending.ref);\n },\n cancelPending: () => setPending(undefined),\n setLayer: (layer) => setState((current) => ({ ...current, layer })),\n editDraft: (draft) => setState((current) => editDraft(current, draft)),\n save: () =>\n run(\"save\", async () => {\n if (!onSaveProfile || !state.draft) return;\n await persist(onSaveProfile, state.draft);\n }),\n saveAsNew: () =>\n run(\"create\", async () => {\n if (!onCreateProfile || !state.draft) return;\n await persist(\n onCreateProfile,\n saveAsNewDraft(state.draft, profiles, newId()),\n );\n }),\n detach: () =>\n run(\"detach\", async () => {\n const draft = state.draft;\n if (!draft) return;\n const resolved = onResolveProfile\n ? (\n await onResolveProfile({\n profile: draft,\n presets: presetsOf(draft, presets).found,\n })\n ).resolved.spec\n : draft.spec;\n onChange(detachedValue(value, resolved));\n setState({ selectedRef: undefined, draft: undefined, layer: \"run\" });\n if (!onResolveProfile) setNotice(DETACH_NOTICE);\n }),\n };\n}\n"],"mappings":";;;;;AA4CA,IAAM,gBACJ;AAEF,SAAgB,wBAAwB,EACtC,OACA,UACA,UACA,SACA,eACA,iBACA,kBACA,cAAc,WAAW,KAkBQ;CACjC,MAAM,CAAC,OAAO,YAAY,eAAe,eAAe,OAAO,QAAQ,CAAC;CACxE,MAAM,CAAC,SAAS,cAAc,SAAsC;CACpE,MAAM,CAAC,MAAM,WAAW,SAAmC;CAC3D,MAAM,CAAC,OAAO,YAAY,SAAiB;CAC3C,MAAM,CAAC,QAAQ,aAAa,SAAiB;CAC7C,MAAM,QAAQ,cAAc,MAAM,gBAAgB,QAAQ;CAC1D,MAAM,QAAQ,aAAa,OAAO,QAAQ;CAE1C,gBAAgB;EACd,MAAM,aAAa,MAAM,mBAAmB,MAAM;EAClD,MAAM,eACJ,UAAU,KAAA,KAAa,MAAM,OAAO,OAAO,MAAM,MAAM,CAAC;EAC1D,IAAI,CAAC,cAAc,CAAC,cAAc;EAClC,SAAS,eAAe,OAAO,QAAQ,CAAC;EACxC,WAAW,KAAA,CAA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CAAC,MAAM,OAAO;GACpC,MAAM,QAAQ,eAAe,MAAM,KAAK;EAC1C,CAAC;EACH,iBACE,IAAI,UAAU,YAAY;GACxB,IAAI,CAAC,mBAAmB,CAAC,MAAM,OAAO;GACtC,MAAM,QACJ,iBACA,eAAe,MAAM,OAAO,UAAU,MAAM,CAAC,CAC/C;EACF,CAAC;EACH,cACE,IAAI,UAAU,YAAY;GACxB,MAAM,QAAQ,MAAM;GACpB,IAAI,CAAC,OAAO;GACZ,MAAM,WAAW,oBAEX,MAAM,iBAAiB;IACrB,SAAS;IACT,SAAS,UAAU,OAAO,OAAO,CAAC,CAAC;GACrC,CAAC,EAAA,CACD,SAAS,OACX,MAAM;GACV,SAAS,cAAc,OAAO,QAAQ,CAAC;GACvC,SAAS;IAAE,aAAa,KAAA;IAAW,OAAO,KAAA;IAAW,OAAO;GAAM,CAAC;GACnE,IAAI,CAAC,kBAAkB,UAAU,aAAa;EAChD,CAAC;CACL;AACF"}
|
|
@@ -12,12 +12,27 @@ function isPinnedToBottom(metrics, threshold) {
|
|
|
12
12
|
function isNearTop(scrollTop, threshold) {
|
|
13
13
|
return scrollTop <= threshold;
|
|
14
14
|
}
|
|
15
|
+
var USER_SCROLL_INTENT_MS = 500;
|
|
16
|
+
var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
17
|
+
"ArrowUp",
|
|
18
|
+
"ArrowDown",
|
|
19
|
+
"PageUp",
|
|
20
|
+
"PageDown",
|
|
21
|
+
"Home",
|
|
22
|
+
"End",
|
|
23
|
+
" "
|
|
24
|
+
]);
|
|
15
25
|
function useSessionScroll(options) {
|
|
16
26
|
const { total, enabled, windowSize, batchSize, resetKey } = options;
|
|
17
27
|
const bottomThreshold = options.bottomThreshold ?? 64;
|
|
18
28
|
const topThreshold = options.topThreshold ?? 600;
|
|
19
29
|
const scrollRef = (0, react.useRef)(null);
|
|
20
|
-
const
|
|
30
|
+
const [scrollEl, setScrollEl] = (0, react.useState)(null);
|
|
31
|
+
const [contentEl, setContentEl] = (0, react.useState)(null);
|
|
32
|
+
const attachScroll = (0, react.useCallback)((node) => {
|
|
33
|
+
scrollRef.current = node;
|
|
34
|
+
setScrollEl(node);
|
|
35
|
+
}, []);
|
|
21
36
|
const followingRef = (0, react.useRef)(true);
|
|
22
37
|
const lastScrollTopRef = (0, react.useRef)(0);
|
|
23
38
|
const anchorHeightRef = (0, react.useRef)(null);
|
|
@@ -31,9 +46,7 @@ function useSessionScroll(options) {
|
|
|
31
46
|
firstKey
|
|
32
47
|
});
|
|
33
48
|
const lastScrollHeightRef = (0, react.useRef)(null);
|
|
34
|
-
const prependedRef = (0, react.useRef)(false);
|
|
35
49
|
const onReachStartRef = (0, react.useRef)(options.onReachStart);
|
|
36
|
-
onReachStartRef.current = options.onReachStart;
|
|
37
50
|
const [visibleCount, setVisibleCount] = (0, react.useState)(windowSize);
|
|
38
51
|
const [following, setFollowing] = (0, react.useState)(true);
|
|
39
52
|
const [tracked, setTracked] = (0, react.useState)({
|
|
@@ -42,10 +55,7 @@ function useSessionScroll(options) {
|
|
|
42
55
|
firstKey
|
|
43
56
|
});
|
|
44
57
|
if (tracked.resetKey !== resetKey || tracked.total !== total || tracked.firstKey !== firstKey) {
|
|
45
|
-
if (enabled && tracked.resetKey === resetKey && tracked.firstKey !== firstKey && total > tracked.total)
|
|
46
|
-
prependedRef.current = true;
|
|
47
|
-
setVisibleCount((count) => count + total - tracked.total);
|
|
48
|
-
}
|
|
58
|
+
if (enabled && tracked.resetKey === resetKey && tracked.firstKey !== firstKey && total > tracked.total) setVisibleCount((count) => count + total - tracked.total);
|
|
49
59
|
setTracked({
|
|
50
60
|
resetKey,
|
|
51
61
|
total,
|
|
@@ -55,7 +65,6 @@ function useSessionScroll(options) {
|
|
|
55
65
|
const startIndex = Math.max(0, total - (enabled ? visibleCount : total));
|
|
56
66
|
const hasMore = enabled && startIndex > 0;
|
|
57
67
|
const hasMoreRef = (0, react.useRef)(hasMore);
|
|
58
|
-
hasMoreRef.current = hasMore;
|
|
59
68
|
const scrollToBottom = (0, react.useCallback)(() => {
|
|
60
69
|
const el = scrollRef.current;
|
|
61
70
|
if (el) {
|
|
@@ -90,7 +99,15 @@ function useSessionScroll(options) {
|
|
|
90
99
|
setVisibleCount((count) => nextVisibleCount(count, batchSize, total));
|
|
91
100
|
}, [batchSize, total]);
|
|
92
101
|
const growOlderRef = (0, react.useRef)(growOlder);
|
|
93
|
-
|
|
102
|
+
(0, react.useLayoutEffect)(() => {
|
|
103
|
+
onReachStartRef.current = options.onReachStart;
|
|
104
|
+
hasMoreRef.current = hasMore;
|
|
105
|
+
growOlderRef.current = growOlder;
|
|
106
|
+
}, [
|
|
107
|
+
options.onReachStart,
|
|
108
|
+
hasMore,
|
|
109
|
+
growOlder
|
|
110
|
+
]);
|
|
94
111
|
(0, react.useLayoutEffect)(() => {
|
|
95
112
|
if (!enabled) return;
|
|
96
113
|
setVisibleCount(windowSize);
|
|
@@ -111,16 +128,12 @@ function useSessionScroll(options) {
|
|
|
111
128
|
total,
|
|
112
129
|
firstKey
|
|
113
130
|
};
|
|
114
|
-
if (enabled
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
total,
|
|
119
|
-
firstKey
|
|
120
|
-
]);
|
|
121
|
-
(0, react.useLayoutEffect)(() => {
|
|
131
|
+
if (!enabled) return;
|
|
132
|
+
const grew = previous.resetKey === resetKey && total > previous.total;
|
|
133
|
+
const prepended = grew && previous.firstKey !== firstKey;
|
|
134
|
+
if (grew && !prepended && !followingRef.current) setVisibleCount((count) => count + total - previous.total);
|
|
122
135
|
const el = scrollRef.current;
|
|
123
|
-
if (!
|
|
136
|
+
if (!el) return;
|
|
124
137
|
if (scrollStartPendingRef.current) {
|
|
125
138
|
scrollStartPendingRef.current = false;
|
|
126
139
|
el.scrollTop = 0;
|
|
@@ -129,7 +142,7 @@ function useSessionScroll(options) {
|
|
|
129
142
|
scrollBottomPendingRef.current = false;
|
|
130
143
|
anchorHeightRef.current = null;
|
|
131
144
|
scrollToBottom();
|
|
132
|
-
} else if (
|
|
145
|
+
} else if (prepended && lastScrollHeightRef.current != null) {
|
|
133
146
|
el.scrollTop += el.scrollHeight - lastScrollHeightRef.current;
|
|
134
147
|
lastScrollTopRef.current = el.scrollTop;
|
|
135
148
|
} else if (anchorHeightRef.current != null) {
|
|
@@ -137,61 +150,127 @@ function useSessionScroll(options) {
|
|
|
137
150
|
anchorHeightRef.current = null;
|
|
138
151
|
lastScrollTopRef.current = el.scrollTop;
|
|
139
152
|
} else if (followingRef.current) scrollToBottom();
|
|
140
|
-
prependedRef.current = false;
|
|
141
153
|
lastScrollHeightRef.current = el.scrollHeight;
|
|
142
154
|
loadingOlderRef.current = false;
|
|
143
155
|
}, [
|
|
144
156
|
enabled,
|
|
145
157
|
visibleCount,
|
|
146
158
|
total,
|
|
159
|
+
firstKey,
|
|
160
|
+
resetKey,
|
|
147
161
|
scrollToBottom
|
|
148
162
|
]);
|
|
149
163
|
(0, react.useEffect)(() => {
|
|
150
|
-
const el =
|
|
164
|
+
const el = scrollEl;
|
|
151
165
|
if (!enabled || !el) return;
|
|
166
|
+
let pointerHeld = false;
|
|
167
|
+
let intentUntil = 0;
|
|
168
|
+
const markIntent = () => {
|
|
169
|
+
intentUntil = performance.now() + USER_SCROLL_INTENT_MS;
|
|
170
|
+
};
|
|
171
|
+
const userScrolling = () => pointerHeld || performance.now() < intentUntil;
|
|
172
|
+
const setFollowingTo = (value) => {
|
|
173
|
+
followingRef.current = value;
|
|
174
|
+
setFollowing(value);
|
|
175
|
+
};
|
|
152
176
|
const onScroll = () => {
|
|
153
177
|
const movedUp = el.scrollTop < lastScrollTopRef.current;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
178
|
+
const pinned = isPinnedToBottom(el, bottomThreshold);
|
|
179
|
+
if (followingRef.current && userScrolling() && (movedUp || !pinned)) setFollowingTo(false);
|
|
180
|
+
else if (followingRef.current && !pinned) scrollToBottom();
|
|
158
181
|
lastScrollTopRef.current = el.scrollTop;
|
|
159
182
|
lastScrollHeightRef.current = el.scrollHeight;
|
|
160
183
|
if (movedUp && isNearTop(el.scrollTop, topThreshold)) loadOlder();
|
|
161
184
|
};
|
|
162
185
|
const onWheel = (event) => {
|
|
186
|
+
markIntent();
|
|
163
187
|
if (event.deltaY >= 0) return;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (
|
|
188
|
+
const nearTop = isNearTop(el.scrollTop, topThreshold);
|
|
189
|
+
const canLoadOlder = hasMoreRef.current || onReachStartRef.current !== void 0;
|
|
190
|
+
if (el.scrollHeight > el.clientHeight || nearTop && canLoadOlder) setFollowingTo(false);
|
|
191
|
+
if (nearTop) loadOlder();
|
|
192
|
+
};
|
|
193
|
+
const onKeyDown = (event) => {
|
|
194
|
+
if (SCROLL_KEYS.has(event.key)) markIntent();
|
|
195
|
+
};
|
|
196
|
+
const onPointerDown = () => {
|
|
197
|
+
pointerHeld = true;
|
|
198
|
+
};
|
|
199
|
+
const onPointerUp = () => {
|
|
200
|
+
pointerHeld = false;
|
|
201
|
+
markIntent();
|
|
167
202
|
};
|
|
168
203
|
const loadOlder = () => {
|
|
169
204
|
if (hasMoreRef.current) growOlderRef.current();
|
|
170
205
|
else onReachStartRef.current?.();
|
|
171
206
|
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
207
|
+
const listeners = [
|
|
208
|
+
[
|
|
209
|
+
el,
|
|
210
|
+
"scroll",
|
|
211
|
+
onScroll
|
|
212
|
+
],
|
|
213
|
+
[
|
|
214
|
+
el,
|
|
215
|
+
"wheel",
|
|
216
|
+
onWheel
|
|
217
|
+
],
|
|
218
|
+
[
|
|
219
|
+
el,
|
|
220
|
+
"touchmove",
|
|
221
|
+
markIntent
|
|
222
|
+
],
|
|
223
|
+
[
|
|
224
|
+
el,
|
|
225
|
+
"keydown",
|
|
226
|
+
onKeyDown
|
|
227
|
+
],
|
|
228
|
+
[
|
|
229
|
+
el,
|
|
230
|
+
"pointerdown",
|
|
231
|
+
onPointerDown
|
|
232
|
+
],
|
|
233
|
+
[
|
|
234
|
+
window,
|
|
235
|
+
"pointerup",
|
|
236
|
+
onPointerUp
|
|
237
|
+
],
|
|
238
|
+
[
|
|
239
|
+
window,
|
|
240
|
+
"pointercancel",
|
|
241
|
+
onPointerUp
|
|
242
|
+
]
|
|
243
|
+
];
|
|
244
|
+
const controller = new AbortController();
|
|
245
|
+
for (const [target, type, listener] of listeners) target.addEventListener(type, listener, {
|
|
246
|
+
passive: true,
|
|
247
|
+
signal: controller.signal
|
|
248
|
+
});
|
|
249
|
+
return () => controller.abort();
|
|
178
250
|
}, [
|
|
179
251
|
enabled,
|
|
252
|
+
scrollEl,
|
|
180
253
|
bottomThreshold,
|
|
181
|
-
topThreshold
|
|
254
|
+
topThreshold,
|
|
255
|
+
scrollToBottom
|
|
182
256
|
]);
|
|
183
257
|
(0, react.useEffect)(() => {
|
|
184
|
-
|
|
185
|
-
if (!enabled || !content || typeof ResizeObserver === "undefined") return;
|
|
258
|
+
if (!enabled || !scrollEl || !contentEl || typeof ResizeObserver === "undefined") return;
|
|
186
259
|
const observer = new ResizeObserver(() => {
|
|
187
260
|
if (followingRef.current) scrollToBottom();
|
|
188
261
|
});
|
|
189
|
-
observer.observe(
|
|
262
|
+
observer.observe(contentEl);
|
|
263
|
+
observer.observe(scrollEl);
|
|
190
264
|
return () => observer.disconnect();
|
|
191
|
-
}, [
|
|
265
|
+
}, [
|
|
266
|
+
enabled,
|
|
267
|
+
scrollEl,
|
|
268
|
+
contentEl,
|
|
269
|
+
scrollToBottom
|
|
270
|
+
]);
|
|
192
271
|
return {
|
|
193
|
-
scrollRef,
|
|
194
|
-
contentRef,
|
|
272
|
+
scrollRef: attachScroll,
|
|
273
|
+
contentRef: setContentEl,
|
|
195
274
|
startIndex,
|
|
196
275
|
hasMore,
|
|
197
276
|
following,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-session-scroll.cjs","names":["useRef","useState","useCallback"],"sources":["../../../src/data/ai/use-session-scroll.ts"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type RefObject,\n} from \"react\";\n\n// Progressive windowing for the SessionViewer log. A recorded session runs to\n// thousands of rows (many with syntax-highlighted code blocks), so rendering the\n// whole transcript blocks first paint. Instead we render the *newest* screenful,\n// keep the view pinned to the bottom (most recent activity), and backfill older\n// rows as the reader scrolls up — the classic reverse-infinite-scroll of a chat\n// log. The pure helpers below hold the windowing math; the hook wires the DOM\n// listeners that drive it. Load-more is driven off scroll position rather than an\n// IntersectionObserver so it stays reliable in backgrounded/hidden tabs (where the\n// browser pauses observer callbacks tied to the render loop).\n\n/** The last `visibleCount` of `items`, plus where the window starts and whether\n * older items remain above it. */\nexport function windowSlice<T>(\n items: readonly T[],\n visibleCount: number,\n): { items: T[]; startIndex: number; hasMore: boolean } {\n const clamped = Math.max(0, Math.min(visibleCount, items.length));\n const startIndex = items.length - clamped;\n return {\n items: items.slice(startIndex),\n startIndex,\n hasMore: startIndex > 0,\n };\n}\n\n/** Grow the window by `batchSize`, never past `total`. */\nexport function nextVisibleCount(\n current: number,\n batchSize: number,\n total: number,\n): number {\n return Math.min(current + Math.max(1, batchSize), total);\n}\n\n/** True when the scroll position sits within `threshold` px of the bottom. */\nexport function isPinnedToBottom(\n metrics: { scrollTop: number; scrollHeight: number; clientHeight: number },\n threshold: number,\n): boolean {\n return (\n metrics.scrollHeight - metrics.scrollTop - metrics.clientHeight <= threshold\n );\n}\n\n/** True when the scroll position sits within `threshold` px of the top. */\nexport function isNearTop(scrollTop: number, threshold: number): boolean {\n return scrollTop <= threshold;\n}\n\nexport interface SessionScrollOptions {\n /** Number of filtered events available to render. */\n total: number;\n /** Turns the whole mechanism on; when false the hook renders every event. */\n enabled: boolean;\n /** Rows rendered on first paint (and after a session change). */\n windowSize: number;\n /** Rows added each time older content is loaded. */\n batchSize: number;\n /** Changing this resets the window and re-pins to the bottom — pass a value\n * derived from the session identity, not the filter state. */\n resetKey: string;\n /** Distance (px) from the bottom still counted as \"pinned\". */\n bottomThreshold?: number;\n /** Distance (px) from the top at which older rows start loading. */\n topThreshold?: number;\n /** Identity of the first item. When it changes under the same resetKey while\n * `total` grows, older items were prepended (a fetched page of history): the\n * window grows to include them and the reader's position is kept. */\n firstKey?: string;\n /** Called as the reader scrolls up near the top with every local item\n * already rendered — the cue to fetch older history. */\n onReachStart?: () => void;\n}\n\nexport interface SessionScrollState {\n scrollRef: RefObject<HTMLDivElement | null>;\n contentRef: RefObject<HTMLDivElement | null>;\n startIndex: number;\n hasMore: boolean;\n following: boolean;\n jumpToStart: () => void;\n resumeFollowing: () => void;\n}\n\nexport function useSessionScroll(\n options: SessionScrollOptions,\n): SessionScrollState {\n const { total, enabled, windowSize, batchSize, resetKey } = options;\n const bottomThreshold = options.bottomThreshold ?? 64;\n const topThreshold = options.topThreshold ?? 600;\n\n const scrollRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const followingRef = useRef(true);\n const lastScrollTopRef = useRef(0);\n const anchorHeightRef = useRef<number | null>(null);\n const scrollStartPendingRef = useRef(false);\n const scrollBottomPendingRef = useRef(true);\n const loadingOlderRef = useRef(false);\n const firstKey = options.firstKey;\n const previousTotalRef = useRef({ resetKey, total, firstKey });\n const lastScrollHeightRef = useRef<number | null>(null);\n const prependedRef = useRef(false);\n const onReachStartRef = useRef(options.onReachStart);\n onReachStartRef.current = options.onReachStart;\n\n const [visibleCount, setVisibleCount] = useState(windowSize);\n const [following, setFollowing] = useState(true);\n // A prepend grows the window during render, so the commit that mounts the\n // older rows is the one whose layout effect restores the reader's position.\n const [tracked, setTracked] = useState({ resetKey, total, firstKey });\n if (\n tracked.resetKey !== resetKey ||\n tracked.total !== total ||\n tracked.firstKey !== firstKey\n ) {\n if (\n enabled &&\n tracked.resetKey === resetKey &&\n tracked.firstKey !== firstKey &&\n total > tracked.total\n ) {\n prependedRef.current = true;\n setVisibleCount((count) => count + total - tracked.total);\n }\n setTracked({ resetKey, total, firstKey });\n }\n const effectiveCount = enabled ? visibleCount : total;\n const startIndex = Math.max(0, total - effectiveCount);\n const hasMore = enabled && startIndex > 0;\n const hasMoreRef = useRef(hasMore);\n hasMoreRef.current = hasMore;\n\n const scrollToBottom = useCallback(() => {\n const el = scrollRef.current;\n if (el) {\n el.scrollTop = el.scrollHeight;\n lastScrollTopRef.current = el.scrollTop;\n }\n }, []);\n\n const resumeFollowing = useCallback(() => {\n scrollStartPendingRef.current = false;\n followingRef.current = true;\n setFollowing(true);\n scrollToBottom();\n }, [scrollToBottom]);\n\n const jumpToStart = useCallback(() => {\n followingRef.current = false;\n setFollowing(false);\n anchorHeightRef.current = null;\n scrollBottomPendingRef.current = false;\n if (hasMoreRef.current) {\n scrollStartPendingRef.current = true;\n setVisibleCount(total);\n } else if (scrollRef.current) {\n scrollRef.current.scrollTop = 0;\n lastScrollTopRef.current = 0;\n }\n }, [total]);\n\n // Prepend an older batch, latching until the layout effect settles the prepend so\n // rapid scroll events don't stack multiple batches at once.\n const growOlder = useCallback(() => {\n if (loadingOlderRef.current || !hasMoreRef.current) return;\n loadingOlderRef.current = true;\n const el = scrollRef.current;\n anchorHeightRef.current = el ? el.scrollHeight : null;\n setVisibleCount((count) => nextVisibleCount(count, batchSize, total));\n }, [batchSize, total]);\n\n const growOlderRef = useRef(growOlder);\n growOlderRef.current = growOlder;\n\n // A new session (resetKey change) snaps back to the newest screenful and re-pins.\n useLayoutEffect(() => {\n if (!enabled) return;\n setVisibleCount(windowSize);\n followingRef.current = true;\n setFollowing(true);\n loadingOlderRef.current = false;\n scrollStartPendingRef.current = false;\n scrollBottomPendingRef.current = true;\n }, [enabled, resetKey, windowSize]);\n\n useLayoutEffect(() => {\n const previous = previousTotalRef.current;\n previousTotalRef.current = { resetKey, total, firstKey };\n if (\n enabled &&\n previous.resetKey === resetKey &&\n previous.firstKey === firstKey &&\n !followingRef.current &&\n total > previous.total\n ) {\n setVisibleCount((count) => count + total - previous.total);\n }\n }, [enabled, resetKey, total, firstKey]);\n\n // After each commit, either snap to bottom (pending pin) or preserve the reader's\n // position when older rows were prepended (anchor), then release the load latch.\n useLayoutEffect(() => {\n const el = scrollRef.current;\n if (!enabled || !el) return;\n if (scrollStartPendingRef.current) {\n scrollStartPendingRef.current = false;\n el.scrollTop = 0;\n lastScrollTopRef.current = 0;\n } else if (scrollBottomPendingRef.current) {\n scrollBottomPendingRef.current = false;\n anchorHeightRef.current = null;\n scrollToBottom();\n } else if (prependedRef.current && lastScrollHeightRef.current != null) {\n el.scrollTop += el.scrollHeight - lastScrollHeightRef.current;\n lastScrollTopRef.current = el.scrollTop;\n } else if (anchorHeightRef.current != null) {\n el.scrollTop += el.scrollHeight - anchorHeightRef.current;\n anchorHeightRef.current = null;\n lastScrollTopRef.current = el.scrollTop;\n } else if (followingRef.current) {\n scrollToBottom();\n }\n prependedRef.current = false;\n lastScrollHeightRef.current = el.scrollHeight;\n loadingOlderRef.current = false;\n }, [enabled, visibleCount, total, scrollToBottom]);\n\n // Track pinned-to-bottom, and load older rows as the reader nears the top.\n useEffect(() => {\n const el = scrollRef.current;\n if (!enabled || !el) return;\n const onScroll = () => {\n const movedUp = el.scrollTop < lastScrollTopRef.current;\n if (movedUp || !isPinnedToBottom(el, bottomThreshold)) {\n followingRef.current = false;\n setFollowing(false);\n }\n lastScrollTopRef.current = el.scrollTop;\n lastScrollHeightRef.current = el.scrollHeight;\n if (movedUp && isNearTop(el.scrollTop, topThreshold)) loadOlder();\n };\n const onWheel = (event: WheelEvent) => {\n if (event.deltaY >= 0) return;\n followingRef.current = false;\n setFollowing(false);\n if (isNearTop(el.scrollTop, topThreshold)) loadOlder();\n };\n // Rendered rows first; once every local row is mounted, ask for history.\n const loadOlder = () => {\n if (hasMoreRef.current) growOlderRef.current();\n else onReachStartRef.current?.();\n };\n el.addEventListener(\"scroll\", onScroll, { passive: true });\n el.addEventListener(\"wheel\", onWheel, { passive: true });\n return () => {\n el.removeEventListener(\"scroll\", onScroll);\n el.removeEventListener(\"wheel\", onWheel);\n };\n }, [enabled, bottomThreshold, topThreshold]);\n\n // Keep the newest row in view as rows grow (shiki highlighting settles after paint).\n useEffect(() => {\n const content = contentRef.current;\n if (!enabled || !content || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(() => {\n if (followingRef.current) scrollToBottom();\n });\n observer.observe(content);\n return () => observer.disconnect();\n }, [enabled, scrollToBottom]);\n\n return {\n scrollRef,\n contentRef,\n startIndex,\n hasMore,\n following,\n jumpToStart,\n resumeFollowing,\n };\n}\n"],"mappings":";;;AAmCA,SAAgB,iBACd,SACA,WACA,OACQ;CACR,OAAO,KAAK,IAAI,UAAU,KAAK,IAAI,GAAG,SAAS,GAAG,KAAK;AACzD;;AAGA,SAAgB,iBACd,SACA,WACS;CACT,OACE,QAAQ,eAAe,QAAQ,YAAY,QAAQ,gBAAgB;AAEvE;;AAGA,SAAgB,UAAU,WAAmB,WAA4B;CACvE,OAAO,aAAa;AACtB;AAqCA,SAAgB,iBACd,SACoB;CACpB,MAAM,EAAE,OAAO,SAAS,YAAY,WAAW,aAAa;CAC5D,MAAM,kBAAkB,QAAQ,mBAAmB;CACnD,MAAM,eAAe,QAAQ,gBAAgB;CAE7C,MAAM,aAAA,GAAYA,MAAAA,OAAAA,CAAuB,IAAI;CAC7C,MAAM,cAAA,GAAaA,MAAAA,OAAAA,CAAuB,IAAI;CAC9C,MAAM,gBAAA,GAAeA,MAAAA,OAAAA,CAAO,IAAI;CAChC,MAAM,oBAAA,GAAmBA,MAAAA,OAAAA,CAAO,CAAC;CACjC,MAAM,mBAAA,GAAkBA,MAAAA,OAAAA,CAAsB,IAAI;CAClD,MAAM,yBAAA,GAAwBA,MAAAA,OAAAA,CAAO,KAAK;CAC1C,MAAM,0BAAA,GAAyBA,MAAAA,OAAAA,CAAO,IAAI;CAC1C,MAAM,mBAAA,GAAkBA,MAAAA,OAAAA,CA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BAAiB,UAAU,UAAU,EAAE,SAAS,KAAK,CAAC;EACzD,GAAG,iBAAiB,SAAS,SAAS,EAAE,SAAS,KAAK,CAAC;EACvD,aAAa;GACX,GAAG,oBAAoB,UAAU,QAAQ;GACzC,GAAG,oBAAoB,SAAS,OAAO;EACzC;CACF,GAAG;EAAC;EAAS;EAAiB;CAAY,CAAC;CAG3C,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,WAAW,CAAC,WAAW,OAAO,mBAAmB,aAAa;EACnE,MAAM,WAAW,IAAI,qBAAqB;GACxC,IAAI,aAAa,SAAS,eAAe;EAC3C,CAAC;EACD,SAAS,QAAQ,OAAO;EACxB,aAAa,SAAS,WAAW;CACnC,GAAG,CAAC,SAAS,cAAc,CAAC;CAE5B,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"use-session-scroll.cjs","names":["useRef","useState","useCallback"],"sources":["../../../src/data/ai/use-session-scroll.ts"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type RefCallback,\n} from \"react\";\n\n// Progressive windowing for the SessionViewer log. A recorded session runs to\n// thousands of rows (many with syntax-highlighted code blocks), so rendering the\n// whole transcript blocks first paint. Instead we render the *newest* screenful,\n// keep the view pinned to the bottom (most recent activity), and backfill older\n// rows as the reader scrolls up — the classic reverse-infinite-scroll of a chat\n// log. The pure helpers below hold the windowing math; the hook wires the DOM\n// listeners that drive it. Load-more is driven off scroll position rather than an\n// IntersectionObserver so it stays reliable in backgrounded/hidden tabs (where the\n// browser pauses observer callbacks tied to the render loop).\n\n/** The last `visibleCount` of `items`, plus where the window starts and whether\n * older items remain above it. */\nexport function windowSlice<T>(\n items: readonly T[],\n visibleCount: number,\n): { items: T[]; startIndex: number; hasMore: boolean } {\n const clamped = Math.max(0, Math.min(visibleCount, items.length));\n const startIndex = items.length - clamped;\n return {\n items: items.slice(startIndex),\n startIndex,\n hasMore: startIndex > 0,\n };\n}\n\n/** Grow the window by `batchSize`, never past `total`. */\nexport function nextVisibleCount(\n current: number,\n batchSize: number,\n total: number,\n): number {\n return Math.min(current + Math.max(1, batchSize), total);\n}\n\n/** True when the scroll position sits within `threshold` px of the bottom. */\nexport function isPinnedToBottom(\n metrics: { scrollTop: number; scrollHeight: number; clientHeight: number },\n threshold: number,\n): boolean {\n return (\n metrics.scrollHeight - metrics.scrollTop - metrics.clientHeight <= threshold\n );\n}\n\n/** True when the scroll position sits within `threshold` px of the top. */\nexport function isNearTop(scrollTop: number, threshold: number): boolean {\n return scrollTop <= threshold;\n}\n\n// How long after a wheel, touch, key or pointer release a scroll event is still\n// attributed to the reader (smooth scrolling keeps emitting after the input).\nconst USER_SCROLL_INTENT_MS = 500;\nconst SCROLL_KEYS = new Set([\"ArrowUp\", \"ArrowDown\", \"PageUp\", \"PageDown\", \"Home\", \"End\", \" \"]);\n\nexport interface SessionScrollOptions {\n /** Number of filtered events available to render. */\n total: number;\n /** Turns the whole mechanism on; when false the hook renders every event. */\n enabled: boolean;\n /** Rows rendered on first paint (and after a session change). */\n windowSize: number;\n /** Rows added each time older content is loaded. */\n batchSize: number;\n /** Changing this resets the window and re-pins to the bottom — pass a value\n * derived from the session identity, not the filter state. */\n resetKey: string;\n /** Distance (px) from the bottom still counted as \"pinned\". */\n bottomThreshold?: number;\n /** Distance (px) from the top at which older rows start loading. */\n topThreshold?: number;\n /** Identity of the first item. When it changes under the same resetKey while\n * `total` grows, older items were prepended (a fetched page of history): the\n * window grows to include them and the reader's position is kept. */\n firstKey?: string;\n /** Called as the reader scrolls up near the top with every local item\n * already rendered — the cue to fetch older history. */\n onReachStart?: () => void;\n}\n\nexport interface SessionScrollState {\n scrollRef: RefCallback<HTMLDivElement>;\n contentRef: RefCallback<HTMLDivElement>;\n startIndex: number;\n hasMore: boolean;\n following: boolean;\n jumpToStart: () => void;\n resumeFollowing: () => void;\n}\n\nexport function useSessionScroll(\n options: SessionScrollOptions,\n): SessionScrollState {\n const { total, enabled, windowSize, batchSize, resetKey } = options;\n const bottomThreshold = options.bottomThreshold ?? 64;\n const topThreshold = options.topThreshold ?? 600;\n\n // The container mounts only once the session has events, so its listeners and\n // observers key off the mounted element rather than the first render's ref.\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const [scrollEl, setScrollEl] = useState<HTMLDivElement | null>(null);\n const [contentEl, setContentEl] = useState<HTMLDivElement | null>(null);\n const attachScroll = useCallback((node: HTMLDivElement | null) => {\n scrollRef.current = node;\n setScrollEl(node);\n }, []);\n const followingRef = useRef(true);\n const lastScrollTopRef = useRef(0);\n const anchorHeightRef = useRef<number | null>(null);\n const scrollStartPendingRef = useRef(false);\n const scrollBottomPendingRef = useRef(true);\n const loadingOlderRef = useRef(false);\n const firstKey = options.firstKey;\n const previousTotalRef = useRef({ resetKey, total, firstKey });\n const lastScrollHeightRef = useRef<number | null>(null);\n const onReachStartRef = useRef(options.onReachStart);\n\n const [visibleCount, setVisibleCount] = useState(windowSize);\n const [following, setFollowing] = useState(true);\n // A prepend grows the window during render, so the commit that mounts the\n // older rows is the one whose layout effect restores the reader's position.\n const [tracked, setTracked] = useState({ resetKey, total, firstKey });\n if (\n tracked.resetKey !== resetKey ||\n tracked.total !== total ||\n tracked.firstKey !== firstKey\n ) {\n if (\n enabled &&\n tracked.resetKey === resetKey &&\n tracked.firstKey !== firstKey &&\n total > tracked.total\n ) {\n setVisibleCount((count) => count + total - tracked.total);\n }\n setTracked({ resetKey, total, firstKey });\n }\n const effectiveCount = enabled ? visibleCount : total;\n const startIndex = Math.max(0, total - effectiveCount);\n const hasMore = enabled && startIndex > 0;\n const hasMoreRef = useRef(hasMore);\n\n const scrollToBottom = useCallback(() => {\n const el = scrollRef.current;\n if (el) {\n el.scrollTop = el.scrollHeight;\n lastScrollTopRef.current = el.scrollTop;\n }\n }, []);\n\n const resumeFollowing = useCallback(() => {\n scrollStartPendingRef.current = false;\n followingRef.current = true;\n setFollowing(true);\n scrollToBottom();\n }, [scrollToBottom]);\n\n const jumpToStart = useCallback(() => {\n followingRef.current = false;\n setFollowing(false);\n anchorHeightRef.current = null;\n scrollBottomPendingRef.current = false;\n if (hasMoreRef.current) {\n scrollStartPendingRef.current = true;\n setVisibleCount(total);\n } else if (scrollRef.current) {\n scrollRef.current.scrollTop = 0;\n lastScrollTopRef.current = 0;\n }\n }, [total]);\n\n // Prepend an older batch, latching until the layout effect settles the prepend so\n // rapid scroll events don't stack multiple batches at once.\n const growOlder = useCallback(() => {\n if (loadingOlderRef.current || !hasMoreRef.current) return;\n loadingOlderRef.current = true;\n const el = scrollRef.current;\n anchorHeightRef.current = el ? el.scrollHeight : null;\n setVisibleCount((count) => nextVisibleCount(count, batchSize, total));\n }, [batchSize, total]);\n\n const growOlderRef = useRef(growOlder);\n useLayoutEffect(() => {\n onReachStartRef.current = options.onReachStart;\n hasMoreRef.current = hasMore;\n growOlderRef.current = growOlder;\n }, [options.onReachStart, hasMore, growOlder]);\n\n // A new session (resetKey change) snaps back to the newest screenful and re-pins.\n useLayoutEffect(() => {\n if (!enabled) return;\n setVisibleCount(windowSize);\n followingRef.current = true;\n setFollowing(true);\n loadingOlderRef.current = false;\n scrollStartPendingRef.current = false;\n scrollBottomPendingRef.current = true;\n }, [enabled, resetKey, windowSize]);\n\n // After each commit, either snap to bottom (pending pin) or preserve the reader's\n // position when older rows were prepended (anchor), then release the load latch.\n useLayoutEffect(() => {\n const previous = previousTotalRef.current;\n previousTotalRef.current = { resetKey, total, firstKey };\n if (!enabled) return;\n const grew = previous.resetKey === resetKey && total > previous.total;\n const prepended = grew && previous.firstKey !== firstKey;\n if (grew && !prepended && !followingRef.current) {\n setVisibleCount((count) => count + total - previous.total);\n }\n const el = scrollRef.current;\n if (!el) return;\n if (scrollStartPendingRef.current) {\n scrollStartPendingRef.current = false;\n el.scrollTop = 0;\n lastScrollTopRef.current = 0;\n } else if (scrollBottomPendingRef.current) {\n scrollBottomPendingRef.current = false;\n anchorHeightRef.current = null;\n scrollToBottom();\n } else if (prepended && lastScrollHeightRef.current != null) {\n el.scrollTop += el.scrollHeight - lastScrollHeightRef.current;\n lastScrollTopRef.current = el.scrollTop;\n } else if (anchorHeightRef.current != null) {\n el.scrollTop += el.scrollHeight - anchorHeightRef.current;\n anchorHeightRef.current = null;\n lastScrollTopRef.current = el.scrollTop;\n } else if (followingRef.current) {\n scrollToBottom();\n }\n lastScrollHeightRef.current = el.scrollHeight;\n loadingOlderRef.current = false;\n }, [enabled, visibleCount, total, firstKey, resetKey, scrollToBottom]);\n\n // Only the reader pauses following. Scroll events also fire for our own\n // programmatic pins and for layout shifts (rows highlighting, the viewport\n // resizing), and those land before the ResizeObserver re-pins — so a scroll\n // that no user input caused re-pins instead of pausing.\n useEffect(() => {\n const el = scrollEl;\n if (!enabled || !el) return;\n let pointerHeld = false;\n let intentUntil = 0;\n const markIntent = () => {\n intentUntil = performance.now() + USER_SCROLL_INTENT_MS;\n };\n const userScrolling = () => pointerHeld || performance.now() < intentUntil;\n const setFollowingTo = (value: boolean) => {\n followingRef.current = value;\n setFollowing(value);\n };\n const onScroll = () => {\n const movedUp = el.scrollTop < lastScrollTopRef.current;\n const pinned = isPinnedToBottom(el, bottomThreshold);\n if (followingRef.current && userScrolling() && (movedUp || !pinned)) {\n setFollowingTo(false);\n } else if (followingRef.current && !pinned) {\n scrollToBottom();\n }\n lastScrollTopRef.current = el.scrollTop;\n lastScrollHeightRef.current = el.scrollHeight;\n if (movedUp && isNearTop(el.scrollTop, topThreshold)) loadOlder();\n };\n const onWheel = (event: WheelEvent) => {\n markIntent();\n if (event.deltaY >= 0) return;\n const nearTop = isNearTop(el.scrollTop, topThreshold);\n const canLoadOlder = hasMoreRef.current || onReachStartRef.current !== undefined;\n // A log that fits without scrolling has nowhere to scroll up to, unless\n // the gesture is about to load older rows above it.\n if (el.scrollHeight > el.clientHeight || (nearTop && canLoadOlder)) setFollowingTo(false);\n if (nearTop) loadOlder();\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (SCROLL_KEYS.has(event.key)) markIntent();\n };\n const onPointerDown = () => {\n pointerHeld = true;\n };\n const onPointerUp = () => {\n pointerHeld = false;\n markIntent();\n };\n // Rendered rows first; once every local row is mounted, ask for history.\n const loadOlder = () => {\n if (hasMoreRef.current) growOlderRef.current();\n else onReachStartRef.current?.();\n };\n const listeners: [EventTarget, string, EventListener][] = [\n [el, \"scroll\", onScroll],\n [el, \"wheel\", onWheel as EventListener],\n [el, \"touchmove\", markIntent],\n [el, \"keydown\", onKeyDown as EventListener],\n [el, \"pointerdown\", onPointerDown],\n [window, \"pointerup\", onPointerUp],\n [window, \"pointercancel\", onPointerUp],\n ];\n const controller = new AbortController();\n for (const [target, type, listener] of listeners) {\n target.addEventListener(type, listener, { passive: true, signal: controller.signal });\n }\n return () => controller.abort();\n }, [enabled, scrollEl, bottomThreshold, topThreshold, scrollToBottom]);\n\n // Keep the newest row in view as rows grow (shiki highlighting settles after\n // paint) and as the viewport itself resizes (a drawer or panel opening).\n useEffect(() => {\n if (!enabled || !scrollEl || !contentEl || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(() => {\n if (followingRef.current) scrollToBottom();\n });\n observer.observe(contentEl);\n observer.observe(scrollEl);\n return () => observer.disconnect();\n }, [enabled, scrollEl, contentEl, scrollToBottom]);\n\n return {\n scrollRef: attachScroll,\n contentRef: setContentEl,\n startIndex,\n hasMore,\n following,\n jumpToStart,\n resumeFollowing,\n };\n}\n"],"mappings":";;;AAmCA,SAAgB,iBACd,SACA,WACA,OACQ;CACR,OAAO,KAAK,IAAI,UAAU,KAAK,IAAI,GAAG,SAAS,GAAG,KAAK;AACzD;;AAGA,SAAgB,iBACd,SACA,WACS;CACT,OACE,QAAQ,eAAe,QAAQ,YAAY,QAAQ,gBAAgB;AAEvE;;AAGA,SAAgB,UAAU,WAAmB,WAA4B;CACvE,OAAO,aAAa;AACtB;AAIA,IAAM,wBAAwB;AAC9B,IAAM,8BAA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