@hasna/workflows 0.2.2 → 0.2.3

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/README.md CHANGED
@@ -126,6 +126,10 @@ the harness configuration.
126
126
  `--stdio` is accepted. Run tools require a stable `idempotencyKey`. Each tool accepts
127
127
  an optional `agent`; otherwise identity comes from the native harness context or
128
128
  the station. CLI and SDK callers may also set their agent explicitly.
129
+ For Codex, `CODEX_THREAD_ID` resolves to `codex-` followed by the thread UUID in
130
+ lowercase without hyphens, matching the native session address. Hyphenated UUIDs
131
+ and compact 32-character hexadecimal IDs are accepted; malformed IDs fail before
132
+ an API request. An explicit `agent` or `HASNA_WORKFLOWS_AGENT` takes precedence.
129
133
 
130
134
  ## Server and migration
131
135
 
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
- // ../../app-test-sandbox-1/source/node_modules/commander/lib/error.js
36
+ // ../../test-sandbox/repo/node_modules/.bun/commander@13.1.0/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
- // ../../app-test-sandbox-1/source/node_modules/commander/lib/argument.js
60
+ // ../../test-sandbox/repo/node_modules/.bun/commander@13.1.0/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
- // ../../app-test-sandbox-1/source/node_modules/commander/lib/help.js
139
+ // ../../test-sandbox/repo/node_modules/.bun/commander@13.1.0/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
- // ../../app-test-sandbox-1/source/node_modules/commander/lib/option.js
489
+ // ../../test-sandbox/repo/node_modules/.bun/commander@13.1.0/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
- // ../../app-test-sandbox-1/source/node_modules/commander/lib/suggestSimilar.js
667
+ // ../../test-sandbox/repo/node_modules/.bun/commander@13.1.0/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
- // ../../app-test-sandbox-1/source/node_modules/commander/lib/command.js
740
+ // ../../test-sandbox/repo/node_modules/.bun/commander@13.1.0/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
- // ../../app-test-sandbox-1/source/node_modules/commander/index.js
2050
+ // ../../test-sandbox/repo/node_modules/.bun/commander@13.1.0/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
- // ../../app-test-sandbox-1/source/node_modules/commander/esm.mjs
2070
+ // ../../test-sandbox/repo/node_modules/.bun/commander@13.1.0/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
- // ../../app-test-sandbox-1/source/node_modules/@hasna/contracts/dist/client/transport.js
2089
+ // ../../test-sandbox/repo/apps/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";
@@ -3563,19 +3563,24 @@ function workflowAgent(env = process.env, explicit) {
3563
3563
  return { name: name(explicit), source: "argument" };
3564
3564
  if (env.HASNA_WORKFLOWS_AGENT !== undefined)
3565
3565
  return { name: name(env.HASNA_WORKFLOWS_AGENT), source: "HASNA_WORKFLOWS_AGENT" };
3566
- for (const [harness, key] of [["claude", "CLAUDE_CODE_SESSION_ID"], ["codex", "CODEX_THREAD_ID"]]) {
3567
- if (env[key] !== undefined)
3568
- return {
3569
- name: `${harness}-${createHash("sha256").update(JSON.stringify([env[key], null])).digest("hex").slice(0, 32)}`,
3570
- source: key
3571
- };
3566
+ if (env.CLAUDE_CODE_SESSION_ID !== undefined)
3567
+ return {
3568
+ name: `claude-${createHash("sha256").update(JSON.stringify([env.CLAUDE_CODE_SESSION_ID, null])).digest("hex").slice(0, 32)}`,
3569
+ source: "CLAUDE_CODE_SESSION_ID"
3570
+ };
3571
+ if (env.CODEX_THREAD_ID !== undefined) {
3572
+ const thread = env.CODEX_THREAD_ID;
3573
+ if (thread.length !== 32 && thread.length !== 36 || !/^(?:[a-f0-9]{32}|[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$/i.test(thread)) {
3574
+ throw new WorkflowInputError("CODEX_THREAD_ID must be a UUID or 32 hexadecimal characters");
3575
+ }
3576
+ return { name: `codex-${thread.replaceAll("-", "").toLowerCase()}`, source: "CODEX_THREAD_ID" };
3572
3577
  }
3573
3578
  return { name: `cli@${station(env)}`, source: "station" };
3574
3579
  }
3575
3580
  // package.json
3576
3581
  var package_default = {
3577
3582
  name: "@hasna/workflows",
3578
- version: "0.2.2",
3583
+ version: "0.2.3",
3579
3584
  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
3585
  type: "module",
3581
3586
  main: "./dist/index.js",
@@ -3651,7 +3656,7 @@ var package_default = {
3651
3656
  dependencies: {
3652
3657
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
3653
3658
  "@cursor/sdk": "^1.0.28",
3654
- "@hasna/contracts": "1.3.5",
3659
+ "@hasna/contracts": "1.3.6",
3655
3660
  "@openai/codex-sdk": "0.160.0",
3656
3661
  commander: "^13.1.0",
3657
3662
  pg: "^8.16.3"
package/dist/handlers.js CHANGED
@@ -1108,7 +1108,7 @@ import { createHash as createHash3 } from "crypto";
1108
1108
  // package.json
1109
1109
  var package_default = {
1110
1110
  name: "@hasna/workflows",
1111
- version: "0.2.2",
1111
+ version: "0.2.3",
1112
1112
  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",
1113
1113
  type: "module",
1114
1114
  main: "./dist/index.js",
@@ -1184,7 +1184,7 @@ var package_default = {
1184
1184
  dependencies: {
1185
1185
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
1186
1186
  "@cursor/sdk": "^1.0.28",
1187
- "@hasna/contracts": "1.3.5",
1187
+ "@hasna/contracts": "1.3.6",
1188
1188
  "@openai/codex-sdk": "0.160.0",
1189
1189
  commander: "^13.1.0",
1190
1190
  pg: "^8.16.3"
package/dist/index.js CHANGED
@@ -1108,7 +1108,7 @@ import { createHash as createHash3 } from "crypto";
1108
1108
  // package.json
1109
1109
  var package_default = {
1110
1110
  name: "@hasna/workflows",
1111
- version: "0.2.2",
1111
+ version: "0.2.3",
1112
1112
  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",
1113
1113
  type: "module",
1114
1114
  main: "./dist/index.js",
@@ -1184,7 +1184,7 @@ var package_default = {
1184
1184
  dependencies: {
1185
1185
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
1186
1186
  "@cursor/sdk": "^1.0.28",
1187
- "@hasna/contracts": "1.3.5",
1187
+ "@hasna/contracts": "1.3.6",
1188
1188
  "@openai/codex-sdk": "0.160.0",
1189
1189
  commander: "^13.1.0",
1190
1190
  pg: "^8.16.3"
package/dist/mcp/index.js CHANGED
@@ -73,7 +73,7 @@ function workflowsTools(_service) {
73
73
  // package.json
74
74
  var package_default = {
75
75
  name: "@hasna/workflows",
76
- version: "0.2.2",
76
+ version: "0.2.3",
77
77
  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",
78
78
  type: "module",
79
79
  main: "./dist/index.js",
@@ -149,7 +149,7 @@ var package_default = {
149
149
  dependencies: {
150
150
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
151
151
  "@cursor/sdk": "^1.0.28",
152
- "@hasna/contracts": "1.3.5",
152
+ "@hasna/contracts": "1.3.6",
153
153
  "@openai/codex-sdk": "0.160.0",
154
154
  commander: "^13.1.0",
155
155
  pg: "^8.16.3"
@@ -653,7 +653,7 @@ function validateNode(graph, node, issues) {
653
653
  }
654
654
  }
655
655
 
656
- // ../../app-test-sandbox-1/source/node_modules/@hasna/contracts/dist/client/transport.js
656
+ // ../../test-sandbox/repo/apps/contracts/dist/client/transport.js
657
657
  import { isIP } from "net";
658
658
  import { spawnSync } from "child_process";
659
659
  import { closeSync as closeSync2, fstatSync as fstatSync2, openSync as openSync2, readFileSync as readFileSync2 } from "fs";
@@ -2150,12 +2150,17 @@ function workflowAgent(env = process.env, explicit) {
2150
2150
  return { name: name(explicit), source: "argument" };
2151
2151
  if (env.HASNA_WORKFLOWS_AGENT !== undefined)
2152
2152
  return { name: name(env.HASNA_WORKFLOWS_AGENT), source: "HASNA_WORKFLOWS_AGENT" };
2153
- for (const [harness, key] of [["claude", "CLAUDE_CODE_SESSION_ID"], ["codex", "CODEX_THREAD_ID"]]) {
2154
- if (env[key] !== undefined)
2155
- return {
2156
- name: `${harness}-${createHash("sha256").update(JSON.stringify([env[key], null])).digest("hex").slice(0, 32)}`,
2157
- source: key
2158
- };
2153
+ if (env.CLAUDE_CODE_SESSION_ID !== undefined)
2154
+ return {
2155
+ name: `claude-${createHash("sha256").update(JSON.stringify([env.CLAUDE_CODE_SESSION_ID, null])).digest("hex").slice(0, 32)}`,
2156
+ source: "CLAUDE_CODE_SESSION_ID"
2157
+ };
2158
+ if (env.CODEX_THREAD_ID !== undefined) {
2159
+ const thread = env.CODEX_THREAD_ID;
2160
+ if (thread.length !== 32 && thread.length !== 36 || !/^(?:[a-f0-9]{32}|[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$/i.test(thread)) {
2161
+ throw new WorkflowInputError("CODEX_THREAD_ID must be a UUID or 32 hexadecimal characters");
2162
+ }
2163
+ return { name: `codex-${thread.replaceAll("-", "").toLowerCase()}`, source: "CODEX_THREAD_ID" };
2159
2164
  }
2160
2165
  return { name: `cli@${station(env)}`, source: "station" };
2161
2166
  }
package/dist/sdk.js CHANGED
@@ -1,4 +1,4 @@
1
- // ../../app-test-sandbox-1/source/node_modules/@hasna/contracts/dist/client/transport.js
1
+ // ../../test-sandbox/repo/apps/contracts/dist/client/transport.js
2
2
  import { isIP } from "net";
3
3
  import { spawnSync } from "child_process";
4
4
  import { closeSync as closeSync2, fstatSync as fstatSync2, openSync as openSync2, readFileSync as readFileSync2 } from "fs";
@@ -1436,19 +1436,24 @@ function workflowAgent(env = process.env, explicit) {
1436
1436
  return { name: name(explicit), source: "argument" };
1437
1437
  if (env.HASNA_WORKFLOWS_AGENT !== undefined)
1438
1438
  return { name: name(env.HASNA_WORKFLOWS_AGENT), source: "HASNA_WORKFLOWS_AGENT" };
1439
- for (const [harness, key] of [["claude", "CLAUDE_CODE_SESSION_ID"], ["codex", "CODEX_THREAD_ID"]]) {
1440
- if (env[key] !== undefined)
1441
- return {
1442
- name: `${harness}-${createHash("sha256").update(JSON.stringify([env[key], null])).digest("hex").slice(0, 32)}`,
1443
- source: key
1444
- };
1439
+ if (env.CLAUDE_CODE_SESSION_ID !== undefined)
1440
+ return {
1441
+ name: `claude-${createHash("sha256").update(JSON.stringify([env.CLAUDE_CODE_SESSION_ID, null])).digest("hex").slice(0, 32)}`,
1442
+ source: "CLAUDE_CODE_SESSION_ID"
1443
+ };
1444
+ if (env.CODEX_THREAD_ID !== undefined) {
1445
+ const thread = env.CODEX_THREAD_ID;
1446
+ if (thread.length !== 32 && thread.length !== 36 || !/^(?:[a-f0-9]{32}|[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$/i.test(thread)) {
1447
+ throw new WorkflowInputError("CODEX_THREAD_ID must be a UUID or 32 hexadecimal characters");
1448
+ }
1449
+ return { name: `codex-${thread.replaceAll("-", "").toLowerCase()}`, source: "CODEX_THREAD_ID" };
1445
1450
  }
1446
1451
  return { name: `cli@${station(env)}`, source: "station" };
1447
1452
  }
1448
1453
  // package.json
1449
1454
  var package_default = {
1450
1455
  name: "@hasna/workflows",
1451
- version: "0.2.2",
1456
+ version: "0.2.3",
1452
1457
  description: "Universal graph workflow app — 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",
1453
1458
  type: "module",
1454
1459
  main: "./dist/index.js",
@@ -1524,7 +1529,7 @@ var package_default = {
1524
1529
  dependencies: {
1525
1530
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
1526
1531
  "@cursor/sdk": "^1.0.28",
1527
- "@hasna/contracts": "1.3.5",
1532
+ "@hasna/contracts": "1.3.6",
1528
1533
  "@openai/codex-sdk": "0.160.0",
1529
1534
  commander: "^13.1.0",
1530
1535
  pg: "^8.16.3"
@@ -22,7 +22,7 @@ var package_default;
22
22
  var init_package = __esm(() => {
23
23
  package_default = {
24
24
  name: "@hasna/workflows",
25
- version: "0.2.2",
25
+ version: "0.2.3",
26
26
  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",
27
27
  type: "module",
28
28
  main: "./dist/index.js",
@@ -98,7 +98,7 @@ var init_package = __esm(() => {
98
98
  dependencies: {
99
99
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
100
100
  "@cursor/sdk": "^1.0.28",
101
- "@hasna/contracts": "1.3.5",
101
+ "@hasna/contracts": "1.3.6",
102
102
  "@openai/codex-sdk": "0.160.0",
103
103
  commander: "^13.1.0",
104
104
  pg: "^8.16.3"
@@ -22,7 +22,7 @@ var package_default;
22
22
  var init_package = __esm(() => {
23
23
  package_default = {
24
24
  name: "@hasna/workflows",
25
- version: "0.2.2",
25
+ version: "0.2.3",
26
26
  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",
27
27
  type: "module",
28
28
  main: "./dist/index.js",
@@ -98,7 +98,7 @@ var init_package = __esm(() => {
98
98
  dependencies: {
99
99
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
100
100
  "@cursor/sdk": "^1.0.28",
101
- "@hasna/contracts": "1.3.5",
101
+ "@hasna/contracts": "1.3.6",
102
102
  "@openai/codex-sdk": "0.160.0",
103
103
  commander: "^13.1.0",
104
104
  pg: "^8.16.3"
package/dist/service.js CHANGED
@@ -1108,7 +1108,7 @@ import { createHash as createHash3 } from "crypto";
1108
1108
  // package.json
1109
1109
  var package_default = {
1110
1110
  name: "@hasna/workflows",
1111
- version: "0.2.2",
1111
+ version: "0.2.3",
1112
1112
  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",
1113
1113
  type: "module",
1114
1114
  main: "./dist/index.js",
@@ -1184,7 +1184,7 @@ var package_default = {
1184
1184
  dependencies: {
1185
1185
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
1186
1186
  "@cursor/sdk": "^1.0.28",
1187
- "@hasna/contracts": "1.3.5",
1187
+ "@hasna/contracts": "1.3.6",
1188
1188
  "@openai/codex-sdk": "0.160.0",
1189
1189
  commander: "^13.1.0",
1190
1190
  pg: "^8.16.3"
@@ -3,7 +3,7 @@
3
3
  "name": "workflows",
4
4
  "class": "service",
5
5
  "contractVersion": "v1",
6
- "kitVersion": "1.3.5",
6
+ "kitVersion": "1.3.6",
7
7
  "description": "Hosted workflow CLI, MCP and HTTP SDK, with a PostgreSQL execution server and a preserved session journal.",
8
8
  "bins": [
9
9
  "workflows",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/workflows",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Universal graph workflow app — 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",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -76,7 +76,7 @@
76
76
  "dependencies": {
77
77
  "@anthropic-ai/claude-agent-sdk": "0.3.234",
78
78
  "@cursor/sdk": "^1.0.28",
79
- "@hasna/contracts": "1.3.5",
79
+ "@hasna/contracts": "1.3.6",
80
80
  "@openai/codex-sdk": "0.160.0",
81
81
  "commander": "^13.1.0",
82
82
  "pg": "^8.16.3"