@themoltnet/pi-runtime 0.3.0 → 0.4.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/index.d.ts +3 -0
- package/dist/index.js +20 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare interface AllowedToolsClient {
|
|
|
46
46
|
allowedShellCommands: Array<{
|
|
47
47
|
argvPrefix: string[];
|
|
48
48
|
}>;
|
|
49
|
+
runtimeKind: string;
|
|
49
50
|
}>;
|
|
50
51
|
};
|
|
51
52
|
}
|
|
@@ -1072,6 +1073,8 @@ declare interface ResolveSessionToolPolicyInput {
|
|
|
1072
1073
|
agent: AllowedToolsClient;
|
|
1073
1074
|
profileId: string;
|
|
1074
1075
|
teamId: string;
|
|
1076
|
+
/** Runtime kind supplied by the trusted daemon adapter for this session. */
|
|
1077
|
+
runtimeKind: string;
|
|
1075
1078
|
/**
|
|
1076
1079
|
* The profile's enforcement mode, already known to the daemon from the
|
|
1077
1080
|
* resolved runtime profile. Used to decide fail-open vs fail-closed when the
|
package/dist/index.js
CHANGED
|
@@ -10046,7 +10046,11 @@ var ProblemDetailsSchema = _Object_({
|
|
|
10046
10046
|
}),
|
|
10047
10047
|
code: ProblemCodeSchema,
|
|
10048
10048
|
detail: Optional(String$1()),
|
|
10049
|
-
instance: Optional(String$1())
|
|
10049
|
+
instance: Optional(String$1()),
|
|
10050
|
+
retryAfter: Optional(Integer({
|
|
10051
|
+
minimum: 0,
|
|
10052
|
+
description: "Non-negative delay in seconds before retrying, matching the Retry-After response header when present."
|
|
10053
|
+
}))
|
|
10050
10054
|
}, {
|
|
10051
10055
|
$id: "ProblemDetails",
|
|
10052
10056
|
additionalProperties: true
|
|
@@ -14991,6 +14995,10 @@ var TaskAttempt = _Object_({
|
|
|
14991
14995
|
taskId: Uuid,
|
|
14992
14996
|
attemptN: Number$1({ minimum: 1 }),
|
|
14993
14997
|
claimedByAgentId: Uuid,
|
|
14998
|
+
leaseId: Union([Uuid, Null()]),
|
|
14999
|
+
runtimeProfileId: Union([Uuid, Null()]),
|
|
15000
|
+
runtimeProfileRevision: Union([Integer({ minimum: 1 }), Null()]),
|
|
15001
|
+
policySnapshotHash: Union([String$1({ pattern: "^sha256:[0-9a-f]{64}$" }), Null()]),
|
|
14994
15002
|
runtimeId: Union([Uuid, Null()]),
|
|
14995
15003
|
claimedAt: IsoTimestamp,
|
|
14996
15004
|
startedAt: Union([IsoTimestamp, Null()]),
|
|
@@ -32559,6 +32567,10 @@ async function resolveSessionToolPolicy(input) {
|
|
|
32559
32567
|
try {
|
|
32560
32568
|
const resolved = await withTimeout$1(input.agent.runtimeProfiles.allowedTools(input.profileId, { teamId: input.teamId }), timeoutMs);
|
|
32561
32569
|
const shellCommands = resolved.allowedShellCommands ?? [];
|
|
32570
|
+
if (resolved.runtimeKind !== input.runtimeKind) throw new RuntimeKindMismatchError({
|
|
32571
|
+
expectedRuntimeKind: input.runtimeKind,
|
|
32572
|
+
receivedRuntimeKind: resolved.runtimeKind
|
|
32573
|
+
});
|
|
32562
32574
|
return {
|
|
32563
32575
|
enforcement: resolved.enforcement,
|
|
32564
32576
|
allowedTools: new Set(resolved.allowedTools),
|
|
@@ -32592,6 +32604,12 @@ var ToolPolicyResolveTimeoutError = class extends Error {
|
|
|
32592
32604
|
this.name = "ToolPolicyResolveTimeoutError";
|
|
32593
32605
|
}
|
|
32594
32606
|
};
|
|
32607
|
+
var RuntimeKindMismatchError = class extends Error {
|
|
32608
|
+
constructor(input) {
|
|
32609
|
+
super(`runtime kind mismatch: expected ${input.expectedRuntimeKind}, received ${input.receivedRuntimeKind}`);
|
|
32610
|
+
this.name = "RuntimeKindMismatchError";
|
|
32611
|
+
}
|
|
32612
|
+
};
|
|
32595
32613
|
/**
|
|
32596
32614
|
* Reject with {@link ToolPolicyResolveTimeoutError} if `promise` does not settle
|
|
32597
32615
|
* within `timeoutMs`. A non-positive `timeoutMs` disables the deadline. The
|
|
@@ -34302,6 +34320,7 @@ async function executePiTask(claimedTask, reporter, opts) {
|
|
|
34302
34320
|
agent: moltnetAgent,
|
|
34303
34321
|
profileId: opts.runtimeProfileId,
|
|
34304
34322
|
teamId: taskTeamId,
|
|
34323
|
+
runtimeKind: opts.runtimeDefinition?.runtimeKind ?? "gondolin_pi",
|
|
34305
34324
|
enforcement: opts.toolEnforcement,
|
|
34306
34325
|
logger: toolPolicyLogger
|
|
34307
34326
|
})]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@themoltnet/pi-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Composable MoltNet runtime kernel for Pi agents in Gondolin VMs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@earendil-works/gondolin": "^0.9.1",
|
|
27
27
|
"@opentelemetry/api": "^1.9.0",
|
|
28
28
|
"typebox": "^1.2.8",
|
|
29
|
-
"@themoltnet/agent-runtime": "0.
|
|
29
|
+
"@themoltnet/agent-runtime": "0.39.0",
|
|
30
30
|
"@themoltnet/shell-command-analyzer": "0.3.0",
|
|
31
31
|
"@themoltnet/sdk": "0.128.0"
|
|
32
32
|
},
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"vite": "^8.0.0",
|
|
46
46
|
"vite-plugin-dts": "^4.5.4",
|
|
47
47
|
"vitest": "^3.0.0",
|
|
48
|
-
"@moltnet/
|
|
48
|
+
"@moltnet/tasks": "0.1.0",
|
|
49
49
|
"@moltnet/crypto-service": "0.1.0",
|
|
50
|
-
"@moltnet/
|
|
50
|
+
"@moltnet/models": "0.1.0"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=22"
|