25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import {
|
|
ThreadReferenceReadError,
|
|
ThreadReferenceReadInput,
|
|
ThreadReferenceReadResult,
|
|
} from "@t3tools/contracts";
|
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
|
|
import * as McpInvocationContext from "../../McpInvocationContext.ts";
|
|
import { ProjectionSnapshotQuery } from "../../../orchestration/Services/ProjectionSnapshotQuery.ts";
|
|
|
|
export const ThreadReadTool = Tool.make("thread_read", {
|
|
description:
|
|
"Read a T3 Code chat thread referenced by a t3-thread link in the user's message. Pass the threadId from that link. The transcript is paginated; when nextCursor is non-null, call thread_read again with that cursor to continue. Do not call this for unrelated threads that the user did not reference.",
|
|
parameters: ThreadReferenceReadInput,
|
|
success: ThreadReferenceReadResult,
|
|
failure: ThreadReferenceReadError,
|
|
dependencies: [McpInvocationContext.McpInvocationContext, ProjectionSnapshotQuery],
|
|
})
|
|
.annotate(Tool.Title, "Read referenced chat thread")
|
|
.annotate(Tool.Readonly, true)
|
|
.annotate(Tool.Destructive, false)
|
|
.annotate(Tool.Idempotent, true);
|
|
|
|
export const ThreadReferenceToolkit = Toolkit.make(ThreadReadTool);
|