@nylorun/core 0.26.0-beta → 0.27.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 +7 -0
- package/README.md +4 -0
- package/dist/compatibility.d.ts +11 -2
- package/dist/compatibility.js +10 -0
- package/dist/contracts.d.ts +210 -0
- package/dist/contracts.js +71 -0
- package/dist/folder/compile.d.ts +49 -0
- package/dist/folder/compile.js +869 -0
- package/dist/folder/frontmatter.d.ts +18 -0
- package/dist/folder/frontmatter.js +87 -0
- package/dist/folder/index.d.ts +7 -0
- package/dist/folder/index.js +7 -0
- package/dist/folder/json.d.ts +28 -0
- package/dist/folder/json.js +183 -0
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @nylorun/core
|
|
2
2
|
|
|
3
|
+
## 0.27.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9ba6634: Agent folders (track T6, D79): `@nylorun/core/folder` exports `compileAgentFolder`, which turns a folder of Markdown and JSON into agent manifest v8. It is pure, so the Runtime and `nylorun check` give one verdict: `AGENT.md` (frontmatter and instructions) and `instructions/*.md`, `runtime.json`, `mcp.json` in Agent Plugins syntax (`${NAME}` in a header names the credential; a slot `runtime.json` does not declare is derived for the server's URL), `skills/<name>/`, HTTP `tools/<name>.json` with schemas inline or by path, `triggers/<id>.md` and `files/**`. Every problem comes back in one pass, with file, line and column for parse and schema errors, and an unknown key gets a "did you mean". JSON is strict; frontmatter is YAML 1.2 core with no aliases, tags or merge keys. Flows, subagents and vendored plugins are refused for now. `folderTextPaths` names the files the compiler reads; `AGENT_FOLDER_LIMITS` holds the folder limits (2,000 files, 50 MiB, 1 MiB per Markdown or JSON file).
|
|
8
|
+
- aaa079f: The Runtime saves agent folders (track T6). `PUT /v1/agent-manifests/{name}` with `Content-Type: application/vnd.nylorun.folder+json` takes a folder by hash (`PutAgentFolderRequestSchema`): the files uploaded first, the Markdown and JSON read back from the definition file store and compiled with `compileAgentFolder`. A folder that does not compile is `422 folder_invalid`, with the compiler's diagnostics by file, line and column in `details.diagnostics`. A save keeps the folder as the version's source: `AgentManifestView.source` summarises it, `GET /v1/agent-manifests/{name}/versions/{v}/source` lists its files and `.../source/files/{path}` returns one. With `?dryRun=true` the plan adds the compiled `manifest`, the `diagnostics` and the `compiler`. A folder whose manifest is unchanged saves no version, and says so (`source_not_saved`). New Host feature `agent-folders`; new error code `folder_invalid`.
|
|
9
|
+
|
|
3
10
|
## 0.26.0-beta
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -6,6 +6,10 @@ HTTP client, Node host or SDK dependencies.
|
|
|
6
6
|
- `/define`: `Agent`, `tool`, the manifest, schemas and explicit local bindings.
|
|
7
7
|
- `/contracts`: runtime request, event, action and response schemas.
|
|
8
8
|
- `/compatibility`: protocol/definition versions and canonical manifest hashing.
|
|
9
|
+
- `/folder`: agent folders. `compileAgentFolder` turns a folder of Markdown and JSON
|
|
10
|
+
(`AGENT.md`, `runtime.json`, `mcp.json`, `skills/`, `tools/`, `triggers/`, `files/`) into
|
|
11
|
+
agent manifest v8, with every diagnostic by file, line and column. Pure: the Runtime
|
|
12
|
+
compiles every folder it is sent with it, and `nylorun check` checks one offline.
|
|
9
13
|
- `/transport`: what every Runtime client does on the wire: the `/health`
|
|
10
14
|
compatibility probe (`checkHealth`), protocol ranges, request headers and
|
|
11
15
|
response bodies. Browser-safe; `@nylorun/agents` and `@nylorun/admin` build on it.
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -197,10 +197,13 @@ export type ProtocolFeature = (typeof PROTOCOL_FEATURES)[number];
|
|
|
197
197
|
* `gateway-credentials`: a `bearer` or `headers` credential with `via`, written to an Agent's vault,
|
|
198
198
|
* may name the gateway's tool prefix (`toolPrefix`), which the Runtime takes off the tools it lists
|
|
199
199
|
* and puts back on each call.
|
|
200
|
+
* `agent-folders`: `PUT /v1/agent-manifests/{name}` also takes an agent folder by hash
|
|
201
|
+
* (`application/vnd.nylorun.folder+json`), compiles it with `@nylorun/core/folder` and keeps it
|
|
202
|
+
* as the version's source, read at `GET .../versions/{v}/source` and `.../source/files/{path}`.
|
|
200
203
|
*/
|
|
201
204
|
export declare const OPTIONAL_HOST_FEATURES: readonly ["tenant-fixture-model", "transcript-events", "subject-headers", "ag-ui-endpoint", "a2a-endpoint", "sandbox-pods", "trusted-issuers", "session-reads", "calls-export", "credential-coverage", "tool-calls", "environment-setup", "environment-disk-versions", "tool-policy", "traces",
|
|
202
205
|
/** Opt-in artifact metadata pages (`GET /v1/artifacts?limit=…`). */
|
|
203
|
-
"artifact-reads", "gateway-credentials"];
|
|
206
|
+
"artifact-reads", "gateway-credentials", "agent-folders"];
|
|
204
207
|
export type OptionalHostFeature = (typeof OPTIONAL_HOST_FEATURES)[number];
|
|
205
208
|
export interface ProtocolRange {
|
|
206
209
|
min: number;
|
|
@@ -352,7 +355,13 @@ export declare const ERROR_CODES: readonly ["not_found",
|
|
|
352
355
|
* `If-Match` named a version that is no longer the latest: `412`. Read the manifest
|
|
353
356
|
* again, or save without `If-Match` (the CLI's `--if-match`, the SDK's `ifMatch`).
|
|
354
357
|
*/
|
|
355
|
-
"manifest_changed",
|
|
358
|
+
"manifest_changed",
|
|
359
|
+
/**
|
|
360
|
+
* An agent folder that does not compile (track T6): `422` when it is saved or planned.
|
|
361
|
+
* `details.diagnostics` names every problem, each with its file and, for parse and schema
|
|
362
|
+
* errors, its line and column.
|
|
363
|
+
*/
|
|
364
|
+
"folder_invalid", "internal_error"];
|
|
356
365
|
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
357
366
|
export declare const TENANT_ID_PATTERN: RegExp;
|
|
358
367
|
export declare const PRINCIPAL_ID_PATTERN: RegExp;
|
package/dist/compatibility.js
CHANGED
|
@@ -199,6 +199,9 @@ export const PROTOCOL_FEATURES = [
|
|
|
199
199
|
* `gateway-credentials`: a `bearer` or `headers` credential with `via`, written to an Agent's vault,
|
|
200
200
|
* may name the gateway's tool prefix (`toolPrefix`), which the Runtime takes off the tools it lists
|
|
201
201
|
* and puts back on each call.
|
|
202
|
+
* `agent-folders`: `PUT /v1/agent-manifests/{name}` also takes an agent folder by hash
|
|
203
|
+
* (`application/vnd.nylorun.folder+json`), compiles it with `@nylorun/core/folder` and keeps it
|
|
204
|
+
* as the version's source, read at `GET .../versions/{v}/source` and `.../source/files/{path}`.
|
|
202
205
|
*/
|
|
203
206
|
export const OPTIONAL_HOST_FEATURES = [
|
|
204
207
|
"tenant-fixture-model",
|
|
@@ -219,6 +222,7 @@ export const OPTIONAL_HOST_FEATURES = [
|
|
|
219
222
|
/** Opt-in artifact metadata pages (`GET /v1/artifacts?limit=…`). */
|
|
220
223
|
"artifact-reads",
|
|
221
224
|
"gateway-credentials",
|
|
225
|
+
"agent-folders",
|
|
222
226
|
];
|
|
223
227
|
/**
|
|
224
228
|
* What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
|
|
@@ -381,6 +385,12 @@ export const ERROR_CODES = [
|
|
|
381
385
|
* again, or save without `If-Match` (the CLI's `--if-match`, the SDK's `ifMatch`).
|
|
382
386
|
*/
|
|
383
387
|
"manifest_changed",
|
|
388
|
+
/**
|
|
389
|
+
* An agent folder that does not compile (track T6): `422` when it is saved or planned.
|
|
390
|
+
* `details.diagnostics` names every problem, each with its file and, for parse and schema
|
|
391
|
+
* errors, its line and column.
|
|
392
|
+
*/
|
|
393
|
+
"folder_invalid",
|
|
384
394
|
"internal_error",
|
|
385
395
|
];
|
|
386
396
|
/** Crockford Base32 alphabet (lowercase); excludes i, l, o, u. */
|
package/dist/contracts.d.ts
CHANGED
|
@@ -2159,6 +2159,33 @@ export declare const AgentManifestSavedBySchema: z.ZodObject<{
|
|
|
2159
2159
|
actor: z.ZodString;
|
|
2160
2160
|
}, z.core.$strict>;
|
|
2161
2161
|
/** One version of an agent manifest. */
|
|
2162
|
+
/**
|
|
2163
|
+
* One problem or remark about an agent folder (track T6): an `error` keeps it from compiling.
|
|
2164
|
+
* `file` is the path in the folder, with the line and column when known; `pointer` the field in
|
|
2165
|
+
* the manifest.
|
|
2166
|
+
*/
|
|
2167
|
+
export declare const AgentFolderDiagnosticSchema: z.ZodObject<{
|
|
2168
|
+
severity: z.ZodEnum<{
|
|
2169
|
+
error: "error";
|
|
2170
|
+
info: "info";
|
|
2171
|
+
note: "note";
|
|
2172
|
+
warning: "warning";
|
|
2173
|
+
}>;
|
|
2174
|
+
code: z.ZodString;
|
|
2175
|
+
message: z.ZodString;
|
|
2176
|
+
file: z.ZodOptional<z.ZodString>;
|
|
2177
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
2178
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
2179
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
2180
|
+
}, z.core.$strict>;
|
|
2181
|
+
export type AgentFolderDiagnostic = z.infer<typeof AgentFolderDiagnosticSchema>;
|
|
2182
|
+
/** The folder a version was compiled from (track T6): the compiler that built it, and its size. */
|
|
2183
|
+
export declare const AgentManifestSourceSummarySchema: z.ZodObject<{
|
|
2184
|
+
compiler: z.ZodString;
|
|
2185
|
+
files: z.ZodNumber;
|
|
2186
|
+
bytes: z.ZodNumber;
|
|
2187
|
+
}, z.core.$strict>;
|
|
2188
|
+
export type AgentManifestSourceSummary = z.infer<typeof AgentManifestSourceSummarySchema>;
|
|
2162
2189
|
export declare const AgentManifestViewSchema: z.ZodObject<{
|
|
2163
2190
|
name: z.ZodString;
|
|
2164
2191
|
version: z.ZodNumber;
|
|
@@ -2264,7 +2291,53 @@ export declare const AgentManifestViewSchema: z.ZodObject<{
|
|
|
2264
2291
|
}, z.core.$strict>;
|
|
2265
2292
|
createdAt: z.ZodString;
|
|
2266
2293
|
agents: z.ZodNumber;
|
|
2294
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
2295
|
+
compiler: z.ZodString;
|
|
2296
|
+
files: z.ZodNumber;
|
|
2297
|
+
bytes: z.ZodNumber;
|
|
2298
|
+
}, z.core.$strict>>;
|
|
2299
|
+
}, z.core.$strict>;
|
|
2300
|
+
/** One file of an agent folder: its path, size and SHA-256 (lowercase hex). */
|
|
2301
|
+
export declare const AgentFolderEntrySchema: z.ZodObject<{
|
|
2302
|
+
path: z.ZodString;
|
|
2303
|
+
size: z.ZodNumber;
|
|
2304
|
+
sha256: z.ZodString;
|
|
2305
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
2306
|
+
mode: z.ZodOptional<z.ZodNumber>;
|
|
2307
|
+
}, z.core.$strict>;
|
|
2308
|
+
export type AgentFolderEntry = z.infer<typeof AgentFolderEntrySchema>;
|
|
2309
|
+
/** The media type of an agent folder sent by hash to `PUT /v1/agent-manifests/{name}`. */
|
|
2310
|
+
export declare const AGENT_FOLDER_MEDIA_TYPE = "application/vnd.nylorun.folder+json";
|
|
2311
|
+
/**
|
|
2312
|
+
* `PUT /v1/agent-manifests/{name}` with `Content-Type: application/vnd.nylorun.folder+json`
|
|
2313
|
+
* (track T6): an agent folder by hash, each file uploaded first with `PUT /v1/files/sha256:<hex>`.
|
|
2314
|
+
*/
|
|
2315
|
+
export declare const PutAgentFolderRequestSchema: z.ZodObject<{
|
|
2316
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
2317
|
+
format: z.ZodLiteral<"nylorun.folder.v2">;
|
|
2318
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
2319
|
+
path: z.ZodString;
|
|
2320
|
+
size: z.ZodNumber;
|
|
2321
|
+
sha256: z.ZodString;
|
|
2322
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
2323
|
+
mode: z.ZodOptional<z.ZodNumber>;
|
|
2324
|
+
}, z.core.$strict>>;
|
|
2325
|
+
}, z.core.$strict>;
|
|
2326
|
+
export type PutAgentFolderRequest = z.infer<typeof PutAgentFolderRequestSchema>;
|
|
2327
|
+
/** `GET /v1/agent-manifests/{name}/versions/{v}/source`: the folder a version was compiled from. */
|
|
2328
|
+
export declare const AgentManifestSourceSchema: z.ZodObject<{
|
|
2329
|
+
name: z.ZodString;
|
|
2330
|
+
version: z.ZodNumber;
|
|
2331
|
+
compiler: z.ZodString;
|
|
2332
|
+
files: z.ZodNumber;
|
|
2333
|
+
bytes: z.ZodNumber;
|
|
2334
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
2335
|
+
path: z.ZodString;
|
|
2336
|
+
size: z.ZodNumber;
|
|
2337
|
+
sha256: z.ZodString;
|
|
2338
|
+
}, z.core.$strict>>;
|
|
2267
2339
|
}, z.core.$strict>;
|
|
2340
|
+
export type AgentManifestSource = z.infer<typeof AgentManifestSourceSchema>;
|
|
2268
2341
|
export type AgentManifestView = z.infer<typeof AgentManifestViewSchema>;
|
|
2269
2342
|
/** `GET /v1/agent-manifests`: each manifest's latest version, by name. */
|
|
2270
2343
|
export declare const ListAgentManifestsResponseSchema: z.ZodObject<{
|
|
@@ -2373,6 +2446,11 @@ export declare const ListAgentManifestsResponseSchema: z.ZodObject<{
|
|
|
2373
2446
|
}, z.core.$strict>;
|
|
2374
2447
|
createdAt: z.ZodString;
|
|
2375
2448
|
agents: z.ZodNumber;
|
|
2449
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
2450
|
+
compiler: z.ZodString;
|
|
2451
|
+
files: z.ZodNumber;
|
|
2452
|
+
bytes: z.ZodNumber;
|
|
2453
|
+
}, z.core.$strict>>;
|
|
2376
2454
|
}, z.core.$strict>>;
|
|
2377
2455
|
}, z.core.$strict>;
|
|
2378
2456
|
export type ListAgentManifestsResponse = z.infer<typeof ListAgentManifestsResponseSchema>;
|
|
@@ -2452,6 +2530,117 @@ export declare const AgentManifestPlanSchema: z.ZodObject<{
|
|
|
2452
2530
|
nextStart: z.ZodNumber;
|
|
2453
2531
|
secrets: z.ZodNumber;
|
|
2454
2532
|
}, z.core.$strict>;
|
|
2533
|
+
manifest: z.ZodOptional<z.ZodObject<{
|
|
2534
|
+
manifestSchemaVersion: z.ZodLiteral<8>;
|
|
2535
|
+
name: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2536
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2537
|
+
metadata: z.ZodOptional<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
|
|
2538
|
+
harness: z.ZodUnion<readonly [z.ZodType<WorkflowHarnessSection, unknown, z.core.$ZodTypeInternals<WorkflowHarnessSection, unknown>>, z.ZodType<AgentHarnessSection, unknown, z.core.$ZodTypeInternals<AgentHarnessSection, unknown>>]>;
|
|
2539
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
2540
|
+
kind: z.ZodEnum<{
|
|
2541
|
+
none: "none";
|
|
2542
|
+
pod: "pod";
|
|
2543
|
+
virtual: "virtual";
|
|
2544
|
+
}>;
|
|
2545
|
+
image: z.ZodOptional<z.ZodString>;
|
|
2546
|
+
resources: z.ZodOptional<z.ZodObject<{
|
|
2547
|
+
cpus: z.ZodOptional<z.ZodNumber>;
|
|
2548
|
+
memory: z.ZodOptional<z.ZodString>;
|
|
2549
|
+
}, z.core.$strict>>;
|
|
2550
|
+
storage: z.ZodOptional<z.ZodString>;
|
|
2551
|
+
network: z.ZodOptional<z.ZodObject<{
|
|
2552
|
+
allowedHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2553
|
+
}, z.core.$strict>>;
|
|
2554
|
+
lifecycle: z.ZodOptional<z.ZodObject<{
|
|
2555
|
+
idle: z.ZodOptional<z.ZodString>;
|
|
2556
|
+
deleteAfter: z.ZodOptional<z.ZodString>;
|
|
2557
|
+
}, z.core.$strict>>;
|
|
2558
|
+
setup: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2559
|
+
command: z.ZodString;
|
|
2560
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
2561
|
+
timeout: z.ZodOptional<z.ZodString>;
|
|
2562
|
+
}, z.core.$strict>>>;
|
|
2563
|
+
files: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
2564
|
+
artifactId: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2565
|
+
version: z.ZodNumber;
|
|
2566
|
+
path: z.ZodString;
|
|
2567
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2568
|
+
path: z.ZodString;
|
|
2569
|
+
files: z.ZodRecord<z.ZodString, z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
|
|
2570
|
+
}, z.core.$strict>]>>>;
|
|
2571
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
2572
|
+
artifacts: z.ZodOptional<z.ZodObject<{
|
|
2573
|
+
fileBytes: z.ZodOptional<z.ZodNumber>;
|
|
2574
|
+
totalBytes: z.ZodOptional<z.ZodNumber>;
|
|
2575
|
+
}, z.core.$strict>>;
|
|
2576
|
+
skills: z.ZodOptional<z.ZodObject<{
|
|
2577
|
+
totalBytes: z.ZodOptional<z.ZodNumber>;
|
|
2578
|
+
}, z.core.$strict>>;
|
|
2579
|
+
disk: z.ZodOptional<z.ZodObject<{
|
|
2580
|
+
versionBytes: z.ZodOptional<z.ZodNumber>;
|
|
2581
|
+
versionEntries: z.ZodOptional<z.ZodNumber>;
|
|
2582
|
+
}, z.core.$strict>>;
|
|
2583
|
+
}, z.core.$strict>>;
|
|
2584
|
+
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2585
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2586
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2587
|
+
type: z.ZodLiteral<"environment_secret">;
|
|
2588
|
+
allowedHosts: z.ZodArray<z.ZodString>;
|
|
2589
|
+
inject: z.ZodOptional<z.ZodObject<{
|
|
2590
|
+
header: z.ZodString;
|
|
2591
|
+
format: z.ZodString;
|
|
2592
|
+
}, z.core.$strict>>;
|
|
2593
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2594
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2595
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2596
|
+
type: z.ZodLiteral<"environment_variable">;
|
|
2597
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2598
|
+
via: z.ZodOptional<z.ZodString>;
|
|
2599
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
2600
|
+
header: z.ZodString;
|
|
2601
|
+
}, z.core.$strict>>;
|
|
2602
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2603
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2604
|
+
type: z.ZodLiteral<"bearer">;
|
|
2605
|
+
url: z.ZodString;
|
|
2606
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2607
|
+
via: z.ZodOptional<z.ZodString>;
|
|
2608
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
2609
|
+
header: z.ZodString;
|
|
2610
|
+
}, z.core.$strict>>;
|
|
2611
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2612
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2613
|
+
type: z.ZodLiteral<"headers">;
|
|
2614
|
+
url: z.ZodString;
|
|
2615
|
+
}, z.core.$strict>], "type">>>;
|
|
2616
|
+
triggers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2617
|
+
schedule: z.ZodOptional<z.ZodString>;
|
|
2618
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
2619
|
+
at: z.ZodOptional<z.ZodISODateTime>;
|
|
2620
|
+
webhook: z.ZodOptional<z.ZodEnum<{
|
|
2621
|
+
"standard-webhooks": "standard-webhooks";
|
|
2622
|
+
}>>;
|
|
2623
|
+
session: z.ZodString;
|
|
2624
|
+
prompt: z.ZodString;
|
|
2625
|
+
}, z.core.$strict>>>;
|
|
2626
|
+
selfWake: z.ZodOptional<z.ZodBoolean>;
|
|
2627
|
+
}, z.core.$strict>>;
|
|
2628
|
+
}, z.core.$strict>>;
|
|
2629
|
+
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2630
|
+
severity: z.ZodEnum<{
|
|
2631
|
+
error: "error";
|
|
2632
|
+
info: "info";
|
|
2633
|
+
note: "note";
|
|
2634
|
+
warning: "warning";
|
|
2635
|
+
}>;
|
|
2636
|
+
code: z.ZodString;
|
|
2637
|
+
message: z.ZodString;
|
|
2638
|
+
file: z.ZodOptional<z.ZodString>;
|
|
2639
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
2640
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
2641
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
2642
|
+
}, z.core.$strict>>>;
|
|
2643
|
+
compiler: z.ZodOptional<z.ZodString>;
|
|
2455
2644
|
}, z.core.$strict>;
|
|
2456
2645
|
export type AgentManifestPlan = z.infer<typeof AgentManifestPlanSchema>;
|
|
2457
2646
|
/** `PUT /v1/agent-manifests/{name}`: the version saved (or the latest, unchanged). */
|
|
@@ -2561,12 +2750,31 @@ export declare const SaveAgentManifestResponseSchema: z.ZodObject<{
|
|
|
2561
2750
|
}, z.core.$strict>;
|
|
2562
2751
|
createdAt: z.ZodString;
|
|
2563
2752
|
agents: z.ZodNumber;
|
|
2753
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
2754
|
+
compiler: z.ZodString;
|
|
2755
|
+
files: z.ZodNumber;
|
|
2756
|
+
bytes: z.ZodNumber;
|
|
2757
|
+
}, z.core.$strict>>;
|
|
2564
2758
|
}, z.core.$strict>;
|
|
2565
2759
|
unchanged: z.ZodBoolean;
|
|
2566
2760
|
warnings: z.ZodArray<z.ZodObject<{
|
|
2567
2761
|
code: z.ZodString;
|
|
2568
2762
|
message: z.ZodString;
|
|
2569
2763
|
}, z.core.$strict>>;
|
|
2764
|
+
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2765
|
+
severity: z.ZodEnum<{
|
|
2766
|
+
error: "error";
|
|
2767
|
+
info: "info";
|
|
2768
|
+
note: "note";
|
|
2769
|
+
warning: "warning";
|
|
2770
|
+
}>;
|
|
2771
|
+
code: z.ZodString;
|
|
2772
|
+
message: z.ZodString;
|
|
2773
|
+
file: z.ZodOptional<z.ZodString>;
|
|
2774
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
2775
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
2776
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
2777
|
+
}, z.core.$strict>>>;
|
|
2570
2778
|
}, z.core.$strict>;
|
|
2571
2779
|
export type SaveAgentManifestResponse = z.infer<typeof SaveAgentManifestResponseSchema>;
|
|
2572
2780
|
export declare const DeleteAgentManifestResponseSchema: z.ZodObject<{
|
|
@@ -3759,6 +3967,7 @@ export declare const RejectedResponseSchema: z.ZodObject<{
|
|
|
3759
3967
|
credential_rejected: "credential_rejected";
|
|
3760
3968
|
credential_required: "credential_required";
|
|
3761
3969
|
definition_files_missing: "definition_files_missing";
|
|
3970
|
+
folder_invalid: "folder_invalid";
|
|
3762
3971
|
harness_mismatch: "harness_mismatch";
|
|
3763
3972
|
host_rejected: "host_rejected";
|
|
3764
3973
|
incompatible_host: "incompatible_host";
|
|
@@ -6622,6 +6831,7 @@ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
|
|
|
6622
6831
|
credential_rejected: "credential_rejected";
|
|
6623
6832
|
credential_required: "credential_required";
|
|
6624
6833
|
definition_files_missing: "definition_files_missing";
|
|
6834
|
+
folder_invalid: "folder_invalid";
|
|
6625
6835
|
harness_mismatch: "harness_mismatch";
|
|
6626
6836
|
host_rejected: "host_rejected";
|
|
6627
6837
|
incompatible_host: "incompatible_host";
|
package/dist/contracts.js
CHANGED
|
@@ -1999,6 +1999,32 @@ export const PutAgentManifestRequestSchema = AgentManifestV8Schema.extend({
|
|
|
1999
1999
|
/** Who saved a version: the subject a request acted for, else `application`. */
|
|
2000
2000
|
export const AgentManifestSavedBySchema = z.object({ actor: z.string() }).strict();
|
|
2001
2001
|
/** One version of an agent manifest. */
|
|
2002
|
+
/**
|
|
2003
|
+
* One problem or remark about an agent folder (track T6): an `error` keeps it from compiling.
|
|
2004
|
+
* `file` is the path in the folder, with the line and column when known; `pointer` the field in
|
|
2005
|
+
* the manifest.
|
|
2006
|
+
*/
|
|
2007
|
+
export const AgentFolderDiagnosticSchema = z
|
|
2008
|
+
.object({
|
|
2009
|
+
severity: z.enum(["error", "warning", "info", "note"]),
|
|
2010
|
+
code: z.string(),
|
|
2011
|
+
message: z.string(),
|
|
2012
|
+
file: z.string().optional(),
|
|
2013
|
+
line: z.number().int().positive().optional(),
|
|
2014
|
+
column: z.number().int().positive().optional(),
|
|
2015
|
+
pointer: z.string().optional(),
|
|
2016
|
+
})
|
|
2017
|
+
.strict()
|
|
2018
|
+
.meta({ id: "AgentFolderDiagnostic" });
|
|
2019
|
+
/** The folder a version was compiled from (track T6): the compiler that built it, and its size. */
|
|
2020
|
+
export const AgentManifestSourceSummarySchema = z
|
|
2021
|
+
.object({
|
|
2022
|
+
/** The compiler format, such as `agent-folder/1`. */
|
|
2023
|
+
compiler: z.string(),
|
|
2024
|
+
files: z.number().int().nonnegative(),
|
|
2025
|
+
bytes: z.number().int().nonnegative(),
|
|
2026
|
+
})
|
|
2027
|
+
.strict();
|
|
2002
2028
|
export const AgentManifestViewSchema = z
|
|
2003
2029
|
.object({
|
|
2004
2030
|
name: z.string(),
|
|
@@ -2010,6 +2036,43 @@ export const AgentManifestViewSchema = z
|
|
|
2010
2036
|
createdAt: z.string(),
|
|
2011
2037
|
/** How many Agents were made from this version. */
|
|
2012
2038
|
agents: z.number().int().nonnegative(),
|
|
2039
|
+
/** The folder it was compiled from; absent for a version saved as JSON. */
|
|
2040
|
+
source: AgentManifestSourceSummarySchema.optional(),
|
|
2041
|
+
})
|
|
2042
|
+
.strict();
|
|
2043
|
+
/** One file of an agent folder: its path, size and SHA-256 (lowercase hex). */
|
|
2044
|
+
export const AgentFolderEntrySchema = z
|
|
2045
|
+
.object({
|
|
2046
|
+
path: z.string().min(1).max(1024),
|
|
2047
|
+
size: z.number().int().nonnegative(),
|
|
2048
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/, { message: "sha256 is 64 lowercase hex digits" }),
|
|
2049
|
+
contentType: z.string().optional(),
|
|
2050
|
+
mode: z.number().int().nonnegative().max(0o7777).optional(),
|
|
2051
|
+
})
|
|
2052
|
+
.strict();
|
|
2053
|
+
/** The media type of an agent folder sent by hash to `PUT /v1/agent-manifests/{name}`. */
|
|
2054
|
+
export const AGENT_FOLDER_MEDIA_TYPE = "application/vnd.nylorun.folder+json";
|
|
2055
|
+
/**
|
|
2056
|
+
* `PUT /v1/agent-manifests/{name}` with `Content-Type: application/vnd.nylorun.folder+json`
|
|
2057
|
+
* (track T6): an agent folder by hash, each file uploaded first with `PUT /v1/files/sha256:<hex>`.
|
|
2058
|
+
*/
|
|
2059
|
+
export const PutAgentFolderRequestSchema = z
|
|
2060
|
+
.object({
|
|
2061
|
+
requestId: RequestIdSchema.optional(),
|
|
2062
|
+
format: z.literal("nylorun.folder.v2"),
|
|
2063
|
+
entries: z.array(AgentFolderEntrySchema),
|
|
2064
|
+
})
|
|
2065
|
+
.strict();
|
|
2066
|
+
/** `GET /v1/agent-manifests/{name}/versions/{v}/source`: the folder a version was compiled from. */
|
|
2067
|
+
export const AgentManifestSourceSchema = z
|
|
2068
|
+
.object({
|
|
2069
|
+
name: z.string(),
|
|
2070
|
+
version: z.number().int().positive(),
|
|
2071
|
+
compiler: z.string(),
|
|
2072
|
+
files: z.number().int().nonnegative(),
|
|
2073
|
+
bytes: z.number().int().nonnegative(),
|
|
2074
|
+
/** Every file, sorted by path. */
|
|
2075
|
+
entries: z.array(z.object({ path: z.string(), size: z.number().int().nonnegative(), sha256: z.string() }).strict()),
|
|
2013
2076
|
})
|
|
2014
2077
|
.strict();
|
|
2015
2078
|
/** `GET /v1/agent-manifests`: each manifest's latest version, by name. */
|
|
@@ -2074,6 +2137,12 @@ export const AgentManifestPlanSchema = z
|
|
|
2074
2137
|
secrets: z.number().int().nonnegative(),
|
|
2075
2138
|
})
|
|
2076
2139
|
.strict(),
|
|
2140
|
+
/** An agent folder's only: the manifest it compiles to. */
|
|
2141
|
+
manifest: AgentManifestV8Schema.optional(),
|
|
2142
|
+
/** An agent folder's only: what the compiler noted, none of them errors. */
|
|
2143
|
+
diagnostics: z.array(AgentFolderDiagnosticSchema).optional(),
|
|
2144
|
+
/** An agent folder's only: the compiler format, such as `agent-folder/1`. */
|
|
2145
|
+
compiler: z.string().optional(),
|
|
2077
2146
|
})
|
|
2078
2147
|
.strict();
|
|
2079
2148
|
/** `PUT /v1/agent-manifests/{name}`: the version saved (or the latest, unchanged). */
|
|
@@ -2082,6 +2151,8 @@ export const SaveAgentManifestResponseSchema = z
|
|
|
2082
2151
|
manifest: AgentManifestViewSchema,
|
|
2083
2152
|
unchanged: z.boolean(),
|
|
2084
2153
|
warnings: z.array(AgentManifestWarningSchema),
|
|
2154
|
+
/** An agent folder's only: what the compiler noted, none of them errors. */
|
|
2155
|
+
diagnostics: z.array(AgentFolderDiagnosticSchema).optional(),
|
|
2085
2156
|
})
|
|
2086
2157
|
.strict();
|
|
2087
2158
|
export const DeleteAgentManifestResponseSchema = z
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type AgentManifestV8 } from "../contracts.js";
|
|
2
|
+
/** The compiler format this version builds: a folder with no `format`, or `format: 1`. */
|
|
3
|
+
export declare const AGENT_FOLDER_COMPILER = "agent-folder/1";
|
|
4
|
+
/** What a folder may hold. Fixed in this version; Tenant settings come later. */
|
|
5
|
+
export declare const AGENT_FOLDER_LIMITS: Readonly<{
|
|
6
|
+
/** Files in one folder. */
|
|
7
|
+
files: 2000;
|
|
8
|
+
/** Every file's bytes together. */
|
|
9
|
+
totalBytes: number;
|
|
10
|
+
/** One Markdown or JSON file the compiler reads. */
|
|
11
|
+
textFileBytes: number;
|
|
12
|
+
}>;
|
|
13
|
+
/** One file of a folder: its `/`-separated path, size and SHA-256 (lowercase hex). */
|
|
14
|
+
export interface AgentFolderEntry {
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly size: number;
|
|
17
|
+
readonly sha256: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One problem or remark: an `error` keeps the folder from compiling; `warning`, `info` and
|
|
21
|
+
* `note` do not. `file` is the folder path it is about, with the line and column when known,
|
|
22
|
+
* and `pointer` the field in the manifest when it is about one.
|
|
23
|
+
*/
|
|
24
|
+
export interface AgentFolderDiagnostic {
|
|
25
|
+
readonly severity: "error" | "warning" | "info" | "note";
|
|
26
|
+
readonly code: string;
|
|
27
|
+
readonly message: string;
|
|
28
|
+
readonly file?: string;
|
|
29
|
+
readonly line?: number;
|
|
30
|
+
readonly column?: number;
|
|
31
|
+
readonly pointer?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CompileAgentFolderInput {
|
|
34
|
+
readonly entries: readonly AgentFolderEntry[];
|
|
35
|
+
/** The bytes of each file `folderTextPaths(entries)` names. */
|
|
36
|
+
readonly files: ReadonlyMap<string, Uint8Array>;
|
|
37
|
+
/** The name the manifest must have: the path's, or the folder's. */
|
|
38
|
+
readonly name?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface CompiledAgentFolder {
|
|
41
|
+
/** The manifest, when nothing is an error. */
|
|
42
|
+
readonly manifest?: AgentManifestV8;
|
|
43
|
+
readonly diagnostics: readonly AgentFolderDiagnostic[];
|
|
44
|
+
readonly compiler: typeof AGENT_FOLDER_COMPILER;
|
|
45
|
+
}
|
|
46
|
+
/** The files the compiler reads: the Runtime and the CLI pass their bytes in. */
|
|
47
|
+
export declare function folderTextPaths(entries: readonly AgentFolderEntry[]): string[];
|
|
48
|
+
/** Compiles an agent folder into agent manifest v8, with every diagnostic. */
|
|
49
|
+
export declare function compileAgentFolder(input: CompileAgentFolderInput): CompiledAgentFolder;
|