pi-harness-runtime 1.1.383 → 1.1.384
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/harness/job-state-machine.ts +97 -10
- package/harness/langchain/surge.test.ts +57 -25
- package/package.json +8 -4
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/dist/minimax-browser-auth.d.ts +1 -0
- package/packages/auth/dist/minimax-browser-auth.d.ts.map +1 -1
- package/packages/auth/dist/minimax-browser-auth.js +2 -2
- package/packages/auth/dist/minimax-browser-auth.js.map +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/auth/src/minimax-browser-auth.ts +15 -3
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/dist/checkpoint-manager.d.ts.map +1 -1
- package/packages/checkpoint/dist/checkpoint-manager.js +3 -0
- package/packages/checkpoint/dist/checkpoint-manager.js.map +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/checkpoint/src/checkpoint-manager.ts +8 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/connection-runtime/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/durable-review/package.json +1 -1
- package/packages/e2e-tester/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-sink/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/permission-mode/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/telegram/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/voice-api/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/write-review/package.json +1 -1
- package/scripts/run-e2e-scripts.mjs +74 -0
- package/scripts/run-langchain-tests.mjs +169 -0
- package/scripts/typecheck-packages.mjs +167 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Type check every TypeScript project that ships a tsconfig.json.
|
|
4
|
+
*
|
|
5
|
+
* `npm run build` compiles the packages but swallows every error (`|| true`),
|
|
6
|
+
* and the CI "Type check" step used to be a no-op (`npm run typecheck ||
|
|
7
|
+
* echo "No typecheck script"` - there was no typecheck script and no root
|
|
8
|
+
* tsconfig.json), so nothing was ever type checked.
|
|
9
|
+
*
|
|
10
|
+
* This script is the real check: it runs `tsc --noEmit` per project and
|
|
11
|
+
* fails when a project reports MORE errors than its recorded baseline.
|
|
12
|
+
*
|
|
13
|
+
* A baseline is the number of type errors a project already has on HEAD.
|
|
14
|
+
* It exists because eight packages, the harness and the scripts directory
|
|
15
|
+
* have pre-existing type errors that are tracked separately; without a
|
|
16
|
+
* baseline this script could never go green. A baseline is a CEILING, not
|
|
17
|
+
* a waiver: one additional error in a baselined project fails the build
|
|
18
|
+
* too, so the blind spot cannot grow.
|
|
19
|
+
*/
|
|
20
|
+
import { execFileSync } from "node:child_process";
|
|
21
|
+
import { existsSync, mkdtempSync, readdirSync, readFileSync } from "node:fs";
|
|
22
|
+
import { tmpdir } from "node:os";
|
|
23
|
+
import { join, relative } from "node:path";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Maximum tolerated number of type errors per project. A project that is
|
|
27
|
+
* not listed must type check cleanly.
|
|
28
|
+
*/
|
|
29
|
+
const BASELINES = new Map([
|
|
30
|
+
["a2a-adapter", 1],
|
|
31
|
+
["clipboard-plugin", 1],
|
|
32
|
+
["provider-router", 3],
|
|
33
|
+
["providers", 4],
|
|
34
|
+
["quota-manager", 2],
|
|
35
|
+
["runtime", 5],
|
|
36
|
+
["voice-api", 16],
|
|
37
|
+
["worktree", 2],
|
|
38
|
+
["harness", 35],
|
|
39
|
+
["scripts", 15],
|
|
40
|
+
]);
|
|
41
|
+
|
|
42
|
+
const TSC_TIMEOUT_MS = 300_000;
|
|
43
|
+
|
|
44
|
+
const root = join(import.meta.dirname, "..");
|
|
45
|
+
const packagesDir = join(root, "packages");
|
|
46
|
+
const tsc = join(root, "node_modules", ".bin", "tsc");
|
|
47
|
+
|
|
48
|
+
if (!existsSync(tsc)) {
|
|
49
|
+
console.error(`typecheck: ${tsc} not found - run "bun install" first`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** All projects to check, relative to the repo root. */
|
|
54
|
+
const projects = [];
|
|
55
|
+
for (const name of readdirSync(packagesDir).sort()) {
|
|
56
|
+
const project = join(packagesDir, name, "tsconfig.json");
|
|
57
|
+
if (existsSync(project)) projects.push(relative(root, project));
|
|
58
|
+
}
|
|
59
|
+
for (const extra of ["harness", "scripts"]) {
|
|
60
|
+
if (existsSync(join(root, extra, "tsconfig.json"))) {
|
|
61
|
+
projects.push(join(extra, "tsconfig.json"));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Baseline owner for a project path ("packages/runtime" -> that package). */
|
|
66
|
+
function ownerOf(projectPath) {
|
|
67
|
+
const normalized = projectPath.split("\\").join("/");
|
|
68
|
+
if (normalized.startsWith("packages/")) {
|
|
69
|
+
return normalized.split("/")[1];
|
|
70
|
+
}
|
|
71
|
+
return normalized.split("/")[0];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const failures = [];
|
|
75
|
+
const baselined = [];
|
|
76
|
+
const improved = [];
|
|
77
|
+
let checked = 0;
|
|
78
|
+
|
|
79
|
+
// `tsc --noEmit` still writes the .tsbuildinfo of an incremental or
|
|
80
|
+
// composite project - into the repo, where those files are tracked. The
|
|
81
|
+
// build info is redirected to a temp directory so a type check never
|
|
82
|
+
// modifies the working tree.
|
|
83
|
+
const buildInfoDir = mkdtempSync(join(tmpdir(), "typecheck-packages-"));
|
|
84
|
+
|
|
85
|
+
for (const project of projects) {
|
|
86
|
+
const owner = ownerOf(project);
|
|
87
|
+
const baseline = BASELINES.get(owner) ?? 0;
|
|
88
|
+
checked++;
|
|
89
|
+
let output = "";
|
|
90
|
+
let timedOut = false;
|
|
91
|
+
const args = ["-p", join(root, project), "--noEmit", "--skipLibCheck"];
|
|
92
|
+
const projectConfig = readFileSync(join(root, project), "utf8");
|
|
93
|
+
if (/"(incremental|composite)"\s*:\s*true/.test(projectConfig)) {
|
|
94
|
+
args.push("--tsBuildInfoFile", join(buildInfoDir, `${owner}.tsbuildinfo`));
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
output = execFileSync(tsc, args, {
|
|
98
|
+
cwd: root,
|
|
99
|
+
encoding: "utf8",
|
|
100
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
101
|
+
timeout: TSC_TIMEOUT_MS,
|
|
102
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
103
|
+
});
|
|
104
|
+
} catch (error) {
|
|
105
|
+
output = `${error.stdout ?? ""}${error.stderr ?? ""}`;
|
|
106
|
+
timedOut = Boolean(error.killed) || error.signal === "SIGTERM";
|
|
107
|
+
}
|
|
108
|
+
const count = output.split("\n").filter((line) => /error TS/.test(line)).length;
|
|
109
|
+
|
|
110
|
+
if (timedOut) {
|
|
111
|
+
// A timeout is not a pass and not an error count - fail closed.
|
|
112
|
+
failures.push({
|
|
113
|
+
owner,
|
|
114
|
+
project,
|
|
115
|
+
count: -1,
|
|
116
|
+
output: `type check timed out after ${TSC_TIMEOUT_MS} ms`,
|
|
117
|
+
});
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (count > baseline) {
|
|
121
|
+
failures.push({ owner, project, count, output });
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (baseline > 0) {
|
|
125
|
+
if (count < baseline) {
|
|
126
|
+
improved.push(`${owner} (${count} errors, baseline ${baseline})`);
|
|
127
|
+
} else {
|
|
128
|
+
baselined.push(`${owner} (${count} known errors)`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// A baseline for a project that does not exist (renamed or removed) is stale.
|
|
134
|
+
for (const owner of BASELINES.keys()) {
|
|
135
|
+
const stillExists = projects.some((project) => ownerOf(project) === owner);
|
|
136
|
+
if (!stillExists) {
|
|
137
|
+
failures.push({
|
|
138
|
+
owner,
|
|
139
|
+
project: owner,
|
|
140
|
+
count: -1,
|
|
141
|
+
output: `stale baseline: no project found for "${owner}"`,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
console.log(`typecheck: ${checked} projects checked`);
|
|
147
|
+
if (baselined.length > 0) {
|
|
148
|
+
console.log(
|
|
149
|
+
`typecheck: ${baselined.length} project(s) with known pre-existing errors: ${baselined.join(", ")}`,
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
if (improved.length > 0) {
|
|
153
|
+
console.warn(
|
|
154
|
+
`typecheck: baseline can be lowered for: ${improved.join(", ")} (update BASELINES in ${relative(root, import.meta.filename)})`,
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (failures.length > 0) {
|
|
159
|
+
console.error(`typecheck: ${failures.length} project(s) with unexpected type errors:`);
|
|
160
|
+
for (const failure of failures) {
|
|
161
|
+
console.error(`--- ${failure.owner} (${failure.count < 0 ? failure.output : `${failure.count} errors`}) ---`);
|
|
162
|
+
if (failure.count >= 0) console.error(failure.output.trim());
|
|
163
|
+
}
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
console.log("typecheck: no unexpected type errors");
|