wattetheria 0.3.9 → 0.4.1
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/.env.release +4 -2
- package/README.md +246 -938
- package/docker-compose.release.yml +3 -1
- package/lib/cli.js +131 -2
- package/package.json +1 -1
|
@@ -115,7 +115,8 @@ services:
|
|
|
115
115
|
WATTSWARM_UDP_ANNOUNCE_ADDR: ${WATTSWARM_UDP_ANNOUNCE_ADDR:-239.255.42.99}
|
|
116
116
|
WATTSWARM_UDP_ANNOUNCE_PORT: ${WATTSWARM_UDP_ANNOUNCE_PORT:-37931}
|
|
117
117
|
WATTSWARM_IROH_RELAY_URLS: ${WATTSWARM_IROH_RELAY_URLS:-https://relay.wattetheria.com}
|
|
118
|
-
|
|
118
|
+
WATTSWARM_IROH_BIND_ADDR: ${WATTSWARM_IROH_BIND_ADDR:-0.0.0.0:4002}
|
|
119
|
+
WATTSWARM_IROH_PUBLISH_DIRECT_ADDRS: ${WATTSWARM_IROH_PUBLISH_DIRECT_ADDRS:-false}
|
|
119
120
|
WATTSWARM_IROH_DATA_PLANE_START_TIMEOUT_MS: ${WATTSWARM_IROH_DATA_PLANE_START_TIMEOUT_MS:-120000}
|
|
120
121
|
WATTSWARM_PUBLIC_BOOTSTRAP_URLS: ${WATTSWARM_PUBLIC_BOOTSTRAP_URLS:-}
|
|
121
122
|
WATTSWARM_PUBLIC_BOOTSTRAP_CONTACTS: ${WATTSWARM_PUBLIC_BOOTSTRAP_CONTACTS:-}
|
|
@@ -129,6 +130,7 @@ services:
|
|
|
129
130
|
- "${WATTSWARM_UI_BIND_HOST:-127.0.0.1}:${WATTSWARM_UI_PORT:-7788}:7788"
|
|
130
131
|
- "${WATTSWARM_SYNC_GRPC_BIND_HOST:-127.0.0.1}:${WATTSWARM_SYNC_GRPC_PORT:-7791}:7791"
|
|
131
132
|
- "${WATTSWARM_P2P_HOST_PORT:-4001}:${WATTSWARM_P2P_PORT:-4001}"
|
|
133
|
+
- "${WATTSWARM_IROH_HOST_PORT:-4002}:4002/udp"
|
|
132
134
|
- "${WATTSWARM_UDP_ANNOUNCE_HOST_PORT:-37931}:${WATTSWARM_UDP_ANNOUNCE_PORT:-37931}/udp"
|
|
133
135
|
networks:
|
|
134
136
|
- watt-internal
|
package/lib/cli.js
CHANGED
|
@@ -37,6 +37,7 @@ const NATIVE_ARCH_ALIASES = new Map([
|
|
|
37
37
|
]);
|
|
38
38
|
const BANNER_COMMANDS = new Set([
|
|
39
39
|
"help",
|
|
40
|
+
"setup",
|
|
40
41
|
"install",
|
|
41
42
|
"start",
|
|
42
43
|
"up",
|
|
@@ -55,11 +56,13 @@ function printHelp() {
|
|
|
55
56
|
|
|
56
57
|
Usage:
|
|
57
58
|
npx wattetheria [command] [options]
|
|
59
|
+
npx wattetheria setup
|
|
58
60
|
npx wattetheria install
|
|
59
61
|
|
|
60
62
|
Commands:
|
|
61
63
|
version Show Wattetheria release version
|
|
62
64
|
images Show configured release images
|
|
65
|
+
setup Install the local stack and finish first-time runtime/MCP setup
|
|
63
66
|
install Prepare deployment, pull images, and start the stack
|
|
64
67
|
start Start an existing deployment
|
|
65
68
|
status Show docker compose status
|
|
@@ -1025,8 +1028,67 @@ function printSummary(options) {
|
|
|
1025
1028
|
console.log(`Deploy dir: ${options.dir}`);
|
|
1026
1029
|
}
|
|
1027
1030
|
|
|
1028
|
-
|
|
1029
|
-
|
|
1031
|
+
function supervisionUrl(options) {
|
|
1032
|
+
const envMap = readEnvFile(envFilePath(options));
|
|
1033
|
+
const kernelHost = getEnvValue(envMap, "WATTETHERIA_CONTROL_PLANE_BIND_HOST", "127.0.0.1");
|
|
1034
|
+
const kernelPort = getEnvValue(envMap, "WATTETHERIA_CONTROL_PLANE_PORT", "7777");
|
|
1035
|
+
return `http://${kernelHost}:${kernelPort}/supervision`;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
function mcpServerConfigSnippet(options) {
|
|
1039
|
+
const args = ["wattetheria", "mcp-proxy"];
|
|
1040
|
+
if (path.resolve(options.dir) !== path.resolve(DEFAULT_DEPLOY_DIR)) {
|
|
1041
|
+
args.push("--dir", options.dir);
|
|
1042
|
+
}
|
|
1043
|
+
return JSON.stringify({
|
|
1044
|
+
mcpServers: {
|
|
1045
|
+
wattetheria: {
|
|
1046
|
+
command: "npx",
|
|
1047
|
+
args
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}, null, 2);
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
function printSetupHint() {
|
|
1054
|
+
console.log("");
|
|
1055
|
+
console.log("To finish first-time setup, run:");
|
|
1056
|
+
console.log(" npx wattetheria setup");
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
function printManualSetupChecklist(options) {
|
|
1060
|
+
console.log("");
|
|
1061
|
+
console.log("Finish setup:");
|
|
1062
|
+
console.log("1. Open Supervision and configure the runtime:");
|
|
1063
|
+
console.log(` ${supervisionUrl(options)}`);
|
|
1064
|
+
console.log("");
|
|
1065
|
+
console.log("2. Add Wattetheria MCP to your agent runtime:");
|
|
1066
|
+
console.log(mcpServerConfigSnippet(options));
|
|
1067
|
+
console.log("");
|
|
1068
|
+
console.log("3. Restart Wattetheria so runtime and MCP config take effect:");
|
|
1069
|
+
console.log(" npx wattetheria restart");
|
|
1070
|
+
console.log("");
|
|
1071
|
+
console.log("4. Verify MCP access from the agent runtime:");
|
|
1072
|
+
console.log(" - list Wattetheria MCP tools");
|
|
1073
|
+
console.log(" - call one read-only Wattetheria MCP tool");
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
async function waitForEnter(message) {
|
|
1077
|
+
const rl = createInterface({
|
|
1078
|
+
input: process.stdin,
|
|
1079
|
+
output: process.stdout
|
|
1080
|
+
});
|
|
1081
|
+
try {
|
|
1082
|
+
await rl.question(message);
|
|
1083
|
+
} finally {
|
|
1084
|
+
rl.close();
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
async function install(options, behavior = {}) {
|
|
1089
|
+
if (!behavior.dockerAlreadyChecked) {
|
|
1090
|
+
await ensureDockerAvailable({ interactive: true });
|
|
1091
|
+
}
|
|
1030
1092
|
ensureDeploymentAssets(options);
|
|
1031
1093
|
if (options.tag) {
|
|
1032
1094
|
console.log(`Pinning release images to requested tag ${options.tag}.`);
|
|
@@ -1042,6 +1104,70 @@ async function install(options) {
|
|
|
1042
1104
|
await runHealthChecks(options);
|
|
1043
1105
|
}
|
|
1044
1106
|
printSummary(options);
|
|
1107
|
+
if (!behavior.suppressSetupHint) {
|
|
1108
|
+
printSetupHint();
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
async function setup(options) {
|
|
1113
|
+
console.log("Checking Docker runtime...");
|
|
1114
|
+
const dockerStatus = getDockerStatus();
|
|
1115
|
+
if (!dockerStatus.ready) {
|
|
1116
|
+
throw new Error([
|
|
1117
|
+
formatDockerStatusMessage(dockerStatus),
|
|
1118
|
+
"",
|
|
1119
|
+
"Install Docker, start it, then rerun:",
|
|
1120
|
+
" npx wattetheria setup"
|
|
1121
|
+
].join("\n"));
|
|
1122
|
+
}
|
|
1123
|
+
console.log("[ok] Docker runtime is ready.");
|
|
1124
|
+
|
|
1125
|
+
console.log("");
|
|
1126
|
+
console.log("[1/5] Install Wattetheria");
|
|
1127
|
+
const deployment = deploymentState(options.dir);
|
|
1128
|
+
if (deployment.runnable) {
|
|
1129
|
+
console.log("Deployment already initialized. Starting existing stack...");
|
|
1130
|
+
await start(options);
|
|
1131
|
+
} else {
|
|
1132
|
+
await install(options, {
|
|
1133
|
+
dockerAlreadyChecked: true,
|
|
1134
|
+
suppressSetupHint: true
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
if (!isInteractiveTerminal()) {
|
|
1139
|
+
printManualSetupChecklist(options);
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
const url = supervisionUrl(options);
|
|
1144
|
+
console.log("");
|
|
1145
|
+
console.log("[2/5] Configure runtime");
|
|
1146
|
+
console.log(`Open: ${url}`);
|
|
1147
|
+
const opened = openUrl(url);
|
|
1148
|
+
if (!opened) {
|
|
1149
|
+
console.log("Open the URL above in your browser.");
|
|
1150
|
+
}
|
|
1151
|
+
await waitForEnter("After saving runtime config, press Enter to continue.");
|
|
1152
|
+
|
|
1153
|
+
console.log("");
|
|
1154
|
+
console.log("[3/5] Install MCP in your agent runtime");
|
|
1155
|
+
console.log(mcpServerConfigSnippet(options));
|
|
1156
|
+
await waitForEnter("After saving MCP config, press Enter to continue.");
|
|
1157
|
+
|
|
1158
|
+
console.log("");
|
|
1159
|
+
console.log("[4/5] Restart Wattetheria");
|
|
1160
|
+
await restart(options);
|
|
1161
|
+
|
|
1162
|
+
console.log("");
|
|
1163
|
+
console.log("[5/5] Verify MCP access");
|
|
1164
|
+
console.log("From the agent runtime:");
|
|
1165
|
+
console.log("- list Wattetheria MCP tools");
|
|
1166
|
+
console.log("- call one read-only Wattetheria MCP tool");
|
|
1167
|
+
await waitForEnter("After verifying MCP access, press Enter to finish.");
|
|
1168
|
+
|
|
1169
|
+
console.log("");
|
|
1170
|
+
console.log("Setup complete.");
|
|
1045
1171
|
}
|
|
1046
1172
|
|
|
1047
1173
|
async function start(options) {
|
|
@@ -1681,6 +1807,9 @@ async function run(argv) {
|
|
|
1681
1807
|
case "images":
|
|
1682
1808
|
printImages(options);
|
|
1683
1809
|
return;
|
|
1810
|
+
case "setup":
|
|
1811
|
+
await setup(options);
|
|
1812
|
+
return;
|
|
1684
1813
|
case "install":
|
|
1685
1814
|
await install(options);
|
|
1686
1815
|
return;
|