windmill-components 1.613.5 → 1.623.2
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/package/cancelable-promise-utils.js +4 -2
- package/package/components/ApiConnectForm.svelte +6 -0
- package/package/components/AppConnectDrawer.svelte +1 -0
- package/package/components/AppConnectInner.svelte +1 -0
- package/package/components/AuthSettings.svelte +3 -1
- package/package/components/BedrockCredentialsCheck.svelte +241 -0
- package/package/components/BedrockCredentialsCheck.svelte.d.ts +3 -0
- package/package/components/CenteredPage.svelte +2 -1
- package/package/components/CenteredPage.svelte.d.ts +1 -0
- package/package/components/CompareWorkspaces.svelte +74 -16
- package/package/components/DBManager.svelte +35 -31
- package/package/components/DBManager.svelte.d.ts +13 -3
- package/package/components/DBManagerContent.svelte +23 -62
- package/package/components/DBManagerContent.svelte.d.ts +37 -3
- package/package/components/DBManagerDrawer.svelte +7 -9
- package/package/components/DBTable.svelte +1 -1
- package/package/components/DBTable.svelte.d.ts +3 -1
- package/package/components/DBTableEditor.svelte +66 -49
- package/package/components/DBTableEditor.svelte.d.ts +1 -1
- package/package/components/DateInput.svelte +29 -35
- package/package/components/DateInput.svelte.d.ts +10 -11
- package/package/components/DedicatedWorkersSelector.svelte +569 -0
- package/package/components/DedicatedWorkersSelector.svelte.d.ts +8 -0
- package/package/components/DeployWorkspace.svelte +106 -29
- package/package/components/DropdownV2.svelte +2 -1
- package/package/components/DropdownV2.svelte.d.ts +1 -0
- package/package/components/Editor.svelte +1 -10
- package/package/components/FlowGraphViewer.svelte +5 -2
- package/package/components/FlowGraphViewer.svelte.d.ts +2 -0
- package/package/components/FlowLoopIterationPreview.svelte.d.ts +1 -1
- package/package/components/FlowPreviewContent.svelte.d.ts +1 -1
- package/package/components/FlowStatusViewerInner.svelte +6 -3
- package/package/components/ForkWorkspaceBanner.svelte +16 -0
- package/package/components/InfiniteList.svelte +27 -20
- package/package/components/InfiniteList.svelte.d.ts +2 -0
- package/package/components/JobLoader.svelte.d.ts +1 -1
- package/package/components/Login.svelte +6 -0
- package/package/components/NextcloudSetting.svelte +1 -1
- package/package/components/OAuthSetting.svelte +12 -23
- package/package/components/PocketIdSetting.svelte +82 -0
- package/package/components/PocketIdSetting.svelte.d.ts +6 -0
- package/package/components/ResourceEditor.svelte +4 -4
- package/package/components/ResourcePicker.svelte +1 -0
- package/package/components/RunForm.svelte +9 -17
- package/package/components/RunForm.svelte.d.ts +0 -1
- package/package/components/RunsPage.svelte +34 -0
- package/package/components/SavedInputsPicker.svelte +1 -1
- package/package/components/SavedInputsV2.svelte +35 -36
- package/package/components/Section.svelte +1 -1
- package/package/components/Star.svelte +8 -12
- package/package/components/Star.svelte.d.ts +6 -19
- package/package/components/StringTypeNarrowing.svelte.d.ts +1 -1
- package/package/components/TimeAgo.svelte +49 -7
- package/package/components/TimeAgo.svelte.d.ts +1 -0
- package/package/components/Toast.svelte +5 -1
- package/package/components/WorkerGroup.svelte +35 -20
- package/package/components/WorkerGroup.svelte.d.ts +1 -0
- package/package/components/apps/components/display/InsertRowDrawerButton.svelte +1 -1
- package/package/components/apps/components/display/dbtable/AppDbExplorer.svelte +2 -1
- package/package/components/apps/components/display/dbtable/dbFeatures.d.ts +9 -0
- package/package/components/apps/components/display/dbtable/dbFeatures.js +32 -0
- package/package/components/apps/components/display/dbtable/metadata.d.ts +3 -3
- package/package/components/apps/components/display/dbtable/metadata.js +120 -130
- package/package/components/apps/components/display/dbtable/queries/alterTable.js +13 -5
- package/package/components/apps/components/display/dbtable/queries/alterTable.test.js +1 -1
- package/package/components/apps/components/display/dbtable/queries/createTable.js +2 -0
- package/package/components/apps/components/display/dbtable/queries/relationalKeys.d.ts +1 -3
- package/package/components/apps/components/display/dbtable/queries/relationalKeys.js +41 -42
- package/package/components/apps/components/display/dbtable/tableEditor.js +18 -0
- package/package/components/apps/components/display/dbtable/utils.d.ts +1 -8
- package/package/components/apps/components/display/dbtable/utils.js +27 -34
- package/package/components/apps/components/display/table/AppAggridTable.svelte +8 -0
- package/package/components/apps/components/display/table/AppAggridTableActions.svelte +9 -9
- package/package/components/apps/components/display/table/AppAggridTableActions.svelte.d.ts +1 -1
- package/package/components/apps/components/inputs/AppMultiSelectV2.svelte +2 -4
- package/package/components/assets/AssetsDropdownButton.svelte +1 -1
- package/package/components/assets/AssetsUsageDrawer.svelte +98 -27
- package/package/components/assets/AssetsUsageDrawer.svelte.d.ts +5 -6
- package/package/components/assets/lib.d.ts +3 -2
- package/package/components/assets/lib.js +3 -1
- package/package/components/common/CloseButton.svelte +2 -1
- package/package/components/common/CloseButton.svelte.d.ts +1 -0
- package/package/components/common/badge/CountBadge.svelte +4 -3
- package/package/components/common/badge/CountBadge.svelte.d.ts +1 -0
- package/package/components/common/button/Button.svelte +1 -1
- package/package/components/common/confirmationModal/ConfirmationModal.svelte +2 -1
- package/package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +1 -0
- package/package/components/common/drawer/Drawer.svelte +4 -1
- package/package/components/common/drawer/DrawerContent.svelte +6 -3
- package/package/components/common/drawer/DrawerContent.svelte.d.ts +1 -0
- package/package/components/common/modal/Modal2.svelte +1 -0
- package/package/components/common/table/AppRow.svelte +4 -1
- package/package/components/common/table/FlowRow.svelte +4 -1
- package/package/components/common/table/RawAppRow.svelte +4 -1
- package/package/components/common/table/Row.svelte +11 -21
- package/package/components/common/table/Row.svelte.d.ts +4 -20
- package/package/components/common/table/RowIcon.svelte +6 -2
- package/package/components/common/table/RowIcon.svelte.d.ts +1 -1
- package/package/components/common/table/ScriptRow.svelte +4 -1
- package/package/components/copilot/autocomplete/Autocompletor.d.ts +1 -1
- package/package/components/copilot/autocomplete/Autocompletor.js +4 -4
- package/package/components/copilot/autocomplete/request.js +13 -9
- package/package/components/copilot/chat/script/core.js +5 -4
- package/package/components/copilot/lib.js +2 -9
- package/package/components/copilot/utils.d.ts +5 -0
- package/package/components/copilot/utils.js +8 -0
- package/package/components/dbOps.d.ts +1 -1
- package/package/components/dbOps.js +2 -2
- package/package/components/details/DetailPageHeader.svelte +21 -7
- package/package/components/details/DetailPageHeader.svelte.d.ts +2 -1
- package/package/components/details/DetailPageLayout.svelte +10 -1
- package/package/components/details/DetailPageLayout.svelte.d.ts +1 -0
- package/package/components/flows/conversations/FlowConversationsSidebar.svelte +79 -77
- package/package/components/flows/propPicker/OutputPickerInner.svelte.d.ts +1 -1
- package/package/components/graph/FlowGraphV2.svelte +7 -1
- package/package/components/graph/renderers/triggers/TriggersBadge.svelte +41 -24
- package/package/components/home/ItemsList.svelte +2 -1
- package/package/components/home/treeViewUtils.js +1 -1
- package/package/components/icons/NextcloudIcon.svelte +3 -2
- package/package/components/icons/NextcloudIcon.svelte.d.ts +2 -0
- package/package/components/icons/PocketIdIcon.svelte +9 -0
- package/package/components/icons/PocketIdIcon.svelte.d.ts +9 -0
- package/package/components/icons/index.js +3 -1
- package/package/components/instanceSettings.d.ts +1 -1
- package/package/components/instanceSettings.js +1 -0
- package/package/components/raw_apps/RawAppDataTableDrawer.svelte +1 -3
- package/package/components/raw_apps/datatableUtils.svelte.js +1 -1
- package/package/components/schema/EditableSchemaWrapper.svelte +2 -2
- package/package/components/select/MultiSelect.svelte +1 -1
- package/package/components/select/SelectDropdown.svelte +15 -3
- package/package/components/settings/ChangeWorkspaceId.svelte +8 -7
- package/package/components/settings/CreateToken.svelte +3 -3
- package/package/components/settings/WorkspaceUserSettings.svelte +6 -5
- package/package/components/sidebar/MenuButton.svelte +13 -5
- package/package/components/sidebar/MultiplayerMenu.svelte +2 -2
- package/package/components/sidebar/SidebarContent.svelte +32 -4
- package/package/components/sidebar/UserMenu.svelte +2 -2
- package/package/components/table/DataTable.svelte +6 -2
- package/package/components/table/DataTable.svelte.d.ts +1 -0
- package/package/components/triggers/AddTriggersButton.svelte +17 -4
- package/package/components/triggers/TriggersEditor.svelte +4 -0
- package/package/components/triggers/TriggersWrapper.svelte +14 -0
- package/package/components/triggers/native/NativeTriggerEditor.svelte +379 -0
- package/package/components/triggers/native/NativeTriggerEditor.svelte.d.ts +26 -0
- package/package/components/triggers/native/NativeTriggerTable.svelte +155 -0
- package/package/components/triggers/native/NativeTriggerTable.svelte.d.ts +16 -0
- package/package/components/triggers/native/NativeTriggersPanel.svelte +40 -0
- package/package/components/triggers/native/NativeTriggersPanel.svelte.d.ts +15 -0
- package/package/components/triggers/native/services/nextcloud/NextcloudTriggerForm.svelte +104 -0
- package/package/components/triggers/native/services/nextcloud/NextcloudTriggerForm.svelte.d.ts +18 -0
- package/package/components/triggers/native/utils.d.ts +74 -0
- package/package/components/triggers/native/utils.js +152 -0
- package/package/components/triggers/triggers.svelte.d.ts +2 -1
- package/package/components/triggers/triggers.svelte.js +36 -8
- package/package/components/triggers/utils.js +18 -5
- package/package/components/triggers.d.ts +1 -1
- package/package/components/workspaceSettings/AISettings.svelte +2 -1
- package/package/components/workspaceSettings/CustomInstanceDbSelect.svelte +1 -0
- package/package/components/workspaceSettings/CustomInstanceDbWizardModal.svelte +3 -1
- package/package/components/workspaceSettings/DataTableSettings.svelte +2 -1
- package/package/components/workspaceSettings/DucklakeSettings.svelte +8 -3
- package/package/components/workspaceSettings/OAuthClientConfig.svelte +180 -0
- package/package/components/workspaceSettings/OAuthClientConfig.svelte.d.ts +14 -0
- package/package/components/workspaceSettings/StorageSettings.svelte +7 -2
- package/package/components/workspaceSettings/WorkspaceIntegrations.svelte +302 -0
- package/package/components/workspaceSettings/WorkspaceIntegrations.svelte.d.ts +3 -0
- package/package/consts.js +0 -2
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +384 -3
- package/package/gen/schemas.gen.js +390 -3
- package/package/gen/services.gen.d.ts +200 -13
- package/package/gen/services.gen.js +383 -24
- package/package/gen/types.gen.d.ts +884 -94
- package/package/hub.js +2 -2
- package/package/hubPaths.json +1 -1
- package/package/refreshUser.d.ts +5 -1
- package/package/refreshUser.js +20 -30
- package/package/storeUtils.js +2 -0
- package/package/svelte5Utils.svelte.d.ts +61 -0
- package/package/svelte5Utils.svelte.js +170 -0
- package/package/utils.js +3 -0
- package/package.json +4 -6
- package/dist/sharedUtils/assets/tokens/colorTokensConfig.d.ts +0 -2
- package/dist/sharedUtils/base.d.ts +0 -1
- package/dist/sharedUtils/cloud.d.ts +0 -1
- package/dist/sharedUtils/common.d.ts +0 -111
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/count.d.ts +0 -5
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/delete.d.ts +0 -5
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/insert.d.ts +0 -5
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/select.d.ts +0 -13
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/update.d.ts +0 -11
- package/dist/sharedUtils/components/apps/components/display/dbtable/utils.d.ts +0 -95
- package/dist/sharedUtils/components/apps/editor/appPolicy.d.ts +0 -6
- package/dist/sharedUtils/components/apps/editor/appUtilsCore.d.ts +0 -7
- package/dist/sharedUtils/components/apps/editor/appUtilsS3.d.ts +0 -33
- package/dist/sharedUtils/components/apps/editor/commonAppUtils.d.ts +0 -10
- package/dist/sharedUtils/components/apps/editor/component/components.d.ts +0 -5371
- package/dist/sharedUtils/components/apps/editor/component/default-codes.d.ts +0 -3
- package/dist/sharedUtils/components/apps/editor/component/index.d.ts +0 -3
- package/dist/sharedUtils/components/apps/editor/component/sets.d.ts +0 -7
- package/dist/sharedUtils/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +0 -3
- package/dist/sharedUtils/components/apps/gridUtils.d.ts +0 -14
- package/dist/sharedUtils/components/apps/inputType.d.ts +0 -178
- package/dist/sharedUtils/components/apps/rx.d.ts +0 -29
- package/dist/sharedUtils/components/apps/sharedTypes.d.ts +0 -21
- package/dist/sharedUtils/components/apps/types.d.ts +0 -274
- package/dist/sharedUtils/components/assets/lib.d.ts +0 -25
- package/dist/sharedUtils/components/common/alert/model.d.ts +0 -2
- package/dist/sharedUtils/components/common/badge/model.d.ts +0 -8
- package/dist/sharedUtils/components/common/button/model.d.ts +0 -45
- package/dist/sharedUtils/components/common/fileInput/model.d.ts +0 -1
- package/dist/sharedUtils/components/common/index.d.ts +0 -24
- package/dist/sharedUtils/components/common/skeleton/model.d.ts +0 -21
- package/dist/sharedUtils/components/dbTypes.d.ts +0 -14
- package/dist/sharedUtils/components/diff_drawer.d.ts +0 -26
- package/dist/sharedUtils/components/ducklake.d.ts +0 -1
- package/dist/sharedUtils/components/flows/scheduleUtils.d.ts +0 -7
- package/dist/sharedUtils/components/icons/index.d.ts +0 -101
- package/dist/sharedUtils/components/random_positive_adjetive.d.ts +0 -1
- package/dist/sharedUtils/components/raw_apps/rawAppPolicy.d.ts +0 -10
- package/dist/sharedUtils/components/raw_apps/utils.d.ts +0 -15
- package/dist/sharedUtils/components/triggers/email/utils.d.ts +0 -4
- package/dist/sharedUtils/components/triggers/gcp/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/http/utils.d.ts +0 -11
- package/dist/sharedUtils/components/triggers/kafka/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/mqtt/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/nats/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/postgres/utils.d.ts +0 -8
- package/dist/sharedUtils/components/triggers/sqs/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/triggers.svelte.d.ts +0 -32
- package/dist/sharedUtils/components/triggers/utils.d.ts +0 -80
- package/dist/sharedUtils/components/triggers/websocket/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers.d.ts +0 -20
- package/dist/sharedUtils/gen/core/ApiError.d.ts +0 -10
- package/dist/sharedUtils/gen/core/ApiRequestOptions.d.ts +0 -13
- package/dist/sharedUtils/gen/core/ApiResult.d.ts +0 -7
- package/dist/sharedUtils/gen/core/CancelablePromise.d.ts +0 -26
- package/dist/sharedUtils/gen/core/OpenAPI.d.ts +0 -27
- package/dist/sharedUtils/gen/core/request.d.ts +0 -29
- package/dist/sharedUtils/gen/index.d.ts +0 -6
- package/dist/sharedUtils/gen/schemas.gen.d.ts +0 -7036
- package/dist/sharedUtils/gen/services.gen.d.ts +0 -6047
- package/dist/sharedUtils/gen/types.gen.d.ts +0 -21881
- package/dist/sharedUtils/history.svelte.d.ts +0 -9
- package/dist/sharedUtils/hub.d.ts +0 -49
- package/dist/sharedUtils/jsr.json +0 -6
- package/dist/sharedUtils/lib.d.ts +0 -5
- package/dist/sharedUtils/lib.es.js +0 -1588
- package/dist/sharedUtils/package.json +0 -12
- package/dist/sharedUtils/schema.d.ts +0 -3
- package/dist/sharedUtils/stores.d.ts +0 -97
- package/dist/sharedUtils/svelte5Utils.svelte.d.ts +0 -80
- package/dist/sharedUtils/toast.d.ts +0 -8
- package/dist/sharedUtils/utils.d.ts +0 -265
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
<script lang="ts">import Star from '../../Star.svelte';
|
|
2
|
-
import { createEventDispatcher } from 'svelte';
|
|
3
2
|
import RowIcon from './RowIcon.svelte';
|
|
4
3
|
import { BellOff } from 'lucide-svelte';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
6
5
|
import { goto } from '../../../navigation';
|
|
7
6
|
import { triggerableByAI } from '../../../actions/triggerableByAI.svelte';
|
|
8
|
-
|
|
9
|
-
let { marked, starred, selected = false, disabled = false, canFavorite = true, isSelectable = false, alignWithSelectable = false, errorHandlerMuted = false, aiId = undefined, aiDescription = undefined, kind = 'script', summary = undefined, path, href = undefined, workspaceId, depth = 0, badges, actions, customSummary, onSelect = () => { } } = $props();
|
|
7
|
+
let { marked, starred, selected = false, disabled = false, canFavorite = true, isSelectable = false, alignWithSelectable = false, errorHandlerMuted = false, aiId = undefined, aiDescription = undefined, kind = 'script', summary = undefined, path, href = undefined, workspaceId, depth = 0, badges, actions, customSummary, onSelect = () => { }, onStarred = (newStarred) => { } } = $props();
|
|
10
8
|
let displayPath = (depth === 0 ? path : path?.split('/')?.slice(-1)?.[0]) ?? '';
|
|
11
9
|
</script>
|
|
12
10
|
|
|
@@ -28,7 +26,6 @@ let displayPath = (depth === 0 ? path : path?.split('/')?.slice(-1)?.[0]) ?? '';
|
|
|
28
26
|
depth > 0 ? '!rounded-none' : '',
|
|
29
27
|
disabled ? 'opacity-25' : 'hover:bg-surface-hover',
|
|
30
28
|
selected ? 'bg-surface-accent-selected' : ''
|
|
31
|
-
|
|
32
29
|
)}
|
|
33
30
|
style={depth > 0 ? `padding-left: ${depth * 32}px;` : ''}
|
|
34
31
|
>
|
|
@@ -39,11 +36,14 @@ let displayPath = (depth === 0 ? path : path?.split('/')?.slice(-1)?.[0]) ?? '';
|
|
|
39
36
|
{/if}
|
|
40
37
|
|
|
41
38
|
{#if href}
|
|
42
|
-
<a
|
|
39
|
+
<a
|
|
40
|
+
{href}
|
|
41
|
+
class="min-w-0 grow hover:underline decoration-gray-400 inline-flex items-center gap-4"
|
|
42
|
+
>
|
|
43
43
|
{@render rowContent()}
|
|
44
44
|
</a>
|
|
45
45
|
{:else}
|
|
46
|
-
|
|
46
|
+
{@render rowContent()}
|
|
47
47
|
{/if}
|
|
48
48
|
|
|
49
49
|
{#if errorHandlerMuted}
|
|
@@ -56,17 +56,9 @@ let displayPath = (depth === 0 ? path : path?.split('/')?.slice(-1)?.[0]) ?? '';
|
|
|
56
56
|
</div>
|
|
57
57
|
{/if}
|
|
58
58
|
|
|
59
|
-
{#if canFavorite && kind !== 'resource' && kind !== 'variable'}
|
|
59
|
+
{#if canFavorite && kind !== 'resource' && kind !== 'variable' && kind !== 'resource_type'}
|
|
60
60
|
<div class="center-center h-full text-xs font-semibold text-secondary w-9">
|
|
61
|
-
<Star
|
|
62
|
-
{kind}
|
|
63
|
-
{path}
|
|
64
|
-
{starred}
|
|
65
|
-
workspace_id={workspaceId}
|
|
66
|
-
on:starred={() => {
|
|
67
|
-
dispatch('change')
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
61
|
+
<Star {kind} {path} {starred} workspace_id={workspaceId} {onStarred} />
|
|
70
62
|
</div>
|
|
71
63
|
{:else}
|
|
72
64
|
<div class="w-9"></div>
|
|
@@ -85,12 +77,10 @@ let displayPath = (depth === 0 ? path : path?.split('/')?.slice(-1)?.[0]) ?? '';
|
|
|
85
77
|
<div class="text-emphasis flex-wrap text-left text-xs font-semibold">
|
|
86
78
|
{#if customSummary}
|
|
87
79
|
{@render customSummary?.()}
|
|
80
|
+
{:else if marked}
|
|
81
|
+
{@html marked}
|
|
88
82
|
{:else}
|
|
89
|
-
{
|
|
90
|
-
{@html marked}
|
|
91
|
-
{:else}
|
|
92
|
-
{!summary || summary.length == 0 ? displayPath : summary}
|
|
93
|
-
{/if}
|
|
83
|
+
{!summary || summary.length == 0 ? displayPath : summary}
|
|
94
84
|
{/if}
|
|
95
85
|
</div>
|
|
96
86
|
<div class="text-hint text-3xs truncate text-left font-normal">
|
|
@@ -9,7 +9,7 @@ interface Props {
|
|
|
9
9
|
errorHandlerMuted?: boolean;
|
|
10
10
|
aiId?: string | undefined;
|
|
11
11
|
aiDescription?: string | undefined;
|
|
12
|
-
kind?: 'script' | 'flow' | 'app' | 'raw_app' | 'resource' | 'variable';
|
|
12
|
+
kind?: 'script' | 'flow' | 'app' | 'raw_app' | 'resource' | 'variable' | 'resource_type';
|
|
13
13
|
summary?: string | undefined;
|
|
14
14
|
path: string;
|
|
15
15
|
href?: string;
|
|
@@ -21,24 +21,8 @@ interface Props {
|
|
|
21
21
|
onSelect?: (e: Event & {
|
|
22
22
|
currentTarget: EventTarget & HTMLInputElement;
|
|
23
23
|
}) => void;
|
|
24
|
+
onStarred?: (starred: boolean) => void;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
$$bindings?: Bindings;
|
|
28
|
-
} & Exports;
|
|
29
|
-
(internal: unknown, props: Props & {
|
|
30
|
-
$$events?: Events;
|
|
31
|
-
$$slots?: Slots;
|
|
32
|
-
}): Exports & {
|
|
33
|
-
$set?: any;
|
|
34
|
-
$on?: any;
|
|
35
|
-
};
|
|
36
|
-
z_$$bindings?: Bindings;
|
|
37
|
-
}
|
|
38
|
-
declare const Row: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
39
|
-
change: CustomEvent<any>;
|
|
40
|
-
} & {
|
|
41
|
-
[evt: string]: CustomEvent<any>;
|
|
42
|
-
}, {}, {}, "">;
|
|
43
|
-
type Row = InstanceType<typeof Row>;
|
|
26
|
+
declare const Row: import("svelte").Component<Props, {}, "">;
|
|
27
|
+
type Row = ReturnType<typeof Row>;
|
|
44
28
|
export default Row;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">import BarsStaggered from '../../icons/BarsStaggered.svelte';
|
|
2
|
-
import { Boxes, Code2, DollarSign, LayoutDashboard } from 'lucide-svelte';
|
|
2
|
+
import { Boxes, Code2, DollarSign, Folder, LayoutDashboard } from 'lucide-svelte';
|
|
3
3
|
export let kind;
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<div class="flex justify-center items-center">
|
|
6
|
+
<div class="flex justify-center items-center" title={kind}>
|
|
7
7
|
{#if kind === 'flow'}
|
|
8
8
|
<BarsStaggered size={16} class="text-teal-500" />
|
|
9
9
|
{:else if kind === 'app' || kind === 'raw_app'}
|
|
@@ -14,6 +14,10 @@ export let kind;
|
|
|
14
14
|
<DollarSign size={16} class="text-gray-400" />
|
|
15
15
|
{:else if kind === 'resource'}
|
|
16
16
|
<Boxes size={16} class="text-gray-400" />
|
|
17
|
+
{:else if kind === 'resource_type'}
|
|
18
|
+
<div style="width: 16px; height: 16px;" class="bg-gray-100 rounded-full" ></div>
|
|
19
|
+
{:else if kind === 'folder'}
|
|
20
|
+
<Folder size={16} class="text-gray-400" />
|
|
17
21
|
{:else}
|
|
18
22
|
<div class="w-[16px]"></div>
|
|
19
23
|
{/if}
|
|
@@ -12,7 +12,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
12
12
|
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
14
|
declare const RowIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
-
kind: "script" | "flow" | "app" | "raw_app" | "resource" | "variable";
|
|
15
|
+
kind: "script" | "flow" | "app" | "raw_app" | "resource" | "variable" | "resource_type" | "folder";
|
|
16
16
|
}, {
|
|
17
17
|
[evt: string]: CustomEvent<any>;
|
|
18
18
|
}, {}, {}, string>;
|
|
@@ -68,7 +68,10 @@ let versionsDrawerOpen = $state(false);
|
|
|
68
68
|
{starred}
|
|
69
69
|
{errorHandlerMuted}
|
|
70
70
|
workspaceId={$workspaceStore ?? ''}
|
|
71
|
-
|
|
71
|
+
onStarred={(newStarred) => {
|
|
72
|
+
starred = newStarred
|
|
73
|
+
dispatch('change')
|
|
74
|
+
}}
|
|
72
75
|
canFavorite={!script.draft_only}
|
|
73
76
|
{depth}
|
|
74
77
|
>
|
|
@@ -4,7 +4,7 @@ import type { MonacoLanguageClient } from 'monaco-languageclient';
|
|
|
4
4
|
export declare class Autocompletor {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(editor: meditor.IStandaloneCodeEditor, scriptLang: ScriptLang | 'bunnative' | 'jsx' | 'tsx' | 'json');
|
|
7
|
-
static isProviderModelSupported(providerModel: AIProviderModel | undefined): boolean
|
|
7
|
+
static isProviderModelSupported(providerModel: AIProviderModel | undefined): boolean;
|
|
8
8
|
dispose(): void;
|
|
9
9
|
setLanguageClient(client: MonacoLanguageClient): void;
|
|
10
10
|
}
|
|
@@ -4,6 +4,7 @@ import { LRUCache } from 'lru-cache';
|
|
|
4
4
|
import { autocompleteRequest } from './request';
|
|
5
5
|
import { FIM_MAX_TOKENS, getModelContextWindow } from '../lib';
|
|
6
6
|
import { setGlobalCSS } from '../shared';
|
|
7
|
+
import { supportsAutocomplete } from '../utils';
|
|
7
8
|
import { get } from 'svelte/store';
|
|
8
9
|
import { copilotInfo } from '../../../aiStore';
|
|
9
10
|
import { getTypeScriptWorker } from '@codingame/monaco-vscode-standalone-typescript-language-features';
|
|
@@ -143,10 +144,9 @@ export class Autocompletor {
|
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
146
|
static isProviderModelSupported(providerModel) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
!providerModel.model.startsWith('codestral-embed'));
|
|
147
|
+
if (!providerModel)
|
|
148
|
+
return false;
|
|
149
|
+
return supportsAutocomplete(providerModel.model);
|
|
150
150
|
}
|
|
151
151
|
dispose() {
|
|
152
152
|
this.#completionDisposable.dispose();
|
|
@@ -11,19 +11,23 @@ function comment(commentSymbol, text) {
|
|
|
11
11
|
.join('\n');
|
|
12
12
|
}
|
|
13
13
|
export async function autocompleteRequest(context, abortController) {
|
|
14
|
-
let commentSymbol = getCommentSymbol(context.scriptLang);
|
|
15
|
-
let contextLines = comment(commentSymbol, 'You are a code completion assistant. You are given three important contexts (<LANGUAGE CONTEXT>, <DIAGNOSTICS>, <LIBRARY METHODS>) to help you complete the code.\n');
|
|
16
|
-
contextLines += comment(commentSymbol, 'LANGUAGE CONTEXT:\n');
|
|
17
|
-
contextLines += comment(commentSymbol, getLangContext(context.scriptLang) + '\n');
|
|
18
|
-
contextLines += comment(commentSymbol, 'DIAGNOSTICS:\n');
|
|
19
|
-
contextLines += comment(commentSymbol, context.markers.map((m) => m.message).join('\n') + '\n');
|
|
20
|
-
contextLines += comment(commentSymbol, 'LIBRARY METHODS:\n');
|
|
21
|
-
contextLines += comment(commentSymbol, context.libraries + '\n');
|
|
22
|
-
context.prefix = contextLines + '\n' + context.prefix;
|
|
23
14
|
const providerModel = get(copilotInfo).codeCompletionModel;
|
|
24
15
|
if (!providerModel) {
|
|
25
16
|
throw new Error('No code completion model selected');
|
|
26
17
|
}
|
|
18
|
+
// Only add context lines for Mistral (native FIM) - other providers use chat completion
|
|
19
|
+
// too much context degrades significantly the quality of the completion
|
|
20
|
+
if (providerModel.provider === 'mistral') {
|
|
21
|
+
let commentSymbol = getCommentSymbol(context.scriptLang);
|
|
22
|
+
let contextLines = comment(commentSymbol, 'You are a code completion assistant. You are given three important contexts (<LANGUAGE CONTEXT>, <DIAGNOSTICS>, <LIBRARY METHODS>) to help you complete the code.\n');
|
|
23
|
+
contextLines += comment(commentSymbol, 'LANGUAGE CONTEXT:\n');
|
|
24
|
+
contextLines += comment(commentSymbol, getLangContext(context.scriptLang) + '\n');
|
|
25
|
+
contextLines += comment(commentSymbol, 'DIAGNOSTICS:\n');
|
|
26
|
+
contextLines += comment(commentSymbol, context.markers.map((m) => m.message).join('\n') + '\n');
|
|
27
|
+
contextLines += comment(commentSymbol, 'LIBRARY METHODS:\n');
|
|
28
|
+
contextLines += comment(commentSymbol, context.libraries + '\n');
|
|
29
|
+
context.prefix = contextLines + '\n' + context.prefix;
|
|
30
|
+
}
|
|
27
31
|
try {
|
|
28
32
|
const completion = await getFimCompletion(context.prefix, context.suffix, providerModel, abortController);
|
|
29
33
|
return completion;
|
|
@@ -355,10 +355,11 @@ export function createDbSchemaTool() {
|
|
|
355
355
|
workspace: workspace,
|
|
356
356
|
path: args.resourcePath
|
|
357
357
|
});
|
|
358
|
-
const newDbSchemas = {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
358
|
+
const newDbSchemas = {
|
|
359
|
+
[args.resourcePath]: await getDbSchemas(resource.resource_type, args.resourcePath, workspace, (error) => {
|
|
360
|
+
console.error(error);
|
|
361
|
+
})
|
|
362
|
+
};
|
|
362
363
|
dbSchemas.update((schemas) => ({ ...schemas, ...newDbSchemas }));
|
|
363
364
|
const dbs = get(dbSchemas);
|
|
364
365
|
const db = dbs[args.resourcePath];
|
|
@@ -271,7 +271,6 @@ function prepareMessages(aiProvider, messages) {
|
|
|
271
271
|
}
|
|
272
272
|
const DEFAULT_COMPLETION_CONFIG = {
|
|
273
273
|
model: '',
|
|
274
|
-
seed: 42,
|
|
275
274
|
messages: []
|
|
276
275
|
};
|
|
277
276
|
export const PROVIDER_COMPLETION_CONFIG_MAP = {
|
|
@@ -282,14 +281,8 @@ export const PROVIDER_COMPLETION_CONFIG_MAP = {
|
|
|
282
281
|
togetherai: DEFAULT_COMPLETION_CONFIG,
|
|
283
282
|
deepseek: DEFAULT_COMPLETION_CONFIG,
|
|
284
283
|
customai: DEFAULT_COMPLETION_CONFIG,
|
|
285
|
-
googleai:
|
|
286
|
-
|
|
287
|
-
seed: undefined // not supported by gemini
|
|
288
|
-
},
|
|
289
|
-
mistral: {
|
|
290
|
-
...DEFAULT_COMPLETION_CONFIG,
|
|
291
|
-
seed: undefined
|
|
292
|
-
},
|
|
284
|
+
googleai: DEFAULT_COMPLETION_CONFIG,
|
|
285
|
+
mistral: DEFAULT_COMPLETION_CONFIG,
|
|
293
286
|
anthropic: DEFAULT_COMPLETION_CONFIG,
|
|
294
287
|
aws_bedrock: DEFAULT_COMPLETION_CONFIG
|
|
295
288
|
};
|
|
@@ -6,3 +6,8 @@ export declare function pythonCompile(schema: Schema): string;
|
|
|
6
6
|
export declare function phpCompile(schema: Schema): string;
|
|
7
7
|
export declare function formatResourceTypes(resourceTypes: ResourceType[], lang: 'python3' | 'typescript' | 'php'): string;
|
|
8
8
|
export declare function yamlStringifyExceptKeys(obj: any, keys: string[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if a model supports FIM (Fill-in-the-Middle) autocomplete.
|
|
11
|
+
* Currently only Codestral models (non-embedding) support this.
|
|
12
|
+
*/
|
|
13
|
+
export declare function supportsAutocomplete(model: string): boolean;
|
|
@@ -159,3 +159,11 @@ export function yamlStringifyExceptKeys(obj, keys) {
|
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Checks if a model supports FIM (Fill-in-the-Middle) autocomplete.
|
|
164
|
+
* Currently only Codestral models (non-embedding) support this.
|
|
165
|
+
*/
|
|
166
|
+
export function supportsAutocomplete(model) {
|
|
167
|
+
const lower = model.toLowerCase();
|
|
168
|
+
return lower.includes('codestral') && !lower.includes('embed');
|
|
169
|
+
}
|
|
@@ -66,7 +66,7 @@ export type IDbSchemaOps = {
|
|
|
66
66
|
onFetchTableEditorDefinition: (params: {
|
|
67
67
|
table: string;
|
|
68
68
|
schema?: string;
|
|
69
|
-
|
|
69
|
+
colDefs: TableMetadata;
|
|
70
70
|
}) => Promise<TableEditorValues>;
|
|
71
71
|
};
|
|
72
72
|
export declare function dbSchemaOpsWithPreviewScripts({ workspace, input }: {
|
|
@@ -132,8 +132,8 @@ export function dbSchemaOpsWithPreviewScripts({ workspace, input }) {
|
|
|
132
132
|
requestBody: { args: { ...dbArg }, language, content: dropSchemaQuery }
|
|
133
133
|
});
|
|
134
134
|
},
|
|
135
|
-
onFetchTableEditorDefinition: async ({ table, schema,
|
|
136
|
-
let { foreignKeys, pk_constraint_name
|
|
135
|
+
onFetchTableEditorDefinition: async ({ table, schema, colDefs }) => {
|
|
136
|
+
let { foreignKeys, pk_constraint_name } = await fetchTableRelationalKeys(input, dbType, table, schema, workspace, dbArg, language);
|
|
137
137
|
return buildTableEditorValues({
|
|
138
138
|
tableName: table,
|
|
139
139
|
metadata: colDefs,
|
|
@@ -5,23 +5,37 @@ import { twMerge } from 'tailwind-merge';
|
|
|
5
5
|
import { userStore } from '../../stores';
|
|
6
6
|
import { createEventDispatcher, getContext, tick } from 'svelte';
|
|
7
7
|
import { Calendar } from 'lucide-svelte';
|
|
8
|
+
import { emptyString } from '../../utils';
|
|
8
9
|
const { triggersCount, triggersState } = $state(getContext('TriggerContext'));
|
|
9
|
-
let { mainButtons = [], menuItems = [],
|
|
10
|
+
let { mainButtons = [], menuItems = [], summary, path, tag, errorHandlerKind, scriptOrFlowPath, errorHandlerMuted = $bindable(), children, trigger_badges } = $props();
|
|
10
11
|
const dispatch = createEventDispatcher();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<div class="border-b p-
|
|
14
|
+
<div class="border-b p-1">
|
|
14
15
|
<div class="mx-auto">
|
|
15
|
-
<div
|
|
16
|
-
|
|
16
|
+
<div
|
|
17
|
+
class="flex w-full flex-wrap md:flex-nowrap justify-end gap-x-2 gap-y-4 items-center min-h-10"
|
|
18
|
+
>
|
|
19
|
+
<div class="grow px-4 inline-flex items-center gap-4 min-w-0">
|
|
17
20
|
<div
|
|
18
21
|
class={twMerge(
|
|
19
|
-
'
|
|
22
|
+
'min-w-24 text-emphasis truncate flex flex-col gap-0',
|
|
20
23
|
$userStore?.operator ? 'pl-10' : ''
|
|
21
24
|
)}
|
|
22
25
|
>
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
<span
|
|
27
|
+
class={twMerge(
|
|
28
|
+
'text-sm min-w-24 text-emphasis font-semibold truncate',
|
|
29
|
+
$userStore?.operator ? 'pl-10' : ''
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
{emptyString(summary) ? (path ?? '') : summary}
|
|
33
|
+
</span>
|
|
34
|
+
{#if !emptyString(summary)}
|
|
35
|
+
<span class="text-2xs text-secondary">{path}</span>
|
|
36
|
+
{/if}
|
|
37
|
+
</div>
|
|
38
|
+
{#if tag}
|
|
25
39
|
<Badge>tag: {tag}</Badge>
|
|
26
40
|
{/if}
|
|
27
41
|
{@render children?.()}
|
|
@@ -13,7 +13,8 @@ type MainButton = {
|
|
|
13
13
|
interface Props {
|
|
14
14
|
mainButtons?: MainButton[];
|
|
15
15
|
menuItems?: MenuItemButton[];
|
|
16
|
-
|
|
16
|
+
summary?: string;
|
|
17
|
+
path?: string;
|
|
17
18
|
tag: string | undefined;
|
|
18
19
|
errorHandlerKind: 'flow' | 'script';
|
|
19
20
|
scriptOrFlowPath: string;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
|
3
3
|
import DetailPageDetailPanel from './DetailPageDetailPanel.svelte';
|
|
4
4
|
import FlowViewerInner from '../FlowViewerInner.svelte';
|
|
5
|
-
let { isOperator = false, flow_json = undefined, selected = $bindable(), forceSmallScreen = false, isChatMode = false, header, form, scriptRender: script, save_inputs, flow_step, triggers } = $props();
|
|
5
|
+
let { isOperator = false, flow_json = undefined, selected = $bindable(), forceSmallScreen = false, isChatMode = false, header, form, scriptRender: script, save_inputs, flow_step, triggers, flow_graph } = $props();
|
|
6
6
|
let mobileTab = $state('form');
|
|
7
7
|
let clientWidth = $state(window.innerWidth);
|
|
8
8
|
const script_render = $derived(script);
|
|
9
9
|
const save_inputs_render = $derived(save_inputs);
|
|
10
10
|
const flow_step_render = $derived(flow_step);
|
|
11
11
|
const triggers_render = $derived(triggers);
|
|
12
|
+
const flow_graph_render = $derived(flow_graph);
|
|
12
13
|
const useDesktopLayout = $derived(clientWidth >= 768 && !forceSmallScreen);
|
|
13
14
|
</script>
|
|
14
15
|
|
|
@@ -49,6 +50,9 @@ const useDesktopLayout = $derived(clientWidth >= 768 && !forceSmallScreen);
|
|
|
49
50
|
{#if !isChatMode}
|
|
50
51
|
<Tab value="saved_inputs" label="Inputs" />
|
|
51
52
|
{/if}
|
|
53
|
+
{#if isChatMode && flow_json}
|
|
54
|
+
<Tab value="flow" label="Flow graph" />
|
|
55
|
+
{/if}
|
|
52
56
|
{#if !isOperator}
|
|
53
57
|
<Tab value="triggers" label="Triggers" />
|
|
54
58
|
{/if}
|
|
@@ -70,6 +74,11 @@ const useDesktopLayout = $derived(clientWidth >= 768 && !forceSmallScreen);
|
|
|
70
74
|
<TabContent value="triggers" class="flex flex-col flex-1 h-full mt-[-2px]">
|
|
71
75
|
{@render triggers?.()}
|
|
72
76
|
</TabContent>
|
|
77
|
+
{#if isChatMode && flow_json}
|
|
78
|
+
<TabContent value="flow" class="flex flex-col flex-1 h-full">
|
|
79
|
+
{@render flow_graph_render?.()}
|
|
80
|
+
</TabContent>
|
|
81
|
+
{/if}
|
|
73
82
|
{#if flow_json}
|
|
74
83
|
<TabContent value="raw" class="flex flex-col flex-1 h-full overflow-auto p-2">
|
|
75
84
|
<FlowViewerInner flow={flow_json} />
|
|
@@ -10,6 +10,7 @@ interface Props {
|
|
|
10
10
|
save_inputs?: import('svelte').Snippet;
|
|
11
11
|
flow_step?: import('svelte').Snippet;
|
|
12
12
|
triggers?: import('svelte').Snippet;
|
|
13
|
+
flow_graph?: import('svelte').Snippet;
|
|
13
14
|
}
|
|
14
15
|
declare const DetailPageLayout: import("svelte").Component<Props, {}, "selected">;
|
|
15
16
|
type DetailPageLayout = ReturnType<typeof DetailPageLayout>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script lang="ts">import { Button } from '../../common';
|
|
2
|
-
import { MessageCircle, Plus, Trash2, PanelLeftClose, PanelLeftOpen
|
|
2
|
+
import { MessageCircle, Plus, Trash2, PanelLeftClose, PanelLeftOpen } from 'lucide-svelte';
|
|
3
3
|
import {} from '../../../gen';
|
|
4
4
|
import CountBadge from '../../common/badge/CountBadge.svelte';
|
|
5
5
|
import InfiniteList from '../../InfiniteList.svelte';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { FlowChatManager } from './FlowChatManager.svelte';
|
|
8
|
+
import { fade } from 'svelte/transition';
|
|
8
9
|
let { manager } = $props();
|
|
9
10
|
function getConversationTitle(conversation) {
|
|
10
11
|
return conversation.title || `Conversation ${conversation.created_at.slice(0, 10)}`;
|
|
@@ -12,35 +13,37 @@ function getConversationTitle(conversation) {
|
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
15
|
<div
|
|
15
|
-
class="flex flex-col h-full bg-surface border-r
|
|
16
|
+
class="flex flex-col h-full bg-surface border-r transition-all duration-300 {manager.isSidebarExpanded
|
|
16
17
|
? 'w-60'
|
|
17
|
-
: 'w-
|
|
18
|
+
: 'w-[44px]'}"
|
|
18
19
|
>
|
|
19
20
|
<!-- Header -->
|
|
20
|
-
<div class="flex-shrink-0
|
|
21
|
-
<div class="flex flex-col gap-2">
|
|
21
|
+
<div class="flex-shrink-0 border-b">
|
|
22
|
+
<div class="flex flex-col gap-2 p-1">
|
|
22
23
|
<Button
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
startIcon={{
|
|
26
|
-
|
|
24
|
+
unifiedSize="md"
|
|
25
|
+
variant="subtle"
|
|
26
|
+
startIcon={{
|
|
27
|
+
icon: manager.isSidebarExpanded ? PanelLeftClose : PanelLeftOpen,
|
|
28
|
+
classes: 'ml-[2px]'
|
|
29
|
+
}}
|
|
30
|
+
onClick={() => (manager.isSidebarExpanded = !manager.isSidebarExpanded)}
|
|
27
31
|
iconOnly={!manager.isSidebarExpanded}
|
|
28
|
-
btnClasses={
|
|
29
|
-
|
|
32
|
+
btnClasses={'justify-start transition-all duration-150'}
|
|
33
|
+
title="Conversations"
|
|
30
34
|
>
|
|
31
|
-
Conversations
|
|
35
|
+
<div transition:fade={{ duration: 100 }}> Conversations </div>
|
|
32
36
|
</Button>
|
|
33
37
|
<Button
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
startIcon={{ icon: Plus }}
|
|
37
|
-
|
|
38
|
+
unifiedSize="md"
|
|
39
|
+
variant="subtle"
|
|
40
|
+
startIcon={{ icon: Plus, classes: 'ml-[2px]' }}
|
|
41
|
+
onClick={() => manager.createConversation({ clearMessages: true })}
|
|
38
42
|
title="Start new conversation"
|
|
39
43
|
iconOnly={!manager.isSidebarExpanded}
|
|
40
|
-
btnClasses={
|
|
41
|
-
label="New chat"
|
|
44
|
+
btnClasses={'justify-start transition-all duration-150 whitespace-nowrap'}
|
|
42
45
|
>
|
|
43
|
-
New chat
|
|
46
|
+
<div transition:fade={{ duration: 100 }}> New chat </div>
|
|
44
47
|
</Button>
|
|
45
48
|
</div>
|
|
46
49
|
</div>
|
|
@@ -48,71 +51,79 @@ function getConversationTitle(conversation) {
|
|
|
48
51
|
<!-- Conversations List -->
|
|
49
52
|
{#if !manager.isSidebarExpanded}
|
|
50
53
|
<!-- Collapsed state - show single chat icon with badge -->
|
|
51
|
-
<div class="p-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
<div class="p-1">
|
|
55
|
+
<Button
|
|
56
|
+
unifiedSize="md"
|
|
57
|
+
startIcon={{ icon: MessageCircle }}
|
|
58
|
+
onClick={() => (manager.isSidebarExpanded = true)}
|
|
55
59
|
title="{manager.conversations.length} conversation{manager.conversations.length !== 1
|
|
56
60
|
? 's'
|
|
57
61
|
: ''}"
|
|
62
|
+
variant="subtle"
|
|
63
|
+
btnClasses="w-fit px-2 relative"
|
|
58
64
|
>
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
<CountBadge
|
|
66
|
+
count={manager.conversations.length}
|
|
67
|
+
small
|
|
68
|
+
alwaysVisible={true}
|
|
69
|
+
class="right-[3px] top-[3px]"
|
|
70
|
+
/>
|
|
71
|
+
</Button>
|
|
62
72
|
</div>
|
|
63
73
|
{/if}
|
|
64
74
|
|
|
65
75
|
<!-- Always mount InfiniteList, but hide it when collapsed -->
|
|
66
|
-
<div
|
|
76
|
+
<div
|
|
77
|
+
class="flex-1 overflow-hidden transition-all duration-150 p-1"
|
|
78
|
+
class:hidden={!manager.isSidebarExpanded}
|
|
79
|
+
>
|
|
67
80
|
<InfiniteList
|
|
68
81
|
bind:this={manager.conversationListComponent}
|
|
69
82
|
bind:items={manager.conversations}
|
|
70
83
|
selectedItemId={manager.selectedConversationId}
|
|
71
84
|
noBorder={true}
|
|
72
85
|
rounded={false}
|
|
86
|
+
preventXOverflow={true}
|
|
73
87
|
>
|
|
74
|
-
{#snippet
|
|
75
|
-
|
|
76
|
-
class={twMerge(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
<Button
|
|
84
|
-
color="transparent"
|
|
85
|
-
size="xs"
|
|
86
|
-
onclick={() => manager.selectConversation(conversation.id, conversation.isDraft)}
|
|
87
|
-
>
|
|
88
|
-
<span class="flex-1 text-left text-sm font-medium text-primary truncate">
|
|
89
|
-
{getConversationTitle(conversation)}
|
|
90
|
-
</span>
|
|
91
|
-
<button
|
|
92
|
-
class="ml-2 p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30 text-red-500 transition-all {hover ||
|
|
93
|
-
manager.deletingConversationId === conversation.id
|
|
94
|
-
? 'opacity-100'
|
|
95
|
-
: 'opacity-0'}"
|
|
96
|
-
disabled={manager.deletingConversationId === conversation.id}
|
|
97
|
-
onclick={(e) => {
|
|
98
|
-
e.stopPropagation()
|
|
99
|
-
if (conversation.isDraft) {
|
|
100
|
-
// just remove first conversation as it is the draft
|
|
101
|
-
manager.conversations = [...manager.conversations.slice(1)]
|
|
102
|
-
} else {
|
|
103
|
-
manager.conversationListComponent?.deleteItem(conversation.id)
|
|
104
|
-
}
|
|
105
|
-
}}
|
|
106
|
-
title="Delete conversation"
|
|
88
|
+
{#snippet customRow({ item: conversation, hover })}
|
|
89
|
+
{#if manager.isSidebarExpanded}
|
|
90
|
+
<div class={twMerge('w-full pb-1')} transition:fade={{ duration: 100, delay: 30 }}>
|
|
91
|
+
<Button
|
|
92
|
+
unifiedSize="md"
|
|
93
|
+
variant="subtle"
|
|
94
|
+
onClick={() => manager.selectConversation(conversation.id, conversation.isDraft)}
|
|
95
|
+
selected={manager.selectedConversationId === conversation.id}
|
|
96
|
+
btnClasses="transition-all duration-150 group"
|
|
107
97
|
>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
<span class="flex-1 text-left truncate">
|
|
99
|
+
{getConversationTitle(conversation)}
|
|
100
|
+
</span>
|
|
101
|
+
<Button
|
|
102
|
+
wrapperClasses={twMerge(
|
|
103
|
+
'ml-2 transition-all duration-100 opacity-0 group-hover:opacity-100',
|
|
104
|
+
manager.deletingConversationId === conversation.id ? 'opacity-100' : ' '
|
|
105
|
+
)}
|
|
106
|
+
disabled={manager.deletingConversationId === conversation.id}
|
|
107
|
+
onClick={(e) => {
|
|
108
|
+
e?.stopPropagation()
|
|
109
|
+
if (conversation.isDraft) {
|
|
110
|
+
// just remove first conversation as it is the draft
|
|
111
|
+
manager.conversations = [...manager.conversations.slice(1)]
|
|
112
|
+
} else {
|
|
113
|
+
manager.conversationListComponent?.deleteItem(conversation.id)
|
|
114
|
+
}
|
|
115
|
+
}}
|
|
116
|
+
title="Delete conversation"
|
|
117
|
+
destructive
|
|
118
|
+
unifiedSize="xs"
|
|
119
|
+
variant="subtle"
|
|
120
|
+
loading={manager.deletingConversationId === conversation.id}
|
|
121
|
+
iconOnly
|
|
122
|
+
startIcon={{ icon: Trash2 }}
|
|
123
|
+
/>
|
|
124
|
+
</Button>
|
|
125
|
+
</div>
|
|
126
|
+
{/if}
|
|
116
127
|
{/snippet}
|
|
117
128
|
|
|
118
129
|
{#snippet empty()}
|
|
@@ -122,13 +133,4 @@ function getConversationTitle(conversation) {
|
|
|
122
133
|
{/snippet}
|
|
123
134
|
</InfiniteList>
|
|
124
135
|
</div>
|
|
125
|
-
|
|
126
|
-
{#if manager.isSidebarExpanded}
|
|
127
|
-
<!-- Footer -->
|
|
128
|
-
<div class="flex-shrink-0 p-4 border-t border-gray-200 dark:border-gray-700">
|
|
129
|
-
<p class="text-xs text-primary">
|
|
130
|
-
{manager.conversations.length} conversation{manager.conversations.length !== 1 ? 's' : ''}
|
|
131
|
-
</p>
|
|
132
|
-
</div>
|
|
133
|
-
{/if}
|
|
134
136
|
</div>
|
|
@@ -44,7 +44,7 @@ interface Props {
|
|
|
44
44
|
}
|
|
45
45
|
declare const OutputPickerInner: import("svelte").Component<Props, {
|
|
46
46
|
setJobPreview: () => void;
|
|
47
|
-
getPreview: () => "
|
|
47
|
+
getPreview: () => "job" | "mock" | undefined;
|
|
48
48
|
getHistoryOpen: () => boolean;
|
|
49
49
|
getSelectedJob: () => OutputViewerJob;
|
|
50
50
|
}, "mock" | "isLoading">;
|