diff --git a/docs/reference/spec-v01-runtime-assembly.md b/docs/reference/spec-v01-runtime-assembly.md index 99bd4b7..e149ba0 100644 --- a/docs/reference/spec-v01-runtime-assembly.md +++ b/docs/reference/spec-v01-runtime-assembly.md @@ -166,7 +166,7 @@ HWLAB Workbench 的 project/workspace 不属于 RuntimeAssembly 四要素,也 #### tools 目录 -runner 对 workspace `tools/` 做统一装配:顶层带 shebang 的脚本会被 `chmod +x`,`tools/` 目录会追加到 `PATH`。`.ts` 工具脚本必须以 `#!/usr/bin/env bun` 或等价 shebang 开头;缺 shebang 必须 blocked 为 schema-invalid。短命令名称来自 repo 内真实文件,例如 `tools/hwpod`,不再由 runner 生成 wrapper。 +runner 对 workspace `tools/` 做统一装配:顶层带 shebang 的脚本会被 `chmod +x`,`tools/` 目录会追加到 `PATH`。非 shebang 文件是随 bundle 复制的源码、测试或辅助文件,不作为可执行工具发现,也不触发 schema-invalid。短命令名称来自 repo 内真实文件,例如 `tools/hwpod`,不再由 runner 生成 wrapper。 #### promptRefs diff --git a/src/runner/resource-bundle.ts b/src/runner/resource-bundle.ts index 658deea..f299682 100644 --- a/src/runner/resource-bundle.ts +++ b/src/runner/resource-bundle.ts @@ -162,7 +162,6 @@ async function prepareGitBundleTools(workspacePath: string): Promise<{ binPath?: const filePath = path.join(binPath, entry.name); const text = await readFile(filePath, "utf8"); const firstLine = text.split(/\r?\n/u, 1)[0] ?? ""; - if (entry.name.endsWith(".ts") && !firstLine.startsWith("#!")) throw new AgentRunError("schema-invalid", `gitbundle tool ${entry.name} must start with a shebang`, { httpStatus: 400 }); if (!firstLine.startsWith("#!")) continue; await chmod(filePath, 0o755); names.push(entry.name); diff --git a/src/selftest/cases/50-hwlab-manual-dispatch.ts b/src/selftest/cases/50-hwlab-manual-dispatch.ts index 0a74185..f4d24e7 100644 --- a/src/selftest/cases/50-hwlab-manual-dispatch.ts +++ b/src/selftest/cases/50-hwlab-manual-dispatch.ts @@ -209,6 +209,7 @@ async function createLocalGitBundle(context: SelfTestContext): Promise