@hasna/workflows 0.2.0 → 0.2.1
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 +28 -0
- package/dist/agent-tools.js +995 -954
- package/dist/cli/index.js +23 -12
- package/dist/handlers.js +830 -778
- package/dist/index.js +831 -778
- package/dist/mcp/index.js +15 -4
- package/dist/sdk.js +4 -4
- package/dist/serve/admin.js +56 -13
- package/dist/serve/index.js +56 -13
- package/dist/service.js +828 -777
- package/package.json +3 -3
- package/types/graph.d.ts +6 -0
- package/types/lanes/codex.d.ts +0 -6
- package/types/lanes/types.d.ts +4 -0
- package/types/sdk/generated-api.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/workflows",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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,9 +76,9 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@anthropic-ai/claude-agent-sdk": "0.3.234",
|
|
78
78
|
"@cursor/sdk": "^1.0.28",
|
|
79
|
-
"@openai/codex-sdk": "0.147.0",
|
|
80
|
-
"commander": "^13.1.0",
|
|
81
79
|
"@hasna/contracts": "1.3.3",
|
|
80
|
+
"@openai/codex-sdk": "0.160.0",
|
|
81
|
+
"commander": "^13.1.0",
|
|
82
82
|
"pg": "^8.16.3"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
package/types/graph.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export declare const GRAPH_NODE_TYPES: readonly ["start", "step", "decision", "w
|
|
|
2
2
|
export type GraphNodeType = (typeof GRAPH_NODE_TYPES)[number];
|
|
3
3
|
export declare const LANE_KINDS: readonly ["claude", "codex", "cursor", "grok"];
|
|
4
4
|
export type LaneKind = (typeof LANE_KINDS)[number];
|
|
5
|
+
export declare const CODEX_EXECUTION_MODES: readonly ["repository", "read-only"];
|
|
6
|
+
export type CodexExecutionMode = (typeof CODEX_EXECUTION_MODES)[number];
|
|
5
7
|
export interface StartNode {
|
|
6
8
|
id: string;
|
|
7
9
|
type: "start";
|
|
@@ -16,6 +18,10 @@ export interface StepNode {
|
|
|
16
18
|
prompt?: string;
|
|
17
19
|
/** Shell command alternative to a lane prompt. */
|
|
18
20
|
command?: string;
|
|
21
|
+
/** Working directory on the executor, shared by shell and model lanes. */
|
|
22
|
+
cwd?: string;
|
|
23
|
+
/** Codex prompts only. Read-only permits nonrepository work without writes or approvals. */
|
|
24
|
+
codexMode?: CodexExecutionMode;
|
|
19
25
|
next?: string;
|
|
20
26
|
/** Retries on lane failure. Default 0. */
|
|
21
27
|
maxRetries?: number;
|
package/types/lanes/codex.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* codex lane adapter — @openai/codex-sdk.
|
|
3
|
-
*
|
|
4
|
-
* `new Codex({ config, env })` -> `thread.run(prompt)` -> `Turn` whose
|
|
5
|
-
* `finalResponse` is the completed agent output. CLI fallback: `codex exec`.
|
|
6
|
-
*/
|
|
7
1
|
import { type LaneAdapter } from "./types.js";
|
|
8
2
|
export interface CodexAdapterDeps {
|
|
9
3
|
sdkLoader?: () => Promise<unknown>;
|
package/types/lanes/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CodexExecutionMode } from "../graph.js";
|
|
1
2
|
export declare const LANE_KINDS: readonly ["claude", "codex", "cursor", "grok"];
|
|
2
3
|
export type LaneKind = (typeof LANE_KINDS)[number];
|
|
3
4
|
export interface LaneJob {
|
|
@@ -7,6 +8,8 @@ export interface LaneJob {
|
|
|
7
8
|
/** Shell command alternative (handled by the daemon's built-in executor). */
|
|
8
9
|
command?: string;
|
|
9
10
|
cwd?: string;
|
|
11
|
+
/** Repository checks remain native defaults unless read-only is explicitly selected. */
|
|
12
|
+
codexMode?: CodexExecutionMode;
|
|
10
13
|
/** Environment for the lane process — never credentials from the vault. */
|
|
11
14
|
env?: Record<string, string>;
|
|
12
15
|
/** Per-invocation budget in ms. Default 120000. */
|
|
@@ -70,4 +73,5 @@ export declare function spawnCli(cmd: string[], opts: {
|
|
|
70
73
|
timeoutMs?: number;
|
|
71
74
|
binaryName: string;
|
|
72
75
|
packageHint: string;
|
|
76
|
+
stdoutOnly?: boolean;
|
|
73
77
|
}): Promise<LaneResult>;
|
|
@@ -36,6 +36,8 @@ export interface StepNode {
|
|
|
36
36
|
"lane"?: "claude" | "codex" | "cursor" | "grok";
|
|
37
37
|
"prompt"?: string;
|
|
38
38
|
"command"?: string;
|
|
39
|
+
"cwd"?: string;
|
|
40
|
+
"codexMode"?: "repository" | "read-only";
|
|
39
41
|
"maxRetries"?: number;
|
|
40
42
|
"memo"?: boolean;
|
|
41
43
|
"timeoutMs"?: number;
|