@ik-firewall/core 1.0.2 → 2.3.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/index.cjs +381 -97
- package/dist/index.d.cts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +371 -97
- package/package.json +6 -4
- package/scripts/setup-runtime.js +60 -19
package/dist/index.d.cts
CHANGED
|
@@ -43,6 +43,17 @@ interface IKConfig {
|
|
|
43
43
|
contextMode?: ContextMode;
|
|
44
44
|
instanceConfigs?: Record<string, Partial<IKConfig>>;
|
|
45
45
|
isEnabled?: boolean;
|
|
46
|
+
licenseKey?: string;
|
|
47
|
+
billingStatus?: 'active' | 'blocked' | 'trial';
|
|
48
|
+
isVerified?: boolean;
|
|
49
|
+
firstUseDate?: string;
|
|
50
|
+
lastSyncDate?: string;
|
|
51
|
+
ownerEmail?: string;
|
|
52
|
+
hmacSecret?: string;
|
|
53
|
+
pricing?: Record<string, {
|
|
54
|
+
input: number;
|
|
55
|
+
output: number;
|
|
56
|
+
}>;
|
|
46
57
|
}
|
|
47
58
|
interface IKPluginInfo {
|
|
48
59
|
id: string;
|
|
@@ -147,6 +158,7 @@ interface UsageData {
|
|
|
147
158
|
optimized_tokens?: number;
|
|
148
159
|
tokens_saved: number;
|
|
149
160
|
cost_saved: number;
|
|
161
|
+
commission_due: number;
|
|
150
162
|
timestamp: string;
|
|
151
163
|
is_local: boolean;
|
|
152
164
|
cq_score: number;
|
|
@@ -294,12 +306,15 @@ declare class IKFirewallCore {
|
|
|
294
306
|
private gatekeeper;
|
|
295
307
|
private configManager;
|
|
296
308
|
private sessionDNA;
|
|
297
|
-
hooks?: IKHooks;
|
|
298
309
|
private cloudProvider?;
|
|
299
310
|
private localProvider;
|
|
300
311
|
private orchestrator;
|
|
301
312
|
private usageTracker;
|
|
313
|
+
private _hooks?;
|
|
314
|
+
private defaultConfig;
|
|
302
315
|
constructor(config?: Partial<IKConfig>, hooks?: IKHooks, cloudProvider?: AIProvider | BaseProvider);
|
|
316
|
+
get hooks(): IKHooks | undefined;
|
|
317
|
+
set hooks(newHooks: IKHooks | undefined);
|
|
303
318
|
static getInstance(config?: Partial<IKConfig>, hooks?: IKHooks): IKFirewallCore;
|
|
304
319
|
setConfig(newConfig: Partial<IKConfig>): void;
|
|
305
320
|
getConfig(): IKConfig;
|
|
@@ -345,14 +360,14 @@ declare class IKFirewallCore {
|
|
|
345
360
|
* Primary Analysis Entry Point
|
|
346
361
|
*/
|
|
347
362
|
analyze(input: string, provider?: AIProvider | BaseProvider, personaName?: string, locale?: string, instanceId?: string): Promise<IKMetrics>;
|
|
363
|
+
private applyHardening;
|
|
348
364
|
private getEmptyMetrics;
|
|
349
365
|
private createHeuristicMetrics;
|
|
350
|
-
private sniffDNA;
|
|
351
366
|
analyzeAIAssisted(input: string, provider?: AIProvider | BaseProvider, personaName?: string, instanceId?: string, configOverride?: Partial<IKConfig>): Promise<IKMetrics>;
|
|
352
367
|
private calculateDNARank;
|
|
353
368
|
private constructAuditPrompt;
|
|
354
369
|
private getFallbackMetrics;
|
|
355
|
-
crystallize(input: string, metrics?: IKMetrics, locale?: string): string;
|
|
370
|
+
crystallize(input: string, metrics?: IKMetrics, locale?: string, instanceId?: string): string;
|
|
356
371
|
private miniCrystallize;
|
|
357
372
|
getAgentDirective(personaName: string, userInsights?: IKMetrics['semanticInsights'], locale?: string): string;
|
|
358
373
|
private getApproachGuidance;
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,17 @@ interface IKConfig {
|
|
|
43
43
|
contextMode?: ContextMode;
|
|
44
44
|
instanceConfigs?: Record<string, Partial<IKConfig>>;
|
|
45
45
|
isEnabled?: boolean;
|
|
46
|
+
licenseKey?: string;
|
|
47
|
+
billingStatus?: 'active' | 'blocked' | 'trial';
|
|
48
|
+
isVerified?: boolean;
|
|
49
|
+
firstUseDate?: string;
|
|
50
|
+
lastSyncDate?: string;
|
|
51
|
+
ownerEmail?: string;
|
|
52
|
+
hmacSecret?: string;
|
|
53
|
+
pricing?: Record<string, {
|
|
54
|
+
input: number;
|
|
55
|
+
output: number;
|
|
56
|
+
}>;
|
|
46
57
|
}
|
|
47
58
|
interface IKPluginInfo {
|
|
48
59
|
id: string;
|
|
@@ -147,6 +158,7 @@ interface UsageData {
|
|
|
147
158
|
optimized_tokens?: number;
|
|
148
159
|
tokens_saved: number;
|
|
149
160
|
cost_saved: number;
|
|
161
|
+
commission_due: number;
|
|
150
162
|
timestamp: string;
|
|
151
163
|
is_local: boolean;
|
|
152
164
|
cq_score: number;
|
|
@@ -294,12 +306,15 @@ declare class IKFirewallCore {
|
|
|
294
306
|
private gatekeeper;
|
|
295
307
|
private configManager;
|
|
296
308
|
private sessionDNA;
|
|
297
|
-
hooks?: IKHooks;
|
|
298
309
|
private cloudProvider?;
|
|
299
310
|
private localProvider;
|
|
300
311
|
private orchestrator;
|
|
301
312
|
private usageTracker;
|
|
313
|
+
private _hooks?;
|
|
314
|
+
private defaultConfig;
|
|
302
315
|
constructor(config?: Partial<IKConfig>, hooks?: IKHooks, cloudProvider?: AIProvider | BaseProvider);
|
|
316
|
+
get hooks(): IKHooks | undefined;
|
|
317
|
+
set hooks(newHooks: IKHooks | undefined);
|
|
303
318
|
static getInstance(config?: Partial<IKConfig>, hooks?: IKHooks): IKFirewallCore;
|
|
304
319
|
setConfig(newConfig: Partial<IKConfig>): void;
|
|
305
320
|
getConfig(): IKConfig;
|
|
@@ -345,14 +360,14 @@ declare class IKFirewallCore {
|
|
|
345
360
|
* Primary Analysis Entry Point
|
|
346
361
|
*/
|
|
347
362
|
analyze(input: string, provider?: AIProvider | BaseProvider, personaName?: string, locale?: string, instanceId?: string): Promise<IKMetrics>;
|
|
363
|
+
private applyHardening;
|
|
348
364
|
private getEmptyMetrics;
|
|
349
365
|
private createHeuristicMetrics;
|
|
350
|
-
private sniffDNA;
|
|
351
366
|
analyzeAIAssisted(input: string, provider?: AIProvider | BaseProvider, personaName?: string, instanceId?: string, configOverride?: Partial<IKConfig>): Promise<IKMetrics>;
|
|
352
367
|
private calculateDNARank;
|
|
353
368
|
private constructAuditPrompt;
|
|
354
369
|
private getFallbackMetrics;
|
|
355
|
-
crystallize(input: string, metrics?: IKMetrics, locale?: string): string;
|
|
370
|
+
crystallize(input: string, metrics?: IKMetrics, locale?: string, instanceId?: string): string;
|
|
356
371
|
private miniCrystallize;
|
|
357
372
|
getAgentDirective(personaName: string, userInsights?: IKMetrics['semanticInsights'], locale?: string): string;
|
|
358
373
|
private getApproachGuidance;
|