@sodikinnaa/smart-report-plugin 1.0.7 → 1.0.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/README.md CHANGED
@@ -1,33 +1,28 @@
1
- # Smart Report Plugin for OpenClaw
1
+ # Smart Report MCP Plugin for OpenClaw (v1.0.8)
2
2
 
3
- Plugin ini mengintegrasikan ekosistem OpenClaw dengan sistem pelaporan Smart Report via protokol MCP.
3
+ Plugin integrasi resmi untuk menghubungkan OpenClaw dengan ekosistem **Smart Report**. Memungkinkan analisis data karyawan, laporan harian, dan dashboard KPI secara real-time.
4
4
 
5
- ## 🛠️ Fitur
6
- - **CLI Auth:** Autentikasi mudah menggunakan token API.
7
- - **Resources:** Akses data real-time via URI `smartreport://`.
8
- - **Agent Tools:** Memungkinkan AI melakukan analisis laporan dan performa secara otonom.
9
-
10
- ## 🚀 Instalasi
11
- 1. Clone repositori ini ke folder `~/.openclaw/extensions/`.
12
- 2. Jalankan `npm install` dan `npm run build`.
13
- 3. Tambahkan entry di `openclaw.json`:
14
- ```json
15
- "plugins": {
16
- "allow": ["smart-report-plugin"]
17
- }
18
- ```
19
-
20
- ## 🔑 Konfigurasi
21
- Lakukan autentikasi via CLI:
5
+ ## 🚀 Quick Start
22
6
  ```bash
23
- openclaw smart-auth <YOUR_API_TOKEN>
7
+ # 1. Instal Plugin
8
+ openclaw plugins install @sodikinnaa/smart-report-plugin
9
+
10
+ # 2. Aktivasi Token
11
+ openclaw smart-auth YOUR_SECRET_TOKEN
24
12
  ```
25
13
 
26
- ## 📖 URI Resources
27
- - `smartreport://reports`: 10 Laporan terbaru.
28
- - `smartreport://employees`: Daftar seluruh karyawan.
29
- - `smartreport://debt-aging`: Analisis keterlambatan/absen.
14
+ ## 📖 Dokumentasi Lengkap
15
+ Kami telah menyediakan panduan langkah-demi-langkah untuk pengguna teknis maupun non-teknis:
16
+ * [**Panduan Pengguna (User Guide)**](docs/USER_GUIDE.md) - Prasyarat, Instalasi, Tooling, dan Troubleshooting.
17
+
18
+ ## 🛠️ Fitur Utama
19
+ * **MCP Integration:** Mendukung standar Model Context Protocol.
20
+ * **KPI Dashboard:** Data agregasi harian (Compact/Full/Ops mode).
21
+ * **Deep Analysis:** Tool untuk mendeteksi "Debt Performance" karyawan.
22
+ * **Division Aware:** Data karyawan sekarang sudah menyertakan nama divisi.
23
+
24
+ ## ⚖️ Lisensi
25
+ Distributed under the MIT License. See `LICENSE` for more information.
30
26
 
31
- ## 🤖 AI Tools
32
- - `get_list_reports`: Mengambil laporan dengan filter.
33
- - `get_debt_analysis`: Analisis performa dan tugas tertunda.
27
+ ---
28
+ *Powered by Sultan Engine*
package/dist/index.js CHANGED
@@ -110,7 +110,30 @@ export function register(api) {
110
110
  return { content: JSON.stringify(data, null, 2) };
111
111
  }
