@the-magic-tower/fixhive-opencode-plugin 0.1.25 → 0.1.27
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/cloud/client.d.ts +44 -0
- package/dist/cloud/client.d.ts.map +1 -0
- package/dist/cloud/embedding.d.ts +43 -0
- package/dist/cloud/embedding.d.ts.map +1 -0
- package/dist/core/error-detector.d.ts +26 -0
- package/dist/core/error-detector.d.ts.map +1 -0
- package/dist/core/hash.d.ts +41 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/privacy-filter.d.ts +33 -0
- package/dist/core/privacy-filter.d.ts.map +1 -0
- package/dist/index.d.ts +44 -472
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27031 -355
- package/dist/plugin/index.d.ts +11 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/tools.d.ts +15 -0
- package/dist/plugin/tools.d.ts.map +1 -0
- package/dist/storage/local-store.d.ts +46 -0
- package/dist/storage/local-store.d.ts.map +1 -0
- package/dist/storage/migrations.d.ts +10 -0
- package/dist/storage/migrations.d.ts.map +1 -0
- package/dist/types/index.d.ts +218 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +6 -11
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FixHive Cloud Client
|
|
3
|
+
* Supabase client for cloud knowledge base operations
|
|
4
|
+
*/
|
|
5
|
+
import type { CloudKnowledgeEntry, SearchRequest, SearchResponse, UploadRequest, UploadResponse, DuplicateCheckResult, ContributorStats } from '../types/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Cloud Client Configuration
|
|
8
|
+
*/
|
|
9
|
+
export interface CloudClientConfig {
|
|
10
|
+
supabaseUrl: string;
|
|
11
|
+
supabaseAnonKey: string;
|
|
12
|
+
openaiApiKey?: string;
|
|
13
|
+
contributorId?: string;
|
|
14
|
+
similarityThreshold?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* CloudClient interface - defines all public methods
|
|
18
|
+
*/
|
|
19
|
+
export interface CloudClient {
|
|
20
|
+
searchSimilar(request: SearchRequest): Promise<SearchResponse>;
|
|
21
|
+
uploadResolution(request: UploadRequest): Promise<UploadResponse>;
|
|
22
|
+
checkDuplicate(errorHash: string, embedding: number[]): Promise<DuplicateCheckResult>;
|
|
23
|
+
vote(knowledgeId: string, helpful: boolean): Promise<{
|
|
24
|
+
success: boolean;
|
|
25
|
+
error?: string;
|
|
26
|
+
}>;
|
|
27
|
+
reportEntry(knowledgeId: string, reason?: string): Promise<{
|
|
28
|
+
success: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
reportHelpful(knowledgeId: string): Promise<void>;
|
|
31
|
+
getContributorStats(): Promise<ContributorStats>;
|
|
32
|
+
getEntry(id: string): Promise<CloudKnowledgeEntry | null>;
|
|
33
|
+
getContributorId(): string;
|
|
34
|
+
hasEmbeddingService(): boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create a CloudClient instance
|
|
38
|
+
* Factory function pattern to avoid ES6 class issues with Bun
|
|
39
|
+
*/
|
|
40
|
+
export declare function createCloudClient(config: CloudClientConfig): Promise<CloudClient>;
|
|
41
|
+
export declare const CloudClient: {
|
|
42
|
+
create: typeof createCloudClient;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/cloud/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAa3B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,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
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* EmbeddingService interface - defines all public methods
|
|
7
|
+
*/
|
|
8
|
+
export interface EmbeddingService {
|
|
9
|
+
generate(text: string): Promise<number[]>;
|
|
10
|
+
generateBatch(texts: string[]): Promise<number[][]>;
|
|
11
|
+
generateErrorEmbedding(errorMessage: string, errorStack?: string, context?: {
|
|
12
|
+
language?: string;
|
|
13
|
+
framework?: string;
|
|
14
|
+
}): Promise<number[]>;
|
|
15
|
+
getDimensions(): number;
|
|
16
|
+
getModel(): string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* EmbeddingService configuration
|
|
20
|
+
*/
|
|
21
|
+
export interface EmbeddingServiceConfig {
|
|
22
|
+
apiKey: string;
|
|
23
|
+
model?: string;
|
|
24
|
+
dimensions?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Calculate cosine similarity between two embeddings
|
|
28
|
+
*/
|
|
29
|
+
export declare function cosineSimilarity(a: number[], b: number[]): number;
|
|
30
|
+
/**
|
|
31
|
+
* Create an EmbeddingService instance
|
|
32
|
+
* Factory function pattern to avoid ES6 class issues with Bun
|
|
33
|
+
*/
|
|
34
|
+
export declare function createEmbeddingService(config: EmbeddingServiceConfig): Promise<EmbeddingService>;
|
|
35
|
+
/**
|
|
36
|
+
* Legacy class wrapper for backwards compatibility
|
|
37
|
+
* @deprecated Use createEmbeddingService() instead
|
|
38
|
+
*/
|
|
39
|
+
export declare const EmbeddingService: {
|
|
40
|
+
create: typeof createEmbeddingService;
|
|
41
|
+
cosineSimilarity: typeof cosineSimilarity;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=embedding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/cloud/embedding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACpD,sBAAsB,CACpB,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACrB,aAAa,IAAI,MAAM,CAAC;IACxB,QAAQ,IAAI,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAmBjE;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2GtG;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FixHive Error Detector
|
|
3
|
+
* Detects errors from tool outputs using multi-signal analysis
|
|
4
|
+
*/
|
|
5
|
+
import type { ErrorDetectionResult, ToolOutput } from '../types/index.js';
|
|
6
|
+
import { type PrivacyFilter } from './privacy-filter.js';
|
|
7
|
+
/**
|
|
8
|
+
* ErrorDetector interface - defines all public methods
|
|
9
|
+
*/
|
|
10
|
+
export interface ErrorDetector {
|
|
11
|
+
detect(toolOutput: ToolOutput): ErrorDetectionResult;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create an ErrorDetector instance
|
|
15
|
+
* Factory function pattern to avoid ES6 class issues with Bun
|
|
16
|
+
*/
|
|
17
|
+
export declare function createErrorDetector(privacyFilter?: PrivacyFilter): ErrorDetector;
|
|
18
|
+
/**
|
|
19
|
+
* Legacy class wrapper for backwards compatibility
|
|
20
|
+
* @deprecated Use createErrorDetector() instead
|
|
21
|
+
*/
|
|
22
|
+
export declare const ErrorDetector: {
|
|
23
|
+
create: typeof createErrorDetector;
|
|
24
|
+
};
|
|
25
|
+
export declare const defaultErrorDetector: ErrorDetector;
|
|
26
|
+
//# sourceMappingURL=error-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-detector.d.ts","sourceRoot":"","sources":["../../src/core/error-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAIV,oBAAoB,EAEpB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAsG9E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,oBAAoB,CAAC;CACtD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,aAAa,CA8PhF;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;;CAEzB,CAAC;AAGF,eAAO,MAAM,oBAAoB,eAAwB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FixHive Hash Utilities
|
|
3
|
+
* Generates fingerprints and hashes for error deduplication
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Generate SHA-256 hash of content
|
|
7
|
+
*/
|
|
8
|
+
export declare function sha256(content: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Generate a shortened hash (first 16 characters)
|
|
11
|
+
*/
|
|
12
|
+
export declare function shortHash(content: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Generate error fingerprint for matching similar errors
|
|
15
|
+
* Normalizes variable parts (paths, numbers, hashes) before hashing
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateErrorFingerprint(errorMessage: string, errorStack?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Normalize error content by replacing variable parts
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeErrorContent(content: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Generate contributor ID (anonymous hash)
|
|
24
|
+
* Uses machine-specific information to create a stable anonymous ID
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateContributorId(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Generate session-specific hash
|
|
29
|
+
*/
|
|
30
|
+
export declare function generateSessionHash(sessionId: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Compare two fingerprints for similarity
|
|
33
|
+
* Returns true if they're identical (exact match)
|
|
34
|
+
*/
|
|
35
|
+
export declare function fingerprintsMatch(fp1: string, fp2: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Calculate simple string similarity (Jaccard index)
|
|
38
|
+
* Used as a fallback when embeddings aren't available
|
|
39
|
+
*/
|
|
40
|
+
export declare function calculateStringSimilarity(str1: string, str2: string): number;
|
|
41
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/core/hash.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CASR;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2B7D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAS9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAU5E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FixHive Privacy Filter
|
|
3
|
+
* Sanitizes sensitive information from error messages before sharing
|
|
4
|
+
*/
|
|
5
|
+
import type { PrivacyFilterRule, SanitizedContent, FilterContext } from '../types/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* PrivacyFilter interface - defines all public methods
|
|
8
|
+
*/
|
|
9
|
+
export interface PrivacyFilter {
|
|
10
|
+
sanitize(content: string, context?: FilterContext): SanitizedContent;
|
|
11
|
+
addRule(rule: PrivacyFilterRule): void;
|
|
12
|
+
removeRule(name: string): boolean;
|
|
13
|
+
getRules(): ReadonlyArray<PrivacyFilterRule>;
|
|
14
|
+
containsSensitiveData(content: string): boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a PrivacyFilter instance
|
|
18
|
+
* Factory function pattern to avoid ES6 class issues with Bun
|
|
19
|
+
*/
|
|
20
|
+
export declare function createPrivacyFilter(customRules?: PrivacyFilterRule[]): PrivacyFilter;
|
|
21
|
+
/**
|
|
22
|
+
* Legacy class wrapper for backwards compatibility
|
|
23
|
+
* @deprecated Use createPrivacyFilter() instead
|
|
24
|
+
*/
|
|
25
|
+
export declare const PrivacyFilter: {
|
|
26
|
+
create: typeof createPrivacyFilter;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Create default filter context from project directory
|
|
30
|
+
*/
|
|
31
|
+
export declare function createFilterContext(projectDirectory: string): FilterContext;
|
|
32
|
+
export declare const defaultPrivacyFilter: PrivacyFilter;
|
|
33
|
+
//# sourceMappingURL=privacy-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacy-filter.d.ts","sourceRoot":"","sources":["../../src/core/privacy-filter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAwN5F;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,gBAAgB,CAAC;IACrE,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,IAAI,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC7C,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CACjD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,CAAC,EAAE,iBAAiB,EAAE,GAAG,aAAa,CAyHpF;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;;CAEzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,GAAG,aAAa,CAc3E;AAGD,eAAO,MAAM,oBAAoB,eAAwB,CAAC"}
|