@nylorun/core 0.23.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 +24 -0
- package/dist/compatibility.d.ts +96 -39
- package/dist/compatibility.js +97 -40
- package/dist/contracts.d.ts +2316 -842
- package/dist/contracts.js +1010 -407
- package/dist/define.d.ts +1 -0
- package/dist/define.js +1 -0
- package/dist/definition/removed.d.ts +7 -0
- package/dist/definition/removed.js +21 -1
- package/dist/definition/sections.d.ts +63 -0
- package/dist/definition/sections.js +204 -0
- package/dist/harness-api/harness-api.schema.json +182 -6
- package/dist/harness-api/index.d.ts +3 -3
- package/dist/harness-api/index.js +3 -3
- package/dist/harness-api/json-schema.js +2 -2
- package/dist/harness-api/messages.d.ts +5 -3
- package/dist/harness-api/messages.js +1 -1
- package/dist/harness-api/schema.d.ts +76 -7
- package/dist/harness-api/schema.js +52 -8
- package/dist/manifest-schemas.d.ts +9 -5
- package/dist/manifest-schemas.js +23 -27
- package/dist/schemas/agent-manifest.schema.json +1534 -250
- package/dist/schemas/harness-manifest.schema.json +1273 -0
- package/dist/schemas/{environment-manifest.schema.json → runtime-manifest.schema.json} +109 -68
- package/dist/types/manifest.d.ts +69 -1
- package/dist/types/manifest.js +4 -0
- package/dist/types/model.d.ts +5 -0
- package/dist/utils/memory.d.ts +64 -0
- package/dist/utils/memory.js +139 -0
- package/dist/utils/runtime-limits.d.ts +53 -2
- package/dist/utils/runtime-limits.js +104 -1
- package/package.json +6 -5
|
@@ -11,7 +11,7 @@ import * as mcp from "./mcp.js";
|
|
|
11
11
|
import * as entries from "./entries.js";
|
|
12
12
|
import * as transport from "./transport.js";
|
|
13
13
|
import { HARNESS_API_VERSION } from "./messages.js";
|
|
14
|
-
import { ArtifactMetaSchema, EffectIntentSchema, FrameSchema, HarnessCheckpointSchema, IntentAnswerSchema, ModelDescriptorSchema, EffectTargetSchema,
|
|
14
|
+
import { ArtifactMetaSchema, EffectIntentSchema, FrameSchema, HarnessCheckpointSchema, IntentAnswerSchema, ModelDescriptorSchema, EffectTargetSchema, TurnAgentSchema, OutcomeAnswerSchema, RecordedOutcomeSchema, RunGrantSchema, RunRoutingSchema, TraceContextSchema, TranscriptUpdateSchema, TurnOutputSchema, TurnStartSchema, coreMessages, coreRequests, harnessRequests, } from "./schema.js";
|
|
15
15
|
const named = {
|
|
16
16
|
ArtifactMetaSchema,
|
|
17
17
|
EffectIntentSchema,
|
|
@@ -20,7 +20,7 @@ const named = {
|
|
|
20
20
|
IntentAnswerSchema,
|
|
21
21
|
ModelDescriptorSchema,
|
|
22
22
|
EffectTargetSchema,
|
|
23
|
-
|
|
23
|
+
TurnAgentSchema,
|
|
24
24
|
OutcomeAnswerSchema,
|
|
25
25
|
RecordedOutcomeSchema,
|
|
26
26
|
RunGrantSchema,
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* which a socket validates it with.
|
|
11
11
|
*/
|
|
12
12
|
import type { z } from "zod";
|
|
13
|
-
import type { ArtifactMetaSchema, CompactionFactsSchema, EffectIntentSchema, EffectTargetSchema, IntentAnswerSchema, ModelDescriptorSchema, OutcomeAnswerSchema, RecordedOutcomeSchema, ReleaseReasonSchema, RequestTypes, RunGrantSchema, RunRoutingSchema, TraceContextSchema,
|
|
14
|
-
export declare const HARNESS_API_VERSION =
|
|
13
|
+
import type { ArtifactMetaSchema, CompactionFactsSchema, EffectIntentSchema, EffectTargetSchema, IntentAnswerSchema, ModelDescriptorSchema, OutcomeAnswerSchema, RecordedOutcomeSchema, ReleaseReasonSchema, RequestTypes, RunGrantSchema, RunRoutingSchema, TraceContextSchema, TurnAgentSchema, TurnMemorySchema, TurnOutputSchema, TurnStartSchema, WorkspaceCallSchema, WorkspaceDiskCallSchema, WorkspaceRecordSchema, WorkspaceSessionSchema, coreMessages, coreRequests, harnessRequests } from "./schema.js";
|
|
14
|
+
export declare const HARNESS_API_VERSION = 5;
|
|
15
15
|
/** Why core stopped a run. Matches the advance's abort kinds. */
|
|
16
16
|
export declare const ABORT_REASONS: readonly ["cancel", "shutdown", "deadline", "ownership.lost"];
|
|
17
17
|
export type AbortReason = (typeof ABORT_REASONS)[number];
|
|
@@ -42,7 +42,9 @@ export type EffectIntent = z.infer<typeof EffectIntentSchema>;
|
|
|
42
42
|
/** What a tool call runs: the record routes it by `kind` (protocol 15). */
|
|
43
43
|
export type EffectTarget = z.infer<typeof EffectTargetSchema>;
|
|
44
44
|
/** The Environment a turn runs in (`turn.start.environment`, protocol 15). */
|
|
45
|
-
export type
|
|
45
|
+
export type TurnAgent = z.infer<typeof TurnAgentSchema>;
|
|
46
|
+
/** The Agent's memory as a turn starts (`turn.start.memory`, track T5). */
|
|
47
|
+
export type TurnMemory = z.infer<typeof TurnMemorySchema>;
|
|
46
48
|
/** An artifact as the artifact seam shows it to a harness (`artifact.read`, `artifact.write`). */
|
|
47
49
|
export type ArtifactMeta = z.infer<typeof ArtifactMetaSchema>;
|
|
48
50
|
/** One `artifact.read` answer: the artifact, and up to one chunk of its bytes from `offset`. */
|
|
@@ -113,6 +113,12 @@ export declare const EffectTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
113
113
|
kind: z.ZodLiteral<"sandbox">;
|
|
114
114
|
}, z.core.$strict>, z.ZodObject<{
|
|
115
115
|
kind: z.ZodLiteral<"harness">;
|
|
116
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
117
|
+
kind: z.ZodLiteral<"runtime">;
|
|
118
|
+
operation: z.ZodEnum<{
|
|
119
|
+
memory: "memory";
|
|
120
|
+
schedule_wake: "schedule_wake";
|
|
121
|
+
}>;
|
|
116
122
|
}, z.core.$strict>], "kind">;
|
|
117
123
|
/**
|
|
118
124
|
* One effect the engine asks for: a `HostEffect`, by structure. Model intents carry no `input`.
|
|
@@ -167,6 +173,12 @@ export declare const EffectIntentSchema: z.ZodObject<{
|
|
|
167
173
|
kind: z.ZodLiteral<"sandbox">;
|
|
168
174
|
}, z.core.$strict>, z.ZodObject<{
|
|
169
175
|
kind: z.ZodLiteral<"harness">;
|
|
176
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
177
|
+
kind: z.ZodLiteral<"runtime">;
|
|
178
|
+
operation: z.ZodEnum<{
|
|
179
|
+
memory: "memory";
|
|
180
|
+
schedule_wake: "schedule_wake";
|
|
181
|
+
}>;
|
|
170
182
|
}, z.core.$strict>], "kind">>;
|
|
171
183
|
skill: z.ZodOptional<z.ZodString>;
|
|
172
184
|
purpose: z.ZodOptional<z.ZodLiteral<"summary">>;
|
|
@@ -333,8 +345,10 @@ export declare const RunRoutingSchema: z.ZodObject<{
|
|
|
333
345
|
/**
|
|
334
346
|
* The fields of `TurnStart.checkpoint` a harness reads (R4.2); the rest are our engine's. An
|
|
335
347
|
* agent turn's `input` is the turn's message: a string, `{text, metadata?}`, `{content,
|
|
336
|
-
* metadata?}` with user content parts, `{kind: "
|
|
337
|
-
*
|
|
348
|
+
* metadata?}` with user content parts, `{kind: "messages", messages}` for messages that waited in
|
|
349
|
+
* the session's queue (protocol 17: each one of the shapes before, each its own user message, in
|
|
350
|
+
* order), `{kind: "continue"}` for the next segment of a yielded turn, or an approval or response
|
|
351
|
+
* event. Effect ids are prefixed `<turnId>:<segment>:`
|
|
338
352
|
* (`effectIdOf`), and every intent carries `manifestHash`. `state` is the harness's own, as its
|
|
339
353
|
* last output left it: core stores it unread (at most `limits.harnessStateBytes` for a harness
|
|
340
354
|
* other than ours) and folds the transcript every segment, whatever the state holds. A model
|
|
@@ -377,11 +391,12 @@ export declare const ModelDescriptorSchema: z.ZodObject<{
|
|
|
377
391
|
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
378
392
|
}, z.core.$strict>;
|
|
379
393
|
/**
|
|
380
|
-
* The
|
|
394
|
+
* The Agent a turn runs on (Harness API 5, protocol 16): its id and kind and, when it has a
|
|
381
395
|
* sandbox, the workspace its commands start in. A harness writes the model's instructions and
|
|
382
396
|
* defines its sandbox tools from it; the sandbox's spec is the routing's (`routing.sandbox.spec`).
|
|
397
|
+
* The Agent's runtime section never reaches the harness.
|
|
383
398
|
*/
|
|
384
|
-
export declare const
|
|
399
|
+
export declare const TurnAgentSchema: z.ZodObject<{
|
|
385
400
|
id: z.ZodString;
|
|
386
401
|
kind: z.ZodEnum<{
|
|
387
402
|
none: "none";
|
|
@@ -391,6 +406,24 @@ export declare const TurnEnvironmentSchema: z.ZodObject<{
|
|
|
391
406
|
sandbox: z.ZodOptional<z.ZodObject<{
|
|
392
407
|
workspace: z.ZodString;
|
|
393
408
|
}, z.core.$strict>>;
|
|
409
|
+
selfWake: z.ZodOptional<z.ZodBoolean>;
|
|
410
|
+
}, z.core.$strict>;
|
|
411
|
+
/**
|
|
412
|
+
* The Agent's memory as a turn starts (track T5, D72), present when the version its session runs
|
|
413
|
+
* sets `harness.memory`: its access in every turn, the agent's own `instructions`, and the index a
|
|
414
|
+
* harness pins in the session (one line per memory, newest first, with its description, within
|
|
415
|
+
* the Runtime limits `memoryIndexLines` and `memoryIndexBytes`; `truncated` when some were left
|
|
416
|
+
* out). A harness offers the `memory` tool (a `runtime` effect, operation `memory`), view only for
|
|
417
|
+
* `read_only` and for its sub-agents.
|
|
418
|
+
*/
|
|
419
|
+
export declare const TurnMemorySchema: z.ZodObject<{
|
|
420
|
+
access: z.ZodEnum<{
|
|
421
|
+
read_only: "read_only";
|
|
422
|
+
read_write: "read_write";
|
|
423
|
+
}>;
|
|
424
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
425
|
+
index: z.ZodString;
|
|
426
|
+
truncated: z.ZodBoolean;
|
|
394
427
|
}, z.core.$strict>;
|
|
395
428
|
/** What a run starts from: `turn.start` (message, continue, resume) or `approval.answer`. */
|
|
396
429
|
export declare const TurnStartSchema: z.ZodObject<{
|
|
@@ -403,6 +436,20 @@ export declare const TurnStartSchema: z.ZodObject<{
|
|
|
403
436
|
flow: "flow";
|
|
404
437
|
}>;
|
|
405
438
|
manifest: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
|
|
439
|
+
definition: z.ZodOptional<z.ZodObject<{
|
|
440
|
+
name: z.ZodString;
|
|
441
|
+
version: z.ZodNumber;
|
|
442
|
+
}, z.core.$strict>>;
|
|
443
|
+
loop: z.ZodOptional<z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>>;
|
|
444
|
+
memory: z.ZodOptional<z.ZodObject<{
|
|
445
|
+
access: z.ZodEnum<{
|
|
446
|
+
read_only: "read_only";
|
|
447
|
+
read_write: "read_write";
|
|
448
|
+
}>;
|
|
449
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
450
|
+
index: z.ZodString;
|
|
451
|
+
truncated: z.ZodBoolean;
|
|
452
|
+
}, z.core.$strict>>;
|
|
406
453
|
checkpoint: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
|
|
407
454
|
mcp: z.ZodOptional<z.ZodObject<{
|
|
408
455
|
servers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -476,7 +523,7 @@ export declare const TurnStartSchema: z.ZodObject<{
|
|
|
476
523
|
maxOutputTokens: z.ZodNumber;
|
|
477
524
|
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
478
525
|
}, z.core.$strict>>;
|
|
479
|
-
|
|
526
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
480
527
|
id: z.ZodString;
|
|
481
528
|
kind: z.ZodEnum<{
|
|
482
529
|
none: "none";
|
|
@@ -486,6 +533,7 @@ export declare const TurnStartSchema: z.ZodObject<{
|
|
|
486
533
|
sandbox: z.ZodOptional<z.ZodObject<{
|
|
487
534
|
workspace: z.ZodString;
|
|
488
535
|
}, z.core.$strict>>;
|
|
536
|
+
selfWake: z.ZodOptional<z.ZodBoolean>;
|
|
489
537
|
}, z.core.$strict>>;
|
|
490
538
|
}, z.core.$strict>;
|
|
491
539
|
/**
|
|
@@ -598,7 +646,7 @@ export declare const harnessRequests: {
|
|
|
598
646
|
}, z.core.$strict>;
|
|
599
647
|
}, z.core.$strict>;
|
|
600
648
|
result: z.ZodObject<{
|
|
601
|
-
api: z.ZodLiteral<
|
|
649
|
+
api: z.ZodLiteral<5>;
|
|
602
650
|
tenantId: z.ZodString;
|
|
603
651
|
sandbox: z.ZodObject<{
|
|
604
652
|
backend: z.ZodNullable<z.ZodString>;
|
|
@@ -629,6 +677,20 @@ export declare const harnessRequests: {
|
|
|
629
677
|
flow: "flow";
|
|
630
678
|
}>;
|
|
631
679
|
manifest: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
|
|
680
|
+
definition: z.ZodOptional<z.ZodObject<{
|
|
681
|
+
name: z.ZodString;
|
|
682
|
+
version: z.ZodNumber;
|
|
683
|
+
}, z.core.$strict>>;
|
|
684
|
+
loop: z.ZodOptional<z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>>;
|
|
685
|
+
memory: z.ZodOptional<z.ZodObject<{
|
|
686
|
+
access: z.ZodEnum<{
|
|
687
|
+
read_only: "read_only";
|
|
688
|
+
read_write: "read_write";
|
|
689
|
+
}>;
|
|
690
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
691
|
+
index: z.ZodString;
|
|
692
|
+
truncated: z.ZodBoolean;
|
|
693
|
+
}, z.core.$strict>>;
|
|
632
694
|
checkpoint: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
|
|
633
695
|
mcp: z.ZodOptional<z.ZodObject<{
|
|
634
696
|
servers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -702,7 +764,7 @@ export declare const harnessRequests: {
|
|
|
702
764
|
maxOutputTokens: z.ZodNumber;
|
|
703
765
|
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
704
766
|
}, z.core.$strict>>;
|
|
705
|
-
|
|
767
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
706
768
|
id: z.ZodString;
|
|
707
769
|
kind: z.ZodEnum<{
|
|
708
770
|
none: "none";
|
|
@@ -712,6 +774,7 @@ export declare const harnessRequests: {
|
|
|
712
774
|
sandbox: z.ZodOptional<z.ZodObject<{
|
|
713
775
|
workspace: z.ZodString;
|
|
714
776
|
}, z.core.$strict>>;
|
|
777
|
+
selfWake: z.ZodOptional<z.ZodBoolean>;
|
|
715
778
|
}, z.core.$strict>>;
|
|
716
779
|
}, z.core.$strict>;
|
|
717
780
|
}, z.core.$strict>;
|
|
@@ -771,6 +834,12 @@ export declare const harnessRequests: {
|
|
|
771
834
|
kind: z.ZodLiteral<"sandbox">;
|
|
772
835
|
}, z.core.$strict>, z.ZodObject<{
|
|
773
836
|
kind: z.ZodLiteral<"harness">;
|
|
837
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
838
|
+
kind: z.ZodLiteral<"runtime">;
|
|
839
|
+
operation: z.ZodEnum<{
|
|
840
|
+
memory: "memory";
|
|
841
|
+
schedule_wake: "schedule_wake";
|
|
842
|
+
}>;
|
|
774
843
|
}, z.core.$strict>], "kind">>;
|
|
775
844
|
skill: z.ZodOptional<z.ZodString>;
|
|
776
845
|
purpose: z.ZodOptional<z.ZodLiteral<"summary">>;
|
|
@@ -81,6 +81,13 @@ export const EffectTargetSchema = z.discriminatedUnion("kind", [
|
|
|
81
81
|
z.object({ kind: z.literal("http"), tool: z.string().min(1) }).strict(),
|
|
82
82
|
z.object({ kind: z.literal("sandbox") }).strict(),
|
|
83
83
|
z.object({ kind: z.literal("harness") }).strict(),
|
|
84
|
+
/**
|
|
85
|
+
* An operation the Runtime itself serves, in the transaction that journals the call, keyed by
|
|
86
|
+
* the effect id (track T4): `schedule_wake` books the session's next turn (D77); `memory` (track
|
|
87
|
+
* T5, D72) is a call of the `memory` tool, with Anthropic's memory tool parameters as its input,
|
|
88
|
+
* on the Agent's memories. Answered at once; the harness never executes it.
|
|
89
|
+
*/
|
|
90
|
+
z.object({ kind: z.literal("runtime"), operation: z.enum(["schedule_wake", "memory"]) }).strict(),
|
|
84
91
|
]);
|
|
85
92
|
/**
|
|
86
93
|
* One effect the engine asks for: a `HostEffect`, by structure. Model intents carry no `input`.
|
|
@@ -259,8 +266,10 @@ export const RunRoutingSchema = z
|
|
|
259
266
|
/**
|
|
260
267
|
* The fields of `TurnStart.checkpoint` a harness reads (R4.2); the rest are our engine's. An
|
|
261
268
|
* agent turn's `input` is the turn's message: a string, `{text, metadata?}`, `{content,
|
|
262
|
-
* metadata?}` with user content parts, `{kind: "
|
|
263
|
-
*
|
|
269
|
+
* metadata?}` with user content parts, `{kind: "messages", messages}` for messages that waited in
|
|
270
|
+
* the session's queue (protocol 17: each one of the shapes before, each its own user message, in
|
|
271
|
+
* order), `{kind: "continue"}` for the next segment of a yielded turn, or an approval or response
|
|
272
|
+
* event. Effect ids are prefixed `<turnId>:<segment>:`
|
|
264
273
|
* (`effectIdOf`), and every intent carries `manifestHash`. `state` is the harness's own, as its
|
|
265
274
|
* last output left it: core stores it unread (at most `limits.harnessStateBytes` for a harness
|
|
266
275
|
* other than ours) and folds the transcript every segment, whatever the state holds. A model
|
|
@@ -300,16 +309,38 @@ export const ModelDescriptorSchema = z
|
|
|
300
309
|
})
|
|
301
310
|
.strict();
|
|
302
311
|
/**
|
|
303
|
-
* The
|
|
312
|
+
* The Agent a turn runs on (Harness API 5, protocol 16): its id and kind and, when it has a
|
|
304
313
|
* sandbox, the workspace its commands start in. A harness writes the model's instructions and
|
|
305
314
|
* defines its sandbox tools from it; the sandbox's spec is the routing's (`routing.sandbox.spec`).
|
|
315
|
+
* The Agent's runtime section never reaches the harness.
|
|
306
316
|
*/
|
|
307
|
-
export const
|
|
317
|
+
export const TurnAgentSchema = z
|
|
308
318
|
.object({
|
|
309
319
|
id,
|
|
310
320
|
kind: z.enum(ENVIRONMENT_KINDS),
|
|
311
321
|
/** Present when the session has a sandbox. */
|
|
312
322
|
sandbox: z.object({ workspace: z.string().regex(/^\//) }).strict().optional(),
|
|
323
|
+
/**
|
|
324
|
+
* The version the session runs sets `runtime.selfWake` (track T4, D77): our engine offers
|
|
325
|
+
* `schedule_wake`, a `runtime` effect.
|
|
326
|
+
*/
|
|
327
|
+
selfWake: z.boolean().optional(),
|
|
328
|
+
})
|
|
329
|
+
.strict();
|
|
330
|
+
/**
|
|
331
|
+
* The Agent's memory as a turn starts (track T5, D72), present when the version its session runs
|
|
332
|
+
* sets `harness.memory`: its access in every turn, the agent's own `instructions`, and the index a
|
|
333
|
+
* harness pins in the session (one line per memory, newest first, with its description, within
|
|
334
|
+
* the Runtime limits `memoryIndexLines` and `memoryIndexBytes`; `truncated` when some were left
|
|
335
|
+
* out). A harness offers the `memory` tool (a `runtime` effect, operation `memory`), view only for
|
|
336
|
+
* `read_only` and for its sub-agents.
|
|
337
|
+
*/
|
|
338
|
+
export const TurnMemorySchema = z
|
|
339
|
+
.object({
|
|
340
|
+
access: z.enum(["read_write", "read_only"]),
|
|
341
|
+
instructions: z.string().optional(),
|
|
342
|
+
index: z.string(),
|
|
343
|
+
truncated: z.boolean(),
|
|
313
344
|
})
|
|
314
345
|
.strict();
|
|
315
346
|
/** What a run starts from: `turn.start` (message, continue, resume) or `approval.answer`. */
|
|
@@ -317,8 +348,21 @@ export const TurnStartSchema = z
|
|
|
317
348
|
.object({
|
|
318
349
|
type: z.enum(["turn.start", "approval.answer"]),
|
|
319
350
|
engine: z.enum(["agent", "flow"]),
|
|
320
|
-
/**
|
|
351
|
+
/**
|
|
352
|
+
* The turn's loop manifest: the harness section of the agent manifest version its session
|
|
353
|
+
* pinned, with the manifest's name as its `id` (agent manifest v7's shape), or the workflow
|
|
354
|
+
* manifest (flow). A flow's leaf session gets its embedded agent's.
|
|
355
|
+
*/
|
|
321
356
|
manifest: document,
|
|
357
|
+
/** The agent manifest version the session pinned (protocol 16), for the harness's records. */
|
|
358
|
+
definition: z.object({ name: z.string(), version: z.number().int().positive() }).strict().optional(),
|
|
359
|
+
/**
|
|
360
|
+
* The harness section's `loop` (protocol 16): the harness's own settings, which the Runtime
|
|
361
|
+
* passes on without reading. Ours reads none yet.
|
|
362
|
+
*/
|
|
363
|
+
loop: document.optional(),
|
|
364
|
+
/** The Agent's memory (track T5), when the version its session runs sets `harness.memory`. Absent for a flow. */
|
|
365
|
+
memory: TurnMemorySchema.optional(),
|
|
322
366
|
/** The segment's checkpoint; an agent's state has no transcript (`transcript.cursor`). */
|
|
323
367
|
checkpoint: document,
|
|
324
368
|
/**
|
|
@@ -364,10 +408,10 @@ export const TurnStartSchema = z
|
|
|
364
408
|
*/
|
|
365
409
|
model: ModelDescriptorSchema.optional(),
|
|
366
410
|
/**
|
|
367
|
-
* The
|
|
368
|
-
* and defines the sandbox tools from. Absent
|
|
411
|
+
* The Agent the session runs on (Harness API 5; `environment` before): what our engine writes
|
|
412
|
+
* the sandbox notes and defines the sandbox tools from. Absent for a flow.
|
|
369
413
|
*/
|
|
370
|
-
|
|
414
|
+
agent: TurnAgentSchema.optional(),
|
|
371
415
|
})
|
|
372
416
|
.strict();
|
|
373
417
|
/**
|
|
@@ -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
|
}
|