@nylorun/admin 0.15.0-beta → 0.16.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 +41 -0
- package/README.md +37 -33
- package/dist/index.d.ts +2 -2
- package/dist/management.d.ts +21 -24
- package/dist/management.js +18 -19
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.16.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
- `@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.
|
|
12
|
+
- `@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`.
|
|
13
|
+
- `@nylorun/harness`: the Harness API claims `environment.state` and `environment.exec`, and its workspace fields name `environmentId`.
|
|
14
|
+
- `@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`.
|
|
15
|
+
- `@nylorun/admin`: `admin.coverage({ agentId, environmentId })` replaces `admin.vaults`; `admin.mcp.preview({ url, environmentId })`.
|
|
16
|
+
- `@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.
|
|
17
|
+
- `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.
|
|
18
|
+
|
|
19
|
+
- 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.
|
|
20
|
+
|
|
21
|
+
- **`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.
|
|
22
|
+
- **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.
|
|
23
|
+
- **`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.
|
|
24
|
+
- `@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**.
|
|
25
|
+
- Migration: move each `approval: "always"` to an `ask` rule (see MIGRATION.md).
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Pin core to the tested release.
|
|
30
|
+
- Updated dependencies [17a97e9]
|
|
31
|
+
- Updated dependencies [b6214d9]
|
|
32
|
+
- Updated dependencies [e917bd6]
|
|
33
|
+
- Updated dependencies [5165451]
|
|
34
|
+
- Updated dependencies [35e29b7]
|
|
35
|
+
- Updated dependencies [e917bd6]
|
|
36
|
+
- Updated dependencies [a0cbca1]
|
|
37
|
+
- Updated dependencies [3013501]
|
|
38
|
+
- Updated dependencies [6061a3a]
|
|
39
|
+
- Updated dependencies [7d496e4]
|
|
40
|
+
- Updated dependencies [81c783e]
|
|
41
|
+
- Updated dependencies [7800358]
|
|
42
|
+
- @nylorun/core@0.20.0-beta
|
|
43
|
+
|
|
3
44
|
## 0.15.0-beta
|
|
4
45
|
|
|
5
46
|
### 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,
|
|
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](
|
|
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](
|
|
57
|
+
([SELF_HOSTING.md](../../guides/SELF_HOSTING.md#keys)). No API call creates one.
|
|
58
58
|
|
|
59
59
|
## The groups
|
|
60
60
|
|
|
@@ -63,8 +63,9 @@ Management keys are issued on the Tenant's machine only:
|
|
|
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
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.
|
|
67
|
-
| `admin.mcp` | `preview({ url, type?, name?,
|
|
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
|
-
|
|
87
|
-
|
|
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
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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",
|
|
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
|
|
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,
|
|
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`, `
|
|
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;
|
package/dist/management.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CredentialCoverage, type CredentialCoverageRequest, 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 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,
|
|
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. */
|
|
@@ -58,29 +58,11 @@ export interface ManagementModels {
|
|
|
58
58
|
put(request: Body<PutModelBudgetsRequest>): Promise<ModelBudgets>;
|
|
59
59
|
};
|
|
60
60
|
}
|
|
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
61
|
export interface ManagementMcp {
|
|
81
62
|
/**
|
|
82
63
|
* A remote MCP server's tools before an agent names it (R2b C12): the Runtime connects with
|
|
83
|
-
* the
|
|
64
|
+
* the credential for `url` in the vault of `environmentId` (none without one), lists the
|
|
65
|
+
* tools and closes; it never calls
|
|
84
66
|
* one. Each tool has the name the model would call it, made with `name` (default: from the
|
|
85
67
|
* URL's host). A server that needs a person's sign-in answers `authRequired`, with its
|
|
86
68
|
* protected-resource metadata. A server that cannot be listed rejects with
|
|
@@ -103,7 +85,8 @@ export interface ManagementSigningKeys {
|
|
|
103
85
|
export interface ManagementSettings {
|
|
104
86
|
readonly sandbox: {
|
|
105
87
|
get(): Promise<TenantSandboxView>;
|
|
106
|
-
|
|
88
|
+
/** The Tenant's Environment settings: limits, the pods' stop grace and placement. */
|
|
89
|
+
put(request: Body<PutTenantEnvironmentsRequest>): Promise<TenantSandboxView>;
|
|
107
90
|
};
|
|
108
91
|
readonly artifacts: {
|
|
109
92
|
get(): Promise<TenantArtifactsView>;
|
|
@@ -117,8 +100,22 @@ export declare class ManagementClient {
|
|
|
117
100
|
readonly tenant: ManagementTenant;
|
|
118
101
|
readonly keys: ManagementKeys;
|
|
119
102
|
readonly models: ManagementModels;
|
|
120
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Which secret of Environment `environmentId` each remote MCP server and HTTP tool of the
|
|
105
|
+
* saved agent `agentId` would get in a session that names it (`covered`), or none
|
|
106
|
+
* (`missing`). Host feature `credential-coverage`.
|
|
107
|
+
*/
|
|
108
|
+
readonly coverage: (request: Body<CredentialCoverageRequest>) => Promise<CredentialCoverage>;
|
|
121
109
|
readonly mcp: ManagementMcp;
|
|
110
|
+
/**
|
|
111
|
+
* The rules the Tool Gate applies to every MCP and HTTP tool call (R5 step 2): `deny` refuses
|
|
112
|
+
* a call, `ask` holds it until a person approves it on the session, `allow` runs it.
|
|
113
|
+
*/
|
|
114
|
+
readonly toolPolicy: {
|
|
115
|
+
get(): Promise<ToolPolicy>;
|
|
116
|
+
/** Replaces every rule; an empty list allows every call. */
|
|
117
|
+
put(request: Body<PutToolPolicyRequest>): Promise<ToolPolicy>;
|
|
118
|
+
};
|
|
122
119
|
readonly signingKeys: ManagementSigningKeys;
|
|
123
120
|
readonly settings: ManagementSettings;
|
|
124
121
|
constructor(options: ManagementClientOptions);
|
package/dist/management.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The Management API client (`/v1/tenant/*`, protocol 8): the Tenant's settings, models,
|
|
3
|
-
*
|
|
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
|
-
|
|
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;
|
|
@@ -67,23 +79,10 @@ export class ManagementClient {
|
|
|
67
79
|
put: (request) => call("PUT", "/v1/tenant/budgets", withId(request)),
|
|
68
80
|
},
|
|
69
81
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
},
|
|
82
|
+
this.coverage = (request) => call("POST", "/v1/tenant/credential-coverage", withId(request));
|
|
83
|
+
this.toolPolicy = {
|
|
84
|
+
get: () => call("GET", "/v1/tenant/tool-policy"),
|
|
85
|
+
put: (request) => call("PUT", "/v1/tenant/tool-policy", withId(request)),
|
|
87
86
|
};
|
|
88
87
|
this.mcp = {
|
|
89
88
|
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.
|
|
3
|
+
"version": "0.16.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.
|
|
31
|
+
"@nylorun/core": "0.20.0-beta"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"zod": "^4.6.5"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^
|
|
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",
|