@plume-canvas/plugin-agent 0.1.7 → 0.1.9

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/server.js CHANGED
@@ -177815,6 +177815,24 @@ var AgentConfigBase = class {
177815
177815
  }
177816
177816
  };
177817
177817
 
177818
+ // src/server/agent/probeTools.ts
177819
+ init_dist6();
177820
+ function probeToolRows(defs) {
177821
+ return defs.map((d6) => {
177822
+ const full = String(d6.name ?? "");
177823
+ const rest = full.startsWith(MCP_TOOL_PREFIX) ? full.slice(MCP_TOOL_PREFIX.length) : full;
177824
+ const sep2 = rest.indexOf("__");
177825
+ const parameters = d6.parameters;
177826
+ return {
177827
+ name: sep2 >= 0 ? rest.slice(sep2 + 2) : rest,
177828
+ server: sep2 >= 0 ? rest.slice(0, sep2) : "",
177829
+ description: String(d6.description ?? ""),
177830
+ fullName: full,
177831
+ ...parameters && typeof parameters === "object" ? { parameters } : {}
177832
+ };
177833
+ });
177834
+ }
177835
+
177818
177836
  // src/server/agent/config.ts
177819
177837
  var AgentConfigService = class extends AgentConfigBase {
177820
177838
  /**
@@ -178453,17 +178471,7 @@ var AgentConfigService = class extends AgentConfigBase {
178453
178471
  ...r7.error_message ? { error: String(r7.error_message) } : {},
178454
178472
  durationMs: Number(r7.duration_ms ?? 0)
178455
178473
  }));
178456
- const tools = defs.map((d6) => {
178457
- const full = String(d6.name ?? "");
178458
- const rest = full.startsWith(MCP_TOOL_PREFIX) ? full.slice(MCP_TOOL_PREFIX.length) : full;
178459
- const sep2 = rest.indexOf("__");
178460
- return {
178461
- name: sep2 >= 0 ? rest.slice(sep2 + 2) : rest,
178462
- server: sep2 >= 0 ? rest.slice(0, sep2) : "",
178463
- description: String(d6.description ?? ""),
178464
- fullName: full
178465
- };
178466
- });
178474
+ const tools = probeToolRows(defs);
178467
178475
  const failed = servers.filter((s3) => s3.status !== "completed");
178468
178476
  return { ok: failed.length === 0, servers, tools, warnings };
178469
178477
  } finally {
@@ -178497,17 +178505,7 @@ var AgentConfigService = class extends AgentConfigBase {
178497
178505
  ...r7.error_message ? { error: String(r7.error_message) } : {},
178498
178506
  durationMs: Number(r7.duration_ms ?? 0)
178499
178507
  }));
178500
- const tools = defs.map((d6) => {
178501
- const full = String(d6.name ?? "");
178502
- const rest = full.startsWith(MCP_TOOL_PREFIX) ? full.slice(MCP_TOOL_PREFIX.length) : full;
178503
- const sep2 = rest.indexOf("__");
178504
- return {
178505
- name: sep2 >= 0 ? rest.slice(sep2 + 2) : rest,
178506
- server: sep2 >= 0 ? rest.slice(0, sep2) : "",
178507
- description: String(d6.description ?? ""),
178508
- fullName: full
178509
- };
178510
- });
178508
+ const tools = probeToolRows(defs);
178511
178509
  const failed = servers.filter((s3) => s3.status !== "completed");
178512
178510
  return { ok: failed.length === 0, servers, tools, warnings };
178513
178511
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plume-canvas/plugin-agent",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "plume": {
6
6
  "title": "Agent 对话助手",
@@ -22,14 +22,17 @@
22
22
  "dist",
23
23
  "README.md"
24
24
  ],
25
- "main": "./src/index.ts",
25
+ "main": "./dist/web.js",
26
26
  "types": "./src/index.ts",
27
27
  "exports": {
28
- ".": {
29
- "types": "./src/index.ts",
30
- "default": "./src/index.ts"
31
- },
32
- "./*": "./src/*"
28
+ ".": "./dist/web.js"
29
+ },
30
+ "scripts": {
31
+ "typecheck": "tsc --noEmit",
32
+ "test": "vitest run",
33
+ "build:web": "vite build",
34
+ "build:server": "node scripts/build-server.mjs",
35
+ "build": "vite build && node scripts/build-server.mjs"
33
36
  },
34
37
  "peerDependencies": {
35
38
  "vue": "^3.5.34"
@@ -41,21 +44,21 @@
41
44
  "@prismshadow/penguin-core": "0.2.13",
42
45
  "hono": "^4.6.0",
43
46
  "yaml": "^2.9.1",
47
+ "@plume-canvas/plugin-sdk": "workspace:*",
48
+ "@plume-canvas/canvas-render": "workspace:*",
49
+ "@plume-canvas/kernel": "workspace:*",
44
50
  "lucide-vue-next": "^1.0.0",
45
51
  "vue-draggable-plus": "^0.6.1",
52
+ "@plume-canvas/editor": "workspace:*",
46
53
  "@types/node": "^24.12.3",
47
54
  "esbuild": "^0.28.2",
55
+ "@plume-canvas/canvas-data": "workspace:*",
48
56
  "@vitejs/plugin-vue": "^6.0.6",
49
57
  "typescript": "~6.0.2",
50
58
  "vitest": "^3.0.0",
51
59
  "vue": "^3.5.34",
52
60
  "vite-plugin-css-injected-by-js": "^3.5.2",
53
- "vite": "^8.0.12",
54
- "@plume-canvas/canvas-render": "0.0.0",
55
- "@plume-canvas/canvas-data": "0.0.0",
56
- "@plume-canvas/editor": "1.0.0",
57
- "@plume-canvas/kernel": "0.0.0",
58
- "@plume-canvas/plugin-sdk": "0.0.0"
61
+ "vite": "^8.0.12"
59
62
  },
60
63
  "publishConfig": {
61
64
  "access": "public"
@@ -69,12 +72,5 @@
69
72
  "yaml": "^2.9.1",
70
73
  "lucide-vue-next": "^1.0.0",
71
74
  "vue-draggable-plus": "^0.6.1"
72
- },
73
- "scripts": {
74
- "typecheck": "tsc --noEmit",
75
- "test": "vitest run",
76
- "build:web": "vite build",
77
- "build:server": "node scripts/build-server.mjs",
78
- "build": "vite build && node scripts/build-server.mjs"
79
75
  }
80
- }
76
+ }
package/src/index.ts DELETED
@@ -1,27 +0,0 @@
1
- export { agentPlugin, name, inject, Config, apply } from './plugin/agentPlugin.js'
2
- export type { AgentPluginConfig } from './plugin/agentPlugin.js'
3
- export { createAgentService, CANVAS_ID } from './service/agentService.js'
4
- export type {
5
- AgentService,
6
- AgentServiceState,
7
- ModelRow,
8
- ProviderRow,
9
- SkillRow,
10
- McpRow,
11
- ApprovalRuleRow,
12
- ApprovalPolicyView,
13
- } from './service/agentService.js'
14
- export { useAgent } from './plugin/useAgent.js'
15
- // 「引用标签被点了」这条系统事件的**唯一一份**名字与载荷定义(应用层按名监听,见 apps/web 的
16
- // useAssetRefOpen)。放这里是因为发事件的是本插件;消费方只取类型与常量,不 import 任何组件。
17
- export { REF_CLICK_EVENT, refClickPayloadOf } from './plugin/refClickEvents.js'
18
- export type { RefClickPayload, RefClickSource } from './plugin/refClickEvents.js'
19
- // 输入框「提交键」的三种可选值 + 归一化:设置页(apps/web)要用了这份判定,
20
- // 两边若各写一份枚举,改一处就会静默漂移(设置页写着 enter、面板只认 ctrl-enter)。
21
- // 这是纯常量/纯函数,不 import 任何组件,导出安全。
22
- export { SUBMIT_KEY_MODES, DEFAULT_SUBMIT_KEY_MODE, normalizeSubmitKeyMode } from './ui/shared/composerKeys.js'
23
- export type { SubmitKeyMode } from './ui/shared/composerKeys.js'
24
- export { AgentApi } from './api/agentApi.js'
25
- export type { ChatEvent, SessionMetaView, SessionRecordView, SendOptions } from './api/agentApi.js'
26
- export { ChatModel } from './model/sessionModel.js'
27
- export type { AgentTurnView, ToolCard, ApprovalCard } from './model/sessionModel.js'