@nylorun/agents 0.23.0-beta → 0.25.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/dist/index.d.ts CHANGED
@@ -6,22 +6,24 @@ export { Agent, AgentBuilder } from "./builder.js";
6
6
  export { AgentBuildError, AgentLifecycleError, VerdictSchema, isVerdict, WorkflowBuildError, isBuiltWorkflow, flow, tool, http, defineSchema, ToolError, } from "@nylorun/core/define";
7
7
  export type { FlowAgentBuilder, Flow, Named, LoopOptions, StageOptions, HttpTarget, } from "@nylorun/core/define";
8
8
  export type { AgentOptions, AgentManifest, BuiltAgent, BuiltWorkflow, Verdict, WorkflowBinding, WorkflowManifest, ToolDefinition, ToolExecutionContext, ToolOutcome, JsonValue, JsonObject, } from "@nylorun/core/define";
9
- export type { SessionPage, SessionListItem, SessionManifestView, HistoryPage, SessionUsageTotals, ModelCall, ModelCallsPage, EnvironmentPage, ToolCall, ToolCallsPage, LiveEvent, SessionEvent, SessionEventOf, EventType, SessionCommand, SubjectScope, EnvironmentView, EnvironmentEvent, EnvironmentEventType, EgressRunningTurn, EnvironmentKind, EnvironmentRecipe, EnvironmentSecretView, EnvironmentSnapshot, EnvironmentRestore, EnvironmentVersions, RestoreEnvironmentRequest, EnvironmentForkPlan, ForkEnvironmentRequest, ForkEnvironmentResponse, EnvironmentManifest, EnvironmentManifestPlan, EnvironmentManifestView, EnvironmentManifestVersions, SaveEnvironmentManifestResponse, MessagePart, ArtifactView, ArtifactKind, ArtifactListItem, ArtifactPage, ArtifactVersionView, ArtifactLink, UploadArtifactResponse, DefinitionFileView, ArtifactTree, ArtifactDiff, FolderEntry, } from "@nylorun/core/contracts";
10
- export { ENVIRONMENT_EVENT_TYPES, RUNTIME_LIMIT_DEFAULTS, SUBJECT_SCOPES } from "@nylorun/core/contracts";
9
+ export type { SessionPage, SessionListItem, SessionManifestView, HistoryPage, SessionUsageTotals, CostSplit, ModelCall, ModelCallsPage, AgentPage, ToolCall, ToolCallsPage, LiveEvent, SessionEvent, SessionEventOf, EventType, SessionCommand, SubjectScope, AgentView, AgentState, AgentAttention, AgentEvent, AgentEventType, EgressRunningTurn, EnvironmentKind, EnvironmentRecipe, EnvironmentSecretSlot, AgentSecretView, AgentSnapshot, AgentRestore, AgentDiskVersions, RestoreAgentRequest, AgentForkPlan, AgentMovePlan, RestartAgentRequest, ForkAgentRequest, ForkAgentResponse, DeleteAgentResponse, PutAgentRequest, PutAgentSecretRequest, AgentManifestV8, AgentManifestFile, HarnessManifestFile, RuntimeManifestFile, RuntimeSection, AgentManifestChange, AgentManifestWarning, AgentManifestPlan, AgentManifestView, AgentManifestVersions, SaveAgentManifestResponse, DeleteAgentManifestResponse, MessagePart, ArtifactView, ArtifactKind, ArtifactListItem, ArtifactPage, ArtifactVersionView, ArtifactLink, UploadArtifactResponse, DefinitionFileView, ArtifactTree, ArtifactDiff, FolderEntry, } from "@nylorun/core/contracts";
10
+ export { AGENT_EVENT_TYPES, AGENT_STATES, COMPUTE_STATES, RUNTIME_LIMIT_DEFAULTS, SUBJECT_SCOPES, } from "@nylorun/core/contracts";
11
+ export type { AgentHarnessSection, HarnessSection, HarnessSkill, HarnessMcpServer, WorkflowHarnessSection, } from "@nylorun/core";
11
12
  export { AgentsClient, SessionClient, createClient } from "./client.js";
