@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/README.md
CHANGED
|
@@ -87,6 +87,34 @@ run API includes `triggerRun`, `getRun`, `listNodes`, `events`, `cancelRun` and
|
|
|
87
87
|
the graph, context and cycle budget. Reusing a key for a different request returns
|
|
88
88
|
HTTP 409. Run context cannot contain the reserved `__wf` or `steps` fields.
|
|
89
89
|
|
|
90
|
+
A step's optional `cwd` names its working directory on the server executing the
|
|
91
|
+
workflow. It applies to shell commands and model lanes; prefer an absolute path.
|
|
92
|
+
Codex prompts keep their native repository, sandbox and approval defaults. Supply
|
|
93
|
+
`cwd` for work in an existing trusted repository. For a prompt that needs no file
|
|
94
|
+
changes and may run outside a repository, explicitly set `codexMode: "read-only"`:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import { createWorkflowsClient, type WorkflowGraph } from "@hasna/workflows/sdk";
|
|
98
|
+
|
|
99
|
+
const workflows = createWorkflowsClient();
|
|
100
|
+
const graph: WorkflowGraph = {
|
|
101
|
+
name: "read-only-answer", version: "1",
|
|
102
|
+
nodes: [
|
|
103
|
+
{ id: "start", type: "start", next: "answer" },
|
|
104
|
+
{ id: "answer", type: "step", lane: "codex", codexMode: "read-only",
|
|
105
|
+
prompt: "Return the requested answer without changing files.", next: "end" },
|
|
106
|
+
{ id: "end", type: "end" },
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
await workflows.triggerRun(graph, {}, { idempotencyKey: "read-only-answer-1" });
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
This explicit mode uses Codex's read-only sandbox, permits a nonrepository
|
|
113
|
+
directory and refuses approval escalation. It applies only to Codex prompt steps;
|
|
114
|
+
shell commands cannot select it. An empty Codex response fails the step even when
|
|
115
|
+
the native process exits successfully. Memoization distinguishes the working
|
|
116
|
+
directory, lane and execution mode.
|
|
117
|
+
|
|
90
118
|
## MCP
|
|
91
119
|
|
|
92
120
|
Register `workflows-mcp` as a stdio command in Codex, Claude Code, OpenCode, Sumi,
|