feat: add @uncaged/workflow-agent-builtin package

Built-in role agent that uses workflow config models directly,
with its own tool-calling run loop. No external agent dependency.

- OpenAI-compatible chat completion client with tool_calls support
- P0 toolkit: read_file, write_file, run_command
- Integrates via createAgent factory from workflow-agent-kit
- CAS detail recording for each turn
- Path sandboxing and shell opt-in (UWF_BUILTIN_ALLOW_SHELL)
This commit is contained in:
2026-05-23 15:28:40 +08:00
parent 10642fdc45
commit deac2336b6
25 changed files with 1842 additions and 0 deletions
@@ -0,0 +1,17 @@
import { describe, expect, test } from "bun:test";
import { join } from "node:path";
import { resolvePathInWorkspace } from "../src/tools/path.js";
describe("resolvePathInWorkspace", () => {
const root = join("/tmp", "uwf-workspace");
test("resolves relative paths inside root", () => {
const resolved = resolvePathInWorkspace(root, "src/foo.ts");
expect(resolved).toBe(join(root, "src/foo.ts"));
});
test("rejects parent traversal", () => {
expect(resolvePathInWorkspace(root, "../etc/passwd")).toBeNull();
});
});