This commit is contained in:
Dax Raad
2025-06-11 12:44:17 -04:00
parent 95d5e1f231
commit 6cf8784ecf
6 changed files with 62 additions and 12 deletions

View File

@@ -1,13 +1,17 @@
import type { StandardSchemaV1 } from "@standard-schema/spec"
export namespace Tool {
interface Metadata {
title: string
[key: string]: any
}
export type Context = {
sessionID: string
abort: AbortSignal
}
export interface Info<
Parameters extends StandardSchemaV1 = StandardSchemaV1,
Metadata extends Record<string, any> = Record<string, any>,
M extends Metadata = Metadata,
> {
id: string
description: string
@@ -16,14 +20,14 @@ export namespace Tool {
args: StandardSchemaV1.InferOutput<Parameters>,
ctx: Context,
): Promise<{
metadata: Metadata
metadata: M
output: string
}>
}
export function define<
Parameters extends StandardSchemaV1,
Result extends Record<string, any>,
Result extends Metadata,
>(input: Info<Parameters, Result>): Info<Parameters, Result> {
return input
}