@fluidgrids/cli 2026.1115.4 → 2026.1115.5

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 (2) hide show
  1. package/dist/cli.js +43 -11
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1265,6 +1265,15 @@ function compareText(a, b) {
1265
1265
  function isRecord5(value) {
1266
1266
  return typeof value === "object" && value !== null && !Array.isArray(value);
1267
1267
  }
1268
+ function isConsistentListing(rows, totals) {
1269
+ if (totals.size > 1)
1270
+ return false;
1271
+ const [total] = [...totals];
1272
+ if (total !== undefined && rows.length !== total)
1273
+ return false;
1274
+ const seen = new Set(rows.map((row) => `${row.nodeType}\x00${row.nodeVersion}`));
1275
+ return seen.size === rows.length;
1276
+ }
1268
1277
  function manifestFromConfig(row) {
1269
1278
  const operations = row.operations;
1270
1279
  const usable = Array.isArray(operations) || isRecord5(operations) && Array.isArray(operations["operations"]);
@@ -1415,16 +1424,27 @@ function createCodeFirstApi(ctx) {
1415
1424
  return data.workflowInterface;
1416
1425
  },
1417
1426
  async nodeManifests() {
1418
- const rows = await paginate(async (offset) => {
1419
- const data = await request(CF_LIST_NODE_MANIFESTS, {
1420
- status: "AVAILABLE",
1421
- pagination: { limit: PAGE_SIZE, offset }
1427
+ let rows = null;
1428
+ for (let attempt = 1;attempt <= REGISTRY_LISTING_ATTEMPTS && rows === null; attempt++) {
1429
+ const totals = new Set;
1430
+ const listed = await paginate(async (offset) => {
1431
+ const data = await request(CF_LIST_NODE_MANIFESTS, {
1432
+ status: "AVAILABLE",
1433
+ pagination: { limit: PAGE_SIZE, offset }
1434
+ });
1435
+ const pagination = data.nodeEndpointConfigs.pagination;
1436
+ if (typeof pagination?.total === "number")
1437
+ totals.add(pagination.total);
1438
+ return { rows: data.nodeEndpointConfigs.configs, hasMore: pagination?.hasMore ?? false };
1422
1439
  });
1423
- return {
1424
- rows: data.nodeEndpointConfigs.configs,
1425
- hasMore: data.nodeEndpointConfigs.pagination?.hasMore ?? false
1426
- };
1427
- });
1440
+ if (isConsistentListing(listed, totals))
1441
+ rows = listed;
1442
+ }
1443
+ if (rows === null) {
1444
+ throw new CliUserError8(`The node registry changed while it was being read, ${REGISTRY_LISTING_ATTEMPTS} times in a row.`, {
1445
+ hint: "Nodes are being published to the workspace registry right now; run the command again in a minute."
1446
+ });
1447
+ }
1428
1448
  return rows.map(manifestFromConfig).filter((manifest) => manifest !== null).sort((a, b) => compareText(`${a.nodeType}\x00${String(a.nodeVersion)}`, `${b.nodeType}\x00${String(b.nodeVersion)}`));
1429
1449
  },
1430
1450
  async connections() {
@@ -1667,7 +1687,7 @@ function createCodeFirstApi(ctx) {
1667
1687
  }
1668
1688
  };
1669
1689
  }
1670
- var PARITY_START_FIELDS, PAGE_SIZE = 100, MAX_PAGES = 200;
1690
+ var PARITY_START_FIELDS, PAGE_SIZE = 100, MAX_PAGES = 200, REGISTRY_LISTING_ATTEMPTS = 4;
1671
1691
  var init_api = __esm(() => {
1672
1692
  init_redact();
1673
1693
  init_flag_hint();
@@ -2685,6 +2705,16 @@ import { CliUserError as CliUserError14 } from "@burdenoff/cli-sdk/core";
2685
2705
  import { registrySnapshotHash } from "@fluidgrids/workflows/codegen";
2686
2706
  import { buildExportDocument, irHash as irHash3, serializeWorkflowDocument } from "@fluidgrids/workflows/ir";
2687
2707
  import { exportWorkflowCode } from "@fluidgrids/workflows/roundtrip";
2708
+ function withoutSnapshot(content) {
2709
+ return content.replace(SNAPSHOT_LINE, "$1 Node registry snapshot");
2710
+ }
2711
+ function keepUnlessChanged(file, existing) {
2712
+ if (existing === null || existing === file.content)
2713
+ return file;
2714
+ if (!SNAPSHOT_LINE.test(existing) || !SNAPSHOT_LINE.test(file.content))
2715
+ return file;
2716
+ return withoutSnapshot(existing) === withoutSnapshot(file.content) ? { ...file, content: existing } : file;
2717
+ }
2688
2718
  function isNodesFile(path) {
2689
2719
  return path === `${GENERATED_DIR}/nodes.ts` || path === `${GENERATED_DIR}/nodes.py`;
2690
2720
  }
@@ -2835,7 +2865,7 @@ async function runPull(env, keys, rawOptions) {
2835
2865
  throw new CliUserError14(`${key} export: refusing ${path}, which is outside ${WORKFLOWS_DIR}/ and ${GENERATED_DIR}/.`);
2836
2866
  }
2837
2867
  }
2838
- const codeFiles = options.server ? files : files.filter((file) => !isNodesFile(file.path));
2868
+ const codeFiles = (options.server ? files : files.filter((file) => !isNodesFile(file.path))).map((file) => keepUnlessChanged(file, readProjectFile(project.root, file.path)));
2839
2869
  if (!options.server && files.some((file) => isNodesFile(file.path)) && format !== "json") {
2840
2870
  clientsUsed = format;
2841
2871
  }
@@ -2907,12 +2937,14 @@ async function runPull(env, keys, rawOptions) {
2907
2937
  }
2908
2938
  return result;
2909
2939
  }
2940
+ var SNAPSHOT_LINE;
2910
2941
  var init_pull = __esm(() => {
2911
2942
  init_connections();
2912
2943
  init_project();
2913
2944
  init_remote();
2914
2945
  init_codegen();
2915
2946
  init_shared();
2947
+ SNAPSHOT_LINE = /^(\/\/|#) Node registry snapshot sha256:[0-9a-f]{64}\.$/m;
2916
2948
  });
2917
2949
 
2918
2950
  // src/code-first/imports.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidgrids/cli",
3
- "version": "2026.1115.4",
3
+ "version": "2026.1115.5",
4
4
  "description": "CLI tool for FluidGrids — workflow automation management (thin shell over @burdenoff/cli-sdk)",
5
5
  "type": "module",
6
6
  "private": false,