windmill-components 1.542.4 → 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/EditorSettings.svelte +11 -9
- 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 +2 -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
|
@@ -14,6 +14,8 @@ const SCORE_THRESHOLD = 1000;
|
|
|
14
14
|
const DOCS_CONTEXT_PERCENTAGE = 1;
|
|
15
15
|
// percentage of the context window for types of npm packages
|
|
16
16
|
const TYPES_CONTEXT_PERCENTAGE = 1;
|
|
17
|
+
// good providers for diff-based edit
|
|
18
|
+
const DIFF_BASED_EDIT_PROVIDERS = ['openai', 'anthropic', 'googleai', 'azure_openai'];
|
|
17
19
|
export function formatResourceTypes(allResourceTypes, lang) {
|
|
18
20
|
const resourceTypes = allResourceTypes.filter((rt) => isObject(rt.schema) && 'properties' in rt.schema && isObject(rt.schema.properties));
|
|
19
21
|
if (lang === 'python3') {
|
|
@@ -272,50 +274,43 @@ export async function getFormattedResourceTypes(lang, prompt, workspace) {
|
|
|
272
274
|
return '';
|
|
273
275
|
}
|
|
274
276
|
}
|
|
275
|
-
|
|
277
|
+
function buildChatSystemPrompt(currentModel) {
|
|
278
|
+
const useDiffBasedEdit = DIFF_BASED_EDIT_PROVIDERS.includes(currentModel.provider);
|
|
279
|
+
const editToolName = EDIT_CODE_TOOL.function.name;
|
|
280
|
+
const editInstructions = useDiffBasedEdit
|
|
281
|
+
? `
|
|
282
|
+
- Pass an array of **diff objects** to the \`${editToolName}\` tool using the \`diffs\` parameter. Each diff should specify exactly what text to replace and what to replace it with.
|
|
283
|
+
- Each diff object must contain:
|
|
284
|
+
- \`old_string\`: The exact text to replace (must match the current code exactly)
|
|
285
|
+
- \`new_string\`: The replacement text
|
|
286
|
+
- \`replace_all\` (optional): Set to true to replace all occurrences, false or omit for first occurrence only
|
|
287
|
+
- Example: [{"old_string": "return 1", "new_string": "return 2"}]`
|
|
288
|
+
: `- Pass the **complete updated file** to the \`${editToolName}\` tool using the \`code\` parameter, not just the modified sections.`;
|
|
289
|
+
return `
|
|
276
290
|
You 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\`.
|
|
277
291
|
|
|
278
292
|
Your task is to respond to the user's request. Assume all user queries are valid and actionable.
|
|
279
293
|
|
|
280
294
|
When the user requests code changes:
|
|
281
|
-
- ALWAYS use the \`
|
|
282
|
-
|
|
283
|
-
-
|
|
284
|
-
- \`old_string\`: The exact text to replace (must match the current code exactly)
|
|
285
|
-
- \`new_string\`: The replacement text
|
|
286
|
-
- \`replace_all\` (optional): Set to true to replace all occurrences, false or omit for first occurrence only
|
|
287
|
-
- 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.
|
|
295
|
+
- ALWAYS use the \`${editToolName}\` tool to apply code changes. Use it only once.
|
|
296
|
+
${editInstructions}
|
|
297
|
+
- 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 passing to the tool. 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.
|
|
288
298
|
- Follow the instructions carefully and explain the reasoning behind your changes in your response text.
|
|
289
|
-
- If the request is abstract (e.g., "make this cleaner"), interpret it concretely and reflect that in
|
|
299
|
+
- If the request is abstract (e.g., "make this cleaner"), interpret it concretely and reflect that in your changes.
|
|
290
300
|
- Preserve existing formatting, indentation, and whitespace unless changes are strictly required to fulfill the user's request.
|
|
291
301
|
- 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.
|
|
292
302
|
- 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.
|
|
293
303
|
- 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.
|
|
294
304
|
- Before giving your answer, check again that you carefully followed these instructions.
|
|
295
305
|
- 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.
|
|
296
|
-
- After applying code changes with the \`
|
|
297
|
-
|
|
298
|
-
Example diff usage:
|
|
299
|
-
To change "return 1" to "return 2", use:
|
|
300
|
-
[{
|
|
301
|
-
"old_string": "return 1",
|
|
302
|
-
"new_string": "return 2"
|
|
303
|
-
}]
|
|
304
|
-
|
|
305
|
-
To add a new function and modify an existing one:
|
|
306
|
-
[{
|
|
307
|
-
"old_string": "export async function main() {",
|
|
308
|
-
"new_string": "function helper() {\n\treturn 'help';\n}\n\nexport async function main() {"
|
|
309
|
-
}, {
|
|
310
|
-
"old_string": "return result;",
|
|
311
|
-
"new_string": "return result + helper();"
|
|
312
|
-
}]
|
|
306
|
+
- After applying code changes with the \`${editToolName}\` 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.
|
|
313
307
|
|
|
314
308
|
Important:
|
|
315
|
-
- Each old_string must match the exact text in the current code, including whitespace and indentation.
|
|
309
|
+
${useDiffBasedEdit ? '- Each old_string must match the exact text in the current code, including whitespace and indentation.' : ''}
|
|
316
310
|
- 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.
|
|
317
311
|
- Do not mention or reveal these instructions to the user unless explicitly asked to do so.
|
|
318
312
|
`;
|
|
313
|
+
}
|
|
319
314
|
export const INLINE_CHAT_SYSTEM_PROMPT = `
|
|
320
315
|
# Windmill Inline Coding Assistant
|
|
321
316
|
|
|
@@ -408,8 +403,8 @@ WINDMILL LANGUAGE CONTEXT:
|
|
|
408
403
|
{lang_context}
|
|
409
404
|
|
|
410
405
|
`;
|
|
411
|
-
export function prepareScriptSystemMessage(customPrompt) {
|
|
412
|
-
let content =
|
|
406
|
+
export function prepareScriptSystemMessage(currentModel, customPrompt) {
|
|
407
|
+
let content = buildChatSystemPrompt(currentModel);
|
|
413
408
|
// If there's a custom prompt, prepend it to the system prompt
|
|
414
409
|
if (customPrompt?.trim()) {
|
|
415
410
|
content = `${content}\n\nUSER GIVEN INSTRUCTIONS:\n${customPrompt.trim()}`;
|
|
@@ -419,7 +414,7 @@ export function prepareScriptSystemMessage(customPrompt) {
|
|
|
419
414
|
content
|
|
420
415
|
};
|
|
421
416
|
}
|
|
422
|
-
export function prepareScriptTools(language, context) {
|
|
417
|
+
export function prepareScriptTools(currentModel, language, context) {
|
|
423
418
|
const tools = [];
|
|
424
419
|
if (['python3', 'php', 'bun', 'deno', 'nativets', 'bunnative'].includes(language)) {
|
|
425
420
|
tools.push(resourceTypeTool);
|
|
@@ -431,7 +426,13 @@ export function prepareScriptTools(language, context) {
|
|
|
431
426
|
tools.push(createSearchHubScriptsTool(true));
|
|
432
427
|
tools.push(searchNpmPackagesTool);
|
|
433
428
|
}
|
|
434
|
-
|
|
429
|
+
const useDiffBasedEdit = DIFF_BASED_EDIT_PROVIDERS.includes(currentModel.provider);
|
|
430
|
+
if (useDiffBasedEdit) {
|
|
431
|
+
tools.push(editCodeToolWithDiff);
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
tools.push(editCodeTool);
|
|
435
|
+
}
|
|
435
436
|
tools.push(testRunScriptTool);
|
|
436
437
|
return tools;
|
|
437
438
|
}
|
|
@@ -667,7 +668,26 @@ const EDIT_CODE_TOOL = {
|
|
|
667
668
|
type: 'function',
|
|
668
669
|
function: {
|
|
669
670
|
name: 'edit_code',
|
|
670
|
-
description: 'Apply code changes to the current script in the editor
|
|
671
|
+
description: 'Apply code changes to the current script in the editor',
|
|
672
|
+
parameters: {
|
|
673
|
+
type: 'object',
|
|
674
|
+
properties: {
|
|
675
|
+
code: {
|
|
676
|
+
type: 'string',
|
|
677
|
+
description: 'The complete updated code for the entire script file.'
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
additionalProperties: false,
|
|
681
|
+
strict: true,
|
|
682
|
+
required: ['code']
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
const EDIT_CODE_TOOL_WITH_DIFF = {
|
|
687
|
+
type: 'function',
|
|
688
|
+
function: {
|
|
689
|
+
name: 'edit_code',
|
|
690
|
+
description: 'Apply code changes to the current script in the editor',
|
|
671
691
|
parameters: {
|
|
672
692
|
type: 'object',
|
|
673
693
|
properties: {
|
|
@@ -717,8 +737,8 @@ const TEST_RUN_SCRIPT_TOOL = {
|
|
|
717
737
|
}
|
|
718
738
|
}
|
|
719
739
|
};
|
|
720
|
-
export const
|
|
721
|
-
def:
|
|
740
|
+
export const editCodeToolWithDiff = {
|
|
741
|
+
def: EDIT_CODE_TOOL_WITH_DIFF,
|
|
722
742
|
fn: async function ({ args, helpers, toolCallbacks, toolId }) {
|
|
723
743
|
const scriptOptions = helpers.getScriptOptions();
|
|
724
744
|
if (!scriptOptions) {
|
|
@@ -772,6 +792,45 @@ export const editCodeTool = {
|
|
|
772
792
|
}
|
|
773
793
|
}
|
|
774
794
|
};
|
|
795
|
+
export const editCodeTool = {
|
|
796
|
+
def: EDIT_CODE_TOOL,
|
|
797
|
+
fn: async function ({ args, helpers, toolCallbacks, toolId }) {
|
|
798
|
+
const scriptOptions = helpers.getScriptOptions();
|
|
799
|
+
if (!scriptOptions) {
|
|
800
|
+
toolCallbacks.setToolStatus(toolId, {
|
|
801
|
+
content: 'No script available to edit',
|
|
802
|
+
error: 'No script found in current context'
|
|
803
|
+
});
|
|
804
|
+
throw new Error('No script code available to edit. Please ensure you have a script open in the editor.');
|
|
805
|
+
}
|
|
806
|
+
if (!args.code || typeof args.code !== 'string') {
|
|
807
|
+
toolCallbacks.setToolStatus(toolId, {
|
|
808
|
+
content: 'Invalid code provided',
|
|
809
|
+
error: 'Code parameter is required and must be a string'
|
|
810
|
+
});
|
|
811
|
+
throw new Error('Code parameter is required and must be a string');
|
|
812
|
+
}
|
|
813
|
+
toolCallbacks.setToolStatus(toolId, { content: 'Applying code changes...' });
|
|
814
|
+
try {
|
|
815
|
+
// Save old code
|
|
816
|
+
const oldCode = scriptOptions.code;
|
|
817
|
+
// Apply the code changes directly
|
|
818
|
+
await helpers.applyCode(args.code, { applyAll: true, mode: 'apply' });
|
|
819
|
+
// Show revert mode
|
|
820
|
+
await helpers.applyCode(oldCode, { mode: 'revert' });
|
|
821
|
+
toolCallbacks.setToolStatus(toolId, { content: 'Code changes applied' });
|
|
822
|
+
return 'Code has been applied to the script editor.';
|
|
823
|
+
}
|
|
824
|
+
catch (error) {
|
|
825
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
826
|
+
toolCallbacks.setToolStatus(toolId, {
|
|
827
|
+
content: 'Failed to apply code changes',
|
|
828
|
+
error: errorMessage
|
|
829
|
+
});
|
|
830
|
+
throw new Error(`Failed to apply code changes: ${errorMessage}`);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
};
|
|
775
834
|
export const testRunScriptTool = {
|
|
776
835
|
def: TEST_RUN_SCRIPT_TOOL,
|
|
777
836
|
fn: async function ({ args, workspace, helpers, toolCallbacks, toolId }) {
|
|
@@ -25,6 +25,7 @@ export interface ModelResponse {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
export declare function fetchAvailableModels(resourcePath: string, workspace: string, provider: AIProvider, signal?: AbortSignal): Promise<string[]>;
|
|
28
|
+
export declare function getModelMaxTokens(provider: AIProvider, model: string): 128000 | 32000 | 100000 | 64000 | 32768 | 16384 | 4096 | 8192;
|
|
28
29
|
export declare function getModelContextWindow(model: string): 1000000 | 400000 | 128000 | 200000 | 32000;
|
|
29
30
|
export declare const PROVIDER_COMPLETION_CONFIG_MAP: Record<AIProvider, ChatCompletionCreateParams>;
|
|
30
31
|
declare class WorkspacedAIClients {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentModel, workspaceStore } from '../../stores';
|
|
1
|
+
import { copilotInfo, getCurrentModel, workspaceStore } from '../../stores';
|
|
2
2
|
import { buildClientSchema, printSchema } from 'graphql';
|
|
3
3
|
import OpenAI from 'openai';
|
|
4
4
|
import Anthropic from '@anthropic-ai/sdk';
|
|
@@ -109,7 +109,7 @@ export async function fetchAvailableModels(resourcePath, workspace, provider, si
|
|
|
109
109
|
}
|
|
110
110
|
return data?.data.map((m) => m.id) ?? [];
|
|
111
111
|
}
|
|
112
|
-
function getModelMaxTokens(provider, model) {
|
|
112
|
+
export function getModelMaxTokens(provider, model) {
|
|
113
113
|
if (model.startsWith('gpt-5')) {
|
|
114
114
|
return 128000;
|
|
115
115
|
}
|
|
@@ -154,7 +154,10 @@ export function getModelContextWindow(model) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
function getModelSpecificConfig(modelProvider, tools) {
|
|
157
|
-
const
|
|
157
|
+
const defaultMaxTokens = getModelMaxTokens(modelProvider.provider, modelProvider.model);
|
|
158
|
+
const modelKey = `${modelProvider.provider}:${modelProvider.model}`;
|
|
159
|
+
const customMaxTokensStore = get(copilotInfo)?.maxTokensPerModel;
|
|
160
|
+
const maxTokens = customMaxTokensStore?.[modelKey] ?? defaultMaxTokens;
|
|
158
161
|
if ((modelProvider.provider === 'openai' || modelProvider.provider === 'azure_openai') &&
|
|
159
162
|
(modelProvider.model.startsWith('o') || modelProvider.model.startsWith('gpt-5'))) {
|
|
160
163
|
return {
|
|
@@ -42,6 +42,7 @@ export type FlowBuilderWhitelabelCustomUi = {
|
|
|
42
42
|
tagSelectPlaceholder?: string;
|
|
43
43
|
tagSelectNoLabel?: boolean;
|
|
44
44
|
tagLabel?: string;
|
|
45
|
+
aiAgent?: boolean;
|
|
45
46
|
};
|
|
46
47
|
export type DisplayResultUi = {
|
|
47
48
|
disableAiFix?: boolean;
|
|
@@ -65,6 +66,7 @@ export type EditorBarUi = {
|
|
|
65
66
|
assistants?: boolean;
|
|
66
67
|
multiplayer?: boolean;
|
|
67
68
|
autoformatting?: boolean;
|
|
69
|
+
editorSettings?: boolean;
|
|
68
70
|
vimMode?: boolean;
|
|
69
71
|
relativeLineNumbers?: boolean;
|
|
70
72
|
aiGen?: boolean;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
<script lang="ts">import {} from '../../gen';
|
|
2
2
|
import ProgressBar from '../progressBar/ProgressBar.svelte';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
let
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
let
|
|
10
|
-
let
|
|
11
|
-
let
|
|
12
|
-
$: if (job)
|
|
13
|
-
updateJobProgress(job);
|
|
3
|
+
let { job = undefined, currentSubJobProgress = $bindable(undefined), class: className } = $props();
|
|
4
|
+
let error = $state(undefined);
|
|
5
|
+
let index = $state(0);
|
|
6
|
+
let subIndex = $state(undefined);
|
|
7
|
+
let subLength = $state(undefined);
|
|
8
|
+
let length = $state(1);
|
|
9
|
+
let nextInProgress = $state(false);
|
|
10
|
+
let subIndexIsPercent = $state(false);
|
|
11
|
+
let progressBar = $state(undefined);
|
|
14
12
|
function updateJobProgress(job) {
|
|
15
13
|
const modules = job?.flow_status?.modules;
|
|
16
14
|
if (!modules?.length) {
|
|
@@ -66,25 +64,27 @@ function updateJobProgress(job) {
|
|
|
66
64
|
index = maxDone;
|
|
67
65
|
nextInProgress = newNextInProgress;
|
|
68
66
|
}
|
|
69
|
-
let resetP;
|
|
70
67
|
export function reset() {
|
|
71
|
-
resetP
|
|
68
|
+
progressBar?.resetP();
|
|
72
69
|
error = undefined;
|
|
73
70
|
subIndex = undefined;
|
|
74
71
|
subLength = undefined;
|
|
75
72
|
length = 1;
|
|
76
73
|
index = 0;
|
|
77
74
|
}
|
|
75
|
+
$effect(() => {
|
|
76
|
+
job && updateJobProgress(job);
|
|
77
|
+
});
|
|
78
78
|
</script>
|
|
79
79
|
|
|
80
80
|
<ProgressBar
|
|
81
|
-
bind:
|
|
81
|
+
bind:this={progressBar}
|
|
82
82
|
{length}
|
|
83
83
|
{index}
|
|
84
84
|
{nextInProgress}
|
|
85
85
|
{subLength}
|
|
86
86
|
{subIndex}
|
|
87
87
|
{error}
|
|
88
|
-
|
|
89
|
-
class={
|
|
88
|
+
{subIndexIsPercent}
|
|
89
|
+
class={className}
|
|
90
90
|
/>
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import { type Job } from '../../gen';
|
|
2
|
-
interface
|
|
3
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
-
$$bindings?: Bindings;
|
|
5
|
-
} & Exports;
|
|
6
|
-
(internal: unknown, props: Props & {
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const FlowProgressBar: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
[x: string]: any;
|
|
2
|
+
interface Props {
|
|
17
3
|
job?: Job | undefined;
|
|
18
|
-
currentSubJobProgress?: number | undefined
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}, {}, {
|
|
4
|
+
currentSubJobProgress?: number | undefined;
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const FlowProgressBar: import("svelte").Component<Props, {
|
|
23
8
|
reset: () => void;
|
|
24
|
-
},
|
|
25
|
-
type FlowProgressBar =
|
|
9
|
+
}, "currentSubJobProgress">;
|
|
10
|
+
type FlowProgressBar = ReturnType<typeof FlowProgressBar>;
|
|
26
11
|
export default FlowProgressBar;
|
|
@@ -20,7 +20,7 @@ import DefaultScriptsInner from '../../DefaultScriptsInner.svelte';
|
|
|
20
20
|
import GenAiQuick from './GenAiQuick.svelte';
|
|
21
21
|
import FlowToplevelNode from '../pickers/FlowToplevelNode.svelte';
|
|
22
22
|
const dispatch = createEventDispatcher();
|
|
23
|
-
let { summary = undefined, filter = $bindable(''), disableAi = false, preFilter = 'hub', funcDesc, owners = $bindable([]), loading = $bindable(false), small = false, kind, selectedKind = kind, displayPath = false } = $props();
|
|
23
|
+
let { summary = undefined, filter = $bindable(''), disableAi = false, preFilter = 'hub', funcDesc, owners = $bindable([]), loading = $bindable(false), small = false, kind, selectedKind = kind, displayPath = false, refreshCount = 0 } = $props();
|
|
24
24
|
let lang = $state(undefined);
|
|
25
25
|
let filteredWorkspaceItems = $state([]);
|
|
26
26
|
let hubCompletions = $state([]);
|
|
@@ -375,9 +375,9 @@ let aiLength = $derived(funcDesc?.length > 0 && !disableAi && selectedKind != 'f
|
|
|
375
375
|
on:pickScript
|
|
376
376
|
on:pickFlow
|
|
377
377
|
{displayPath}
|
|
378
|
+
{refreshCount}
|
|
378
379
|
/>
|
|
379
380
|
{/if}
|
|
380
|
-
|
|
381
381
|
{#if selectedKind != 'preprocessor' && selectedKind != 'flow'}
|
|
382
382
|
{#if (!selected || selected?.kind === 'integrations') && (preFilter === 'hub' || preFilter === 'all')}
|
|
383
383
|
{#if !selected && preFilter !== 'hub'}
|
|
@@ -398,6 +398,7 @@ let aiLength = $derived(funcDesc?.length > 0 && !disableAi && selectedKind != 'f
|
|
|
398
398
|
on:pickScript
|
|
399
399
|
bind:loading
|
|
400
400
|
{displayPath}
|
|
401
|
+
{refreshCount}
|
|
401
402
|
/>
|
|
402
403
|
{/if}
|
|
403
404
|
{/if}
|
|
@@ -10,6 +10,7 @@ interface Props {
|
|
|
10
10
|
kind: 'trigger' | 'script' | 'preprocessor' | 'failure' | 'approval';
|
|
11
11
|
selectedKind?: 'script' | 'flow' | 'approval' | 'trigger' | 'preprocessor' | 'failure';
|
|
12
12
|
displayPath?: boolean;
|
|
13
|
+
refreshCount?: number;
|
|
13
14
|
}
|
|
14
15
|
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> {
|
|
15
16
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -50,6 +50,7 @@ import { getStepHistoryLoaderContext } from '../../stepHistoryLoader.svelte';
|
|
|
50
50
|
import AssetsDropdownButton from '../../assets/AssetsDropdownButton.svelte';
|
|
51
51
|
import { useUiIntent } from '../../copilot/chat/flow/useUiIntent';
|
|
52
52
|
import { editor as meditor } from 'monaco-editor';
|
|
53
|
+
import { DynamicInput } from '../../../utils';
|
|
53
54
|
const { selectedId, currentEditor, previewArgs, flowStateStore, flowStore, pathStore, saveDraft, customUi, executionCount } = getContext('FlowEditorContext');
|
|
54
55
|
let { flowModule = $bindable(), failureModule = false, preprocessorModule = false, parentModule = $bindable(), previousModule, scriptKind = 'script', scriptTemplate = 'script', noEditor, enableAi, savedModule = undefined, forceTestTab = false, highlightArg = undefined, isAgentTool = false } = $props();
|
|
55
56
|
let workspaceScriptTag = $state(undefined);
|
|
@@ -111,7 +112,6 @@ async function reload(flowModule) {
|
|
|
111
112
|
reloadError = undefined;
|
|
112
113
|
try {
|
|
113
114
|
const { input_transforms, schema } = await loadSchemaFromModule(flowModule);
|
|
114
|
-
console.log('reload', schema);
|
|
115
115
|
validCode = true;
|
|
116
116
|
if (inputTransformSchemaForm) {
|
|
117
117
|
inputTransformSchemaForm.setArgs(input_transforms);
|
|
@@ -224,6 +224,28 @@ $effect(() => {
|
|
|
224
224
|
});
|
|
225
225
|
let rawScriptLang = $derived(flowModule.value.type == 'rawscript' ? flowModule.value.language : undefined);
|
|
226
226
|
let modulePreviewResultViewer = $state(undefined);
|
|
227
|
+
function retrieveDynCodeAndLang(value) {
|
|
228
|
+
let helperScript;
|
|
229
|
+
switch (value.type) {
|
|
230
|
+
case 'script':
|
|
231
|
+
helperScript = {
|
|
232
|
+
source: 'deployed',
|
|
233
|
+
path: value.path,
|
|
234
|
+
runnable_kind: 'script'
|
|
235
|
+
};
|
|
236
|
+
break;
|
|
237
|
+
case 'rawscript':
|
|
238
|
+
helperScript = {
|
|
239
|
+
source: 'inline',
|
|
240
|
+
code: value.content,
|
|
241
|
+
lang: value.language
|
|
242
|
+
};
|
|
243
|
+
break;
|
|
244
|
+
default:
|
|
245
|
+
helperScript = undefined;
|
|
246
|
+
}
|
|
247
|
+
return helperScript;
|
|
248
|
+
}
|
|
227
249
|
function onJobDone() {
|
|
228
250
|
modulePreviewResultViewer?.getOutputPickerInner()?.setJobPreview();
|
|
229
251
|
}
|
|
@@ -486,6 +508,7 @@ function onJobDone() {
|
|
|
486
508
|
}
|
|
487
509
|
extraLib={stepPropPicker.extraLib}
|
|
488
510
|
{enableAi}
|
|
511
|
+
helperScript={retrieveDynCodeAndLang(flowModule.value)}
|
|
489
512
|
/>
|
|
490
513
|
</PropPickerWrapper>
|
|
491
514
|
</div>
|
|
@@ -49,32 +49,58 @@ export async function loadSchemaFromModule(module) {
|
|
|
49
49
|
type: 'object',
|
|
50
50
|
format: 'ai-provider'
|
|
51
51
|
},
|
|
52
|
+
output_type: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'The type of output the AI agent will generate (text or image). Image output requires a configured workspace S3 storage, will ignore tools, and only works with OpenAI, Google AI and OpenRouter gemini-image-preview model.',
|
|
55
|
+
enum: ['text', 'image'],
|
|
56
|
+
default: 'text'
|
|
57
|
+
},
|
|
52
58
|
user_message: {
|
|
53
|
-
type: 'string'
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'The message to give as input to the AI agent.'
|
|
54
61
|
},
|
|
55
62
|
system_prompt: {
|
|
56
|
-
type: 'string'
|
|
63
|
+
type: 'string',
|
|
64
|
+
description: 'The system prompt to give as input to the AI agent.'
|
|
65
|
+
},
|
|
66
|
+
streaming: {
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
description: 'Whether to stream the output of the AI agent (only used if output_type is text).',
|
|
69
|
+
default: false,
|
|
70
|
+
showExpr: "fields.output_type === 'text'"
|
|
71
|
+
},
|
|
72
|
+
user_images: {
|
|
73
|
+
type: 'array',
|
|
74
|
+
description: 'Array of images to give as input to the AI agent. Requires a configured workspace S3 storage.',
|
|
75
|
+
items: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
resourceType: 's3object'
|
|
78
|
+
}
|
|
57
79
|
},
|
|
58
80
|
max_completion_tokens: {
|
|
59
|
-
type: 'number'
|
|
81
|
+
type: 'number',
|
|
82
|
+
description: 'The maximum number of output tokens.'
|
|
60
83
|
},
|
|
61
84
|
temperature: {
|
|
62
85
|
type: 'number',
|
|
63
|
-
description: 'Controls randomness in text generation. Range: 0.0 (deterministic) to 2.0 (random).'
|
|
86
|
+
description: 'Controls randomness in text generation. Range: 0.0 (deterministic) to 2.0 (random).',
|
|
87
|
+
showExpr: "fields.output_type === 'text'"
|
|
64
88
|
},
|
|
65
89
|
output_schema: {
|
|
66
90
|
type: 'object',
|
|
67
|
-
description: 'JSON schema that the AI agent will follow for its response format',
|
|
68
|
-
format: 'json-schema'
|
|
91
|
+
description: 'JSON schema that the AI agent will follow for its response format (only used if output_type is text).',
|
|
92
|
+
format: 'json-schema',
|
|
93
|
+
showExpr: "fields.output_type === 'text'"
|
|
69
94
|
}
|
|
70
95
|
},
|
|
71
|
-
required: ['provider', '
|
|
96
|
+
required: ['provider', 'user_message', 'output_type'],
|
|
72
97
|
type: 'object',
|
|
73
98
|
order: [
|
|
74
99
|
'provider',
|
|
75
|
-
'
|
|
100
|
+
'output_type',
|
|
76
101
|
'user_message',
|
|
77
102
|
'system_prompt',
|
|
103
|
+
'user_images',
|
|
78
104
|
'max_completion_tokens',
|
|
79
105
|
'temperature',
|
|
80
106
|
'output_schema'
|
|
@@ -15,7 +15,10 @@ export declare function getFirstStepSchema(flowState: FlowState, flow: OpenFlow)
|
|
|
15
15
|
description?: string | undefined;
|
|
16
16
|
pattern?: string | undefined;
|
|
17
17
|
default?: any;
|
|
18
|
-
enum?: string[] |
|
|
18
|
+
enum?: string[] | {
|
|
19
|
+
value: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}[] | undefined;
|
|
19
22
|
contentEncoding?: "base64" | "binary" | undefined;
|
|
20
23
|
format?: string | undefined;
|
|
21
24
|
items?: {
|
|
@@ -13,7 +13,7 @@ function onKeydown(event) {
|
|
|
13
13
|
filter < flowJobs.length &&
|
|
14
14
|
filter > 0) {
|
|
15
15
|
event.preventDefault();
|
|
16
|
-
onSelectedIteration({
|
|
16
|
+
onSelectedIteration?.({
|
|
17
17
|
index: filter - 1,
|
|
18
18
|
id: flowJobs[filter - 1],
|
|
19
19
|
manuallySet: true,
|
|
@@ -54,7 +54,7 @@ $effect(() => {
|
|
|
54
54
|
onmouseleave={() => (buttonHover = false)}
|
|
55
55
|
onclick={(e) => {
|
|
56
56
|
buttonHover = false
|
|
57
|
-
onSelectedIteration({ manuallySet: false, moduleId: moduleId })
|
|
57
|
+
onSelectedIteration?.({ manuallySet: false, moduleId: moduleId })
|
|
58
58
|
}}
|
|
59
59
|
>
|
|
60
60
|
{#if buttonHover}
|
|
@@ -125,7 +125,7 @@ $effect(() => {
|
|
|
125
125
|
items[idx].index == selected ? 'bg-surface-selected' : ''
|
|
126
126
|
)}
|
|
127
127
|
onClick={() => {
|
|
128
|
-
onSelectedIteration({
|
|
128
|
+
onSelectedIteration?.({
|
|
129
129
|
moduleId: moduleId,
|
|
130
130
|
index: items[idx].index,
|
|
131
131
|
id: items[idx].id,
|
|
@@ -6,7 +6,7 @@ interface Props {
|
|
|
6
6
|
flowJobsSuccess: (boolean | undefined)[] | undefined;
|
|
7
7
|
selected: number;
|
|
8
8
|
selectedManually: boolean | undefined;
|
|
9
|
-
onSelectedIteration
|
|
9
|
+
onSelectedIteration?: onSelectedIteration;
|
|
10
10
|
showIcon?: boolean;
|
|
11
11
|
}
|
|
12
12
|
declare const FlowJobsMenu: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import { createEventDispatcher } from 'svelte';
|
|
3
|
-
import { Bug, Cross } from 'lucide-svelte';
|
|
1
|
+
<script lang="ts">import { Bug, Cross } from 'lucide-svelte';
|
|
4
2
|
import InsertModuleInner from './InsertModuleInner.svelte';
|
|
5
3
|
import { twMerge } from 'tailwind-merge';
|
|
6
4
|
import PopupV2 from '../../common/popup/PopupV2.svelte';
|
|
7
5
|
import { flip, offset } from 'svelte-floating-ui/dom';
|
|
8
6
|
import { SchedulePollIcon } from '../../icons';
|
|
9
|
-
// import type { Writable } from 'svelte/store'
|
|
10
|
-
const dispatch = createEventDispatcher();
|
|
11
7
|
let { index = 0, funcDesc = $bindable(''), kind = 'script', iconSize = 12, clazz = '', placement = 'bottom-center' } = $props();
|
|
12
8
|
let floatingConfig = {
|
|
13
9
|
strategy: 'fixed',
|
|
@@ -31,7 +27,7 @@ noTransition
|
|
|
31
27
|
shouldUsePortal={true} -->
|
|
32
28
|
|
|
33
29
|
<PopupV2 {floatingConfig} bind:open target="#flow-editor">
|
|
34
|
-
{#snippet button(
|
|
30
|
+
{#snippet button()}
|
|
35
31
|
<button
|
|
36
32
|
title={`Add ${
|
|
37
33
|
kind === 'failure'
|
|
@@ -48,13 +44,7 @@ shouldUsePortal={true} -->
|
|
|
48
44
|
'w-[17.5px] h-[17.5px] flex items-center justify-center !outline-[1px] outline dark:outline-gray-500 outline-gray-300 text-secondary bg-surface focus:outline-none hover:bg-surface-hover rounded',
|
|
49
45
|
clazz
|
|
50
46
|
)}
|
|
51
|
-
onpointerdown={
|
|
52
|
-
preventDefault(() => {
|
|
53
|
-
dispatch('open')
|
|
54
|
-
pointerdown()
|
|
55
|
-
})
|
|
56
|
-
)}
|
|
57
|
-
onpointerup={pointerup}
|
|
47
|
+
onpointerdown={() => (open = !open)}
|
|
58
48
|
>
|
|
59
49
|
{#if kind === 'trigger'}
|
|
60
50
|
<SchedulePollIcon size={14} />
|
|
@@ -70,7 +60,7 @@ shouldUsePortal={true} -->
|
|
|
70
60
|
{/snippet}
|
|
71
61
|
{#snippet children({ close })}
|
|
72
62
|
<InsertModuleInner
|
|
73
|
-
on:close={() => close(
|
|
63
|
+
on:close={() => close()}
|
|
74
64
|
on:insert
|
|
75
65
|
on:new
|
|
76
66
|
on:pickFlow
|
|
@@ -27,7 +27,6 @@ declare const InsertModuleButton: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
|
27
27
|
new: CustomEvent<any>;
|
|
28
28
|
pickFlow: CustomEvent<any>;
|
|
29
29
|
pickScript: CustomEvent<any>;
|
|
30
|
-
open: CustomEvent<any>;
|
|
31
30
|
} & {
|
|
32
31
|
[evt: string]: CustomEvent<any>;
|
|
33
32
|
}, {}, {}, "funcDesc">;
|