opencode-agent-harness 0.0.0-stage → 0.2.0
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/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/README.md +590 -2
- package/bin/agent-harness.js +3059 -0
- package/contrib/global-plugins/README.md +49 -0
- package/contrib/global-plugins/harness-freshness.ts +355 -0
- package/package.json +48 -4
- package/templates/.agents/AGENTS.md +204 -0
- package/templates/.agents/features/INDEX.md +10 -0
- package/templates/.agents/handoffs/README.md +87 -0
- package/templates/.agents/memory/dev-loop.md +59 -0
- package/templates/.agents/memory/domain-map.md +29 -0
- package/templates/.agents/memory/environments.md +35 -0
- package/templates/.agents/memory/flow-map.md +23 -0
- package/templates/.agents/memory/history.md +7 -0
- package/templates/.agents/memory/locations.md +14 -0
- package/templates/.agents/memory/model-routing.md +261 -0
- package/templates/.agents/memory/orchestration.md +183 -0
- package/templates/.agents/memory/owned-files.md +19 -0
- package/templates/.agents/memory/product-principles.md +37 -0
- package/templates/.agents/memory/quality-parameters.md +37 -0
- package/templates/.agents/memory/stack-versions.md +35 -0
- package/templates/.agents/memory/test-design-parameters.md +36 -0
- package/templates/.agents/nightly.json +17 -0
- package/templates/.agents/qa-plans/README.md +70 -0
- package/templates/.agents/qa-runs/README.md +21 -0
- package/templates/.agents/reviews/README.md +47 -0
- package/templates/.agents/rules/00-operating.md +199 -0
- package/templates/.agents/skills/data-engineer/SKILL.md +31 -0
- package/templates/.agents/skills/devops-engineer/SKILL.md +50 -0
- package/templates/.agents/skills/diagnostics-expert/SKILL.md +44 -0
- package/templates/.agents/skills/docs/SKILL.md +140 -0
- package/templates/.agents/skills/features/SKILL.md +187 -0
- package/templates/.agents/skills/frontend-engineer/SKILL.md +81 -0
- package/templates/.agents/skills/handoff/SKILL.md +85 -0
- package/templates/.agents/skills/mobile-engineer/SKILL.md +101 -0
- package/templates/.agents/skills/planner/SKILL.md +112 -0
- package/templates/.agents/skills/product-manager/SKILL.md +115 -0
- package/templates/.agents/skills/qa-architect/SKILL.md +224 -0
- package/templates/.agents/skills/qa-runner/SKILL.md +64 -0
- package/templates/.agents/skills/security-engineer/SKILL.md +53 -0
- package/templates/.agents/skills/system-architect/SKILL.md +42 -0
- package/templates/.agents/skills/ui-designer/SKILL.md +71 -0
- package/templates/.github/workflows/ci.yml +148 -0
- package/templates/.github/workflows/deploy-uat.yml +95 -0
- package/templates/.github/workflows/nightly.yml +83 -0
- package/templates/.github/workflows/uat-health.yml +41 -0
- package/templates/.husky/pre-push +23 -0
- package/templates/.ignore +28 -0
- package/templates/.opencode/agents/data-engineer.md +37 -0
- package/templates/.opencode/agents/devops-engineer.md +37 -0
- package/templates/.opencode/agents/diagnostics-expert.md +37 -0
- package/templates/.opencode/agents/docs.md +37 -0
- package/templates/.opencode/agents/features.md +21 -0
- package/templates/.opencode/agents/frontend-engineer.md +37 -0
- package/templates/.opencode/agents/handoff.md +21 -0
- package/templates/.opencode/agents/mobile-engineer.md +37 -0
- package/templates/.opencode/agents/planner.md +34 -0
- package/templates/.opencode/agents/product-manager.md +29 -0
- package/templates/.opencode/agents/qa-architect.md +27 -0
- package/templates/.opencode/agents/qa-runner.md +17 -0
- package/templates/.opencode/agents/security-engineer.md +37 -0
- package/templates/.opencode/agents/system-architect.md +37 -0
- package/templates/.opencode/agents/ui-designer.md +37 -0
- package/templates/.opencode/commands/board.md +15 -0
- package/templates/.opencode/commands/checkpoint.md +25 -0
- package/templates/.opencode/commands/feature.md +56 -0
- package/templates/.opencode/commands/finish.md +36 -0
- package/templates/.opencode/commands/next.md +49 -0
- package/templates/.opencode/commands/report.md +55 -0
- package/templates/.opencode/commands/resume.md +39 -0
- package/templates/.opencode/commands/switch-model.md +34 -0
- package/templates/.opencode/commands/tidy.md +49 -0
- package/templates/.opencode/plugins/backlog-notify.ts +57 -0
- package/templates/.opencode/plugins/backlog.ts +272 -0
- package/templates/.opencode/plugins/checkpoint.ts +160 -0
- package/templates/.opencode/plugins/context-guard.ts +1164 -0
- package/templates/.opencode/plugins/diff.ts +85 -0
- package/templates/.opencode/plugins/gates.ts +71 -0
- package/templates/.opencode/plugins/job-notify.ts +241 -0
- package/templates/.opencode/plugins/orient.ts +67 -0
- package/templates/.opencode/plugins/session.ts +89 -0
- package/templates/.opencode/plugins/wait.ts +101 -0
- package/templates/.opencode/plugins/where.ts +70 -0
- package/templates/.opencode/skills/bounded-explore/SKILL.md +38 -0
- package/templates/.opencode/skills/dev-loop/SKILL.md +87 -0
- package/templates/.vercelignore +16 -0
- package/templates/AGENTS.md +27 -0
- package/templates/BACKLOG.md +95 -0
- package/templates/docs/ci-cd-pipeline.md +81 -0
- package/templates/docs/gates.md +128 -0
- package/templates/docs/mcp-integrations.md +97 -0
- package/templates/docs/mobile-testing.md +555 -0
- package/templates/docs/nightly-testing.md +106 -0
- package/templates/docs/wsl-optimizations.md +290 -0
- package/templates/opencode.json +188 -0
- package/templates/scripts/agent-report.js +541 -0
- package/templates/scripts/agent-search.sh +117 -0
- package/templates/scripts/backlog.js +1864 -0
- package/templates/scripts/board-service.sh +207 -0
- package/templates/scripts/checkpoint.js +290 -0
- package/templates/scripts/finalize.js +277 -0
- package/templates/scripts/nightly.js +913 -0
- package/templates/scripts/orient.js +514 -0
- package/templates/scripts/qa/board-client.js +260 -0
- package/templates/scripts/qa/board-lib.js +96 -0
- package/templates/scripts/qa/board-sync.js +469 -0
- package/templates/scripts/qa/capacity-lib.js +916 -0
- package/templates/scripts/qa/check-backlog.js +427 -0
- package/templates/scripts/qa/check-capacity.js +85 -0
- package/templates/scripts/qa/check-ci-policy.js +164 -0
- package/templates/scripts/qa/check-concurrency.js +344 -0
- package/templates/scripts/qa/check-dispatch-config.js +296 -0
- package/templates/scripts/qa/check-docs.js +284 -0
- package/templates/scripts/qa/check-integrate.js +98 -0
- package/templates/scripts/qa/check-linger.js +160 -0
- package/templates/scripts/qa/check-prefix-stability.js +183 -0
- package/templates/scripts/qa/check-product.js +177 -0
- package/templates/scripts/qa/check-qa-plan.js +378 -0
- package/templates/scripts/qa/check-qa-scripts.js +85 -0
- package/templates/scripts/qa/check-quality.js +249 -0
- package/templates/scripts/qa/check-test-wiring.js +253 -0
- package/templates/scripts/qa/ci-triage.js +346 -0
- package/templates/scripts/qa/ci-usage-lib.js +185 -0
- package/templates/scripts/qa/ci-wait-lib.js +294 -0
- package/templates/scripts/qa/command-classifier.js +552 -0
- package/templates/scripts/qa/context-guard-core.js +1618 -0
- package/templates/scripts/qa/diff.js +174 -0
- package/templates/scripts/qa/feature-scaffold.js +224 -0
- package/templates/scripts/qa/fixtures/backlog.md +104 -0
- package/templates/scripts/qa/governance.js +174 -0
- package/templates/scripts/qa/hash-file.js +32 -0
- package/templates/scripts/qa/lease-lib.js +263 -0
- package/templates/scripts/qa/merge-backlog.js +324 -0
- package/templates/scripts/qa/mobile-e2e/analyze-timings.js +300 -0
- package/templates/scripts/qa/mobile-e2e/apk-cache.js +420 -0
- package/templates/scripts/qa/mobile-e2e/backend-build-cache.js +203 -0
- package/templates/scripts/qa/mobile-e2e/boot-emulator.sh +432 -0
- package/templates/scripts/qa/mobile-e2e/build-apk.sh +210 -0
- package/templates/scripts/qa/mobile-e2e/check-flows.js +453 -0
- package/templates/scripts/qa/mobile-e2e/config.yaml +18 -0
- package/templates/scripts/qa/mobile-e2e/device-down.sh +88 -0
- package/templates/scripts/qa/mobile-e2e/device-up.sh +258 -0
- package/templates/scripts/qa/mobile-e2e/ios-simulator-down.sh +72 -0
- package/templates/scripts/qa/mobile-e2e/ios-simulator-up.sh +153 -0
- package/templates/scripts/qa/mobile-e2e/job-events.js +181 -0
- package/templates/scripts/qa/mobile-e2e/prewarm.sh +56 -0
- package/templates/scripts/qa/mobile-e2e/run-detached.sh +222 -0
- package/templates/scripts/qa/mobile-e2e/run-maestro.js +1543 -0
- package/templates/scripts/qa/mobile-e2e/ui-dump.js +327 -0
- package/templates/scripts/qa/models.allowlist.txt +32 -0
- package/templates/scripts/qa/provider-stats.js +878 -0
- package/templates/scripts/qa/run-clean.js +83 -0
- package/templates/scripts/qa/run-gates.js +212 -0
- package/templates/scripts/qa/run-loop.js +220 -0
- package/templates/scripts/qa/session-recon.js +512 -0
- package/templates/scripts/qa/store-lib.js +324 -0
- package/templates/scripts/qa/tool-lib.js +134 -0
- package/templates/scripts/qa/where.js +214 -0
- package/templates/scripts/qa/wslconfig-merge.js +157 -0
- package/templates/scripts/serve.js +1328 -0
- package/templates/scripts/setup-nightly.sh +185 -0
- package/templates/scripts/setup-tmpfs.sh +374 -0
- package/templates/scripts/ship.js +586 -0
- package/templates/scripts/switch-reasoning-model.ps1 +101 -0
- package/templates/scripts/switch-reasoning-model.sh +104 -0
- package/templates/scripts/wait-for.js +342 -0
- package/templates/scripts/wsl-gpu.sh +180 -0
- package/templates/scripts/wsl-tune.sh +261 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/*
|
|
4
|
+
* wslconfig-merge — set/overwrite keys in a `[section]` INI file (a Windows
|
|
5
|
+
* `.wslconfig`) WITHOUT clobbering the user's other settings. `scripts/wsl-tune.sh`
|
|
6
|
+
* uses it to apply the recommended `[wsl2]`/`[experimental]` tuning idempotently.
|
|
7
|
+
*
|
|
8
|
+
* Why a merged file, not a managed block: `.wslconfig` is INI, so a second
|
|
9
|
+
* `[wsl2]` section would be invalid. This updates keys in place, inserts a
|
|
10
|
+
* missing key at the end of its section, and appends a whole section only when
|
|
11
|
+
* it is absent — comments, blank lines, ordering, and unknown keys survive.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* node scripts/qa/wslconfig-merge.js --file <path> --set wsl2.processors=8 \
|
|
15
|
+
* --set wsl2.swap=4GB [--set experimental.autoMemoryReclaim=gradual] \
|
|
16
|
+
* [--write] [--backup] [--dry-run]
|
|
17
|
+
*
|
|
18
|
+
* Without --write it prints the merged content to stdout (nothing is changed).
|
|
19
|
+
* Exit 1 on an invalid key / unreadable file.
|
|
20
|
+
*/
|
|
21
|
+
const fs = require("fs");
|
|
22
|
+
|
|
23
|
+
const KEY_RE = /^[A-Za-z0-9_.-]+$/;
|
|
24
|
+
|
|
25
|
+
function validate(section, key) {
|
|
26
|
+
if (!KEY_RE.test(section) || !KEY_RE.test(key)) {
|
|
27
|
+
throw new Error(`invalid section/key: [${section}] ${key}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function detectEol(text) {
|
|
32
|
+
return /\r\n/.test(text) ? "\r\n" : "\n";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Pure merge: returns the new content. `sets` is [{section,key,value}]. */
|
|
36
|
+
function mergeConfig(text, sets) {
|
|
37
|
+
const eol = detectEol(text);
|
|
38
|
+
// Normalize to \n for processing, restore at the end.
|
|
39
|
+
const lines = String(text == null ? "" : text).replace(/\r\n/g, "\n").split("\n");
|
|
40
|
+
const pending = new Map(); // section(lower) -> [{key,value}]
|
|
41
|
+
for (const s of sets) {
|
|
42
|
+
validate(s.section, s.key);
|
|
43
|
+
const sec = s.section.toLowerCase();
|
|
44
|
+
if (!pending.has(sec)) pending.set(sec, []);
|
|
45
|
+
// Last write wins within a section.
|
|
46
|
+
const list = pending.get(sec);
|
|
47
|
+
const idx = list.findIndex((x) => x.key.toLowerCase() === s.key.toLowerCase());
|
|
48
|
+
if (idx === -1) list.push({ key: s.key, value: s.value });
|
|
49
|
+
else list[idx] = { key: s.key, value: s.value };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const out = [];
|
|
53
|
+
let current = null;
|
|
54
|
+
const flush = () => {
|
|
55
|
+
if (current && pending.has(current)) {
|
|
56
|
+
for (const { key, value } of pending.get(current)) out.push(`${key}=${value}`);
|
|
57
|
+
pending.delete(current);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
for (const line of lines) {
|
|
61
|
+
const header = line.match(/^\s*\[([^\]]+)\]\s*$/);
|
|
62
|
+
if (header) {
|
|
63
|
+
flush();
|
|
64
|
+
current = header[1].trim().toLowerCase();
|
|
65
|
+
out.push(line);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const kv = line.match(/^([ \t]*)([A-Za-z0-9_.-]+)([ \t]*)=([ \t]*)(.*)$/);
|
|
69
|
+
if (kv && current && pending.has(current)) {
|
|
70
|
+
const list = pending.get(current);
|
|
71
|
+
const idx = list.findIndex((x) => x.key.toLowerCase() === kv[2].toLowerCase());
|
|
72
|
+
if (idx !== -1) {
|
|
73
|
+
out.push(`${kv[1]}${list[idx].key}=${list[idx].value}`);
|
|
74
|
+
list.splice(idx, 1);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
out.push(line);
|
|
79
|
+
}
|
|
80
|
+
flush();
|
|
81
|
+
for (const [section, list] of pending) {
|
|
82
|
+
if (!list.length) continue;
|
|
83
|
+
out.push("", `[${section}]`, ...list.map((x) => `${x.key}=${x.value}`));
|
|
84
|
+
}
|
|
85
|
+
// Collapse an accidental leading blank when the file started empty.
|
|
86
|
+
let result = out.join("\n");
|
|
87
|
+
if (!result.endsWith("\n")) result += "\n";
|
|
88
|
+
return result.replace(/\n/g, eol);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function parseArgs(argv) {
|
|
92
|
+
const out = { sets: [] };
|
|
93
|
+
for (let i = 0; i < argv.length; i++) {
|
|
94
|
+
const a = argv[i];
|
|
95
|
+
if (a === "--file") out.file = argv[++i];
|
|
96
|
+
else if (a === "--set") out.sets.push(argv[++i]);
|
|
97
|
+
else if (a === "--write") out.write = true;
|
|
98
|
+
else if (a === "--backup") out.backup = true;
|
|
99
|
+
else if (a === "--dry-run") out.dryRun = true;
|
|
100
|
+
else if (a.startsWith("--set=")) out.sets.push(a.slice(6));
|
|
101
|
+
else if (a.startsWith("--file=")) out.file = a.slice(7);
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function parseSet(spec) {
|
|
107
|
+
const m = String(spec).match(/^([A-Za-z0-9_.-]+)\.([A-Za-z0-9_.-]+)=(.*)$/);
|
|
108
|
+
if (!m) throw new Error(`--set must be <section>.<key>=<value>, got "${spec}"`);
|
|
109
|
+
return { section: m[1], key: m[2], value: m[3] };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function run(argv) {
|
|
113
|
+
const args = parseArgs(argv);
|
|
114
|
+
if (!args.file) {
|
|
115
|
+
console.error("usage: node scripts/qa/wslconfig-merge.js --file <path> --set section.key=value [--set ...] [--write] [--backup] [--dry-run]");
|
|
116
|
+
return 2;
|
|
117
|
+
}
|
|
118
|
+
let sets;
|
|
119
|
+
try {
|
|
120
|
+
sets = args.sets.map(parseSet);
|
|
121
|
+
} catch (e) {
|
|
122
|
+
console.error("wslconfig-merge: " + e.message);
|
|
123
|
+
return 1;
|
|
124
|
+
}
|
|
125
|
+
if (!sets.length) {
|
|
126
|
+
console.error("wslconfig-merge: at least one --set is required");
|
|
127
|
+
return 1;
|
|
128
|
+
}
|
|
129
|
+
let current = "";
|
|
130
|
+
try {
|
|
131
|
+
current = fs.readFileSync(args.file, "utf8");
|
|
132
|
+
} catch (_) {
|
|
133
|
+
current = ""; // create the file
|
|
134
|
+
}
|
|
135
|
+
const merged = mergeConfig(current, sets);
|
|
136
|
+
if (args.dryRun || !args.write) {
|
|
137
|
+
process.stdout.write(merged);
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
if (merged === current) {
|
|
141
|
+
console.log(`wslconfig-merge: ${args.file} already up to date`);
|
|
142
|
+
return 0;
|
|
143
|
+
}
|
|
144
|
+
if (args.backup && current) {
|
|
145
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
146
|
+
fs.writeFileSync(`${args.file}.bak-${stamp}`, current, "utf8");
|
|
147
|
+
}
|
|
148
|
+
fs.writeFileSync(args.file, merged, "utf8");
|
|
149
|
+
console.log(`wslconfig-merge: updated ${args.file}`);
|
|
150
|
+
return 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (require.main === module) {
|
|
154
|
+
process.exitCode = run(process.argv.slice(2));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
module.exports = { mergeConfig, parseSet, parseArgs, detectEol };
|