@oomol-lab/open-flow 0.1.0-beta.86 → 0.1.0-beta.88
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/dist/browser/{FlowCanvas-CHIaMaBv.js → FlowCanvas-SqPUBqze.js} +3 -3
- package/dist/browser/{createResourceDialog-C0E5yPe6.js → createResourceDialog-CB3eiK7e.js} +3 -3
- package/dist/browser/{dialog-b3hsdu8i.js → dialog-Bi-MVTGj.js} +1 -1
- package/dist/browser/{exportPng-DGHcejgy.js → exportPng-CLZKdNzR.js} +2 -2
- package/dist/browser/{flowChanges-BvSWezEb.js → flowChanges-CnOOPJJR.js} +15 -12
- package/dist/browser/{flowWorkspace-BKnMRClO.js → flowWorkspace-B79fy3Me.js} +8 -8
- package/dist/browser/{markdownContent-BR9-1ikU.js → markdownContent-D0BBrFcF.js} +1 -1
- package/dist/browser/preview.css +12 -10
- package/dist/browser/preview.js +3 -1
- package/dist/browser/theme.css +3 -1
- package/dist/browser/{tooltip-DSBF3bRw.js → tooltip-BZ6tpqnr.js} +3 -1
- package/dist/browser/ui.css +12 -10
- package/dist/browser/ui.d.ts +1 -0
- package/dist/browser/ui.js +110 -63
- package/dist/browser/workbench.css +12 -10
- package/dist/browser/workbench.js +7 -7
- package/dist/browser/{workbenchSelect-Di1Bm_-d.js → workbenchSelect-CHOeceKA.js} +2 -2
- package/dist/browser/{wrapLayout-B0AT8_-i.js → wrapLayout-BB_qwy3k.js} +1 -1
- package/dist/command/index.js +32 -32
- package/dist/common/control-api-conformance.js +12 -9
- package/dist/common/control-api.js +12 -9
- package/dist/common/control-requests.js +8 -2
- package/dist/common/flow-semantics.js +7 -1
- package/dist/common/mcp.js +12 -9
- package/dist/render/browser/runtime.css +12 -10
- package/dist/render/browser/runtime.js +3 -1
- package/package.json +1 -1
- package/src/control/common/api.ts +13 -9
- package/src/control/common/authoring.ts +2 -1
- package/src/flow/common/graph.ts +10 -1
|
@@ -12476,6 +12476,14 @@ function runEvents(value) {
|
|
|
12476
12476
|
};
|
|
12477
12477
|
}
|
|
12478
12478
|
var segment = encodeURIComponent;
|
|
12479
|
+
async function responseJson(response, signal) {
|
|
12480
|
+
try {
|
|
12481
|
+
return await response.json();
|
|
12482
|
+
} catch (error) {
|
|
12483
|
+
if (signal?.aborted) throw signal.reason ?? error;
|
|
12484
|
+
return invalidResponse(`HTTP ${response.status} response body is not JSON.`);
|
|
12485
|
+
}
|
|
12486
|
+
}
|
|
12479
12487
|
function operationKey(operation) {
|
|
12480
12488
|
return `${operation}-${randomId()}`;
|
|
12481
12489
|
}
|
|
@@ -12774,7 +12782,7 @@ var ControlClient = class {
|
|
|
12774
12782
|
};
|
|
12775
12783
|
return {
|
|
12776
12784
|
modified: true,
|
|
12777
|
-
data: query.decode(await response
|
|
12785
|
+
data: query.decode(await responseJson(response, signal)),
|
|
12778
12786
|
etag: nextETag
|
|
12779
12787
|
};
|
|
12780
12788
|
}
|
|
@@ -12803,7 +12811,7 @@ var ControlClient = class {
|
|
|
12803
12811
|
};
|
|
12804
12812
|
}
|
|
12805
12813
|
return {
|
|
12806
|
-
data: decodeTriggerCatalog(await response
|
|
12814
|
+
data: decodeTriggerCatalog(await responseJson(response, signal)),
|
|
12807
12815
|
etag: response.headers.get("etag")?.trim() || null
|
|
12808
12816
|
};
|
|
12809
12817
|
}
|
|
@@ -13312,7 +13320,7 @@ var ControlClient = class {
|
|
|
13312
13320
|
try {
|
|
13313
13321
|
value = await response.json();
|
|
13314
13322
|
} catch {
|
|
13315
|
-
return invalidResponse();
|
|
13323
|
+
return invalidResponse(`HTTP ${response.status} response did not include a JSON error body.`);
|
|
13316
13324
|
}
|
|
13317
13325
|
const error = record$1(value).error;
|
|
13318
13326
|
const source = error == null ? void 0 : record$1(error);
|
|
@@ -13321,12 +13329,7 @@ var ControlClient = class {
|
|
|
13321
13329
|
return response;
|
|
13322
13330
|
}
|
|
13323
13331
|
async request(path, init = {}) {
|
|
13324
|
-
|
|
13325
|
-
try {
|
|
13326
|
-
return await response.json();
|
|
13327
|
-
} catch {
|
|
13328
|
-
return invalidResponse();
|
|
13329
|
-
}
|
|
13332
|
+
return await responseJson(await this.response(path, init), init.signal);
|
|
13330
13333
|
}
|
|
13331
13334
|
};
|
|
13332
13335
|
//#endregion
|
|
@@ -13165,6 +13165,14 @@ function runEvents(value) {
|
|
|
13165
13165
|
};
|
|
13166
13166
|
}
|
|
13167
13167
|
var segment = encodeURIComponent;
|
|
13168
|
+
async function responseJson(response, signal) {
|
|
13169
|
+
try {
|
|
13170
|
+
return await response.json();
|
|
13171
|
+
} catch (error) {
|
|
13172
|
+
if (signal?.aborted) throw signal.reason ?? error;
|
|
13173
|
+
return invalidResponse(`HTTP ${response.status} response body is not JSON.`);
|
|
13174
|
+
}
|
|
13175
|
+
}
|
|
13168
13176
|
function operationKey(operation) {
|
|
13169
13177
|
return `${operation}-${randomId()}`;
|
|
13170
13178
|
}
|
|
@@ -13463,7 +13471,7 @@ var ControlClient = class {
|
|
|
13463
13471
|
};
|
|
13464
13472
|
return {
|
|
13465
13473
|
modified: true,
|
|
13466
|
-
data: query.decode(await response
|
|
13474
|
+
data: query.decode(await responseJson(response, signal)),
|
|
13467
13475
|
etag: nextETag
|
|
13468
13476
|
};
|
|
13469
13477
|
}
|
|
@@ -13492,7 +13500,7 @@ var ControlClient = class {
|
|
|
13492
13500
|
};
|
|
13493
13501
|
}
|
|
13494
13502
|
return {
|
|
13495
|
-
data: decodeTriggerCatalog(await response
|
|
13503
|
+
data: decodeTriggerCatalog(await responseJson(response, signal)),
|
|
13496
13504
|
etag: response.headers.get("etag")?.trim() || null
|
|
13497
13505
|
};
|
|
13498
13506
|
}
|
|
@@ -14001,7 +14009,7 @@ var ControlClient = class {
|
|
|
14001
14009
|
try {
|
|
14002
14010
|
value = await response.json();
|
|
14003
14011
|
} catch {
|
|
14004
|
-
return invalidResponse();
|
|
14012
|
+
return invalidResponse(`HTTP ${response.status} response did not include a JSON error body.`);
|
|
14005
14013
|
}
|
|
14006
14014
|
const error = record(value).error;
|
|
14007
14015
|
const source = error == null ? void 0 : record(error);
|
|
@@ -14010,12 +14018,7 @@ var ControlClient = class {
|
|
|
14010
14018
|
return response;
|
|
14011
14019
|
}
|
|
14012
14020
|
async request(path, init = {}) {
|
|
14013
|
-
|
|
14014
|
-
try {
|
|
14015
|
-
return await response.json();
|
|
14016
|
-
} catch {
|
|
14017
|
-
return invalidResponse();
|
|
14018
|
-
}
|
|
14021
|
+
return await responseJson(await this.response(path, init), init.signal);
|
|
14019
14022
|
}
|
|
14020
14023
|
};
|
|
14021
14024
|
//#endregion
|
|
@@ -16388,6 +16388,12 @@ function sourceOutputLabel(source) {
|
|
|
16388
16388
|
function isResolutionNode(node) {
|
|
16389
16389
|
return node?.kind == "approval" || node?.kind == "wait";
|
|
16390
16390
|
}
|
|
16391
|
+
function keywordMismatchDetail(mismatch) {
|
|
16392
|
+
if (mismatch?.kind != "keyword") return "";
|
|
16393
|
+
const location = mismatch.path.length == 0 ? "" : ` at ${mismatch.path.join(".")}`;
|
|
16394
|
+
const declared = mismatch.source === void 0 ? "does not declare it" : `declares ${JSON.stringify(mismatch.source)}`;
|
|
16395
|
+
return ` The input requires ${mismatch.keyword} ${JSON.stringify(mismatch.target)}${location}; the output ${declared}.`;
|
|
16396
|
+
}
|
|
16391
16397
|
function graphDiagnostic(code, message, path, values, mismatch) {
|
|
16392
16398
|
return {
|
|
16393
16399
|
code,
|
|
@@ -16610,7 +16616,7 @@ function checkSource(source, graph, document, targetInput, path, diagnostics) {
|
|
|
16610
16616
|
}
|
|
16611
16617
|
if (targetInput != null) {
|
|
16612
16618
|
const comparison = comparePorts(selected, targetInput);
|
|
16613
|
-
if (comparison.kind != "compatible") diagnostics.push(graphDiagnostic("graph.node-output-incompatible", `Upstream node "${source.nodeId}" output ${JSON.stringify(sourceOutputLabel(source))} is not compatible with this input
|
|
16619
|
+
if (comparison.kind != "compatible") diagnostics.push(graphDiagnostic("graph.node-output-incompatible", `Upstream node "${source.nodeId}" output ${JSON.stringify(sourceOutputLabel(source))} is not compatible with this input.${comparison.kind == "incompatible" ? keywordMismatchDetail(comparison.mismatch) : ""}`, path, {
|
|
16614
16620
|
nodeId: source.nodeId,
|
|
16615
16621
|
output: source.output,
|
|
16616
16622
|
...source.field === void 0 ? {} : { field: source.field }
|
|
@@ -18115,7 +18121,7 @@ async function compileAuthoring(base, request, host) {
|
|
|
18115
18121
|
operations.push(...checked);
|
|
18116
18122
|
}
|
|
18117
18123
|
function resolve(ref) {
|
|
18118
|
-
return ref.startsWith("$") ? (Object.hasOwn(aliases, ref.slice(1)) ? aliases[ref.slice(1)] : void 0) ?? fail("node.alias-missing", `Unknown alias ${ref}.`) : ref;
|
|
18124
|
+
return ref.startsWith("$") ? (Object.hasOwn(aliases, ref.slice(1)) ? aliases[ref.slice(1)] : void 0) ?? fail("node.alias-missing", `Unknown alias ${ref}. Set the as field to ${JSON.stringify(ref.slice(1))} on an earlier node.add in the same request.`) : ref;
|
|
18119
18125
|
}
|
|
18120
18126
|
function source(value) {
|
|
18121
18127
|
if (value.kind == "output" || value.kind == "system") {
|
|
@@ -12879,6 +12879,12 @@ function sourceOutputLabel(source) {
|
|
|
12879
12879
|
function isResolutionNode(node) {
|
|
12880
12880
|
return node?.kind == "approval" || node?.kind == "wait";
|
|
12881
12881
|
}
|
|
12882
|
+
function keywordMismatchDetail(mismatch) {
|
|
12883
|
+
if (mismatch?.kind != "keyword") return "";
|
|
12884
|
+
const location = mismatch.path.length == 0 ? "" : ` at ${mismatch.path.join(".")}`;
|
|
12885
|
+
const declared = mismatch.source === void 0 ? "does not declare it" : `declares ${JSON.stringify(mismatch.source)}`;
|
|
12886
|
+
return ` The input requires ${mismatch.keyword} ${JSON.stringify(mismatch.target)}${location}; the output ${declared}.`;
|
|
12887
|
+
}
|
|
12882
12888
|
function graphDiagnostic(code, message, path, values, mismatch) {
|
|
12883
12889
|
return {
|
|
12884
12890
|
code,
|
|
@@ -13101,7 +13107,7 @@ function checkSource(source, graph, document, targetInput, path, diagnostics) {
|
|
|
13101
13107
|
}
|
|
13102
13108
|
if (targetInput != null) {
|
|
13103
13109
|
const comparison = comparePorts(selected, targetInput);
|
|
13104
|
-
if (comparison.kind != "compatible") diagnostics.push(graphDiagnostic("graph.node-output-incompatible", `Upstream node "${source.nodeId}" output ${JSON.stringify(sourceOutputLabel(source))} is not compatible with this input
|
|
13110
|
+
if (comparison.kind != "compatible") diagnostics.push(graphDiagnostic("graph.node-output-incompatible", `Upstream node "${source.nodeId}" output ${JSON.stringify(sourceOutputLabel(source))} is not compatible with this input.${comparison.kind == "incompatible" ? keywordMismatchDetail(comparison.mismatch) : ""}`, path, {
|
|
13105
13111
|
nodeId: source.nodeId,
|
|
13106
13112
|
output: source.output,
|
|
13107
13113
|
...source.field === void 0 ? {} : { field: source.field }
|
package/dist/common/mcp.js
CHANGED
|
@@ -12666,6 +12666,14 @@ function runEvents(value) {
|
|
|
12666
12666
|
};
|
|
12667
12667
|
}
|
|
12668
12668
|
var segment = encodeURIComponent;
|
|
12669
|
+
async function responseJson(response, signal) {
|
|
12670
|
+
try {
|
|
12671
|
+
return await response.json();
|
|
12672
|
+
} catch (error) {
|
|
12673
|
+
if (signal?.aborted) throw signal.reason ?? error;
|
|
12674
|
+
return invalidResponse(`HTTP ${response.status} response body is not JSON.`);
|
|
12675
|
+
}
|
|
12676
|
+
}
|
|
12669
12677
|
function operationKey(operation) {
|
|
12670
12678
|
return `${operation}-${randomId()}`;
|
|
12671
12679
|
}
|
|
@@ -12964,7 +12972,7 @@ var ControlClient = class {
|
|
|
12964
12972
|
};
|
|
12965
12973
|
return {
|
|
12966
12974
|
modified: true,
|
|
12967
|
-
data: query.decode(await response
|
|
12975
|
+
data: query.decode(await responseJson(response, signal)),
|
|
12968
12976
|
etag: nextETag
|
|
12969
12977
|
};
|
|
12970
12978
|
}
|
|
@@ -12993,7 +13001,7 @@ var ControlClient = class {
|
|
|
12993
13001
|
};
|
|
12994
13002
|
}
|
|
12995
13003
|
return {
|
|
12996
|
-
data: decodeTriggerCatalog(await response
|
|
13004
|
+
data: decodeTriggerCatalog(await responseJson(response, signal)),
|
|
12997
13005
|
etag: response.headers.get("etag")?.trim() || null
|
|
12998
13006
|
};
|
|
12999
13007
|
}
|
|
@@ -13502,7 +13510,7 @@ var ControlClient = class {
|
|
|
13502
13510
|
try {
|
|
13503
13511
|
value = await response.json();
|
|
13504
13512
|
} catch {
|
|
13505
|
-
return invalidResponse();
|
|
13513
|
+
return invalidResponse(`HTTP ${response.status} response did not include a JSON error body.`);
|
|
13506
13514
|
}
|
|
13507
13515
|
const error = record(value).error;
|
|
13508
13516
|
const source = error == null ? void 0 : record(error);
|
|
@@ -13511,12 +13519,7 @@ var ControlClient = class {
|
|
|
13511
13519
|
return response;
|
|
13512
13520
|
}
|
|
13513
13521
|
async request(path, init = {}) {
|
|
13514
|
-
|
|
13515
|
-
try {
|
|
13516
|
-
return await response.json();
|
|
13517
|
-
} catch {
|
|
13518
|
-
return invalidResponse();
|
|
13519
|
-
}
|
|
13522
|
+
return await responseJson(await this.response(path, init), init.signal);
|
|
13520
13523
|
}
|
|
13521
13524
|
};
|
|
13522
13525
|
//#endregion
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
.open-flow-theme {
|
|
94
94
|
--_open-flow-theme: light;
|
|
95
|
-
color-scheme:
|
|
95
|
+
color-scheme: light;
|
|
96
96
|
--_open-flow-background: var(--open-flow-background, light-dark(#fdfdfd, #1c1c1c));
|
|
97
97
|
--_open-flow-foreground: var(--open-flow-foreground, light-dark(#242424, #eee));
|
|
98
98
|
--_open-flow-card: var(--open-flow-card, light-dark(#fefefe, #242424));
|
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
|
|
132
132
|
.open-flow-theme[data-theme="dark"] {
|
|
133
133
|
--_open-flow-theme: dark;
|
|
134
|
+
color-scheme: dark;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
.open-flow-theme, .open-flow-canvas-root :is(.react-flow__controls, [data-canvas-control-scope]) {
|
|
@@ -1450,6 +1451,10 @@
|
|
|
1450
1451
|
min-height: min(360px, 80dvh);
|
|
1451
1452
|
}
|
|
1452
1453
|
|
|
1454
|
+
:where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .min-h-min {
|
|
1455
|
+
min-height: min-content;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1453
1458
|
:where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .w-\(--anchor-width\) {
|
|
1454
1459
|
width: var(--anchor-width);
|
|
1455
1460
|
}
|
|
@@ -6131,23 +6136,20 @@
|
|
|
6131
6136
|
}
|
|
6132
6137
|
|
|
6133
6138
|
.open-flow-navigation-menu {
|
|
6139
|
+
width: max-content;
|
|
6140
|
+
max-width: calc(100vw - 16px);
|
|
6141
|
+
max-height: var(--available-height);
|
|
6142
|
+
overscroll-behavior: contain;
|
|
6134
6143
|
border: 1px solid var(--ui-border);
|
|
6135
6144
|
border-radius: var(--ui-radius);
|
|
6136
6145
|
background: var(--ui-popover);
|
|
6137
6146
|
color: var(--ui-popover-foreground);
|
|
6138
|
-
|
|
6147
|
+
gap: 0;
|
|
6139
6148
|
padding: 4px;
|
|
6140
|
-
|
|
6141
|
-
inset: 48px 16px auto auto;
|
|
6149
|
+
overflow-y: auto;
|
|
6142
6150
|
box-shadow: 0 4px 12px #0002;
|
|
6143
6151
|
}
|
|
6144
6152
|
|
|
6145
|
-
.open-flow-navigation-menu:popover-open {
|
|
6146
|
-
flex-direction: column;
|
|
6147
|
-
align-items: stretch;
|
|
6148
|
-
display: flex;
|
|
6149
|
-
}
|
|
6150
|
-
|
|
6151
6153
|
.open-flow-navigation-menu button[aria-pressed="true"] {
|
|
6152
6154
|
background: var(--ui-muted);
|
|
6153
6155
|
}
|
|
@@ -62819,6 +62819,7 @@ var OpenFlowRenderer = (function(exports) {
|
|
|
62819
62819
|
//#region src/ui/browser/button.tsx
|
|
62820
62820
|
var buttonVariants = cva("nodrag group/button relative inline-flex shrink-0 items-center justify-center rounded-[var(--ui-control-radius,calc(var(--ui-radius)_+_2px))] border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap no-underline transition-[color,background-color,border-color,box-shadow,opacity,transform] outline-none select-none before:absolute before:inset-0 before:content-[''] motion-reduce:transition-none focus-visible:border-border focus-visible:outline-2 focus-visible:outline-solid focus-visible:ring-0 focus-visible:aria-invalid:ring-0 focus-visible:outline-offset-1 focus-visible:outline-ring focus-visible:aria-invalid:outline-destructive active:not-aria-[haspopup]:not-data-[variant=field]:translate-y-px disabled:pointer-events-none disabled:opacity-[var(--ui-disabled-opacity,0.5)] aria-disabled:pointer-events-none aria-disabled:opacity-[var(--ui-disabled-opacity,0.5)] aria-invalid:border-destructive [&_svg]:pointer-events-none [&_i[aria-hidden=true]]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
62821
62821
|
variants: {
|
|
62822
|
+
multiline: { true: "min-h-min whitespace-normal wrap-anywhere text-center" },
|
|
62822
62823
|
variant: {
|
|
62823
62824
|
"default": "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
62824
62825
|
"outline": "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-[var(--ui-disabled-background,color-mix(in_srgb,var(--ui-input)_50%,transparent))]",
|
|
@@ -62847,7 +62848,7 @@ var OpenFlowRenderer = (function(exports) {
|
|
|
62847
62848
|
size: "default"
|
|
62848
62849
|
}
|
|
62849
62850
|
});
|
|
62850
|
-
var Button = (0, import_react$4.forwardRef)(function Button({ className, variant = "default", size = "default", ...props }, ref) {
|
|
62851
|
+
var Button = (0, import_react$4.forwardRef)(function Button({ className, variant = "default", size = "default", multiline, ...props }, ref) {
|
|
62851
62852
|
return /* @__PURE__ */ (0, import_jsx_runtime$2.jsx)(Button$1, {
|
|
62852
62853
|
ref,
|
|
62853
62854
|
"data-slot": "button",
|
|
@@ -62856,6 +62857,7 @@ var OpenFlowRenderer = (function(exports) {
|
|
|
62856
62857
|
className: cn(buttonVariants({
|
|
62857
62858
|
variant,
|
|
62858
62859
|
size,
|
|
62860
|
+
multiline,
|
|
62859
62861
|
className
|
|
62860
62862
|
})),
|
|
62861
62863
|
...props
|
package/package.json
CHANGED
|
@@ -857,6 +857,15 @@ function runEvents(value: unknown): RunEvents {
|
|
|
857
857
|
|
|
858
858
|
const segment = encodeURIComponent
|
|
859
859
|
|
|
860
|
+
async function responseJson(response: Response, signal: AbortSignal | null | undefined): Promise<unknown> {
|
|
861
|
+
try {
|
|
862
|
+
return await response.json()
|
|
863
|
+
} catch (error) {
|
|
864
|
+
if (signal?.aborted) throw signal.reason ?? error
|
|
865
|
+
return invalidResponse(`HTTP ${response.status} response body is not JSON.`)
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
|
|
860
869
|
function operationKey(operation: string): string {
|
|
861
870
|
return `${operation}-${randomId()}`
|
|
862
871
|
}
|
|
@@ -1158,7 +1167,7 @@ export class ControlClient {
|
|
|
1158
1167
|
const response = await this.response(query.path, { headers, signal }, true)
|
|
1159
1168
|
const nextETag = response.headers.get('etag')?.trim() || null
|
|
1160
1169
|
if (response.status == 304) return { modified: false, etag: nextETag }
|
|
1161
|
-
return { modified: true, data: query.decode(await response
|
|
1170
|
+
return { modified: true, data: query.decode(await responseJson(response, signal)), etag: nextETag }
|
|
1162
1171
|
}
|
|
1163
1172
|
|
|
1164
1173
|
async getTriggerCatalog(locale: string, cached?: TriggerCatalogCache, signal?: AbortSignal): Promise<TriggerCatalogCache> {
|
|
@@ -1177,7 +1186,7 @@ export class ControlClient {
|
|
|
1177
1186
|
if (cached == null) return invalidResponse()
|
|
1178
1187
|
return { ...cached, etag: response.headers.get('etag')?.trim() || cached.etag }
|
|
1179
1188
|
}
|
|
1180
|
-
return { data: decodeTriggerCatalog(await response
|
|
1189
|
+
return { data: decodeTriggerCatalog(await responseJson(response, signal)), etag: response.headers.get('etag')?.trim() || null }
|
|
1181
1190
|
}
|
|
1182
1191
|
|
|
1183
1192
|
async getTriggerKey(key: string, signal?: AbortSignal): Promise<TriggerKeySnapshot> {
|
|
@@ -1746,7 +1755,7 @@ export class ControlClient {
|
|
|
1746
1755
|
try {
|
|
1747
1756
|
value = await response.json()
|
|
1748
1757
|
} catch {
|
|
1749
|
-
return invalidResponse()
|
|
1758
|
+
return invalidResponse(`HTTP ${response.status} response did not include a JSON error body.`)
|
|
1750
1759
|
}
|
|
1751
1760
|
const error = record(value).error
|
|
1752
1761
|
const source = error == null ? undefined : record(error)
|
|
@@ -1761,11 +1770,6 @@ export class ControlClient {
|
|
|
1761
1770
|
}
|
|
1762
1771
|
|
|
1763
1772
|
protected async request<Value = unknown>(path: string, init: RequestInit = {}): Promise<Value> {
|
|
1764
|
-
|
|
1765
|
-
try {
|
|
1766
|
-
return (await response.json()) as Value
|
|
1767
|
-
} catch {
|
|
1768
|
-
return invalidResponse()
|
|
1769
|
-
}
|
|
1773
|
+
return (await responseJson(await this.response(path, init), init.signal)) as Value
|
|
1770
1774
|
}
|
|
1771
1775
|
}
|
|
@@ -363,7 +363,8 @@ export async function compileAuthoring(base: RevisionContent, request: Authoring
|
|
|
363
363
|
}
|
|
364
364
|
function resolve(ref: string) {
|
|
365
365
|
return ref.startsWith('$')
|
|
366
|
-
? ((Object.hasOwn(aliases, ref.slice(1)) ? aliases[ref.slice(1)] : undefined) ??
|
|
366
|
+
? ((Object.hasOwn(aliases, ref.slice(1)) ? aliases[ref.slice(1)] : undefined) ??
|
|
367
|
+
fail('node.alias-missing', `Unknown alias ${ref}. Set the as field to ${JSON.stringify(ref.slice(1))} on an earlier node.add in the same request.`))
|
|
367
368
|
: ref
|
|
368
369
|
}
|
|
369
370
|
function source(
|
package/src/flow/common/graph.ts
CHANGED
|
@@ -39,6 +39,13 @@ import {
|
|
|
39
39
|
export function isResolutionNode(node: GraphNode | undefined): node is Extract<GraphNode, { readonly kind: 'approval' | 'wait' }> {
|
|
40
40
|
return node?.kind == 'approval' || node?.kind == 'wait'
|
|
41
41
|
}
|
|
42
|
+
function keywordMismatchDetail(mismatch: SchemaMismatch | undefined): string {
|
|
43
|
+
if (mismatch?.kind != 'keyword') return ''
|
|
44
|
+
const location = mismatch.path.length == 0 ? '' : ` at ${mismatch.path.join('.')}`
|
|
45
|
+
const declared = mismatch.source === undefined ? 'does not declare it' : `declares ${JSON.stringify(mismatch.source)}`
|
|
46
|
+
return ` The input requires ${mismatch.keyword} ${JSON.stringify(mismatch.target)}${location}; the output ${declared}.`
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
function graphDiagnostic(
|
|
43
50
|
code: string,
|
|
44
51
|
message: string,
|
|
@@ -369,7 +376,9 @@ function checkSource(
|
|
|
369
376
|
diagnostics.push(
|
|
370
377
|
graphDiagnostic(
|
|
371
378
|
'graph.node-output-incompatible',
|
|
372
|
-
`Upstream node "${source.nodeId}" output ${JSON.stringify(sourceOutputLabel(source))} is not compatible with this input
|
|
379
|
+
`Upstream node "${source.nodeId}" output ${JSON.stringify(sourceOutputLabel(source))} is not compatible with this input.${
|
|
380
|
+
comparison.kind == 'incompatible' ? keywordMismatchDetail(comparison.mismatch) : ''
|
|
381
|
+
}`,
|
|
373
382
|
path,
|
|
374
383
|
{ nodeId: source.nodeId, output: source.output, ...(source.field === undefined ? {} : { field: source.field }) },
|
|
375
384
|
comparison.kind == 'incompatible' ? comparison.mismatch : undefined,
|