@nylorun/harness 0.30.0-beta → 0.31.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.
@@ -17,125 +17,31 @@
17
17
  * read and write, and holds the limits. Expected problems (no such artifact, too large, not a
18
18
  * file) are failed outcomes the model sees; only the run's own failures throw.
19
19
  */
20
- import { READ_ARTIFACT_TOOL, SANDBOX_WORKSPACE, SAVE_ARTIFACT_TOOL, } from "@nylorun/core/define";
21
- import { ARTIFACT_NAME_MAX, DEFAULT_CONTENT_TYPE, contentTypeFor, essence, isText, normalizeContentType, } from "@nylorun/core/contracts";
20
+ import { READ_ARTIFACT_TOOL, SAVE_ARTIFACT_TOOL } from "@nylorun/core/define";
21
+ import { ARTIFACTS_READ_TEXT, ARTIFACTS_SAVE_TEXT, OUTPUTS_AFTER_SAVE_TEXT, artifactTools, } from "@nylorun/core/engine";
22
+ import { DEFAULT_CONTENT_TYPE, contentTypeFor, essence, isText, normalizeContentType, } from "@nylorun/core/contracts";
22
23
  import { HarnessApiError, fromBase64, openArtifactWrite, readArtifact, writeArtifactBytes, } from "@nylorun/core/harness-api";
23
24
  import { textPage } from "./text-page.js";
24
25
  import { fileView } from "../loop/model/files.js";
25
- const ARTIFACTS_INSTRUCTIONS = "Use save_artifact to hand the user a file you made: a path in the sandbox, or text you pass as content. " +
26
- "The user sees it as an artifact of this session and can download it; reply with its name, not its bytes. " +
27
- "Files you write under /workspace/outputs reach the user too: when your turn ends, they become the session's outputs folder.";
28
- const READ_ARTIFACT_INSTRUCTIONS = "A tool result too large to show is saved as an artifact of this session: the result says truncated: true, with its artifactId, its size in bytes and a preview of its start and end. " +
29
- "Images and other files a tool returns are saved as artifacts too. Use read_artifact to read more of one, a page at a time, only when the preview is not enough. " +
30
- 'Files from earlier turns appear as lines like [Uploaded artifact "name" · <artifactId> v<version> · read_artifact to view]: call read_artifact with that artifactId and version only when you need the file again.';
31
- const SAVE_DESCRIPTION = `Save a file as an artifact of this session, for the user to download. Give path (a file in the sandbox; relative paths resolve under ${SANDBOX_WORKSPACE}) or content (text), not both. ` +
32
- "Returns the artifact's id and version. Pass artifactId to save a new version of an artifact you saved before.";
33
- const SAVE_SCHEMA = {
34
- $schema: "http://json-schema.org/draft-07/schema#",
35
- type: "object",
36
- properties: {
37
- path: { description: "A file in the sandbox.", type: "string", minLength: 1 },
38
- content: { description: "Text to save instead of a file.", type: "string" },
39
- name: {
40
- description: "The artifact's name. Default: the file's name.",
41
- type: "string",
42
- minLength: 1,
43
- maxLength: ARTIFACT_NAME_MAX,
44
- },
45
- contentType: {
46
- description: "The media type, e.g. image/png. Default: from the name's extension.",
47
- type: "string",
48
- minLength: 1,
49
- },
50
- artifactId: {
51
- description: "Save a new version of this artifact.",
52
- type: "string",
53
- minLength: 1,
54
- },
55
- },
56
- additionalProperties: false,
57
- };
58
- function readDescription(pageBytes, sandboxed) {
59
- return (`Read an artifact of this session, such as a tool result marked truncated or a file from an earlier turn. A text file returns up to ${pageBytes} bytes from offset, ` +
60
- "with nextOffset while more remains: pass it as offset to read on. An image or another file you can read is shown to you." +
61
- (sandboxed
62
- ? ` Pass path to copy the whole artifact into the sandbox instead (relative paths resolve under ${SANDBOX_WORKSPACE}), for a command to use.`
63
- : ""));
64
- }
65
- function readSchema(pageBytes, sandboxed) {
66
- return {
67
- $schema: "http://json-schema.org/draft-07/schema#",
68
- type: "object",
69
- properties: {
70
- artifactId: {
71
- type: "string",
72
- minLength: 1,
73
- description: "The artifact to read, e.g. a truncated result's artifactId.",
74
- },
75
- version: {
76
- description: "The version to read. Default: the latest.",
77
- type: "integer",
78
- minimum: 1,
79
- maximum: Number.MAX_SAFE_INTEGER,
80
- },
81
- offset: {
82
- description: "The byte to start at. Default 0.",
83
- type: "integer",
84
- minimum: 0,
85
- maximum: Number.MAX_SAFE_INTEGER,
86
- },
87
- length: {
88
- description: `How many bytes to read. Default and most: ${pageBytes}.`,
89
- type: "integer",
90
- minimum: 1,
91
- maximum: pageBytes,
92
- },
93
- ...(sandboxed
94
- ? {
95
- path: {
96
- description: "Copy the artifact to this file in the sandbox instead of reading it.",
97
- type: "string",
98
- minLength: 1,
99
- },
100
- }
101
- : {}),
102
- },
103
- required: ["artifactId"],
104
- additionalProperties: false,
105
- };
106
- }
107
26
  /** True when `name` is one of our engine's artifact tools. */
