@nylorun/runtime 0.24.0-beta → 0.26.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 (171) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/README.md +18 -4
  3. package/dist/api/a2a/card.d.ts +11 -1
  4. package/dist/api/a2a/card.js +26 -2
  5. package/dist/api/a2a/endpoint.js +4 -2
  6. package/dist/api/a2a/protocol.d.ts +25 -2
  7. package/dist/api/a2a/protocol.js +20 -3
  8. package/dist/api/a2a/routes.d.ts +4 -1
  9. package/dist/api/a2a/routes.js +65 -7
  10. package/dist/api/ag-ui/endpoint.js +5 -2
  11. package/dist/api/ag-ui/history.d.ts +6 -1
  12. package/dist/api/ag-ui/history.js +35 -2
  13. package/dist/api/ag-ui/routes.js +53 -11
  14. package/dist/api/components.d.ts +1165 -678
  15. package/dist/api/components.js +16 -1
  16. package/dist/api/gate/keys.d.ts +2 -1
  17. package/dist/api/gate/keys.js +7 -0
  18. package/dist/api/gate/routes.js +13 -0
  19. package/dist/api/http/app.d.ts +2 -2
  20. package/dist/api/http/app.js +15 -4
  21. package/dist/api/http/body.d.ts +3 -3
  22. package/dist/api/http/body.js +7 -7
  23. package/dist/api/http/define.d.ts +1 -1
  24. package/dist/api/http/respond.js +1 -1
  25. package/dist/api/http/routes/environment-manifests.d.ts +9 -0
  26. package/dist/api/http/routes/environment-manifests.js +118 -0
  27. package/dist/api/http/routes/environments.js +61 -12
  28. package/dist/api/http/routes/reads.d.ts +52 -3
  29. package/dist/api/http/routes/sessions.js +14 -4
  30. package/dist/api/http/routes/tenant.js +35 -7
  31. package/dist/api/inbound-files.d.ts +65 -0
  32. package/dist/api/inbound-files.js +115 -0
  33. package/dist/api/openapi.js +18 -3
  34. package/dist/artifacts/disk.js +20 -14
  35. package/dist/artifacts/media-types.d.ts +15 -0
  36. package/dist/artifacts/media-types.js +56 -4
  37. package/dist/artifacts/parts.d.ts +12 -3
  38. package/dist/artifacts/parts.js +15 -4
  39. package/dist/artifacts/workspace.d.ts +4 -4
  40. package/dist/artifacts/workspace.js +6 -18
  41. package/dist/core/flow-host.d.ts +1 -1
  42. package/dist/core/flow-host.js +2 -2
  43. package/dist/core/sandbox-routes.js +2 -2
  44. package/dist/core/turn-manifest.d.ts +3 -2
  45. package/dist/core/turn-manifest.js +29 -5
  46. package/dist/gates/egress-credentials.js +1 -1
  47. package/dist/gates/egress.d.ts +13 -19
  48. package/dist/gates/egress.js +32 -29
  49. package/dist/gates/http-tool.d.ts +3 -4
  50. package/dist/gates/http-tool.js +23 -19
  51. package/dist/gates/journal.js +0 -1
  52. package/dist/gates/mcp-handler.js +2 -3
  53. package/dist/gates/policy.js +1 -3
  54. package/dist/gates/tool-contract.d.ts +1 -1
  55. package/dist/harness/calls.d.ts +2 -2
  56. package/dist/harness/calls.js +9 -12
  57. package/dist/harness/main.js +7 -1
  58. package/dist/harness/pod.d.ts +6 -1
  59. package/dist/harness/pod.js +5 -0
  60. package/dist/harness/service.js +5 -5
  61. package/dist/harness/setup.d.ts +2 -0
  62. package/dist/harness/setup.js +25 -1
  63. package/dist/harness-api/record.d.ts +1 -1
  64. package/dist/harness-api/record.js +13 -13
  65. package/dist/harness-api/server.d.ts +27 -4
  66. package/dist/harness-api/server.js +41 -8
  67. package/dist/harness-api/tool-journal.d.ts +17 -8
  68. package/dist/harness-api/tool-journal.js +41 -11
  69. package/dist/harness-api/workspace.d.ts +7 -5
  70. package/dist/harness-api/workspace.js +25 -19
  71. package/dist/host/gates.js +2 -2
  72. package/dist/host/stack-config.js +1 -1
  73. package/dist/keys/contract.d.ts +1 -1
  74. package/dist/keys/contract.js +1 -1
  75. package/dist/keys/keys.d.ts +9 -2
  76. package/dist/keys/keys.js +4 -1
  77. package/dist/management-openapi.json +366 -61
  78. package/dist/mcp/connect.d.ts +1 -2
  79. package/dist/mcp/connect.js +1 -4
  80. package/dist/mcp/pool.d.ts +1 -4
  81. package/dist/mcp/pool.js +13 -27
  82. package/dist/mcp/preview.d.ts +1 -1
  83. package/dist/mcp/preview.js +1 -2
  84. package/dist/mcp/snapshot.d.ts +11 -13
  85. package/dist/mcp/snapshot.js +27 -38
  86. package/dist/model/capabilities.d.ts +26 -0
  87. package/dist/model/capabilities.js +44 -0
  88. package/dist/model/catalog.d.ts +34 -3
  89. package/dist/model/catalog.js +38 -2
  90. package/dist/model/models.d.ts +2 -0
  91. package/dist/model/models.js +1 -1
  92. package/dist/model/native-blocks.d.ts +35 -0
  93. package/dist/model/native-blocks.js +170 -0
  94. package/dist/model/pi-model.js +106 -94
  95. package/dist/openapi.json +9554 -5076
  96. package/dist/record/environment.js +1 -1
  97. package/dist/sandbox/join.js +4 -0
  98. package/dist/sandbox/manager.d.ts +32 -14
  99. package/dist/sandbox/manager.js +132 -93
  100. package/dist/sandbox/placement.d.ts +1 -1
  101. package/dist/sandbox/placement.js +2 -2
  102. package/dist/sandbox/pods/client.d.ts +3 -1
  103. package/dist/sandbox/pods/lifecycle.d.ts +8 -0
  104. package/dist/sandbox/pods/lifecycle.js +15 -0
  105. package/dist/sandbox/pods/spec.js +2 -1
  106. package/dist/sandbox/resolve.d.ts +5 -3
  107. package/dist/sandbox/resolve.js +9 -2
  108. package/dist/sandbox/runtime-tools.d.ts +9 -0
  109. package/dist/sandbox/runtime-tools.js +16 -0
  110. package/dist/sandbox/session-sandbox.d.ts +4 -6
  111. package/dist/sandbox/session-sandbox.js +47 -94
  112. package/dist/sandbox/setup.d.ts +4 -1
  113. package/dist/sandbox/setup.js +46 -9
  114. package/dist/sandbox/share.d.ts +12 -7
  115. package/dist/sandbox/share.js +27 -25
  116. package/dist/sandbox/skills.d.ts +8 -6
  117. package/dist/sandbox/skills.js +24 -23
  118. package/dist/store/postgres/drizzle/0024_flat_manifest.sql +7 -0
  119. package/dist/store/postgres/drizzle/0025_environment_manifests.sql +14 -0
  120. package/dist/store/postgres/drizzle/0026_environment_forks.sql +1 -0
  121. package/dist/store/postgres/drizzle/0027_environment_image_digest.sql +1 -0
  122. package/dist/store/postgres/drizzle/meta/_journal.json +28 -0
  123. package/dist/store/postgres/migrate.js +1 -1
  124. package/dist/store/postgres/reads.js +8 -2
  125. package/dist/store/postgres/schema.d.ts +217 -0
  126. package/dist/store/postgres/schema.js +36 -2
  127. package/dist/store/postgres/store.js +79 -4
  128. package/dist/store/types.d.ts +68 -14
  129. package/dist/tenant/advance.js +3 -0
  130. package/dist/tenant/artifact-tool.d.ts +1 -1
  131. package/dist/tenant/artifact-tool.js +43 -22
  132. package/dist/tenant/commands.js +24 -4
  133. package/dist/tenant/context.d.ts +10 -4
  134. package/dist/tenant/effects.js +7 -9
  135. package/dist/tenant/environment-manifests.d.ts +57 -0
  136. package/dist/tenant/environment-manifests.js +200 -0
  137. package/dist/tenant/environments.d.ts +54 -47
  138. package/dist/tenant/environments.js +309 -85
  139. package/dist/tenant/ephemeral.d.ts +1 -1
  140. package/dist/tenant/host-token.js +1 -1
  141. package/dist/tenant/identity-file.d.ts +1 -1
  142. package/dist/tenant/identity-file.js +1 -1
  143. package/dist/tenant/model-setting.d.ts +14 -0
  144. package/dist/tenant/model-setting.js +51 -0
  145. package/dist/tenant/outbound.d.ts +6 -5
  146. package/dist/tenant/outbound.js +8 -6
  147. package/dist/tenant/sessions.d.ts +5 -1
  148. package/dist/tenant/sessions.js +45 -12
  149. package/dist/tenant/skill-tool.d.ts +3 -3
  150. package/dist/tenant/skill-tool.js +6 -11
  151. package/dist/tenant/sweep.js +1 -1
  152. package/dist/tenant/tool-results.js +1 -1
  153. package/dist/tenant/tool-search.d.ts +7 -11
  154. package/dist/tenant/tool-search.js +8 -5
  155. package/dist/tenant/transcript.d.ts +51 -32
  156. package/dist/tenant/transcript.js +2 -1
  157. package/dist/tenant/types.d.ts +2 -2
  158. package/dist/traces/ids.d.ts +0 -1
  159. package/dist/traces/ids.js +0 -4
  160. package/dist/traces/map.d.ts +2 -2
  161. package/dist/traces/map.js +1 -29
  162. package/dist/vault/coverage.js +11 -13
  163. package/dist/vault/host-model.d.ts +4 -1
  164. package/dist/vault/host-model.js +10 -2
  165. package/dist/vault/service.d.ts +49 -4
  166. package/dist/vault/service.js +153 -6
  167. package/dist/version.d.ts +1 -1
  168. package/dist/version.js +1 -1
  169. package/package.json +3 -3
  170. package/dist/sandbox/capability.d.ts +0 -3
  171. package/dist/sandbox/capability.js +0 -10
