Add capability-probed structured outputs and a prototype/instance creation graph.

Probe API profiles for json_schema/tools, flatten worker artifacts onto a strict schema, and let users spawn or revise graph nodes instead of a one-shot DAG.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-31 01:57:22 +08:00
co-authored by Cursor
parent 872f742d3e
commit bd5d88abfa
65 changed files with 7625 additions and 942 deletions
+10
View File
@@ -4,6 +4,7 @@ import {
createMockToolCall,
MockLlmProvider,
} from "../src/llm/client.js";
import { isUnusableMainAgentOutput } from "../src/main-agent/main-agent.js";
import { runMainAgentToolLoop } from "../src/main-agent/tool-loop.js";
import { MAIN_AGENT_TOOL_DEFINITIONS } from "../src/main-agent/tools.js";
import { toolCallToDecision } from "../src/runtime/tool-registry.js";
@@ -29,6 +30,15 @@ describe("main agent tool loop", () => {
).toEqual(["read_blackboard", "run_worker"]);
});
it("detects unusable main agent output", () => {
expect(
isUnusableMainAgentOutput(
new Error("Main Agent returned invalid JSON: Let me analyze"),
),
).toBe(true);
expect(isUnusableMainAgentOutput(new Error("fetch failed"))).toBe(false);
});
it("runs loop tools then returns terminal decision", async () => {
const llm = new MockLlmProvider([
createMockToolCall("read_blackboard", { tags: ["book.brief"] }),