fix: expose AgentRun aipod bridge

This commit is contained in:
Codex
2026-06-10 14:20:42 +00:00
parent df4c93d424
commit 420a9a9e85
3 changed files with 41 additions and 9 deletions
+18 -5
View File
@@ -23,13 +23,19 @@ const mirrorToolsImage = "127.0.0.1:5000/hwlab/hwlab-ci-node-tools:node22-alpine
export function agentRunHelp(): unknown {
return {
command: "agentrun v01 control-plane status|trigger-current|refresh|cleanup-runs|cleanup-released-pvs | git-mirror status|sync|flush | queue submit|list|show|stats|commander|read|cancel|dispatch|refresh | sessions ps|show|turn|steer|cancel|output|trace|read",
command: "agentrun v01 control-plane status|trigger-current|refresh|cleanup-runs|cleanup-released-pvs | git-mirror status|sync|flush | aipod-specs list|show|render|apply|delete | queue submit|list|show|stats|commander|read|cancel|dispatch|refresh | sessions ps|show|turn|steer|cancel|output|trace|read",
output: "json",
usage: [
"bun scripts/cli.ts agentrun v01 queue commander --reader-id cli",
"bun scripts/cli.ts agentrun v01 queue commander --reader-id cli --limit 20",
"bun scripts/cli.ts agentrun v01 aipod-specs list",
"bun scripts/cli.ts agentrun v01 aipod-specs show Artificer",
"bun scripts/cli.ts agentrun v01 aipod-specs render Artificer --prompt-stdin",
"bun scripts/cli.ts agentrun v01 aipod-specs apply --yaml-stdin --dry-run",
"bun scripts/cli.ts agentrun v01 queue submit --json-stdin <<'JSON'",
"bun scripts/cli.ts agentrun v01 queue submit --json-stdin --dry-run <<'JSON'",
"bun scripts/cli.ts agentrun v01 queue submit --aipod Artificer --prompt-stdin --idempotency-key <key>",
"bun scripts/cli.ts agentrun v01 queue submit --aipod Artificer --prompt-stdin --dry-run",
"bun scripts/cli.ts agentrun v01 queue submit --json-file <task.json> # reusable reviewed file fallback",
"bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-stdin <<'JSON'",
"bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-stdin --dry-run <<'JSON'",
@@ -37,6 +43,7 @@ export function agentRunHelp(): unknown {
"bun scripts/cli.ts agentrun v01 queue cancel <taskId> --reason <text> --dry-run",
"bun scripts/cli.ts agentrun v01 sessions trace <sessionId> --after-seq 0 --limit 100",
"bun scripts/cli.ts agentrun v01 sessions output <sessionId> --after-seq 0 --limit 100",
"bun scripts/cli.ts agentrun v01 sessions turn --aipod Artificer --prompt-stdin",
"bun scripts/cli.ts agentrun v01 sessions steer <sessionId> --prompt-stdin",
"bun scripts/cli.ts agentrun v01 sessions read <sessionId> --reader-id cli",
"bun scripts/cli.ts agentrun v01 control-plane status",
@@ -54,7 +61,7 @@ export function agentRunHelp(): unknown {
"bun scripts/cli.ts agentrun v01 git-mirror sync --confirm",
"bun scripts/cli.ts agentrun v01 git-mirror flush --confirm",
],
description: "Operate AgentRun v0.1 Queue and Sessions through the official G14 /root/agentrun-v01 CLI, plus bounded Tekton/Argo control-plane and devops-infra git mirror actions through UniDesk routes. Queue/session commands are direct AgentRun CLI calls, not a UniDesk Code Queue adapter or double-write path.",
description: "Operate AgentRun v0.1 Queue, Sessions, and AipodSpec through the official G14 /root/agentrun-v01 CLI, plus bounded Tekton/Argo control-plane and devops-infra git mirror actions through UniDesk routes. Queue/session/aipod-spec commands are direct AgentRun CLI calls, not a UniDesk Code Queue adapter or double-write path.",
};
}
@@ -76,12 +83,16 @@ export async function runAgentRunCommand(config: UniDeskConfig, args: string[]):
return await runGitMirrorJob(config, action, options);
}
}
if (group === "queue" || group === "sessions") {
if (isOfficialAgentRunCliBridgeGroup(group)) {
return await runOfficialAgentRunCli(config, group, args.slice(2));
}
return unsupported(args);
}
function isOfficialAgentRunCliBridgeGroup(group: string | undefined): group is AgentRunOfficialCliBridgeGroup {
return group === "queue" || group === "sessions" || group === "aipod-specs" || group === "aipods";
}
interface TriggerOptions {
confirm: boolean;
dryRun: boolean;
@@ -1458,7 +1469,9 @@ interface PreparedAgentRunCliArgs {
stdinPayload: AgentRunCliForwardedStdin | null;
}
async function runOfficialAgentRunCli(config: UniDeskConfig, group: "queue" | "sessions", args: string[]): Promise<Record<string, unknown>> {
type AgentRunOfficialCliBridgeGroup = "queue" | "sessions" | "aipod-specs" | "aipods";
async function runOfficialAgentRunCli(config: UniDeskConfig, group: AgentRunOfficialCliBridgeGroup, args: string[]): Promise<Record<string, unknown>> {
const prepared = prepareOfficialAgentRunCliArgs([group, ...args]);
const command = `agentrun v01 ${prepared.args.join(" ")}`.trim();
const bridge = agentRunQueueBridgeMetadata(prepared.materializedFiles, prepared.stdinPayload);
@@ -1784,6 +1797,6 @@ function unsupported(args: string[]): Record<string, unknown> {
ok: false,
command: `agentrun ${args.join(" ")}`.trim(),
degradedReason: "unsupported-command",
message: "supported commands: agentrun v01 queue submit|list|show|stats|commander|read|cancel|dispatch|refresh; agentrun v01 sessions ps|show|turn|steer|cancel|output|trace|read; agentrun v01 control-plane status|trigger-current|refresh; agentrun v01 git-mirror status|sync|flush",
message: "supported commands: agentrun v01 aipod-specs list|show|render|apply|delete; agentrun v01 queue submit|list|show|stats|commander|read|cancel|dispatch|refresh; agentrun v01 sessions ps|show|turn|steer|cancel|output|trace|read; agentrun v01 control-plane status|trigger-current|refresh; agentrun v01 git-mirror status|sync|flush",
};
}