@themoltnet/pi-runtime 0.10.0 → 0.10.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/dist/index.js +7 -43
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -7,17 +7,8 @@ import { Type } from "@earendil-works/pi-ai";
|
|
|
7
7
|
import { AuthStorage, DEFAULT_MAX_BYTES, DefaultResourceLoader, ModelRegistry, SessionManager, createAgentSession, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLsToolDefinition, createReadToolDefinition, createSyntheticSourceInfo, createWriteToolDefinition, defineTool, formatSize, parseFrontmatter, truncateHead, truncateLine } from "@earendil-works/pi-coding-agent";
|
|
8
8
|
import { SpanStatusCode, context, metrics, trace } from "@opentelemetry/api";
|
|
9
9
|
import { CID } from "multiformats/cid";
|
|
10
|
-
import "multiformats/codecs/raw";
|
|
11
|
-
import "multiformats/hashes/digest";
|
|
12
|
-
import { sha256 } from "multiformats/hashes/sha2";
|
|
13
|
-
import "@noble/hashes/sha2";
|
|
14
|
-
import "multiformats/bases/base32";
|
|
15
|
-
import "@noble/curves/ed25519.js";
|
|
16
|
-
import * as ed from "@noble/ed25519";
|
|
17
|
-
import { createHash } from "crypto";
|
|
18
|
-
import { createHash as createHash$1 } from "node:crypto";
|
|
19
10
|
import * as json from "multiformats/codecs/json";
|
|
20
|
-
import "
|
|
11
|
+
import { sha256 } from "multiformats/hashes/sha2";
|
|
21
12
|
import { FREEFORM_TYPE, SUBMIT_OUTPUT_GATE_ID, TaskContext, buildTaskUserPrompt, getSubmitOutputContract, materializeTaskOutput, mergeRuntimeProfileContext, resolveTaskContext, taskTypeUsesSubagents, traceRuntimePhase, validateTaskOutput, validateTaskSubmission } from "@themoltnet/agent-runtime";
|
|
22
13
|
import { connect } from "@themoltnet/sdk/node";
|
|
23
14
|
import { ShellCommandAnalyzer } from "@themoltnet/shell-command-analyzer";
|
|
@@ -25,6 +16,7 @@ import { homedir } from "node:os";
|
|
|
25
16
|
import { MemoryProvider, RealFSProvider, ShadowProvider, VM, VmCheckpoint, createHttpHooks, createShadowPathPredicate, ensureImageSelector, isWriteFlag, loadGuestAssets } from "@earendil-works/gondolin";
|
|
26
17
|
import { Type as Type$1 } from "typebox";
|
|
27
18
|
import { Value } from "typebox/value";
|
|
19
|
+
import { createHash } from "node:crypto";
|
|
28
20
|
import { parseEnv } from "node:util";
|
|
29
21
|
//#region src/path-containment.ts
|
|
30
22
|
/**
|
|
@@ -1310,21 +1302,6 @@ async function resolvePersistentSessionManager(args) {
|
|
|
1310
1302
|
await SessionManager.list(args.cwd, args.sessionDir);
|
|
1311
1303
|
return SessionManager.continueRecent(args.cwd, args.sessionDir);
|
|
1312
1304
|
}
|
|
1313
|
-
new TextEncoder();
|
|
1314
|
-
//#endregion
|
|
1315
|
-
//#region ../crypto-service/src/crypto.service.ts
|
|
1316
|
-
ed.etc.sha512Sync = (...m) => {
|
|
1317
|
-
const hash = createHash("sha512");
|
|
1318
|
-
m.forEach((msg) => hash.update(msg));
|
|
1319
|
-
return hash.digest();
|
|
1320
|
-
};
|
|
1321
|
-
//#endregion
|
|
1322
|
-
//#region ../crypto-service/src/executor-attestation.ts
|
|
1323
|
-
ed.etc.sha512Sync = (...m) => {
|
|
1324
|
-
const hash = createHash$1("sha512");
|
|
1325
|
-
m.forEach((msg) => hash.update(msg));
|
|
1326
|
-
return hash.digest();
|
|
1327
|
-
};
|
|
1328
1305
|
//#endregion
|
|
1329
1306
|
//#region ../crypto-service/src/json-cid.ts
|
|
1330
1307
|
/**
|
|
@@ -1340,19 +1317,6 @@ async function computeJsonCid(value) {
|
|
|
1340
1317
|
return CID.create(1, json.code, hash).toString();
|
|
1341
1318
|
}
|
|
1342
1319
|
//#endregion
|
|
1343
|
-
//#region ../crypto-service/src/ssh.ts
|
|
1344
|
-
/**
|
|
1345
|
-
* SSH key format conversion for MoltNet Ed25519 keys
|
|
1346
|
-
*
|
|
1347
|
-
* Converts MoltNet agent keys (ed25519:<base64>) to OpenSSH format
|
|
1348
|
-
* for use with git commit signing and SSH authentication.
|
|
1349
|
-
*/
|
|
1350
|
-
if (!ed.etc.sha512Sync) ed.etc.sha512Sync = (...m) => {
|
|
1351
|
-
const hash = createHash("sha512");
|
|
1352
|
-
m.forEach((msg) => hash.update(msg));
|
|
1353
|
-
return hash.digest();
|
|
1354
|
-
};
|
|
1355
|
-
//#endregion
|
|
1356
1320
|
//#region src/config.ts
|
|
1357
1321
|
/** Resolve Pi's host-side auth/config directory from process configuration. */
|
|
1358
1322
|
function resolvePiCodingAgentDir() {
|
|
@@ -1967,10 +1931,10 @@ Type$1.Object({
|
|
|
1967
1931
|
Type$1.Literal("completed"),
|
|
1968
1932
|
Type$1.Literal("failed")
|
|
1969
1933
|
]),
|
|
1970
|
-
githubCode: Type$1.Optional(Type$1.String()),
|
|
1934
|
+
githubCode: Type$1.Optional(Type$1.String({ description: "GitHub manifest code sealed to the onboarding agent public key." })),
|
|
1971
1935
|
identityId: Type$1.Optional(Type$1.String()),
|
|
1972
1936
|
clientId: Type$1.Optional(Type$1.String()),
|
|
1973
|
-
clientSecret: Type$1.Optional(Type$1.String()),
|
|
1937
|
+
clientSecret: Type$1.Optional(Type$1.String({ description: "OAuth2 client secret sealed to the onboarding agent public key." })),
|
|
1974
1938
|
installationId: Type$1.Optional(Type$1.String())
|
|
1975
1939
|
});
|
|
1976
1940
|
Type$1.Object({
|
|
@@ -3882,7 +3846,7 @@ Type$1.Object({
|
|
|
3882
3846
|
allowedProfiles: Type$1.Array(RuntimeProfileRef, { maxItems: 16 }),
|
|
3883
3847
|
status: TaskStatus,
|
|
3884
3848
|
queuedAt: IsoTimestamp,
|
|
3885
|
-
completedAt: Type$1.Union([IsoTimestamp, Type$1.Null()]),
|
|
3849
|
+
completedAt: Type$1.Union([IsoTimestamp, Type$1.Null()], { description: "First time the task entered completed, failed, cancelled, or expired; null until terminal." }),
|
|
3886
3850
|
expiresAt: Type$1.Union([IsoTimestamp, Type$1.Null()]),
|
|
3887
3851
|
cancelledByAgentId: Type$1.Union([Uuid, Type$1.Null()]),
|
|
3888
3852
|
cancelledByHumanId: Type$1.Union([Uuid, Type$1.Null()]),
|
|
@@ -4059,7 +4023,7 @@ function getCacheDir() {
|
|
|
4059
4023
|
return path.join(base, "moltnet", "gondolin");
|
|
4060
4024
|
}
|
|
4061
4025
|
function computeConfigHash(config) {
|
|
4062
|
-
const h = createHash
|
|
4026
|
+
const h = createHash("sha256");
|
|
4063
4027
|
h.update(JSON.stringify({
|
|
4064
4028
|
baseAlpine: BASE_ALPINE_PACKAGES,
|
|
4065
4029
|
ghVersion: GH_VERSION,
|
|
@@ -5501,7 +5465,7 @@ function decideToolCall(input) {
|
|
|
5501
5465
|
return fenced(input.enforcement, "tool_not_permitted", `not permitted by tool policy: ${missing.join(", ")}`, `would block (watch): ${missing.join(", ")}`, missing, missingShellCommands);
|
|
5502
5466
|
}
|
|
5503
5467
|
function fingerprintArgv(argv) {
|
|
5504
|
-
return `sha256:${createHash
|
|
5468
|
+
return `sha256:${createHash("sha256").update(JSON.stringify(argv.map((token) => token === null ? { dynamic: true } : token))).digest("hex").slice(0, 16)}`;
|
|
5505
5469
|
}
|
|
5506
5470
|
function toMatchedShellCommand(executable, argvPrefix) {
|
|
5507
5471
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@themoltnet/pi-runtime",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Composable MoltNet runtime kernel for Pi agents in Gondolin VMs",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@opentelemetry/api": "^1.9.0",
|
|
32
32
|
"multiformats": "^13.3.0",
|
|
33
33
|
"typebox": "^1.2.8",
|
|
34
|
-
"@themoltnet/agent-runtime": "0.43.
|
|
34
|
+
"@themoltnet/agent-runtime": "0.43.1",
|
|
35
|
+
"@themoltnet/sdk": "0.135.0",
|
|
35
36
|
"@themoltnet/os-keyring": "0.2.0",
|
|
36
|
-
"@themoltnet/sdk": "0.134.0",
|
|
37
37
|
"@themoltnet/shell-command-analyzer": "0.3.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"vite": "^8.0.0",
|
|
52
52
|
"vite-plugin-dts": "^4.5.4",
|
|
53
53
|
"vitest": "^3.0.0",
|
|
54
|
-
"@moltnet/crypto-service": "0.1.0",
|
|
55
54
|
"@moltnet/models": "0.1.0",
|
|
55
|
+
"@moltnet/crypto-service": "0.1.0",
|
|
56
56
|
"@moltnet/tasks": "0.1.0"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|