@strayl/agent 0.1.5 → 0.1.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/dist/agent.js +17 -1
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -13545,6 +13545,11 @@ async function runAgent(config) {
|
|
|
13545
13545
|
context.addUser(config.userMessage);
|
|
13546
13546
|
} else {
|
|
13547
13547
|
context.addSystem(systemPrompt);
|
|
13548
|
+
if (config.previousSummary) {
|
|
13549
|
+
context.addUser(`[Previous conversation summary]
|
|
13550
|
+
${config.previousSummary}`);
|
|
13551
|
+
context.addAssistant("I understand the previous conversation context. I'll continue from where we left off.");
|
|
13552
|
+
}
|
|
13548
13553
|
context.addUser(config.userMessage, config.images);
|
|
13549
13554
|
}
|
|
13550
13555
|
while (iteration < maxIterations) {
|
|
@@ -13823,6 +13828,7 @@ var { values } = parseArgs({
|
|
|
13823
13828
|
"hitl-dir": { type: "string", default: "/tmp/hitl" },
|
|
13824
13829
|
"skills-dir": { type: "string", default: "./skills" },
|
|
13825
13830
|
"previous-summary": { type: "string" },
|
|
13831
|
+
"previous-summary-file": { type: "string" },
|
|
13826
13832
|
"max-iterations": { type: "string", default: "200" },
|
|
13827
13833
|
"work-dir": { type: "string" },
|
|
13828
13834
|
"restore-checkpoint": { type: "string" }
|
|
@@ -13899,7 +13905,17 @@ try {
|
|
|
13899
13905
|
maxIterations: parseInt(values["max-iterations"]),
|
|
13900
13906
|
hitlDir: values["hitl-dir"],
|
|
13901
13907
|
skillsDir: values["skills-dir"],
|
|
13902
|
-
previousSummary: values["previous-summary"]
|
|
13908
|
+
previousSummary: values["previous-summary"] ?? await (async () => {
|
|
13909
|
+
const file = values["previous-summary-file"];
|
|
13910
|
+
if (!file) return void 0;
|
|
13911
|
+
try {
|
|
13912
|
+
return await fs12.readFile(file, "utf-8");
|
|
13913
|
+
} catch {
|
|
13914
|
+
process.stderr.write(`Failed to read previous summary file: ${file}
|
|
13915
|
+
`);
|
|
13916
|
+
return void 0;
|
|
13917
|
+
}
|
|
13918
|
+
})(),
|
|
13903
13919
|
restoreCheckpoint,
|
|
13904
13920
|
images: images.length > 0 ? images : void 0
|
|
13905
13921
|
});
|