@toon-protocol/client-mcp 0.9.1 → 0.10.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/dist/daemon.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  ClientRunner,
5
5
  registerRoutes,
6
6
  scaffoldFirstRun
7
- } from "./chunk-2GQXKV2O.js";
7
+ } from "./chunk-ZIJNTR5Y.js";
8
8
  import {
9
9
  ControlClient,
10
10
  ToonClient,
@@ -17,7 +17,7 @@ import {
17
17
  resolveConfig,
18
18
  spawnDaemonDetached,
19
19
  waitForReady
20
- } from "./chunk-WAE4H47W.js";
20
+ } from "./chunk-5Z74D23J.js";
21
21
  import "./chunk-32QD72IL.js";
22
22
  import "./chunk-DLYE6U2Z.js";
23
23
  import "./chunk-LR7W2ISE.js";
package/dist/index.d.ts CHANGED
@@ -114,8 +114,20 @@ interface PublishUnsignedRequest {
114
114
  * `requestBlobStorage`).
115
115
  */
116
116
  interface UploadMediaRequest {
117
- /** Base64-encoded media bytes. */
118
- dataBase64: string;
117
+ /**
118
+ * Base64-encoded media bytes. Mutually exclusive with `filePath`: supply
119
+ * EXACTLY ONE. Inline base64 streams the whole payload through the model
120
+ * context — prefer `filePath` for anything but tiny blobs.
121
+ */
122
+ dataBase64?: string;
123
+ /**
124
+ * Absolute path the daemon `fs.readFile`s to source the media bytes off disk
125
+ * (avoids materializing base64 as a tool argument). Mutually exclusive with
126
+ * `dataBase64`: supply EXACTLY ONE. The path is resolved and, when an upload
127
+ * root is configured (`TOON_CLIENT_UPLOAD_ROOT` / `uploadAllowedRoot`), must
128
+ * resolve inside it.
129
+ */
130
+ filePath?: string;
119
131
  /** MIME type (default 'application/octet-stream'). */
120
132
  mime?: string;
121
133
  /**
@@ -765,6 +777,14 @@ interface DaemonConfigFile {
765
777
  * Env override: `TOON_CLIENT_ARWEAVE_GATEWAYS` (comma-separated).
766
778
  */
767
779
  arweaveGateways?: string[];
780
+ /**
781
+ * Optional allowed-root for `toon_upload`'s `filePath` reads. When set, a
782
+ * supplied `filePath` is resolved and rejected unless it lies inside this
783
+ * directory — bounding which filesystem locations the daemon will read on an
784
+ * agent's behalf. When unset, any absolute path is read (the path is still
785
+ * resolved). Env override: `TOON_CLIENT_UPLOAD_ROOT`.
786
+ */
787
+ uploadAllowedRoot?: string;
768
788
  }
769
789
  interface ResolvedDaemonConfig {
770
790
  httpPort: number;
@@ -809,6 +829,11 @@ interface ResolvedDaemonConfig {
809
829
  * fall back to the shared default when it is absent.
810
830
  */
811
831
  arweaveGateways?: string[];
832
+ /**
833
+ * Resolved allowed-root for `toon_upload` `filePath` reads, when configured.
834
+ * Absent means no boundary (any absolute path is read, still resolved).
835
+ */
836
+ uploadAllowedRoot?: string;
812
837
  }
813
838
  /**
814
839
  * Password used to encrypt an auto-generated keystore (#251 first-run
@@ -1093,6 +1118,14 @@ declare class ClientRunner {
1093
1118
  * entirely server-side.
1094
1119
  */
1095
1120
  uploadMedia(req: UploadMediaRequest): Promise<UploadMediaResponse>;
1121
+ /**
1122
+ * Read media bytes off disk for an upload `filePath`. The path is resolved
1123
+ * and, when an `uploadAllowedRoot` is configured, must resolve inside it —
1124
+ * bounding which filesystem locations the daemon reads on an agent's behalf.
1125
+ * A missing/unreadable file (or an out-of-bounds path) surfaces as an
1126
+ * `InvalidPayloadError` (HTTP 400), not an unhandled crash.
1127
+ */
1128
+ private readUploadFile;
1096
1129
  /** Validate + assemble a signable event template (with replaceable merge). */
1097
1130
  private buildTemplate;
1098
1131
  /** Latest self-authored event of `kind` currently in the merged read buffer. */
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  hasConfiguredIdentity,
9
9
  registerRoutes,
10
10
  scaffoldFirstRun
11
- } from "./chunk-2GQXKV2O.js";
11
+ } from "./chunk-ZIJNTR5Y.js";
12
12
  import {
13
13
  PUBLISH_TOOL,
14
14
  TOOL_DEFINITIONS,
@@ -18,7 +18,7 @@ import {
18
18
  buildFollowListFilter,
19
19
  buildProfileFilter,
20
20
  dispatchTool
21
- } from "./chunk-5E7BCL4B.js";
21
+ } from "./chunk-KWQKOCE4.js";
22
22
  import {
23
23
  ControlApiError,
24
24
  ControlClient,
@@ -36,7 +36,7 @@ import {
36
36
  resolveMnemonic,
37
37
  spawnDaemonDetached,
38
38
  waitForReady
39
- } from "./chunk-WAE4H47W.js";
39
+ } from "./chunk-5Z74D23J.js";
40
40
  import "./chunk-32QD72IL.js";
41
41
  import "./chunk-DLYE6U2Z.js";
42
42
  import "./chunk-LR7W2ISE.js";
package/dist/mcp.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  APP_RESOURCE_URI,
5
5
  TOOL_DEFINITIONS,
6
6
  dispatchTool
7
- } from "./chunk-5E7BCL4B.js";
7
+ } from "./chunk-KWQKOCE4.js";
8
8
  import {
9
9
  ControlClient,
10
10
  defaultConfigPath,
@@ -12,7 +12,7 @@ import {
12
12
  readConfigFile,
13
13
  spawnDaemonDetached,
14
14
  waitForReady
15
- } from "./chunk-WAE4H47W.js";
15
+ } from "./chunk-5Z74D23J.js";
16
16
  import "./chunk-32QD72IL.js";
17
17
  import "./chunk-DLYE6U2Z.js";
18
18
  import "./chunk-LR7W2ISE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toon-protocol/client-mcp",
3
- "version": "0.9.1",
3
+ "version": "0.10.1",
4
4
  "description": "Always-on local daemon + MCP server letting a Claude agent (Desktop or Code) act as a TOON Protocol client: pay-to-write publishing, free reads, channel/balance management, and swaps.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Green",
@@ -49,8 +49,8 @@
49
49
  "typescript": "^5.3.0",
50
50
  "vitest": "^1.0.0",
51
51
  "@toon-protocol/arweave": "0.1.1",
52
- "@toon-protocol/views": "0.9.1",
53
- "@toon-protocol/client": "0.14.6"
52
+ "@toon-protocol/client": "0.14.7",
53
+ "@toon-protocol/views": "0.10.1"
54
54
  },
55
55
  "engines": {
56
56
  "node": ">=20"