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:
@@ -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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user