@flowdrop/flowdrop 2.9.0 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +200 -0
- package/dist/commands/executor.js +52 -8
- package/dist/commands/types.d.ts +3 -0
- package/dist/components/App.svelte +8 -0
- package/dist/components/App.svelte.d.ts +6 -0
- package/dist/components/CanvasContextMenu.stories.svelte +63 -0
- package/dist/components/CanvasContextMenu.stories.svelte.d.ts +19 -0
- package/dist/components/CanvasContextMenu.svelte +259 -0
- package/dist/components/CanvasContextMenu.svelte.d.ts +16 -0
- package/dist/components/CanvasController.svelte +24 -2
- package/dist/components/CanvasController.svelte.d.ts +16 -0
- package/dist/components/EdgeRefresher.svelte +1 -1
- package/dist/components/FlowDropZone.svelte +11 -7
- package/dist/components/FlowDropZone.svelte.d.ts +12 -0
- package/dist/components/PortCoordinateTracker.svelte +1 -1
- package/dist/components/UniversalNode.svelte +12 -13
- package/dist/components/WorkflowEditor.svelte +486 -149
- package/dist/components/WorkflowEditor.svelte.d.ts +7 -0
- package/dist/components/WorkflowInterfaceEditor.svelte +28 -3
- package/dist/components/WorkflowInterfaceEntryCard.svelte +112 -2
- package/dist/components/WorkflowInterfaceEntryCard.svelte.d.ts +3 -1
- package/dist/components/nodes/CaptionNode.stories.svelte +65 -0
- package/dist/components/nodes/CaptionNode.stories.svelte.d.ts +18 -0
- package/dist/components/nodes/CaptionNode.svelte +313 -0
- package/dist/components/nodes/CaptionNode.svelte.d.ts +16 -0
- package/dist/components/nodes/NotesNode.svelte +6 -0
- package/dist/components/playground/ChatBubble.svelte +2 -0
- package/dist/components/playground/ChatInput.svelte +18 -34
- package/dist/components/playground/ChatInput.svelte.d.ts +7 -0
- package/dist/components/playground/ControlPanel.svelte +27 -0
- package/dist/components/playground/ControlPanel.svelte.d.ts +12 -0
- package/dist/components/playground/ExecutionLogs.svelte +11 -8
- package/dist/components/playground/InterfaceInputForm.svelte +74 -0
- package/dist/components/playground/InterfaceInputForm.svelte.d.ts +14 -0
- package/dist/components/playground/LogRow.svelte +2 -0
- package/dist/components/playground/MessageCard.svelte +15 -3
- package/dist/components/playground/MessageNotice.svelte +2 -0
- package/dist/components/playground/MessageStream.svelte +87 -23
- package/dist/components/playground/OriginBadge.svelte +48 -0
- package/dist/components/playground/OriginBadge.svelte.d.ts +7 -0
- package/dist/components/playground/Playground.svelte +155 -38
- package/dist/components/playground/messageDisplay.d.ts +23 -1
- package/dist/components/playground/messageDisplay.js +49 -0
- package/dist/config/endpoints.d.ts +65 -0
- package/dist/config/endpoints.js +39 -0
- package/dist/core/index.d.ts +6 -3
- package/dist/core/index.js +2 -1
- package/dist/editor/contextMenu.d.ts +107 -0
- package/dist/editor/contextMenu.js +134 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/messages/defaults.d.ts +63 -0
- package/dist/messages/defaults.js +59 -0
- package/dist/openapi/v1/openapi.yaml +356 -7
- package/dist/playground/commands/registry.js +4 -2
- package/dist/playground/index.d.ts +3 -2
- package/dist/playground/index.js +2 -1
- package/dist/registry/builtinNodeTypes.d.ts +1 -1
- package/dist/registry/builtinNodeTypes.js +1 -0
- package/dist/registry/builtinNodes.js +13 -0
- package/dist/registry/nodeComponentRegistry.d.ts +18 -0
- package/dist/registry/nodeComponentRegistry.js +14 -2
- package/dist/schemas/v1/workflow.schema.json +22 -1
- package/dist/services/historyService.d.ts +1 -1
- package/dist/services/historyService.js +2 -2
- package/dist/services/playgroundService.d.ts +35 -1
- package/dist/services/playgroundService.js +82 -36
- package/dist/stores/inlineEditStore.svelte.d.ts +35 -0
- package/dist/stores/inlineEditStore.svelte.js +63 -0
- package/dist/stores/instanceContainer.svelte.d.ts +6 -0
- package/dist/stores/instanceContainer.svelte.js +2 -0
- package/dist/stores/playgroundStore.svelte.d.ts +59 -2
- package/dist/stores/playgroundStore.svelte.js +128 -2
- package/dist/styles/base.css +8 -0
- package/dist/styles/tokens.css +8 -0
- package/dist/svelte-app.d.ts +15 -0
- package/dist/svelte-app.js +6 -4
- package/dist/types/index.d.ts +34 -1
- package/dist/types/index.js +11 -0
- package/dist/types/playground.d.ts +90 -9
- package/dist/types/playground.js +12 -4
- package/dist/utils/captionText.d.ts +43 -0
- package/dist/utils/captionText.js +49 -0
- package/dist/utils/focus.d.ts +16 -0
- package/dist/utils/focus.js +40 -0
- package/dist/utils/nodeTypes.js +1 -0
- package/dist/utils/nodeWrapper.js +2 -0
- package/dist/utils/workflowInterface.d.ts +83 -1
- package/dist/utils/workflowInterface.js +192 -1
- package/package.json +2 -2
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas context menu model.
|
|
3
|
+
*
|
|
4
|
+
* Pure (no Svelte, no DOM): builds the entries for a right-click or keyboard
|
|
5
|
+
* menu on the editor canvas, lets the consumer's `contextMenu.items` have the
|
|
6
|
+
* last word, and runs an entry without letting a consumer bug break the
|
|
7
|
+
* canvas. The component (`CanvasContextMenu.svelte`) and the editor wiring
|
|
8
|
+
* live elsewhere; the built-in entries go through the same path as consumer
|
|
9
|
+
* ones, so there is one way to add an item.
|
|
10
|
+
*
|
|
11
|
+
* @module editor/contextMenu
|
|
12
|
+
*/
|
|
13
|
+
import type { XYPosition } from '@xyflow/svelte';
|
|
14
|
+
import type { NodeMetadata, WorkflowNode } from '../types/index.js';
|
|
15
|
+
import { defaultMessages } from '../messages/defaults.js';
|
|
16
|
+
/** What was right-clicked (or had focus when the menu key was pressed). */
|
|
17
|
+
export type ContextMenuTarget = 'pane' | 'node' | 'selection';
|
|
18
|
+
/** Operations an entry can perform on the editor. All go through the editor's own paths (history, confirm-delete, edge cleanup). */
|
|
19
|
+
export interface ContextMenuActions {
|
|
20
|
+
/** Add a node of the given type at a flow position. Returns the new node id, or null if it could not be created. */
|
|
21
|
+
addNode(metadata: NodeMetadata, position: XYPosition, options?: {
|
|
22
|
+
edit?: boolean;
|
|
23
|
+
}): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Delete nodes (and their edges) as the Delete key would, including the
|
|
26
|
+
* confirm-delete setting and the undo entry. Resolves once the deletion has
|
|
27
|
+
* been decided and applied (or declined at the confirm prompt).
|
|
28
|
+
*/
|
|
29
|
+
deleteNodes(ids: string[]): Promise<void>;
|
|
30
|
+
/** Open the configuration panel for a node. */
|
|
31
|
+
openConfig(id: string): void;
|
|
32
|
+
/** Open a node for typing in place. */
|
|
33
|
+
editInPlace(id: string): void;
|
|
34
|
+
}
|
|
35
|
+
/** Everything an entry or the `items` option needs to decide what to show and do. */
|
|
36
|
+
export interface ContextMenuContext {
|
|
37
|
+
target: ContextMenuTarget;
|
|
38
|
+
/** The right-clicked node, or the selection; empty on the pane. */
|
|
39
|
+
nodes: WorkflowNode[];
|
|
40
|
+
/** Flow coordinates of the click, snapped to the grid when snap-to-grid is on. */
|
|
41
|
+
position: XYPosition;
|
|
42
|
+
/** The instance's node types (`fd.nodeTypes.current`). */
|
|
43
|
+
nodeTypes: NodeMetadata[];
|
|
44
|
+
actions: ContextMenuActions;
|
|
45
|
+
}
|
|
46
|
+
/** A menu item or a separator. */
|
|
47
|
+
export type ContextMenuEntry = {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
/** Iconify icon name. */
|
|
51
|
+
icon?: string;
|
|
52
|
+
/** Display-only hint, e.g. the key that triggers the same action. */
|
|
53
|
+
shortcut?: string;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
run(ctx: ContextMenuContext): void | Promise<void>;
|
|
56
|
+
} | {
|
|
57
|
+
id: string;
|
|
58
|
+
separator: true;
|
|
59
|
+
};
|
|
60
|
+
/** Consumer configuration for the canvas context menu. */
|
|
61
|
+
export interface ContextMenuOptions {
|
|
62
|
+
/**
|
|
63
|
+
* Receives the built-in entries for this menu and returns the final list:
|
|
64
|
+
* append, remove, reorder or pass them through. Synchronous. If it throws or
|
|
65
|
+
* returns something that is not an array, the built-in entries are used.
|
|
66
|
+
*/
|
|
67
|
+
items?: (ctx: ContextMenuContext, defaults: ContextMenuEntry[]) => ContextMenuEntry[];
|
|
68
|
+
}
|
|
69
|
+
type ContextMenuMessages = typeof defaultMessages.contextMenu;
|
|
70
|
+
/**
|
|
71
|
+
* What the pure builder cannot learn from the context alone. Kept out of
|
|
72
|
+
* `ContextMenuContext` so that public shape does not change.
|
|
73
|
+
*/
|
|
74
|
+
export interface DefaultEntriesOptions {
|
|
75
|
+
/** Whether a node edits its text in place (its registration sets `editsInPlace`). Default: never. */
|
|
76
|
+
editsInPlace?: (node: WorkflowNode) => boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The first node type that is the caption: `type === 'caption'`, or
|
|
80
|
+
* `supportedTypes` includes `'caption'`. Undefined when the backend has none,
|
|
81
|
+
* in which case there is no "Add caption" entry.
|
|
82
|
+
*/
|
|
83
|
+
export declare function findCaptionMetadata(nodeTypes: NodeMetadata[]): NodeMetadata | undefined;
|
|
84
|
+
/** Type guard: separator entry. */
|
|
85
|
+
export declare function isSeparator(entry: ContextMenuEntry): entry is {
|
|
86
|
+
id: string;
|
|
87
|
+
separator: true;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* The built-in entries for a menu: node -> Configure (or Edit text for a node
|
|
91
|
+
* that edits in place), separator, Delete; selection (2+ nodes) -> Delete n
|
|
92
|
+
* nodes; pane -> Add caption when the node types include a caption, else none.
|
|
93
|
+
*
|
|
94
|
+
* @param messages - the `contextMenu` message branch (`m().contextMenu` in a component)
|
|
95
|
+
* @param options - facts the context does not carry (see `DefaultEntriesOptions`)
|
|
96
|
+
*/
|
|
97
|
+
export declare function buildDefaultContextMenuEntries(ctx: ContextMenuContext, messages?: ContextMenuMessages, options?: DefaultEntriesOptions): ContextMenuEntry[];
|
|
98
|
+
/** Drop leading, trailing and doubled separators. */
|
|
99
|
+
export declare function cleanSeparators(entries: ContextMenuEntry[]): ContextMenuEntry[];
|
|
100
|
+
/**
|
|
101
|
+
* Build the final entries: defaults, then the consumer's `items`, then
|
|
102
|
+
* separator clean-up. A consumer error never reaches the canvas.
|
|
103
|
+
*/
|
|
104
|
+
export declare function resolveContextMenuEntries(ctx: ContextMenuContext, options?: ContextMenuOptions, messages?: ContextMenuMessages, defaultsOptions?: DefaultEntriesOptions): ContextMenuEntry[];
|
|
105
|
+
/** Run an entry; errors from `run` (sync or async) are logged, never thrown. Disabled entries and separators do nothing. */
|
|
106
|
+
export declare function runContextMenuEntry(entry: ContextMenuEntry, ctx: ContextMenuContext): void;
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas context menu model.
|
|
3
|
+
*
|
|
4
|
+
* Pure (no Svelte, no DOM): builds the entries for a right-click or keyboard
|
|
5
|
+
* menu on the editor canvas, lets the consumer's `contextMenu.items` have the
|
|
6
|
+
* last word, and runs an entry without letting a consumer bug break the
|
|
7
|
+
* canvas. The component (`CanvasContextMenu.svelte`) and the editor wiring
|
|
8
|
+
* live elsewhere; the built-in entries go through the same path as consumer
|
|
9
|
+
* ones, so there is one way to add an item.
|
|
10
|
+
*
|
|
11
|
+
* @module editor/contextMenu
|
|
12
|
+
*/
|
|
13
|
+
import { defaultMessages } from '../messages/defaults.js';
|
|
14
|
+
import { logger } from '../utils/logger.js';
|
|
15
|
+
/**
|
|
16
|
+
* The first node type that is the caption: `type === 'caption'`, or
|
|
17
|
+
* `supportedTypes` includes `'caption'`. Undefined when the backend has none,
|
|
18
|
+
* in which case there is no "Add caption" entry.
|
|
19
|
+
*/
|
|
20
|
+
export function findCaptionMetadata(nodeTypes) {
|
|
21
|
+
return nodeTypes.find((meta) => meta.type === 'caption' || (meta.supportedTypes ?? []).includes('caption'));
|
|
22
|
+
}
|
|
23
|
+
/** Type guard: separator entry. */
|
|
24
|
+
export function isSeparator(entry) {
|
|
25
|
+
return 'separator' in entry && entry.separator === true;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The built-in entries for a menu: node -> Configure (or Edit text for a node
|
|
29
|
+
* that edits in place), separator, Delete; selection (2+ nodes) -> Delete n
|
|
30
|
+
* nodes; pane -> Add caption when the node types include a caption, else none.
|
|
31
|
+
*
|
|
32
|
+
* @param messages - the `contextMenu` message branch (`m().contextMenu` in a component)
|
|
33
|
+
* @param options - facts the context does not carry (see `DefaultEntriesOptions`)
|
|
34
|
+
*/
|
|
35
|
+
export function buildDefaultContextMenuEntries(ctx, messages = defaultMessages.contextMenu, options = {}) {
|
|
36
|
+
if (ctx.target === 'pane') {
|
|
37
|
+
const caption = findCaptionMetadata(ctx.nodeTypes);
|
|
38
|
+
if (!caption)
|
|
39
|
+
return [];
|
|
40
|
+
return [
|
|
41
|
+
{
|
|
42
|
+
id: 'add-caption',
|
|
43
|
+
label: messages.addCaption,
|
|
44
|
+
run: (c) => {
|
|
45
|
+
c.actions.addNode(caption, c.position, { edit: true });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
if (ctx.target === 'node' && ctx.nodes.length === 1) {
|
|
51
|
+
const first = options.editsInPlace?.(ctx.nodes[0])
|
|
52
|
+
? {
|
|
53
|
+
id: 'edit-text',
|
|
54
|
+
label: messages.editText,
|
|
55
|
+
shortcut: messages.shortcutEnter,
|
|
56
|
+
run: (c) => c.actions.editInPlace(c.nodes[0].id)
|
|
57
|
+
}
|
|
58
|
+
: {
|
|
59
|
+
id: 'configure',
|
|
60
|
+
label: messages.configure,
|
|
61
|
+
shortcut: messages.shortcutEnter,
|
|
62
|
+
run: (c) => c.actions.openConfig(c.nodes[0].id)
|
|
63
|
+
};
|
|
64
|
+
return [
|
|
65
|
+
first,
|
|
66
|
+
{ id: 'separator-node', separator: true },
|
|
67
|
+
{
|
|
68
|
+
id: 'delete',
|
|
69
|
+
label: messages.delete,
|
|
70
|
+
shortcut: messages.shortcutDelete,
|
|
71
|
+
run: (c) => c.actions.deleteNodes(c.nodes.map((n) => n.id))
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
if (ctx.target === 'selection' && ctx.nodes.length > 1) {
|
|
76
|
+
return [
|
|
77
|
+
{
|
|
78
|
+
id: 'delete',
|
|
79
|
+
label: messages.deleteNodes({ n: ctx.nodes.length }),
|
|
80
|
+
shortcut: messages.shortcutDelete,
|
|
81
|
+
run: (c) => c.actions.deleteNodes(c.nodes.map((n) => n.id))
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
/** Drop leading, trailing and doubled separators. */
|
|
88
|
+
export function cleanSeparators(entries) {
|
|
89
|
+
const out = [];
|
|
90
|
+
for (const entry of entries) {
|
|
91
|
+
if (isSeparator(entry) && (out.length === 0 || isSeparator(out[out.length - 1])))
|
|
92
|
+
continue;
|
|
93
|
+
out.push(entry);
|
|
94
|
+
}
|
|
95
|
+
while (out.length > 0 && isSeparator(out[out.length - 1]))
|
|
96
|
+
out.pop();
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Build the final entries: defaults, then the consumer's `items`, then
|
|
101
|
+
* separator clean-up. A consumer error never reaches the canvas.
|
|
102
|
+
*/
|
|
103
|
+
export function resolveContextMenuEntries(ctx, options, messages = defaultMessages.contextMenu, defaultsOptions = {}) {
|
|
104
|
+
const defaults = buildDefaultContextMenuEntries(ctx, messages, defaultsOptions);
|
|
105
|
+
const items = options?.items;
|
|
106
|
+
if (!items)
|
|
107
|
+
return cleanSeparators(defaults);
|
|
108
|
+
try {
|
|
109
|
+
const result = items(ctx, defaults);
|
|
110
|
+
if (!Array.isArray(result)) {
|
|
111
|
+
logger.error('contextMenu.items must return an array; using the default entries.');
|
|
112
|
+
return cleanSeparators(defaults);
|
|
113
|
+
}
|
|
114
|
+
return cleanSeparators(result);
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
logger.error('contextMenu.items threw; using the default entries.', error);
|
|
118
|
+
return cleanSeparators(defaults);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Run an entry; errors from `run` (sync or async) are logged, never thrown. Disabled entries and separators do nothing. */
|
|
122
|
+
export function runContextMenuEntry(entry, ctx) {
|
|
123
|
+
if (isSeparator(entry) || entry.disabled)
|
|
124
|
+
return;
|
|
125
|
+
try {
|
|
126
|
+
const result = entry.run(ctx);
|
|
127
|
+
if (result instanceof Promise) {
|
|
128
|
+
result.catch((error) => logger.error(`Context menu entry "${entry.id}" failed.`, error));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
logger.error(`Context menu entry "${entry.id}" failed.`, error);
|
|
133
|
+
}
|
|
134
|
+
}
|
package/dist/editor/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export { default as WorkflowNodeComponent } from '../components/nodes/WorkflowNo
|
|
|
42
42
|
export { default as SimpleNode } from '../components/nodes/SimpleNode.svelte';
|
|
43
43
|
export { default as ToolNode } from '../components/nodes/ToolNode.svelte';
|
|
44
44
|
export { default as NotesNode } from '../components/nodes/NotesNode.svelte';
|
|
45
|
+
export { default as CaptionNode } from '../components/nodes/CaptionNode.svelte';
|
|
45
46
|
export { default as GatewayNode } from '../components/nodes/GatewayNode.svelte';
|
|
46
47
|
export { default as SquareNode } from '../components/nodes/SquareNode.svelte';
|
|
47
48
|
export { default as TerminalNode } from '../components/nodes/TerminalNode.svelte';
|
|
@@ -96,4 +97,5 @@ export type { FlowDropEventHandlers, FlowDropFeatures, WorkflowChangeType } from
|
|
|
96
97
|
export type { EndpointConfig } from '../config/endpoints.js';
|
|
97
98
|
export type { UIAction } from '../commands/types.js';
|
|
98
99
|
export type { FlowDropMountOptions, MountedFlowDropApp, NavbarAction } from '../svelte-app.js';
|
|
100
|
+
export type { ContextMenuActions, ContextMenuContext, ContextMenuEntry, ContextMenuOptions, ContextMenuTarget } from './contextMenu.js';
|
|
99
101
|
export type { NodeComponentProps, NodeComponentRegistration, FlowDropPluginConfig, PluginNodeDefinition } from '../registry/index.js';
|
package/dist/editor/index.js
CHANGED
|
@@ -48,6 +48,7 @@ export { default as WorkflowNodeComponent } from '../components/nodes/WorkflowNo
|
|
|
48
48
|
export { default as SimpleNode } from '../components/nodes/SimpleNode.svelte';
|
|
49
49
|
export { default as ToolNode } from '../components/nodes/ToolNode.svelte';
|
|
50
50
|
export { default as NotesNode } from '../components/nodes/NotesNode.svelte';
|
|
51
|
+
export { default as CaptionNode } from '../components/nodes/CaptionNode.svelte';
|
|
51
52
|
export { default as GatewayNode } from '../components/nodes/GatewayNode.svelte';
|
|
52
53
|
export { default as SquareNode } from '../components/nodes/SquareNode.svelte';
|
|
53
54
|
export { default as TerminalNode } from '../components/nodes/TerminalNode.svelte';
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { default as App } from './components/App.svelte';
|
|
|
30
30
|
export { mountFlowDropApp, unmountFlowDropApp } from './svelte-app.js';
|
|
31
31
|
export { createFlowDropInstance } from './stores/instanceContainer.svelte.js';
|
|
32
32
|
export { getInstance, provideInstance } from './stores/getInstance.svelte.js';
|
|
33
|
-
export { createEndpointConfig, defaultEndpointConfig } from './config/endpoints.js';
|
|
33
|
+
export { createEndpointConfig, defaultEndpointConfig, sessionsEndpoints } from './config/endpoints.js';
|
|
34
34
|
export { NoAuthProvider, StaticAuthProvider, CallbackAuthProvider } from './types/auth.js';
|
|
35
35
|
export type { Workflow, WorkflowNode, WorkflowEdge, NodeMetadata, ConfigSchema } from './types/index.js';
|
|
36
36
|
export type { EndpointConfig } from './config/endpoints.js';
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,6 @@ export { mountFlowDropApp, unmountFlowDropApp } from './svelte-app.js';
|
|
|
36
36
|
export { createFlowDropInstance } from './stores/instanceContainer.svelte.js';
|
|
37
37
|
export { getInstance, provideInstance } from './stores/getInstance.svelte.js';
|
|
38
38
|
// Endpoint configuration helpers.
|
|
39
|
-
export { createEndpointConfig, defaultEndpointConfig } from './config/endpoints.js';
|
|
39
|
+
export { createEndpointConfig, defaultEndpointConfig, sessionsEndpoints } from './config/endpoints.js';
|
|
40
40
|
// Authentication providers.
|
|
41
41
|
export { NoAuthProvider, StaticAuthProvider, CallbackAuthProvider } from './types/auth.js';
|
|
@@ -231,6 +231,18 @@ export declare const defaultMessages: {
|
|
|
231
231
|
readonly chat: "AI Assistant";
|
|
232
232
|
};
|
|
233
233
|
};
|
|
234
|
+
readonly contextMenu: {
|
|
235
|
+
readonly menuLabel: "Canvas actions";
|
|
236
|
+
readonly configure: "Configure";
|
|
237
|
+
readonly delete: "Delete";
|
|
238
|
+
readonly deleteNodes: ({ n }: {
|
|
239
|
+
n: number;
|
|
240
|
+
}) => string;
|
|
241
|
+
readonly addCaption: "Add caption";
|
|
242
|
+
readonly editText: "Edit text";
|
|
243
|
+
readonly shortcutEnter: "Enter";
|
|
244
|
+
readonly shortcutDelete: "Delete";
|
|
245
|
+
};
|
|
234
246
|
readonly layout: {
|
|
235
247
|
readonly componentsSidebar: "Components sidebar";
|
|
236
248
|
readonly workflowCanvas: "Workflow canvas";
|
|
@@ -321,6 +333,12 @@ export declare const defaultMessages: {
|
|
|
321
333
|
readonly placeholder: "Type your message...";
|
|
322
334
|
readonly predefinedRun: "Run workflow";
|
|
323
335
|
};
|
|
336
|
+
readonly inputForm: {
|
|
337
|
+
readonly title: "Workflow inputs";
|
|
338
|
+
readonly missingRequired: ({ names }: {
|
|
339
|
+
names: string;
|
|
340
|
+
}) => string;
|
|
341
|
+
};
|
|
324
342
|
readonly states: {
|
|
325
343
|
readonly newSessionTitle: "New session";
|
|
326
344
|
readonly newSessionText: "Test your flow with a prompt";
|
|
@@ -440,6 +458,21 @@ export declare const defaultMessages: {
|
|
|
440
458
|
readonly log: "Log";
|
|
441
459
|
readonly message: "Message";
|
|
442
460
|
};
|
|
461
|
+
readonly origins: {
|
|
462
|
+
readonly user: "User";
|
|
463
|
+
readonly workflow: "Workflow";
|
|
464
|
+
readonly engine: "Engine";
|
|
465
|
+
readonly playground: "Playground";
|
|
466
|
+
readonly interrupt: "Interrupt";
|
|
467
|
+
readonly postedBy: ({ origin }: {
|
|
468
|
+
origin: string;
|
|
469
|
+
}) => string;
|
|
470
|
+
};
|
|
471
|
+
readonly logGroup: {
|
|
472
|
+
readonly summary: ({ count }: {
|
|
473
|
+
count: number;
|
|
474
|
+
}) => string;
|
|
475
|
+
};
|
|
443
476
|
readonly messageTooltips: {
|
|
444
477
|
readonly nodeId: ({ id }: {
|
|
445
478
|
id: string;
|
|
@@ -508,6 +541,10 @@ export declare const defaultMessages: {
|
|
|
508
541
|
readonly errorOccurred: "Error occurred";
|
|
509
542
|
readonly configure: "Configure note";
|
|
510
543
|
};
|
|
544
|
+
readonly caption: {
|
|
545
|
+
readonly placeholder: "Caption";
|
|
546
|
+
readonly editLabel: "Caption text";
|
|
547
|
+
};
|
|
511
548
|
readonly graph: {
|
|
512
549
|
readonly workflowNode: ({ name }: {
|
|
513
550
|
name: string;
|
|
@@ -605,6 +642,32 @@ export declare const defaultMessages: {
|
|
|
605
642
|
id: string;
|
|
606
643
|
}) => string;
|
|
607
644
|
readonly metaDisclosure: "Server metadata (read-only)";
|
|
645
|
+
readonly turnLabel: "Chat turn";
|
|
646
|
+
readonly turnNone: "None";
|
|
647
|
+
readonly turns: {
|
|
648
|
+
readonly message: "User message";
|
|
649
|
+
readonly history: "History";
|
|
650
|
+
readonly session_id: "Session ID";
|
|
651
|
+
readonly message_id: "Message ID";
|
|
652
|
+
readonly reply: "Reply";
|
|
653
|
+
};
|
|
654
|
+
readonly turnDescriptions: {
|
|
655
|
+
readonly message: "Receives the person's chat message";
|
|
656
|
+
readonly history: "Receives recent user and assistant messages from the session";
|
|
657
|
+
readonly session_id: "Receives the session's ID";
|
|
658
|
+
readonly message_id: "Receives the ID of the person's message";
|
|
659
|
+
readonly reply: "Text the session saves as the assistant's answer";
|
|
660
|
+
};
|
|
661
|
+
readonly turnUnknown: ({ value }: {
|
|
662
|
+
value: string;
|
|
663
|
+
}) => string;
|
|
664
|
+
readonly turnTakenInline: ({ id }: {
|
|
665
|
+
id: string;
|
|
666
|
+
}) => string;
|
|
667
|
+
readonly historyLimitLabel: "Messages to include";
|
|
668
|
+
readonly historyLimitPlaceholder: ({ limit }: {
|
|
669
|
+
limit: number;
|
|
670
|
+
}) => string;
|
|
608
671
|
readonly composerTitleInput: "New input";
|
|
609
672
|
readonly composerTitleOutput: "New output";
|
|
610
673
|
readonly composerStep: ({ step, total }: {
|
|
@@ -211,6 +211,18 @@ export const defaultMessages = {
|
|
|
211
211
|
chat: 'AI Assistant'
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
|
+
contextMenu: {
|
|
215
|
+
// aria-label of the canvas context menu.
|
|
216
|
+
menuLabel: 'Canvas actions',
|
|
217
|
+
configure: 'Configure',
|
|
218
|
+
delete: 'Delete',
|
|
219
|
+
deleteNodes: ({ n }) => `Delete ${n} node${n !== 1 ? 's' : ''}`,
|
|
220
|
+
addCaption: 'Add caption',
|
|
221
|
+
editText: 'Edit text',
|
|
222
|
+
// Key hints shown beside an entry; plain words so they read on any platform.
|
|
223
|
+
shortcutEnter: 'Enter',
|
|
224
|
+
shortcutDelete: 'Delete'
|
|
225
|
+
},
|
|
214
226
|
layout: {
|
|
215
227
|
// Sidebar/main-region landmarks.
|
|
216
228
|
componentsSidebar: 'Components sidebar',
|
|
@@ -279,6 +291,12 @@ export const defaultMessages = {
|
|
|
279
291
|
placeholder: 'Type your message...',
|
|
280
292
|
predefinedRun: 'Run workflow'
|
|
281
293
|
},
|
|
294
|
+
// The form a workflow's interface inputs render as (inputs without a chat
|
|
295
|
+
// turn; the session fills the others).
|
|
296
|
+
inputForm: {
|
|
297
|
+
title: 'Workflow inputs',
|
|
298
|
+
missingRequired: ({ names }) => `Fill in the required inputs: ${names}`
|
|
299
|
+
},
|
|
282
300
|
states: {
|
|
283
301
|
newSessionTitle: 'New session',
|
|
284
302
|
newSessionText: 'Test your flow with a prompt',
|
|
@@ -358,6 +376,20 @@ export const defaultMessages = {
|
|
|
358
376
|
log: 'Log',
|
|
359
377
|
message: 'Message'
|
|
360
378
|
},
|
|
379
|
+
// Badges for messages posted by a component other than the person or
|
|
380
|
+
// the workflow (the message `origin`). user/workflow are never badged.
|
|
381
|
+
origins: {
|
|
382
|
+
user: 'User',
|
|
383
|
+
workflow: 'Workflow',
|
|
384
|
+
engine: 'Engine',
|
|
385
|
+
playground: 'Playground',
|
|
386
|
+
interrupt: 'Interrupt',
|
|
387
|
+
postedBy: ({ origin }) => `Posted by: ${origin}`
|
|
388
|
+
},
|
|
389
|
+
// Collapsible run of adjacent log lines.
|
|
390
|
+
logGroup: {
|
|
391
|
+
summary: ({ count }) => `${count} log lines`
|
|
392
|
+
},
|
|
361
393
|
messageTooltips: {
|
|
362
394
|
nodeId: ({ id }) => `Node ID: ${id}`,
|
|
363
395
|
executionDuration: 'Execution duration'
|
|
@@ -420,6 +452,12 @@ export const defaultMessages = {
|
|
|
420
452
|
errorOccurred: 'Error occurred',
|
|
421
453
|
configure: 'Configure note'
|
|
422
454
|
},
|
|
455
|
+
caption: {
|
|
456
|
+
// Shown (dimmed) in an empty caption while it is being typed.
|
|
457
|
+
placeholder: 'Caption',
|
|
458
|
+
// aria-label of the text box while a caption is edited in place.
|
|
459
|
+
editLabel: 'Caption text'
|
|
460
|
+
},
|
|
423
461
|
// SvelteFlow node aria-labels — every visible node and port needs a
|
|
424
462
|
// landmark. The `name`/`title` parameter is the rendered display
|
|
425
463
|
// string (already localised by the workflow author or fallback).
|
|
@@ -493,6 +531,27 @@ export const defaultMessages = {
|
|
|
493
531
|
moveUp: ({ id }) => `Move "${id}" up`,
|
|
494
532
|
moveDown: ({ id }) => `Move "${id}" down`,
|
|
495
533
|
metaDisclosure: 'Server metadata (read-only)',
|
|
534
|
+
// The Chat turn selector: what a port is for in a chat turn (`turn`).
|
|
535
|
+
turnLabel: 'Chat turn',
|
|
536
|
+
turnNone: 'None',
|
|
537
|
+
turns: {
|
|
538
|
+
message: 'User message',
|
|
539
|
+
history: 'History',
|
|
540
|
+
session_id: 'Session ID',
|
|
541
|
+
message_id: 'Message ID',
|
|
542
|
+
reply: 'Reply'
|
|
543
|
+
},
|
|
544
|
+
turnDescriptions: {
|
|
545
|
+
message: "Receives the person's chat message",
|
|
546
|
+
history: 'Receives recent user and assistant messages from the session',
|
|
547
|
+
session_id: "Receives the session's ID",
|
|
548
|
+
message_id: "Receives the ID of the person's message",
|
|
549
|
+
reply: "Text the session saves as the assistant's answer"
|
|
550
|
+
},
|
|
551
|
+
turnUnknown: ({ value }) => `${value} (not known to this editor)`,
|
|
552
|
+
turnTakenInline: ({ id }) => `Input "${id}" already has this chat turn. A workflow takes one input per turn value.`,
|
|
553
|
+
historyLimitLabel: 'Messages to include',
|
|
554
|
+
historyLimitPlaceholder: ({ limit }) => `${limit} (default)`,
|
|
496
555
|
// The inline composer that opens from "Add input" / "Add output".
|
|
497
556
|
composerTitleInput: 'New input',
|
|
498
557
|
composerTitleOutput: 'New output',
|