@senpi-ai/runtime 3.0.189 → 3.0.202
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/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +37 -17
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/cli/senpi-commands.d.ts.map +1 -1
- package/dist/cli/senpi-commands.js +62 -30
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/cli/update-command.d.ts +20 -8
- package/dist/cli/update-command.d.ts.map +1 -1
- package/dist/cli/update-command.js +52 -37
- package/dist/cli/update-command.js.map +1 -1
- package/dist/deploy/orchestrator.js +3 -3
- package/dist/deploy/orchestrator.js.map +1 -1
- package/dist/deploy/package.d.ts +17 -0
- package/dist/deploy/package.d.ts.map +1 -1
- package/dist/deploy/package.js +19 -0
- package/dist/deploy/package.js.map +1 -1
- package/dist/deploy/proof-gate.d.ts.map +1 -1
- package/dist/deploy/proof-gate.js +12 -3
- package/dist/deploy/proof-gate.js.map +1 -1
- package/dist/deploy/recheck-commands.d.ts +2 -0
- package/dist/deploy/recheck-commands.d.ts.map +1 -1
- package/dist/deploy/recheck-commands.js +4 -0
- package/dist/deploy/recheck-commands.js.map +1 -1
- package/dist/deploy/register.js +2 -2
- package/dist/deploy/register.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/runtime/effective-config.d.ts.map +1 -1
- package/dist/runtime/effective-config.js +12 -2
- package/dist/runtime/effective-config.js.map +1 -1
- package/dist/runtime/load-runtime-config.d.ts +20 -0
- package/dist/runtime/load-runtime-config.d.ts.map +1 -1
- package/dist/runtime/load-runtime-config.js +36 -8
- package/dist/runtime/load-runtime-config.js.map +1 -1
- package/dist/runtime/map-strategies.d.ts.map +1 -1
- package/dist/runtime/map-strategies.js +7 -4
- package/dist/runtime/map-strategies.js.map +1 -1
- package/dist/runtime/recipe-file.d.ts +73 -0
- package/dist/runtime/recipe-file.d.ts.map +1 -0
- package/dist/runtime/recipe-file.js +194 -0
- package/dist/runtime/recipe-file.js.map +1 -0
- package/dist/runtime/runtime-descriptor.d.ts +23 -0
- package/dist/runtime/runtime-descriptor.d.ts.map +1 -1
- package/dist/runtime/runtime-descriptor.js +40 -0
- package/dist/runtime/runtime-descriptor.js.map +1 -1
- package/dist/runtime/update-apply-deps.d.ts +30 -11
- package/dist/runtime/update-apply-deps.d.ts.map +1 -1
- package/dist/runtime/update-apply-deps.js +93 -27
- package/dist/runtime/update-apply-deps.js.map +1 -1
- package/dist/runtime/update-handler.d.ts +28 -9
- package/dist/runtime/update-handler.d.ts.map +1 -1
- package/dist/runtime/update-handler.js +186 -19
- package/dist/runtime/update-handler.js.map +1 -1
- package/dist/runtime/update-register.d.ts +101 -2
- package/dist/runtime/update-register.d.ts.map +1 -1
- package/dist/runtime/update-register.js +269 -44
- package/dist/runtime/update-register.js.map +1 -1
- package/dist/scanners/external/scaffold/preflight.py +492 -12
- package/dist/validate/codes.d.ts +2 -0
- package/dist/validate/codes.d.ts.map +1 -1
- package/dist/validate/codes.js +6 -0
- package/dist/validate/codes.js.map +1 -1
- package/dist/validate/live-stage.d.ts +12 -0
- package/dist/validate/live-stage.d.ts.map +1 -1
- package/dist/validate/live-stage.js +16 -0
- package/dist/validate/live-stage.js.map +1 -1
- package/dist/validate/package-gates-stage.d.ts +13 -1
- package/dist/validate/package-gates-stage.d.ts.map +1 -1
- package/dist/validate/package-gates-stage.js +3 -8
- package/dist/validate/package-gates-stage.js.map +1 -1
- package/dist/validate/proof.d.ts.map +1 -1
- package/dist/validate/proof.js +20 -5
- package/dist/validate/proof.js.map +1 -1
- package/dist/validate/target.d.ts +75 -1
- package/dist/validate/target.d.ts.map +1 -1
- package/dist/validate/target.js +94 -28
- package/dist/validate/target.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -13,8 +13,12 @@
|
|
|
13
13
|
* The module owns no logic beyond adapting a gateway context into the handler's dependencies, so
|
|
14
14
|
* everything worth testing lives in `update-handler.ts` and tests never drive a gateway.
|
|
15
15
|
*/
|
|
16
|
+
import { isAbsolute } from "node:path";
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
import { NODE_RECIPE_FILE_IO, readRecipeAtPath } from "./recipe-file.js";
|
|
16
19
|
import { runUpdateApply, runUpdateDryRun, } from "./update-handler.js";
|
|
17
20
|
import { renderUpdateReport } from "./update-report.js";
|
|
21
|
+
import { VERSION } from "../version.js";
|
|
18
22
|
/**
|
|
19
23
|
* Render refusals for a human while keeping them machine-readable.
|
|
20
24
|
*
|
|
@@ -60,53 +64,278 @@ function renderFailure(runtimeId, findings) {
|
|
|
60
64
|
.join("\n\n");
|
|
61
65
|
return `${head}\n\n${body}`;
|
|
62
66
|
}
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Every key `senpi.update` reads, and the one message that names them.
|
|
69
|
+
*
|
|
70
|
+
* A raw gateway caller sends JSON, so a refusal phrased in CLI flags (`--path`) sent it guessing
|
|
71
|
+
* synonyms (`recipeDir`, `runtimeId`, `recipe`) one call at a time. Unknown keys follow one rule
|
|
72
|
+
* per mode, with no value exceptions:
|
|
73
|
+
*
|
|
74
|
+
* - An **apply** (`dryRun: false`) with any unknown key is refused as `INVALID_REQUEST` and nothing
|
|
75
|
+
* is applied. Dropping a key from a call that changes a live runtime would run a different
|
|
76
|
+
* change than the caller sent (`code_only` dropped is a full update; `runtime_id` dropped
|
|
77
|
+
* auto-resolves to whatever runtime is installed). The CLI sends only accepted keys.
|
|
78
|
+
* - A **plan** with unknown keys goes ahead, since a plan changes nothing, and names them after the
|
|
79
|
+
* report with the params list. A {@link nearMissOf near-miss} refuses a plan too: the plan would
|
|
80
|
+
* describe another call than the one meant (the wrong runtime, a full update, no apply).
|
|
81
|
+
*
|
|
82
|
+
* A `null` for an accepted key counts as absent, and so does `""` for a selector or path (see
|
|
83
|
+
* {@link isAbsent}). A near-miss sent as `null` is absent too, since the key it means would be. An
|
|
84
|
+
* unknown key that is not a near-miss still counts when `null`: nothing says what null means to
|
|
85
|
+
* it. A known key of the wrong type (`dryRun: "false"`, `id: 5`) is refused.
|
|
86
|
+
*
|
|
87
|
+
* Every INVALID_REQUEST leads with {@link PARAMS_CODE}, or {@link PARAM_UNSUPPORTED_CODE} for an
|
|
88
|
+
* apply refused only for keys no accepted key resembles, so the CLI reads it as a refusal.
|
|
89
|
+
*/
|
|
90
|
+
const PARAMS = z.object({
|
|
91
|
+
runtimeYamlPath: z.string(),
|
|
92
|
+
runtimeYamlContent: z.string(),
|
|
93
|
+
runtimeYamlDir: z.string(),
|
|
94
|
+
id: z.string(),
|
|
95
|
+
address: z.string(),
|
|
96
|
+
dryRun: z.boolean(),
|
|
97
|
+
codeOnly: z.boolean(),
|
|
98
|
+
}).partial();
|
|
99
|
+
export const ACCEPTED_PARAMS = Object.keys(PARAMS.shape);
|
|
100
|
+
/**
|
|
101
|
+
* Whether a value for an accepted key means "not sent". `null` always does. `""` does for a
|
|
102
|
+
* selector or path: every CLI forwards `--id "$ID"` verbatim, so a script with the variable unset
|
|
103
|
+
* sends `id: ""`, and older gateways read that as absent and auto-resolved the single runtime. Not
|
|
104
|
+
* for the recipe content (empty content is a recipe, and the planner says what is wrong with it),
|
|
105
|
+
* nor for the booleans, where `dryRun: ""` is a type error rather than a silent plan.
|
|
106
|
+
*/
|
|
107
|
+
const EMPTY_IS_ABSENT = new Set(["runtimeYamlPath", "runtimeYamlDir", "id", "address"]);
|
|
108
|
+
function isAbsent(key, v) {
|
|
109
|
+
return v === null || (v === "" && EMPTY_IS_ABSENT.has(key));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Case and separators stripped, so `code_only`, `Dry-Run` and `ID` meet their accepted spelling.
|
|
113
|
+
*
|
|
114
|
+
* Invariant: no two {@link ACCEPTED_PARAMS} may normalize to the same key (see {@link Params}).
|
|
115
|
+
*/
|
|
116
|
+
export function normalizeKey(k) {
|
|
117
|
+
return k.toLowerCase().replace(/[-_\s.]/g, "");
|
|
65
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* The synonyms raw callers have guessed, by {@link normalizeKey normalized} spelling, and the
|
|
121
|
+
* accepted key or keys each one may mean. `apply` means `dryRun`, inverted.
|
|
122
|
+
*
|
|
123
|
+
* A synonym that could mean two keys lists both, and the hint names both: `runtime` may carry a
|
|
124
|
+
* recipe or an id, `recipe` a path or the YAML text, `strategyId` a runtime or its wallet. Naming
|
|
125
|
+
* one would steer half of those callers to the wrong key.
|
|
126
|
+
*/
|
|
127
|
+
export const PARAM_SYNONYMS = new Map([
|
|
128
|
+
["runtimeid", ["id"]],
|
|
129
|
+
["runtimename", ["id"]],
|
|
130
|
+
["runtime", ["id", "runtimeYamlContent"]],
|
|
131
|
+
["strategyid", ["id", "address"]],
|
|
132
|
+
["wallet", ["address"]],
|
|
133
|
+
["walletaddress", ["address"]],
|
|
134
|
+
["strategyaddress", ["address"]],
|
|
135
|
+
["strategywallet", ["address"]],
|
|
136
|
+
["recipedir", ["runtimeYamlDir"]],
|
|
137
|
+
["packagedir", ["runtimeYamlDir"]],
|
|
138
|
+
["dir", ["runtimeYamlDir"]],
|
|
139
|
+
["recipepath", ["runtimeYamlPath"]],
|
|
140
|
+
["path", ["runtimeYamlPath"]],
|
|
141
|
+
["recipe", ["runtimeYamlPath", "runtimeYamlContent"]],
|
|
142
|
+
["content", ["runtimeYamlContent"]],
|
|
143
|
+
["recipecontent", ["runtimeYamlContent"]],
|
|
144
|
+
["apply", ["dryRun"]],
|
|
145
|
+
]);
|
|
146
|
+
/** The accepted key(s) an unknown key is a case, separator or synonym variant of, if any. */
|
|
147
|
+
function nearMissOf(k) {
|
|
148
|
+
const n = normalizeKey(k);
|
|
149
|
+
const exact = ACCEPTED_PARAMS.find((a) => normalizeKey(a) === n);
|
|
150
|
+
return exact !== undefined ? [exact] : PARAM_SYNONYMS.get(n);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* What each accepted key takes, in one line. A near-miss hint names this and never the caller's
|
|
154
|
+
* value: re-sending the value under a guessed key is what steered a recipe path into
|
|
155
|
+
* `runtimeYamlContent` and a conflicting `runtime_id` over an explicit `id`.
|
|
156
|
+
*/
|
|
157
|
+
const PARAM_MEANING = {
|
|
158
|
+
runtimeYamlPath: "the runtime.yaml file path on the gateway's disk",
|
|
159
|
+
runtimeYamlContent: "the recipe YAML text",
|
|
160
|
+
runtimeYamlDir: "the directory that holds runtime.yaml (the package root when runtime.yaml is there; otherwise the instance subdirectory that holds it)",
|
|
161
|
+
id: "the runtime id to update, from `openclaw senpi runtime list`",
|
|
162
|
+
address: "the strategy wallet of the runtime to update",
|
|
163
|
+
dryRun: "`false` applies; leave it out to plan",
|
|
164
|
+
codeOnly: "`true` asserts only scanner code changed",
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* The code every INVALID_REQUEST leads with, unless {@link PARAM_UNSUPPORTED_CODE} does. Without a
|
|
168
|
+
* code the CLI reads the refusal as a transport failure. `senpi update` exits 3 on it: the call is
|
|
169
|
+
* malformed.
|
|
170
|
+
*/
|
|
171
|
+
export const PARAMS_CODE = "E_UPDATE_PARAMS";
|
|
172
|
+
/**
|
|
173
|
+
* The code for an apply refused only for keys this gateway does not know and that are no near-miss
|
|
174
|
+
* of one it does. The CLI sends only keys its own runtime accepts, so when the CLI gets this the
|
|
175
|
+
* gateway is older than the CLI (a self-update installs first and restarts later): the command is
|
|
176
|
+
* right and the fix is a gateway restart. `senpi update` exits 2 on it, not 3 ("fix the command").
|
|
177
|
+
*/
|
|
178
|
+
export const PARAM_UNSUPPORTED_CODE = "E_UPDATE_PARAM_UNSUPPORTED";
|
|
179
|
+
/**
|
|
180
|
+
* The code for an apply on a gateway wired to plan only (`NOT_IMPLEMENTED`). Nothing was attempted,
|
|
181
|
+
* so it is a refusal: without the bracket `callGatewayJson` read it as an uncoded answer and
|
|
182
|
+
* `senpi update --apply` exited 1, which its contract reserves for an apply that failed part-way.
|
|
183
|
+
*/
|
|
184
|
+
export const PLAN_ONLY_CODE = "E_UPDATE_PLAN_ONLY";
|
|
185
|
+
/**
|
|
186
|
+
* The code for a fault while PLANNING (`UNAVAILABLE` on a plan). A plan touches nothing, so this
|
|
187
|
+
* exits 2 like any refusal. The same fault during an apply stays uncoded: the runtime's state is
|
|
188
|
+
* then unknown, which is exit 1's meaning.
|
|
189
|
+
*/
|
|
190
|
+
export const PLAN_FAULT_CODE = "E_UPDATE_PLAN_FAULT";
|
|
191
|
+
const PARAMS_SCHEMA = "senpi.update params: runtimeYamlPath (string) | runtimeYamlContent (string) — exactly one; " +
|
|
192
|
+
"runtimeYamlDir (string): the directory that holds runtime.yaml (the package root when " +
|
|
193
|
+
"runtime.yaml is there; otherwise the instance subdirectory that holds it); send it with " +
|
|
194
|
+
"runtimeYamlContent; with runtimeYamlPath it defaults to that file's directory; " +
|
|
195
|
+
"id (string) or address (string) to pick the runtime; dryRun (false applies; absent plans); " +
|
|
196
|
+
"codeOnly (true). The CLI verb sends these for you: openclaw senpi update <recipe-dir>.";
|
|
197
|
+
/**
|
|
198
|
+
* One line per unknown key: the accepted key(s) it may mean and what each takes, or that it is not
|
|
199
|
+
* a param at all. When the accepted key was ALSO sent, it says so rather than steer a resend onto
|
|
200
|
+
* it. An `apply` beside a `dryRun` that says the same thing (`apply: true` with `dryRun: false`, or
|
|
201
|
+
* `apply: false` with `dryRun: true`) is told to go. One that contradicts it is not: dropping it
|
|
202
|
+
* would run what `dryRun` says, which may be the apply the caller said not to run, so the line says
|
|
203
|
+
* they disagree and asks for `dryRun` alone, with the value meant.
|
|
204
|
+
*/
|
|
205
|
+
function unknownKeyLine(k, sent, raw) {
|
|
206
|
+
const meant = nearMissOf(k);
|
|
207
|
+
if (meant === undefined)
|
|
208
|
+
return `\`${k}\`: not a senpi.update param. Leave it out, or use one of the params below.`;
|
|
209
|
+
const ask = `\`${k}\`: did you mean ${meant.map((m) => `\`${m}\` (${PARAM_MEANING[m]})`).join(" or ")}?`;
|
|
210
|
+
if (meant.length !== 1 || !sent.has(meant[0]))
|
|
211
|
+
return ask;
|
|
212
|
+
if (meant[0] !== "dryRun" || normalizeKey(k) !== "apply") {
|
|
213
|
+
return `${ask} You also sent \`${meant[0]}\`; send only \`${meant[0]}\`, with the value you mean.`;
|
|
214
|
+
}
|
|
215
|
+
const agree = typeof raw[k] === "boolean" && typeof raw.dryRun === "boolean" && raw[k] === !raw.dryRun;
|
|
216
|
+
return agree
|
|
217
|
+
? `${ask} You also sent \`dryRun\`; drop \`apply\`.`
|
|
218
|
+
: `${ask} You also sent \`dryRun\`, and the two disagree; send only \`dryRun\`, with the value you mean (${PARAM_MEANING.dryRun}).`;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* An apply whose unknown keys are all no near-miss may come from a CLI newer than this gateway: a
|
|
222
|
+
* self-update installs the new CLI first and restarts the gateway later (when idle, or never on a
|
|
223
|
+
* reload mode that forbids it). Re-running the same CLI command is then refused the same way.
|
|
224
|
+
*/
|
|
225
|
+
const VERSION_NOTE = `If \`openclaw senpi update\` sent a key named here, the CLI is newer than this gateway. ` +
|
|
226
|
+
`This gateway runs runtime ${VERSION}: restart the gateway so it loads the installed runtime, then re-run.`;
|
|
66
227
|
export function registerUpdateGatewayMethod(api, ctxDeps) {
|
|
67
228
|
api.registerGatewayMethod("senpi.update", async (ctx) => {
|
|
68
229
|
const { params, respond } = ctx;
|
|
69
|
-
const
|
|
70
|
-
const
|
|
230
|
+
const isObject = params != null && typeof params === "object" && !Array.isArray(params);
|
|
231
|
+
const raw = isObject ? params : {};
|
|
232
|
+
// A near-miss sent as `null` is absent, as the key it means would be.
|
|
233
|
+
const unknown = Object.keys(raw).filter((k) => !ACCEPTED_PARAMS.includes(k) && !(raw[k] === null && nearMissOf(k) !== undefined));
|
|
234
|
+
const sent = new Set(Object.keys(raw).filter((k) => ACCEPTED_PARAMS.includes(k) && !isAbsent(k, raw[k])));
|
|
235
|
+
// Every INVALID_REQUEST: its code and own line, then each unknown key (never "ignored":
|
|
236
|
+
// nothing ran), then any closing note, then the params list, once.
|
|
237
|
+
const refuseParams = (head, note, code = PARAMS_CODE) => respond(false, undefined, {
|
|
238
|
+
code: "INVALID_REQUEST",
|
|
239
|
+
message: [
|
|
240
|
+
`[${code}] ${head}`,
|
|
241
|
+
...unknown.map((k) => unknownKeyLine(k, sent, raw)),
|
|
242
|
+
...(note !== undefined ? [note] : []),
|
|
243
|
+
PARAMS_SCHEMA,
|
|
244
|
+
].join("\n"),
|
|
245
|
+
});
|
|
246
|
+
// Every other reply. Unknown keys reach here only on a plan (an apply with one is refused
|
|
247
|
+
// below), so this note never follows an apply. It comes AFTER the reply, because a plan's
|
|
248
|
+
// first line (`Dry run for <id> — nothing has been applied.`) is the line the skills tell
|
|
249
|
+
// agents to read, and it carries the params list because an ignored key may be why a plan
|
|
250
|
+
// was refused.
|
|
251
|
+
const ignoredNote = unknown.length === 0 ? "" : `\n\nIgnored unknown param(s): ${unknown.join(", ")}.\n${PARAMS_SCHEMA}`;
|
|
252
|
+
const fail = (code, message) => respond(false, undefined, { code, message: message + ignoredNote });
|
|
253
|
+
if (params != null && !isObject) {
|
|
254
|
+
refuseParams(`Wrong param type (params: expected an object of named params, received ${Array.isArray(params) ? "an array" : typeof params}). Nothing was planned or applied.`);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
// A caller serialising an unset optional as `null` (or a CLI forwarding an unset `--id` as
|
|
258
|
+
// `""`) asked for nothing, so absent values never reach the schema.
|
|
259
|
+
const present = Object.fromEntries(Object.entries(raw).filter(([k, v]) => !isAbsent(k, v)));
|
|
260
|
+
const typed = PARAMS.safeParse(present);
|
|
261
|
+
if (!typed.success) {
|
|
262
|
+
const bad = typed.error.issues.map((i) => `${i.path.join(".") || "params"}: ${i.message}`).join("; ");
|
|
263
|
+
refuseParams(`Wrong param type (${bad}). Nothing was planned or applied.${unknown.length > 0 ? `\nUnknown param(s): ${unknown.join(", ")}.` : ""}`);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const { runtimeYamlPath: path, runtimeYamlContent: content, runtimeYamlDir: dir, id, address, dryRun, codeOnly } = typed.data;
|
|
267
|
+
// `dryRun: false` is the apply.
|
|
268
|
+
const wantsApply = dryRun === false;
|
|
269
|
+
if (wantsApply && unknown.length > 0) {
|
|
270
|
+
// Only keys no accepted key resembles can come from a newer CLI. A near-miss among them is
|
|
271
|
+
// a caller's spelling, so the call is malformed and the version note would mislead.
|
|
272
|
+
const unsupportedOnly = unknown.every((k) => nearMissOf(k) === undefined);
|
|
273
|
+
refuseParams(`Unknown param(s) on an apply: ${unknown.join(", ")}. Nothing was planned or applied.`, unsupportedOnly ? VERSION_NOTE : undefined, unsupportedOnly ? PARAM_UNSUPPORTED_CODE : PARAMS_CODE);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (unknown.some((k) => nearMissOf(k) !== undefined)) {
|
|
277
|
+
refuseParams(`Unknown param(s): ${unknown.join(", ")}. Nothing was planned or applied: a misspelt param would plan a different call.`);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
71
280
|
if (path === undefined && content === undefined) {
|
|
72
|
-
|
|
73
|
-
code: "INVALID_REQUEST",
|
|
74
|
-
message: "Please provide the updated recipe: --path <file> or --content \"<yaml text>\".",
|
|
75
|
-
});
|
|
281
|
+
refuseParams("Please provide the updated recipe.");
|
|
76
282
|
return;
|
|
77
283
|
}
|
|
78
284
|
if (path !== undefined && content !== undefined) {
|
|
79
|
-
|
|
80
|
-
code: "INVALID_REQUEST",
|
|
81
|
-
message: "Please provide either a file path (--path) or YAML content (--content), not both.",
|
|
82
|
-
});
|
|
285
|
+
refuseParams("Please provide either runtimeYamlPath or runtimeYamlContent, not both.");
|
|
83
286
|
return;
|
|
84
287
|
}
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
|
|
288
|
+
// Relative paths are refused, not resolved. The gateway runs in its own process with its own
|
|
289
|
+
// working directory and cannot know the caller's, so resolving against it read a different
|
|
290
|
+
// file, or none, and a relative `runtimeYamlDir` went into the registry as given, where an
|
|
291
|
+
// external scanner's `path: ./` and the proof lookup resolve against whatever the cwd is at
|
|
292
|
+
// the next boot. The CLI resolves both where it runs and sends absolute values.
|
|
293
|
+
for (const [field, value] of [
|
|
294
|
+
["runtimeYamlPath", path],
|
|
295
|
+
["runtimeYamlDir", dir],
|
|
296
|
+
]) {
|
|
297
|
+
if (value !== undefined && !isAbsolute(value)) {
|
|
298
|
+
fail("INVALID_REQUEST", `[${PARAMS_CODE}] ${field} "${value}" is relative. The gateway cannot know the caller's working directory, ` +
|
|
299
|
+
"so it would resolve it against its own and use a different directory, or none.\n" +
|
|
300
|
+
"Send an absolute path, or run `openclaw senpi update <path>`, which resolves the path " +
|
|
301
|
+
"where you run it and sends the recipe as content.");
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// A deployment that did not wire the two mutating dependencies must refuse an apply rather
|
|
306
|
+
// than quietly planning — a caller who asked to change something and got an exit 0 over a
|
|
307
|
+
// plan would believe it changed.
|
|
89
308
|
const canApply = ctxDeps.applyToRuntime != null && ctxDeps.writeRegistry != null;
|
|
90
309
|
if (wantsApply && !canApply) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
message: "This gateway cannot apply updates — it can only plan them. " +
|
|
94
|
-
"Re-run without --apply to see what the change would do.",
|
|
95
|
-
});
|
|
310
|
+
fail("NOT_IMPLEMENTED", `[${PLAN_ONLY_CODE}] This gateway cannot apply updates — it can only plan them. ` +
|
|
311
|
+
"Omit `dryRun` (CLI: re-run without --apply) to see what the change would do.");
|
|
96
312
|
return;
|
|
97
313
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
314
|
+
// A path is read here, once, by the CLI's own read (an absolute path; a package directory to
|
|
315
|
+
// the recipe in it), and handled exactly like the CLI's request: content plus the file's
|
|
316
|
+
// directory. Passing the path on would bind no wallet placeholder and
|
|
317
|
+
// store the PATH in the registry, so one update by path turned a deploy-installed entry into
|
|
318
|
+
// a path entry for good: its descriptor publishes `recipeHash: null` and the drift check
|
|
319
|
+
// stops comparing. Reading once also keeps what is parsed and what is stored the same bytes.
|
|
320
|
+
let recipe;
|
|
321
|
+
if (path !== undefined) {
|
|
322
|
+
const read = readRecipeAtPath(NODE_RECIPE_FILE_IO, path);
|
|
323
|
+
if (!read.ok) {
|
|
324
|
+
fail("INVALID_REQUEST", `[${PARAMS_CODE}] ${read.message}`);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
recipe = { content: read.content, dir: dir ?? read.dir };
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
recipe = { content: content, ...(dir !== undefined ? { dir } : {}) };
|
|
331
|
+
}
|
|
103
332
|
// Resolved here only to stamp the wallet on the audit event; the handler does its own
|
|
104
333
|
// resolution and owns every refusal about it.
|
|
105
334
|
const runtimes = wantsApply ? await ctxDeps.listRuntimes().catch(() => []) : [];
|
|
106
335
|
const request = {
|
|
107
|
-
...(
|
|
108
|
-
...(
|
|
109
|
-
...(
|
|
336
|
+
...(id !== undefined ? { id } : {}),
|
|
337
|
+
...(address !== undefined ? { address } : {}),
|
|
338
|
+
...(codeOnly === true ? { codeOnly: true } : {}),
|
|
110
339
|
recipe,
|
|
111
340
|
};
|
|
112
341
|
let outcome;
|
|
@@ -121,14 +350,12 @@ export function registerUpdateGatewayMethod(api, ctxDeps) {
|
|
|
121
350
|
// `runUpdateApply` converts the failures it knows about into outcomes, so a throw escaping
|
|
122
351
|
// it is a defect here. On a plan that is unambiguous — nothing was touched. On an apply it
|
|
123
352
|
// is not, so the wording must not promise a state it cannot verify.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
: `Could not plan the update. This is a fault in the planner, not in your recipe.\n\n${String(err)}`,
|
|
131
|
-
});
|
|
353
|
+
fail("UNAVAILABLE", wantsApply
|
|
354
|
+
? `The update failed unexpectedly. This is a fault here rather than in your recipe, and ` +
|
|
355
|
+
`the runtime's state could not be determined from it — check it with ` +
|
|
356
|
+
`\`openclaw senpi runtime list\` before retrying.\n\n${String(err)}`
|
|
357
|
+
: `[${PLAN_FAULT_CODE}] Nothing was changed. The gateway hit an internal error while ` +
|
|
358
|
+
`planning this update: ${String(err)}. Report it with this message.`);
|
|
132
359
|
return;
|
|
133
360
|
}
|
|
134
361
|
if (!outcome.ok) {
|
|
@@ -141,12 +368,9 @@ export function registerUpdateGatewayMethod(api, ctxDeps) {
|
|
|
141
368
|
// handler had long since returned. The only refusal that ever worked was the one raised
|
|
142
369
|
// before this line, which carries no extra key. Structured findings stay available through
|
|
143
370
|
// `--json` on a plan; a refusal's `what`/`fix` are already rendered into the message.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
? renderFailure(asString(params?.id), outcome.refusals)
|
|
148
|
-
: renderRefusals(asString(params?.id), outcome.refusals),
|
|
149
|
-
});
|
|
371
|
+
fail(outcome.stage === "failed" ? "UPDATE_FAILED" : "UPDATE_REFUSED", outcome.stage === "failed"
|
|
372
|
+
? renderFailure(id, outcome.refusals)
|
|
373
|
+
: renderRefusals(id, outcome.refusals));
|
|
150
374
|
return;
|
|
151
375
|
}
|
|
152
376
|
if (wantsApply) {
|
|
@@ -166,7 +390,8 @@ export function registerUpdateGatewayMethod(api, ctxDeps) {
|
|
|
166
390
|
}
|
|
167
391
|
respond(true, {
|
|
168
392
|
report: outcome.plan.report,
|
|
169
|
-
rendered: renderUpdateReport(outcome.plan.report),
|
|
393
|
+
rendered: renderUpdateReport(outcome.plan.report) + ignoredNote,
|
|
394
|
+
...(unknown.length > 0 ? { ignoredParams: unknown } : {}),
|
|
170
395
|
});
|
|
171
396
|
}, { scope: "operator.write" });
|
|
172
397
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-register.js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