@sodikinnaa/smart-report-plugin 1.0.6 → 1.0.8

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.js CHANGED
@@ -83,13 +83,23 @@ export function register(api) {
83
83
  api.registerResource({
84
84
  uri: 'smartreport://employees',
85
85
  name: 'Employee List',
86
- description: 'Complete list of active employees',
86
+ description: 'Complete list of active employees with division names',
87
87
  mimeType: 'application/json',
88
88
  read: async () => {
89
89
  const data = await callMcp(api, 'employees/list', {});
90
90
  return { content: JSON.stringify(data, null, 2) };
91
91
  }
92
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
+ });
93
103
  api.registerResource({
94
104
  uri: 'smartreport://debt-aging',
95
105
  name: 'Debt Aging Analysis',
@@ -100,7 +110,30 @@ export function register(api) {
100
110
  return { content: JSON.stringify(data, null, 2) };
101
111
  }
102
112
  });
113
+ api.registerResource({
114
+ uri: 'smartreport://dashboard',
115
+ name: 'Daily Dashboard',
116
+ description: 'Real-time KPI dashboard (stats, highlights, alerts)',
117
+ mimeType: 'application/json',
118
+ read: async (params) => {
119
+ const data = await callMcp(api, 'smartreport/dashboard', params || {});
120
+ return { content: JSON.stringify(data, null, 2) };
121
+ }
122
+ });
103
123
  // 3. Agent Tools
124
+ api.registerTool({
125
+ name: 'get_daily_dashboard',
126
+ description: 'Retrieve real-time KPI dashboard (stats, highlights, alerts).',
127
+ execute: async (args) => {
128
+ try {
129
+ const data = await callMcp(api, 'smartreport/dashboard', args);
130
+ return { text: JSON.stringify(data, null, 2) };
131
+ }
132
+ catch (err) {
133
+ return { error: err.message };
134
+ }
135
+ }
136
+ });
104
137
  api.registerTool({
105
138
  name: 'get_list_reports',
106
139
  description: 'Retrieve reports with filters (date, employee, division).',
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "id": "smart-report-plugin",
3
3
  "name": "Smart Report Integration",
4
- "version": "1.0.6",
5
- "description": "Integration plugin for Smart Report and AI Analytics",
4
+ "version": "1.0.8",
5
+ "description": "Integration plugin for Smart Report and AI Analytics with Daily Dashboard",
6
6
  "entry": "dist/index.js",
7
7
  "skills": ["skills/smart-report/SKILL.md"],
8
8
  "configSchema": {
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "@sodikinnaa/smart-report-plugin",
3
- "version": "1.0.6",
4
- "description": "OpenClaw plugin for Smart Report system integration",
3
+ "version": "1.0.8",
4
+ "description": "OpenClaw plugin for Smart Report system integration with Daily Dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "type": "module",
8
8
  "types": "dist/index.d.ts",
9
9
  "scripts": {
10
10
  "build": "tsc",
11
- "test": "echo \"Error: no test specified\" && exit 1"
11
+ "test": "node test/simple.test.js",
12
+ "publish": "npm publish --access public"
12
13
  },
13
14
  "keywords": [
14
15
  "openclaw-plugin",
15
- "smart-report"
16
+ "smart-report",
17
+ "dashboard"
16
18
  ],
17
19
  "author": "Sodikin",
18
20
  "license": "MIT",
package/src/index.ts CHANGED
@@ -90,7 +90,7 @@ export function register(api: any) {
90
90
  api.registerResource({
91
91
  uri: 'smartreport://employees',
92
92
  name: 'Employee List',
93
- description: 'Complete list of active employees',
93
+ description: 'Complete list of active employees with division names',
94
94
  mimeType: 'application/json',
95
95
  read: async () => {
96
96
  const data = await callMcp(api, 'employees/list', {});
@@ -98,6 +98,17 @@ export function register(api: any) {
98
98
  }
99
99
  });
100
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
+
101
112
  api.registerResource({
102
113
  uri: 'smartreport://debt-aging',
103
114
  name: 'Debt Aging Analysis',
@@ -109,7 +120,31 @@ export function register(api: any) {
109
120
  }
110
121
  });
111
122
 
123
+ api.registerResource({
124
+ uri: 'smartreport://dashboard',
125
+ name: 'Daily Dashboard',
126
+ description: 'Real-time KPI dashboard (stats, highlights, alerts)',
127
+ mimeType: 'application/json',
128
+ read: async (params: any) => {
129
+ const data = await callMcp(api, 'smartreport/dashboard', params || {});
130
+ return { content: JSON.stringify(data, null, 2) };
131
+ }
132
+ });
133
+
112
134
  // 3. Agent Tools
135
+ api.registerTool({
136
+ name: 'get_daily_dashboard',
137
+ description: 'Retrieve real-time KPI dashboard (stats, highlights, alerts).',
138
+ execute: async (args: any) => {
139
+ try {
140
+ const data = await callMcp(api, 'smartreport/dashboard', args);
141
+ return { text: JSON.stringify(data, null, 2) };
142
+ } catch (err: any) {
143
+ return { error: err.message };
144
+ }
145
+ }
146
+ });
147
+
113
148
  api.registerTool({
114
149
  name: 'get_list_reports',
115
150
  description: 'Retrieve reports with filters (date, employee, division).',