@nylorun/core 0.22.0-beta → 0.24.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 (82) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +1 -1
  3. package/dist/compatibility.d.ts +120 -47
  4. package/dist/compatibility.js +122 -49
  5. package/dist/contracts.d.ts +2824 -907
  6. package/dist/contracts.js +1286 -585
  7. package/dist/define.d.ts +9 -12
  8. package/dist/define.js +8 -11
  9. package/dist/definition/assemble.d.ts +1 -3
  10. package/dist/definition/assemble.js +4 -8
  11. package/dist/definition/bound.d.ts +1 -1
  12. package/dist/definition/delegate.d.ts +5 -0
  13. package/dist/definition/delegate.js +6 -1
  14. package/dist/definition/from.d.ts +4 -2
  15. package/dist/definition/from.js +11 -29
  16. package/dist/definition/http-tool.d.ts +5 -3
  17. package/dist/definition/http-tool.js +8 -5
  18. package/dist/definition/manifest.d.ts +7 -6
  19. package/dist/definition/manifest.js +7 -6
  20. package/dist/definition/mcp.d.ts +1 -1
  21. package/dist/definition/media-reference.d.ts +2 -11
  22. package/dist/definition/media-reference.js +0 -12
  23. package/dist/definition/model-failure.js +1 -0
  24. package/dist/definition/removed.d.ts +7 -0
  25. package/dist/definition/removed.js +21 -0
  26. package/dist/definition/sections.d.ts +63 -0
  27. package/dist/definition/sections.js +204 -0
  28. package/dist/definition/trace.d.ts +0 -7
  29. package/dist/definition/trace.js +0 -34
  30. package/dist/definition/variant.d.ts +1 -1
  31. package/dist/definition/variant.js +1 -3
  32. package/dist/harness-api/artifacts.d.ts +84 -0
  33. package/dist/harness-api/artifacts.js +128 -0
  34. package/dist/harness-api/gates.d.ts +0 -4
  35. package/dist/harness-api/gates.js +0 -4
  36. package/dist/harness-api/harness-api.schema.json +2798 -1124
  37. package/dist/harness-api/index.d.ts +9 -6
  38. package/dist/harness-api/index.js +9 -6
  39. package/dist/harness-api/json-schema.js +5 -2
  40. package/dist/harness-api/mcp.d.ts +77 -30
  41. package/dist/harness-api/mcp.js +42 -25
  42. package/dist/harness-api/messages.d.ts +47 -17
  43. package/dist/harness-api/messages.js +20 -5
  44. package/dist/harness-api/schema.d.ts +609 -200
  45. package/dist/harness-api/schema.js +345 -62
  46. package/dist/harness-api/transcript.d.ts +8 -10
  47. package/dist/harness-api/transcript.js +27 -11
  48. package/dist/harness-api/transport.d.ts +7 -1
  49. package/dist/harness-api/transport.js +10 -7
  50. package/dist/manifest-schemas.d.ts +9 -5
  51. package/dist/manifest-schemas.js +23 -27
  52. package/dist/schemas/agent-manifest.schema.json +1508 -365
  53. package/dist/schemas/harness-manifest.schema.json +1273 -0
  54. package/dist/schemas/{environment-manifest.schema.json → runtime-manifest.schema.json} +165 -84
  55. package/dist/types/manifest.d.ts +72 -14
  56. package/dist/types/manifest.js +4 -0
  57. package/dist/types/model.d.ts +15 -5
  58. package/dist/utils/definition-files.d.ts +20 -6
  59. package/dist/utils/definition-files.js +31 -17
  60. package/dist/utils/file-systems.d.ts +20 -0
  61. package/dist/utils/file-systems.js +20 -0
  62. package/dist/utils/harness-id.d.ts +4 -1
  63. package/dist/utils/harness-id.js +4 -1
  64. package/dist/utils/media-types.d.ts +30 -0
  65. package/dist/utils/media-types.js +128 -0
  66. package/dist/utils/memory.d.ts +64 -0
  67. package/dist/utils/memory.js +139 -0
  68. package/dist/utils/runtime-limits.d.ts +280 -0
  69. package/dist/utils/runtime-limits.js +585 -0
  70. package/dist/utils/runtime-tools.d.ts +8 -16
  71. package/dist/utils/runtime-tools.js +8 -27
  72. package/dist/utils/sandbox.d.ts +4 -1
  73. package/dist/utils/sandbox.js +4 -1
  74. package/package.json +6 -5
  75. package/dist/definition/deferred-tools.d.ts +0 -27
  76. package/dist/definition/deferred-tools.js +0 -82
  77. package/dist/definition/runtime-manifest.d.ts +0 -30
  78. package/dist/definition/runtime-manifest.js +0 -132
  79. package/dist/definition/sandbox-tools.d.ts +0 -5
  80. package/dist/definition/sandbox-tools.js +0 -109
  81. package/dist/definition/skill-tools.d.ts +0 -23
  82. package/dist/definition/skill-tools.js +0 -76
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * - the transport: path `/nylorun/harness/v1` and header `Nylorun-Harness-Api: 1`, for the
5
5
  * WebSocket and its frames (`FrameSchema`), one JSON text message per frame;
