@withone/cli 1.47.2 → 1.47.4

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/index.js CHANGED
@@ -3323,7 +3323,7 @@ function validateStepIds(flow2) {
3323
3323
  collectIds(flow2.steps, "steps");
3324
3324
  return errors;
3325
3325
  }
3326
- function validateSelectorReferences(flow2) {
3326
+ function validateSelectorReferences(flow2, rootDir) {
3327
3327
  const errors = [];
3328
3328
  const inputNames = new Set(Object.keys(flow2.inputs));
3329
3329
  const nestedKeys = getNestedStepsKeys();
@@ -3441,6 +3441,17 @@ function validateSelectorReferences(flow2) {
3441
3441
  const fieldName = step.type === "code" ? "source" : "expression";
3442
3442
  checkSelectors(extractSelectors(text5), `${pathPrefix}.${descriptor.configKey}.${fieldName}`, preceding2);
3443
3443
  }
3444
+ const modulePath = step.type === "code" ? c.module : void 0;
3445
+ if (rootDir && typeof modulePath === "string" && modulePath.length > 0) {
3446
+ const abs = path4.resolve(rootDir, modulePath);
3447
+ if (fs4.existsSync(abs)) {
3448
+ try {
3449
+ const moduleText = fs4.readFileSync(abs, "utf-8");
3450
+ checkSelectors(extractSelectors(moduleText), `${pathPrefix}.${descriptor.configKey}.module`, preceding2);
3451
+ } catch {
3452
+ }
3453
+ }
3454
+ }
3444
3455
  }
3445
3456
  }
3446
3457
  for (const { configKey, fieldName } of nestedKeys) {
@@ -3608,7 +3619,7 @@ function validateFlow(flow2, rootDir) {
3608
3619
  const f = flow2;
3609
3620
  return [
3610
3621
  ...validateStepIds(f),
3611
- ...validateSelectorReferences(f),
3622
+ ...validateSelectorReferences(f, rootDir),
3612
3623
  ...validateOutputSchemas(f),
3613
3624
  ...rootDir ? validateCodeModules(f, rootDir) : []
3614
3625
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/cli",
3
- "version": "1.47.2",
3
+ "version": "1.47.4",
4
4
  "description": "CLI for managing One",
5
5
  "type": "module",
6
6
  "files": [
@@ -30,7 +30,7 @@
30
30
  "@clack/prompts": "^0.9.1",
31
31
  "commander": "^13.1.0",
32
32
  "open": "^10.1.0",
33
- "pgserve": "^2.2.3",
33
+ "pgserve": "2.2.3",
34
34
  "picocolors": "^1.1.1",
35
35
  "smol-toml": "^1.6.0"
36
36
  },
@@ -145,7 +145,7 @@ Two rules: (1) prepend the stdin-read line, (2) replace `return X` with `process
145
145
  one --agent flow validate <key>
146
146
  ```
147
147
 
148
- `flow validate` parses every inline `code.source` and runs `node --check` on every `code.module` file, so syntax errors (brace/paren mismatches, duplicate `let`, etc.) surface here instead of after upstream steps have already run. It also extracts `$.steps.X` and `$.input.X` references from inside `code.source` and `transform.expression` and reports any reference to an undefined step/input or to a step declared **after** the current one (forward references resolve to `undefined` at runtime — silent data loss). The same checks run automatically at the start of `flow execute` so a broken step in position 15 fails the run immediately rather than 15 minutes in.
148
+ `flow validate` parses every inline `code.source` and runs `node --check` on every `code.module` file, so syntax errors (brace/paren mismatches, duplicate `let`, etc.) surface here instead of after upstream steps have already run. It also extracts `$.steps.X` and `$.input.X` references from inside `code.source`, `transform.expression`, **and external `code.module` `.mjs` files**, and reports any reference to an undefined step/input or to a step declared **after** the current one (forward references resolve to `undefined` at runtime — silent data loss). The same checks run automatically at the start of `flow execute` so a broken step in position 15 fails the run immediately rather than 15 minutes in.
149
149
 
150
150
  ### Step 6: Execute
151
151