@flowdrop/flowdrop 2.5.0 → 2.7.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/chat/commandClassifier.d.ts +19 -1
  3. package/dist/chat/commandClassifier.js +33 -1
  4. package/dist/chat/index.d.ts +1 -1
  5. package/dist/chat/index.js +1 -1
  6. package/dist/commands/executor.js +270 -37
  7. package/dist/commands/index.d.ts +1 -1
  8. package/dist/commands/parser.js +20 -0
  9. package/dist/commands/types.d.ts +77 -12
  10. package/dist/components/App.svelte +8 -0
  11. package/dist/components/BindablePortListbox.svelte +426 -0
  12. package/dist/components/BindablePortListbox.svelte.d.ts +23 -0
  13. package/dist/components/WorkflowInterfaceEditor.svelte +142 -36
  14. package/dist/components/WorkflowInterfaceEditor.svelte.d.ts +8 -0
  15. package/dist/components/WorkflowInterfaceEntryCard.svelte +537 -294
  16. package/dist/components/WorkflowInterfaceEntryCard.svelte.d.ts +6 -3
  17. package/dist/components/WorkflowInterfaceEntryComposer.svelte +331 -0
  18. package/dist/components/WorkflowInterfaceEntryComposer.svelte.d.ts +19 -0
  19. package/dist/components/console/CommandConsole.svelte +8 -0
  20. package/dist/components/console/formatters.d.ts +9 -1
  21. package/dist/components/console/formatters.js +54 -0
  22. package/dist/core/index.d.ts +1 -1
  23. package/dist/messages/context.d.ts +6 -0
  24. package/dist/messages/context.js +8 -0
  25. package/dist/messages/defaults.d.ts +78 -2
  26. package/dist/messages/defaults.js +50 -3
  27. package/dist/messages/index.d.ts +1 -1
  28. package/dist/messages/index.js +1 -1
  29. package/dist/services/globalSave.d.ts +7 -1
  30. package/dist/services/globalSave.js +17 -3
  31. package/dist/stores/instanceContainer.svelte.d.ts +26 -0
  32. package/dist/stores/instanceContainer.svelte.js +24 -0
  33. package/dist/stores/workflowStore.svelte.d.ts +10 -0
  34. package/dist/stores/workflowStore.svelte.js +15 -0
  35. package/dist/stories/WebMCPFakeAgent.svelte +229 -0
  36. package/dist/stories/WebMCPFakeAgent.svelte.d.ts +10 -0
  37. package/dist/styles/base.css +4 -2
  38. package/dist/styles/tokens.css +6 -0
  39. package/dist/svelte-app.d.ts +24 -2
  40. package/dist/svelte-app.js +65 -3
  41. package/dist/types/index.d.ts +49 -0
  42. package/dist/utils/focus.d.ts +18 -0
  43. package/dist/utils/focus.js +24 -0
  44. package/dist/utils/whenWorkflowLoaded.svelte.d.ts +17 -0
  45. package/dist/utils/whenWorkflowLoaded.svelte.js +42 -0
  46. package/dist/utils/workflowInterface.d.ts +47 -3
  47. package/dist/utils/workflowInterface.js +84 -9
  48. package/dist/webmcp/WebMCP.stories.svelte +101 -0
  49. package/dist/webmcp/WebMCP.stories.svelte.d.ts +18 -0
  50. package/dist/webmcp/WebMCPConfirm.svelte +216 -0
  51. package/dist/webmcp/WebMCPConfirm.svelte.d.ts +21 -0
  52. package/dist/webmcp/bridge.d.ts +63 -0
  53. package/dist/webmcp/bridge.js +106 -0
  54. package/dist/webmcp/descriptors.d.ts +59 -0
  55. package/dist/webmcp/descriptors.js +504 -0
  56. package/dist/webmcp/fake.d.ts +23 -0
  57. package/dist/webmcp/fake.js +42 -0
  58. package/dist/webmcp/gate.d.ts +76 -0
  59. package/dist/webmcp/gate.js +188 -0
  60. package/dist/webmcp/index.d.ts +36 -0
  61. package/dist/webmcp/index.js +32 -0
  62. package/dist/webmcp/register.d.ts +33 -0
  63. package/dist/webmcp/register.js +504 -0
  64. package/dist/webmcp/types.d.ts +268 -0
  65. package/dist/webmcp/types.js +23 -0
  66. package/dist/webmcp/validate.d.ts +32 -0
  67. package/dist/webmcp/validate.js +118 -0
  68. package/package.json +6 -1
