@flowdrop/flowdrop 2.7.0 → 2.8.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/CHANGELOG.md +31 -1
- package/dist/api/enhanced-client.d.ts +29 -1
- package/dist/api/enhanced-client.js +83 -9
- package/dist/chat/index.d.ts +5 -1
- package/dist/chat/index.js +2 -0
- package/dist/chat/toolCatalogue.d.ts +27 -0
- package/dist/chat/toolCatalogue.js +35 -0
- package/dist/chat/turnDriver.d.ts +143 -0
- package/dist/chat/turnDriver.js +124 -0
- package/dist/components/App.svelte +47 -56
- package/dist/components/SettingsPanel.svelte +13 -0
- package/dist/components/WorkflowEditor.svelte +4 -2
- package/dist/components/WorkflowEditor.svelte.d.ts +2 -0
- package/dist/components/chat/AIChatPanel.svelte +410 -22
- package/dist/components/toast/DismissibleToast.svelte +53 -0
- package/dist/components/toast/DismissibleToast.svelte.d.ts +24 -0
- package/dist/components/toast/WarningIcon.svelte +28 -0
- package/dist/components/toast/WarningIcon.svelte.d.ts +26 -0
- package/dist/config/constants.d.ts +7 -3
- package/dist/config/constants.js +7 -3
- package/dist/config/endpoints.d.ts +7 -0
- package/dist/config/endpoints.js +2 -1
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/messages/defaults.d.ts +41 -0
- package/dist/messages/defaults.js +20 -0
- package/dist/services/chatService.d.ts +21 -3
- package/dist/services/chatService.js +33 -1
- package/dist/services/globalSave.js +3 -1
- package/dist/services/toastService.d.ts +23 -2
- package/dist/services/toastService.js +72 -28
- package/dist/stores/instanceContainer.svelte.d.ts +34 -0
- package/dist/stores/instanceContainer.svelte.js +30 -0
- package/dist/styles/toast.css +62 -0
- package/dist/svelte-app.d.ts +12 -2
- package/dist/svelte-app.js +29 -12
- package/dist/types/chat.d.ts +59 -0
- package/dist/types/events.d.ts +23 -0
- package/dist/types/events.js +3 -1
- package/dist/types/settings.d.ts +18 -1
- package/dist/types/settings.js +1 -0
- package/dist/webmcp/WebMCPConfirm.svelte +129 -68
- package/dist/webmcp/WebMCPConfirm.svelte.d.ts +2 -2
- package/dist/webmcp/descriptors.d.ts +7 -0
- package/dist/webmcp/descriptors.js +51 -0
- package/dist/webmcp/gate.d.ts +13 -7
- package/dist/webmcp/gate.js +8 -53
- package/dist/webmcp/index.d.ts +5 -2
- package/dist/webmcp/index.js +3 -1
- package/dist/webmcp/register.d.ts +11 -10
- package/dist/webmcp/register.js +59 -384
- package/dist/webmcp/runtime.d.ts +33 -0
- package/dist/webmcp/runtime.js +500 -0
- package/dist/webmcp/types.d.ts +92 -0
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import CommandConsole from './console/CommandConsole.svelte';
|
|
21
21
|
import AIChatPanel from './chat/AIChatPanel.svelte';
|
|
22
22
|
import TabbedSurface from './surfaces/TabbedSurface.svelte';
|
|
23
|
+
import type { Snippet } from 'svelte';
|
|
23
24
|
import type { SurfaceTab } from './surfaces/TabbedSurface.svelte';
|
|
24
25
|
import SurfaceOverlay from './surfaces/SurfaceOverlay.svelte';
|
|
25
26
|
import type { UIAction } from '../commands/index.js';
|
|
@@ -861,7 +862,7 @@
|
|
|
861
862
|
const errorObj = error instanceof Error ? error : new Error('Unknown error occurred');
|
|
862
863
|
logger.error('Workflow import failed:', errorObj);
|
|
863
864
|
if (features.showToasts) {
|
|
864
|
-
apiToasts.error('Import workflow', errorObj
|
|
865
|
+
apiToasts.error('Import workflow', errorObj);
|
|
865
866
|
}
|
|
866
867
|
}
|
|
867
868
|
};
|
|
@@ -994,8 +995,40 @@
|
|
|
994
995
|
|
|
995
996
|
/** Config surface has something to show (node config or workflow settings). */
|
|
996
997
|
const configActive = $derived(isWorkflowSettingsOpen || !!selectedNodeForConfig);
|
|
997
|
-
/** Console
|
|
998
|
-
const
|
|
998
|
+
/** The Command Console tab is offered by this mount. */
|
|
999
|
+
const consoleTabOffered = features.console;
|
|
1000
|
+
/** The AI Assistant tab is offered: switched on, and a chat backend exists. */
|
|
1001
|
+
const chatTabOffered = $derived(
|
|
1002
|
+
features.assistant && endpointConfig?.endpoints?.chat !== undefined
|
|
1003
|
+
);
|
|
1004
|
+
/** At least one surface of the console/chat group is offered. */
|
|
1005
|
+
const consoleGroupOffered = $derived(consoleTabOffered || chatTabOffered);
|
|
1006
|
+
/** Console/chat group is available (offered, editable canvas, console toggled open). */
|
|
1007
|
+
const consoleActive = $derived(
|
|
1008
|
+
consoleGroupOffered && getUiSettings().consoleOpen && canvasEditable
|
|
1009
|
+
);
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* The console-group tabs this mount offers, for whichever host renders them.
|
|
1013
|
+
* Snippets are passed in because they are declared in the template.
|
|
1014
|
+
*/
|
|
1015
|
+
function consoleGroupTabs(consoleBody: Snippet, chatBody: Snippet): SurfaceTab[] {
|
|
1016
|
+
return [
|
|
1017
|
+
...(consoleTabOffered
|
|
1018
|
+
? [
|
|
1019
|
+
{
|
|
1020
|
+
id: 'console',
|
|
1021
|
+
label: mergedMessages.navigation.bottomPanel.console,
|
|
1022
|
+
content: consoleBody,
|
|
1023
|
+
display: 'contents' as const
|
|
1024
|
+
}
|
|
1025
|
+
]
|
|
1026
|
+
: []),
|
|
1027
|
+
...(chatTabOffered
|
|
1028
|
+
? [{ id: 'chat', label: mergedMessages.navigation.bottomPanel.chat, content: chatBody }]
|
|
1029
|
+
: [])
|
|
1030
|
+
];
|
|
1031
|
+
}
|
|
999
1032
|
/** Node-swap sub-flow occupies the right sidebar regardless of placement. */
|
|
1000
1033
|
const swapActive = $derived(swapMode !== 'idle');
|
|
1001
1034
|
|
|
@@ -1100,6 +1133,7 @@
|
|
|
1100
1133
|
target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;
|
|
1101
1134
|
|
|
1102
1135
|
if (isInputElement) return;
|
|
1136
|
+
if (!consoleGroupOffered) return;
|
|
1103
1137
|
|
|
1104
1138
|
event.preventDefault();
|
|
1105
1139
|
toggleConsole();
|
|
@@ -1381,19 +1415,7 @@
|
|
|
1381
1415
|
Console + chat tabs, shared by whichever host the console group is routed to.
|
|
1382
1416
|
-->
|
|
1383
1417
|
{#snippet consoleChatTabs()}
|
|
1384
|
-
{@const tabs =
|
|
1385
|
-
{
|
|
1386
|
-
id: 'console',
|
|
1387
|
-
label: mergedMessages.navigation.bottomPanel.console,
|
|
1388
|
-
content: consoleSurfaceBody,
|
|
1389
|
-
display: 'contents' as const
|
|
1390
|
-
},
|
|
1391
|
-
{
|
|
1392
|
-
id: 'chat',
|
|
1393
|
-
label: mergedMessages.navigation.bottomPanel.chat,
|
|
1394
|
-
content: chatSurfaceBody
|
|
1395
|
-
}
|
|
1396
|
-
]}
|
|
1418
|
+
{@const tabs = consoleGroupTabs(consoleSurfaceBody, chatSurfaceBody)}
|
|
1397
1419
|
<TabbedSurface {tabs} activeId={activeSurface} onSelect={selectSurface} />
|
|
1398
1420
|
{/snippet}
|
|
1399
1421
|
|
|
@@ -1506,21 +1528,7 @@
|
|
|
1506
1528
|
}
|
|
1507
1529
|
]
|
|
1508
1530
|
: []),
|
|
1509
|
-
...(consoleHere('sidebar')
|
|
1510
|
-
? [
|
|
1511
|
-
{
|
|
1512
|
-
id: 'console',
|
|
1513
|
-
label: mergedMessages.navigation.bottomPanel.console,
|
|
1514
|
-
content: consoleSurfaceBody,
|
|
1515
|
-
display: 'contents' as const
|
|
1516
|
-
},
|
|
1517
|
-
{
|
|
1518
|
-
id: 'chat',
|
|
1519
|
-
label: mergedMessages.navigation.bottomPanel.chat,
|
|
1520
|
-
content: chatSurfaceBody
|
|
1521
|
-
}
|
|
1522
|
-
]
|
|
1523
|
-
: [])
|
|
1531
|
+
...(consoleHere('sidebar') ? consoleGroupTabs(consoleSurfaceBody, chatSurfaceBody) : [])
|
|
1524
1532
|
] as SurfaceTab[]}
|
|
1525
1533
|
<TabbedSurface {tabs} activeId={activeSurface} onSelect={selectSurface} />
|
|
1526
1534
|
{/if}
|
|
@@ -1541,21 +1549,7 @@
|
|
|
1541
1549
|
}
|
|
1542
1550
|
]
|
|
1543
1551
|
: []),
|
|
1544
|
-
...(consoleHere('below')
|
|
1545
|
-
? [
|
|
1546
|
-
{
|
|
1547
|
-
id: 'console',
|
|
1548
|
-
label: mergedMessages.navigation.bottomPanel.console,
|
|
1549
|
-
content: consoleSurfaceBody,
|
|
1550
|
-
display: 'contents' as const
|
|
1551
|
-
},
|
|
1552
|
-
{
|
|
1553
|
-
id: 'chat',
|
|
1554
|
-
label: mergedMessages.navigation.bottomPanel.chat,
|
|
1555
|
-
content: chatSurfaceBody
|
|
1556
|
-
}
|
|
1557
|
-
]
|
|
1558
|
-
: [])
|
|
1552
|
+
...(consoleHere('below') ? consoleGroupTabs(consoleSurfaceBody, chatSurfaceBody) : [])
|
|
1559
1553
|
] as SurfaceTab[]}
|
|
1560
1554
|
<TabbedSurface {tabs} activeId={activeSurface} onSelect={selectSurface} />
|
|
1561
1555
|
{/snippet}
|
|
@@ -1620,8 +1614,11 @@
|
|
|
1620
1614
|
{refreshTrigger}
|
|
1621
1615
|
builtinEditors={features.builtinEditors}
|
|
1622
1616
|
gridVariant={themeConfig?.canvas?.grid ?? 'dots'}
|
|
1623
|
-
consoleOpen={
|
|
1624
|
-
onToggleConsole={toggleConsole}
|
|
1617
|
+
consoleOpen={consoleActive}
|
|
1618
|
+
onToggleConsole={consoleGroupOffered ? toggleConsole : undefined}
|
|
1619
|
+
consoleToggleLabel={consoleTabOffered
|
|
1620
|
+
? undefined
|
|
1621
|
+
: mergedMessages.navigation.bottomPanel.chat}
|
|
1625
1622
|
/>
|
|
1626
1623
|
</div>
|
|
1627
1624
|
</MainLayout>
|
|
@@ -1643,13 +1640,7 @@
|
|
|
1643
1640
|
>
|
|
1644
1641
|
{@const tabs = [
|
|
1645
1642
|
{ id: 'config', label: activeConfig?.title ?? 'Configuration', content: configBareContent },
|
|
1646
|
-
|
|
1647
|
-
id: 'console',
|
|
1648
|
-
label: mergedMessages.navigation.bottomPanel.console,
|
|
1649
|
-
content: consoleSurfaceBody,
|
|
1650
|
-
display: 'contents' as const
|
|
1651
|
-
},
|
|
1652
|
-
{ id: 'chat', label: mergedMessages.navigation.bottomPanel.chat, content: chatSurfaceBody }
|
|
1643
|
+
...consoleGroupTabs(consoleSurfaceBody, chatSurfaceBody)
|
|
1653
1644
|
] as SurfaceTab[]}
|
|
1654
1645
|
<TabbedSurface {tabs} activeId={activeSurface} onSelect={selectSurface} />
|
|
1655
1646
|
</SurfaceOverlay>
|
|
@@ -1663,7 +1654,7 @@
|
|
|
1663
1654
|
</SurfaceOverlay>
|
|
1664
1655
|
{:else if consoleHere('modal')}
|
|
1665
1656
|
<SurfaceOverlay
|
|
1666
|
-
title={activeSurface === 'chat'
|
|
1657
|
+
title={activeSurface === 'chat' || !consoleTabOffered
|
|
1667
1658
|
? mergedMessages.navigation.bottomPanel.chat
|
|
1668
1659
|
: mergedMessages.navigation.bottomPanel.console}
|
|
1669
1660
|
closeLabel={mergedMessages.layout.closeConfigPanel}
|
|
@@ -268,6 +268,19 @@
|
|
|
268
268
|
description: 'Show confirmation before deleting nodes',
|
|
269
269
|
default: true
|
|
270
270
|
},
|
|
271
|
+
chatMode: {
|
|
272
|
+
type: 'string',
|
|
273
|
+
title: 'AI Assistant Mode',
|
|
274
|
+
description:
|
|
275
|
+
'Tools: the assistant calls the editor tools in a loop and asks before changing the workflow. ' +
|
|
276
|
+
'Text (legacy): one reply with a command block you apply by hand. ' +
|
|
277
|
+
'Tools needs a backend that supports tool-calling turns; otherwise the panel falls back to Text.',
|
|
278
|
+
oneOf: [
|
|
279
|
+
{ const: 'tools', title: 'Tools' },
|
|
280
|
+
{ const: 'dsl', title: 'Text (legacy)' }
|
|
281
|
+
],
|
|
282
|
+
default: 'tools'
|
|
283
|
+
},
|
|
271
284
|
chatAutoRetry: {
|
|
272
285
|
type: 'boolean',
|
|
273
286
|
title: 'AI Assistant Auto-retry',
|
|
@@ -86,6 +86,8 @@
|
|
|
86
86
|
// Console toggle
|
|
87
87
|
consoleOpen?: boolean;
|
|
88
88
|
onToggleConsole?: () => void;
|
|
89
|
+
/** Label of the console-group toggle; defaults to the Command Console wording. */
|
|
90
|
+
consoleToggleLabel?: string;
|
|
89
91
|
/** Per-instance state container (created by mount functions). Defaults to the page-default instance. */
|
|
90
92
|
instance?: FlowDropInstance;
|
|
91
93
|
/**
|
|
@@ -718,7 +720,7 @@
|
|
|
718
720
|
} catch (error) {
|
|
719
721
|
const errorObj = error instanceof Error ? error : new Error('Unknown error occurred');
|
|
720
722
|
logger.error('Workflow file drop import failed:', errorObj);
|
|
721
|
-
apiToasts.error('Import workflow', errorObj
|
|
723
|
+
apiToasts.error('Import workflow', errorObj);
|
|
722
724
|
}
|
|
723
725
|
};
|
|
724
726
|
reader.onerror = () => {
|
|
@@ -925,7 +927,7 @@
|
|
|
925
927
|
{#if canvasEditable && props.onToggleConsole}
|
|
926
928
|
<CanvasIconButton
|
|
927
929
|
class="flowdrop-console-toggle"
|
|
928
|
-
label={m().layout.commandConsole}
|
|
930
|
+
label={props.consoleToggleLabel ?? m().layout.commandConsole}
|
|
929
931
|
active={props.consoleOpen}
|
|
930
932
|
onclick={props.onToggleConsole}
|
|
931
933
|
>
|
|
@@ -26,6 +26,8 @@ interface Props {
|
|
|
26
26
|
refreshTrigger?: number;
|
|
27
27
|
consoleOpen?: boolean;
|
|
28
28
|
onToggleConsole?: () => void;
|
|
29
|
+
/** Label of the console-group toggle; defaults to the Command Console wording. */
|
|
30
|
+
consoleToggleLabel?: string;
|
|
29
31
|
/** Per-instance state container (created by mount functions). Defaults to the page-default instance. */
|
|
30
32
|
instance?: FlowDropInstance;
|
|
31
33
|
/**
|