mop-agent 0.1.1 → 0.1.2
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/README.md +12 -10
- package/installer/bootstrap.mjs +2 -3
- package/installer/mop-agent.mjs +10 -34
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,8 +5,8 @@ through MOP-FLOW. It stores project memory, performs semantic recall and
|
|
|
5
5
|
consolidation, serves grounded chat, and can request approved actions from a
|
|
6
6
|
linked FLOW node.
|
|
7
7
|
|
|
8
|
-
> **Release status:** npm package `mop-agent@0.1.
|
|
9
|
-
> installer
|
|
8
|
+
> **Release status:** npm package `mop-agent@0.1.2` contains the corrected VPS
|
|
9
|
+
> installer flow. After publishing 0.1.2, the canonical installation command is
|
|
10
10
|
> exactly `npx mop-agent`.
|
|
11
11
|
|
|
12
12
|
## Current status
|
|
@@ -51,10 +51,14 @@ npx mop-agent
|
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
The first run copies the npm-packaged runtime from the temporary npx cache into
|
|
54
|
-
`/opt/mop-agent`, installs its dependencies, and opens
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
`/opt/mop-agent`, installs its dependencies, and opens a four-action TUI:
|
|
55
|
+
|
|
56
|
+
- `Install` — installs nginx/Certbot and immediately continues through the
|
|
57
|
+
complete domain, SQLite, HTTPS, and systemd setup.
|
|
58
|
+
- `Update` — updates only MOP-AGENT, migrates/builds, and restarts it.
|
|
59
|
+
- `Status` — reports service health and filesystem locations.
|
|
60
|
+
- `Delete` — removes the service and nginx configuration while preserving data
|
|
61
|
+
unless purge is explicitly requested.
|
|
58
62
|
|
|
59
63
|
During `setup`, choose one deployment mode:
|
|
60
64
|
|
|
@@ -72,10 +76,8 @@ needs to write under `/opt` or `/etc`, install OS packages, or control
|
|
|
72
76
|
nginx/systemd. When launched as root, it creates a locked-down `mop-agent`
|
|
73
77
|
system account and runs the web service under that account—not as root.
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
asks before running the global npm update. Set `MOP_AGENT_SKIP_NPM_UPDATE=1` to
|
|
78
|
-
skip this check.
|
|
79
|
+
MOP-AGENT never upgrades or modifies the system npm installation. npm and
|
|
80
|
+
Node.js upgrades remain an explicit server-administration task.
|
|
79
81
|
|
|
80
82
|
Subsequent operations use the same command:
|
|
81
83
|
|
package/installer/bootstrap.mjs
CHANGED
|
@@ -45,11 +45,10 @@ MOP-AGENT ${VERSION}
|
|
|
45
45
|
|
|
46
46
|
Usage:
|
|
47
47
|
npx mop-agent Open the installer menu
|
|
48
|
-
npx mop-agent install Install
|
|
49
|
-
npx mop-agent setup Configure domain, HTTPS, app and systemd
|
|
48
|
+
npx mop-agent install Install dependencies and complete setup
|
|
50
49
|
npx mop-agent status Show service health and file locations
|
|
51
50
|
npx mop-agent update Apply the npm version selected by npx
|
|
52
|
-
npx mop-agent
|
|
51
|
+
npx mop-agent delete Remove service and nginx config
|
|
53
52
|
|
|
54
53
|
Environment:
|
|
55
54
|
MOP_AGENT_DIR Durable app directory (default: ${DEFAULT_DIR})
|
package/installer/mop-agent.mjs
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
* MOP-AGENT installer / operator (TUI). Self-host with one command.
|
|
4
4
|
*
|
|
5
5
|
* npx mop-agent # interactive TUI
|
|
6
|
-
* npx mop-agent install #
|
|
7
|
-
* npx mop-agent setup # domain / SQLite / ssl / systemd
|
|
6
|
+
* npx mop-agent install # dependencies + complete setup
|
|
8
7
|
* npx mop-agent update # migrate + build + restart staged npm version
|
|
9
8
|
* npx mop-agent status # health
|
|
10
|
-
* npx mop-agent
|
|
9
|
+
* npx mop-agent delete # remove service + nginx vhost (keeps data unless --purge)
|
|
11
10
|
*
|
|
12
11
|
* Run as a normal user. Privileged OS operations request sudo individually.
|
|
13
12
|
*/
|
|
@@ -109,16 +108,16 @@ async function cmdInstall() {
|
|
|
109
108
|
banner();
|
|
110
109
|
const os = detectOS();
|
|
111
110
|
if (!printInstallLocations(os)) return;
|
|
112
|
-
await maybeUpdateNpm();
|
|
113
111
|
console.log(c("bold", "Installing system dependencies (nginx and Certbot)…\n"));
|
|
114
112
|
runSteps(planInstallDeps(os), { privileged: true });
|
|
115
|
-
console.log(c("green", "\n✓ dependencies
|
|
113
|
+
console.log(c("green", "\n✓ dependencies installed. Continuing to application setup…\n"));
|
|
114
|
+
await cmdSetup({ continuation: true });
|
|
116
115
|
}
|
|
117
116
|
|
|
118
|
-
async function cmdSetup() {
|
|
119
|
-
banner();
|
|
117
|
+
async function cmdSetup({ continuation = false } = {}) {
|
|
118
|
+
if (!continuation) banner();
|
|
120
119
|
const os = detectOS();
|
|
121
|
-
if (!printInstallLocations(os)) return;
|
|
120
|
+
if (!continuation && !printInstallLocations(os)) return;
|
|
122
121
|
const rl = createInterface({ input, output });
|
|
123
122
|
const ask = async (q, def) => (await rl.question(c("cyan", ` ${q}${def ? c("gray", ` [${def}]`) : ""}: `))).trim() || def || "";
|
|
124
123
|
|
|
@@ -303,28 +302,6 @@ function randomToken(n) {
|
|
|
303
302
|
return randomBytes(Math.ceil(n / 2)).toString("hex").slice(0, n);
|
|
304
303
|
}
|
|
305
304
|
|
|
306
|
-
async function maybeUpdateNpm() {
|
|
307
|
-
if (args["skip-npm-update"] || process.env.MOP_AGENT_SKIP_NPM_UPDATE === "1") return;
|
|
308
|
-
const current = run("npm --version", { capture: true }).stdout.trim();
|
|
309
|
-
const latestResult = run("npm view npm version", { capture: true, allowFailure: true });
|
|
310
|
-
const latest = latestResult.stdout.trim();
|
|
311
|
-
if (!latest || latest === current) {
|
|
312
|
-
console.log(c("green", `✓ npm ${current || "unknown"} is current\n`));
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
const engineResult = run("npm view npm@latest engines.node", { capture: true, allowFailure: true });
|
|
316
|
-
const engine = engineResult.stdout.trim();
|
|
317
|
-
const rl = createInterface({ input, output });
|
|
318
|
-
const answer = (await rl.question(c("cyan", ` Update npm ${current} → ${latest}${engine ? ` (Node ${engine})` : ""}? [Y/n]: `))).trim().toLowerCase();
|
|
319
|
-
rl.close();
|
|
320
|
-
if (answer && !answer.startsWith("y")) {
|
|
321
|
-
console.log(c("gray", " npm update skipped.\n"));
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
run("npm install -g npm@latest", { privileged: true });
|
|
325
|
-
console.log(c("green", `✓ npm updated to ${latest}\n`));
|
|
326
|
-
}
|
|
327
|
-
|
|
328
305
|
function ensureRootServiceUser(os) {
|
|
329
306
|
const user = "mop-agent";
|
|
330
307
|
const create = os.family === "alpine"
|
|
@@ -340,11 +317,10 @@ async function tui() {
|
|
|
340
317
|
if (DRY) console.log(c("yellow", " Running in DRY-RUN (no changes).\n"));
|
|
341
318
|
const rl = createInterface({ input, output });
|
|
342
319
|
const menu = [
|
|
343
|
-
["1", "install", "Install
|
|
344
|
-
["2", "
|
|
320
|
+
["1", "install", "Install (dependencies + complete setup)"],
|
|
321
|
+
["2", "update", "Update MOP-AGENT + restart"],
|
|
345
322
|
["3", "status", "Show service health"],
|
|
346
|
-
["4", "
|
|
347
|
-
["5", "uninstall", "Remove service + nginx vhost"],
|
|
323
|
+
["4", "delete", "Delete service + nginx config"],
|
|
348
324
|
["q", "quit", "Exit"],
|
|
349
325
|
];
|
|
350
326
|
for (const [k, , desc] of menu) console.log(` ${c("cyan", k)} ${desc}`);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mop-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "mop-agent",
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.2",
|
|
10
10
|
"license": "UNLICENSED",
|
|
11
11
|
"workspaces": [
|
|
12
12
|
"packages/*",
|
package/package.json
CHANGED