windmill-components 1.542.5 → 1.550.0
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 +4 -1
- package/package/components/AIAgentLogViewer.svelte +1 -1
- package/package/components/ArgEnum.svelte +14 -5
- package/package/components/ArgInput.svelte +23 -15
- package/package/components/ArgInput.svelte.d.ts +1 -1
- package/package/components/ChannelSelector.svelte +92 -18
- package/package/components/ChannelSelector.svelte.d.ts +2 -0
- package/package/components/ConnectionSection.svelte +12 -1
- package/package/components/Dev.svelte +18 -5
- package/package/components/Dev.svelte.d.ts +23 -1
- package/package/components/DisplayResult.svelte +36 -23
- package/package/components/DropdownV2.svelte +8 -2
- package/package/components/DropdownV2.svelte.d.ts +1 -0
- package/package/components/DynamicInput.svelte +10 -10
- package/package/components/EditableSchemaForm.svelte +21 -7
- package/package/components/ErrorOrRecoveryHandler.svelte +14 -20
- package/package/components/FlowHistoryJobPicker.svelte +3 -0
- package/package/components/FlowHistoryJobPicker.svelte.d.ts +1 -0
- package/package/components/FlowJobResult.svelte +5 -5
- package/package/components/FlowLogRow.svelte +2 -2
- package/package/components/FlowLogViewer.svelte +228 -57
- package/package/components/FlowLogViewer.svelte.d.ts +16 -5
- package/package/components/FlowLogViewerWrapper.svelte +56 -3
- package/package/components/FlowLogViewerWrapper.svelte.d.ts +4 -3
- package/package/components/FlowLoopIterationPreview.svelte +4 -4
- package/package/components/FlowMetadata.svelte +3 -4
- package/package/components/FlowMetadata.svelte.d.ts +4 -18
- package/package/components/FlowPreviewContent.svelte +9 -3
- package/package/components/FlowPreviewContent.svelte.d.ts +1 -1
- package/package/components/FlowStatusViewer.svelte +62 -59
- package/package/components/FlowStatusViewer.svelte.d.ts +2 -2
- package/package/components/FlowStatusViewerInner.svelte +186 -94
- package/package/components/FlowStatusViewerInner.svelte.d.ts +10 -3
- package/package/components/FlowTimeline.svelte +110 -131
- package/package/components/FlowTimeline.svelte.d.ts +13 -4
- package/package/components/FlowTimelineBar.svelte +227 -0
- package/package/components/FlowTimelineBar.svelte.d.ts +24 -0
- package/package/components/InputTransformForm.svelte +119 -3
- package/package/components/InputTransformForm.svelte.d.ts +3 -0
- package/package/components/InputTransformSchemaForm.svelte +5 -1
- package/package/components/InputTransformSchemaForm.svelte.d.ts +2 -0
- package/package/components/InstanceSetting.svelte +17 -42
- package/package/components/InstanceSettings.svelte +12 -21
- package/package/components/JobArgs.svelte +15 -16
- package/package/components/JobArgs.svelte.d.ts +4 -18
- package/package/components/JobLoader.svelte +23 -42
- package/package/components/JobLoader.svelte.d.ts +2 -0
- package/package/components/JobStatus.svelte +1 -1
- package/package/components/JobStatus.svelte.d.ts +4 -18
- package/package/components/ModulePreviewResultViewer.svelte +1 -7
- package/package/components/NextcloudSetting.svelte +6 -1
- package/package/components/Password.svelte +7 -11
- package/package/components/Password.svelte.d.ts +5 -20
- package/package/components/PasswordArgInput.svelte +35 -15
- package/package/components/PasswordArgInput.svelte.d.ts +4 -18
- package/package/components/QueuePosition.svelte +6 -2
- package/package/components/RunForm.svelte +5 -14
- package/package/components/S3ArrayHelperButton.svelte +12 -0
- package/package/components/S3ArrayHelperButton.svelte.d.ts +8 -0
- package/package/components/ScriptEditor.svelte +5 -6
- package/package/components/StringTypeNarrowing.svelte +39 -24
- package/package/components/StringTypeNarrowing.svelte.d.ts +1 -1
- package/package/components/TeamSelector.svelte +83 -37
- package/package/components/TeamSelector.svelte.d.ts +0 -1
- package/package/components/apps/components/buttons/AppButton.svelte +11 -1
- package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte +13 -4
- package/package/components/apps/components/display/table/SyncColumnDefs.svelte +2 -2
- package/package/components/apps/components/display/table/utils.js +1 -1
- package/package/components/apps/components/helpers/RefreshButton.svelte +5 -1
- package/package/components/apps/components/helpers/RunnableComponent.svelte +0 -2
- package/package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -0
- package/package/components/apps/components/layout/AppTabs.svelte +116 -71
- package/package/components/apps/components/layout/AppTabs.svelte.d.ts +1 -0
- package/package/components/apps/editor/component/ComponentInner.svelte +1 -0
- package/package/components/apps/editor/component/components.d.ts +16 -1
- package/package/components/apps/editor/component/components.js +22 -2
- package/package/components/apps/editor/settingsPanel/ComponentPanel.svelte +2 -0
- package/package/components/apps/editor/settingsPanel/GridTab.svelte +19 -1
- package/package/components/apps/editor/settingsPanel/GridTab.svelte.d.ts +3 -1
- package/package/components/apps/editor/settingsPanel/GridTabHidden.svelte +52 -0
- package/package/components/apps/editor/settingsPanel/GridTabHidden.svelte.d.ts +9 -0
- package/package/components/auditLogs/AuditLogsFilters.svelte +6 -0
- package/package/components/auditLogs/AuditLogsTable.svelte +17 -7
- package/package/components/auditLogs/AuditLogsTable.svelte.d.ts +1 -0
- package/package/components/common/CloseButton.svelte +2 -2
- package/package/components/common/CloseButton.svelte.d.ts +1 -0
- package/package/components/common/layout/List.svelte +3 -7
- package/package/components/common/layout/List.svelte.d.ts +7 -29
- package/package/components/common/popup/PopupV2.svelte +8 -25
- package/package/components/common/popup/PopupV2.svelte.d.ts +4 -2
- package/package/components/common/table/ScriptRow.svelte +22 -2
- package/package/components/copilot/FlowCopilotInputsModal.svelte +26 -23
- package/package/components/copilot/chat/AIChatManager.svelte.js +3 -2
- package/package/components/copilot/chat/ProviderModelSelector.svelte +1 -1
- package/package/components/copilot/chat/flow/FlowAIChat.svelte +4 -2
- package/package/components/copilot/chat/script/core.d.ts +4 -4
- package/package/components/copilot/chat/script/core.js +93 -34
- package/package/components/copilot/lib.d.ts +1 -0
- package/package/components/copilot/lib.js +6 -3
- package/package/components/custom_ui.d.ts +1 -0
- package/package/components/flows/FlowProgressBar.svelte +16 -16
- package/package/components/flows/FlowProgressBar.svelte.d.ts +7 -22
- package/package/components/flows/content/FlowInputsQuick.svelte +3 -2
- package/package/components/flows/content/FlowInputsQuick.svelte.d.ts +1 -0
- package/package/components/flows/content/FlowModuleComponent.svelte +24 -1
- package/package/components/flows/flowInfers.js +34 -8
- package/package/components/flows/flowStore.d.ts +4 -1
- package/package/components/flows/map/FlowJobsMenu.svelte +3 -3
- package/package/components/flows/map/FlowJobsMenu.svelte.d.ts +1 -1
- package/package/components/flows/map/InsertModuleButton.svelte +4 -14
- package/package/components/flows/map/InsertModuleButton.svelte.d.ts +0 -1
- package/package/components/flows/map/InsertModuleInner.svelte +17 -20
- package/package/components/flows/map/MapItem.svelte +1 -1
- package/package/components/flows/pickers/PickHubScriptQuick.svelte +38 -52
- package/package/components/flows/pickers/PickHubScriptQuick.svelte.d.ts +1 -0
- package/package/components/flows/pickers/WorkspaceScriptPickerQuick.svelte +27 -15
- package/package/components/flows/pickers/WorkspaceScriptPickerQuick.svelte.d.ts +1 -0
- package/package/components/flows/propPicker/OutputPicker.svelte +2 -0
- package/package/components/git_sync/DetectionFlow.svelte +33 -44
- package/package/components/git_sync/DetectionFlow.svelte.d.ts +1 -0
- package/package/components/git_sync/GitSyncContext.svelte.d.ts +22 -0
- package/package/components/git_sync/GitSyncContext.svelte.js +145 -5
- package/package/components/git_sync/GitSyncModeDisplay.svelte +14 -0
- package/package/components/git_sync/GitSyncModeDisplay.svelte.d.ts +9 -0
- package/package/components/git_sync/GitSyncRepositoryCard.svelte +365 -253
- package/package/components/git_sync/GitSyncRepositoryCard.svelte.d.ts +10 -1
- package/package/components/git_sync/GitSyncSection.svelte +134 -14
- package/package/components/git_sync/PullWorkspaceModal.svelte +24 -32
- package/package/components/git_sync/PushWorkspaceModal.svelte +24 -32
- package/package/components/graph/model.d.ts +5 -5
- package/package/components/graph/renderers/edges/EmptyEdge.svelte +3 -10
- package/package/components/graph/renderers/edges/EmptyEdge.svelte.d.ts +4 -18
- package/package/components/graph/renderers/nodes/AIToolNode.svelte +2 -2
- package/package/components/graph/renderers/nodes/NewAIToolNode.svelte +5 -10
- package/package/components/home/ItemsList.svelte +1 -1
- package/package/components/jobs/JobProgressBar.svelte +27 -21
- package/package/components/jobs/JobProgressBar.svelte.d.ts +9 -24
- package/package/components/meltComponents/MenuSingleItem.svelte +3 -8
- package/package/components/meltComponents/MenuSingleItem.svelte.d.ts +0 -3
- package/package/components/meltComponents/Popover.svelte +3 -2
- package/package/components/meltComponents/Popover.svelte.d.ts +1 -0
- package/package/components/meltComponents/Tooltip.svelte +1 -1
- package/package/components/progressBar/ProgressBar.svelte +39 -53
- package/package/components/progressBar/ProgressBar.svelte.d.ts +11 -26
- package/package/components/runs/JobsLoader.svelte +1 -1
- package/package/components/runs/NoWorkerWithTagWarning.svelte +3 -3
- package/package/components/runs/NoWorkerWithTagWarning.svelte.d.ts +1 -1
- package/package/components/schema/AddPropertyV2.svelte +7 -4
- package/package/components/schema/PropertyEditor.svelte.d.ts +1 -1
- package/package/components/select/MultiSelect.svelte +2 -2
- package/package/components/select/MultiSelect.svelte.d.ts +1 -0
- package/package/components/settings/WorkspaceUserSettings.svelte +92 -1
- package/package/components/sidebar/MenuLink.svelte +2 -1
- package/package/components/sidebar/MenuLink.svelte.d.ts +1 -0
- package/package/components/sidebar/SidebarContent.svelte +27 -27
- package/package/components/table/Cell.svelte +7 -14
- package/package/components/table/Cell.svelte.d.ts +13 -35
- package/package/components/triggers/AddTriggersButton.svelte +1 -0
- package/package/components/triggers/gcp/GcpTriggerEditorConfigSection.svelte +1 -1
- package/package/components/triggers/gcp/GcpTriggerEditorConfigSection.svelte.d.ts +2 -1
- package/package/components/triggers/gcp/GcpTriggerEditorInner.svelte +28 -5
- package/package/components/triggers/gcp/utils.js +1 -0
- package/package/components/triggers/schedules/ScheduleEditorInner.svelte +1 -0
- package/package/components/triggers/webhook/WebhooksConfigSection.svelte +143 -63
- package/package/components/triggers/websocket/WebsocketTriggerEditorInner.svelte +22 -0
- package/package/components/triggers/websocket/utils.js +1 -0
- package/package/components/workspaceSettings/AISettings.svelte +8 -2
- package/package/components/workspaceSettings/AISettings.svelte.d.ts +2 -1
- package/package/components/workspaceSettings/ModelTokenLimits.svelte +165 -0
- package/package/components/workspaceSettings/ModelTokenLimits.svelte.d.ts +8 -0
- package/package/components/workspaceSettings/StorageSettings.svelte +123 -51
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +141 -16
- package/package/gen/schemas.gen.js +144 -16
- package/package/gen/services.gen.d.ts +62 -42
- package/package/gen/services.gen.js +131 -82
- package/package/gen/types.gen.d.ts +218 -144
- package/package/hubPaths.json +2 -1
- package/package/services/JobManager.js +10 -7
- package/package/stores.d.ts +1 -0
- package/package/stores.js +6 -3
- package/package/timelineCompute.svelte.d.ts +21 -0
- package/package/timelineCompute.svelte.js +113 -0
- package/package/utils.d.ts +15 -8
- package/package/utils.js +62 -12
- package/package/workspace_settings.d.ts +13 -8
- package/package/workspace_settings.js +46 -11
- package/package.json +2 -2
|
@@ -879,11 +879,23 @@ export const components = {
|
|
|
879
879
|
value: undefined,
|
|
880
880
|
fieldType: 'icon-select'
|
|
881
881
|
},
|
|
882
|
+
tooltip: {
|
|
883
|
+
type: 'static',
|
|
884
|
+
value: '',
|
|
885
|
+
fieldType: 'text',
|
|
886
|
+
tooltip: 'Tooltip text to show on hover'
|
|
887
|
+
},
|
|
882
888
|
triggerOnAppLoad: {
|
|
883
889
|
type: 'static',
|
|
884
890
|
value: false,
|
|
885
891
|
fieldType: 'boolean'
|
|
886
892
|
},
|
|
893
|
+
runInBackground: {
|
|
894
|
+
type: 'static',
|
|
895
|
+
value: false,
|
|
896
|
+
fieldType: 'boolean',
|
|
897
|
+
tooltip: 'Run the job in the background without blocking the button. Multiple clicks will trigger multiple jobs.'
|
|
898
|
+
},
|
|
887
899
|
onSuccess: onSuccessClick,
|
|
888
900
|
onError: onErrorClick,
|
|
889
901
|
confirmationModal: {
|
|
@@ -2456,7 +2468,15 @@ See date-fns format for more information. By default, it is 'dd.MM.yyyy HH:mm'
|
|
|
2456
2468
|
},
|
|
2457
2469
|
componentInput: undefined,
|
|
2458
2470
|
numberOfSubgrids: 2,
|
|
2459
|
-
tabs: ['First tab', 'Second tab']
|
|
2471
|
+
tabs: ['First tab', 'Second tab'],
|
|
2472
|
+
disabledTabs: [
|
|
2473
|
+
{ type: 'static', value: false, fieldType: 'boolean' },
|
|
2474
|
+
{ type: 'static', value: false, fieldType: 'boolean' }
|
|
2475
|
+
],
|
|
2476
|
+
hiddenTabs: [
|
|
2477
|
+
{ type: 'static', value: false, fieldType: 'boolean' },
|
|
2478
|
+
{ type: 'static', value: false, fieldType: 'boolean' }
|
|
2479
|
+
]
|
|
2460
2480
|
}
|
|
2461
2481
|
},
|
|
2462
2482
|
steppercomponent: {
|
|
@@ -2994,7 +3014,7 @@ See date-fns format for more information. By default, it is 'dd.MM.yyyy HH:mm'
|
|
|
2994
3014
|
type: 'static',
|
|
2995
3015
|
fieldType: 'object',
|
|
2996
3016
|
value: {},
|
|
2997
|
-
tooltip: 'This enables setting form enum values dynamically using an object: keys are field names, and values are arrays of strings.'
|
|
3017
|
+
tooltip: 'This enables setting form enum values dynamically using an object: keys are field names, and values are arrays of strings or { "label": "myLabel", "value": "myValue" }.'
|
|
2998
3018
|
},
|
|
2999
3019
|
displayType: {
|
|
3000
3020
|
fieldType: 'boolean',
|
|
@@ -337,8 +337,10 @@ function onTemplateChange(e) {
|
|
|
337
337
|
<GridTab
|
|
338
338
|
bind:tabs={item.data.tabs}
|
|
339
339
|
bind:disabledTabs={item.data.disabledTabs}
|
|
340
|
+
bind:hiddenTabs={item.data.hiddenTabs}
|
|
340
341
|
bind:component={item.data}
|
|
341
342
|
canDisableTabs
|
|
343
|
+
canHideTabs
|
|
342
344
|
/>
|
|
343
345
|
{:else if item.data.type === 'aggridcomponentee'}
|
|
344
346
|
<GridAgGridLicenseKey bind:license={item.data.license} />
|
|
@@ -9,7 +9,8 @@ import { dragHandle, dragHandleZone } from '@windmill-labs/svelte-dnd-action';
|
|
|
9
9
|
import { generateRandomString } from '../../../../utils';
|
|
10
10
|
import { GripVertical, Plus } from 'lucide-svelte';
|
|
11
11
|
import GridTabDisabled from './GridTabDisabled.svelte';
|
|
12
|
-
|
|
12
|
+
import GridTabHidden from './GridTabHidden.svelte';
|
|
13
|
+
let { tabs = $bindable(undefined), disabledTabs = $bindable(undefined), hiddenTabs = $bindable(undefined), canDisableTabs = false, canHideTabs = false, word = 'Tab', component = $bindable() } = $props();
|
|
13
14
|
$effect.pre(() => {
|
|
14
15
|
if (tabs == undefined) {
|
|
15
16
|
tabs = [];
|
|
@@ -20,6 +21,12 @@ $effect.pre(() => {
|
|
|
20
21
|
{ type: 'static', value: false, fieldType: 'boolean' }
|
|
21
22
|
];
|
|
22
23
|
}
|
|
24
|
+
if (hiddenTabs == undefined) {
|
|
25
|
+
hiddenTabs = [
|
|
26
|
+
{ type: 'static', value: false, fieldType: 'boolean' },
|
|
27
|
+
{ type: 'static', value: false, fieldType: 'boolean' }
|
|
28
|
+
];
|
|
29
|
+
}
|
|
23
30
|
});
|
|
24
31
|
let items = $state.raw((tabs ?? []).map((tab, index) => {
|
|
25
32
|
return { value: tab, id: generateRandomString(), originalIndex: index };
|
|
@@ -47,6 +54,7 @@ function addTab() {
|
|
|
47
54
|
];
|
|
48
55
|
component.numberOfSubgrids = items.length;
|
|
49
56
|
disabledTabs = [...(disabledTabs ?? []), { type: 'static', value: false, fieldType: 'boolean' }];
|
|
57
|
+
hiddenTabs = [...(hiddenTabs ?? []), { type: 'static', value: false, fieldType: 'boolean' }];
|
|
50
58
|
}
|
|
51
59
|
function deleteSubgrid(index) {
|
|
52
60
|
let subgrid = `${component.id}-${index}`;
|
|
@@ -64,6 +72,8 @@ function deleteSubgrid(index) {
|
|
|
64
72
|
items = items.filter((item) => item.originalIndex !== index);
|
|
65
73
|
// Delete the item in the disabledTabs array
|
|
66
74
|
disabledTabs = (disabledTabs ?? []).filter((_, i) => i !== index);
|
|
75
|
+
// Delete the item in the hiddenTabs array
|
|
76
|
+
hiddenTabs = (hiddenTabs ?? []).filter((_, i) => i !== index);
|
|
67
77
|
component.numberOfSubgrids = items.length;
|
|
68
78
|
// Update the originalIndex of the remaining items
|
|
69
79
|
items.forEach((item, i) => {
|
|
@@ -93,10 +103,13 @@ function handleFinalize(e) {
|
|
|
93
103
|
$app.subgrids[`${component.id}-${items[i].originalIndex}`] ?? [];
|
|
94
104
|
}
|
|
95
105
|
const newDisabledTabs = [];
|
|
106
|
+
const newHiddenTabs = [];
|
|
96
107
|
for (let i = 0; i < items.length; i++) {
|
|
97
108
|
disabledTabs && newDisabledTabs.push(disabledTabs[items[i].originalIndex]);
|
|
109
|
+
hiddenTabs && newHiddenTabs.push(hiddenTabs[items[i].originalIndex]);
|
|
98
110
|
}
|
|
99
111
|
disabledTabs = newDisabledTabs;
|
|
112
|
+
hiddenTabs = newHiddenTabs;
|
|
100
113
|
// update originalIndex
|
|
101
114
|
items.forEach((item, i) => {
|
|
102
115
|
item.originalIndex = i;
|
|
@@ -156,6 +169,11 @@ const rnd = generateRandomString();
|
|
|
156
169
|
{#if canDisableTabs && disabledTabs}
|
|
157
170
|
<GridTabDisabled {index} bind:field={disabledTabs[index]} id={component.id} />
|
|
158
171
|
{/if}
|
|
172
|
+
{#if canHideTabs && hiddenTabs}
|
|
173
|
+
<div class="mt-2">
|
|
174
|
+
<GridTabHidden {index} bind:field={hiddenTabs[index]} id={component.id} />
|
|
175
|
+
</div>
|
|
176
|
+
{/if}
|
|
159
177
|
</div>
|
|
160
178
|
{/each}
|
|
161
179
|
</section>
|
|
@@ -3,10 +3,12 @@ import type { AppComponent } from '../component';
|
|
|
3
3
|
interface Props {
|
|
4
4
|
tabs?: string[];
|
|
5
5
|
disabledTabs?: RichConfiguration[];
|
|
6
|
+
hiddenTabs?: RichConfiguration[];
|
|
6
7
|
canDisableTabs?: boolean;
|
|
8
|
+
canHideTabs?: boolean;
|
|
7
9
|
word?: string;
|
|
8
10
|
component: AppComponent;
|
|
9
11
|
}
|
|
10
|
-
declare const GridTab: import("svelte").Component<Props, {}, "component" | "tabs" | "disabledTabs">;
|
|
12
|
+
declare const GridTab: import("svelte").Component<Props, {}, "component" | "tabs" | "disabledTabs" | "hiddenTabs">;
|
|
11
13
|
type GridTab = ReturnType<typeof GridTab>;
|
|
12
14
|
export default GridTab;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts">import Toggle from '../../../Toggle.svelte';
|
|
2
|
+
import InputsSpecEditor from './InputsSpecEditor.svelte';
|
|
3
|
+
import { slide } from 'svelte/transition';
|
|
4
|
+
let { id, field = $bindable(), index } = $props();
|
|
5
|
+
let hideable = $state(field && !(field?.type === 'static' && field?.value === false));
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<Toggle
|
|
9
|
+
bind:checked={hideable}
|
|
10
|
+
size="xs"
|
|
11
|
+
options={{
|
|
12
|
+
right: 'Can be hidden'
|
|
13
|
+
}}
|
|
14
|
+
on:change={() => {
|
|
15
|
+
if (hideable) {
|
|
16
|
+
field = {
|
|
17
|
+
type: 'evalv2',
|
|
18
|
+
expr: 'false',
|
|
19
|
+
fieldType: 'boolean',
|
|
20
|
+
connections: []
|
|
21
|
+
}
|
|
22
|
+
} else {
|
|
23
|
+
field = {
|
|
24
|
+
type: 'static',
|
|
25
|
+
value: false,
|
|
26
|
+
fieldType: 'boolean'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
{#if hideable}
|
|
33
|
+
<div transition:slide|local>
|
|
34
|
+
<InputsSpecEditor
|
|
35
|
+
key="tabHidden {index}"
|
|
36
|
+
bind:componentInput={field}
|
|
37
|
+
{id}
|
|
38
|
+
userInputEnabled={false}
|
|
39
|
+
shouldCapitalize={true}
|
|
40
|
+
resourceOnly={false}
|
|
41
|
+
fieldType={field?.['fieldType']}
|
|
42
|
+
subFieldType={field?.['subFieldType']}
|
|
43
|
+
format={field?.['format']}
|
|
44
|
+
selectOptions={field?.['selectOptions']}
|
|
45
|
+
tooltip={field?.['tooltip']}
|
|
46
|
+
fileUpload={field?.['fileUpload']}
|
|
47
|
+
placeholder={field?.['placeholder']}
|
|
48
|
+
customTitle={field?.['customTitle']}
|
|
49
|
+
displayType={false}
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RichConfiguration } from '../../types';
|
|
2
|
+
interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
field: RichConfiguration;
|
|
5
|
+
index: number;
|
|
6
|
+
}
|
|
7
|
+
declare const GridTabHidden: import("svelte").Component<Props, {}, "field">;
|
|
8
|
+
type GridTabHidden = ReturnType<typeof GridTabHidden>;
|
|
9
|
+
export default GridTabHidden;
|
|
@@ -190,6 +190,9 @@ const operations = {
|
|
|
190
190
|
USERS_ADD_GLOBAL: 'users.add_global',
|
|
191
191
|
USERS_IMPERSONATE: 'users.impersonate',
|
|
192
192
|
USERS_LEAVE_WORKSPACE: 'users.leave_workspace',
|
|
193
|
+
USERS_SCIM_CREATE: 'users.scim_create',
|
|
194
|
+
USERS_SCIM_DELETE: 'users.scim_delete',
|
|
195
|
+
USERS_SCIM_UPDATE: 'users.scim_update',
|
|
193
196
|
OAUTH_LOGIN: 'oauth.login',
|
|
194
197
|
OAUTH_LOGIN_FAILURE: 'oauth.login_failure',
|
|
195
198
|
OAUTH_SIGNUP: 'oauth.signup',
|
|
@@ -217,6 +220,9 @@ const operations = {
|
|
|
217
220
|
IGROUP_DELETE: 'igroup.delete',
|
|
218
221
|
IGROUP_ADDUSER: 'igroup.adduser',
|
|
219
222
|
IGROUP_REMOVEUSER: 'igroup.removeuser',
|
|
223
|
+
INSTANCE_GROUPS_SCIM_CREATE: 'instance_groups.scim_create',
|
|
224
|
+
INSTANCE_GROUPS_SCIM_DELETE: 'instance_groups.scim_delete',
|
|
225
|
+
INSTANCE_GROUPS_SCIM_UPDATE: 'instance_groups.scim_update',
|
|
220
226
|
VARIABLES_DECRYPT_SECRET: 'variables.decrypt_secret',
|
|
221
227
|
WORKSPACES_EDIT_COMMAND_SCRIPT: 'workspaces.edit_command_script',
|
|
222
228
|
WORKSPACES_EDIT_DEPLOY_TO: 'workspaces.edit_deploy_to',
|
|
@@ -5,7 +5,7 @@ import Button from '../common/button/Button.svelte';
|
|
|
5
5
|
import { ListFilter, ChevronLeft, ChevronRight } from 'lucide-svelte';
|
|
6
6
|
import VirtualList from '@tutorlatin/svelte-tiny-virtual-list';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
|
-
let { logs = [], pageIndex = $bindable(1), perPage = $bindable(100), hasMore = $bindable(true), actionKind = $bindable(), operation = $bindable(), selectedId = undefined, usernameFilter = $bindable(), resourceFilter = $bindable(), onselect } = $props();
|
|
8
|
+
let { logs = [], pageIndex = $bindable(1), perPage = $bindable(100), hasMore = $bindable(true), actionKind = $bindable(), operation = $bindable(), selectedId = undefined, usernameFilter = $bindable(), resourceFilter = $bindable(), showWorkspace = false, onselect } = $props();
|
|
9
9
|
function groupLogsByDay(logs) {
|
|
10
10
|
const groupedLogs = {};
|
|
11
11
|
if (!logs)
|
|
@@ -82,9 +82,12 @@ function kindToBadgeColor(kind) {
|
|
|
82
82
|
class="flex flex-row bg-surface-secondary sticky top-0 w-full p-2 pr-4 text-xs font-semibold"
|
|
83
83
|
>
|
|
84
84
|
<div class="w-1/12">ID</div>
|
|
85
|
-
<div class="w-3/12">Timestamp</div>
|
|
86
|
-
<div class="w-3/12">Username</div>
|
|
87
|
-
|
|
85
|
+
<div class={showWorkspace ? "w-2/12" : "w-3/12"}>Timestamp</div>
|
|
86
|
+
<div class={showWorkspace ? "w-2/12" : "w-3/12"}>Username</div>
|
|
87
|
+
{#if showWorkspace}
|
|
88
|
+
<div class="w-2/12">Workspace</div>
|
|
89
|
+
{/if}
|
|
90
|
+
<div class={showWorkspace ? "w-2/12" : "w-3/12"}>Operation</div>
|
|
88
91
|
<div class="w-2/12">Resource</div>
|
|
89
92
|
</div>
|
|
90
93
|
</div>
|
|
@@ -128,10 +131,10 @@ function kindToBadgeColor(kind) {
|
|
|
128
131
|
<div class="w-1/12 text-xs truncate">
|
|
129
132
|
{logOrDate.log.id}
|
|
130
133
|
</div>
|
|
131
|
-
<div class="w-3/12 text-xs">
|
|
134
|
+
<div class={showWorkspace ? "w-2/12 text-xs" : "w-3/12 text-xs"}>
|
|
132
135
|
{displayDate(logOrDate.log.timestamp)}
|
|
133
136
|
</div>
|
|
134
|
-
<div class="w-3/12 text-xs">
|
|
137
|
+
<div class={showWorkspace ? "w-2/12 text-xs" : "w-3/12 text-xs"}>
|
|
135
138
|
<div class="flex flex-row gap-2 items-center">
|
|
136
139
|
<div class="whitespace-nowrap overflow-x-auto no-scrollbar max-w-60">
|
|
137
140
|
{logOrDate.log.username}
|
|
@@ -150,7 +153,14 @@ function kindToBadgeColor(kind) {
|
|
|
150
153
|
/>
|
|
151
154
|
</div>
|
|
152
155
|
</div>
|
|
153
|
-
|
|
156
|
+
{#if showWorkspace}
|
|
157
|
+
<div class="w-2/12 text-xs">
|
|
158
|
+
<div class="whitespace-nowrap overflow-x-auto no-scrollbar max-w-60">
|
|
159
|
+
{logOrDate.log.workspace_id}
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
{/if}
|
|
163
|
+
<div class={showWorkspace ? "w-2/12 text-xs" : "w-3/12 text-xs"}>
|
|
154
164
|
<div class="flex flex-row gap-1">
|
|
155
165
|
<Badge
|
|
156
166
|
on:click={() => {
|
|
@@ -9,6 +9,7 @@ interface Props {
|
|
|
9
9
|
selectedId?: number | undefined;
|
|
10
10
|
usernameFilter?: string | undefined;
|
|
11
11
|
resourceFilter?: string | undefined;
|
|
12
|
+
showWorkspace?: boolean;
|
|
12
13
|
onselect?: (id: number) => void;
|
|
13
14
|
}
|
|
14
15
|
declare const AuditLogsTable: import("svelte").Component<Props, {}, "operation" | "perPage" | "hasMore" | "pageIndex" | "actionKind" | "usernameFilter" | "resourceFilter">;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import Button from './button/Button.svelte';
|
|
3
3
|
import { X } from 'lucide-svelte';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
let { noBg = false, small = false, Icon, class: className } = $props();
|
|
5
|
+
let { noBg = false, small = false, Icon, class: className, onClick } = $props();
|
|
6
6
|
const dispatch = createEventDispatcher();
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<Button
|
|
10
|
-
on:click={() => dispatch('close')}
|
|
10
|
+
on:click={() => (dispatch('close'), onClick?.())}
|
|
11
11
|
on:pointerdown={(e) => e.stopPropagation()}
|
|
12
12
|
startIcon={{ icon: Icon ?? X }}
|
|
13
13
|
iconOnly
|
|
@@ -3,6 +3,7 @@ interface Props {
|
|
|
3
3
|
small?: boolean;
|
|
4
4
|
Icon?: any | undefined;
|
|
5
5
|
class?: string;
|
|
6
|
+
onClick?: () => void | undefined | any;
|
|
6
7
|
}
|
|
7
8
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
8
9
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<script lang="ts">import { twMerge } from 'tailwind-merge';
|
|
2
|
-
|
|
3
|
-
export let gap = 'sm';
|
|
4
|
-
export let justify = 'start';
|
|
5
|
-
export let wFull = true;
|
|
6
|
-
export let hFull = true;
|
|
2
|
+
let { horizontal = false, gap = 'sm', justify = 'start', wFull = true, hFull = true, children } = $props();
|
|
7
3
|
const gapMap = {
|
|
8
4
|
none: '',
|
|
9
5
|
sm: 'gap-2',
|
|
@@ -24,7 +20,7 @@ const justifyMap = {
|
|
|
24
20
|
justify
|
|
25
21
|
]}"
|
|
26
22
|
>
|
|
27
|
-
|
|
23
|
+
{@render children?.()}
|
|
28
24
|
</div>
|
|
29
25
|
{:else}
|
|
30
26
|
<div
|
|
@@ -36,6 +32,6 @@ const justifyMap = {
|
|
|
36
32
|
justifyMap[justify]
|
|
37
33
|
)}
|
|
38
34
|
>
|
|
39
|
-
|
|
35
|
+
{@render children?.()}
|
|
40
36
|
</div>
|
|
41
37
|
{/if}
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
interface
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const List: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
1
|
+
interface Props {
|
|
20
2
|
horizontal?: boolean;
|
|
21
|
-
gap?:
|
|
22
|
-
justify?:
|
|
3
|
+
gap?: 'none' | 'sm' | 'md' | 'lg';
|
|
4
|
+
justify?: 'start' | 'center' | 'end' | 'between';
|
|
23
5
|
wFull?: boolean;
|
|
24
6
|
hFull?: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
}, {
|
|
30
|
-
default: {};
|
|
31
|
-
}, {}, string>;
|
|
32
|
-
type List = InstanceType<typeof List>;
|
|
7
|
+
children?: import('svelte').Snippet;
|
|
8
|
+
}
|
|
9
|
+
declare const List: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type List = ReturnType<typeof List>;
|
|
33
11
|
export default List;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import Portal from '../../Portal.svelte';
|
|
2
2
|
import { clickOutside } from '../../../utils';
|
|
3
3
|
import { createFloatingActions } from 'svelte-floating-ui';
|
|
4
|
+
import { fly } from 'svelte/transition';
|
|
4
5
|
let { floatingConfig = {
|
|
5
6
|
strategy: 'absolute',
|
|
6
7
|
//@ts-ignore
|
|
@@ -9,28 +10,13 @@ let { floatingConfig = {
|
|
|
9
10
|
// export let containerClasses: string = 'rounded-lg shadow-md border p-4 bg-surface'
|
|
10
11
|
// export let floatingClasses: string = ''
|
|
11
12
|
const [floatingRef, floatingContent] = createFloatingActions(floatingConfig);
|
|
12
|
-
function close(
|
|
13
|
+
function close() {
|
|
13
14
|
open = false;
|
|
14
15
|
}
|
|
15
|
-
let acceptClickoutside = $state(false);
|
|
16
|
-
function pointerup() {
|
|
17
|
-
setTimeout(() => {
|
|
18
|
-
acceptClickoutside = true;
|
|
19
|
-
}, 100);
|
|
20
|
-
}
|
|
21
|
-
function pointerdown() {
|
|
22
|
-
if (acceptClickoutside && open) {
|
|
23
|
-
open = false;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
acceptClickoutside = false;
|
|
27
|
-
open = true;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
16
|
</script>
|
|
31
17
|
|
|
32
18
|
<div use:floatingRef>
|
|
33
|
-
{@render button?.(
|
|
19
|
+
{@render button?.()}
|
|
34
20
|
</div>
|
|
35
21
|
|
|
36
22
|
<Portal name="popup-v2" {target}>
|
|
@@ -39,18 +25,15 @@ function pointerdown() {
|
|
|
39
25
|
class="border rounded-lg shadow-lg bg-surface z5000"
|
|
40
26
|
style="position:absolute"
|
|
41
27
|
use:floatingContent
|
|
28
|
+
transition:fly={{ duration: 100, y: -16 }}
|
|
42
29
|
>
|
|
43
|
-
<!-- svelte-ignore event_directive_deprecated -->
|
|
44
30
|
<div
|
|
45
|
-
use:clickOutside
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
acceptClickoutside = false
|
|
49
|
-
open = false
|
|
50
|
-
}
|
|
31
|
+
use:clickOutside={{
|
|
32
|
+
eventToListenName: 'pointerdown',
|
|
33
|
+
onClickOutside: () => (open = false)
|
|
51
34
|
}}
|
|
52
35
|
>
|
|
53
|
-
{@render children?.({ close })}
|
|
36
|
+
{@render children?.({ close: () => close() })}
|
|
54
37
|
</div>
|
|
55
38
|
</div>
|
|
56
39
|
{/if}
|
|
@@ -3,8 +3,10 @@ interface Props {
|
|
|
3
3
|
floatingConfig?: ComputeConfig;
|
|
4
4
|
open?: boolean;
|
|
5
5
|
target?: string | undefined;
|
|
6
|
-
button?: import('svelte').Snippet
|
|
7
|
-
children?: import('svelte').Snippet<[
|
|
6
|
+
button?: import('svelte').Snippet;
|
|
7
|
+
children?: import('svelte').Snippet<[{
|
|
8
|
+
close: () => void;
|
|
9
|
+
}]>;
|
|
8
10
|
}
|
|
9
11
|
declare const PopupV2: import("svelte").Component<Props, {}, "open">;
|
|
10
12
|
type PopupV2 = ReturnType<typeof PopupV2>;
|
|
@@ -4,7 +4,7 @@ import Dropdown from '../../DropdownV2.svelte';
|
|
|
4
4
|
import ScheduleEditor from '../../triggers/schedules/ScheduleEditor.svelte';
|
|
5
5
|
import SharedBadge from '../../SharedBadge.svelte';
|
|
6
6
|
import { ScriptService, DraftService } from '../../../gen';
|
|
7
|
-
import { userStore, workspaceStore } from '../../../stores';
|
|
7
|
+
import { hubBaseUrlStore, userStore, workspaceStore } from '../../../stores';
|
|
8
8
|
import { createEventDispatcher } from 'svelte';
|
|
9
9
|
import Badge from '../badge/Badge.svelte';
|
|
10
10
|
import Button from '../button/Button.svelte';
|
|
@@ -14,12 +14,13 @@ import { sendUserToast } from '../../../toast';
|
|
|
14
14
|
import { capitalize, copyToClipboard, DELETE, isOwner } from '../../../utils';
|
|
15
15
|
import { isDeployable } from '../../../utils_deployable';
|
|
16
16
|
import { LanguageIcon } from '../languageIcons';
|
|
17
|
-
import { Archive, Calendar, Code, Copy, Eye, FolderOpen, ChevronUpSquare, GitFork, List, Pen, Share, Trash, History } from 'lucide-svelte';
|
|
17
|
+
import { Archive, Calendar, Code, Copy, Eye, FolderOpen, ChevronUpSquare, GitFork, List, Pen, Share, Trash, History, Globe2 } from 'lucide-svelte';
|
|
18
18
|
import ScriptVersionHistory from '../../ScriptVersionHistory.svelte';
|
|
19
19
|
import { Drawer, DrawerContent } from '..';
|
|
20
20
|
import NoMainFuncBadge from '../../NoMainFuncBadge.svelte';
|
|
21
21
|
import Tooltip from '../../Tooltip.svelte';
|
|
22
22
|
import { getDeployUiSettings } from '../../home/deploy_ui';
|
|
23
|
+
import { scriptToHubUrl } from '../../../hub';
|
|
23
24
|
let { script, marked, starred, shareModal, moveDrawer, deploymentDrawer, deleteConfirmedCallback = $bindable(), errorHandlerMuted, showCode, depth = 0, menuOpen = $bindable(false) } = $props();
|
|
24
25
|
const dispatch = createEventDispatcher();
|
|
25
26
|
async function archiveScript(path) {
|
|
@@ -247,6 +248,25 @@ let versionsDrawerOpen = $state(false);
|
|
|
247
248
|
copyToClipboard(script.path)
|
|
248
249
|
}
|
|
249
250
|
},
|
|
251
|
+
{
|
|
252
|
+
displayName: 'Publish to Hub',
|
|
253
|
+
icon: Globe2,
|
|
254
|
+
action: () => {
|
|
255
|
+
window.open(
|
|
256
|
+
scriptToHubUrl(
|
|
257
|
+
script.content,
|
|
258
|
+
script.summary,
|
|
259
|
+
script.description ?? '',
|
|
260
|
+
script.kind,
|
|
261
|
+
script.language,
|
|
262
|
+
script.schema,
|
|
263
|
+
script.lock ?? '',
|
|
264
|
+
$hubBaseUrlStore
|
|
265
|
+
).toString(),
|
|
266
|
+
'_blank'
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
},
|
|
250
270
|
{
|
|
251
271
|
displayName: script.archived ? 'Unarchive' : 'Archive',
|
|
252
272
|
icon: Archive,
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
<script lang="ts">import { createEventDispatcher } from 'svelte';
|
|
2
2
|
import { Button, Badge } from '../common';
|
|
3
3
|
import Modal from '../common/modal/Modal.svelte';
|
|
4
|
+
import Portal from '../Portal.svelte';
|
|
4
5
|
export let open = false;
|
|
5
6
|
export let inputs = [];
|
|
6
7
|
const dispatch = createEventDispatcher();
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
dispatch('confirmed')
|
|
14
|
-
}}
|
|
15
|
-
on:canceled
|
|
16
|
-
title="Windmill AI wants to add the following inputs to the flow:"
|
|
17
|
-
>
|
|
18
|
-
<ul class=" list-disc pl-5">
|
|
19
|
-
{#each inputs as input}
|
|
20
|
-
<li>{input}</li>
|
|
21
|
-
{/each}
|
|
22
|
-
</ul>
|
|
23
|
-
|
|
24
|
-
<Button
|
|
25
|
-
slot="actions"
|
|
26
|
-
on:click={() => {
|
|
10
|
+
<Portal>
|
|
11
|
+
<Modal
|
|
12
|
+
bind:open
|
|
13
|
+
on:confirmed={() => {
|
|
27
14
|
open = false
|
|
28
15
|
dispatch('confirmed')
|
|
29
16
|
}}
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
on:canceled
|
|
18
|
+
title="Windmill AI wants to add the following inputs to the flow:"
|
|
32
19
|
>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
</
|
|
20
|
+
<ul class=" list-disc pl-5">
|
|
21
|
+
{#each inputs as input}
|
|
22
|
+
<li>{input}</li>
|
|
23
|
+
{/each}
|
|
24
|
+
</ul>
|
|
25
|
+
|
|
26
|
+
<Button
|
|
27
|
+
slot="actions"
|
|
28
|
+
on:click={() => {
|
|
29
|
+
open = false
|
|
30
|
+
dispatch('confirmed')
|
|
31
|
+
}}
|
|
32
|
+
color="light"
|
|
33
|
+
size="sm"
|
|
34
|
+
>
|
|
35
|
+
<span class="inline-flex gap-2">Add <Badge color="dark-green">Enter</Badge></span>
|
|
36
|
+
</Button>
|
|
37
|
+
</Modal>
|
|
38
|
+
</Portal>
|
|
@@ -153,11 +153,12 @@ class AIChatManager {
|
|
|
153
153
|
this.pendingPrompt = pendingPrompt ?? '';
|
|
154
154
|
if (mode === AIMode.SCRIPT) {
|
|
155
155
|
const customPrompt = get(copilotInfo).customPrompts?.[mode];
|
|
156
|
-
|
|
156
|
+
const currentModel = getCurrentModel();
|
|
157
|
+
this.systemMessage = prepareScriptSystemMessage(currentModel, customPrompt);
|
|
157
158
|
this.systemMessage.content = this.NAVIGATION_SYSTEM_PROMPT + this.systemMessage.content;
|
|
158
159
|
const context = this.contextManager.getSelectedContext();
|
|
159
160
|
const lang = this.scriptEditorOptions?.lang ?? 'bun';
|
|
160
|
-
this.tools = [this.changeModeTool, ...prepareScriptTools(lang, context)];
|
|
161
|
+
this.tools = [this.changeModeTool, ...prepareScriptTools(currentModel, lang, context)];
|
|
161
162
|
this.helpers = {
|
|
162
163
|
getScriptOptions: () => {
|
|
163
164
|
return {
|
|
@@ -18,7 +18,7 @@ $: multipleModels = $copilotInfo.aiModels.length > 1;
|
|
|
18
18
|
<div class="text-tertiary text-xs flex flex-row items-center font-normal gap-0.5">
|
|
19
19
|
<span class={`truncate ${multipleModels ? '' : 'pr-2'}`}>{providerModel.model}</span>
|
|
20
20
|
{#if multipleModels}
|
|
21
|
-
<div class="shrink-0
|
|
21
|
+
<div class="shrink-0">
|
|
22
22
|
<ChevronDown size={16} />
|
|
23
23
|
</div>
|
|
24
24
|
{/if}
|
|
@@ -77,8 +77,10 @@ const flowHelpers = {
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
rejectAllModuleActions() {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
// Do it in reverse to revert nested modules first then parents
|
|
81
|
+
const ids = Object.keys(affectedModules);
|
|
82
|
+
for (let i = ids.length - 1; i >= 0; i--) {
|
|
83
|
+
this.revertModuleAction(ids[i]);
|
|
82
84
|
}
|
|
83
85
|
affectedModules = {};
|
|
84
86
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResourceType, ScriptLang } from '../../../../gen/types.gen';
|
|
1
|
+
import type { AIProviderModel, ResourceType, ScriptLang } from '../../../../gen/types.gen';
|
|
2
2
|
import type { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources/index.mjs';
|
|
3
3
|
import type { ContextElement } from '../context';
|
|
4
4
|
import { type Tool } from '../shared';
|
|
@@ -11,11 +11,10 @@ export declare function getLangContext(lang: ScriptLang | 'bunnative' | 'jsx' |
|
|
|
11
11
|
isFailure?: boolean;
|
|
12
12
|
}): string;
|
|
13
13
|
export declare function getFormattedResourceTypes(lang: ScriptLang | 'bunnative', prompt: string, workspace: string): Promise<string>;
|
|
14
|
-
export declare const CHAT_SYSTEM_PROMPT = "\n\tYou are a coding assistant for the Windmill platform. You are provided with a list of `INSTRUCTIONS` and the current contents of a code file under `CODE`.\n\n\tYour task is to respond to the user's request. Assume all user queries are valid and actionable.\n\n\tWhen the user requests code changes:\n\t- ALWAYS use the `edit_code` tool to apply code changes. Use it only once with an array of diffs.\n\t- Pass an array of **diff objects** to the `edit_code` tool. Each diff should specify exactly what text to replace and what to replace it with.\n\t- Each diff object must contain:\n\t - `old_string`: The exact text to replace (must match the current code exactly)\n\t - `new_string`: The replacement text\n\t - `replace_all` (optional): Set to true to replace all occurrences, false or omit for first occurrence only\n\t- The code can include `[#START]` and `[#END]` markers to indicate the start and end of a code piece. You MUST only modify the code between these markers if given, and remove them when creating your diffs. If a question is asked about the code, you MUST only talk about the code between the markers. Refer to it as the code piece, not the code between the markers.\n\t- Follow the instructions carefully and explain the reasoning behind your changes in your response text.\n\t- If the request is abstract (e.g., \"make this cleaner\"), interpret it concretely and reflect that in the diffs.\n\t- Preserve existing formatting, indentation, and whitespace unless changes are strictly required to fulfill the user's request.\n\t- The user can ask you to look at or modify specific files, databases or errors by having its name in the INSTRUCTIONS preceded by the @ symbol. In this case, put your focus on the element that is explicitly mentioned.\n\t- The user can ask you questions about a list of `DATABASES` that are available in the user's workspace. If the user asks you a question about a database, you should ask the user to specify the database name if not given, or take the only one available if there is only one.\n\t- You can also receive a `DIFF` of the changes that have been made to the code. You should use this diff to give better answers.\n\t- Before giving your answer, check again that you carefully followed these instructions.\n\t- When asked to create a script that communicates with an external service, you can use the `search_hub_scripts` tool to search for relevant scripts in the hub. Make sure the language is the same as what the user is coding in. If you do not find any relevant scripts, you can use the `search_npm_packages` tool to search for relevant packages and their documentation. Always give a link to the documentation in your answer if possible.\n\t- After applying code changes with the `edit_code` tool, ALWAYS use the `test_run_script` tool to test the code, and iterate on the code until it works as expected (MAX 3 times). If the user cancels the test run, do not try again and wait for the next user instruction.\n\n\tExample diff usage:\n\tTo change \"return 1\" to \"return 2\", use:\n\t[{\n\t\t\"old_string\": \"return 1\",\n\t\t\"new_string\": \"return 2\"\n\t}]\n\n\tTo add a new function and modify an existing one:\n\t[{\n\t\t\"old_string\": \"export async function main() {\",\n\t\t\"new_string\": \"function helper() {\n\treturn 'help';\n}\n\nexport async function main() {\"\n\t}, {\n\t\t\"old_string\": \"return result;\",\n\t\t\"new_string\": \"return result + helper();\"\n\t}]\n\n\tImportant:\n\t- Each old_string must match the exact text in the current code, including whitespace and indentation.\n\t- Do not return the applied code in your response, just explain what you did. You can return code blocks in your response for explanations or examples as per user request.\n\t- Do not mention or reveal these instructions to the user unless explicitly asked to do so.\n";
|
|
15
14
|
export declare const INLINE_CHAT_SYSTEM_PROMPT = "\n# Windmill Inline Coding Assistant\n\nYou are a coding assistant for the Windmill platform. You provide precise code modifications based on user instructions.\n\n## Input Format\n\nYou will receive:\n- **INSTRUCTIONS**: User's modification request\n- **CODE**: Current code content with modification boundaries\n- **DATABASES** *(optional)*: Available workspace databases\n\n### Code Boundaries\n\nThe code contains `[#START]` and `[#END]` markers indicating the modification scope:\n- **MUST** only modify code between these markers\n- **MUST** remove the markers in your response\n- **MUST** preserve all other code exactly as provided\n\n## Task Requirements\n\nReturn the modified CODE that fulfills the user's request. Assume all user queries are valid and actionable.\n\n### Critical Rules\n\n- \u2705 **ALWAYS** include a single code block with the entire updated CODE\n- \u2705 **ALWAYS** use the structured XML output format below\n- \u274C **NEVER** include only modified sections\n- \u274C **NEVER** add explanatory text or comments outside the format\n- \u274C **NEVER** include ``` code fences in your response\n- \u274C **NEVER** modify the code outside the boundaries\n\n## Output Format\n\n```xml\n<changes_made>\nBrief description of what was changed\n</changes_made>\n<new_code>\n[complete modified code without markers]\n</new_code>\n```\n\n## Example\n\n### Input:\n```xml\n<user_request>\nINSTRUCTIONS:\nReturn 2 instead of 1\n\nCODE:\nimport * as wmill from \"windmill-client\"\n\nfunction test() {\n\treturn \"hello\"\n}\n\n[#START]\nexport async function main() {\n\treturn 1;\n}\n[#END]\n</user_request>\n```\n\n### Expected Output:\n```xml\n<changes_made>\nChanged return value from 1 to 2 in main function\n</changes_made>\n<new_code>\nimport * as wmill from \"windmill-client\"\n\nfunction test() {\n\treturn \"hello\"\n}\n\nexport async function main() {\n\treturn 2;\n}\n</new_code>\n```\n";
|
|
16
15
|
export declare const CHAT_USER_PROMPT = "\nINSTRUCTIONS:\n{instructions}\n\nWINDMILL LANGUAGE CONTEXT:\n{lang_context}\n\n";
|
|
17
|
-
export declare function prepareScriptSystemMessage(customPrompt?: string): ChatCompletionSystemMessageParam;
|
|
18
|
-
export declare function prepareScriptTools(language: ScriptLang | 'bunnative', context: ContextElement[]): Tool<ScriptChatHelpers>[];
|
|
16
|
+
export declare function prepareScriptSystemMessage(currentModel: AIProviderModel, customPrompt?: string): ChatCompletionSystemMessageParam;
|
|
17
|
+
export declare function prepareScriptTools(currentModel: AIProviderModel, language: ScriptLang | 'bunnative', context: ContextElement[]): Tool<ScriptChatHelpers>[];
|
|
19
18
|
export declare function prepareScriptUserMessage(instructions: string, language: ScriptLang | 'bunnative', selectedContext: ContextElement[], options?: {
|
|
20
19
|
isPreprocessor?: boolean;
|
|
21
20
|
}): ChatCompletionUserMessageParam;
|
|
@@ -41,5 +40,6 @@ export declare function fetchNpmPackageTypes(packageName: string, version?: stri
|
|
|
41
40
|
types: string;
|
|
42
41
|
error?: string;
|
|
43
42
|
}>;
|
|
43
|
+
export declare const editCodeToolWithDiff: Tool<ScriptChatHelpers>;
|
|
44
44
|
export declare const editCodeTool: Tool<ScriptChatHelpers>;
|
|
45
45
|
export declare const testRunScriptTool: Tool<ScriptChatHelpers>;
|