112
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
+ });
113
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
+ });
114
137
  api.registerTool({
115
138
  name: 'get_list_reports',
116
139
  description: 'Retrieve reports with filters (date, employee, division).',
@@ -0,0 +1,97 @@
1
+ # 📊 Panduan Lengkap Smart Report MCP Plugin
2
+
3
+ Selamat datang di ekosistem Smart Report! Plugin ini memungkinkan asisten AI Anda (OpenClaw) terhubung langsung dengan data operasional perusahaan secara real-time.
4
+
5
+ ---
6
+
7
+ ## 1. Prasyarat (Prerequisites)
8
+
9
+ Sebelum instalasi, pastikan Anda memiliki:
10
+ * **Environment:** Node.js v20+ dan OpenClaw Gateway terpasang.
11
+ * **Token API:** Token akses sah dari Admin Smart Report (Misal: `Wkr4v8Tj...`).
12
+ * **Akses Internet:** Dibutuhkan untuk instalasi package dan request data ke server.
13
+
14
+ ---
15
+
16
+ ## 2. Instalasi (Installation)
17
+
18
+ ### Jalur Normal (NPM)
19
+ Gunakan perintah ini di terminal OpenClaw:
20
+ ```bash
21
+ openclaw plugins install @sodikinnaa/smart-report-plugin
22
+ ```
23
+
24
+ ### Jalur Fallback (Jika NPM/Cache Bermasalah)
25
+ Jika instalasi gagal karena kendala versi lama atau cache, gunakan link tarball langsung:
26
+ ```bash
27
+ openclaw plugins install https://registry.npmjs.org/@sodikinnaa/smart-report-plugin/-/smart-report-plugin-1.0.8.tgz
28
+ ```
29
+
30
+ ---
31
+
32
+ ## 3. Aktivasi & Autentikasi (Auth)
33
+
34
+ Setelah terinstal, Anda wajib mendaftarkan token Anda agar AI bisa mengakses data:
35
+
36
+ **Perintah:**
37
+ ```bash
38
+ openclaw smart-auth <TOKEN_ANDA>
39
+ ```
40
+
41
+ **Contoh Sukses:**
42
+ `✅ Smart Report API Token saved successfully.`
43
+
44
+ **Contoh Gagal:**
45
+ `❌ Failed to save config: ...` (Pastikan Anda menjalankan perintah di terminal yang memiliki izin tulis ke folder `.openclaw`).
46
+
47
+ ---
48
+
49
+ ## 4. Daftar Resource & Tool
50
+
51
+ ### 🔎 Resource (Data Statis/Stream)
52
+ AI dapat membaca resource ini untuk mendapatkan konteks:
53
+ * `smartreport://dashboard`: Data KPI hari ini (Total karyawan, kehadiran, completion rate).
54
+ * `smartreport://employees`: Daftar lengkap karyawan beserta nama divisinya.
55
+ * `smartreport://reports`: Aliran 10 laporan terbaru yang masuk.
56
+ * `smartreport://divisions`: Daftar seluruh divisi di perusahaan.
57
+
58
+ ### 🛠️ Agent Tools (Aksi Dinamis)
59
+ AI dapat menjalankan perintah spesifik:
60
+ * **`get_daily_dashboard`**: Mengambil ringkasan statistik harian.
61
+ * **`get_list_reports`**: Mencari laporan berdasarkan filter (tanggal, divisi, nama).
62
+ * **`get_debt_analysis`**: Menganalisis siapa saja yang belum lapor atau memiliki tugas tertunda.
63
+
64
+ ---
65
+
66
+ ## 5. Mode Dashboard
67
+
68
+ Saat meminta dashboard, Anda dapat menentukan `mode`:
69
+ 1. **Compact (Default):** Ringkasan angka utama saja. Cocok untuk update cepat di chat.
70
+ 2. **Full:** Menyertakan detail statistik per divisi. Cocok untuk laporan manajemen.
71
+ 3. **Ops:** Menyertakan alert sistem dan highlight operasional. Cocok untuk monitoring tim.
72
+
73
+ ---
74
+
75
+ ## 6. Workflow Harian (Best Practice)
76
+
77
+ Berikut adalah contoh alur kerja asisten AI Anda setiap hari:
78
+ 1. **Pagi (09:00):** AI mengecek `smartreport://employees` untuk memetakan tim.
79
+ 2. **Siang (13:00):** AI menjalankan `get_daily_dashboard(mode="compact")` untuk melihat progres awal.
80
+ 3. **Sore (17:00):** AI menjalankan `get_debt_analysis` dan memberikan daftar orang yang belum lapor kepada Admin.
81
+ 4. **Malam (20:00):** AI menarik `get_daily_dashboard(mode="full")` untuk laporan penutup ke WhatsApp Owner.
82
+
83
+ ---
84
+
85
+ ## 7. Troubleshooting (Solusi Cepat)
86
+
87
+ * **Error: `ReferenceError exports is not defined`**
88
+ * *Solusi:* Update ke versi v1.0.6+ (`npm install ...@latest`).
89
+ * **Error: `package.json missing openclaw.extensions`**
90
+ * *Solusi:* Update ke versi v1.0.4+.
91
+ * **Error: `Method not found (-32601)`**
92
+ * *Solusi:* Pastikan backend sudah terupdate ke v1.3.0.
93
+ * **Error: `Unauthorized`**
94
+ * *Solusi:* Masukkan kembali token valid menggunakan `openclaw smart-auth`.
95
+
96
+ ---
97
+ *Dokumentasi ini dibuat oleh Sultan Engine Core untuk memastikan kelancaran operasional Anda.*
@@ -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.7",
4
- "description": "OpenClaw plugin for Smart Report system integration",
3
+ "version": "1.0.9",
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
@@ -120,7 +120,31 @@ export function register(api: any) {
120
120
  }
121
121
  });
122
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
+
123
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
+
124
148
  api.registerTool({
125
149
  name: 'get_list_reports',
126
150
  description: 'Retrieve reports with filters (date, employee, division).',