@task-handoff/server 0.0.3-alpha.3 → 0.0.3-alpha.4
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.
|
@@ -94,6 +94,11 @@ if ! command -v node >/dev/null 2>&1; then
|
|
|
94
94
|
echo "node is required for this installer." >&2
|
|
95
95
|
exit 1
|
|
96
96
|
fi
|
|
97
|
+
if ! command -v npm >/dev/null 2>&1; then
|
|
98
|
+
echo "npm is required for managed updates." >&2
|
|
99
|
+
exit 1
|
|
100
|
+
fi
|
|
101
|
+
NPM_COMMAND="$(command -v npm)"
|
|
97
102
|
|
|
98
103
|
resolve_command() {
|
|
99
104
|
candidate="$1"
|
|
@@ -171,6 +176,7 @@ assert_service_command_accessible() {
|
|
|
171
176
|
assert_service_command_accessible "$CONTROL_PLANE_COMMAND" "Control-plane command"
|
|
172
177
|
assert_service_command_accessible "$NODE_AGENT_COMMAND" "Node-agent command"
|
|
173
178
|
assert_service_command_accessible "$CONTROLLED_INSTANCE_COMMAND" "Controlled-instance command"
|
|
179
|
+
assert_service_command_accessible "$NPM_COMMAND" "npm command"
|
|
174
180
|
|
|
175
181
|
mkdir -p "$ENV_DIR" "$CONTROL_PLANE_DATA_DIR" "$NODE_AGENT_DATA_DIR"
|
|
176
182
|
chown -R "$SERVICE_USER":"$SERVICE_USER" "$CONTROL_PLANE_DATA_DIR" "$NODE_AGENT_DATA_DIR" 2>/dev/null || true
|
|
@@ -183,6 +189,7 @@ TASK_HANDOFF_NODE_AGENT_CONNECTION_MODE=local-ipc
|
|
|
183
189
|
TASK_HANDOFF_NODE_AGENT_IPC_PATH=$NODE_AGENT_IPC_PATH
|
|
184
190
|
TASK_HANDOFF_NODE_AGENT_CONTAINER_URL=http://host.docker.internal:$NODE_AGENT_PORT
|
|
185
191
|
TASK_HANDOFF_LOCAL_CONTROLLED_COMMAND=$CONTROLLED_INSTANCE_COMMAND
|
|
192
|
+
TASK_HANDOFF_NPM_COMMAND=$NPM_COMMAND
|
|
186
193
|
EOF
|
|
187
194
|
chmod 0640 "$ENV_DIR/node-agent.env"
|
|
188
195
|
|
package/bin/task-handoff-server
CHANGED
|
@@ -7,6 +7,7 @@ const { spawnSync } = require("node:child_process");
|
|
|
7
7
|
|
|
8
8
|
const packageRoot = path.resolve(__dirname, "..");
|
|
9
9
|
const manifest = JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8"));
|
|
10
|
+
const npmCommand = process.env.TASK_HANDOFF_NPM_COMMAND || "npm";
|
|
10
11
|
|
|
11
12
|
function usage() {
|
|
12
13
|
console.log(`Usage: task-handoff-server <command> [options]
|
|
@@ -87,7 +88,7 @@ function systemctlState(service) {
|
|
|
87
88
|
function npmVersion(target, registry) {
|
|
88
89
|
const args = ["view", `@task-handoff/server@${target}`, "version", "--json"];
|
|
89
90
|
if (registry) args.push("--registry", registry);
|
|
90
|
-
const value = JSON.parse(run(
|
|
91
|
+
const value = JSON.parse(run(npmCommand, args));
|
|
91
92
|
if (typeof value !== "string") throw new Error(`npm target ${target} did not resolve to one version.`);
|
|
92
93
|
return value;
|
|
93
94
|
}
|
|
@@ -204,7 +205,7 @@ async function main() {
|
|
|
204
205
|
console.log(`Updating @task-handoff/server ${manifest.version} -> ${targetVersion}`);
|
|
205
206
|
const npmArgs = ["install", "--global", "--prefix", prefix, `@task-handoff/server@${targetVersion}`];
|
|
206
207
|
if (registry) npmArgs.push("--registry", registry);
|
|
207
|
-
run(
|
|
208
|
+
run(npmCommand, npmArgs, { stdio: "inherit" });
|
|
208
209
|
run(path.join(prefix, "bin", "task-handoff-install-server"), installOptions, { stdio: "inherit" });
|
|
209
210
|
run("systemctl", ["restart", "task-handoff-node-agent.service"]);
|
|
210
211
|
waitForSocket(nodeSocket);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@task-handoff/server",
|
|
3
|
-
"version": "0.0.3-alpha.
|
|
3
|
+
"version": "0.0.3-alpha.4",
|
|
4
4
|
"description": "Complete TaskHandoff server package.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"node": ">=22.22.2"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@task-handoff/control-plane": "0.0.3-alpha.
|
|
21
|
-
"@task-handoff/node-agent": "0.0.3-alpha.
|
|
22
|
-
"@task-handoff/controlled-instance": "0.0.3-alpha.
|
|
20
|
+
"@task-handoff/control-plane": "0.0.3-alpha.4",
|
|
21
|
+
"@task-handoff/node-agent": "0.0.3-alpha.4",
|
|
22
|
+
"@task-handoff/controlled-instance": "0.0.3-alpha.4"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|