@nylorun/core 0.53.0-beta → 0.54.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 +114 -99
- package/dist/compatibility.d.ts +39 -12
- package/dist/compatibility.js +37 -10
- package/dist/contracts.d.ts +126 -44
- package/dist/contracts.js +127 -69
- package/dist/define.d.ts +2 -2
- package/dist/define.js +1 -1
- package/dist/definition/bound.d.ts +3 -1
- package/dist/definition/declaration.js +1 -0
- package/dist/definition/delegate.d.ts +7 -4
- package/dist/definition/delegate.js +4 -3
- package/dist/definition/from.js +3 -1
- package/dist/definition/manifest.js +7 -1
- package/dist/definition/sections.d.ts +9 -8
- package/dist/definition/sections.js +13 -5
- package/dist/definition/variant.d.ts +2 -2
- package/dist/definition/variant.js +4 -4
- package/dist/definition/workflow/runnable.d.ts +1 -1
- package/dist/definition/workflow/runnable.js +1 -1
- package/dist/definition/workflow/verdict.d.ts +1 -1
- package/dist/definition/workflow/verdict.js +1 -1
- package/dist/engine/blocks.d.ts +2 -2
- package/dist/engine/blocks.js +3 -3
- package/dist/engine/explain.d.ts +1 -1
- package/dist/engine/explain.js +3 -3
- package/dist/engine/features.d.ts +1 -1
- package/dist/engine/features.js +1 -1
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/engine/mcp.d.ts +4 -4
- package/dist/engine/mcp.js +4 -4
- package/dist/engine/names.d.ts +1 -1
- package/dist/engine/names.js +1 -1
- package/dist/engine/preview.d.ts +2 -2
- package/dist/engine/preview.js +1 -1
- package/dist/engine/projection.d.ts +3 -3
- package/dist/engine/projection.js +8 -8
- package/dist/engine/tools.d.ts +8 -8
- package/dist/engine/tools.js +7 -7
- package/dist/errors.d.ts +1 -1
- package/dist/folder/compile.d.ts +1 -1
- package/dist/folder/compile.js +23 -14
- package/dist/folder/decompile.js +7 -7
- package/dist/folder/engine.d.ts +3 -3
- package/dist/folder/engine.js +3 -3
- package/dist/folder/fix.js +1 -1
- package/dist/folder/flow.d.ts +1 -1
- package/dist/folder/flow.js +1 -1
- package/dist/folder/index.d.ts +2 -2
- package/dist/folder/index.js +2 -2
- package/dist/folder/migrate-v3.js +2 -2
- package/dist/folder/migrate-v4.js +1 -1
- package/dist/folder/nested.js +9 -6
- package/dist/folder/plugins.d.ts +13 -1
- package/dist/folder/plugins.js +49 -12
- package/dist/folder/schemas.js +7 -7
- package/dist/folder/subagent-files.d.ts +9 -5
- package/dist/folder/subagent-files.js +96 -22
- package/dist/folder/v3.d.ts +2 -2
- package/dist/folder/v3.js +2 -2
- package/dist/harness-api/artifacts.d.ts +1 -1
- package/dist/harness-api/json-schema.js +6 -6
- package/dist/harness-api/messages.d.ts +1 -1
- package/dist/harness-api/messages.js +1 -1
- package/dist/harness-api/schema.d.ts +2 -2
- package/dist/harness-api/schema.js +8 -8
- package/dist/manifest-schemas.js +9 -6
- package/dist/plugins/index.js +1 -1
- package/dist/schemas/agent-manifest.schema.json +65 -2
- package/dist/schemas/harness-manifest.schema.json +55 -2
- package/dist/types/manifest.d.ts +32 -7
- package/dist/types/model.d.ts +3 -3
- package/dist/types/observe.d.ts +1 -1
- package/dist/types/part.d.ts +5 -3
- package/dist/types/transcript.d.ts +1 -1
- package/dist/utils/definition-files.d.ts +23 -0
- package/dist/utils/definition-files.js +50 -4
- package/dist/utils/memory.js +1 -1
- package/dist/utils/runtime-limits.d.ts +2 -2
- package/dist/utils/runtime-limits.js +3 -3
- package/package.json +1 -1
package/dist/contracts.js
CHANGED
|
@@ -11,11 +11,11 @@ import { FILE_NAME_MAX, FILE_PATH_MAX, LINK_TARGET_MAX } from "./utils/file-syst
|
|
|
11
11
|
export { FILE_NAME_MAX, FILE_PATH_MAX } from "./utils/file-systems.js";
|
|
12
12
|
import { DEFAULT_HARNESS, HARNESS_ID_PATTERN, isHarnessId } from "./utils/harness-id.js";
|
|
13
13
|
export { DEFAULT_HARNESS, HARNESS_ID_PATTERN, isHarnessId };
|
|
14
|
-
import { isDefinitionFileHash, skillFilesIssue } from "./utils/definition-files.js";
|
|
14
|
+
import { isDefinitionFileHash, pluginFilesIssue, skillFilesIssue } from "./utils/definition-files.js";
|
|
15
15
|
import { MEMORY_ACCESS, MEMORY_INSTRUCTIONS_MAX, MEMORY_OPERATIONS } from "./utils/memory.js";
|
|
16
16
|
export { MEMORY_ACCESS, MEMORY_COMMANDS, MEMORY_DESCRIPTION_MAX, MEMORY_INSTRUCTIONS_MAX, MEMORY_OPERATIONS, MEMORY_PATH_MAX, MEMORY_ROOT, checkMemoryCall, memoryAliasOf, memoryDescriptionOf, memoryPathOf, memoryPathWithin, } from "./utils/memory.js";
|
|
17
17
|
export { PROTOCOL_VERSION, ERROR_CODES } from "./compatibility.js";
|
|
18
|
-
export { SKILL_TOTAL_BYTES_DEFAULT, definitionFilesOf, isDefinitionFileHash, skillsOf, } from "./utils/definition-files.js";
|
|
18
|
+
export { SKILL_TOTAL_BYTES_DEFAULT, definitionFilesOf, isDefinitionFileHash, mountedPluginsOf, skillsOf, } from "./utils/definition-files.js";
|
|
19
19
|
export { HARNESS_LIMIT_DEFAULTS, HarnessLimitsSchema, JS_STRING_MAX_LENGTH, RECORD_ENVELOPE_RESERVE_BYTES, RUNTIME_LIMIT_CEILINGS, RUNTIME_LIMIT_DEFAULTS, RuntimeLimitsSchema, S2_RECORD_MAX_BYTES, TIMER_MAX_MS, harnessLimitsOf, inlineBodyBytes, limitExceededMessage, runtimeLimitIssues, runtimeLimitsOf, } from "./utils/runtime-limits.js";
|
|
20
20
|
import { RuntimeLimitsSchema, TIMER_MAX_MS } from "./utils/runtime-limits.js";
|
|
21
21
|
export { DEFAULT_CONTENT_TYPE, MODEL_IMAGE_TYPES, contentTypeFor, essence, extensionFor, inputLabel, isModelImage, isOffice, isText, matchesSignature, modelInputOf, normalizeContentType, } from "./utils/media-types.js";
|
|
@@ -53,6 +53,23 @@ const pluginLabelSchema = z
|
|
|
53
53
|
.object({ name: z.string().min(1), version: z.string().min(1).optional() })
|
|
54
54
|
.strict()
|
|
55
55
|
.meta({ id: "PluginLabel" });
|
|
56
|
+
/**
|
|
57
|
+
* An Agent Plugin an agent was composed with; `files`, when the plugin holds files beyond the parts
|
|
58
|
+
* the manifest carries, are mounted read-only in the sandbox at `/plugins/<name>@<hash>/`.
|
|
59
|
+
*/
|
|
60
|
+
const pluginManifestSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
name: z.string().min(1),
|
|
63
|
+
version: z.string().min(1).optional(),
|
|
64
|
+
files: z.record(z.string(), z.string()).optional(),
|
|
65
|
+
})
|
|
66
|
+
.strict()
|
|
67
|
+
.superRefine((plugin, ctx) => {
|
|
68
|
+
const issue = plugin.files === undefined ? undefined : pluginFilesIssue(plugin.files);
|
|
69
|
+
if (issue)
|
|
70
|
+
ctx.addIssue({ code: "custom", path: ["files"], message: `Plugin '${plugin.name}' ${issue}` });
|
|
71
|
+
})
|
|
72
|
+
.meta({ id: "PluginManifest" });
|
|
56
73
|
/** One tool's settings on an MCP server. */
|
|
57
74
|
const mcpToolSettingsSchema = z
|
|
58
75
|
.object({
|
|
@@ -109,6 +126,7 @@ const skillManifestSchema = z
|
|
|
109
126
|
description: z.string().min(1),
|
|
110
127
|
files: z.record(z.string(), z.string()),
|
|
111
128
|
plugin: pluginLabelSchema.optional(),
|
|
129
|
+
disableModelInvocation: z.literal(true).optional(),
|
|
112
130
|
})
|
|
113
131
|
.strict()
|
|
114
132
|
.superRefine((skill, ctx) => {
|
|
@@ -185,6 +203,8 @@ const toolManifestSchema = z
|
|
|
185
203
|
.optional(),
|
|
186
204
|
http: httpToolTargetSchema.optional(),
|
|
187
205
|
approval: z.enum(APPROVAL_MODES).optional(),
|
|
206
|
+
/** The Agent Plugin an agent used as a tool came from (Host feature `plugin-subagents`). */
|
|
207
|
+
plugin: pluginLabelSchema.optional(),
|
|
188
208
|
fn: reservedToolKind,
|
|
189
209
|
command: reservedToolKind,
|
|
190
210
|
})
|
|
@@ -201,6 +221,12 @@ const toolManifestSchema = z
|
|
|
201
221
|
path: ["approval"],
|
|
202
222
|
message: `Tool '${tool.name}' takes approval only as an HTTP tool`,
|
|
203
223
|
});
|
|
224
|
+
if (tool.plugin !== undefined && tool.agent === undefined)
|
|
225
|
+
ctx.addIssue({
|
|
226
|
+
code: "custom",
|
|
227
|
+
path: ["plugin"],
|
|
228
|
+
message: `Tool '${tool.name}' takes a plugin label only as an agent used as a tool`,
|
|
229
|
+
});
|
|
204
230
|
const parameters = tool.http && httpInputIssue(tool.http, tool.inputSchema);
|
|
205
231
|
if (parameters)
|
|
206
232
|
ctx.addIssue({ code: "custom", path: ["http", "url"], message: `Tool '${tool.name}': ${parameters}` });
|
|
@@ -232,7 +258,7 @@ const agentRequirementsSchema = z
|
|
|
232
258
|
})
|
|
233
259
|
.strict();
|
|
234
260
|
/**
|
|
235
|
-
* The engine features an agent declares (
|
|
261
|
+
* The engine features an agent declares (`agent-folder/2`): `harness.engine` of an
|
|
236
262
|
* agent manifest v8 and `engine` of the loop manifest (v7) the harness runs. With it, our engine
|
|
237
263
|
* adds only what it names; without it, the defaults of `agent-folder/1`.
|
|
238
264
|
*/
|
|
@@ -277,7 +303,7 @@ export const HarnessEngineSchema = z
|
|
|
277
303
|
hosts: z.array(z.string().min(1)).optional(),
|
|
278
304
|
}))
|
|
279
305
|
.optional()
|
|
280
|
-
.meta({ description: "The Runtime's plugins the agent declares (agent-folder/3
|
|
306
|
+
.meta({ description: "The Runtime's plugins the agent declares (agent-folder/3): each with the tools left on and the hash of its files" }),
|
|
281
307
|
})
|
|
282
308
|
.meta({ id: "HarnessEngine" });
|
|
283
309
|
const harnessEngineField = HarnessEngineSchema.optional();
|
|
@@ -295,6 +321,7 @@ const agentManifestSchema = z
|
|
|
295
321
|
tools: z.array(toolManifestSchema).optional(),
|
|
296
322
|
skills: z.record(z.string(), skillManifestSchema).optional(),
|
|
297
323
|
mcpServers: z.record(z.string(), mcpServerSchema).optional(),
|
|
324
|
+
plugins: z.array(pluginManifestSchema).optional(),
|
|
298
325
|
requires: agentRequirementsSchema.optional(),
|
|
299
326
|
engine: harnessEngineField,
|
|
300
327
|
// Reserved for Functions, which are deferred: developer code the Runtime will run from
|
|
@@ -545,7 +572,7 @@ const resourcesSchema = z
|
|
|
545
572
|
.optional(),
|
|
546
573
|
})
|
|
547
574
|
.strict();
|
|
548
|
-
// --- Environments (protocol 11
|
|
575
|
+
// --- Environments (protocol 11) --------------------------------
|
|
549
576
|
/**
|
|
550
577
|
* An Agent id (protocol 16; an Environment id before): 1–200 characters, one or more
|
|
551
578
|
* `/`-separated segments of letters, digits, `.`, `_` and `-`, each starting with a letter or
|
|
@@ -684,7 +711,7 @@ export const EnvironmentFileSchema = z.union([
|
|
|
684
711
|
path: absoluteWorkspacePath("path"),
|
|
685
712
|
files: z
|
|
686
713
|
.record(relativeFilePath, z.string().refine(isDefinitionFileHash, { message: "each file is sha256:<64 lowercase hex>" }))
|
|
687
|
-
// At most the Tenant's Runtime limit `environmentFilesPerEntry`, checked when made
|
|
714
|
+
// At most the Tenant's Runtime limit `environmentFilesPerEntry`, checked when made.
|
|
688
715
|
.refine((files) => Object.keys(files).length >= 1, { message: "files names at least one file" }),
|
|
689
716
|
})
|
|
690
717
|
.strict(),
|
|
@@ -759,7 +786,7 @@ export const EnvironmentLimitsSchema = z
|
|
|
759
786
|
.strict()
|
|
760
787
|
.optional(),
|
|
761
788
|
/**
|
|
762
|
-
* Its triggers
|
|
789
|
+
* Its triggers, within the Tenant's Runtime limits `triggersPerAgent`,
|
|
763
790
|
* `triggerMinIntervalMs` and `triggerRunsPerHour`: lowering one deletes nothing.
|
|
764
791
|
*/
|
|
765
792
|
triggers: z
|
|
@@ -817,7 +844,7 @@ const runtimeFields = {
|
|
|
817
844
|
* waits for its next start; one that adds a required secret waits for its value. Its manifest's
|
|
818
845
|
* name, kind, harness and storage are fixed (`409 agent_fixed_field`); fork it to change them. One
|
|
819
846
|
* kind change is not: on a Runtime whose pods are computers, a `PUT` that moves a `virtual` Agent to
|
|
820
|
-
* a `pod` version makes it a computer in place
|
|
847
|
+
* a `pod` version makes it a computer in place, with its id, sessions, memory, vault and
|
|
821
848
|
* triggers. `?dryRun=true` answers the move's plan (`AgentMovePlan`) and changes nothing.
|
|
822
849
|
*/
|
|
823
850
|
export const PutAgentRequestSchema = z
|
|
@@ -1154,37 +1181,39 @@ export const AGENT_EVENT_TYPES = [
|
|
|
1154
1181
|
"agent.deleted",
|
|
1155
1182
|
// Kind `pod` (Host feature `sandbox-pods`).
|
|
1156
1183
|
"agent.running",
|
|
1184
|
+
// Its computer became ready: created, resumed, restarted, or moved off a draining worker.
|
|
1185
|
+
"agent.resumed",
|
|
1157
1186
|
"agent.suspended",
|
|
1158
1187
|
"agent.relaunched",
|
|
1159
1188
|
"agent.lost",
|
|
1160
1189
|
"agent.reset",
|
|
1161
1190
|
"agent.failed",
|
|
1162
|
-
// Forked into a new Agent
|
|
1191
|
+
// Forked into a new Agent.
|
|
1163
1192
|
"agent.forked",
|
|
1164
|
-
// Moved to another version of its manifest
|
|
1193
|
+
// Moved to another version of its manifest.
|
|
1165
1194
|
"agent.outdated",
|
|
1166
1195
|
"agent.version_changed",
|
|
1167
1196
|
"agent.start_failed",
|
|
1168
|
-
// egress-gate: every connection the Agent opens
|
|
1197
|
+
// egress-gate: every connection the Agent opens.
|
|
1169
1198
|
"agent.egress",
|
|
1170
|
-
// Triggers
|
|
1199
|
+
// Triggers: each run, and a trigger paused or resumed.
|
|
1171
1200
|
"agent.run",
|
|
1172
1201
|
"agent.trigger_paused",
|
|
1173
1202
|
"agent.trigger_resumed",
|
|
1174
1203
|
"agent.trigger_secret_rotated",
|
|
1175
|
-
// Triggers an agent made with the triggers tool
|
|
1204
|
+
// Triggers an agent made with the triggers tool, and one deleted by an agent or a person.
|
|
1176
1205
|
"agent.trigger_created",
|
|
1177
1206
|
"agent.trigger_updated",
|
|
1178
1207
|
"agent.trigger_deleted",
|
|
1179
|
-
// Memory
|
|
1208
|
+
// Memory: a turn changed the Agent's memories.
|
|
1180
1209
|
"agent.memory_updated",
|
|
1181
1210
|
];
|
|
1182
|
-
/** `agent.trigger_created` and `agent.trigger_updated`'s payload
|
|
1211
|
+
/** `agent.trigger_created` and `agent.trigger_updated`'s payload. */
|
|
1183
1212
|
export const TriggerChangePayloadSchema = z
|
|
1184
1213
|
.object({
|
|
1185
1214
|
triggerId: z.string(),
|
|
1186
1215
|
kind: z.enum(["schedule", "at", "webhook"]),
|
|
1187
|
-
/** Absent on events recorded before
|
|
1216
|
+
/** Absent on events recorded before triggers could be put over the API, which were all `agent`. */
|
|
1188
1217
|
origin: z.enum(["agent", "api"]).optional(),
|
|
1189
1218
|
/** The session whose agent made it: an `agent` trigger's. */
|
|
1190
1219
|
sessionId: z.string().optional(),
|
|
@@ -1195,7 +1224,7 @@ export const TriggerChangePayloadSchema = z
|
|
|
1195
1224
|
schedule: z.string().optional(),
|
|
1196
1225
|
timezone: z.string().optional(),
|
|
1197
1226
|
at: z.string().optional(),
|
|
1198
|
-
/** On `agent.trigger_updated`
|
|
1227
|
+
/** On `agent.trigger_updated` of a Runtime that serves API triggers: the definition's fields that changed. */
|
|
1199
1228
|
changed: z.array(z.string()).optional(),
|
|
1200
1229
|
nextRunAt: z.string().nullable(),
|
|
1201
1230
|
})
|
|
@@ -1227,11 +1256,18 @@ export const AGENT_EVENT_PAYLOADS = {
|
|
|
1227
1256
|
.passthrough(),
|
|
1228
1257
|
/** A pod joined and serves the Agent. */
|
|
1229
1258
|
"agent.running": z.object({ hostEpoch: z.number().int() }).passthrough(),
|
|
1259
|
+
/**
|
|
1260
|
+
* Its pod became ready, so its awake time starts at this event's `time`: created, resumed,
|
|
1261
|
+
* restarted, or (`drain`) moved to another worker, written with the drain's `agent.suspended`.
|
|
1262
|
+
* The awake time ends at the Agent's next `agent.suspended`, `.failed`, `.lost`, `.reset`,
|
|
1263
|
+
* `.deleted`, `.start_failed` or `.resumed`.
|
|
1264
|
+
*/
|
|
1265
|
+
"agent.resumed": z.object({ cause: z.enum(["use", "drain"]) }).passthrough(),
|
|
1230
1266
|
/**
|
|
1231
1267
|
* Stopped (`POST .../stop`, or idle): the volume is kept; the next turn starts it again.
|
|
1232
1268
|
* `drain` (Agent Substrate): its worker stopped, so it was suspended with everything it held
|
|
1233
1269
|
* and resumed on another worker; nothing was lost. `diskBytes`: a computer suspended as idle
|
|
1234
|
-
* had its disk measured first (`/workspace` and `/skills
|
|
1270
|
+
* had its disk measured first (`/workspace` and `/skills`); absent when it could not be.
|
|
1235
1271
|
*/
|
|
1236
1272
|
"agent.suspended": z
|
|
1237
1273
|
.object({ reason: z.enum(["stop", "idle", "restart", "drain"]), diskBytes: z.number().int().nonnegative().optional() })
|
|
@@ -1266,7 +1302,7 @@ export const AGENT_EVENT_PAYLOADS = {
|
|
|
1266
1302
|
.passthrough(),
|
|
1267
1303
|
/**
|
|
1268
1304
|
* Runs version `to` of its manifest now: turns that start from here run it. `kindFrom` and
|
|
1269
|
-
* `kindTo` when the move changed its kind: a `virtual` Agent became a computer
|
|
1305
|
+
* `kindTo` when the move changed its kind: a `virtual` Agent became a computer.
|
|
1270
1306
|
*/
|
|
1271
1307
|
"agent.version_changed": z
|
|
1272
1308
|
.object({
|
|
@@ -1307,8 +1343,8 @@ export const AGENT_EVENT_PAYLOADS = {
|
|
|
1307
1343
|
/** A webhook trigger's signing secret was made or replaced; the one before stopped working. */
|
|
1308
1344
|
"agent.trigger_secret_rotated": z.object({ triggerId: z.string() }).passthrough(),
|
|
1309
1345
|
/**
|
|
1310
|
-
* An agent made a trigger with the `triggers` tool
|
|
1311
|
-
|
|
1346
|
+
* An agent made a trigger with the `triggers` tool, or a client put one over the API
|
|
1347
|
+
*, or either replaced one with the same id (`agent.trigger_updated`): where it came from
|
|
1312
1348
|
* (`origin`), the session whose agent made it (`sessionId`, for `agent`) or who put it
|
|
1313
1349
|
* (`principal`, for `api`), the session it runs in (`session`), its timing, its title, its next
|
|
1314
1350
|
* run, and on an update the fields that changed (`changed`).
|
|
@@ -1317,7 +1353,7 @@ export const AGENT_EVENT_PAYLOADS = {
|
|
|
1317
1353
|
"agent.trigger_updated": TriggerChangePayloadSchema,
|
|
1318
1354
|
/**
|
|
1319
1355
|
* A trigger an agent made or a client put was deleted: by an agent of `sessionId`, or over the
|
|
1320
|
-
* API (`principal`); `origin` says which kind of trigger it was
|
|
1356
|
+
* API (`principal`); `origin` says which kind of trigger it was.
|
|
1321
1357
|
*/
|
|
1322
1358
|
"agent.trigger_deleted": z
|
|
1323
1359
|
.object({
|
|
@@ -1346,10 +1382,10 @@ export const AgentEventSchema = z
|
|
|
1346
1382
|
export const ListAgentEventsResponseSchema = z
|
|
1347
1383
|
.object({ events: z.array(AgentEventSchema) })
|
|
1348
1384
|
.strict();
|
|
1349
|
-
/** The schema id of the Tenant's events (its stream in the record
|
|
1385
|
+
/** The schema id of the Tenant's events (its stream in the record). */
|
|
1350
1386
|
export const TENANT_EVENT_SCHEMA = "nylorun.tenant-event/1";
|
|
1351
1387
|
/**
|
|
1352
|
-
* The Tenant's stream (
|
|
1388
|
+
* The Tenant's stream (Host feature `tenant-audit`): who changed who may reach the Tenant
|
|
1353
1389
|
* and what its sessions may do, and each use of a vault credential, read with
|
|
1354
1390
|
* `GET /v1/tenant/audit`. Every type is the Runtime's record (layer `runtime`): the Runtime saw it
|
|
1355
1391
|
* happen, in the change's own transaction where it could; no harness writes one. No payload carries
|
|
@@ -1465,7 +1501,7 @@ export const StudioSignInRequestSchema = z
|
|
|
1465
1501
|
})
|
|
1466
1502
|
.strict();
|
|
1467
1503
|
/**
|
|
1468
|
-
* A model role's name (Host feature `model-roles
|
|
1504
|
+
* A model role's name (Host feature `model-roles`): a lowercase letter, then up to 31
|
|
1469
1505
|
* lowercase letters, digits and `-`, such as `builder`.
|
|
1470
1506
|
*/
|
|
1471
1507
|
export const AGENT_ROLE_PATTERN = /^[a-z][a-z0-9-]{0,31}$/;
|
|
@@ -1809,7 +1845,7 @@ export function environmentSecretNameError(type, name) {
|
|
|
1809
1845
|
? undefined
|
|
1810
1846
|
: "A credential name is 1-64 letters, digits, '.', '_' and '-'";
|
|
1811
1847
|
}
|
|
1812
|
-
// --- Environment manifests (protocol 14
|
|
1848
|
+
// --- Environment manifests (protocol 14) -----------------------------------------
|
|
1813
1849
|
const slotBase = {
|
|
1814
1850
|
/** Whether a session whose agent needs it may open without it. Default false. */
|
|
1815
1851
|
required: z.boolean().optional(),
|
|
@@ -1864,7 +1900,7 @@ export const EnvironmentSecretSlotsSchema = z
|
|
|
1864
1900
|
ctx.addIssue({ code: "custom", path: [name], message: error });
|
|
1865
1901
|
}
|
|
1866
1902
|
});
|
|
1867
|
-
// --- Agent manifest v8 (protocol 16
|
|
1903
|
+
// --- Agent manifest v8 (protocol 16) ----------------------------------------------
|
|
1868
1904
|
/** The schema version of an agent manifest the Runtime saves at `/v1/agent-manifests/{name}`. */
|
|
1869
1905
|
export const AGENT_MANIFEST_V8_SCHEMA_VERSION = 8;
|
|
1870
1906
|
/** A skill of the harness section: v7's, and the secret slots its scripts read. */
|
|
@@ -1874,6 +1910,7 @@ const harnessSkillSchema = z
|
|
|
1874
1910
|
description: z.string().min(1),
|
|
1875
1911
|
files: z.record(z.string(), z.string()),
|
|
1876
1912
|
plugin: pluginLabelSchema.optional(),
|
|
1913
|
+
disableModelInvocation: z.literal(true).optional(),
|
|
1877
1914
|
secrets: z
|
|
1878
1915
|
.array(z.string().regex(ENVIRONMENT_NAME_PATTERN, "A skill's secrets are environment variable names"))
|
|
1879
1916
|
.optional(),
|
|
@@ -1943,7 +1980,7 @@ export function agentModelChoice(value) {
|
|
|
1943
1980
|
}
|
|
1944
1981
|
const harnessModelField = AgentModelSchema.optional();
|
|
1945
1982
|
/**
|
|
1946
|
-
* `harness.roles` (Host feature `model-roles
|
|
1983
|
+
* `harness.roles` (Host feature `model-roles`): a model for each role a session may be
|
|
1947
1984
|
* opened with (`PUT /v1/sessions/{id}` `role`, an A2A message's `metadata.role`), checked as
|
|
1948
1985
|
* `harness.model` is. A session opened with no role runs on `harness.model`.
|
|
1949
1986
|
*/
|
|
@@ -1967,7 +2004,7 @@ const agentHarnessObject = z
|
|
|
1967
2004
|
tools: z.array(toolManifestSchema).optional(),
|
|
1968
2005
|
skills: z.record(z.string(), harnessSkillSchema).optional(),
|
|
1969
2006
|
mcpServers: z.record(z.string(), harnessMcpServerSchema).optional(),
|
|
1970
|
-
plugins: z.array(
|
|
2007
|
+
plugins: z.array(pluginManifestSchema).optional(),
|
|
1971
2008
|
outputSchema: definitionJson.optional(),
|
|
1972
2009
|
loop: harnessLoopField,
|
|
1973
2010
|
memory: harnessMemoryField,
|
|
@@ -2093,7 +2130,7 @@ export function triggerKindOf(trigger) {
|
|
|
2093
2130
|
*/
|
|
2094
2131
|
export const TRIGGER_STATUSES = ["active", "paused", "completed"];
|
|
2095
2132
|
/**
|
|
2096
|
-
* Where a trigger's definition comes from
|
|
2133
|
+
* Where a trigger's definition comes from: `manifest` (the version's `runtime.triggers`),
|
|
2097
2134
|
* `agent` (made by an agent of the Agent's sessions with the `triggers` tool, kept by the Agent),
|
|
2098
2135
|
* `api` (put on the Agent by a client, `PUT /v1/agents/{id}/triggers/{triggerId}`, kept by the
|
|
2099
2136
|
* Agent with the principal that put it) or `wake` (a session's booked wake, never listed).
|
|
@@ -2112,7 +2149,7 @@ export const TriggerViewSchema = z
|
|
|
2112
2149
|
title: z.string().nullable(),
|
|
2113
2150
|
/** The session whose agent made it; null for a manifest's or an `api` trigger. */
|
|
2114
2151
|
createdSessionId: z.string().nullable(),
|
|
2115
|
-
/** Who put an `api` trigger
|
|
2152
|
+
/** Who put an `api` trigger; null for every other origin. Absent from a Runtime without API triggers. */
|
|
2116
2153
|
principal: z.string().nullable().optional(),
|
|
2117
2154
|
status: z.enum(TRIGGER_STATUSES),
|
|
2118
2155
|
/** `manual`, `new` for one an upgrade added, `undeclared` for an agent's while the version lacks `engine.triggers`. */
|
|
@@ -2140,14 +2177,14 @@ export const TriggerListSchema = z.object({ triggers: z.array(TriggerViewSchema)
|
|
|
2140
2177
|
/** The longest title an agent or a client gives a trigger it makes. */
|
|
2141
2178
|
export const TRIGGER_TITLE_MAX = 80;
|
|
2142
2179
|
/**
|
|
2143
|
-
* The body of `PUT /v1/agents/{agentId}/triggers/{triggerId}
|
|
2180
|
+
* The body of `PUT /v1/agents/{agentId}/triggers/{triggerId}`: a `Trigger`, exactly as a
|
|
2144
2181
|
* definition's `runtime.triggers` entry holds it, and an optional `title`. It creates the Agent's
|
|
2145
2182
|
* `api` trigger with that id, or replaces it; the same body again changes nothing.
|
|
2146
2183
|
*/
|
|
2147
2184
|
export const TriggerPutSchema = z
|
|
2148
2185
|
.strictObject({ ...TRIGGER_FIELDS, title: z.string().min(1).max(TRIGGER_TITLE_MAX).optional() })
|
|
2149
2186
|
.superRefine(checkTriggerKind);
|
|
2150
|
-
/** `in` of the `triggers` tool
|
|
2187
|
+
/** `in` of the `triggers` tool: a delay in minutes, hours or days, such as `30m`, `2h`, `1d`. */
|
|
2151
2188
|
export const TRIGGER_DELAY_PATTERN = /^[1-9][0-9]*(m|h|d)$/;
|
|
2152
2189
|
/** Where an agent-made trigger runs: the calling session (`this`), or a session of its own (`own`). */
|
|
2153
2190
|
export const TRIGGER_TOOL_SESSIONS = ["this", "own"];
|
|
@@ -2170,7 +2207,7 @@ const triggerCreateSchema = z
|
|
|
2170
2207
|
ctx.addIssue({ code: "custom", path: ["timezone"], message: "timezone goes with schedule" });
|
|
2171
2208
|
});
|
|
2172
2209
|
/**
|
|
2173
|
-
* A call of the `triggers` tool
|
|
2210
|
+
* A call of the `triggers` tool, which the Runtime serves for an agent whose version
|
|
2174
2211
|
* declares `engine.triggers`: `list` the triggers the calling session made; `create` one (or
|
|
2175
2212
|
* replace the session's own with the same `id`) with exactly one of `schedule` (with `timezone`),
|
|
2176
2213
|
* `at` or `in`, the `session` it runs in and its `prompt`; `delete` one by `id`.
|
|
@@ -2201,7 +2238,7 @@ export const TriggerToolOutputSchema = z.union([
|
|
|
2201
2238
|
status: z.enum(TRIGGER_STATUSES),
|
|
2202
2239
|
nextRunAt: z.string().nullable(),
|
|
2203
2240
|
session: z.string(),
|
|
2204
|
-
/** The Runtime's clock when it answered, so the model knows the time
|
|
2241
|
+
/** The Runtime's clock when it answered, so the model knows the time. */
|
|
2205
2242
|
now: z.string().optional(),
|
|
2206
2243
|
}),
|
|
2207
2244
|
z.strictObject({ triggers: z.array(TriggerToolItemSchema), now: z.string().optional() }),
|
|
@@ -2232,7 +2269,7 @@ export const TriggerRunSchema = z
|
|
|
2232
2269
|
})
|
|
2233
2270
|
.strict();
|
|
2234
2271
|
/**
|
|
2235
|
-
* One run on the Tenant's runs stream (
|
|
2272
|
+
* One run on the Tenant's runs stream (`GET /v1/runs/stream`): a run of any Agent's
|
|
2236
2273
|
* triggers, as `TriggerRunSchema` has it, with its Agent and its trigger's origin and title. A
|
|
2237
2274
|
* run may arrive twice (after a crash between append and mark); a reader drops a `runId` it has
|
|
2238
2275
|
* seen.
|
|
@@ -2459,7 +2496,7 @@ export const PutAgentManifestRequestSchema = AgentManifestV8Schema.extend({
|
|
|
2459
2496
|
export const AgentManifestSavedBySchema = z.object({ actor: z.string() }).strict();
|
|
2460
2497
|
/** One version of an agent manifest. */
|
|
2461
2498
|
/**
|
|
2462
|
-
* The edit that fixes a diagnostic, when only one edit can (
|
|
2499
|
+
* The edit that fixes a diagnostic, when only one edit can (`nylorun check --fix`):
|
|
2463
2500
|
* `rename_key` renames the key at `line` and `column` of `file` from `from` to `to`, the one known
|
|
2464
2501
|
* key it is close to; `crlf` makes `file`'s CRLF line ends LF; `move_skill_secrets` moves a
|
|
2465
2502
|
* `SKILL.md`'s `secrets` to `AGENT.md`'s `skills` block, as `skills: { <skill>: { secrets } }`.
|
|
@@ -2481,7 +2518,7 @@ export const AgentFolderFixSchema = z
|
|
|
2481
2518
|
])
|
|
2482
2519
|
.meta({ id: "AgentFolderFix" });
|
|
2483
2520
|
/**
|
|
2484
|
-
* One problem or remark about an agent folder
|
|
2521
|
+
* One problem or remark about an agent folder: an `error` keeps it from compiling.
|
|
2485
2522
|
* `file` is the path in the folder, with the line and column when known; `pointer` the field in
|
|
2486
2523
|
* the manifest; `fix` the edit that fixes it, when only one edit can.
|
|
2487
2524
|
*/
|
|
@@ -2498,7 +2535,7 @@ export const AgentFolderDiagnosticSchema = z
|
|
|
2498
2535
|
})
|
|
2499
2536
|
.strict()
|
|
2500
2537
|
.meta({ id: "AgentFolderDiagnostic" });
|
|
2501
|
-
/** The folder a version was compiled from
|
|
2538
|
+
/** The folder a version was compiled from: the compiler that built it, and its size. */
|
|
2502
2539
|
export const AgentManifestSourceSummarySchema = z
|
|
2503
2540
|
.object({
|
|
2504
2541
|
/** The compiler format, such as `agent-folder/1`. */
|
|
@@ -2536,7 +2573,7 @@ export const AgentFolderEntrySchema = z
|
|
|
2536
2573
|
export const AGENT_FOLDER_MEDIA_TYPE = "application/vnd.nylorun.folder+json";
|
|
2537
2574
|
/**
|
|
2538
2575
|
* `PUT /v1/agent-manifests/{name}` with `Content-Type: application/vnd.nylorun.folder+json`
|
|
2539
|
-
|
|
2576
|
+
*: an agent folder by hash, each file uploaded first with `PUT /v1/files/sha256:<hex>`.
|
|
2540
2577
|
*/
|
|
2541
2578
|
export const PutAgentFolderRequestSchema = z
|
|
2542
2579
|
.object({
|
|
@@ -2562,7 +2599,7 @@ export const AgentManifestSourceSchema = z
|
|
|
2562
2599
|
})
|
|
2563
2600
|
.strict();
|
|
2564
2601
|
/**
|
|
2565
|
-
* `GET /v1/agent-manifests/{name}/source/diff?from=&to
|
|
2602
|
+
* `GET /v1/agent-manifests/{name}/source/diff?from=&to=`: what changed between two
|
|
2566
2603
|
* versions' sources, by path and SHA-256. Each list is sorted by path; `unchanged` counts the
|
|
2567
2604
|
* files both hold with the same bytes.
|
|
2568
2605
|
*/
|
|
@@ -2798,7 +2835,7 @@ export const ModelCallHeaderSourceSchema = z.discriminatedUnion("from", [
|
|
|
2798
2835
|
z.object({ from: z.literal("session.owner") }).strict(),
|
|
2799
2836
|
]);
|
|
2800
2837
|
/**
|
|
2801
|
-
* What the Runtime cannot learn from a custom OpenAI-compatible endpoint
|
|
2838
|
+
* What the Runtime cannot learn from a custom OpenAI-compatible endpoint:
|
|
2802
2839
|
* its context window and output limit (default `CUSTOM_MODEL_SETTING_DEFAULTS`), whether it
|
|
2803
2840
|
* reasons, what it reads (`inputs`; default text only) and pi-ai `compat` settings
|
|
2804
2841
|
* (`thinkingFormat`, `thinkingTokenBudgetField`, `chatTemplateKwargs`, …). `headers` are sent on
|
|
@@ -2822,7 +2859,7 @@ export const CustomModelSettingsSchema = z
|
|
|
2822
2859
|
* endpoint only) the Runtime's workload token, read from `NYLORUN_WORKLOAD_TOKEN_FILE` on every
|
|
2823
2860
|
* call and never stored (#496), or (`google-vertex` only, Host feature `model-host-identity`) the
|
|
2824
2861
|
* Host's own identity: Google's Application Default Credentials, found at each call and never
|
|
2825
|
-
* stored, on a Host whose operator lends it with `NYLORUN_MODEL_HOST_IDENTITY
|
|
2862
|
+
* stored, on a Host whose operator lends it with `NYLORUN_MODEL_HOST_IDENTITY`.
|
|
2826
2863
|
*/
|
|
2827
2864
|
export const HOST_MODEL_AUTH_TYPES = ["api_key", "oauth", "workload", "host_identity"];
|
|
2828
2865
|
export const PutHostModelRequestSchema = z
|
|
@@ -3064,7 +3101,7 @@ const commandBase = {
|
|
|
3064
3101
|
/**
|
|
3065
3102
|
* What a message to a busy session does (protocol 17): `queue` waits for the running turn to
|
|
3066
3103
|
* end and starts the next one; `reject` is refused with `409 session_busy`. A protocol 17 client's
|
|
3067
|
-
* default is `queue`, a protocol 16 client's `reject`. `steer` (Host feature `steer
|
|
3104
|
+
* default is `queue`, a protocol 16 client's `reject`. `steer` (Host feature `steer`) joins
|
|
3068
3105
|
* the running turn before its next step, when our engine runs it; a workflow session queues it,
|
|
3069
3106
|
* and one the turn doesn't take starts the next turn like a queued message.
|
|
3070
3107
|
*/
|
|
@@ -3079,12 +3116,12 @@ export const MessageDeliverySchema = z.enum(["queue", "reject", "steer"]);
|
|
|
3079
3116
|
* only narrows.
|
|
3080
3117
|
*/
|
|
3081
3118
|
export const RemoveToolsSchema = z.array(z.string().min(1).max(256)).max(256);
|
|
3082
|
-
/** The most context items one message carries
|
|
3119
|
+
/** The most context items one message carries. */
|
|
3083
3120
|
export const MESSAGE_CONTEXT_MAX_ITEMS = 16;
|
|
3084
|
-
/** The most bytes a message's context items take, as JSON
|
|
3121
|
+
/** The most bytes a message's context items take, as JSON. */
|
|
3085
3122
|
export const MESSAGE_CONTEXT_MAX_BYTES = 16 * 1024;
|
|
3086
3123
|
/**
|
|
3087
|
-
* A message's `context` (Host feature `message-context
|
|
3124
|
+
* A message's `context` (Host feature `message-context`): facts for its own turn only,
|
|
3088
3125
|
* such as the time or who the agent is today. Our engine puts them in the `<runtime-context>` block
|
|
3089
3126
|
* of every model call of that turn, after the history; later turns leave them out. The
|
|
3090
3127
|
* `command.message` event keeps them.
|
|
@@ -3114,6 +3151,13 @@ const messageBase = {
|
|
|
3114
3151
|
removeTools: RemoveToolsSchema.optional(),
|
|
3115
3152
|
delivery: MessageDeliverySchema.optional(),
|
|
3116
3153
|
context: MessageContextSchema.optional(),
|
|
3154
|
+
/**
|
|
3155
|
+
* The skill a person starts with this message (Host feature `person-started-skills`): one of the
|
|
3156
|
+
* root agent's skills, by name, offered to the model for this turn even when only a person may
|
|
3157
|
+
* start it (`disableModelInvocation`). A name the session's agent doesn't hold is
|
|
3158
|
+
* `400 unknown_skill`. A message naming a skill waits for its own turn: it never steers.
|
|
3159
|
+
*/
|
|
3160
|
+
skill: z.string().min(1).max(64).optional(),
|
|
3117
3161
|
};
|
|
3118
3162
|
/**
|
|
3119
3163
|
* One part of a user message (protocol 6): text, or a file by artifact id. A file part without
|
|
@@ -3189,7 +3233,7 @@ export const SessionCommandSchema = z.union([
|
|
|
3189
3233
|
.strict(),
|
|
3190
3234
|
]);
|
|
3191
3235
|
export const SessionEventBodySchema = SessionCommandSchema;
|
|
3192
|
-
/** The envelope every session event carries (`nylorun.event/2
|
|
3236
|
+
/** The envelope every session event carries (`nylorun.event/2`). */
|
|
3193
3237
|
export const EVENT_SCHEMA = "nylorun.event/2";
|
|
3194
3238
|
/**
|
|
3195
3239
|
* Who wrote an event: the writer says so, not the event's type. `client` is a
|
|
@@ -3217,7 +3261,7 @@ export const EventSourceKindSchema = z.enum([
|
|
|
3217
3261
|
"api",
|
|
3218
3262
|
]);
|
|
3219
3263
|
/**
|
|
3220
|
-
* Whose account an event is: the agent's or the Runtime's
|
|
3264
|
+
* Whose account an event is: the agent's or the Runtime's. A session's events have one each
|
|
3221
3265
|
* (`EVENT_CATALOG`); every event on an Agent's stream (`AGENT_EVENT_TYPES`) is the Runtime's.
|
|
3222
3266
|
*/
|
|
3223
3267
|
export const EVENT_LAYERS = ["agent", "runtime"];
|
|
@@ -3298,7 +3342,7 @@ export const AcceptedResponseSchema = z.object({
|
|
|
3298
3342
|
/**
|
|
3299
3343
|
* A message the session queued because a turn runs or waits (protocol 17): it starts the next
|
|
3300
3344
|
* turn when this one ends. `position` counts from 1, the first to go. `delivery` is what applied
|
|
3301
|
-
|
|
3345
|
+
*: `steer` when the running turn takes it before a step, `queue` otherwise; a Host without
|
|
3302
3346
|
* the feature `steer` leaves it out.
|
|
3303
3347
|
*/
|
|
3304
3348
|
export const QueuedResponseSchema = z.object({
|
|
@@ -3363,7 +3407,7 @@ export const MeteredUsageSchema = z
|
|
|
3363
3407
|
})
|
|
3364
3408
|
.passthrough();
|
|
3365
3409
|
/**
|
|
3366
|
-
* One retry of a model call
|
|
3410
|
+
* One retry of a model call: the attempt it started, the first counted as 1,
|
|
3367
3411
|
* the delay waited before it, and the error that ended the attempt before it, as the provider or
|
|
3368
3412
|
* its SDK worded it, cut to 300 characters.
|
|
3369
3413
|
*/
|
|
@@ -3428,7 +3472,7 @@ export function isEmptyAssistantMessage(payload) {
|
|
|
3428
3472
|
(payload.toolCalls?.length ?? 0) === 0);
|
|
3429
3473
|
}
|
|
3430
3474
|
/**
|
|
3431
|
-
* `model.failed`: a model call that failed in a known way
|
|
3475
|
+
* `model.failed`: a model call that failed in a known way. The turn
|
|
3432
3476
|
* then fails with `model.<code>`, or recovers.
|
|
3433
3477
|
*/
|
|
3434
3478
|
export const ModelFailedPayloadSchema = z
|
|
@@ -3443,7 +3487,7 @@ export const ModelFailedPayloadSchema = z
|
|
|
3443
3487
|
.passthrough();
|
|
3444
3488
|
/**
|
|
3445
3489
|
* `context.compacted`: the harness summarized older history to fit the model's window
|
|
3446
|
-
|
|
3490
|
+
*, and said so with the transcript edit that replaced it (`kind: "compaction"`,
|
|
3447
3491
|
* protocol 15). Token counts are the harness's estimates; `invocationId` and the model facts are
|
|
3448
3492
|
* the last summary call's. Written once per compaction, when the segment's edit is recorded.
|
|
3449
3493
|
*/
|
|
@@ -3609,7 +3653,7 @@ export const TurnCancelledPayloadSchema = z
|
|
|
3609
3653
|
/**
|
|
3610
3654
|
* `message.queued` (protocol 17): a message arrived while the session's turn ran or waited, and
|
|
3611
3655
|
* waits in its queue. `position` counts from 1; the message's `command.message` is written when
|
|
3612
|
-
* a turn takes it. `delivery`
|
|
3656
|
+
* a turn takes it. `delivery` says whether the running turn may take it before a step.
|
|
3613
3657
|
*/
|
|
3614
3658
|
export const MessageQueuedPayloadSchema = z
|
|
3615
3659
|
.object({
|
|
@@ -3650,7 +3694,7 @@ export const PlanUpdatedPayloadSchema = z
|
|
|
3650
3694
|
.passthrough();
|
|
3651
3695
|
/**
|
|
3652
3696
|
* `queue.taken` (protocol 17): the turn that started with the queued messages, in order. With
|
|
3653
|
-
* `step
|
|
3697
|
+
* `step`, the running turn took steered messages before that step instead.
|
|
3654
3698
|
*/
|
|
3655
3699
|
export const QueueTakenPayloadSchema = z
|
|
3656
3700
|
.object({
|
|
@@ -3711,8 +3755,10 @@ export const CommandMessagePayloadSchema = z
|
|
|
3711
3755
|
manifest: z.unknown().optional(),
|
|
3712
3756
|
/** The tools the message's turn may not use (Host feature `remove-tools`). */
|
|
3713
3757
|
removeTools: z.array(z.string()).optional(),
|
|
3714
|
-
/** The context items the message carried for its turn (
|
|
3758
|
+
/** The context items the message carried for its turn (Host feature `message-context`). */
|
|
3715
3759
|
context: z.array(z.object({ type: z.string().optional(), value: jsonValue }).strict()).optional(),
|
|
3760
|
+
/** The skill a person started with the message (Host feature `person-started-skills`). */
|
|
3761
|
+
skill: z.string().optional(),
|
|
3716
3762
|
delivery: MessageDeliverySchema.optional(),
|
|
3717
3763
|
/** Set when the message waited in the session's queue (protocol 17): its id there. */
|
|
3718
3764
|
queuedMessageId: z.string().optional(),
|
|
@@ -3864,7 +3910,7 @@ export const TranscriptUpdatedPayloadSchema = z
|
|
|
3864
3910
|
*/
|
|
3865
3911
|
export const ArtifactSourceSchema = z.enum(["upload", "engine", "export", "snapshot"]);
|
|
3866
3912
|
/**
|
|
3867
|
-
* Who an artifact is for
|
|
3913
|
+
* Who an artifact is for: `model` for a file our engine stored only so its model could
|
|
3868
3914
|
* see it (a sandbox image or PDF it read). Such an artifact stays in the session, readable by id,
|
|
3869
3915
|
* but is no output: no A2A task file, no AG-UI history entry, not in a session's artifact list.
|
|
3870
3916
|
* Absent for everything else.
|
|
@@ -3890,7 +3936,7 @@ export const ArtifactVersionPayloadSchema = z
|
|
|
3890
3936
|
size: z.number().int().nonnegative(),
|
|
3891
3937
|
sha256: z.string(),
|
|
3892
3938
|
source: ArtifactSourceSchema,
|
|
3893
|
-
/** `model`: stored only for the model to see
|
|
3939
|
+
/** `model`: stored only for the model to see; absent for an output. */
|
|
3894
3940
|
audience: ArtifactAudienceSchema.optional(),
|
|
3895
3941
|
/** The tool call that saved it (`save_artifact`), when our engine did. */
|
|
3896
3942
|
callId: z.string().optional(),
|
|
@@ -3945,7 +3991,7 @@ export const ArtifactExportFailedPayloadSchema = z
|
|
|
3945
3991
|
.passthrough();
|
|
3946
3992
|
/**
|
|
3947
3993
|
* `engine.diagnostic`: our engine met something about the session's agent that the agent's
|
|
3948
|
-
* declarations decide, and says so instead of choosing for it
|
|
3994
|
+
* declarations decide, and says so instead of choosing for it, such as `mcp_tools_inline`:
|
|
3949
3995
|
* an agent that does not declare `engine.toolSearch` has MCP tool schemas past the share of the
|
|
3950
3996
|
* model's context window at which they would be deferred, and keeps them all in its tool list.
|
|
3951
3997
|
*/
|
|
@@ -4049,7 +4095,7 @@ export const McpDiscoveredPayloadSchema = z
|
|
|
4049
4095
|
})
|
|
4050
4096
|
.passthrough();
|
|
4051
4097
|
/**
|
|
4052
|
-
* The event catalog
|
|
4098
|
+
* The event catalog: every session event type, its payload schema, its
|
|
4053
4099
|
* payload schema version and who writes it. A type not listed here cannot be written. A type
|
|
4054
4100
|
* with `visibility: "internal"` is recorded and folded by the Runtime but never served to
|
|
4055
4101
|
* clients (SSE, history, AG-UI and A2A skip it).
|
|
@@ -4122,7 +4168,7 @@ export const EVENT_CATALOG = {
|
|
|
4122
4168
|
},
|
|
4123
4169
|
};
|
|
4124
4170
|
export const EVENT_TYPES = Object.keys(EVENT_CATALOG);
|
|
4125
|
-
/** An event type's layer
|
|
4171
|
+
/** An event type's layer; `undefined` for a type this version does not know. */
|
|
4126
4172
|
export function eventLayer(type) {
|
|
4127
4173
|
return Object.hasOwn(EVENT_CATALOG, type) ? EVENT_CATALOG[type].layer : undefined;
|
|
4128
4174
|
}
|
|
@@ -4243,7 +4289,7 @@ export const HostTenantSchema = z
|
|
|
4243
4289
|
cause: TenantCauseSchema.optional(),
|
|
4244
4290
|
})
|
|
4245
4291
|
.strict();
|
|
4246
|
-
/** A stream relay's state
|
|
4292
|
+
/** A stream relay's state. */
|
|
4247
4293
|
export const StreamRelayStatusSchema = z
|
|
4248
4294
|
.object({
|
|
4249
4295
|
/** This process holds the replication slot (one process per slot does). */
|
|
@@ -4884,7 +4930,7 @@ export const TenantSandboxViewSchema = z
|
|
|
4884
4930
|
namespace: z.string(),
|
|
4885
4931
|
context: z.string(),
|
|
4886
4932
|
ready: z.boolean(),
|
|
4887
|
-
/** What runs the pods: `agent-sandbox` Sandboxes, or `substrate` actors (preview
|
|
4933
|
+
/** What runs the pods: `agent-sandbox` Sandboxes, or `substrate` actors (preview). */
|
|
4888
4934
|
backend: z.enum(["agent-sandbox", "substrate"]).optional(),
|
|
4889
4935
|
/** With backend `substrate`: the Tenant's atespace and Substrate's version. */
|
|
4890
4936
|
atespace: z.string().optional(),
|
|
@@ -5002,7 +5048,7 @@ export const ToolInputConditionSchema = z
|
|
|
5002
5048
|
});
|
|
5003
5049
|
/**
|
|
5004
5050
|
* One rule of the Tenant's tool policy, applied at the Tool Gate to every MCP and HTTP tool call
|
|
5005
|
-
* of every harness, and to the operations the Runtime serves itself (`kind: "runtime"
|
|
5051
|
+
* of every harness, and to the operations the Runtime serves itself (`kind: "runtime"`). A
|
|
5006
5052
|
* rule matches a call when every selector it sets matches: `tool` (the tool's identity: an MCP
|
|
5007
5053
|
* tool's own name on its server, an HTTP tool's declared name, or a runtime operation:
|
|
5008
5054
|
* `triggers`, `memory`, `schedule_wake`; never the name a harness gave the model; `*` for any run
|
|
@@ -5088,7 +5134,7 @@ export const AgUiRunErrorCodeSchema = z.enum([
|
|
|
5088
5134
|
...ERROR_CODES,
|
|
5089
5135
|
"runtime_error",
|
|
5090
5136
|
]);
|
|
5091
|
-
// --- Studio embedding
|
|
5137
|
+
// --- Studio embedding ---------------------------------------------------
|
|
5092
5138
|
/**
|
|
5093
5139
|
* A Tenant id as Studio's routes accept it.
|
|
5094
5140
|
* An identifier's grammar is the protocol's: it crosses the Runtime API, tokens and grants
|
|
@@ -5155,7 +5201,7 @@ function embed(kind, shape) {
|
|
|
5155
5201
|
...shape,
|
|
5156
5202
|
});
|
|
5157
5203
|
}
|
|
5158
|
-
/** Every message between an embedder and Studio
|
|
5204
|
+
/** Every message between an embedder and Studio. */
|
|
5159
5205
|
export const StudioEmbedMessageSchema = z.discriminatedUnion("kind", [
|
|
5160
5206
|
embed("ready", {
|
|
5161
5207
|
protocols: z.array(z.number().int().positive()).min(1),
|
|
@@ -5215,7 +5261,7 @@ export function parseFrameAncestors(value) {
|
|
|
5215
5261
|
throw new Error(`${entry} is not an exact origin. Use origins such as nylorun://localhost or https://app.example.com, with no wildcards or paths.`);
|
|
5216
5262
|
return [...new Set(entries)];
|
|
5217
5263
|
}
|
|
5218
|
-
// --- File artifacts (protocol 6
|
|
5264
|
+
// --- File artifacts (protocol 6) ----------------------------------------
|
|
5219
5265
|
/** The JWT `typ` of a capability link's token (RFC 8725 explicit typing). */
|
|
5220
5266
|
export const ARTIFACT_LINK_TOKEN_TYPE = "nylorun-artifact+jwt";
|
|
5221
5267
|
/**
|
|
@@ -5277,7 +5323,7 @@ export const ArtifactViewSchema = z
|
|
|
5277
5323
|
latestVersion: z.number().int().positive(),
|
|
5278
5324
|
labels: z.record(z.string(), z.string()).optional(),
|
|
5279
5325
|
/**
|
|
5280
|
-
* `model`: our engine stored it only so its model could see it
|
|
5326
|
+
* `model`: our engine stored it only so its model could see it. Readable by id;
|
|
5281
5327
|
* never in a list of artifacts. Absent for every other artifact.
|
|
5282
5328
|
*/
|
|
5283
5329
|
audience: ArtifactAudienceSchema.optional(),
|
|
@@ -5339,7 +5385,7 @@ export const ArtifactLinkSchema = z
|
|
|
5339
5385
|
expiresAt: z.string(),
|
|
5340
5386
|
})
|
|
5341
5387
|
.strict();
|
|
5342
|
-
// --- Folder artifacts (protocol 6
|
|
5388
|
+
// --- Folder artifacts (protocol 6) -------------------------------------------------------
|
|
5343
5389
|
/** The media type of a folder artifact and of its manifests. */
|
|
5344
5390
|
export const FOLDER_CONTENT_TYPE = "application/vnd.nylorun.folder+json";
|
|
5345
5391
|
/** The manifest format a folder version is stored as. */
|
|
@@ -5587,6 +5633,18 @@ export const ModelCallExportPageSchema = z
|
|
|
5587
5633
|
asOf: z.string(),
|
|
5588
5634
|
})
|
|
5589
5635
|
.strict();
|
|
5636
|
+
/**
|
|
5637
|
+
* A page of every Agent's events, in safe transaction order (`GET /v1/tenant/agent-events`):
|
|
5638
|
+
* `next` reads on, and `caughtUp` says the page reached the newest committed event.
|
|
5639
|
+
*/
|
|
5640
|
+
export const AgentEventExportPageSchema = z
|
|
5641
|
+
.object({
|
|
5642
|
+
events: z.array(AgentEventSchema),
|
|
5643
|
+
next: z.string().nullable(),
|
|
5644
|
+
caughtUp: z.boolean(),
|
|
5645
|
+
asOf: z.string(),
|
|
5646
|
+
})
|
|
5647
|
+
.strict();
|
|
5590
5648
|
/**
|
|
5591
5649
|
* A turn's status in the turn index (Host feature `turns`): `running` from its first
|
|
5592
5650
|
* `command.message` and again after an answer, `paused` while it waits for a person, then one of
|