Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pins.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"t3": {
"repo": "pingdotgg/t3code",
"commit": "8b44f42b14c8e273156474a924ccf29680dd7857",
"commit": "67eebaca23f8f7bc46e8817434087fc9c5acf8e3",
"paths": [
"apps/server/src/mcp/toolkits/attachment/tools.ts",
"apps/server/src/mcp/toolkits/device/tools.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const OrchestratorCapabilitiesTool = Tool.make("orchestrator_capabilities", {

const DelegateTaskTool = Tool.make("delegate_task", {
description:
"Start one child agent with only `task`. No parent history. Separate checkout or PR per child: `isolation:'worktree'`. Keep `taskId` for `task_status` and `task_cancel`.",
"Start one child agent with only `task`. No parent history. Separate checkout or PR per child: `isolation:'worktree'`. Keep `taskId` for `task_status` and `task_cancel`. No secrets in `task`.",
parameters: OrchestratorMcpDelegateTaskInput,
success: OrchestratorMcpDelegateTaskResult,
failure: OrchestratorMcpFailure,
Expand Down Expand Up @@ -197,15 +197,17 @@ const DeleteScheduledTaskTool = Tool.make("delete_scheduled_task", {

const RequestSecretTool = Tool.make("request_secret", {
description:
'Ask the user to enter a secret in a private card and wait. You never see the value. Returns a one-use `secretRef` for a tool that accepts it, or with `delivery: "file"` a private file path to read inside a shell command. Asked how to provide a secret: call this now, do not explain instead.',
'Ask for a secret in a private card and wait; open it, don\'t offer it. Returns a one-use `secretRef`, or with `delivery: "file"` a file to read only in its command, e.g. `adb pair <ip:port> "$(cat <file>)"`. Asked how to give one: call now. Pasted secret for child or script: `value`. Not one from an old thread.',
parameters: OrchestratorMcpRequestSecretInput,
success: OrchestratorMcpRequestSecretResult,
failure: OrchestratorMcpFailure,
failureMode: "return",
dependencies,
})
.annotate(Tool.Title, "Request a secret from the user")
.annotate(Tool.Destructive, false);
.annotate(Tool.Destructive, false)
// Claude Code defers MCP tools behind ToolSearch; agents that never load this one ask in chat.
.annotate(Tool.Meta, { "anthropic/alwaysLoad": true });

const CreateThreadsTool = Tool.make("create_threads", {
description:
Expand Down
19 changes: 14 additions & 5 deletions t3/contract/packages/contracts/src/orchestratorMcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,11 @@ export const OrchestratorMcpUpdateScheduledTaskInput = Schema.Struct({
export type OrchestratorMcpUpdateScheduledTaskInput =
typeof OrchestratorMcpUpdateScheduledTaskInput.Type;

// Not trimmed: whitespace in a password matters. The check stays out of the advertised schema.
const PastedSecretValue = Schema.String.check(
Schema.makeFilter((value: string) => value.length > 0, { expected: "a non-empty string" }),
);

export const OrchestratorMcpRequestSecretInput = Schema.Struct({
label: TrimmedNonEmptyString.annotate({
description: "Card title, such as 'GitHub webhook secret'.",
Expand All @@ -737,14 +742,17 @@ export const OrchestratorMcpRequestSecretInput = Schema.Struct({
}),
placeholder: Schema.optional(TrimmedNonEmptyString),
delivery: Schema.optional(Schema.Literals(["secretRef", "file"])).annotate({
description:
'secretRef (default) for a T3 tool. file for a shell CLI: read the path in your command, e.g. TOKEN="$(cat <file>)" wrangler whoami.',
description: "secretRef (default) for a T3 tool; file for a command.",
}),
value: Schema.optional(PastedSecretValue).annotate({
description: "Pasted in this thread; no card.",
}),
/** Default 10 minutes. */
timeoutMs: Schema.optional(
Schema.Int.check(Schema.isBetween({ minimum: 1_000, maximum: 60 * 60 * 1_000 })),
).annotate({ description: "Default 10 min." }),
),
clientRequestId: Schema.optional(OrchestratorMcpClientRequestId).annotate({
description: "Retry key for this ask. New key after a timeout or cancel.",
description: "Retry key.",
}),
});
export type OrchestratorMcpRequestSecretInput = typeof OrchestratorMcpRequestSecretInput.Type;
Expand All @@ -766,8 +774,9 @@ export const OrchestratorMcpRequestSecretResult = Schema.Union([
Schema.Struct({
status: Schema.Literals(["declined", "cancelled", "timed_out"]).annotate({
description:
"declined: user chose not to. cancelled: ended with the run. timed_out: no answer in time. Ask again with a new `clientRequestId` if still needed.",
"declined: user chose not to; don't ask again. cancelled: ended with the run. timed_out: no answer in time. After cancelled or timed_out, ask again with a new `clientRequestId` only if still needed.",
}),
note: Schema.optional(Schema.String).annotate({ description: "What to do next." }),
}),
]);
export type OrchestratorMcpRequestSecretResult = typeof OrchestratorMcpRequestSecretResult.Type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Ordinary coding tasks need no T3 tools.
- Another machine: \`t3_environment_links\` lists linked ones. Pass its \`environmentId\` to a T3 tool to act there. Ids are then that machine's, so pass \`threadId\`.
- A machine the user names that is not linked ("delegate this to my vps"): call \`t3_environment_link\` with a \`hint\` from their words. Never ask for a pairing code in chat.
- In your reply, mention a thread by its \`link\`, verbatim. Never a plain title or bare id.
- A secret: call \`request_secret\` yourself. Pass its \`secretRef\` to a T3 tool, or use \`delivery: "file"\` for a shell command. Never ask in chat or invent one. When asked only to schedule, \`schedule_task\` without running its prompt.
- A login, token, PIN or pairing code only the user can give: call \`request_secret\`, not a chat ask or a handoff. Not for access you have. When asked only to schedule, \`schedule_task\` without running its prompt.
- T3 tools may load late. Try the name once before you call it absent.`,
`### Visuals and preview

Expand Down
Loading