@nylorun/admin 0.15.0-beta → 0.17.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 CHANGED
@@ -1,5 +1,87 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.0-beta
4
+
5
+ ### Minor Changes
6
+
7
+ - c96b9a8: **An agent manifest is flat: manifest v7, a `runtime` block the Runtime writes, and tools known by name (protocol 13, Harness API 3).** A manifest listed capabilities, each with its own instructions, tools, skills and servers, and the Runtime added its own as more capabilities. Now the agent's parts sit at the top level, a plugin's skills and servers say which plugin brought them, and what the Runtime adds to a session's agent is one `runtime` block. A fresh start: the Runtime speaks protocol 13 only, so save your agents again; sessions from protocol 12 do not carry over. See MIGRATION.md.
8
+
9
+ - **Manifest v7.** `{ manifestSchemaVersion: 7, id, name?, description?, metadata?, outputSchema?, instructions?, tools?, skills?, mcpServers?, runtime? }`. Versions 3 to 6 and a `capabilities` field are refused with a message to rebuild. `SkillManifest.plugin` and `McpServerManifest.plugin` are `{ name, version? }`, set by `.plugin(dir)` from `plugin.json`.
10
+ - **The `runtime` block.** `{ sandbox?, tools?, instructions? }`, written only by the Runtime when a session pins the agent: the sandbox spec and tools, `save_artifact`, `read_artifact`, `load_skill` and `read_skill_resource`, the skill catalog and the notes that go with them. A definition or a turn variant that sets it is refused. `runtimeManifestFor` in `@nylorun/core/define` replaces `sandboxCapabilityManifest`, `artifactsCapabilityManifest` and `toolsCapabilityManifest`. `.skills()` and `.plugin()` no longer add the skill tools or the catalog.
11
+ - **Names.** An agent's tool may not take a Runtime tool's name (`RUNTIME_TOOL_NAMES`) or contain `__`, and names are unique across tools, skills and servers.
12
+ - **Turn variants** may remove tools, tighten MCP servers and change instructions, name, description and metadata. Skills are fixed, and a variant never sets `runtime` or changes `outputSchema`.
13
+ - **Tools by name.** `capabilityId` is gone from `tool.completed`, `mcp.discovered`, tool call rows, `EffectIntent`, gate requests, checkpoints and `SessionToolRef`. An HTTP tool's `server` is its URL's host. `Implementations` is `{ tools }`, keyed by tool name (`Agent.from(json, { tools })`), `AgentBinding.declarations` is `parts`, and observe events say `partId`.
14
+ - **Harness API 3.** `hello.capabilities` is `features`, and the `harness` pseudo-capability is gone: a native tool is known by its name, and one whose name is taken fails the turn at its start. `createHarness({ features })` in `@nylorun/harness`. `examples/harness-minimal` speaks it.
15
+ - **Studio.** The Agent tab shows instructions, tools (HTTP and agent badges), skills and MCP servers, each skill and server with its plugin's badge and a filter by plugin, and a session's Runtime section: its sandbox, tools and instructions.
16
+ - `@nylorun/core`: `PROTOCOL_VERSION` 13, `HOST_PROTOCOL` `{ min: 13, max: 13 }`, required feature `flat-manifest`, `HARNESS_API_VERSION` 3; `PluginLabel`, `RuntimeManifest`, `RUNTIME_TOOL_NAMES`, `isRuntimeToolName`, `runtimeToolOf`, `isSkillTool`, `SKILLS_USAGE` and `formatSkillCatalog` in `/define`.
17
+ - `@nylorun/agents`, `@nylorun/admin`, `@nylorun/studio` and `nylorun` send protocol 13.
18
+
19
+ - 94bf329: **Each model says what it reads, a file it does not read is refused before a turn starts, and a file is an artifact the model reads again after its turn (protocol 12).** A message could name any file, and a model that could not read it failed the turn at its model call; every later turn sent the file's bytes again. Now the Runtime knows what the Tenant's model reads, checks a message's files when it is accepted, and sends a file's bytes only in the turn that brought it. Protocol 12 only adds to 11: the Runtime serves both.
20
+
21
+ - **Model inputs.** A model reads `text`, and `image`, `pdf`, `office`, `audio` or `video` when its catalog says so or the operator adds it where its API carries it natively (images everywhere; PDFs on the Anthropic, OpenAI, Azure and Google APIs; Office documents on the OpenAI Responses APIs; audio and video on Google's APIs and OpenAI-compatible completions). `GET /v1/tenant/models` gives each model `inputs` and `addableInputs`, `GET /v1/tenant/providers` each provider's `inputs`, and **`PUT /v1/tenant/models/inputs`** (the Management API; `admin.models.setInputs({ provider, model, inputs })`) sets the added ones, kept in the Tenant setting `model.inputs`. The Model Gate gives the provider adapter a model with an added image, so it is sent.
22
+ - **A custom endpoint reads text only by default.** It used to be sent images. Set `settings.inputs` on `PUT /v1/tenant/model` (`image`, `pdf`, `audio`, `video`) for what yours reads; `office` is refused there. See MIGRATION.md.
23
+ - **The accept check.** A message naming a file of a type the Tenant's model does not read is `422 attachment_unsupported`, with `details.parts` (`artifactId`, `name`, `mediaType`, `reason`), and no turn starts. Only the type is checked, never the size. Without a model in the vault nothing is refused.
24
+ - **Files as artifacts.** After its turn a file is a reference line, `[Uploaded artifact "name" · <artifactId> v<n> · read_artifact to view]` (a tool's: `[Tool <name> returned artifact …]`). Our harness sends the turn's own files once more, as media, in one user message after the conversation, so a message reads the same in every later call. At the gate, an image the model reads is an image, a text file a `<file>` block, and any other file, or one that cannot be read, a note: no file fails a call. PDFs, Office documents, audio and video are notes until the gate sends them natively.
25
+ - **`read_artifact` for every agent.** Every agent's session has it (an agent that declares its own keeps it), so every agent session pins its definition with it added. It takes a `version`, reads the Tenant-wide artifacts the session's messages named, and shows any file the Tenant's model reads; one it does not read fails `artifact.unsupported`.
26
+ - **Compaction** keeps the summarized part's reference lines (`files` on the compaction entry), and counts the turn's files by type and size in its token estimate.
27
+ - `@nylorun/core`: `PROTOCOL_VERSION` 12, required feature `model-inputs`, `HOST_PROTOCOL` `{ min: 11, max: 12 }`, error code `attachment_unsupported`; `MODEL_INPUTS`, `ModelInputSchema`, `PutModelInputsRequestSchema`, `ModelInputsViewSchema`, `CustomModelSettings.inputs`; `mediaReferenceLine` and `mediaReferenceOf` in `/define`; `TranscriptCompactionEntry.files`.
28
+ - `@nylorun/agents`, `@nylorun/studio` and `nylorun` send protocol 12.
29
+
30
+ ### Patch Changes
31
+
32
+ - Pin core to the tested release.
33
+ - Updated dependencies [3a32a57]
34
+ - Updated dependencies [af90d1e]
35
+ - Updated dependencies [104f24f]
36
+ - Updated dependencies [c96b9a8]
37
+ - Updated dependencies [94bf329]
38
+ - Updated dependencies [b5ea2b5]
39
+ - Updated dependencies [aff9bb8]
40
+ - Updated dependencies [f44c018]
41
+ - Updated dependencies [c8e640b]
42
+ - @nylorun/core@0.21.0-beta
43
+
44
+ ## 0.16.0-beta
45
+
46
+ ### Minor Changes
47
+
48
+ - 35e29b7: **Environments replace sandboxes and vaults (protocol 11). This is a fresh start: upgrading deletes your sandboxes, their disks and every vault except the model's, and closes every open session (its history stays readable).** List what you have before upgrading; see "Environments replace sandboxes and vaults" in MIGRATION.md.
49
+
50
+ An Environment is where sessions run: one sandbox (kind `virtual`, `pod` or `none`) with a recipe that can change, and one vault of secrets for its shell, MCP servers and HTTP tools. The app decides who uses which Environment; the Runtime keeps it by id and holds its lifecycle.
51
+
52
+ - `@nylorun/core`: protocol 11 (the Host accepts 11 only; older clients get `426`), required feature `environments`. `PutEnvironmentRequestSchema`, `EnvironmentViewSchema` (`recipe`, `version`, `appliedVersion`, `ownerUserId`, `lastUsedAt`), `PutEnvironmentSecretRequestSchema`, `EnvironmentSecretViewSchema`, `ENVIRONMENT_EVENT_TYPES`, `TenantEnvironmentsConfigSchema`, `environmentGranted`. `PutSessionRequest.environment` replaces `sandbox`, `vaultIds` and `credentialSelections`; `SessionView.environment` replaces the session's sandbox and vault fields. Error codes `environment_busy`, `environment_unavailable`, `environment_lost`, `environment_not_granted`, `environment_owner_mismatch` and `session_closed` (the `sandbox_*` codes and `sandbox_expired` are gone); session events `environment.state`, `environment.exec` and `environment.attached`; scope `environments:write`. Credential coverage takes `environmentId` and answers `covered` or `missing`; the MCP preview takes `environmentId`. The vault Management schemas are removed.
53
+ - `@nylorun/runtime`: `/v1/environments/{id}` replaces `/v1/sandboxes/{id}`: `PUT` creates, finds or changes one (`kind` and `storage` fixed; a recipe change bumps `version`; a pod gets a new image or resources at its next start from stopped, a new allowlist within seconds), with list by label, events (`nylorun.environment-event/1`), stop, reset and delete. Each Environment owns one vault: `PUT|GET|DELETE /v1/environments/{id}/secrets/{name}` on the Runtime API, write-only, with a second credential for a host or URL refused at the write (`409 credential_conflict`). An optional owner guard (`ownerUserId`) is checked when a session opens and at every turn start. `lifecycle.deleteAfter` deletes an Environment unused that long; TTL and `onExpiry` are gone. Kind `none` holds secrets for MCP-only agents. `/v1/tenant/vaults`, user and installation vaults, the Tenant's default sandbox, inline sandboxes and `{ session }` sharing are removed. The Tenant setting is `environments.config` (`limits.environments`). Identity files grant `environments:` (an old `sandboxes:` key, or `sandboxes:write`, stops the Runtime with a message naming the new key). Migration `0020_environments`.
54
+ - `@nylorun/harness`: the Harness API claims `environment.state` and `environment.exec`, and its workspace fields name `environmentId`.
55
+ - `@nylorun/agents`: `client.environments` (`put`, `get`, `list`, `page`, `stop`, `reset`, `delete`, `events`, `secrets.put|list|get|delete`, `forSession`) replaces `client.sandboxes`; `createSession({ environment })`; `sessions.page({ environmentId })` filters by Environment. The AG-UI handler's session options take `environment`.
56
+ - `@nylorun/admin`: `admin.coverage({ agentId, environmentId })` replaces `admin.vaults`; `admin.mcp.preview({ url, environmentId })`.
57
+ - `@nylorun/studio`: Environments replace Sandboxes, with a create form, stop, reset, delete and their secrets; the Credentials forms write an Environment's secrets; New session picks an Environment and shows its coverage.
58
+ - `nylorun`: `nylorun sandbox ls|rm` list and delete Environments; `nylorun mcp inspect --environment <id>` replaces `--vault`; `nylo reset --environments` replaces `--sandboxes`; `nylo doctor sandbox` reports the Environment limits.
59
+
60
+ - 6061a3a: **Tool approvals are the Tenant's tool policy (R5 step 2).** An agent's manifest used to say which tool calls wait for a person, and only the Runtime's own harness asked; a harness built from the Harness API could skip it. Now the operator sets one tool policy for every agent and every harness, and the Runtime enforces it before anything is sent.
61
+
62
+ - **`GET`/`PUT /v1/tenant/tool-policy`** (the Management API; `admin.toolPolicy.get()`/`.put({ rules })`): rules `{ effect: "allow" | "ask" | "deny", tool?, server?, kind?, agent?, when?, reason? }`. A rule matches a call when every selector it sets matches (`tool` and `server` take `*` globs; `when` tests input fields by dotted path with `equals`, `in`, `gt`, `gte`, `lt`, `lte` or `matches`). The strictest matching rule decides; a call no rule matches runs.
63
+ - **Enforced for every harness.** Core decides an MCP or HTTP tool call as it journals it. `deny` fails it to the model as `tool.denied`, unsent. `ask` holds the call (`held` at `/calls/tool`) and pauses the turn with one `approval` interaction per held call (`turn.paused`, with the tool, its input and the reason). `approve` sends that exact call, or fails it as `tool.denied`. The Tool Gate runs only calls the journal holds running, so a held or refused call cannot run. Nothing holds a process while it waits: an approval survives a restart. A flow's HTTP stages are decided the same way.
64
+ - **`approval` leaves the manifest.** `PUT /v1/agents/:id` and `saveAgent()` refuse a definition that sets `approval` on an HTTP tool, an MCP server or an MCP tool's settings; `http({ approval })` and `.mcp({ … approval })` throw; a turn manifest can no longer add one. The engine never asks for an HTTP or MCP tool's approval itself. A session pinned to a manifest saved with `approval: "always"` keeps it, as an ask.
65
+ - `@nylorun/studio`: a paused session shows an approval card for each held call, with its tool, why it is held and its input, and **Approve** / **Deny**.
66
+ - Migration: move each `approval: "always"` to an `ask` rule (see MIGRATION.md).
67
+
68
+ ### Patch Changes
69
+
70
+ - Pin core to the tested release.
71
+ - Updated dependencies [17a97e9]
72
+ - Updated dependencies [b6214d9]
73
+ - Updated dependencies [e917bd6]
74
+ - Updated dependencies [5165451]
75
+ - Updated dependencies [35e29b7]
76
+ - Updated dependencies [e917bd6]
77
+ - Updated dependencies [a0cbca1]
78
+ - Updated dependencies [3013501]
79
+ - Updated dependencies [6061a3a]
80
+ - Updated dependencies [7d496e4]
81
+ - Updated dependencies [81c783e]
82
+ - Updated dependencies [7800358]
83
+ - @nylorun/core@0.20.0-beta
84
+
3
85
  ## 0.15.0-beta
4
86
 
5
87
  ### Major Changes
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @nylorun/admin
2
2
 
3
3
  The Management API client (protocol 8): the Tenant's status, seed and reset, its
4
- models, vaults, MCP server previews, signing keys, settings and application keys, through
4
+ models, credential coverage, MCP server previews, signing keys, settings and application keys, through
5
5
  `/v1/tenant/*` with a **management key**. It also holds the two helpers over the
6
6
  admin key that Studio needs. Depends only on `@nylorun/core`.
7
- Requires Node 24+. Vocabulary: [runtime/src/CONTEXT.md](../runtime/src/CONTEXT.md).
7
+ Requires Node 24+. Vocabulary: [runtime/server/src/CONTEXT.md](../../runtime/server/src/CONTEXT.md).
8
8
 
9
9
  Developer applications do **not** depend on this package: they use the Runtime
10
10
  API through `@nylorun/agents`. Operators' clients do: the CLI, Studio, CI and
@@ -54,7 +54,7 @@ Host's `/health` and throws `incompatible_host` unless the Host serves protocol
54
54
  Management keys are issued on the Tenant's machine only:
55
55
  `npx nylorun key put <id> --management` on a local Tenant, or
56
56
  `nylorun-operate keys put <id> --role management` inside the runtime container
57
- ([SELF_HOSTING.md](../SELF_HOSTING.md#keys)). No API call creates one.
57
+ ([SELF_HOSTING.md](../../guides/SELF_HOSTING.md#keys)). No API call creates one.
58
58
 
59
59
  ## The groups
60
60
 
@@ -62,9 +62,10 @@ Management keys are issued on the Tenant's machine only:
62
62
  | --- | --- | --- |
63
63
  | `admin.tenant` | `status()`, `seed(request)`, `reset(request)` | `GET /v1/tenant`, `PUT /v1/tenant/config/seed`, `POST /v1/tenant/reset` |
64
64
  | `admin.keys` | `list()`, `put(id)`, `delete(id)` | `/v1/tenant/keys…` |
65
- | `admin.models` | `catalog()`, `providers()`, `get()`, `put(request)`, `select(request)`, `usage(query)`, `budgets.get()`, `budgets.put(request)` | `/v1/tenant/models`, `/providers`, `/model`, `/model/selection`, `/usage`, `/budgets` |
66
- | `admin.vaults` | `create`, `list(ownerUserId?)`, `get`, `delete`, `credentials.create`, `.list`, `.get`, `.rotate`, `.delete` | `/v1/tenant/vaults…` |
67
- | `admin.mcp` | `preview({ url, type?, name?, vaultId? })` | `POST /v1/tenant/mcp/preview` |
65
+ | `admin.models` | `catalog()`, `providers()`, `get()`, `put(request)`, `select(request)`, `setInputs(request)`, `usage(query)`, `budgets.get()`, `budgets.put(request)` | `/v1/tenant/models`, `/providers`, `/model`, `/model/selection`, `/models/inputs`, `/usage`, `/budgets` |
66
+ | `admin.coverage` | called directly: `admin.coverage({ agentId, environmentId? })` | `POST /v1/tenant/credential-coverage` |
67
+ | `admin.mcp` | `preview({ url, type?, name?, environmentId? })` | `POST /v1/tenant/mcp/preview` |
68
+ | `admin.toolPolicy` | `get()`, `put({ rules })`: which MCP and HTTP tool calls run, wait for a person (`ask`) or are refused (`deny`) | `/v1/tenant/tool-policy` |
68
69
  | `admin.signingKeys` | `list()`, `rotate({ force? })`, `revoke(kid)` | `/v1/tenant/signing-keys…` |
69
70
  | `admin.settings` | `sandbox.get()`, `sandbox.put(request)`, `artifacts.get()`, `artifacts.put(request)` | `/v1/tenant/sandbox`, `/v1/tenant/artifacts` |
70
71
 
@@ -83,49 +84,52 @@ await admin.keys.list(); // [{ id, role, createdAt }]
83
84
  await admin.keys.delete("backend"); // true when it existed
84
85
  ```
85
86
 
86
- Installation vaults hold the installation's shared credentials. A session
87
- attaches them by id (`vaultIds`) through the Runtime API:
87
+ Credentials for MCP servers, HTTP tools and skills are not the Management
88
+ API's: each Environment has one vault, whose secrets the app writes on the
89
+ Runtime API (`client.environments.secrets.put` in
90
+ [`@nylorun/agents`](../agents/README.md), `PUT /v1/environments/{id}/secrets/{name}`)
91
+ and never reads back. See "MCP servers and HTTP tools" in
92
+ [DEPLOYMENT.md](../../guides/DEPLOYMENT.md#mcp-servers-and-http-tools), with
93
+ gateway recipes.
94
+
95
+ `admin.coverage` says what a session of a saved agent would send for each of
96
+ its MCP servers and HTTP tool credentials in the Environment it will name,
97
+ before any session starts: `covered` (with the secret's Environment, name and
98
+ `via`) or `missing`. Without `environmentId` every entry is `missing`. It reads
99
+ no secret and calls no server (Host feature `credential-coverage`).
88
100
 
89
101
  ```ts
90
- const vault = await admin.vaults.create({ scope: "installation", name: "tools", idempotencyKey: "tools" });
91
- await admin.vaults.credentials.create(vault.id, {
92
- name: "linear",
93
- idempotencyKey: "linear",
94
- auth: { type: "bearer", url: "https://mcp.linear.app/mcp", token: process.env.LINEAR_TOKEN! },
95
- });
102
+ const coverage = await admin.coverage({ agentId: "triage", environmentId: "projects/acme" });
103
+ if (!coverage.complete)
104
+ for (const entry of coverage.entries) if (entry.status !== "covered") console.log(entry.name, entry.message);
96
105
  ```
97
106
 
98
- A credential is bound to the URL an agent names: a `bearer` token, or a
99
- `headers` map (`{ type: "headers", url, headers: { "x-api-key": … } }`). Either
100
- may add `via`, where the requests go instead (an MCP gateway), and
101
- `identity: { header }`, which carries the session owner's subject. A person's
102
- own keys go in their vault (`admin.vaults.create({ name, ownerUserId })`).
103
- Listing and getting a credential return its header names, `via` and identity
104
- header, never a value; `credentials.rotate` replaces the token or the map. See
105
- "MCP servers and HTTP tools" in
106
- [DEPLOYMENT.md](../DEPLOYMENT.md#mcp-servers-and-http-tools), with gateway
107
- recipes.
108
-
109
- `admin.mcp.preview` shows what that server offers with that credential, before
110
- an agent names it: the Runtime connects, lists the tools within 15 s and calls
111
- none. Each tool has the name the model would call it (made with `name`,
112
- default from the URL's host), its annotations and its input schema's size. A
113
- server that answers `401` comes back with `authRequired` and its RFC 9728
114
- protected-resource metadata; one that cannot be listed rejects with
115
- `mcp_preview_failed` (`details.failure`).
107
+ `admin.mcp.preview` shows what a server offers with an Environment's credential
108
+ for its URL (none without `environmentId`), before an agent names it: the
109
+ Runtime connects, lists the tools within 15 s and calls none. Each tool has the
110
+ name the model would call it (made with `name`, default from the URL's host),
111
+ its annotations and its input schema's size. A server that answers `401` comes
112
+ back with `authRequired` and its RFC 9728 protected-resource metadata; one that
113
+ cannot be listed rejects with `mcp_preview_failed` (`details.failure`).
116
114
 
117
115
  ```ts
118
- const preview = await admin.mcp.preview({ url: "https://mcp.linear.app/mcp", name: "linear", vaultId: vault.id });
116
+ const preview = await admin.mcp.preview({ url: "https://mcp.linear.app/mcp", name: "linear", environmentId: "projects/acme" });
119
117
  for (const tool of preview.tools) console.log(tool.modelName, tool.schemaBytes);
120
118
  if (preview.authRequired) console.log("needs a sign-in:", preview.authRequired.resourceMetadata);
121
119
  ```
122
120
 
121
+ `admin.settings.sandbox` reads and replaces the Tenant's Environment settings
122
+ (Tenant setting `environments.config`): `limits` (`network`, `resources`,
123
+ `defaultResources`, `idle`, `environments`), the pods' `lifecycle.stopGrace` and
124
+ `placement`. `admin.tenant.reset({ scope })` takes `sessions`, `environments`
125
+ or `all`.
126
+
123
127
  ## In a browser
124
128
 
125
129
  `@nylorun/admin/client` exports `createManagementClient({ url, key?, fetch?,
126
130
  headers? })` and `ManagementClient`, with the same groups and no Node module.
127
131
  It is for a browser app behind its own server that adds the management key, as
128
- Studio's Credentials page is: omit `key`, and point `url` at that server. Never
132
+ Studio is: omit `key`, and point `url` at that server. Never
129
133
  send a management key from a browser: the Runtime refuses any key sent with an
130
134
  `Origin` (`403 origin_rejected`).
131
135
 
package/dist/index.d.ts CHANGED
@@ -8,10 +8,10 @@ export type { ErrorCode };
8
8
  export { AdminError };
9
9
  export { deriveStudioToken, tenantHostRoot };
10
10
  export { mintStudioLoginToken } from "./studio-login.js";
11
- export { ManagementClient, createManagementClient, type ManagementClientOptions, type ManagementKeys, type ManagementMcp, type ManagementModels, type ManagementSettings, type ManagementSigningKeys, type ManagementTenant, type ManagementVaults, } from "./management.js";
11
+ export { ManagementClient, createManagementClient, type ManagementClientOptions, type ManagementKeys, type ManagementMcp, type ManagementModels, type ManagementSettings, type ManagementSigningKeys, type ManagementTenant, } from "./management.js";
12
12
  /**
13
13
  * The Management API client for the installation (`/v1/tenant/*`): `tenant`, `keys`
14
- * (application keys), `models`, `vaults`, `mcp`, `signingKeys` and `settings`, with a management key.
14
+ * (application keys), `models`, `coverage`, `mcp`, `signingKeys` and `settings`, with a management key.
15
15
  * `source` says where the connection came from.
16
16
  */
17
17
  export type Admin = AdminClient;
@@ -1,4 +1,4 @@
1
- import { type CreateCredentialRequest, type CreateVaultRequest, type CredentialInfo, type HostModelCatalog, type HostModelView, type ListProvidersResponse, type McpPreview, type McpPreviewRequest, type ModelCallExportPage, type ModelBudgets, type ModelUsageQuery, type ModelUsageTotals, type OperatorKey, type PutHostModelRequest, type PutModelBudgetsRequest, type PutOperatorKeyResponse, type PutTenantArtifactsRequest, type PutTenantSandboxRequest, type ResetTenantRequest, type ResetTenantResponse, type RotateCredentialRequest, type SeedTenantConfigRequest, type SeedTenantConfigResponse, type SelectHostModelRequest, type SigningKeyView, type TenantArtifactsView, type TenantSandboxView, type TenantStatus, type VaultInfo } from "@nylorun/core/contracts";
1
+ import { type CredentialCoverage, type CredentialCoverageRequest, type HostModelCatalog, type HostModelView, type ListProvidersResponse, type McpPreview, type McpPreviewRequest, type ModelCallExportPage, type ModelBudgets, type ModelInputsView, type ModelUsageQuery, type ModelUsageTotals, type OperatorKey, type PutHostModelRequest, type PutModelBudgetsRequest, type PutModelInputsRequest, type PutToolPolicyRequest, type PutOperatorKeyResponse, type PutTenantArtifactsRequest, type PutTenantEnvironmentsRequest, type ResetTenantRequest, type ResetTenantResponse, type SeedTenantConfigRequest, type SeedTenantConfigResponse, type SelectHostModelRequest, type SigningKeyView, type TenantArtifactsView, type TenantSandboxView, type TenantStatus, type ToolPolicy } from "@nylorun/core/contracts";
2
2
  export interface ManagementClientOptions {
3
3
  /** The Tenant's URL, or a proxy in front of it. */
4
4
  url: string;
@@ -18,7 +18,7 @@ export interface ManagementTenant {
18
18
  status(): Promise<TenantStatus>;
19
19
  /** Seeds the Tenant's configuration where it is unset (`nylorun start` does this). */
20
20
  seed(request: Body<SeedTenantConfigRequest>): Promise<SeedTenantConfigResponse>;
21
- /** Resets the Tenant's sessions, sandboxes or both. */
21
+ /** Resets the Tenant's sessions, Environments or both. */
22
22
  reset(request: Body<ResetTenantRequest>): Promise<ResetTenantResponse>;
23
23
  }
24
24
  /** The Tenant's keys: application keys are managed here; management keys only on its machine. */
@@ -41,6 +41,12 @@ export interface ManagementModels {
41
41
  put(request: Body<PutHostModelRequest>): Promise<HostModelView>;
42
42
  /** Chooses the provider and model among those with credentials. */
43
43
  select(request: Body<SelectHostModelRequest>): Promise<HostModelView>;
44
+ /**
45
+ * Sets what a catalog model reads beyond its catalog's inputs (protocol 12): only inputs in its
46
+ * `addableInputs`; an empty list removes the additions. A custom endpoint sets
47
+ * `settings.inputs` with `put` instead.
48
+ */
49
+ setInputs(request: Body<PutModelInputsRequest>): Promise<ModelInputsView>;
44
50
  /** What the Tenant's model calls used, for one scope and period. */
45
51
  usage(query: ModelUsageQuery): Promise<ModelUsageTotals>;
46
52
  /**
@@ -58,29 +64,11 @@ export interface ManagementModels {
58
64
  put(request: Body<PutModelBudgetsRequest>): Promise<ModelBudgets>;
59
65
  };
60
66
  }
61
- export interface ManagementVaults {
62
- create(request: Body<CreateVaultRequest>): Promise<VaultInfo>;
63
- /** The installation vaults, after `ownerUserId`'s when it is given. */
64
- list(ownerUserId?: string): Promise<VaultInfo[]>;
65
- get(vaultId: string): Promise<VaultInfo>;
66
- delete(vaultId: string): Promise<{
67
- id: string;
68
- }>;
69
- readonly credentials: {
70
- create(vaultId: string, request: Body<CreateCredentialRequest>): Promise<CredentialInfo>;
71
- list(vaultId: string): Promise<CredentialInfo[]>;
72
- get(vaultId: string, credentialId: string): Promise<CredentialInfo>;
73
- /** Rotates the credential's secret. */
74
- rotate(vaultId: string, credentialId: string, request: Body<RotateCredentialRequest>): Promise<CredentialInfo>;
75
- delete(vaultId: string, credentialId: string): Promise<{
76
- id: string;
77
- }>;
78
- };
79
- }
80
67
  export interface ManagementMcp {
81
68
  /**
82
69
  * A remote MCP server's tools before an agent names it (R2b C12): the Runtime connects with
83
- * the installation vault's credential for `url`, lists the tools and closes; it never calls
70
+ * the credential for `url` in the vault of `environmentId` (none without one), lists the
71
+ * tools and closes; it never calls
84
72
  * one. Each tool has the name the model would call it, made with `name` (default: from the
85
73
  * URL's host). A server that needs a person's sign-in answers `authRequired`, with its
86
74
  * protected-resource metadata. A server that cannot be listed rejects with
@@ -103,7 +91,8 @@ export interface ManagementSigningKeys {
103
91
  export interface ManagementSettings {
104
92
  readonly sandbox: {
105
93
  get(): Promise<TenantSandboxView>;
106
- put(request: Body<PutTenantSandboxRequest>): Promise<TenantSandboxView>;
94
+ /** The Tenant's Environment settings: limits, the pods' stop grace and placement. */
95
+ put(request: Body<PutTenantEnvironmentsRequest>): Promise<TenantSandboxView>;
107
96
  };
108
97
  readonly artifacts: {
109
98
  get(): Promise<TenantArtifactsView>;
@@ -117,8 +106,22 @@ export declare class ManagementClient {
117
106
  readonly tenant: ManagementTenant;
118
107
  readonly keys: ManagementKeys;
119
108
  readonly models: ManagementModels;
120
- readonly vaults: ManagementVaults;
109
+ /**
110
+ * Which secret of Environment `environmentId` each remote MCP server and HTTP tool of the
111
+ * saved agent `agentId` would get in a session that names it (`covered`), or none
112
+ * (`missing`). Host feature `credential-coverage`.
113
+ */
114
+ readonly coverage: (request: Body<CredentialCoverageRequest>) => Promise<CredentialCoverage>;
121
115
  readonly mcp: ManagementMcp;
116
+ /**
117
+ * The rules the Tool Gate applies to every MCP and HTTP tool call (R5 step 2): `deny` refuses
118
+ * a call, `ask` holds it until a person approves it on the session, `allow` runs it.
119
+ */
120
+ readonly toolPolicy: {
121
+ get(): Promise<ToolPolicy>;
122
+ /** Replaces every rule; an empty list allows every call. */
123
+ put(request: Body<PutToolPolicyRequest>): Promise<ToolPolicy>;
124
+ };
122
125
  readonly signingKeys: ManagementSigningKeys;
123
126
  readonly settings: ManagementSettings;
124
127
  constructor(options: ManagementClientOptions);
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * The Management API client (`/v1/tenant/*`, protocol 8): the Tenant's settings, models,
3
- * vaults, MCP server previews, signing keys and application keys, with a management key. It imports nothing from
3
+ * credential coverage, MCP server previews, signing keys and application keys, with a
4
+ * management key. An Environment's secrets are written on the Runtime API
5
+ * (`@nylorun/agents`, `client.environments.secrets`). It imports nothing from
4
6
  * Node, so a browser app that reaches the Runtime through its own proxy (Studio) uses it too:
5
7
  * `@nylorun/admin/client`. `createAdmin()` in the package's main entry finds the URL and key.
6
8
  */
@@ -18,8 +20,18 @@ export class ManagementClient {
18
20
  tenant;
19
21
  keys;
20
22
  models;
21
- vaults;
23
+ /**
24
+ * Which secret of Environment `environmentId` each remote MCP server and HTTP tool of the
25
+ * saved agent `agentId` would get in a session that names it (`covered`), or none
26
+ * (`missing`). Host feature `credential-coverage`.
27
+ */
28
+ coverage;
22
29
  mcp;
30
+ /**
31
+ * The rules the Tool Gate applies to every MCP and HTTP tool call (R5 step 2): `deny` refuses
32
+ * a call, `ask` holds it until a person approves it on the session, `allow` runs it.
33
+ */
34
+ toolPolicy;
23
35
  signingKeys;
24
36
  settings;
25
37
  #key;
@@ -57,6 +69,7 @@ export class ManagementClient {
57
69
  get: () => call("GET", "/v1/tenant/model"),
58
70
  put: (request) => call("PUT", "/v1/tenant/model", withId(request)),
59
71
  select: (request) => call("PUT", "/v1/tenant/model/selection", withId(request)),
72
+ setInputs: (request) => call("PUT", "/v1/tenant/models/inputs", withId(request)),
60
73
  usage: (query) => {
61
74
  const search = new URLSearchParams(Object.entries(query).flatMap(([name, value]) => value === undefined ? [] : [[name, String(value)]]));
62
75
  return call("GET", `/v1/tenant/usage?${search}`);
@@ -67,23 +80,10 @@ export class ManagementClient {
67
80
  put: (request) => call("PUT", "/v1/tenant/budgets", withId(request)),
68
81
  },
69
82
  };
70
- const vault = (vaultId) => `/v1/tenant/vaults/${segment(vaultId)}`;
71
- const credential = (vaultId, credentialId) => `${vault(vaultId)}/credentials/${segment(credentialId)}`;
72
- this.vaults = {
73
- create: (request) => call("POST", "/v1/tenant/vaults", withId(request)),
74
- list: async (ownerUserId) => (await call("GET", ownerUserId === undefined
75
- ? "/v1/tenant/vaults"
76
- : `/v1/tenant/vaults?ownerUserId=${segment(ownerUserId)}`)).vaults,
77
- get: (vaultId) => call("GET", vault(vaultId)),
78
- delete: (vaultId) => call("DELETE", vault(vaultId)),
79
- credentials: {
80
- create: (vaultId, request) => call("POST", `${vault(vaultId)}/credentials`, withId(request)),
81
- list: async (vaultId) => (await call("GET", `${vault(vaultId)}/credentials`))
82
- .credentials,
83
- get: (vaultId, credentialId) => call("GET", credential(vaultId, credentialId)),
84
- rotate: (vaultId, credentialId, request) => call("POST", credential(vaultId, credentialId), withId(request)),
85
- delete: (vaultId, credentialId) => call("DELETE", credential(vaultId, credentialId)),
86
- },
83
+ this.coverage = (request) => call("POST", "/v1/tenant/credential-coverage", withId(request));
84
+ this.toolPolicy = {
85
+ get: () => call("GET", "/v1/tenant/tool-policy"),
86
+ put: (request) => call("PUT", "/v1/tenant/tool-policy", withId(request)),
87
87
  };
88
88
  this.mcp = {
89
89
  preview: (request) => call("POST", "/v1/tenant/mcp/preview", request),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nylorun/admin",
3
- "version": "0.15.0-beta",
3
+ "version": "0.17.0-beta",
4
4
  "description": "Nylorun Management API client: the Tenant's models, vaults, signing keys, settings and application keys",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -28,13 +28,13 @@
28
28
  "clean": "node -e \"import('node:fs').then(({rmSync})=>rmSync('dist',{recursive:true,force:true}))\""
29
29
  },
30
30
  "dependencies": {
31
- "@nylorun/core": "0.19.0-beta"
31
+ "@nylorun/core": "0.21.0-beta"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "zod": "^4.6.5"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/node": "^24.0.0",
37
+ "@types/node": "^26.6.4",
38
38
  "typescript": "npm:@typescript/typescript6@^6.0.2",
39
39
  "vitest": "^5.0.2"
40
40
  },
@@ -44,7 +44,7 @@
44
44
  "repository": {
45
45
  "type": "git",
46
46
  "url": "git+https://github.com/nylorun/agents.git",
47
- "directory": "admin"
47
+ "directory": "sdks/admin"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public",