failproofai 1.0.15 → 1.0.16-beta.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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +13 -13
- package/.next/standalone/.next/prerender-manifest.json +4 -4
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +22 -21
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js +4 -3
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +8 -7
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/settings/page.js +8 -7
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__048f1wnr8pysf._.js +4 -4
- package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_0fmclqlaj83-2._.js +5 -0
- package/.next/standalone/.next/server/chunks/src_hooks_15j31lnj-km9r._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_hooks_daemon-client_ts_0il_yu1zc0291._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t76rmc_vci18._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1vofkb2oq7p7e._.js → [root-of-the-server]__0tayeyopslkf1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0f-kswpk5hx7v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +5 -5
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_components_project-list_tsx_1ke6anr0vt64h._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_0e3yg5gbcfsai.js → node_modules_html-to-image_es_index_0wgfci23_yqs_.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1-ytegsicaf2d._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1euxn1va7c5gq._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_daemon-client_ts_0k41_i7jg6ndv._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_daemon-service_ts_0ibufora3s_bw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_effective-reviewers_ts_1h4wtvo55j16x._.js +3 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +13 -13
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/{0oxlfb02aqo3e.js → 0fqjv13piwa6z.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1osrmi14e2jub.js → 0y9qczsccrmmf.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0p14j2e6dnj1x.js → 0z70k3nof30ws.js} +1 -1
- package/.next/standalone/.next/static/chunks/{05g1pu2r8o5q3.js → 167exo9u6npy3.js} +1 -1
- package/.next/standalone/.next/static/chunks/{098vx6twrn-vk.js → 1xwh61k4505md.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3d6_vjbvr0c2n.js → 24nikgpkr0qas.js} +1 -1
- package/.next/standalone/.next/static/chunks/{38lnk75xvqiug.js → 2ayu58wi805x4.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0tiuj32d-qcy3.js → 2swcvie6i54dn.js} +1 -1
- package/.next/standalone/.next/static/chunks/2xx-2wehe-kwl.js +1 -0
- package/.next/standalone/.next/static/chunks/{1i9zuw01f0ogt.js → 3r-j6pmqrq4l1.js} +2 -2
- package/.next/standalone/.next/static/chunks/{2zwsbp8xyfv__.js → 3tfcj166ki-08.js} +1 -1
- package/.next/standalone/.next/static/chunks/{12ys9uaq6i1h2.js → 3uj5quosl7j_x.js} +1 -1
- package/.next/standalone/hermes-plugin/client.py +97 -37
- package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
- package/.next/standalone/package.json +9 -9
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +66 -90
- package/dist/cli.mjs +1421 -1489
- package/dist/worker.mjs +19 -4
- package/hermes-plugin/client.py +97 -37
- package/hermes-plugin/plugin.yaml +1 -1
- package/openclaw-plugin/daemon-client.js +72 -16
- package/openclaw-plugin/hooks.js +12 -0
- package/package.json +9 -9
- package/pi-extension/index.ts +2 -0
- package/src/hooks/cloud-managed-policies.ts +22 -0
- package/src/hooks/config-status.ts +34 -21
- package/src/hooks/configure-wizard.ts +16 -3
- package/src/hooks/daemon-client.ts +59 -16
- package/src/hooks/daemon-service.ts +167 -19
- package/src/hooks/delivery-health.ts +10 -0
- package/src/hooks/fp-home.ts +8 -0
- package/src/hooks/fp-reset.ts +8 -2
- package/src/hooks/gateway-restart.ts +248 -0
- package/src/hooks/handler.ts +39 -2
- package/src/hooks/hermes-update.ts +18 -2
- package/src/hooks/hook-activity-store.ts +5 -0
- package/src/hooks/manager.ts +43 -9
- package/src/hooks/shell-quote.ts +19 -0
- package/src/hooks/update-run.ts +276 -0
- package/.next/standalone/.next/server/chunks/src_hooks_0_em82s16zfym._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05-glpesefmmi._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0ge1hz9485xpp._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0agdmptetetdt._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0mdwgjisv4fub._.js +0 -5
- package/.next/standalone/.next/static/chunks/2o8j51ujh1ox4.js +0 -1
- /package/.next/standalone/.next/static/{-AugwIGiiIYcahO4J7mdM → _rnWxsoAWV0JPMURamq78}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{-AugwIGiiIYcahO4J7mdM → _rnWxsoAWV0JPMURamq78}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{-AugwIGiiIYcahO4J7mdM → _rnWxsoAWV0JPMURamq78}/_ssgManifest.js +0 -0
package/bin/failproofai.mjs
CHANGED
|
@@ -669,7 +669,13 @@ async function runCli() {
|
|
|
669
669
|
// test on a seeded layout-2 home, not by a unit test: nothing below the CLI
|
|
670
670
|
// entry point can see this ordering.
|
|
671
671
|
const { checkLayoutForCli } = await import("../src/hooks/fp-reset");
|
|
672
|
-
|
|
672
|
+
// Setup brings the daemon to this version itself, so it is not told to
|
|
673
|
+
// run `update` first; its other modes (--status, --pause, …) still are.
|
|
674
|
+
const setupRun =
|
|
675
|
+
args[0] === "config" &&
|
|
676
|
+
!["--status", "--pause", "--resume", "--connect", "--disconnect"].some((f) => args.includes(f)) &&
|
|
677
|
+
!(args.includes("--machine-label") && !["--token", "--oss", "--agents"].some((f) => args.includes(f)));
|
|
678
|
+
const check = await checkLayoutForCli({ daemonUpdatedByCommand: setupRun });
|
|
673
679
|
// Written rather than `console.error`, which Bun paints red on a terminal.
|
|
674
680
|
if (check.lines.length > 0) process.stderr.write(`${check.lines.join("\n")}\n`);
|
|
675
681
|
if (check.fatal) await exitAfterFlush(1);
|
|
@@ -1143,13 +1149,16 @@ async function runCli() {
|
|
|
1143
1149
|
await printHelp({
|
|
1144
1150
|
name: "update",
|
|
1145
1151
|
usage: [["npm i -g failproofai@latest && failproofai update"]],
|
|
1146
|
-
options: [
|
|
1152
|
+
options: [
|
|
1153
|
+
["--no-daemon", "Migrate everything but leave the daemon as is"],
|
|
1154
|
+
["--no-restart", "Leave running Hermes and OpenClaw gateways as they are"],
|
|
1155
|
+
],
|
|
1147
1156
|
optionsCol: 20,
|
|
1148
1157
|
});
|
|
1149
1158
|
process.exit(0);
|
|
1150
1159
|
}
|
|
1151
1160
|
|
|
1152
|
-
const KNOWN = new Set(["--no-daemon"]);
|
|
1161
|
+
const KNOWN = new Set(["--no-daemon", "--no-restart"]);
|
|
1153
1162
|
const unknown = subArgs.find((a) => a.startsWith("-") && !KNOWN.has(a));
|
|
1154
1163
|
if (unknown) {
|
|
1155
1164
|
throw new CliError(
|
|
@@ -1162,107 +1171,43 @@ async function runCli() {
|
|
|
1162
1171
|
// this file, which this command is exempt from. Reading the ledger and
|
|
1163
1172
|
// inferring "the top-level check must have done it" was the first version, and
|
|
1164
1173
|
// it is the kind of indirection that reads fine and reports the wrong thing
|
|
1165
|
-
// the moment either half moves.
|
|
1166
|
-
|
|
1167
|
-
const {
|
|
1168
|
-
const
|
|
1169
|
-
const
|
|
1174
|
+
// the moment either half moves. The steps are shared with `config`, which
|
|
1175
|
+
// runs them after the first setup on a new version (src/hooks/update-run.ts).
|
|
1176
|
+
const { runUpdateSteps, markUpdated } = await import("../src/hooks/update-run");
|
|
1177
|
+
const noDaemon = subArgs.includes("--no-daemon");
|
|
1178
|
+
const run = await runUpdateSteps({
|
|
1179
|
+
layout: true,
|
|
1180
|
+
daemon: !noDaemon,
|
|
1181
|
+
// A daemon left as it is may not serve the new plugin, so --no-daemon
|
|
1182
|
+
// leaves the gateways alone too.
|
|
1183
|
+
restart: !noDaemon && !subArgs.includes("--no-restart"),
|
|
1184
|
+
noteSkippedDaemon: noDaemon,
|
|
1185
|
+
});
|
|
1170
1186
|
|
|
1171
|
-
if (
|
|
1187
|
+
if (run.futureLayout) {
|
|
1172
1188
|
await printReport("update", [
|
|
1173
1189
|
`This machine's failproofai directory was written by a NEWER version ` +
|
|
1174
|
-
`(layout ${
|
|
1190
|
+
`(layout ${run.futureLayout.found}; this build speaks ${run.futureLayout.speaks}). This CLI is the stale half:`,
|
|
1175
1191
|
"",
|
|
1176
1192
|
" npm install -g failproofai@latest",
|
|
1177
|
-
], { ok: false, meta: `layout ${
|
|
1193
|
+
], { ok: false, meta: `layout ${run.futureLayout.found}` });
|
|
1178
1194
|
await track("cli_update", { ok: false, reason: "future_layout" });
|
|
1179
1195
|
lastSubcommand = null;
|
|
1180
1196
|
await exitAfterFlush(1);
|
|
1181
1197
|
return;
|
|
1182
1198
|
}
|
|
1183
1199
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
const report = [];
|
|
1188
|
-
let migrationsRan = 0;
|
|
1189
|
-
let migrationFailed = false;
|
|
1190
|
-
if (state.kind === "stale") {
|
|
1191
|
-
const run = runMigrations(state.found);
|
|
1192
|
-
migrationsRan = run.steps.length;
|
|
1193
|
-
migrationFailed = Boolean(run.failed);
|
|
1194
|
-
for (const step of run.steps) {
|
|
1195
|
-
report.push(` ${step.ok ? "migrated" : "FAILED "} layout ${step.from} → ${step.to}`);
|
|
1196
|
-
}
|
|
1197
|
-
if (run.backedUp.length > 0) report.push("", `Saved first: ${run.backedUp.join(", ")}`);
|
|
1198
|
-
// Each failing half marks its own line (the daemon's lines arrive with
|
|
1199
|
-
// their ✕ already): the report opens on whatever ran first, often a
|
|
1200
|
-
// success, and printReport's guess would put the ✕ there.
|
|
1201
|
-
if (run.failed) {
|
|
1202
|
-
report.push(
|
|
1203
|
-
"",
|
|
1204
|
-
`✕ Step ${run.failed.from} → ${run.failed.to} did not finish: ${run.failed.error}`,
|
|
1205
|
-
` The home is still marked layout ${state.found} and will be retried.`,
|
|
1206
|
-
);
|
|
1207
|
-
}
|
|
1208
|
-
} else {
|
|
1209
|
-
report.push(`Home is at layout ${LAYOUT_VERSION}; no migration was needed.`);
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
// The daemon is refreshed even when a step failed, and deliberately: the
|
|
1213
|
-
// binary and the layout are independent halves, and leaving a version-skewed
|
|
1214
|
-
// daemon behind on top of a failed migration is strictly worse than fixing
|
|
1215
|
-
// the half that can be fixed. The exit code still reports the failure.
|
|
1216
|
-
let daemonOk = true;
|
|
1217
|
-
if (subArgs.includes("--no-daemon")) {
|
|
1218
|
-
report.push("", "Skipped the daemon (--no-daemon). Its version may not match this CLI.");
|
|
1219
|
-
} else {
|
|
1220
|
-
const svc = await import("../src/hooks/daemon-service");
|
|
1221
|
-
if (!svc.isDaemonSupportedPlatform()) {
|
|
1222
|
-
report.push("", `failproofaid does not run on ${process.platform}; nothing to update.`);
|
|
1223
|
-
} else {
|
|
1224
|
-
// `refreshDaemonToCliVersion` answers "is there a service at all" itself,
|
|
1225
|
-
// so there is no separate installed check to get out of step with it.
|
|
1226
|
-
const result = await svc.refreshDaemonToCliVersion();
|
|
1227
|
-
report.push("", ...result.lines);
|
|
1228
|
-
daemonOk = result.ok;
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
// Hermes is migrated AFTER the daemon, and gated on what the daemon that is
|
|
1233
|
-
// now running can do: the native plugin needs `policyEvaluation`, which
|
|
1234
|
-
// ≤1.0.5 daemons lack, so when the swap above could not happen (a sudo
|
|
1235
|
-
// system service with no sudo) the shell hooks stay and this fails loudly.
|
|
1236
|
-
let hermesOk = true;
|
|
1237
|
-
let hermesMigrated = 0;
|
|
1238
|
-
try {
|
|
1239
|
-
const { runHermesUpdateMigration } = await import("../src/hooks/hermes-update");
|
|
1240
|
-
const svc = await import("../src/hooks/daemon-service");
|
|
1241
|
-
const hermesResult = await runHermesUpdateMigration({
|
|
1242
|
-
daemonSupportsPolicyEvaluation: () => svc.probeDaemonPolicyEvaluation(),
|
|
1243
|
-
});
|
|
1244
|
-
if (hermesResult.lines.length > 0) {
|
|
1245
|
-
// Its lines open on a "Hermes:" heading over one row per profile; on a
|
|
1246
|
-
// failure the heading carries the ✕ and the rows say which profile.
|
|
1247
|
-
const [heading, ...rest] = hermesResult.lines;
|
|
1248
|
-
report.push("", hermesResult.ok ? heading : `✕ ${heading}`, ...rest);
|
|
1249
|
-
}
|
|
1250
|
-
hermesOk = hermesResult.ok;
|
|
1251
|
-
hermesMigrated = hermesResult.profiles.filter((p) => p.status === "migrated").length;
|
|
1252
|
-
} catch (err) {
|
|
1253
|
-
report.push("", `✕ Hermes migration failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1254
|
-
hermesOk = false;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
const updateOk = daemonOk && !migrationFailed && hermesOk;
|
|
1200
|
+
const report = run.lines;
|
|
1201
|
+
const updateOk = run.ok;
|
|
1202
|
+
if (updateOk && !noDaemon) markUpdated(version);
|
|
1258
1203
|
// No `v${version}` meta: the header already names the version.
|
|
1259
1204
|
await printReport("update", report, { ok: updateOk });
|
|
1260
1205
|
await track("cli_update", {
|
|
1261
1206
|
ok: updateOk,
|
|
1262
|
-
migrations: migrationsRan,
|
|
1263
|
-
migration_failed: migrationFailed,
|
|
1264
|
-
hermes_ok: hermesOk,
|
|
1265
|
-
hermes_migrated: hermesMigrated,
|
|
1207
|
+
migrations: run.migrationsRan,
|
|
1208
|
+
migration_failed: run.migrationFailed,
|
|
1209
|
+
hermes_ok: run.hermesOk,
|
|
1210
|
+
hermes_migrated: run.hermesMigrated,
|
|
1266
1211
|
});
|
|
1267
1212
|
lastSubcommand = null;
|
|
1268
1213
|
await exitAfterFlush(updateOk ? 0 : 1);
|
|
@@ -2074,6 +2019,8 @@ async function runCli() {
|
|
|
2074
2019
|
if (refusal) throw new CliError(refusal);
|
|
2075
2020
|
}
|
|
2076
2021
|
const { runConfigureWizard } = await import("../src/hooks/configure-wizard");
|
|
2022
|
+
const { pluggedProfiles } = await import("../src/hooks/update-run");
|
|
2023
|
+
const pluggedBefore = await pluggedProfiles().catch(() => []);
|
|
2077
2024
|
const result = await runConfigureWizard(
|
|
2078
2025
|
{},
|
|
2079
2026
|
{
|
|
@@ -2097,6 +2044,35 @@ async function runCli() {
|
|
|
2097
2044
|
labelExit = renamed.exitCode;
|
|
2098
2045
|
}
|
|
2099
2046
|
}
|
|
2047
|
+
// The first setup on a new version finishes the upgrade too: without this a
|
|
2048
|
+
// running Hermes or OpenClaw gateway kept the plugin it loaded before (or
|
|
2049
|
+
// none) until someone thought to run `update`. Setup has already brought
|
|
2050
|
+
// the daemon to this version and the entry check migrated the home.
|
|
2051
|
+
let updateExit = 0;
|
|
2052
|
+
if (result.applied) {
|
|
2053
|
+
const { runUpdateSteps, markUpdated, setupNeedsUpdateSteps, setupGatewayLine, restartNewlyPlugged } =
|
|
2054
|
+
await import("../src/hooks/update-run");
|
|
2055
|
+
const { screenKit, colorsEnabled } = await import("../src/hooks/tui");
|
|
2056
|
+
const kit = screenKit({ color: colorsEnabled(process.stdout) });
|
|
2057
|
+
if (!setupNeedsUpdateSteps(version)) {
|
|
2058
|
+
// Already updated on this version: only a profile this run plugged in
|
|
2059
|
+
// (one created since) has a gateway still running without the plugin.
|
|
2060
|
+
const gateway = setupGatewayLine(await restartNewlyPlugged(pluggedBefore).catch(() => []));
|
|
2061
|
+
if (gateway) process.stdout.write(`${gateway.ok ? kit.ok(gateway.text) : kit.caution(gateway.text)}\n`);
|
|
2062
|
+
} else {
|
|
2063
|
+
const run = await runUpdateSteps({ layout: false, daemon: false, restart: true });
|
|
2064
|
+
// One line at most, in update's own words; a Hermes failure keeps its
|
|
2065
|
+
// existing ✕ line so it is not lost.
|
|
2066
|
+
const gateway = setupGatewayLine(run.restarts);
|
|
2067
|
+
const out = [
|
|
2068
|
+
...run.lines.filter((l) => l.startsWith("✕")),
|
|
2069
|
+
...(gateway ? [gateway.ok ? kit.ok(gateway.text) : kit.caution(gateway.text)] : []),
|
|
2070
|
+
];
|
|
2071
|
+
if (out.length > 0) process.stdout.write(`${out.join("\n")}\n`);
|
|
2072
|
+
if (run.ok) markUpdated(version);
|
|
2073
|
+
else updateExit = 1;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2100
2076
|
await warnTokenOnArgv();
|
|
2101
2077
|
await track("cli_configure_invoked", {
|
|
2102
2078
|
applied: result.applied,
|
|
@@ -2115,7 +2091,7 @@ async function runCli() {
|
|
|
2115
2091
|
// regardless discarded it: a fleet script could not tell "the user pressed
|
|
2116
2092
|
// Esc" from "this machine could not install the required daemon and is
|
|
2117
2093
|
// unconfigured". Cancelling is not a failure; the other two are.
|
|
2118
|
-
await exitAfterFlush(!result.applied && result.abort && result.abort !== "cancelled" ? 1 : labelExit);
|
|
2094
|
+
await exitAfterFlush(!result.applied && result.abort && result.abort !== "cancelled" ? 1 : labelExit || updateExit);
|
|
2119
2095
|
return;
|
|
2120
2096
|
}
|
|
2121
2097
|
|