@lingjingai/scriptctl 0.61.1 → 0.61.3
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/changes/0.61.1.md +4 -4
- package/changes/0.61.2.md +10 -0
- package/changes/0.61.3.md +4 -0
- package/dist/bin.js +8 -1
- package/dist/bin.js.map +2 -2
- package/dist/review-agent.js +8 -8
- package/dist/review-agent.js.map +2 -2
- package/package.json +1 -1
- package/skills/scriptctl/SKILL.md +4 -4
package/dist/review-agent.js
CHANGED
|
@@ -1002,6 +1002,7 @@ function newId(prefix, taken) {
|
|
|
1002
1002
|
return id;
|
|
1003
1003
|
}
|
|
1004
1004
|
function save(doc) {
|
|
1005
|
+
Object.assign(doc, parse(doc.raw, doc.path));
|
|
1005
1006
|
if (!doc.path) {
|
|
1006
1007
|
step("save", "skipped: document is not bound to a file");
|
|
1007
1008
|
return;
|
|
@@ -1014,7 +1015,6 @@ function commit(doc, path4 = doc.path) {
|
|
|
1014
1015
|
const tmp = `${path4}.tmp-${process.pid}`;
|
|
1015
1016
|
fs.writeFileSync(tmp, JSON.stringify(doc.raw, null, 2) + "\n");
|
|
1016
1017
|
fs.renameSync(tmp, path4);
|
|
1017
|
-
doc.path = path4;
|
|
1018
1018
|
step("commit", `${fs.statSync(path4).size} bytes -> ${path4} (tmp + atomic rename)`);
|
|
1019
1019
|
}
|
|
1020
1020
|
|
|
@@ -2903,17 +2903,17 @@ async function reviewScript(opts) {
|
|
|
2903
2903
|
opts.onEvent?.(event);
|
|
2904
2904
|
};
|
|
2905
2905
|
const units = [];
|
|
2906
|
-
|
|
2907
|
-
const unit = await reviewUnit(doc, episode, videos[episode - 1], config);
|
|
2906
|
+
const checkpoint = (unit, type) => {
|
|
2908
2907
|
units.push(unit);
|
|
2909
|
-
|
|
2908
|
+
commit(doc, opts.scriptPath);
|
|
2909
|
+
emit({ type, ...unit });
|
|
2910
|
+
};
|
|
2911
|
+
await pool(selected, opts.concurrency ?? 5, async (episode) => {
|
|
2912
|
+
checkpoint(await reviewUnit(doc, episode, videos[episode - 1], config), "episode");
|
|
2910
2913
|
});
|
|
2911
2914
|
if (opts.converge !== false) {
|
|
2912
|
-
|
|
2913
|
-
units.push(unit);
|
|
2914
|
-
emit({ type: "global", ...unit });
|
|
2915
|
+
checkpoint(await reviewUnit(doc, 0, void 0, config), "global");
|
|
2915
2916
|
}
|
|
2916
|
-
commit(doc, opts.scriptPath);
|
|
2917
2917
|
const usage_total = units.flatMap((unit) => unit.usage);
|
|
2918
2918
|
emit({
|
|
2919
2919
|
type: "done",
|