@sodikinnaa/smart-report-plugin 2026.3.404 → 2026.4.1

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  declare const plugin: any;
2
- export declare const register: (api: any) => any;
3
- export declare const activate: (api: any) => any;
4
2
  export default plugin;
3
+ export declare const register: any;
4
+ export declare const activate: any;
package/dist/index.js CHANGED
@@ -1,7 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.activate = exports.register = void 0;
1
7
  /**
2
8
  * Smart Report MCP Plugin for OpenClaw
3
9
  */
4
- import axios from 'axios';
10
+ const axios_1 = __importDefault(require("axios"));
5
11
  const PLUGIN_ID = 'smart-report-plugin';
6
12
  const API_BASE = 'https://smartreport.siapdigital.my.id/api/mcp';
7
13
  async function callMcp(api, method, params = {}) {
@@ -10,7 +16,7 @@ async function callMcp(api, method, params = {}) {
10
16
  if (!token) {
11
17
  throw new Error('API Token not found. Please run "openclaw smart-auth <token>" first.');
12
18
  }
13
- const response = await axios.post(API_BASE, {
19
+ const response = await axios_1.default.post(API_BASE, {
14
20
  jsonrpc: '2.0',
15
21
  method: method,
16
22
  params: params,
@@ -30,7 +36,7 @@ async function callMcp(api, method, params = {}) {
30
36
  const plugin = {
31
37
  id: PLUGIN_ID,
32
38
  name: "Smart Report Integration",
33
- version: "2026.3.404",
39
+ version: "2.1.4",
34
40
  register(api) {
35
41
  // 1. CLI Commands
36
42
  api.registerCli(({ program }) => {
@@ -161,6 +167,6 @@ const plugin = {
161
167
  });
162
168
  }
163
169
  };
164
- export const register = (api) => plugin.register(api);
165
- export const activate = (api) => plugin.register(api);
166
- export default plugin;
170
+ exports.default = plugin;
171
+ exports.register = plugin.register;
172
+ exports.activate = plugin.register;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "smart-report-plugin",
3
3
  "name": "Smart Report Integration",
4
- "version": "2026.3.404",
4
+ "version": "2026.3.43",
5
5
  "description": "Integration plugin for Smart Report and AI Analytics with Daily Dashboard and Dynamic Guides",
6
6
  "entrypoint": "./dist/index.js",
7
7
  "skills": [
package/package.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
2
  "name": "@sodikinnaa/smart-report-plugin",
3
- "version": "2026.3.404",
3
+ "version": "2026.4.1",
4
4
  "description": "OpenClaw plugin for Smart Report system integration with Daily Dashboard",
5
5
  "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "type": "module",
8
- "types": "dist/index.d.ts",
6
+ "types": "./dist/index.d.ts",
9
7
  "scripts": {
10
- "build": "tsc && node scripts/audit-sync.js",
11
- "test": "node test/simple.test.js",
8
+ "build": "tsc",
9
+ "test": "node scripts/test-loader.js",
12
10
  "publish": "npm publish --access public"
13
11
  },
14
12
  "keywords": [
@@ -24,6 +22,7 @@
24
22
  ]
25
23
  },
26
24
  "devDependencies": {
25
+ "@types/node": "^25.3.3",
27
26
  "typescript": "^5.0.0"
28
27
  },
29
28
  "dependencies": {
@@ -0,0 +1,16 @@
1
+ // CI Gate Simulation
2
+ try {
3
+ const plugin = require('../dist/index.js');
4
+ console.log('Loading plugin:', Object.keys(plugin));
5
+
6
+ if (typeof plugin.register !== 'function' && typeof plugin.activate !== 'function') {
7
+ console.error('❌ CI Gate Failed: plugin export missing register/activate');
8
+ process.exit(1);
9
+ }
10
+
11
+ console.log('✅ CI Gate Passed: plugin exports register/activate correctly');
12
+ process.exit(0);
13
+ } catch (err) {
14
+ console.error('❌ CI Gate Failed with Exception:', err.message);
15
+ process.exit(1);
16
+ }
package/src/index.ts CHANGED
@@ -37,7 +37,7 @@ async function callMcp(api: any, method: string, params: any = {}) {
37
37
  const plugin: any = {
38
38
  id: PLUGIN_ID,
39
39
  name: "Smart Report Integration",
40
- version: "2026.3.404",
40
+ version: "2.1.4",
41
41
 
42
42
  register(api: any) {
43
43
  // 1. CLI Commands
@@ -175,6 +175,6 @@ const plugin: any = {
175
175
  }
176
176
  };
177
177
 
178
- export const register = (api: any) => plugin.register(api);
179
- export const activate = (api: any) => plugin.register(api);
180
178
  export default plugin;
179
+ export const register = plugin.register;
180
+ export const activate = plugin.register;
package/tsconfig.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "NodeNext",
5
- "lib": ["ESNext"],
3
+ "target": "ES2022",
4
+ "module": "CommonJS",
5
+ "lib": ["ES2022", "DOM"],
6
6
  "declaration": true,
7
7
  "outDir": "./dist",
8
8
  "strict": true,
9
9
  "esModuleInterop": true,
10
10
  "skipLibCheck": true,
11
11
  "forceConsistentCasingInFileNames": true,
12
- "moduleResolution": "NodeNext"
12
+ "moduleResolution": "node"
13
13
  },
14
14
  "include": ["src/**/*"]
15
15
  }
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import fs from 'fs';
4
- import path from 'path';
5
-
6
- const pluginPath = process.argv[2] || '.';
7
- const packageJsonPath = path.join(pluginPath, 'package.json');
8
- const openclawJsonPath = path.join(pluginPath, 'openclaw.plugin.json');
9
- const distIndexPath = path.join(pluginPath, 'dist/index.js');
10
-
11
- console.log('🔍 Starting Plugin Sync & Audit...');
12
-
13
- // 1. Read package.json
14
- if (!fs.existsSync(packageJsonPath)) {
15
- console.error('❌ package.json not found');
16
- process.exit(1);
17
- }
18
- const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
19
- const version = pkg.version;
20
-
21
- // 2. Sync openclaw.plugin.json
22
- if (fs.existsSync(openclawJsonPath)) {
23
- const pluginJson = JSON.parse(fs.readFileSync(openclawJsonPath, 'utf8'));
24
- if (pluginJson.version !== version) {
25
- console.log(`⚠️ Syncing openclaw.plugin.json version: ${pluginJson.version} -> ${version}`);
26
- pluginJson.version = version;
27
- fs.writeFileSync(openclawJsonPath, JSON.stringify(pluginJson, null, 2));
28
- } else {
29
- console.log(`✅ openclaw.plugin.json version matches: ${version}`);
30
- }
31
- }
32
-
33
- // 3. Verify dist/index.js (Loader Contract)
34
- if (fs.existsSync(distIndexPath)) {
35
- const content = fs.readFileSync(distIndexPath, 'utf8');
36
- const hasRegister = content.includes('export const register') || content.includes('exports.register');
37
- const hasActivate = content.includes('export const activate') || content.includes('exports.activate');
38
- const hasVersionMatch = content.includes(`version: "${version}"`) || content.includes(`version: '${version}'`);
39
-
40
- if (!hasRegister || !hasActivate) {
41
- console.error('❌ Loader Contract Violation: Missing register or activate export in dist/index.js');
42
- process.exit(1);
43
- }
44
-
45
- // 4. Entrypoint verification
46
- const pluginJsonPath = path.join(pluginPath, 'openclaw.plugin.json');
47
- if (fs.existsSync(pluginJsonPath)) {
48
- const pluginJson = JSON.parse(fs.readFileSync(pluginJsonPath, 'utf8'));
49
- if (!pluginJson.entrypoint || !pluginJson.entrypoint.startsWith('./')) {
50
- console.error('❌ Manifest Violation: "entrypoint" must exist and start with "./" (e.g., "./dist/index.js")');
51
- process.exit(1);
52
- }
53
- if (pluginJson.main) {
54
- console.error('❌ Manifest Violation: "main" field detected in openclaw.plugin.json. Use "entrypoint" only for OpenClaw manifests to avoid loader confusion.');
55
- process.exit(1);
56
- }
57
- console.log('✅ Manifest: valid entrypoint found and no "main" field.');
58
- }
59
-
60
- console.log('✅ Loader Contract: register/activate exports found.');
61
-
62
- if (!hasVersionMatch) {
63
- console.error(`❌ Internal version in dist/index.js out of sync! Build target: ${version}`);
64
- process.exit(1);
65
- }
66
- console.log(`✅ Internal build version matches: ${version}`);
67
- } else {
68
- console.warn('⚠️ dist/index.js not found. Run build first.');
69
- }
70
-
71
- console.log('🚀 Audit Completed Successfully.');
package/test/api.test.js DELETED
@@ -1,36 +0,0 @@
1
-
2
- import axios from 'axios';
3
-
4
- const API_BASE = 'https://smartreport.siapdigital.my.id/api/mcp';
5
- const token = 'Wkr4v8TjpoXGPt4arv8EcBuXYpZaSDX8P0WL4dwPcanNRUAfNUrHF33j081lII30';
6
-
7
- async function testApi() {
8
- try {
9
- console.log('Testing Smart Report API with provided token...');
10
- const response = await axios.post(API_BASE, {
11
- jsonrpc: '2.0',
12
- method: 'guides/list',
13
- params: {},
14
- id: Date.now()
15
- }, {
16
- headers: {
17
- 'Authorization': `Bearer ${token}`,
18
- 'Content-Type': 'application/json',
19
- 'Accept': 'application/json'
20
- }
21
- });
22
-
23
- if (response.data.error) {
24
- console.error('❌ API Error:', response.data.error.message);
25
- process.exit(1);
26
- }
27
-
28
- console.log('✅ API Success! Found', response.data.result.length, 'guides.');
29
- process.exit(0);
30
- } catch (err) {
31
- console.error('❌ Connection Error:', err.message);
32
- process.exit(1);
33
- }
34
- }
35
-
36
- testApi();
@@ -1 +0,0 @@
1
- console.log('Dummy test passed');