Skip to content

Commit fdb51b3

Browse files
committed
feat(studio): hosts can run Studio's agent tools on their own edit session
Exports buildStudioTools, collectStudioLookScene and their types from the package index. EditorShell keeps using the same builder; no behaviour change.
1 parent 30c5569 commit fdb51b3

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { expect, it } from "vitest";
2+
import { buildStudioTools, collectStudioLookScene, type StudioAgentToolsDeps } from "@hyperframes/studio";
3+
4+
it("exports Studio's agent tools so a host can run them on its own edit session", () => {
5+
const tools = buildStudioTools({ current: {} as StudioAgentToolsDeps });
6+
expect(tools.map((tool) => tool.name)).toEqual(
7+
expect.arrayContaining(["studio_look", "studio_inspect", "studio_select", "studio_seek"]),
8+
);
9+
expect(typeof collectStudioLookScene).toBe("function");
10+
});

‎packages/studio/src/index.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,11 @@ export type { MarqueeGestures, MarqueeGesturesDeps } from "./components/editor/m
240240
export { MarqueeOverlay } from "./components/editor/MarqueeOverlay";
241241
export type { MarqueeOverlayProps } from "./components/editor/MarqueeOverlay";
242242
export type { Rect as MarqueeRect } from "./utils/marqueeGeometry";
243+
244+
// Agent tools: Studio's WebMCP tool bodies, for a host running them on its own edit session.
245+
export { buildStudioTools } from "./webmcp/useStudioAgentTools";
246+
export type { StudioAgentToolsDeps } from "./webmcp/useStudioAgentTools";
247+
export { collectStudioLookScene } from "./webmcp/tools/lookTools";
248+
export type { StudioLookSnapshot } from "./webmcp/tools/lookTools";
249+
export type { ModelContextTool } from "./webmcp/types";
250+
export type { ToolResult } from "./webmcp/toolResult";

‎packages/studio/src/webmcp/useStudioAgentTools.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export interface StudioAgentToolsDeps
111111
* a snapshot, which is what lets the list be built once and still see live
112112
* state. That is the whole point of the ref: see the registration note below.
113113
*/
114-
function buildStudioTools(depsRef: { readonly current: StudioAgentToolsDeps }): ModelContextTool[] {
114+
export function buildStudioTools(depsRef: { readonly current: StudioAgentToolsDeps }): ModelContextTool[] {
115115
/**
116116
* `execute` for a tool whose handler takes the caller's abort signal.
117117
*

0 commit comments

Comments
 (0)