108
27
  export function isArtifactTool(name) {
109
28
  return name === READ_ARTIFACT_TOOL || name === SAVE_ARTIFACT_TOOL;
110
29
  }
111
- const HARNESS = Object.freeze({ kind: "harness" });
112
30
  /**
113
- * The artifact tools our engine offers an agent: `save_artifact` when the session has a sandbox,
114
- * and `read_artifact`, which takes `path` only then. Each runs here (`harness`).
31
+ * The artifact tools our engine offers an agent that declares nothing (`agent-folder/1`):
32
+ * `save_artifact` when the session has a sandbox, and `read_artifact`, which takes `path` only
33
+ * then. Each runs here (`harness`). One that declares its engine features gets those it names
34
+ * (`engineProjection`).
115
35
  */
116
36
  export function artifactToolsFor(sandboxed, options) {
117
- return [
118
- ...(sandboxed
119
- ? [
120
- {
121
- name: SAVE_ARTIFACT_TOOL,
122
- description: SAVE_DESCRIPTION,
123
- inputSchema: SAVE_SCHEMA,
124
- target: HARNESS,
125
- },
126
- ]
127
- : []),
128
- {
129
- name: READ_ARTIFACT_TOOL,
130
- description: readDescription(options.pageBytes, sandboxed),
131
- inputSchema: readSchema(options.pageBytes, sandboxed),
132
- target: HARNESS,
133
- },
134
- ];
37
+ return artifactTools({ read: true, save: sandboxed, sandboxed }, options);
135
38
  }
136
- /** What the model reads with the artifact tools, in their order. */
39
+ /** What the model reads with the artifact tools, in their order, for an agent that declares nothing. */
137
40
  export function artifactInstructions(sandboxed) {
138
- return [...(sandboxed ? [ARTIFACTS_INSTRUCTIONS] : []), READ_ARTIFACT_INSTRUCTIONS];
41
+ return [
42
+ ...(sandboxed ? [`${ARTIFACTS_SAVE_TEXT} ${OUTPUTS_AFTER_SAVE_TEXT}`] : []),
43
+ ARTIFACTS_READ_TEXT,
44
+ ];
139
45
  }