6
- * - the messages: `HARNESS_API_VERSION` (2), which a harness names in `hello.api` and core
6
+ * - the messages: `HARNESS_API_VERSION`, which a harness names in `hello.api` and core
7
7
  * checks;
8
8
  * - the Runtime's protocol, which the Runtime and Management APIs carry, never this one.
9
9
  *
@@ -29,14 +29,17 @@ export const HOST_RENEW_PATH = `${HARNESS_API_PATH}/host/renew`;
29
29
  * mounted join file (afresh each time: a reset writes a new one), and the id the harness keeps on
30
30
  * the volume (`/harness/volume-id`), so a volume recreated empty is told apart.
31
31
  */
32
+ /**
33
+ * A pod's UID or a volume id: a Kubernetes UID is an RFC 4122 UUID (36 characters); 64 leaves a
34
+ * volume id room. With the join token's 512, an identifier's grammar is the protocol's (it crosses the Runtime API, the Harness API and tokens, and means the same in every installation), so its length is a constant of protocol 15, not a setting.
35
+ */
36
+ export const POD_UID_PATTERN = /^[A-Za-z0-9-]{1,64}$/;
37
+ export const JOIN_TOKEN_MAX = 512;
32
38
  export const HostJoinRequestSchema = z.strictObject({
33
39
  sandboxId: z.string().min(1),
34
- podUid: z.string().regex(/^[A-Za-z0-9-]{1,64}$/),
35
- joinToken: z.string().min(1).max(512),
36
- volumeId: z
37
- .string()
38
- .regex(/^[A-Za-z0-9-]{1,64}$/)
39
- .optional(),
40
+ podUid: z.string().regex(POD_UID_PATTERN),
41
+ joinToken: z.string().min(1).max(JOIN_TOKEN_MAX),
42
+ volumeId: z.string().regex(POD_UID_PATTERN).optional(),
40
43
  });
41
44
  /**
42
45
  * What `host/join` and `host/renew` answer. The host token is the WebSocket bearer; the egress
@@ -1,6 +1,10 @@
1
- /** The agent manifest version these documents describe. */
2
- export declare const AGENT_MANIFEST_SCHEMA_VERSION = 7;
3
- /** The environment manifest's JSON Schema document (draft 2020-12). */
4
- export declare function environmentManifestJsonSchema(): Record<string, unknown>;
5
- /** The agent manifest's JSON Schema document (draft 2020-12). */
1
+ /**
2
+ * Agent manifest v8's JSON Schema document (protocol 16): the authoring form, whose `harness`
3
+ * and `runtime` may each be a path to an authoring file, as `agent.manifest.json` is written.
4
+ * What the API receives has both sections written out (`AgentManifestV8Schema`).
5
+ */
6
6
  export declare function agentManifestJsonSchema(): Record<string, unknown>;
7
+ /** `harness.manifest.json`'s JSON Schema document: the harness section as an authoring file. */
8
+ export declare function harnessManifestJsonSchema(): Record<string, unknown>;
9
+ /** `runtime.manifest.json`'s JSON Schema document: the runtime section as an authoring file. */
10
+ export declare function runtimeManifestJsonSchema(): Record<string, unknown>;
@@ -1,17 +1,15 @@
1
1
  /**
2
- * The agent manifest and the environment manifest as JSON Schema documents (protocol 14, D63),
3
- * generated from the zod schemas the Runtime validates with, so an editor checks a manifest file
4
- * from its `$schema` and a client in another language validates what core enforces. The build
5
- * writes them to `dist/schemas/` (`@nylorun/core/schemas/agent-manifest.json` and
6
- * `@nylorun/core/schemas/environment-manifest.json`). Both allow a top-level `$schema`, which
7
- * the CLI and SDK drop before they save: the Runtime's own schemas stay strict. The environment
8
- * manifest's `files` also allow the CLI's `{ path, from }`, a folder beside the file that
9
- * `nylorun environments manifests save` hashes into `{ path, files }`: the Runtime never sees it.
2
+ * Agent manifest v8 and its two authoring files as JSON Schema documents (protocol 16),
3
+ * generated from the zod schemas the Runtime and the composer validate with, so an editor checks
4
+ * a manifest file from its `$schema` and a client in another language validates what core
5
+ * enforces. The build writes them to `dist/schemas/`: `@nylorun/core/schemas/agent-manifest.json`
6
+ * (`agent.manifest.json`, whose sections may be paths), `harness-manifest.json` and
7
+ * `runtime-manifest.json`. Each allows a top-level `$schema`, which the composer drops before it
8
+ * saves: the Runtime's own schemas stay strict. A runtime file's `files` also allow `{ path,
9
+ * from }`, a folder beside the file the composer hashes into `{ path, files }`.
10
10
  */
