@agentvault/secure-channel 0.6.5 → 0.6.6
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.js +55 -12
- package/dist/cli.js.map +3 -3
- package/dist/setup.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -45776,10 +45776,11 @@ var SecureChannel = class extends EventEmitter {
|
|
|
45776
45776
|
|
|
45777
45777
|
// src/cli.ts
|
|
45778
45778
|
import { resolve as resolve2 } from "node:path";
|
|
45779
|
-
import { createInterface } from "node:readline";
|
|
45779
|
+
import { createInterface as createInterface2 } from "node:readline";
|
|
45780
45780
|
|
|
45781
45781
|
// src/setup.ts
|
|
45782
|
-
import { execSync } from "node:child_process";
|
|
45782
|
+
import { execSync, spawnSync } from "node:child_process";
|
|
45783
|
+
import * as readline from "node:readline";
|
|
45783
45784
|
import { resolve } from "node:path";
|
|
45784
45785
|
async function runSetupCommand(options) {
|
|
45785
45786
|
const { token: token2, name: name2, apiUrl: apiUrl2 } = options;
|
|
@@ -45875,16 +45876,8 @@ async function runSetupCommand(options) {
|
|
|
45875
45876
|
}
|
|
45876
45877
|
if (configPatched) {
|
|
45877
45878
|
console.log(` \u2705 Channel registered in OpenClaw config.
|
|
45878
|
-
|
|
45879
|
-
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
45880
|
-
Restart OpenClaw to activate the secure channel:
|
|
45881
|
-
|
|
45882
|
-
openclaw gateway restart
|
|
45883
|
-
|
|
45884
|
-
After restart, your AgentVault UI will route
|
|
45885
|
-
encrypted messages directly into your agent.
|
|
45886
|
-
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
45887
45879
|
`);
|
|
45880
|
+
await promptAndRestart(env);
|
|
45888
45881
|
} else {
|
|
45889
45882
|
console.log(` \u26A0\uFE0F Could not auto-configure OpenClaw (is 'openclaw' in your PATH?).
|
|
45890
45883
|
Add this to your OpenClaw config (openclaw.yaml or openclaw.json) manually:
|
|
@@ -45900,6 +45893,56 @@ async function runSetupCommand(options) {
|
|
|
45900
45893
|
`);
|
|
45901
45894
|
}
|
|
45902
45895
|
}
|
|
45896
|
+
async function promptAndRestart(env) {
|
|
45897
|
+
const answer = await ask(
|
|
45898
|
+
" \u26A0\uFE0F OpenClaw gateway will restart, briefly interrupting any active conversations.\n Restart now? [y/N] "
|
|
45899
|
+
);
|
|
45900
|
+
if (answer.trim().toLowerCase() === "y") {
|
|
45901
|
+
console.log("\n Restarting OpenClaw gateway...");
|
|
45902
|
+
const result = spawnSync("openclaw", ["gateway", "restart"], {
|
|
45903
|
+
stdio: "inherit",
|
|
45904
|
+
env
|
|
45905
|
+
});
|
|
45906
|
+
if (result.status === 0) {
|
|
45907
|
+
console.log(`
|
|
45908
|
+
\u2705 Gateway restarted. AgentVault is now active.
|
|
45909
|
+
Your AgentVault UI will route encrypted messages
|
|
45910
|
+
directly into your agent.
|
|
45911
|
+
`);
|
|
45912
|
+
} else {
|
|
45913
|
+
console.log(`
|
|
45914
|
+
\u26A0\uFE0F Restart command failed (exit ${result.status ?? "unknown"}).
|
|
45915
|
+
Please restart manually:
|
|
45916
|
+
|
|
45917
|
+
openclaw gateway restart
|
|
45918
|
+
`);
|
|
45919
|
+
}
|
|
45920
|
+
} else {
|
|
45921
|
+
console.log(`
|
|
45922
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
45923
|
+
Run this when you're ready to activate:
|
|
45924
|
+
|
|
45925
|
+
openclaw gateway restart
|
|
45926
|
+
|
|
45927
|
+
After restart, your AgentVault UI will route
|
|
45928
|
+
encrypted messages directly into your agent.
|
|
45929
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
45930
|
+
`);
|
|
45931
|
+
}
|
|
45932
|
+
}
|
|
45933
|
+
function ask(question) {
|
|
45934
|
+
return new Promise((resolve3) => {
|
|
45935
|
+
const rl2 = readline.createInterface({
|
|
45936
|
+
input: process.stdin,
|
|
45937
|
+
output: process.stdout,
|
|
45938
|
+
terminal: true
|
|
45939
|
+
});
|
|
45940
|
+
rl2.question(question, (answer) => {
|
|
45941
|
+
rl2.close();
|
|
45942
|
+
resolve3(answer);
|
|
45943
|
+
});
|
|
45944
|
+
});
|
|
45945
|
+
}
|
|
45903
45946
|
|
|
45904
45947
|
// src/cli.ts
|
|
45905
45948
|
var _notifier = null;
|
|
@@ -46048,7 +46091,7 @@ console.log(`
|
|
|
46048
46091
|
Keep this process running to receive messages${noNotifications ? "." : " and notifications."}
|
|
46049
46092
|
`);
|
|
46050
46093
|
await channel.start();
|
|
46051
|
-
var rl =
|
|
46094
|
+
var rl = createInterface2({
|
|
46052
46095
|
input: process.stdin,
|
|
46053
46096
|
output: process.stdout,
|
|
46054
46097
|
prompt: "> "
|