@majkapp/plugin-kit 1.0.16 → 1.0.18

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
@@ -12,5 +12,7 @@
12
12
  * - Lifecycle hooks with cleanup management
13
13
  */
14
14
  export { definePlugin, FluentBuilder } from './plugin-kit';
15
- export type { PluginContext, PluginLogger, PluginStorage, ScopedTimers, ScopedIpcRegistry, PluginCapabilities, PluginCapability, ToolImplementation, InProcessPlugin, PluginHealthStatus, ToolSpec, ToolHandler, ApiMethod, ApiRouteDef, RouteHandler, RequestLike, ResponseLike, UiConfig, HistoryMode, ScreenBase, ReactScreen, HtmlScreen, ConfigWizardDef, SettingsDef, Scope, EntityType, CleanupFn, HealthCheckFn, MCPServerEntity, TeamMemberEntity } from './types';
15
+ export { HttpTransport, WebSocketTransport, MCPTransport } from './transports';
16
+ export { FunctionRegistryImpl } from './registry';
17
+ 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';
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAE3D,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,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,EACjB,MAAM,SAAS,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;AAElD,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,6 +13,12 @@
13
13
  * - Lifecycle hooks with cleanup management
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.definePlugin = void 0;
16
+ 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
+ var transports_1 = require("./transports");
20
+ Object.defineProperty(exports, "HttpTransport", { enumerable: true, get: function () { return transports_1.HttpTransport; } });
21
+ Object.defineProperty(exports, "WebSocketTransport", { enumerable: true, get: function () { return transports_1.WebSocketTransport; } });
22
+ Object.defineProperty(exports, "MCPTransport", { enumerable: true, get: function () { return transports_1.MCPTransport; } });
23
+ var registry_1 = require("./registry");
24
+ Object.defineProperty(exports, "FunctionRegistryImpl", { enumerable: true, get: function () { return registry_1.FunctionRegistryImpl; } });
@@ -1,4 +1,4 @@
1
- import { PluginContext, InProcessPlugin, ToolSpec, ToolHandler, ApiRouteDef, UiConfig, ReactScreen, HtmlScreen, ConfigWizardDef, SettingsDef, Scope, EntityType, CleanupFn, HealthCheckFn, MCPServerEntity, TeamMemberEntity, MenuItemDeclaration } from './types';
1
+ import { PluginContext, InProcessPlugin, ToolSpec, ToolHandler, ApiRouteDef, JsonSchema, UiConfig, ReactScreen, HtmlScreen, ConfigWizardDef, SettingsDef, Scope, EntityType, CleanupFn, HealthCheckFn, MCPServerEntity, TeamMemberEntity, MenuItemDeclaration, FunctionHandler, SubscriptionHandler, Transport, ClientGenerationConfig } from './types';
2
2
  /**
3
3
  * Fluent Builder Interface
4
4
  */
@@ -17,8 +17,28 @@ export interface FluentBuilder<Id extends string> {
17
17
  screenReact(screen: ReactScreen<Id>): this;
18
18
  /** Add an HTML screen */
19
19
  screenHtml(screen: HtmlScreen<Id>): this;
20
- /** Add an API route */
20
+ /** Add an API route (legacy) */
21
21
  apiRoute(route: ApiRouteDef): this;
22
+ /** Add a function with JSON Schema (new function-first API) */
23
+ function(name: string, config: {
24
+ description: string;
25
+ input: JsonSchema;
26
+ output: JsonSchema;
27
+ handler: FunctionHandler;
28
+ tags?: string[];
29
+ deprecated?: boolean;
30
+ }): this;
31
+ /** Add a subscription for real-time updates */
32
+ subscription(name: string, config: {
33
+ description: string;
34
+ input: JsonSchema;
35
+ output: JsonSchema;
36
+ handler: SubscriptionHandler;
37
+ }): this;
38
+ /** Configure transports */
39
+ transport(transport: Transport): this;
40
+ /** Configure client generation */
41
+ generateClient(config: ClientGenerationConfig): this;
22
42
  /** Add a tool */
23
43
  tool(scope: Scope, spec: ToolSpec, handler: ToolHandler): this;
24
44
  /** Declare entities that this plugin provides (generic, untyped) */
@@ -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,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EAIb,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAmtBjB;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,EAAE,SAAS,MAAM;IAC9C,mDAAmD;IACnD,MAAM,CAAC,KAAK,EAAE,mBAAmB,EAAE,IAAI,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE7G,0CAA0C;IAC1C,UAAU,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;IAE/C,0CAA0C;IAC1C,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5B,yBAAyB;IACzB,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAA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AAE,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,CAshBnB"}
@@ -7,6 +7,8 @@ exports.definePlugin = definePlugin;
7
7
  const http_1 = __importDefault(require("http"));
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
10
+ const registry_1 = require("./registry");
11
+ const transports_1 = require("./transports");
10
12
  /**
11
13
  * Build-time errors with clear, actionable messages
12
14
  */
@@ -143,6 +145,113 @@ function validateEntity(entityType, entity) {
143
145
  }
144
146
  return errors;
145
147
  }
