Open History to see the last commit
1import { OrchestratorMcpFailure } from "@t3tools/contracts";
2import * as Schema from "effect/Schema";
3import { McpSchema, Tool, Toolkit } from "effect/ai";
4
5import {
6 FeedbackAwaitingApproval,
7 FeedbackInput,
8 FeedbackSubmitResult,
9} from "../../../feedback/FeedbackReport.ts";
10import * as Feedback from "../../../feedback/FeedbackService.ts";
11import * as ThreadManagementService from "../../../orchestration-v2/ThreadManagementService.ts";
12import * as McpInvocationContext from "../../McpInvocationContext.ts";
13
14const shared = {
15 failure: OrchestratorMcpFailure,
16 failureMode: "return" as const,
17 dependencies: [
18 Feedback.FeedbackService,
19 McpInvocationContext.McpInvocationContext,
20 ThreadManagementService.ThreadManagementService,
21 ],
22};
23
24export const FeedbackToolkit = Toolkit.make(
25 Tool.make("t3_feedback", {
26 ...shared,
27 description:
28 "Send feedback to the T3 team: a T3 tool or `t3` command that misbehaved, a confusing instruction, a missing capability, or anything about T3 Code the user asks you to send. Not the user's own code. Use your own words; never quote the user's messages, code, files, or names. A report the user asks for opens a card where they approve it and choose whether to include the conversation of the `turns` you set, so call this when asked without asking first, and never paste the conversation into it.",
29 parameters: FeedbackInput,
30 success: Schema.Union([FeedbackSubmitResult, FeedbackAwaitingApproval]),
31 })
32 .annotate(Tool.Destructive, false)
33 .annotate(McpSchema.EnabledWhen, McpInvocationContext.hiddenWhileFeedbackOff),
34);