refactor: remove skill files from seed, keep only tool files

Skills now delivered exclusively via AgentRun skillRefs channel.
Removed: hwpod-cli, hwpod-ctl, hwlab-agent-runtime SKILL.md entries.
Removed: arm2d-skill directory seed + collectDirectorySeedFiles helper.
Seed array now only contains hwpod tool files (*.ts).
This commit is contained in:
Codex Agent
2026-06-07 15:07:31 +08:00
parent 7b5dd408fc
commit 2577ecfaf9
+1 -29
View File
@@ -1,7 +1,7 @@
import { spawn } from "node:child_process";
import { createHash, randomUUID } from "node:crypto";
import { closeSync, openSync } from "node:fs";
import { copyFile, mkdir, readFile, readdir, stat, writeFile } from "node:fs/promises";
import { copyFile, mkdir, readFile, stat, writeFile } from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
@@ -28,10 +28,6 @@ const AGENT_WORKSPACE_SEED_FILES = [
{ source: "tools/src/hwpod-harness-lib.ts", target: "tools/src/hwpod-harness-lib.ts" },
{ source: "tools/src/hwpod-node-ops-contract.ts", target: "tools/src/hwpod-node-ops-contract.ts" },
{ source: "tools/src/runtime-endpoint-resolver.ts", target: "tools/src/runtime-endpoint-resolver.ts" },
{ source: "skills/hwpod-cli/SKILL.md", target: ".agents/skills/hwpod-cli/SKILL.md" },
{ source: "skills/hwpod-ctl/SKILL.md", target: ".agents/skills/hwpod-ctl/SKILL.md" },
{ source: "skills/hwlab-agent-runtime/SKILL.md", target: ".agents/skills/hwlab-agent-runtime/SKILL.md" },
{ source: "skills/arm2d-skill", target: ".agents/skills/arm2d-skill", type: "directory" }
] as const;
type EnvLike = Record<string, string | undefined>;
@@ -942,34 +938,10 @@ function agentTraceIdentityArtifact(run: PreparedCaseRun, agent: AgentRunStage)
});
}
async function collectDirectorySeedFiles(sourceRel: string, targetRel: string, files: AgentWorkspaceFile[]): Promise<void> {
const sourceDir = path.join(SOURCE_ROOT, sourceRel);
const stack: string[] = [""];
while (stack.length > 0) {
const sub = stack.pop()!;
const dirPath = path.join(sourceDir, sub);
const entries = await readdir(dirPath, { withFileTypes: true });
for (const dirent of entries) {
const relPath = sub ? path.join(sub, dirent.name) : dirent.name;
if (dirent.isDirectory()) {
stack.push(relPath);
} else if (dirent.isFile()) {
const filePath = path.join(dirPath, dirent.name);
const targetPath = path.join(targetRel, relPath).replace(/\\/g, "/");
files.push({ path: targetPath, content: await readFile(filePath, "utf8"), encoding: "utf8" });
}
}
}
}
async function agentWorkspaceFilesForRun(run: PreparedCaseRun): Promise<AgentWorkspaceFile[]> {
const content = await readFile(run.specPath, "utf8");
const files: AgentWorkspaceFile[] = [{ path: ".hwlab/hwpod-spec.yaml", content, encoding: "utf8" }];
for (const entry of AGENT_WORKSPACE_SEED_FILES) {
if ("type" in entry && (entry as any).type === "directory") {
await collectDirectorySeedFiles(entry.source, (entry as any).target, files);
continue;
}
const sourcePath = path.join(SOURCE_ROOT, entry.source);
try {
files.push({ path: entry.target, content: await readFile(sourcePath, "utf8"), encoding: "utf8" });