@nylorun/agents 0.31.0-beta → 0.32.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 +63 -0
- package/README.md +1 -1
- package/dist/agents.d.ts +22 -6
- package/dist/agents.js +4 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -0
- package/dist/session-client.d.ts +17 -3
- package/dist/session-client.js +11 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# @nylorun/agents
|
|
2
2
|
|
|
3
|
+
## 0.32.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 67ed2ea: `previewTurn(manifest, { sandbox?, memory?, mcpFacts?, model?, selfWake?, loop? })` (ADR-100):
|
|
8
|
+
what the model of a turn reads and may call, offline, built from the code the harness runs:
|
|
9
|
+
`{ system, tools, blocks, features, pinned, diagnostics, agents }`, the root agent's and each
|
|
10
|
+
subagent's. It takes a compiled agent manifest v8 (`checkFolder`'s) or a loop manifest; the facts
|
|
11
|
+
it is not given come from the manifest.
|
|
12
|
+
- 67ed2ea: A message's `removeTools` (Host feature `remove-tools`): the tools its turn may not use, by name. A
|
|
13
|
+
declared tool or an agent used as a tool by its name (in the agent and the agents it uses as tools),
|
|
14
|
+
an MCP server's tool as `<server>__<tool>`, a whole server by its name. The Runtime applies it to the
|
|
15
|
+
version the turn runs, after the turn's first segment re-pins the session to its Agent's version, so
|
|
16
|
+
a session that always sends it still moves to new versions; names that version lacks are ignored.
|
|
17
|
+
A message's turn manifest is validated again against the version a re-pin moves to; one that is no
|
|
18
|
+
variant of it keeps the turn on the version it pinned (`turn.version_kept`). A variant may narrow an
|
|
19
|
+
agent it uses as a tool (`isVariantOf`; `withoutTools` in `@nylorun/core/define`). An HTTP tool call
|
|
20
|
+
is checked against the turn's manifest. `session.input` and `session.inputParts` take
|
|
21
|
+
`removeTools`.
|
|
22
|
+
- 67ed2ea: Secret routing: the agent folder names, the installation routes (Host feature `secret-routing`, no
|
|
23
|
+
protocol change). A `bearer` or `headers` secret slot (`runtime.json`, `runtime.secrets`) takes the
|
|
24
|
+
gateway's `toolPrefix`, with or without `via`, and a slot's value write
|
|
25
|
+
(`PUT /v1/agents/{id}/secrets/{name}` with `{ value }` or `{ headers }`) takes `via`, with the same
|
|
26
|
+
URL rules as a slot's. At each request the secret's `via` wins, else the slot's in the version the
|
|
27
|
+
Agent runs, else none (the slot's `url`); the slot's `toolPrefix` wins over the secret's and
|
|
28
|
+
applies only with a `via`; the slot's `url` still picks the credential, for MCP servers and HTTP
|
|
29
|
+
tools alike, and an HTTP tool whose URL has `{field}` parameters still fails behind a `via`. A
|
|
30
|
+
write whose `toolPrefix` differs from its slot's is accepted, with a warning in the log. A `via` a
|
|
31
|
+
write copied from its slot follows the slot when the Agent moves, and a fork keeps a secret's own
|
|
32
|
+
`via`. Secret views show the `via` and `toolPrefix` in force, never a value.
|
|
33
|
+
`client.agents.secrets.put` takes `{ value | headers, via?, toolPrefix? }` (`AgentSecretRouting`),
|
|
34
|
+
and `nylorun agents secrets put` takes `--via` and `--tool-prefix`, and a slot's JSON without a
|
|
35
|
+
`type`. The JSON Schemas that gained the slot's `toolPrefix` are published as
|
|
36
|
+
`agent-manifest/v8.2`, `runtime-manifest/v1.1` and `agent-folder/v1/runtime.1`, which `nylorun init`
|
|
37
|
+
maps; the old `$schema` URLs are still read.
|
|
38
|
+
- 67ed2ea: A session records the model its turns call and why (`SessionModelRecord`): `model` on `GET
|
|
39
|
+
/v1/sessions/{id}` is `{provider, model, source: "manifest" | "session" | "tenant", reason?,
|
|
40
|
+
requested?}`, with the fallback's `reason` (`provider_not_connected`, `not_in_catalog`,
|
|
41
|
+
`invalid_model`) and the model `requested` by the manifest or the session. It is set when the
|
|
42
|
+
session opens, chooses or clears its model, and again at each segment's start, and each change
|
|
43
|
+
writes the new `session.model` event with the `previous` record. `SessionView.model` in
|
|
44
|
+
`@nylorun/agents`.
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- Pin core to the tested release.
|
|
49
|
+
- Updated dependencies [67ed2ea]
|
|
50
|
+
- Updated dependencies [67ed2ea]
|
|
51
|
+
- Updated dependencies [67ed2ea]
|
|
52
|
+
- Updated dependencies [67ed2ea]
|
|
53
|
+
- Updated dependencies [67ed2ea]
|
|
54
|
+
- Updated dependencies [67ed2ea]
|
|
55
|
+
- Updated dependencies [67ed2ea]
|
|
56
|
+
- @nylorun/core@0.34.0-beta
|
|
57
|
+
|
|
58
|
+
## 0.31.1-beta
|
|
59
|
+
|
|
60
|
+
### Patch Changes
|
|
61
|
+
|
|
62
|
+
- Pin core to the tested release.
|
|
63
|
+
- Updated dependencies [63a6217]
|
|
64
|
+
- @nylorun/core@0.33.0-beta
|
|
65
|
+
|
|
3
66
|
## 0.31.0-beta
|
|
4
67
|
|
|
5
68
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -371,7 +371,7 @@ With a sandbox (kind `virtual` or `pod`), the model gets `bash`, `read`, `write`
|
|
|
371
371
|
|
|
372
372
|
An Agent runs one version of its manifest at a time and evolves in place, with its id, disk, vault and sessions: a `put` on an existing one may change its `labels` and `owner` guard and moves it to the version its `manifest` names (`"name"` tracks the latest, `"name@n"` pins), `plan(id, input)` answers what that move would do, and a save of a new version moves every Agent that tracks the manifest. A harness change applies at once (each session's next turn runs it); a pod's runtime change waits for its next start on the same volume (`targetVersion`, `waitingFor: "start"`; `restart(id)` applies it now), and a start that fails goes back to the version it ran (`failedVersion`; `restart(id, { retry: true })` tries again). A version that adds a required secret waits for its value (`waitingFor: "secrets"`). `list({ outdated: true })` lists the Agents still moving. Its manifest's name, kind, harness and storage are fixed (`409 agent_fixed_field`): `fork(id, { id: next, manifest? })` makes a new Agent (default the source's manifest, tracking), with the source's disk (`disk`: `latest`, a version, or `empty`) and the secrets the new manifest declares (`secrets: "none"` copies none), and `planFork` answers what a fork would do. The Runtime checks the runtime section against the Tenant's limits (`GET`/`PUT /v1/tenant/sandbox`: a network ceiling, a resource maximum, the idle timeout; `/v1/tenant/artifacts` and `/v1/tenant/skills` for its `limits`). `lifecycle.idle` stops a pod after that long without a turn (at most the Tenant's); `lifecycle.deleteAfter` deletes the Agent, its vault and its files once nothing has used it that long. Private networks, loopback, the host and cloud metadata endpoints are always blocked.
|
|
373
373
|
|
|
374
|
-
Secrets are write-only: `client.agents.secrets.put(id, name, secret)` creates or replaces one, and `list`, `get` and `delete` never return a value. When the manifest declares the secret's slot (`runtime.secrets`), send only `{ value }` (or `{ headers }`): the type and binding come from the slot, and a name it does not declare is `409 secret_not_in_manifest`. Typed, an `environment_secret` (`{ value, allowedHosts, inject? }`) shows its name to commands as the sentinel `nylorun_managed`, and egress-gate sets its header on HTTPS requests to `allowedHosts` (pods only); an `environment_variable` (`{ value }`) is a plain variable; `bearer` (`{ url, value, via?, toolPrefix?, identity? }`) and `headers` (`{ url, headers, via?, toolPrefix?, identity? }`) are credentials for the MCP servers and HTTP tools at `url`. A second secret for one host, or a second credential for one URL, is `409 credential_conflict` at the write ([DEPLOYMENT.md](../../guides/DEPLOYMENT.md#credentials)).
|
|
374
|
+
Secrets are write-only: `client.agents.secrets.put(id, name, secret)` creates or replaces one, and `list`, `get` and `delete` never return a value. When the manifest declares the secret's slot (`runtime.secrets`), send only `{ value }` (or `{ headers }`): the type and binding come from the slot, and a name it does not declare is `409 secret_not_in_manifest`. A `bearer` or `headers` slot's value may carry this installation's routing (Host feature `secret-routing`): `via`, where its requests go (a gateway's endpoint, or the real URL of a tool the folder names by a fixed URL), which wins over the slot's `via`, and the gateway's `toolPrefix`, which needs a `via` and gives way to the slot's (a folder may name it in the slot, with or without a `via`). The slot's `url` still picks the credential, and `get` and `list` show the `via` and `toolPrefix` in force: `client.agents.secrets.put("bot", "WEB_KEY", { headers: { "x-litellm-api-key": key }, via: "http://localhost:4100/mcp/web" })`. Typed, an `environment_secret` (`{ value, allowedHosts, inject? }`) shows its name to commands as the sentinel `nylorun_managed`, and egress-gate sets its header on HTTPS requests to `allowedHosts` (pods only); an `environment_variable` (`{ value }`) is a plain variable; `bearer` (`{ url, value, via?, toolPrefix?, identity? }`) and `headers` (`{ url, headers, via?, toolPrefix?, identity? }`) are credentials for the MCP servers and HTTP tools at `url`. A second secret for one host, or a second credential for one URL, is `409 credential_conflict` at the write ([DEPLOYMENT.md](../../guides/DEPLOYMENT.md#credentials)).
|
|
375
375
|
|
|
376
376
|
Sessions on one Agent share its `/workspace` and run their turns at the same time (one turn per session); which sessions work on one disk, and when, is your app's call. Stop, reset, snapshot and restore wait until no turn runs (`409 agent_busy`). Deleting a session only detaches it. With `owner` set, a session of another owner is `403 agent_owner_mismatch` (a caller acting for a person gets the `404` of a missing Agent), checked when it opens and at every turn start. An Agent's view says what it runs (`manifest`, `resolvedVersion`, `tracking`), its `state` (`working`, `sleeping`, `input_required`, `failing` or `paused`, `AGENT_STATES`) with the sessions behind it (`attention`), its compute (`compute.state`) and its slots. `client.agents.list({ labels, state, manifest })`, `page`, `get(id)`, `events(id, { types, since, until })` (its lifecycle, and `agent.egress` for every connection its sandbox opens, naming the turns that were running), `stop(id)`, `reset(id)` and `delete(id)` manage them, and `npx nylorun agents list | put | rm` does the same from the command line. Acting for a person (`app.as(...)`), changing an Agent or its secrets needs `agents:write`, and saving a manifest `agent-manifests:write`. A trusted issuer's token reaches only the Agents its issuer grants (the identity file's `agents` templates, exact ids or prefixes ending in `/*`), checked at every turn start. The Tenant holds at most `limits.environments` of them (`PUT /v1/tenant/sandbox`, default 100).
|
|
377
377
|
|
package/dist/agents.d.ts
CHANGED
|
@@ -33,15 +33,27 @@ import { type AgentDiskVersions, type AgentEvent, type AgentEventType, type Agen
|
|
|
33
33
|
import { type Transport } from "./http.js";
|
|
34
34
|
/** What an Agent is made from (`manifest: "name"` or `"name@n"`), and its owner guard, labels and `from`. */
|
|
35
35
|
export type AgentInput = Omit<PutAgentRequest, "requestId">;
|
|
36
|
+
/**
|
|
37
|
+
* This installation's routing of a `bearer` or `headers` slot's value (Host feature
|
|
38
|
+
* `secret-routing`): `via`, where the credential's requests go (an `https` URL, `http` only to a
|
|
39
|
+
* loopback host, with no userinfo, query or fragment), which wins over the slot's `via`; and the
|
|
40
|
+
* gateway's `toolPrefix`, which needs a `via` (this one or the slot's) and gives way to the slot's.
|
|
41
|
+
* The credential is still chosen by the slot's `url`.
|
|
42
|
+
*/
|
|
43
|
+
export interface AgentSecretRouting {
|
|
44
|
+
readonly via?: string;
|
|
45
|
+
readonly toolPrefix?: string;
|
|
46
|
+
}
|
|
36
47
|
/**
|
|
37
48
|
* One secret of an Agent's vault, as written: typed, or only its value (`{ value }`, or
|
|
38
|
-
* `{ headers }` for a `headers` secret) when its manifest declares the slot
|
|
49
|
+
* `{ headers }` for a `headers` secret) when its manifest declares the slot, with this
|
|
50
|
+
* installation's routing for a `bearer` or `headers` slot (`AgentSecretRouting`).
|
|
39
51
|
*/
|
|
40
|
-
export type AgentSecretInput = PutAgentSecretRequest | {
|
|
52
|
+
export type AgentSecretInput = PutAgentSecretRequest | ({
|
|
41
53
|
readonly value: string;
|
|
42
|
-
} | {
|
|
54
|
+
} & AgentSecretRouting) | ({
|
|
43
55
|
readonly headers: Readonly<Record<string, string>>;
|
|
44
|
-
};
|
|
56
|
+
} & AgentSecretRouting);
|
|
45
57
|
/** Which Agents a `list` or `page` answers: those with every label, and the state or manifest given. */
|
|
46
58
|
export interface AgentFilter {
|
|
47
59
|
readonly labels?: Readonly<Record<string, string>>;
|
|
@@ -75,8 +87,10 @@ export declare class AgentSecretsClient {
|
|
|
75
87
|
* Creates or replaces secret `name` (`PUT /v1/agents/{id}/secrets/{name}`): for
|
|
76
88
|
* `environment_secret` and `environment_variable` the name is the variable's. A second
|
|
77
89
|
* credential for a host or a URL is a 409 `credential_conflict`. When the Agent's manifest
|
|
78
|
-
* declares the secret's slot, send only `{ value }` (or `{ headers }`)
|
|
79
|
-
*
|
|
90
|
+
* declares the secret's slot, send only `{ value }` (or `{ headers }`), with `via` and
|
|
91
|
+
* `toolPrefix` for a `bearer` or `headers` slot routed through a gateway (Host feature
|
|
92
|
+
* `secret-routing`); a name it does not declare is `409 secret_not_in_manifest`. The answer
|
|
93
|
+
* shows the `via` and `toolPrefix` in force, never a value.
|
|
80
94
|
*/
|
|
81
95
|
put(agentId: string, name: string, secret: AgentSecretInput, options?: {
|
|
82
96
|
signal?: AbortSignal;
|
|
@@ -284,6 +298,7 @@ export declare class AgentInstancesClient {
|
|
|
284
298
|
description?: string | undefined;
|
|
285
299
|
type: "bearer";
|
|
286
300
|
url: string;
|
|
301
|
+
toolPrefix?: string | undefined;
|
|
287
302
|
} | {
|
|
288
303
|
via?: string | undefined;
|
|
289
304
|
identity?: {
|
|
@@ -293,6 +308,7 @@ export declare class AgentInstancesClient {
|
|
|
293
308
|
description?: string | undefined;
|
|
294
309
|
type: "headers";
|
|
295
310
|
url: string;
|
|
311
|
+
toolPrefix?: string | undefined;
|
|
296
312
|
}> | undefined;
|
|
297
313
|
};
|
|
298
314
|
limits: {
|
package/dist/agents.js
CHANGED
|
@@ -71,8 +71,10 @@ export class AgentSecretsClient {
|
|
|
71
71
|
* Creates or replaces secret `name` (`PUT /v1/agents/{id}/secrets/{name}`): for
|
|
72
72
|
* `environment_secret` and `environment_variable` the name is the variable's. A second
|
|
73
73
|
* credential for a host or a URL is a 409 `credential_conflict`. When the Agent's manifest
|
|
74
|
-
* declares the secret's slot, send only `{ value }` (or `{ headers }`)
|
|
75
|
-
*
|
|
74
|
+
* declares the secret's slot, send only `{ value }` (or `{ headers }`), with `via` and
|
|
75
|
+
* `toolPrefix` for a `bearer` or `headers` slot routed through a gateway (Host feature
|
|
76
|
+
* `secret-routing`); a name it does not declare is `409 secret_not_in_manifest`. The answer
|
|
77
|
+
* shows the `via` and `toolPrefix` in force, never a value.
|
|
76
78
|
*/
|
|
77
79
|
async put(agentId, name, secret, options = {}) {
|
|
78
80
|
return this.transport.json(`${this.path(agentId)}/secrets/${segment(name)}`, "PUT", { requestId: id(), ...secret }, options.signal);
|
package/dist/index.d.ts
CHANGED
|
@@ -6,18 +6,19 @@ export { Agent, AgentBuilder } from "./builder.js";
|
|
|
6
6
|
export { AgentBuildError, AgentLifecycleError, VerdictSchema, isVerdict, WorkflowBuildError, isBuiltWorkflow, flow, tool, http, defineSchema, ToolError, harnessSectionOf, sectionGaps, } 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, SessionModelChoice, SessionModelView, 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, AgentManifestSource, AgentManifestSourceDiff, AgentManifestSourceSummary, AgentFolderDiagnostic, AgentManifestView, AgentManifestVersions, SaveAgentManifestResponse, DeleteAgentManifestResponse, MessagePart, ArtifactView, ArtifactKind, ArtifactListItem, ArtifactPage, ArtifactVersionView, ArtifactLink, UploadArtifactResponse, DefinitionFileView, ArtifactTree, ArtifactDiff, FolderEntry, } from "@nylorun/core/contracts";
|
|
9
|
+
export type { SessionPage, SessionListItem, SessionManifestView, HistoryPage, SessionUsageTotals, SessionModelChoice, SessionModelView, SessionModelRecord, 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, PutAgentSecretValueRequest, AgentManifestV8, AgentManifestFile, HarnessManifestFile, RuntimeManifestFile, RuntimeSection, AgentManifestChange, AgentManifestWarning, AgentManifestPlan, AgentManifestSource, AgentManifestSourceDiff, AgentManifestSourceSummary, AgentFolderDiagnostic, AgentManifestView, AgentManifestVersions, SaveAgentManifestResponse, DeleteAgentManifestResponse, MessagePart, ArtifactView, ArtifactKind, ArtifactListItem, ArtifactPage, ArtifactVersionView, ArtifactLink, UploadArtifactResponse, DefinitionFileView, ArtifactTree, ArtifactDiff, FolderEntry, } from "@nylorun/core/contracts";
|
|
10
10
|
export { AGENT_EVENT_TYPES, AGENT_FOLDER_MEDIA_TYPE, AGENT_STATES, COMPUTE_STATES, RUNTIME_LIMIT_DEFAULTS, SUBJECT_SCOPES, } from "@nylorun/core/contracts";
|
|
11
11
|
export type { AgentHarnessSection, HarnessSection, HarnessSkill, HarnessMcpServer, WorkflowHarnessSection, } from "@nylorun/core";
|
|
12
12
|
export { AgentsClient, SessionClient, createClient } from "./client.js";
|
|
13
13
|
export { ArtifactsClient } from "./artifacts.js";
|
|
14
14
|
export { FilesClient, definitionFileHash } from "./files.js";
|
|
15
15
|
export type { ArtifactBody, ArtifactPageOptions, ArtifactLinkWithUrl, UploadArtifactOptions, } from "./artifacts.js";
|
|
16
|
-
export type { ActAsOptions, AgentSource, SessionView, CommandOptions, CreateSessionOptions, SessionSandbox, AgentFilter, AgentInput, AgentSecretInput, RuntimeFileBytes, AgentManifestDocument, AgentManifestFromAgent, AgentManifestInput, AgentManifestSaveOptions, ComposedManifest, DefinitionFiles, } from "./client.js";
|
|
16
|
+
export type { ActAsOptions, AgentSource, SessionView, CommandOptions, CreateSessionOptions, SessionSandbox, AgentFilter, AgentInput, AgentSecretInput, AgentSecretRouting, RuntimeFileBytes, AgentManifestDocument, AgentManifestFromAgent, AgentManifestInput, AgentManifestSaveOptions, ComposedManifest, DefinitionFiles, } from "./client.js";
|
|
17
17
|
export { AgentInstancesClient, AgentManifestsClient, AgentMemoriesClient, AgentSecretsClient, ManifestGapsError, agentManifest, requirementGaps, runtimeFiles, } from "./client.js";
|
|
18
18
|
export { composeManifest, manifestFolders, ComposeError, AGENT_MANIFEST_FILE } from "./compose.js";
|
|
19
19
|
export { AGENT_FOLDER_FILE, FolderError, FolderInvalidError, diagnosticLine } from "./folder.js";
|
|
20
20
|
export { checkFolder, folderOfManifest, type FolderOfManifest, type FolderOfManifestOptions } from "./folder-check.js";
|
|
21
|
+
export { ENGINE_BLOCK_NAMES, previewTurn, type AgentTurnPreview, type EngineBlockName, type PreviewTool, type PreviewTurnOptions, type TurnPreview, } from "@nylorun/core/engine";
|
|
21
22
|
export type { PackedFolder } from "./folder.js";
|
|
22
23
|
export { packFolder, isAgentFolder, FOLDER_IGNORE_FILE } from "./folder-pack.js";
|
|
23
24
|
export { ignoreMatcher } from "./folder-ignore.js";
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,8 @@ export { AgentInstancesClient, AgentManifestsClient, AgentMemoriesClient, AgentS
|
|
|
15
15
|
export { composeManifest, manifestFolders, ComposeError, AGENT_MANIFEST_FILE } from "./compose.js";
|
|
16
16
|
export { AGENT_FOLDER_FILE, FolderError, FolderInvalidError, diagnosticLine } from "./folder.js";
|
|
17
17
|
export { checkFolder, folderOfManifest } from "./folder-check.js";
|
|
18
|
+
// What the model of a turn reads and may call (ADR-100), offline: our engine's own code.
|
|
19
|
+
export { ENGINE_BLOCK_NAMES, previewTurn, } from "@nylorun/core/engine";
|
|
18
20
|
export { packFolder, isAgentFolder, FOLDER_IGNORE_FILE } from "./folder-pack.js";
|
|
19
21
|
export { ignoreMatcher } from "./folder-ignore.js";
|
|
20
22
|
export { AccessClient } from "./access.js";
|
package/dist/session-client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* which resolves the connection from the environment or the Project link.
|
|
4
4
|
*/
|
|
5
5
|
import type { JsonValue, SandboxToolName } from "@nylorun/core/define";
|
|
6
|
-
import { type SessionModelChoice, type SessionItemsResponse, type SessionSummary, type SubjectScope, type MessageDelivery, type MessagePart, type SessionCommand } from "@nylorun/core/contracts";
|
|
6
|
+
import { type SessionModelChoice, type SessionModelRecord, 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
9
|
import { AgentInstancesClient } from "./agents.js";
|
|
@@ -22,6 +22,13 @@ export interface SessionView {
|
|
|
22
22
|
status: string;
|
|
23
23
|
activeTurnId: string | null;
|
|
24
24
|
waits?: unknown;
|
|
25
|
+
/**
|
|
26
|
+
* The model the session's turns call and why: `source` `manifest` (its Agent's version's
|
|
27
|
+
* `harness.model`), `session` (its own, `setModel`) or `tenant`, with `reason` and `requested`
|
|
28
|
+
* when it falls back to the Tenant's. Null for a flow and while the Tenant has no model; absent
|
|
29
|
+
* from an older Runtime. Each change is a `session.model` event.
|
|
30
|
+
*/
|
|
31
|
+
model?: SessionModelRecord | null;
|
|
25
32
|
[key: string]: unknown;
|
|
26
33
|
}
|
|
27
34
|
/** `AgentsClient.createSession`'s options. */
|
|
@@ -92,10 +99,15 @@ export type CommandOptions = {
|
|
|
92
99
|
/**
|
|
93
100
|
* A message's options. `delivery` says what a message to a busy session does (protocol 17):
|
|
94
101
|
* `queue` (the default) waits for the running turn to end, `reject` is refused with
|
|
95
|
-
* `409 session_busy`.
|
|
102
|
+
* `409 session_busy`. `removeTools` names the tools the message's turn may not use (Host feature
|
|
103
|
+
* `remove-tools`): a declared tool or an agent used as a tool by its name (in the agent and in
|
|
104
|
+
* the agents it uses as tools), an MCP server's tool as `<server>__<tool>`, a whole MCP server by
|
|
105
|
+
* its name. It applies to the version the turn runs, so the session still moves to its Agent's
|
|
106
|
+
* new versions; names that version does not have are ignored.
|
|
96
107
|
*/
|
|
97
108
|
export type MessageOptions = CommandOptions & {
|
|
98
109
|
delivery?: MessageDelivery;
|
|
110
|
+
removeTools?: readonly string[];
|
|
99
111
|
};
|
|
100
112
|
export declare class SessionClient {
|
|
101
113
|
private readonly transport;
|
|
@@ -152,6 +164,8 @@ export declare class SessionClient {
|
|
|
152
164
|
cursor: string | null;
|
|
153
165
|
requestId: string;
|
|
154
166
|
}>;
|
|
167
|
+
/** A message's `removeTools`, when it names any; a Runtime without `remove-tools` refuses it. */
|
|
168
|
+
private removeToolsOf;
|
|
155
169
|
/** Approve (or deny) a held tool call. Without an idempotency key, a new one is made. */
|
|
156
170
|
approve(interactionId: string, approved: boolean, options?: Partial<CommandOptions>): Promise<{
|
|
157
171
|
status: "accepted";
|
|
@@ -492,7 +506,7 @@ export type { Destination, IncompatibleReason } from "./http.js";
|
|
|
492
506
|
export type { LiveEvent } from "@nylorun/core/contracts";
|
|
493
507
|
export { AccessClient } from "./access.js";
|
|
494
508
|
export { AgentInstancesClient, AgentMemoriesClient, AgentSecretsClient, runtimeFiles } from "./agents.js";
|
|
495
|
-
export type { AgentFilter, AgentInput, AgentSecretInput, RuntimeFileBytes } from "./agents.js";
|
|
509
|
+
export type { AgentFilter, AgentInput, AgentSecretInput, AgentSecretRouting, RuntimeFileBytes } from "./agents.js";
|
|
496
510
|
export { AgentManifestsClient, ManifestGapsError, agentManifest, requirementGaps } from "./agent-manifests.js";
|
|
497
511
|
export { AGENT_FOLDER_FILE, FolderError, FolderInvalidError, diagnosticLine } from "./folder.js";
|
|
498
512
|
export type { PackedFolder } from "./folder.js";
|
package/dist/session-client.js
CHANGED
|
@@ -143,12 +143,13 @@ export class SessionClient {
|
|
|
143
143
|
* Start a turn. Strings become `message.content`; any other JSON value becomes
|
|
144
144
|
* `message.data` (workflows.md §5).
|
|
145
145
|
*/
|
|
146
|
-
input(value, options) {
|
|
146
|
+
async input(value, options) {
|
|
147
147
|
const base = {
|
|
148
148
|
type: "message",
|
|
149
149
|
requestId: options.requestId ?? id(),
|
|
150
150
|
idempotencyKey: options.idempotencyKey,
|
|
151
151
|
...(options.delivery ? { delivery: options.delivery } : {}),
|
|
152
|
+
...(await this.removeToolsOf(options)),
|
|
152
153
|
};
|
|
153
154
|
return this.command(typeof value === "string"
|
|
154
155
|
? { ...base, content: value }
|
|
@@ -159,15 +160,23 @@ export class SessionClient {
|
|
|
159
160
|
* it with `client.artifacts.upload`), at a version or its latest, and the model reads it, an
|
|
160
161
|
* image as an image and a text file as text.
|
|
161
162
|
*/
|
|
162
|
-
inputParts(parts, options) {
|
|
163
|
+
async inputParts(parts, options) {
|
|
163
164
|
return this.command({
|
|
164
165
|
type: "message",
|
|
165
166
|
requestId: options.requestId ?? id(),
|
|
166
167
|
idempotencyKey: options.idempotencyKey,
|
|
167
168
|
parts: [...parts],
|
|
168
169
|
...(options.delivery ? { delivery: options.delivery } : {}),
|
|
170
|
+
...(await this.removeToolsOf(options)),
|
|
169
171
|
}, options.signal);
|
|
170
172
|
}
|
|
173
|
+
/** A message's `removeTools`, when it names any; a Runtime without `remove-tools` refuses it. */
|
|
174
|
+
async removeToolsOf(options) {
|
|
175
|
+
if (!options.removeTools?.length)
|
|
176
|
+
return {};
|
|
177
|
+
await this.transport.requireFeature("remove-tools", options.signal);
|
|
178
|
+
return { removeTools: [...options.removeTools] };
|
|
179
|
+
}
|
|
171
180
|
/** Approve (or deny) a held tool call. Without an idempotency key, a new one is made. */
|
|
172
181
|
approve(interactionId, approved, options = {}) {
|
|
173
182
|
return this.command({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylorun/agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0-beta",
|
|
4
4
|
"description": "Nylorun agent definitions and session client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test": "vitest run --passWithNoTests"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@nylorun/core": "0.
|
|
46
|
+
"@nylorun/core": "0.34.0-beta",
|
|
47
47
|
"gray-matter": "^4.0.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|