@qwen-code/arena-agent 0.0.10-dev.6 → 0.0.10-dev.7
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/.env.example +14 -6
- package/CHANGELOG.md +160 -0
- package/README.md +11 -14
- package/dist/agent.js +3 -9
- package/dist/agent.js.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/code-cli.js +0 -0
- package/dist/code-tools.js +121 -29
- package/dist/code-tools.js.map +1 -1
- package/dist/config.d.ts +0 -2
- package/dist/config.js +0 -2
- package/dist/config.js.map +1 -1
- package/dist/file-edit.d.ts +2 -0
- package/dist/file-edit.js +9 -4
- package/dist/file-edit.js.map +1 -1
- package/dist/provider.d.ts +0 -1
- package/dist/provider.js +7 -41
- package/dist/provider.js.map +1 -1
- package/dist/replay-responses.d.ts +17 -0
- package/dist/replay-responses.js +100 -0
- package/dist/replay-responses.js.map +1 -0
- package/dist/routify-web-fetch.js +18 -4
- package/dist/routify-web-fetch.js.map +1 -1
- package/dist/tools.js +49 -1
- package/dist/tools.js.map +1 -1
- package/dist/tui.js +1 -1
- package/dist/tui.js.map +1 -1
- package/dist/web-fetch-output.d.ts +9 -0
- package/dist/web-fetch-output.js +38 -0
- package/dist/web-fetch-output.js.map +1 -0
- package/docs/BINARY_DISTRIBUTION.md +25 -16
- package/docs/MODES_AND_RELEASES.md +28 -5
- package/package.json +5 -1
- package/scripts/README.md +62 -0
- package/scripts/check-changelog.mjs +66 -0
- package/dist/web/app.d.ts +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
|
|
7
|
+
export function checkChangelog(directory = root) {
|
|
8
|
+
const { version } = JSON.parse(
|
|
9
|
+
readFileSync(path.join(directory, "package.json"), "utf8"),
|
|
10
|
+
);
|
|
11
|
+
const fail = (message) => {
|
|
12
|
+
throw new Error(`CHANGELOG.md: ${message}. Update the changelog before releasing ${version}.`);
|
|
13
|
+
};
|
|
14
|
+
let changelog;
|
|
15
|
+
try {
|
|
16
|
+
changelog = readFileSync(path.join(directory, "CHANGELOG.md"), "utf8");
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (error.code === "ENOENT") fail("file is missing");
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
// Examples and comments are not release notes.
|
|
22
|
+
const content = changelog
|
|
23
|
+
.replace(/<!--[^]*?-->/g, "")
|
|
24
|
+
.replace(/^(`{3,}|~{3,})[^\n]*\n[^]*?^\1[^\S\r\n]*$/gm, "");
|
|
25
|
+
const sections = [...content.matchAll(/^##[ \t]+(.+?)[ \t]*\r?$/gm)];
|
|
26
|
+
if (sections[0]?.[1] !== "[Unreleased]") {
|
|
27
|
+
fail("the first section must be ## [Unreleased]");
|
|
28
|
+
}
|
|
29
|
+
if (sections.filter((section) => section[1] === "[Unreleased]").length !== 1) {
|
|
30
|
+
fail("Unreleased must appear exactly once");
|
|
31
|
+
}
|
|
32
|
+
const currentSections = sections.filter((section) =>
|
|
33
|
+
section[1].startsWith(`[${version}]`),
|
|
34
|
+
);
|
|
35
|
+
if (currentSections.length !== 1 || currentSections[0] !== sections[1]) {
|
|
36
|
+
fail(`the newest release section must be a single ## [${version}] - YYYY-MM-DD`);
|
|
37
|
+
}
|
|
38
|
+
const current = currentSections[0];
|
|
39
|
+
const date = current[1].slice(`[${version}] - `.length);
|
|
40
|
+
if (
|
|
41
|
+
current[1] !== `[${version}] - ${date}` ||
|
|
42
|
+
!/^\d{4}-\d{2}-\d{2}$/.test(date) ||
|
|
43
|
+
!Number.isFinite(Date.parse(`${date}T00:00:00Z`)) ||
|
|
44
|
+
new Date(`${date}T00:00:00Z`).toISOString().slice(0, 10) !== date
|
|
45
|
+
) {
|
|
46
|
+
fail(`release ${version} needs a valid date in YYYY-MM-DD format`);
|
|
47
|
+
}
|
|
48
|
+
const body = content.slice(current.index + current[0].length, sections[2]?.index);
|
|
49
|
+
const entries = [...body.matchAll(/^[-*][ \t]+(.+?)\r?$/gm)];
|
|
50
|
+
if (!entries.some((entry) =>
|
|
51
|
+
/[\p{L}\p{N}]/u.test(entry[1]) &&
|
|
52
|
+
!/^(?:TODO|TBD|待补充|待填写|暂无)(?:[\s::.!!。…-]|$)/i.test(entry[1]),
|
|
53
|
+
)) {
|
|
54
|
+
fail(`release ${version} needs at least one non-placeholder change entry`);
|
|
55
|
+
}
|
|
56
|
+
return version;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
60
|
+
try {
|
|
61
|
+
console.log(`Changelog ready for ${checkChangelog()}`);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error(error.message);
|
|
64
|
+
process.exitCode = 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
package/dist/web/app.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|