windmill-components 1.596.0 → 1.596.1
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/common.d.ts +2 -0
- package/package/components/ArgInput.svelte +4 -2
- package/package/components/ArgInput.svelte.d.ts +1 -0
- package/package/components/ArrayTypeNarrowing.svelte +8 -7
- package/package/components/DBManager.svelte +377 -41
- package/package/components/DBManager.svelte.d.ts +16 -1
- package/package/components/DBManagerContent.svelte +195 -0
- package/package/components/DBManagerContent.svelte.d.ts +24 -0
- package/package/components/DBManagerDrawer.svelte +90 -175
- package/package/components/DBManagerDrawer.svelte.d.ts +5 -1
- package/package/components/InputTransformForm.svelte +13 -1
- package/package/components/InputTransformForm.svelte.d.ts +1 -0
- package/package/components/InputTransformSchemaForm.svelte +2 -1
- package/package/components/InputTransformSchemaForm.svelte.d.ts +1 -0
- package/package/components/SchemaForm.svelte +21 -7
- package/package/components/SchemaForm.svelte.d.ts +1 -0
- package/package/components/ScriptBuilder.svelte +14 -0
- package/package/components/common/drawer/DrawerContent.svelte +4 -1
- package/package/components/common/drawer/DrawerContent.svelte.d.ts +1 -0
- package/package/components/common/modal/Modal.svelte +13 -17
- package/package/components/common/modal/Modal.svelte.d.ts +13 -23
- package/package/components/copilot/chat/AIChatDisplay.svelte +3 -1
- package/package/components/copilot/chat/AIChatManager.svelte.js +2 -0
- package/package/components/copilot/chat/DatatableCreationPolicy.svelte +63 -0
- package/package/components/copilot/chat/DatatableCreationPolicy.svelte.d.ts +3 -0
- package/package/components/copilot/chat/__tests__/app/appEvalHelpers.js +13 -0
- package/package/components/copilot/chat/app/core.d.ts +27 -0
- package/package/components/copilot/chat/app/core.js +207 -2
- package/package/components/copilot/chat/flow/core.js +1 -1
- package/package/components/copilot/chat/script/core.js +1 -1
- package/package/components/copilot/chat/sharedChatState.svelte.js +3 -1
- package/package/components/dbOps.d.ts +3 -0
- package/package/components/dbOps.js +10 -1
- package/package/components/flows/CreateActionsApp.svelte +114 -9
- package/package/components/flows/CreateActionsApp.svelte.d.ts +2 -17
- package/package/components/flows/DebounceLimit.svelte +64 -1
- package/package/components/flows/DebounceLimit.svelte.d.ts +6 -1
- package/package/components/flows/content/FlowModuleComponent.svelte +1 -0
- package/package/components/flows/content/FlowSettings.svelte +4 -0
- package/package/components/flows/conversations/FlowChatManager.svelte.js +0 -1
- package/package/components/flows/flowInfers.js +19 -1
- package/package/components/flows/flowStore.svelte.d.ts +2 -0
- package/package/components/flows/utils.svelte.js +17 -0
- package/package/components/icons/index.d.ts +101 -0
- package/package/components/icons/index.js +1 -1
- package/package/components/raw_apps/DefaultDatabaseSelector.svelte +61 -0
- package/package/components/raw_apps/DefaultDatabaseSelector.svelte.d.ts +13 -0
- package/package/components/raw_apps/RawAppBackgroundRunner.svelte +17 -1
- package/package/components/raw_apps/RawAppDataTableDrawer.svelte +205 -0
- package/package/components/raw_apps/RawAppDataTableDrawer.svelte.d.ts +14 -0
- package/package/components/raw_apps/RawAppDataTableList.svelte +160 -0
- package/package/components/raw_apps/RawAppDataTableList.svelte.d.ts +22 -0
- package/package/components/raw_apps/RawAppEditor.svelte +153 -9
- package/package/components/raw_apps/RawAppEditor.svelte.d.ts +3 -0
- package/package/components/raw_apps/RawAppEditorHeader.svelte +2 -2
- package/package/components/raw_apps/RawAppEditorHeader.svelte.d.ts +3 -0
- package/package/components/raw_apps/RawAppHistoryManager.svelte.d.ts +5 -2
- package/package/components/raw_apps/RawAppHistoryManager.svelte.js +11 -9
- package/package/components/raw_apps/RawAppSidebar.svelte +36 -4
- package/package/components/raw_apps/RawAppSidebar.svelte.d.ts +8 -0
- package/package/components/raw_apps/dataTableRefUtils.d.ts +30 -0
- package/package/components/raw_apps/dataTableRefUtils.js +40 -0
- package/package/components/raw_apps/datatableUtils.svelte.d.ts +24 -0
- package/package/components/raw_apps/datatableUtils.svelte.js +69 -0
- package/package/gen/schemas.gen.d.ts +39 -0
- package/package/gen/schemas.gen.js +39 -0
- package/package/gen/services.gen.d.ts +10 -1
- package/package/gen/services.gen.js +18 -0
- package/package/gen/types.gen.d.ts +45 -0
- package/package/system_prompts/index.d.ts +3 -0
- package/package/system_prompts/index.js +33 -0
- package/package/system_prompts/prompts.d.ts +25 -0
- package/package/system_prompts/prompts.js +2598 -0
- package/package/utils.js +3 -1
- package/package.json +19 -3
|
@@ -3,17 +3,37 @@ import { base } from '../../base';
|
|
|
3
3
|
import { Button } from '../common';
|
|
4
4
|
import Drawer from '../common/drawer/Drawer.svelte';
|
|
5
5
|
import DrawerContent from '../common/drawer/DrawerContent.svelte';
|
|
6
|
-
import
|
|
6
|
+
import Modal from '../common/modal/Modal.svelte';
|
|
7
|
+
import { LayoutDashboard, Loader2, Plus, Code2, FlaskConical } from 'lucide-svelte';
|
|
7
8
|
import { importStore } from '../apps/store';
|
|
9
|
+
import Badge from '../common/badge/Badge.svelte';
|
|
8
10
|
import YAML from 'yaml';
|
|
9
11
|
let drawer = undefined;
|
|
10
|
-
let pendingRaw = '';
|
|
11
|
-
let importType = 'yaml';
|
|
12
|
+
let pendingRaw = $state('');
|
|
13
|
+
let importType = $state('yaml');
|
|
14
|
+
// Modal states
|
|
15
|
+
let appTypeModalOpen = $state(false);
|
|
16
|
+
let featurePreviewModalOpen = $state(false);
|
|
12
17
|
async function importRaw() {
|
|
13
18
|
$importStore = importType === 'yaml' ? YAML.parse(pendingRaw) : JSON.parse(pendingRaw);
|
|
14
19
|
await goto('/apps/add?nodraft=true');
|
|
15
20
|
drawer?.closeDrawer?.();
|
|
16
21
|
}
|
|
22
|
+
function openAppTypeModal() {
|
|
23
|
+
appTypeModalOpen = true;
|
|
24
|
+
}
|
|
25
|
+
function selectLowCode() {
|
|
26
|
+
appTypeModalOpen = false;
|
|
27
|
+
goto(`${base}/apps/add?nodraft=true`);
|
|
28
|
+
}
|
|
29
|
+
function selectFullCode() {
|
|
30
|
+
appTypeModalOpen = false;
|
|
31
|
+
featurePreviewModalOpen = true;
|
|
32
|
+
}
|
|
33
|
+
function confirmFullCode() {
|
|
34
|
+
featurePreviewModalOpen = false;
|
|
35
|
+
goto(`${base}/apps_raw/add?nodraft=true`);
|
|
36
|
+
}
|
|
17
37
|
</script>
|
|
18
38
|
|
|
19
39
|
<!-- Buttons -->
|
|
@@ -21,11 +41,11 @@ async function importRaw() {
|
|
|
21
41
|
<Button
|
|
22
42
|
id="create-app-button"
|
|
23
43
|
aiId="apps-create-actions-app"
|
|
24
|
-
aiDescription="Create a new
|
|
44
|
+
aiDescription="Create a new app"
|
|
25
45
|
unifiedSize="lg"
|
|
26
46
|
startIcon={{ icon: Plus }}
|
|
27
47
|
endIcon={{ icon: LayoutDashboard }}
|
|
28
|
-
|
|
48
|
+
on:click={openAppTypeModal}
|
|
29
49
|
variant="accent"
|
|
30
50
|
dropdownItems={[
|
|
31
51
|
{
|
|
@@ -42,16 +62,101 @@ async function importRaw() {
|
|
|
42
62
|
importType = 'json'
|
|
43
63
|
}
|
|
44
64
|
}
|
|
45
|
-
// {
|
|
46
|
-
// label: 'Build app in React/Vue/Svelte (alpha)',
|
|
47
|
-
// onClick: () => goto('/apps_raw/add?nodraft=true')
|
|
48
|
-
// }
|
|
49
65
|
]}
|
|
50
66
|
>
|
|
51
67
|
<div class="flex flex-row items-center"> App </div>
|
|
52
68
|
</Button>
|
|
53
69
|
</div>
|
|
54
70
|
|
|
71
|
+
<!-- App Type Selection Modal -->
|
|
72
|
+
<Modal bind:open={appTypeModalOpen} title="Choose your app builder">
|
|
73
|
+
<div class="flex flex-col gap-4 pr-4">
|
|
74
|
+
<div class="grid grid-cols-2 gap-8">
|
|
75
|
+
<!-- Low-code option -->
|
|
76
|
+
<button
|
|
77
|
+
class="flex flex-col items-center gap-3 p-6 rounded-lg border-2 border-gray-200 dark:border-gray-700 hover:border-orange-500 dark:hover:border-orange-400 hover:bg-orange-50 dark:hover:bg-orange-900/20 transition-all cursor-pointer group"
|
|
78
|
+
onclick={selectLowCode}
|
|
79
|
+
>
|
|
80
|
+
<div
|
|
81
|
+
class="w-32 h-32 rounded-xl bg-orange-100 dark:bg-orange-900/40 flex items-center justify-center group-hover:bg-orange-200 dark:group-hover:bg-orange-800/50 transition-colors"
|
|
82
|
+
>
|
|
83
|
+
<LayoutDashboard size={32} class="text-orange-600 dark:text-orange-400" />
|
|
84
|
+
</div>
|
|
85
|
+
<div class="text-center">
|
|
86
|
+
<h3 class="font-semibold text-primary">Low-code App</h3>
|
|
87
|
+
<p class="text-xs text-tertiary mt-1">
|
|
88
|
+
Drag-and-drop UI builder with 60+ powerful components.
|
|
89
|
+
|
|
90
|
+
<br /><br />
|
|
91
|
+
Better for simple apps or apps that require minimal customization.
|
|
92
|
+
</p>
|
|
93
|
+
</div>
|
|
94
|
+
</button>
|
|
95
|
+
|
|
96
|
+
<button
|
|
97
|
+
class="relative flex flex-col items-center gap-3 p-6 rounded-lg border-2 border-gray-200 dark:border-gray-700 hover:border-purple-500 dark:hover:border-purple-400 hover:bg-purple-50 dark:hover:bg-purple-900/20 transition-all cursor-pointer group"
|
|
98
|
+
onclick={selectFullCode}
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
class="w-32 h-32 rounded-xl bg-purple-100 dark:bg-purple-900/40 flex items-center justify-center group-hover:bg-purple-200 dark:group-hover:bg-purple-800/50 transition-colors"
|
|
102
|
+
>
|
|
103
|
+
<Code2 size={32} class="text-purple-600 dark:text-purple-400" />
|
|
104
|
+
</div>
|
|
105
|
+
<div class="text-center">
|
|
106
|
+
<h3 class="font-semibold text-primary">Full-code App</h3>
|
|
107
|
+
<p class="text-xs text-tertiary mt-1">
|
|
108
|
+
Build with React or Svelte with full control and a powerful AI agent.
|
|
109
|
+
</p>
|
|
110
|
+
</div>
|
|
111
|
+
<br /><br />
|
|
112
|
+
<div class="flex flex-row items-center gap-2">
|
|
113
|
+
<Badge color="yellow">
|
|
114
|
+
<FlaskConical size={12} class="mr-1" />
|
|
115
|
+
Preview (unstable)
|
|
116
|
+
</Badge>
|
|
117
|
+
</div>
|
|
118
|
+
</button>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</Modal>
|
|
122
|
+
|
|
123
|
+
<!-- Feature Preview Warning Modal -->
|
|
124
|
+
<Modal kind="X" bind:open={featurePreviewModalOpen} title="Feature Preview Notice">
|
|
125
|
+
<div class="flex flex-col gap-4">
|
|
126
|
+
<div
|
|
127
|
+
class="flex items-start gap-3 p-4 rounded-lg bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800"
|
|
128
|
+
>
|
|
129
|
+
<FlaskConical size={24} class="text-yellow-600 dark:text-yellow-400 shrink-0 mt-0.5" />
|
|
130
|
+
<div class="text-sm text-yellow-800 dark:text-yellow-200">
|
|
131
|
+
<p class="font-semibold mb-2">Full-code Apps are in Feature Preview</p>
|
|
132
|
+
<p>
|
|
133
|
+
This feature is not yet stable and may change significantly before it reaches General
|
|
134
|
+
Availability (GA), which is expected in <strong>January 2026</strong>.
|
|
135
|
+
</p>
|
|
136
|
+
<ul class="list-disc list-inside mt-2 space-y-1 text-yellow-700 dark:text-yellow-300">
|
|
137
|
+
<li>APIs and interfaces may change without notice</li>
|
|
138
|
+
<li>Some functionality may be incomplete or buggy</li>
|
|
139
|
+
<li>Not recommended for production use yet</li>
|
|
140
|
+
</ul>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div class="flex justify-end gap-3 pt-2">
|
|
145
|
+
<Button
|
|
146
|
+
color="light"
|
|
147
|
+
size="sm"
|
|
148
|
+
on:click={() => {
|
|
149
|
+
featurePreviewModalOpen = false
|
|
150
|
+
appTypeModalOpen = true
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
Go back
|
|
154
|
+
</Button>
|
|
155
|
+
<Button color="blue" size="sm" on:click={confirmFullCode}>I understand, continue</Button>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</Modal>
|
|
159
|
+
|
|
55
160
|
<!-- Raw JSON -->
|
|
56
161
|
<Drawer bind:this={drawer} size="800px">
|
|
57
162
|
<DrawerContent
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const CreateActionsApp: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type CreateActionsApp = InstanceType<typeof CreateActionsApp>;
|
|
1
|
+
declare const CreateActionsApp: import("svelte").Component<Record<string, never>, {}, "">;
|
|
2
|
+
type CreateActionsApp = ReturnType<typeof CreateActionsApp>;
|
|
18
3
|
export default CreateActionsApp;
|
|
@@ -3,7 +3,32 @@ import Tooltip from '../Tooltip.svelte';
|
|
|
3
3
|
import { SecondsInput } from '../common';
|
|
4
4
|
import { enterpriseLicense } from '../../stores';
|
|
5
5
|
import Label from '../Label.svelte';
|
|
6
|
-
let { debounce_delay_s = $bindable(), debounce_key = $bindable(), placeholder, size = 'xs', color = undefined, fontClass = 'font-normal' } = $props();
|
|
6
|
+
let { debounce_delay_s = $bindable(), debounce_key = $bindable(), debounce_args_to_accumulate = $bindable(), max_total_debouncing_time = $bindable(), max_total_debounces_amount = $bindable(), schema = undefined, placeholder, size = 'xs', color = undefined, fontClass = 'font-normal' } = $props();
|
|
7
|
+
// Get list of array-type arguments from schema
|
|
8
|
+
let arrayArgs = $derived(schema?.properties
|
|
9
|
+
? Object.entries(schema.properties)
|
|
10
|
+
.filter(([_, prop]) => prop.type === 'array')
|
|
11
|
+
.map(([key, _]) => key)
|
|
12
|
+
: []);
|
|
13
|
+
// Single selected arg for UI (convert between single selection and array)
|
|
14
|
+
let selectedArg = $state(debounce_args_to_accumulate?.[0] ?? '');
|
|
15
|
+
$effect(() => {
|
|
16
|
+
if (selectedArg && selectedArg !== '') {
|
|
17
|
+
debounce_args_to_accumulate = [selectedArg];
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
debounce_args_to_accumulate = undefined;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
// Convert 0 to undefined for max values
|
|
24
|
+
$effect(() => {
|
|
25
|
+
if (max_total_debouncing_time === 0) {
|
|
26
|
+
max_total_debouncing_time = undefined;
|
|
27
|
+
}
|
|
28
|
+
if (max_total_debounces_amount === 0) {
|
|
29
|
+
max_total_debounces_amount = undefined;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
7
32
|
</script>
|
|
8
33
|
|
|
9
34
|
<div>
|
|
@@ -53,6 +78,44 @@ let { debounce_delay_s = $bindable(), debounce_key = $bindable(), placeholder, s
|
|
|
53
78
|
{placeholder}
|
|
54
79
|
/>
|
|
55
80
|
</Label>
|
|
81
|
+
<Label label="Argument to accumulate (optional)">
|
|
82
|
+
{#snippet header()}
|
|
83
|
+
<Tooltip>
|
|
84
|
+
Select a list-type argument to accumulate across debounced executions. Values from
|
|
85
|
+
each debounced execution will be appended together.</Tooltip
|
|
86
|
+
>
|
|
87
|
+
{/snippet}
|
|
88
|
+
<select disabled={!$enterpriseLicense} bind:value={selectedArg}>
|
|
89
|
+
<option value="">None</option>
|
|
90
|
+
{#each arrayArgs as arg}
|
|
91
|
+
<option value={arg}>{arg}</option>
|
|
92
|
+
{/each}
|
|
93
|
+
</select>
|
|
94
|
+
{#if arrayArgs.length === 0}
|
|
95
|
+
<div class="text-xs text-gray-500 mt-1">
|
|
96
|
+
No list-type arguments found in schema. Define arguments with type "array" to enable
|
|
97
|
+
accumulation.
|
|
98
|
+
</div>
|
|
99
|
+
{/if}
|
|
100
|
+
</Label>
|
|
101
|
+
<Label label="Max total debouncing time (optional)">
|
|
102
|
+
{#snippet header()}
|
|
103
|
+
<Tooltip>
|
|
104
|
+
Maximum total time (in seconds) that a job can be debounced before it must execute.
|
|
105
|
+
Once this time is reached, the job will run regardless of ongoing debouncing.</Tooltip
|
|
106
|
+
>
|
|
107
|
+
{/snippet}
|
|
108
|
+
<SecondsInput disabled={!$enterpriseLicense} bind:seconds={max_total_debouncing_time} />
|
|
109
|
+
</Label>
|
|
110
|
+
<Label label="Max total debounces amount (optional)">
|
|
111
|
+
{#snippet header()}
|
|
112
|
+
<Tooltip>
|
|
113
|
+
Maximum number of times a job can be debounced before it must execute. Once this
|
|
114
|
+
count is reached, the job will run regardless of ongoing debouncing.</Tooltip
|
|
115
|
+
>
|
|
116
|
+
{/snippet}
|
|
117
|
+
<input type="number" disabled={!$enterpriseLicense} bind:value={max_total_debounces_amount} min="0" />
|
|
118
|
+
</Label>
|
|
56
119
|
</div>
|
|
57
120
|
{/if}
|
|
58
121
|
</div>
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import type { Schema } from '../../common';
|
|
1
2
|
type $$ComponentProps = {
|
|
2
3
|
debounce_delay_s: number | undefined;
|
|
3
4
|
debounce_key: string | undefined;
|
|
5
|
+
debounce_args_to_accumulate: string[] | undefined;
|
|
6
|
+
max_total_debouncing_time: number | undefined;
|
|
7
|
+
max_total_debounces_amount: number | undefined;
|
|
8
|
+
schema?: Schema;
|
|
4
9
|
placeholder: string;
|
|
5
10
|
size: 'xs' | 'sm';
|
|
6
11
|
color?: 'nord' | undefined;
|
|
7
12
|
fontClass?: string;
|
|
8
13
|
};
|
|
9
|
-
declare const DebounceLimit: import("svelte").Component<$$ComponentProps, {}, "debounce_delay_s" | "debounce_key">;
|
|
14
|
+
declare const DebounceLimit: import("svelte").Component<$$ComponentProps, {}, "debounce_delay_s" | "debounce_key" | "debounce_args_to_accumulate" | "max_total_debouncing_time" | "max_total_debounces_amount">;
|
|
10
15
|
type DebounceLimit = ReturnType<typeof DebounceLimit>;
|
|
11
16
|
export default DebounceLimit;
|
|
@@ -520,6 +520,7 @@ let preparedSqlQueries = usePreparedAssetSqlQueries(() => flowGraphAssetsCtx?.va
|
|
|
520
520
|
{enableAi}
|
|
521
521
|
{isAgentTool}
|
|
522
522
|
helperScript={retrieveDynCodeAndLang(flowModule.value)}
|
|
523
|
+
chatInputEnabled={flowStore.val.value?.chat_input_enabled ?? false}
|
|
523
524
|
/>
|
|
524
525
|
</PropPickerWrapper>
|
|
525
526
|
</div>
|
|
@@ -458,6 +458,10 @@ let numberOfAdvancedOptionsOn = $derived(activeAdvancedOptionNames.length);
|
|
|
458
458
|
fontClass="font-medium"
|
|
459
459
|
bind:debounce_delay_s={flowStore.val.value.debounce_delay_s}
|
|
460
460
|
bind:debounce_key={flowStore.val.value.debounce_key}
|
|
461
|
+
bind:debounce_args_to_accumulate={flowStore.val.value.debounce_args_to_accumulate}
|
|
462
|
+
bind:max_total_debouncing_time={flowStore.val.value.max_total_debouncing_time}
|
|
463
|
+
bind:max_total_debounces_amount={flowStore.val.value.max_total_debounces_amount}
|
|
464
|
+
schema={asSchema(flowStore.val.schema)}
|
|
461
465
|
placeholder={`$workspace/flow/${$pathStore}-$args[foo]`}
|
|
462
466
|
/>
|
|
463
467
|
{/if}
|
|
@@ -32,6 +32,17 @@ export const AI_AGENT_SCHEMA = {
|
|
|
32
32
|
type: 'object',
|
|
33
33
|
description: 'Configure how conversation memory is managed. Choose "auto" to let Windmill automatically store and load messages (up to N last messages), or "manual" to provide an explicit array of conversation messages. The system_prompt and user_message are added to the messages if provided.',
|
|
34
34
|
oneOf: [
|
|
35
|
+
{
|
|
36
|
+
type: 'object',
|
|
37
|
+
title: 'off',
|
|
38
|
+
properties: {
|
|
39
|
+
kind: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
enum: ['off'],
|
|
42
|
+
description: 'Disable conversation memory'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
35
46
|
{
|
|
36
47
|
type: 'object',
|
|
37
48
|
title: 'auto',
|
|
@@ -45,7 +56,14 @@ export const AI_AGENT_SCHEMA = {
|
|
|
45
56
|
context_length: {
|
|
46
57
|
type: 'number',
|
|
47
58
|
description: 'Number of most recent messages to store and load. Set to 0 to disable memory.',
|
|
48
|
-
default:
|
|
59
|
+
default: 5
|
|
60
|
+
},
|
|
61
|
+
memory_id: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
format: 'uuid',
|
|
64
|
+
'x-auto-generate': true,
|
|
65
|
+
description: 'Custom memory identifier. Each unique ID maintains separate conversation history.',
|
|
66
|
+
hideWhenChatEnabled: true
|
|
49
67
|
}
|
|
50
68
|
},
|
|
51
69
|
required: ['kind'],
|
|
@@ -44,6 +44,7 @@ export declare function getFirstStepSchema(flowState: FlowState, flow: OpenFlow)
|
|
|
44
44
|
} | undefined;
|
|
45
45
|
required?: string[] | undefined;
|
|
46
46
|
showExpr?: string | undefined;
|
|
47
|
+
hideWhenChatEnabled?: boolean | undefined;
|
|
47
48
|
password?: boolean | undefined;
|
|
48
49
|
order?: string[] | undefined;
|
|
49
50
|
nullable?: boolean | undefined;
|
|
@@ -54,6 +55,7 @@ export declare function getFirstStepSchema(flowState: FlowState, flow: OpenFlow)
|
|
|
54
55
|
originalType?: string | undefined;
|
|
55
56
|
disabled?: boolean | undefined;
|
|
56
57
|
'x-no-s3-storage-workspace-warning'?: string | undefined;
|
|
58
|
+
'x-auto-generate'?: boolean | undefined;
|
|
57
59
|
};
|
|
58
60
|
};
|
|
59
61
|
order?: string[] | undefined;
|
|
@@ -72,6 +72,7 @@ export function filteredContentForExport(flow) {
|
|
|
72
72
|
return o;
|
|
73
73
|
}
|
|
74
74
|
import { dfs as dfsApply } from './dfs';
|
|
75
|
+
import { randomUUID } from './conversations/FlowChatManager.svelte';
|
|
75
76
|
export function cleanFlow(flow) {
|
|
76
77
|
const newFlow = $state.snapshot(flow);
|
|
77
78
|
dfsApply(newFlow.value.modules, (mod) => {
|
|
@@ -92,6 +93,22 @@ export function cleanFlow(flow) {
|
|
|
92
93
|
if (mod.value.type == 'rawscript' && mod.value.assets?.length == 0) {
|
|
93
94
|
mod.value.assets = undefined;
|
|
94
95
|
}
|
|
96
|
+
// Generate memory_id for AI agents with auto memory if not already set
|
|
97
|
+
// Only if chat input is not enabled, as otherwise memory id is based on conversation id
|
|
98
|
+
if (!newFlow.value.chat_input_enabled && mod.value.type === 'aiagent') {
|
|
99
|
+
const memoryTransform = mod.value.input_transforms?.memory;
|
|
100
|
+
if (memoryTransform?.type === 'static' && memoryTransform.value) {
|
|
101
|
+
const memoryValue = memoryTransform.value;
|
|
102
|
+
if (memoryValue.kind === 'auto' &&
|
|
103
|
+
memoryValue.context_length > 0 &&
|
|
104
|
+
!memoryValue.memory_id) {
|
|
105
|
+
memoryTransform.value = {
|
|
106
|
+
...memoryValue,
|
|
107
|
+
memory_id: randomUUID()
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
95
112
|
});
|
|
96
113
|
if (newFlow.value.concurrency_key == '') {
|
|
97
114
|
newFlow.value.concurrency_key = undefined;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import AirtableIcon from './AirtableIcon.svelte';
|
|
2
|
+
import DbIcon from './DbIcon.svelte';
|
|
3
|
+
import DiscordIcon from './DiscordIcon.svelte';
|
|
4
|
+
import GcalIcon from './GcalIcon.svelte';
|
|
5
|
+
import GCloudIcon from './GCloudIcon.svelte';
|
|
6
|
+
import GdriveIcon from './GdriveIcon.svelte';
|
|
7
|
+
import GithubIcon from './GithubIcon.svelte';
|
|
8
|
+
import GitlabIcon from './GitlabIcon.svelte';
|
|
9
|
+
import GmailIcon from './GmailIcon.svelte';
|
|
10
|
+
import GSheetsIcon from './GSheetsIcon.svelte';
|
|
11
|
+
import HttpIcon from './HttpIcon.svelte';
|
|
12
|
+
import Mail from './Mail.svelte';
|
|
13
|
+
import MastodonIcon from './MastodonIcon.svelte';
|
|
14
|
+
import MatrixIcon from './MatrixIcon.svelte';
|
|
15
|
+
import Mysql from './Mysql.svelte';
|
|
16
|
+
import PostgresIcon from './PostgresIcon.svelte';
|
|
17
|
+
import S3Icon from './S3Icon.svelte';
|
|
18
|
+
import Slack from './Slack.svelte';
|
|
19
|
+
import TogglIcon from './TogglIcon.svelte';
|
|
20
|
+
import WindmillIcon from './WindmillIcon.svelte';
|
|
21
|
+
import WindmillIcon2 from './WindmillIcon2.svelte';
|
|
22
|
+
import SchedulePollIcon from './SchedulePollIcon.svelte';
|
|
23
|
+
import MailchimpIcon from './MailchimpIcon.svelte';
|
|
24
|
+
import SendgridIcon from './SendgridIcon.svelte';
|
|
25
|
+
import SendflakeIcon from './SendflakeIcon.svelte';
|
|
26
|
+
import LinkedinIcon from './LinkedinIcon.svelte';
|
|
27
|
+
import HubspotIcon from './HubspotIcon.svelte';
|
|
28
|
+
import DatadogIcon from './DatadogIcon.svelte';
|
|
29
|
+
import StripeIcon from './StripeIcon.svelte';
|
|
30
|
+
import TelegramIcon from './TelegramIcon.svelte';
|
|
31
|
+
import FunkwhaleIcon from './FunkwhaleIcon.svelte';
|
|
32
|
+
import GdocsIcon from './GdocsIcon.svelte';
|
|
33
|
+
import NextcloudIcon from './NextcloudIcon.svelte';
|
|
34
|
+
import FaunadbIcon from './FaunadbIcon.svelte';
|
|
35
|
+
import ClickhouseIcon from './ClickhouseIcon.svelte';
|
|
36
|
+
import OpenaiIcon from './OpenaiIcon.svelte';
|
|
37
|
+
import AwsIcon from './AwsIcon.svelte';
|
|
38
|
+
import BcryptIcon from './BcryptIcon.svelte';
|
|
39
|
+
import GoogleIcon from './GoogleIcon.svelte';
|
|
40
|
+
import MicrosoftIcon from './MicrosoftIcon.svelte';
|
|
41
|
+
import HackernewsIcon from './HackernewsIcon.svelte';
|
|
42
|
+
import MongodbIcon from './MongodbIcon.svelte';
|
|
43
|
+
import RedditIcon from './RedditIcon.svelte';
|
|
44
|
+
import SupabaseIcon from './SupabaseIcon.svelte';
|
|
45
|
+
import WebdavIcon from './WebdavIcon.svelte';
|
|
46
|
+
import ZammadIcon from './ZammadIcon.svelte';
|
|
47
|
+
import SurrealdbIcon from './SurrealdbIcon.svelte';
|
|
48
|
+
import ActivitypubIcon from './ActivitypubIcon.svelte';
|
|
49
|
+
import AwsEcrIcon from './AwsEcrIcon.svelte';
|
|
50
|
+
import CalcomIcon from './CalcomIcon.svelte';
|
|
51
|
+
import ClickupIcon from './ClickupIcon.svelte';
|
|
52
|
+
import CloudflareIcon from './CloudflareIcon.svelte';
|
|
53
|
+
import FirebaseIcon from './FirebaseIcon.svelte';
|
|
54
|
+
import GoogleFormsIcon from './GoogleFormsIcon.svelte';
|
|
55
|
+
import JiraIcon from './JiraIcon.svelte';
|
|
56
|
+
import NotionIcon from './NotionIcon.svelte';
|
|
57
|
+
import PineconeIcon from './PineconeIcon.svelte';
|
|
58
|
+
import RssIcon from './RssIcon.svelte';
|
|
59
|
+
import ShopifyIcon from './ShopifyIcon.svelte';
|
|
60
|
+
import TypeformIcon from './TypeformIcon.svelte';
|
|
61
|
+
import BigQueryIcon from './BigQueryIcon.svelte';
|
|
62
|
+
import OracleDBIcon from './OracleDBIcon.svelte';
|
|
63
|
+
import GraphqlIcon from './GraphqlIcon.svelte';
|
|
64
|
+
import NocoDbIcon from './NocoDbIcon.svelte';
|
|
65
|
+
import AzureIcon from './AzureIcon.svelte';
|
|
66
|
+
import OktaIcon from './OktaIcon.svelte';
|
|
67
|
+
import Auth0Icon from './Auth0Icon.svelte';
|
|
68
|
+
import AuthentikIcon from './AuthentikIcon.svelte';
|
|
69
|
+
import AutheliaIcon from './AutheliaIcon.svelte';
|
|
70
|
+
import KanidmIcon from './KanidmIcon.svelte';
|
|
71
|
+
import AsanaIcon from './AsanaIcon.svelte';
|
|
72
|
+
import BitbucketIcon from './BitbucketIcon.svelte';
|
|
73
|
+
import DynatraceIcon from './DynatraceIcon.svelte';
|
|
74
|
+
import EdgeDbIcon from './EdgeDbIcon.svelte';
|
|
75
|
+
import GitIcon from './GitIcon.svelte';
|
|
76
|
+
import ZendeskIcon from './ZendeskIcon.svelte';
|
|
77
|
+
import TwilioIcon from './TwilioIcon.svelte';
|
|
78
|
+
import TrelloIcon from './TrelloIcon.svelte';
|
|
79
|
+
import ResendIcon from './ResendIcon.svelte';
|
|
80
|
+
import PushoverIcon from './PushoverIcon.svelte';
|
|
81
|
+
import QuickbooksIcon from './QuickbooksIcon.svelte';
|
|
82
|
+
import MsTeamsIcon from './MSTeamsIcon.svelte';
|
|
83
|
+
import MailgunIcon from './MailgunIcon.svelte';
|
|
84
|
+
import IpinfoIcon from './IpinfoIcon.svelte';
|
|
85
|
+
import GoogleCloudIcon from './GoogleCloudIcon.svelte';
|
|
86
|
+
import CaCertificate from './CACertificate.svelte';
|
|
87
|
+
import CurrencyApiIcon from './CurrencyApiIcon.svelte';
|
|
88
|
+
import VismaIcon from './VismaIcon.svelte';
|
|
89
|
+
import JumpCloudIcon from './JumpCloudIcon.svelte';
|
|
90
|
+
import KeycloakIcon from './KeycloakIcon.svelte';
|
|
91
|
+
import ZitadelIcon from './ZitadelIcon.svelte';
|
|
92
|
+
import XeroIcon from './XeroIcon.svelte';
|
|
93
|
+
import KafkaIcon from './KafkaIcon.svelte';
|
|
94
|
+
import NatsIcon from './NatsIcon.svelte';
|
|
95
|
+
import MqttIcon from './MqttIcon.svelte';
|
|
96
|
+
import ApifyIcon from './ApifyIcon.svelte';
|
|
97
|
+
import McpIcon from './McpIcon.svelte';
|
|
98
|
+
import ZohoIcon from './ZohoIcon.svelte';
|
|
99
|
+
import type { Component } from 'svelte';
|
|
100
|
+
export declare const APP_TO_ICON_COMPONENT: Record<string, Component>;
|
|
101
|
+
export { AirtableIcon, DbIcon, DiscordIcon, GcalIcon, GCloudIcon, GdriveIcon, GithubIcon, GitlabIcon, GmailIcon, GSheetsIcon, HttpIcon, Mail, MastodonIcon, MatrixIcon, Mysql, PostgresIcon, S3Icon, Slack, TogglIcon, WindmillIcon, WindmillIcon2, SchedulePollIcon, MailchimpIcon, SendgridIcon, LinkedinIcon, HubspotIcon, TelegramIcon, StripeIcon, DatadogIcon, FunkwhaleIcon, GdocsIcon, FaunadbIcon, ClickhouseIcon, OpenaiIcon, AwsIcon, BcryptIcon, GoogleIcon, HackernewsIcon, MongodbIcon, RedditIcon, SupabaseIcon, WebdavIcon, ZammadIcon, NextcloudIcon, SendflakeIcon, SurrealdbIcon, ActivitypubIcon, AwsEcrIcon, CalcomIcon, ClickupIcon, CloudflareIcon, FirebaseIcon, GoogleFormsIcon, JiraIcon, NotionIcon, PineconeIcon, RssIcon, ShopifyIcon, TypeformIcon, BigQueryIcon, OracleDBIcon, GraphqlIcon, NocoDbIcon, AzureIcon, MicrosoftIcon, OktaIcon, Auth0Icon, AuthentikIcon, AutheliaIcon, KanidmIcon, AsanaIcon, BitbucketIcon, DynatraceIcon, EdgeDbIcon, GitIcon, ZendeskIcon, TwilioIcon, TrelloIcon, ResendIcon, PushoverIcon, QuickbooksIcon, MsTeamsIcon, MailgunIcon, IpinfoIcon, GoogleCloudIcon, CaCertificate, CurrencyApiIcon, VismaIcon, JumpCloudIcon, KeycloakIcon, ZitadelIcon, XeroIcon, KafkaIcon, NatsIcon, MqttIcon, ApifyIcon, McpIcon, ZohoIcon };
|
|
@@ -211,5 +211,5 @@ export const APP_TO_ICON_COMPONENT = {
|
|
|
211
211
|
apify: ApifyIcon,
|
|
212
212
|
mcp: McpIcon,
|
|
213
213
|
zoho: ZohoIcon
|
|
214
|
-
};
|
|
214
|
+
}; // to generate correct svelte package types
|
|
215
215
|
export { AirtableIcon, DbIcon, DiscordIcon, GcalIcon, GCloudIcon, GdriveIcon, GithubIcon, GitlabIcon, GmailIcon, GSheetsIcon, HttpIcon, Mail, MastodonIcon, MatrixIcon, Mysql, PostgresIcon, S3Icon, Slack, TogglIcon, WindmillIcon, WindmillIcon2, SchedulePollIcon, MailchimpIcon, SendgridIcon, LinkedinIcon, HubspotIcon, TelegramIcon, StripeIcon, DatadogIcon, FunkwhaleIcon, GdocsIcon, FaunadbIcon, ClickhouseIcon, OpenaiIcon, AwsIcon, BcryptIcon, GoogleIcon, HackernewsIcon, MongodbIcon, RedditIcon, SupabaseIcon, WebdavIcon, ZammadIcon, NextcloudIcon, SendflakeIcon, SurrealdbIcon, ActivitypubIcon, AwsEcrIcon, CalcomIcon, ClickupIcon, CloudflareIcon, FirebaseIcon, GoogleFormsIcon, JiraIcon, NotionIcon, PineconeIcon, RssIcon, ShopifyIcon, TypeformIcon, BigQueryIcon, OracleDBIcon, GraphqlIcon, NocoDbIcon, AzureIcon, MicrosoftIcon, OktaIcon, Auth0Icon, AuthentikIcon, AutheliaIcon, KanidmIcon, AsanaIcon, BitbucketIcon, DynatraceIcon, EdgeDbIcon, GitIcon, ZendeskIcon, TwilioIcon, TrelloIcon, ResendIcon, PushoverIcon, QuickbooksIcon, MsTeamsIcon, MailgunIcon, IpinfoIcon, GoogleCloudIcon, CaCertificate, CurrencyApiIcon, VismaIcon, JumpCloudIcon, KeycloakIcon, ZitadelIcon, XeroIcon, KafkaIcon, NatsIcon, MqttIcon, ApifyIcon, McpIcon, ZohoIcon };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script lang="ts">import { Settings } from 'lucide-svelte';
|
|
2
|
+
import Popover from '../meltComponents/Popover.svelte';
|
|
3
|
+
import Select from '../select/Select.svelte';
|
|
4
|
+
import { workspaceStore } from '../../stores';
|
|
5
|
+
import { createDatatablesResource, createSchemasResource, toDatatableItems, toSchemaItems } from './datatableUtils.svelte';
|
|
6
|
+
let { datatable, schema, onChange, description = 'Set the default datatable and schema for new tables. This is where AI will create new tables when needed.' } = $props();
|
|
7
|
+
// Load available datatables and schemas using shared utilities
|
|
8
|
+
const datatables = createDatatablesResource(() => $workspaceStore);
|
|
9
|
+
const schemas = createSchemasResource(() => datatable);
|
|
10
|
+
const datatableItems = $derived(toDatatableItems(datatables.current));
|
|
11
|
+
const schemaItems = $derived(toSchemaItems(schemas.current));
|
|
12
|
+
// Track datatable changes to reset schema
|
|
13
|
+
let previousDatatable = $state(undefined);
|
|
14
|
+
$effect(() => {
|
|
15
|
+
if (previousDatatable !== undefined && datatable !== previousDatatable) {
|
|
16
|
+
// Reset schema when datatable changes
|
|
17
|
+
onChange?.(datatable, undefined);
|
|
18
|
+
}
|
|
19
|
+
previousDatatable = datatable;
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<Popover>
|
|
24
|
+
<svelte:fragment slot="trigger">
|
|
25
|
+
<button
|
|
26
|
+
class="pt-1.5 pb-0.5 px-1 hover:bg-surface-hover rounded transition-colors"
|
|
27
|
+
title="Configure default datatable & schema"
|
|
28
|
+
>
|
|
29
|
+
<Settings size={12} class="text-tertiary" />
|
|
30
|
+
</button>
|
|
31
|
+
</svelte:fragment>
|
|
32
|
+
<svelte:fragment slot="content">
|
|
33
|
+
<div class="flex flex-col gap-3 p-2 min-w-64 max-w-80">
|
|
34
|
+
<div class="text-xs font-medium text-primary">Default Datatable & Schema</div>
|
|
35
|
+
|
|
36
|
+
<p class="text-2xs text-tertiary leading-relaxed">
|
|
37
|
+
{description}
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
<div class="flex flex-col gap-1">
|
|
41
|
+
<span class="text-2xs text-tertiary">Database</span>
|
|
42
|
+
<Select
|
|
43
|
+
items={datatableItems}
|
|
44
|
+
bind:value={() => datatable, (v) => onChange?.(v, schema)}
|
|
45
|
+
placeholder="Select database"
|
|
46
|
+
size="sm"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="flex flex-col gap-1">
|
|
51
|
+
<span class="text-2xs text-tertiary">Schema</span>
|
|
52
|
+
<Select
|
|
53
|
+
items={schemaItems}
|
|
54
|
+
bind:value={() => schema ?? '', (v) => onChange?.(datatable, v || undefined)}
|
|
55
|
+
placeholder="public"
|
|
56
|
+
size="sm"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</svelte:fragment>
|
|
61
|
+
</Popover>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Currently selected datatable */
|
|
3
|
+
datatable: string | undefined;
|
|
4
|
+
/** Currently selected schema */
|
|
5
|
+
schema: string | undefined;
|
|
6
|
+
/** Callback when either value changes */
|
|
7
|
+
onChange?: (datatable: string | undefined, schema: string | undefined) => void;
|
|
8
|
+
/** Description text to show in the popover */
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const DefaultDatabaseSelector: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type DefaultDatabaseSelector = ReturnType<typeof DefaultDatabaseSelector>;
|
|
13
|
+
export default DefaultDatabaseSelector;
|
|
@@ -23,6 +23,22 @@ let listener = async (event) => {
|
|
|
23
23
|
if (event.data.type == 'backend') {
|
|
24
24
|
respond({ result, error });
|
|
25
25
|
}
|
|
26
|
+
if (editor) {
|
|
27
|
+
try {
|
|
28
|
+
let jobInfo = await JobService.getCompletedJobTiming({ workspace, id: uuid });
|
|
29
|
+
if (jobInfo.started_at) {
|
|
30
|
+
jobsById[uuid] = {
|
|
31
|
+
...(jobsById[uuid] ?? {}),
|
|
32
|
+
created_at: new Date(jobInfo.created_at).getTime(),
|
|
33
|
+
started_at: new Date(jobInfo.started_at).getTime(),
|
|
34
|
+
duration_ms: jobInfo.duration_ms
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
console.error('Error getting job info', e);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
26
42
|
return result;
|
|
27
43
|
}
|
|
28
44
|
if (event.data.type == 'backend' || event.data.type == 'backendAsync') {
|
|
@@ -61,7 +77,7 @@ let listener = async (event) => {
|
|
|
61
77
|
await respondWithResult(data.jobId);
|
|
62
78
|
}
|
|
63
79
|
else if (event.data.type == 'getJob') {
|
|
64
|
-
const job = JobService.getJob({ workspace, id: data.jobId });
|
|
80
|
+
const job = await JobService.getJob({ workspace, id: data.jobId });
|
|
65
81
|
respond({ result: job });
|
|
66
82
|
}
|
|
67
83
|
else {
|