@plume-canvas/server 0.1.25 → 0.1.27
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/cli.js +48 -27
- package/dist/index.d.ts +31 -2
- package/dist/index.js +21 -20
- package/package.json +25 -22
package/dist/index.d.ts
CHANGED
|
@@ -718,6 +718,14 @@ export declare function canvasResourcesDir(root: string, id: string): string;
|
|
|
718
718
|
export declare class CanvasResourceStore {
|
|
719
719
|
private readonly root;
|
|
720
720
|
constructor(root: string);
|
|
721
|
+
/**
|
|
722
|
+
* 数据根本身(`<根>/canvases` 的上一级)。
|
|
723
|
+
*
|
|
724
|
+
* 为什么需要它:Agent 手里只有同源 URL(`/api/canvases/<id>/resources/<名>`),
|
|
725
|
+
* 想直接读文件就得知道根在哪。以前只能从系统提示里抄一行、自己拼路径 ——
|
|
726
|
+
* 现在由 MCP 工具现算给它(见 `resource_local_path`)。
|
|
727
|
+
*/
|
|
728
|
+
dataRoot(): string;
|
|
721
729
|
/**
|
|
722
730
|
* 存一个资源;同内容不重复写。返回**同源 URL**(写进节点 data 的那个)与磁盘名。
|
|
723
731
|
*
|
|
@@ -1385,7 +1393,24 @@ resolveDoc?: CanvasDocResolver,
|
|
|
1385
1393
|
listCanvases?: () => Promise<Array<{
|
|
1386
1394
|
id: string;
|
|
1387
1395
|
name: string;
|
|
1388
|
-
}
|
|
1396
|
+
}>>,
|
|
1397
|
+
/**
|
|
1398
|
+
* 数据根(`<根>/canvases` 的上一级)。
|
|
1399
|
+
*
|
|
1400
|
+
* 只给「把同源地址翻成磁盘路径」的两个工具用(`resource_local_path` /
|
|
1401
|
+
* `canvas_resource_fetch`)。拿不到就不返回路径 ——
|
|
1402
|
+
* 宁可少给一个字段,也不编一个可能是错的绝对路径。
|
|
1403
|
+
*/
|
|
1404
|
+
dataRoot?: () => string | undefined,
|
|
1405
|
+
/**
|
|
1406
|
+
* 「把取回的字节落一份给 Agent 文件工具读」的目录(按画布给)。
|
|
1407
|
+
*
|
|
1408
|
+
* 为什么需要单独一处:Agent 的文件类工具被限制在它自己的工作目录里,
|
|
1409
|
+
* 而画布资源在 `<根>/canvases/<id>/resources` —— 是**兄弟目录**,读不到。
|
|
1410
|
+
* 所以取回字节时另存一份到工作目录下,返回 `agentLocalPath` 给它。
|
|
1411
|
+
* 不传就不落盘,只回 base64。
|
|
1412
|
+
*/
|
|
1413
|
+
agentFilesDir?: (canvasId: string) => string | undefined): McpServer;
|
|
1389
1414
|
|
|
1390
1415
|
export declare function createCloudServer(opts?: CloudServerOptions): Promise<CloudServer>;
|
|
1391
1416
|
|
|
@@ -2129,7 +2154,11 @@ resolveDoc?: CanvasDocResolver,
|
|
|
2129
2154
|
listCanvases?: () => Promise<Array<{
|
|
2130
2155
|
id: string;
|
|
2131
2156
|
name: string;
|
|
2132
|
-
}
|
|
2157
|
+
}>>,
|
|
2158
|
+
/** 数据根(`resource_local_path` / `withLocalPath` 把同源地址翻成磁盘路径用) */
|
|
2159
|
+
dataRoot?: () => string | undefined,
|
|
2160
|
+
/** 某个画布的 Agent 工作目录(`canvas_resource_fetch` 取回字节后落一份给文件工具读) */
|
|
2161
|
+
agentFilesDir?: (canvasId: string) => string | undefined): Hono;
|
|
2133
2162
|
|
|
2134
2163
|
/** 工具清单(给 `--list-tools` 与诊断用;与实际注册保持一致) */
|
|
2135
2164
|
export declare interface McpTool {
|