@nylorun/core 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 +69 -0
- package/dist/compatibility.d.ts +40 -14
- package/dist/compatibility.js +38 -12
- package/dist/contracts.d.ts +171 -51
- package/dist/contracts.js +246 -57
- package/dist/define.d.ts +6 -5
- package/dist/define.js +3 -2
- package/dist/definition/assemble.d.ts +3 -1
- package/dist/definition/assemble.js +3 -0
- package/dist/definition/code-tools.d.ts +4 -4
- package/dist/definition/code-tools.js +3 -2
- package/dist/definition/from.d.ts +5 -0
- package/dist/definition/from.js +16 -7
- package/dist/definition/manifest.d.ts +3 -1
- package/dist/definition/manifest.js +4 -1
- package/dist/definition/mcp.d.ts +45 -1
- package/dist/definition/mcp.js +85 -2
- package/dist/definition/removed.d.ts +4 -1
- package/dist/definition/removed.js +5 -2
- package/dist/definition/sandbox-capability.d.ts +21 -4
- package/dist/definition/sandbox-capability.js +56 -19
- package/dist/definition/tools-capability.d.ts +37 -0
- package/dist/definition/tools-capability.js +98 -0
- package/dist/definition/variant.d.ts +2 -1
- package/dist/definition/variant.js +40 -4
- package/dist/harness-api/transcript.d.ts +5 -1
- package/dist/harness-api/transcript.js +6 -2
- package/dist/types/manifest.d.ts +42 -14
- package/dist/types/tool.d.ts +22 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# @nylorun/core
|
|
2
2
|
|
|
3
|
+
## 0.17.0-beta
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 50e2f7e: **Protocol 10: MCP credentials come from a session's vaults only.** Nylorun no longer signs the installation in to MCP servers with OAuth and no longer asks a credential resolver. Upgrade every package together; MIGRATION.md has the details.
|
|
8
|
+
|
|
9
|
+
- **Breaking (`@nylorun/runtime`): the MCP OAuth connect is gone.** `POST /v1/tenant/vaults/{vaultId}/oauth/start` and `GET /v1/oauth/callback` answer `404`. The vault credential type `oauth` and its refresh are gone: a credential is a `bearer` token or a `headers` map bound to a URL. Migration `0016_mcp_oauth_removed` drops the table of pending connects and deletes every `oauth` credential, writing one audit row each (actor `migration`); the Runtime logs `oauth_credential_removed` once for each, naming its vault, id and URL.
|
|
10
|
+
- **Breaking (`@nylorun/runtime`): the credential resolver is gone.** The gateway no longer asks the operator's resolver for a person's credential when the session's vaults hold none. A process that still sets a `NYLORUN_RESOLVER_*` variable logs `resolver_removed` and ignores it. Keep a person's own keys in their user vault and attach it to their sessions (`vaultIds`). `TenantConfig.resolver`, `TenantConfig.publicUrl`, `TenantConfig.vaultFetch`, `startEphemeralRuntime({ resolver })`, the `ResolverConfig` export and `VaultService`'s `fetch` option are removed; `NYLORUN_PUBLIC_URL` still sets the protected resource metadata's `resource`.
|
|
11
|
+
- **Breaking (`@nylorun/core`):** `PROTOCOL_VERSION` is 10 and `HOST_PROTOCOL` 4–10. `StartOAuthRequest`, `StartOAuthResponse`, the `oauth` variants of `CreateCredentialRequest` and `RotateCredentialRequest`, `oauth` in `CredentialInfo.type` and `CredentialInfo.expiresAt` are removed, and `ERROR_CODES` drops `oauth_client_required`, `oauth_state_invalid` and `oauth_failed`. `@nylorun/agents` and `@nylorun/cli` send protocol 10.
|
|
12
|
+
- **Breaking (`@nylorun/admin`):** `admin.vaults` loses its OAuth start method.
|
|
13
|
+
- **Breaking (`nylorun`):** the `connect` subcommand of `nylorun mcp` is removed (`nylorun mcp inspect` lists a server's tools instead), and the gateway's Compose service no longer passes the `NYLORUN_RESOLVER_*` variables.
|
|
14
|
+
- `@nylorun/studio`: the Credentials page loses the OAuth type, the Expires column and the OAuth connect hint.
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- e0e39ff: **Header map, gateway and identity header credentials; `credential_rejected` on a `401`** (R2b C1, C2). For remote MCP servers and HTTP tools alike, in installation and user vaults. MIGRATION.md (protocol 10, "Header and gateway credentials" and "Tool errors the model sees") has the details.
|
|
19
|
+
|
|
20
|
+
- `@nylorun/core`: `CreateCredentialRequest` and `RotateCredentialRequest` gain `type: "headers"` with a `headers` map, and optional `via` (where requests go, such as a gateway: `https`, or `http` to a loopback host, with no userinfo, query string or fragment) and `identity: { header }` on both kinds; a rotation may change them, and `null` removes one. `CredentialInfo` gains `headers` in its type, `headerNames`, `via` and `identity`, never a value. `ERROR_CODES` gains `credential_rejected`, and `tool.completed`'s `error` documents `server` and `vault`. The admin client's vault methods take the new bodies through these types.
|
|
21
|
+
- `@nylorun/runtime`: a `headers` credential is sealed like a token and sends every header in its map; the transport's headers, `Idempotency-Key` and `Nylorun-*` are refused (`400`), and a credential header replaces a manifest header of the same name. A credential with `via` sends the server's requests there, while the manifest's URL still picks the credential and names the tools. An identity header carries the session owner's subject from the session record, and is left out for a session owned by `installation`. A `401` from an MCP server or HTTP tool is a failed tool call with code `credential_rejected` that the model sees, never retried and never `uncertain`. `via`, `identity` and the header names are stored unsealed in the credential's binding: no migration.
|
|
22
|
+
- `@nylorun/studio`: the Credentials page adds Bearer or Headers credentials (name and value rows), with an optional gateway URL and identity header, and shows them without values.
|
|
23
|
+
|
|
24
|
+
- 18f9a2f: **Model-safe MCP tool names, coded MCP tool errors and credential scrubbing** (R2b C6, C7, C8). MIGRATION.md (protocol 10, "Tool and MCP server names" and "Tool errors the model sees") has the details.
|
|
25
|
+
|
|
26
|
+
- `@nylorun/core`: a declared tool's name and an MCP server's name must match `^[A-Za-z0-9_-]{1,64}$` (`AgentManifestSchema`, so `PUT /v1/agents/{id}` refuses others). `mcp.discovered`'s server outcomes gain `renamed: [{ serverToolName, name }]`; `tool.completed` gains `redacted` and its `error` gains `retryable`. A failed `ToolOutcome` and `ToolResult` may carry `retryable`.
|
|
27
|
+
- `@nylorun/harness`: a failed tool result keeps the outcome's `retryable`, and the model sees it beside `code` and `message`.
|
|
28
|
+
- `@nylorun/runtime`: the model knows an MCP tool by `server__tool` with characters outside `[A-Za-z0-9_-]` replaced by `_`, shortened to 64 with an 8-hex SHA-256 suffix (also given to a renamed tool that collides); the server is still called by its own name. A failed MCP tool call is a failed tool result the model sees, with code `mcp.unreachable` (never sent; retryable), `credential_rejected` (`401`), `mcp.forbidden` (`403`), `mcp.error` (a JSON-RPC error) or `mcp.status` (another HTTP status); a call whose answer was lost after it was sent is `mcp.lost` for a `readOnlyHint` or `idempotentHint` tool and stays `uncertain` otherwise, as does a call lost with a gateway restart. A pooled connection whose server ended its session (`404` to its `Mcp-Session-Id`) or whose credential's `via` moved is dropped, opened again, and the call sent once more, since the tool never saw it. The credential values sent on a call (at least 8 characters, and a `Bearer` value's token) are replaced with `[redacted]` in MCP and HTTP tool results and errors before the gate records or returns them; no other field is touched.
|
|
29
|
+
|
|
30
|
+
- da93711: **Preview an MCP server's tools** (R2b C12). MIGRATION.md (protocol 10, "Previewing a server's tools") has the details.
|
|
31
|
+
|
|
32
|
+
- `@nylorun/core`: `McpPreviewRequestSchema` and `McpPreviewSchema` (`McpPreviewTool`), and the error code `mcp_preview_failed`.
|
|
33
|
+
- `@nylorun/runtime`: `POST /v1/tenant/mcp/preview` (the Management API) connects to a remote MCP server with the installation vault's credential for its URL (headers and `via`, no identity header), under the Host's address policy and within 15 s, and answers its server info, instructions, tools (model names, annotations, schema sizes) and renames; a `401` is `authRequired`, with the server's RFC 9728 protected-resource metadata. It runs in the keys service (`Keys.previewMcp`), which holds the plaintext, and calls no tool. Both OpenAPI documents list it.
|
|
34
|
+
- `@nylorun/admin`: `admin.mcp.preview({ url, type?, name?, vaultId? })`.
|
|
35
|
+
- `nylorun`: `nylorun mcp inspect <url> [--server <name>] [--vault <id>] [--sse] [--json]` prints the running Tenant's preview: a table of tools, the renames, or that the server needs a person's sign-in. Its `connect` subcommand still says it was removed, and now points to `inspect`.
|
|
36
|
+
- `@nylorun/studio`: **Preview tools** on each credential of the Credentials page lists the tools behind its URL.
|
|
37
|
+
|
|
38
|
+
- 90a817d: **MCP and HTTP tool results that fit** (R2b C11). MIGRATION.md (protocol 10, "Tool results that fit") has the details.
|
|
39
|
+
|
|
40
|
+
- `@nylorun/core`: a completed `ToolOutcome` may carry `files` (`ToolResultFile`: a media type and the host's reference) and `truncated`; a completed `ToolResult` carries the `files`. `artifactsCapabilityManifest({ save, read })` adds the built-in `read_artifact` (`READ_ARTIFACT_TOOL`, `READ_ARTIFACT_MAX_BYTES`), and `codeToolsOf` leaves it alone. `SessionView` gains `definitionHash`, the definition the session was opened from. Transcript edits are split at 48 KiB, down from 256 KiB, so each `transcript.updated` event stays under 64 KiB when no entry is larger.
|
|
41
|
+
- `@nylorun/harness`: a tool result's files go to the model after its output, as media parts; an outcome marked `truncated` is not checked against the tool's output schema.
|
|
42
|
+
- `@nylorun/runtime`: an agent's remote MCP or HTTP tool result past 32 KiB is stored as a file artifact of the session, and the model gets `{ truncated: true, artifactId, size, preview }` (the first 4 KiB and the last 1 KiB). Image, audio and blob resource parts become artifacts too, an image also shown to a model that reads images (a note for one that does not); each part of a mixed result is shaped alone, and a `resource_link` stays a link. One step's results share a 256 KiB budget, so many parallel results never make an event near S2's 1 MiB record: past it, a result is a stub naming its artifact. When an artifact cannot be stored, the preview stays and `dropped` says why. An MCP answer past 8 MiB is `mcp.too-large`. `read_artifact { artifactId, offset?, length? }` reads 32 KiB of the session's own artifact a call, with or without a sandbox: a session gets it for each agent with an MCP server or an HTTP tool. The session view names its `definitionHash`.
|
|
43
|
+
- `@nylorun/studio`: a session is shown as running an older manifest only when the definition it was opened from is not the registered one, not because the Runtime pinned its own tools (a sandbox's, `save_artifact`, `read_artifact`) beside it.
|
|
44
|
+
|
|
45
|
+
- b8d10cb: **Per-tool MCP settings (manifest v6) and deferred tools** (R2b C9, C10). MIGRATION.md (protocol 10, "Per-tool settings and manifest v6" and "Deferred tools") has the details.
|
|
46
|
+
|
|
47
|
+
- `@nylorun/core`: an MCP server takes `tools` (`McpToolSettings` by the server's own tool name, `"*"` for the rest: `enabled`, `approval`, `deferred`) and `deferred`, in manifest v6. `mcp()` and `Agent.mcp()` accept them, and the builder writes v6 only for a manifest that uses them, so other manifests keep their hashes; `AgentManifestSchema` accepts v5 unchanged and refuses the fields in v5. `mcpToolSettings` resolves a tool's settings, `manifestVersionFor` says which version a definition needs. `isVariantOf` lets a turn variant disable an MCP tool or require its approval, and nothing else. `TOOLS_CAPABILITY_ID`, `TOOL_SEARCH_TOOL`, `TOOL_CALL_TOOL`, `deferredToolsTools` and `deferredToolsInstructions` describe `tool_search` and `tool_call`. A session tool may carry instructions, read with its capability's. `mcp.discovered` gains `deferred`, `disabled` and `unknownTools` per server.
|
|
48
|
+
- `@nylorun/harness`: a session tool marked `deferred` stays out of the model's tool list; `tool_call` runs it as its own call, after checking the arguments against its `inputSchema`, and asks for approval when it needs it.
|
|
49
|
+
- `@nylorun/runtime`: discovery leaves out the tools a server's settings disable and names keys that match no tool. A session of an agent with a remote MCP server pins an empty `nylorun.tools` capability; when the agent's MCP tools pass a tenth of the model's context window (or settings say so), they are deferred for the session's life, and the model gets `tool_search` (BM25 over the deferred tools' names and descriptions, served by core) and `tool_call`, with a note naming each server and its instructions. Approval resolves per tool, and a turn variant's tightening applies to its turn. The gate's `mcp/connect` answers the server's instructions.
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- fed5e58: **Docs: reaching a person's accounts** (R2b C5). The READMEs describe MCP credentials as protocol 10 has them (a `bearer` token or a `headers` map per URL, with `via` and an identity header for an MCP gateway), and point to "MCP servers and HTTP tools" in DEPLOYMENT.md: the operator's flow from credential to preview, tool settings, deferral, stored results and the error codes a model sees, with gateway recipes for Arcade, ToolHive, Obot and Nylorun Cloud and the proxy pattern for gateways that mint per person. `HttpToolTarget.credential`'s doc (`@nylorun/core`) no longer names the removed credential resolver.
|
|
54
|
+
|
|
55
|
+
## 0.16.0-beta
|
|
56
|
+
|
|
57
|
+
### Major Changes
|
|
58
|
+
|
|
59
|
+
- cf5eb9c: **Protocol 9: the Runtime API is an OAuth 2.1 resource server for your identity provider's tokens.** Nylorun is still never the authorization server. Upgrade every package together; MIGRATION.md has the details.
|
|
60
|
+
|
|
61
|
+
- **Breaking (`@nylorun/runtime`): a refused credential is `401`, not the opaque `404`.** No `Authorization` is `401 credential_required`; an unknown key, or a token no trusted issuer signed or that fails a check, is `401 credential_invalid`. Each carries `WWW-Authenticate: Bearer` (OAuth 2.1 §5.3), naming the protected resource metadata (`resource_metadata`) on the Runtime API when the Runtime has trusted issuers; the Management API's challenge is a bare `Bearer`. `token_expired` and `issuer_unavailable` gain the challenge too. Another Tenant named, a Tenant that could not open and an unsigned capability link stay the opaque `404`.
|
|
62
|
+
- **Breaking (`@nylorun/runtime`): a request with neither `Nylorun-Protocol` nor `Authorization`** on an API route gets that route's `401` challenge instead of `426`, so a generic OAuth client learns where to sign in.
|
|
63
|
+
- `@nylorun/runtime`: a token without a route's scope still gets `403 scope_required`, now with `WWW-Authenticate: Bearer error="insufficient_scope", scope="…"`. The `Bearer` scheme is matched in any case (RFC 9110).
|
|
64
|
+
- `@nylorun/runtime`: `GET /.well-known/oauth-protected-resource` (RFC 9728) serves the resource (`NYLORUN_PUBLIC_URL`, else the request's origin), the identity file's issuers in order and their scopes, with no key or protocol; `404` without an identity file.
|
|
65
|
+
- **Breaking (`@nylorun/runtime`): the identity file drops `maxLifetime`.** The issuer sets its tokens' lifetimes; `exp` is required, `iat` no longer is. A key the file does not define, `maxLifetime` included, is ignored and logged (`identity_file_key_ignored`) instead of stopping the boot. `subject` defaults to `{sub}`, `scopes` to `{ claim: scope }` and `allowedScopes` to every token scope but `studio`.
|
|
66
|
+
- `@nylorun/core`: `PROTOCOL_VERSION` is 9 and `HOST_PROTOCOL` 4–9, with the required feature `resource-server`; `ERROR_CODES` adds `credential_required` and `credential_invalid`. `@nylorun/agents`, `@nylorun/admin` and `@nylorun/cli` send protocol 9.
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- 2ed5fe0: The event source `sandboxd` is now `sandboxes`, the name the sandbox lifecycle service took on 3 Oct, matching core, loop, gates, keys, egress and harness. Nothing emits it yet, so no stored event changes; the OpenAPI document's `EventSourceKind` enum shows the new name, and `--service sandboxes` is the blueprint service this release refuses as not yet shipped.
|
|
71
|
+
|
|
3
72
|
## 0.15.0-beta
|
|
4
73
|
|
|
5
74
|
### Major Changes
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
export { hashManifest } from "./utils/hash.js";
|
|
2
2
|
/**
|
|
3
|
+
* Protocol 10: MCP credential custody leaves OSS (D49). The vault credential type `oauth`, the
|
|
4
|
+
* MCP OAuth connect (`/v1/tenant/vaults/{vaultId}/oauth/start`, `/v1/oauth/callback`) and the
|
|
5
|
+
* credential resolver are gone: a session's MCP servers and HTTP tools reach their credentials
|
|
6
|
+
* through its attached vaults only.
|
|
7
|
+
* Protocol 9: the Runtime API is an OAuth 2.1 resource server (RFC 6750, RFC 9728). A missing
|
|
8
|
+
* or unknown credential is `401 credential_required` or `credential_invalid` with a
|
|
9
|
+
* `WWW-Authenticate: Bearer` challenge instead of the opaque 404, a token missing a scope gets
|
|
10
|
+
* `error="insufficient_scope"`, and `GET /.well-known/oauth-protected-resource` names the trusted
|
|
11
|
+
* issuers. Identity files lose `maxLifetime`: the issuer sets its tokens' lifetimes.
|
|
3
12
|
* Protocol 8: the Runtime and Management APIs (`key_role_mismatch`), and manifest-only agents
|
|
4
13
|
* (track R2): manifest v5 and workflow manifest v3, no hooks or flow functions, remote MCP
|
|
5
14
|
* only, and no Action endpoints (`/v1/endpoints` and `/v1/actions/*` answer 404, delivery
|
|
@@ -13,7 +22,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
13
22
|
* it. The Host still accepts protocol 4 (and `Nylorun-Tenant`), 5 and 6 clients on every route
|
|
14
23
|
* that remains; a client that requires `action-endpoints` is refused by the feature check.
|
|
15
24
|
*/
|
|
16
|
-
export declare const PROTOCOL_VERSION =
|
|
25
|
+
export declare const PROTOCOL_VERSION = 10;
|
|
17
26
|
/** What a client of this protocol requires of a Host. */
|
|
18
27
|
export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts",
|
|
19
28
|
/**
|
|
@@ -21,7 +30,13 @@ export declare const PROTOCOL_FEATURES: readonly ["studio-principal", "artifacts
|
|
|
21
30
|
* Runtime API application keys only (`key_role_mismatch`); vaults and signing keys are under
|
|
22
31
|
* `/v1/tenant`.
|
|
23
32
|
*/
|
|
24
|
-
"management-api"
|
|
33
|
+
"management-api",
|
|
34
|
+
/**
|
|
35
|
+
* Protocol 9: credential failures are `401` with a `WWW-Authenticate: Bearer` challenge
|
|
36
|
+
* (`credential_required`, `credential_invalid`), and the Runtime serves its protected resource
|
|
37
|
+
* metadata at `/.well-known/oauth-protected-resource` when it has trusted issuers.
|
|
38
|
+
*/
|
|
39
|
+
"resource-server"];
|
|
25
40
|
export type ProtocolFeature = (typeof PROTOCOL_FEATURES)[number];
|
|
26
41
|
/**
|
|
27
42
|
* Host features no client requires: a client that uses one checks the Host's `/health`
|
|
@@ -58,7 +73,7 @@ export interface ProtocolRange {
|
|
|
58
73
|
* What this Host serves. `runtime-tenants` (protocol 4 clients require it) and `admin-status`
|
|
59
74
|
* (protocol 5 to 7 clients require it) are still advertised for the compatibility window, so
|
|
60
75
|
* those clients keep reaching the Runtime API; protocol 8 clients require neither. The Admin
|
|
61
|
-
* API itself is gone (protocol 8): `/v1/admin/*` is
|
|
76
|
+
* API itself is gone (protocol 8): `/v1/admin/*` is no route. `artifacts` (protocol 6 and
|
|
62
77
|
* 7, required by their clients): file artifacts, capability links and message `parts`.
|
|
63
78
|
*/
|
|
64
79
|
export declare const HOST_PROTOCOL: ProtocolRange;
|
|
@@ -77,7 +92,15 @@ export declare const SCOPES_HEADER = "Nylorun-Scopes";
|
|
|
77
92
|
export declare const SESSION_ID_HEADER = "Nylorun-Session-Id";
|
|
78
93
|
export declare const TURN_ID_HEADER = "Nylorun-Turn-Id";
|
|
79
94
|
export declare const AGENT_ID_HEADER = "Nylorun-Agent-Id";
|
|
80
|
-
export declare const ERROR_CODES: readonly ["not_found",
|
|
95
|
+
export declare const ERROR_CODES: readonly ["not_found",
|
|
96
|
+
/** No credential on a route that needs one (protocol 9): `401` with a `Bearer` challenge. */
|
|
97
|
+
"credential_required",
|
|
98
|
+
/**
|
|
99
|
+
* A key the Tenant does not know, or a token no trusted issuer signed or that fails its checks
|
|
100
|
+
* (protocol 9): `401` with `WWW-Authenticate: Bearer error="invalid_token"`. The reason is
|
|
101
|
+
* logged, never sent.
|
|
102
|
+
*/
|
|
103
|
+
"credential_invalid", "protocol_unsupported", "host_rejected", "origin_rejected", "unsupported_media_type", "connection_missing", "incompatible_host", "subject_invalid", "scope_required",
|
|
81
104
|
/**
|
|
82
105
|
* A known key on the other API (protocol 8): an application key on the Management API
|
|
83
106
|
* (`/v1/tenant/*`), or a management key on the Runtime API. The message names the key's API.
|
|
@@ -106,20 +129,23 @@ export declare const ERROR_CODES: readonly ["not_found", "protocol_unsupported",
|
|
|
106
129
|
* be fetched now (Host feature `trusted-issuers`): retry later. Keys already fetched keep working.
|
|
107
130
|
*/
|
|
108
131
|
"issuer_unavailable",
|
|
109
|
-
/**
|
|
110
|
-
* An MCP OAuth connect found no way to identify this installation to the authorization server:
|
|
111
|
-
* it offers no dynamic client registration and no client id was given (F9 C2).
|
|
112
|
-
*/
|
|
113
|
-
"oauth_client_required",
|
|
114
|
-
/** An OAuth callback's `state` is unknown, already used or expired: start the connect again. */
|
|
115
|
-
"oauth_state_invalid",
|
|
116
|
-
/** The authorization server (or its discovery) failed or refused an MCP OAuth connect step. */
|
|
117
|
-
"oauth_failed",
|
|
118
132
|
/**
|
|
119
133
|
* A definition names definition files the Runtime does not hold (track R2 M4): upload each
|
|
120
134
|
* with `PUT /v1/files/sha256:<hex>` first. `details.missing` lists their hashes.
|
|
121
135
|
*/
|
|
122
|
-
"definition_files_missing",
|
|
136
|
+
"definition_files_missing",
|
|
137
|
+
/**
|
|
138
|
+
* Not an HTTP answer: the code of a tool error the model sees when an MCP server or HTTP tool
|
|
139
|
+
* answered `401` (R2b C1). The vault's credential (or none) was rejected; the call is not retried.
|
|
140
|
+
*/
|
|
141
|
+
"credential_rejected",
|
|
142
|
+
/**
|
|
143
|
+
* `POST /v1/tenant/mcp/preview` could not list the server's tools (R2b C12): `502`, with
|
|
144
|
+
* `details.failure` the code a tool call would have failed with (`mcp.unreachable` for an
|
|
145
|
+
* address the Host refuses, a connection that failed or a server silent past 15 s;
|
|
146
|
+
* `mcp.forbidden`, `mcp.status`, `mcp.error`).
|
|
147
|
+
*/
|
|
148
|
+
"mcp_preview_failed", "internal_error"];
|
|
123
149
|
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
124
150
|
export declare const TENANT_ID_PATTERN: RegExp;
|
|
125
151
|
export declare const PRINCIPAL_ID_PATTERN: RegExp;
|
package/dist/compatibility.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
export { hashManifest } from "./utils/hash.js";
|
|
2
2
|
/**
|
|
3
|
+
* Protocol 10: MCP credential custody leaves OSS (D49). The vault credential type `oauth`, the
|
|
4
|
+
* MCP OAuth connect (`/v1/tenant/vaults/{vaultId}/oauth/start`, `/v1/oauth/callback`) and the
|
|
5
|
+
* credential resolver are gone: a session's MCP servers and HTTP tools reach their credentials
|
|
6
|
+
* through its attached vaults only.
|
|
7
|
+
* Protocol 9: the Runtime API is an OAuth 2.1 resource server (RFC 6750, RFC 9728). A missing
|
|
8
|
+
* or unknown credential is `401 credential_required` or `credential_invalid` with a
|
|
9
|
+
* `WWW-Authenticate: Bearer` challenge instead of the opaque 404, a token missing a scope gets
|
|
10
|
+
* `error="insufficient_scope"`, and `GET /.well-known/oauth-protected-resource` names the trusted
|
|
11
|
+
* issuers. Identity files lose `maxLifetime`: the issuer sets its tokens' lifetimes.
|
|
3
12
|
* Protocol 8: the Runtime and Management APIs (`key_role_mismatch`), and manifest-only agents
|
|
4
13
|
* (track R2): manifest v5 and workflow manifest v3, no hooks or flow functions, remote MCP
|
|
5
14
|
* only, and no Action endpoints (`/v1/endpoints` and `/v1/actions/*` answer 404, delivery
|
|
@@ -13,7 +22,7 @@ export { hashManifest } from "./utils/hash.js";
|
|
|
13
22
|
* it. The Host still accepts protocol 4 (and `Nylorun-Tenant`), 5 and 6 clients on every route
|
|
14
23
|
* that remains; a client that requires `action-endpoints` is refused by the feature check.
|
|
15
24
|
*/
|
|
16
|
-
export const PROTOCOL_VERSION =
|
|
25
|
+
export const PROTOCOL_VERSION = 10;
|
|
17
26
|
/** What a client of this protocol requires of a Host. */
|
|
18
27
|
export const PROTOCOL_FEATURES = [
|
|
19
28
|
"studio-principal",
|
|
@@ -24,6 +33,12 @@ export const PROTOCOL_FEATURES = [
|
|
|
24
33
|
* `/v1/tenant`.
|
|
25
34
|
*/
|
|
26
35
|
"management-api",
|
|
36
|
+
/**
|
|
37
|
+
* Protocol 9: credential failures are `401` with a `WWW-Authenticate: Bearer` challenge
|
|
38
|
+
* (`credential_required`, `credential_invalid`), and the Runtime serves its protected resource
|
|
39
|
+
* metadata at `/.well-known/oauth-protected-resource` when it has trusted issuers.
|
|
40
|
+
*/
|
|
41
|
+
"resource-server",
|
|
27
42
|
];
|
|
28
43
|
/**
|
|
29
44
|
* Host features no client requires: a client that uses one checks the Host's `/health`
|
|
@@ -65,12 +80,12 @@ export const OPTIONAL_HOST_FEATURES = [
|
|
|
65
80
|
* What this Host serves. `runtime-tenants` (protocol 4 clients require it) and `admin-status`
|
|
66
81
|
* (protocol 5 to 7 clients require it) are still advertised for the compatibility window, so
|
|
67
82
|
* those clients keep reaching the Runtime API; protocol 8 clients require neither. The Admin
|
|
68
|
-
* API itself is gone (protocol 8): `/v1/admin/*` is
|
|
83
|
+
* API itself is gone (protocol 8): `/v1/admin/*` is no route. `artifacts` (protocol 6 and
|
|
69
84
|
* 7, required by their clients): file artifacts, capability links and message `parts`.
|
|
70
85
|
*/
|
|
71
86
|
export const HOST_PROTOCOL = {
|
|
72
87
|
min: 4,
|
|
73
|
-
max:
|
|
88
|
+
max: 10,
|
|
74
89
|
features: ["runtime-tenants", "admin-status", ...PROTOCOL_FEATURES, ...OPTIONAL_HOST_FEATURES],
|
|
75
90
|
};
|
|
76
91
|
export const DEFINITION_SCHEMA_VERSION = 2;
|
|
@@ -90,6 +105,14 @@ export const TURN_ID_HEADER = "Nylorun-Turn-Id";
|
|
|
90
105
|
export const AGENT_ID_HEADER = "Nylorun-Agent-Id";
|
|
91
106
|
export const ERROR_CODES = [
|
|
92
107
|
"not_found",
|
|
108
|
+
/** No credential on a route that needs one (protocol 9): `401` with a `Bearer` challenge. */
|
|
109
|
+
"credential_required",
|
|
110
|
+
/**
|
|
111
|
+
* A key the Tenant does not know, or a token no trusted issuer signed or that fails its checks
|
|
112
|
+
* (protocol 9): `401` with `WWW-Authenticate: Bearer error="invalid_token"`. The reason is
|
|
113
|
+
* logged, never sent.
|
|
114
|
+
*/
|
|
115
|
+
"credential_invalid",
|
|
93
116
|
"protocol_unsupported",
|
|
94
117
|
"host_rejected",
|
|
95
118
|
"origin_rejected",
|
|
@@ -128,20 +151,23 @@ export const ERROR_CODES = [
|
|
|
128
151
|
* be fetched now (Host feature `trusted-issuers`): retry later. Keys already fetched keep working.
|
|
129
152
|
*/
|
|
130
153
|
"issuer_unavailable",
|
|
131
|
-
/**
|
|
132
|
-
* An MCP OAuth connect found no way to identify this installation to the authorization server:
|
|
133
|
-
* it offers no dynamic client registration and no client id was given (F9 C2).
|
|
134
|
-
*/
|
|
135
|
-
"oauth_client_required",
|
|
136
|
-
/** An OAuth callback's `state` is unknown, already used or expired: start the connect again. */
|
|
137
|
-
"oauth_state_invalid",
|
|
138
|
-
/** The authorization server (or its discovery) failed or refused an MCP OAuth connect step. */
|
|
139
|
-
"oauth_failed",
|
|
140
154
|
/**
|
|
141
155
|
* A definition names definition files the Runtime does not hold (track R2 M4): upload each
|
|
142
156
|
* with `PUT /v1/files/sha256:<hex>` first. `details.missing` lists their hashes.
|
|
143
157
|
*/
|
|
144
158
|
"definition_files_missing",
|
|
159
|
+
/**
|
|
160
|
+
* Not an HTTP answer: the code of a tool error the model sees when an MCP server or HTTP tool
|
|
161
|
+
* answered `401` (R2b C1). The vault's credential (or none) was rejected; the call is not retried.
|
|
162
|
+
*/
|
|
163
|
+
"credential_rejected",
|
|
164
|
+
/**
|
|
165
|
+
* `POST /v1/tenant/mcp/preview` could not list the server's tools (R2b C12): `502`, with
|
|
166
|
+
* `details.failure` the code a tool call would have failed with (`mcp.unreachable` for an
|
|
167
|
+
* address the Host refuses, a connection that failed or a server silent past 15 s;
|
|
168
|
+
* `mcp.forbidden`, `mcp.status`, `mcp.error`).
|
|
169
|
+
*/
|
|
170
|
+
"mcp_preview_failed",
|
|
145
171
|
"internal_error",
|
|
146
172
|
];
|
|
147
173
|
/** Crockford Base32 alphabet (lowercase); excludes i, l, o, u. */
|