11
11
  import { z } from "zod";
12
- import { AgentManifestSchema, ENVIRONMENT_MANIFEST_SCHEMA_VERSION, EnvironmentManifestSchema, } from "./contracts.js";
13
- /** The agent manifest version these documents describe. */
14
- export const AGENT_MANIFEST_SCHEMA_VERSION = 7;
12
+ import { AGENT_MANIFEST_V8_SCHEMA_VERSION, AgentManifestFileSchema, HARNESS_MANIFEST_FILE_SCHEMA_VERSION, HarnessManifestFileSchema, RUNTIME_MANIFEST_FILE_SCHEMA_VERSION, RuntimeManifestFileSchema, } from "./contracts.js";
15
13
  function document(schema, id, title) {
16
14
  const { $schema: _, ...definition } = z.toJSONSchema(schema, { io: "input", unrepresentable: "any" });
17
15
  const properties = (definition.properties ?? {});
@@ -26,21 +24,19 @@ function document(schema, id, title) {
26
24
  },
27
25
  };
28
26
  }
29
- /** The environment manifest's JSON Schema document (draft 2020-12). */
30
- export function environmentManifestJsonSchema() {
31
- const schema = document(EnvironmentManifestSchema, `environment-manifest/v${ENVIRONMENT_MANIFEST_SCHEMA_VERSION}`, `Nylorun environment manifest ${ENVIRONMENT_MANIFEST_SCHEMA_VERSION}`);
32
- const shapes = schema.properties.files.items.anyOf;
33
- const tree = shapes.find((shape) => "files" in shape.properties);
34
- shapes.push({
35
- type: "object",
36
- description: "For the CLI only: a folder, relative to this file, that `nylorun environments manifests save` uploads by hash and saves as { path, files }",
37
- properties: { path: tree?.properties.path, from: { type: "string", minLength: 1 } },
38
- required: ["path", "from"],
39
- additionalProperties: false,
40
- });
41
- return schema;
42
- }
43
- /** The agent manifest's JSON Schema document (draft 2020-12). */
27
+ /**
28
+ * Agent manifest v8's JSON Schema document (protocol 16): the authoring form, whose `harness`
29
+ * and `runtime` may each be a path to an authoring file, as `agent.manifest.json` is written.
30
+ * What the API receives has both sections written out (`AgentManifestV8Schema`).
31
+ */
44
32
  export function agentManifestJsonSchema() {
45
- return document(AgentManifestSchema, `agent-manifest/v${AGENT_MANIFEST_SCHEMA_VERSION}`, `Nylorun agent manifest ${AGENT_MANIFEST_SCHEMA_VERSION}`);
33
+ return document(AgentManifestFileSchema, `agent-manifest/v${AGENT_MANIFEST_V8_SCHEMA_VERSION}`, `Nylorun agent manifest ${AGENT_MANIFEST_V8_SCHEMA_VERSION}`);
34
+ }
35
+ /** `harness.manifest.json`'s JSON Schema document: the harness section as an authoring file. */
36
+ export function harnessManifestJsonSchema() {
37
+ return document(HarnessManifestFileSchema, `harness-manifest/v${HARNESS_MANIFEST_FILE_SCHEMA_VERSION}`, `Nylorun harness manifest ${HARNESS_MANIFEST_FILE_SCHEMA_VERSION}`);
38
+ }
39
+ /** `runtime.manifest.json`'s JSON Schema document: the runtime section as an authoring file. */
40
+ export function runtimeManifestJsonSchema() {
41
+ return document(RuntimeManifestFileSchema, `runtime-manifest/v${RUNTIME_MANIFEST_FILE_SCHEMA_VERSION}`, `Nylorun runtime manifest ${RUNTIME_MANIFEST_FILE_SCHEMA_VERSION}`);
46
42
  }