12
13
  export { ArtifactsClient } from "./artifacts.js";
13
14
  export { FilesClient, definitionFileHash } from "./files.js";
14
15
  export type { ArtifactBody, ArtifactPageOptions, ArtifactLinkWithUrl, UploadArtifactOptions, } from "./artifacts.js";
15
- export type { ActAsOptions, AgentSource, SessionView, CommandOptions, CreateSessionOptions, SessionSandbox, ForSessionOptions, EnvironmentFileBytes, EnvironmentInput, EnvironmentManifestInput, EnvironmentSecretInput, SessionEnvironmentHandle, } from "./client.js";
16
- export { EnvironmentManifestsClient, EnvironmentsClient, EnvironmentSecretsClient, environmentFiles, environmentManifest, } from "./client.js";
16
+ export type { ActAsOptions, AgentSource, SessionView, CommandOptions, CreateSessionOptions, SessionSandbox, AgentFilter, AgentInput, AgentSecretInput, RuntimeFileBytes, AgentManifestDocument, AgentManifestFromAgent, AgentManifestInput, AgentManifestSaveOptions, ComposedManifest, DefinitionFiles, } from "./client.js";
17
+ export { AgentInstancesClient, AgentManifestsClient, AgentMemoriesClient, AgentSecretsClient, ManifestGapsError, agentManifest, requirementGaps, runtimeFiles, } from "./client.js";
18
+ export { composeManifest, manifestFolders, ComposeError, AGENT_MANIFEST_FILE } from "./compose.js";
17
19
  export { AccessClient } from "./access.js";
18
20
  export { resolveConnection, ConnectionError } from "./connection.js";
19
21
  export type { ResolvedConnection } from "./connection.js";
20
22
  export { RuntimeError, IncompatibleRuntimeError } from "./http.js";
21
23
  export type { Destination, IncompatibleReason, TokenSource } from "./http.js";
22
- export { loadPlugin, PluginError } from "./plugins/load.js";
24
+ export { loadMcpServers, loadPlugin, PluginError } from "./plugins/load.js";
23
25
  export type { LoadedPlugin, PluginDiagnostic } from "./plugins/load.js";
24
- export { loadSkillsFromDirectory, resolveSkillsRoot, parseSkill, SkillsError, } from "./skills/index.js";
26
+ export { hashFolder, loadSkillsFromDirectory, resolveSkillsRoot, parseSkill, SkillsError, } from "./skills/index.js";
25
27
  export type { SkillDiagnostic } from "./skills/index.js";
26
28
  export { McpError } from "./mcp/index.js";
27
29
  export type { McpServerSpec } from "./mcp/index.js";
