@oomol-lab/open-flow 0.1.0-beta.62 → 0.1.0-beta.64

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 (55) hide show
  1. package/dist/browser/{createResourceDialog-DZgJsr3e.js → createResourceDialog-BAJXbzNH.js} +20 -7
  2. package/dist/browser/flow-authoring.js +8 -7
  3. package/dist/browser/flow-change-schema.d.ts +1 -0
  4. package/dist/browser/flow-change.d.ts +1 -0
  5. package/dist/browser/flow-change.js +8 -7
  6. package/dist/browser/flow-notifications.d.ts +6 -0
  7. package/dist/browser/{flowChanges-CzYIVevI.js → flowChanges-BAMkSaKF.js} +1771 -1331
  8. package/dist/browser/{flowRunInputEditorStore-Dsxyfwae.js → flowRunInputEditorStore-B2Rw4VsT.js} +1 -1
  9. package/dist/browser/{flowWorkspace-BgZaFKZm.js → flowWorkspace-DxLc1Ybv.js} +429 -205
  10. package/dist/browser/{icons-CajfDpy_.js → icons-Db2Jb2iX.js} +30 -10
  11. package/dist/browser/preview.css +40 -52
  12. package/dist/browser/preview.js +7752 -7452
  13. package/dist/browser/theme.css +4 -0
  14. package/dist/browser/{typeScriptSession-fXPMFGjW.js → typeScriptSession-D0bjYDeg.js} +1 -1
  15. package/dist/browser/ui.css +39 -51
  16. package/dist/browser/ui.js +5 -5
  17. package/dist/browser/{value-DL_poNiC.js → value-BADHeZ9I.js} +12 -1
  18. package/dist/browser/workbench-contract.d.ts +10 -0
  19. package/dist/browser/workbench.css +43 -59
  20. package/dist/browser/workbench.d.ts +5 -3
  21. package/dist/browser/workbench.js +255 -216
  22. package/dist/browser/{workbenchSelect-H9wzEFkH.js → workbenchSelect-C-jf6NIM.js} +1 -1
  23. package/dist/command/index.js +49 -48
  24. package/dist/common/authoringSchema.d.ts +1 -0
  25. package/dist/common/canvas-commands.d.ts +19 -0
  26. package/dist/common/connector-action.d.ts +1 -0
  27. package/dist/common/connector-action.js +15 -12
  28. package/dist/common/control-api-conformance.js +127 -8
  29. package/dist/common/control-api.d.ts +16 -0
  30. package/dist/common/control-api.js +67 -8
  31. package/dist/common/control-requests.d.ts +23 -0
  32. package/dist/common/control-requests.js +64 -19
  33. package/dist/common/decision.js +8 -7
  34. package/dist/common/flow-connectionUsage.d.ts +1 -0
  35. package/dist/common/flow-encoding.d.ts +1 -0
  36. package/dist/common/flow-encoding.js +202 -10
  37. package/dist/common/flow-notifications.d.ts +6 -0
  38. package/dist/common/flow-semantics.js +64 -46
  39. package/dist/common/flow-workflowFile.d.ts +23 -0
  40. package/dist/common/integration-trigger.js +8 -7
  41. package/dist/common/localization.d.ts +1 -0
  42. package/dist/common/localization.js +12 -1
  43. package/dist/common/mcp.d.ts +103 -0
  44. package/dist/common/mcp.js +135 -11
  45. package/dist/common/openapi.js +8 -7
  46. package/dist/common/poll-trigger.js +8 -7
  47. package/dist/common/runtime-contract.js +1 -1
  48. package/dist/common/scheduler.d.ts +22 -2
  49. package/dist/common/scheduler.js +354 -83
  50. package/dist/common/trigger-config.d.ts +2 -0
  51. package/dist/common/webhook-trigger.js +8 -7
  52. package/dist/index.d.ts +2 -2
  53. package/package.json +1 -1
  54. package/skills/open-flow/SKILL.md +1 -1
  55. package/skills/open-flow/references/flow-authoring.md +49 -0
