@nylorun/runtime 0.37.0-beta → 0.39.0-beta

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/dist/api/components.d.ts +1732 -80
  3. package/dist/api/http/routes/agents.js +3 -3
  4. package/dist/core/turn-manifest.d.ts +23 -0
  5. package/dist/core/turn-manifest.js +36 -1
  6. package/dist/gates/policy.d.ts +13 -3
  7. package/dist/gates/policy.js +17 -4
  8. package/dist/harness/executors.d.ts +4 -2
  9. package/dist/harness/executors.js +26 -4
  10. package/dist/harness/image-engine.d.ts +14 -0
  11. package/dist/harness/image-engine.js +16 -0
  12. package/dist/harness/pod.d.ts +2 -0
  13. package/dist/harness/pod.js +5 -0
  14. package/dist/harness-api/record.js +4 -2
  15. package/dist/harness-api/server.js +37 -13
  16. package/dist/harness-api/start.js +43 -5
  17. package/dist/harness-api/ws-server.js +7 -1
  18. package/dist/keys/keys.d.ts +6 -3
  19. package/dist/keys/keys.js +1 -1
  20. package/dist/management-openapi.json +38 -4
  21. package/dist/mcp/pool.d.ts +5 -0
  22. package/dist/mcp/pool.js +1 -1
  23. package/dist/mcp/snapshot.d.ts +3 -1
  24. package/dist/mcp/snapshot.js +5 -3
  25. package/dist/openapi.json +1636 -563
  26. package/dist/sandbox/join.d.ts +7 -1
  27. package/dist/sandbox/join.js +5 -1
  28. package/dist/sandbox/pods/builtin.d.ts +18 -0
  29. package/dist/sandbox/pods/builtin.js +33 -0
  30. package/dist/sandbox/pods/client.d.ts +5 -4
  31. package/dist/sandbox/pods/spec.js +14 -1
  32. package/dist/store/postgres/drizzle/0042_worker_engine_image.sql +1 -0
  33. package/dist/store/postgres/drizzle/meta/_journal.json +7 -0
  34. package/dist/store/postgres/schema.d.ts +19 -0
  35. package/dist/store/postgres/schema.js +2 -0
  36. package/dist/store/postgres/store.js +16 -0
  37. package/dist/store/types.d.ts +18 -0
  38. package/dist/tenant/agent-versions.d.ts +13 -5
  39. package/dist/tenant/agent-versions.js +30 -6
  40. package/dist/tenant/agents.d.ts +14 -2
  41. package/dist/tenant/agents.js +51 -13
  42. package/dist/tenant/commands.js +16 -8
  43. package/dist/tenant/context.d.ts +30 -1
  44. package/dist/tenant/session-model.d.ts +35 -6
  45. package/dist/tenant/session-model.js +77 -9
  46. package/dist/tenant/sessions.js +13 -3
  47. package/dist/vault/service.d.ts +44 -3
  48. package/dist/vault/service.js +68 -27
  49. package/dist/version.d.ts +1 -1
  50. package/dist/version.js +1 -1
  51. package/package.json +3 -3
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.2.0",
3
3
  "info": {
4
4
  "title": "Nylorun Management API",
5
- "version": "0.37.0-beta",
5
+ "version": "0.39.0-beta",
6
6
  "x-nylorun-protocol": {
7
7
  "min": 16,
8
8
  "max": 18,
@@ -40,7 +40,9 @@
40
40
  "model-host-identity",
41
41
  "credential-provider",
42
42
  "turns",
43
- "agent-model"
43
+ "agent-model",
44
+ "secret-routing",
45
+ "remove-tools"
44
46
  ]
45
47
  },
46
48
  "description": "For operators: the Tenant's models, vaults, signing keys, settings and application keys, at `/v1/tenant/*` on the Tenant's URL, through `@nylorun/admin`. Every operation takes a management key, acting as itself: never for a subject and never from a browser. Management keys are issued only on the Tenant's machine (`nylorun tenant keys put <id> --management`) or from `NYLORUN_MANAGEMENT_KEY_FILE`."
@@ -931,6 +933,22 @@
931
933
  },
932
934
  "additionalProperties": false
933
935
  },
936
+ "engine": {
937
+ "type": "object",
938
+ "properties": {
939
+ "images": {
940
+ "type": "array",
941
+ "items": {
942
+ "type": "string",
943
+ "minLength": 1,
944
+ "maxLength": 256,
945
+ "pattern": "^[a-z0-9]([a-z0-9._:/-]*[a-z0-9])?$"
946
+ },
947
+ "maxItems": 32
948
+ }
949
+ },
950
+ "additionalProperties": false
951
+ },
934
952
  "placement": {
935
953
  "type": "object",
936
954
  "additionalProperties": {
@@ -2321,6 +2339,22 @@
2321
2339
  },
2322
2340
  "additionalProperties": false
2323
2341
  },
