@page-mcp/vue2 1.1.0 → 2.0.0
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 +3 -2
- package/dist/index.cjs +44 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +45 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
// Discover tools from AI side
|
|
66
|
-
const tools = await this.$pageMcp.client.
|
|
66
|
+
const tools = await this.$pageMcp.client.toolsList();
|
|
67
67
|
console.log('Available tools:', tools);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -76,6 +76,7 @@ export default {
|
|
|
76
76
|
|---|---|
|
|
77
77
|
| `this.$pageMcp.host` | `PageMcpHost` instance |
|
|
78
78
|
| `this.$pageMcp.client` | `PageMcpClient` instance |
|
|
79
|
+
| `this.$pageMcp.skills` | Extensions skills client |
|
|
79
80
|
| `this.$pageMcp.bus` | `EventBus` instance |
|
|
80
81
|
| `pageMcpTools` option | Array of tools auto-registered on component create |
|
|
81
82
|
| `pageMcpResources` option | Array of resources auto-registered on component create |
|
|
@@ -84,7 +85,7 @@ export default {
|
|
|
84
85
|
## How It Works
|
|
85
86
|
|
|
86
87
|
- `PageMcpPlugin` creates `EventBus`, `PageMcpHost`, and `PageMcpClient` instances and attaches them to `Vue.prototype.$pageMcp`.
|
|
87
|
-
- A global mixin reads `pageMcpTools`, `pageMcpResources`, and `
|
|
88
|
+
- A global mixin reads `pageMcpTools`, `pageMcpResources`, `pageMcpSkills`, and `pageMcpPrompts` from component options and registers them during `created`, cleaning up in `beforeDestroy`.
|
|
88
89
|
- The Host is started automatically when the Plugin is installed.
|
|
89
90
|
|
|
90
91
|
For detailed documentation, see the [main README](../../README.md#vue-2-page-mcpvue2).
|
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
EventBus: () => import_core2.EventBus,
|
|
24
|
+
Extensions: () => import_core2.Extensions,
|
|
24
25
|
PageMcpClient: () => import_core2.PageMcpClient,
|
|
25
26
|
PageMcpHost: () => import_core2.PageMcpHost,
|
|
26
27
|
PageMcpPlugin: () => PageMcpPlugin,
|
|
@@ -34,10 +35,11 @@ var PageMcpPlugin = {
|
|
|
34
35
|
const bus = options.bus ?? new import_core.EventBus();
|
|
35
36
|
const host = new import_core.PageMcpHost({ name: options.name, version: options.version, bus });
|
|
36
37
|
const client = new import_core.PageMcpClient({ bus });
|
|
38
|
+
const skills = import_core.Extensions.createSkillsClient(client);
|
|
37
39
|
const hostInfo = { name: options.name, version: options.version };
|
|
38
40
|
host.start();
|
|
39
41
|
client.connect();
|
|
40
|
-
const injection = { host, client, bus, hostInfo };
|
|
42
|
+
const injection = { host, client, skills, bus, hostInfo };
|
|
41
43
|
Vue.prototype.$pageMcp = injection;
|
|
42
44
|
Vue.mixin(pageMcpAutoRegisterMixin);
|
|
43
45
|
}
|
|
@@ -47,11 +49,18 @@ var pageMcpAutoRegisterMixin = {
|
|
|
47
49
|
const pageMcp = this.$pageMcp;
|
|
48
50
|
if (!pageMcp) return;
|
|
49
51
|
const { host } = pageMcp;
|
|
52
|
+
this.__pageMcpRegistered = {
|
|
53
|
+
tools: [],
|
|
54
|
+
resources: [],
|
|
55
|
+
skills: [],
|
|
56
|
+
prompts: []
|
|
57
|
+
};
|
|
50
58
|
const tools = this.$options.pageMcpTools;
|
|
51
59
|
if (tools && Array.isArray(tools)) {
|
|
52
60
|
for (const tool of tools) {
|
|
53
61
|
try {
|
|
54
62
|
host.registerTool(tool);
|
|
63
|
+
this.__pageMcpRegistered.tools.push(tool.name);
|
|
55
64
|
} catch {
|
|
56
65
|
}
|
|
57
66
|
}
|
|
@@ -61,6 +70,7 @@ var pageMcpAutoRegisterMixin = {
|
|
|
61
70
|
for (const resource of resources) {
|
|
62
71
|
try {
|
|
63
72
|
host.registerResource(resource);
|
|
73
|
+
this.__pageMcpRegistered.resources.push(resource.uri);
|
|
64
74
|
} catch {
|
|
65
75
|
}
|
|
66
76
|
}
|
|
@@ -70,6 +80,7 @@ var pageMcpAutoRegisterMixin = {
|
|
|
70
80
|
for (const skill of skills) {
|
|
71
81
|
try {
|
|
72
82
|
host.registerSkill(skill);
|
|
83
|
+
this.__pageMcpRegistered.skills.push(skill.name);
|
|
73
84
|
} catch {
|
|
74
85
|
}
|
|
75
86
|
}
|
|
@@ -79,15 +90,47 @@ var pageMcpAutoRegisterMixin = {
|
|
|
79
90
|
for (const prompt of prompts) {
|
|
80
91
|
try {
|
|
81
92
|
host.registerPrompt(prompt);
|
|
93
|
+
this.__pageMcpRegistered.prompts.push(prompt.name);
|
|
82
94
|
} catch {
|
|
83
95
|
}
|
|
84
96
|
}
|
|
85
97
|
}
|
|
98
|
+
},
|
|
99
|
+
beforeDestroy() {
|
|
100
|
+
const pageMcp = this.$pageMcp;
|
|
101
|
+
const registered = this.__pageMcpRegistered;
|
|
102
|
+
if (!pageMcp || !registered) return;
|
|
103
|
+
const { host } = pageMcp;
|
|
104
|
+
for (const name of registered.tools) {
|
|
105
|
+
try {
|
|
106
|
+
host.unregisterTool(name);
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
for (const uri of registered.resources) {
|
|
111
|
+
try {
|
|
112
|
+
host.unregisterResource(uri);
|
|
113
|
+
} catch {
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
for (const name of registered.skills) {
|
|
117
|
+
try {
|
|
118
|
+
host.unregisterSkill(name);
|
|
119
|
+
} catch {
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
for (const name of registered.prompts) {
|
|
123
|
+
try {
|
|
124
|
+
host.unregisterPrompt(name);
|
|
125
|
+
} catch {
|
|
126
|
+
}
|
|
127
|
+
}
|
|
86
128
|
}
|
|
87
129
|
};
|
|
88
130
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
131
|
0 && (module.exports = {
|
|
90
132
|
EventBus,
|
|
133
|
+
Extensions,
|
|
91
134
|
PageMcpClient,
|
|
92
135
|
PageMcpHost,
|
|
93
136
|
PageMcpPlugin,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ============================================================\n// @page-mcp/vue2 — Vue 2 Adapter for Page MCP SDK\n// ============================================================\n\nimport {\n PageMcpHost,\n PageMcpClient,\n EventBus,\n type ToolDefinition,\n type ResourceDefinition,\n type SkillDefinition,\n type PromptDefinition,\n type HostInfo,\n} from '@page-mcp/core';\n\n// ------ Types for Vue 2 ------\n\ninterface Vue2ComponentOptions {\n beforeCreate?: () => void;\n created?: () => void;\n beforeDestroy?: () => void;\n [key: string]: unknown;\n}\n\ninterface Vue2Instance {\n $pageMcp?: PageMcpInjection;\n $options: {\n pageMcpTools?: ToolDefinition[];\n pageMcpResources?: ResourceDefinition[];\n pageMcpSkills?: SkillDefinition[];\n pageMcpPrompts?: PromptDefinition[];\n parent?: Vue2Instance;\n [key: string]: unknown;\n };\n $root: Vue2Instance;\n [key: string]: unknown;\n}\n\ninterface Vue2Constructor {\n mixin(mixin: Vue2ComponentOptions): void;\n prototype: Vue2Instance;\n [key: string]: unknown;\n}\n\ninterface PageMcpInjection {\n host: PageMcpHost;\n client: PageMcpClient;\n bus: EventBus;\n hostInfo: HostInfo;\n}\n\n// ------ Plugin ------\n\nexport interface PageMcpPluginOptions {\n name: string;\n version: string;\n bus?: EventBus;\n}\n\n/**\n * Vue 2 Plugin. Install globally:\n *\n * ```js\n * import Vue from 'vue';\n * import { PageMcpPlugin } from '@page-mcp/vue2';\n *\n * Vue.use(PageMcpPlugin, { name: 'my-app', version: '1.0' });\n * ```\n *\n * After installation, `this.$pageMcp` is available in all components:\n * - `this.$pageMcp.host` — PageMcpHost instance\n * - `this.$pageMcp.client` — PageMcpClient instance\n * - `this.$pageMcp.bus` — EventBus instance\n */\nexport const PageMcpPlugin = {\n install(Vue: Vue2Constructor, options: PageMcpPluginOptions): void {\n const bus = options.bus ?? new EventBus();\n const host = new PageMcpHost({ name: options.name, version: options.version, bus });\n const client = new PageMcpClient({ bus });\n const hostInfo: HostInfo = { name: options.name, version: options.version };\n\n host.start();\n client.connect();\n\n const injection: PageMcpInjection = { host, client, bus, hostInfo };\n\n // Make $pageMcp available in all components\n Vue.prototype.$pageMcp = injection;\n\n // Install the auto-registration mixin\n Vue.mixin(pageMcpAutoRegisterMixin);\n },\n};\n\n// ------ Mixin ------\n\n/**\n * Mixin that auto-registers tools/resources/skills defined in component options.\n *\n * ```js\n * export default {\n * pageMcpTools: [\n * {\n * name: 'search',\n * description: 'Search products',\n * parameters: { type: 'object', properties: { q: { type: 'string' } } },\n * handler: async (args) => this.searchProducts(args.q),\n * }\n * ],\n * pageMcpResources: [...],\n * pageMcpSkills: [...],\n * }\n * ```\n */\nconst pageMcpAutoRegisterMixin: Vue2ComponentOptions = {\n created(this: Vue2Instance) {\n const pageMcp = this.$pageMcp;\n if (!pageMcp) return;\n\n const { host } = pageMcp;\n\n // Register tools from component options\n const tools = this.$options.pageMcpTools;\n if (tools && Array.isArray(tools)) {\n for (const tool of tools) {\n try {\n host.registerTool(tool);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register resources from component options\n const resources = this.$options.pageMcpResources;\n if (resources && Array.isArray(resources)) {\n for (const resource of resources) {\n try {\n host.registerResource(resource);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register skills from component options\n const skills = this.$options.pageMcpSkills;\n if (skills && Array.isArray(skills)) {\n for (const skill of skills) {\n try {\n host.registerSkill(skill);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register prompts from component options\n const prompts = this.$options.pageMcpPrompts;\n if (prompts && Array.isArray(prompts)) {\n for (const prompt of prompts) {\n try {\n host.registerPrompt(prompt);\n } catch {\n // Already registered\n }\n }\n }\n },\n};\n\n/**\n * Standalone mixin for manual use (without the plugin).\n * Useful when you want to use the mixin pattern explicitly.\n */\nexport { pageMcpAutoRegisterMixin as pageMcpMixin };\n\n// ------ Re-exports ------\n\nexport {\n PageMcpHost,\n PageMcpClient,\n EventBus,\n} from '@page-mcp/core';\n\nexport type {\n ToolDefinition,\n ToolInfo,\n ResourceDefinition,\n ResourceInfo,\n SkillDefinition,\n SkillInfo,\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ============================================================\n// @page-mcp/vue2 — Vue 2 Adapter for Page MCP SDK\n// ============================================================\n\nimport {\n Extensions,\n PageMcpHost,\n PageMcpClient,\n EventBus,\n type ToolDefinition,\n type ResourceDefinition,\n type SkillDefinition,\n type PromptDefinition,\n type HostInfo,\n} from '@page-mcp/core';\n\n// ------ Types for Vue 2 ------\n\ninterface Vue2ComponentOptions {\n beforeCreate?: () => void;\n created?: () => void;\n beforeDestroy?: () => void;\n [key: string]: unknown;\n}\n\ninterface Vue2Instance {\n $pageMcp?: PageMcpInjection;\n $options: {\n pageMcpTools?: ToolDefinition[];\n pageMcpResources?: ResourceDefinition[];\n pageMcpSkills?: SkillDefinition[];\n pageMcpPrompts?: PromptDefinition[];\n parent?: Vue2Instance;\n [key: string]: unknown;\n };\n $root: Vue2Instance;\n __pageMcpRegistered?: {\n tools: string[];\n resources: string[];\n skills: string[];\n prompts: string[];\n };\n [key: string]: unknown;\n}\n\ninterface Vue2Constructor {\n mixin(mixin: Vue2ComponentOptions): void;\n prototype: Vue2Instance;\n [key: string]: unknown;\n}\n\ninterface PageMcpInjection {\n host: PageMcpHost;\n client: PageMcpClient;\n skills: InstanceType<typeof Extensions.SkillsClient>;\n bus: EventBus;\n hostInfo: HostInfo;\n}\n\n// ------ Plugin ------\n\nexport interface PageMcpPluginOptions {\n name: string;\n version: string;\n bus?: EventBus;\n}\n\n/**\n * Vue 2 Plugin. Install globally:\n *\n * ```js\n * import Vue from 'vue';\n * import { PageMcpPlugin } from '@page-mcp/vue2';\n *\n * Vue.use(PageMcpPlugin, { name: 'my-app', version: '1.0' });\n * ```\n *\n * After installation, `this.$pageMcp` is available in all components:\n * - `this.$pageMcp.host` — PageMcpHost instance\n * - `this.$pageMcp.client` — PageMcpClient instance\n * - `this.$pageMcp.bus` — EventBus instance\n */\nexport const PageMcpPlugin = {\n install(Vue: Vue2Constructor, options: PageMcpPluginOptions): void {\n const bus = options.bus ?? new EventBus();\n const host = new PageMcpHost({ name: options.name, version: options.version, bus });\n const client = new PageMcpClient({ bus });\n const skills = Extensions.createSkillsClient(client);\n const hostInfo: HostInfo = { name: options.name, version: options.version };\n\n host.start();\n client.connect();\n\n const injection: PageMcpInjection = { host, client, skills, bus, hostInfo };\n\n // Make $pageMcp available in all components\n Vue.prototype.$pageMcp = injection;\n\n // Install the auto-registration mixin\n Vue.mixin(pageMcpAutoRegisterMixin);\n },\n};\n\n// ------ Mixin ------\n\n/**\n * Mixin that auto-registers tools/resources/skills defined in component options.\n *\n * ```js\n * export default {\n * pageMcpTools: [\n * {\n * name: 'search',\n * description: 'Search products',\n * parameters: { type: 'object', properties: { q: { type: 'string' } } },\n * handler: async (args) => this.searchProducts(args.q),\n * }\n * ],\n * pageMcpResources: [...],\n * pageMcpSkills: [...],\n * }\n * ```\n */\nconst pageMcpAutoRegisterMixin: Vue2ComponentOptions = {\n created(this: Vue2Instance) {\n const pageMcp = this.$pageMcp;\n if (!pageMcp) return;\n\n const { host } = pageMcp;\n this.__pageMcpRegistered = {\n tools: [],\n resources: [],\n skills: [],\n prompts: [],\n };\n\n // Register tools from component options\n const tools = this.$options.pageMcpTools;\n if (tools && Array.isArray(tools)) {\n for (const tool of tools) {\n try {\n host.registerTool(tool);\n this.__pageMcpRegistered.tools.push(tool.name);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register resources from component options\n const resources = this.$options.pageMcpResources;\n if (resources && Array.isArray(resources)) {\n for (const resource of resources) {\n try {\n host.registerResource(resource);\n this.__pageMcpRegistered.resources.push(resource.uri);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register skills from component options\n const skills = this.$options.pageMcpSkills;\n if (skills && Array.isArray(skills)) {\n for (const skill of skills) {\n try {\n host.registerSkill(skill);\n this.__pageMcpRegistered.skills.push(skill.name);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register prompts from component options\n const prompts = this.$options.pageMcpPrompts;\n if (prompts && Array.isArray(prompts)) {\n for (const prompt of prompts) {\n try {\n host.registerPrompt(prompt);\n this.__pageMcpRegistered.prompts.push(prompt.name);\n } catch {\n // Already registered\n }\n }\n }\n },\n beforeDestroy(this: Vue2Instance) {\n const pageMcp = this.$pageMcp;\n const registered = this.__pageMcpRegistered;\n if (!pageMcp || !registered) return;\n const { host } = pageMcp;\n\n for (const name of registered.tools) {\n try { host.unregisterTool(name); } catch { /* noop */ }\n }\n for (const uri of registered.resources) {\n try { host.unregisterResource(uri); } catch { /* noop */ }\n }\n for (const name of registered.skills) {\n try { host.unregisterSkill(name); } catch { /* noop */ }\n }\n for (const name of registered.prompts) {\n try { host.unregisterPrompt(name); } catch { /* noop */ }\n }\n },\n};\n\n/**\n * Standalone mixin for manual use (without the plugin).\n * Useful when you want to use the mixin pattern explicitly.\n */\nexport { pageMcpAutoRegisterMixin as pageMcpMixin };\n\n// ------ Re-exports ------\n\nexport {\n Extensions,\n PageMcpHost,\n PageMcpClient,\n EventBus,\n} from '@page-mcp/core';\n\nexport type {\n ToolDefinition,\n ToolInfo,\n ResourceDefinition,\n ResourceInfo,\n SkillDefinition,\n SkillInfo,\n SkillGetResult,\n SkillExecutionResult,\n SkillExecutionContext,\n PromptDefinition,\n PromptInfo,\n HostInfo,\n} from '@page-mcp/core';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAUO;A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inition, SkillDefinition, PromptDefinition } from '@page-mcp/core';
|
|
2
|
-
export { EventBus, HostInfo, PageMcpClient, PageMcpHost, PromptDefinition, PromptInfo, ResourceDefinition, ResourceInfo, SkillDefinition,
|
|
1
|
+
import { PageMcpHost, PageMcpClient, Extensions, EventBus, HostInfo, ToolDefinition, ResourceDefinition, SkillDefinition, PromptDefinition } from '@page-mcp/core';
|
|
2
|
+
export { EventBus, Extensions, HostInfo, PageMcpClient, PageMcpHost, PromptDefinition, PromptInfo, ResourceDefinition, ResourceInfo, SkillDefinition, SkillExecutionContext, SkillExecutionResult, SkillGetResult, SkillInfo, ToolDefinition, ToolInfo } from '@page-mcp/core';
|
|
3
3
|
|
|
4
4
|
interface Vue2ComponentOptions {
|
|
5
5
|
beforeCreate?: () => void;
|
|
@@ -18,6 +18,12 @@ interface Vue2Instance {
|
|
|
18
18
|
[key: string]: unknown;
|
|
19
19
|
};
|
|
20
20
|
$root: Vue2Instance;
|
|
21
|
+
__pageMcpRegistered?: {
|
|
22
|
+
tools: string[];
|
|
23
|
+
resources: string[];
|
|
24
|
+
skills: string[];
|
|
25
|
+
prompts: string[];
|
|
26
|
+
};
|
|
21
27
|
[key: string]: unknown;
|
|
22
28
|
}
|
|
23
29
|
interface Vue2Constructor {
|
|
@@ -28,6 +34,7 @@ interface Vue2Constructor {
|
|
|
28
34
|
interface PageMcpInjection {
|
|
29
35
|
host: PageMcpHost;
|
|
30
36
|
client: PageMcpClient;
|
|
37
|
+
skills: InstanceType<typeof Extensions.SkillsClient>;
|
|
31
38
|
bus: EventBus;
|
|
32
39
|
hostInfo: HostInfo;
|
|
33
40
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PageMcpHost, PageMcpClient, EventBus, HostInfo, ToolDefinition, ResourceDefinition, SkillDefinition, PromptDefinition } from '@page-mcp/core';
|
|
2
|
-
export { EventBus, HostInfo, PageMcpClient, PageMcpHost, PromptDefinition, PromptInfo, ResourceDefinition, ResourceInfo, SkillDefinition,
|
|
1
|
+
import { PageMcpHost, PageMcpClient, Extensions, EventBus, HostInfo, ToolDefinition, ResourceDefinition, SkillDefinition, PromptDefinition } from '@page-mcp/core';
|
|
2
|
+
export { EventBus, Extensions, HostInfo, PageMcpClient, PageMcpHost, PromptDefinition, PromptInfo, ResourceDefinition, ResourceInfo, SkillDefinition, SkillExecutionContext, SkillExecutionResult, SkillGetResult, SkillInfo, ToolDefinition, ToolInfo } from '@page-mcp/core';
|
|
3
3
|
|
|
4
4
|
interface Vue2ComponentOptions {
|
|
5
5
|
beforeCreate?: () => void;
|
|
@@ -18,6 +18,12 @@ interface Vue2Instance {
|
|
|
18
18
|
[key: string]: unknown;
|
|
19
19
|
};
|
|
20
20
|
$root: Vue2Instance;
|
|
21
|
+
__pageMcpRegistered?: {
|
|
22
|
+
tools: string[];
|
|
23
|
+
resources: string[];
|
|
24
|
+
skills: string[];
|
|
25
|
+
prompts: string[];
|
|
26
|
+
};
|
|
21
27
|
[key: string]: unknown;
|
|
22
28
|
}
|
|
23
29
|
interface Vue2Constructor {
|
|
@@ -28,6 +34,7 @@ interface Vue2Constructor {
|
|
|
28
34
|
interface PageMcpInjection {
|
|
29
35
|
host: PageMcpHost;
|
|
30
36
|
client: PageMcpClient;
|
|
37
|
+
skills: InstanceType<typeof Extensions.SkillsClient>;
|
|
31
38
|
bus: EventBus;
|
|
32
39
|
hostInfo: HostInfo;
|
|
33
40
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {
|
|
3
|
+
Extensions,
|
|
3
4
|
PageMcpHost,
|
|
4
5
|
PageMcpClient,
|
|
5
6
|
EventBus
|
|
6
7
|
} from "@page-mcp/core";
|
|
7
8
|
import {
|
|
9
|
+
Extensions as Extensions2,
|
|
8
10
|
PageMcpHost as PageMcpHost2,
|
|
9
11
|
PageMcpClient as PageMcpClient2,
|
|
10
12
|
EventBus as EventBus2
|
|
@@ -14,10 +16,11 @@ var PageMcpPlugin = {
|
|
|
14
16
|
const bus = options.bus ?? new EventBus();
|
|
15
17
|
const host = new PageMcpHost({ name: options.name, version: options.version, bus });
|
|
16
18
|
const client = new PageMcpClient({ bus });
|
|
19
|
+
const skills = Extensions.createSkillsClient(client);
|
|
17
20
|
const hostInfo = { name: options.name, version: options.version };
|
|
18
21
|
host.start();
|
|
19
22
|
client.connect();
|
|
20
|
-
const injection = { host, client, bus, hostInfo };
|
|
23
|
+
const injection = { host, client, skills, bus, hostInfo };
|
|
21
24
|
Vue.prototype.$pageMcp = injection;
|
|
22
25
|
Vue.mixin(pageMcpAutoRegisterMixin);
|
|
23
26
|
}
|
|
@@ -27,11 +30,18 @@ var pageMcpAutoRegisterMixin = {
|
|
|
27
30
|
const pageMcp = this.$pageMcp;
|
|
28
31
|
if (!pageMcp) return;
|
|
29
32
|
const { host } = pageMcp;
|
|
33
|
+
this.__pageMcpRegistered = {
|
|
34
|
+
tools: [],
|
|
35
|
+
resources: [],
|
|
36
|
+
skills: [],
|
|
37
|
+
prompts: []
|
|
38
|
+
};
|
|
30
39
|
const tools = this.$options.pageMcpTools;
|
|
31
40
|
if (tools && Array.isArray(tools)) {
|
|
32
41
|
for (const tool of tools) {
|
|
33
42
|
try {
|
|
34
43
|
host.registerTool(tool);
|
|
44
|
+
this.__pageMcpRegistered.tools.push(tool.name);
|
|
35
45
|
} catch {
|
|
36
46
|
}
|
|
37
47
|
}
|
|
@@ -41,6 +51,7 @@ var pageMcpAutoRegisterMixin = {
|
|
|
41
51
|
for (const resource of resources) {
|
|
42
52
|
try {
|
|
43
53
|
host.registerResource(resource);
|
|
54
|
+
this.__pageMcpRegistered.resources.push(resource.uri);
|
|
44
55
|
} catch {
|
|
45
56
|
}
|
|
46
57
|
}
|
|
@@ -50,6 +61,7 @@ var pageMcpAutoRegisterMixin = {
|
|
|
50
61
|
for (const skill of skills) {
|
|
51
62
|
try {
|
|
52
63
|
host.registerSkill(skill);
|
|
64
|
+
this.__pageMcpRegistered.skills.push(skill.name);
|
|
53
65
|
} catch {
|
|
54
66
|
}
|
|
55
67
|
}
|
|
@@ -59,14 +71,46 @@ var pageMcpAutoRegisterMixin = {
|
|
|
59
71
|
for (const prompt of prompts) {
|
|
60
72
|
try {
|
|
61
73
|
host.registerPrompt(prompt);
|
|
74
|
+
this.__pageMcpRegistered.prompts.push(prompt.name);
|
|
62
75
|
} catch {
|
|
63
76
|
}
|
|
64
77
|
}
|
|
65
78
|
}
|
|
79
|
+
},
|
|
80
|
+
beforeDestroy() {
|
|
81
|
+
const pageMcp = this.$pageMcp;
|
|
82
|
+
const registered = this.__pageMcpRegistered;
|
|
83
|
+
if (!pageMcp || !registered) return;
|
|
84
|
+
const { host } = pageMcp;
|
|
85
|
+
for (const name of registered.tools) {
|
|
86
|
+
try {
|
|
87
|
+
host.unregisterTool(name);
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
for (const uri of registered.resources) {
|
|
92
|
+
try {
|
|
93
|
+
host.unregisterResource(uri);
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const name of registered.skills) {
|
|
98
|
+
try {
|
|
99
|
+
host.unregisterSkill(name);
|
|
100
|
+
} catch {
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
for (const name of registered.prompts) {
|
|
104
|
+
try {
|
|
105
|
+
host.unregisterPrompt(name);
|
|
106
|
+
} catch {
|
|
107
|
+
}
|
|
108
|
+
}
|
|
66
109
|
}
|
|
67
110
|
};
|
|
68
111
|
export {
|
|
69
112
|
EventBus2 as EventBus,
|
|
113
|
+
Extensions2 as Extensions,
|
|
70
114
|
PageMcpClient2 as PageMcpClient,
|
|
71
115
|
PageMcpHost2 as PageMcpHost,
|
|
72
116
|
PageMcpPlugin,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ============================================================\n// @page-mcp/vue2 — Vue 2 Adapter for Page MCP SDK\n// ============================================================\n\nimport {\n PageMcpHost,\n PageMcpClient,\n EventBus,\n type ToolDefinition,\n type ResourceDefinition,\n type SkillDefinition,\n type PromptDefinition,\n type HostInfo,\n} from '@page-mcp/core';\n\n// ------ Types for Vue 2 ------\n\ninterface Vue2ComponentOptions {\n beforeCreate?: () => void;\n created?: () => void;\n beforeDestroy?: () => void;\n [key: string]: unknown;\n}\n\ninterface Vue2Instance {\n $pageMcp?: PageMcpInjection;\n $options: {\n pageMcpTools?: ToolDefinition[];\n pageMcpResources?: ResourceDefinition[];\n pageMcpSkills?: SkillDefinition[];\n pageMcpPrompts?: PromptDefinition[];\n parent?: Vue2Instance;\n [key: string]: unknown;\n };\n $root: Vue2Instance;\n [key: string]: unknown;\n}\n\ninterface Vue2Constructor {\n mixin(mixin: Vue2ComponentOptions): void;\n prototype: Vue2Instance;\n [key: string]: unknown;\n}\n\ninterface PageMcpInjection {\n host: PageMcpHost;\n client: PageMcpClient;\n bus: EventBus;\n hostInfo: HostInfo;\n}\n\n// ------ Plugin ------\n\nexport interface PageMcpPluginOptions {\n name: string;\n version: string;\n bus?: EventBus;\n}\n\n/**\n * Vue 2 Plugin. Install globally:\n *\n * ```js\n * import Vue from 'vue';\n * import { PageMcpPlugin } from '@page-mcp/vue2';\n *\n * Vue.use(PageMcpPlugin, { name: 'my-app', version: '1.0' });\n * ```\n *\n * After installation, `this.$pageMcp` is available in all components:\n * - `this.$pageMcp.host` — PageMcpHost instance\n * - `this.$pageMcp.client` — PageMcpClient instance\n * - `this.$pageMcp.bus` — EventBus instance\n */\nexport const PageMcpPlugin = {\n install(Vue: Vue2Constructor, options: PageMcpPluginOptions): void {\n const bus = options.bus ?? new EventBus();\n const host = new PageMcpHost({ name: options.name, version: options.version, bus });\n const client = new PageMcpClient({ bus });\n const hostInfo: HostInfo = { name: options.name, version: options.version };\n\n host.start();\n client.connect();\n\n const injection: PageMcpInjection = { host, client, bus, hostInfo };\n\n // Make $pageMcp available in all components\n Vue.prototype.$pageMcp = injection;\n\n // Install the auto-registration mixin\n Vue.mixin(pageMcpAutoRegisterMixin);\n },\n};\n\n// ------ Mixin ------\n\n/**\n * Mixin that auto-registers tools/resources/skills defined in component options.\n *\n * ```js\n * export default {\n * pageMcpTools: [\n * {\n * name: 'search',\n * description: 'Search products',\n * parameters: { type: 'object', properties: { q: { type: 'string' } } },\n * handler: async (args) => this.searchProducts(args.q),\n * }\n * ],\n * pageMcpResources: [...],\n * pageMcpSkills: [...],\n * }\n * ```\n */\nconst pageMcpAutoRegisterMixin: Vue2ComponentOptions = {\n created(this: Vue2Instance) {\n const pageMcp = this.$pageMcp;\n if (!pageMcp) return;\n\n const { host } = pageMcp;\n\n // Register tools from component options\n const tools = this.$options.pageMcpTools;\n if (tools && Array.isArray(tools)) {\n for (const tool of tools) {\n try {\n host.registerTool(tool);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register resources from component options\n const resources = this.$options.pageMcpResources;\n if (resources && Array.isArray(resources)) {\n for (const resource of resources) {\n try {\n host.registerResource(resource);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register skills from component options\n const skills = this.$options.pageMcpSkills;\n if (skills && Array.isArray(skills)) {\n for (const skill of skills) {\n try {\n host.registerSkill(skill);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register prompts from component options\n const prompts = this.$options.pageMcpPrompts;\n if (prompts && Array.isArray(prompts)) {\n for (const prompt of prompts) {\n try {\n host.registerPrompt(prompt);\n } catch {\n // Already registered\n }\n }\n }\n },\n};\n\n/**\n * Standalone mixin for manual use (without the plugin).\n * Useful when you want to use the mixin pattern explicitly.\n */\nexport { pageMcpAutoRegisterMixin as pageMcpMixin };\n\n// ------ Re-exports ------\n\nexport {\n PageMcpHost,\n PageMcpClient,\n EventBus,\n} from '@page-mcp/core';\n\nexport type {\n ToolDefinition,\n ToolInfo,\n ResourceDefinition,\n ResourceInfo,\n SkillDefinition,\n SkillInfo,\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ============================================================\n// @page-mcp/vue2 — Vue 2 Adapter for Page MCP SDK\n// ============================================================\n\nimport {\n Extensions,\n PageMcpHost,\n PageMcpClient,\n EventBus,\n type ToolDefinition,\n type ResourceDefinition,\n type SkillDefinition,\n type PromptDefinition,\n type HostInfo,\n} from '@page-mcp/core';\n\n// ------ Types for Vue 2 ------\n\ninterface Vue2ComponentOptions {\n beforeCreate?: () => void;\n created?: () => void;\n beforeDestroy?: () => void;\n [key: string]: unknown;\n}\n\ninterface Vue2Instance {\n $pageMcp?: PageMcpInjection;\n $options: {\n pageMcpTools?: ToolDefinition[];\n pageMcpResources?: ResourceDefinition[];\n pageMcpSkills?: SkillDefinition[];\n pageMcpPrompts?: PromptDefinition[];\n parent?: Vue2Instance;\n [key: string]: unknown;\n };\n $root: Vue2Instance;\n __pageMcpRegistered?: {\n tools: string[];\n resources: string[];\n skills: string[];\n prompts: string[];\n };\n [key: string]: unknown;\n}\n\ninterface Vue2Constructor {\n mixin(mixin: Vue2ComponentOptions): void;\n prototype: Vue2Instance;\n [key: string]: unknown;\n}\n\ninterface PageMcpInjection {\n host: PageMcpHost;\n client: PageMcpClient;\n skills: InstanceType<typeof Extensions.SkillsClient>;\n bus: EventBus;\n hostInfo: HostInfo;\n}\n\n// ------ Plugin ------\n\nexport interface PageMcpPluginOptions {\n name: string;\n version: string;\n bus?: EventBus;\n}\n\n/**\n * Vue 2 Plugin. Install globally:\n *\n * ```js\n * import Vue from 'vue';\n * import { PageMcpPlugin } from '@page-mcp/vue2';\n *\n * Vue.use(PageMcpPlugin, { name: 'my-app', version: '1.0' });\n * ```\n *\n * After installation, `this.$pageMcp` is available in all components:\n * - `this.$pageMcp.host` — PageMcpHost instance\n * - `this.$pageMcp.client` — PageMcpClient instance\n * - `this.$pageMcp.bus` — EventBus instance\n */\nexport const PageMcpPlugin = {\n install(Vue: Vue2Constructor, options: PageMcpPluginOptions): void {\n const bus = options.bus ?? new EventBus();\n const host = new PageMcpHost({ name: options.name, version: options.version, bus });\n const client = new PageMcpClient({ bus });\n const skills = Extensions.createSkillsClient(client);\n const hostInfo: HostInfo = { name: options.name, version: options.version };\n\n host.start();\n client.connect();\n\n const injection: PageMcpInjection = { host, client, skills, bus, hostInfo };\n\n // Make $pageMcp available in all components\n Vue.prototype.$pageMcp = injection;\n\n // Install the auto-registration mixin\n Vue.mixin(pageMcpAutoRegisterMixin);\n },\n};\n\n// ------ Mixin ------\n\n/**\n * Mixin that auto-registers tools/resources/skills defined in component options.\n *\n * ```js\n * export default {\n * pageMcpTools: [\n * {\n * name: 'search',\n * description: 'Search products',\n * parameters: { type: 'object', properties: { q: { type: 'string' } } },\n * handler: async (args) => this.searchProducts(args.q),\n * }\n * ],\n * pageMcpResources: [...],\n * pageMcpSkills: [...],\n * }\n * ```\n */\nconst pageMcpAutoRegisterMixin: Vue2ComponentOptions = {\n created(this: Vue2Instance) {\n const pageMcp = this.$pageMcp;\n if (!pageMcp) return;\n\n const { host } = pageMcp;\n this.__pageMcpRegistered = {\n tools: [],\n resources: [],\n skills: [],\n prompts: [],\n };\n\n // Register tools from component options\n const tools = this.$options.pageMcpTools;\n if (tools && Array.isArray(tools)) {\n for (const tool of tools) {\n try {\n host.registerTool(tool);\n this.__pageMcpRegistered.tools.push(tool.name);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register resources from component options\n const resources = this.$options.pageMcpResources;\n if (resources && Array.isArray(resources)) {\n for (const resource of resources) {\n try {\n host.registerResource(resource);\n this.__pageMcpRegistered.resources.push(resource.uri);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register skills from component options\n const skills = this.$options.pageMcpSkills;\n if (skills && Array.isArray(skills)) {\n for (const skill of skills) {\n try {\n host.registerSkill(skill);\n this.__pageMcpRegistered.skills.push(skill.name);\n } catch {\n // Already registered\n }\n }\n }\n\n // Register prompts from component options\n const prompts = this.$options.pageMcpPrompts;\n if (prompts && Array.isArray(prompts)) {\n for (const prompt of prompts) {\n try {\n host.registerPrompt(prompt);\n this.__pageMcpRegistered.prompts.push(prompt.name);\n } catch {\n // Already registered\n }\n }\n }\n },\n beforeDestroy(this: Vue2Instance) {\n const pageMcp = this.$pageMcp;\n const registered = this.__pageMcpRegistered;\n if (!pageMcp || !registered) return;\n const { host } = pageMcp;\n\n for (const name of registered.tools) {\n try { host.unregisterTool(name); } catch { /* noop */ }\n }\n for (const uri of registered.resources) {\n try { host.unregisterResource(uri); } catch { /* noop */ }\n }\n for (const name of registered.skills) {\n try { host.unregisterSkill(name); } catch { /* noop */ }\n }\n for (const name of registered.prompts) {\n try { host.unregisterPrompt(name); } catch { /* noop */ }\n }\n },\n};\n\n/**\n * Standalone mixin for manual use (without the plugin).\n * Useful when you want to use the mixin pattern explicitly.\n */\nexport { pageMcpAutoRegisterMixin as pageMcpMixin };\n\n// ------ Re-exports ------\n\nexport {\n Extensions,\n PageMcpHost,\n PageMcpClient,\n EventBus,\n} from '@page-mcp/core';\n\nexport type {\n ToolDefinition,\n ToolInfo,\n ResourceDefinition,\n ResourceInfo,\n SkillDefinition,\n SkillInfo,\n SkillGetResult,\n SkillExecutionResult,\n SkillExecutionContext,\n PromptDefinition,\n PromptInfo,\n HostInfo,\n} from '@page-mcp/core';\n"],"mappings":";AAIA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMG;AA2MP;AAAA,EACI,cAAAA;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,OACG;AA5IA,IAAM,gBAAgB;AAAA,EACzB,QAAQ,KAAsB,SAAqC;AAC/D,UAAM,MAAM,QAAQ,OAAO,IAAI,SAAS;AACxC,UAAM,OAAO,IAAI,YAAY,EAAE,MAAM,QAAQ,MAAM,SAAS,QAAQ,SAAS,IAAI,CAAC;AAClF,UAAM,SAAS,IAAI,cAAc,EAAE,IAAI,CAAC;AACxC,UAAM,SAAS,WAAW,mBAAmB,MAAM;AACnD,UAAM,WAAqB,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AO,GAAG;AACnC,iBAAW,UAAU,SAAS;AAC1B,YAAI;AACA,eAAK,eAAe,MAAM;AAC1B,eAAK,oBAAoB,QAAQ,KAAK,OAAO,IAAI;AAAA,QACrD,QAAQ;AAAA,QAER;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA,EACA,gBAAkC;AAC9B,UAAM,UAAU,KAAK;AACrB,UAAM,aAAa,KAAK;AACxB,QAAI,CAAC,WAAW,CAAC,WAAY;AAC7B,UAAM,EAAE,KAAK,IAAI;AAEjB,eAAW,QAAQ,WAAW,OAAO;AACjC,UAAI;AAAE,aAAK,eAAe,IAAI;AAAA,MAAG,QAAQ;AAAA,MAAa;AAAA,IAC1D;AACA,eAAW,OAAO,WAAW,WAAW;AACpC,UAAI;AAAE,aAAK,mBAAmB,GAAG;AAAA,MAAG,QAAQ;AAAA,MAAa;AAAA,IAC7D;AACA,eAAW,QAAQ,WAAW,QAAQ;AAClC,UAAI;AAAE,aAAK,gBAAgB,IAAI;AAAA,MAAG,QAAQ;AAAA,MAAa;AAAA,IAC3D;AACA,eAAW,QAAQ,WAAW,SAAS;AACnC,UAAI;AAAE,aAAK,iBAAiB,IAAI;AAAA,MAAG,QAAQ;AAAA,MAAa;AAAA,IAC5D;AAAA,EACJ;AACJ;","names":["Extensions","PageMcpHost","PageMcpClient","EventBus"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@page-mcp/vue2",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vue 2 adapter for Page MCP SDK — Plugin + Mixin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"vue": ">=2.6.0 <3.0.0",
|
|
31
|
-
"@page-mcp/core": "^
|
|
31
|
+
"@page-mcp/core": "^2.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"vue": "^2.7.0",
|
|
35
35
|
"tsup": "^8.0.0",
|
|
36
36
|
"typescript": "^5.4.0",
|
|
37
|
-
"@page-mcp/core": "^
|
|
37
|
+
"@page-mcp/core": "^2.0.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsup",
|