deac2336b6
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)
18 lines
542 B
TypeScript
18 lines
542 B
TypeScript
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();
|
|
});
|
|
});
|