diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 41a94cf..f1042e2 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -9,7 +9,7 @@ "name": "pstack", "source": "./plugins/pstack", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", - "version": "0.13.8", + "version": "0.13.9", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" }, diff --git a/package.json b/package.json index 1808f52..7f53591 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "t3-pstack", - "version": "0.13.8", + "version": "0.13.9", "private": true, "type": "module", "scripts": { 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/plugins/pstack/.claude-plugin/plugin.json b/plugins/pstack/.claude-plugin/plugin.json index 49cad34..4f6756f 100644 --- a/plugins/pstack/.claude-plugin/plugin.json +++ b/plugins/pstack/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "pstack", "displayName": "pstack", - "version": "0.13.8", + "version": "0.13.9", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" diff --git a/plugins/pstack/.codex-plugin/plugin.json b/plugins/pstack/.codex-plugin/plugin.json index dbdc0a2..d896a4e 100644 --- a/plugins/pstack/.codex-plugin/plugin.json +++ b/plugins/pstack/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "pstack", - "version": "0.13.8", + "version": "0.13.9", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" diff --git a/plugins/pstack/skills/poteto-mode/references/t3-adapter.md b/plugins/pstack/skills/poteto-mode/references/t3-adapter.md index bf3ec74..d5b881a 100644 --- a/plugins/pstack/skills/poteto-mode/references/t3-adapter.md +++ b/plugins/pstack/skills/poteto-mode/references/t3-adapter.md @@ -57,7 +57,7 @@ Upstream reads per-role models from "the `/setup-pstack` rule" (`~/.cursor/rules - `orchestrator_capabilities` lists a short set of models per provider and leaves out legacy ones, but `delegate_task` accepts any catalog model id. Send a full model id the list lacks as it is. Call `orchestrator_capabilities` again with `search` set to the model only for a short form the list lacks or after `delegate_task` rejects the model. - A project can turn a provider off. `orchestrator_capabilities` still lists it, but `delegate_task` refuses it as "disabled for project". - When the search finds nothing or the provider is off, never switch the lane to another model or provider on your own. Name what is missing and ask the user which to use (Questions section). This replaces every fallback a skill gives for a rejected model, such as a family default, the closest valid slug from the error, or the parent model. - - Compare the `providerInstanceId`, `model`, and `options` that `delegate_task` returns with the target. If they differ, say so in the reply. + - Compare the `providerInstanceId`, `model`, and `options` that `delegate_task` returns with the target. If they differ, say so in the reply. The provider can still run another model, such as when the user's organization disallows the requested one. A finished task then reports it in `executedModel`, and T3 starts its summary with a note that names both models. Name the model that ran in the reply too. 3. `inherit-parent` or `auto` means: omit `target`. The lane runs on your own provider and model, and it still counts toward a panel's fan-out. 4. With no sheet line, translate the skill's default slug: `claude-opus-5-5-` is `claude:opus@`, `gpt-5.6-sol-` is `codex:gpt-6.1-sol@`, and `grok-4.7--fast` or `grok-4.7-` is the `grok` provider when the catalog lists one that can run child tasks, else `codex:gpt-6.1-sol@`. 5. "A model family" is the provider. A cross-family judge or reviewer runs on a different provider than the work it judges. @@ -120,7 +120,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or - **A delegated child never asks the user.** It returns `BLOCKED` with the question, and the root asks. A child that asks anyway waits, and `t3_thread_read` on its `childThreadId` shows a nonzero `pendingRequestCount`. Find the question with `t3_pending_request` and `action: "list"`, read it with `action: "read"`, and answer it with `action: "respond"`, each with `threadId` set to the child's `childThreadId`. Answer it yourself when the brief or the run settles it. Otherwise ask the user and pass on the answer. - **Visuals** (charts, tables, mockups, Cursor's `/visualize`). Build a self-contained page as an `.html` file in the work dir (Worktrees section), check it with `html_preview`, then publish it with `html_render` from the root. Pass the file's absolute path as `path` to both, so the page is not retyped. Only a full-access thread may pass `path`. Any other thread gets a capability error and passes the page as inline `html` instead. A child's render lands in the child's thread. Show verification screenshots the same way, for example a before and after grid, before the reply that cites them. A reader who clicks an image outside a link or button opens it full size in T3's image viewer, so a grid can show screenshots small. Write each image as one complete absolute path, in `src` or as a JavaScript string. T3 does not inline a path the page builds from parts. T3 inlines local images into the page, so the thread keeps them after the worktree is gone. To embed a screenshot, a video, or an audio clip in the reply itself, as `/ketchup` asks, write it as a Markdown image whose target is the file's absolute path. T3 renders all three. Keep that file in the work dir (Worktrees section), so it outlives the worktree. A Mermaid fence in the reply renders as a diagram. A generated image needs an image tool from your provider. T3 has none, so without one draw a diagram or chart instead. - **Files in the reply.** Link each file the reply cites, such as show-me-your-work's evidence, the decision log, or a verification log, as a Markdown link whose target is the file's absolute path. T3 opens it in its file viewer. -- **Secrets** (a CLI token, an API key, a test account password for a verification run). The root calls `request_secret`. For a shell command, pass `delivery: "file"` and read the returned path inside the command, such as `TOKEN="$(cat )" `. Never print the value, and keep it out of the work dir, briefs, and commits. A child that needs a secret returns `BLOCKED`. The root requests it and puts the file path, never the value, in the next brief. T3 deletes the file after 24 hours, so a schedule or automation that needs the value later reads it from the user's own configuration, such as benny's `BENNY_SLACK_BOT_TOKEN`. +- **Secrets** (a CLI token, an API key, a test account password for a verification run). The root calls `request_secret` and puts the link to the page where the user gets the value, such as the service's token settings, in `url`, not in `reason`. The card shows it as a button. For a shell command, pass `delivery: "file"` and read the returned path inside the command, such as `TOKEN="$(cat )" `. Never print the value, and keep it out of the work dir, briefs, and commits. A child that needs a secret returns `BLOCKED`. The root requests it and puts the file path, never the value, in the next brief. T3 deletes the file after 24 hours, so a schedule or automation that needs the value later reads it from the user's own configuration, such as benny's `BENNY_SLACK_BOT_TOKEN`. ## Cursor products with no counterpart 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