140
46
  const failed = (code, message) => ({
141
47
  kind: "failed",
@@ -1,12 +1,6 @@
1
1
  import type { DurableSessionTool, HostEffect } from "../run/durable.js";
2
- /** The tool's name. */
3
- export declare const REQUEST_CONNECTION_TOOL = "request_connection";
4
- /** The most characters of the app's name and of the reason. */
5
- export declare const CONNECTION_LIMITS: Readonly<{
6
- appChars: 80;
7
- reasonChars: 280;
8
- }>;
9
- /** The tool, and the text the model reads with it. */
2
+ export { CONNECTION_LIMITS, REQUEST_CONNECTION_TOOL } from "@nylorun/core/engine";
3
+ /** The tool, and the text the model reads with it (block `connection`, `@nylorun/core/engine`). */
10
4
  export declare function connectionTool(): {
11
5
  tool: DurableSessionTool;
12
6
  instructions: string;
@@ -1,44 +1,25 @@
1
+ /**
2
+ * `request_connection` (A2A profile v2, `interactions/v1` kind `connection`): the agent asks
3
+ * whoever started the task to connect an app it needs (an account, a workspace), and waits.
4
+ * Offered to the session's root agent when the version the session runs sets
5
+ * `harness.loop.connections: true` (`turn.start.loop.connections`; in an agent folder,
6
+ * `loop: { connections: true }` in `AGENT.md`), unless the agent has its own tool of that name.
7
+ *
8
+ * It runs here (`harness`). A first call pauses the turn with an interaction of kind `response`
9
+ * whose `metadata` is `{ kind: "connection", app, reason }`, which the session's waits carry and
10
+ * the A2A server shows as kind `connection`. The answer (`respond`) runs it again, in the next
11
+ * segment, with the value: `true` or `{ connected: true }` answers `Connected: <app>`, anything
12
+ * else `Not connected: <app>`. A replayed call answers its recorded outcome.
13
+ *
14
+ * Long input is cut, never refused: an app of at most `CONNECTION_LIMITS.appChars` characters
15
+ * and a reason of at most `reasonChars`, each cut ending in `…`.
16
+ */
17
+ import { CONNECTION_LIMITS, CONNECTION_TEXT, REQUEST_CONNECTION_TOOL, connectionToolOf, } from "@nylorun/core/engine";
1
18
  import { cut } from "./plan.js";
2
- /** The tool's name. */
3
- export const REQUEST_CONNECTION_TOOL = "request_connection";
4
- /** The most characters of the app's name and of the reason. */
5
- export const CONNECTION_LIMITS = Object.freeze({ appChars: 80, reasonChars: 280 });
6
- const HARNESS = Object.freeze({ kind: "harness" });
7
- const DESCRIPTION = [
8
- "Ask the person or agent who gave you this task to connect an app you need and cannot reach, such as their GitHub, Linear or Google Drive, then wait for their answer.",
9
- "Give the app's name and the reason, in a sentence they can act on.",
10
- "It answers Connected: <app> once they connected it, so try again; or Not connected: <app>, so go on without it or say what you could not do.",
11
- "Use it only when a tool says the app is not connected or its credential is missing; never to ask anything else.",
12
- ].join(" ");
13
- const INPUT_SCHEMA = {
14
- type: "object",
15
- properties: {
16
- app: {
17
- type: "string",
18
- minLength: 1,
19
- description: `The app to connect, by its name (at most ${CONNECTION_LIMITS.appChars} characters).`,
20
- },
21
- reason: {
22
- type: "string",
23
- minLength: 1,
24
- description: `Why you need it, in a sentence (at most ${CONNECTION_LIMITS.reasonChars} characters).`,
25
- },
26
- },
27
- required: ["app", "reason"],
28
- additionalProperties: false,
29
- };
30
- const INSTRUCTIONS = "When a tool fails because an app is not connected or its credential is missing, ask for it with request_connection, then try again once it is connected.";
31
- /** The tool, and the text the model reads with it. */
19
+ export { CONNECTION_LIMITS, REQUEST_CONNECTION_TOOL } from "@nylorun/core/engine";
20
+ /** The tool, and the text the model reads with it (block `connection`, `@nylorun/core/engine`). */
32
21
  export function connectionTool() {
33
- return {
34
- tool: {
35
- name: REQUEST_CONNECTION_TOOL,
36
- description: DESCRIPTION,
37
- inputSchema: INPUT_SCHEMA,
38
- target: HARNESS,
39
- },
40
- instructions: INSTRUCTIONS,
41
- };
22
+ return { tool: connectionToolOf(), instructions: CONNECTION_TEXT };
42
23
  }
43
24
  /** True when `effect` is a call of `request_connection` (ours: a `harness` call). */
44
25
  export function isConnectionTool(effect) {
@@ -1,24 +1,28 @@
1
1
  /**
2
- * What our engine adds to each agent of a session (protocol 15): the model-facing text and tools
3
- * that come with the session's Environment and the agent's skills. The Runtime states facts in
4
- * `turn.start` (the Environment, its sandbox's workspace, the agent's skills); our engine words
5
- * them and defines the tools, in one order, which keeps the prompt's prefix stable:
2
+ * What our engine adds to each agent of a session (protocol 15, ADR-100): the model-facing text
3
+ * and tools that come with the session's Environment, its memory and loop settings, and the
4
+ * agent's skills, as the agent declares them (`engine`, `agent-folder/2`) or, when it declares
5
+ * nothing, every default of `agent-folder/1`. The Runtime states facts in `turn.start` (the
6
+ * Environment, its sandbox's workspace, the memory, the agent's skills); our engine words them and
7
+ * defines the tools, in one order, which keeps the prompt's prefix stable:
6
8
  *
7
9
  * - instructions: the skills' usage and catalog; the sandbox note; the skills' folder note;
8
- * the artifact notes;
9
- * - tools: the six sandbox tools; the skill tools; `save_artifact`; `read_artifact`;
10
+ * the artifact notes; the wake note; the memory rules; the plan and connection notes;
11
+ * - tools: the sandbox tools; the skill tools; `save_artifact`; `read_artifact`;
10
12
  * `schedule_wake` when the session's version sets `runtime.selfWake` (track T4); `memory`
11
13
  * when it sets `harness.memory` (track T5); and, for the root agent, `update_plan` when it sets
12
14
  * `harness.loop.plan` and `request_connection` when it sets `harness.loop.connections` (A2A
13
15
  * profile v2).
14
16
  *
15
- * They come after the agent's own and before the session's MCP tools (`mcpToolSet`), and are
17
+ * The code is `@nylorun/core/engine`'s (`engineProjection`), which the SDK's `previewTurn` runs
18
+ * too. They come after the agent's own and before the session's MCP tools (`mcpToolSet`), and are
16
19
  * not hashed.
17
20
  */
18
21
  import type { AgentManifest } from "@nylorun/core/define";
19
- import type { TurnAgent, TurnMemory } from "@nylorun/core/harness-api";
22
+ import type { TurnAgent } from "@nylorun/core/harness-api";
23
+ import { type EngineBlockUse, type EngineFeatures, type EngineMemory } from "@nylorun/core/engine";
20
24
  import type { DurableSessionTool } from "../run/durable.js";
21
- import { type SandboxToolLimits } from "./sandbox.js";
25
+ import type { SandboxToolLimits } from "./sandbox.js";
22
26
  import type { McpToolConfig } from "./mcp.js";
23
27
  import type { ToolResultConfig } from "./results.js";
24
28
  import type { OutputsConfig } from "./outputs.js";
@@ -41,15 +45,17 @@ export interface EngineToolOptions {
41
45
  export interface EngineTools {
42
46
  readonly tools: readonly DurableSessionTool[];
43
47
  readonly instructions: readonly string[];
48
+ /** The text blocks the agent got (ADR-100), in order. */
49
+ readonly blocks?: readonly EngineBlockUse[];
50
+ /** The engine features the agent got. */
51
+ readonly features?: EngineFeatures;
44
52
  }
45
53
  /**
46
54
  * Our engine's tools and text for `agent`, in a session on Agent `runsOn` (`turn.start.agent`)
47
55
  * with its memory (`turn.start.memory`). `memory.root` is false for an agent used as a tool,
48
- * which may only view memory. `plan` offers `update_plan`: true for the session's root agent when
49
- * the version sets `harness.loop.plan` (`turn.start.loop.plan`); `connections` offers
50
- * `request_connection` alike (`harness.loop.connections`). An agent whose own tools name one of
51
- * them keeps its own.
56
+ * which may only view memory; `memory.index` false when no index is pinned. `plan` offers
57
+ * `update_plan`: true for the session's root agent when the version sets `harness.loop.plan`
58
+ * (`turn.start.loop.plan`); `connections` offers `request_connection` alike
59
+ * (`harness.loop.connections`). An agent whose own tools name one of them keeps its own.
52
60
  */
53
- export declare function engineToolsFor(agent: Pick<AgentManifest, "skills" | "tools">, runsOn: TurnAgent | undefined, options: Pick<EngineToolOptions, "artifactPageBytes" | "sandboxTools" | "skillReadBytes">, memory?: Pick<TurnMemory, "access" | "instructions"> & {
54
- readonly root: boolean;
55
- }, plan?: boolean, connections?: boolean): EngineTools;
61
+ export declare function engineToolsFor(agent: Pick<AgentManifest, "skills" | "tools" | "engine">, runsOn: TurnAgent | undefined, options: Pick<EngineToolOptions, "artifactPageBytes" | "sandboxTools" | "skillReadBytes">, memory?: EngineMemory, plan?: boolean, connections?: boolean): EngineTools;
@@ -1,58 +1,12 @@
1
- import { artifactInstructions, artifactToolsFor } from "./artifacts.js";
2
- import { sandboxInstructions, sandboxTools } from "./sandbox.js";
3
- import { skillCatalogText, skillFolderNote, skillTools } from "./skills.js";
4
- import { wakeTool } from "./wake.js";
5
- import { memoryTool } from "./memory.js";
6
- import { planTool, UPDATE_PLAN_TOOL } from "./plan.js";
7
- import { connectionTool, REQUEST_CONNECTION_TOOL } from "./connection.js";
1
+ import { engineProjection, } from "@nylorun/core/engine";
8
2
  /**
9
3
  * Our engine's tools and text for `agent`, in a session on Agent `runsOn` (`turn.start.agent`)
10
4
  * with its memory (`turn.start.memory`). `memory.root` is false for an agent used as a tool,
11
- * which may only view memory. `plan` offers `update_plan`: true for the session's root agent when
12
- * the version sets `harness.loop.plan` (`turn.start.loop.plan`); `connections` offers
13
- * `request_connection` alike (`harness.loop.connections`). An agent whose own tools name one of
14
- * them keeps its own.
5
+ * which may only view memory; `memory.index` false when no index is pinned. `plan` offers
6
+ * `update_plan`: true for the session's root agent when the version sets `harness.loop.plan`
7
+ * (`turn.start.loop.plan`); `connections` offers `request_connection` alike
8
+ * (`harness.loop.connections`). An agent whose own tools name one of them keeps its own.
15
9
  */
16
10
  export function engineToolsFor(agent, runsOn, options, memory, plan = false, connections = false) {
17
- const skills = Object.values(agent.skills ?? {});
18
- const workspace = runsOn?.sandbox?.workspace;
19
- const sandboxed = workspace !== undefined;
20
- const instructions = [];
21
- if (skills.length > 0)
22
- instructions.push(...skillCatalogText(skills));
23
- if (sandboxed) {
24
- instructions.push(sandboxInstructions(workspace));
25
- if (skills.length > 0)
26
- instructions.push(skillFolderNote(skills));
27
- }
28
- instructions.push(...artifactInstructions(sandboxed));
29
- // A session that may book its own next turn (track T4, D77).
30
- const wake = runsOn?.selfWake === true ? wakeTool() : undefined;
31
- if (wake)
32
- instructions.push(wake.instructions);
33
- // The Agent's memory (track T5, D72).
34
- const remember = memory ? memoryTool(memory, memory.root) : undefined;
35
- if (remember)
36
- instructions.push(remember.instructions);
37
- // The agent's plan (A2A profile v2, `progress/v1`).
38
- const own = (name) => (agent.tools ?? []).some((tool) => tool.name === name);
39
- const planning = plan && !own(UPDATE_PLAN_TOOL) ? planTool() : undefined;
40
- if (planning)
41
- instructions.push(planning.instructions);
42
- // The apps the agent asks to have connected (A2A profile v2, `interactions/v1` kind `connection`).
43
- const connecting = connections && !own(REQUEST_CONNECTION_TOOL) ? connectionTool() : undefined;
44
- if (connecting)
45
- instructions.push(connecting.instructions);
46
- return {
47
- tools: [
48
- ...(sandboxed ? sandboxTools(options.sandboxTools, workspace) : []),
49
- ...skillTools(skills),
50
- ...artifactToolsFor(sandboxed, { pageBytes: options.artifactPageBytes }),
51
- ...(wake ? [wake.tool] : []),
52
- ...(remember ? [remember.tool] : []),
53
- ...(planning ? [planning.tool] : []),
54
- ...(connecting ? [connecting.tool] : []),
55
- ],
56
- instructions,
57
- };
11
+ return engineProjection(agent, runsOn, options, memory, plan, connections);
58
12
  }
@@ -1,92 +1,7 @@
1
- import { type AgentManifest } from "@nylorun/core/define";
2
- import { MODEL_TOOL_NAME_MAX } from "@nylorun/core/define";
3
- import type { McpFacts, ModelDescriptor } from "@nylorun/core/harness-api";
4
- import type { DurableSessionTool } from "../run/durable.js";
5
- export { MODEL_TOOL_NAME_MAX };
6
- /** The harness's configuration of the MCP tools our engine offers. */
7
- export interface McpToolConfig {
8
- /**
9
- * The share of the model's context window past which an agent's MCP tools are deferred, when
10
- * the manifest does not say (Q21). Default 0.1.
11
- */
12
- readonly deferShare: number;
13
- /** Characters per token, to estimate what tool definitions take of a context window. Default 4. */
14
- readonly charsPerToken: number;
15
- /**
16
- * The context window, in tokens, assumed when the turn names no model (`turn.start.model`).
17
- * Default 32,768, small, as for a custom endpoint.
18
- */
19
- readonly fallbackContextWindow: number;
20
- /** How much of a server's own instructions the deferred tools' note shows. Default 2,000. */
21
- readonly serverInstructionsMaxChars: number;
22
- /** How many tools `tool_search` returns when the model sets no `limit`. Default 8. */
23
- readonly toolSearchDefaultLimit: number;
24
- /** The most tools one `tool_search` returns. Default 20. */
25
- readonly toolSearchMaxLimit: number;
26
- }
27
- export declare const DEFAULT_MCP_TOOL_CONFIG: McpToolConfig;
28
- /** `set` over the defaults. */
29
- export declare function mcpToolConfigOf(set?: Partial<McpToolConfig>): McpToolConfig;
30
1
  /**
31
- * The name the model knows an MCP tool by (R2b C6, Q13): `server__tool` with each character
32
- * outside `[A-Za-z0-9_-]` replaced by `_`. A name over 64 characters, or one that collides
33
- * (`suffixed`), keeps 55 and adds `_` and 8 hex characters of the SHA-256 of the raw
34
- * `server/tool`.
2
+ * The session's MCP tools as our engine offers them (protocol 15): named, deferred behind
3
+ * `tool_search` past the threshold (only for an agent that declares tool search, ADR-100, or
4
+ * declares nothing), and laid out once per session's facts. The code is `@nylorun/core/engine`'s,
5
+ * which the SDK's `previewTurn` runs too.
35
6
  */
36
- export declare function mcpToolName(server: string, tool: string, options?: {
37
- readonly suffixed?: boolean;
38
- }): string;
39
- /** A tool whose model-facing name is not `server__tool`. */
40
- export interface McpRenamedTool {
41
- readonly serverToolName: string;
42
- readonly name: string;
43
- }
44
- /**
45
- * The model-facing names of a server's tools (`tools`, raw names, in the server's order), and
46
- * those it renamed or left out. Names that need no change go first, so a renamed tool never takes
47
- * the name of another of the server's tools; a renamed one that collides gets the hash suffix;
48
- * a name `taken` holds (the agent's own tools, an earlier server's tools) leaves the tool out.
49
- * Adds the names it gives to `taken`.
50
- */
51
- export declare function mcpToolNames(server: string, tools: readonly string[], taken: Set<string>): {
52
- names: Map<string, string>;
53
- renamed: McpRenamedTool[];
54
- omitted: string[];
55
- };
56
- /**
57
- * The deferral our engine decided for a session's MCP tools (R2b C10): the identities of the
58
- * deferred ones (`mcpToolKey`), for the facts whose hash is `factsHash`. Kept in our engine's
59
- * state, so the session keeps it while its facts stay the same.
60
- */
61
- export interface McpLayout {
62
- readonly factsHash: string;
63
- readonly deferred: readonly string[];
64
- }
65
- /** The key of an MCP tool's identity in a layout: its agent, server and own name. */
66
- export declare function mcpToolKey(agentId: string | undefined, server: string, tool: string): string;
67
- /** The session's MCP tools as our engine offers them, for one run. */
68
- export interface McpToolSet {
69
- /**
70
- * Every agent's MCP tools in the model's order: the listed ones, then for each agent with
71
- * deferred tools `tool_search` (with the note on its servers), `tool_call` and the deferred
72
- * ones (`deferred: true`). An agent used as a tool's carry its `agentId`.
73
- */
74
- readonly tools: readonly DurableSessionTool[];
75
- /** The layout these tools follow: the one given, or the one decided now. */
76
- readonly layout: McpLayout;
77
- /** The deferred tools of an agent (`agentId` absent for the root), which `tool_search` searches. */
78
- deferredOf(agentId: string | undefined): readonly DurableSessionTool[];
79
- }
80
- /**
81
- * The session's MCP tools from the turn's facts (`turn.start.mcp`) for the agent tree `manifest`.
82
- * `layout` is the one our engine's state keeps: followed while its `factsHash` matches, else the
83
- * deferral is decided again from the model's window (`model.contextWindow`, or
84
- * `config.fallbackContextWindow`). `taken(agent)` names an agent's other tools (our engine's
85
- * own), which an MCP tool's name may not take besides the agent's declared tools.
86
- */
87
- export declare function mcpToolSet(facts: McpFacts | undefined, manifest: AgentManifest, options: {
88
- readonly config: McpToolConfig;
89
- readonly model?: ModelDescriptor;
90
- readonly layout?: McpLayout;
91
- readonly taken?: (agent: AgentManifest) => readonly string[];
92
- }): McpToolSet;
7
+ export { DEFAULT_MCP_TOOL_CONFIG, MODEL_TOOL_NAME_MAX, mcpToolConfigOf, mcpToolKey, mcpToolName, mcpToolNames, mcpToolSet, type McpLayout, type McpRenamedTool, type McpToolConfig, type McpToolDiagnostic, type McpToolSet, } from "@nylorun/core/engine";