@oalo-ai/cli 0.6.0 → 0.7.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/man/oalo.1 +39 -4
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +2 -2
- package/plugin/skills/oalo/SKILL.md +60 -16
- package/src/commands/heal.js +141 -0
- package/src/commands/skill.js +15 -5
- package/src/coord-release.json +9 -9
- package/src/help.js +27 -3
- package/src/index.js +4 -0
package/man/oalo.1
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.TH OALO 1 "" "oalo 0.
|
|
1
|
+
.TH OALO 1 "" "oalo 0.7.0" "OALO CLI"
|
|
2
2
|
.SH NAME
|
|
3
3
|
oalo \- wire a local app into your Oalo workspace
|
|
4
4
|
.SH SYNOPSIS
|
|
@@ -396,6 +396,39 @@ vectorize sends the text of the chosen fields to the embedding provider (Voyage)
|
|
|
396
396
|
keep\-from\-ai names fields a bot's data tools (data_search, data_related, table_search, search) leave out of what they hand its AI model, and that can't be embedded. They're still stored, synced to your apps, and read by workflows. A field that's embedded now has to be vectorized away first. With no fields, the list.
|
|
397
397
|
.PP
|
|
398
398
|
Exit codes: 0 done; 1 failed, or some rows were rejected; 2 bad arguments or no token.
|
|
399
|
+
.SS heal
|
|
400
|
+
Inspect runtime errors, run/suggest integration tests, and run or approve self\-healing patches (Base or \-\-local).
|
|
401
|
+
.PP
|
|
402
|
+
\fBoalo heal list \-\-app <slug> [\-\-json]\fR
|
|
403
|
+
.br
|
|
404
|
+
\fBoalo heal inspect <error_id> [\-\-json]\fR
|
|
405
|
+
.br
|
|
406
|
+
\fBoalo heal run <error_id> [\-\-local] [\-\-mode branch_and_pr|diagnose_only|auto_deploy]\fR
|
|
407
|
+
.br
|
|
408
|
+
\fBoalo heal approve|reject <heal_id>\fR
|
|
409
|
+
.br
|
|
410
|
+
\fBoalo heal tests \-\-app <slug> [\-\-env dev|prod]\fR
|
|
411
|
+
.br
|
|
412
|
+
\fBoalo heal suggest\-tests \-\-app <slug> [\-\-auto]\fR
|
|
413
|
+
.br
|
|
414
|
+
.TP
|
|
415
|
+
\fB\-\-app <slug>\fR
|
|
416
|
+
The app. Default: the one saved with \fBoalo link \-\-app\fR.
|
|
417
|
+
.TP
|
|
418
|
+
\fB\-\-local\fR
|
|
419
|
+
Download the error bundle and switch to a local fix branch instead of running on the Base.
|
|
420
|
+
.TP
|
|
421
|
+
\fB\-\-auto\fR
|
|
422
|
+
Apply suggested tests immediately into .oalo/tests/smoke.json.
|
|
423
|
+
.TP
|
|
424
|
+
\fB\-\-json\fR
|
|
425
|
+
Raw JSON output.
|
|
426
|
+
.IP \(bu 2
|
|
427
|
+
Runs on the Base by default (opening a Forgejo PR in branch_and_pr mode), or pass \-\-local to download the error bundle and patch on your own machine.
|
|
428
|
+
.IP \(bu 2
|
|
429
|
+
High\-risk diffs (auth, migrations, billing, >5 files, >200 lines) always require explicit \fBoalo heal approve\fR or Dashboard 1\-click approval.
|
|
430
|
+
.PP
|
|
431
|
+
Exit codes: 0 done; 1 failed or failing tests; 2 bad arguments or no token.
|
|
399
432
|
.SS incidents
|
|
400
433
|
A live app's outages and restart bursts, as Oalo's uptime check saw them, newest first.
|
|
401
434
|
.PP
|
|
@@ -1262,13 +1295,15 @@ The Oalo app the variables go to. Default: the app this folder is linked to (oal
|
|
|
1262
1295
|
\fB\-\-json\fR
|
|
1263
1296
|
The plan as JSON: names only, never a value.
|
|
1264
1297
|
.IP \(bu 2
|
|
1265
|
-
Run it in the app's repo.
|
|
1298
|
+
Run it in the app's repo. Your existing host keeps serving traffic with zero downtime until you point DNS at Oalo.
|
|
1299
|
+
.IP \(bu 2
|
|
1300
|
+
It reads fly.toml, railway.json or railway.toml, render.yaml, app.json and the Procfile, and asks the platform's CLI for variables (heroku, railway), secret names (fly) and dyno sizes (heroku) when it's installed and signed in.
|
|
1266
1301
|
.IP \(bu 2
|
|
1267
1302
|
Variables: PORT and each platform's own (HEROKU_*, RAILWAY_*, RENDER_*, FLY_*) are left out, and DATABASE_URL becomes EXTERNAL_DATABASE_URL, since DATABASE_URL on Oalo is the Base's own Postgres. Values are never printed or written to a file; \-\-apply sends them to prod without restarting the app.
|
|
1268
1303
|
.IP \(bu 2
|
|
1269
|
-
It says what doesn't carry over: cron jobs, volumes and disks, private addresses (*.railway.internal, *.flycast), extra replicas, build commands, an Aptfile, a VM bigger than large.
|
|
1304
|
+
It says what doesn't carry over: cron jobs, volumes and disks, private addresses (*.railway.internal, *.flycast), extra replicas, build commands, an Aptfile, a VM bigger than large (2 CPUs, 4 GB).
|
|
1270
1305
|
.IP \(bu 2
|
|
1271
|
-
|
|
1306
|
+
Exact execution order: (1) Ensure Node apps have a committed lockfile (package\-lock.json, yarn.lock or pnpm\-lock.yaml) and a Procfile \fBweb:\fR line listening on $PORT (or package.json start). (2) Run \fBoalo migrate <platform> [\-\-from\-app <name>]\fR to inspect the plan and warnings. (3) Run \fBoalo migrate <platform> [\-\-from\-app <name>] \-\-apply\fR to write Procfile / .oalo/app.json with mapped sizes. (4) Commit those files (\fBgit add Procfile .oalo/app.json && git commit\fR). (5) Run \fBoalo deploy \-\-new <slug>\fR to create the app and dev preview (if deploy updates .gitignore, commit .gitignore). (6) Run \fBoalo migrate <platform> [\-\-from\-app <name>] \-\-apply\fR a second time to push prod variables now that the app exists. (7) Optionally move Postgres with \fBoalo db restore \-\-from\-env SOURCE_DATABASE_URL \-\-env prod \-\-check\fR then without \fB\-\-check\fR, unset EXTERNAL_DATABASE_URL, and run \fBoalo deploy \-\-app <slug> \-\-env prod\fR. See \fBoalo docs migrating\-from\-<platform>\fR.
|
|
1272
1307
|
.PP
|
|
1273
1308
|
Exit codes: 0 the plan was shown, or applied; 1 a config file couldn't be read, or the variables couldn't be set; 2 bad arguments, an unknown platform, or no CLI token.
|
|
1274
1309
|
.SS env
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oalo",
|
|
3
|
-
"description": "Work on an Oalo workspace from Claude Code: edit chat flows, loops and code tools,
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Work on an Oalo workspace from Claude Code: edit chat flows, loops and code tools, deploy and migrate apps, inspect and self-heal runtime errors, and run test conversations with a bot.",
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"author": { "name": "Oalo" },
|
|
6
6
|
"mcpServers": {
|
|
7
7
|
"oalo": {
|
|
@@ -303,25 +303,68 @@ oalo build --app shop --download # a Flutter or Expo app's store files (.ipa
|
|
|
303
303
|
after the copy starts is lost. `oalo docs migrating-from-heroku` (or
|
|
304
304
|
`-railway`, `-render`, `-fly`, `-primcloud`) has each platform's steps.
|
|
305
305
|
8. **Moving an app from another platform** (Heroku, Railway, Render, Fly.io,
|
|
306
|
-
Primcloud
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
306
|
+
Primcloud; the old host stays live with zero downtime until DNS flips):
|
|
307
|
+
execute in this exact order inside the app's repo:
|
|
308
|
+
1. **Pre-flight files:** Confirm Node apps have a committed lockfile
|
|
309
|
+
(`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and a `Procfile`
|
|
310
|
+
`web:` line listening on `$PORT` (or `package.json` `start`, or a
|
|
311
|
+
`Dockerfile`).
|
|
312
|
+
2. **Plan first (read-only):** Run `oalo migrate <platform> --from-app
|
|
313
|
+
<name>` and show the person the plan + warnings (sizes mapped into
|
|
314
|
+
`.oalo/app.json`, `Aptfile`, cron/scheduler, `> large` 4 GB dynos). It
|
|
315
|
+
changes nothing and never prints secret values.
|
|
316
|
+
3. **Write config files:** Run `oalo migrate <platform> --from-app <name>
|
|
317
|
+
--apply` (writes `Procfile` / `.oalo/app.json` without overwriting an
|
|
318
|
+
existing `Procfile`), then `git add Procfile .oalo/app.json && git
|
|
319
|
+
commit`.
|
|
320
|
+
4. **Create the app & preview:** Run `oalo deploy --new <slug>`. If it adds
|
|
321
|
+
`.oalo/credentials*` to `.gitignore`, commit `.gitignore` before the next
|
|
322
|
+
deploy.
|
|
323
|
+
5. **Push prod variables:** Run the exact same `oalo migrate <platform>
|
|
324
|
+
--from-app <name> --apply` a second time (now the app exists, it sends
|
|
325
|
+
the prod vars safely without restarting or printing values, renaming
|
|
326
|
+
`DATABASE_URL` to `EXTERNAL_DATABASE_URL`). For platforms whose CLI
|
|
327
|
+
can't read secret values back (Fly secrets, Primcloud), have the person
|
|
328
|
+
put them in an uncommitted `.env` file and pass `--env-file`. Don't copy
|
|
329
|
+
secrets by hand with `oalo env set NAME=value`.
|
|
330
|
+
6. **Move Postgres (optional, rule 7):** If moving the database into Oalo,
|
|
331
|
+
run `oalo db restore --from-env SOURCE_DATABASE_URL --env prod --check`,
|
|
332
|
+
then without `--check` once writes stop, then `oalo env unset
|
|
333
|
+
EXTERNAL_DATABASE_URL --env prod`.
|
|
334
|
+
7. **Go live when the person says so:** Run `oalo deploy --app <slug> --env
|
|
335
|
+
prod` (zero-downtime health-checked swap; web/server self-healing
|
|
336
|
+
telemetry starts automatically with no code changes).
|
|
318
337
|
9. **App Store and Google Play files** (a Flutter or Expo app): `oalo deploy`
|
|
319
338
|
updates only the web preview. `oalo build --app shop --download` makes a
|
|
320
339
|
store build (15 to 60 minutes, both platforms) and saves the `.ipa` and
|
|
321
|
-
`.aab` where you run it.
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
340
|
+
`.aab` where you run it. When Apple App Store Connect or Google Play
|
|
341
|
+
credentials are connected in Integrations, Oalo can also publish Expo
|
|
342
|
+
JS-only fixes over the air (EAS Update) and submit native builds to Apple
|
|
343
|
+
App Review and a 10% Google Play staged rollout from **Apps > Logs &
|
|
344
|
+
Errors**; otherwise deliver the `.ipa` with Transporter and upload the
|
|
345
|
+
`.aab` in Google Play Console. Each build raises the version code, so start
|
|
346
|
+
one only when asked. Don't build them locally with Xcode, Gradle,
|
|
347
|
+
`flutter build` or `eas build`.
|
|
348
|
+
10. **Self-healing, error telemetry, and integration tests** (`oalo docs
|
|
349
|
+
self-healing`):
|
|
350
|
+
- **Hosted web & server apps** get error capture automatically (HTML gets
|
|
351
|
+
`/_oalo/error-beacon.js`; proxied server routes capture `5xx`, `502`,
|
|
352
|
+
status regressions, and JSON shape drift). In React apps, forward caught
|
|
353
|
+
`ErrorBoundary` errors via `window.__oaloReportError?.(error, {
|
|
354
|
+
component_stack: info.componentStack })`.
|
|
355
|
+
- **Native mobile apps (Expo / Flutter) and off-box frontends** do not go
|
|
356
|
+
through Oalo's HTML proxy: wire a global crash handler that POSTs to
|
|
357
|
+
`<OALO_ORIGIN>/_oalo/errors` (`{ app, env, platform, message, stack,
|
|
358
|
+
route, app_version }`). Copy the exact snippet from `oalo docs
|
|
359
|
+
self-healing`.
|
|
360
|
+
- **Write `.oalo/tests/smoke.json`** as you add API routes (`tests: [{
|
|
361
|
+
name, method, path, expect_status, expect_json_keys, expect_json_shape,
|
|
362
|
+
max_ms }]`) and verify with `oalo heal tests --app <slug>` (or `oalo
|
|
363
|
+
heal suggest-tests --app <slug>`).
|
|
364
|
+
- **Investigate and fix runtime errors** with `oalo heal list --app
|
|
365
|
+
<slug>`, `oalo heal inspect <error_id>`, `oalo heal run <error_id>`
|
|
366
|
+
(Base PR by default, or `--local` to download the error bundle and fix
|
|
367
|
+
locally), and `oalo heal approve|reject <heal_id>`.
|
|
325
368
|
|
|
326
369
|
## An app's environment variables
|
|
327
370
|
|
|
@@ -369,6 +412,7 @@ writing it: the endpoints, headers and shapes are there.
|
|
|
369
412
|
| Give the live app more CPU or memory, a health check, or required variables | All in one committed file, `.oalo/app.json`: `{"sizes": {"web": "medium"}, "health": "/healthz", "env": {"required": ["STRIPE_KEY"]}}`. A live deploy is refused while a required variable isn't set for prod. There is no `infra.json`. | `live-server-apps` |
|
|
370
413
|
| Show the app's own numbers to its users (a chart in the app) | `queryMetric({ table: "sessions", every: "week", days: 90, by: "coach_id" })` from `oalo typegen`, called on the app's server. | `dashboards` |
|
|
371
414
|
| Work on an app made from Oalo's Flutter template on this machine | `oalo typegen --dart` (the models, and `.oalo/dart-defines.json`), then `flutter run -d chrome --dart-define-from-file=.oalo/dart-defines.json`. | `flutter-on-your-machine` |
|
|
415
|
+
| Wire self-healing error telemetry & `.oalo/tests/smoke.json` | Web & server capture is automatic; forward React `ErrorBoundary` via `window.__oaloReportError`, POST native Expo/Flutter crashes to `/_oalo/errors`, and add `.oalo/tests/smoke.json` checked with `oalo heal tests`. | `self-healing` |
|
|
372
416
|
|
|
373
417
|
## Selling: products and paid content
|
|
374
418
|
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { OaloChannel } from "../channel.js";
|
|
5
|
+
import { resolve as resolveConfig, controlPlane, HOW_TO_CONNECT } from "../config.js";
|
|
6
|
+
import { dim } from "../events.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* `oalo heal`: inspect runtime errors, run/suggest integration tests, and run
|
|
10
|
+
* self-healing either on the Base or locally (`--local`), plus approve/reject
|
|
11
|
+
* generated fix PRs.
|
|
12
|
+
*/
|
|
13
|
+
export async function heal(flags, rest, opts = {}) {
|
|
14
|
+
const cfg = resolveConfig(flags);
|
|
15
|
+
const { url, token } = controlPlane(cfg);
|
|
16
|
+
if (!url || !token) return fail(`oalo heal needs a CLI token.\n\n${HOW_TO_CONNECT}`, 2);
|
|
17
|
+
|
|
18
|
+
const sub = rest[1] || "list";
|
|
19
|
+
const arg = rest[2];
|
|
20
|
+
const app = typeof flags.app === "string" ? flags.app : cfg.appId;
|
|
21
|
+
|
|
22
|
+
const ch = (opts.channel || ((o) => new OaloChannel(o)))({ url, token });
|
|
23
|
+
try {
|
|
24
|
+
await ch.connect();
|
|
25
|
+
|
|
26
|
+
if (sub === "list") {
|
|
27
|
+
if (!app) return fail("Pass --app <slug> or link an app with `oalo link --app <slug>`.", 2);
|
|
28
|
+
const r = await ch.call("apps:heal:list", { app });
|
|
29
|
+
if (flags.json) return void console.log(JSON.stringify(r, null, 2));
|
|
30
|
+
const errors = r.errors || [];
|
|
31
|
+
const runs = r.runs || [];
|
|
32
|
+
console.log(`${r.app} policy: mode=${r.policy?.mode} runner=${r.policy?.runner}`);
|
|
33
|
+
if (!errors.length) {
|
|
34
|
+
console.log(" No runtime errors recorded.");
|
|
35
|
+
} else {
|
|
36
|
+
for (const e of errors) {
|
|
37
|
+
console.log(` #${e.id} [${e.status}] (${e.occurrences}x) ${e.platform}/${e.source}: ${e.title}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (runs.length) {
|
|
41
|
+
console.log("\nRecent heal runs:");
|
|
42
|
+
for (const h of runs) {
|
|
43
|
+
console.log(` heal #${h.id} (error #${h.error_id}) [${h.status}] branch=${h.branch || "-"}${h.pr_url ? ` ${dim(h.pr_url)}` : ""}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (sub === "inspect") {
|
|
50
|
+
if (!arg) return fail("Usage: oalo heal inspect <error_id>", 2);
|
|
51
|
+
const b = await ch.call("apps:heal:bundle", { error_id: arg });
|
|
52
|
+
if (flags.json) return void console.log(JSON.stringify(b, null, 2));
|
|
53
|
+
const e = b.error;
|
|
54
|
+
console.log(`Error #${e.id} [${e.status}] on ${e.slug} (${e.env}, ${e.platform}/${e.source})`);
|
|
55
|
+
console.log(`Title: ${e.title}`);
|
|
56
|
+
console.log(`Route: ${e.method || ""} ${e.route || "/"} (HTTP ${e.status_code ?? "-"}) · ${e.occurrences}x`);
|
|
57
|
+
if (e.diagnosis) console.log(`\nDiagnosis:\n${e.diagnosis}`);
|
|
58
|
+
if (e.stack_trace) console.log(`\nStack:\n${e.stack_trace}`);
|
|
59
|
+
if (e.sample_logs) console.log(`\nLogs:\n${e.sample_logs}`);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (sub === "run") {
|
|
64
|
+
if (!arg) return fail("Usage: oalo heal run <error_id> [--local] [--mode branch_and_pr|diagnose_only|auto_deploy]", 2);
|
|
65
|
+
if (flags.local) {
|
|
66
|
+
const b = await ch.call("apps:heal:bundle", { error_id: arg });
|
|
67
|
+
const dir = join(process.cwd(), ".oalo", "heal");
|
|
68
|
+
mkdirSync(dir, { recursive: true });
|
|
69
|
+
const outPath = join(dir, `error-${b.error.id}.json`);
|
|
70
|
+
writeFileSync(outPath, JSON.stringify(b, null, 2) + "\n", "utf8");
|
|
71
|
+
const branch = b.branch || `oalo/fix-${b.error.id}`;
|
|
72
|
+
const git = spawnSync("git", ["checkout", "-B", branch], { encoding: "utf8" });
|
|
73
|
+
if (flags.json) {
|
|
74
|
+
return void console.log(JSON.stringify({ ok: true, bundle_path: outPath, branch, git_switched: git.status === 0 }, null, 2));
|
|
75
|
+
}
|
|
76
|
+
console.log(`Saved error bundle to ${outPath}`);
|
|
77
|
+
if (git.status === 0) console.log(`Switched local git branch to ${branch}`);
|
|
78
|
+
console.log(`Fix error #${b.error.id} (${b.error.title}), run tests, and push branch ${branch} to Forgejo.`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const r = await ch.call("apps:heal:start", {
|
|
83
|
+
error_id: arg,
|
|
84
|
+
...(typeof flags.mode === "string" ? { mode: flags.mode } : {}),
|
|
85
|
+
runner: "base",
|
|
86
|
+
});
|
|
87
|
+
if (flags.json) return void console.log(JSON.stringify(r, null, 2));
|
|
88
|
+
console.log(`Heal #${r.run?.id} ${r.run?.status} on branch ${r.run?.branch}`);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (sub === "approve") {
|
|
93
|
+
if (!arg) return fail("Usage: oalo heal approve <heal_id>", 2);
|
|
94
|
+
const r = await ch.call("apps:heal:approve", { id: arg });
|
|
95
|
+
if (flags.json) return void console.log(JSON.stringify(r, null, 2));
|
|
96
|
+
console.log(`Heal #${r.run?.id} approved and merged (${r.run?.status}).`);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (sub === "reject") {
|
|
101
|
+
if (!arg) return fail("Usage: oalo heal reject <heal_id>", 2);
|
|
102
|
+
const r = await ch.call("apps:heal:reject", { id: arg });
|
|
103
|
+
if (flags.json) return void console.log(JSON.stringify(r, null, 2));
|
|
104
|
+
console.log(`Heal #${r.run?.id} rejected and closed.`);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (sub === "tests") {
|
|
109
|
+
if (!app) return fail("Pass --app <slug>.", 2);
|
|
110
|
+
const r = await ch.call("apps:tests:run", { app, env: typeof flags.env === "string" ? flags.env : "dev" });
|
|
111
|
+
if (flags.json) return void console.log(JSON.stringify(r, null, 2));
|
|
112
|
+
const run = r.run || {};
|
|
113
|
+
console.log(`${app} tests (${run.status}): ${run.passed_count} passed, ${run.failed_count} failed (${run.duration_ms}ms)`);
|
|
114
|
+
for (const tc of run.results || []) {
|
|
115
|
+
console.log(` ${tc.passed ? "ok " : "FAIL"} ${tc.name} (${tc.status ?? "err"}, ${tc.duration_ms}ms)`);
|
|
116
|
+
for (const f of tc.failures || []) console.log(` - ${f}`);
|
|
117
|
+
}
|
|
118
|
+
if (run.failed_count > 0) process.exitCode = 1;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (sub === "suggest-tests") {
|
|
123
|
+
if (!app) return fail("Pass --app <slug>.", 2);
|
|
124
|
+
const r = await ch.call("apps:tests:suggest", { app, auto: Boolean(flags.auto) });
|
|
125
|
+
if (flags.json) return void console.log(JSON.stringify(r, null, 2));
|
|
126
|
+
console.log(`Suggestion #${r.suggestion?.id} [${r.suggestion?.status}]: ${r.suggestion?.title}`);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return fail(`Unknown heal subcommand: ${sub}. Use list, inspect, run, approve, reject, tests, or suggest-tests.`, 2);
|
|
131
|
+
} catch (e) {
|
|
132
|
+
return fail(e.message, 1);
|
|
133
|
+
} finally {
|
|
134
|
+
ch.close();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function fail(msg, code) {
|
|
139
|
+
console.error(msg);
|
|
140
|
+
process.exitCode = code;
|
|
141
|
+
}
|
package/src/commands/skill.js
CHANGED
|
@@ -38,9 +38,10 @@ export function skillHash() {
|
|
|
38
38
|
|
|
39
39
|
const body = (md) => md.replace(/^---\n[\s\S]*?\n---\n+/, "");
|
|
40
40
|
const skillPath = (cwd) => join(cwd, ".claude", "skills", "oalo", "SKILL.md");
|
|
41
|
+
const openSkillPath = (cwd) => join(cwd, ".agents", "skills", "oalo", "SKILL.md");
|
|
41
42
|
|
|
42
43
|
// The packaged skill with a stamp line after its front matter (the front matter
|
|
43
|
-
// must stay first for
|
|
44
|
+
// must stay first for agent harnesses to read it).
|
|
44
45
|
function stamped() {
|
|
45
46
|
const md = readFileSync(SKILL, "utf8");
|
|
46
47
|
const stamp = `<!-- oalo-cli ${CLI_VERSION} (skill ${skillHash()}) wrote this copy; \`oalo skill\` updates it. -->\n\n`;
|
|
@@ -49,8 +50,9 @@ function stamped() {
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
/**
|
|
52
|
-
* Write the skill into `cwd`
|
|
53
|
-
*
|
|
53
|
+
* Write the skill into `cwd` for both the open cross-harness standard
|
|
54
|
+
* (`.agents/skills/oalo/SKILL.md`) and Claude Code (`.claude/skills/oalo/SKILL.md`),
|
|
55
|
+
* plus the `AGENTS.md` section when `agents` is true or `AGENTS.md` already has one.
|
|
54
56
|
*/
|
|
55
57
|
export function installSkill(cwd = process.cwd(), { agents = false } = {}) {
|
|
56
58
|
const md = stamped();
|
|
@@ -58,6 +60,10 @@ export function installSkill(cwd = process.cwd(), { agents = false } = {}) {
|
|
|
58
60
|
mkdirSync(dirname(target), { recursive: true });
|
|
59
61
|
writeFileSync(target, md);
|
|
60
62
|
|
|
63
|
+
const openTarget = openSkillPath(cwd);
|
|
64
|
+
mkdirSync(dirname(openTarget), { recursive: true });
|
|
65
|
+
writeFileSync(openTarget, md);
|
|
66
|
+
|
|
61
67
|
const agentsPath = join(cwd, "AGENTS.md");
|
|
62
68
|
const current = existsSync(agentsPath) ? readFileSync(agentsPath, "utf8") : "";
|
|
63
69
|
const at = current.indexOf(START);
|
|
@@ -74,7 +80,11 @@ export function installSkill(cwd = process.cwd(), { agents = false } = {}) {
|
|
|
74
80
|
agentsResult = at >= 0 ? "updated" : "added";
|
|
75
81
|
}
|
|
76
82
|
|
|
77
|
-
return {
|
|
83
|
+
return {
|
|
84
|
+
path: target.slice(cwd.length + 1),
|
|
85
|
+
openPath: openTarget.slice(cwd.length + 1),
|
|
86
|
+
agents: agentsResult,
|
|
87
|
+
};
|
|
78
88
|
}
|
|
79
89
|
|
|
80
90
|
/**
|
|
@@ -136,7 +146,7 @@ export async function skill(flags) {
|
|
|
136
146
|
}
|
|
137
147
|
|
|
138
148
|
const r = installSkill(process.cwd(), { agents: !!flags.agents });
|
|
139
|
-
console.log(`installed ${r.path}`);
|
|
149
|
+
console.log(`installed ${r.openPath} and ${r.path}`);
|
|
140
150
|
if (r.agents) console.log(`${r.agents} the Oalo section in AGENTS.md`);
|
|
141
151
|
console.log(dim(`From CLI ${CLI_VERSION}. Run \`oalo skill\` again after updating the CLI.`));
|
|
142
152
|
}
|
package/src/coord-release.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.7.0",
|
|
3
3
|
"targets": {
|
|
4
4
|
"darwin-arm64": {
|
|
5
5
|
"file": "oalo-coord-darwin-arm64.gz",
|
|
6
|
-
"sha256": "
|
|
7
|
-
"bytes":
|
|
6
|
+
"sha256": "e689f1a38178d13cc1a10f4d50ce15927da58ca7484e3e963d82bcb73e581893",
|
|
7
|
+
"bytes": 24874385
|
|
8
8
|
},
|
|
9
9
|
"darwin-x64": {
|
|
10
10
|
"file": "oalo-coord-darwin-x64.gz",
|
|
11
|
-
"sha256": "
|
|
12
|
-
"bytes":
|
|
11
|
+
"sha256": "c9d7a43b292de653526cd73139e97f5683b5f5cf4fb07392439fdbe32a2e5f81",
|
|
12
|
+
"bytes": 27013652
|
|
13
13
|
},
|
|
14
14
|
"linux-x64": {
|
|
15
15
|
"file": "oalo-coord-linux-x64.gz",
|
|
16
|
-
"sha256": "
|
|
17
|
-
"bytes":
|
|
16
|
+
"sha256": "dad3c5e0dd9a794c200ec2824fbf7a3786700b96f9c46ad18a53b873db645983",
|
|
17
|
+
"bytes": 36905376
|
|
18
18
|
},
|
|
19
19
|
"linux-arm64": {
|
|
20
20
|
"file": "oalo-coord-linux-arm64.gz",
|
|
21
|
-
"sha256": "
|
|
22
|
-
"bytes":
|
|
21
|
+
"sha256": "e58aeadf446af3d09806e6525e2edc29888337dd84592e863e82545ed96eb352",
|
|
22
|
+
"bytes": 37145971
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
package/src/help.js
CHANGED
|
@@ -243,6 +243,29 @@ export const COMMANDS = [
|
|
|
243
243
|
],
|
|
244
244
|
exits: { 0: "done", 1: "failed, or some rows were rejected", 2: "bad arguments or no token" },
|
|
245
245
|
},
|
|
246
|
+
{
|
|
247
|
+
name: "heal",
|
|
248
|
+
summary: "Inspect runtime errors, run/suggest integration tests, and run or approve self-healing patches (Base or --local).",
|
|
249
|
+
usage: [
|
|
250
|
+
"oalo heal list --app <slug> [--json]",
|
|
251
|
+
"oalo heal inspect <error_id> [--json]",
|
|
252
|
+
"oalo heal run <error_id> [--local] [--mode branch_and_pr|diagnose_only|auto_deploy]",
|
|
253
|
+
"oalo heal approve|reject <heal_id>",
|
|
254
|
+
"oalo heal tests --app <slug> [--env dev|prod]",
|
|
255
|
+
"oalo heal suggest-tests --app <slug> [--auto]",
|
|
256
|
+
],
|
|
257
|
+
flags: [
|
|
258
|
+
{ flag: "--app <slug>", desc: "The app. Default: the one saved with `oalo link --app`." },
|
|
259
|
+
{ flag: "--local", desc: "Download the error bundle and switch to a local fix branch instead of running on the Base." },
|
|
260
|
+
{ flag: "--auto", desc: "Apply suggested tests immediately into .oalo/tests/smoke.json." },
|
|
261
|
+
{ flag: "--json", desc: "Raw JSON output." },
|
|
262
|
+
],
|
|
263
|
+
notes: [
|
|
264
|
+
"Runs on the Base by default (opening a Forgejo PR in branch_and_pr mode), or pass --local to download the error bundle and patch on your own machine.",
|
|
265
|
+
"High-risk diffs (auth, migrations, billing, >5 files, >200 lines) always require explicit `oalo heal approve` or Dashboard 1-click approval.",
|
|
266
|
+
],
|
|
267
|
+
exits: { 0: "done", 1: "failed or failing tests", 2: "bad arguments or no token" },
|
|
268
|
+
},
|
|
246
269
|
{
|
|
247
270
|
name: "incidents",
|
|
248
271
|
summary: "A live app's outages and restart bursts, as Oalo's uptime check saw them, newest first.",
|
|
@@ -739,10 +762,11 @@ export const COMMANDS = [
|
|
|
739
762
|
{ flag: "--json", desc: "The plan as JSON: names only, never a value." },
|
|
740
763
|
],
|
|
741
764
|
notes: [
|
|
742
|
-
"Run it in the app's repo.
|
|
765
|
+
"Run it in the app's repo. Your existing host keeps serving traffic with zero downtime until you point DNS at Oalo.",
|
|
766
|
+
"It reads fly.toml, railway.json or railway.toml, render.yaml, app.json and the Procfile, and asks the platform's CLI for variables (heroku, railway), secret names (fly) and dyno sizes (heroku) when it's installed and signed in.",
|
|
743
767
|
"Variables: PORT and each platform's own (HEROKU_*, RAILWAY_*, RENDER_*, FLY_*) are left out, and DATABASE_URL becomes EXTERNAL_DATABASE_URL, since DATABASE_URL on Oalo is the Base's own Postgres. Values are never printed or written to a file; --apply sends them to prod without restarting the app.",
|
|
744
|
-
"It says what doesn't carry over: cron jobs, volumes and disks, private addresses (*.railway.internal, *.flycast), extra replicas, build commands, an Aptfile, a VM bigger than large.",
|
|
745
|
-
"
|
|
768
|
+
"It says what doesn't carry over: cron jobs, volumes and disks, private addresses (*.railway.internal, *.flycast), extra replicas, build commands, an Aptfile, a VM bigger than large (2 CPUs, 4 GB).",
|
|
769
|
+
"Exact execution order: (1) Ensure Node apps have a committed lockfile (package-lock.json, yarn.lock or pnpm-lock.yaml) and a Procfile `web:` line listening on $PORT (or package.json start). (2) Run `oalo migrate <platform> [--from-app <name>]` to inspect the plan and warnings. (3) Run `oalo migrate <platform> [--from-app <name>] --apply` to write Procfile / .oalo/app.json with mapped sizes. (4) Commit those files (`git add Procfile .oalo/app.json && git commit`). (5) Run `oalo deploy --new <slug>` to create the app and dev preview (if deploy updates .gitignore, commit .gitignore). (6) Run `oalo migrate <platform> [--from-app <name>] --apply` a second time to push prod variables now that the app exists. (7) Optionally move Postgres with `oalo db restore --from-env SOURCE_DATABASE_URL --env prod --check` then without `--check`, unset EXTERNAL_DATABASE_URL, and run `oalo deploy --app <slug> --env prod`. See `oalo docs migrating-from-<platform>`.",
|
|
746
770
|
],
|
|
747
771
|
exits: { 0: "the plan was shown, or applied", 1: "a config file couldn't be read, or the variables couldn't be set", 2: "bad arguments, an unknown platform, or no CLI token" },
|
|
748
772
|
},
|
package/src/index.js
CHANGED
|
@@ -29,6 +29,7 @@ import { sources } from "./commands/sources.js";
|
|
|
29
29
|
import { setup } from "./commands/setup.js";
|
|
30
30
|
import { build } from "./commands/build.js";
|
|
31
31
|
import { incidents } from "./commands/incidents.js";
|
|
32
|
+
import { heal } from "./commands/heal.js";
|
|
32
33
|
import { channels } from "./commands/channels.js";
|
|
33
34
|
import { products } from "./commands/products.js";
|
|
34
35
|
import { metrics, dashboards } from "./commands/metrics.js";
|
|
@@ -183,6 +184,9 @@ async function dispatch(cmd) {
|
|
|
183
184
|
case "incidents":
|
|
184
185
|
await incidents(flags, rest);
|
|
185
186
|
break;
|
|
187
|
+
case "heal":
|
|
188
|
+
await heal(flags, rest);
|
|
189
|
+
break;
|
|
186
190
|
case "channels":
|
|
187
191
|
await channels(flags, rest);
|
|
188
192
|
break;
|