@@ -209,6 +209,7 @@ export declare const authoringConfigurations: {
209
209
  notification: z.ZodOptional<z.ZodObject<{
210
210
  action: z.ZodString;
211
211
  connectionId: z.ZodOptional<z.ZodString>;
212
+ outputMode: z.ZodOptional<z.ZodLiteral<"value">>;
212
213
  messageHandle: z.ZodString;
213
214
  inputs: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
214
215
  kind: z.ZodLiteral<"value">;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ export declare const canvasMinZoom = 0.1;
3
+ export declare const canvasMaxZoom = 3;
4
+ /** Transient operations on each connected canvas's own viewport. */
5
+ export declare const canvasCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
+ type: z.ZodLiteral<"focus">;
7
+ nodeId: z.ZodString;
8
+ }, z.core.$strict>, z.ZodObject<{
9
+ type: z.ZodLiteral<"zoom">;
10
+ zoom: z.ZodNumber;
11
+ }, z.core.$strict>, z.ZodObject<{
12
+ type: z.ZodLiteral<"pan">;
13
+ dx: z.ZodNumber;
14
+ dy: z.ZodNumber;
15
+ }, z.core.$strict>, z.ZodObject<{
16
+ type: z.ZodLiteral<"fit">;
17
+ }, z.core.$strict>], "type">;
18
+ export type CanvasCommand = z.infer<typeof canvasCommandSchema>;
19
+ export type CanvasCommandSubscriber = (execute: (command: CanvasCommand) => void) => () => void;
@@ -24,3 +24,4 @@ export interface ConnectorRuntimeInputPort {
24
24
  }
25
25
  export declare function connectorActionPorts(inputSchema: unknown, outputSchema: unknown): ConnectorActionPorts;
26
26
  export declare function normalizeConnectorRuntimeInputs<Value>(ports: readonly ConnectorRuntimeInputPort[], inputs: Readonly<Record<string, Value>>): Readonly<Record<string, Value>>;
27
+ export declare function connectorOutputMode(schema: unknown): 'fields' | 'value';
@@ -43,24 +43,27 @@ function inputPorts(schema) {
43
43
  };
44
44
  });
45
45
  }