package/dist/index.js CHANGED
@@ -4,14 +4,15 @@ export { hashManifest, PROTOCOL_VERSION, PROTOCOL_FEATURES, HOST_PROTOCOL, DEFIN
4
4
  export { checkHealth, describeIncompatibility, parseProtocolRange, } from "@nylorun/core/transport";
5
5
  export { Agent, AgentBuilder } from "./builder.js";
6
6
  export { AgentBuildError, AgentLifecycleError, VerdictSchema, isVerdict, WorkflowBuildError, isBuiltWorkflow, flow, tool, http, defineSchema, ToolError, } from "@nylorun/core/define";
7
- export { ENVIRONMENT_EVENT_TYPES, RUNTIME_LIMIT_DEFAULTS, SUBJECT_SCOPES } from "@nylorun/core/contracts";
7
+ export { AGENT_EVENT_TYPES, AGENT_STATES, COMPUTE_STATES, RUNTIME_LIMIT_DEFAULTS, SUBJECT_SCOPES, } from "@nylorun/core/contracts";
8
8
  export { AgentsClient, SessionClient, createClient } from "./client.js";
9
9
  export { ArtifactsClient } from "./artifacts.js";
10
10
  export { FilesClient, definitionFileHash } from "./files.js";
11
- export { EnvironmentManifestsClient, EnvironmentsClient, EnvironmentSecretsClient, environmentFiles, environmentManifest, } from "./client.js";
11
+ export { AgentInstancesClient, AgentManifestsClient, AgentMemoriesClient, AgentSecretsClient, ManifestGapsError, agentManifest, requirementGaps, runtimeFiles, } from "./client.js";
12
+ export { composeManifest, manifestFolders, ComposeError, AGENT_MANIFEST_FILE } from "./compose.js";
12
13
  export { AccessClient } from "./access.js";
13
14
  export { resolveConnection, ConnectionError } from "./connection.js";
14
15
  export { RuntimeError, IncompatibleRuntimeError } from "./http.js";
15
- export { loadPlugin, PluginError } from "./plugins/load.js";
16
- export { loadSkillsFromDirectory, resolveSkillsRoot, parseSkill, SkillsError, } from "./skills/index.js";
16
+ export { loadMcpServers, loadPlugin, PluginError } from "./plugins/load.js";
17
+ export { hashFolder, loadSkillsFromDirectory, resolveSkillsRoot, parseSkill, SkillsError, } from "./skills/index.js";
17
18
  export { McpError } from "./mcp/index.js";
@@ -23,3 +23,13 @@ export interface LoadedPlugin {
23
23
  readonly diagnostics: readonly PluginDiagnostic[];
24
24
  }
25
25
  export declare function loadPlugin(directory: string): LoadedPlugin;
26
+ /**
27
+ * The remote MCP servers of an `mcp.json` in the Agent Plugins format (`$schema` and
28
+ * `mcpServers`), as a manifest declares them: a plugin's, or the one a `harness.manifest.json`
29
+ * names. A file that cannot be read is a `<prefix>.mcp-invalid` diagnostic and no servers; an
30
+ * invalid server is skipped with a diagnostic; a stdio server throws.
31
+ */
32
+ export declare function loadMcpServers(location: string, diagnostics: PluginDiagnostic[], options?: {
33
+ readonly boundary?: string;
34
+ readonly codePrefix?: string;
35
+ }): Readonly<Record<string, McpServerManifest>>;
@@ -1,5 +1,5 @@
1
1
  import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
2
- import { isAbsolute, join, relative, resolve, sep } from "node:path";
2
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
3
3
  import { stdioMcpRefusal } from "@nylorun/core/define";
4
4
  import { HEADER_NAME_PATTERN, LOOPBACK_HOSTS, McpServerManifestSchema, } from "@nylorun/core/contracts";
5
5
  import { loadSkillsFromDirectory } from "../skills/load.js";
@@ -137,12 +137,23 @@ function loadMcp(root, diagnostics) {
137
137
  const location = join(root, "mcp.json");
138
138
  if (!existsSync(location))
139
139
  return {};
140
- const real = realInside(root, location);
140
+ return loadMcpServers(location, diagnostics, { boundary: root });
141
+ }
142
+ /**
143
+ * The remote MCP servers of an `mcp.json` in the Agent Plugins format (`$schema` and
144
+ * `mcpServers`), as a manifest declares them: a plugin's, or the one a `harness.manifest.json`
145
+ * names. A file that cannot be read is a `<prefix>.mcp-invalid` diagnostic and no servers; an
146
+ * invalid server is skipped with a diagnostic; a stdio server throws.
147
+ */
148
+ export function loadMcpServers(location, diagnostics, options = {}) {
149
+ const prefix = options.codePrefix ?? "plugin";
150
+ const boundary = options.boundary ?? dirname(resolve(location));
151
+ const real = realInside(boundary, location);
141
152
  if (!real || !statSync(real).isFile()) {
142
153
  diagnostics.push({
143
154
  severity: "warning",
144
- code: "plugin.mcp-invalid",
145
- message: "mcp.json is not a file inside the package",
155
+ code: `${prefix}.mcp-invalid`,
156
+ message: `${basename(location)} is not a file inside the package`,
146
157
  path: location,
147
158
  });
148
159
  return {};
@@ -154,8 +165,8 @@ function loadMcp(root, diagnostics) {
154
165
  catch {
155
166
  diagnostics.push({
156
167
  severity: "warning",
157
- code: "plugin.mcp-invalid",
158
- message: "mcp.json is not valid JSON",
168
+ code: `${prefix}.mcp-invalid`,
169
+ message: `${basename(location)} is not valid JSON`,
159
170
  path: location,
160
171
  });
161
172
  return {};
@@ -163,8 +174,8 @@ function loadMcp(root, diagnostics) {
163
174
  if (!isRecord(parsed) || Object.keys(parsed).some((key) => key !== "$schema" && key !== "mcpServers")) {
164
175
  diagnostics.push({
165
176
  severity: "warning",
166
- code: "plugin.mcp-invalid",
167
- message: "mcp.json must contain only $schema and mcpServers",
177
+ code: `${prefix}.mcp-invalid`,
178
+ message: `${basename(location)} must contain only $schema and mcpServers`,
168
179
  path: location,
169
180
  });
170
181
  return {};
@@ -172,8 +183,8 @@ function loadMcp(root, diagnostics) {
172
183
  if (parsed.$schema !== MCP_SCHEMA) {
173
184
  diagnostics.push({
174
185
  severity: "warning",
175
- code: "plugin.mcp-invalid",
176
- message: "mcp.json $schema does not match the plugin schema version",
186
+ code: `${prefix}.mcp-invalid`,
187
+ message: `${basename(location)} $schema does not match the plugin schema version`,
177
188
  path: location,
178
189
  });
179
190
  return {};
@@ -181,8 +192,8 @@ function loadMcp(root, diagnostics) {
181
192
  if (!isRecord(parsed.mcpServers)) {
182
193
  diagnostics.push({
183
194
  severity: "warning",
184
- code: "plugin.mcp-invalid",
185
- message: "mcp.json mcpServers must be an object",
195
+ code: `${prefix}.mcp-invalid`,
196
+ message: `${basename(location)} mcpServers must be an object`,
186
197
  path: location,
187
198
  });
188
199
  return {};
@@ -190,12 +201,12 @@ function loadMcp(root, diagnostics) {
190
201
  const servers = {};
191
202
  for (const [name, value] of Object.entries(parsed.mcpServers)) {
192
203
  if (isRecord(value) && value.type === "stdio")
193
- throw new PluginError("plugin.mcp-stdio", stdioMcpRefusal(name), diagnostics);
204
+ throw new PluginError(`${prefix}.mcp-stdio`, stdioMcpRefusal(name), diagnostics);
194
205
  const server = validateServer(name, value);
195
206
  if (typeof server === "string") {
196
207
  diagnostics.push({
197
208
  severity: "warning",
198
- code: "plugin.mcp-server-skipped",
209
+ code: `${prefix}.mcp-server-skipped`,
199
210
  message: `Skipped invalid MCP server '${name}': ${server}`,
200
211
  path: location,
201
212
  });
@@ -5,7 +5,7 @@ export interface PluginPart extends PartDeclaration {
5
5
  }
6
6
  /**
7
7
  * Read an Agent Plugin package as one part of an agent, for `.plugin()`. Each part it skips
8
- * (an invalid MCP server or skill) is a process warning, so building or registering the agent
8
+ * (an invalid MCP server or skill) is a process warning, so building or saving its manifest
9
9
  * says why the agent has less than the package declares. A stdio MCP server throws: Nylorun
10
10
  * accepts remote servers only.
11
11
  */
@@ -2,7 +2,7 @@ import { skillsDeclaration } from "../skills/skills.js";
2
2
  import { loadPlugin, } from "./load.js";
3
3
  /**
4
4
  * Read an Agent Plugin package as one part of an agent, for `.plugin()`. Each part it skips
5
- * (an invalid MCP server or skill) is a process warning, so building or registering the agent
5
+ * (an invalid MCP server or skill) is a process warning, so building or saving its manifest
6
6
  * says why the agent has less than the package declares. A stdio MCP server throws: Nylorun
7
7
  * accepts remote servers only.
8
8
  */
package/dist/reads.d.ts CHANGED
@@ -2,9 +2,11 @@
2
2
  import { type SessionListItem, type SessionPage } from "@nylorun/core/contracts";
3
3
  import type { Transport } from "./http.js";
4
4
  export type SessionPageOptions = {
5
+ /** The Agent the sessions run on. */
5
6
  agentId?: string;
7
+ /** The agent manifest's name their Agents were made from. */
8
+ manifest?: string;
6
9
  status?: SessionListItem["status"];
7
- environmentId?: string;
8
10
  ownerUserId?: string;
9
11
  limit?: number;
10
12
  cursor?: string;
@@ -2,11 +2,12 @@
2
2
  * The Runtime API client classes, with no Node-only imports. `client.ts` adds `createClient`,
3
3
  * which resolves the connection from the environment or the Project link.
4
4
  */
5
- import type { AgentManifest, BuiltAgent, BuiltWorkflow, JsonValue, SandboxToolName, WorkflowManifest } from "@nylorun/core/define";
6
- import { type SessionItemsResponse, type SessionSummary, type ListAgentsResponse, type ListPublicAgentsResponse, type SubjectScope, type MessagePart, type SessionCommand } from "@nylorun/core/contracts";
5
+ import type { JsonValue, SandboxToolName } from "@nylorun/core/define";
6
+ import { type SessionItemsResponse, type SessionSummary, type SubjectScope, type MessageDelivery, type MessagePart, type SessionCommand } from "@nylorun/core/contracts";
7
7
  import { SessionsReadClient } from "./reads.js";
8
8
  import { AccessClient } from "./access.js";
9
- import { EnvironmentsClient } from "./environments.js";
9
+ import { AgentInstancesClient } from "./agents.js";
10
+ import { AgentManifestsClient } from "./agent-manifests.js";
10
11
  import { ArtifactsClient } from "./artifacts.js";
11
12
  import { FilesClient } from "./files.js";
12
13
  import { Transport, type Destination } from "./http.js";
@@ -14,12 +15,6 @@ import { Transport, type Destination } from "./http.js";
14
15
  export type SessionSandbox = {
15
16
  readonly [K in SandboxToolName]: (args: Record<string, unknown>) => Promise<unknown>;
16
17
  };
17
- export interface AgentSource {
18
- readonly id: string;
19
- readonly manifest: AgentManifest | WorkflowManifest;
20
- build?(): BuiltAgent | BuiltWorkflow;
21
- getBinding?: BuiltAgent["getBinding"] | BuiltWorkflow["getBinding"];
22
- }
23
18
  export interface SessionView {
24
19
  id: string;
25
20
  agentId: string;
@@ -31,17 +26,16 @@ export interface SessionView {
31
26
  }
32
27
  /** `AgentsClient.createSession`'s options. */
33
28
  export interface CreateSessionOptions {
29
+ /** The session's id, which the app chooses. Default: a new UUID. */
34
30
  id?: string;
35
- agentId: string;
31
+ /**
32
+ * The Agent the session runs on (`client.agents`): its manifest version, its sandbox and its
33
+ * vault's credentials. Fixed once the session exists.
34
+ */
35
+ agent: string;
36
36
  ownerUserId: string;
37
37
  info?: Record<string, unknown>;
38
38
  requestId?: string;
39
- /**
40
- * The Environment the session runs in (`client.environments`): its sandbox, and its vault's
41
- * credentials for the session's shell, MCP servers and HTTP tools. Omit for no sandbox and no
42
- * credentials. Fixed once the session exists.
43
- */
44
- environment?: string;
45
39
  }
46
40
  export interface ActAsOptions {
47
41
  /** What the subject may do; the Runtime grants nothing else. Default `["sessions:own"]`. */
@@ -62,11 +56,16 @@ export declare class AgentsClient {
62
56
  /** The public keys that verify the tokens the Tenant signs. */
63
57
  get access(): AccessClient;
64
58
  /**
65
- * Environments (protocol 11): `put` one by id (create, find or change), write its `secrets`,
66
- * `list` them by label, `stop`, `reset` or `delete` one, or give a session its own with
67
- * `forSession`.
59
+ * Agent manifests (protocol 16): `save` a manifest's next version (a v8 document, what
60
+ * `composeManifest` read, or a built agent with its runtime section), `plan` a save, read
61
+ * their versions.
68
62
  */
69
- get environments(): EnvironmentsClient;
63
+ get agentManifests(): AgentManifestsClient;
64
+ /**
65
+ * Agents (protocol 16): `put` one by id from a saved manifest (create or find), write its
66
+ * `secrets`, `list` them, `stop`, `reset`, `fork` or `delete` one. Sessions run on them.
67
+ */
68
+ get agents(): AgentInstancesClient;
70
69
  /** File artifacts: upload, list, download with Range, capability links (protocol 6). */
71
70
  get artifacts(): ArtifactsClient;
72
71
  /** Definition files: the skill files a definition names, by content hash. */
@@ -76,32 +75,12 @@ export declare class AgentsClient {
76
75
  signal?: AbortSignal;
77
76
  }): Promise<readonly string[]>;
78
77
  get sessions(): SessionsReadClient;
79
- listAgents(options?: {
80
- signal?: AbortSignal;
81
- }): Promise<ListAgentsResponse | {
82
- agents: (ListPublicAgentsResponse["agents"][number] & {
83
- manifest?: never;
84
- })[];
85
- }>;
86
78
  listSessions(options?: {
87
79
  agentId?: string;
88
80
  signal?: AbortSignal;
89
81
  }): Promise<{
90
82
  sessions: SessionSummary[];
91
83
  }>;
92
- /**
93
- * Registers the agent's definition (`PUT /v1/agents/{id}`), first uploading the skill files
94
- * it names that the Runtime does not hold. A definition with a tool that runs your code
95
- * (`tool({ run })`, a flow's tool stage) is refused before anything is sent: the Runtime runs
96
- * agents from their manifests alone. `implementationVersion` defaults to
97
- * `NYLORUN_IMPLEMENTATION_VERSION`, else `dev`. `dryRun` (protocol 14) runs every check and
98
- * saves nothing; the skill files are still uploaded, since they are stored by content.
99
- */
100
- saveAgent(agent: AgentSource | BuiltWorkflow, options?: {
101
- implementationVersion?: string;
102
- requestId?: string;
103
- dryRun?: boolean;
104
- }): Promise<unknown>;
105
84
  createSession(options: CreateSessionOptions): Promise<SessionClient>;
106
85
  session(sessionId: string): SessionClient;
107
86
  }
@@ -110,6 +89,14 @@ export type CommandOptions = {
110
89
  requestId?: string;
111
90
  signal?: AbortSignal;
112
91
  };
92
+ /**
93
+ * A message's options. `delivery` says what a message to a busy session does (protocol 17):
94
+ * `queue` (the default) waits for the running turn to end, `reject` is refused with
95
+ * `409 session_busy`.
96
+ */
97
+ export type MessageOptions = CommandOptions & {
98
+ delivery?: MessageDelivery;
99
+ };
113
100
  export declare class SessionClient {
114
101
  private readonly transport;
115
102
  readonly id: string;
@@ -119,44 +106,75 @@ export declare class SessionClient {
119
106
  inspect(signal?: AbortSignal): Promise<SessionView>;
120
107
  /** Pending waits / interactions from the session inspect view. */
121
108
  pending(signal?: AbortSignal): Promise<{}>;
109
+ /** A message answers `queued` when it waits for the running turn (protocol 17). */
122
110
  command(command: SessionCommand, signal?: AbortSignal): Promise<{
123
111
  status: "accepted";
124
112
  turnId: string | null;
125
113
  cursor: string | null;
126
114
  requestId: string;
115
+ } | {
116
+ status: "queued";
117
+ queuedMessageId: string;
118
+ position: number;
119
+ cursor: string | null;
120
+ requestId: string;
127
121
  }>;
128
122
  /**
129
123
  * Start a turn. Strings become `message.content`; any other JSON value becomes
130
124
  * `message.data` (workflows.md §5).
131
125
  */
132
- input(value: string | JsonValue, options: CommandOptions): Promise<{
126
+ input(value: string | JsonValue, options: MessageOptions): Promise<{
133
127
  status: "accepted";
134
128
  turnId: string | null;
135
129
  cursor: string | null;
136
130
  requestId: string;
131
+ } | {
132
+ status: "queued";
133
+ queuedMessageId: string;
134
+ position: number;
135
+ cursor: string | null;
136
+ requestId: string;
137
137
  }>;
138
138
  /**
139
139
  * Start a turn with text and file parts (protocol 6): a file part names an artifact (upload
140
140
  * it with `client.artifacts.upload`), at a version or its latest, and the model reads it, an
141
141
  * image as an image and a text file as text.
142
142
  */
143
- inputParts(parts: readonly MessagePart[], options: CommandOptions): Promise<{
143
+ inputParts(parts: readonly MessagePart[], options: MessageOptions): Promise<{
144
144
  status: "accepted";
145
145
  turnId: string | null;
146
146
  cursor: string | null;
147
147
  requestId: string;
148
+ } | {
149
+ status: "queued";
150
+ queuedMessageId: string;
151
+ position: number;
152
+ cursor: string | null;
153
+ requestId: string;
148
154
  }>;
149
155
  approve(interactionId: string, approved: boolean, options: CommandOptions): Promise<{
150
156
  status: "accepted";
151
157
  turnId: string | null;
152
158
  cursor: string | null;
153
159
  requestId: string;
160
+ } | {
161
+ status: "queued";
162
+ queuedMessageId: string;
163
+ position: number;
164
+ cursor: string | null;
165
+ requestId: string;
154
166
  }>;
155
167
  respond(interactionId: string, value: JsonValue, options: CommandOptions): Promise<{
156
168
  status: "accepted";
157
169
  turnId: string | null;
158
170
  cursor: string | null;
159
171
  requestId: string;
172
+ } | {
173
+ status: "queued";
174
+ queuedMessageId: string;
175
+ position: number;
176
+ cursor: string | null;
177
+ requestId: string;
160
178
  }>;
161
179
  cancel(options: CommandOptions & {
162
180
  reason?: string;
@@ -165,14 +183,23 @@ export declare class SessionClient {
165
183
  turnId: string | null;
166
184
  cursor: string | null;
167
185
  requestId: string;
186
+ } | {
187
+ status: "queued";
188
+ queuedMessageId: string;
189
+ position: number;
190
+ cursor: string | null;
191
+ requestId: string;
168
192
  }>;
169
193
  manifest(options?: {
170
194
  signal?: AbortSignal;
171
195
  }): Promise<{
172
196
  sessionId: string;
173
197
  agentId: string;
198
+ definition: {
199
+ name: string;
200
+ version: number;
201
+ } | null;
174
202
  manifestHash: string;
175
- implementationVersion: string;
176
203
  manifest: Record<string, unknown>;
177
204
  }>;
178
205
  usage(options?: {
@@ -194,6 +221,15 @@ export declare class SessionClient {
194
221
  unpricedCalls: number;
195
222
  unreportedCalls: number;
196
223
  unknownQualityCalls: number;
224
+ costSplit: {
225
+ input: number;
226
+ cacheRead: number;
227
+ cacheWrite: number;
228
+ output: number;
229
+ };
230
+ splitCalls: number;
231
+ modelTimeMs: number;
232
+ timedCalls: number;
197
233
  }>;
198
234
  modelCalls(options?: {
199
235
  turnId?: string;
@@ -206,10 +242,12 @@ export declare class SessionClient {
206
242
  effectId: string;
207
243
  sessionId: string;
208
244
  turnId: string;
209
- agentId: string;
245
+ manifestName: string;
210
246
  provider: string | null;
211
247
  model: string | null;
212
248
  at: string;
249
+ startedAt: string | null;
250
+ endedAt: string | null;
213
251
  outcome: "completed" | "failed";
214
252
  usage: {
215
253
  inputTokens: number;
@@ -222,13 +260,19 @@ export declare class SessionClient {
222
260
  duplicate: boolean;
223
261
  tokensReported: boolean | null;
224
262
  costKnown: boolean | null;
263
+ costSplit: {
264
+ input: number;
265
+ cacheRead: number;
266
+ cacheWrite: number;
267
+ output: number;
268
+ } | null;
225
269
  } | null;
226
270
  }[];
227
271
  nextCursor: string | null;
228
272
  asOf: string;
229
273
  }>;
230
274
  /**
231
- * The session's tool calls (R5, Host feature `tool-calls`), in the order they were first sent:
275
+ * The session's tool calls (Host feature `tool-calls`), in the order they were first sent:
232
276
  * each one's tool, input, status and sends. `attempts` above 1: a crash re-sent it.
233
277
  */
234
278
  toolCalls(options?: {
@@ -242,7 +286,7 @@ export declare class SessionClient {
242
286
  turnId: string;
243
287
  callId: string | null;
244
288
  toolName: string | null;
245
- kind: "harness" | "http" | "mcp" | "sandbox" | null;
289
+ kind: "harness" | "http" | "mcp" | "runtime" | "sandbox" | null;
246
290
  server: string | null;
247
291
  tool: string | null;
248
292
  skill: string | null;
@@ -265,7 +309,7 @@ export declare class SessionClient {
265
309
  asOf: string;
266
310
  }>;
267
311
  /**
268
- * A turn's trace (R7, Host feature `traces`): its spans as OTLP/HTTP JSON (`resourceSpans`), as
312
+ * A turn's trace (Host feature `traces`): its spans as OTLP/HTTP JSON (`resourceSpans`), as
269
313
  * the Runtime posts them to an OTLP collector. Post it to a collector's `/v1/traces` to backfill
270
314
  * one, or read it without one.
271
315
  */
@@ -350,7 +394,7 @@ export declare class SessionClient {
350
394
  };
351
395
  evidence: "asserted" | "attested" | "claimed" | "measured" | "observed";
352
396
  principal?: {
353
- kind: "application" | "core" | "flow-host" | "subject";
397
+ kind: "application" | "core" | "flow-host" | "subject" | "trigger";
354
398
  id: string;
355
399
  } | undefined;
356
400
  trace?: {
@@ -374,5 +418,7 @@ export { RuntimeError, IncompatibleRuntimeError } from "./http.js";
374
418
  export type { Destination, IncompatibleReason } from "./http.js";
375
419
  export type { LiveEvent } from "@nylorun/core/contracts";
376
420
  export { AccessClient } from "./access.js";
377
- export { EnvironmentManifestsClient, EnvironmentSecretsClient, EnvironmentsClient, environmentFiles, environmentManifest, } from "./environments.js";
378
- export type { EnvironmentFileBytes, EnvironmentInput, EnvironmentManifestInput, EnvironmentSecretInput, ForSessionOptions, SessionEnvironmentHandle, } from "./environments.js";
421
+ export { AgentInstancesClient, AgentMemoriesClient, AgentSecretsClient, runtimeFiles } from "./agents.js";
422
+ export type { AgentFilter, AgentInput, AgentSecretInput, RuntimeFileBytes } from "./agents.js";
423
+ export { AgentManifestsClient, ManifestGapsError, agentManifest, requirementGaps } from "./agent-manifests.js";
424
+ export type { AgentManifestDocument, AgentManifestFromAgent, AgentManifestInput, AgentManifestSaveOptions, AgentSource, ComposedManifest, DefinitionFiles, } from "./agent-manifests.js";