@neural-tools/core 0.1.4 → 0.1.5

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/LICENSE.md ADDED
@@ -0,0 +1,80 @@
1
+ # Neural Tools License
2
+
3
+ Copyright (c) 2025 Luke Amy. All rights reserved.
4
+
5
+ ## License Agreement
6
+
7
+ This software is provided under a dual-license model:
8
+
9
+ ### 1. Free Tier License (MIT)
10
+
11
+ The following components are licensed under the MIT License:
12
+
13
+ - Basic MCP generation functionality
14
+ - Claude command generation
15
+ - Core utilities and types
16
+ - Basic templates
17
+ - Documentation and examples
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining a copy of the free tier components to use, copy, modify, merge, publish, and distribute, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
22
+
23
+ ### 2. Pro/Enterprise License (Proprietary)
24
+
25
+ The following features require a valid Pro or Enterprise license:
26
+
27
+ **Pro Features:**
28
+ - Vector database integration
29
+ - Semantic caching
30
+ - Fine-tuning workflows
31
+ - Cloud deployment templates (AWS/GCP)
32
+ - Premium templates and examples
33
+ - GitHub automation features
34
+
35
+ **Enterprise Features:**
36
+ - White-label support
37
+ - Custom integrations
38
+ - Priority support
39
+ - SLA guarantees
40
+ - Team collaboration features
41
+
42
+ These features are proprietary and may not be used without a valid license key purchased from neural-tools.dev.
43
+
44
+ ### License Terms
45
+
46
+ 1. **Free Tier**: You may use the free tier features for any purpose, including commercial use, under the MIT License terms.
47
+
48
+ 2. **Pro/Enterprise**: You must purchase a license to access Pro or Enterprise features. Each license is:
49
+ - Per-user for individual licenses
50
+ - Per-organization for team/enterprise licenses
51
+ - Non-transferable without written consent
52
+ - Subject to the terms at neural-tools.dev/terms
53
+
54
+ 3. **Source Code**: This repository is private. You may not:
55
+ - Redistribute the source code
56
+ - Create derivative works for redistribution
57
+ - Reverse engineer Pro/Enterprise features
58
+ - Remove or circumvent license checks
59
+
60
+ 4. **Support**: Support is provided based on your license tier:
61
+ - Free: Community support only
62
+ - Pro: Email support (48-hour response)
63
+ - Enterprise: Priority support with SLA
64
+
65
+ ### Warranty Disclaimer
66
+
67
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
68
+
69
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
70
+
71
+ ### Contact
72
+
73
+ For licensing inquiries:
74
+ - Email: licensing@neural-tools.dev
75
+ - Website: https://neural-tools.dev/pricing
76
+ - Support: support@neural-tools.dev
77
+
78
+ ---
79
+
80
+ **Last Updated:** January 2025
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
- export declare enum LicenseTier {
2
+
3
+ declare enum LicenseTier {
3
4
  FREE = "free",
4
5
  PRO = "pro",
5
6
  ENTERPRISE = "enterprise"
6
7
  }
7
- export declare const LicenseSchema: z.ZodObject<{
8
+ declare const LicenseSchema: z.ZodObject<{
8
9
  tier: z.ZodNativeEnum<typeof LicenseTier>;
9
10
  email: z.ZodOptional<z.ZodString>;
10
11
  key: z.ZodOptional<z.ZodString>;
@@ -23,8 +24,8 @@ export declare const LicenseSchema: z.ZodObject<{
23
24
  expiresAt?: string | undefined;
24
25
  features?: string[] | undefined;
25
26
  }>;
26
- export type License = z.infer<typeof LicenseSchema>;
27
- export declare const MCPConfigSchema: z.ZodObject<{
27
+ type License = z.infer<typeof LicenseSchema>;
28
+ declare const MCPConfigSchema: z.ZodObject<{
28
29
  name: z.ZodString;
29
30
  description: z.ZodString;
30
31
  version: z.ZodString;
@@ -72,8 +73,8 @@ export declare const MCPConfigSchema: z.ZodObject<{
72
73
  resources?: string[] | undefined;
73
74
  } | undefined;
74
75
  }>;
75
- export type MCPConfig = z.infer<typeof MCPConfigSchema>;
76
- export declare const ClaudeCommandConfigSchema: z.ZodObject<{
76
+ type MCPConfig = z.infer<typeof MCPConfigSchema>;
77
+ declare const ClaudeCommandConfigSchema: z.ZodObject<{
77
78
  name: z.ZodString;
78
79
  description: z.ZodString;
79
80
  argumentHint: z.ZodOptional<z.ZodString>;
@@ -92,38 +93,38 @@ export declare const ClaudeCommandConfigSchema: z.ZodObject<{
92
93
  argumentHint?: string | undefined;
93
94
  allowedTools?: string[] | undefined;
94
95
  }>;
95
- export type ClaudeCommandConfig = z.infer<typeof ClaudeCommandConfigSchema>;
96
- export interface GeneratorOptions {
96
+ type ClaudeCommandConfig = z.infer<typeof ClaudeCommandConfigSchema>;
97
+ interface GeneratorOptions {
97
98
  name: string;
98
99
  description?: string;
99
100
  outputDir?: string;
100
101
  template?: string;
101
102
  dryRun?: boolean;
102
103
  }
103
- export interface MCPGeneratorOptions extends GeneratorOptions {
104
+ interface MCPGeneratorOptions extends GeneratorOptions {
104
105
  fastmcp?: boolean;
105
106
  cicd?: 'github' | 'harness' | 'none';
106
107
  deployment?: 'aws' | 'gcp' | 'none';
107
108
  }
108
- export interface ClaudeCommandGeneratorOptions extends GeneratorOptions {
109
+ interface ClaudeCommandGeneratorOptions extends GeneratorOptions {
109
110
  arguments?: string[];
110
111
  allowedTools?: string[];
111
112
  installGlobally?: boolean;
112
113
  }
113
- export interface VectorDBConfig {
114
+ interface VectorDBConfig {
114
115
  provider: 'pinecone' | 'qdrant' | 'chromadb' | 'local';
115
116
  apiKey?: string;
116
117
  endpoint?: string;
117
118
  dimension?: number;
118
119
  metric?: 'cosine' | 'euclidean' | 'dotproduct';
119
120
  }
120
- export interface SemanticCacheConfig {
121
+ interface SemanticCacheConfig {
121
122
  enabled: boolean;
122
123
  ttl?: number;
123
124
  similarityThreshold?: number;
124
125
  vectorDB?: VectorDBConfig;
125
126
  }
126
- export interface FineTuneConfig {
127
+ interface FineTuneConfig {
127
128
  provider: 'openai' | 'anthropic' | 'custom';
128
129
  model: string;
129
130
  datasetPath: string;
@@ -131,3 +132,39 @@ export interface FineTuneConfig {
131
132
  epochs?: number;
132
133
  learningRate?: number;
133
134
  }
135
+
136
+ declare class LicenseManager {
137
+ private static instance;
138
+ private license;
139
+ private constructor();
140
+ static getInstance(): LicenseManager;
141
+ loadLicense(): Promise<License>;
142
+ saveLicense(license: License): Promise<void>;
143
+ checkFeature(feature: string): Promise<boolean>;
144
+ requireFeature(feature: string, featureName?: string): Promise<void>;
145
+ getTier(): Promise<LicenseTier>;
146
+ }
147
+ declare const licenseManager: LicenseManager;
148
+ declare function checkLicense(): Promise<License>;
149
+ declare function checkFeature(feature: string): Promise<boolean>;
150
+ declare function requireFeature(feature: string, featureName?: string): Promise<void>;
151
+
152
+ declare class Logger {
153
+ private spinner;
154
+ info(message: string): void;
155
+ success(message: string): void;
156
+ warn(message: string): void;
157
+ error(message: string): void;
158
+ debug(message: string): void;
159
+ startSpinner(message: string): void;
160
+ succeedSpinner(message?: string): void;
161
+ failSpinner(message?: string): void;
162
+ updateSpinner(message: string): void;
163
+ log(message: string): void;
164
+ newline(): void;
165
+ header(message: string): void;
166
+ section(title: string, content: string[]): void;
167
+ }
168
+ declare const logger: Logger;
169
+
170
+ export { type ClaudeCommandConfig, ClaudeCommandConfigSchema, type ClaudeCommandGeneratorOptions, type FineTuneConfig, type GeneratorOptions, type License, LicenseManager, LicenseSchema, LicenseTier, Logger, type MCPConfig, MCPConfigSchema, type MCPGeneratorOptions, type SemanticCacheConfig, type VectorDBConfig, checkFeature, checkLicense, licenseManager, logger, requireFeature };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,170 @@
1
- export * from './types';
2
- export * from './license';
3
- export { logger, Logger } from './logger';
1
+ import { z } from 'zod';
2
+
3
+ declare enum LicenseTier {
4
+ FREE = "free",
5
+ PRO = "pro",
6
+ ENTERPRISE = "enterprise"
7
+ }
8
+ declare const LicenseSchema: z.ZodObject<{
9
+ tier: z.ZodNativeEnum<typeof LicenseTier>;
10
+ email: z.ZodOptional<z.ZodString>;
11
+ key: z.ZodOptional<z.ZodString>;
12
+ expiresAt: z.ZodOptional<z.ZodString>;
13
+ features: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ tier: LicenseTier;
16
+ features: string[];
17
+ email?: string | undefined;
18
+ key?: string | undefined;
19
+ expiresAt?: string | undefined;
20
+ }, {
21
+ tier: LicenseTier;
22
+ email?: string | undefined;
23
+ key?: string | undefined;
24
+ expiresAt?: string | undefined;
25
+ features?: string[] | undefined;
26
+ }>;
27
+ type License = z.infer<typeof LicenseSchema>;
28
+ declare const MCPConfigSchema: z.ZodObject<{
29
+ name: z.ZodString;
30
+ description: z.ZodString;
31
+ version: z.ZodString;
32
+ author: z.ZodOptional<z.ZodString>;
33
+ homepage: z.ZodOptional<z.ZodString>;
34
+ repository: z.ZodOptional<z.ZodString>;
35
+ license: z.ZodDefault<z.ZodString>;
36
+ fastmcp: z.ZodOptional<z.ZodObject<{
37
+ tools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
38
+ prompts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
39
+ resources: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ tools: string[];
42
+ prompts: string[];
43
+ resources: string[];
44
+ }, {
45
+ tools?: string[] | undefined;
46
+ prompts?: string[] | undefined;
47
+ resources?: string[] | undefined;
48
+ }>>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ name: string;
51
+ description: string;
52
+ version: string;
53
+ license: string;
54
+ author?: string | undefined;
55
+ homepage?: string | undefined;
56
+ repository?: string | undefined;
57
+ fastmcp?: {
58
+ tools: string[];
59
+ prompts: string[];
60
+ resources: string[];
61
+ } | undefined;
62
+ }, {
63
+ name: string;
64
+ description: string;
65
+ version: string;
66
+ author?: string | undefined;
67
+ homepage?: string | undefined;
68
+ repository?: string | undefined;
69
+ license?: string | undefined;
70
+ fastmcp?: {
71
+ tools?: string[] | undefined;
72
+ prompts?: string[] | undefined;
73
+ resources?: string[] | undefined;
74
+ } | undefined;
75
+ }>;
76
+ type MCPConfig = z.infer<typeof MCPConfigSchema>;
77
+ declare const ClaudeCommandConfigSchema: z.ZodObject<{
78
+ name: z.ZodString;
79
+ description: z.ZodString;
80
+ argumentHint: z.ZodOptional<z.ZodString>;
81
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
82
+ content: z.ZodString;
83
+ }, "strip", z.ZodTypeAny, {
84
+ name: string;
85
+ description: string;
86
+ content: string;
87
+ argumentHint?: string | undefined;
88
+ allowedTools?: string[] | undefined;
89
+ }, {
90
+ name: string;
91
+ description: string;
92
+ content: string;
93
+ argumentHint?: string | undefined;
94
+ allowedTools?: string[] | undefined;
95
+ }>;
96
+ type ClaudeCommandConfig = z.infer<typeof ClaudeCommandConfigSchema>;
97
+ interface GeneratorOptions {
98
+ name: string;
99
+ description?: string;
100
+ outputDir?: string;
101
+ template?: string;
102
+ dryRun?: boolean;
103
+ }
104
+ interface MCPGeneratorOptions extends GeneratorOptions {
105
+ fastmcp?: boolean;
106
+ cicd?: 'github' | 'harness' | 'none';
107
+ deployment?: 'aws' | 'gcp' | 'none';
108
+ }
109
+ interface ClaudeCommandGeneratorOptions extends GeneratorOptions {
110
+ arguments?: string[];
111
+ allowedTools?: string[];
112
+ installGlobally?: boolean;
113
+ }
114
+ interface VectorDBConfig {
115
+ provider: 'pinecone' | 'qdrant' | 'chromadb' | 'local';
116
+ apiKey?: string;
117
+ endpoint?: string;
118
+ dimension?: number;
119
+ metric?: 'cosine' | 'euclidean' | 'dotproduct';
120
+ }
121
+ interface SemanticCacheConfig {
122
+ enabled: boolean;
123
+ ttl?: number;
124
+ similarityThreshold?: number;
125
+ vectorDB?: VectorDBConfig;
126
+ }
127
+ interface FineTuneConfig {
128
+ provider: 'openai' | 'anthropic' | 'custom';
129
+ model: string;
130
+ datasetPath: string;
131
+ validationSplit?: number;
132
+ epochs?: number;
133
+ learningRate?: number;
134
+ }
135
+
136
+ declare class LicenseManager {
137
+ private static instance;
138
+ private license;
139
+ private constructor();
140
+ static getInstance(): LicenseManager;
141
+ loadLicense(): Promise<License>;
142
+ saveLicense(license: License): Promise<void>;
143
+ checkFeature(feature: string): Promise<boolean>;
144
+ requireFeature(feature: string, featureName?: string): Promise<void>;
145
+ getTier(): Promise<LicenseTier>;
146
+ }
147
+ declare const licenseManager: LicenseManager;
148
+ declare function checkLicense(): Promise<License>;
149
+ declare function checkFeature(feature: string): Promise<boolean>;
150
+ declare function requireFeature(feature: string, featureName?: string): Promise<void>;
151
+
152
+ declare class Logger {
153
+ private spinner;
154
+ info(message: string): void;
155
+ success(message: string): void;
156
+ warn(message: string): void;
157
+ error(message: string): void;
158
+ debug(message: string): void;
159
+ startSpinner(message: string): void;
160
+ succeedSpinner(message?: string): void;
161
+ failSpinner(message?: string): void;
162
+ updateSpinner(message: string): void;
163
+ log(message: string): void;
164
+ newline(): void;
165
+ header(message: string): void;
166
+ section(title: string, content: string[]): void;
167
+ }
168
+ declare const logger: Logger;
169
+
170
+ export { type ClaudeCommandConfig, ClaudeCommandConfigSchema, type ClaudeCommandGeneratorOptions, type FineTuneConfig, type GeneratorOptions, type License, LicenseManager, LicenseSchema, LicenseTier, Logger, type MCPConfig, MCPConfigSchema, type MCPGeneratorOptions, type SemanticCacheConfig, type VectorDBConfig, checkFeature, checkLicense, licenseManager, logger, requireFeature };
package/dist/index.js CHANGED
@@ -1,25 +1,2 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Logger = exports.logger = void 0;
18
- // Types
19
- __exportStar(require("./types"), exports);
20
- // License management
21
- __exportStar(require("./license"), exports);
22
- // Logger
23
- var logger_1 = require("./logger");
24
- Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
25
- Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
1
+ "use strict";var C=Object.create;var l=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var i in e)l(t,i,{get:e[i],enumerable:!0})},y=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of F(e))!P.call(t,o)&&o!==i&&l(t,o,{get:()=>e[o],enumerable:!(r=E(e,o))||r.enumerable});return t};var a=(t,e,i)=>(i=t!=null?C(L(t)):{},y(e||!t||!t.__esModule?l(i,"default",{value:t,enumerable:!0}):i,t)),O=t=>y(l({},"__esModule",{value:!0}),t);var I={};S(I,{ClaudeCommandConfigSchema:()=>k,LicenseManager:()=>d,LicenseSchema:()=>u,LicenseTier:()=>p,Logger:()=>c,MCPConfigSchema:()=>R,checkFeature:()=>D,checkLicense:()=>T,licenseManager:()=>m,logger:()=>b,requireFeature:()=>G});module.exports=O(I);var n=require("zod"),p=(r=>(r.FREE="free",r.PRO="pro",r.ENTERPRISE="enterprise",r))(p||{}),u=n.z.object({tier:n.z.nativeEnum(p),email:n.z.string().email().optional(),key:n.z.string().optional(),expiresAt:n.z.string().datetime().optional(),features:n.z.array(n.z.string()).default([])}),R=n.z.object({name:n.z.string(),description:n.z.string(),version:n.z.string(),author:n.z.string().optional(),homepage:n.z.string().url().optional(),repository:n.z.string().url().optional(),license:n.z.string().default("MIT"),fastmcp:n.z.object({tools:n.z.array(n.z.string()).default([]),prompts:n.z.array(n.z.string()).default([]),resources:n.z.array(n.z.string()).default([])}).optional()}),k=n.z.object({name:n.z.string(),description:n.z.string(),argumentHint:n.z.string().optional(),allowedTools:n.z.array(n.z.string()).optional(),content:n.z.string()});var g=a(require("fs/promises")),f=a(require("path")),v=a(require("os"));var h=f.default.join(v.default.homedir(),".ai-toolkit","license.json"),d=class t{static instance;license=null;constructor(){}static getInstance(){return t.instance||(t.instance=new t),t.instance}async loadLicense(){if(this.license)return this.license;try{let e=await g.default.readFile(h,"utf-8"),i=JSON.parse(e);if(this.license=u.parse(i),this.license.expiresAt&&new Date(this.license.expiresAt)<new Date)throw new Error("License has expired");return this.license}catch{return this.license={tier:"free",features:["mcp-generation","claude-commands","basic-templates"]},this.license}}async saveLicense(e){let i=u.parse(e),r=f.default.dirname(h);await g.default.mkdir(r,{recursive:!0}),await g.default.writeFile(h,JSON.stringify(i,null,2),"utf-8"),this.license=i}async checkFeature(e){let i=await this.loadLicense(),r=["mcp-generation","claude-commands","basic-templates","local-development"],o=[...r,"vector-db","semantic-cache","fine-tuning","cloud-deployment","premium-templates","github-automation"],w=[...o,"white-label","custom-integrations","priority-support","sla-guarantee"];switch(i.tier){case"free":return r.includes(e)||i.features.includes(e);case"pro":return o.includes(e)||i.features.includes(e);case"enterprise":return w.includes(e)||i.features.includes(e);default:return r.includes(e)}}async requireFeature(e,i){if(!await this.checkFeature(e)){let o=i||e;throw new Error(`Feature "${o}" requires a Pro or Enterprise license.
2
+ Visit https://ai-toolkit.dev/pricing to upgrade.`)}}async getTier(){return(await this.loadLicense()).tier}},m=d.getInstance();async function T(){return m.loadLicense()}async function D(t){return m.checkFeature(t)}async function G(t,e){return m.requireFeature(t,e)}var s=a(require("chalk")),x=a(require("ora")),c=class{spinner=null;info(e){console.log(s.default.blue("\u2139"),e)}success(e){console.log(s.default.green("\u2713"),e)}warn(e){console.log(s.default.yellow("\u26A0"),e)}error(e){console.log(s.default.red("\u2717"),e)}debug(e){process.env.DEBUG&&console.log(s.default.gray("\u2192"),e)}startSpinner(e){this.spinner=(0,x.default)(e).start()}succeedSpinner(e){this.spinner&&(this.spinner.succeed(e),this.spinner=null)}failSpinner(e){this.spinner&&(this.spinner.fail(e),this.spinner=null)}updateSpinner(e){this.spinner&&(this.spinner.text=e)}log(e){console.log(e)}newline(){console.log()}header(e){console.log(),console.log(s.default.bold.cyan(e)),console.log(s.default.cyan("\u2500".repeat(e.length)))}section(e,i){this.header(e),i.forEach(r=>this.log(` ${r}`)),this.newline()}},b=new c;0&&(module.exports={ClaudeCommandConfigSchema,LicenseManager,LicenseSchema,LicenseTier,Logger,MCPConfigSchema,checkFeature,checkLicense,licenseManager,logger,requireFeature});
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import{z as n}from"zod";var c=(i=>(i.FREE="free",i.PRO="pro",i.ENTERPRISE="enterprise",i))(c||{}),l=n.object({tier:n.nativeEnum(c),email:n.string().email().optional(),key:n.string().optional(),expiresAt:n.string().datetime().optional(),features:n.array(n.string()).default([])}),b=n.object({name:n.string(),description:n.string(),version:n.string(),author:n.string().optional(),homepage:n.string().url().optional(),repository:n.string().url().optional(),license:n.string().default("MIT"),fastmcp:n.object({tools:n.array(n.string()).default([]),prompts:n.array(n.string()).default([]),resources:n.array(n.string()).default([])}).optional()}),w=n.object({name:n.string(),description:n.string(),argumentHint:n.string().optional(),allowedTools:n.array(n.string()).optional(),content:n.string()});import p from"fs/promises";import m from"path";import f from"os";var u=m.join(f.homedir(),".ai-toolkit","license.json"),g=class r{static instance;license=null;constructor(){}static getInstance(){return r.instance||(r.instance=new r),r.instance}async loadLicense(){if(this.license)return this.license;try{let e=await p.readFile(u,"utf-8"),t=JSON.parse(e);if(this.license=l.parse(t),this.license.expiresAt&&new Date(this.license.expiresAt)<new Date)throw new Error("License has expired");return this.license}catch{return this.license={tier:"free",features:["mcp-generation","claude-commands","basic-templates"]},this.license}}async saveLicense(e){let t=l.parse(e),i=m.dirname(u);await p.mkdir(i,{recursive:!0}),await p.writeFile(u,JSON.stringify(t,null,2),"utf-8"),this.license=t}async checkFeature(e){let t=await this.loadLicense(),i=["mcp-generation","claude-commands","basic-templates","local-development"],s=[...i,"vector-db","semantic-cache","fine-tuning","cloud-deployment","premium-templates","github-automation"],h=[...s,"white-label","custom-integrations","priority-support","sla-guarantee"];switch(t.tier){case"free":return i.includes(e)||t.features.includes(e);case"pro":return s.includes(e)||t.features.includes(e);case"enterprise":return h.includes(e)||t.features.includes(e);default:return i.includes(e)}}async requireFeature(e,t){if(!await this.checkFeature(e)){let s=t||e;throw new Error(`Feature "${s}" requires a Pro or Enterprise license.
2
+ Visit https://ai-toolkit.dev/pricing to upgrade.`)}}async getTier(){return(await this.loadLicense()).tier}},d=g.getInstance();async function O(){return d.loadLicense()}async function R(r){return d.checkFeature(r)}async function k(r,e){return d.requireFeature(r,e)}import o from"chalk";import y from"ora";var a=class{spinner=null;info(e){console.log(o.blue("\u2139"),e)}success(e){console.log(o.green("\u2713"),e)}warn(e){console.log(o.yellow("\u26A0"),e)}error(e){console.log(o.red("\u2717"),e)}debug(e){process.env.DEBUG&&console.log(o.gray("\u2192"),e)}startSpinner(e){this.spinner=y(e).start()}succeedSpinner(e){this.spinner&&(this.spinner.succeed(e),this.spinner=null)}failSpinner(e){this.spinner&&(this.spinner.fail(e),this.spinner=null)}updateSpinner(e){this.spinner&&(this.spinner.text=e)}log(e){console.log(e)}newline(){console.log()}header(e){console.log(),console.log(o.bold.cyan(e)),console.log(o.cyan("\u2500".repeat(e.length)))}section(e,t){this.header(e),t.forEach(i=>this.log(` ${i}`)),this.newline()}},v=new a;export{w as ClaudeCommandConfigSchema,g as LicenseManager,l as LicenseSchema,c as LicenseTier,a as Logger,b as MCPConfigSchema,R as checkFeature,O as checkLicense,d as licenseManager,v as logger,k as requireFeature};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neural-tools/core",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Core utilities and types for Neural Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "url": "https://github.com/MacLeanLuke/neural-tools.git",
14
14
  "directory": "packages/core"
15
15
  },
16
- "homepage": "https://neural-tools.com",
16
+ "homepage": "https://neural-tools.com/docs/core.html",
17
17
  "bugs": {
18
18
  "url": "https://github.com/MacLeanLuke/neural-tools/issues"
19
19
  },
@@ -39,8 +39,8 @@
39
39
  "dist"
40
40
  ],
41
41
  "scripts": {
42
- "build": "tsc",
43
- "dev": "tsc --watch",
42
+ "build": "tsup",
43
+ "dev": "tsup --watch",
44
44
  "clean": "rm -rf dist",
45
45
  "test": "echo 'Tests coming soon'"
46
46
  }
package/dist/license.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import { License, LicenseTier } from './types';
2
- export declare class LicenseManager {
3
- private static instance;
4
- private license;
5
- private constructor();
6
- static getInstance(): LicenseManager;
7
- loadLicense(): Promise<License>;
8
- saveLicense(license: License): Promise<void>;
9
- checkFeature(feature: string): Promise<boolean>;
10
- requireFeature(feature: string, featureName?: string): Promise<void>;
11
- getTier(): Promise<LicenseTier>;
12
- }
13
- export declare const licenseManager: LicenseManager;
14
- export declare function checkLicense(): Promise<License>;
15
- export declare function checkFeature(feature: string): Promise<boolean>;
16
- export declare function requireFeature(feature: string, featureName?: string): Promise<void>;
package/dist/license.js DELETED
@@ -1,120 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.licenseManager = exports.LicenseManager = void 0;
7
- exports.checkLicense = checkLicense;
8
- exports.checkFeature = checkFeature;
9
- exports.requireFeature = requireFeature;
10
- const promises_1 = __importDefault(require("fs/promises"));
11
- const path_1 = __importDefault(require("path"));
12
- const os_1 = __importDefault(require("os"));
13
- const types_1 = require("./types");
14
- const LICENSE_FILE = path_1.default.join(os_1.default.homedir(), '.ai-toolkit', 'license.json');
15
- class LicenseManager {
16
- static instance;
17
- license = null;
18
- constructor() { }
19
- static getInstance() {
20
- if (!LicenseManager.instance) {
21
- LicenseManager.instance = new LicenseManager();
22
- }
23
- return LicenseManager.instance;
24
- }
25
- async loadLicense() {
26
- if (this.license) {
27
- return this.license;
28
- }
29
- try {
30
- const licenseData = await promises_1.default.readFile(LICENSE_FILE, 'utf-8');
31
- const parsed = JSON.parse(licenseData);
32
- this.license = types_1.LicenseSchema.parse(parsed);
33
- // Check if license is expired
34
- if (this.license.expiresAt) {
35
- const expiresAt = new Date(this.license.expiresAt);
36
- if (expiresAt < new Date()) {
37
- throw new Error('License has expired');
38
- }
39
- }
40
- return this.license;
41
- }
42
- catch (error) {
43
- // Default to free tier if no license found
44
- this.license = {
45
- tier: types_1.LicenseTier.FREE,
46
- features: ['mcp-generation', 'claude-commands', 'basic-templates']
47
- };
48
- return this.license;
49
- }
50
- }
51
- async saveLicense(license) {
52
- const validated = types_1.LicenseSchema.parse(license);
53
- const licenseDir = path_1.default.dirname(LICENSE_FILE);
54
- await promises_1.default.mkdir(licenseDir, { recursive: true });
55
- await promises_1.default.writeFile(LICENSE_FILE, JSON.stringify(validated, null, 2), 'utf-8');
56
- this.license = validated;
57
- }
58
- async checkFeature(feature) {
59
- const license = await this.loadLicense();
60
- // Free tier features
61
- const freeTierFeatures = [
62
- 'mcp-generation',
63
- 'claude-commands',
64
- 'basic-templates',
65
- 'local-development'
66
- ];
67
- // Pro tier features
68
- const proTierFeatures = [
69
- ...freeTierFeatures,
70
- 'vector-db',
71
- 'semantic-cache',
72
- 'fine-tuning',
73
- 'cloud-deployment',
74
- 'premium-templates',
75
- 'github-automation'
76
- ];
77
- // Enterprise tier features
78
- const enterpriseTierFeatures = [
79
- ...proTierFeatures,
80
- 'white-label',
81
- 'custom-integrations',
82
- 'priority-support',
83
- 'sla-guarantee'
84
- ];
85
- switch (license.tier) {
86
- case types_1.LicenseTier.FREE:
87
- return freeTierFeatures.includes(feature) || license.features.includes(feature);
88
- case types_1.LicenseTier.PRO:
89
- return proTierFeatures.includes(feature) || license.features.includes(feature);
90
- case types_1.LicenseTier.ENTERPRISE:
91
- return enterpriseTierFeatures.includes(feature) || license.features.includes(feature);
92
- default:
93
- return freeTierFeatures.includes(feature);
94
- }
95
- }
96
- async requireFeature(feature, featureName) {
97
- const hasFeature = await this.checkFeature(feature);
98
- if (!hasFeature) {
99
- const displayName = featureName || feature;
100
- throw new Error(`Feature "${displayName}" requires a Pro or Enterprise license.\n` +
101
- `Visit https://ai-toolkit.dev/pricing to upgrade.`);
102
- }
103
- }
104
- async getTier() {
105
- const license = await this.loadLicense();
106
- return license.tier;
107
- }
108
- }
109
- exports.LicenseManager = LicenseManager;
110
- exports.licenseManager = LicenseManager.getInstance();
111
- // Convenience functions
112
- async function checkLicense() {
113
- return exports.licenseManager.loadLicense();
114
- }
115
- async function checkFeature(feature) {
116
- return exports.licenseManager.checkFeature(feature);
117
- }
118
- async function requireFeature(feature, featureName) {
119
- return exports.licenseManager.requireFeature(feature, featureName);
120
- }
package/dist/logger.d.ts DELETED
@@ -1,17 +0,0 @@
1
- export declare class Logger {
2
- private spinner;
3
- info(message: string): void;
4
- success(message: string): void;
5
- warn(message: string): void;
6
- error(message: string): void;
7
- debug(message: string): void;
8
- startSpinner(message: string): void;
9
- succeedSpinner(message?: string): void;
10
- failSpinner(message?: string): void;
11
- updateSpinner(message: string): void;
12
- log(message: string): void;
13
- newline(): void;
14
- header(message: string): void;
15
- section(title: string, content: string[]): void;
16
- }
17
- export declare const logger: Logger;
package/dist/logger.js DELETED
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.logger = exports.Logger = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const ora_1 = __importDefault(require("ora"));
9
- class Logger {
10
- spinner = null;
11
- info(message) {
12
- console.log(chalk_1.default.blue('ℹ'), message);
13
- }
14
- success(message) {
15
- console.log(chalk_1.default.green('✓'), message);
16
- }
17
- warn(message) {
18
- console.log(chalk_1.default.yellow('⚠'), message);
19
- }
20
- error(message) {
21
- console.log(chalk_1.default.red('✗'), message);
22
- }
23
- debug(message) {
24
- if (process.env.DEBUG) {
25
- console.log(chalk_1.default.gray('→'), message);
26
- }
27
- }
28
- startSpinner(message) {
29
- this.spinner = (0, ora_1.default)(message).start();
30
- }
31
- succeedSpinner(message) {
32
- if (this.spinner) {
33
- this.spinner.succeed(message);
34
- this.spinner = null;
35
- }
36
- }
37
- failSpinner(message) {
38
- if (this.spinner) {
39
- this.spinner.fail(message);
40
- this.spinner = null;
41
- }
42
- }
43
- updateSpinner(message) {
44
- if (this.spinner) {
45
- this.spinner.text = message;
46
- }
47
- }
48
- log(message) {
49
- console.log(message);
50
- }
51
- newline() {
52
- console.log();
53
- }
54
- header(message) {
55
- console.log();
56
- console.log(chalk_1.default.bold.cyan(message));
57
- console.log(chalk_1.default.cyan('─'.repeat(message.length)));
58
- }
59
- section(title, content) {
60
- this.header(title);
61
- content.forEach(line => this.log(` ${line}`));
62
- this.newline();
63
- }
64
- }
65
- exports.Logger = Logger;
66
- exports.logger = new Logger();
package/dist/types.js DELETED
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClaudeCommandConfigSchema = exports.MCPConfigSchema = exports.LicenseSchema = exports.LicenseTier = void 0;
4
- const zod_1 = require("zod");
5
- // License tiers
6
- var LicenseTier;
7
- (function (LicenseTier) {
8
- LicenseTier["FREE"] = "free";
9
- LicenseTier["PRO"] = "pro";
10
- LicenseTier["ENTERPRISE"] = "enterprise";
11
- })(LicenseTier || (exports.LicenseTier = LicenseTier = {}));
12
- // License schema
13
- exports.LicenseSchema = zod_1.z.object({
14
- tier: zod_1.z.nativeEnum(LicenseTier),
15
- email: zod_1.z.string().email().optional(),
16
- key: zod_1.z.string().optional(),
17
- expiresAt: zod_1.z.string().datetime().optional(),
18
- features: zod_1.z.array(zod_1.z.string()).default([])
19
- });
20
- // MCP Configuration
21
- exports.MCPConfigSchema = zod_1.z.object({
22
- name: zod_1.z.string(),
23
- description: zod_1.z.string(),
24
- version: zod_1.z.string(),
25
- author: zod_1.z.string().optional(),
26
- homepage: zod_1.z.string().url().optional(),
27
- repository: zod_1.z.string().url().optional(),
28
- license: zod_1.z.string().default('MIT'),
29
- fastmcp: zod_1.z.object({
30
- tools: zod_1.z.array(zod_1.z.string()).default([]),
31
- prompts: zod_1.z.array(zod_1.z.string()).default([]),
32
- resources: zod_1.z.array(zod_1.z.string()).default([])
33
- }).optional()
34
- });
35
- // Claude Command Configuration
36
- exports.ClaudeCommandConfigSchema = zod_1.z.object({
37
- name: zod_1.z.string(),
38
- description: zod_1.z.string(),
39
- argumentHint: zod_1.z.string().optional(),
40
- allowedTools: zod_1.z.array(zod_1.z.string()).optional(),
41
- content: zod_1.z.string()
42
- });