@@ -1,13 +1,16 @@
1
1
  import type { PortDataTypeConfig, WorkflowInterfaceEntry } from '../types/index.js';
2
- import { type BindablePort, type InterfaceIssue, type ResolvedInterfaceEntry } from '../utils/workflowInterface.js';
2
+ import type { PortCompatibilityChecker } from '../utils/connections.js';
3
+ import { type RankedBindablePort, type InterfaceIssue, type ResolvedInterfaceEntry } from '../utils/workflowInterface.js';
3
4
  interface Props {
4
5
  entry: WorkflowInterfaceEntry;
5
6
  direction: 'inputs' | 'outputs';
6
7
  status: ResolvedInterfaceEntry | undefined;
7
- /** Candidate ports for this direction, for the binding picker. */
8
- candidates: BindablePort[];
8
+ /** Candidate ports for this direction, ranked, for the binding picker. */
9
+ candidates: RankedBindablePort[];
9
10
  /** The authoring vocabulary offered by the dataType picker. */
10
11
  dataTypes: PortDataTypeConfig[];
12
+ /** The instance's checker — shape symbol and lane colour of the bound port. */
13
+ checker: PortCompatibilityChecker;
11
14
  /** The issues this card explains in its footer. */
12
15
  footerIssues: InterfaceIssue[];
13
16
  /** Input side only: the bound port already receives another edge. */
@@ -0,0 +1,331 @@
1
+ <!--
2
+ WorkflowInterfaceEntryComposer
3
+
4
+ The inline form that opens from "Add input" / "Add output" in
5
+ `WorkflowInterfaceEditor`. Two steps, deliberately small:
6
+
7
+ 1. "Bind it to an existing port?" — yes takes the author to a port picker;
8
+ no adds an empty entry straight away (the pre-composer behaviour).
9
+ 2. The picker: a custom listbox over `rankBindablePorts`, ports nothing is
10
+ using yet first, then the connected or already-published ones, each row
11
+ carrying the metadata a native <select> cannot show — type, node › port,
12
+ description, and why a port sits in the second group.
13
+
14
+ Stateless towards the workflow: it reports the author's choice through
15
+ `onBind` / `onCustom` / `onCancel` and the editor builds the entry.
16
+ -->
17
+
18
+ <script lang="ts">
19
+ import Icon from '@iconify/svelte';
20
+ import Button from './Button.svelte';
21
+ import IconButton from './IconButton.svelte';
22
+ import { m } from '../messages/index.js';
23
+ import type { RankedBindablePort } from '../utils/workflowInterface.js';
24
+ import BindablePortListbox from './BindablePortListbox.svelte';
25
+ import type { PortCompatibilityChecker } from '../utils/connections.js';
26
+ import { focusOnMount } from '../utils/focus.js';
27
+
28
+ interface Props {
29
+ direction: 'inputs' | 'outputs';
30
+ /** From `rankBindablePorts` — already ordered free-first. */
31
+ candidates: RankedBindablePort[];
32
+ /**
33
+ * The instance's port-compatibility checker — the source of each row's
34
+ * shape symbol and lane chip, so a candidate reads exactly as its port does
35
+ * on the canvas.
36
+ */
37
+ checker: PortCompatibilityChecker;
38
+ onBind: (candidate: RankedBindablePort) => void;
39
+ onCustom: () => void;
40
+ onCancel: () => void;
41
+ }
42
+
43
+ const { direction, candidates, checker, onBind, onCustom, onCancel }: Props = $props();
44
+
45
+ const isInput = $derived(direction === 'inputs');
46
+
47
+ let mode = $state<'choose' | 'bind'>('choose');
48
+ let selected = $state<RankedBindablePort | undefined>(undefined);
49
+
50
+ function confirm(candidate: RankedBindablePort | undefined = selected): void {
51
+ if (candidate) onBind(candidate);
52
+ }
53
+
54
+ function handleChoiceKeydown(event: KeyboardEvent): void {
55
+ if (event.key === 'Escape') {
56
+ event.preventDefault();
57
+ onCancel();
58
+ }
59
+ }
60
+ </script>
61
+
62
+ <div
63
+ class="wf-composer"
64
+ role="group"
65
+ aria-label={isInput
66
+ ? m().workflowInterface.composerTitleInput
67
+ : m().workflowInterface.composerTitleOutput}
68
+ >
69
+ <div class="wf-composer__header">
70
+ <div class="wf-composer__heading">
71
+ <span class="wf-composer__icon">
72
+ <Icon icon="heroicons:sparkles" />
73
+ </span>
74
+ <div class="wf-composer__heading-text">
75
+ <span class="wf-composer__title">
76
+ {isInput
77
+ ? m().workflowInterface.composerTitleInput
78
+ : m().workflowInterface.composerTitleOutput}
79
+ </span>
80
+ <span class="wf-composer__step">
81
+ {m().workflowInterface.composerStep({ step: mode === 'choose' ? 1 : 2, total: 2 })}
82
+ </span>
83
+ </div>
84
+ </div>
85
+ <IconButton
86
+ size="sm"
87
+ class="wf-composer__close"
88
+ ariaLabel={m().workflowInterface.composerClose}
89
+ onclick={onCancel}
90
+ >
91
+ <Icon icon="heroicons:x-mark" />
92
+ </IconButton>
93
+ </div>
94
+
95
+ {#if mode === 'choose'}
96
+ <p class="wf-composer__question">{m().workflowInterface.composerQuestion}</p>
97
+ <div
98
+ class="wf-composer__choices"
99
+ role="group"
100
+ aria-label={m().workflowInterface.composerQuestion}
101
+ >
102
+ <button
103
+ type="button"
104
+ class="wf-composer__choice"
105
+ {@attach focusOnMount()}
106
+ onclick={() => (mode = 'bind')}
107
+ onkeydown={handleChoiceKeydown}
108
+ >
109
+ <span class="wf-composer__choice-icon">
110
+ <Icon icon="heroicons:link" />
111
+ </span>
112
+ <span class="wf-composer__choice-text">
113
+ <span class="wf-composer__choice-title">{m().workflowInterface.composerBindYes}</span>
114
+ <span class="wf-composer__choice-hint">{m().workflowInterface.composerBindYesHint}</span>
115
+ </span>
116
+ <Icon icon="heroicons:chevron-right" class="wf-composer__choice-arrow" />
117
+ </button>
118
+ <button
119
+ type="button"
120
+ class="wf-composer__choice"
121
+ onclick={onCustom}
122
+ onkeydown={handleChoiceKeydown}
123
+ >
124
+ <span class="wf-composer__choice-icon">
125
+ <Icon icon="heroicons:pencil-square" />
126
+ </span>
127
+ <span class="wf-composer__choice-text">
128
+ <span class="wf-composer__choice-title">{m().workflowInterface.composerBindNo}</span>
129
+ <span class="wf-composer__choice-hint">{m().workflowInterface.composerBindNoHint}</span>
130
+ </span>
131
+ <Icon icon="heroicons:plus" class="wf-composer__choice-arrow" />
132
+ </button>
133
+ </div>
134
+ {:else}
135
+ <BindablePortListbox
136
+ {direction}
137
+ {candidates}
138
+ {checker}
139
+ idPrefix="wf-composer-option-{direction}"
140
+ autofocus
141
+ onHighlight={(candidate) => (selected = candidate)}
142
+ onConfirm={(candidate) => confirm(candidate)}
143
+ {onCancel}
144
+ />
145
+
146
+ <div class="wf-composer__actions">
147
+ <Button variant="ghost" size="sm" onclick={() => (mode = 'choose')}>
148
+ <Icon icon="heroicons:arrow-left" />
149
+ {m().workflowInterface.composerBack}
150
+ </Button>
151
+ <span class="wf-composer__actions-spacer"></span>
152
+ <Button variant="ghost" size="sm" onclick={onCancel}>
153
+ {m().workflowInterface.composerCancel}
154
+ </Button>
155
+ <Button variant="primary" size="sm" disabled={!selected} onclick={() => confirm()}>
156
+ <Icon icon="heroicons:plus" />
157
+ {isInput ? m().workflowInterface.addInput : m().workflowInterface.addOutput}
158
+ </Button>
159
+ </div>
160
+ {/if}
161
+ </div>
162
+
163
+ <style>
164
+ /*
165
+ A draft object, visibly not yet one of the cards below it: a dashed
166
+ primary edge on a faintly primary-tinted surface, its own small header
167
+ with a step counter, and its own close. Everything else — inputs,
168
+ buttons, badges — is the shared control system.
169
+ */
170
+ .wf-composer {
171
+ display: flex;
172
+ flex-direction: column;
173
+ gap: var(--fd-space-sm);
174
+ padding: var(--fd-space-sm);
175
+ border: 1px dashed color-mix(in srgb, var(--fd-primary) 55%, var(--fd-border));
176
+ border-radius: var(--fd-radius-lg);
177
+ background-color: color-mix(in srgb, var(--fd-primary) 4%, var(--fd-card));
178
+ box-shadow: var(--fd-shadow-sm);
179
+ }
180
+
181
+ .wf-composer__header {
182
+ display: flex;
183
+ align-items: flex-start;
184
+ justify-content: space-between;
185
+ gap: var(--fd-space-sm);
186
+ }
187
+
188
+ .wf-composer__heading {
189
+ display: flex;
190
+ align-items: center;
191
+ gap: var(--fd-space-xs);
192
+ min-width: 0;
193
+ }
194
+
195
+ .wf-composer__icon {
196
+ display: inline-flex;
197
+ align-items: center;
198
+ justify-content: center;
199
+ width: 1.75rem;
200
+ height: 1.75rem;
201
+ border-radius: var(--fd-radius-md);
202
+ background-color: var(--fd-primary-muted);
203
+ color: var(--fd-primary);
204
+ font-size: 0.9375rem;
205
+ flex-shrink: 0;
206
+ }
207
+
208
+ .wf-composer__heading-text {
209
+ display: flex;
210
+ flex-direction: column;
211
+ min-width: 0;
212
+ }
213
+
214
+ .wf-composer__title {
215
+ font-size: var(--fd-text-sm);
216
+ font-weight: 600;
217
+ line-height: 1.3;
218
+ color: var(--fd-foreground);
219
+ }
220
+
221
+ .wf-composer__step {
222
+ font-size: var(--fd-text-2xs);
223
+ font-weight: 500;
224
+ letter-spacing: 0.04em;
225
+ text-transform: uppercase;
226
+ color: var(--fd-primary);
227
+ }
228
+
229
+ .wf-composer :global(.wf-composer__close) {
230
+ flex-shrink: 0;
231
+ }
232
+
233
+ .wf-composer__question {
234
+ margin: 0;
235
+ font-size: 0.8125rem;
236
+ font-weight: 600;
237
+ letter-spacing: -0.01em;
238
+ color: var(--fd-foreground);
239
+ }
240
+
241
+ .wf-composer__choices {
242
+ display: flex;
243
+ flex-direction: column;
244
+ gap: var(--fd-space-xs);
245
+ }
246
+
247
+ .wf-composer__choice {
248
+ display: flex;
249
+ align-items: center;
250
+ gap: var(--fd-space-sm);
251
+ width: 100%;
252
+ padding: var(--fd-space-xs) var(--fd-space-sm);
253
+ border: 1px solid var(--fd-border);
254
+ border-radius: var(--fd-radius-md);
255
+ background-color: var(--fd-card);
256
+ color: var(--fd-foreground);
257
+ text-align: left;
258
+ cursor: pointer;
259
+ transition:
260
+ border-color var(--fd-transition-fast),
261
+ background-color var(--fd-transition-fast),
262
+ box-shadow var(--fd-transition-fast);
263
+ }
264
+
265
+ .wf-composer__choice:hover {
266
+ border-color: var(--fd-primary);
267
+ background-color: var(--fd-primary-muted);
268
+ }
269
+
270
+ .wf-composer__choice:focus-visible {
271
+ outline: none;
272
+ border-color: var(--fd-primary);
273
+ box-shadow: 0 0 0 var(--fd-ring-width) var(--fd-primary-muted);
274
+ }
275
+
276
+ .wf-composer__choice-icon {
277
+ display: inline-flex;
278
+ align-items: center;
279
+ justify-content: center;
280
+ width: 1.75rem;
281
+ height: 1.75rem;
282
+ border-radius: var(--fd-radius-full);
283
+ background-color: var(--fd-muted);
284
+ color: var(--fd-muted-foreground);
285
+ font-size: 0.9375rem;
286
+ flex-shrink: 0;
287
+ transition:
288
+ background-color var(--fd-transition-fast),
289
+ color var(--fd-transition-fast);
290
+ }
291
+
292
+ .wf-composer__choice:hover .wf-composer__choice-icon {
293
+ background-color: var(--fd-card);
294
+ color: var(--fd-primary);
295
+ }
296
+
297
+ .wf-composer__choice-text {
298
+ display: flex;
299
+ flex-direction: column;
300
+ gap: 0.0625rem;
301
+ flex: 1;
302
+ min-width: 0;
303
+ }
304
+
305
+ .wf-composer__choice-title {
306
+ font-size: 0.8125rem;
307
+ font-weight: 600;
308
+ line-height: 1.35;
309
+ }
310
+
311
+ .wf-composer__choice-hint {
312
+ font-size: var(--fd-text-xs);
313
+ line-height: 1.45;
314
+ color: var(--fd-muted-foreground);
315
+ }
316
+
317
+ .wf-composer :global(.wf-composer__choice-arrow) {
318
+ flex-shrink: 0;
319
+ color: var(--fd-muted-foreground);
320
+ }
321
+
322
+ .wf-composer__actions {
323
+ display: flex;
324
+ align-items: center;
325
+ gap: var(--fd-space-xs);
326
+ }
327
+
328
+ .wf-composer__actions-spacer {
329
+ flex: 1;
330
+ }
331
+ </style>
@@ -0,0 +1,19 @@
1
+ import type { RankedBindablePort } from '../utils/workflowInterface.js';
2
+ import type { PortCompatibilityChecker } from '../utils/connections.js';
3
+ interface Props {
4
+ direction: 'inputs' | 'outputs';
5
+ /** From `rankBindablePorts` — already ordered free-first. */
6
+ candidates: RankedBindablePort[];
7
+ /**
8
+ * The instance's port-compatibility checker — the source of each row's
9
+ * shape symbol and lane chip, so a candidate reads exactly as its port does
10
+ * on the canvas.
11
+ */
12
+ checker: PortCompatibilityChecker;
13
+ onBind: (candidate: RankedBindablePort) => void;
14
+ onCustom: () => void;
15
+ onCancel: () => void;
16
+ }
17
+ declare const WorkflowInterfaceEntryComposer: import("svelte").Component<Props, {}, "">;
18
+ type WorkflowInterfaceEntryComposer = ReturnType<typeof WorkflowInterfaceEntryComposer>;
19
+ export default WorkflowInterfaceEntryComposer;
@@ -16,6 +16,8 @@
16
16
  type ListNodesResultData,
17
17
  type ListEdgesResultData,
18
18
  type ListTypesResultData,
19
+ type SearchTypesResultData,
20
+ type DescribeTypeResultData,
19
21
  type InfoResultData,
20
22
  type HelpResultData
21
23
  } from '../../commands/index.js';
@@ -29,6 +31,8 @@
29
31
  formatListNodes,
30
32
  formatListEdges,
31
33
  formatListTypes,
34
+ formatSearchTypes,
35
+ formatDescribeType,
32
36
  formatInfo,
33
37
  formatHelp
34
38
  } from './formatters.js';
