diff --git a/packages/studio/src/agentToolsExport.test.ts b/packages/studio/src/agentToolsExport.test.ts new file mode 100644 index 00000000000..0eb94ac2e8c --- /dev/null +++ b/packages/studio/src/agentToolsExport.test.ts @@ -0,0 +1,8 @@ +import { expect, it } from "vitest"; +import { buildStudioTools, collectStudioLookScene } from "@hyperframes/studio"; + +it("exports Studio's agent tools for a host's own edit session", () => { + const names = buildStudioTools({ current: {} as never }).map((tool) => tool.name); + expect(names).toEqual(expect.arrayContaining(["studio_look", "studio_seek"])); + expect(typeof collectStudioLookScene).toBe("function"); +}); diff --git a/packages/studio/src/index.ts b/packages/studio/src/index.ts index 011d3c47cc2..f12013ccede 100644 --- a/packages/studio/src/index.ts +++ b/packages/studio/src/index.ts @@ -240,3 +240,10 @@ export type { MarqueeGestures, MarqueeGesturesDeps } from "./components/editor/m export { MarqueeOverlay } from "./components/editor/MarqueeOverlay"; export type { MarqueeOverlayProps } from "./components/editor/MarqueeOverlay"; export type { Rect as MarqueeRect } from "./utils/marqueeGeometry"; + +export { buildStudioTools } from "./webmcp/useStudioAgentTools"; +export type { StudioAgentToolsDeps } from "./webmcp/useStudioAgentTools"; +export { collectStudioLookScene } from "./webmcp/tools/lookTools"; +export type { StudioLookSnapshot } from "./webmcp/tools/lookTools"; +export type { ModelContextTool } from "./webmcp/types"; +export type { ToolResult } from "./webmcp/toolResult"; diff --git a/packages/studio/src/webmcp/useStudioAgentTools.ts b/packages/studio/src/webmcp/useStudioAgentTools.ts index 913ceb21b4a..3d34804317d 100644 --- a/packages/studio/src/webmcp/useStudioAgentTools.ts +++ b/packages/studio/src/webmcp/useStudioAgentTools.ts @@ -111,7 +111,9 @@ export interface StudioAgentToolsDeps * a snapshot, which is what lets the list be built once and still see live * state. That is the whole point of the ref: see the registration note below. */ -function buildStudioTools(depsRef: { readonly current: StudioAgentToolsDeps }): ModelContextTool[] { +export function buildStudioTools(depsRef: { + readonly current: StudioAgentToolsDeps; +}): ModelContextTool[] { /** * `execute` for a tool whose handler takes the caller's abort signal. *