46
- function outputPorts(schema) {
46
+ function connectorOutputMode(schema) {
47
47
  const root = toPlainObject(schema);
48
48
  const properties = toPlainObject(root?.properties);
49
- if (root != null && (root.type == "object" || properties != null)) {
50
- if (properties == null) return [];
51
- const required = stringSet(root.required);
52
- return Object.entries(properties).map(([handle, propertySchema]) => ({
53
- description: schemaDescription(root, propertySchema),
54
- handle,
55
- json_schema: propertySchemaWithDefinitions(root, propertySchema),
56
- nullable: !required.has(handle) || schemaAllowsNull(propertySchema, root)
57
- }));
58
- } else return [{
49
+ return properties != null && Object.keys(properties).length > 0 || root?.type == "object" && root.additionalProperties === false ? "fields" : "value";
50
+ }
51
+ function outputPorts(schema) {
52
+ const root = toPlainObject(schema);
53
+ if (connectorOutputMode(schema) == "value") return [{
59
54
  description: schemaDescription(root, schema),
60
55
  handle: "output",
61
56
  json_schema: schema,
62
57
  nullable: schemaAllowsNull(schema)
63
58
  }];
59
+ const properties = toPlainObject(root?.properties) ?? {};
60
+ const required = stringSet(root?.required);
61
+ return Object.entries(properties).map(([handle, propertySchema]) => ({
62
+ description: schemaDescription(root, propertySchema),
63
+ handle,
64
+ json_schema: propertySchemaWithDefinitions(root, propertySchema),
65
+ nullable: !required.has(handle) || schemaAllowsNull(propertySchema, root)
66
+ }));
64
67
  }
65
68
  function propertySchemaWithDefinitions(root, schema) {
66
69
  const property = toPlainObject(schema);
@@ -124,4 +127,4 @@ function resolveLocalReference(root, reference) {
124
127
  return current;
125
128
  }
126
129
  //#endregion
127
- export { connectorActionPorts, normalizeConnectorRuntimeInputs };
130
+ export { connectorActionPorts, connectorOutputMode, normalizeConnectorRuntimeInputs };
@@ -6684,10 +6684,10 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
6684
6684
  }
6685
6685
  if (compiledEnum.length === 0) recordWarn(context, "all of elements from list is rejected by currently schema object", "enum");
6686
6686
  }
6687
- if (constValue && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
6687
+ if (constValue !== void 0 && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
6688
6688
  if (compiledEnum) {
6689
6689
  if (compiledEnum.length === 0) isNever = true;
6690
- else if (constValue) {
6690
+ else if (constValue !== void 0) {
6691
6691
  let foundEquals = false;
6692
6692
  for (const enumValue of compiledEnum) if (isDeepEquals(enumValue, constValue)) {
6693
6693
  foundEquals = true;
@@ -6700,7 +6700,7 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
6700
6700
  const compiledSchema = {};
6701
6701
  if (schema.type) compiledSchema.type = schema.type;
6702
6702
  if (compiledEnum) compiledSchema.enum = compiledEnum;
6703
- if (constValue) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
6703
+ if (constValue !== void 0) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
6704
6704
  return wrapCompiledSchema(kind, compiledSchema, context.delegate, context.path);
6705
6705
  }
6706
6706
  //#endregion
@@ -7095,7 +7095,7 @@ function compileSchema(context, schema) {
7095
7095
  let targetSchema = schema;
7096
7096
  let shouldHandleEnumAndConst = false;
7097
7097
  const { enum: enumList, const: constValue } = schema;
7098
- if (enumList || constValue) {
7098
+ if (enumList || constValue !== void 0) {
7099
7099
  const { enum: _0, const: _1, ...rest } = schema;
7100
7100
  targetSchema = rest;
7101
7101
  shouldHandleEnumAndConst = true;
@@ -7685,7 +7685,7 @@ function schemaEqualsChecker(extendsContext) {
7685
7685
  }
7686
7686
  function isValueEquals(value1, value2) {
7687
7687
  if (value1 === value2) return true;
7688
- if (value1 === null) return false;
7688
+ if (value1 === null || value2 === null) return false;
7689
7689
  if (typeof value1 !== "object") return false;
7690
7690
  if (typeof value1 !== typeof value2) return false;
7691
7691
  if (isCompiledSchema(value1) && isCompiledSchema(value2)) return isCompiledSchemaEquals(value1, value2);
@@ -8251,7 +8251,7 @@ function findMismatchPath(source, target) {
8251
8251
  if ((sourceSchema.maxProperties ?? Number.POSITIVE_INFINITY) > (targetSchema.maxProperties ?? Number.POSITIVE_INFINITY)) return [...targetPath, "maxProperties"];
8252
8252
  break;
8253
8253
  }
8254
- case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const == null ? "enum" : "const"];
8254
+ case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const === void 0 ? "enum" : "const"];
8255
8255
  }
8256
8256
  return targetPath;
8257
8257
  }
@@ -8716,7 +8716,8 @@ var managedFields = object({
8716
8716
  object({
8717
8717
  kind: literal("connector"),
8718
8718
  action: text,
8719
- connectionId: text.optional()
8719
+ connectionId: text.optional(),
8720
+ outputMode: literal("value").optional()
8720
8721
  }),
8721
8722
  object({
8722
8723
  kind: literal("openapi"),
@@ -9314,7 +9315,7 @@ var authoringConfigurations = {
9314
9315
  outputs: outputFields,
9315
9316
  capabilities: authoringDefinitionSchemas.capabilities.optional()
9316
9317
  }),
9317
- connector: authoringDefinitionSchemas.connector.strict(),
9318
+ connector: authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
9318
9319
  openapi: authoringOpenApiSchema,
9319
9320
  agent: authoringDefinitionSchemas.agent.omit({
9320
9321
  prompt: true,
@@ -10034,6 +10035,24 @@ function providerIconAppearance(metadata, position) {
10034
10035
  }
10035
10036
  };
10036
10037
  }
10038
+ //#endregion
10039
+ //#region src/flow/common/workflowFile.ts
10040
+ var envelope = strictObject({
10041
+ kind: literal("open-flow-workflow"),
10042
+ version: literal(1),
10043
+ name: string$1().optional(),
10044
+ content: unknown(),
10045
+ presentation: record$3(string$1(), json$4()).optional()
10046
+ });
10047
+ /** Structural decoding only: incomplete drafts are supported, repair is never attempted. */
10048
+ function decodeWorkflowFile(value) {
10049
+ checkJsonDepth(value, -1);
10050
+ const file = envelope.parse(value);
10051
+ return {
10052
+ ...file,
10053
+ content: decodeRevisionContent(file.content)
10054
+ };
10055
+ }
10037
10056
  new TextEncoder();
10038
10057
  //#endregion
10039
10058
  //#region src/control/common/providerAccess.ts
@@ -11418,6 +11437,26 @@ var ControlClient = class {
11418
11437
  exact(source, ["version"]);
11419
11438
  if (source.version != 1) return invalidResponse();
11420
11439
  }
11440
+ async exportFlow(flowId) {
11441
+ const value = await this.request(`/v1/flows/${segment(flowId)}/export`);
11442
+ try {
11443
+ return decodeWorkflowFile(value);
11444
+ } catch {
11445
+ return invalidResponse();
11446
+ }
11447
+ }
11448
+ async importFlow(file, options = {}) {
11449
+ return flow(await this.request("/v1/flows/import", {
11450
+ method: "POST",
11451
+ headers: { "Idempotency-Key": options.idempotencyKey ?? `flow-${randomId()}` },
11452
+ body: JSON.stringify({
11453
+ file,
11454
+ name: options.name,
11455
+ teamId: options.teamId,
11456
+ version: 1
11457
+ })
11458
+ }));
11459
+ }
11421
11460
  async createFlow(name, idempotencyKey = `flow-${randomId()}`, teamId) {
11422
11461
  return flow(await this.request("/v1/flows", {
11423
11462
  body: JSON.stringify({
@@ -11429,6 +11468,26 @@ var ControlClient = class {
11429
11468
  method: "POST"
11430
11469
  }));
11431
11470
  }
11471
+ async broadcastCanvas(flowId, command) {
11472
+ const source = record$1(await this.request(`/v1/flows/${segment(flowId)}/canvas`, {
11473
+ method: "POST",
11474
+ body: JSON.stringify({
11475
+ version: 1,
11476
+ command
11477
+ })
11478
+ }));
11479
+ exact(source, [
11480
+ "version",
11481
+ "flowId",
11482
+ "broadcast"
11483
+ ]);
11484
+ if (source.version != 1 || source.broadcast !== true || source.flowId !== flowId) return invalidResponse();
11485
+ return {
11486
+ version: 1,
11487
+ flowId: string(source.flowId),
11488
+ broadcast: true
11489
+ };
11490
+ }
11432
11491
  async getFlow(flowId) {
11433
11492
  return flow(await this.request(`/v1/flows/${segment(flowId)}`));
11434
11493
  }
@@ -12107,6 +12166,66 @@ function liveRunRequest(harness, publicationId, key) {
12107
12166
  });
12108
12167
  }
12109
12168
  var controlApiConformanceCases = [
12169
+ {
12170
+ name: "imports workflow files atomically and exports a new unpublished draft with its Presentation",
12171
+ async verify(harness) {
12172
+ const api = new ControlClient((url, init) => harness.request(new Request(new URL(url, harness.origin), init)));
12173
+ const file = {
12174
+ kind: "open-flow-workflow",
12175
+ version: 1,
12176
+ name: "Portable flow",
12177
+ content: {
12178
+ modelVersion: 6,
12179
+ modules: {},
12180
+ document: {
12181
+ bindings: {},
12182
+ graph: {
12183
+ nodes: { start: {
12184
+ kind: "manual",
12185
+ name: "Start"
12186
+ } },
12187
+ edges: []
12188
+ }
12189
+ }
12190
+ },
12191
+ presentation: { viewport: {
12192
+ x: 10,
12193
+ y: 20,
12194
+ zoom: 1
12195
+ } }
12196
+ };
12197
+ const idempotencyKey = crypto.randomUUID();
12198
+ const created = await api.importFlow(file, { idempotencyKey });
12199
+ equal(dequal(await api.importFlow(file, { idempotencyKey }), created), true, "Import retry must return the same Flow.");
12200
+ equal(dequal(await api.exportFlow(created.flowId), file), true, "Export must retain the graph and Presentation.");
12201
+ const editor = await api.getEditor(created.flowId);
12202
+ equal(editor.live.publication == null, true, "Import must not publish.");
12203
+ equal(editor.draft.parentRevisionId == null, true, "Import must create an initial Revision.");
12204
+ equal(dequal(editor.presentation.value, file.presentation), true, "Import must atomically save Presentation.");
12205
+ await error(await request(harness, "/v1/flows/import", {
12206
+ method: "POST",
12207
+ headers: { "idempotency-key": idempotencyKey },
12208
+ body: JSON.stringify({
12209
+ file,
12210
+ name: "Changed",
12211
+ version: 1
12212
+ })
12213
+ }), 409, "flow.conflict", "Reject changed import retry");
12214
+ const before = await api.listFlows();
12215
+ await error(await request(harness, "/v1/flows/import", {
12216
+ method: "POST",
12217
+ headers: { "idempotency-key": crypto.randomUUID() },
12218
+ body: JSON.stringify({
12219
+ file: {
12220
+ ...file,
12221
+ version: 99
12222
+ },
12223
+ version: 1
12224
+ })
12225
+ }), 400, "flow.invalid", "Reject unsupported file");
12226
+ equal(dequal((await api.listFlows()).flows, before.flows), true, "Rejected import left an empty Flow.");
12227
+ }
12228
+ },
12110
12229
  {
12111
12230
  name: "authors nodes atomically with public views, fixed reads and replay before CAS",
12112
12231
  async verify(harness) {
@@ -1,3 +1,5 @@
1
+ import type { CanvasCommand } from './canvas-commands.js';
2
+ export type { CanvasCommand, CanvasCommandSubscriber } from './canvas-commands.js';
1
3
  import type { LiveDetails } from './liveDetails.js';
2
4
  export { liveEntries } from './liveDetails.js';
3
5
  export type { LiveDetails, LiveEntry } from './liveDetails.js';
@@ -22,12 +24,19 @@ import type { ResultQuery } from './run-results.js';
22
24
  import { decodeResultList, decodeResultRead } from './run-results.js';
23
25
  export { readResult, parseResultQuery, decodeResultList, decodeResultRead, type ResultCall, type ResultInfo, type ResultPage, type ResultQuery, } from './run-results.js';
24
26
  import type { RunStatus } from './run-lifecycle.js';
27
+ import type { WorkflowFile } from './flow-workflowFile.js';
28
+ export type { WorkflowFile, WorkflowCleanupSummary } from './flow-workflowFile.js';
25
29
  import type { InputPortDefinition, JsonValue, PortDefinition, RevisionContent, TriggerKeySnapshot, WaitAction } from '../browser/flow-change.js';
26
30
  import type { FlowResourceReferences } from './flow-semantics.js';
27
31
  export type { JsonValue, TriggerKeySnapshot, WaitAction } from '../browser/flow-change.js';
28
32
  export type { RunStatus } from './run-lifecycle.js';
29
33
  export { ApiError, controlErrorCode, controlErrorMetadata, type ControlErrorCode } from './control-api-errors.js';
30
34
  export type { FlowCatalogEvent, FlowChangeEvent } from './flow-notifications.js';
35
+ export interface CanvasBroadcast {
36
+ readonly version: 1;
37
+ readonly flowId: string;
38
+ readonly broadcast: true;
39
+ }
31
40
  export type ControlRequest = (path: string, init?: RequestInit) => Promise<Response>;
32
41
  export interface ErrorListener {
33
42
  readonly flowId: string;
@@ -782,7 +791,14 @@ export declare class ControlClient {
782
791
  getVariable(name: string): Promise<Variable>;
783
792
  putVariable(name: string, value: string): Promise<Variable>;
784
793
  deleteVariable(name: string): Promise<void>;
794
+ exportFlow(flowId: string): Promise<WorkflowFile>;
795
+ importFlow(file: WorkflowFile, options?: {
796
+ readonly name?: string;
797
+ readonly teamId?: string;
798
+ readonly idempotencyKey?: string;
799
+ }): Promise<Flow>;
785
800
  createFlow(name: string, idempotencyKey?: string, teamId?: string): Promise<Flow>;
801
+ broadcastCanvas(flowId: string, command: CanvasCommand): Promise<CanvasBroadcast>;
786
802
  getFlow(flowId: string): Promise<Flow>;
787
803
  getErrorListeners(flowId: string, signal?: AbortSignal): Promise<readonly ErrorListener[]>;
788
804
  renameFlow(flowId: string, name: string): Promise<Flow>;
@@ -6711,10 +6711,10 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
6711
6711
  }
6712
6712
  if (compiledEnum.length === 0) recordWarn(context, "all of elements from list is rejected by currently schema object", "enum");
6713
6713
  }
6714
- if (constValue && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
6714
+ if (constValue !== void 0 && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
6715
6715
  if (compiledEnum) {
6716
6716
  if (compiledEnum.length === 0) isNever = true;
6717
- else if (constValue) {
6717
+ else if (constValue !== void 0) {
6718
6718
  let foundEquals = false;
6719
6719
  for (const enumValue of compiledEnum) if (isDeepEquals(enumValue, constValue)) {
6720
6720
  foundEquals = true;
@@ -6727,7 +6727,7 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
6727
6727
  const compiledSchema = {};
6728
6728
  if (schema.type) compiledSchema.type = schema.type;
6729
6729
  if (compiledEnum) compiledSchema.enum = compiledEnum;
6730
- if (constValue) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
6730
+ if (constValue !== void 0) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
6731
6731
  return wrapCompiledSchema(kind, compiledSchema, context.delegate, context.path);
6732
6732
  }
6733
6733
  //#endregion
@@ -7122,7 +7122,7 @@ function compileSchema(context, schema) {
7122
7122
  let targetSchema = schema;
7123
7123
  let shouldHandleEnumAndConst = false;
7124
7124
  const { enum: enumList, const: constValue } = schema;
7125
- if (enumList || constValue) {
7125
+ if (enumList || constValue !== void 0) {
7126
7126
  const { enum: _0, const: _1, ...rest } = schema;
7127
7127
  targetSchema = rest;
7128
7128
  shouldHandleEnumAndConst = true;
@@ -7712,7 +7712,7 @@ function schemaEqualsChecker(extendsContext) {
7712
7712
  }
7713
7713
  function isValueEquals(value1, value2) {
7714
7714
  if (value1 === value2) return true;
7715
- if (value1 === null) return false;
7715
+ if (value1 === null || value2 === null) return false;
7716
7716
  if (typeof value1 !== "object") return false;
7717
7717
  if (typeof value1 !== typeof value2) return false;
7718
7718
  if (isCompiledSchema(value1) && isCompiledSchema(value2)) return isCompiledSchemaEquals(value1, value2);
@@ -8278,7 +8278,7 @@ function findMismatchPath(source, target) {
8278
8278
  if ((sourceSchema.maxProperties ?? Number.POSITIVE_INFINITY) > (targetSchema.maxProperties ?? Number.POSITIVE_INFINITY)) return [...targetPath, "maxProperties"];
8279
8279
  break;
8280
8280
  }
8281
- case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const == null ? "enum" : "const"];
8281
+ case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const === void 0 ? "enum" : "const"];
8282
8282
  }
8283
8283
  return targetPath;
8284
8284
  }
@@ -8743,7 +8743,8 @@ var managedFields = object({
8743
8743
  object({
8744
8744
  kind: literal("connector"),
8745
8745
  action: text,
8746
- connectionId: text.optional()
8746
+ connectionId: text.optional(),
8747
+ outputMode: literal("value").optional()
8747
8748
  }),
8748
8749
  object({
8749
8750
  kind: literal("openapi"),
@@ -9341,7 +9342,7 @@ var authoringConfigurations = {
9341
9342
  outputs: outputFields,
9342
9343
  capabilities: authoringDefinitionSchemas.capabilities.optional()
9343
9344
  }),
9344
- connector: authoringDefinitionSchemas.connector.strict(),
9345
+ connector: authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
9345
9346
  openapi: authoringOpenApiSchema,
9346
9347
  agent: authoringDefinitionSchemas.agent.omit({
9347
9348
  prompt: true,
@@ -10164,6 +10165,24 @@ function providerIconAppearance(metadata, position) {
10164
10165
  };
10165
10166
  }
10166
10167
  //#endregion
10168
+ //#region src/flow/common/workflowFile.ts
10169
+ var envelope = strictObject({
10170
+ kind: literal("open-flow-workflow"),
10171
+ version: literal(1),
10172
+ name: string$1().optional(),
10173
+ content: unknown(),
10174
+ presentation: record$2(string$1(), json$3()).optional()
10175
+ });
10176
+ /** Structural decoding only: incomplete drafts are supported, repair is never attempted. */
10177
+ function decodeWorkflowFile(value) {
10178
+ checkJsonDepth(value, -1);
10179
+ const file = envelope.parse(value);
10180
+ return {
10181
+ ...file,
10182
+ content: decodeRevisionContent(file.content)
10183
+ };
10184
+ }
10185
+ //#endregion
10167
10186
  //#region src/flow/common/encoding.ts
10168
10187
  var encoder$1 = new TextEncoder();
10169
10188
  function canonicalText(value) {
@@ -12074,6 +12093,26 @@ var ControlClient = class {
12074
12093
  exact(source, ["version"]);
12075
12094
  if (source.version != 1) return invalidResponse();
12076
12095
  }
12096
+ async exportFlow(flowId) {
12097
+ const value = await this.request(`/v1/flows/${segment(flowId)}/export`);
12098
+ try {
12099
+ return decodeWorkflowFile(value);
12100
+ } catch {
12101
+ return invalidResponse();
12102
+ }
12103
+ }
12104
+ async importFlow(file, options = {}) {
12105
+ return flow(await this.request("/v1/flows/import", {
12106
+ method: "POST",
12107
+ headers: { "Idempotency-Key": options.idempotencyKey ?? `flow-${randomId()}` },
12108
+ body: JSON.stringify({
12109
+ file,
12110
+ name: options.name,
12111
+ teamId: options.teamId,
12112
+ version: 1
12113
+ })
12114
+ }));
12115
+ }
12077
12116
  async createFlow(name, idempotencyKey = `flow-${randomId()}`, teamId) {
12078
12117
  return flow(await this.request("/v1/flows", {
12079
12118
  body: JSON.stringify({
@@ -12085,6 +12124,26 @@ var ControlClient = class {
12085
12124
  method: "POST"
12086
12125
  }));
12087
12126
  }
12127
+ async broadcastCanvas(flowId, command) {
12128
+ const source = record(await this.request(`/v1/flows/${segment(flowId)}/canvas`, {
12129
+ method: "POST",
12130
+ body: JSON.stringify({
12131
+ version: 1,
12132
+ command
12133
+ })
12134
+ }));
12135
+ exact(source, [
12136
+ "version",
12137
+ "flowId",
12138
+ "broadcast"
12139
+ ]);
12140
+ if (source.version != 1 || source.broadcast !== true || source.flowId !== flowId) return invalidResponse();
12141
+ return {
12142
+ version: 1,
12143
+ flowId: string(source.flowId),
12144
+ broadcast: true
12145
+ };
12146
+ }
12088
12147
  async getFlow(flowId) {
12089
12148
  return flow(await this.request(`/v1/flows/${segment(flowId)}`));
12090
12149
  }
@@ -1,3 +1,4 @@
1
+ export { canvasCommandSchema } from './canvas-commands.js';
1
2
  export * from './authoring.js';
2
3
  import type { JsonValue } from '../browser/flow-change.js';
3
4
  import type { DraftOperation } from './draftOperations.js';
@@ -9,6 +10,22 @@ export declare const waitActionBodySchema: {
9
10
  };
10
11
  };
11
12
  export declare const controlRequests: {
13
+ canvas: (value: unknown) => {
14
+ command: {
15
+ type: "focus";
16
+ nodeId: string;
17
+ } | {
18
+ type: "zoom";
19
+ zoom: number;
20
+ } | {
21
+ type: "pan";
22
+ dx: number;
23
+ dy: number;
24
+ } | {
25
+ type: "fit";
26
+ };
27
+ version: 1;
28
+ };
12
29
  authoringCheck: (value: unknown) => {
13
30
  revisionId: string;
14
31
  };
@@ -162,6 +179,12 @@ export declare const controlRequests: {
162
179
  version: 1;
163
180
  expectedRevision: number;
164
181
  };
182
+ importFlow: (value: unknown) => {
183
+ file: JsonValue;
184
+ name?: string | undefined;
185
+ teamId?: string | undefined;
186
+ version: 1;
187
+ };
165
188
  createFlow: (value: unknown) => {
166
189
  name: string;
167
190
  teamId?: string | undefined;