148
+ /**
149
+ * Convert JSON Schema to OpenAPI Schema
150
+ */
151
+ function jsonSchemaToOpenApi(schema) {
152
+ // OpenAPI doesn't use the $schema property
153
+ const { ...openApiSchema } = schema;
154
+ return openApiSchema;
155
+ }
156
+ /**
157
+ * Generate OpenAPI specification from routes
158
+ */
159
+ function generateOpenApiSpec(pluginId, pluginName, pluginVersion, routes, baseUrl) {
160
+ const paths = {};
161
+ for (const route of routes) {
162
+ const openApiPath = route.path.replace(/:([A-Za-z0-9_]+)/g, '{$1}');
163
+ if (!paths[openApiPath]) {
164
+ paths[openApiPath] = {};
165
+ }
166
+ const operation = {
167
+ operationId: `${pluginId}_${route.name.replace(/\s+/g, '_')}`,
168
+ summary: route.name,
169
+ description: route.description,
170
+ tags: route.tags || [pluginId],
171
+ deprecated: route.deprecated
172
+ };
173
+ // Add parameters from request schema
174
+ if (route.requestSchema) {
175
+ const parameters = [];
176
+ // Path parameters
177
+ if (route.requestSchema.params) {
178
+ const paramProps = route.requestSchema.params.properties || {};
179
+ for (const [name, schema] of Object.entries(paramProps)) {
180
+ parameters.push({
181
+ name,
182
+ in: 'path',
183
+ required: route.requestSchema.params.required?.includes(name) ?? true,
184
+ schema: jsonSchemaToOpenApi(schema),
185
+ description: schema.description
186
+ });
187
+ }
188
+ }
189
+ // Query parameters
190
+ if (route.requestSchema.query) {
191
+ const queryProps = route.requestSchema.query.properties || {};
192
+ for (const [name, schema] of Object.entries(queryProps)) {
193
+ parameters.push({
194
+ name,
195
+ in: 'query',
196
+ required: route.requestSchema.query.required?.includes(name) ?? false,
197
+ schema: jsonSchemaToOpenApi(schema),
198
+ description: schema.description
199
+ });
200
+ }
201
+ }
202
+ if (parameters.length > 0) {
203
+ operation.parameters = parameters;
204
+ }
205
+ // Request body
206
+ if (route.requestSchema.body) {
207
+ operation.requestBody = {
208
+ required: true,
209
+ content: {
210
+ 'application/json': {
211
+ schema: jsonSchemaToOpenApi(route.requestSchema.body)
212
+ }
213
+ }
214
+ };
215
+ }
216
+ }
217
+ // Response schema
218
+ operation.responses = {
219
+ '200': {
220
+ description: 'Successful response',
221
+ content: route.responseSchema ? {
222
+ 'application/json': {
223
+ schema: jsonSchemaToOpenApi(route.responseSchema)
224
+ }
225
+ } : {}
226
+ },
227
+ '400': {
228
+ description: 'Bad request'
229
+ },
230
+ '500': {
231
+ description: 'Internal server error'
232
+ }
233
+ };
234
+ paths[openApiPath][route.method.toLowerCase()] = operation;
235
+ }
236
+ return {
237
+ openapi: '3.0.0',
238
+ info: {
239
+ title: `${pluginName} API`,
240
+ version: pluginVersion,
241
+ description: `API documentation for the ${pluginName} MAJK plugin`
242
+ },
243
+ servers: [
244
+ {
245
+ url: baseUrl,
246
+ description: 'Plugin API server'
247
+ }
248
+ ],
249
+ paths,
250
+ components: {
251
+ schemas: {}
252
+ }
253
+ };
254
+ }
146
255
  /**
147
256
  * Path parameter regex builder
148
257
  */
