w3pk 0.10.2 → 0.10.3
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.mts +124 -85
- package/dist/index.d.ts +124 -85
- package/dist/index.js +31 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -31
- package/dist/index.mjs.map +1 -1
- package/dist/zk/index.js +1 -1
- package/dist/zk/index.js.map +1 -1
- package/dist/zk/index.mjs.map +1 -1
- package/dist/zk/utils.js +3 -3
- package/dist/zk/utils.js.map +1 -1
- package/dist/zk/utils.mjs +3 -3
- package/dist/zk/utils.mjs.map +1 -1
- package/docs/API_REFERENCE.md +87 -18
- package/docs/ARCHITECTURE.md +14 -13
- package/docs/BROWSER_COMPATIBILITY.md +13 -0
- package/docs/INTEGRATION_GUIDELINES.md +36 -20
- package/docs/POST_QUANTUM.md +236 -1468
- package/docs/QUICK_START.md +4 -4
- package/docs/RECOVERY.md +35 -1
- package/docs/SECURITY.md +65 -58
- package/docs/notes/IFRAME_IMPLEMENTATION_PLAN.md +197 -0
- package/docs/notes/JULY_13_ROADMAP.md +29 -0
- package/docs/notes/NOTES.md +333 -0
- package/docs/notes/SIWE_IMPLEMENTATION.md +129 -0
- package/docs/notes/SYNCING_ACROSS_DEVICES.md +127 -0
- package/docs/notes/ethereum-post-quantum-roadmap.md +213 -0
- package/docs/notes/wulong-building-finding.md +109 -0
- package/package.json +3 -2
- package/dist/inspect/node.d.mts +0 -112
- package/dist/inspect/node.d.ts +0 -112
package/dist/inspect/node.d.mts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node.js Inspection Module
|
|
3
|
-
*
|
|
4
|
-
* Provides filesystem-based code inspection capabilities for analyzing web3 applications
|
|
5
|
-
* from the server-side or during development. Scans application source code and generates
|
|
6
|
-
* security reports via the Rukh API.
|
|
7
|
-
*
|
|
8
|
-
* @module inspect/node
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Configuration options for Node.js-based application inspection
|
|
12
|
-
*/
|
|
13
|
-
interface InspectOptions {
|
|
14
|
-
/**
|
|
15
|
-
* The root directory of the application to inspect
|
|
16
|
-
* @default process.cwd()
|
|
17
|
-
*/
|
|
18
|
-
appPath?: string;
|
|
19
|
-
/**
|
|
20
|
-
* File patterns to include (glob patterns)
|
|
21
|
-
* @default ['**\/*.ts', '**\/*.tsx', '**\/*.js', '**\/*.jsx', '**\/*.json']
|
|
22
|
-
*/
|
|
23
|
-
includePatterns?: string[];
|
|
24
|
-
/**
|
|
25
|
-
* Directories to exclude from inspection
|
|
26
|
-
* @default ['node_modules', 'dist', '.next', '.git', 'build', 'coverage']
|
|
27
|
-
*/
|
|
28
|
-
excludeDirs?: string[];
|
|
29
|
-
/**
|
|
30
|
-
* Maximum file size in KB to include
|
|
31
|
-
* @default 500
|
|
32
|
-
*/
|
|
33
|
-
maxFileSizeKB?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Maximum total size in KB for all collected code (prevents exceeding API token limits)
|
|
36
|
-
* @default 100
|
|
37
|
-
*/
|
|
38
|
-
maxTotalSizeKB?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Focus mode: filters files to only include those relevant to specific features
|
|
41
|
-
* - 'transactions': Only files with signing, transactions, or blockchain operations
|
|
42
|
-
* - 'all': Include all files (default)
|
|
43
|
-
* @default 'all'
|
|
44
|
-
*/
|
|
45
|
-
focusMode?: 'transactions' | 'all';
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Result of the code gathering operation
|
|
49
|
-
*/
|
|
50
|
-
interface InspectResult {
|
|
51
|
-
/**
|
|
52
|
-
* The generated markdown content with all collected code
|
|
53
|
-
*/
|
|
54
|
-
markdown: string;
|
|
55
|
-
/**
|
|
56
|
-
* List of files that were included
|
|
57
|
-
*/
|
|
58
|
-
includedFiles: string[];
|
|
59
|
-
/**
|
|
60
|
-
* Total size in KB of all included files
|
|
61
|
-
*/
|
|
62
|
-
totalSizeKB: number;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Gathers application code and generates a markdown document
|
|
66
|
-
*
|
|
67
|
-
* @param options - Configuration options for the inspection
|
|
68
|
-
* @returns An object containing the markdown content and metadata
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* const result = await gatherCode({
|
|
73
|
-
* appPath: '../genji-passkey',
|
|
74
|
-
* includePatterns: ['**\/*.ts', '**\/*.tsx']
|
|
75
|
-
* });
|
|
76
|
-
*
|
|
77
|
-
* console.log(`Collected ${result.includedFiles.length} files`);
|
|
78
|
-
* console.log(`Total size: ${result.totalSizeKB} KB`);
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
declare function gatherCode(options?: InspectOptions): Promise<InspectResult>;
|
|
82
|
-
/**
|
|
83
|
-
* Inspects an application and returns a security report via Rukh API
|
|
84
|
-
*
|
|
85
|
-
* @param appPath - Path to the application to inspect
|
|
86
|
-
* @param rukhUrl - The Rukh API endpoint URL
|
|
87
|
-
* @param context - The context name to use (should have an instruction file with report format)
|
|
88
|
-
* @param model - The AI model to use ('anthropic', 'mistral', or 'openai')
|
|
89
|
-
* @param focusMode - Focus on 'transactions' or include 'all' files
|
|
90
|
-
* @returns A markdown-formatted security report
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```typescript
|
|
94
|
-
* const report = await inspect(
|
|
95
|
-
* '../genji-passkey',
|
|
96
|
-
* 'https://rukh.w3hc.org',
|
|
97
|
-
* 'w3pk',
|
|
98
|
-
* 'anthropic',
|
|
99
|
-
* 'transactions'
|
|
100
|
-
* );
|
|
101
|
-
*
|
|
102
|
-
* console.log(report);
|
|
103
|
-
* // Outputs:
|
|
104
|
-
* // # Genji Passkey Report
|
|
105
|
-
* // ## Available Methods
|
|
106
|
-
* // ### Method #1: Sign Message
|
|
107
|
-
* // ...
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
declare function inspect(appPath: string, rukhUrl?: string, context?: string, model?: 'anthropic' | 'mistral' | 'openai', focusMode?: 'transactions' | 'all'): Promise<string>;
|
|
111
|
-
|
|
112
|
-
export { type InspectOptions, type InspectResult, gatherCode, inspect };
|
package/dist/inspect/node.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node.js Inspection Module
|
|
3
|
-
*
|
|
4
|
-
* Provides filesystem-based code inspection capabilities for analyzing web3 applications
|
|
5
|
-
* from the server-side or during development. Scans application source code and generates
|
|
6
|
-
* security reports via the Rukh API.
|
|
7
|
-
*
|
|
8
|
-
* @module inspect/node
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Configuration options for Node.js-based application inspection
|
|
12
|
-
*/
|
|
13
|
-
interface InspectOptions {
|
|
14
|
-
/**
|
|
15
|
-
* The root directory of the application to inspect
|
|
16
|
-
* @default process.cwd()
|
|
17
|
-
*/
|
|
18
|
-
appPath?: string;
|
|
19
|
-
/**
|
|
20
|
-
* File patterns to include (glob patterns)
|
|
21
|
-
* @default ['**\/*.ts', '**\/*.tsx', '**\/*.js', '**\/*.jsx', '**\/*.json']
|
|
22
|
-
*/
|
|
23
|
-
includePatterns?: string[];
|
|
24
|
-
/**
|
|
25
|
-
* Directories to exclude from inspection
|
|
26
|
-
* @default ['node_modules', 'dist', '.next', '.git', 'build', 'coverage']
|
|
27
|
-
*/
|
|
28
|
-
excludeDirs?: string[];
|
|
29
|
-
/**
|
|
30
|
-
* Maximum file size in KB to include
|
|
31
|
-
* @default 500
|
|
32
|
-
*/
|
|
33
|
-
maxFileSizeKB?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Maximum total size in KB for all collected code (prevents exceeding API token limits)
|
|
36
|
-
* @default 100
|
|
37
|
-
*/
|
|
38
|
-
maxTotalSizeKB?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Focus mode: filters files to only include those relevant to specific features
|
|
41
|
-
* - 'transactions': Only files with signing, transactions, or blockchain operations
|
|
42
|
-
* - 'all': Include all files (default)
|
|
43
|
-
* @default 'all'
|
|
44
|
-
*/
|
|
45
|
-
focusMode?: 'transactions' | 'all';
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Result of the code gathering operation
|
|
49
|
-
*/
|
|
50
|
-
interface InspectResult {
|
|
51
|
-
/**
|
|
52
|
-
* The generated markdown content with all collected code
|
|
53
|
-
*/
|
|
54
|
-
markdown: string;
|
|
55
|
-
/**
|
|
56
|
-
* List of files that were included
|
|
57
|
-
*/
|
|
58
|
-
includedFiles: string[];
|
|
59
|
-
/**
|
|
60
|
-
* Total size in KB of all included files
|
|
61
|
-
*/
|
|
62
|
-
totalSizeKB: number;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Gathers application code and generates a markdown document
|
|
66
|
-
*
|
|
67
|
-
* @param options - Configuration options for the inspection
|
|
68
|
-
* @returns An object containing the markdown content and metadata
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* const result = await gatherCode({
|
|
73
|
-
* appPath: '../genji-passkey',
|
|
74
|
-
* includePatterns: ['**\/*.ts', '**\/*.tsx']
|
|
75
|
-
* });
|
|
76
|
-
*
|
|
77
|
-
* console.log(`Collected ${result.includedFiles.length} files`);
|
|
78
|
-
* console.log(`Total size: ${result.totalSizeKB} KB`);
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
declare function gatherCode(options?: InspectOptions): Promise<InspectResult>;
|
|
82
|
-
/**
|
|
83
|
-
* Inspects an application and returns a security report via Rukh API
|
|
84
|
-
*
|
|
85
|
-
* @param appPath - Path to the application to inspect
|
|
86
|
-
* @param rukhUrl - The Rukh API endpoint URL
|
|
87
|
-
* @param context - The context name to use (should have an instruction file with report format)
|
|
88
|
-
* @param model - The AI model to use ('anthropic', 'mistral', or 'openai')
|
|
89
|
-
* @param focusMode - Focus on 'transactions' or include 'all' files
|
|
90
|
-
* @returns A markdown-formatted security report
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```typescript
|
|
94
|
-
* const report = await inspect(
|
|
95
|
-
* '../genji-passkey',
|
|
96
|
-
* 'https://rukh.w3hc.org',
|
|
97
|
-
* 'w3pk',
|
|
98
|
-
* 'anthropic',
|
|
99
|
-
* 'transactions'
|
|
100
|
-
* );
|
|
101
|
-
*
|
|
102
|
-
* console.log(report);
|
|
103
|
-
* // Outputs:
|
|
104
|
-
* // # Genji Passkey Report
|
|
105
|
-
* // ## Available Methods
|
|
106
|
-
* // ### Method #1: Sign Message
|
|
107
|
-
* // ...
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
declare function inspect(appPath: string, rukhUrl?: string, context?: string, model?: 'anthropic' | 'mistral' | 'openai', focusMode?: 'transactions' | 'all'): Promise<string>;
|
|
111
|
-
|
|
112
|
-
export { type InspectOptions, type InspectResult, gatherCode, inspect };
|