diff --git a/pins.json b/pins.json index c797e85..a183ddb 100644 --- a/pins.json +++ b/pins.json @@ -23,7 +23,7 @@ }, "t3": { "repo": "pingdotgg/t3code", - "commit": "09a54f01bc0ae83865347a965ced50f8c8ec2953", + "commit": "c6ca6056309904f89b90b6055d797973be0a0939", "paths": [ "apps/server/src/mcp/toolkits/attachment/tools.ts", "apps/server/src/mcp/toolkits/device/tools.ts", diff --git a/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts b/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts index f0affbf..2ba8a5f 100644 --- a/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts +++ b/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts @@ -197,7 +197,7 @@ const DeleteScheduledTaskTool = Tool.make("delete_scheduled_task", { const RequestSecretTool = Tool.make("request_secret", { description: - 'Ask for one secret per single-line card; never combine values. Open it, don\'t offer it. Returns one-use `secretRef`, or `delivery: "file"` a file read only in its command, e.g. `adb pair "$(cat )"`. Asked how: call now. Pasted secret for child/script: `value`. Never from an old thread.', + 'Ask for one secret per single-line card; never combine values. Open it, don\'t offer it. Returns one-use `secretRef`, or `delivery: "file"` a file read only in its command, e.g. `adb pair "$(cat )"`. Asked how: call now. Sign-in link: `url`. Pasted secret for child/script: `value`. Never from an old thread.', parameters: OrchestratorMcpRequestSecretInput, success: OrchestratorMcpRequestSecretResult, failure: OrchestratorMcpFailure, diff --git a/t3/contract/packages/contracts/src/orchestratorMcp.ts b/t3/contract/packages/contracts/src/orchestratorMcp.ts index c73bbd4..d1bb996 100644 --- a/t3/contract/packages/contracts/src/orchestratorMcp.ts +++ b/t3/contract/packages/contracts/src/orchestratorMcp.ts @@ -32,6 +32,7 @@ import { ThreadPullRequestKey, ThreadPullRequestLinkSource, } from "./threadPullRequest.ts"; +import { secretRequestPageUrl } from "./secretRequest.ts"; import { hasOnlyPairedSurrogates } from "./threadMetadataMcp.ts"; import { ThreadTitleRegeneration } from "./threadTitle.ts"; import { @@ -201,6 +202,12 @@ export const ORCHESTRATOR_MCP_RUNNING_TASK_NEXT = "Completion wakes this thread, so end your turn. Do not wait on it or poll it."; const OrchestratorMcpRunningTaskNext = Schema.Literal(ORCHESTRATOR_MCP_RUNNING_TASK_NEXT); +// Optional: linked environments on older versions omit it. +const OrchestratorMcpExecutedModel = Schema.NullOr(Schema.String).annotate({ + description: + "Model the provider reported running, or null when unavailable. Can differ from the requested `model`.", +}); + export const OrchestratorMcpDelegateTaskResult = Schema.Struct({ taskId: NodeId, /** Null for a task that runs in a linked environment; see `remoteChild`. */ @@ -221,6 +228,7 @@ export const OrchestratorMcpDelegateTaskResult = Schema.Struct({ latestTerminalResultContextTransferId: Schema.NullOr(ContextTransferId), providerInstanceId: ProviderInstanceId, model: Schema.NullOr(Schema.String), + executedModel: Schema.optional(OrchestratorMcpExecutedModel), options: Schema.optional(Schema.Array(ProviderOptionSelection)), summary: Schema.NullOr(Schema.String), resultContextTransferId: Schema.NullOr(ContextTransferId), @@ -462,6 +470,7 @@ export const OrchestratorMcpThreadRun = Schema.Struct({ status: OrchestrationV2RunStatus, providerInstanceId: ProviderInstanceId, model: Schema.String, + executedModel: Schema.optional(OrchestratorMcpExecutedModel), requestedAt: IsoDateTime, startedAt: Schema.NullOr(IsoDateTime), completedAt: Schema.NullOr(IsoDateTime), @@ -752,7 +761,16 @@ export const OrchestratorMcpRequestSecretInput = Schema.Struct({ description: "Card title, such as 'GitHub webhook secret'.", }), reason: TrimmedNonEmptyString.annotate({ - description: "What it is for and where to get it.", + description: "What it is for and where to get it. A link goes in `url`.", + }), + url: Schema.optional( + TrimmedNonEmptyString.check( + Schema.makeFilter((value) => secretRequestPageUrl(value) !== null, { + expected: "an http(s) URL", + }), + ), + ).annotate({ + description: "Sign-in or setup page for the value. Shown as a button.", }), placeholder: Schema.optional(TrimmedNonEmptyString), delivery: Schema.optional(Schema.Literals(["secretRef", "file"])).annotate({ diff --git a/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts b/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts index c4061a2..4e826db 100644 --- a/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts +++ b/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts @@ -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 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. +- A login, token, PIN, pairing code or sudo password only the user can give: call \`request_secret\`, not a chat ask or a handoff. Not for access you have. Sudo: if \`sudo -n \` says a password is required, use \`delivery: "file"\` and run \`sudo -S -p '' < "$file"\`; the password takes stdin, so give other input as a file argument. 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