The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
perf(runner): compile the TypeScript surface once per build (#15853)
Devin Foleyde9ab8e7e066
diff --git a/packages/paperclip-runner/package.json b/packages/paperclip-runner/package.jsonindex 8c1249044c..f962fe6c20 100644--- a/packages/paperclip-runner/package.json+++ b/packages/paperclip-runner/package.json@@ -63,7 +63,7 @@},"sideEffects": false,"scripts": {- "build": "pnpm run check:protocol-manifest && pnpm run build:typescript && pnpm run check:capability-contract && pnpm run check:capability-inventory && pnpm run check:protocol-coverage && pnpm run check:semantic-contracts && pnpm run check:runner-workflow-traceability && pnpm run build:binary && node scripts/generate-replay-goldens.mjs --check && node scripts/generate-semantic-action-catalog.mjs --check",+ "build": "pnpm run check:protocol-manifest && pnpm run build:typescript && pnpm run check:capability-contract && pnpm run check:capability-inventory && pnpm run check:protocol-coverage && node scripts/generate-semantic-contracts.mjs --check && node scripts/check-runner-workflow-traceability.mjs && pnpm run build:binary && node scripts/generate-replay-goldens.mjs --check && node scripts/generate-semantic-action-catalog.mjs --check","build:typescript": "pnpm run check:acpx-profiles && pnpm run ensure:eval-build-deps && pnpm run check:protocol-types && node ./node_modules/typescript/bin/tsc --version && node ./node_modules/typescript/bin/tsc -p tsconfig.json && node ./node_modules/typescript/bin/tsc -p tsconfig.surfaces.json && node scripts/build-verified-provider-entrypoints.mjs","build:rust": "cargo build --manifest-path runner/Cargo.toml --locked --workspace --bins","build:binary": "cargo build --release --manifest-path runner/Cargo.toml --locked -p paperclip-runner-core --bin paperclip-runnerd && node scripts/stage-runner-binary.mjs",diff --git a/server/src/__tests__/server-package-build-script.test.ts b/server/src/__tests__/server-package-build-script.test.tsindex 64cbbf17ab..0c97256947 100644--- a/server/src/__tests__/server-package-build-script.test.ts+++ b/server/src/__tests__/server-package-build-script.test.ts@@ -103,6 +103,36 @@ describe("server package build script", () => {);});+ it("compiles the vendored Runner's TypeScript surface once per build", () => {+ // prepare:runner-vendor runs the Runner's full build, and `pnpm -r build`+ // has already run it once by the time the server builds. Each extra+ // build:typescript inside that chain (two tsc projects plus the eval-kernel+ // rebuild) costs about 7s on the CI Build job's critical path, twice.+ // Checks that read dist/ must call their script directly, the way+ // generate-replay-goldens.mjs already does, not through a `check:*`+ // wrapper that rebuilds first for standalone use.+ const runner = JSON.parse(readFileSync(new URL(+ "../../../packages/paperclip-runner/package.json", import.meta.url,+ ), "utf8")) as { scripts: Record<string, string> };+ const steps = runner.scripts.build.split(" && ");+ const wrapped = steps+ .filter((step) => step.startsWith("pnpm run "))+ .map((step) => step.slice("pnpm run ".length));+ for (const name of wrapped) {+ expect(runner.scripts[name], `build step ${name}`).toBeDefined();+ }+ const compiles = (step: string) =>+ step === "build:typescript" || (runner.scripts[step] ?? "").includes("build:typescript");++ expect(wrapped.filter(compiles)).toEqual(["build:typescript"]);+ expect(steps).toContain("node scripts/generate-semantic-contracts.mjs --check");+ expect(steps).toContain("node scripts/check-runner-workflow-traceability.mjs");+ expect(steps.indexOf("node scripts/generate-semantic-contracts.mjs --check"))+ .toBeGreaterThan(steps.indexOf("pnpm run build:typescript"));+ expect(steps.indexOf("node scripts/check-runner-workflow-traceability.mjs"))+ .toBeGreaterThan(steps.indexOf("pnpm run build:typescript"));+ });+it("ships the pinned OpenCode dependency resolved by the vendored Runner", () => {const server = JSON.parse(readFileSync(packageJsonPath, "utf8"));const runner = JSON.parse(readFileSync(new URL(