@flowdrop/flowdrop 2.4.0 → 2.6.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 (57) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/chat/commandClassifier.d.ts +17 -0
  3. package/dist/chat/commandClassifier.js +29 -0
  4. package/dist/chat/index.d.ts +1 -1
  5. package/dist/chat/index.js +1 -1
  6. package/dist/components/App.svelte +8 -0
  7. package/dist/components/BindablePortListbox.svelte +426 -0
  8. package/dist/components/BindablePortListbox.svelte.d.ts +23 -0
  9. package/dist/components/WorkflowInterfaceEditor.svelte +142 -36
  10. package/dist/components/WorkflowInterfaceEditor.svelte.d.ts +8 -0
  11. package/dist/components/WorkflowInterfaceEntryCard.svelte +537 -294
  12. package/dist/components/WorkflowInterfaceEntryCard.svelte.d.ts +6 -3
  13. package/dist/components/WorkflowInterfaceEntryComposer.svelte +331 -0
  14. package/dist/components/WorkflowInterfaceEntryComposer.svelte.d.ts +19 -0
  15. package/dist/config/defaultPortConfig.js +27 -9
  16. package/dist/messages/context.d.ts +6 -0
  17. package/dist/messages/context.js +8 -0
  18. package/dist/messages/defaults.d.ts +45 -2
  19. package/dist/messages/defaults.js +36 -3
  20. package/dist/messages/index.d.ts +1 -1
  21. package/dist/messages/index.js +1 -1
  22. package/dist/openapi/v1/openapi.yaml +14 -1
  23. package/dist/schemas/v1/workflow.schema.json +9 -2
  24. package/dist/stores/instanceContainer.svelte.d.ts +26 -0
  25. package/dist/stores/instanceContainer.svelte.js +24 -0
  26. package/dist/stories/WebMCPFakeAgent.svelte +229 -0
  27. package/dist/stories/WebMCPFakeAgent.svelte.d.ts +10 -0
  28. package/dist/styles/base.css +4 -2
  29. package/dist/styles/tokens.css +20 -0
  30. package/dist/svelte-app.d.ts +20 -0
  31. package/dist/svelte-app.js +49 -1
  32. package/dist/types/index.d.ts +26 -1
  33. package/dist/utils/focus.d.ts +18 -0
  34. package/dist/utils/focus.js +24 -0
  35. package/dist/utils/whenWorkflowLoaded.svelte.d.ts +17 -0
  36. package/dist/utils/whenWorkflowLoaded.svelte.js +42 -0
  37. package/dist/utils/workflowInterface.d.ts +47 -3
  38. package/dist/utils/workflowInterface.js +84 -9
  39. package/dist/webmcp/WebMCP.stories.svelte +101 -0
  40. package/dist/webmcp/WebMCP.stories.svelte.d.ts +18 -0
  41. package/dist/webmcp/WebMCPConfirm.svelte +170 -0
  42. package/dist/webmcp/WebMCPConfirm.svelte.d.ts +11 -0
  43. package/dist/webmcp/descriptors.d.ts +59 -0
  44. package/dist/webmcp/descriptors.js +464 -0
  45. package/dist/webmcp/fake.d.ts +23 -0
  46. package/dist/webmcp/fake.js +42 -0
  47. package/dist/webmcp/gate.d.ts +40 -0
  48. package/dist/webmcp/gate.js +92 -0
  49. package/dist/webmcp/index.d.ts +34 -0
  50. package/dist/webmcp/index.js +31 -0
  51. package/dist/webmcp/register.d.ts +33 -0
  52. package/dist/webmcp/register.js +267 -0
  53. package/dist/webmcp/types.d.ts +166 -0
  54. package/dist/webmcp/types.js +23 -0
  55. package/dist/webmcp/validate.d.ts +32 -0
  56. package/dist/webmcp/validate.js +118 -0
  57. 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;
