@hasna/workflows 0.2.0 → 0.2.2

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/cli/index.js CHANGED
@@ -33,7 +33,7 @@ var __toESM = (mod, isNodeMode, target) => {
33
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
34
  var __require = import.meta.require;
35
35
 
36
- // ../../workflows-release-artifact-1/app/node_modules/commander/lib/error.js
36
+ // ../../app-test-sandbox-1/source/node_modules/commander/lib/error.js
37
37
  var require_error = __commonJS((exports) => {
38
38
  class CommanderError extends Error {
39
39
  constructor(exitCode, code, message) {
@@ -57,7 +57,7 @@ var require_error = __commonJS((exports) => {
57
57
  exports.InvalidArgumentError = InvalidArgumentError;
58
58
  });
59
59
 
60
- // ../../workflows-release-artifact-1/app/node_modules/commander/lib/argument.js
60
+ // ../../app-test-sandbox-1/source/node_modules/commander/lib/argument.js
61
61
  var require_argument = __commonJS((exports) => {
62
62
  var { InvalidArgumentError } = require_error();
63
63
 
@@ -136,7 +136,7 @@ var require_argument = __commonJS((exports) => {
136
136
  exports.humanReadableArgName = humanReadableArgName;
137
137
  });
138
138
 
139
- // ../../workflows-release-artifact-1/app/node_modules/commander/lib/help.js
139
+ // ../../app-test-sandbox-1/source/node_modules/commander/lib/help.js
140
140
  var require_help = __commonJS((exports) => {
141
141
  var { humanReadableArgName } = require_argument();
142
142
 
@@ -486,7 +486,7 @@ ${itemIndentStr}`);
486
486
  exports.stripColor = stripColor;
487
487
  });
488
488
 
489
- // ../../workflows-release-artifact-1/app/node_modules/commander/lib/option.js
489
+ // ../../app-test-sandbox-1/source/node_modules/commander/lib/option.js
490
490
  var require_option = __commonJS((exports) => {
491
491
  var { InvalidArgumentError } = require_error();
492
492
 
@@ -664,7 +664,7 @@ var require_option = __commonJS((exports) => {
664
664
  exports.DualOptions = DualOptions;
665
665
  });
666
666
 
667
- // ../../workflows-release-artifact-1/app/node_modules/commander/lib/suggestSimilar.js
667
+ // ../../app-test-sandbox-1/source/node_modules/commander/lib/suggestSimilar.js
668
668
  var require_suggestSimilar = __commonJS((exports) => {
669
669
  var maxDistance = 3;
670
670
  function editDistance(a, b) {
@@ -737,7 +737,7 @@ var require_suggestSimilar = __commonJS((exports) => {
737
737
  exports.suggestSimilar = suggestSimilar;
738
738
  });
739
739
 
740
- // ../../workflows-release-artifact-1/app/node_modules/commander/lib/command.js
740
+ // ../../app-test-sandbox-1/source/node_modules/commander/lib/command.js
741
741
  var require_command = __commonJS((exports) => {
742
742
  var EventEmitter = __require("events").EventEmitter;
743
743
  var childProcess = __require("child_process");
@@ -2047,7 +2047,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2047
2047
  exports.useColor = useColor;
2048
2048
  });
2049
2049
 
2050
- // ../../workflows-release-artifact-1/app/node_modules/commander/index.js
2050
+ // ../../app-test-sandbox-1/source/node_modules/commander/index.js
2051
2051
  var require_commander = __commonJS((exports) => {
2052
2052
  var { Argument } = require_argument();
2053
2053
  var { Command } = require_command();
@@ -2067,7 +2067,7 @@ var require_commander = __commonJS((exports) => {
2067
2067
  exports.InvalidOptionArgumentError = InvalidArgumentError;
2068
2068
  });
2069
2069
 
2070
- // ../../workflows-release-artifact-1/app/node_modules/commander/esm.mjs
2070
+ // ../../app-test-sandbox-1/source/node_modules/commander/esm.mjs
2071
2071
  var import__ = __toESM(require_commander(), 1);
2072
2072
  var {
2073
2073
  program,
@@ -2086,7 +2086,7 @@ var {
2086
2086
  // src/cli/index.ts
2087
2087
  import { readFileSync as readFileSync5, readSync, writeFileSync as writeFileSync2 } from "fs";
2088
2088
 
2089
- // ../../workflows-release-artifact-1/app/node_modules/@hasna/contracts/dist/client/transport.js
2089
+ // ../../app-test-sandbox-1/source/node_modules/@hasna/contracts/dist/client/transport.js
2090
2090
  import { isIP } from "net";
2091
2091
  import { spawnSync } from "child_process";
2092
2092
  import { closeSync as closeSync2, fstatSync as fstatSync2, openSync as openSync2, readFileSync as readFileSync2 } from "fs";
@@ -3575,7 +3575,7 @@ function workflowAgent(env = process.env, explicit) {
3575
3575
  // package.json
3576
3576
  var package_default = {
3577
3577
  name: "@hasna/workflows",
3578
- version: "0.2.0",
3578
+ version: "0.2.2",
3579
3579
  description: "Universal graph workflow app \u2014 graph language (start/step/decision/while/end), three-table store, session WAL, daemon with claims/leases, four lane adapters (claude/codex/cursor/grok), and a full CLI on four surfaces",
3580
3580
  type: "module",
3581
3581
  main: "./dist/index.js",
@@ -3651,9 +3651,9 @@ var package_default = {
3651
3651
  dependencies: {
3652
3652
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
3653
3653
  "@cursor/sdk": "^1.0.28",
3654
- "@openai/codex-sdk": "0.147.0",
3654
+ "@hasna/contracts": "1.3.5",
3655
+ "@openai/codex-sdk": "0.160.0",
3655
3656
  commander: "^13.1.0",
3656
- "@hasna/contracts": "1.3.3",
3657
3657
  pg: "^8.16.3"
3658
3658
  },
3659
3659
  devDependencies: {
@@ -3922,6 +3922,7 @@ function parseExpr(input) {
3922
3922
  // src/graph.ts
3923
3923
  var GRAPH_NODE_TYPES = ["start", "step", "decision", "while", "end"];
3924
3924
  var LANE_KINDS = ["claude", "codex", "cursor", "grok"];
3925
+ var CODEX_EXECUTION_MODES = ["repository", "read-only"];
3925
3926
  var NODE_ID_RE = /^[A-Za-z_][A-Za-z0-9_-]*$/;
3926
3927
  function issue(issues, path, message) {
3927
3928
  issues.push({ path, message });
@@ -4140,6 +4141,16 @@ function validateNode(graph, node, issues) {
4140
4141
  if (node.lane !== undefined && !LANE_KINDS.includes(node.lane)) {
4141
4142
  issue(issues, `nodes.${node.id}`, `unknown lane ${JSON.stringify(node.lane)} (expected one of ${LANE_KINDS.join(", ")})`);
4142
4143
  }
4144
+ if (node.cwd !== undefined && (typeof node.cwd !== "string" || !node.cwd.trim() || node.cwd.includes("\x00"))) {
4145
+ issue(issues, `nodes.${node.id}.cwd`, "cwd must be a non-empty path string without NUL characters on the executor");
4146
+ }
4147
+ if (node.codexMode !== undefined) {
4148
+ if (!CODEX_EXECUTION_MODES.includes(node.codexMode)) {
4149
+ issue(issues, `nodes.${node.id}.codexMode`, "codexMode must be repository or read-only");
4150
+ } else if (node.lane !== "codex" || !node.prompt || node.command !== undefined) {
4151
+ issue(issues, `nodes.${node.id}.codexMode`, "codexMode is supported only for a codex prompt step without command");
4152
+ }
4153
+ }
4143
4154
  if (node.maxRetries !== undefined && (!Number.isInteger(node.maxRetries) || node.maxRetries < 0)) {
4144
4155
  issue(issues, `nodes.${node.id}`, "maxRetries must be a non-negative integer");
4145
4156
  }