@@ -121,7 +121,6 @@ import {
121121 type SourceDetectionResult ,
122122 type Tool ,
123123 type ToolListFilter ,
124- type ToolSchemaOptions ,
125124} from "./types" ;
126125import { buildToolTypeScriptPreview , type ToolTypeScriptPreview } from "./schema-types" ;
127126import { collectReferencedDefinitions } from "./schema-refs" ;
@@ -183,11 +182,8 @@ export type Executor<TPlugins extends readonly AnyPlugin[] = readonly []> = {
183182 readonly list : ( filter ?: ToolListFilter ) => Effect . Effect < readonly Tool [ ] , StorageFailure > ;
184183 /** Fetch a tool's schema view: JSON schemas with `$defs`
185184 * attached from the core `definition` table, plus TypeScript
186- * preview strings unless disabled. Returns `null` for unknown tool ids. */
187- readonly schema : (
188- toolId : string ,
189- options ?: ToolSchemaOptions ,
190- ) => Effect . Effect < ToolSchema | null , StorageFailure > ;
185+ * preview strings. Returns `null` for unknown tool ids. */
186+ readonly schema : ( toolId : string ) => Effect . Effect < ToolSchema | null , StorageFailure > ;
191187 /** Every `$defs` entry across every source, grouped by source id.
192188 * Used for bulk schema export and downstream TypeScript rendering. */
193189 readonly definitions : ( ) => Effect . Effect <
@@ -2984,7 +2980,6 @@ export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = rea
29842980 sourceId : string | undefined ;
29852981 rawInput : unknown ;
29862982 rawOutput : unknown ;
2987- includeTypeScript : boolean ;
29882983 } ) =>
29892984 Effect . gen ( function * ( ) {
29902985 const defs : Record < string , unknown > = opts . sourceId
@@ -2999,25 +2994,23 @@ export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = rea
29992994 sourceDefsMap ,
30002995 ) ;
30012996 const schemaDefsMap = new Map < string , unknown > ( Object . entries ( schemaDefinitions ) ) ;
3002- const preview : ToolTypeScriptPreview = opts . includeTypeScript
3003- ? yield * Effect . promise ( ( ) =>
3004- buildToolTypeScriptPreview ( {
3005- inputSchema : opts . rawInput ,
3006- outputSchema : opts . rawOutput ,
3007- defs : schemaDefsMap ,
3008- } ) ,
3009- ) . pipe (
3010- Effect . withSpan ( "schema.compile.preview" , {
3011- attributes : {
3012- "schema.kind" : "tool.preview" ,
3013- "schema.has_input" : opts . rawInput !== undefined ,
3014- "schema.has_output" : opts . rawOutput !== undefined ,
3015- "schema.def_count" : schemaDefsMap . size ,
3016- "schema.source_def_count" : sourceDefsMap . size ,
3017- } ,
3018- } ) ,
3019- )
3020- : { } ;
2997+ const preview : ToolTypeScriptPreview = yield * Effect . promise ( ( ) =>
2998+ buildToolTypeScriptPreview ( {
2999+ inputSchema : opts . rawInput ,
3000+ outputSchema : opts . rawOutput ,
3001+ defs : schemaDefsMap ,
3002+ } ) ,
3003+ ) . pipe (
3004+ Effect . withSpan ( "schema.compile.preview" , {
3005+ attributes : {
3006+ "schema.kind" : "tool.preview" ,
3007+ "schema.has_input" : opts . rawInput !== undefined ,
3008+ "schema.has_output" : opts . rawOutput !== undefined ,
3009+ "schema.def_count" : schemaDefsMap . size ,
3010+ "schema.source_def_count" : sourceDefsMap . size ,
3011+ } ,
3012+ } ) ,
3013+ ) ;
30213014
30223015 return ToolSchema . make ( {
30233016 id : ToolId . make ( opts . toolId ) ,
@@ -3033,9 +3026,8 @@ export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = rea
30333026 } ) ;
30343027 } ) ;
30353028
3036- const toolSchema = ( toolId : string , options ?: ToolSchemaOptions ) =>
3029+ const toolSchema = ( toolId : string ) =>
30373030 Effect . gen ( function * ( ) {
3038- const includeTypeScript = options ?. includeTypeScript ?? true ;
30393031 // Static pool first — static tools have no source in the DB so
30403032 // no `$defs` attach; just wrap the declared schemas.
30413033 const staticEntry = staticTools . get ( toolId ) ;
@@ -3052,7 +3044,6 @@ export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = rea
30523044 sourceId : undefined ,
30533045 rawInput : toToolJsonSchema ( staticEntry . tool . inputSchema ) ,
30543046 rawOutput : toToolJsonSchema ( staticEntry . tool . outputSchema , "output" ) ,
3055- includeTypeScript,
30563047 } ) ;
30573048 }
30583049 // Innermost-wins lookup across every visible scope.
@@ -3075,7 +3066,6 @@ export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = rea
30753066 sourceId : row . source_id ,
30763067 rawInput : decodeJsonColumn ( row . input_schema ) ,
30773068 rawOutput : decodeJsonColumn ( row . output_schema ) ,
3078- includeTypeScript,
30793069 } ) ;
30803070 } ) . pipe (
30813071 Effect . withSpan ( "executor.tool.schema" , {
0 commit comments