2342
+ "engine": {
2343
+ "type": "object",
2344
+ "properties": {
2345
+ "images": {
2346
+ "type": "array",
2347
+ "items": {
2348
+ "type": "string",
2349
+ "minLength": 1,
2350
+ "maxLength": 256,
2351
+ "pattern": "^[a-z0-9]([a-z0-9._:/-]*[a-z0-9])?$"
2352
+ },
2353
+ "maxItems": 32
2354
+ }
2355
+ },
2356
+ "additionalProperties": false
2357
+ },
2324
2358
  "placement": {
2325
2359
  "type": "object",
2326
2360
  "additionalProperties": {
@@ -2533,7 +2567,7 @@
2533
2567
  "agent": {
2534
2568
  "type": "string",
2535
2569
  "minLength": 1,
2536
- "description": "The agent that calls the tool: the agent manifest's name, or the id of an agent used as a tool or of a flow's agent, never an Agent's id. `*` matches any run of characters"
2570
+ "description": "The agent that calls the tool: the agent manifest's name, or the id of an agent used as a tool or of a flow's agent, never an Agent's id. The session's root agent's name also matches the calls of the agents it uses as tools. `*` matches any run of characters"
2537
2571
  },
2538
2572
  "when": {
2539
2573
  "type": "object",
@@ -2635,7 +2669,7 @@
2635
2669
  "agent": {
2636
2670
  "type": "string",
2637
2671
  "minLength": 1,
2638
- "description": "The agent that calls the tool: the agent manifest's name, or the id of an agent used as a tool or of a flow's agent, never an Agent's id. `*` matches any run of characters"
2672
+ "description": "The agent that calls the tool: the agent manifest's name, or the id of an agent used as a tool or of a flow's agent, never an Agent's id. The session's root agent's name also matches the calls of the agents it uses as tools. `*` matches any run of characters"
2639
2673
  },
2640
2674
  "when": {
2641
2675
  "type": "object",
@@ -34,6 +34,11 @@ export declare class McpPool {
34
34
  manifestHash: string;
35
35
  maxInstructionBytes: number;
36
36
  signal?: AbortSignal;
37
+ /**
38
+ * Only these of its declared servers (default all): the ones a later turn tries again because
39
+ * they are not in the session's snapshot (`prepareMcp`).
40
+ */
41
+ servers?: readonly DeclaredServer[];
37
42
  }): Promise<{
38
43
  snapshot: McpSnapshot;
39
44
  diagnostics: McpDiagnostic[];
package/dist/mcp/pool.js CHANGED
@@ -22,7 +22,7 @@ export class McpPool {
22
22
  async discover(input) {
23
23
  const servers = [];
24
24
  const diagnostics = [];
25
- for (const declared of serversOf(input.manifest)) {
25
+ for (const declared of input.servers ?? serversOf(input.manifest)) {
26
26
  input.signal?.throwIfAborted();
27
27
  const opened = await this.connectDeclared(input, declared);
28
28
  if (!opened.ok) {
@@ -49,7 +49,9 @@ export declare function manifestFor(manifest: AgentManifest, agent: HostEffect["
49
49
  * out, so the session never offers its tools, and its diagnostic says so (`failed`, replacing
50
50
  * the one it had). Unchanged when the whole snapshot fits.
51
51
  */
52
- export declare function fitSnapshot(snapshot: McpSnapshot, diagnostics: readonly McpDiagnostic[], limitBytes: number): {
52
+ export declare function fitSnapshot(snapshot: McpSnapshot, diagnostics: readonly McpDiagnostic[], limitBytes: number,
53
+ /** How many of its first servers stay whatever their size: those the session pinned already. */
54
+ keep?: number): {
53
55
  snapshot: McpSnapshot;
54
56
  diagnostics: McpDiagnostic[];
55
57
  };
@@ -86,17 +86,19 @@ export function manifestFor(manifest, agent) {
86
86
  * out, so the session never offers its tools, and its diagnostic says so (`failed`, replacing
87
87
  * the one it had). Unchanged when the whole snapshot fits.
88
88
  */
89
- export function fitSnapshot(snapshot, diagnostics, limitBytes) {
89
+ export function fitSnapshot(snapshot, diagnostics, limitBytes,
90
+ /** How many of its first servers stay whatever their size: those the session pinned already. */
91
+ keep = 0) {
90
92
  const bytes = (value) => Buffer.byteLength(JSON.stringify(value));
91
93
  if (bytes(snapshot) <= limitBytes)
92
94
  return { snapshot, diagnostics: [...diagnostics] };
93
95
  const kept = [];
94
96
  const dropped = new Map();
95
97
  const key = (agentId, serverName) => JSON.stringify([agentId ?? null, serverName]);
96
- for (const server of snapshot.servers) {
98
+ for (const [index, server] of snapshot.servers.entries()) {
97
99
  const next = { ...snapshot, servers: [...kept, server] };
98
100
  const size = bytes(next);
99
- if (size <= limitBytes)
101
+ if (index < keep || size <= limitBytes)
100
102
  kept.push(server);
101
103
  else
102
104
  dropped.set(key(server.agentId, server.name), bytes(server));