Files
united-workforce/scripts/mock-agent.ts
T
xiaoju 710d42d6b9 refactor(agent-kit): base AgentContext on ModeratorContext
AgentContext now extends ModeratorContext (start + steps) with threadId, role, store, and expanded workflow. Hermes and mock-agent read prompt/steps/systemPrompt from the new shape.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 16:14:13 +00:00

29 lines
807 B
TypeScript

#!/usr/bin/env bun
// Mock agent for smoke testing
import { bootstrap, type JSONSchema, putSchema } from "@uncaged/json-cas";
import { createAgent } from "../packages/uwf-agent-kit/src/index.js";
const MOCK_RAW_OUTPUT_SCHEMA: JSONSchema = {
title: "mock-raw-output",
type: "object",
required: ["text"],
properties: {
text: { type: "string" },
},
additionalProperties: false,
};
const agent = createAgent({
name: "mock",
run: async (ctx) => {
const output = `Mock output for role ${ctx.role}: task was "${ctx.start.prompt}"`;
const { store } = ctx;
await bootstrap(store);
const schemaHash = await putSchema(store, MOCK_RAW_OUTPUT_SCHEMA);
const detailHash = await store.put(schemaHash, { text: output });
return { output, detailHash };
},
});
await agent();