@sodikinnaa/smart-report-plugin 1.0.5 → 1.0.7
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/index.d.ts +6 -1
- package/dist/index.js +18 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/sodikinnaa-smart-report-plugin-1.0.6.tgz +0 -0
- package/src/index.ts +20 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -48,7 +48,10 @@ async function callMcp(api, method, params = {}) {
|
|
|
48
48
|
}
|
|
49
49
|
return response.data.result;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
/**
|
|
52
|
+
* MCP Activation Hook
|
|
53
|
+
*/
|
|
54
|
+
export function register(api) {
|
|
52
55
|
// 1. CLI Commands
|
|
53
56
|
api.registerCli(({ program }) => {
|
|
54
57
|
program
|
|
@@ -80,13 +83,23 @@ export default function register(api) {
|
|
|
80
83
|
api.registerResource({
|
|
81
84
|
uri: 'smartreport://employees',
|
|
82
85
|
name: 'Employee List',
|
|
83
|
-
description: 'Complete list of active employees',
|
|
86
|
+
description: 'Complete list of active employees with division names',
|
|
84
87
|
mimeType: 'application/json',
|
|
85
88
|
read: async () => {
|
|
86
89
|
const data = await callMcp(api, 'employees/list', {});
|
|
87
90
|
return { content: JSON.stringify(data, null, 2) };
|
|
88
91
|
}
|
|
89
92
|
});
|
|
93
|
+
api.registerResource({
|
|
94
|
+
uri: 'smartreport://divisions',
|
|
95
|
+
name: 'Division List',
|
|
96
|
+
description: 'List of all divisions in the company',
|
|
97
|
+
mimeType: 'application/json',
|
|
98
|
+
read: async () => {
|
|
99
|
+
const data = await callMcp(api, 'divisions/list', {});
|
|
100
|
+
return { content: JSON.stringify(data, null, 2) };
|
|
101
|
+
}
|
|
102
|
+
});
|
|
90
103
|
api.registerResource({
|
|
91
104
|
uri: 'smartreport://debt-aging',
|
|
92
105
|
name: 'Debt Aging Analysis',
|
|
@@ -125,3 +138,6 @@ export default function register(api) {
|
|
|
125
138
|
}
|
|
126
139
|
});
|
|
127
140
|
}
|
|
141
|
+
// Ensure both default and named exports
|
|
142
|
+
export default register;
|
|
143
|
+
export const activate = register;
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
Binary file
|
package/src/index.ts
CHANGED
|
@@ -54,7 +54,10 @@ async function callMcp(api: any, method: string, params: any = {}) {
|
|
|
54
54
|
return response.data.result;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* MCP Activation Hook
|
|
59
|
+
*/
|
|
60
|
+
export function register(api: any) {
|
|
58
61
|
// 1. CLI Commands
|
|
59
62
|
api.registerCli(({ program }: any) => {
|
|
60
63
|
program
|
|
@@ -87,7 +90,7 @@ export default function register(api: any) {
|
|
|
87
90
|
api.registerResource({
|
|
88
91
|
uri: 'smartreport://employees',
|
|
89
92
|
name: 'Employee List',
|
|
90
|
-
description: 'Complete list of active employees',
|
|
93
|
+
description: 'Complete list of active employees with division names',
|
|
91
94
|
mimeType: 'application/json',
|
|
92
95
|
read: async () => {
|
|
93
96
|
const data = await callMcp(api, 'employees/list', {});
|
|
@@ -95,6 +98,17 @@ export default function register(api: any) {
|
|
|
95
98
|
}
|
|
96
99
|
});
|
|
97
100
|
|
|
101
|
+
api.registerResource({
|
|
102
|
+
uri: 'smartreport://divisions',
|
|
103
|
+
name: 'Division List',
|
|
104
|
+
description: 'List of all divisions in the company',
|
|
105
|
+
mimeType: 'application/json',
|
|
106
|
+
read: async () => {
|
|
107
|
+
const data = await callMcp(api, 'divisions/list', {});
|
|
108
|
+
return { content: JSON.stringify(data, null, 2) };
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
98
112
|
api.registerResource({
|
|
99
113
|
uri: 'smartreport://debt-aging',
|
|
100
114
|
name: 'Debt Aging Analysis',
|
|
@@ -133,3 +147,7 @@ export default function register(api: any) {
|
|
|
133
147
|
}
|
|
134
148
|
});
|
|
135
149
|
}
|
|
150
|
+
|
|
151
|
+
// Ensure both default and named exports
|
|
152
|
+
export default register;
|
|
153
|
+
export const activate = register;
|