Skip to content

Commit 7a60b97

Browse files
feat(studio): hosts can run Studio's agent tools on their own edit session (#4882)
* 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. * style(studio): format the agent tools export and keep its comment share
1 parent d218cec commit 7a60b97

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

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

‎packages/studio/src/index.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,10 @@ 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+
export { buildStudioTools } from "./webmcp/useStudioAgentTools";
245+
export type { StudioAgentToolsDeps } from "./webmcp/useStudioAgentTools";
246+
export { collectStudioLookScene } from "./webmcp/tools/lookTools";
247+
export type { StudioLookSnapshot } from "./webmcp/tools/lookTools";
248+
export type { ModelContextTool } from "./webmcp/types";
249+
export type { ToolResult } from "./webmcp/toolResult";

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ 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: {
115+
readonly current: StudioAgentToolsDeps;
116+
}): ModelContextTool[] {
115117
/**
116118
* `execute` for a tool whose handler takes the caller's abort signal.
117119
*

0 commit comments

Comments
 (0)