@vectorize-io/self-driving-agents 0.0.21 → 0.0.22
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/cli.js +35 -19
- package/dist/tests/cli.test.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -238,7 +238,12 @@ function parseAgentsJson(raw) {
|
|
|
238
238
|
const jsonStr = arrStart >= 0 ? clean.slice(arrStart + 1) : clean.startsWith("[") ? clean : "[]";
|
|
239
239
|
return JSON.parse(jsonStr);
|
|
240
240
|
}
|
|
241
|
-
|
|
241
|
+
// Install/upgrade the host-level hindsight-openclaw extension. Used by both
|
|
242
|
+
// the openclaw flow (followed by the openclaw config wizard) and the nemoclaw
|
|
243
|
+
// flow (which then handles config + sandbox network policy via its own setup
|
|
244
|
+
// script). Splitting this out lets nemoclaw share the upgrade path without
|
|
245
|
+
// triggering the openclaw-specific configuration wizard.
|
|
246
|
+
async function ensureOpenClawPluginInstalled() {
|
|
242
247
|
const installed = isPluginInstalled();
|
|
243
248
|
const currentVersion = installed ? getInstalledPluginVersion() : null;
|
|
244
249
|
const needsInstall = !installed;
|
|
@@ -269,28 +274,32 @@ async function ensurePlugin() {
|
|
|
269
274
|
p.cancel("Failed to install plugin. Run manually:\n openclaw plugins install @vectorize-io/hindsight-openclaw");
|
|
270
275
|
process.exit(1);
|
|
271
276
|
}
|
|
277
|
+
return;
|
|
272
278
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
p.log.info(`Hindsight plugin v${currentVersion} (already latest)`);
|
|
287
|
-
}
|
|
279
|
+
if (!currentVersion)
|
|
280
|
+
return;
|
|
281
|
+
// Plugin meets the floor — still try to pull the latest minor/patch in case
|
|
282
|
+
// a newer release shipped fixes (mirrors the claude-code flow which always
|
|
283
|
+
// runs `claude plugin update`). Best-effort: if openclaw is already on the
|
|
284
|
+
// latest, this is a no-op; if it fails, we keep the current install.
|
|
285
|
+
p.log.info(`Hindsight plugin v${currentVersion} — checking for updates...`);
|
|
286
|
+
try {
|
|
287
|
+
execSync("openclaw plugins update hindsight-openclaw", { stdio: "pipe" });
|
|
288
|
+
const updated = getInstalledPluginVersion();
|
|
289
|
+
if (updated && updated !== currentVersion) {
|
|
290
|
+
p.log.success(`Hindsight plugin updated v${currentVersion} → v${updated}`);
|
|
288
291
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
p.log.warn(`Plugin update failed (keeping v${currentVersion}): ${msg.split("\n")[0]}`);
|
|
292
|
+
else {
|
|
293
|
+
p.log.info(`Hindsight plugin v${currentVersion} (already latest)`);
|
|
292
294
|
}
|
|
293
295
|
}
|
|
296
|
+
catch (err) {
|
|
297
|
+
const msg = err?.stderr?.toString?.()?.trim() || err?.message || String(err);
|
|
298
|
+
p.log.warn(`Plugin update failed (keeping v${currentVersion}): ${msg.split("\n")[0]}`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
async function ensurePlugin() {
|
|
302
|
+
await ensureOpenClawPluginInstalled();
|
|
294
303
|
if (!isPluginConfigured()) {
|
|
295
304
|
p.log.warn("Hindsight plugin needs configuration.");
|
|
296
305
|
try {
|
|
@@ -777,6 +786,13 @@ async function main() {
|
|
|
777
786
|
({ apiUrl, bankId, apiToken } = resolveFromPlugin(agentId));
|
|
778
787
|
}
|
|
779
788
|
else if (harness === "nemoclaw") {
|
|
789
|
+
// Plugin extension lives at the host level (~/.openclaw/extensions/...)
|
|
790
|
+
// and the sandbox just gets read-only Landlock access to it. The
|
|
791
|
+
// hindsight-nemoclaw setup script otherwise passes --skip-plugin-install
|
|
792
|
+
// when Hindsight is already configured, which means existing nemoclaw
|
|
793
|
+
// users never receive plugin upgrades. Run the openclaw install/upgrade
|
|
794
|
+
// path first so they get the same upgrade behavior as the openclaw flow.
|
|
795
|
+
await ensureOpenClawPluginInstalled();
|
|
780
796
|
await ensureNemoClawPlugin(sandbox, agentId);
|
|
781
797
|
await ensureOpenClawAgentGranularity();
|
|
782
798
|
({ apiUrl, bankId, apiToken } = resolveFromPlugin(agentId));
|
package/dist/tests/cli.test.js
CHANGED
|
@@ -287,7 +287,7 @@ describe("versionGte", () => {
|
|
|
287
287
|
expect(versionGte("0.6.9", "1.0.0")).toBe(false);
|
|
288
288
|
});
|
|
289
289
|
});
|
|
290
|
-
describe("openclaw
|
|
290
|
+
describe("openclaw ensureOpenClawPluginInstalled decision tree", () => {
|
|
291
291
|
const FLOOR = "0.7.4";
|
|
292
292
|
function decide(installed, currentVersion) {
|
|
293
293
|
function gte(c, r) {
|