064696c558
- Rewrite docs/architecture.md with 15-package map, dependency graph, updated engine paths - Update CLAUDE.md monorepo structure section - Add READMEs for: workflow-protocol, workflow-runtime, workflow-util, workflow-cas, workflow-register, workflow-execute, workflow-reactor - Fix agent READMEs: update deps from @uncaged/workflow to actual packages - Mark workflow-as-agent plan as outdated Fixes #153 小橘 <xiaoju@shazhou.work>
36 lines
1.3 KiB
Markdown
36 lines
1.3 KiB
Markdown
# @uncaged/workflow-agent-cursor
|
|
|
|
`AgentFn` adapter that runs the `cursor-agent` CLI against a workspace path derived from the thread.
|
|
|
|
The agent builds a full prompt (system + task + step history via `@uncaged/workflow-util-agent`), extracts the absolute workspace path with your `extract` + Zod schema, then spawns `cursor-agent` with `--workspace`, model, and non-interactive flags.
|
|
|
|
## Install
|
|
|
|
```bash
|
|
bun add @uncaged/workflow-agent-cursor @uncaged/workflow-runtime @uncaged/workflow-util-agent zod
|
|
```
|
|
|
|
In this monorepo: `"@uncaged/workflow-agent-cursor": "workspace:*"` plus `workspace:*` for `@uncaged/workflow-runtime` and `@uncaged/workflow-util-agent`, and `zod` ^4.
|
|
|
|
## Usage
|
|
|
|
```typescript
|
|
import { createCursorAgent } from "@uncaged/workflow-agent-cursor";
|
|
|
|
const agent = createCursorAgent({
|
|
model: null, // null → "auto"
|
|
timeout: 0, // ms; 0 = no limit (spawnCli timeout disabled)
|
|
extract: myExtractFn,
|
|
});
|
|
```
|
|
|
|
## API overview
|
|
|
|
| Export | Description |
|
|
|--------|-------------|
|
|
| `createCursorAgent(config)` | Returns `AgentFn` that runs `cursor-agent` with `buildAgentPrompt(ctx)` from `@uncaged/workflow-util-agent` |
|
|
| `CursorAgentConfig` | `model`, `timeout`, `extract` (must supply workspace path) |
|
|
| `validateCursorAgentConfig` | Config validation result |
|
|
|
|
Requires `cursor-agent` on `PATH` at runtime.
|