diff --git a/.agents/skills/unidesk-code-queue/SKILL.md b/.agents/skills/unidesk-code-queue/SKILL.md index cd01dd0f..795e12c2 100644 --- a/.agents/skills/unidesk-code-queue/SKILL.md +++ b/.agents/skills/unidesk-code-queue/SKILL.md @@ -18,7 +18,17 @@ description: UniDesk legacy Code Queue archive CLI — `codex` 子命令只保 bun scripts/cli.ts agentrun v01 queue commander --reader-id # 提交 AgentRun Queue payload -bun scripts/cli.ts agentrun v01 queue submit --json-file /tmp/task.json +bun scripts/cli.ts agentrun v01 queue submit --json-stdin <<'JSON' +{ + "tenantId": "unidesk", + "projectId": "example", + "queue": "commander", + "title": "任务标题", + "payload": { + "prompt": "任务说明" + } +} +JSON # 查看/控制 AgentRun session bun scripts/cli.ts agentrun v01 sessions trace @@ -28,7 +38,7 @@ bun scripts/cli.ts agentrun v01 sessions steer --prompt-stdin bun scripts/cli.ts agentrun v01 sessions cancel ``` -UniDesk bridge 会把本地 `--json-file`、`--prompt-file`、`--runner-json-file` 或 `--prompt-stdin` materialize 到 G14 `/root/agentrun-v01` 临时文件,然后调用官方 `./scripts/agentrun --manager-url auto`。它不是旧 Code Queue adapter,不双写,也不迁移旧历史。 +日常一次性 JSON、prompt 和 runner JSON 输入优先使用 quoted heredoc/stdin:`--json-stdin`、`--prompt-stdin`、`--runner-json-stdin` 或 `--*-file -`。UniDesk bridge 会把 stdin 直通 G14 `/root/agentrun-v01` 官方 `./scripts/agentrun --manager-url auto` CLI,不先落 dump 文件;`--json-file`、`--prompt-file` 和 `--runner-json-file` 只用于已审阅且可复用的受控文件。它不是旧 Code Queue adapter,不双写,也不迁移旧历史。 AgentRun Queue payload 需要 runner 内使用 UniDesk SSH 透传时,只通过 `executionPolicy.secretScope.toolCredentials[].tool=unidesk-ssh` 请求 `agentrun-v01-tool-unidesk-ssh/UNIDESK_SSH_CLIENT_TOKEN` SecretRef;不要把 token 写入 prompt、payload 或 `transientEnv`。非敏感 endpoint 使用 `UNIDESK_MAIN_SERVER_IP`、`UNIDESK_MAIN_SERVER_HOST` 或 `UNIDESK_FRONTEND_URL`,可由 runner-job `transientEnv` 显式提供;G14 `agentrun-v01` manager 也会在缺省时按受控默认值自动补齐,并在 trace 中只显示 env name/count/hash 与 `valuesPrinted=false`。 diff --git a/src/components/frontend/src/code-queue.tsx b/src/components/frontend/src/code-queue.tsx index fe5299b3..3f6bf50f 100644 --- a/src/components/frontend/src/code-queue.tsx +++ b/src/components/frontend/src/code-queue.tsx @@ -4308,7 +4308,7 @@ export function CodeQueuePage({ microservices, onRaw, apiBaseUrl = "/api", initi h("p", null, "新任务请使用 AgentRun Queue;本页保留历史任务、Trace 和排障查看。"), h("div", { className: "codex-freeze-command-grid" }, h("code", null, "bun scripts/cli.ts agentrun v01 queue commander --reader-id cli"), - h("code", null, "bun scripts/cli.ts agentrun v01 queue submit --json-file "), + h("code", null, "bun scripts/cli.ts agentrun v01 queue submit --json-stdin <<'JSON'"), h("code", null, "bun scripts/cli.ts agentrun v01 sessions trace --after-seq 0 --limit 100"), ), ), diff --git a/src/components/microservices/code-queue/src/index.ts b/src/components/microservices/code-queue/src/index.ts index 9b246291..c6cd2cb0 100644 --- a/src/components/microservices/code-queue/src/index.ts +++ b/src/components/microservices/code-queue/src/index.ts @@ -4872,11 +4872,11 @@ function legacyQueueFrozenResponse(method: string, targetPath: string, action: s action, replacement: { queueCommander: "bun scripts/cli.ts agentrun v01 queue commander --reader-id cli", - queueSubmit: "bun scripts/cli.ts agentrun v01 queue submit --json-file ", - queueDispatch: "bun scripts/cli.ts agentrun v01 queue dispatch --json-file ", + queueSubmit: "bun scripts/cli.ts agentrun v01 queue submit --json-stdin <<'JSON'", + queueDispatch: "bun scripts/cli.ts agentrun v01 queue dispatch --json-stdin <<'JSON'", sessionsTrace: "bun scripts/cli.ts agentrun v01 sessions trace --after-seq 0 --limit 100", sessionsOutput: "bun scripts/cli.ts agentrun v01 sessions output --after-seq 0 --limit 100", - sessionsSteer: "bun scripts/cli.ts agentrun v01 sessions steer --prompt-file ", + sessionsSteer: "bun scripts/cli.ts agentrun v01 sessions steer --prompt-stdin <<'EOF'", sessionsRead: "bun scripts/cli.ts agentrun v01 sessions read --reader-id cli", queueCancel: "bun scripts/cli.ts agentrun v01 queue cancel --reason ", },