@plurnk/plurnk-mcp 1.8.0 → 1.9.1

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/README.md CHANGED
@@ -13,11 +13,11 @@ serves its standard surface at its own negotiated revision. Plurnk does not
13
13
  downgrade its own extension wire, but it does not reject an older supported
14
14
  revision.
15
15
 
16
- ## Manage workspace servers
16
+ ## Manage Worker servers
17
17
 
18
- Service environment variables provide available servers for every workspace;
18
+ Service environment variables provide available servers for every Worker;
19
19
  `PLURNK_MCP_ENABLED` selects the exact cold-enabled subset. Users can add,
20
- enable, disable, or remove workspace servers without restarting the daemon. An
20
+ enable, disable, or remove one Worker's servers without restarting the daemon. An
21
21
  existing AG-UI connection sends the ordinary management-action form under
22
22
  `forwardedProps.plurnk.action`:
23
23
 
@@ -27,10 +27,12 @@ existing AG-UI connection sends the ordinary management-action form under
27
27
  "plurnk": {
28
28
  "workspace": "example",
29
29
  "action": {
30
- "kind": "workspace.mcp.add",
30
+ "kind": "worker.mcp.add",
31
31
  "alias": "project",
32
- "target": "/opt/mcp/current-server",
33
- "options": {
32
+ "definition": {
33
+ "name": "project",
34
+ "transport": "stdio",
35
+ "command": "/opt/mcp/current-server",
34
36
  "args": ["--stdio"],
35
37
  "env": { "PROJECT_TOKEN": "${PROJECT_TOKEN}" },
36
38
  "tools": ["issue_read", "issue_write"],
@@ -43,20 +45,22 @@ existing AG-UI connection sends the ordinary management-action form under
43
45
  ```
44
46
 
45
47
  The standard `plurnk.action.result` event reports success or exact RFC 9457
46
- Problem Details. The definition is durable and workspace-shared; symbolic
48
+ Problem Details. The definition is durable and Worker-private; symbolic
47
49
  environment references remain unexpanded at rest.
48
50
 
49
- Available workspace actions are:
51
+ MCP is one family of Worker Functionality; the common lifecycle actions are
52
+ published by the coordinator and the two continuations by this module:
50
53
 
51
54
  | Action | Parameters |
52
55
  |---|---|
53
- | `workspace.mcp.list` | optional client `overlay` |
54
- | `workspace.mcp.add` | `alias`, `target`; optional `options` |
55
- | `workspace.mcp.enable` | `alias`; optional client `overlay` and explicit `options` |
56
- | `workspace.mcp.disable` | `alias` |
57
- | `workspace.mcp.remove` | `alias` |
58
- | `workspace.mcp.oauth.complete` | `alias`, complete `callbackUrl` |
59
- | `workspace.mcp.complete` | `server`, completion `ref` and `argument`; optional `context` |
56
+ | `worker.mcp.list` | — |
57
+ | `worker.mcp.discover` | optional `query`, `source` (URL or command line), `configuration` (a client's `PLURNK_MCP_*` overlay) |
58
+ | `worker.mcp.add` | optional `alias` (must equal the definition's `name`), `definition: McpServerDefinition` |
59
+ | `worker.mcp.enable` / `disable` / `remove` | `alias` |
60
+ | `worker.mcp.oauth.complete` | `alias`, complete `callbackUrl` |
61
+ | `worker.mcp.complete` | `server`, completion `ref` and `argument`; optional `context` |
62
+
63
+ The model manages the same family through `EXEC [mcp] (list|discover|add|enable|disable|remove)`.
60
64
 
61
65
  The owning [specification](./SPEC.md) defines the complete action and server
62
66
  definition contracts.
@@ -75,10 +79,10 @@ PLURNK_MCP_GITEA_ARGS=["plurnk_pk"]
75
79
  ```
76
80
 
77
81
  The client carries its raw declarations while listing and enabling. Listing is
78
- inert. `/mcp enable gitea` (or `plurnk mcp enable gitea` in a named workspace)
79
- composes service, durable workspace, client, and optional command-file fields
82
+ inert. `/mcp enable gitea` (or `plurnk mcp enable gitea` in a bound conversation)
83
+ composes service, durable worker, client, and optional command-file fields
80
84
  in that order, prepares the connection, then persists the complete unexpanded
81
- workspace specialization. Arrays and maps replace rather than append or merge.
85
+ worker specialization. Arrays and maps replace rather than append or merge.
82
86
 
83
87
  ## Demo fixtures
84
88
 
@@ -152,13 +156,13 @@ Portable timeouts and complete examples live in [`.env.defaults`](./.env.default
152
156
 
153
157
  | MCP surface | Plurnk surface |
154
158
  |---|---|
155
- | Server tools | `worker://plurnk/tools/<server>.md` family summary |
156
- | Enabled tool | Exact `worker://plurnk/tools/<server>/<encoded-tool>.md` document and `## EXEC0 [server] (tool)` |
159
+ | Server tools | `worker://~/_plurnk/tools/<server>.md` family summary |
160
+ | Enabled tool | Exact `worker://~/_plurnk/tools/<server>/<encoded-tool>.md` document and `## EXEC0 [server] (tool)` |
157
161
  | Resource catalog | `server:///` or `server:///resources` |
158
162
  | Resource | `server:///resources/<encoded-uri>` through ordinary `FIND` and `READ` |
159
163
  | Prompt catalog | `server:///prompts` |
160
164
  | Prompt retrieval | `server:///prompts/<encoded-name>?argument=value` through ordinary `READ` |
161
- | Completion | Client-owned `workspace.mcp.complete` action |
165
+ | Completion | Client-owned `worker.mcp.complete` action |
162
166
 
163
167
  Tool results, resource bodies, prompt messages, and failures become ordinary
164
168
  Plurnk entries and channels. Disabled tools appear in neither teaching nor
@@ -176,7 +180,7 @@ HTTP definitions support bearer references, client credentials, and
176
180
  interactive OAuth. Stdio never receives OAuth. Interactive add or enable returns
177
181
  `{ "status": 202, "authorization": { "url": "..." } }` without publishing a
178
182
  partial server. After the user completes that URL, the client submits its
179
- complete callback URL through `workspace.mcp.oauth.complete`. PKCE, issuer and
183
+ complete callback URL through `worker.mcp.oauth.complete`. PKCE, issuer and
180
184
  resource validation, refresh, scope escalation, and credentials remain inside
181
185
  the host connection.
182
186
 
package/SPEC.md CHANGED
@@ -85,7 +85,7 @@ nothing task-shaped is written to SQLite and no MCP sidecar lifecycle exists.
85
85
  |---|---|
86
86
  | Client disconnect | The daemon-owned operation and its task keep running; the client reattaches to the operation, not the task. |
87
87
  | Daemon restart | The connection and every in-flight task handle die with it; the tool call fails like any interrupted operation, the loop re-runs, and the tool call creates a fresh task. |
88
- | Workspace reattachment | The attachment reconstructs from its durable definition; in-flight tasks on the replaced connection are abandoned, not resumed. |
88
+ | Worker reactivation | The attachment reconstructs from its durable definition; in-flight tasks on the replaced connection are abandoned, not resumed. |
89
89
  | Expiry | The owning operation deadline bounds polling; a non-converging task fails at the standard round bound and is cancelled. |
90
90
  | Cancellation | Owner abort cancels the task before settling; the handle is then terminal. |
91
91
  | Already terminal | Terminal results and errors are consumed by the drive loop; a completed or failed task is never re-polled or re-resumed. |
@@ -164,20 +164,20 @@ originating distinction in its canonical Problem/result path.
164
164
 
165
165
  ## §mcp-configuration Configuration
166
166
 
167
- Service configuration and workspace state produce one available set and one
168
- enabled subset per workspace. Every `PLURNK_MCP_<server>` declares an available
167
+ Service configuration and worker state produce one available set and one
168
+ enabled subset per worker. Every `PLURNK_MCP_<server>` declares an available
169
169
  service-owned definition. `PLURNK_MCP_ENABLED` names the exact subset enabled
170
- when a workspace has no override. Workspace state may positively override a
170
+ when a worker has no override. Worker state may positively override a
171
171
  service definition's enabledness or own an added definition and its enabledness.
172
172
  Disabled definitions remain client-visible but contribute no connection,
173
173
  Registry, documentation, or resource authority.
174
174
 
175
- §mcp-hydration-isolation **Cold endpoint failure is capability-local.** Invalid
175
+ §mcp-activation-isolation **Cold endpoint failure is capability-local.** Invalid
176
176
  service configuration or durable state fails admission, but an enabled server
177
- that cannot connect or complete discovery during workspace hydration remains
177
+ that cannot connect or complete discovery during worker activation remains
178
178
  enabled and client-visible as `unavailable`. It publishes no runtime, tools,
179
179
  resources, or documentation and cannot prevent other capabilities or the daemon
180
- from starting. Enabling that already-enabled alias is an explicit reconnect
180
+ from starting or serving dormant workers. Enabling that already-enabled alias is an explicit reconnect
181
181
  attempt; failure preserves the unavailable snapshot, while success atomically
182
182
  replaces it. Interactive add and enable mutations continue to reject an
183
183
  unavailable candidate without changing durable state.
@@ -244,87 +244,108 @@ discovery state, and authorization callback state remain process-memory
244
244
  credentials; a restart reconstructs the attachment as authorization-required
245
245
  instead of writing secrets into SQLite.
246
246
 
247
- The contracts-owned `McpServerOptions` schema is the closed supplement accepted
248
- by `workspace.mcp.add` and customized enable. It may contain `args`, `cwd`,
249
- `env`, `headers`, `authorization`, `tools`, and `read`; it cannot repeat alias,
250
- target, or transport. An absolute HTTP(S) target selects Streamable HTTP. Every
251
- other target is one exact stdio executable. The normalized definition rejects
247
+ The contracts-owned `McpServerDefinition` is the exact definition one `add`
248
+ accepts and the coordinator persists; a client composes it from its target
249
+ (an absolute HTTP(S) URL selects Streamable HTTP, anything else is one exact
250
+ stdio executable) and its options (`args`, `cwd`, `env`, `headers`,
251
+ `authorization`, `tools`, `read`). The normalized definition rejects
252
252
  transport-inapplicable options before any connection work.
253
253
 
254
254
  §mcp-configuration-cascade MCP server configuration has one field-wise
255
- precedence order: service environment, durable workspace specialization,
256
- client configuration overlay, then explicit action options. Arrays and maps
257
- replace their lower value instead of appending or merging. A client-supplied
258
- target replaces the complete lower definition before its companion variables
259
- apply; a companion without a client target specializes the lower definition.
260
- The contracts-owned `{§mcp-configuration-overlay}` is parsed by the same owner
261
- and path as service environment declarations. It carries no service controls,
262
- does not activate a server, and is never persisted as raw environment syntax.
263
- A successful customized enable persists one complete, normalized, unexpanded
264
- workspace definition. Thus later enablement needs neither the originating
265
- client nor its configuration file, and symbolic credentials remain resolvable
266
- only by the service at connection preparation.
267
-
268
- ### §mcp-management-actions Workspace management
269
-
270
- Every action below declares `scope: "workspace"` under
271
- {§module-action-registration}. AG-UI binds its workspace; none accepts a
272
- workspace identifier in params.
255
+ precedence order: service environment, then the Worker's durable definition.
256
+ Arrays and maps replace their lower value instead of appending or merging.
257
+ Client configuration is not a live layer: the contracts-owned
258
+ `{§mcp-configuration-overlay}` enters only as the `configuration` of a
259
+ `discover` query, is parsed by the same owner and path as service environment
260
+ declarations, and yields inert candidates with client-configuration provenance
261
+ ({§mcp-discovery}); adding one persists a complete, normalized, unexpanded
262
+ Worker definition. Thus later enablement needs neither the originating client
263
+ nor its configuration file, and symbolic credentials remain resolvable only by
264
+ the service at connection preparation.
265
+
266
+ ### §mcp-module The MCP family beneath the coordinator
267
+
268
+ §mcp-management-actions MCP is one family of Worker Functionality
269
+ ({§functionality-coordinator}): the coordinator publishes `worker.mcp.list |
270
+ discover | add | enable | disable | remove` and the model's `EXEC [mcp]`
271
+ family with the common semantics, durable state, and publication; this module
272
+ registers the family adapter and owns protocol truth beneath it. `available`
273
+ is the service environment with its `PLURNK_MCP_ENABLED` defaults; `admit`
274
+ validates one exact definition and binds the alias to its `name`; `prepare`
275
+ connects the enabled set, reusing unchanged live attachments, and returns one
276
+ executor family and resource facet per connected server, one outcome per alias
277
+ (`active` with catalog detail — negotiated protocol version, server identity,
278
+ capabilities, tool names, resource and prompt counts — `unavailable` with its
279
+ exact Problem, or `authorization-required` with its URL), and a two-phase
280
+ snapshot: `commit` closes connections the new set no longer uses and records
281
+ pending authorizations; `abort` closes only what the attempt opened.
282
+
283
+ Two protocol continuations remain MCP-registered worker actions beneath the
284
+ common grammar:
273
285
 
274
286
  | Action | Parameters | Result / effect |
275
287
  |---|---|---|
276
- | `workspace.mcp.list` | optional `overlay: McpConfigurationOverlay` | Sorted available server summaries: alias, source, target, transport, enabledness, connection/authorization/unavailable state, unavailable Problem, negotiated identity/capabilities, enabled tools, and read subset. A client-only definition is shown disabled with source `client`; carrying configuration neither connects nor persists it. No credential values. |
277
- | `workspace.mcp.add` | `alias`, `target`; optional `options: McpServerOptions` | Adds and enables a workspace-owned alias absent from the available set. Preparation completes before publication. |
278
- | `workspace.mcp.enable` | `alias`; optional `overlay: McpConfigurationOverlay`, `options: McpServerOptions` | Resolves the alias through {§mcp-configuration-cascade} and enables it for this workspace. A definition differing from the service baseline becomes the durable workspace specialization. Successful preparation precedes persistence and capability publication. Already connected with the same definition is a no-op; already enabled but unavailable retries preparation. |
279
- | `workspace.mcp.disable` | `alias` | Disables an available alias, retaining it for client discovery while removing its connection and complete model-facing capability set. Already disabled is a no-op. |
280
- | `workspace.mcp.remove` | `alias` | Removes a workspace specialization. A same-named service definition is revealed disabled; a workspace-only alias disappears. Service definitions without a specialization reject removal and direct the client to disable them. |
281
- | `workspace.mcp.oauth.complete` | `alias`, `callbackUrl` | State- and issuer-validates one pending interactive callback through the SDK, completes connection preparation, then performs the originally requested add or enable. |
282
- | `workspace.mcp.complete` | `server`, `ref`, `argument`; optional `context` | Requests negotiated prompt/resource-template argument completion for a client-owned interaction. |
283
-
284
- Expected preparation failures cross the action boundary as MCP-management
285
- Problems rather than generic AG-UI failures:
288
+ | `worker.mcp.oauth.complete` | `alias`, `callbackUrl` | State- and issuer-validates one pending interactive callback through the SDK, completes connection preparation, and re-enables the alias through the coordinator ({§oauth-continuation}); the result is the common mutation result. |
289
+ | `worker.mcp.complete` | `server`, `ref`, `argument`; optional `context` | Requests negotiated prompt/resource-template argument completion for a client-owned interaction. |
290
+
291
+ §mcp-discovery Discovery is inert. `configuration` (a client's own
292
+ `PLURNK_MCP_*` overlay) becomes candidates without connecting; `source` — an
293
+ absolute HTTP(S) URL or one whitespace-separated command line — is probed at the
294
+ negotiated revision for its catalog and released, yielding one candidate with
295
+ direct-target provenance (an authorization challenge yields the candidate with
296
+ that fact in its summary); a bare `query` requires a configured downstream
297
+ registry and is `501 registry-not-configured` until one exists. No candidate
298
+ is installed, persisted, enabled, or executed by discovery.
299
+
300
+ Expected preparation failures cross the boundary as MCP-management Problems
301
+ rather than generic failures; an explicit client action rejects them and a
302
+ Worker's own accepted mutation publishes them as unavailable
303
+ ({§functionality-model-mutation}):
286
304
 
287
305
  | Endpoint condition | Problem |
288
306
  |---|---|
289
307
  | Cannot connect or complete discovery/catalog preparation at the negotiated revision | `502 server-unavailable`, retryable; names the server and transport without exposing credentials |
290
308
  | Client-credentials grant rejected by the authorization server | `502 oauth-client-credentials-failed`, non-retryable; names the server and client id, never the secret ({§oauth-client-credentials}) |
291
309
 
292
- Interactive preparation returns a successful pending result shaped as
293
- `{ status: 202, authorization: { url } }`; it publishes no candidate runtime.
294
- The action owner retains one pending candidate per `(workspace, alias)` and a
295
- new request cancels and replaces it ({§oauth-lifetime}). Unrelated workspace
296
- changes remain authoritative while authorization is pending; drift of the same
297
- server fails completion with a conflict instead of replaying a stale workspace
298
- snapshot. `oauth.complete` accepts the complete
299
- callback URL so state, `code`, and `iss` remain one parsing unit. A missing,
300
- expired, mismatched, or replayed callback fails without exposing attacker-owned
301
- OAuth error text. It completes either pending hydration or the originally
302
- requested add or enable.
310
+ §oauth-continuation Interactive preparation publishes the alias as enabled and
311
+ `authorization-required` with its URL; it publishes no runtime. The adapter
312
+ retains one pending candidate per `(worker, alias)` holding the challenged
313
+ connection and one Worker residency lease; a new challenge for the alias
314
+ supersedes and releases the previous one ({§oauth-lifetime}).
315
+ `oauth.complete` accepts the complete callback URL so state, `code`, and
316
+ `iss` remain one parsing unit; it finishes the pending connection's
317
+ authorization, prepares its active attachment, and re-enables the alias through
318
+ the coordinator, whose publication consumes the prepared attachment and
319
+ releases the lease. A callback for a superseded attempt fails as invalid; a
320
+ committed attachment that no longer matches the pending definition fails
321
+ with a conflict instead of replaying a stale snapshot. A missing, expired,
322
+ mismatched, or replayed callback fails without exposing attacker-owned OAuth
323
+ error text.
303
324
 
304
325
  ## §oauth-lifetime Interactive OAuth lifetime and reauthorization
305
326
 
306
327
  Interactive OAuth state is deliberately ephemeral and process-memory: client
307
328
  registration data, access and refresh tokens, the PKCE verifier, and pending
308
329
  state live only in the owning connection or pending candidate. Nothing
309
- OAuth-secret is written to SQLite; the durable workspace state holds only the
330
+ OAuth-secret is written to SQLite; the durable worker state holds only the
310
331
  unexpanded definition ({§mcp-configuration}). There is no callback HTTP
311
332
  listener, authority-root resource, or daemon-side browser side channel: the
312
- client returns the complete callback URL through `workspace.mcp.oauth.complete`
333
+ client returns the complete callback URL through `worker.mcp.oauth.complete`
313
334
  so `state`, `code`, and `iss` remain one parsing unit. Reauthorization after a
314
335
  daemon restart is the intended journey, documented here rather than presented
315
336
  as an accidental failure.
316
337
 
317
338
  | Journey point | Behaviour |
318
339
  |---|---|
319
- | Pending authorization | One pending candidate per `(workspace, alias)`; a new add or customized enable cancels and replaces it. A callback from a superseded attempt fails state validation instead of cross-completing. |
340
+ | Pending authorization | One pending candidate per `(worker, alias)`; a new add or customized enable cancels and replaces it. A callback from a superseded attempt fails state validation instead of cross-completing. |
320
341
  | Client disconnect | Does not touch the pending candidate; it can still be completed, or replaced by a fresh request. |
321
342
  | Daemon restart during pending | The candidate is lost: nothing was durable, no attachment publishes, and `oauth.complete` answers `404 oauth-not-pending`. Start authorization again. |
322
343
  | Daemon restart after authorization | The durable definition rehydrates but tokens are gone; the attachment publishes `authorization-required` and enable returns a fresh `{ status: 202, authorization: { url } }`. The operator reauthorizes. |
323
344
  | Token expiry | An expired access token surfaces as one unauthorized response; the SDK re-acquires via `refresh_token` when one was issued, otherwise re-enters interactive authorization. |
324
345
  | Refresh | Happens only against the issuer bound during the original authorization; the refreshed token replaces the in-memory token. |
325
- | Workspace disable/remove | Closes the attachment and clears its pending candidate; no durable secret deletion is needed because nothing secret is durable. |
346
+ | Worker disable/remove | Closes the attachment and clears its pending candidate; no durable secret deletion is needed because nothing secret is durable. |
326
347
  | Server replacement | Completion compares the pending candidate's expected definition with the current one; drift of the same server fails `409 oauth-target-conflict` instead of replaying a stale snapshot. |
327
- | Cross-authorization protection | Candidates are keyed by `(workspace, alias)`; callback state, PKCE, and issuer are validated by the SDK against the attempt that created them, so no other workspace, alias, or attempt can complete this authorization. |
348
+ | Cross-authorization protection | Candidates are keyed by `(worker, alias)`; callback state, PKCE, and issuer are validated by the SDK against the attempt that created them, so no other worker, alias, or attempt can complete this authorization. |
328
349
 
329
350
  ## §oauth-client-credentials Client-credentials grant adoption
330
351
 
@@ -376,17 +397,28 @@ decision on durable identity material is ratified.
376
397
 
377
398
  ## §mcp-setup Atomic lifecycle
378
399
 
379
- For each workspace, hydration resolves service defaults and durable positive
380
- workspace state, opens and discovers only enabled connections,
400
+ When a cold worker is demanded, activation resolves service defaults and durable positive
401
+ worker state, opens and discovers only enabled connections,
381
402
  lists the negotiated catalogs, applies enabled/effect policy, builds each exact
382
403
  tool Registry and resource facet, and submits one complete owner snapshot to
383
- {§module-workspace-capabilities}. A configured tool absent from the server, a
404
+ {§module-worker-capabilities}. A configured tool absent from the server, a
384
405
  duplicate remote name, an enabled name not representable as a Plurnk target,
385
- or a `read` name outside the enabled set fails that workspace hydration. No
406
+ or a `read` name outside the enabled set fails that worker activation. No
386
407
  partial namespace is published and every acquired candidate closes.
387
408
 
409
+ MCP participates in core Functionality residency ({§module-worker-residency}).
410
+ Every tool call and Task retains the worker from executor entry through its
411
+ terminal result; an interactive OAuth candidate retains it until completion,
412
+ replacement, cancellation, or module shutdown. Catalog refresh timers are
413
+ infrastructure, not residency owners: cooling serializes behind a refresh
414
+ already running and cancels any timer not yet begun. At a lease-free quiescent
415
+ boundary, deactivation removes the worker snapshot and closes all of its
416
+ connections. Core separately withdraws the executor/scheme publication while
417
+ preserving durable MCP state and generated reference entries for transparent
418
+ reactivation.
419
+
388
420
  Add and enable prepare the candidate while the old snapshot remains
389
- authoritative, then commit only at {§module-workspace-quiescence}. Disable and
421
+ authoritative, then commit only at {§module-worker-quiescence}. Disable and
390
422
  remove commit the complete reduced snapshot at the same boundary. The
391
423
  old connection rejects replacement while it owns an active protocol request,
392
424
  MRTR exchange, or Task. Cache/list-change watches are infrastructure and close
@@ -395,17 +427,19 @@ commit leaves the durable definition, connection, Registry, docs, and resource
395
427
  authority unchanged. Materialization and registration inspect the complete
396
428
  owning operation result; a non-success preserves its original Problem.
397
429
 
398
- Shutdown first prevents new work, cancels pending OAuth candidates and
399
- infrastructure watches, settles every active request and Task, closes every
400
- acquired connection, then reports all close failures. Whole-connection
401
- shutdown retires subscription work before closing its transport; it does not
402
- first issue a redundant per-listen cancellation.
430
+ Shutdown first prevents new serialized work, cancels infrastructure watches,
431
+ and closes every acquired connection—including a candidate still negotiating.
432
+ That cancellation reaches pending OAuth, active requests, and Tasks. It then
433
+ waits active mutations to settle, discards process-local snapshots, and reports
434
+ every close failure. Whole-connection shutdown retires subscription work before
435
+ closing its transport; it does not first issue a redundant per-listen
436
+ cancellation.
403
437
 
404
438
  ## §mcp-host-composition Protocol-to-Plurnk composition
405
439
 
406
440
  One `ServerConnection` owns negotiation, SDK caches, authorization partition,
407
441
  subscriptions, active request controllers, MRTR rounds, and Tasks for one
408
- workspace attachment. The host does not reproduce SDK protocol machinery.
442
+ worker attachment. The host does not reproduce SDK protocol machinery.
409
443
 
410
444
  | Protocol event | Plurnk composition |
411
445
  |---|---|
@@ -459,8 +493,8 @@ even then the capability would be per-client-advertised, never daemon-wide.
459
493
 
460
494
  | MCP surface | Plurnk surface |
461
495
  |---|---|
462
- | Server | One registered executor family, `worker://plurnk/tools/<server>.md`, and matching resource scheme |
463
- | Enabled tool | One annotated call in the compact family document plus one exact `worker://plurnk/tools/<server>/<encoded-tool>.md` input-contract document |
496
+ | Server | One registered executor family, `worker://~/_plurnk/tools/<server>.md`, and matching resource scheme |
497
+ | Enabled tool | One annotated call in the compact family document plus one exact `worker://~/_plurnk/tools/<server>/<encoded-tool>.md` input-contract document |
464
498
  | Tool survey | Ordinary FIND summary metadata from the standard executable-tool resource tree |
465
499
  | Resource catalog | `<server>:///` and `<server>:///resources` |
466
500
  | Resources | `<server>:///resources` and encoded resource-URI descendants |
@@ -9,12 +9,12 @@ export default class McpExecutor extends BaseExecutor {
9
9
  constructor(metadata: {
10
10
  runtime: string;
11
11
  glyph: string;
12
- }, connection: ServerConnection, policy?: Partial<ToolPolicy>, toolSummaries?: ReadonlyMap<string, string>);
12
+ }, connection: ServerConnection, retainWorkspace: () => () => void, policy?: Partial<ToolPolicy>, toolSummaries?: ReadonlyMap<string, string>);
13
13
  get manifest(): {
14
14
  name: string;
15
+ authority?: import("@plurnk/plurnk-schemes").SchemeAuthority;
15
16
  channels: Record<string, string>;
16
17
  defaultChannel: string;
17
- category: "data" | "logging" | "control";
18
18
  writableBy: ReadonlyArray<import("@plurnk/plurnk-schemes").WriterTier>;
19
19
  volatile: boolean;
20
20
  modelVisible: boolean;
@@ -26,6 +26,29 @@ export default class McpExecutor extends BaseExecutor {
26
26
  documentation?: string;
27
27
  glyph?: string;
28
28
  storedScheme?: string;
29
+ category: "data";
30
+ entryOwner: import("@plurnk/plurnk-schemes").SchemeEntryOwner;
31
+ inherit: import("@plurnk/plurnk-schemes").SchemeEntryInheritance;
32
+ example: string;
33
+ } | {
34
+ name: string;
35
+ authority?: import("@plurnk/plurnk-schemes").SchemeAuthority;
36
+ channels: Record<string, string>;
37
+ defaultChannel: string;
38
+ writableBy: ReadonlyArray<import("@plurnk/plurnk-schemes").WriterTier>;
39
+ volatile: boolean;
40
+ modelVisible: boolean;
41
+ folderScopes?: boolean;
42
+ textEditScopes?: boolean;
43
+ lineAnchors?: boolean;
44
+ foldedByDefault?: boolean;
45
+ flags?: import("@plurnk/plurnk-schemes").SchemeFlagAffinity;
46
+ documentation?: string;
47
+ glyph?: string;
48
+ storedScheme?: string;
49
+ category: "logging" | "control";
50
+ entryOwner?: never;
51
+ inherit?: never;
29
52
  example: string;
30
53
  };
31
54
  get channels(): Readonly<Record<string, ChannelDecl>>;
@@ -1 +1 @@
1
- {"version":3,"file":"McpExecutor.d.ts","sourceRoot":"","sources":["../src/McpExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EAMf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,UAAU,EAEV,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,EAAE,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAkB9C,eAAO,MAAM,aAAa,SAChB,MAAM,WACH,aAAa,GAAG,SAAS,YACxB,MAAM,GAAG,SAAS,KAC7B,MAYF,CAAC;AAEF,eAAO,MAAM,WAAW,SAAU,MAAM,WAAW,MAAM,eAAe,OAAO,KAAG,WAchF,CAAC;AAuBH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,YAAY;;IAQjD,YACI,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAC5C,UAAU,EAAE,gBAAgB,EAC5B,MAAM,GAAE,OAAO,CA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AAe,OAAO,KAAG,WAchF,CAAC;AAuBH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,YAAY;;IASjD,YACI,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAC5C,UAAU,EAAE,gBAAgB,EAC5B,eAAe,EAAE,MAAM,MAAM,IAAI,EACjC,MAAM,GAAE,OAAO,CAAC,UAAU,CAAM,EAChC,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAQ9C;IAED,IAAa,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKpB;IAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAMpD;IAEQ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAK7C;IAgCD,YAAY,IAAI,mBAAmB,CAKlC;IAED,IAAI,OAAO,IAAI,aAAa,CAK3B;IAEc,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAgBvE;IAEK,gBAAgB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqBzE;IAEK,GAAG,CAAC,EACN,OAAO,EACP,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,GACX,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAoHhC;CACJ"}
@@ -65,13 +65,15 @@ export default class McpExecutor extends BaseExecutor {
65
65
  #read;
66
66
  #registry = null;
67
67
  #toolSummaries;
68
+ #retainWorkspace;
68
69
  #catalog = null;
69
- constructor(metadata, connection, policy = {}, toolSummaries) {
70
+ constructor(metadata, connection, retainWorkspace, policy = {}, toolSummaries) {
70
71
  super(metadata);
71
72
  this.#connection = connection;
72
73
  this.#tools = policy.tools ?? null;
73
74
  this.#read = new Set(policy.read ?? []);
74
75
  this.#toolSummaries = toolSummaries ?? new Map();
76
+ this.#retainWorkspace = retainWorkspace;
75
77
  }
76
78
  get manifest() {
77
79
  return {
@@ -185,14 +187,14 @@ export default class McpExecutor extends BaseExecutor {
185
187
  const input = body.trim();
186
188
  if (target === null || target.length === 0) {
187
189
  return fail("tool-required", 400, `MCP executor '${runtime}' requires a tool target.`, {
188
- recovery: `Select a target documented under worker://plurnk/tools/${runtime}/.`,
190
+ recovery: `Select a target documented under worker://~/_plurnk/tools/${runtime}/.`,
189
191
  retryable: false,
190
192
  });
191
193
  }
192
194
  if (!this.#enabledTargets().has(target)) {
193
195
  return fail("tool-not-enabled", 404, `MCP tool '${target}' is not enabled on '${runtime}'.`, {
194
196
  tool: target,
195
- recovery: `Select a target documented under worker://plurnk/tools/${runtime}/.`,
197
+ recovery: `Select a target documented under worker://~/_plurnk/tools/${runtime}/.`,
196
198
  retryable: false,
197
199
  });
198
200
  }
@@ -213,6 +215,7 @@ export default class McpExecutor extends BaseExecutor {
213
215
  });
214
216
  }
215
217
  }
218
+ const releaseWorkspace = this.#retainWorkspace();
216
219
  try {
217
220
  const tool = this.#catalog?.tools.find((candidate) => candidate.name === target);
218
221
  if (tool === undefined) {
@@ -237,6 +240,9 @@ export default class McpExecutor extends BaseExecutor {
237
240
  retryable: !signal.aborted,
238
241
  });
239
242
  }
243
+ finally {
244
+ releaseWorkspace();
245
+ }
240
246
  }
241
247
  }
242
248
  //# sourceMappingURL=McpExecutor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"McpExecutor.js","sourceRoot":"","sources":["../src/McpExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,iBAAiB,GACpB,MAAM,sBAAsB,CAAC;AAc9B,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAA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