@@ -65,6 +69,10 @@
65
69
  return formatListEdges(result.data as ListEdgesResultData);
66
70
  case 'list_types':
67
71
  return formatListTypes(result.data as ListTypesResultData);
72
+ case 'search_types':
73
+ return formatSearchTypes(result.data as SearchTypesResultData);
74
+ case 'describe_type':
75
+ return formatDescribeType(result.data as DescribeTypeResultData);
68
76
  case 'info':
69
77
  return formatInfo(result.data as InfoResultData);
70
78
  case 'help':
@@ -2,7 +2,7 @@
2
2
  * Pure formatting functions for rich command result display.
3
3
  * Converts CommandResult data into aligned table strings for console output.
4
4
  */
5
- import type { ListNodesResultData, ListEdgesResultData, ListTypesResultData, InfoResultData, HelpResultData } from '../../commands/types.js';
5
+ import type { ListNodesResultData, ListEdgesResultData, ListTypesResultData, SearchTypesResultData, DescribeTypeResultData, InfoResultData, HelpResultData } from '../../commands/types.js';
6
6
  /**
7
7
  * Formats list nodes result as an aligned table: ID, Label, Type.
8
8
  */
@@ -15,6 +15,14 @@ export declare function formatListEdges(data: ListEdgesResultData): string;
15
15
  * Formats list types result as a table: Type ID, Name, Category.