@@ -48,12 +48,17 @@ export const DEFAULT_PORT_CONFIG = {
48
48
  // The sink, not `string`: a port with no declared lane constrains nothing.
49
49
  defaultDataType: 'mixed',
50
50
  dataTypes: [
51
- // Control flow types
51
+ // Control flow types.
52
+ //
53
+ // Ink, not a hue: the handle must read as the same thing as the trigger
54
+ // WIRE, which is `--fd-edge-trigger` — ink that flips with the theme. It
55
+ // sat on purple, sharing that hue with `boolean`, and matched neither the
56
+ // wire nor the served payload's cyan.
52
57
  {
53
58
  id: 'trigger',
54
59
  name: 'Trigger',
55
60
  description: 'Control flow of the workflow',
56
- color: 'var(--fd-node-purple)',
61
+ color: 'var(--fd-node-ink)',
57
62
  category: 'basic',
58
63
  enabled: true
59
64
  },
@@ -99,12 +104,15 @@ export const DEFAULT_PORT_CONFIG = {
99
104
  category: 'logical',
100
105
  enabled: true
101
106
  },
102
- // Collection types
107
+ // Collection types.
108
+ //
109
+ // Violet: the untyped array is the one array with no element hue to
110
+ // inherit. It had amber until `tool` took that to match its wire.
103
111
  {
104
112
  id: 'array',
105
113
  name: 'Array',
106
114
  description: 'Ordered list of items',
107
- color: 'var(--fd-node-amber)',
115
+ color: 'var(--fd-node-violet)',
108
116
  category: 'collection',
109
117
  enabled: true
110
118
  },
@@ -145,7 +153,7 @@ export const DEFAULT_PORT_CONFIG = {
145
153
  id: 'file[]',
146
154
  name: 'File Array',
147
155
  description: 'Array of files',
148
- color: 'var(--fd-node-red)',
156
+ color: 'var(--fd-node-teal)',
149
157
  category: 'collection',
150
158
  enabled: true
151
159
  },
@@ -166,12 +174,15 @@ export const DEFAULT_PORT_CONFIG = {
166
174
  category: 'complex',
167
175
  enabled: true
168
176
  },
169
- // File types
177
+ // File types.
178
+ //
179
+ // Teal, vacated by `video`. Red is reserved for `error` alone — a failed
180
+ // run and a PDF are not the same kind of thing and must not share a hue.
170
181
  {
171
182
  id: 'file',
172
183
  name: 'File',
173
184
  description: 'File data',
174
- color: 'var(--fd-node-red)',
185
+ color: 'var(--fd-node-teal)',
175
186
  category: 'file',
176
187
  enabled: true
177
188
  },
@@ -192,11 +203,14 @@ export const DEFAULT_PORT_CONFIG = {
192
203
  category: 'media',
193
204
  enabled: true
194
205
  },
206
+ // Fuchsia, freed by `messages`. Landing beside `image`'s pink is wanted:
207
+ // the two are both visual media, so the near-adjacency reads as a family
208
+ // rather than as a collision.
195
209
  {
196
210
  id: 'video',
197
211
  name: 'Video',
198
212
  description: 'Video data',
199
- color: 'var(--fd-node-teal)',
213
+ color: 'var(--fd-node-fuchsia)',
200
214
  category: 'media',
201
215
  enabled: true
202
216
  },
@@ -253,11 +267,15 @@ export const DEFAULT_PORT_CONFIG = {
253
267
  // A list of provider-shaped chat messages. JSON-Schema `array`
254
268
  // underneath, but not an arbitrary array — which is the whole reason it
255
269
  // is its own lane.
270
+ //
271
+ // Orange, with `json` and `json[]`: a complex lane wears the hue of the
272
+ // shape it is made of, and a message list is an array of objects. It sat
273
+ // alone on fuchsia, which said nothing about what it carries.
256
274
  {
257
275
  id: 'messages',
258
276
  name: 'Messages',
259
277
  description: 'A conversation: a list of provider-shaped chat messages',
260
- color: 'var(--fd-node-fuchsia)',
278
+ color: 'var(--fd-node-orange)',
261
279
  category: 'complex',
262
280
  enabled: true
263
281
  }
@@ -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,42 @@ 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";
561
604
  };
562
605
  };
@@ -445,8 +445,6 @@ export const defaultMessages = {
445
445
  outputsHeading: 'Outputs',
446
446
  addInput: 'Add input',
447
447
  addOutput: 'Add output',
448
- noInputs: 'No inputs declared yet.',
449
- noOutputs: 'No outputs declared yet.',
450
448
  idLabel: 'ID',
451
449
  nameLabel: 'Name',
452
450
  descriptionLabel: 'Description',
@@ -463,12 +461,47 @@ export const defaultMessages = {
463
461
  removeExample: 'Remove example',
464
462
  bindingLabel: 'Bound port',
465
463
  bindingUnbound: 'Not bound',
464
+ bindingChange: 'Change the bound port',
465
+ bindingChoose: 'Choose a port to bind',
466
+ bindingCurrent: 'Current',
467
+ bindingUnbind: 'Unbind',
468
+ bindingDangling: ({ nodeId, portId }) => `${nodeId} › ${portId} (missing)`,
466
469
  moreOptions: 'More options',
467
470
  pullFromPort: 'Pull from port',
468
471
  pullFromPortTitle: "Fill name, data type, description, required and default from the bound port's own declaration",
469
472
  removeEntry: ({ id }) => `Remove interface entry "${id}"`,
470
473
  moveUp: ({ id }) => `Move "${id}" up`,
471
474
  moveDown: ({ id }) => `Move "${id}" down`,
472
- metaDisclosure: 'Server metadata (read-only)'
475
+ metaDisclosure: 'Server metadata (read-only)',
476
+ // The inline composer that opens from "Add input" / "Add output".
477
+ composerTitleInput: 'New input',
478
+ composerTitleOutput: 'New output',
479
+ composerStep: ({ step, total }) => `Step ${step} of ${total}`,
480
+ composerClose: 'Close without adding',
481
+ composerQuestion: 'Bind it to an existing port?',
482
+ composerBindYes: 'Yes, bind to a port',
483
+ composerBindYesHint: 'Pick an exposed port. The entry takes its id, name, type and description from it.',
484
+ composerBindNo: 'No, add a custom entry',
485
+ composerBindNoHint: 'Start with an empty entry. Bind it later, or leave it unbound.',
486
+ composerSearchLabel: 'Search ports',
487
+ composerSearchPlaceholder: 'Search by node, port or type…',
488
+ composerListLabelInput: 'Exposed input ports',
489
+ composerListLabelOutput: 'Exposed output ports',
490
+ composerGroupFree: 'Available',
491
+ composerGroupTaken: 'Connected or already published',
492
+ composerNoPorts: 'No exposed ports to bind yet. Expose a port on a node first.',
493
+ composerNoMatches: 'No ports match your search.',
494
+ composerConnected: 'Connected',
495
+ composerPublishedAs: ({ id }) => `Published as ${id}`,
496
+ composerRequired: 'Required',
497
+ composerBack: 'Back',
498
+ composerCancel: 'Cancel'
499
+ },
500
+ // The confirm dialog the WebMCP adapter shows before a browser agent's change runs.
501
+ webmcp: {
502
+ confirmTitle: ({ name }) => `A browser agent wants to change “${name}”`,
503
+ confirmCount: ({ count }) => `${count === 1 ? '1 change' : `${count} changes`} — applied together, undone together.`,
504
+ reject: 'Reject',
505
+ apply: 'Apply'
473
506
  }
474
507
  };
@@ -6,5 +6,5 @@
6
6
  */
7
7
  export { defaultMessages } from './defaults.js';
8
8
  export { mergeMessages } from './merge.js';
9
- export { setMessages, getMessages, m } from './context.js';
9
+ export { setMessages, getMessages, messagesContext, m } from './context.js';
10
10
  export type { Messages, MessagesOverride, DeepPartial } from './types.js';
@@ -6,4 +6,4 @@
6
6
  */
7
7
  export { defaultMessages } from './defaults.js';
8
8
  export { mergeMessages } from './merge.js';
9
- export { setMessages, getMessages, m } from './context.js';
9
+ export { setMessages, getMessages, messagesContext, m } from './context.js';
@@ -4021,6 +4021,13 @@ components:
4021
4021
  description: Help text describing what this entry represents to external callers.
4022
4022
  dataType:
4023
4023
  $ref: '#/components/schemas/NodeDataType'
4024
+ description: |
4025
+ The port's LANE — what it is and what it may connect to — not the JSON
4026
+ Schema type of its value, which is `schema.type`. The two vocabularies
4027
+ overlap on `string`/`number`/`boolean`/`array` and diverge where it
4028
+ matters: a `messages` port is a JSON `array`, an `error` port a JSON
4029
+ `object`. Derived by the server from the bound inner port and ignored
4030
+ on write.
4024
4031
  required:
4025
4032
  type: boolean
4026
4033
  description: Whether callers must supply a value. Inputs only; ignored on outputs.
@@ -4035,7 +4042,13 @@ components:
4035
4042
  only; ignored on outputs. Never validated against `schema`.
4036
4043
  schema:
4037
4044
  $ref: '#/components/schemas/PortDataSchema'
4038
- description: JSON Schema describing the structure of data carried by this entry.
4045
+ description: |
4046
+ The JSON Schema fragment for this one port — a single property's
4047
+ schema (`{"type": "array"}`), not a whole object schema. Carries the
4048
+ structural contract only: whatever the entry states itself (the lane,
4049
+ `name`, `description`, `examples`, `required`) is not repeated inside
4050
+ it. Derived by the server from the bound inner port and ignored on
4051
+ write; absent when the bound port declares no structural contract.
4039
4052
  bindings:
4040
4053
  type: array
4041
4054
  items: