@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.
- package/CHANGELOG.md +126 -0
- package/README.md +1 -1
- package/dist/compatibility.d.ts +120 -47
- package/dist/compatibility.js +122 -49
- package/dist/contracts.d.ts +2824 -907
- package/dist/contracts.js +1286 -585
- package/dist/define.d.ts +9 -12
- package/dist/define.js +8 -11
- package/dist/definition/assemble.d.ts +1 -3
- package/dist/definition/assemble.js +4 -8
- package/dist/definition/bound.d.ts +1 -1
- package/dist/definition/delegate.d.ts +5 -0
- package/dist/definition/delegate.js +6 -1
- package/dist/definition/from.d.ts +4 -2
- package/dist/definition/from.js +11 -29
- package/dist/definition/http-tool.d.ts +5 -3
- package/dist/definition/http-tool.js +8 -5
- package/dist/definition/manifest.d.ts +7 -6
- package/dist/definition/manifest.js +7 -6
- package/dist/definition/mcp.d.ts +1 -1
- package/dist/definition/media-reference.d.ts +2 -11
- package/dist/definition/media-reference.js +0 -12
- package/dist/definition/model-failure.js +1 -0
- package/dist/definition/removed.d.ts +7 -0
- package/dist/definition/removed.js +21 -0
- package/dist/definition/sections.d.ts +63 -0
- package/dist/definition/sections.js +204 -0
- package/dist/definition/trace.d.ts +0 -7
- package/dist/definition/trace.js +0 -34
- package/dist/definition/variant.d.ts +1 -1
- package/dist/definition/variant.js +1 -3
- package/dist/harness-api/artifacts.d.ts +84 -0
- package/dist/harness-api/artifacts.js +128 -0
- package/dist/harness-api/gates.d.ts +0 -4
- package/dist/harness-api/gates.js +0 -4
- package/dist/harness-api/harness-api.schema.json +2798 -1124
- package/dist/harness-api/index.d.ts +9 -6
- package/dist/harness-api/index.js +9 -6
- package/dist/harness-api/json-schema.js +5 -2
- package/dist/harness-api/mcp.d.ts +77 -30
- package/dist/harness-api/mcp.js +42 -25
- package/dist/harness-api/messages.d.ts +47 -17
- package/dist/harness-api/messages.js +20 -5
- package/dist/harness-api/schema.d.ts +609 -200
- package/dist/harness-api/schema.js +345 -62
- package/dist/harness-api/transcript.d.ts +8 -10
- package/dist/harness-api/transcript.js +27 -11
- package/dist/harness-api/transport.d.ts +7 -1
- package/dist/harness-api/transport.js +10 -7
- package/dist/manifest-schemas.d.ts +9 -5
- package/dist/manifest-schemas.js +23 -27
- package/dist/schemas/agent-manifest.schema.json +1508 -365
- package/dist/schemas/harness-manifest.schema.json +1273 -0
- package/dist/schemas/{environment-manifest.schema.json → runtime-manifest.schema.json} +165 -84
- package/dist/types/manifest.d.ts +72 -14
- package/dist/types/manifest.js +4 -0
- package/dist/types/model.d.ts +15 -5
- package/dist/utils/definition-files.d.ts +20 -6
- package/dist/utils/definition-files.js +31 -17
- package/dist/utils/file-systems.d.ts +20 -0
- package/dist/utils/file-systems.js +20 -0
- package/dist/utils/harness-id.d.ts +4 -1
- package/dist/utils/harness-id.js +4 -1
- package/dist/utils/media-types.d.ts +30 -0
- package/dist/utils/media-types.js +128 -0
- package/dist/utils/memory.d.ts +64 -0
- package/dist/utils/memory.js +139 -0
- package/dist/utils/runtime-limits.d.ts +280 -0
- package/dist/utils/runtime-limits.js +585 -0
- package/dist/utils/runtime-tools.d.ts +8 -16
- package/dist/utils/runtime-tools.js +8 -27
- package/dist/utils/sandbox.d.ts +4 -1
- package/dist/utils/sandbox.js +4 -1
- package/package.json +6 -5
- package/dist/definition/deferred-tools.d.ts +0 -27
- package/dist/definition/deferred-tools.js +0 -82
- package/dist/definition/runtime-manifest.d.ts +0 -30
- package/dist/definition/runtime-manifest.js +0 -132
- package/dist/definition/sandbox-tools.d.ts +0 -5
- package/dist/definition/sandbox-tools.js +0 -109
- package/dist/definition/skill-tools.d.ts +0 -23
- 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
|
|
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(
|
|
35
|
-
joinToken: z.string().min(1).max(
|
|
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
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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>;
|
package/dist/manifest-schemas.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* generated from the zod schemas the Runtime
|
|
4
|
-
* from its `$schema` and a client in another language validates what core
|
|
5
|
-
* writes them to `dist/schemas
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
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 {
|
|
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
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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(
|
|
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
|
}
|