pi-mcp-adapter 3.1.0 → 3.3.0
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 +54 -0
- package/OAUTH.md +7 -7
- package/README.md +64 -6
- package/cli.js +1 -0
- package/direct-tools.ts +9 -1
- package/dist/elicitation-handler.d.ts +9 -1
- package/dist/elicitation-handler.js +65 -2
- package/dist/elicitation-handler.js.map +1 -1
- package/dist/jev-client.js +7 -5
- package/dist/jev-client.js.map +1 -1
- package/dist/jev-key-store.d.ts +1 -0
- package/dist/jev-key-store.js +11 -0
- package/dist/jev-key-store.js.map +1 -1
- package/dist/mcp-callback-server.js +1 -2
- package/dist/mcp-callback-server.js.map +1 -1
- package/dist/mcp-oauth-provider.d.ts +2 -1
- package/dist/mcp-oauth-provider.js +5 -2
- package/dist/mcp-oauth-provider.js.map +1 -1
- package/dist/metadata-cache.js +5 -1
- package/dist/metadata-cache.js.map +1 -1
- package/dist/output-shape.d.ts +23 -0
- package/dist/output-shape.js +194 -0
- package/dist/output-shape.js.map +1 -0
- package/dist/state.d.ts +6 -1
- package/dist/ts-shape.d.ts +3 -0
- package/dist/ts-shape.js +153 -0
- package/dist/ts-shape.js.map +1 -0
- package/dist/types.d.ts +13 -2
- package/dist/types.js.map +1 -1
- package/dist/unix-socket-transport.js +1 -1
- package/dist/unix-socket-transport.js.map +1 -1
- package/dist/utils.d.ts +6 -1
- package/dist/utils.js +17 -0
- package/dist/utils.js.map +1 -1
- package/elicitation-handler.ts +78 -1
- package/host-managed.ts +547 -0
- package/index.ts +19 -22
- package/init.ts +15 -9
- package/jev-client.ts +7 -4
- package/jev-key-store.ts +7 -0
- package/mcp-callback-server.ts +1 -1
- package/mcp-code.ts +12 -2
- package/mcp-oauth-provider.ts +5 -2
- package/mcp-script-wasm.ts +18 -1
- package/mcp-script-worker.mjs +9 -2
- package/metadata-cache.ts +5 -0
- package/namespace-tools.ts +22 -2
- package/output-shape.ts +209 -0
- package/package.json +9 -2
- package/prompts.ts +68 -0
- package/proxy-modes.ts +28 -1
- package/skills/mcp-scripting/SKILL.md +2 -0
- package/state.ts +6 -1
- package/tool-approval.ts +28 -10
- package/tool-metadata.ts +3 -1
- package/tool-parameters.ts +11 -0
- package/ts-shape.ts +1 -1
- package/types.ts +14 -2
- package/ui-server.ts +5 -2
- package/unix-socket-transport.ts +1 -1
- package/utils.ts +16 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.3.0] - 2026-09-29
|
|
11
|
+
|
|
12
|
+
### Highlights
|
|
13
|
+
|
|
14
|
+
- You can now tell a read-only MCP tool from one that deletes data. The hints servers declare on their tools show up when you describe a tool and in the approval prompt.
|
|
15
|
+
- New `approveTools: "destructive"` setting asks before any tool that may change or delete data, without making you list tool names.
|
|
16
|
+
- A tool call no longer fails with "Request timed out" while you are still answering the server's input form.
|
|
17
|
+
- The model gets a better idea of what a tool returns, even when the server declares no output schema.
|
|
18
|
+
- MCP prompt slash commands now suggest argument names as you type.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- The hints a server declares on its tools (read-only, destructive, idempotent, open-world, title) are now kept, including in the metadata cache, and shown in `mcp({ describe })`, in `tools.describe` inside `mcpScript`, and in the tool approval prompt. Search results and direct-tool descriptions stay the same, so nothing is added to every turn's context.
|
|
23
|
+
- `approveTools: "destructive"` asks before any tool that may change or delete data. Only tools the server marks read-only or non-destructive run without a prompt; tools with no hints still ask. It works globally or per server.
|
|
24
|
+
- For tools that declare no output schema, `mcp({ describe })` and `tools.describe` in `mcpScript` now show the output shape seen so far this session, after a successful call returns structured content or a JSON text result. Only field names and types are shown, never values. The shape is kept in memory only and is labeled as observed, not a contract.
|
|
25
|
+
- MCP prompt slash commands now suggest declared argument names as you type. Arguments you already entered are kept, suggestions follow the server's latest prompt list, and nothing connects to a server just to show them. Thanks to [@quifox](https://github.com/quifox) for [PR #733](https://github.com/nicobailon/pi-mcp-adapter/pull/733).
|
|
26
|
+
- Jev semantic search works with an existing OpenRouter key. Set `SYSTEMONE_ENDPOINT=https://openrouter.ai/api/alpha/decisions` and `OPENROUTER_API_KEY` is used as the key, with the model defaulting to `typesafe/jev-1.13`. The key is never sent to any other endpoint.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- A mistyped `approveTools` value no longer turns approval off silently. Any value other than `true`, `false`, `"destructive"`, or a list of tool name patterns now asks before every tool.
|
|
31
|
+
- Dropped the unused `@modelcontextprotocol/ext-apps` dependency. MCP Apps already run from a bundled app bridge, and the package made a plain `npm install` pull in the old MCP SDK v1 and its HTTP server dependencies.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- A tool call no longer times out while you are answering the server's input prompt. The request timeout (60 seconds by default) kept running while the form was open, so a slow answer failed the call with "Request timed out" and the answer was lost. The timeout now pauses while the prompt is open.
|
|
36
|
+
- Jev no longer rejects responses that carry extra provider details, such as OpenRouter's `id`, `provider`, and `usage.cost`. The documented OpenRouter setup previously failed with "Jev returned an invalid response."
|
|
37
|
+
- Typechecking the adapter's sources with `@types/node` 25 no longer fails in the Unix socket transport. Thanks to [@abdwhb-png](https://github.com/abdwhb-png) for [PR #732](https://github.com/nicobailon/pi-mcp-adapter/pull/732).
|
|
38
|
+
|
|
39
|
+
## [3.2.0] - 2026-09-28
|
|
40
|
+
|
|
41
|
+
### Highlights
|
|
42
|
+
|
|
43
|
+
- Apps that embed Pi can now run the adapter on MCP connections they manage themselves, and keep control of approvals and results.
|
|
44
|
+
- OAuth sign-in now works with servers that reject `localhost` callbacks, such as Lovable.
|
|
45
|
+
- Direct tools no longer vanish from a session when another Pi session updates the shared tool cache.
|
|
46
|
+
- `mcpScript` now works in Bun-compiled builds of Pi.
|
|
47
|
+
- Trusted projects no longer show a false "project servers blocked" warning at startup.
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- New `pi-mcp-adapter/host-managed` entry point for apps that embed Pi and manage their own MCP connections. The app supplies the connections, records each approved call before it is sent, sees the raw result first, and decides when the adapter starts and stops. The adapter never retries a call or reconnects, and never reads config, OAuth, or keyring state. See [Host-managed embedding](README.md#host-managed-embedding). Thanks to [@LeonEthan](https://github.com/LeonEthan) for the design in [issue #716](https://github.com/nicobailon/pi-mcp-adapter/issues/716).
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- OAuth callbacks now default to `http://127.0.0.1:<port>/callback` instead of `localhost`, as RFC 8252 recommends. Servers that reject `localhost`, such as Lovable, now work without extra setup. If a server only accepts `localhost`, set `oauth.redirectUri` to that address. Thanks to [@ebysofyan](https://github.com/ebysofyan) for [issue #711](https://github.com/nicobailon/pi-mcp-adapter/issues/711) and [PR #712](https://github.com/nicobailon/pi-mcp-adapter/pull/712).
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- Pi no longer warns "MCP: Project servers blocked: … (blocked by project trust)" at startup in a project you already trust, including one trusted through a parent folder. `eager` and `keep-alive` project servers now wait for Pi's trust check, and the approval prompt still appears when the session starts. Thanks to [@pnym-ai](https://github.com/pnym-ai) for reporting [issue #713](https://github.com/nicobailon/pi-mcp-adapter/issues/713).
|
|
60
|
+
- Direct tools no longer disappear from a session when another Pi session writes different details for the same server to the shared cache, or when the cache entry expires, is deleted, or the server disconnects while idle. Each session now keeps the tools and resources it found. Changing the server's config still clears them. Thanks to [@NoahWTeng](https://github.com/NoahWTeng) for [PR #718](https://github.com/nicobailon/pi-mcp-adapter/pull/718).
|
|
61
|
+
- A server's `mcp__<server>` tool now comes back once the adapter can retry the server after a failed connection. Before, on Pi versions without `unregisterTool`, it stayed hidden for the rest of the session. A tool you turned off yourself stays off. Thanks to [@fer-git](https://github.com/fer-git) for [issue #717](https://github.com/nicobailon/pi-mcp-adapter/issues/717).
|
|
62
|
+
- `mcpScript` works when Pi runs as a Bun-compiled executable. Before, every call failed with `Cannot find package 'quickjs-wasi'` from the sandbox worker. Thanks to [@fmoda3](https://github.com/fmoda3) for [issue #720](https://github.com/nicobailon/pi-mcp-adapter/issues/720).
|
|
63
|
+
|
|
10
64
|
## [3.1.0] - 2026-09-27
|
|
11
65
|
|
|
12
66
|
### Highlights
|
package/OAUTH.md
CHANGED
|
@@ -88,7 +88,7 @@ You can optionally provide a pre-registered client:
|
|
|
88
88
|
- `oauth.authServerMetadataUrl` - HTTPS OAuth/OIDC authorization-server metadata document to use authoritatively when MCP protected-resource discovery is unavailable (optional; issuer validation remains enabled)
|
|
89
89
|
- `oauth.skipIssuerMetadataValidation` - Set `true` only for a known-misconfigured authorization server whose metadata issuer cannot be fixed immediately. This weakens OAuth issuer validation.
|
|
90
90
|
|
|
91
|
-
Dynamic fallback clients normally omit `oauth.redirectUri`; the adapter starts the callback server lazily on the default loopback host (`
|
|
91
|
+
Dynamic fallback clients normally omit `oauth.redirectUri`; the adapter starts the callback server lazily on the default loopback host (`127.0.0.1`, as RFC 8252 recommends) and asks the OS for an available local port when auth begins. Use `oauth.redirectUri` when the provider requires a pre-registered callback, such as Slack MCP's Claude-compatible `http://localhost:3118/callback`, or when a server only accepts a `localhost` redirect (for example `http://localhost:{port}/callback`). A loopback URI must use `http://` with `localhost`, `127.0.0.1`, or `[::1]`. It may contain an explicit port, which is bound exactly, or `{port}`, which is replaced with the OS-assigned port in the authorization and token requests.
|
|
92
92
|
|
|
93
93
|
### Non-Interactive `client_credentials`
|
|
94
94
|
|
|
@@ -142,13 +142,13 @@ When Pi runs over SSH or in a headless environment, use the proxy tool to retrie
|
|
|
142
142
|
mcp({ action: "auth-start", server: "my-oauth-server" })
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
Open the returned URL in your local browser. After approval, copy the full redirected
|
|
145
|
+
Open the returned URL in your local browser. After approval, copy the full redirected callback URL from the browser address bar (the page may fail to load locally) and complete the same pending auth flow:
|
|
146
146
|
|
|
147
147
|
```
|
|
148
148
|
mcp({
|
|
149
149
|
action: "auth-complete",
|
|
150
150
|
server: "my-oauth-server",
|
|
151
|
-
args: { redirectUrl: "http://
|
|
151
|
+
args: { redirectUrl: "http://127.0.0.1:19876/callback?code=...&state=..." }
|
|
152
152
|
})
|
|
153
153
|
```
|
|
154
154
|
|
|
@@ -220,7 +220,7 @@ The adapter does not provide a default URL or host the public document: operator
|
|
|
220
220
|
2. Registers a new client with:
|
|
221
221
|
- `client_name`: configured `oauth.clientName` or "Pi Coding Agent"
|
|
222
222
|
- `client_uri`: configured `oauth.clientUri` or the adapter repository URL
|
|
223
|
-
- `redirect_uris`: `["http://
|
|
223
|
+
- `redirect_uris`: `["http://127.0.0.1:<active-callback-port>/callback"]`, or the configured `oauth.redirectUri`
|
|
224
224
|
- `grant_types`: `["authorization_code", "refresh_token"]`
|
|
225
225
|
3. Stores the registered client credentials and the redirect URIs returned by the authorization server
|
|
226
226
|
|
|
@@ -230,8 +230,8 @@ When a fresh browser auth starts, cached dynamic fallback client info with token
|
|
|
230
230
|
|
|
231
231
|
A Node.js HTTP server runs on a loopback callback endpoint and handles the active callback path:
|
|
232
232
|
|
|
233
|
-
- Dynamic registration starts the callback server only when auth begins, binds the default host `
|
|
234
|
-
- Pre-registered clients (`oauth.clientId`) without `oauth.redirectUri` require the exact configured callback port from `MCP_OAUTH_CALLBACK_PORT` or the default `19876` on `
|
|
233
|
+
- Dynamic registration starts the callback server only when auth begins, binds the default host `127.0.0.1`, and asks the OS for an available local port
|
|
234
|
+
- Pre-registered clients (`oauth.clientId`) without `oauth.redirectUri` require the exact configured callback port from `MCP_OAUTH_CALLBACK_PORT` or the default `19876` on `127.0.0.1`
|
|
235
235
|
- `oauth.redirectUri` binds the exact loopback host and path. An explicit port is bound exactly; `{port}` asks the OS for a port and is replaced with that assigned value before the URI is advertised to the provider
|
|
236
236
|
|
|
237
237
|
- Handles `code`, `state`, and `error` parameters
|
|
@@ -320,7 +320,7 @@ Some servers require pre-registered clients. Obtain a client ID from your OAuth
|
|
|
320
320
|
|
|
321
321
|
### Callback server already in use
|
|
322
322
|
|
|
323
|
-
Dynamic fallback browser OAuth uses a lazy OS-assigned port on the default loopback host (`
|
|
323
|
+
Dynamic fallback browser OAuth uses a lazy OS-assigned port on the default loopback host (`127.0.0.1`), so the configured default port being busy should not block fallback registration.
|
|
324
324
|
|
|
325
325
|
For pre-registered OAuth clients (`oauth.clientId`), the callback redirect URI must match the provider registration policy. Set `oauth.redirectUri` to the full fixed callback, such as Slack MCP's Claude-compatible `http://localhost:3118/callback`, use a loopback `{port}` URI when the provider explicitly permits dynamic RFC 8252 ports, or free/set `MCP_OAUTH_CALLBACK_PORT` when you rely on the default `/callback` path without an explicit redirect URI.
|
|
326
326
|
|
package/README.md
CHANGED
|
@@ -263,6 +263,52 @@ await updateMcpOAuthTokensForUrl("jira", "https://jira.example.com/mcp", { acces
|
|
|
263
263
|
|
|
264
264
|
The public subpath exposes only token read/update helpers plus a status helper. The async read path uses the adapter's refresh logic before it returns tokens. For a service-protected endpoint or a pre-registered OAuth client, pass the explicit refresh configuration as `getMcpOAuthTokensForUrl(name, url, { definition: { headers, oauth } })`. This optional configuration is never loaded from ambient config or stored with the tokens; headers are bound to the supplied MCP URL's origin. The helpers keep secure-store storage, URL binding, refresh persistence, chunk handling, legacy import, and fail-closed credential-store errors. They do not expose client registration secrets, PKCE verifiers, or OAuth state.
|
|
265
265
|
|
|
266
|
+
### Host-managed embedding
|
|
267
|
+
|
|
268
|
+
Use `pi-mcp-adapter/host-managed` when an application embeds Pi and owns the MCP connection itself: it builds the transports, holds the credentials, records each call before it runs, and decides when the adapter starts and stops. For an ordinary integration that only supplies MCP configuration, use `createMcpAdapter` instead.
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
import { createAgentSession, DefaultResourceLoader } from "@earendil-works/pi-coding-agent";
|
|
272
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/client";
|
|
273
|
+
import { createHostManagedMcpAdapter } from "pi-mcp-adapter/host-managed";
|
|
274
|
+
|
|
275
|
+
const adapter = createHostManagedMcpAdapter({
|
|
276
|
+
servers: {
|
|
277
|
+
github: {
|
|
278
|
+
createTransport: () => new StreamableHTTPClientTransport(new URL(url), { fetch: guardedFetch }),
|
|
279
|
+
tools: ["search_issues", "get_issue"], // omit to expose every listed tool
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
async onToolCall(call) {
|
|
283
|
+
await journal.record(call.toolCallId, call.server, call.tool, call.arguments);
|
|
284
|
+
return await call.dispatch();
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
await adapter.ready(); // connects, lists tools, and freezes the catalog
|
|
289
|
+
const loader = new DefaultResourceLoader({ extensionFactories: [adapter.extensionFactory] });
|
|
290
|
+
await loader.reload();
|
|
291
|
+
const { session } = await createAgentSession({ resourceLoader: loader });
|
|
292
|
+
await adapter.close(); // after the session settles
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Nothing connects until `ready()`, which calls each `createTransport` once. It rejects and closes the adapter if a server fails to start, a requested tool is missing, or two tools map to the same Pi name (`<server>_<tool>`). `extensionFactory` registers only the selected tools and throws before `ready()` resolves or after `close()`. `close()` refuses new calls, aborts in-flight ones, and closes every transport within five seconds. A dropped connection is never reopened.
|
|
296
|
+
|
|
297
|
+
Every call goes through the approval broker (`pi-mcp-adapter:tool-approval-request` on `pi.events`, origin `direct`). Only `allow_once` or `allow_for_session` lets it run. A denial, an `abstain`, or no handler at all refuses the call before `onToolCall` sees it. `onToolCall` receives the frozen arguments and input schema, the Pi tool-call id, an opaque `connectionId`, and a `dispatch()` that sends `tools/call` at most once. The result it returns goes through the normal output guard, whether raw or changed (for example after importing images). An `isError: true` result reaches the model as a tool error. `dispatch()` rejects with `HostManagedMcpError`. The raw error is kept only as its `cause`, and the model sees fixed text.
|
|
298
|
+
|
|
299
|
+
| `delivery` | Meaning |
|
|
300
|
+
|---|---|
|
|
301
|
+
| `not_sent` | The request never left the adapter; the tool did not run. |
|
|
302
|
+
| `may_have_run` | The request was sent and the outcome is unknown (timeout, cancellation, lost connection, HTTP error). The agent is told not to retry automatically. |
|
|
303
|
+
| `server_error` | The server answered with a JSON-RPC error (`protocolCode`). |
|
|
304
|
+
| `invalid_result` | The server answered, but the result failed validation, including the tool's `outputSchema`. The tool may have run. |
|
|
305
|
+
|
|
306
|
+
On `notifications/tools/list_changed` the adapter lists the server's tools again. A selected tool that changed or disappeared is retired for the life of the adapter; if the re-list fails, every selected tool on that server is retired. Calls wait for a running re-list and are refused as `not_sent` both before `onToolCall` and inside `dispatch()`. The model is told to start a new session.
|
|
307
|
+
|
|
308
|
+
After `dispatch()` resolves, `call.linkedResource(uri)` prepares a read of a `resource_link` from that result. The read needs its own broker approval (origin `resource`, args `{ uri }`) and uses the same connection. It returns a `readId` and a single-use `dispatch()`, so you can record the read before it happens. A URI that is not linked throws, and a read is refused as `not_sent` once the parent call has settled.
|
|
309
|
+
|
|
310
|
+
Supplied transports must not carry an OAuth `authProvider` or any retry or replay behavior. The adapter sends each `tools/call` at most once at its own layer. It turns off the SDK's multi-round-trip auto-fulfilment, passes the tool definition so the SDK cannot resend on a header mismatch, and never recovers a session or reconnects. This mode does not read config files, use OAuth or the credential store, register commands, UI, or the `mcp` proxy tool, expose resource tools or prompts, or answer sampling or elicitation requests.
|
|
311
|
+
|
|
266
312
|
### Runtime status snapshots
|
|
267
313
|
|
|
268
314
|
Extensions can subscribe to the adapter's versioned shared event-bus channel instead of parsing `/mcp-adapter` or `mcp({})` output:
|
|
@@ -315,7 +361,7 @@ In the configuration examples below, `30000` is illustrative only. If `requestTi
|
|
|
315
361
|
| `oauth.clientSecret` | OAuth client secret for confidential clients; a value beginning with `!` runs a command when OAuth authenticates, while `!!` escapes a literal leading `!`. Combining it with `oauth.clientMetadataUrl` requires an explicit `oauth.clientId`. |
|
|
316
362
|
| `oauth.clientMetadataUrl` | Advanced opt-in for an operator-supplied public HTTPS Client ID Metadata Document (CIMD) URL with a non-root path. Used as the `client_id` when the authorization server advertises CIMD support; otherwise the adapter falls back to Dynamic Client Registration. The adapter does not provide or host a default document. |
|
|
317
363
|
| `oauth.scope` | Requested OAuth scopes |
|
|
318
|
-
| `oauth.redirectUri` | Redirect URI for browser OAuth. Dynamic clients normally omit it and use an OS-assigned
|
|
364
|
+
| `oauth.redirectUri` | Redirect URI for browser OAuth. Dynamic clients normally omit it and use an OS-assigned port on the default `http://127.0.0.1:<port>/callback`. Local `http://` loopback URIs accept an explicit port or `{port}` for an OS-assigned port (for example, `http://localhost:{port}/callback` for a server registered only for `localhost`). Pre-registered `https://` callbacks use manual completion by pasting the full callback URL. |
|
|
319
365
|
| `oauth.clientName` | Client display name advertised during Dynamic Client Registration fallback |
|
|
320
366
|
| `oauth.clientUri` | Client homepage URI advertised during Dynamic Client Registration fallback. Defaults to `piConfig.clientUri` from the host's manifest when set, and is omitted rather than guessed under a rebranded host |
|
|
321
367
|
| `oauth.logoUri` | Client logo URL advertised during Dynamic Client Registration fallback (RFC 7591 `logo_uri`). Must be an absolute `http(s)` URL — consent screens fetch it server-side, so local paths render nothing. Omitted from the registration request when unset |
|
|
@@ -437,7 +483,7 @@ Public servers are ready immediately. For OAuth servers, the same action opens t
|
|
|
437
483
|
|
|
438
484
|
### Remote/headless OAuth
|
|
439
485
|
|
|
440
|
-
If Pi is running on a remote server, `/mcp-auth <server>` shows a clickable authorization URL first. Open it in your local browser and approve access, then select **Yes** in Pi to open the callback input. The browser may fail to load the
|
|
486
|
+
If Pi is running on a remote server, `/mcp-auth <server>` shows a clickable authorization URL first. Open it in your local browser and approve access, then select **Yes** in Pi to open the callback input. The browser may fail to load the loopback callback page because `127.0.0.1` refers to your workstation; copy the full URL from its address bar and paste it into Pi. The authorization screen closes automatically instead when the browser can reach Pi's callback directly.
|
|
441
487
|
|
|
442
488
|
The same flow is available through the proxy tool for non-interactive clients. By default, persistent OAuth requires an available OS credential store; on headless Linux that usually means an unlocked Secret Service/libsecret keyring. The adapter fails closed instead of falling back to plaintext credentials when the secure store is unavailable.
|
|
443
489
|
|
|
@@ -449,13 +495,13 @@ On Linux, if credential access fails because Pi inherited a revoked session keyr
|
|
|
449
495
|
mcp({ action: "auth-start", server: "linear-server" })
|
|
450
496
|
```
|
|
451
497
|
|
|
452
|
-
For a loopback redirect, the adapter attempts to open the returned authorization URL, watches the callback, completes token exchange, and sends an `mcp-oauth-status` event when authentication finishes. If Pi is remote or cannot open a browser, open the returned URL locally. If the browser cannot reach Pi's callback, copy the full
|
|
498
|
+
For a loopback redirect, the adapter attempts to open the returned authorization URL, watches the callback, completes token exchange, and sends an `mcp-oauth-status` event when authentication finishes. If Pi is remote or cannot open a browser, open the returned URL locally. If the browser cannot reach Pi's callback, copy the full callback URL from the address bar and complete the flow in the same Pi session:
|
|
453
499
|
|
|
454
500
|
```js
|
|
455
501
|
mcp({
|
|
456
502
|
action: "auth-complete",
|
|
457
503
|
server: "linear-server",
|
|
458
|
-
args: { redirectUrl: "http://
|
|
504
|
+
args: { redirectUrl: "http://127.0.0.1:19876/callback?code=...&state=..." }
|
|
459
505
|
})
|
|
460
506
|
```
|
|
461
507
|
|
|
@@ -525,7 +571,7 @@ When any enabled server uses `eager` or `keep-alive`, initialization also starts
|
|
|
525
571
|
| `projectServers` | Project-server admission policy for trusted headless sessions: `"ask"` (default, skip unapproved servers) or `"allow"`. Only user-global or explicitly selected config may set it; project files are ignored. |
|
|
526
572
|
| `ancestorConfigRoots` | Trusted absolute or `~/...` roots for opt-in ancestor config discovery. Only user-global or explicitly selected config may set it; roots outside cwd are ignored and the deepest matching root is used. |
|
|
527
573
|
| `agentPluginPaths` | Agent Plugins package directories to load MCP servers from. Relative paths resolve from the active project cwd. |
|
|
528
|
-
| `approveTools` | `true` to require approval before every MCP tool call, or an array of glob patterns such as `["github_delete_*", "notion_update_*"]`. Per-server `approveTools` overrides this. |
|
|
574
|
+
| `approveTools` | `true` to require approval before every MCP tool call, `"destructive"` to require it for tools the server does not mark read-only or non-destructive, or an array of glob patterns such as `["github_delete_*", "notion_update_*"]`. Per-server `approveTools` overrides this. |
|
|
529
575
|
| `oauthDir` | Legacy OAuth `tokens.json` import directory for this MCP config. Relative paths resolve from the active project cwd. `MCP_OAUTH_DIR` still wins when set. Persistent OAuth credentials are stored in the OS credential store, not this directory. |
|
|
530
576
|
| `oauthCredentialStore` | Set explicitly to `"encrypted-file"` for externally keyed AES-256-GCM storage (notably Windows OpenSSH network logons). Requires `PI_MCP_ADAPTER_OAUTH_FILE_KEY`; absent uses the OS credential store. |
|
|
531
577
|
| `mcpServers.<name>.oauth.authorizationParams` | Extra authorization URL parameters for provider-specific OAuth extensions. Flow-owned parameters such as `client_id`, `redirect_uri`, `scope`, `state`, `code_challenge`, `response_type`, and `resource` cannot be overridden. |
|
|
@@ -564,6 +610,8 @@ Use `approveTools` when a tool should stay visible but not run without confirmat
|
|
|
564
610
|
}
|
|
565
611
|
```
|
|
566
612
|
|
|
613
|
+
To be asked before any tool that may change or delete data, set `"approveTools": "destructive"` globally or per server. A tool then runs without a prompt only when its server marks it read-only (`readOnlyHint: true`) or non-destructive (`destructiveHint: false`); tools with no such hints, including those restored from an older metadata cache, are gated. Resource reads are never gated by this value. Any other string requires approval for every tool.
|
|
614
|
+
|
|
567
615
|
When a matching tool is called from the proxy tool, a direct MCP tool, a resource call, or an MCP UI iframe, Pi asks: **Allow once**, **Allow for session**, **Allow server for this session**, or **Deny**. **Allow for session** tool grants and MCP UI iframe consent decisions (including denials) persist as non-LLM custom entries on the active Pi session branch and restore on resume or branch navigation. Entries store only server/tool names and deterministic definition/argument hashes; raw arguments, results, and secrets never persist. Tool grants and iframe consent remain separate gates. In headless sessions, matching calls fail closed with an `approval_required` result; denials, abstentions, **Allow once**, and approval-required paths do not create tool grant records. `excludeTools` still removes tools entirely; `approveTools` only gates visible tools at call time.
|
|
568
616
|
|
|
569
617
|
**Allow server for this session** permits all tools and argument combinations on the selected server, including tools discovered later. It does not approve other servers. This broad grant stays in memory only: reload, session replacement, resume, and branch navigation clear it. A changed or replaced server configuration also invalidates it. It is never saved to session entries or configuration. Broker denials, tool exclusions, host security guards, and the separate MCP UI iframe consent gate still apply. Use **Allow for session** instead to approve only the displayed tool definition and arguments.
|
|
@@ -651,7 +699,9 @@ System One decisions are the same API at different origins, so pointing at anoth
|
|
|
651
699
|
| Command Code | `https://api.commandcode.ai/provider/v1/systemone` | `typesafe/jev` |
|
|
652
700
|
| OpenRouter | `https://openrouter.ai/api/alpha/decisions` | `typesafe/jev-1.13` |
|
|
653
701
|
|
|
654
|
-
These are example configurations, subject to each provider's current documentation ([OpenCode Zen](https://opencode.ai/docs/zen/), [Command Code](https://commandcode.ai/docs/provider), [TypeSafe](https://docs.typesafe.ai/)).
|
|
702
|
+
These are example configurations, subject to each provider's current documentation ([OpenCode Zen](https://opencode.ai/docs/zen/), [Command Code](https://commandcode.ai/docs/provider), [OpenRouter](https://openrouter.ai/docs/guides/community/jev), [TypeSafe](https://docs.typesafe.ai/)).
|
|
703
|
+
|
|
704
|
+
With `SYSTEMONE_ENDPOINT` pointed at OpenRouter, an existing `OPENROUTER_API_KEY` works as the key and the model defaults to `typesafe/jev-1.13`. `OPENROUTER_API_KEY` is never sent to any other endpoint, and `SYSTEMONE_API_KEY` takes precedence over it.
|
|
655
705
|
|
|
656
706
|
The endpoint must be an absolute `https` URL with a path. A set-but-invalid `SYSTEMONE_ENDPOINT` disables Jev instead of falling back to the default. Treat the endpoint as trusted configuration: it receives the API key and the judgment payload. Credentials are stored per endpoint, so switching endpoints does not overwrite a saved key. Set the model with:
|
|
657
707
|
|
|
@@ -733,6 +783,8 @@ When Pi exposes dialog-capable UI, the adapter advertises form elicitation suppo
|
|
|
733
783
|
|
|
734
784
|
URL mode is advertised only in TUI mode. The adapter displays the requesting server, target host, and full URL, and always requires consent before opening the browser. It also handles URL-required tool errors (`-32042`) and completion notifications; after completing the browser interaction, retry the original tool call.
|
|
735
785
|
|
|
786
|
+
Time spent answering a server's prompt does not count against its tool calls' `requestTimeoutMs` (or the SDK's 60-second default). The timeout pauses while a prompt from that server is open and resumes with the time that was left. Task-backed calls are unchanged: their timeout applies to each task request, not to the whole task.
|
|
787
|
+
|
|
736
788
|
### Direct Tools
|
|
737
789
|
|
|
738
790
|
By default, all MCP tools are accessed through the single `mcp` proxy tool. This keeps context small but means the LLM has to discover MCP tools via proxy search. If you want specific tools to show up directly in the agent's tool list — alongside `read`, `bash`, `edit`, etc. — add `directTools` to your config.
|
|
@@ -837,6 +889,8 @@ Direct tools register from the metadata cache in the Pi agent dir (`~/.pi/agent/
|
|
|
837
889
|
|
|
838
890
|
For faster startup, set `settings.deferWithMissingMetadata` to `true`. Servers with missing or invalid metadata (expired, mismatched, or non-cacheable) then contribute no tools, prompts, resources, or search entries until the first MCP operation starts the runtime and loads live metadata; the `mcp` gateway stays available. Because Pi cannot unregister slash commands, cached prompt commands also wait for live metadata under this setting. `eager`/`keep-alive` servers and cold `MCP_DIRECT_TOOLS` selections still start immediately.
|
|
839
891
|
|
|
892
|
+
After discovery, each runtime retains its own schema-bearing tool and resource catalogue. Another session overwriting the shared disk cache, disk-cache expiry (including `ttlMs: 0`), cache deletion, or an idle disconnect does not revoke that runtime's tools. Disk TTLs still govern reuse at startup; session catalogues are not persisted with extended TTLs. A failed resource discovery preserves that runtime's previously discovered resources for the same server configuration, whereas a successful empty resource list removes them. Current server identity, disabled state, tool filters and failure backoff still apply, and an authoritative empty discovery removes the tools. Replacing the runtime requires fresh discovery or valid disk metadata.
|
|
893
|
+
|
|
840
894
|
Models sometimes encode an object or array argument as a JSON string. Set `settings.strictDirectToolArguments` to `true` to recover one such layer for schema-declared object and array properties, then validate the complete input against the advertised schema before execution.
|
|
841
895
|
|
|
842
896
|
Set `settings.directToolResultDetails` to `"bounded"` when an extension needs structured MCP result fields in Pi's direct-tool result details. The same output guard limits apply. Small leading structured fields stay available, while large fields receive bounded summaries and the complete guarded result follows the output guard's spill-file policy. The default `"lean"` mode keeps the existing server and tool metadata only.
|
|
@@ -954,6 +1008,8 @@ Search includes both MCP tools and Pi tools (from extensions). Pi tools appear f
|
|
|
954
1008
|
|
|
955
1009
|
Tool names are fuzzy-matched on hyphens and underscores — `context7_resolve_library_id` finds `context7_resolve-library-id`. When `describe` or `tool` cannot resolve a name, the result includes top suggestions so the agent can correct a typo or missing prefix in the same turn.
|
|
956
1010
|
|
|
1011
|
+
When a server declares MCP tool annotations, `describe` adds a `Hints:` line such as `Hints: read-only, idempotent`, `tools.describe` in `mcpScript` returns them as `annotations`, and the approval prompt says when a tool is marked destructive or read-only. They are the server's own hints, not guarantees, and never appear in search results or direct-tool descriptions.
|
|
1012
|
+
|
|
957
1013
|
### Search keywords
|
|
958
1014
|
|
|
959
1015
|
Search uses literal matching so a tool whose name and description use different vocabulary than the query won't be found. Per-server `searchKeywords` adds extra vocabulary for matching tools:
|
|
@@ -979,6 +1035,8 @@ Keys match a tool's original name, prefixed name, or a glob (`*` applies to ever
|
|
|
979
1035
|
|
|
980
1036
|
When `includeSchemas` is enabled, search and describe render common JSON Schema parameters as compact TypeScript shapes like `{ query: string; limit?: number; }`, with the older schema formatter retained as a fallback for unsupported schemas.
|
|
981
1037
|
|
|
1038
|
+
Most tools declare no output schema. After such a tool returns structured content or a JSON text result, `describe` (and `tools.describe` in `mcpScript`) also shows the output shape seen so far this session: field names and types only, never values. It lives in memory only and is labeled as observed, not a contract.
|
|
1039
|
+
|
|
982
1040
|
For HTTP servers, Pi reports HTTP 503 as temporary unavailability and does not add another immediate retry loop. Keep-alive servers keep cached metadata available and retry after 30 seconds, backing off to 5 minutes. Other failed connects run a one-request shape probe that can turn opaque transport errors into setup hints such as `endpoint returned HTML (200) — this URL does not appear to speak MCP`. Healthy connections are not probed.
|
|
983
1041
|
|
|
984
1042
|
Servers that provide usage guidance via the MCP `instructions` field surface it through discovery paths: `mcp({ server: "name" })` includes a preview, and `mcp({ instructions: "name" })` returns the full text. Instructions are captured at connect time and cached alongside tool metadata, so they stay available without a live connection.
|
package/cli.js
CHANGED
|
@@ -406,6 +406,7 @@ async function runKey(argv, log, error, stdin) {
|
|
|
406
406
|
log("Jev API key removed from the OS secure credential store.");
|
|
407
407
|
}
|
|
408
408
|
if (Object.hasOwn(process.env, "SYSTEMONE_API_KEY")) log("Note: SYSTEMONE_API_KEY is present and overrides the stored key.");
|
|
409
|
+
else if (endpoint.origin === store.OPENROUTER_ORIGIN && Object.hasOwn(process.env, "OPENROUTER_API_KEY")) log("Note: OPENROUTER_API_KEY is present and overrides the stored key.");
|
|
409
410
|
else if (Object.hasOwn(process.env, "TYPESAFE_API_KEY")) log(endpoint.href === store.JEV_DEFAULT_ENDPOINT
|
|
410
411
|
? "Note: TYPESAFE_API_KEY is present and overrides the stored key."
|
|
411
412
|
: `Note: TYPESAFE_API_KEY is ignored for ${endpoint.href}; it is a TypeSafe credential and is never sent there.`);
|
package/direct-tools.ts
CHANGED
|
@@ -16,6 +16,8 @@ import { formatAuthRequiredMessage, normalizeToolArguments, resolveServerUrl, wi
|
|
|
16
16
|
import { SessionRecoveryAuthRequiredError, withSessionRecovery } from "./session-recovery.ts";
|
|
17
17
|
import { combineAbortSignals, isAbortError } from "./runtime-owner.ts";
|
|
18
18
|
import { callToolViaTaskSession } from "./mcp-tasks.ts";
|
|
19
|
+
import { callToolPausingForElicitation } from "./elicitation-handler.ts";
|
|
20
|
+
import { recordObservedOutput } from "./output-shape.ts";
|
|
19
21
|
import { ensureToolCallApproved } from "./tool-approval.ts";
|
|
20
22
|
import { getInputRequiredNeedsUiDetails } from "./errors.ts";
|
|
21
23
|
|
|
@@ -207,6 +209,10 @@ export function createDirectToolExecutor(
|
|
|
207
209
|
}
|
|
208
210
|
|
|
209
211
|
const normalizedParams = spec.resourceUri ? params : normalizeToolArguments(params);
|
|
212
|
+
// The spec is fixed at registration; approval must see the hints the server advertises now.
|
|
213
|
+
const annotations = spec.resourceUri
|
|
214
|
+
? undefined
|
|
215
|
+
: state.toolMetadata.get(spec.serverName)?.find(tool => !tool.resourceUri && tool.originalName === spec.originalName)?.annotations;
|
|
210
216
|
const approval = await ensureToolCallApproved(state, spec.serverName, {
|
|
211
217
|
name: spec.prefixedName,
|
|
212
218
|
originalName: spec.originalName,
|
|
@@ -215,6 +221,7 @@ export function createDirectToolExecutor(
|
|
|
215
221
|
...(spec.resourceUri !== undefined ? { resourceUri: spec.resourceUri } : {}),
|
|
216
222
|
...(spec.uiResourceUri !== undefined ? { uiResourceUri: spec.uiResourceUri } : {}),
|
|
217
223
|
...(spec.uiStreamMode !== undefined ? { uiStreamMode: spec.uiStreamMode } : {}),
|
|
224
|
+
...(annotations !== undefined ? { annotations } : {}),
|
|
218
225
|
}, normalizedParams, ownedSignal, spec.resourceUri ? "resource" : "direct");
|
|
219
226
|
if (approval.ok === false) {
|
|
220
227
|
const denied = approval.reason === "denied";
|
|
@@ -324,7 +331,7 @@ export function createDirectToolExecutor(
|
|
|
324
331
|
requestTimeoutMs: requestOptions?.timeout,
|
|
325
332
|
}) as unknown as ClientCallToolResult;
|
|
326
333
|
}
|
|
327
|
-
return abortable(conn.client
|
|
334
|
+
return abortable(callToolPausingForElicitation(conn.client, {
|
|
328
335
|
name: spec.originalName,
|
|
329
336
|
arguments: normalizedParams,
|
|
330
337
|
_meta: requestMeta,
|
|
@@ -332,6 +339,7 @@ export function createDirectToolExecutor(
|
|
|
332
339
|
},
|
|
333
340
|
);
|
|
334
341
|
uiSession?.sendToolResult(result as unknown as import("@modelcontextprotocol/client").CallToolResult);
|
|
342
|
+
if (!result.isError) recordObservedOutput(state, spec.serverName, spec.originalName, result as Record<string, unknown>);
|
|
335
343
|
|
|
336
344
|
if (result.isError) {
|
|
337
345
|
const content = resolveMcpResultContent(result as Record<string, unknown>, state.owner?.signal);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExtensionUIContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import type { Client } from "@modelcontextprotocol/client";
|
|
3
|
-
import { type ElicitRequest, type ElicitRequestFormParams, type ElicitRequestURLParams, type ElicitResult } from "@modelcontextprotocol/client";
|
|
3
|
+
import { type ElicitRequest, type ElicitRequestFormParams, type ElicitRequestURLParams, type ElicitResult, type RequestOptions } from "@modelcontextprotocol/client";
|
|
4
4
|
export type ElicitationValue = string | number | boolean | string[] | undefined;
|
|
5
5
|
export type ElicitationUIContext = Pick<ExtensionUIContext, "select" | "input" | "notify">;
|
|
6
6
|
export interface ElicitationHandlerOptions {
|
|
@@ -11,6 +11,14 @@ export interface ElicitationHandlerOptions {
|
|
|
11
11
|
}
|
|
12
12
|
export type ServerElicitationConfig = Omit<ElicitationHandlerOptions, "serverName" | "onUrlAccepted">;
|
|
13
13
|
export declare function registerElicitationHandler(client: Client, options: ElicitationHandlerOptions): void;
|
|
14
|
+
/**
|
|
15
|
+
* Calls a tool with the request timeout counting only time the user is not
|
|
16
|
+
* answering an elicitation prompt from the same server. The SDK's own timer
|
|
17
|
+
* cannot be paused, so it is pushed out of the way and the deadline aborts the
|
|
18
|
+
* request with the same timeout error the SDK would raise. A client without an
|
|
19
|
+
* elicitation handler cannot prompt, so it keeps the SDK's timer.
|
|
20
|
+
*/
|
|
21
|
+
export declare function callToolPausingForElicitation(client: Client, params: Parameters<Client["callTool"]>[0], options?: RequestOptions): ReturnType<Client["callTool"]>;
|
|
14
22
|
export declare function handleElicitationRequest(options: ElicitationHandlerOptions, request: ElicitRequest, signal?: AbortSignal): Promise<ElicitResult>;
|
|
15
23
|
export declare function handleFormElicitation(options: ElicitationHandlerOptions, params: ElicitRequestFormParams, signal?: AbortSignal): Promise<ElicitResult>;
|
|
16
24
|
export declare function coerceAndValidateFormValues(params: ElicitRequestFormParams, values: Record<string, ElicitationValue>): Record<string, string | number | boolean | string[]>;
|
|
@@ -1,9 +1,72 @@
|
|
|
1
|
-
import { ProtocolError, ProtocolErrorCode, } from "@modelcontextprotocol/client";
|
|
1
|
+
import { DEFAULT_REQUEST_TIMEOUT_MSEC, ProtocolError, ProtocolErrorCode, SdkError, SdkErrorCode, } from "@modelcontextprotocol/client";
|
|
2
2
|
import { AjvJsonSchemaValidator } from "@modelcontextprotocol/client/validators/ajv";
|
|
3
3
|
import open from "open";
|
|
4
4
|
import { abortable, throwIfAborted } from "./abort.js";
|
|
5
|
+
import { combineAbortSignals } from "./runtime-owner.js";
|
|
6
|
+
const promptPauses = new WeakMap();
|
|
5
7
|
export function registerElicitationHandler(client, options) {
|
|
6
|
-
|
|
8
|
+
const state = { open: 0, deadlines: new Set() };
|
|
9
|
+
promptPauses.set(client, state);
|
|
10
|
+
client.setRequestHandler("elicitation/create", request => whilePromptOpen(state, () => handleElicitationRequest(options, request)));
|
|
11
|
+
}
|
|
12
|
+
async function whilePromptOpen(state, run) {
|
|
13
|
+
if (state.open++ === 0)
|
|
14
|
+
for (const deadline of state.deadlines)
|
|
15
|
+
deadline.pause();
|
|
16
|
+
try {
|
|
17
|
+
return await run();
|
|
18
|
+
}
|
|
19
|
+
finally {
|
|
20
|
+
if (--state.open === 0)
|
|
21
|
+
for (const deadline of state.deadlines)
|
|
22
|
+
deadline.resume();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// setTimeout fires immediately for delays above this.
|
|
26
|
+
const MAX_TIMER_MS = 2 ** 31 - 1;
|
|
27
|
+
/**
|
|
28
|
+
* Calls a tool with the request timeout counting only time the user is not
|
|
29
|
+
* answering an elicitation prompt from the same server. The SDK's own timer
|
|
30
|
+
* cannot be paused, so it is pushed out of the way and the deadline aborts the
|
|
31
|
+
* request with the same timeout error the SDK would raise. A client without an
|
|
32
|
+
* elicitation handler cannot prompt, so it keeps the SDK's timer.
|
|
33
|
+
*/
|
|
34
|
+
export async function callToolPausingForElicitation(client, params, options) {
|
|
35
|
+
const state = promptPauses.get(client);
|
|
36
|
+
if (!state)
|
|
37
|
+
return client.callTool(params, options);
|
|
38
|
+
const timeout = Math.min(options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC, MAX_TIMER_MS);
|
|
39
|
+
const expired = new AbortController();
|
|
40
|
+
let remaining = timeout;
|
|
41
|
+
let startedAt = 0;
|
|
42
|
+
let timer;
|
|
43
|
+
const deadline = {
|
|
44
|
+
pause() {
|
|
45
|
+
if (timer === undefined)
|
|
46
|
+
return;
|
|
47
|
+
clearTimeout(timer);
|
|
48
|
+
timer = undefined;
|
|
49
|
+
remaining -= Date.now() - startedAt;
|
|
50
|
+
},
|
|
51
|
+
resume() {
|
|
52
|
+
startedAt = Date.now();
|
|
53
|
+
timer = setTimeout(() => expired.abort(new SdkError(SdkErrorCode.RequestTimeout, "Request timed out", { timeout })), Math.max(remaining, 0));
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
state.deadlines.add(deadline);
|
|
57
|
+
if (state.open === 0)
|
|
58
|
+
deadline.resume();
|
|
59
|
+
try {
|
|
60
|
+
return await client.callTool(params, {
|
|
61
|
+
...options,
|
|
62
|
+
timeout: MAX_TIMER_MS,
|
|
63
|
+
signal: combineAbortSignals(options?.signal, expired.signal) ?? expired.signal,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
state.deadlines.delete(deadline);
|
|
68
|
+
deadline.pause();
|
|
69
|
+
}
|
|
7
70
|
}
|
|
8
71
|
export async function handleElicitationRequest(options, request, signal) {
|
|
9
72
|
throwIfAborted(signal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elicitation-handler.js","sourceRoot":"","sources":["../elicitation-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,iBAAiB,GAKlB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAiBvD,MAAM,UAAU,0BAA0B,CAAC,MAAc,EAAE,OAAkC;IAC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B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,uCAAuC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC5H,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC9B,CAAC;IACD,cAAc,CAAC,MAAM,CAAC,CAAC;IACvB,OAAO,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,qCAAqC,EAAE,MAAM,CAAC,CAAC;IACjE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AACtH,CAAC"}
|
package/dist/jev-client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypeSafeClient } from "@typesafe-ai/sdk";
|
|
2
2
|
import { isServerDisabled } from "./types.js";
|
|
3
3
|
import { combineAbortSignals } from "./runtime-owner.js";
|
|
4
|
-
import { JEV_SDK_PATH, resolveJevCredential, resolveJevEndpoint } from "./jev-key-store.js";
|
|
4
|
+
import { JEV_SDK_PATH, OPENROUTER_ORIGIN, resolveJevCredential, resolveJevEndpoint } from "./jev-key-store.js";
|
|
5
5
|
const DEFAULTS = {
|
|
6
6
|
semanticSearch: false, scriptEvaluation: false, allowedServers: [], model: "jev-1.13.0",
|
|
7
7
|
requestTimeoutMs: 5_000, maxRetries: 0, maxStateBytes: 262_144,
|
|
@@ -10,6 +10,8 @@ const DEFAULTS = {
|
|
|
10
10
|
semanticMinProbability: 0.2,
|
|
11
11
|
};
|
|
12
12
|
const DANGEROUS_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
13
|
+
/** OpenRouter's name for Jev, used there when `settings.jev.model` is not configured. */
|
|
14
|
+
const OPENROUTER_DEFAULT_MODEL = "typesafe/jev-1.13";
|
|
13
15
|
const hosts = new WeakMap();
|
|
14
16
|
const credentials = new WeakMap();
|
|
15
17
|
/**
|
|
@@ -218,8 +220,8 @@ function sameKeys(actual, expected) {
|
|
|
218
220
|
return keys.length === expected.length && expected.every(key => Object.hasOwn(actual, key));
|
|
219
221
|
}
|
|
220
222
|
function validateResponse(value, input) {
|
|
223
|
+
// Providers may add metadata such as `id`, `provider`, or `usage.cost`; only the fields validated here are kept.
|
|
221
224
|
const response = record(value, "response");
|
|
222
|
-
exactKeys(response, ["model", "answers", "usage"], "response");
|
|
223
225
|
const answers = record(response.answers, "response answers");
|
|
224
226
|
const questionNames = Object.keys(input.questions);
|
|
225
227
|
if (!sameKeys(answers, questionNames))
|
|
@@ -259,8 +261,6 @@ function validateResponse(value, input) {
|
|
|
259
261
|
if (typeof response.model !== "string" || response.model.length === 0 || response.model.length > 128)
|
|
260
262
|
throw new Error("Invalid response model");
|
|
261
263
|
const usage = record(response.usage, "response usage");
|
|
262
|
-
if (!sameKeys(usage, ["input_tokens", "output_tokens"]))
|
|
263
|
-
throw new Error("Invalid response usage");
|
|
264
264
|
return { answers: validated, model: response.model, usage: { inputTokens: safeNumber(usage.input_tokens, "input tokens", true), outputTokens: safeNumber(usage.output_tokens, "output tokens", true) } };
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
@@ -348,7 +348,9 @@ export async function evaluateJev(state, value, options) {
|
|
|
348
348
|
const timer = setTimeout(() => { timedOut = true; deadline.abort(new Error("Jev evaluation deadline exceeded")); }, settings.requestTimeoutMs);
|
|
349
349
|
const signal = combineAbortSignals(options.signal, state.owner.signal, deadline.signal);
|
|
350
350
|
try {
|
|
351
|
-
const
|
|
351
|
+
const configured = state.config.settings?.jev;
|
|
352
|
+
const model = resolved.endpoint.origin === OPENROUTER_ORIGIN && (!configured || configured.model === undefined) ? OPENROUTER_DEFAULT_MODEL : settings.model;
|
|
353
|
+
const request = { state: input.state, questions: input.questions, model };
|
|
352
354
|
const raw = await resolved.client.systemOne(request, { ...(signal ? { signal } : {}), timeout: settings.requestTimeoutMs, retry: { maxRetries: settings.maxRetries } });
|
|
353
355
|
try {
|
|
354
356
|
return { ok: true, data: validateResponse(raw, input) };
|