@majkapp/plugin-kit 1.0.18 → 1.1.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/dist/generator/cli.d.ts +3 -0
- package/dist/generator/cli.d.ts.map +1 -0
- package/dist/generator/cli.js +161 -0
- package/dist/generator/generator.d.ts +6 -0
- package/dist/generator/generator.d.ts.map +1 -0
- package/dist/generator/generator.js +389 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/plugin-kit.d.ts +6 -0
- package/dist/plugin-kit.d.ts.map +1 -1
- package/dist/plugin-kit.js +331 -19
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/generator/cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const commander_1 = require("commander");
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const child_process_1 = require("child_process");
|
|
41
|
+
const generator_1 = require("./generator");
|
|
42
|
+
commander_1.program
|
|
43
|
+
.name('plugin-kit')
|
|
44
|
+
.version('1.0.20')
|
|
45
|
+
.description('Plugin Kit CLI - Generate TypeScript clients from plugin definitions');
|
|
46
|
+
commander_1.program
|
|
47
|
+
.command('generate')
|
|
48
|
+
.description('Generate a TypeScript client from a plugin definition')
|
|
49
|
+
.option('-e, --entry <path>', 'Path to the compiled plugin entry file', './index.js')
|
|
50
|
+
.option('-o, --output <path>', 'Output directory for generated client', './ui/src/generated')
|
|
51
|
+
.option('-w, --watch', 'Watch for changes and regenerate', false)
|
|
52
|
+
.action(async (options) => {
|
|
53
|
+
const entryPath = path.resolve(options.entry);
|
|
54
|
+
const outputPath = path.resolve(options.output);
|
|
55
|
+
const logPath = path.join(outputPath, 'generation.log');
|
|
56
|
+
// Ensure output directory exists
|
|
57
|
+
fs.mkdirSync(outputPath, { recursive: true });
|
|
58
|
+
const generate = async () => {
|
|
59
|
+
const startTime = Date.now();
|
|
60
|
+
const log = [];
|
|
61
|
+
log.push(`=== Plugin Kit Client Generation ===`);
|
|
62
|
+
log.push(`Time: ${new Date().toISOString()}`);
|
|
63
|
+
log.push(`Entry: ${entryPath}`);
|
|
64
|
+
log.push(`Output: ${outputPath}`);
|
|
65
|
+
log.push(``);
|
|
66
|
+
try {
|
|
67
|
+
// Check if entry file exists
|
|
68
|
+
if (!fs.existsSync(entryPath)) {
|
|
69
|
+
throw new Error(`Entry file not found: ${entryPath}`);
|
|
70
|
+
}
|
|
71
|
+
log.push(`✓ Found entry file`);
|
|
72
|
+
// Extract metadata from plugin
|
|
73
|
+
const metadata = await extractMetadata(entryPath);
|
|
74
|
+
log.push(`✓ Extracted metadata from plugin: ${metadata.name} v${metadata.version}`);
|
|
75
|
+
log.push(` - ${metadata.functions.length} functions`);
|
|
76
|
+
log.push(` - ${metadata.screens.length} screens`);
|
|
77
|
+
log.push(` - ${metadata.tools.length} tools`);
|
|
78
|
+
log.push(``);
|
|
79
|
+
// Generate client files
|
|
80
|
+
const result = await (0, generator_1.generateClient)(metadata, outputPath, log);
|
|
81
|
+
const duration = Date.now() - startTime;
|
|
82
|
+
log.push(``);
|
|
83
|
+
log.push(`✓ Generation completed in ${duration}ms`);
|
|
84
|
+
if (result.warnings.length > 0) {
|
|
85
|
+
log.push(``);
|
|
86
|
+
log.push(`⚠ Warnings:`);
|
|
87
|
+
result.warnings.forEach(w => log.push(` - ${w}`));
|
|
88
|
+
}
|
|
89
|
+
// Write log file (overwrite each time)
|
|
90
|
+
fs.writeFileSync(logPath, log.join('\n'), 'utf-8');
|
|
91
|
+
console.log(`✅ Client generated successfully in ${duration}ms`);
|
|
92
|
+
console.log(` Output: ${outputPath}`);
|
|
93
|
+
console.log(` Files: ${result.files.join(', ')}`);
|
|
94
|
+
if (result.warnings.length > 0) {
|
|
95
|
+
console.log(` ⚠ ${result.warnings.length} warnings (see generation.log)`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
log.push(`✗ Error: ${error.message}`);
|
|
100
|
+
log.push(error.stack || '');
|
|
101
|
+
fs.writeFileSync(logPath, log.join('\n'), 'utf-8');
|
|
102
|
+
console.error(`❌ Generation failed: ${error.message}`);
|
|
103
|
+
console.error(` See ${logPath} for details`);
|
|
104
|
+
if (!options.watch) {
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
if (options.watch) {
|
|
110
|
+
console.log(`👁 Watching for changes...`);
|
|
111
|
+
// Initial generation
|
|
112
|
+
await generate();
|
|
113
|
+
// Watch for changes
|
|
114
|
+
let timeout;
|
|
115
|
+
fs.watch(entryPath, () => {
|
|
116
|
+
clearTimeout(timeout);
|
|
117
|
+
timeout = setTimeout(() => {
|
|
118
|
+
console.log(`🔄 Changes detected, regenerating...`);
|
|
119
|
+
generate();
|
|
120
|
+
}, 500);
|
|
121
|
+
});
|
|
122
|
+
// Keep process alive
|
|
123
|
+
process.stdin.resume();
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
await generate();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
commander_1.program.parse();
|
|
130
|
+
async function extractMetadata(entryPath) {
|
|
131
|
+
// Create a temp file for the output
|
|
132
|
+
const tempFile = path.join(path.dirname(entryPath), `.plugin-metadata-${Date.now()}.json`);
|
|
133
|
+
try {
|
|
134
|
+
// Run the plugin in extract mode with file output
|
|
135
|
+
(0, child_process_1.execSync)(`node "${entryPath}"`, {
|
|
136
|
+
env: {
|
|
137
|
+
...process.env,
|
|
138
|
+
PLUGIN_KIT_MODE: 'extract',
|
|
139
|
+
PLUGIN_KIT_OUTPUT: tempFile
|
|
140
|
+
},
|
|
141
|
+
cwd: path.dirname(entryPath),
|
|
142
|
+
stdio: 'inherit' // Let the plugin print its own messages
|
|
143
|
+
});
|
|
144
|
+
// Read the generated file
|
|
145
|
+
if (!fs.existsSync(tempFile)) {
|
|
146
|
+
throw new Error('Metadata file was not created');
|
|
147
|
+
}
|
|
148
|
+
const content = fs.readFileSync(tempFile, 'utf-8');
|
|
149
|
+
const metadata = JSON.parse(content);
|
|
150
|
+
// Clean up temp file
|
|
151
|
+
fs.unlinkSync(tempFile);
|
|
152
|
+
return metadata;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
// Clean up temp file if it exists
|
|
156
|
+
if (fs.existsSync(tempFile)) {
|
|
157
|
+
fs.unlinkSync(tempFile);
|
|
158
|
+
}
|
|
159
|
+
throw new Error(`Failed to extract metadata: ${error.message}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/generator/generator.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,GAAG,EACb,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EAAE,GACZ,OAAO,CAAC,gBAAgB,CAAC,CAmC3B"}
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.generateClient = generateClient;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
async function generateClient(metadata, outputPath, log) {
|
|
40
|
+
const warnings = [];
|
|
41
|
+
const files = [];
|
|
42
|
+
// Helper to write files
|
|
43
|
+
const writeFile = (filename, content) => {
|
|
44
|
+
const filePath = path.join(outputPath, filename);
|
|
45
|
+
fs.writeFileSync(filePath, content, 'utf-8');
|
|
46
|
+
files.push(filename);
|
|
47
|
+
log.push(` ✓ Generated ${filename}`);
|
|
48
|
+
};
|
|
49
|
+
try {
|
|
50
|
+
// 1. Generate TypeScript types
|
|
51
|
+
const types = generateTypes(metadata, warnings, log);
|
|
52
|
+
writeFile('types.ts', types);
|
|
53
|
+
// 2. Generate client class
|
|
54
|
+
const client = generateClientClass(metadata, warnings, log);
|
|
55
|
+
writeFile('client.ts', client);
|
|
56
|
+
// 3. Generate React hooks
|
|
57
|
+
const hooks = generateReactHooks(metadata, warnings, log);
|
|
58
|
+
writeFile('hooks.ts', hooks);
|
|
59
|
+
// 4. Generate index file
|
|
60
|
+
const index = generateIndex();
|
|
61
|
+
writeFile('index.ts', index);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
warnings.push(`Partial generation error: ${error.message}`);
|
|
65
|
+
log.push(` ⚠ Partial generation error: ${error.message}`);
|
|
66
|
+
}
|
|
67
|
+
return { files, warnings };
|
|
68
|
+
}
|
|
69
|
+
function generateTypes(metadata, warnings, log) {
|
|
70
|
+
const lines = [];
|
|
71
|
+
lines.push(`/**
|
|
72
|
+
* Auto-generated TypeScript types for ${metadata.name}
|
|
73
|
+
* Generated at: ${new Date().toISOString()}
|
|
74
|
+
* Plugin version: ${metadata.version}
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
`);
|
|
78
|
+
// Extract types from function schemas
|
|
79
|
+
const processedTypes = new Set();
|
|
80
|
+
metadata.functions.forEach((func) => {
|
|
81
|
+
try {
|
|
82
|
+
// Generate input type
|
|
83
|
+
const inputTypeName = `${capitalize(func.name)}Input`;
|
|
84
|
+
if (!processedTypes.has(inputTypeName)) {
|
|
85
|
+
lines.push(`export interface ${inputTypeName} ${schemaToTypeScript(func.input, 0)}\n`);
|
|
86
|
+
processedTypes.add(inputTypeName);
|
|
87
|
+
}
|
|
88
|
+
// Generate output type
|
|
89
|
+
const outputTypeName = `${capitalize(func.name)}Output`;
|
|
90
|
+
if (!processedTypes.has(outputTypeName)) {
|
|
91
|
+
// Handle array types specially - use type alias instead of interface
|
|
92
|
+
if (func.output.type === 'array') {
|
|
93
|
+
lines.push(`export type ${outputTypeName} = ${schemaToTypeScript(func.output, 0)};\n`);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
lines.push(`export interface ${outputTypeName} ${schemaToTypeScript(func.output, 0)}\n`);
|
|
97
|
+
}
|
|
98
|
+
processedTypes.add(outputTypeName);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
warnings.push(`Failed to generate types for ${func.name}: ${error.message}`);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
// Standard response types
|
|
106
|
+
lines.push(`
|
|
107
|
+
export interface SuccessResponse<T> {
|
|
108
|
+
success: true;
|
|
109
|
+
data: T;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ErrorResponse {
|
|
113
|
+
success: false;
|
|
114
|
+
error: string;
|
|
115
|
+
details?: any[];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type ApiResponse<T> = SuccessResponse<T> | ErrorResponse;
|
|
119
|
+
`);
|
|
120
|
+
return lines.join('\n');
|
|
121
|
+
}
|
|
122
|
+
function generateClientClass(metadata, warnings, log) {
|
|
123
|
+
const lines = [];
|
|
124
|
+
lines.push(`/**
|
|
125
|
+
* Auto-generated client for ${metadata.name}
|
|
126
|
+
* Generated at: ${new Date().toISOString()}
|
|
127
|
+
* Plugin version: ${metadata.version}
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
import type {
|
|
131
|
+
${metadata.functions.map((f) => ` ${capitalize(f.name)}Input,
|
|
132
|
+
${capitalize(f.name)}Output`).join(',\n')}
|
|
133
|
+
} from './types';
|
|
134
|
+
|
|
135
|
+
export class ${capitalize(toCamelCase(metadata.id))}Client {
|
|
136
|
+
constructor(private baseUrl: string = '') {}
|
|
137
|
+
|
|
138
|
+
private async request<TInput, TOutput>(
|
|
139
|
+
functionName: string,
|
|
140
|
+
input: TInput
|
|
141
|
+
): Promise<TOutput> {
|
|
142
|
+
try {
|
|
143
|
+
const response = await fetch(\`\${this.baseUrl}/api/fn/\${functionName}\`, {
|
|
144
|
+
method: 'POST',
|
|
145
|
+
headers: {
|
|
146
|
+
'Content-Type': 'application/json',
|
|
147
|
+
},
|
|
148
|
+
body: JSON.stringify(input),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const result = await response.json();
|
|
152
|
+
|
|
153
|
+
// The transport wraps responses in { success: boolean, data?: T, error?: string }
|
|
154
|
+
// Check for errors first
|
|
155
|
+
if (result.success === false) {
|
|
156
|
+
throw new Error(result.error || \`Function \${functionName} failed\`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Return the unwrapped data
|
|
160
|
+
// The TypeScript output types represent the data inside the wrapper
|
|
161
|
+
return result.data;
|
|
162
|
+
} catch (error: any) {
|
|
163
|
+
console.error(\`Error calling \${functionName}:\`, error);
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
`);
|
|
168
|
+
// Generate methods for each function
|
|
169
|
+
metadata.functions.forEach((func) => {
|
|
170
|
+
try {
|
|
171
|
+
const methodName = toCamelCase(func.name);
|
|
172
|
+
const inputType = `${capitalize(func.name)}Input`;
|
|
173
|
+
const outputType = `${capitalize(func.name)}Output`;
|
|
174
|
+
lines.push(`
|
|
175
|
+
/**
|
|
176
|
+
* ${func.description}${func.deprecated ? '\n * @deprecated' : ''}
|
|
177
|
+
*/
|
|
178
|
+
async ${methodName}(input: ${inputType} = {}): Promise<${outputType}> {
|
|
179
|
+
return this.request<${inputType}, ${outputType}>('${func.name}', input);
|
|
180
|
+
}
|
|
181
|
+
`);
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
warnings.push(`Failed to generate method for ${func.name}: ${error.message}`);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
lines.push(`}
|
|
188
|
+
|
|
189
|
+
// Default singleton instance
|
|
190
|
+
export const ${toCamelCase(metadata.id)}Client = new ${capitalize(toCamelCase(metadata.id))}Client();
|
|
191
|
+
`);
|
|
192
|
+
return lines.join('');
|
|
193
|
+
}
|
|
194
|
+
function generateReactHooks(metadata, warnings, log) {
|
|
195
|
+
const lines = [];
|
|
196
|
+
lines.push(`/**
|
|
197
|
+
* Auto-generated React hooks for ${metadata.name}
|
|
198
|
+
* Generated at: ${new Date().toISOString()}
|
|
199
|
+
* Plugin version: ${metadata.version}
|
|
200
|
+
*/
|
|
201
|
+
|
|
202
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
203
|
+
import { ${toCamelCase(metadata.id)}Client } from './client';
|
|
204
|
+
import type {
|
|
205
|
+
${metadata.functions.map((f) => ` ${capitalize(f.name)}Input,
|
|
206
|
+
${capitalize(f.name)}Output`).join(',\n')}
|
|
207
|
+
} from './types';
|
|
208
|
+
|
|
209
|
+
export interface UseQueryResult<T> {
|
|
210
|
+
data: T | undefined;
|
|
211
|
+
error: Error | undefined;
|
|
212
|
+
loading: boolean;
|
|
213
|
+
refetch: () => void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface UseMutationResult<TInput, TOutput> {
|
|
217
|
+
mutate: (input: TInput) => Promise<TOutput>;
|
|
218
|
+
data: TOutput | undefined;
|
|
219
|
+
error: Error | undefined;
|
|
220
|
+
loading: boolean;
|
|
221
|
+
}
|
|
222
|
+
`);
|
|
223
|
+
// Generate hooks for each function
|
|
224
|
+
metadata.functions.forEach((func) => {
|
|
225
|
+
try {
|
|
226
|
+
const hookName = `use${capitalize(func.name)}`;
|
|
227
|
+
const inputType = `${capitalize(func.name)}Input`;
|
|
228
|
+
const outputType = `${capitalize(func.name)}Output`;
|
|
229
|
+
// Determine if it's a query or mutation based on name/tags
|
|
230
|
+
const isQuery = func.name.startsWith('get') ||
|
|
231
|
+
func.name.startsWith('list') ||
|
|
232
|
+
func.name.includes('health') ||
|
|
233
|
+
func.name.includes('status');
|
|
234
|
+
if (isQuery) {
|
|
235
|
+
lines.push(`
|
|
236
|
+
/**
|
|
237
|
+
* React hook for ${func.description}
|
|
238
|
+
*/
|
|
239
|
+
export function ${hookName}(
|
|
240
|
+
input: ${inputType} = {},
|
|
241
|
+
options?: { enabled?: boolean; refetchInterval?: number }
|
|
242
|
+
): UseQueryResult<${outputType}> {
|
|
243
|
+
const [data, setData] = useState<${outputType} | undefined>();
|
|
244
|
+
const [error, setError] = useState<Error | undefined>();
|
|
245
|
+
const [loading, setLoading] = useState(false);
|
|
246
|
+
|
|
247
|
+
const fetch = useCallback(async () => {
|
|
248
|
+
if (options?.enabled === false) return;
|
|
249
|
+
|
|
250
|
+
setLoading(true);
|
|
251
|
+
setError(undefined);
|
|
252
|
+
|
|
253
|
+
try {
|
|
254
|
+
const result = await ${toCamelCase(metadata.id)}Client.${toCamelCase(func.name)}(input);
|
|
255
|
+
setData(result);
|
|
256
|
+
} catch (err: any) {
|
|
257
|
+
setError(err);
|
|
258
|
+
} finally {
|
|
259
|
+
setLoading(false);
|
|
260
|
+
}
|
|
261
|
+
}, [JSON.stringify(input), options?.enabled]);
|
|
262
|
+
|
|
263
|
+
useEffect(() => {
|
|
264
|
+
fetch();
|
|
265
|
+
|
|
266
|
+
if (options?.refetchInterval) {
|
|
267
|
+
const interval = setInterval(fetch, options.refetchInterval);
|
|
268
|
+
return () => clearInterval(interval);
|
|
269
|
+
}
|
|
270
|
+
}, [fetch, options?.refetchInterval]);
|
|
271
|
+
|
|
272
|
+
return { data, error, loading, refetch: fetch };
|
|
273
|
+
}
|
|
274
|
+
`);
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
lines.push(`
|
|
278
|
+
/**
|
|
279
|
+
* React hook for ${func.description}
|
|
280
|
+
*/
|
|
281
|
+
export function ${hookName}(): UseMutationResult<${inputType}, ${outputType}> {
|
|
282
|
+
const [data, setData] = useState<${outputType} | undefined>();
|
|
283
|
+
const [error, setError] = useState<Error | undefined>();
|
|
284
|
+
const [loading, setLoading] = useState(false);
|
|
285
|
+
|
|
286
|
+
const mutate = useCallback(async (input: ${inputType}): Promise<${outputType}> => {
|
|
287
|
+
setLoading(true);
|
|
288
|
+
setError(undefined);
|
|
289
|
+
|
|
290
|
+
try {
|
|
291
|
+
const result = await ${toCamelCase(metadata.id)}Client.${toCamelCase(func.name)}(input);
|
|
292
|
+
setData(result);
|
|
293
|
+
return result;
|
|
294
|
+
} catch (err: any) {
|
|
295
|
+
setError(err);
|
|
296
|
+
throw err;
|
|
297
|
+
} finally {
|
|
298
|
+
setLoading(false);
|
|
299
|
+
}
|
|
300
|
+
}, []);
|
|
301
|
+
|
|
302
|
+
return { mutate, data, error, loading };
|
|
303
|
+
}
|
|
304
|
+
`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
warnings.push(`Failed to generate hook for ${func.name}: ${error.message}`);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
return lines.join('');
|
|
312
|
+
}
|
|
313
|
+
function generateIndex() {
|
|
314
|
+
return `/**
|
|
315
|
+
* Auto-generated client exports
|
|
316
|
+
* Generated at: ${new Date().toISOString()}
|
|
317
|
+
*/
|
|
318
|
+
|
|
319
|
+
export * from './types';
|
|
320
|
+
export * from './client';
|
|
321
|
+
export * from './hooks';
|
|
322
|
+
`;
|
|
323
|
+
}
|
|
324
|
+
// Helper functions
|
|
325
|
+
function schemaToTypeScript(schema, indent) {
|
|
326
|
+
if (!schema)
|
|
327
|
+
return 'any';
|
|
328
|
+
const spaces = ' '.repeat(indent);
|
|
329
|
+
if (schema.type === 'object') {
|
|
330
|
+
const props = schema.properties || {};
|
|
331
|
+
const required = schema.required || [];
|
|
332
|
+
const lines = ['{'];
|
|
333
|
+
Object.entries(props).forEach(([key, prop]) => {
|
|
334
|
+
const optional = !required.includes(key) ? '?' : '';
|
|
335
|
+
const type = schemaToTypeScript(prop, indent + 1);
|
|
336
|
+
const description = prop.description ? `\n${spaces} /** ${prop.description} */\n${spaces} ` : '\n' + spaces + ' ';
|
|
337
|
+
lines.push(`${description}${key}${optional}: ${type};`);
|
|
338
|
+
});
|
|
339
|
+
if (Object.keys(props).length === 0) {
|
|
340
|
+
lines.push(`${spaces} [key: string]: any;`);
|
|
341
|
+
}
|
|
342
|
+
lines.push(spaces + '}');
|
|
343
|
+
return lines.join('');
|
|
344
|
+
}
|
|
345
|
+
if (schema.type === 'array') {
|
|
346
|
+
return `${schemaToTypeScript(schema.items, indent)}[]`;
|
|
347
|
+
}
|
|
348
|
+
if (schema.type === 'string') {
|
|
349
|
+
if (schema.enum) {
|
|
350
|
+
return schema.enum.map((e) => `'${e}'`).join(' | ');
|
|
351
|
+
}
|
|
352
|
+
return 'string';
|
|
353
|
+
}
|
|
354
|
+
if (schema.type === 'number' || schema.type === 'integer') {
|
|
355
|
+
return 'number';
|
|
356
|
+
}
|
|
357
|
+
if (schema.type === 'boolean') {
|
|
358
|
+
return 'boolean';
|
|
359
|
+
}
|
|
360
|
+
if (schema.type === 'null') {
|
|
361
|
+
return 'null';
|
|
362
|
+
}
|
|
363
|
+
// Handle union types
|
|
364
|
+
if (Array.isArray(schema.type)) {
|
|
365
|
+
return schema.type.map((t) => {
|
|
366
|
+
if (t === 'null')
|
|
367
|
+
return 'null';
|
|
368
|
+
if (t === 'string')
|
|
369
|
+
return 'string';
|
|
370
|
+
if (t === 'number' || t === 'integer')
|
|
371
|
+
return 'number';
|
|
372
|
+
if (t === 'boolean')
|
|
373
|
+
return 'boolean';
|
|
374
|
+
return 'any';
|
|
375
|
+
}).join(' | ');
|
|
376
|
+
}
|
|
377
|
+
// Handle anyOf/oneOf
|
|
378
|
+
if (schema.anyOf || schema.oneOf) {
|
|
379
|
+
const schemas = schema.anyOf || schema.oneOf;
|
|
380
|
+
return schemas.map((s) => schemaToTypeScript(s, indent)).join(' | ');
|
|
381
|
+
}
|
|
382
|
+
return 'any';
|
|
383
|
+
}
|
|
384
|
+
function capitalize(str) {
|
|
385
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
386
|
+
}
|
|
387
|
+
function toCamelCase(str) {
|
|
388
|
+
return str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
389
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,5 +14,6 @@
|
|
|
14
14
|
export { definePlugin, FluentBuilder } from './plugin-kit';
|
|
15
15
|
export { HttpTransport, WebSocketTransport, MCPTransport } from './transports';
|
|
16
16
|
export { FunctionRegistryImpl } from './registry';
|
|
17
|
+
export { generateClient } from './generator/generator';
|
|
17
18
|
export type { PluginContext, PluginLogger, PluginStorage, ScopedTimers, ScopedIpcRegistry, PluginCapabilities, PluginCapability, ToolImplementation, InProcessPlugin, PluginHealthStatus, ToolSpec, ToolHandler, ApiMethod, ApiRouteDef, JsonSchema, RouteHandler, RequestLike, ResponseLike, UiConfig, HistoryMode, ScreenBase, ReactScreen, HtmlScreen, ConfigWizardDef, SettingsDef, Scope, EntityType, CleanupFn, HealthCheckFn, MCPServerEntity, TeamMemberEntity, FunctionHandler, SubscriptionHandler, FunctionDefinition, SubscriptionDefinition, Transport, TransportMetadata, FunctionRegistry, ClientGenerationConfig } from './types';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,YAAY,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,eAAe,EACf,gBAAgB,EAEhB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* - Lifecycle hooks with cleanup management
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.FunctionRegistryImpl = exports.MCPTransport = exports.WebSocketTransport = exports.HttpTransport = exports.definePlugin = void 0;
|
|
16
|
+
exports.generateClient = exports.FunctionRegistryImpl = exports.MCPTransport = exports.WebSocketTransport = exports.HttpTransport = exports.definePlugin = void 0;
|
|
17
17
|
var plugin_kit_1 = require("./plugin-kit");
|
|
18
18
|
Object.defineProperty(exports, "definePlugin", { enumerable: true, get: function () { return plugin_kit_1.definePlugin; } });
|
|
19
19
|
var transports_1 = require("./transports");
|
|
@@ -22,3 +22,5 @@ Object.defineProperty(exports, "WebSocketTransport", { enumerable: true, get: fu
|
|
|
22
22
|
Object.defineProperty(exports, "MCPTransport", { enumerable: true, get: function () { return transports_1.MCPTransport; } });
|
|
23
23
|
var registry_1 = require("./registry");
|
|
24
24
|
Object.defineProperty(exports, "FunctionRegistryImpl", { enumerable: true, get: function () { return registry_1.FunctionRegistryImpl; } });
|
|
25
|
+
var generator_1 = require("./generator/generator");
|
|
26
|
+
Object.defineProperty(exports, "generateClient", { enumerable: true, get: function () { return generator_1.generateClient; } });
|
package/dist/plugin-kit.d.ts
CHANGED
|
@@ -47,6 +47,12 @@ export interface FluentBuilder<Id extends string> {
|
|
|
47
47
|
mcpServer(servers: MCPServerEntity[]): this;
|
|
48
48
|
/** Add team member entities with full TypeScript validation */
|
|
49
49
|
teamMember(members: TeamMemberEntity[]): this;
|
|
50
|
+
/** Add configurable entities that are only registered after plugin config exists */
|
|
51
|
+
configurableEntity(entityType: EntityType, factory: (config: any) => any[]): this;
|
|
52
|
+
/** Add configurable MCP servers (only registered after config exists) */
|
|
53
|
+
configurableMcp(factory: (config: any) => MCPServerEntity[]): this;
|
|
54
|
+
/** Add configurable team members (only registered after config exists) */
|
|
55
|
+
configurableTeamMember(factory: (config: any) => TeamMemberEntity[]): this;
|
|
50
56
|
/** Add config wizard */
|
|
51
57
|
configWizard(def: ConfigWizardDef): this;
|
|
52
58
|
/** Add settings screen */
|
package/dist/plugin-kit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-kit.d.ts","sourceRoot":"","sources":["../src/plugin-kit.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAGb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,UAAU,EACV,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EAIb,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,SAAS,EAET,sBAAsB,EACvB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-kit.d.ts","sourceRoot":"","sources":["../src/plugin-kit.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAGb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,UAAU,EACV,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,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,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAElG,0BAA0B;IAC1B,MAAM,CAAC,EAAE,EAAE,aAAa,GAAG,IAAI,CAAC;IAEhC;;;;;;;;;;OAUG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,uBAAuB;IACvB,KAAK,IAAI,eAAe,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAClD,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,aAAa,CAAC,EAAE,CAAC,CA0uBnB"}
|
package/dist/plugin-kit.js
CHANGED
|
@@ -9,6 +9,14 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const registry_1 = require("./registry");
|
|
11
11
|
const transports_1 = require("./transports");
|
|
12
|
+
/**
|
|
13
|
+
* Conditional logging - suppressed in extract mode
|
|
14
|
+
*/
|
|
15
|
+
const log = (message) => {
|
|
16
|
+
if (process.env.PLUGIN_KIT_MODE !== 'extract') {
|
|
17
|
+
console.log(message);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
12
20
|
/**
|
|
13
21
|
* Build-time errors with clear, actionable messages
|
|
14
22
|
*/
|
|
@@ -257,20 +265,20 @@ function generateOpenApiSpec(pluginId, pluginName, pluginVersion, routes, baseUr
|
|
|
257
265
|
*/
|
|
258
266
|
function pathToRegex(p) {
|
|
259
267
|
const keys = [];
|
|
260
|
-
|
|
268
|
+
log(`[pathToRegex] Input path: ${p}`);
|
|
261
269
|
// First, escape special regex characters EXCEPT the colon (for path params)
|
|
262
270
|
const escaped = p.replace(/([.+*?=^!${}()[\]|\\])/g, '\\$1');
|
|
263
|
-
|
|
271
|
+
log(`[pathToRegex] After escaping: ${escaped}`);
|
|
264
272
|
// Then, replace path parameters with capturing groups
|
|
265
273
|
const pattern = escaped.replace(/\/:([A-Za-z0-9_]+)/g, (_m, k) => {
|
|
266
274
|
keys.push(k);
|
|
267
|
-
|
|
275
|
+
log(`[pathToRegex] Found param: ${k}`);
|
|
268
276
|
return '/([^/]+)';
|
|
269
277
|
});
|
|
270
|
-
|
|
271
|
-
|
|
278
|
+
log(`[pathToRegex] Final pattern: ${pattern}`);
|
|
279
|
+
log(`[pathToRegex] Keys: [${keys.join(', ')}]`);
|
|
272
280
|
const regex = new RegExp(`^${pattern}$`);
|
|
273
|
-
|
|
281
|
+
log(`[pathToRegex] Final regex: ${regex}`);
|
|
274
282
|
return { regex, keys };
|
|
275
283
|
}
|
|
276
284
|
/**
|
|
@@ -399,9 +407,11 @@ function serveSpa(ui, req, res, ctx) {
|
|
|
399
407
|
* Main plugin class built by the fluent API
|
|
400
408
|
*/
|
|
401
409
|
class BuiltPlugin {
|
|
402
|
-
constructor(id, name, version, capabilities, tools, apiRoutes, uiConfig, reactScreens, htmlScreens, wizard, onReadyFn, healthCheckFn, userProvidedPluginRoot,
|
|
410
|
+
constructor(id, name, version, capabilities, tools, apiRoutes, uiConfig, reactScreens, htmlScreens, wizard, settings, onReadyFn, healthCheckFn, userProvidedPluginRoot,
|
|
403
411
|
// New parameters for function-first architecture
|
|
404
|
-
functionRegistry, transports
|
|
412
|
+
functionRegistry, transports,
|
|
413
|
+
// New parameter for configurable entities
|
|
414
|
+
configurableEntities) {
|
|
405
415
|
this.capabilities = capabilities;
|
|
406
416
|
this.tools = tools;
|
|
407
417
|
this.apiRoutes = apiRoutes;
|
|
@@ -409,9 +419,11 @@ class BuiltPlugin {
|
|
|
409
419
|
this.reactScreens = reactScreens;
|
|
410
420
|
this.htmlScreens = htmlScreens;
|
|
411
421
|
this.wizard = wizard;
|
|
422
|
+
this.settings = settings;
|
|
412
423
|
this.onReadyFn = onReadyFn;
|
|
413
424
|
this.healthCheckFn = healthCheckFn;
|
|
414
425
|
this.userProvidedPluginRoot = userProvidedPluginRoot;
|
|
426
|
+
this.configurableEntities = configurableEntities;
|
|
415
427
|
this.cleanups = [];
|
|
416
428
|
this.router = [];
|
|
417
429
|
this.transports = [];
|
|
@@ -420,11 +432,61 @@ class BuiltPlugin {
|
|
|
420
432
|
this.version = version;
|
|
421
433
|
this.functionRegistry = functionRegistry;
|
|
422
434
|
this.transports = transports || [];
|
|
435
|
+
this.configurableEntities = configurableEntities || [];
|
|
423
436
|
}
|
|
424
|
-
getCapabilities() {
|
|
437
|
+
async getCapabilities() {
|
|
438
|
+
// Start with static capabilities
|
|
439
|
+
const dynamicCapabilities = [...this.capabilities];
|
|
440
|
+
// Only process configurable entities if context is available (after onLoad has been called)
|
|
441
|
+
if (!this.context) {
|
|
442
|
+
// Context not set yet - return only static capabilities
|
|
443
|
+
// This happens when getCapabilities() is called before onLoad()
|
|
444
|
+
return {
|
|
445
|
+
apiVersion: 'majk.capabilities/v1',
|
|
446
|
+
capabilities: dynamicCapabilities
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
// If wizard has schema, check for config and add configurable entities
|
|
450
|
+
if (this.wizard?.schema && this.configurableEntities && this.configurableEntities.length > 0) {
|
|
451
|
+
const storageKey = this.wizard.storageKey || '_plugin_config';
|
|
452
|
+
this.context.logger.info(`[ConfigWizard] getCapabilities: checking for config at key: ${storageKey}`);
|
|
453
|
+
try {
|
|
454
|
+
// Load config from storage
|
|
455
|
+
const config = await this.context.storage.get(storageKey);
|
|
456
|
+
if (config) {
|
|
457
|
+
this.context.logger.info(`[ConfigWizard] ✅ Config found - generating configurable entities`);
|
|
458
|
+
this.context.logger.info(`[ConfigWizard] Config:`, JSON.stringify(config, null, 2));
|
|
459
|
+
// Call each configurable entity factory with the config
|
|
460
|
+
for (const ce of this.configurableEntities) {
|
|
461
|
+
this.context.logger.info(`[ConfigWizard] Calling factory for ${ce.entityType}...`);
|
|
462
|
+
try {
|
|
463
|
+
const entities = ce.factory(config);
|
|
464
|
+
this.context.logger.info(`[ConfigWizard] Factory returned ${entities.length} ${ce.entityType} entities`);
|
|
465
|
+
if (entities.length > 0) {
|
|
466
|
+
dynamicCapabilities.push({
|
|
467
|
+
type: 'entity',
|
|
468
|
+
entityType: ce.entityType,
|
|
469
|
+
entities: entities
|
|
470
|
+
});
|
|
471
|
+
this.context.logger.info(`[ConfigWizard] ✅ Added ${entities.length} ${ce.entityType} entities to capabilities`);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
catch (factoryError) {
|
|
475
|
+
this.context.logger.error(`[ConfigWizard] ❌ Factory for ${ce.entityType} failed:`, factoryError.message);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
this.context.logger.info(`[ConfigWizard] ⚠️ No config found - configurable entities will not be registered`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
catch (error) {
|
|
484
|
+
this.context.logger.error(`[ConfigWizard] ❌ Failed to load config:`, error.message);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
425
487
|
return {
|
|
426
488
|
apiVersion: 'majk.capabilities/v1',
|
|
427
|
-
capabilities:
|
|
489
|
+
capabilities: dynamicCapabilities
|
|
428
490
|
};
|
|
429
491
|
}
|
|
430
492
|
/**
|
|
@@ -463,6 +525,7 @@ class BuiltPlugin {
|
|
|
463
525
|
};
|
|
464
526
|
context.logger.info('═══════════════════════════════════════════════════════');
|
|
465
527
|
context.logger.info(`🚀 Loading Plugin: ${this.name} (${this.id}) v${this.version}`);
|
|
528
|
+
context.logger.info(`🔧 Plugin Kit Version: @majkapp/plugin-kit@1.0.19`);
|
|
466
529
|
context.logger.info(`📍 Plugin Root: ${effectivePluginRoot}`);
|
|
467
530
|
if (this.userProvidedPluginRoot) {
|
|
468
531
|
context.logger.info(` (user-provided via .pluginRoot(__dirname))`);
|
|
@@ -495,10 +558,30 @@ class BuiltPlugin {
|
|
|
495
558
|
await this.startServer();
|
|
496
559
|
// Initialize transports for function-first architecture
|
|
497
560
|
if (this.functionRegistry) {
|
|
561
|
+
context.logger.info('');
|
|
562
|
+
context.logger.info('🔌 Initializing Transports...');
|
|
498
563
|
for (const transport of this.transports) {
|
|
499
564
|
await transport.initialize(this.functionRegistry, this.context);
|
|
500
565
|
await transport.start();
|
|
501
|
-
|
|
566
|
+
const metadata = transport.getMetadata();
|
|
567
|
+
context.logger.info(` ✅ ${transport.name} transport initialized`);
|
|
568
|
+
context.logger.info(` • Base Path: ${metadata.endpoint}`);
|
|
569
|
+
context.logger.info(` • Discovery: ${metadata.discovery}`);
|
|
570
|
+
}
|
|
571
|
+
// Log registered functions
|
|
572
|
+
const functionNames = this.functionRegistry.getFunctionNames();
|
|
573
|
+
if (functionNames.length > 0) {
|
|
574
|
+
context.logger.info('');
|
|
575
|
+
context.logger.info(`📦 Registered ${functionNames.length} Functions:`);
|
|
576
|
+
for (const fname of functionNames) {
|
|
577
|
+
const func = this.functionRegistry.functions.get(fname);
|
|
578
|
+
if (func) {
|
|
579
|
+
context.logger.info(` • ${fname}: ${func.description}`);
|
|
580
|
+
if (func.deprecated) {
|
|
581
|
+
context.logger.info(` ⚠️ DEPRECATED`);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
502
585
|
}
|
|
503
586
|
}
|
|
504
587
|
// Register API routes (legacy)
|
|
@@ -528,6 +611,11 @@ class BuiltPlugin {
|
|
|
528
611
|
name: 'API Discovery',
|
|
529
612
|
description: 'Get OpenAPI specification for all plugin API routes',
|
|
530
613
|
handler: async (_req, _res, _ctx) => {
|
|
614
|
+
// If using function-first architecture, generate spec from function registry
|
|
615
|
+
if (this.functionRegistry && this.functionRegistry.getFunctionNames().length > 0) {
|
|
616
|
+
return this.functionRegistry.toOpenAPISpec();
|
|
617
|
+
}
|
|
618
|
+
// Otherwise fall back to legacy API routes
|
|
531
619
|
const openApiSpec = generateOpenApiSpec(this.id, this.name, this.version, this.apiRoutes, this.context.http.baseUrl);
|
|
532
620
|
return openApiSpec;
|
|
533
621
|
}
|
|
@@ -570,7 +658,62 @@ class BuiltPlugin {
|
|
|
570
658
|
await this.onReadyFn(this.context, (fn) => this.cleanups.push(fn));
|
|
571
659
|
context.logger.info('✅ onReady hook completed');
|
|
572
660
|
}
|
|
573
|
-
|
|
661
|
+
// Print comprehensive summary
|
|
662
|
+
context.logger.info('');
|
|
663
|
+
context.logger.info('╔══════════════════════════════════════════════════════════╗');
|
|
664
|
+
context.logger.info('║ 🎉 PLUGIN LOADED SUCCESSFULLY ║');
|
|
665
|
+
context.logger.info('╟──────────────────────────────────────────────────────────╢');
|
|
666
|
+
context.logger.info('║ 🌐 API ENDPOINTS ║');
|
|
667
|
+
context.logger.info('╟──────────────────────────────────────────────────────────╢');
|
|
668
|
+
// API Discovery endpoints
|
|
669
|
+
context.logger.info(`║ 🔍 Discovery: ║`);
|
|
670
|
+
context.logger.info(`║ ${context.http.baseUrl}/majk/plugin/api`);
|
|
671
|
+
context.logger.info(`║ ${context.http.baseUrl}/majk/plugin/routes`);
|
|
672
|
+
// Function endpoints
|
|
673
|
+
if (this.functionRegistry && this.functionRegistry.getFunctionNames().length > 0) {
|
|
674
|
+
context.logger.info(`║ ║`);
|
|
675
|
+
context.logger.info(`║ 🚀 Function Endpoints: ║`);
|
|
676
|
+
for (const fname of this.functionRegistry.getFunctionNames()) {
|
|
677
|
+
context.logger.info(`║ POST ${context.http.baseUrl}/api/fn/${fname}`);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
// Legacy API routes
|
|
681
|
+
if (this.apiRoutes.length > 0) {
|
|
682
|
+
context.logger.info(`║ ║`);
|
|
683
|
+
context.logger.info(`║ 📋 Legacy API Routes: ║`);
|
|
684
|
+
for (const route of this.apiRoutes) {
|
|
685
|
+
context.logger.info(`║ ${route.method} ${context.http.baseUrl}${route.path}`);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
// UI Screens
|
|
689
|
+
const allScreens = [...this.reactScreens, ...this.htmlScreens];
|
|
690
|
+
if (allScreens.length > 0 || this.uiConfig) {
|
|
691
|
+
context.logger.info('╟──────────────────────────────────────────────────────────╢');
|
|
692
|
+
context.logger.info('║ 🕹 UI SCREENS ║');
|
|
693
|
+
context.logger.info('╟──────────────────────────────────────────────────────────╢');
|
|
694
|
+
for (const screen of allScreens) {
|
|
695
|
+
context.logger.info(`║ • ${screen.name || screen.id}`);
|
|
696
|
+
context.logger.info(`║ ${context.http.baseUrl}${screen.route}`);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
// Config Wizard
|
|
700
|
+
if (this.wizard) {
|
|
701
|
+
context.logger.info('╟──────────────────────────────────────────────────────────╢');
|
|
702
|
+
context.logger.info('║ 🧙 CONFIG WIZARD ║');
|
|
703
|
+
context.logger.info('╟──────────────────────────────────────────────────────────╢');
|
|
704
|
+
context.logger.info(`║ ${this.wizard.title}`);
|
|
705
|
+
context.logger.info(`║ ${context.http.baseUrl}${this.wizard.path}`);
|
|
706
|
+
}
|
|
707
|
+
// Settings
|
|
708
|
+
if (this.settings) {
|
|
709
|
+
context.logger.info('╟──────────────────────────────────────────────────────────╢');
|
|
710
|
+
context.logger.info('║ ⚙️ SETTINGS ║');
|
|
711
|
+
context.logger.info('╟──────────────────────────────────────────────────────────╢');
|
|
712
|
+
context.logger.info(`║ ${this.settings.title}`);
|
|
713
|
+
context.logger.info(`║ ${context.http.baseUrl}${this.settings.path}`);
|
|
714
|
+
}
|
|
715
|
+
context.logger.info('╚══════════════════════════════════════════════════════════╝');
|
|
716
|
+
context.logger.info('');
|
|
574
717
|
}
|
|
575
718
|
catch (error) {
|
|
576
719
|
context.logger.error(`❌ Failed to load plugin "${this.name}": ${error.message}`);
|
|
@@ -851,6 +994,9 @@ function groupByScope(tools) {
|
|
|
851
994
|
* Create a plugin with fluent builder API
|
|
852
995
|
*/
|
|
853
996
|
function definePlugin(id, name, version) {
|
|
997
|
+
log(`🔨 Building plugin: ${name} (${id}) v${version}`);
|
|
998
|
+
log(`📦 Plugin Kit: @majkapp/plugin-kit@1.0.19`);
|
|
999
|
+
log(``);
|
|
854
1000
|
const _capabilities = [];
|
|
855
1001
|
const _tools = new Map();
|
|
856
1002
|
const _toolSpecs = [];
|
|
@@ -859,6 +1005,7 @@ function definePlugin(id, name, version) {
|
|
|
859
1005
|
const _htmlScreens = [];
|
|
860
1006
|
const _topbars = [];
|
|
861
1007
|
const _entities = [];
|
|
1008
|
+
const _configurableEntities = [];
|
|
862
1009
|
// Function-first architecture state
|
|
863
1010
|
const _functionRegistry = new registry_1.FunctionRegistryImpl(id, name, version);
|
|
864
1011
|
const _transports = [];
|
|
@@ -916,12 +1063,17 @@ function definePlugin(id, name, version) {
|
|
|
916
1063
|
}
|
|
917
1064
|
const iframeUrl = `http://localhost:{port}${_ui.base}${screen.reactPath}`;
|
|
918
1065
|
_reactScreens.push(screen);
|
|
919
|
-
|
|
1066
|
+
log(` 🕹 Registered React screen: ${screen.name} at ${screen.route}`);
|
|
1067
|
+
const capability = {
|
|
920
1068
|
type: 'screen',
|
|
921
1069
|
id: screen.id,
|
|
922
1070
|
path: screen.route,
|
|
923
1071
|
iframeUrl
|
|
924
|
-
}
|
|
1072
|
+
};
|
|
1073
|
+
if (screen.hash) {
|
|
1074
|
+
capability.hash = screen.hash;
|
|
1075
|
+
}
|
|
1076
|
+
_capabilities.push(capability);
|
|
925
1077
|
return this;
|
|
926
1078
|
},
|
|
927
1079
|
screenHtml(screen) {
|
|
@@ -931,6 +1083,7 @@ function definePlugin(id, name, version) {
|
|
|
931
1083
|
}
|
|
932
1084
|
const iframeUrl = `http://localhost:{port}/__html/${encodeURIComponent(screen.id)}`;
|
|
933
1085
|
_htmlScreens.push(screen);
|
|
1086
|
+
log(` 📋 Registered HTML screen: ${screen.name} at ${screen.route}`);
|
|
934
1087
|
_capabilities.push({
|
|
935
1088
|
type: 'screen',
|
|
936
1089
|
id: screen.id,
|
|
@@ -982,6 +1135,8 @@ function definePlugin(id, name, version) {
|
|
|
982
1135
|
tags: config.tags,
|
|
983
1136
|
deprecated: config.deprecated
|
|
984
1137
|
});
|
|
1138
|
+
// Log function registration
|
|
1139
|
+
log(` 📦 Registered function: ${name} - ${config.description}`);
|
|
985
1140
|
}
|
|
986
1141
|
catch (error) {
|
|
987
1142
|
throw new PluginBuildError(`Failed to register function "${name}"`, error.message, { function: name });
|
|
@@ -1041,12 +1196,97 @@ function definePlugin(id, name, version) {
|
|
|
1041
1196
|
// Type-safe wrapper for team member entities
|
|
1042
1197
|
return this.entity('teamMember', members);
|
|
1043
1198
|
},
|
|
1199
|
+
configurableEntity(entityType, factory) {
|
|
1200
|
+
_configurableEntities.push({ entityType, factory });
|
|
1201
|
+
log(` 🔧 Registered configurable entity: ${entityType} (requires config)`);
|
|
1202
|
+
return this;
|
|
1203
|
+
},
|
|
1204
|
+
configurableMcp(factory) {
|
|
1205
|
+
_configurableEntities.push({ entityType: 'mcpServer', factory });
|
|
1206
|
+
log(` 🔧 Registered configurable MCP server (requires config)`);
|
|
1207
|
+
return this;
|
|
1208
|
+
},
|
|
1209
|
+
configurableTeamMember(factory) {
|
|
1210
|
+
_configurableEntities.push({ entityType: 'teamMember', factory });
|
|
1211
|
+
log(` 🔧 Registered configurable team member (requires config)`);
|
|
1212
|
+
return this;
|
|
1213
|
+
},
|
|
1044
1214
|
configWizard(def) {
|
|
1045
1215
|
if (_wizard) {
|
|
1046
1216
|
throw new PluginBuildError('Config wizard already defined', 'You can only have one config wizard per plugin');
|
|
1047
1217
|
}
|
|
1048
1218
|
validateDescription(def.description, 'Config wizard');
|
|
1049
1219
|
_wizard = def;
|
|
1220
|
+
// Auto-generate config management functions if schema is provided
|
|
1221
|
+
if (def.schema) {
|
|
1222
|
+
const storageKey = def.storageKey || '_plugin_config';
|
|
1223
|
+
log(` 🔧 Schema provided - auto-generating config functions`);
|
|
1224
|
+
log(` Storage key: ${storageKey}`);
|
|
1225
|
+
// Auto-generate updateConfig function
|
|
1226
|
+
_functionRegistry.registerFunction('updateConfig', 'Update plugin configuration (auto-generated)', def.schema, {
|
|
1227
|
+
type: 'object',
|
|
1228
|
+
properties: {
|
|
1229
|
+
success: { type: 'boolean' },
|
|
1230
|
+
message: { type: 'string' },
|
|
1231
|
+
data: def.schema,
|
|
1232
|
+
error: { type: 'string' }
|
|
1233
|
+
},
|
|
1234
|
+
required: ['success']
|
|
1235
|
+
}, async (config, ctx) => {
|
|
1236
|
+
ctx.logger.info(`[ConfigWizard] updateConfig called`);
|
|
1237
|
+
ctx.logger.info(`[ConfigWizard] Config to save:`, JSON.stringify(config, null, 2));
|
|
1238
|
+
try {
|
|
1239
|
+
// Save to storage
|
|
1240
|
+
await ctx.storage.set(storageKey, config);
|
|
1241
|
+
ctx.logger.info(`[ConfigWizard] ✅ Config saved to storage key: ${storageKey}`);
|
|
1242
|
+
return {
|
|
1243
|
+
success: true,
|
|
1244
|
+
message: 'Configuration saved successfully',
|
|
1245
|
+
data: config
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
catch (error) {
|
|
1249
|
+
ctx.logger.error(`[ConfigWizard] ❌ Failed to save config:`, error.message);
|
|
1250
|
+
return {
|
|
1251
|
+
success: false,
|
|
1252
|
+
error: error.message
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
}, { tags: ['config'], deprecated: false });
|
|
1256
|
+
// Auto-generate getConfig function
|
|
1257
|
+
_functionRegistry.registerFunction('getConfig', 'Get current plugin configuration (auto-generated)', {
|
|
1258
|
+
type: 'object',
|
|
1259
|
+
properties: {},
|
|
1260
|
+
additionalProperties: false
|
|
1261
|
+
}, {
|
|
1262
|
+
type: 'object',
|
|
1263
|
+
properties: {
|
|
1264
|
+
success: { type: 'boolean' },
|
|
1265
|
+
data: def.schema,
|
|
1266
|
+
error: { type: 'string' }
|
|
1267
|
+
},
|
|
1268
|
+
required: ['success']
|
|
1269
|
+
}, async (_input, ctx) => {
|
|
1270
|
+
ctx.logger.info(`[ConfigWizard] getConfig called`);
|
|
1271
|
+
try {
|
|
1272
|
+
const config = await ctx.storage.get(storageKey);
|
|
1273
|
+
if (config) {
|
|
1274
|
+
ctx.logger.info(`[ConfigWizard] ✅ Config loaded from storage`);
|
|
1275
|
+
return { success: true, data: config };
|
|
1276
|
+
}
|
|
1277
|
+
else {
|
|
1278
|
+
ctx.logger.info(`[ConfigWizard] ⚠️ No config found in storage`);
|
|
1279
|
+
return { success: false, error: 'No configuration found' };
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
catch (error) {
|
|
1283
|
+
ctx.logger.error(`[ConfigWizard] ❌ Failed to load config:`, error.message);
|
|
1284
|
+
return { success: false, error: error.message };
|
|
1285
|
+
}
|
|
1286
|
+
}, { tags: ['config'], deprecated: false });
|
|
1287
|
+
log(` ✅ Auto-generated: updateConfig()`);
|
|
1288
|
+
log(` ✅ Auto-generated: getConfig()`);
|
|
1289
|
+
}
|
|
1050
1290
|
return this;
|
|
1051
1291
|
},
|
|
1052
1292
|
settings(def) {
|
|
@@ -1059,6 +1299,7 @@ function definePlugin(id, name, version) {
|
|
|
1059
1299
|
},
|
|
1060
1300
|
onReady(fn) {
|
|
1061
1301
|
_onReady = fn;
|
|
1302
|
+
log(` 🏁 Registered onReady lifecycle hook`);
|
|
1062
1303
|
return this;
|
|
1063
1304
|
},
|
|
1064
1305
|
health(fn) {
|
|
@@ -1074,6 +1315,27 @@ function definePlugin(id, name, version) {
|
|
|
1074
1315
|
},
|
|
1075
1316
|
build() {
|
|
1076
1317
|
// ========== Build-Time Validation ==========
|
|
1318
|
+
// Validate configurable entities require configWizard with schema
|
|
1319
|
+
if (_configurableEntities.length > 0) {
|
|
1320
|
+
if (!_wizard) {
|
|
1321
|
+
throw new PluginBuildError('Configurable entities require configWizard', 'You used .configurableTeamMember(), .configurableMcp(), or .configurableEntity() but did not call .configWizard()', {
|
|
1322
|
+
configurableEntities: _configurableEntities.map(ce => ce.entityType),
|
|
1323
|
+
hint: 'Add .configWizard({ schema: YourSchema, ... }) to your plugin'
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
if (!_wizard.schema) {
|
|
1327
|
+
throw new PluginBuildError('Configurable entities require configWizard with schema', 'You used configurable entities but .configWizard() does not have a schema property', {
|
|
1328
|
+
configurableEntities: _configurableEntities.map(ce => ce.entityType),
|
|
1329
|
+
hint: 'Add schema property to .configWizard({ schema: YourSchema, ... })'
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
log(` ✅ Validated: ${_configurableEntities.length} configurable entities with config schema`);
|
|
1333
|
+
}
|
|
1334
|
+
// Warn if config wizard has schema but no configurable entities
|
|
1335
|
+
if (_wizard?.schema && _configurableEntities.length === 0) {
|
|
1336
|
+
log(` ⚠️ Warning: configWizard has schema but no configurable entities defined`);
|
|
1337
|
+
log(` Consider using .configurableTeamMember() or .configurableMcp() to take advantage of the config`);
|
|
1338
|
+
}
|
|
1077
1339
|
// Validate React UI setup
|
|
1078
1340
|
if (_reactScreens.length > 0 && !_uiConfigured) {
|
|
1079
1341
|
throw new PluginBuildError('UI not configured but React screens were added', 'Call .ui() before adding React screens', { reactScreens: _reactScreens.map(s => s.id) });
|
|
@@ -1168,6 +1430,10 @@ function definePlugin(id, name, version) {
|
|
|
1168
1430
|
},
|
|
1169
1431
|
required: true
|
|
1170
1432
|
};
|
|
1433
|
+
// Add hash if provided
|
|
1434
|
+
if (_wizard.hash) {
|
|
1435
|
+
wizardCap.screen.hash = _wizard.hash;
|
|
1436
|
+
}
|
|
1171
1437
|
// Add shouldShow as method name reference if provided
|
|
1172
1438
|
if (_wizard.shouldShow) {
|
|
1173
1439
|
wizardCap.shouldShow = 'shouldShowConfigWizard';
|
|
@@ -1176,7 +1442,7 @@ function definePlugin(id, name, version) {
|
|
|
1176
1442
|
}
|
|
1177
1443
|
// Add settings
|
|
1178
1444
|
if (_settings) {
|
|
1179
|
-
|
|
1445
|
+
const settingsCap = {
|
|
1180
1446
|
type: 'settings-screen',
|
|
1181
1447
|
path: `/plugins/${id}/settings`,
|
|
1182
1448
|
name: _settings.title,
|
|
@@ -1184,7 +1450,12 @@ function definePlugin(id, name, version) {
|
|
|
1184
1450
|
path: _settings.path,
|
|
1185
1451
|
title: _settings.title
|
|
1186
1452
|
}
|
|
1187
|
-
}
|
|
1453
|
+
};
|
|
1454
|
+
// Add hash if provided
|
|
1455
|
+
if (_settings.hash) {
|
|
1456
|
+
settingsCap.screen.hash = _settings.hash;
|
|
1457
|
+
}
|
|
1458
|
+
_capabilities.push(settingsCap);
|
|
1188
1459
|
}
|
|
1189
1460
|
// ========== Build Plugin Class ==========
|
|
1190
1461
|
// MAJK expects a class/constructor, not an instance
|
|
@@ -1197,13 +1468,54 @@ function definePlugin(id, name, version) {
|
|
|
1197
1468
|
if (_clientConfig) {
|
|
1198
1469
|
// This would generate the client files based on the function registry
|
|
1199
1470
|
// For now, just log that it was requested
|
|
1200
|
-
|
|
1471
|
+
log('Client generation requested: ' + JSON.stringify(_clientConfig));
|
|
1472
|
+
}
|
|
1473
|
+
// Check for extract mode - output metadata and exit
|
|
1474
|
+
if (process.env.PLUGIN_KIT_MODE === 'extract') {
|
|
1475
|
+
const metadata = {
|
|
1476
|
+
id,
|
|
1477
|
+
name,
|
|
1478
|
+
version,
|
|
1479
|
+
functions: Array.from(_functionRegistry.functions.entries()).map(([fname, func]) => ({
|
|
1480
|
+
name: fname,
|
|
1481
|
+
description: func.description,
|
|
1482
|
+
input: func.input,
|
|
1483
|
+
output: func.output,
|
|
1484
|
+
tags: func.tags,
|
|
1485
|
+
deprecated: func.deprecated
|
|
1486
|
+
})),
|
|
1487
|
+
screens: [..._reactScreens, ..._htmlScreens].map(s => ({
|
|
1488
|
+
id: s.id,
|
|
1489
|
+
name: s.name,
|
|
1490
|
+
route: s.route,
|
|
1491
|
+
type: 'reactPath' in s ? 'react' : 'html'
|
|
1492
|
+
})),
|
|
1493
|
+
tools: _toolSpecs.map(t => ({
|
|
1494
|
+
name: t.spec.name,
|
|
1495
|
+
description: t.spec.description,
|
|
1496
|
+
scope: t.scope
|
|
1497
|
+
})),
|
|
1498
|
+
openapi: _functionRegistry.toOpenAPISpec()
|
|
1499
|
+
};
|
|
1500
|
+
// Write to file specified by env variable
|
|
1501
|
+
const outputFile = process.env.PLUGIN_KIT_OUTPUT;
|
|
1502
|
+
if (outputFile) {
|
|
1503
|
+
fs_1.default.writeFileSync(outputFile, JSON.stringify(metadata, null, 2), 'utf-8');
|
|
1504
|
+
console.log(`Metadata written to ${outputFile}`);
|
|
1505
|
+
}
|
|
1506
|
+
else {
|
|
1507
|
+
// Fallback to stdout if no file specified
|
|
1508
|
+
console.log(JSON.stringify(metadata, null, 2));
|
|
1509
|
+
}
|
|
1510
|
+
process.exit(0);
|
|
1201
1511
|
}
|
|
1202
1512
|
return class extends BuiltPlugin {
|
|
1203
1513
|
constructor() {
|
|
1204
|
-
super(id, name, version, _capabilities, _tools, _apiRoutes, _uiConfigured ? _ui : null, _reactScreens, _htmlScreens, _wizard, _onReady, _healthCheck, _pluginRoot,
|
|
1514
|
+
super(id, name, version, _capabilities, _tools, _apiRoutes, _uiConfigured ? _ui : null, _reactScreens, _htmlScreens, _wizard, _settings, _onReady, _healthCheck, _pluginRoot,
|
|
1205
1515
|
// Pass function registry and transports if functions were defined
|
|
1206
|
-
_functionRegistry.functions.size > 0 ? _functionRegistry : undefined, _transports.length > 0 ? _transports : undefined
|
|
1516
|
+
_functionRegistry.functions.size > 0 ? _functionRegistry : undefined, _transports.length > 0 ? _transports : undefined,
|
|
1517
|
+
// Pass configurable entities
|
|
1518
|
+
_configurableEntities.length > 0 ? _configurableEntities : undefined);
|
|
1207
1519
|
}
|
|
1208
1520
|
};
|
|
1209
1521
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -189,6 +189,9 @@ export interface FunctionRegistry {
|
|
|
189
189
|
name: string;
|
|
190
190
|
version: string;
|
|
191
191
|
};
|
|
192
|
+
getFunctionNames(): string[];
|
|
193
|
+
getSubscriptionNames(): string[];
|
|
194
|
+
toOpenAPISpec(): any;
|
|
192
195
|
}
|
|
193
196
|
export interface ClientGenerationConfig {
|
|
194
197
|
output: string;
|
|
@@ -210,6 +213,7 @@ export interface ScreenBase<Id extends string> {
|
|
|
210
213
|
}
|
|
211
214
|
export interface ReactScreen<Id extends string> extends ScreenBase<Id> {
|
|
212
215
|
reactPath: `/${string}`;
|
|
216
|
+
hash?: `#/${string}`;
|
|
213
217
|
}
|
|
214
218
|
export type HtmlScreen<Id extends string> = ScreenBase<Id> & ({
|
|
215
219
|
html: string;
|
|
@@ -217,15 +221,25 @@ export type HtmlScreen<Id extends string> = ScreenBase<Id> & ({
|
|
|
217
221
|
htmlFile: `${string}.html`;
|
|
218
222
|
});
|
|
219
223
|
export interface ConfigWizardDef {
|
|
224
|
+
schema?: JsonSchema;
|
|
225
|
+
storageKey?: string;
|
|
220
226
|
path: `/${string}`;
|
|
227
|
+
hash?: `#/${string}`;
|
|
221
228
|
title: string;
|
|
222
229
|
width?: number;
|
|
223
230
|
height?: number;
|
|
224
231
|
shouldShow?: (ctx: any) => boolean | Promise<boolean>;
|
|
225
232
|
description?: string;
|
|
233
|
+
settings?: {
|
|
234
|
+
path: `/${string}`;
|
|
235
|
+
hash?: `#/${string}`;
|
|
236
|
+
title: string;
|
|
237
|
+
description?: string;
|
|
238
|
+
};
|
|
226
239
|
}
|
|
227
240
|
export interface SettingsDef {
|
|
228
241
|
path: `/${string}`;
|
|
242
|
+
hash?: `#/${string}`;
|
|
229
243
|
title: string;
|
|
230
244
|
description?: string;
|
|
231
245
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC7C,IAAI,CA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OAAO,GAAG,SAAS,CAAC;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;CACnD;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAC7D,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@majkapp/plugin-kit",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Fluent builder framework for creating robust MAJK plugins",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"plugin-kit": "./dist/generator/cli.js"
|
|
9
|
+
},
|
|
7
10
|
"repository": {
|
|
8
11
|
"type": "git",
|
|
9
12
|
"url": "https://github.com/gaiin-platform/majk-plugins.git",
|
|
@@ -29,6 +32,9 @@
|
|
|
29
32
|
"builder"
|
|
30
33
|
],
|
|
31
34
|
"author": "Majk Contributors",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"commander": "^11.1.0"
|
|
37
|
+
},
|
|
32
38
|
"devDependencies": {
|
|
33
39
|
"@types/node": "^20.19.24",
|
|
34
40
|
"typescript": "^5.9.3"
|