@remnic/cli 9.69.9 → 9.69.10
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/index.js +43 -0
- package/package.json +32 -32
package/dist/index.js
CHANGED
|
@@ -5707,6 +5707,7 @@ async function loadOpenclawManagedUpgradeModule(packageSpec, hooks = {}) {
|
|
|
5707
5707
|
|
|
5708
5708
|
// src/remote-daemon.ts
|
|
5709
5709
|
import fs24 from "fs";
|
|
5710
|
+
import { isLoopbackHost } from "@remnic/core/runtime/http-transport.js";
|
|
5710
5711
|
function readCompatEnv(primary, legacy) {
|
|
5711
5712
|
return process.env[primary] ?? process.env[legacy];
|
|
5712
5713
|
}
|
|
@@ -5806,6 +5807,25 @@ function resolveRemoteDaemon(configPath) {
|
|
|
5806
5807
|
const token = resolveOperatorToken(configPath);
|
|
5807
5808
|
return token ? { baseUrl, token } : { baseUrl };
|
|
5808
5809
|
}
|
|
5810
|
+
function resolveHostedOnlyDaemonRefusal(configPath) {
|
|
5811
|
+
const remoteUrl = resolveRemoteDaemonUrl(configPath);
|
|
5812
|
+
if (!remoteUrl) return void 0;
|
|
5813
|
+
let hostname;
|
|
5814
|
+
try {
|
|
5815
|
+
hostname = new URL(remoteUrl).hostname;
|
|
5816
|
+
} catch {
|
|
5817
|
+
return void 0;
|
|
5818
|
+
}
|
|
5819
|
+
if (isLoopbackHost(hostname)) return void 0;
|
|
5820
|
+
return { remoteUrl };
|
|
5821
|
+
}
|
|
5822
|
+
function hostedOnlyDaemonRefusalMessage(remoteUrl, action) {
|
|
5823
|
+
return [
|
|
5824
|
+
`Error: refusing to ${action} a local remnic-server: REMNIC_DAEMON_URL / server.url is set to the remote origin ${remoteUrl} (hosted-only mode).`,
|
|
5825
|
+
" Check the hosted daemon instead: remnic status",
|
|
5826
|
+
" To manage a local daemon, unset REMNIC_DAEMON_URL / ENGRAM_DAEMON_URL and remove server.url from the config."
|
|
5827
|
+
].join("\n");
|
|
5828
|
+
}
|
|
5809
5829
|
function isTransportError(err) {
|
|
5810
5830
|
return err instanceof Error && (err.message.includes("ECONNREFUSED") || err.message.includes("ECONNRESET") || err.message.includes("fetch failed") || err.message.includes("aborted") || err.message.includes("ENOTFOUND"));
|
|
5811
5831
|
}
|
|
@@ -15973,6 +15993,19 @@ function isServiceRunning() {
|
|
|
15973
15993
|
return { running: false };
|
|
15974
15994
|
}
|
|
15975
15995
|
async function daemonStatus() {
|
|
15996
|
+
const hostedOnly = resolveHostedOnlyDaemonRefusal(resolveConfigPath());
|
|
15997
|
+
if (hostedOnly) {
|
|
15998
|
+
const probe = await probeDaemonHealth(
|
|
15999
|
+
hostedOnly.remoteUrl,
|
|
16000
|
+
resolveOperatorToken(resolveConfigPath())
|
|
16001
|
+
);
|
|
16002
|
+
const remoteState = probe.ok ? "reachable" : `unreachable${probe.status ? ` (HTTP ${probe.status})` : probe.error ? ` (${probe.error})` : ""}`;
|
|
16003
|
+
console.log(`Remnic daemon status:`);
|
|
16004
|
+
console.log(` Mode: hosted-only (remote origin ${hostedOnly.remoteUrl})`);
|
|
16005
|
+
console.log(` Remote: ${remoteState}`);
|
|
16006
|
+
console.log(` Local: disabled \u2014 \`daemon start|install\` refuse while the remote origin is set`);
|
|
16007
|
+
return;
|
|
16008
|
+
}
|
|
15976
16009
|
const { running, pid } = isServiceRunning();
|
|
15977
16010
|
const port = inferPort();
|
|
15978
16011
|
const serviceInstalled = isMacOS() ? anyFileExists(LAUNCHD_PLIST_PATHS) : isLinux() ? anyFileExists(SYSTEMD_UNIT_PATHS) : false;
|
|
@@ -16003,6 +16036,13 @@ async function daemonStatus() {
|
|
|
16003
16036
|
console.log(` Memory extensions: unknown (config error)`);
|
|
16004
16037
|
}
|
|
16005
16038
|
}
|
|
16039
|
+
function refuseLocalDaemonIfHostedOnly(action) {
|
|
16040
|
+
const refusal = resolveHostedOnlyDaemonRefusal(resolveConfigPath());
|
|
16041
|
+
if (refusal) {
|
|
16042
|
+
console.error(hostedOnlyDaemonRefusalMessage(refusal.remoteUrl, action));
|
|
16043
|
+
process.exit(1);
|
|
16044
|
+
}
|
|
16045
|
+
}
|
|
16006
16046
|
function daemonStart() {
|
|
16007
16047
|
const svc = isServiceRunning();
|
|
16008
16048
|
if (svc.running) {
|
|
@@ -17171,6 +17211,9 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
17171
17211
|
break;
|
|
17172
17212
|
case "daemon": {
|
|
17173
17213
|
const action = rest[0];
|
|
17214
|
+
if (action === "start" || action === "install" || action === "restart") {
|
|
17215
|
+
refuseLocalDaemonIfHostedOnly(action);
|
|
17216
|
+
}
|
|
17174
17217
|
switch (action) {
|
|
17175
17218
|
case "start":
|
|
17176
17219
|
daemonStart();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/cli",
|
|
3
|
-
"version": "9.69.
|
|
3
|
+
"version": "9.69.10",
|
|
4
4
|
"description": "CLI for Remnic memory — init, query, doctor, daemon management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,26 +26,26 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"yaml": "^2.4.2",
|
|
29
|
-
"@remnic/
|
|
30
|
-
"@remnic/
|
|
31
|
-
"@remnic/
|
|
29
|
+
"@remnic/core": "^9.69.10",
|
|
30
|
+
"@remnic/plugin-pi": "^9.69.10",
|
|
31
|
+
"@remnic/server": "^9.69.10"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@remnic/bench": "^9.69.
|
|
35
|
-
"@remnic/plugin-openclaw": "^9.69.
|
|
36
|
-
"@remnic/export-weclone": "^9.69.
|
|
37
|
-
"@remnic/import-weclone": "^9.69.
|
|
38
|
-
"@remnic/import-chatgpt": "^9.69.
|
|
39
|
-
"@remnic/import-claude": "^9.69.
|
|
40
|
-
"@remnic/import-gemini": "^9.69.
|
|
41
|
-
"@remnic/import-lossless-claw": "^9.69.
|
|
42
|
-
"@remnic/import-mem0": "^9.69.
|
|
43
|
-
"@remnic/import-supermemory": "^9.69.
|
|
44
|
-
"@remnic/import-okf": "^9.69.
|
|
45
|
-
"@remnic/connector-limitless": "^9.69.
|
|
46
|
-
"@remnic/connector-bee": "^9.69.
|
|
47
|
-
"@remnic/connector-omi": "^9.69.
|
|
48
|
-
"@remnic/capture-audio": "^9.69.
|
|
34
|
+
"@remnic/bench": "^9.69.10",
|
|
35
|
+
"@remnic/plugin-openclaw": "^9.69.10",
|
|
36
|
+
"@remnic/export-weclone": "^9.69.10",
|
|
37
|
+
"@remnic/import-weclone": "^9.69.10",
|
|
38
|
+
"@remnic/import-chatgpt": "^9.69.10",
|
|
39
|
+
"@remnic/import-claude": "^9.69.10",
|
|
40
|
+
"@remnic/import-gemini": "^9.69.10",
|
|
41
|
+
"@remnic/import-lossless-claw": "^9.69.10",
|
|
42
|
+
"@remnic/import-mem0": "^9.69.10",
|
|
43
|
+
"@remnic/import-supermemory": "^9.69.10",
|
|
44
|
+
"@remnic/import-okf": "^9.69.10",
|
|
45
|
+
"@remnic/connector-limitless": "^9.69.10",
|
|
46
|
+
"@remnic/connector-bee": "^9.69.10",
|
|
47
|
+
"@remnic/connector-omi": "^9.69.10",
|
|
48
|
+
"@remnic/capture-audio": "^9.69.10"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"@remnic/bench": {
|
|
@@ -97,19 +97,19 @@
|
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"tsup": "^8.5.1",
|
|
99
99
|
"typescript": "^5.9.3",
|
|
100
|
-
"@remnic/bench": "9.69.
|
|
101
|
-
"@remnic/plugin-openclaw": "9.69.
|
|
102
|
-
"@remnic/export-weclone": "9.69.
|
|
103
|
-
"@remnic/import-
|
|
104
|
-
"@remnic/import-
|
|
105
|
-
"@remnic/import-
|
|
106
|
-
"@remnic/import-
|
|
107
|
-
"@remnic/import-
|
|
108
|
-
"@remnic/import-mem0": "9.69.
|
|
109
|
-
"@remnic/import-supermemory": "9.69.
|
|
110
|
-
"@remnic/connector-limitless": "9.69.
|
|
111
|
-
"@remnic/connector-bee": "9.69.
|
|
112
|
-
"@remnic/connector-omi": "9.69.
|
|
100
|
+
"@remnic/bench": "9.69.10",
|
|
101
|
+
"@remnic/plugin-openclaw": "9.69.10",
|
|
102
|
+
"@remnic/export-weclone": "9.69.10",
|
|
103
|
+
"@remnic/import-weclone": "9.69.10",
|
|
104
|
+
"@remnic/import-chatgpt": "9.69.10",
|
|
105
|
+
"@remnic/import-claude": "9.69.10",
|
|
106
|
+
"@remnic/import-gemini": "9.69.10",
|
|
107
|
+
"@remnic/import-lossless-claw": "9.69.10",
|
|
108
|
+
"@remnic/import-mem0": "9.69.10",
|
|
109
|
+
"@remnic/import-supermemory": "9.69.10",
|
|
110
|
+
"@remnic/connector-limitless": "9.69.10",
|
|
111
|
+
"@remnic/connector-bee": "9.69.10",
|
|
112
|
+
"@remnic/connector-omi": "9.69.10"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
115
|
"repository": {
|