@wagemule/daemon 0.1.7 → 0.1.8
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/main.cjs +38 -25
- package/dist/main.cjs.map +2 -2
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -3891,7 +3891,7 @@ var import_ws = __toESM(require("ws"));
|
|
|
3891
3891
|
// package.json
|
|
3892
3892
|
var package_default = {
|
|
3893
3893
|
name: "@wagemule/daemon",
|
|
3894
|
-
version: "0.1.
|
|
3894
|
+
version: "0.1.8",
|
|
3895
3895
|
private: false,
|
|
3896
3896
|
description: "Wage Mule local daemon for connecting local agent runtimes to Workspace Server.",
|
|
3897
3897
|
main: "./dist/main.cjs",
|
|
@@ -3987,30 +3987,7 @@ var ServerConnection = class {
|
|
|
3987
3987
|
ws.on("open", () => {
|
|
3988
3988
|
this.reconnectAttempt = 0;
|
|
3989
3989
|
this.log(`socket open url=${redactUrl(url)}`);
|
|
3990
|
-
this.
|
|
3991
|
-
type: "ready",
|
|
3992
|
-
capabilities: [
|
|
3993
|
-
"agent:start",
|
|
3994
|
-
"agent:stop",
|
|
3995
|
-
"agent:deliver",
|
|
3996
|
-
"agent:reset-workspace",
|
|
3997
|
-
"agent:diagnostic",
|
|
3998
|
-
"workspace:list",
|
|
3999
|
-
"workspace:read",
|
|
4000
|
-
"agent:skills:list",
|
|
4001
|
-
"machine:runtime_models:detect",
|
|
4002
|
-
"machine:workspace:scan",
|
|
4003
|
-
"machine:workspace:delete",
|
|
4004
|
-
"reminder-cache"
|
|
4005
|
-
],
|
|
4006
|
-
runtimes: supportedRuntimeIds,
|
|
4007
|
-
runningAgents: this.options.runningAgentsProvider?.() ?? [],
|
|
4008
|
-
wakeableAgents: this.options.wakeableAgentsProvider?.() ?? [],
|
|
4009
|
-
hostname: import_node_os6.default.hostname() || "local",
|
|
4010
|
-
name: this.options.name,
|
|
4011
|
-
os: `${process.platform}/${process.arch}`,
|
|
4012
|
-
daemonVersion: this.options.daemonVersion ?? package_default.version
|
|
4013
|
-
});
|
|
3990
|
+
void this.sendReady();
|
|
4014
3991
|
});
|
|
4015
3992
|
ws.on("message", (raw) => {
|
|
4016
3993
|
const msg = JSON.parse(String(raw));
|
|
@@ -4036,6 +4013,42 @@ var ServerConnection = class {
|
|
|
4036
4013
|
this.scheduleReconnect();
|
|
4037
4014
|
});
|
|
4038
4015
|
}
|
|
4016
|
+
async sendReady() {
|
|
4017
|
+
this.send({
|
|
4018
|
+
type: "ready",
|
|
4019
|
+
capabilities: [
|
|
4020
|
+
"agent:start",
|
|
4021
|
+
"agent:stop",
|
|
4022
|
+
"agent:deliver",
|
|
4023
|
+
"agent:reset-workspace",
|
|
4024
|
+
"agent:diagnostic",
|
|
4025
|
+
"workspace:list",
|
|
4026
|
+
"workspace:read",
|
|
4027
|
+
"agent:skills:list",
|
|
4028
|
+
"machine:runtime_models:detect",
|
|
4029
|
+
"machine:workspace:scan",
|
|
4030
|
+
"machine:workspace:delete",
|
|
4031
|
+
"reminder-cache"
|
|
4032
|
+
],
|
|
4033
|
+
runtimes: await this.detectAvailableRuntimes(),
|
|
4034
|
+
runningAgents: this.options.runningAgentsProvider?.() ?? [],
|
|
4035
|
+
wakeableAgents: this.options.wakeableAgentsProvider?.() ?? [],
|
|
4036
|
+
hostname: import_node_os6.default.hostname() || "local",
|
|
4037
|
+
name: this.options.name,
|
|
4038
|
+
os: `${process.platform}/${process.arch}`,
|
|
4039
|
+
daemonVersion: this.options.daemonVersion ?? package_default.version
|
|
4040
|
+
});
|
|
4041
|
+
}
|
|
4042
|
+
async detectAvailableRuntimes() {
|
|
4043
|
+
if (this.options.runtimesProvider) return this.options.runtimesProvider();
|
|
4044
|
+
try {
|
|
4045
|
+
const results = await doctorRuntimes(supportedRuntimeIds);
|
|
4046
|
+
return results.filter((result) => result.detected).map((result) => result.runtime);
|
|
4047
|
+
} catch (error) {
|
|
4048
|
+
this.log(`runtime detection failed ${error instanceof Error ? error.message : String(error)}`);
|
|
4049
|
+
return [];
|
|
4050
|
+
}
|
|
4051
|
+
}
|
|
4039
4052
|
scheduleReconnect() {
|
|
4040
4053
|
if (this.stopped || this.reconnectTimer) return;
|
|
4041
4054
|
const delay = this.nextReconnectDelayMs();
|