Skip to content

Commit 7edf1d7

Browse files
authored
Merge pull request #102 from RhysSullivan/worktree-tools-view-redesign
Redesign tools detail view with interactive schema explorer
2 parents 2c75d0e + 0f70f78 commit 7edf1d7

10 files changed

Lines changed: 1001 additions & 166 deletions

File tree

‎apps/cloud/src/api.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
HttpApiBuilder,
88
HttpApiSwagger,
99
HttpMiddleware,
10+
HttpRouter,
1011
HttpServer,
1112
} from "@effect/platform";
1213
import { Effect, Layer, Scope } from "effect";
@@ -76,6 +77,7 @@ const SharedServicesMemoized = Effect.runSync(
7677
const publicApiHandler = HttpApiBuilder.toWebHandler(
7778
PublicCloudApiLive.pipe(
7879
Layer.provideMerge(SharedServicesMemoized),
80+
Layer.provideMerge(HttpRouter.setRouterConfig({ maxParamLength: 1000 })),
7981
),
8082
{ middleware: HttpMiddleware.logger },
8183
);
@@ -184,6 +186,7 @@ const createProtectedHandler = (
184186
Layer.provideMerge(ProtectedCloudApiLive),
185187
Layer.provideMerge(requestServices),
186188
Layer.provideMerge(SharedServicesMemoized),
189+
Layer.provideMerge(HttpRouter.setRouterConfig({ maxParamLength: 1000 })),
187190
),
188191
{ middleware: HttpMiddleware.logger },
189192
);

‎apps/local/src/routes/__root.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export const Route = createRootRoute({
1717
{ rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=Instrument+Serif&family=JetBrains+Mono:wght@400;500&display=swap" },
1818
{ rel: "stylesheet", href: appCss },
1919
],
20+
scripts: import.meta.env.DEV
21+
? [{ src: "https://ui.sh/ui-picker.js" }]
22+
: [],
2023
}),
2124
component: RootComponent,
2225
shellComponent: RootDocument,

‎apps/local/src/server/main.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
HttpApiBuilder,
33
HttpApiSwagger,
44
HttpMiddleware,
5+
HttpRouter,
56
HttpServer,
67
} from "@effect/platform";
78
import { Context, Effect, Layer, ManagedRuntime } from "effect";
@@ -76,6 +77,7 @@ export const createServerHandlers = async (): Promise<ServerHandlers> => {
7677
Layer.provideMerge(Layer.succeed(ExecutorService, executor)),
7778
Layer.provideMerge(Layer.succeed(ExecutionEngineService, engine)),
7879
Layer.provideMerge(HttpServer.layerContext),
80+
Layer.provideMerge(HttpRouter.setRouterConfig({ maxParamLength: 1000 })),
7981
),
8082
{ middleware: HttpMiddleware.logger },
8183
);

‎packages/core/api/src/tools/api.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const ToolSchemaResponse = Schema.Struct({
3333
typeScriptDefinitions: Schema.optional(
3434
Schema.Record({ key: Schema.String, value: Schema.String }),
3535
),
36+
inputSchema: Schema.optional(Schema.Unknown),
37+
outputSchema: Schema.optional(Schema.Unknown),
3638
});
3739

3840
// ---------------------------------------------------------------------------

‎packages/core/sdk/src/in-memory/tool-registry.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type {
99
InvokeOptions,
1010
RuntimeToolHandler,
1111
} from "../tools";
12-
import { normalizeRefs } from "../schema-refs";
12+
import { normalizeRefs, reattachDefs } from "../schema-refs";
1313
import { buildToolTypeScriptPreview } from "../schema-types";
1414

1515
export const makeInMemoryToolRegistry = () => {
@@ -68,11 +68,19 @@ export const makeInMemoryToolRegistry = () => {
6868
inputSchema: t.inputSchema,
6969
outputSchema: t.outputSchema,
7070
defs,
71+
options: {
72+
maxLength: Infinity,
73+
maxProperties: Infinity,
74+
maxCompositeMembers: Infinity,
75+
maxRefDepth: 20,
76+
},
7177
});
7278

7379
return {
7480
id: t.id,
7581
...typeScriptPreview,
82+
inputSchema: t.inputSchema ? reattachDefs(t.inputSchema, defs) : undefined,
83+
outputSchema: t.outputSchema ? reattachDefs(t.outputSchema, defs) : undefined,
7684
};
7785
}),
7886
),

‎packages/core/sdk/src/tools.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export class ToolSchema extends Schema.Class<ToolSchema>("ToolSchema")({
3636
typeScriptDefinitions: Schema.optional(
3737
Schema.Record({ key: Schema.String, value: Schema.String }),
3838
),
39+
inputSchema: Schema.optional(Schema.Unknown),
40+
outputSchema: Schema.optional(Schema.Unknown),
3941
}) {}
4042

4143
export class ToolInvocationResult extends Schema.Class<ToolInvocationResult>(

‎packages/core/storage-file/src/tool-registry.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {
1212
InvokeOptions,
1313
RuntimeToolHandler,
1414
} from "@executor/sdk";
15-
import { buildToolTypeScriptPreview } from "@executor/sdk";
15+
import { buildToolTypeScriptPreview, reattachDefs } from "@executor/sdk";
1616

1717
// ---------------------------------------------------------------------------
1818
// Serialization — leverage ToolRegistration Schema.Class directly
@@ -101,11 +101,19 @@ export const makeKvToolRegistry = (
101101
inputSchema: t.inputSchema,
102102
outputSchema: t.outputSchema,
103103
defs,
104+
options: {
105+
maxLength: Infinity,
106+
maxProperties: Infinity,
107+
maxCompositeMembers: Infinity,
108+
maxRefDepth: 20,
109+
},
104110
});
105111

106112
return {
107113
id: t.id,
108114
...typeScriptPreview,
115+
inputSchema: t.inputSchema ? reattachDefs(t.inputSchema, defs) : undefined,
116+
outputSchema: t.outputSchema ? reattachDefs(t.outputSchema, defs) : undefined,
109117
};
110118
}),
111119

0 commit comments

Comments
 (0)