@@ -290,7 +399,9 @@ function serveSpa(ui, req, res, ctx) {
290
399
  * Main plugin class built by the fluent API
291
400
  */
292
401
  class BuiltPlugin {
293
- constructor(id, name, version, capabilities, tools, apiRoutes, uiConfig, reactScreens, htmlScreens, wizard, onReadyFn, healthCheckFn, userProvidedPluginRoot) {
402
+ constructor(id, name, version, capabilities, tools, apiRoutes, uiConfig, reactScreens, htmlScreens, wizard, onReadyFn, healthCheckFn, userProvidedPluginRoot,
403
+ // New parameters for function-first architecture
404
+ functionRegistry, transports) {
294
405
  this.capabilities = capabilities;
295
406
  this.tools = tools;
296
407
  this.apiRoutes = apiRoutes;
@@ -303,9 +414,12 @@ class BuiltPlugin {
303
414
  this.userProvidedPluginRoot = userProvidedPluginRoot;
304
415
  this.cleanups = [];
305
416
  this.router = [];
417
+ this.transports = [];
306
418
  this.id = id;
307
419
  this.name = name;
308
420
  this.version = version;
421
+ this.functionRegistry = functionRegistry;
422
+ this.transports = transports || [];
309
423
  }
310
424
  getCapabilities() {
311
425
  return {
@@ -379,7 +493,15 @@ class BuiltPlugin {
379
493
  }
380
494
  try {
381
495
  await this.startServer();
382
- // Register API routes
496
+ // Initialize transports for function-first architecture
497
+ if (this.functionRegistry) {
498
+ for (const transport of this.transports) {
499
+ await transport.initialize(this.functionRegistry, this.context);
500
+ await transport.start();
501
+ context.logger.info(`✅ ${transport.name} transport initialized`);
502
+ }
503
+ }
504
+ // Register API routes (legacy)
383
505
  for (const route of this.apiRoutes) {
384
506
  const { regex, keys } = pathToRegex(route.path);
385
507
  this.router.push({
@@ -388,10 +510,60 @@ class BuiltPlugin {
388
510
  keys,
389
511
  name: route.name,
390
512
  description: route.description,
391
- handler: route.handler
513
+ handler: route.handler,
514
+ requestSchema: route.requestSchema,
515
+ responseSchema: route.responseSchema,
516
+ tags: route.tags,
517
+ deprecated: route.deprecated
392
518
  });
393
519
  context.logger.info(`📝 Registered route: ${route.method} ${route.path} - ${route.name}`);
394
520
  }
521
+ // Register the discovery endpoint at /majk/plugin/api
522
+ const discoveryPath = '/majk/plugin/api';
523
+ const { regex: discoveryRegex, keys: discoveryKeys } = pathToRegex(discoveryPath);
524
+ this.router.push({
525
+ method: 'GET',
526
+ regex: discoveryRegex,
527
+ keys: discoveryKeys,
528
+ name: 'API Discovery',
529
+ description: 'Get OpenAPI specification for all plugin API routes',
530
+ handler: async (_req, _res, _ctx) => {
531
+ const openApiSpec = generateOpenApiSpec(this.id, this.name, this.version, this.apiRoutes, this.context.http.baseUrl);
532
+ return openApiSpec;
533
+ }
534
+ });
535
+ context.logger.info(`📝 Registered discovery route: GET ${discoveryPath}`);
536
+ // Also register a simpler JSON format at /majk/plugin/routes for quick access
537
+ const routesPath = '/majk/plugin/routes';
538
+ const { regex: routesRegex, keys: routesKeys } = pathToRegex(routesPath);
539
+ this.router.push({
540
+ method: 'GET',
541
+ regex: routesRegex,
542
+ keys: routesKeys,
543
+ name: 'Routes List',
544
+ description: 'Get a simple JSON list of all available API routes',
545
+ handler: async (_req, _res, _ctx) => {
546
+ return {
547
+ plugin: {
548
+ id: this.id,
549
+ name: this.name,
550
+ version: this.version
551
+ },
552
+ routes: this.apiRoutes.map(route => ({
553
+ method: route.method,
554
+ path: route.path,
555
+ name: route.name,
556
+ description: route.description,
557
+ deprecated: route.deprecated,
558
+ tags: route.tags,
559
+ requestSchema: route.requestSchema,
560
+ responseSchema: route.responseSchema
561
+ })),
562
+ discoveryUrl: `${this.context.http.baseUrl}/majk/plugin/api`
563
+ };
564
+ }
565
+ });
566
+ context.logger.info(`📝 Registered routes list: GET ${routesPath}`);
395
567
  // Call onReady hook
396
568
  if (this.onReadyFn) {
397
569
  context.logger.info('⚙️ Calling onReady hook...');
@@ -526,8 +698,52 @@ class BuiltPlugin {
526
698
  this.context.logger.debug(`← ${method} ${url} ${res.statusCode || 200} (${duration}ms)`);
527
699
  return;
528
700
  }
529
- // API routes
530
- if (req.url?.startsWith('/api/')) {
701
+ // Function calls (new function-first API)
702
+ if (req.method === 'POST' && req.url?.startsWith('/api/fn/')) {
703
+ const functionName = req.url.substring('/api/fn/'.length).split('?')[0];
704
+ if (this.functionRegistry && this.transports.length > 0) {
705
+ // Use the first HTTP transport to handle the function call
706
+ const httpTransport = this.transports.find(t => t.name === 'http');
707
+ if (httpTransport) {
708
+ const body = await readBody(req);
709
+ const request = {
710
+ method: 'POST',
711
+ url: req.url,
712
+ pathname: req.url.split('?')[0],
713
+ query: new URL(req.url, `http://localhost:${port}`).searchParams,
714
+ params: {},
715
+ body,
716
+ headers: req.headers
717
+ };
718
+ const response = makeResponse(res);
719
+ await httpTransport.handleFunctionCall(functionName, request, response, {
720
+ majk: this.context.majk,
721
+ storage: this.context.storage,
722
+ logger: this.context.logger,
723
+ http: this.context.http
724
+ });
725
+ const duration = Date.now() - startTime;
726
+ this.context.logger.debug(`← POST /api/fn/${functionName} ${res.statusCode || 200} (${duration}ms)`);
727
+ return;
728
+ }
729
+ }
730
+ }
731
+ // Function discovery endpoint
732
+ if (req.method === 'GET' && req.url === '/api/fn/discovery') {
733
+ if (this.functionRegistry && this.transports.length > 0) {
734
+ const httpTransport = this.transports.find(t => t.name === 'http');
735
+ if (httpTransport) {
736
+ const discovery = httpTransport.getDiscovery();
737
+ res.writeHead(200, corsHeaders({ 'Content-Type': 'application/json' }));
738
+ res.end(JSON.stringify(discovery));
739
+ const duration = Date.now() - startTime;
740
+ this.context.logger.debug(`← GET /api/fn/discovery 200 (${duration}ms)`);
741
+ return;
742
+ }
743
+ }
744
+ }
745
+ // API routes (including discovery endpoints) - legacy
746
+ if (req.url?.startsWith('/api/') || req.url?.startsWith('/majk/plugin/')) {
531
747
  const url = new URL(req.url, `http://localhost:${port}`);
532
748
  const pathname = url.pathname;
533
749
  const method = req.method;
@@ -643,6 +859,10 @@ function definePlugin(id, name, version) {
643
859
  const _htmlScreens = [];
644
860
  const _topbars = [];
645
861
  const _entities = [];
862
+ // Function-first architecture state
863
+ const _functionRegistry = new registry_1.FunctionRegistryImpl(id, name, version);
864
+ const _transports = [];
865
+ let _clientConfig = null;
646
866
  let _ui = { appDir: 'ui/dist', base: '/', history: 'browser' };
647
867
  let _uiConfigured = false;
648
868
  let _wizard = null;
@@ -665,8 +885,12 @@ function definePlugin(id, name, version) {
665
885
  throw new PluginBuildError('topBarMenu requires a non-empty array of menu items', 'Pass an array of MenuItemDeclaration objects', { provided: items });
666
886
  }
667
887
  for (const item of items) {
668
- if (!item.path || !item.label) {
669
- throw new PluginBuildError('Menu items must have both path and label', 'Provide a valid path (e.g. "Plugin.Section.Item") and label', { item });
888
+ if (!item.path) {
889
+ throw new PluginBuildError('Menu items must have a path', 'Provide a valid path (e.g. "Plugin.Section.Item")', { item });
890
+ }
891
+ // Dividers and headers can have empty labels
892
+ if (item.type !== 'divider' && !item.label) {
893
+ throw new PluginBuildError('Menu items must have a label (except dividers)', 'Provide a label for the menu item', { item });
670
894
  }
671
895
  }
672
896
  _capabilities.push({
@@ -720,9 +944,68 @@ function definePlugin(id, name, version) {
720
944
  if (!route.path.startsWith('/api/')) {
721
945
  throw new PluginBuildError(`API route path must start with "/api/"`, `Change path from "${route.path}" to "/api/your-endpoint"`, { route: route.name });
722
946
  }
947
+ // Runtime validation for request schema (TypeScript already enforces at compile-time)
948
+ // This catches any runtime bypasses or JavaScript usage
949
+ if (!route.requestSchema) {
950
+ throw new PluginBuildError(`API route "${route.name}" must provide a requestSchema`, `Add requestSchema to your route definition. For routes with no input, use an empty object: requestSchema: {}`, { route: route.name, path: route.path, method: route.method });
951
+ }
952
+ // Validate request schema structure
953
+ if (route.requestSchema) {
954
+ const { query, params, body } = route.requestSchema;
955
+ if (query && query.type !== 'object') {
956
+ throw new PluginBuildError(`Query schema for route "${route.name}" must be of type "object"`, `Change query.type to "object" in your schema definition`, { route: route.name });
957
+ }
958
+ if (params && params.type !== 'object') {
959
+ throw new PluginBuildError(`Params schema for route "${route.name}" must be of type "object"`, `Change params.type to "object" in your schema definition`, { route: route.name });
960
+ }
961
+ // Check for path parameters in the route
962
+ const pathParamMatches = route.path.match(/\/:([A-Za-z0-9_]+)/g);
963
+ const pathParams = pathParamMatches ? pathParamMatches.map(p => p.substring(2)) : [];
964
+ if (pathParams.length > 0 && !params) {
965
+ throw new PluginBuildError(`Route "${route.name}" has path parameters but no params schema`, `Add params schema defining: ${pathParams.join(', ')}`, { route: route.name, pathParams });
966
+ }
967
+ if (params && pathParams.length > 0) {
968
+ const schemaProps = params.properties || {};
969
+ const missingParams = pathParams.filter(p => !(p in schemaProps));
970
+ if (missingParams.length > 0) {
971
+ throw new PluginBuildError(`Params schema missing definitions for path parameters: ${missingParams.join(', ')}`, `Add properties for: ${missingParams.join(', ')} to params.properties`, { route: route.name, missingParams });
972
+ }
973
+ }
974
+ }
723
975
  _apiRoutes.push(route);
724
976
  return this;
725
977
  },
978
+ function(name, config) {
979
+ validateDescription(config.description, `Function "${name}"`);
980
+ try {
981
+ _functionRegistry.registerFunction(name, config.description, config.input, config.output, config.handler, {
982
+ tags: config.tags,
983
+ deprecated: config.deprecated
984
+ });
985
+ }
986
+ catch (error) {
987
+ throw new PluginBuildError(`Failed to register function "${name}"`, error.message, { function: name });
988
+ }
989
+ return this;
990
+ },
991
+ subscription(name, config) {
992
+ validateDescription(config.description, `Subscription "${name}"`);
993
+ try {
994
+ _functionRegistry.registerSubscription(name, config.description, config.input, config.output, config.handler);
995
+ }
996
+ catch (error) {
997
+ throw new PluginBuildError(`Failed to register subscription "${name}"`, error.message, { subscription: name });
998
+ }
999
+ return this;
1000
+ },
1001
+ transport(transport) {
1002
+ _transports.push(transport);
1003
+ return this;
1004
+ },
1005
+ generateClient(config) {
1006
+ _clientConfig = config;
1007
+ return this;
1008
+ },
726
1009
  tool(scope, spec, handler) {
727
1010
  validateDescription(spec.description, `Tool "${spec.name}"`);
728
1011
  if (_tools.has(spec.name)) {
@@ -906,9 +1189,21 @@ function definePlugin(id, name, version) {
906
1189
  // ========== Build Plugin Class ==========
907
1190
  // MAJK expects a class/constructor, not an instance
908
1191
  // Return a class that instantiates BuiltPlugin
1192
+ // If no transports specified but functions were defined, add default HTTP transport
1193
+ if (_functionRegistry.functions.size > 0 && _transports.length === 0) {
1194
+ _transports.push(new transports_1.HttpTransport());
1195
+ }
1196
+ // TODO: Implement client generation if configured
1197
+ if (_clientConfig) {
1198
+ // This would generate the client files based on the function registry
1199
+ // For now, just log that it was requested
1200
+ console.log('Client generation requested:', _clientConfig);
1201
+ }
909
1202
  return class extends BuiltPlugin {
910
1203
  constructor() {
911
- super(id, name, version, _capabilities, _tools, _apiRoutes, _uiConfigured ? _ui : null, _reactScreens, _htmlScreens, _wizard, _onReady, _healthCheck, _pluginRoot);
1204
+ super(id, name, version, _capabilities, _tools, _apiRoutes, _uiConfigured ? _ui : null, _reactScreens, _htmlScreens, _wizard, _onReady, _healthCheck, _pluginRoot,
1205
+ // Pass function registry and transports if functions were defined
1206
+ _functionRegistry.functions.size > 0 ? _functionRegistry : undefined, _transports.length > 0 ? _transports : undefined);
912
1207
  }
913
1208
  };
914
1209
  }
@@ -0,0 +1,38 @@
1
+ import type { FunctionDefinition, SubscriptionDefinition, JsonSchema, FunctionHandler, SubscriptionHandler, FunctionRegistry as IFunctionRegistry } from './types';
2
+ /**
3
+ * Function Registry implementation
4
+ */
5
+ export declare class FunctionRegistryImpl implements IFunctionRegistry {
6
+ functions: Map<string, FunctionDefinition>;
7
+ subscriptions: Map<string, SubscriptionDefinition>;
8
+ plugin: {
9
+ id: string;
10
+ name: string;
11
+ version: string;
12
+ };
13
+ constructor(pluginId: string, pluginName: string, pluginVersion: string);
14
+ /**
15
+ * Register a function
16
+ */
17
+ registerFunction(name: string, description: string, input: JsonSchema, output: JsonSchema, handler: FunctionHandler, options?: {
18
+ tags?: string[];
19
+ deprecated?: boolean;
20
+ }): void;
21
+ /**
22
+ * Register a subscription
23
+ */
24
+ registerSubscription(name: string, description: string, input: JsonSchema, output: JsonSchema, handler: SubscriptionHandler): void;
25
+ /**
26
+ * Get all function names
27
+ */
28
+ getFunctionNames(): string[];
29
+ /**
30
+ * Get all subscription names
31
+ */
32
+ getSubscriptionNames(): string[];
33
+ /**
34
+ * Generate OpenAPI specification
35
+ */
36
+ toOpenAPISpec(): any;
37
+ }
38
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,IAAI,iBAAiB,EACtC,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,oBAAqB,YAAW,iBAAiB;IACrD,SAAS,kCAAyC;IAClD,aAAa,sCAA6C;IAC1D,MAAM,EAAE;QACb,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;gBAGA,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM;IASvB;;OAEG;IACH,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,GACA,IAAI;IA8BP;;OAEG;IACH,oBAAoB,CAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,mBAAmB,GAC3B,IAAI;IAoBP;;OAEG;IACH,gBAAgB,IAAI,MAAM,EAAE;IAI5B;;OAEG;IACH,oBAAoB,IAAI,MAAM,EAAE;IAIhC;;OAEG;IACH,aAAa,IAAI,GAAG;CAqErB"}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FunctionRegistryImpl = void 0;
4
+ /**
5
+ * Function Registry implementation
6
+ */
7
+ class FunctionRegistryImpl {
8
+ constructor(pluginId, pluginName, pluginVersion) {
9
+ this.functions = new Map();
10
+ this.subscriptions = new Map();
11
+ this.plugin = {
12
+ id: pluginId,
13
+ name: pluginName,
14
+ version: pluginVersion
15
+ };
16
+ }
17
+ /**
18
+ * Register a function
19
+ */
20
+ registerFunction(name, description, input, output, handler, options) {
21
+ // Validate function name
22
+ if (!/^[a-zA-Z][a-zA-Z0-9]*$/.test(name)) {
23
+ throw new Error(`Invalid function name "${name}". Must be a valid JavaScript identifier (letters and numbers only, starting with a letter).`);
24
+ }
25
+ if (this.functions.has(name)) {
26
+ throw new Error(`Function "${name}" is already registered`);
27
+ }
28
+ // Validate that input is an object schema
29
+ if (input.type !== 'object') {
30
+ throw new Error(`Function "${name}" input must be an object schema. Got type: ${input.type}`);
31
+ }
32
+ this.functions.set(name, {
33
+ name,
34
+ description,
35
+ input,
36
+ output,
37
+ handler,
38
+ tags: options?.tags,
39
+ deprecated: options?.deprecated
40
+ });
41
+ }
42
+ /**
43
+ * Register a subscription
44
+ */
45
+ registerSubscription(name, description, input, output, handler) {
46
+ if (!/^[a-zA-Z][a-zA-Z0-9]*$/.test(name)) {
47
+ throw new Error(`Invalid subscription name "${name}". Must be a valid JavaScript identifier.`);
48
+ }
49
+ if (this.subscriptions.has(name)) {
50
+ throw new Error(`Subscription "${name}" is already registered`);
51
+ }
52
+ this.subscriptions.set(name, {
53
+ name,
54
+ description,
55
+ input,
56
+ output,
57
+ handler
58
+ });
59
+ }
60
+ /**
61
+ * Get all function names
62
+ */
63
+ getFunctionNames() {
64
+ return Array.from(this.functions.keys());
65
+ }
66
+ /**
67
+ * Get all subscription names
68
+ */
69
+ getSubscriptionNames() {
70
+ return Array.from(this.subscriptions.keys());
71
+ }
72
+ /**
73
+ * Generate OpenAPI specification
74
+ */
75
+ toOpenAPISpec() {
76
+ const spec = {
77
+ openapi: '3.1.0',
78
+ info: {
79
+ title: `${this.plugin.name} API`,
80
+ version: this.plugin.version,
81
+ description: `API specification for ${this.plugin.name} plugin`
82
+ },
83
+ paths: {},
84
+ components: {
85
+ schemas: {}
86
+ }
87
+ };
88
+ // Add function endpoints
89
+ for (const [name, func] of this.functions) {
90
+ spec.paths[`/fn/${name}`] = {
91
+ post: {
92
+ summary: func.description,
93
+ operationId: name,
94
+ tags: func.tags || [this.plugin.id],
95
+ deprecated: func.deprecated,
96
+ requestBody: {
97
+ required: true,
98
+ content: {
99
+ 'application/json': {
100
+ schema: func.input
101
+ }
102
+ }
103
+ },
104
+ responses: {
105
+ '200': {
106
+ description: 'Success',
107
+ content: {
108
+ 'application/json': {
109
+ schema: {
110
+ type: 'object',
111
+ properties: {
112
+ success: { type: 'boolean', const: true },
113
+ data: func.output
114
+ },
115
+ required: ['success', 'data']
116
+ }
117
+ }
118
+ }
119
+ },
120
+ '400': {
121
+ description: 'Bad Request',
122
+ content: {
123
+ 'application/json': {
124
+ schema: {
125
+ type: 'object',
126
+ properties: {
127
+ success: { type: 'boolean', const: false },
128
+ error: { type: 'string' },
129
+ details: { type: 'array' }
130
+ },
131
+ required: ['success', 'error']
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ };
139
+ }
140
+ return spec;
141
+ }
142
+ }
143
+ exports.FunctionRegistryImpl = FunctionRegistryImpl;
@@ -0,0 +1,59 @@
1
+ import type { Transport, TransportMetadata, FunctionRegistry, PluginContext, RequestLike, ResponseLike } from './types';
2
+ /**
3
+ * HTTP Transport configuration
4
+ */
5
+ export interface HttpTransportConfig {
6
+ basePath?: string;
7
+ cors?: boolean;
8
+ validation?: {
9
+ request?: boolean;
10
+ response?: boolean;
11
+ };
12
+ }
13
+ /**
14
+ * HTTP Transport implementation
15
+ */
16
+ export declare class HttpTransport implements Transport {
17
+ name: string;
18
+ private registry?;
19
+ private context?;
20
+ private config;
21
+ constructor(config?: HttpTransportConfig);
22
+ initialize(registry: FunctionRegistry, context: PluginContext): Promise<void>;
23
+ start(): Promise<void>;
24
+ stop(): Promise<void>;
25
+ getMetadata(): TransportMetadata;
26
+ /**
27
+ * Handle a function call via HTTP
28
+ */
29
+ handleFunctionCall(functionName: string, req: RequestLike, res: ResponseLike, ctx: any): Promise<void>;
30
+ /**
31
+ * Get discovery information
32
+ */
33
+ getDiscovery(): any;
34
+ }
35
+ /**
36
+ * WebSocket Transport (placeholder for future implementation)
37
+ */
38
+ export declare class WebSocketTransport implements Transport {
39
+ name: string;
40
+ private config;
41
+ constructor(config?: any);
42
+ initialize(registry: FunctionRegistry, context: PluginContext): Promise<void>;
43
+ start(): Promise<void>;
44
+ stop(): Promise<void>;
45
+ getMetadata(): TransportMetadata;
46
+ }
47
+ /**
48
+ * MCP Transport (placeholder for future implementation)
49
+ */
50
+ export declare class MCPTransport implements Transport {
51
+ name: string;
52
+ private config;
53
+ constructor(config?: any);
54
+ initialize(registry: FunctionRegistry, context: PluginContext): Promise<void>;
55
+ start(): Promise<void>;
56
+ stop(): Promise<void>;
57
+ getMetadata(): TransportMetadata;
58
+ }
59
+ //# sourceMappingURL=transports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transports.d.ts","sourceRoot":"","sources":["../src/transports.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C,IAAI,SAAU;IACd,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CA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Transport = exports.WebSocketTransport = exports.HttpTransport = void 0;
4
+ /**
5
+ * HTTP Transport implementation
6
+ */
7
+ class HttpTransport {
8
+ constructor(config = {}) {
9
+ this.name = 'http';
10
+ this.config = {
11
+ basePath: config.basePath || '/api',
12
+ cors: config.cors !== false,
13
+ validation: {
14
+ request: config.validation?.request !== false,
15
+ response: config.validation?.response !== false
16
+ }
17
+ };
18
+ }
19
+ async initialize(registry, context) {
20
+ this.registry = registry;
21
+ this.context = context;
22
+ context.logger.info(`HTTP Transport initialized with base path ${this.config.basePath}`);
23
+ }
24
+ async start() {
25
+ // HTTP server is managed by the BuiltPlugin
26
+ // This transport just provides the route handlers
27
+ }
28
+ async stop() {
29
+ // Cleanup if needed
30
+ }
31
+ getMetadata() {
32
+ // Use the baseUrl from context if available, otherwise construct from context.http
33
+ const baseUrl = this.context?.http?.baseUrl || '';
34
+ return {
35
+ type: 'http',
36
+ endpoint: `${baseUrl}${this.config.basePath}`,
37
+ discovery: `${baseUrl}${this.config.basePath}/discovery`
38
+ };
39
+ }
40
+ /**
41
+ * Handle a function call via HTTP
42
+ */
43
+ async handleFunctionCall(functionName, req, res, ctx) {
44
+ if (!this.registry) {
45
+ res.status(500);
46
+ res.json({ success: false, error: 'Transport not initialized' });
47
+ return;
48
+ }
49
+ const func = this.registry.functions.get(functionName);
50
+ if (!func) {
51
+ res.status(404);
52
+ res.json({ success: false, error: `Function "${functionName}" not found` });
53
+ return;
54
+ }
55
+ try {
56
+ // Get input from request body
57
+ const input = req.body || {};
58
+ // Validate input if configured
59
+ if (this.config.validation?.request) {
60
+ // TODO: Add actual JSON Schema validation here
61
+ // For now, just check basic structure
62
+ if (func.input.type === 'object' && typeof input !== 'object') {
63
+ res.status(400);
64
+ res.json({
65
+ success: false,
66
+ error: 'Invalid input',
67
+ details: ['Input must be an object']
68
+ });
69
+ return;
70
+ }
71
+ }
72
+ // Call the function handler
73
+ const output = await func.handler(input, this.context);
74
+ // Return success response
75
+ res.json({ success: true, data: output });
76
+ }
77
+ catch (error) {
78
+ this.context?.logger.error(`Function "${functionName}" error: ${error.message}`);
79
+ res.status(500);
80
+ res.json({
81
+ success: false,
82
+ error: error.message || 'Internal server error'
83
+ });
84
+ }
85
+ }
86
+ /**
87
+ * Get discovery information
88
+ */
89
+ getDiscovery() {
90
+ if (!this.registry) {
91
+ return { error: 'Transport not initialized' };
92
+ }
93
+ const functions = [];
94
+ for (const [name, func] of this.registry.functions) {
95
+ functions.push({
96
+ name,
97
+ description: func.description,
98
+ input: func.input,
99
+ output: func.output,
100
+ tags: func.tags,
101
+ deprecated: func.deprecated
102
+ });
103
+ }
104
+ const subscriptions = [];
105
+ for (const [name, sub] of this.registry.subscriptions) {
106
+ subscriptions.push({
107
+ name,
108
+ description: sub.description,
109
+ input: sub.input,
110
+ output: sub.output
111
+ });
112
+ }
113
+ return {
114
+ plugin: this.registry.plugin,
115
+ functions,
116
+ subscriptions,
117
+ transports: [this.getMetadata()]
118
+ };
119
+ }
120
+ }
121
+ exports.HttpTransport = HttpTransport;
122
+ /**
123
+ * WebSocket Transport (placeholder for future implementation)
124
+ */
125
+ class WebSocketTransport {
126
+ constructor(config = {}) {
127
+ this.name = 'websocket';
128
+ this.config = config;
129
+ }
130
+ async initialize(registry, context) {
131
+ context.logger.info('WebSocket Transport initialized (not yet implemented)');
132
+ }
133
+ async start() {
134
+ // TODO: Implement WebSocket server
135
+ }
136
+ async stop() {
137
+ // TODO: Stop WebSocket server
138
+ }
139
+ getMetadata() {
140
+ return {
141
+ type: 'websocket',
142
+ endpoint: `ws://localhost:${this.config.port || 3001}${this.config.path || '/ws'}`
143
+ };
144
+ }
145
+ }
146
+ exports.WebSocketTransport = WebSocketTransport;
147
+ /**
148
+ * MCP Transport (placeholder for future implementation)
149
+ */
150
+ class MCPTransport {
151
+ constructor(config = {}) {
152
+ this.name = 'mcp';
153
+ this.config = config;
154
+ }
155
+ async initialize(registry, context) {
156
+ context.logger.info('MCP Transport initialized (not yet implemented)');
157
+ }
158
+ async start() {
159
+ // TODO: Register functions as MCP tools
160
+ }
161
+ async stop() {
162
+ // TODO: Cleanup MCP registration
163
+ }
164
+ getMetadata() {
165
+ return {
166
+ type: 'mcp',
167
+ name: this.config.name || 'plugin-mcp-server'
168
+ };
169
+ }
170
+ }
171
+ exports.MCPTransport = MCPTransport;
package/dist/types.d.ts CHANGED
@@ -118,12 +118,83 @@ export type RouteHandler = (req: RequestLike, res: ResponseLike, ctx: {
118
118
  logger: any;
119
119
  http: any;
120
120
  }) => any | Promise<any>;
121
+ export interface JsonSchema {
122
+ type?: 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null';
123
+ properties?: Record<string, JsonSchema>;
124
+ items?: JsonSchema;
125
+ required?: string[];
126
+ additionalProperties?: boolean | JsonSchema;
127
+ enum?: any[];
128
+ minimum?: number;
129
+ maximum?: number;
130
+ minLength?: number;
131
+ maxLength?: number;
132
+ pattern?: string;
133
+ description?: string;
134
+ default?: any;
135
+ examples?: any[];
136
+ [key: string]: any;
137
+ }
121
138
  export interface ApiRouteDef {
122
139
  method: ApiMethod;
123
140
  path: `/api/${string}`;
124
141
  name: string;
125
142
  description: string;
126
143
  handler: RouteHandler;
144
+ requestSchema: {
145
+ query?: JsonSchema;
146
+ params?: JsonSchema;
147
+ body?: JsonSchema;
148
+ };
149
+ responseSchema?: JsonSchema;
150
+ tags?: string[];
151
+ deprecated?: boolean;
152
+ }
153
+ export type FunctionHandler<TInput = any, TOutput = any> = (input: TInput, context: PluginContext) => Promise<TOutput> | TOutput;
154
+ export type SubscriptionHandler<TInput = any, TOutput = any> = (input: TInput, context: PluginContext) => AsyncGenerator<TOutput, void, unknown>;
155
+ export interface FunctionDefinition {
156
+ name: string;
157
+ description: string;
158
+ input: JsonSchema;
159
+ output: JsonSchema;
160
+ handler: FunctionHandler;
161
+ tags?: string[];
162
+ deprecated?: boolean;
163
+ }
164
+ export interface SubscriptionDefinition {
165
+ name: string;
166
+ description: string;
167
+ input: JsonSchema;
168
+ output: JsonSchema;
169
+ handler: SubscriptionHandler;
170
+ }
171
+ export interface Transport {
172
+ name: string;
173
+ initialize(registry: FunctionRegistry, context: PluginContext): Promise<void>;
174
+ start(): Promise<void>;
175
+ stop(): Promise<void>;
176
+ getMetadata(): TransportMetadata;
177
+ }
178
+ export interface TransportMetadata {
179
+ type: string;
180
+ endpoint?: string;
181
+ discovery?: string;
182
+ [key: string]: any;
183
+ }
184
+ export interface FunctionRegistry {
185
+ functions: Map<string, FunctionDefinition>;
186
+ subscriptions: Map<string, SubscriptionDefinition>;
187
+ plugin: {
188
+ id: string;
189
+ name: string;
190
+ version: string;
191
+ };
192
+ }
193
+ export interface ClientGenerationConfig {
194
+ output: string;
195
+ languages: ('typescript' | 'javascript')[];
196
+ includeReactHooks?: boolean;
197
+ includeValidation?: boolean;
127
198
  }
128
199
  export type HistoryMode = 'browser' | 'hash';
129
200
  export interface UiConfig {
@@ -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,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAClD,GAAG,CAAC,CAAC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AAG,SAAS,GAAG,SAAS,GAAG,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@majkapp/plugin-kit",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Fluent builder framework for creating robust MAJK plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,8 +30,7 @@
30
30
  ],
31
31
  "author": "Majk Contributors",
32
32
  "devDependencies": {
33
- "@types/node": "^20.0.0",
34
- "typescript": "^5.0.0"
35
- },
36
- "peerDependencies": {}
33
+ "@types/node": "^20.19.24",
34
+ "typescript": "^5.9.3"
35
+ }
37
36
  }