Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Assist tests stream Claude replies (shared SSE fixture); youtube-script has no studio link

Clauded9a27a6d3f56
diff --git a/skills/youtube-script/SKILL.md b/skills/youtube-script/SKILL.md
index 7a5bd58e..11438924 100644
--- a/skills/youtube-script/SKILL.md
+++ b/skills/youtube-script/SKILL.md
@@ -4,7 +4,6 @@ title: YouTube Script
description: A complete YouTube script with a full spoken body in one of six genres — business and finance, tech review, commentary or video essay, storytelling or documentary, true crime, or explainer and education — plus hook options, timestamps, production cues and a retention map.
when_to_use: The user asks for a YouTube script, a video script, an outline with hooks, or "write the script for my video". The deliverable is text; offer to produce the video afterwards with faceless-video or narration.
icon: file-text
-studio: /assist
tags: [youtube, script, writing]
offline:
kind: text
diff --git a/tests/assist-context.test.ts b/tests/assist-context.test.ts
index 6a662237..c4af7866 100644
--- a/tests/assist-context.test.ts
+++ b/tests/assist-context.test.ts
@@ -2,6 +2,7 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
+import { claudeStream } from "./fixtures/claude-sse";
import type Anthropic from "@anthropic-ai/sdk";
vi.setConfig({ testTimeout: 60_000 });
@@ -184,20 +185,10 @@ describe("modes", () => {
const sent: { headers: Headers; body: Record<string, unknown> }[] = [];
const realFetch = globalThis.fetch;
// The reply streams (server-sent events); the agent keeps the final message.
- const sse = (events: Record<string, unknown>[]) => events.map((e) => `event: ${e.type}\ndata: ${JSON.stringify(e)}\n\n`).join("");
globalThis.fetch = (async (_url: string, init: RequestInit) => {
const body = JSON.parse(String(init.body)) as Record<string, unknown>;
sent.push({ headers: new Headers(init.headers), body });
- const events = [
- { type: "message_start", message: { id: "msg_1", type: "message", role: "assistant", model: body.model, content: [], stop_reason: null, stop_sequence: null, stop_details: null, usage: { input_tokens: 1, output_tokens: 0 } } },
- { type: "content_block_start", index: 0, content_block: { type: "text", text: "", citations: null } },
- { type: "content_block_delta", index: 0, delta: { type: "text_delta", text: "Hel" } },
- { type: "content_block_delta", index: 0, delta: { type: "text_delta", text: "lo" } },
- { type: "content_block_stop", index: 0 },
- { type: "message_delta", delta: { stop_reason: "end_turn", stop_sequence: null, stop_details: null }, usage: { output_tokens: 2 } },
- { type: "message_stop" },
- ];
- return new Response(sse(events), { status: 200, headers: { "content-type": "text/event-stream" } });
+ return claudeStream({ content: [{ type: "text", text: "Hello" }], stop_reason: "end_turn", model: String(body.model) });
}) as typeof fetch;
try {
await agent.run(t.id);
diff --git a/tests/assist-skills.test.ts b/tests/assist-skills.test.ts
index bd2eaf6a..a55b4bb5 100644
--- a/tests/assist-skills.test.ts
+++ b/tests/assist-skills.test.ts
@@ -262,9 +262,11 @@ describe("skills on the server", () => {
for (const n of ["product-photoshoot", "ugc-video", "short-film", "narration", "thumbnail-generation", "image-repurposer", "faceless-video", "video-repurposer", "character-sheet", "youtube-script", "video-montage", "katana", "brand-asset-creation", "marketing-studio-cards"]) {
expect(builtin.map((s) => s.name)).toContain(n);
}
- // Studio links point at pages that exist.
+ // Studio links point at pages that exist (a text-only skill like youtube-script has none).
+ expect(builtin.find((s) => s.name === "youtube-script")?.studio).toBeUndefined();
for (const s of builtin) {
- const route = s.studio!.split("?")[0].replace(/^\/apps\/.+$/, "/apps/[id]").replace(/^\/(audio|video-tools|upscale)\/.+$/, "/$1/[mode]");
+ if (!s.studio) continue;
+ const route = s.studio.split("?")[0].replace(/^\/apps\/.+$/, "/apps/[id]").replace(/^\/(audio|video-tools|upscale)\/.+$/, "/$1/[mode]");
const page = path.join(process.cwd(), "src/app/(studio)", route, "page.tsx");
expect(fs.existsSync(page), `${s.name} → ${s.studio}`).toBe(true);
}
diff --git a/tests/assist.test.ts b/tests/assist.test.ts
index 7568798e..161ba7b7 100644
--- a/tests/assist.test.ts
+++ b/tests/assist.test.ts
@@ -2,6 +2,7 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
+import { claudeStream } from "./fixtures/claude-sse";
import type Anthropic from "@anthropic-ai/sdk";
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-assist-"));
@@ -204,11 +205,8 @@ describe("claude request", () => {
];
globalThis.fetch = (async (url: string, init: RequestInit) => {
sent.push({ url: String(url), headers: new Headers(init.headers), body: JSON.parse(String(init.body)) });
- const a = answers.shift()!;
- return new Response(JSON.stringify({ id: "msg_1", type: "message", role: "assistant", model: "claude-opus-5-5", stop_sequence: null, stop_details: null, usage: { input_tokens: 1, output_tokens: 1 }, ...a }), {
- status: 200,
- headers: { "content-type": "application/json" },
- });
+ // Assist's Claude calls stream; the agent keeps the final message.
+ return claudeStream(answers.shift()! as Parameters<typeof claudeStream>[0]);
}) as typeof fetch;
try {
await agent.run(t.id);
@@ -220,7 +218,7 @@ describe("claude request", () => {
const [first, second] = sent;
expect(first.url).toMatch(/\/v1\/messages\?beta=true$/);
expect(first.headers.get("anthropic-beta")).toContain("server-side-fallback-2026-07-01");
- expect(first.body).toMatchObject({ model: "claude-opus-5-5", thinking: { type: "adaptive" }, output_config: { effort: "medium" }, fallbacks: "default" });
+ expect(first.body).toMatchObject({ model: "claude-opus-5-5", thinking: { type: "adaptive" }, output_config: { effort: "medium" }, fallbacks: "default", stream: true });
expect(first.body.tool_choice).toBeUndefined();
const system = first.body.system as { text: string; cache_control?: unknown }[];
expect(system[0].cache_control).toEqual({ type: "ephemeral" });
diff --git a/tests/fixtures/claude-sse.ts b/tests/fixtures/claude-sse.ts
new file mode 100644
index 00000000..f05ecb34
--- /dev/null
+++ b/tests/fixtures/claude-sse.ts
@@ -0,0 +1,26 @@
+/**
+ * A Messages API reply as the server-sent events the SDK's stream reads (Assist's Claude calls
+ * stream and keep the final message). Text and tool_use blocks only.
+ */
+export function claudeStream(reply: { content: ({ type: "text"; text: string } | { type: "tool_use"; id: string; name: string; input: unknown })[]; stop_reason: string; model?: string }): Response {
+ const events: Record<string, unknown>[] = [
+ {
+ type: "message_start",
+ message: { id: "msg_1", type: "message", role: "assistant", model: reply.model ?? "claude-opus-5-5", content: [], stop_reason: null, stop_sequence: null, stop_details: null, usage: { input_tokens: 1, output_tokens: 0 } },
+ },
+ ];
+ reply.content.forEach((b, index) => {
+ if (b.type === "text") {
+ events.push({ type: "content_block_start", index, content_block: { type: "text", text: "", citations: null } });
+ events.push({ type: "content_block_delta", index, delta: { type: "text_delta", text: b.text } });
+ } else {
+ events.push({ type: "content_block_start", index, content_block: { type: "tool_use", id: b.id, name: b.name, input: {} } });
+ events.push({ type: "content_block_delta", index, delta: { type: "input_json_delta", partial_json: JSON.stringify(b.input) } });
+ }
+ events.push({ type: "content_block_stop", index });
+ });
+ events.push({ type: "message_delta", delta: { stop_reason: reply.stop_reason, stop_sequence: null, stop_details: null }, usage: { output_tokens: 1 } });
+ events.push({ type: "message_stop" });
+ const body = events.map((e) => `event: ${e.type}\ndata: ${JSON.stringify(e)}\n\n`).join("");
+ return new Response(body, { status: 200, headers: { "content-type": "text/event-stream" } });
+}