@fungi.computer/knapsack 0.2.0 → 0.2.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
@@ -98,7 +98,11 @@ invalidates its captured modules when that list changes.
98
98
  Computer calls preserve Mycelium's invocation context, including its execution
99
99
  identity, abort signal and deadline. Advertised Computer operations are marked
100
100
  unsafe to replay because their implementation can change external state. The
101
- host's provider remains responsible for admission on each call.
101
+ host's provider remains responsible for admission on each call. An interactive
102
+ host may set `confirmCalls: true` on its Computer connection to request Mycelium
103
+ confirmation before every advertised call. The advertisement does not
104
+ distinguish read-only from mutating operations, so this policy confirms both;
105
+ other connections keep their existing approval policy.
102
106
 
103
107
  `Knapsack.files({ port })` builds a Files module and direct tools from one port.
104
108
  Text edits use `port.replace` with the expected original content; the host must
package/dist/index.d.ts CHANGED
@@ -15,6 +15,9 @@ export type ComputerConnectionOptions = Readonly<{
15
15
  name: string;
16
16
  /** Logical parent namespace; the Computer name is its final segment. */
17
17
  namespace?: readonly string[];
18
+ /** Ask a person before each advertised call on this connection. The host
19
+ * chooses this for interactive MCP; Agent connections keep their own policy. */
20
+ confirmCalls?: boolean;
18
21
  /** Files scoped by the host to this Computer, under its own authority id. */
19
22
  files?: FilesConnectionOptions;
20
23
  /**
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ function projectComputer(input, advertisement) {
57
57
  operations[advertised.id] = Mycelium.operation({
58
58
  // Computer advertisements may execute arbitrary host actions.
59
59
  replay: "unsafe",
60
+ confirm: input.confirmCalls === true,
60
61
  description: advertised.description,
61
62
  input: operationSchema(advertised.parameters),
62
63
  output,
package/dist/mcp.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { FetchLike } from "@modelcontextprotocol/client";
2
1
  import { type CapabilitySource } from "@fungi.computer/mycelium";
3
2
  /** One remote MCP server a host has admitted for an Agent. */
4
3
  export type McpServerConnection = Readonly<{
@@ -28,7 +27,7 @@ export type McpServersConnectionOptions = Readonly<{
28
27
  /** Receives each server dropped from an acquisition and why. */
29
28
  onUnavailable: (error: McpServerUnavailableError) => void;
30
29
  /** Host egress for every MCP request; the host chooses where requests may go. */
31
- fetch: FetchLike;
30
+ fetch: (url: string | URL, init?: RequestInit) => Promise<Response>;
32
31
  /** Parent namespace for every server module; defaults to `["mcp"]`. */
33
32
  namespace?: readonly string[];
34
33
  /** Bound on connecting and listing one server; defaults to 10 seconds. */
package/docs/api/index.md CHANGED
@@ -343,6 +343,7 @@ type ComputerConnectionOptions = Readonly<{
343
343
  id: string;
344
344
  name: string;
345
345
  namespace?: readonly string[];
346
+ confirmCalls?: boolean;
346
347
  files?: FilesConnectionOptions;
347
348
  role?: string;
348
349
  computer: KnapsackComputer;
@@ -411,7 +412,7 @@ type McpServersConnectionOptions = Readonly<{
411
412
  >;
412
413
  subscribe: (invalidate) => () => void;
413
414
  onUnavailable: (error) => void;
414
- fetch: FetchLike;
415
+ fetch: (url, init?) => Promise<Response>;
415
416
  namespace?: readonly string[];
416
417
  connectTimeoutMillis?: number;
417
418
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/knapsack",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Agent tool connections projected into Mycelium capability sources",
6
6
  "type": "module",
@@ -47,8 +47,8 @@
47
47
  "dependencies": {
48
48
  "@fungi.computer/cairn": "0.1.0",
49
49
  "@fungi.computer/forage": "0.2.0",
50
- "@fungi.computer/mule": "0.1.0",
51
- "@fungi.computer/mycelium": "0.2.0",
50
+ "@fungi.computer/mule": "0.1.1",
51
+ "@fungi.computer/mycelium": "0.2.1",
52
52
  "@fungi.computer/whistle": "0.1.0",
53
53
  "@modelcontextprotocol/client": "2.0.0",
54
54
  "diff": "8.0.4",