16
16
  */
17
17
  export declare function formatListTypes(data: ListTypesResultData): string;
18
+ /**
19
+ * Formats search types result: the same table as list types, or a hint.
20
+ */
21
+ export declare function formatSearchTypes(data: SearchTypesResultData): string;
22
+ /**
23
+ * Formats describe type result: header, ports and config schema sections.
24
+ */
25
+ export declare function formatDescribeType(data: DescribeTypeResultData): string;
18
26
  /**
19
27
  * Formats info result as structured output with header fields,
20
28
  * config section, ports section, and edges section.
@@ -51,6 +51,60 @@ export function formatListTypes(data) {
51
51
  const rows = data.types.map((t) => [t.typeId, t.name, t.category]);
52
52
  return formatTable(['Type ID', 'Name', 'Category'], rows);
53
53
  }
54
+ /**
55
+ * Formats search types result: the same table as list types, or a hint.
56
+ */
57
+ export function formatSearchTypes(data) {
58
+ if (data.types.length === 0) {
59
+ return `No node type matches "${data.query}"`;
60
+ }
61
+ return formatListTypes({ types: data.types });
62
+ }
63
+ /**
64
+ * Formats describe type result: header, ports and config schema sections.
65
+ */
66
+ export function formatDescribeType(data) {
67
+ const lines = [];
68
+ lines.push(`Type: ${data.typeId}`);
69
+ lines.push(`Name: ${data.name}`);
70
+ lines.push(`Category: ${data.category}`);
71
+ if (data.description)
72
+ lines.push(`Description: ${data.description}`);
73
+ if (data.tags && data.tags.length > 0)
74
+ lines.push(`Tags: ${data.tags.join(', ')}`);
75
+ if (data.confirmation)
76
+ lines.push(`Confirmation: ${data.confirmation.policy}`);
77
+ lines.push('');
78
+ lines.push('Inputs:');
79
+ if (data.inputs.length === 0)
80
+ lines.push(' (none)');
81
+ for (const p of data.inputs) {
82
+ lines.push(` ${p.portId} (${p.dataType})${p.required ? ' required' : ''}${p.description ? ` — ${p.description}` : ''}`);
83
+ }
84
+ lines.push('');
85
+ lines.push('Outputs:');
86
+ if (data.outputs.length === 0)
87
+ lines.push(' (none)');
88
+ for (const p of data.outputs) {
89
+ lines.push(` ${p.portId} (${p.dataType})${p.description ? ` — ${p.description}` : ''}`);
90
+ }
91
+ lines.push('');
92
+ lines.push('Config:');
93
+ if (data.config.length === 0)
94
+ lines.push(' (none)');
95
+ for (const c of data.config) {
96
+ const type = Array.isArray(c.type) ? c.type.join('|') : (c.type ?? 'any');
97
+ const parts = [` ${c.key} (${type})`];
98
+ if (c.required)
99
+ parts.push('required');
100
+ if (c.enum)
101
+ parts.push(`one of ${c.enum.map((v) => JSON.stringify(v)).join(', ')}`);
102
+ if (c.default !== undefined)
103
+ parts.push(`default ${JSON.stringify(c.default)}`);
104
+ lines.push(parts.join(' ') + (c.description ? ` — ${c.description}` : ''));
105
+ }
106
+ return lines.join('\n');
107
+ }
54
108
  /**
55
109
  * Formats info result as structured output with header fields,
56
110
  * config section, ports section, and edges section.
@@ -50,7 +50,7 @@ export { resolveScopeToKey, keyToScope, generateDefaultUISchema, collectReferenc
50
50
  export { DEFAULT_PORT_CONFIG } from '../config/defaultPortConfig.js';
51
51
  export { defaultEndpointConfig, createEndpointConfig } from '../config/endpoints.js';
52
52
  export { generateNodeId, extractConfigDefaults } from '../utils/nodeIds.js';
53
- export type { AddNodeCommand, DeleteNodeCommand, RenameNodeCommand, SetConfigCommand, GetConfigCommand, ConnectCommand, DisconnectPortsCommand, DisconnectNodeCommand, ListNodesCommand, ListEdgesCommand, ListTypesCommand, InfoCommand, UndoCommand, RedoCommand, ConfigOpenCommand, SelectNodeCommand, HelpCommand, ClearCommand, SwapNodeCommand, MoveNodeCommand, AutoLayoutCommand, Command, ParseResult, CommandErrorCode, AddNodeResultData, ListNodesResultData, ListEdgesResultData, ListTypesResultData, InfoResultData, GetConfigResultData, SetConfigResultData, HelpResultData, CommandResultData, CommandResultOk, CommandResultError, CommandResult, BatchResult, UIAction, CommandDispatch, CommandContext } from '../commands/index.js';
53
+ export type { AddNodeCommand, DeleteNodeCommand, RenameNodeCommand, SetConfigCommand, GetConfigCommand, ConnectCommand, DisconnectPortsCommand, DisconnectNodeCommand, ListNodesCommand, ListEdgesCommand, ListTypesCommand, DescribeTypeCommand, SearchTypesCommand, InfoCommand, UndoCommand, RedoCommand, ConfigOpenCommand, SelectNodeCommand, HelpCommand, ClearCommand, SwapNodeCommand, MoveNodeCommand, AutoLayoutCommand, Command, ParseResult, CommandErrorCode, AddNodeResultData, ListNodesResultData, ListEdgesResultData, ListTypesResultData, SearchTypesResultData, DescribeTypeResultData, TypeSummary, ConfigKeyDescription, PortDescription, InfoResultData, GetConfigResultData, GetConfigKeyResultData, GetConfigAllResultData, SetConfigResultData, HelpResultData, CommandResultData, CommandResultOk, CommandResultError, CommandResult, BatchResult, UIAction, CommandDispatch, CommandContext } from '../commands/index.js';
54
54
  export { buildTypeMap, parseCommand, executeCommand, toShortId, toShortTypeId, resolveNode, executeBatch, computeAutoPosition } from '../commands/index.js';
55
55
  export { WorkflowAdapter } from '../adapters/WorkflowAdapter.js';
56
56
  export type { StandardNode, StandardEdge, StandardWorkflow, WorkflowExecutionResult, WorkflowValidationResult } from '../adapters/WorkflowAdapter.js';
@@ -14,6 +14,12 @@
14
14
  */
