feat(core): bound v2 tool output (#30999)
This commit is contained in:
@@ -22,7 +22,7 @@ export const Success = Schema.Struct({
|
||||
directory: Schema.String,
|
||||
output: Schema.String,
|
||||
truncated: Schema.Boolean,
|
||||
resource: ToolOutputStore.Resource.pipe(Schema.optional),
|
||||
outputPath: Schema.String.pipe(Schema.optional),
|
||||
})
|
||||
|
||||
export const description = [
|
||||
@@ -73,6 +73,7 @@ export const layer = Layer.effectDiscard(
|
||||
yield* registry.contribute((editor) =>
|
||||
editor.set(name, {
|
||||
tool: definition,
|
||||
outputPaths: (output) => (output.outputPath ? [output.outputPath] : []),
|
||||
execute: ({ parameters, sessionID, call, assertPermission }) =>
|
||||
Effect.gen(function* () {
|
||||
const current = yield* skills.list()
|
||||
@@ -98,7 +99,7 @@ export const layer = Layer.effectDiscard(
|
||||
directory,
|
||||
output: output.content,
|
||||
truncated: output.truncated,
|
||||
...(output.truncated ? { resource: output.resource } : {}),
|
||||
...(output.truncated ? { outputPath: output.outputPath } : {}),
|
||||
}
|
||||
}).pipe(Effect.catchCause((cause) => Effect.fail(unableToLoad(parameters.name, Cause.squash(cause)))))
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user