@bian-womp/spark-workbench 0.3.11 → 0.3.13
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/lib/cjs/index.cjs +145 -140
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/WorkbenchCanvas.d.ts.map +1 -1
- package/lib/cjs/src/misc/WorkbenchStudio.d.ts.map +1 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/cjs/src/runtime/RemoteGraphRunner.d.ts +8 -2
- package/lib/cjs/src/runtime/RemoteGraphRunner.d.ts.map +1 -1
- package/lib/esm/index.js +145 -140
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/misc/WorkbenchCanvas.d.ts.map +1 -1
- package/lib/esm/src/misc/WorkbenchStudio.d.ts.map +1 -1
- package/lib/esm/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/esm/src/runtime/RemoteGraphRunner.d.ts +8 -2
- package/lib/esm/src/runtime/RemoteGraphRunner.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchCanvas.d.ts","sourceRoot":"","sources":["../../../../src/misc/WorkbenchCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,EAOL,iBAAiB,EACjB,IAAI,EACJ,IAAI,EACJ,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAuB1D,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,MAAM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AC;IACd,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE;QACd,EAAE,EAAE,iBAAiB,CAAC;QACtB,MAAM,EAAE,YAAY,CAAC;QACrB,eAAe,EAAE,CACf,GAAG,EAAE,eAAe,EACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC7C,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB,KAAK,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,GAAG,EAAE,eAAe,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACjD,KAAK,IAAI,CAAC;CACZ,2CAiGA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAYf,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAa1D,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAiB5B,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,iBAAiB,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,
|
|
1
|
+
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAYf,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAa1D,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAiB5B,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,iBAAiB,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAkjCA"}
|
|
@@ -14,14 +14,20 @@ export declare class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
14
14
|
private valueCache;
|
|
15
15
|
private listenersBound;
|
|
16
16
|
private registryFetched;
|
|
17
|
-
private
|
|
17
|
+
private registryFetchPromise?;
|
|
18
18
|
private readonly MAX_REGISTRY_FETCH_ATTEMPTS;
|
|
19
19
|
private readonly INITIAL_RETRY_DELAY_MS;
|
|
20
|
+
private readonly REGISTRY_FETCH_TIMEOUT_MS;
|
|
20
21
|
/**
|
|
21
22
|
* Fetch full registry description from remote and register it locally.
|
|
22
|
-
*
|
|
23
|
+
* Simplified with straightforward retry loop.
|
|
24
|
+
* Ensures only one fetch happens at a time, even with concurrent calls.
|
|
23
25
|
*/
|
|
24
26
|
private fetchRegistry;
|
|
27
|
+
/**
|
|
28
|
+
* Internal method that performs the actual registry fetch.
|
|
29
|
+
*/
|
|
30
|
+
private _doFetchRegistry;
|
|
25
31
|
/**
|
|
26
32
|
* Build RemoteRuntimeClient config from RemoteExecutionBackend config.
|
|
27
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteGraphRunner.d.ts","sourceRoot":"","sources":["../../../../src/runtime/RemoteGraphRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,OAAO,EACR,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,YAAY,EACZ,mBAAmB,EAGpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EAGtB,eAAe,EACf,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D,qBAAa,iBAAkB,SAAQ,mBAAmB;IACxD,SAAS,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;IACpC,SAAS,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IACvC,SAAS,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAChC,OAAO,CAAC,aAAa,CAAC,CAA+B;IACrD,OAAO,CAAC,0BAA0B,CAAC,CAAa;IAChD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,sBAAsB,CAAkB;IAChD,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC,OA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ACxC,OAAO,CAAC,IAAI,CAAC;IAchB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IASrD,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoBzE,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA6BlE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA0C9B;;;OAGG;IACH,EAAE,CAAC,CAAC,SAAS,eAAe,EAC1B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC9B,MAAM,IAAI;CAiBd"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1385,116 +1385,145 @@ let remoteRunnerCounter = 0;
|
|
|
1385
1385
|
class RemoteGraphRunner extends AbstractGraphRunner {
|
|
1386
1386
|
/**
|
|
1387
1387
|
* Fetch full registry description from remote and register it locally.
|
|
1388
|
-
*
|
|
1388
|
+
* Simplified with straightforward retry loop.
|
|
1389
|
+
* Ensures only one fetch happens at a time, even with concurrent calls.
|
|
1389
1390
|
*/
|
|
1390
|
-
async fetchRegistry(client
|
|
1391
|
-
if (this.
|
|
1392
|
-
// Already fetching, don't start another fetch
|
|
1391
|
+
async fetchRegistry(client) {
|
|
1392
|
+
if (this.registryFetched) {
|
|
1393
1393
|
return;
|
|
1394
1394
|
}
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1395
|
+
// If already fetching, wait for that fetch to complete
|
|
1396
|
+
if (this.registryFetchPromise) {
|
|
1397
|
+
return this.registryFetchPromise;
|
|
1398
|
+
}
|
|
1399
|
+
// Create promise wrapper and assign atomically to prevent race conditions
|
|
1400
|
+
// This ensures concurrent calls will see the promise and wait for it
|
|
1401
|
+
let promise;
|
|
1402
|
+
this.registryFetchPromise = promise = (async () => {
|
|
1403
|
+
try {
|
|
1404
|
+
await this._doFetchRegistry(client);
|
|
1405
|
+
}
|
|
1406
|
+
finally {
|
|
1407
|
+
// Clear the promise after completion (success or failure)
|
|
1408
|
+
this.registryFetchPromise = undefined;
|
|
1409
|
+
}
|
|
1410
|
+
})();
|
|
1411
|
+
return promise;
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Internal method that performs the actual registry fetch.
|
|
1415
|
+
*/
|
|
1416
|
+
async _doFetchRegistry(client) {
|
|
1417
|
+
let lastError;
|
|
1418
|
+
for (let attempt = 1; attempt <= this.MAX_REGISTRY_FETCH_ATTEMPTS; attempt++) {
|
|
1419
|
+
try {
|
|
1420
|
+
// Add timeout to registry fetch - if it exceeds 3s, retry
|
|
1421
|
+
let timeoutId;
|
|
1422
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
1423
|
+
timeoutId = setTimeout(() => reject(new Error("Registry fetch timeout (3s exceeded)")), this.REGISTRY_FETCH_TIMEOUT_MS);
|
|
1424
|
+
});
|
|
1425
|
+
const fetchPromise = client.api.describeRegistry().finally(() => {
|
|
1426
|
+
// Clear timeout if request completes first
|
|
1427
|
+
if (timeoutId) {
|
|
1428
|
+
clearTimeout(timeoutId);
|
|
1429
|
+
timeoutId = undefined;
|
|
1430
|
+
}
|
|
1431
|
+
});
|
|
1432
|
+
const desc = await Promise.race([fetchPromise, timeoutPromise]);
|
|
1433
|
+
// Register types
|
|
1434
|
+
for (const t of desc.types) {
|
|
1435
|
+
if (t.options) {
|
|
1436
|
+
this.registry.registerEnum({
|
|
1410
1437
|
id: t.id,
|
|
1411
|
-
|
|
1412
|
-
validate: (_v) => true,
|
|
1438
|
+
options: t.options,
|
|
1413
1439
|
bakeTarget: t.bakeTarget,
|
|
1414
1440
|
});
|
|
1415
1441
|
}
|
|
1442
|
+
else {
|
|
1443
|
+
if (!this.registry.types.has(t.id)) {
|
|
1444
|
+
this.registry.registerType({
|
|
1445
|
+
id: t.id,
|
|
1446
|
+
displayName: t.displayName,
|
|
1447
|
+
validate: (_v) => true,
|
|
1448
|
+
bakeTarget: t.bakeTarget,
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1416
1452
|
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1453
|
+
// Register categories
|
|
1454
|
+
for (const c of desc.categories || []) {
|
|
1455
|
+
if (!this.registry.categories.has(c.id)) {
|
|
1456
|
+
// Create placeholder category descriptor
|
|
1457
|
+
const category = {
|
|
1458
|
+
id: c.id,
|
|
1459
|
+
displayName: c.displayName,
|
|
1460
|
+
createRuntime: () => ({
|
|
1461
|
+
async onInputsChanged() { },
|
|
1462
|
+
}),
|
|
1463
|
+
policy: { asyncConcurrency: "switch" },
|
|
1464
|
+
};
|
|
1465
|
+
this.registry.categories.register(category);
|
|
1466
|
+
}
|
|
1431
1467
|
}
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
}
|
|
1468
|
+
// Register coercions
|
|
1469
|
+
for (const c of desc.coercions) {
|
|
1470
|
+
if (c.async) {
|
|
1471
|
+
this.registry.registerAsyncCoercion(c.from, c.to, async (v) => v, {
|
|
1472
|
+
nonTransitive: c.nonTransitive,
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
else {
|
|
1476
|
+
this.registry.registerCoercion(c.from, c.to, (v) => v, {
|
|
1477
|
+
nonTransitive: c.nonTransitive,
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1439
1480
|
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1481
|
+
// Register nodes
|
|
1482
|
+
for (const n of desc.nodes) {
|
|
1483
|
+
if (!this.registry.nodes.has(n.id)) {
|
|
1484
|
+
this.registry.registerNode({
|
|
1485
|
+
id: n.id,
|
|
1486
|
+
categoryId: n.categoryId,
|
|
1487
|
+
displayName: n.displayName,
|
|
1488
|
+
inputs: n.inputs || {},
|
|
1489
|
+
outputs: n.outputs || {},
|
|
1490
|
+
policy: n.policy || {},
|
|
1491
|
+
impl: () => { },
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1444
1494
|
}
|
|
1495
|
+
this.registryFetched = true;
|
|
1496
|
+
this.emit("registry", this.registry);
|
|
1497
|
+
return;
|
|
1445
1498
|
}
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
if (
|
|
1449
|
-
this.
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1499
|
+
catch (err) {
|
|
1500
|
+
lastError = err instanceof Error ? err : new Error(String(err));
|
|
1501
|
+
if (attempt < this.MAX_REGISTRY_FETCH_ATTEMPTS) {
|
|
1502
|
+
const delayMs = this.INITIAL_RETRY_DELAY_MS * Math.pow(2, attempt - 1);
|
|
1503
|
+
console.warn(`Failed to fetch registry (attempt ${attempt}/${this.MAX_REGISTRY_FETCH_ATTEMPTS}), retrying in ${delayMs}ms...`, lastError);
|
|
1504
|
+
// Emit error event for UI feedback
|
|
1505
|
+
this.emit("error", {
|
|
1506
|
+
kind: "registry",
|
|
1507
|
+
message: `Registry fetch failed (attempt ${attempt}/${this.MAX_REGISTRY_FETCH_ATTEMPTS}), retrying...`,
|
|
1508
|
+
err: lastError,
|
|
1509
|
+
attempt,
|
|
1510
|
+
maxAttempts: this.MAX_REGISTRY_FETCH_ATTEMPTS,
|
|
1457
1511
|
});
|
|
1512
|
+
// Wait before retrying
|
|
1513
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
1458
1514
|
}
|
|
1459
1515
|
}
|
|
1460
|
-
this.registryFetched = true;
|
|
1461
|
-
this.registryFetching = false;
|
|
1462
|
-
this.emit("registry", this.registry);
|
|
1463
|
-
}
|
|
1464
|
-
catch (err) {
|
|
1465
|
-
this.registryFetching = false;
|
|
1466
|
-
const error = err instanceof Error ? err : new Error(String(err));
|
|
1467
|
-
// Retry with exponential backoff if attempts remaining
|
|
1468
|
-
if (attempt < this.MAX_REGISTRY_FETCH_ATTEMPTS) {
|
|
1469
|
-
const delayMs = this.INITIAL_RETRY_DELAY_MS * Math.pow(2, attempt - 1);
|
|
1470
|
-
console.warn(`Failed to fetch registry (attempt ${attempt}/${this.MAX_REGISTRY_FETCH_ATTEMPTS}), retrying in ${delayMs}ms...`, error);
|
|
1471
|
-
// Emit error event for UI feedback
|
|
1472
|
-
this.emit("error", {
|
|
1473
|
-
kind: "registry",
|
|
1474
|
-
message: `Registry fetch failed (attempt ${attempt}/${this.MAX_REGISTRY_FETCH_ATTEMPTS}), retrying...`,
|
|
1475
|
-
err: error,
|
|
1476
|
-
attempt,
|
|
1477
|
-
maxAttempts: this.MAX_REGISTRY_FETCH_ATTEMPTS,
|
|
1478
|
-
});
|
|
1479
|
-
// Retry after delay
|
|
1480
|
-
setTimeout(() => {
|
|
1481
|
-
this.fetchRegistry(client, attempt + 1).catch(() => {
|
|
1482
|
-
// Final failure handled below
|
|
1483
|
-
});
|
|
1484
|
-
}, delayMs);
|
|
1485
|
-
}
|
|
1486
|
-
else {
|
|
1487
|
-
// Max attempts reached, emit final error
|
|
1488
|
-
console.error(`Failed to fetch registry after ${this.MAX_REGISTRY_FETCH_ATTEMPTS} attempts:`, error);
|
|
1489
|
-
this.emit("error", {
|
|
1490
|
-
kind: "registry",
|
|
1491
|
-
message: `Failed to fetch registry after ${this.MAX_REGISTRY_FETCH_ATTEMPTS} attempts. Please check your connection and try refreshing.`,
|
|
1492
|
-
err: error,
|
|
1493
|
-
attempt: this.MAX_REGISTRY_FETCH_ATTEMPTS,
|
|
1494
|
-
maxAttempts: this.MAX_REGISTRY_FETCH_ATTEMPTS,
|
|
1495
|
-
});
|
|
1496
|
-
}
|
|
1497
1516
|
}
|
|
1517
|
+
// Max attempts reached, emit final error and throw
|
|
1518
|
+
console.error(`Failed to fetch registry after ${this.MAX_REGISTRY_FETCH_ATTEMPTS} attempts:`, lastError);
|
|
1519
|
+
this.emit("error", {
|
|
1520
|
+
kind: "registry",
|
|
1521
|
+
message: `Failed to fetch registry after ${this.MAX_REGISTRY_FETCH_ATTEMPTS} attempts. Please check your connection and try refreshing.`,
|
|
1522
|
+
err: lastError,
|
|
1523
|
+
attempt: this.MAX_REGISTRY_FETCH_ATTEMPTS,
|
|
1524
|
+
maxAttempts: this.MAX_REGISTRY_FETCH_ATTEMPTS,
|
|
1525
|
+
});
|
|
1526
|
+
throw lastError;
|
|
1498
1527
|
}
|
|
1499
1528
|
/**
|
|
1500
1529
|
* Build RemoteRuntimeClient config from RemoteExecutionBackend config.
|
|
@@ -1549,7 +1578,9 @@ class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
1549
1578
|
return this.clientPromise;
|
|
1550
1579
|
const backend = this.backend;
|
|
1551
1580
|
// Create connection promise to prevent concurrent connections
|
|
1552
|
-
|
|
1581
|
+
// Create promise wrapper first, then assign immediately before async work starts
|
|
1582
|
+
let promise;
|
|
1583
|
+
this.clientPromise = promise = (async () => {
|
|
1553
1584
|
// Build client config from backend config
|
|
1554
1585
|
const clientConfig = this.buildClientConfig(backend);
|
|
1555
1586
|
// Wrap custom event handler to intercept flow-viewport events and emit viewport event
|
|
@@ -1581,23 +1612,18 @@ class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
1581
1612
|
this.client = client;
|
|
1582
1613
|
this.valueCache.clear();
|
|
1583
1614
|
this.listenersBound = false;
|
|
1584
|
-
//
|
|
1585
|
-
if (
|
|
1586
|
-
|
|
1615
|
+
// Fetch registry before returning (wait for it to complete)
|
|
1616
|
+
// Only fetch if not already fetched (handles concurrent calls)
|
|
1617
|
+
if (!this.registryFetched) {
|
|
1587
1618
|
console.info("[RemoteGraphRunner] Loading registry from remote...");
|
|
1588
|
-
this.fetchRegistry(client)
|
|
1589
|
-
|
|
1590
|
-
console.info("[RemoteGraphRunner] Loaded registry from remote");
|
|
1591
|
-
})
|
|
1592
|
-
.catch((err) => {
|
|
1593
|
-
console.error("[RemoteGraphRunner] Failed to fetch registry:", err);
|
|
1594
|
-
});
|
|
1619
|
+
await this.fetchRegistry(client);
|
|
1620
|
+
console.info("[RemoteGraphRunner] Loaded registry from remote");
|
|
1595
1621
|
}
|
|
1596
1622
|
// Clear promise on success
|
|
1597
1623
|
this.clientPromise = undefined;
|
|
1598
1624
|
return client;
|
|
1599
1625
|
})();
|
|
1600
|
-
return
|
|
1626
|
+
return promise;
|
|
1601
1627
|
}
|
|
1602
1628
|
constructor(backend) {
|
|
1603
1629
|
super(backend);
|
|
@@ -1605,9 +1631,9 @@ class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
1605
1631
|
this.valueCache = new Map();
|
|
1606
1632
|
this.listenersBound = false;
|
|
1607
1633
|
this.registryFetched = false;
|
|
1608
|
-
this.registryFetching = false;
|
|
1609
1634
|
this.MAX_REGISTRY_FETCH_ATTEMPTS = 3;
|
|
1610
1635
|
this.INITIAL_RETRY_DELAY_MS = 1000; // 1 second
|
|
1636
|
+
this.REGISTRY_FETCH_TIMEOUT_MS = 3000; // 3 seconds
|
|
1611
1637
|
// Generate readable ID for this runner instance (e.g., remote-001, remote-002)
|
|
1612
1638
|
remoteRunnerCounter++;
|
|
1613
1639
|
this.runnerId = `remote-${String(remoteRunnerCounter).padStart(3, "0")}`;
|
|
@@ -2032,7 +2058,6 @@ class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
2032
2058
|
const clientToDispose = this.client;
|
|
2033
2059
|
this.client = undefined;
|
|
2034
2060
|
this.registryFetched = false; // Reset so registry is fetched again on reconnect
|
|
2035
|
-
this.registryFetching = false; // Reset fetching state
|
|
2036
2061
|
if (clientToDispose) {
|
|
2037
2062
|
try {
|
|
2038
2063
|
await clientToDispose.dispose();
|
|
@@ -4387,7 +4412,7 @@ function WorkbenchProvider({ wb, runner, overrides, uiVersion, children, }) {
|
|
|
4387
4412
|
console.error("[WorkbenchContext] Error updating graph:", err);
|
|
4388
4413
|
}
|
|
4389
4414
|
});
|
|
4390
|
-
const
|
|
4415
|
+
const offWbSetValidation = wb.on("validationChanged", (r) => setValidation(r));
|
|
4391
4416
|
const offWbSelectionChanged = wb.on("selectionChanged", async (sel) => {
|
|
4392
4417
|
setSelectedNodeId(sel.nodes?.[0]);
|
|
4393
4418
|
setSelectedEdgeId(sel.edges?.[0]);
|
|
@@ -4460,20 +4485,8 @@ function WorkbenchProvider({ wb, runner, overrides, uiVersion, children, }) {
|
|
|
4460
4485
|
});
|
|
4461
4486
|
const offWbError = wb.on("error", add("workbench", "error"));
|
|
4462
4487
|
// Registry updates: swap registry and refresh graph validation/UI
|
|
4463
|
-
const offRunnerRegistry = runner.on("registry", async (
|
|
4464
|
-
|
|
4465
|
-
wb.setRegistry(newReg);
|
|
4466
|
-
// Trigger a graph update so the UI revalidates with new types/enums/nodes
|
|
4467
|
-
try {
|
|
4468
|
-
await runner.update(wb.def);
|
|
4469
|
-
}
|
|
4470
|
-
catch {
|
|
4471
|
-
console.error("Failed to update graph definition after registry changed");
|
|
4472
|
-
}
|
|
4473
|
-
}
|
|
4474
|
-
catch {
|
|
4475
|
-
console.error("Failed to handle registry changed event");
|
|
4476
|
-
}
|
|
4488
|
+
const offRunnerRegistry = runner.on("registry", async (registry) => {
|
|
4489
|
+
wb.setRegistry(registry);
|
|
4477
4490
|
});
|
|
4478
4491
|
const offFlowViewport = runner.on("viewport", (event) => {
|
|
4479
4492
|
const viewport = event.viewport;
|
|
@@ -4540,7 +4553,7 @@ function WorkbenchProvider({ wb, runner, overrides, uiVersion, children, }) {
|
|
|
4540
4553
|
offWbValidationChanged();
|
|
4541
4554
|
offWbError();
|
|
4542
4555
|
offWbGraphChangedForUpdate();
|
|
4543
|
-
|
|
4556
|
+
offWbSetValidation();
|
|
4544
4557
|
offWbSelectionChanged();
|
|
4545
4558
|
offRunnerRegistry();
|
|
4546
4559
|
offRunnerTransport();
|
|
@@ -5845,14 +5858,9 @@ const WorkbenchCanvasComponent = React.forwardRef((props, ref) => {
|
|
|
5845
5858
|
const { nodeTypes, resolveNodeType } = useMemo(() => {
|
|
5846
5859
|
// Build nodeTypes map using UI extension registry
|
|
5847
5860
|
const custom = new Map(); // Include all types present in registry AND current graph to avoid timing issues
|
|
5848
|
-
const
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
]);
|
|
5852
|
-
for (const typeId of ids) {
|
|
5853
|
-
const renderer = ui.getNodeRenderer(typeId);
|
|
5854
|
-
if (renderer)
|
|
5855
|
-
custom.set(typeId, renderer);
|
|
5861
|
+
const allNodeRenderers = ui.getAllNodeRenderers();
|
|
5862
|
+
for (const typeId of Object.keys(allNodeRenderers)) {
|
|
5863
|
+
custom.set(typeId, allNodeRenderers[typeId]);
|
|
5856
5864
|
}
|
|
5857
5865
|
const types = {
|
|
5858
5866
|
"spark-default": DefaultNode,
|
|
@@ -5865,7 +5873,7 @@ const WorkbenchCanvasComponent = React.forwardRef((props, ref) => {
|
|
|
5865
5873
|
return { nodeTypes: types, resolveNodeType: resolver };
|
|
5866
5874
|
// Include uiVersion to recompute when custom renderers are registered
|
|
5867
5875
|
// Include registryVersion to recompute when registry enums/types change
|
|
5868
|
-
}, [wb, wb.registry, registryVersion,
|
|
5876
|
+
}, [wb, wb.registry, registryVersion, ui, uiVersion]);
|
|
5869
5877
|
const edgeTypes = useMemo(() => {
|
|
5870
5878
|
// Use default edge renderer override if registered, otherwise use DefaultEdge
|
|
5871
5879
|
const customEdgeRenderer = ui.getEdgeRenderer();
|
|
@@ -6524,10 +6532,7 @@ function WorkbenchStudioCanvas({ autoScroll, onAutoScrollChange, example, onExam
|
|
|
6524
6532
|
return;
|
|
6525
6533
|
const setInitialGraph = async (d, inputs) => {
|
|
6526
6534
|
await wb.load(d);
|
|
6527
|
-
|
|
6528
|
-
runner.build(wb.def);
|
|
6529
|
-
}
|
|
6530
|
-
catch { }
|
|
6535
|
+
runner.build(wb.def);
|
|
6531
6536
|
if (inputs) {
|
|
6532
6537
|
for (const [nodeId, map] of Object.entries(inputs)) {
|
|
6533
6538
|
runner.setInputs(nodeId, map, { dry: true });
|
|
@@ -6571,13 +6576,13 @@ function WorkbenchStudioCanvas({ autoScroll, onAutoScrollChange, example, onExam
|
|
|
6571
6576
|
const ex = examples.find((e) => e.id === key) ?? examples[0];
|
|
6572
6577
|
if (!ex)
|
|
6573
6578
|
return;
|
|
6574
|
-
const { registry
|
|
6579
|
+
const { registry, def, inputs } = await ex.load();
|
|
6575
6580
|
// Keep registry consistent with backend:
|
|
6576
6581
|
// - For local backend, allow example to provide its own registry
|
|
6577
6582
|
// - For remote backend, registry is automatically managed by RemoteGraphRunner
|
|
6578
6583
|
if (backendKind === "local") {
|
|
6579
|
-
if (
|
|
6580
|
-
wb.setRegistry(
|
|
6584
|
+
if (registry) {
|
|
6585
|
+
wb.setRegistry(registry);
|
|
6581
6586
|
}
|
|
6582
6587
|
}
|
|
6583
6588
|
await wb.load(def);
|