15
15
  import type { Messages } from './types.js';
16
16
  export declare function setMessages(getter: () => Messages): void;
17
+ /**
18
+ * The context entry `setMessages` would create, for code that mounts a
19
+ * component imperatively (`mount(Component, { target, context })`) and so has
20
+ * no provider above it. The WebMCP confirm dialog is mounted this way.
21
+ */
22
+ export declare function messagesContext(getter: () => Messages): Map<unknown, unknown>;
17
23
  /**
18
24
  * Returns the current messages getter. Components should call the result on
19
25
  * every read so locale switches in the consumer's i18n library propagate
@@ -19,6 +19,14 @@ const defaultGetter = () => defaultMessages;
19
19
  export function setMessages(getter) {
20
20
  setContext(KEY, getter);
21
21
  }
22
+ /**
23
+ * The context entry `setMessages` would create, for code that mounts a
24
+ * component imperatively (`mount(Component, { target, context })`) and so has
25
+ * no provider above it. The WebMCP confirm dialog is mounted this way.
26
+ */
27
+ export function messagesContext(getter) {
28
+ return new Map([[KEY, getter]]);
29
+ }
22
30
  /**
23
31
  * Returns the current messages getter. Components should call the result on
24
32
  * every read so locale switches in the consumer's i18n library propagate
@@ -523,8 +523,6 @@ export declare const defaultMessages: {
523
523
  readonly outputsHeading: "Outputs";
524
524
  readonly addInput: "Add input";
525
525
  readonly addOutput: "Add output";
526
- readonly noInputs: "No inputs declared yet.";
527
- readonly noOutputs: "No outputs declared yet.";
528
526
  readonly idLabel: "ID";
529
527
  readonly nameLabel: "Name";
530
528
  readonly descriptionLabel: "Description";
@@ -545,6 +543,14 @@ export declare const defaultMessages: {
545
543
  readonly removeExample: "Remove example";
546
544
  readonly bindingLabel: "Bound port";
547
545
  readonly bindingUnbound: "Not bound";
546
+ readonly bindingChange: "Change the bound port";
547
+ readonly bindingChoose: "Choose a port to bind";
548
+ readonly bindingCurrent: "Current";
549
+ readonly bindingUnbind: "Unbind";
550
+ readonly bindingDangling: ({ nodeId, portId }: {
551
+ nodeId: string;
552
+ portId: string;
553
+ }) => string;
548
554
  readonly moreOptions: "More options";
549
555
  readonly pullFromPort: "Pull from port";
550
556
  readonly pullFromPortTitle: "Fill name, data type, description, required and default from the bound port's own declaration";
@@ -558,5 +564,75 @@ export declare const defaultMessages: {
558
564
  id: string;
559
565
  }) => string;
560
566
  readonly metaDisclosure: "Server metadata (read-only)";
567
+ readonly composerTitleInput: "New input";
568
+ readonly composerTitleOutput: "New output";
569
+ readonly composerStep: ({ step, total }: {
570
+ step: number;
571
+ total: number;
572
+ }) => string;
573
+ readonly composerClose: "Close without adding";
574
+ readonly composerQuestion: "Bind it to an existing port?";
575
+ readonly composerBindYes: "Yes, bind to a port";
576
+ readonly composerBindYesHint: "Pick an exposed port. The entry takes its id, name, type and description from it.";
577
+ readonly composerBindNo: "No, add a custom entry";
578
+ readonly composerBindNoHint: "Start with an empty entry. Bind it later, or leave it unbound.";
579
+ readonly composerSearchLabel: "Search ports";
580
+ readonly composerSearchPlaceholder: "Search by node, port or type…";
581
+ readonly composerListLabelInput: "Exposed input ports";
582
+ readonly composerListLabelOutput: "Exposed output ports";
583
+ readonly composerGroupFree: "Available";
584
+ readonly composerGroupTaken: "Connected or already published";
585
+ readonly composerNoPorts: "No exposed ports to bind yet. Expose a port on a node first.";
586
+ readonly composerNoMatches: "No ports match your search.";
587
+ readonly composerConnected: "Connected";
588
+ readonly composerPublishedAs: ({ id }: {
589
+ id: string;
590
+ }) => string;
591
+ readonly composerRequired: "Required";
592
+ readonly composerBack: "Back";
593
+ readonly composerCancel: "Cancel";
594
+ };
595
+ readonly webmcp: {
596
+ readonly confirmTitle: ({ name }: {
597
+ name: string;
598
+ }) => string;
599
+ readonly confirmCount: ({ count }: {
600
+ count: number;
601
+ }) => string;
602
+ readonly reject: "Reject";
603
+ readonly apply: "Apply";
604
+ readonly saveLine: ({ name }: {
605
+ name: string;
606
+ }) => string;
607
+ readonly saveHint: "Writes the workflow to the server. This cannot be undone from the editor.";
608
+ readonly runLine: ({ name }: {
609
+ name: string;
610
+ }) => string;
611
+ readonly runHint: "Starts a run of the saved workflow. Unsaved changes are not part of it.";
612
+ /** One clause per kind of change; joined into the batch summary. */
613
+ readonly summaryAdds: ({ count }: {
614
+ count: number;
615
+ }) => string;
616
+ readonly summaryDeletes: ({ count }: {
617
+ count: number;
618
+ }) => string;
619
+ readonly summaryConnects: ({ count }: {
620
+ count: number;
621
+ }) => string;
622
+ readonly summaryDisconnects: ({ count }: {
623
+ count: number;
624
+ }) => string;
625
+ readonly summaryConfigs: ({ count }: {
626
+ count: number;
627
+ }) => string;
628
+ readonly summaryOther: ({ count }: {
629
+ count: number;
630
+ }) => string;
631
+ /** `{count} changes — adds 2 nodes, connects 1 edge. Applied together, undone together.` */
632
+ readonly batchSummary: ({ count, parts }: {
633
+ count: number;
634
+ parts: string;
635
+ }) => string;
636
+ readonly rememberEdits: "Apply further edits from any agent on this page without asking, until this page is closed";
561
637
  };
562
638
  };