@themoltnet/agent-daemon 0.46.1 → 0.48.0

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.js CHANGED
@@ -89,6 +89,18 @@ initInstrumentation({
89
89
  pg: false
90
90
  });
91
91
  //#endregion
92
+ //#region src/lib/supervisor-parent-guard.ts
93
+ /** Exit a supervised run when its serve parent's IPC channel disappears. */
94
+ function installSupervisorParentGuard(proc = process) {
95
+ if (proc.env["MOLTNET_SUPERVISED_RUN"] !== "1" || typeof proc.disconnect !== "function") return false;
96
+ if (proc.connected === false) {
97
+ proc.kill(proc.pid, "SIGTERM");
98
+ return true;
99
+ }
100
+ proc.once("disconnect", () => proc.kill(proc.pid, "SIGTERM"));
101
+ return true;
102
+ }
103
+ //#endregion
92
104
  //#region src/runtime-loader.ts
93
105
  function extractRuntimeModule(argv) {
94
106
  const remaining = [];
@@ -154,6 +166,7 @@ function isDaemonRuntimeAdapter(value) {
154
166
  }
155
167
  //#endregion
156
168
  //#region src/main.ts
169
+ installSupervisorParentGuard();
157
170
  async function main() {
158
171
  const selection = extractRuntimeModule(process.argv.slice(2));
159
172
  return runAgentDaemonCli({
package/dist/pi.js CHANGED
@@ -7,7 +7,7 @@ import { Value } from "typebox/value";
7
7
  import { GONDOLIN_BASE_EXECUTABLES, GONDOLIN_TOOL_NAMES, MOLTNET_TOOL_NAMES, agentSigningCapability, buildPiExecutorManifest, createPiTaskExecutor, defineGondolinTemplate, definePiRuntime } from "@themoltnet/pi-runtime";
8
8
  import { createHash } from "node:crypto";
9
9
  import * as ed from "@noble/ed25519";
10
- import { createHash as createHash$1, randomBytes } from "crypto";
10
+ import { createHash as createHash$1, randomBytes as randomBytes$1 } from "crypto";
11
11
  import "multiformats/codecs/raw";
12
12
  import "multiformats/hashes/digest";
13
13
  import "@noble/hashes/sha2";
@@ -134,7 +134,7 @@ var cryptoService = {
134
134
  return this.verify(signedMessage.message, signedMessage.signature, signedMessage.publicKey);
135
135
  },
136
136
  generateChallenge() {
137
- return `moltnet:challenge:${randomBytes(32).toString("hex")}:${Date.now()}`;
137
+ return `moltnet:challenge:${randomBytes$1(32).toString("hex")}:${Date.now()}`;
138
138
  },
139
139
  async derivePublicKey(privateKeyBase64) {
140
140
  const privateKeyBytes = new Uint8Array(Buffer.from(privateKeyBase64, "base64"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/agent-daemon",
3
- "version": "0.46.1",
3
+ "version": "0.48.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "description": "Universal MoltNet agent daemon host with a built-in Pi/Gondolin runtime and support for trusted operator-owned runtime modules. CLI: moltnet-agent.",
@@ -48,9 +48,11 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@earendil-works/gondolin": "^0.12.0",
51
- "@earendil-works/pi-ai": "0.79.4",
52
- "@earendil-works/pi-coding-agent": "0.79.4",
51
+ "@earendil-works/pi-coding-agent": "0.84.4",
52
+ "@fastify/cors": "^11.0.0",
53
+ "@fastify/helmet": "^13.0.1",
53
54
  "@fastify/otel": "^0.18.0",
55
+ "@fastify/rate-limit": "^10.2.1",
54
56
  "@ipld/dag-cbor": "^9.2.5",
55
57
  "@noble/ciphers": "^1.2.0",
56
58
  "@noble/curves": "^2.0.0",
@@ -72,31 +74,36 @@
72
74
  "@opentelemetry/sdk-trace-base": "^2.5.1",
73
75
  "@opentelemetry/sdk-trace-node": "^2.5.1",
74
76
  "@opentelemetry/semantic-conventions": "^1.39.0",
77
+ "fastify": "^5.8.5",
75
78
  "fastify-plugin": "^5.1.0",
76
79
  "multiformats": "^13.3.0",
77
80
  "pino": "^10.3.1",
78
81
  "pino-opentelemetry-transport": "^3.0.0",
79
82
  "pino-pretty": "^13.1.3",
83
+ "proper-lockfile": "4.1.2",
80
84
  "typebox": "^1.2.8",
81
- "@themoltnet/agent-runtime": "0.45.1",
82
- "@themoltnet/sdk": "0.139.0",
83
85
  "@themoltnet/os-keyring": "0.3.0",
84
- "@themoltnet/pi-runtime": "0.13.1"
86
+ "@themoltnet/sdk": "0.140.0",
87
+ "@themoltnet/pi-runtime": "0.14.0",
88
+ "@themoltnet/agent-runtime": "0.45.2"
85
89
  },
86
90
  "devDependencies": {
91
+ "@types/proper-lockfile": "^4.1.4",
87
92
  "tsx": "^4.7.0",
88
93
  "typescript": "~5.9.2",
89
94
  "vite": "^8.0.0",
90
95
  "vite-plugin-dts": "^4.5.4",
91
96
  "vitest": "^3.0.0",
92
- "@moltnet/crypto-service": "0.1.0",
97
+ "@moltnet/agent-eval": "0.1.0",
93
98
  "@moltnet/bootstrap": "0.1.0",
99
+ "@moltnet/crypto-service": "0.1.0",
94
100
  "@moltnet/execution-integrations": "0.1.0",
95
- "@moltnet/models": "0.1.0",
96
101
  "@moltnet/execution-plan": "0.1.0",
97
- "@moltnet/observability": "0.1.0",
102
+ "@moltnet/loopback-companion": "0.1.0",
103
+ "@moltnet/models": "0.1.0",
104
+ "@moltnet/tasks": "0.1.0",
98
105
  "@moltnet/runtime-profiles": "0.1.0",
99
- "@moltnet/tasks": "0.1.0"
106
+ "@moltnet/observability": "0.1.0"
100
107
  },
101
108
  "nx": {
102
109
  "projectType": "application",
@@ -105,7 +112,19 @@
105
112
  "scope:agent",
106
113
  "platform:cli"
107
114
  ],
108
- "targets": {}
115
+ "targets": {
116
+ "bundle": {
117
+ "executor": "nx:run-commands",
118
+ "cache": false,
119
+ "dependsOn": [
120
+ "build"
121
+ ],
122
+ "options": {
123
+ "cwd": "{workspaceRoot}",
124
+ "command": "node tools/release/agent-bundle/build.mjs --skip-daemon-build --out dist/agent-bundle"
125
+ }
126
+ }
127
+ }
109
128
  },
110
129
  "scripts": {
111
130
  "cli": "tsx src/main.ts",