@nylorun/core 0.33.0-beta → 0.35.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 +85 -0
- package/dist/compatibility.d.ts +25 -1
- package/dist/compatibility.js +24 -0
- package/dist/contracts.d.ts +749 -17
- package/dist/contracts.js +360 -22
- package/dist/define.d.ts +1 -1
- package/dist/define.js +1 -1
- package/dist/definition/assemble.d.ts +2 -1
- package/dist/definition/assemble.js +1 -0
- package/dist/definition/from.js +1 -0
- package/dist/definition/manifest.d.ts +2 -1
- package/dist/definition/manifest.js +1 -0
- package/dist/definition/sections.d.ts +1 -1
- package/dist/definition/sections.js +5 -1
- package/dist/definition/variant.d.ts +16 -1
- package/dist/definition/variant.js +81 -3
- package/dist/engine/blocks.d.ts +54 -0
- package/dist/engine/blocks.js +162 -0
- package/dist/engine/explain.d.ts +36 -0
- package/dist/engine/explain.js +113 -0
- package/dist/engine/features.d.ts +28 -0
- package/dist/engine/features.js +34 -0
- package/dist/engine/index.d.ts +14 -0
- package/dist/engine/index.js +14 -0
- package/dist/engine/mcp.d.ts +119 -0
- package/dist/engine/mcp.js +267 -0
- package/dist/engine/names.d.ts +12 -0
- package/dist/engine/names.js +26 -0
- package/dist/engine/preview.d.ts +93 -0
- package/dist/engine/preview.js +120 -0
- package/dist/engine/projection.d.ts +63 -0
- package/dist/engine/projection.js +109 -0
- package/dist/engine/tools.d.ts +118 -0
- package/dist/engine/tools.js +508 -0
- package/dist/folder/compile.d.ts +11 -4
- package/dist/folder/compile.js +126 -13
- package/dist/folder/context.d.ts +5 -0
- package/dist/folder/decompile.js +22 -1
- package/dist/folder/engine.d.ts +73 -0
- package/dist/folder/engine.js +224 -0
- package/dist/folder/nested.js +6 -0
- package/dist/folder/schemas.js +47 -3
- package/dist/harness-api/harness-api.schema.json +29 -7
- package/dist/harness-api/json-schema.js +6 -2
- package/dist/harness-api/messages.d.ts +4 -2
- package/dist/harness-api/messages.js +4 -1
- package/dist/harness-api/schema.d.ts +15 -4
- package/dist/harness-api/schema.js +20 -4
- package/dist/manifest-schemas.js +9 -4
- package/dist/schemas/agent-folder/agent-md.schema.json +84 -3
- package/dist/schemas/agent-folder/runtime.schema.json +34 -1
- package/dist/schemas/agent-manifest.schema.json +166 -1
- package/dist/schemas/harness-manifest.schema.json +130 -1
- package/dist/schemas/runtime-manifest.schema.json +34 -1
- package/dist/types/manifest.d.ts +49 -0
- package/package.json +5 -1
package/dist/contracts.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/** Public wire contracts only. Never import checkpoint or engine modules here. */
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { SANDBOX_NETWORK_PRESETS, isSandboxHostPattern, parseSandboxDuration, parseSandboxSize, } from "./utils/sandbox.js";
|
|
3
|
+
import { SANDBOX_NETWORK_PRESETS, SANDBOX_TOOL_NAMES, isSandboxHostPattern, parseSandboxDuration, parseSandboxSize, } from "./utils/sandbox.js";
|
|
4
4
|
import { REMOVED_MANIFEST_FIELDS, REMOVED_RUNTIME_SECTION_FIELDS, agentManifestVersionIssue, manifestVersionIssue, workflowVersionIssue, } from "./definition/removed.js";
|
|
5
5
|
import { DELEGATE_INPUT_SCHEMA, DELEGATE_NAME_PATTERN } from "./definition/delegate.js";
|
|
6
6
|
import { stdioMcpRefusal } from "./definition/mcp.js";
|
|
7
7
|
import { APPROVAL_MODES, HTTP_TOOL_METHODS, httpInputIssue, httpUrlIssue, httpUrlTemplateIssue, httpVerifierIssue, } from "./definition/http-tool.js";
|
|
8
8
|
import { canonical } from "./utils/canonical.js";
|
|
9
|
+
import { ENGINE_BLOCK_NAMES } from "./engine/names.js";
|
|
9
10
|
import { FILE_NAME_MAX, FILE_PATH_MAX, LINK_TARGET_MAX } from "./utils/file-systems.js";
|
|
10
11
|
export { FILE_NAME_MAX, FILE_PATH_MAX } from "./utils/file-systems.js";
|
|
11
12
|
import { DEFAULT_HARNESS, HARNESS_ID_PATTERN, isHarnessId } from "./utils/harness-id.js";
|
|
@@ -230,6 +231,47 @@ const agentRequirementsSchema = z
|
|
|
230
231
|
secrets: z.array(z.string().regex(ENVIRONMENT_NAME_PATTERN, "A secret name in requires is an environment variable name")).optional(),
|
|
231
232
|
})
|
|
232
233
|
.strict();
|
|
234
|
+
/**
|
|
235
|
+
* The engine features an agent declares (ADR-100, `agent-folder/2`): `harness.engine` of an
|
|
236
|
+
* agent manifest v8 and `engine` of the loop manifest (v7) the harness runs. With it, our engine
|
|
237
|
+
* adds only what it names; without it, the defaults of `agent-folder/1`.
|
|
238
|
+
*/
|
|
239
|
+
const engineBlockRefSchema = z
|
|
240
|
+
.object({
|
|
241
|
+
name: z.enum(ENGINE_BLOCK_NAMES),
|
|
242
|
+
version: z.number().int().positive(),
|
|
243
|
+
sha256: z.string().regex(/^sha256:[0-9a-f]{64}$/),
|
|
244
|
+
source: z.string().min(1).optional(),
|
|
245
|
+
})
|
|
246
|
+
.strict();
|
|
247
|
+
export const HarnessEngineSchema = z
|
|
248
|
+
.strictObject({
|
|
249
|
+
sandbox: z
|
|
250
|
+
.array(z.enum(SANDBOX_TOOL_NAMES))
|
|
251
|
+
.refine((tools) => new Set(tools).size === tools.length, { message: "engine.sandbox names each tool once" })
|
|
252
|
+
.optional()
|
|
253
|
+
.meta({ description: "The sandbox tools offered: any of bash, read, write, edit, grep and glob; needs a computer" }),
|
|
254
|
+
artifacts: z
|
|
255
|
+
.strictObject({ read: z.boolean().optional(), save: z.boolean().optional() })
|
|
256
|
+
.optional()
|
|
257
|
+
.meta({ description: "read: read_artifact and its text; save: save_artifact and its text (needs a computer)" }),
|
|
258
|
+
outputs: z.boolean().optional().meta({ description: "Save /workspace/outputs when a turn ends; needs a computer" }),
|
|
259
|
+
toolSearch: z
|
|
260
|
+
.boolean()
|
|
261
|
+
.optional()
|
|
262
|
+
.meta({ description: "Defer MCP tools behind tool_search when their schemas pass the threshold" }),
|
|
263
|
+
triggers: z
|
|
264
|
+
.boolean()
|
|
265
|
+
.optional()
|
|
266
|
+
.meta({ description: "The triggers tool and its text: the root agent sets up its own triggers; never a subagent's" }),
|
|
267
|
+
instructions: z
|
|
268
|
+
.partialRecord(z.enum(ENGINE_BLOCK_NAMES), z.string().min(1))
|
|
269
|
+
.optional()
|
|
270
|
+
.meta({ description: "A block's wording replaced, by block name" }),
|
|
271
|
+
blocks: z.array(engineBlockRefSchema).optional().meta({ description: "The engine text blocks the agent gets, with their hashes" }),
|
|
272
|
+
})
|
|
273
|
+
.meta({ id: "HarnessEngine" });
|
|
274
|
+
const harnessEngineField = HarnessEngineSchema.optional();
|
|
233
275
|
const agentManifestSchema = z
|
|
234
276
|
.strictObject({
|
|
235
277
|
manifestSchemaVersion: z.literal(7, {
|
|
@@ -245,6 +287,7 @@ const agentManifestSchema = z
|
|
|
245
287
|
skills: z.record(z.string(), skillManifestSchema).optional(),
|
|
246
288
|
mcpServers: z.record(z.string(), mcpServerSchema).optional(),
|
|
247
289
|
requires: agentRequirementsSchema.optional(),
|
|
290
|
+
engine: harnessEngineField,
|
|
248
291
|
// Reserved for Functions, which are deferred: developer code the Runtime will run from
|
|
249
292
|
// uploaded definition files (a `functions/` folder). Any value is refused below.
|
|
250
293
|
functions: z.unknown().optional().meta({ description: "Reserved: Functions are not available yet" }),
|
|
@@ -703,6 +746,21 @@ export const EnvironmentLimitsSchema = z
|
|
|
703
746
|
})
|
|
704
747
|
.strict()
|
|
705
748
|
.optional(),
|
|
749
|
+
/**
|
|
750
|
+
* Its triggers (D83), within the Tenant's Runtime limits `triggersPerAgent`,
|
|
751
|
+
* `triggerMinIntervalMs` and `triggerRunsPerHour`: lowering one deletes nothing.
|
|
752
|
+
*/
|
|
753
|
+
triggers: z
|
|
754
|
+
.object({
|
|
755
|
+
/** The most triggers its agents may make with the `triggers` tool; at most `triggersPerAgent`. */
|
|
756
|
+
count: z.number().int().positive().optional(),
|
|
757
|
+
/** The shortest gap between two runs of a schedule its agents make; at least `triggerMinIntervalMs`. */
|
|
758
|
+
minIntervalMs: z.number().int().positive().optional(),
|
|
759
|
+
/** The most runs its triggers start or queue in any hour; at most `triggerRunsPerHour`. */
|
|
760
|
+
runsPerHour: z.number().int().positive().optional(),
|
|
761
|
+
})
|
|
762
|
+
.strict()
|
|
763
|
+
.optional(),
|
|
706
764
|
})
|
|
707
765
|
.strict();
|
|
708
766
|
/**
|
|
@@ -1098,6 +1156,10 @@ export const AGENT_EVENT_TYPES = [
|
|
|
1098
1156
|
"agent.trigger_paused",
|
|
1099
1157
|
"agent.trigger_resumed",
|
|
1100
1158
|
"agent.trigger_secret_rotated",
|
|
1159
|
+
// Triggers an agent made with the triggers tool (D83), and one deleted by an agent or a person.
|
|
1160
|
+
"agent.trigger_created",
|
|
1161
|
+
"agent.trigger_updated",
|
|
1162
|
+
"agent.trigger_deleted",
|
|
1101
1163
|
// Memory (track T5, D72): a turn changed the Agent's memories.
|
|
1102
1164
|
"agent.memory_updated",
|
|
1103
1165
|
];
|
|
@@ -1192,6 +1254,35 @@ export const AGENT_EVENT_PAYLOADS = {
|
|
|
1192
1254
|
"agent.trigger_resumed": z.object({ triggerId: z.string() }).passthrough(),
|
|
1193
1255
|
/** A webhook trigger's signing secret was made or replaced; the one before stopped working. */
|
|
1194
1256
|
"agent.trigger_secret_rotated": z.object({ triggerId: z.string() }).passthrough(),
|
|
1257
|
+
/**
|
|
1258
|
+
* An agent made a trigger with the `triggers` tool (D83), or replaced one with the same id
|
|
1259
|
+
* (`agent.trigger_updated`): the session whose agent made it (`sessionId`), the session it runs
|
|
1260
|
+
* in (`session`), its title and its next run.
|
|
1261
|
+
*/
|
|
1262
|
+
"agent.trigger_created": z
|
|
1263
|
+
.object({
|
|
1264
|
+
triggerId: z.string(),
|
|
1265
|
+
kind: z.enum(["schedule", "at"]),
|
|
1266
|
+
sessionId: z.string(),
|
|
1267
|
+
session: z.string(),
|
|
1268
|
+
title: z.string().optional(),
|
|
1269
|
+
nextRunAt: z.string().nullable(),
|
|
1270
|
+
})
|
|
1271
|
+
.passthrough(),
|
|
1272
|
+
"agent.trigger_updated": z
|
|
1273
|
+
.object({
|
|
1274
|
+
triggerId: z.string(),
|
|
1275
|
+
kind: z.enum(["schedule", "at"]),
|
|
1276
|
+
sessionId: z.string(),
|
|
1277
|
+
session: z.string(),
|
|
1278
|
+
title: z.string().optional(),
|
|
1279
|
+
nextRunAt: z.string().nullable(),
|
|
1280
|
+
})
|
|
1281
|
+
.passthrough(),
|
|
1282
|
+
/** A trigger an agent made was deleted: by an agent of `sessionId`, or over the API (`principal`). */
|
|
1283
|
+
"agent.trigger_deleted": z
|
|
1284
|
+
.object({ triggerId: z.string(), sessionId: z.string().optional(), principal: z.string().optional() })
|
|
1285
|
+
.passthrough(),
|
|
1195
1286
|
/** A turn changed the Agent's memories (`memory.updated` in its session): which, and how. */
|
|
1196
1287
|
"agent.memory_updated": MemoryUpdatedPayloadSchema.extend({ sessionId: z.string(), turnId: z.string() }),
|
|
1197
1288
|
};
|
|
@@ -1343,8 +1434,10 @@ export const CredentialIdentitySchema = z.object({ header: CredentialHeaderNameS
|
|
|
1343
1434
|
* `toolPrefix`: what the gateway at `via` puts before each tool name it lists, such as
|
|
1344
1435
|
* LiteLLM's `github-` (Host feature `gateway-credentials`). The Runtime lists the server's tools
|
|
1345
1436
|
* without it, so tool names, a manifest's `tools` settings and tool policy rules name the server's
|
|
1346
|
-
* own tools, and calls a tool by the name the gateway listed.
|
|
1347
|
-
*
|
|
1437
|
+
* own tools, and calls a tool by the name the gateway listed. On an Agent's secret, only with
|
|
1438
|
+
* `via`. A manifest's `bearer` or `headers` slot may name it too (Host feature `secret-routing`),
|
|
1439
|
+
* with or without a `via`: it applies whenever the credential's requests go to a `via`, and wins
|
|
1440
|
+
* over the secret's.
|
|
1348
1441
|
*/
|
|
1349
1442
|
export const CredentialToolPrefixSchema = z
|
|
1350
1443
|
.string()
|
|
@@ -1519,14 +1612,22 @@ export const PutAgentSecretRequestSchema = z.discriminatedUnion("type", [
|
|
|
1519
1612
|
/**
|
|
1520
1613
|
* A secret write on an Environment whose manifest declares the secret's slot: only the
|
|
1521
1614
|
* value, `value` (or `headers` for a `headers` slot). Its type and binding come from the slot,
|
|
1522
|
-
* except
|
|
1615
|
+
* except this installation's routing of a `bearer` or `headers` slot (Host feature
|
|
1616
|
+
* `secret-routing`): `via`, where its requests go, which wins over the slot's; and the gateway's
|
|
1617
|
+
* `toolPrefix`, which needs a `via` (the write's or the slot's) and gives way to the slot's.
|
|
1523
1618
|
*/
|
|
1524
1619
|
export const PutAgentSecretValueRequestSchema = z
|
|
1525
1620
|
.object({
|
|
1526
1621
|
requestId: RequestIdSchema.optional(),
|
|
1527
1622
|
value: z.string().min(1).optional(),
|
|
1528
1623
|
headers: CredentialHeadersSchema.optional(),
|
|
1529
|
-
/**
|
|
1624
|
+
/**
|
|
1625
|
+
* A `bearer` or `headers` slot: where this installation sends the credential's requests,
|
|
1626
|
+
* such as a gateway's endpoint for the server. Wins over the slot's `via`; the credential is
|
|
1627
|
+
* still chosen by the slot's `url`.
|
|
1628
|
+
*/
|
|
1629
|
+
via: CredentialViaSchema.optional(),
|
|
1630
|
+
/** A `bearer` or `headers` slot with a `via`: how the gateway there prefixes tool names. */
|
|
1530
1631
|
toolPrefix: CredentialToolPrefixSchema.optional(),
|
|
1531
1632
|
})
|
|
1532
1633
|
.strict()
|
|
@@ -1556,7 +1657,11 @@ const slotBase = {
|
|
|
1556
1657
|
/**
|
|
1557
1658
|
* One secret an Environment of a kind needs: its type and binding, never its value. The
|
|
1558
1659
|
* value is written into each Environment's vault (`PUT /v1/agents/{id}/secrets/{name}`
|
|
1559
|
-
* with `{ value }`, or `{ headers }` for `headers`), and the binding comes from here.
|
|
1660
|
+
* with `{ value }`, or `{ headers }` for `headers`), and the binding comes from here. A
|
|
1661
|
+
* `bearer` or `headers` slot may name the gateway's `toolPrefix` without a `via`, so a folder
|
|
1662
|
+
* names how tools are listed and each installation binds where requests go (the write's `via`,
|
|
1663
|
+
* Host feature `secret-routing`). At each request the credential's `via` is the secret's, else
|
|
1664
|
+
* the slot's, else none (the slot's `url`), and its tool prefix the slot's, else the secret's.
|
|
1560
1665
|
*/
|
|
1561
1666
|
export const EnvironmentSecretSlotSchema = z.discriminatedUnion("type", [
|
|
1562
1667
|
z
|
|
@@ -1568,8 +1673,24 @@ export const EnvironmentSecretSlotSchema = z.discriminatedUnion("type", [
|
|
|
1568
1673
|
})
|
|
1569
1674
|
.strict(),
|
|
1570
1675
|
z.object({ type: z.literal("environment_variable"), ...slotBase }).strict(),
|
|
1571
|
-
z
|
|
1572
|
-
|
|
1676
|
+
z
|
|
1677
|
+
.object({
|
|
1678
|
+
type: z.literal("bearer"),
|
|
1679
|
+
url: z.string().min(1),
|
|
1680
|
+
...credentialRouting,
|
|
1681
|
+
toolPrefix: CredentialToolPrefixSchema.optional(),
|
|
1682
|
+
...slotBase,
|
|
1683
|
+
})
|
|
1684
|
+
.strict(),
|
|
1685
|
+
z
|
|
1686
|
+
.object({
|
|
1687
|
+
type: z.literal("headers"),
|
|
1688
|
+
url: z.string().min(1),
|
|
1689
|
+
...credentialRouting,
|
|
1690
|
+
toolPrefix: CredentialToolPrefixSchema.optional(),
|
|
1691
|
+
...slotBase,
|
|
1692
|
+
})
|
|
1693
|
+
.strict(),
|
|
1573
1694
|
]);
|
|
1574
1695
|
/** A manifest's secret slots: at most the Tenant's Runtime limit `environmentSecretSlots`. */
|
|
1575
1696
|
export const EnvironmentSecretSlotsSchema = z
|
|
@@ -1630,6 +1751,10 @@ export const HarnessMemorySchema = z.strictObject({
|
|
|
1630
1751
|
.max(MEMORY_INSTRUCTIONS_MAX)
|
|
1631
1752
|
.optional()
|
|
1632
1753
|
.meta({ description: "What this agent should remember, after the engine's own memory rules" }),
|
|
1754
|
+
index: z
|
|
1755
|
+
.boolean()
|
|
1756
|
+
.optional()
|
|
1757
|
+
.meta({ description: "agent-folder/2: false pins no memory index in a session. Default true" }),
|
|
1633
1758
|
});
|
|
1634
1759
|
const harnessMemoryField = HarnessMemorySchema.optional()
|
|
1635
1760
|
.meta({ description: "The Agent's memory: Markdown files under /memories it keeps across sessions" });
|
|
@@ -1676,6 +1801,7 @@ const agentHarnessObject = z
|
|
|
1676
1801
|
loop: harnessLoopField,
|
|
1677
1802
|
memory: harnessMemoryField,
|
|
1678
1803
|
model: harnessModelField,
|
|
1804
|
+
engine: harnessEngineField,
|
|
1679
1805
|
functions: z.unknown().optional().meta({ description: "Reserved: Functions are not available yet" }),
|
|
1680
1806
|
}, { error: removedFieldError(REMOVED_HARNESS_FIELDS) })
|
|
1681
1807
|
.superRefine((harness, ctx) => {
|
|
@@ -1794,12 +1920,27 @@ export function triggerKindOf(trigger) {
|
|
|
1794
1920
|
* `manual`, or `new` for one an upgrade added), `completed` is an `at` that ran.
|
|
1795
1921
|
*/
|
|
1796
1922
|
export const TRIGGER_STATUSES = ["active", "paused", "completed"];
|
|
1797
|
-
/**
|
|
1923
|
+
/**
|
|
1924
|
+
* Where a trigger's definition comes from (D83): `manifest` (the version's `runtime.triggers`),
|
|
1925
|
+
* `agent` (made by an agent of the Agent's sessions with the `triggers` tool, kept by the Agent)
|
|
1926
|
+
* or `wake` (a session's booked wake, never listed).
|
|
1927
|
+
*/
|
|
1928
|
+
export const TRIGGER_ORIGINS = ["manifest", "agent", "wake"];
|
|
1929
|
+
/**
|
|
1930
|
+
* `GET /v1/agents/{id}/triggers`: one trigger, from its manifest entry (or, for one an agent made,
|
|
1931
|
+
* its own definition) and the Agent's state.
|
|
1932
|
+
*/
|
|
1798
1933
|
export const TriggerViewSchema = z
|
|
1799
1934
|
.object({
|
|
1800
1935
|
id: z.string(),
|
|
1801
1936
|
kind: z.enum(TRIGGER_KINDS),
|
|
1937
|
+
origin: z.enum(TRIGGER_ORIGINS),
|
|
1938
|
+
/** The title an agent gave a trigger it made; null for a manifest's. */
|
|
1939
|
+
title: z.string().nullable(),
|
|
1940
|
+
/** The session whose agent made it; null for a manifest's. */
|
|
1941
|
+
createdSessionId: z.string().nullable(),
|
|
1802
1942
|
status: z.enum(TRIGGER_STATUSES),
|
|
1943
|
+
/** `manual`, `new` for one an upgrade added, `undeclared` for an agent's while the version lacks `engine.triggers`. */
|
|
1803
1944
|
pausedReason: z.string().nullable(),
|
|
1804
1945
|
schedule: z.string().optional(),
|
|
1805
1946
|
timezone: z.string().optional(),
|
|
@@ -1816,9 +1957,66 @@ export const TriggerViewSchema = z
|
|
|
1816
1957
|
webhookUrl: z.string().optional(),
|
|
1817
1958
|
/** Whether a webhook trigger has a signing secret (`POST .../secret` makes one). */
|
|
1818
1959
|
secretSet: z.boolean().optional(),
|
|
1960
|
+
/** What each run sends as its message: the definition's prompt. */
|
|
1961
|
+
prompt: z.string().optional(),
|
|
1819
1962
|
})
|
|
1820
1963
|
.strict();
|
|
1821
1964
|
export const TriggerListSchema = z.object({ triggers: z.array(TriggerViewSchema) }).strict();
|
|
1965
|
+
/** `in` of the `triggers` tool (D83): a delay in minutes, hours or days, such as `30m`, `2h`, `1d`. */
|
|
1966
|
+
export const TRIGGER_DELAY_PATTERN = /^[1-9][0-9]*(m|h|d)$/;
|
|
1967
|
+
/** The longest title an agent gives a trigger it makes. */
|
|
1968
|
+
export const TRIGGER_TITLE_MAX = 80;
|
|
1969
|
+
/** Where an agent-made trigger runs: the calling session (`this`), or a session of its own (`own`). */
|
|
1970
|
+
export const TRIGGER_TOOL_SESSIONS = ["this", "own"];
|
|
1971
|
+
const triggerCreateSchema = z
|
|
1972
|
+
.strictObject({
|
|
1973
|
+
command: z.literal("create"),
|
|
1974
|
+
id: TriggerIdSchema,
|
|
1975
|
+
title: z.string().min(1).max(TRIGGER_TITLE_MAX).optional(),
|
|
1976
|
+
schedule: TriggerSchema.shape.schedule,
|
|
1977
|
+
timezone: z.string().min(1).optional(),
|
|
1978
|
+
at: TriggerSchema.shape.at,
|
|
1979
|
+
in: z.string().regex(TRIGGER_DELAY_PATTERN, { message: "in is a delay such as 30m, 2h or 1d" }).optional(),
|
|
1980
|
+
session: z.enum(TRIGGER_TOOL_SESSIONS),
|
|
1981
|
+
prompt: z.string().min(1),
|
|
1982
|
+
})
|
|
1983
|
+
.superRefine((input, ctx) => {
|
|
1984
|
+
if ([input.schedule, input.at, input.in].filter((value) => value !== undefined).length !== 1)
|
|
1985
|
+
ctx.addIssue({ code: "custom", message: "Give exactly one of schedule, at or in" });
|
|
1986
|
+
if (input.timezone !== undefined && input.schedule === undefined)
|
|
1987
|
+
ctx.addIssue({ code: "custom", path: ["timezone"], message: "timezone goes with schedule" });
|
|
1988
|
+
});
|
|
1989
|
+
/**
|
|
1990
|
+
* A call of the `triggers` tool (D83), which the Runtime serves for an agent whose version
|
|
1991
|
+
* declares `engine.triggers`: `list` the triggers the calling session made; `create` one (or
|
|
1992
|
+
* replace the session's own with the same `id`) with exactly one of `schedule` (with `timezone`),
|
|
1993
|
+
* `at` or `in`, the `session` it runs in and its `prompt`; `delete` one by `id`.
|
|
1994
|
+
*/
|
|
1995
|
+
export const TriggerToolInputSchema = z.discriminatedUnion("command", [
|
|
1996
|
+
z.strictObject({ command: z.literal("list") }),
|
|
1997
|
+
triggerCreateSchema,
|
|
1998
|
+
z.strictObject({ command: z.literal("delete"), id: TriggerIdSchema }),
|
|
1999
|
+
]);
|
|
2000
|
+
/** One trigger as the `triggers` tool lists it. */
|
|
2001
|
+
export const TriggerToolItemSchema = z
|
|
2002
|
+
.strictObject({
|
|
2003
|
+
id: z.string(),
|
|
2004
|
+
title: z.string().nullable(),
|
|
2005
|
+
status: z.enum(TRIGGER_STATUSES),
|
|
2006
|
+
schedule: z.string().optional(),
|
|
2007
|
+
timezone: z.string().optional(),
|
|
2008
|
+
at: z.string().optional(),
|
|
2009
|
+
/** The session it runs in: the calling session's id, or its own (`<session>_t_<id>`). */
|
|
2010
|
+
session: z.string(),
|
|
2011
|
+
nextRunAt: z.string().nullable(),
|
|
2012
|
+
prompt: z.string(),
|
|
2013
|
+
});
|
|
2014
|
+
/** What a `triggers` call answers: the trigger made, the list, or the one deleted. */
|
|
2015
|
+
export const TriggerToolOutputSchema = z.union([
|
|
2016
|
+
z.strictObject({ id: z.string(), status: z.enum(TRIGGER_STATUSES), nextRunAt: z.string().nullable(), session: z.string() }),
|
|
2017
|
+
z.strictObject({ triggers: z.array(TriggerToolItemSchema) }),
|
|
2018
|
+
z.strictObject({ id: z.string(), deleted: z.literal(true) }),
|
|
2019
|
+
]);
|
|
1822
2020
|
/**
|
|
1823
2021
|
* What a run came to: `started` a turn, `queued` a message behind a running turn,
|
|
1824
2022
|
* `skipped` (nothing started: `overlap`, `rate_limited`, `paused`) or `failed` (`queue_full`,
|
|
@@ -1843,6 +2041,33 @@ export const TriggerRunSchema = z
|
|
|
1843
2041
|
queuedMessageId: z.string().nullable(),
|
|
1844
2042
|
})
|
|
1845
2043
|
.strict();
|
|
2044
|
+
/**
|
|
2045
|
+
* One run on the Tenant's runs stream (D83, `GET /v1/runs/stream`): a run of any Agent's
|
|
2046
|
+
* triggers, as `TriggerRunSchema` has it, with its Agent and its trigger's origin and title. A
|
|
2047
|
+
* run may arrive twice (after a crash between append and mark); a reader drops a `runId` it has
|
|
2048
|
+
* seen.
|
|
2049
|
+
*/
|
|
2050
|
+
export const TenantRunSchema = z
|
|
2051
|
+
.object({
|
|
2052
|
+
runId: z.string(),
|
|
2053
|
+
agentId: z.string(),
|
|
2054
|
+
triggerId: z.string(),
|
|
2055
|
+
kind: z.enum(TRIGGER_KINDS),
|
|
2056
|
+
status: z.enum(TRIGGER_RUN_STATUSES),
|
|
2057
|
+
reason: z.string().nullable(),
|
|
2058
|
+
sessionId: z.string().nullable(),
|
|
2059
|
+
turnId: z.string().nullable(),
|
|
2060
|
+
queuedMessageId: z.string().nullable(),
|
|
2061
|
+
dueAt: z.string(),
|
|
2062
|
+
firedAt: z.string(),
|
|
2063
|
+
late: z.boolean(),
|
|
2064
|
+
origin: z.enum(TRIGGER_ORIGINS),
|
|
2065
|
+
/** The title an agent gave the trigger; null for a manifest's or a wake. */
|
|
2066
|
+
title: z.string().nullable(),
|
|
2067
|
+
})
|
|
2068
|
+
.strict();
|
|
2069
|
+
/** One event of `GET /v1/runs/stream` (`event: run`): the run, and the cursor to resume after it. */
|
|
2070
|
+
export const TenantRunEventSchema = z.object({ cursor: z.string(), run: TenantRunSchema }).strict();
|
|
1846
2071
|
/** `GET /v1/agents/{id}/runs`: runs, newest first. */
|
|
1847
2072
|
export const TriggerRunPageSchema = z
|
|
1848
2073
|
.object({ runs: z.array(TriggerRunSchema), nextCursor: z.string().nullable() })
|
|
@@ -1999,6 +2224,7 @@ export const HarnessManifestFileSchema = z
|
|
|
1999
2224
|
loop: harnessLoopField,
|
|
2000
2225
|
memory: harnessMemoryField,
|
|
2001
2226
|
model: harnessModelField,
|
|
2227
|
+
engine: harnessEngineField,
|
|
2002
2228
|
/** MCP server or HTTP tool name → the `runtime.secrets` slot it authenticates with. */
|
|
2003
2229
|
credentials: z.record(z.string().min(1), z.string().min(1)).optional(),
|
|
2004
2230
|
/** What this harness needs of any runtime it is combined with; checked by the composer only. */
|
|
@@ -2476,8 +2702,15 @@ export const AgentSecretViewSchema = z
|
|
|
2476
2702
|
.strict(),
|
|
2477
2703
|
/** A `headers` credential's header names (lower case), never their values. */
|
|
2478
2704
|
headerNames: z.array(z.string()).optional(),
|
|
2705
|
+
/**
|
|
2706
|
+
* Where its requests go: the secret's own `via`, else its slot's (Host feature
|
|
2707
|
+
* `secret-routing`). Absent: to its `url`.
|
|
2708
|
+
*/
|
|
2479
2709
|
via: z.string().optional(),
|
|
2480
|
-
/**
|
|
2710
|
+
/**
|
|
2711
|
+
* How the gateway at `via` prefixes tool names (Host feature `gateway-credentials`): its
|
|
2712
|
+
* slot's, else the secret's; only with a `via`.
|
|
2713
|
+
*/
|
|
2481
2714
|
toolPrefix: z.string().optional(),
|
|
2482
2715
|
identity: CredentialIdentitySchema.optional(),
|
|
2483
2716
|
createdAt: z.string(),
|
|
@@ -2643,11 +2876,27 @@ const commandBase = {
|
|
|
2643
2876
|
* default is `queue`, a protocol 16 client's `reject`.
|
|
2644
2877
|
*/
|
|
2645
2878
|
export const MessageDeliverySchema = z.enum(["queue", "reject"]);
|
|
2879
|
+
/**
|
|
2880
|
+
* A message's `removeTools` (Host feature `remove-tools`): the tools its turn may not use, by
|
|
2881
|
+
* name. In the root agent and each agent it uses as a tool, a name removes the declared tool of
|
|
2882
|
+
* that name (an agent used as a tool included), `<server>__<tool>` disables an MCP server's tool
|
|
2883
|
+
* (the server's name and the tool's own name on it), and `<server>` every tool of that server.
|
|
2884
|
+
* Applied to the version the turn runs, after a turn's first segment re-pins the session to its
|
|
2885
|
+
* Agent's version; names that version does not have are ignored. Any caller may send it: it
|
|
2886
|
+
* only narrows.
|
|
2887
|
+
*/
|
|
2888
|
+
export const RemoveToolsSchema = z.array(z.string().min(1).max(256)).max(256);
|
|
2646
2889
|
const messageBase = {
|
|
2647
2890
|
...commandBase,
|
|
2648
2891
|
type: z.literal("message"),
|
|
2649
|
-
/**
|
|
2892
|
+
/**
|
|
2893
|
+
* Optional turn manifest (Loop patch): a variant of the version the turn runs. Validated
|
|
2894
|
+
* against the session's pin when the message is accepted, and again against the Agent's
|
|
2895
|
+
* version when the turn's first segment re-pins the session to it; one that is no variant of
|
|
2896
|
+
* that version keeps the turn on the version it pinned (`turn.version_kept`).
|
|
2897
|
+
*/
|
|
2650
2898
|
manifest: AgentManifestSchema.optional(),
|
|
2899
|
+
removeTools: RemoveToolsSchema.optional(),
|
|
2651
2900
|
delivery: MessageDeliverySchema.optional(),
|
|
2652
2901
|
};
|
|
2653
2902
|
/**
|
|
@@ -3189,6 +3438,8 @@ export const CommandMessagePayloadSchema = z
|
|
|
3189
3438
|
parts: z.array(MessagePartSchema).optional(),
|
|
3190
3439
|
/** The turn manifest the message carried, if any. */
|
|
3191
3440
|
manifest: z.unknown().optional(),
|
|
3441
|
+
/** The tools the message's turn may not use (Host feature `remove-tools`). */
|
|
3442
|
+
removeTools: z.array(z.string()).optional(),
|
|
3192
3443
|
delivery: MessageDeliverySchema.optional(),
|
|
3193
3444
|
/** Set when the message waited in the session's queue (protocol 17): its id there. */
|
|
3194
3445
|
queuedMessageId: z.string().optional(),
|
|
@@ -3410,6 +3661,70 @@ export const ArtifactExportSkippedPayloadSchema = z
|
|
|
3410
3661
|
export const ArtifactExportFailedPayloadSchema = z
|
|
3411
3662
|
.object({ name: z.string(), message: z.string() })
|
|
3412
3663
|
.passthrough();
|
|
3664
|
+
/**
|
|
3665
|
+
* `engine.diagnostic`: our engine met something about the session's agent that the agent's
|
|
3666
|
+
* declarations decide, and says so instead of choosing for it (ADR-100), such as `mcp_tools_inline`:
|
|
3667
|
+
* an agent that does not declare `engine.toolSearch` has MCP tool schemas past the share of the
|
|
3668
|
+
* model's context window at which they would be deferred, and keeps them all in its tool list.
|
|
3669
|
+
*/
|
|
3670
|
+
export const EngineDiagnosticPayloadSchema = z
|
|
3671
|
+
.object({
|
|
3672
|
+
code: z.string().min(1),
|
|
3673
|
+
message: z.string(),
|
|
3674
|
+
/** The agent used as a tool it is about; absent for the session's root agent. */
|
|
3675
|
+
agentId: z.string().optional(),
|
|
3676
|
+
})
|
|
3677
|
+
.passthrough();
|
|
3678
|
+
/** Where the model a session's turns call comes from (`SessionModelRecord.source`). */
|
|
3679
|
+
export const SESSION_MODEL_SOURCES = ["manifest", "session", "tenant"];
|
|
3680
|
+
/**
|
|
3681
|
+
* Why a session's turns call the Tenant's model and not the one its manifest (`harness.model`) or
|
|
3682
|
+
* its own choice (`PUT /v1/sessions/{id}/model`) names: that model's provider is not connected,
|
|
3683
|
+
* its provider's catalog does not list it, or it is no `<provider>/<model>` the Tenant takes.
|
|
3684
|
+
*/
|
|
3685
|
+
export const SESSION_MODEL_FALLBACK_REASONS = ["provider_not_connected", "not_in_catalog", "invalid_model"];
|
|
3686
|
+
/**
|
|
3687
|
+
* The model a session's turns call, and why (`model` on `GET /v1/sessions/{id}`, and the
|
|
3688
|
+
* `session.model` event): `source` `manifest` for the model its Agent's version names
|
|
3689
|
+
* (`harness.model`, Host feature `agent-model`), `session` for its own choice, `tenant` for the
|
|
3690
|
+
* Tenant's model. On a fallback to the Tenant's, `reason` says why the model `requested` (by the
|
|
3691
|
+
* manifest or the session) is not used.
|
|
3692
|
+
*/
|
|
3693
|
+
export const SessionModelRecordSchema = z
|
|
3694
|
+
.object({
|
|
3695
|
+
provider: z.string(),
|
|
3696
|
+
model: z.string(),
|
|
3697
|
+
source: z.enum(SESSION_MODEL_SOURCES),
|
|
3698
|
+
reason: z.enum(SESSION_MODEL_FALLBACK_REASONS).optional(),
|
|
3699
|
+
requested: z
|
|
3700
|
+
.object({ provider: z.string(), model: z.string(), by: z.enum(["manifest", "session"]) })
|
|
3701
|
+
.strict()
|
|
3702
|
+
.optional(),
|
|
3703
|
+
})
|
|
3704
|
+
.strict();
|
|
3705
|
+
/**
|
|
3706
|
+
* `session.model`: the model the session's turns call was set (the session opened, its own model
|
|
3707
|
+
* was chosen or cleared) or changed (at a turn's start: a provider was connected or disconnected,
|
|
3708
|
+
* the Tenant's model changed), fallbacks included. `previous` is what it was, absent at the first.
|
|
3709
|
+
*/
|
|
3710
|
+
export const SessionModelPayloadSchema = SessionModelRecordSchema.extend({
|
|
3711
|
+
previous: SessionModelRecordSchema.optional(),
|
|
3712
|
+
}).passthrough();
|
|
3713
|
+
/**
|
|
3714
|
+
* `turn.version_kept`: a turn's first segment did not move the session to the version its Agent
|
|
3715
|
+
* runs now (`from` is the version the session keeps, `to` the Agent's). `variant_invalid`: the
|
|
3716
|
+
* turn manifest its message carried is no variant of that version, and the turn runs it on the
|
|
3717
|
+
* version it was accepted for, so the variant never widens what the turn may do. Send the message
|
|
3718
|
+
* again with a variant of the new version, or name the tools with `removeTools`.
|
|
3719
|
+
*/
|
|
3720
|
+
export const TurnVersionKeptPayloadSchema = z
|
|
3721
|
+
.object({
|
|
3722
|
+
reason: z.enum(["variant_invalid"]),
|
|
3723
|
+
from: z.object({ name: z.string(), version: z.number().int() }).strict(),
|
|
3724
|
+
to: z.object({ name: z.string(), version: z.number().int() }).strict(),
|
|
3725
|
+
message: z.string(),
|
|
3726
|
+
})
|
|
3727
|
+
.passthrough();
|
|
3413
3728
|
/** What readying one declared MCP server found (`mcp.discovered`). */
|
|
3414
3729
|
export const McpServerOutcomeSchema = z
|
|
3415
3730
|
.object({
|
|
@@ -3436,11 +3751,17 @@ export const McpServerOutcomeSchema = z
|
|
|
3436
3751
|
.passthrough();
|
|
3437
3752
|
/**
|
|
3438
3753
|
* `mcp.discovered`: the session's first turn readied its MCP servers and pinned the tools they
|
|
3439
|
-
* offer, one outcome per declared server. A server that did not connect adds no tools
|
|
3440
|
-
*
|
|
3754
|
+
* offer, one outcome per declared server. A server that did not connect adds no tools until a
|
|
3755
|
+
* later turn's first segment, which tries it again: once it answers, it joins the session's
|
|
3756
|
+
* snapshot and a second `mcp.discovered` names it (`rejoined`, with only the servers that joined).
|
|
3757
|
+
* This is where the model's missing tools show (also `mcpDiagnostics`).
|
|
3441
3758
|
*/
|
|
3442
3759
|
export const McpDiscoveredPayloadSchema = z
|
|
3443
|
-
.object({
|
|
3760
|
+
.object({
|
|
3761
|
+
servers: z.array(McpServerOutcomeSchema),
|
|
3762
|
+
/** Set when the servers joined the snapshot at a later turn, having failed at the first. */
|
|
3763
|
+
rejoined: z.literal(true).optional(),
|
|
3764
|
+
})
|
|
3444
3765
|
.passthrough();
|
|
3445
3766
|
/**
|
|
3446
3767
|
* The event catalog (Durable Streams §9.5): every session event type, its payload schema, its
|
|
@@ -3460,6 +3781,8 @@ export const EVENT_CATALOG = {
|
|
|
3460
3781
|
"turn.paused": { payload: TurnPausedPayloadSchema, source: "loop", version: 1 },
|
|
3461
3782
|
"turn.failed": { payload: TurnFailedPayloadSchema, source: "loop", version: 1 },
|
|
3462
3783
|
"turn.cancelled": { payload: TurnCancelledPayloadSchema, source: "api", version: 1 },
|
|
3784
|
+
"turn.version_kept": { payload: TurnVersionKeptPayloadSchema, source: "api", version: 1 },
|
|
3785
|
+
"session.model": { payload: SessionModelPayloadSchema, source: "api", version: 1 },
|
|
3463
3786
|
"message.queued": { payload: MessageQueuedPayloadSchema, source: "api", version: 1 },
|
|
3464
3787
|
"queue.taken": { payload: QueueTakenPayloadSchema, source: "api", version: 1 },
|
|
3465
3788
|
"wake.booked": { payload: WakeBookedPayloadSchema, source: "api", version: 1 },
|
|
@@ -3474,6 +3797,7 @@ export const EVENT_CATALOG = {
|
|
|
3474
3797
|
"delegation.completed": { payload: DelegationPayloadSchema, source: "loop", version: 1 },
|
|
3475
3798
|
"mcp.discovered": { payload: McpDiscoveredPayloadSchema, source: "loop", version: 1 },
|
|
3476
3799
|
"plan.updated": { payload: PlanUpdatedPayloadSchema, source: "loop", version: 1 },
|
|
3800
|
+
"engine.diagnostic": { payload: EngineDiagnosticPayloadSchema, source: "loop", version: 1 },
|
|
3477
3801
|
"environment.state": { payload: EnvironmentStatePayloadSchema, source: "loop", version: 1 },
|
|
3478
3802
|
"environment.exec": { payload: EnvironmentExecPayloadSchema, source: "loop", version: 1 },
|
|
3479
3803
|
"agent.attached": { payload: AgentAttachedPayloadSchema, source: "api", version: 1 },
|
|
@@ -4111,6 +4435,12 @@ export const SessionViewSchema = z
|
|
|
4111
4435
|
closedReason: z.string().optional(),
|
|
4112
4436
|
mcpSnapshot: z.record(z.string(), z.unknown()).nullable(),
|
|
4113
4437
|
mcpDiagnostics: z.array(z.record(z.string(), z.unknown())),
|
|
4438
|
+
/**
|
|
4439
|
+
* The model the session's turns call and why (`SessionModelRecord`): as its last turn
|
|
4440
|
+
* started, or as the session opened or chose it since. Null for a flow and while the Tenant
|
|
4441
|
+
* has no model.
|
|
4442
|
+
*/
|
|
4443
|
+
model: SessionModelRecordSchema.nullable(),
|
|
4114
4444
|
/** What the session waits on: interactions, approvals, timers. */
|
|
4115
4445
|
waits: z.unknown().optional(),
|
|
4116
4446
|
error: z.string().optional(),
|
|
@@ -4360,12 +4690,15 @@ export const ToolInputConditionSchema = z
|
|
|
4360
4690
|
});
|
|
4361
4691
|
/**
|
|
4362
4692
|
* One rule of the Tenant's tool policy, applied at the Tool Gate to every MCP and HTTP tool call
|
|
4363
|
-
* of every harness
|
|
4364
|
-
*
|
|
4365
|
-
*
|
|
4366
|
-
* `
|
|
4367
|
-
*
|
|
4368
|
-
*
|
|
4693
|
+
* of every harness, and to the operations the Runtime serves itself (`kind: "runtime"`, D83). A
|
|
4694
|
+
* rule matches a call when every selector it sets matches: `tool` (the tool's identity: an MCP
|
|
4695
|
+
* tool's own name on its server, an HTTP tool's declared name, or a runtime operation:
|
|
4696
|
+
* `triggers`, `memory`, `schedule_wake`; never the name a harness gave the model; `*` for any run
|
|
4697
|
+
* of characters), `server` (an MCP server's name), `kind` (a runtime operation matches only a rule
|
|
4698
|
+
* that names `kind: "runtime"`), `agent` (the agent that calls it: the agent manifest's name, or the id of an agent used
|
|
4699
|
+
* as a tool or of a flow's agent; never an Agent's id; the session's root agent's name matches its
|
|
4700
|
+
* subagents' calls too, those of the agents it uses as tools) and `when` (fields of the input, by
|
|
4701
|
+
* dotted path). The strictest matching rule decides: `deny` refuses the call before it is sent,
|
|
4369
4702
|
* `ask` holds it until a person approves it on the session (`approve`), `allow` runs it. A call no
|
|
4370
4703
|
* rule matches runs. Sandbox tools never cross the gate; their network side is egress policy.
|
|
4371
4704
|
*
|
|
@@ -4385,13 +4718,16 @@ export const ToolRuleSchema = z
|
|
|
4385
4718
|
description: "The tool's identity: an MCP tool's own name on its `server`, or an HTTP tool's declared name, never the name the model calls it by. `*` matches any run of characters; a name with `__` in it is refused",
|
|
4386
4719
|
}),
|
|
4387
4720
|
server: z.string().min(1).optional().meta({ description: "An MCP server's name; `*` matches any run of characters" }),
|
|
4388
|
-
kind: z
|
|
4721
|
+
kind: z
|
|
4722
|
+
.enum(["mcp", "http", "runtime"])
|
|
4723
|
+
.optional()
|
|
4724
|
+
.meta({ description: "mcp, http, or runtime: an operation the Runtime serves itself (triggers, memory, schedule_wake), which only a rule naming it matches" }),
|
|
4389
4725
|
agent: z
|
|
4390
4726
|
.string()
|
|
4391
4727
|
.min(1)
|
|
4392
4728
|
.optional()
|
|
4393
4729
|
.meta({
|
|
4394
|
-
description: "The agent that calls the tool: the agent manifest's name, or the id of an agent used as a tool or of a flow's agent, never an Agent's id. `*` matches any run of characters",
|
|
4730
|
+
description: "The agent that calls the tool: the agent manifest's name, or the id of an agent used as a tool or of a flow's agent, never an Agent's id. The session's root agent's name also matches the calls of the agents it uses as tools. `*` matches any run of characters",
|
|
4395
4731
|
}),
|
|
4396
4732
|
when: z
|
|
4397
4733
|
.record(z.string().min(1), ToolInputConditionSchema)
|
|
@@ -4402,6 +4738,8 @@ export const ToolRuleSchema = z
|
|
|
4402
4738
|
})
|
|
4403
4739
|
.strict()
|
|
4404
4740
|
.superRefine((rule, ctx) => {
|
|
4741
|
+
if (rule.kind === "runtime" && rule.server !== undefined)
|
|
4742
|
+
ctx.addIssue({ code: "custom", path: ["server"], message: "A runtime operation has no server: leave server out of a rule of kind runtime" });
|
|
4405
4743
|
if (rule.tool !== undefined && rule.tool.includes("__"))
|
|
4406
4744
|
ctx.addIssue({
|
|
4407
4745
|
code: "custom",
|
package/dist/define.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export { implementationsFor, bindingFromAgent } from "./definition/binding.js";
|
|
|
37
37
|
export type { AgentBinding } from "./definition/binding.js";
|
|
38
38
|
export { VerdictSchema, isVerdict, WorkflowBuildError, isBuiltWorkflow, } from "./definition/workflow/index.js";
|
|
39
39
|
export type { BuiltWorkflow } from "./definition/workflow/index.js";
|
|
40
|
-
export { isVariantOf } from "./definition/variant.js";
|
|
40
|
+
export { isVariantOf, withoutTools } from "./definition/variant.js";
|
|
41
41
|
export type { Verdict, WorkflowBinding, WorkflowHttpVerify, WorkflowLoopVerify, WorkflowManifest, WorkflowNode, } from "./types/workflow.js";
|
|
42
42
|
export type { DefinitionPart, BoundToolDefinition, } from "./definition/bound.js";
|
|
43
43
|
export { bindTool } from "./definition/bind-tool.js";
|
package/dist/define.js
CHANGED
|
@@ -19,7 +19,7 @@ export { SKILL_ENTRY, SKILL_TOTAL_BYTES_DEFAULT, SKILL_FILE_PATH_MAX, SKILLS_MOU
|
|
|
19
19
|
export { normalizeToolDefinition, normalizedSchemasFor, } from "./definition/schema.js";
|
|
20
20
|
export { implementationsFor, bindingFromAgent } from "./definition/binding.js";
|
|
21
21
|
export { VerdictSchema, isVerdict, WorkflowBuildError, isBuiltWorkflow, } from "./definition/workflow/index.js";
|
|
22
|
-
export { isVariantOf } from "./definition/variant.js";
|
|
22
|
+
export { isVariantOf, withoutTools } from "./definition/variant.js";
|
|
23
23
|
export { bindTool } from "./definition/bind-tool.js";
|
|
24
24
|
export { bindOutputContract } from "./definition/output-contract.js";
|
|
25
25
|
export { agentFrom } from "./definition/from.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DefinitionPart } from "./bound.js";
|
|
2
2
|
import type { BuiltAgent } from "../types/agent.js";
|
|
3
|
-
import type { AgentManifest, AgentRequirements } from "../types/manifest.js";
|
|
3
|
+
import type { AgentManifest, AgentRequirements, HarnessEngine } from "../types/manifest.js";
|
|
4
4
|
import type { BuildDiagnostic, JsonObject } from "../types/shared.js";
|
|
5
5
|
import type { ToolSchemaSource } from "../types/tool.js";
|
|
6
6
|
type BuildResult<Agent> = {
|
|
@@ -18,5 +18,6 @@ export declare function assembleAgent(parts: readonly DefinitionPart[], identity
|
|
|
18
18
|
metadata?: JsonObject;
|
|
19
19
|
outputSchema?: ToolSchemaSource;
|
|
20
20
|
requires?: AgentRequirements;
|
|
21
|
+
engine?: HarnessEngine;
|
|
21
22
|
}>): BuildResult<BuiltAgent>;
|
|
22
23
|
export {};
|
|
@@ -52,6 +52,7 @@ export function assembleAgent(parts, identity) {
|
|
|
52
52
|
metadata: identity.metadata,
|
|
53
53
|
outputSchema: identity.outputSchema,
|
|
54
54
|
requires: identity.requires,
|
|
55
|
+
engine: identity.engine,
|
|
55
56
|
parts: frozenParts,
|
|
56
57
|
});
|
|
57
58
|
const agent = bindAgent(frozenParts, manifest, identity);
|
package/dist/definition/from.js
CHANGED
|
@@ -56,6 +56,7 @@ export function agentFrom(json, implementations, options) {
|
|
|
56
56
|
metadata: manifest.metadata,
|
|
57
57
|
outputSchema,
|
|
58
58
|
...(manifest.requires === undefined ? {} : { requires: manifest.requires }),
|
|
59
|
+
...(manifest.engine === undefined ? {} : { engine: manifest.engine }),
|
|
59
60
|
});
|
|
60
61
|
if (!result.ok)
|
|
61
62
|
throw new HarnessError("agent.build-failed", result.diagnostics.map((item) => item.message).join("; "));
|