@@ -178,8 +178,8 @@ export async function startEgress(options) {
178
178
  sandboxes: { live: async (sandboxId) => storeEgressSandboxes((await tenant.open()).store).live(sandboxId) },
179
179
  // Each connection on the Tenant's record (R7.3): the gates' one write into it.
180
180
  record: {
181
- holder: async (environmentId) => storeEgressRecord((await tenant.open()).store).holder(environmentId),
182
- write: async (holder, connection) => storeEgressRecord((await tenant.open()).store).write(holder, connection),
181
+ runningTurns: async (environmentId) => storeEgressRecord((await tenant.open()).store).runningTurns(environmentId),
182
+ write: async (connection) => storeEgressRecord((await tenant.open()).store).write(connection),
183
183
  },
184
184
  credentials: {
185
185
  bound: async (sandboxId, host) => (await tenant.open()).environmentSecretBound(sandboxId, host),
@@ -459,7 +459,7 @@ function parseSandboxes(env) {
459
459
  return undefined;
460
460
  const token = read(env, "NYLORUN_SANDBOXES_TOKEN");
461
461
  if (token === undefined || token.length < 32)
462
- throw new StackConfigError("NYLORUN_SANDBOXES_TOKEN (at least 32 characters) is required with NYLORUN_SANDBOXES_URL (`nylorun sandbox enable` sets both)");
462
+ throw new StackConfigError("NYLORUN_SANDBOXES_TOKEN (at least 32 characters) is required with NYLORUN_SANDBOXES_URL (`nylorun local sandbox enable` sets both)");
463
463
  const harnessImage = read(env, "NYLORUN_SANDBOX_HARNESS_IMAGE");
464
464
  if (harnessImage === undefined || /\s/.test(harnessImage))
465
465
  throw new StackConfigError("NYLORUN_SANDBOX_HARNESS_IMAGE is required with NYLORUN_SANDBOXES_URL: the Runtime image sandbox pods copy the engine from (`nylorun start` sets it)");
@@ -4,7 +4,7 @@
4
4
  * gates token. Internal: only core calls it, so it is not in the published OpenAPI documents.
5
5
  *
6
6
  * `200 {result}` when the operation succeeded, `200 {error}` when it refused: a vault error or
7
- * a Tenant API error with its status, code and details, so the route that called it answers
7
+ * a Runtime or Management API error with its status, code and details, so the route that called it answers
8
8
  * exactly what it answered when the operation ran in its own process.
9
9
  */
10
10
  export declare const KEYS_PATH = "/nylorun/v1/keys";
@@ -4,7 +4,7 @@
4
4
  * gates token. Internal: only core calls it, so it is not in the published OpenAPI documents.
5
5
  *
6
6
  * `200 {result}` when the operation succeeded, `200 {error}` when it refused: a vault error or
7
- * a Tenant API error with its status, code and details, so the route that called it answers
7
+ * a Runtime or Management API error with its status, code and details, so the route that called it answers
8
8
  * exactly what it answered when the operation ran in its own process.
9
9
  */
10
10
  export const KEYS_PATH = "/nylorun/v1/keys";
@@ -2,7 +2,7 @@ import type { EnvironmentSecretView, HostModelView, McpPreview, McpPreviewReques
2
2
  import type { SessionStore } from "../store/types.js";
3
3
  import type { OutboundPolicy } from "../tenant/outbound.js";
4
4
  import { type SigningKeys } from "../tenant/signing-keys.js";
5
- import type { VaultService } from "../vault/service.js";
5
+ import type { SealedSecretCopies, VaultService } from "../vault/service.js";
6
6
  /** One JWT to sign: its `typ` and every claim, `iss`, `aud`, `sub`, `iat`, `exp` and `jti` included. */
7
7
  export interface SignRequest {
8
8
  readonly typ: string;
@@ -18,6 +18,13 @@ export interface Keys {
18
18
  putEnvironmentSecret(environmentId: string, name: string, body: PutEnvironmentSecretRequest, actor: string): Promise<EnvironmentSecretView>;
19
19
  putHostModel(body: PutHostModelRequest): Promise<HostModelView>;
20
20
  selectHostModel(body: SelectHostModelRequest): Promise<HostModelView>;
21
+ /**
22
+ * Environment `from`'s secrets sealed again for a fork's new vault `vaultId`, limited to
23
+ * `slots` when given (`VaultService.sealEnvironmentSecretCopies`, Q15). Writes nothing: the
24
+ * fork's transaction inserts the copies; call it before that transaction opens. `null`, not
25
+ * `undefined`, crosses the wire.
26
+ */
27
+ sealEnvironmentSecretCopies(from: string, vaultId: string, slots: Readonly<Record<string, Record<string, unknown>>> | null): Promise<SealedSecretCopies>;
21
28
  /** Signs with the current key, creating the Tenant's keys if it has none. */
22
29
  sign(request: SignRequest): Promise<Signed>;
23
30
  /** Rotates the signing keys (`SigningKeys.rotate`); 409 while the previous key may verify live tokens. */
@@ -41,7 +48,7 @@ export interface Keys {
41
48
  signEgressLeaf(host: string, publicKey: string): Promise<string>;
42
49
  }
43
50
  /** The operations, by the name the HTTP route carries. */
44
- export declare const KEYS_OPERATIONS: readonly ["putEnvironmentSecret", "putHostModel", "selectHostModel", "sign", "rotateSigningKeys", "ensureSigningKeys", "previewMcp", "egressCa", "signEgressLeaf"];
51
+ export declare const KEYS_OPERATIONS: readonly ["putEnvironmentSecret", "putHostModel", "selectHostModel", "sealEnvironmentSecretCopies", "sign", "rotateSigningKeys", "ensureSigningKeys", "previewMcp", "egressCa", "signEgressLeaf"];
45
52
  export type KeysOperation = (typeof KEYS_OPERATIONS)[number];
46
53
  export interface InProcessKeysOptions {
47
54
  readonly store: SessionStore;
package/dist/keys/keys.js CHANGED
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * The keys seam (blueprint §14, F4.2): everything that needs the vault key. Vault writes that
3
3
  * touch a secret (writing an Environment's secret, setting and selecting the host model;
4
- * rotation and selection decrypt the old secret first) and all token signing (capability
4
+ * rotation and selection decrypt the old secret first; sealing a fork's copies of its source's
5
+ * secrets, which the fork's transaction then inserts) and all token signing (capability
5
6
  * links, run and host tokens, signing-key rotation) run here, whole, so the process that calls them never
6
7
  * holds the key or a private signing key.
7
8
  *
@@ -21,6 +22,7 @@ export const KEYS_OPERATIONS = [
21
22
  "putEnvironmentSecret",
22
23
  "putHostModel",
23
24
  "selectHostModel",
25
+ "sealEnvironmentSecretCopies",
24
26
  "sign",
25
27
  "rotateSigningKeys",
26
28
  "ensureSigningKeys",
@@ -35,6 +37,7 @@ export function inProcessKeys(options) {
35
37
  putEnvironmentSecret: (environmentId, name, body, actor) => vault.putEnvironmentSecret(environmentId, name, body, actor),
36
38
  putHostModel: (body) => vault.putHostModel(body),
37
39
  selectHostModel: (body) => vault.selectHostModel(body),
40
+ sealEnvironmentSecretCopies: (from, vaultId, slots) => vault.sealEnvironmentSecretCopies(from, vaultId, slots),
38
41
  async sign(request) {
39
42
  const key = kek();
40
43
  const row = await store.tx((t) => signingKeys.ensure(t, key));