indusagi-coding-agent 0.1.23 → 0.1.25
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/CHANGELOG.md +101 -0
- package/README.md +2 -0
- package/dist/cli/args.d.ts +117 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +221 -52
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts +58 -2
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +130 -12
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts +70 -2
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +240 -15
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/list-models.d.ts +63 -3
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +202 -27
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/login-handler.d.ts +82 -8
- package/dist/cli/login-handler.d.ts.map +1 -1
- package/dist/cli/login-handler.js +410 -77
- package/dist/cli/login-handler.js.map +1 -1
- package/dist/cli/session-picker.d.ts +74 -2
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +236 -12
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/core/agent-session.d.ts +214 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +214 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts +302 -12
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +302 -12
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/diagnostics.d.ts +191 -0
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js +142 -0
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/discover-packages.d.ts +6 -0
- package/dist/core/discover-packages.d.ts.map +1 -0
- package/dist/core/discover-packages.js +62 -0
- package/dist/core/discover-packages.js.map +1 -0
- package/dist/core/event-bus.d.ts +146 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +93 -0
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts +4 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +4 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/index.d.ts +128 -0
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +128 -0
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts +4 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +4 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/keybindings.d.ts +142 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +142 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +98 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +98 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +99 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +99 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +2 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +127 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +125 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/subagents.js.map +1 -1
- package/dist/core/tools/bash.d.ts +391 -11
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +269 -2
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/bg-process.d.ts +49 -0
- package/dist/core/tools/bg-process.d.ts.map +1 -0
- package/dist/core/tools/bg-process.js +69 -0
- package/dist/core/tools/bg-process.js.map +1 -0
- package/dist/core/tools/edit.d.ts +284 -6
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +238 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +169 -5
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +136 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +285 -5
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +247 -0
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +45 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +15 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +6 -0
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +6 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +308 -7
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +231 -0
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/registry.d.ts +17 -0
- package/dist/core/tools/registry.d.ts.map +1 -0
- package/dist/core/tools/registry.js +108 -0
- package/dist/core/tools/registry.js.map +1 -0
- package/dist/core/tools/webfetch.d.ts +118 -3
- package/dist/core/tools/webfetch.d.ts.map +1 -1
- package/dist/core/tools/webfetch.js +118 -3
- package/dist/core/tools/webfetch.js.map +1 -1
- package/dist/core/tools/websearch.d.ts +130 -3
- package/dist/core/tools/websearch.d.ts.map +1 -1
- package/dist/core/tools/websearch.js +130 -3
- package/dist/core/tools/websearch.js.map +1 -1
- package/dist/core/tools/write.d.ts +251 -5
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +210 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +12 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +164 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +164 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +297 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +297 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +251 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +186 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +186 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1567 -13
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1567 -13
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +422 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +422 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts +538 -5
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +538 -5
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +921 -8
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +921 -8
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +802 -9
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +802 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +356 -3
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +356 -3
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/shared.d.ts +386 -0
- package/dist/modes/shared.d.ts.map +1 -0
- package/dist/modes/shared.js +543 -0
- package/dist/modes/shared.js.map +1 -0
- package/dist/utils/array.d.ts +389 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +585 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/color-formatter.d.ts +318 -0
- package/dist/utils/color-formatter.d.ts.map +1 -0
- package/dist/utils/color-formatter.js +442 -0
- package/dist/utils/color-formatter.js.map +1 -0
- package/dist/utils/data-transformer.d.ts +326 -0
- package/dist/utils/data-transformer.d.ts.map +1 -0
- package/dist/utils/data-transformer.js +512 -0
- package/dist/utils/data-transformer.js.map +1 -0
- package/dist/utils/date-formatter.d.ts +281 -0
- package/dist/utils/date-formatter.d.ts.map +1 -0
- package/dist/utils/date-formatter.js +503 -0
- package/dist/utils/date-formatter.js.map +1 -0
- package/dist/utils/error-handler.d.ts +541 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +726 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/file-operations.d.ts +297 -0
- package/dist/utils/file-operations.d.ts.map +1 -0
- package/dist/utils/file-operations.js +505 -0
- package/dist/utils/file-operations.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +268 -6
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +500 -21
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/json-formatter.d.ts +259 -0
- package/dist/utils/json-formatter.d.ts.map +1 -0
- package/dist/utils/json-formatter.js +517 -0
- package/dist/utils/json-formatter.js.map +1 -0
- package/dist/utils/logger.d.ts +176 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +346 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/markdown-formatter.d.ts +211 -0
- package/dist/utils/markdown-formatter.d.ts.map +1 -0
- package/dist/utils/markdown-formatter.js +482 -0
- package/dist/utils/markdown-formatter.js.map +1 -0
- package/dist/utils/path-validator.d.ts +603 -0
- package/dist/utils/path-validator.d.ts.map +1 -0
- package/dist/utils/path-validator.js +870 -0
- package/dist/utils/path-validator.js.map +1 -0
- package/dist/utils/string-formatter.d.ts +609 -0
- package/dist/utils/string-formatter.d.ts.map +1 -0
- package/dist/utils/string-formatter.js +806 -0
- package/dist/utils/string-formatter.js.map +1 -0
- package/dist/utils/type-guards.d.ts +629 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +662 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/docs/COMPLETE-GUIDE.md +300 -0
- package/docs/COMPREHENSIVE-CLI-SUMMARY.md +900 -0
- package/docs/MODES-ARCHITECTURE.md +565 -0
- package/docs/PRINT-MODE-GUIDE.md +456 -0
- package/docs/RPC-GUIDE.md +705 -0
- package/docs/UTILS-IMPLEMENTATION-SUMMARY.md +647 -0
- package/docs/UTILS-MODULE-OVERVIEW.md +1480 -0
- package/docs/UTILS-QA-CHECKLIST.md +1061 -0
- package/docs/UTILS-USAGE-GUIDE.md +1419 -0
- package/package.json +7 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-formatter.js","sourceRoot":"","sources":["../../src/utils/markdown-formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAqDH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,IAAI,IAAI,GAAG,QAAQ,CAAC;IAEpB,gCAAgC;IAChC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC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AAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;SAC9C,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Path Validation and Normalization Utilities
|
|
3
|
+
*
|
|
4
|
+
* **SECURITY FOCUSED**: This module provides secure path handling to prevent
|
|
5
|
+
* common path traversal and directory escape vulnerabilities.
|
|
6
|
+
*
|
|
7
|
+
* Common Path Vulnerabilities Addressed:
|
|
8
|
+
* - Directory traversal (../../) attacks
|
|
9
|
+
* - Symlink following (TOCTOU - Time-of-Check-Time-of-Use)
|
|
10
|
+
* - Path normalization bypasses
|
|
11
|
+
* - Null byte injection (\0)
|
|
12
|
+
* - Mixed slash handling (Windows vs Unix)
|
|
13
|
+
* - Relative path escape patterns
|
|
14
|
+
*
|
|
15
|
+
* SECURITY PRINCIPLES:
|
|
16
|
+
* 1. Always validate and normalize paths before file operations
|
|
17
|
+
* 2. Prevent directory traversal with ".." and "." resolution
|
|
18
|
+
* 3. Resolve symlinks to detect jail breaks
|
|
19
|
+
* 4. Whitelist allowed directories when possible
|
|
20
|
+
* 5. Never trust user-supplied paths directly
|
|
21
|
+
*
|
|
22
|
+
* This module provides type-safe, well-tested functions for:
|
|
23
|
+
* - Path safety validation and sanitization
|
|
24
|
+
* - Secure path resolution and normalization
|
|
25
|
+
* - Path component extraction
|
|
26
|
+
* - Cross-platform path handling
|
|
27
|
+
* - Symlink and traversal detection
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // SAFE: Validate before use
|
|
31
|
+
* if (isPathSafe(userPath, baseDir)) {
|
|
32
|
+
* const fullPath = joinSafe(baseDir, userPath);
|
|
33
|
+
* // Safe to use fullPath
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // UNSAFE: Direct concatenation - vulnerable to path traversal
|
|
38
|
+
* const fullPath = baseDir + '/' + userPath; // DON'T DO THIS
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // SAFE: Use validation helpers
|
|
42
|
+
* validatePath(userPath, { allowRelative: true, base: '/app/uploads' });
|
|
43
|
+
* const dir = getDirName(path);
|
|
44
|
+
* const name = getFileName(path);
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Path validation options
|
|
48
|
+
*/
|
|
49
|
+
export interface PathValidationOptions {
|
|
50
|
+
/** Base directory for relative path resolution */
|
|
51
|
+
base?: string;
|
|
52
|
+
/** Allow relative paths (default: false) */
|
|
53
|
+
allowRelative?: boolean;
|
|
54
|
+
/** Allow symlinks (default: false - security) */
|
|
55
|
+
allowSymlinks?: boolean;
|
|
56
|
+
/** Allow hidden files starting with . (default: false) */
|
|
57
|
+
allowHidden?: boolean;
|
|
58
|
+
/** Maximum allowed path length in characters (default: 4096) */
|
|
59
|
+
maxLength?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Path validation result with detailed information
|
|
63
|
+
*/
|
|
64
|
+
export interface PathValidationResult {
|
|
65
|
+
/** Whether the path is valid */
|
|
66
|
+
valid: boolean;
|
|
67
|
+
/** Error message if invalid */
|
|
68
|
+
error?: string;
|
|
69
|
+
/** Resolved absolute path */
|
|
70
|
+
resolved?: string;
|
|
71
|
+
/** Whether path contains symlinks */
|
|
72
|
+
hasSymlinks?: boolean;
|
|
73
|
+
/** Whether path is within allowed base */
|
|
74
|
+
isWithinBase?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* SECURITY: Checks if a path is safe for operations
|
|
78
|
+
*
|
|
79
|
+
* This is the primary security function - use before ANY file operation.
|
|
80
|
+
* Prevents:
|
|
81
|
+
* - Directory traversal (../../etc/passwd)
|
|
82
|
+
* - Absolute path bypass
|
|
83
|
+
* - Symlink attacks
|
|
84
|
+
* - Path normalization bypass
|
|
85
|
+
*
|
|
86
|
+
* @param pathStr - Path to validate
|
|
87
|
+
* @param baseDir - Optional base directory for restriction
|
|
88
|
+
* @returns true if path is safe, false otherwise
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* // SAFE: Check user-supplied path
|
|
92
|
+
* const userInput = req.query.file;
|
|
93
|
+
* if (isPathSafe(userInput, '/app/uploads')) {
|
|
94
|
+
* const fullPath = path.join('/app/uploads', userInput);
|
|
95
|
+
* const data = fs.readFileSync(fullPath); // Safe
|
|
96
|
+
* }
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* // UNSAFE: Allows directory traversal
|
|
100
|
+
* const fullPath = path.join('/app/uploads', userInput); // DON'T - no validation
|
|
101
|
+
* const data = fs.readFileSync(fullPath);
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* // UNSAFE PATHS (returns false)
|
|
105
|
+
* isPathSafe('../../../etc/passwd') // true -> prevents escape
|
|
106
|
+
* isPathSafe('/etc/passwd', '/app') // false -> absolute outside base
|
|
107
|
+
* isPathSafe('../../file.txt') // false -> traversal attempt
|
|
108
|
+
* isPathSafe('./file.txt', '/app') // true -> safe relative
|
|
109
|
+
*
|
|
110
|
+
* @edge-cases
|
|
111
|
+
* - Empty path returns true (cwd)
|
|
112
|
+
* - Resolves .. but only within base directory
|
|
113
|
+
* - Strips null bytes (\0) - potential injection
|
|
114
|
+
* - Windows paths with backslashes normalized to forward slashes
|
|
115
|
+
*
|
|
116
|
+
* @security-notes
|
|
117
|
+
* - Use this function BEFORE every file operation with user input
|
|
118
|
+
* - Does NOT check file existence
|
|
119
|
+
* - For maximum security, use with baseDir parameter
|
|
120
|
+
* - Be aware of TOCTOU: file can change between check and use
|
|
121
|
+
*/
|
|
122
|
+
export declare function isPathSafe(pathStr: string, baseDir?: string): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* SECURITY: Comprehensive path validation with detailed results
|
|
125
|
+
*
|
|
126
|
+
* Use this for detailed validation and error reporting.
|
|
127
|
+
* Returns structured result with specific error information.
|
|
128
|
+
*
|
|
129
|
+
* @param pathStr - Path to validate
|
|
130
|
+
* @param options - Validation options
|
|
131
|
+
* @returns Detailed validation result
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* // Validate with full options
|
|
135
|
+
* const result = validatePath(userPath, {
|
|
136
|
+
* base: '/app/uploads',
|
|
137
|
+
* allowRelative: true,
|
|
138
|
+
* allowSymlinks: false,
|
|
139
|
+
* maxLength: 255,
|
|
140
|
+
* });
|
|
141
|
+
*
|
|
142
|
+
* if (!result.valid) {
|
|
143
|
+
* console.error(result.error);
|
|
144
|
+
* // Reject the request
|
|
145
|
+
* }
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* // Check for symlinks and traversal
|
|
149
|
+
* const result = validatePath('../../secret.txt', {
|
|
150
|
+
* base: '/app/data',
|
|
151
|
+
* allowSymlinks: false,
|
|
152
|
+
* });
|
|
153
|
+
* // result.valid === false
|
|
154
|
+
* // result.error mentions directory traversal
|
|
155
|
+
*
|
|
156
|
+
* @edge-cases
|
|
157
|
+
* - Symlink detection requires filesystem access
|
|
158
|
+
* - May be expensive for deeply nested paths
|
|
159
|
+
* - Resolved path is provided even if invalid (for debugging)
|
|
160
|
+
*/
|
|
161
|
+
export declare function validatePath(pathStr: string, options?: PathValidationOptions): PathValidationResult;
|
|
162
|
+
/**
|
|
163
|
+
* SECURITY: Normalizes a path to prevent traversal bypass
|
|
164
|
+
*
|
|
165
|
+
* Removes redundant separators and resolves . and .. patterns.
|
|
166
|
+
* Critical for preventing normalized path bypass attacks.
|
|
167
|
+
*
|
|
168
|
+
* @param pathStr - Path to normalize
|
|
169
|
+
* @returns Normalized path
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* normalizePath('./foo/../bar') // "bar"
|
|
173
|
+
* normalizePath('foo//bar') // "foo/bar"
|
|
174
|
+
* normalizePath('foo/./bar') // "foo/bar"
|
|
175
|
+
* normalizePath('\\foo\\bar') // "foo/bar" (Windows)
|
|
176
|
+
* normalizePath('') // "."
|
|
177
|
+
* normalizePath('/absolute/./path') // "/absolute/path"
|
|
178
|
+
* normalizePath('foo/../../bar') // "../bar"
|
|
179
|
+
*
|
|
180
|
+
* @edge-cases
|
|
181
|
+
* - Normalizes both forward and backslashes (Windows/Unix)
|
|
182
|
+
* - Preserves absolute path status
|
|
183
|
+
* - Collapses .. patterns (may escape if outside boundary)
|
|
184
|
+
* - Use isPathSafe() to prevent escape with .. patterns
|
|
185
|
+
*
|
|
186
|
+
* @security-notes
|
|
187
|
+
* - This ALONE doesn't prevent attacks
|
|
188
|
+
* - Use with isPathSafe() for full protection
|
|
189
|
+
* - Directory traversal requires checking against base dir
|
|
190
|
+
*/
|
|
191
|
+
export declare function normalizePath(pathStr: string): string;
|
|
192
|
+
/**
|
|
193
|
+
* SECURITY: Safely joins path segments with base directory
|
|
194
|
+
*
|
|
195
|
+
* Validates each segment against directory traversal before joining.
|
|
196
|
+
* Preferred over path.join() for security-sensitive code.
|
|
197
|
+
*
|
|
198
|
+
* @param base - Base directory (absolute path)
|
|
199
|
+
* @param ...segments - Path segments to join
|
|
200
|
+
* @returns Safely joined path, or throws if unsafe
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* // SAFE: Returns '/app/uploads/user-file.txt'
|
|
204
|
+
* joinSafe('/app/uploads', 'user-file.txt')
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* // UNSAFE: Throws error
|
|
208
|
+
* try {
|
|
209
|
+
* joinSafe('/app/uploads', '../../etc/passwd')
|
|
210
|
+
* } catch (e) {
|
|
211
|
+
* console.log('Traversal attempt blocked')
|
|
212
|
+
* }
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* // SAFE: Multiple segments
|
|
216
|
+
* joinSafe('/app', 'uploads', 'users', 'file.txt')
|
|
217
|
+
* // -> '/app/uploads/users/file.txt'
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* // UNSAFE: Symlink in path (if allowSymlinks: false)
|
|
221
|
+
* joinSafe('/app', './link-to-escape')
|
|
222
|
+
* // throws if link escapes /app
|
|
223
|
+
*
|
|
224
|
+
* @throws Error if any segment is unsafe for the given base
|
|
225
|
+
*
|
|
226
|
+
* @security-notes
|
|
227
|
+
* - Base directory must be absolute
|
|
228
|
+
* - Each segment is validated independently
|
|
229
|
+
* - Throws on traversal attempts (fail-safe)
|
|
230
|
+
* - Suitable for file server implementations
|
|
231
|
+
*/
|
|
232
|
+
export declare function joinSafe(base: string, ...segments: string[]): string;
|
|
233
|
+
/**
|
|
234
|
+
* SECURITY: Resolves a path safely relative to a base directory
|
|
235
|
+
*
|
|
236
|
+
* Like joinSafe but returns resolved path. Better for cases
|
|
237
|
+
* where the target path must be within base (sandboxing).
|
|
238
|
+
*
|
|
239
|
+
* @param pathStr - Path to resolve
|
|
240
|
+
* @param baseDir - Base directory for restriction
|
|
241
|
+
* @returns Resolved absolute path
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* resolvePath('uploads/file.txt', '/app')
|
|
245
|
+
* // -> '/app/uploads/file.txt'
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* // Throws: attempts escape
|
|
249
|
+
* resolvePath('../../etc/passwd', '/app')
|
|
250
|
+
*
|
|
251
|
+
* @throws Error if path attempts to escape base directory
|
|
252
|
+
*
|
|
253
|
+
* @security-notes
|
|
254
|
+
* - For sandboxing / jail implementations
|
|
255
|
+
* - Always validate user input
|
|
256
|
+
* - Return error, don't expose real paths
|
|
257
|
+
*/
|
|
258
|
+
export declare function resolvePath(pathStr: string, baseDir: string): string;
|
|
259
|
+
/**
|
|
260
|
+
* Returns whether a path is absolute (not relative)
|
|
261
|
+
*
|
|
262
|
+
* Works consistently across Windows and Unix.
|
|
263
|
+
*
|
|
264
|
+
* @param pathStr - Path to check
|
|
265
|
+
* @returns true if absolute, false if relative
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* isAbsolutePath('/home/user') // true
|
|
269
|
+
* isAbsolutePath('C:\\Users\\User') // true (Windows)
|
|
270
|
+
* isAbsolutePath('./relative') // false
|
|
271
|
+
* isAbsolutePath('relative/path') // false
|
|
272
|
+
* isAbsolutePath('') // false
|
|
273
|
+
*
|
|
274
|
+
* @edge-cases
|
|
275
|
+
* - Windows drive letters (C:\) are absolute
|
|
276
|
+
* - UNC paths (\\server\share) are absolute
|
|
277
|
+
* - Relative paths with ./ prefix are still relative
|
|
278
|
+
*/
|
|
279
|
+
export declare function isAbsolutePath(pathStr: string): boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Returns whether a path is relative (not absolute)
|
|
282
|
+
*
|
|
283
|
+
* Inverse of isAbsolutePath.
|
|
284
|
+
*
|
|
285
|
+
* @param pathStr - Path to check
|
|
286
|
+
* @returns true if relative, false if absolute
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* isRelativePath('./file') // true
|
|
290
|
+
* isRelativePath('file.txt') // true
|
|
291
|
+
* isRelativePath('dir/file') // true
|
|
292
|
+
* isRelativePath('/absolute') // false
|
|
293
|
+
* isRelativePath('') // true
|
|
294
|
+
*
|
|
295
|
+
* @edge-cases
|
|
296
|
+
* - Relative paths may escape with .. patterns
|
|
297
|
+
* - Empty string is technically relative
|
|
298
|
+
*/
|
|
299
|
+
export declare function isRelativePath(pathStr: string): boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Extracts the file name from a path (including extension)
|
|
302
|
+
*
|
|
303
|
+
* Safe extraction of filename from path.
|
|
304
|
+
*
|
|
305
|
+
* @param pathStr - Full path
|
|
306
|
+
* @returns File name without directory
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* getFileName('/home/user/file.txt') // "file.txt"
|
|
310
|
+
* getFileName('file.txt') // "file.txt"
|
|
311
|
+
* getFileName('/home/user/') // "" (directory path)
|
|
312
|
+
* getFileName('/home/user/doc.tar.gz') // "doc.tar.gz"
|
|
313
|
+
* getFileName('') // ""
|
|
314
|
+
* getFileName('.gitignore') // ".gitignore"
|
|
315
|
+
*
|
|
316
|
+
* @edge-cases
|
|
317
|
+
* - Returns empty string for directory paths
|
|
318
|
+
* - Preserves multiple extensions
|
|
319
|
+
*/
|
|
320
|
+
export declare function getFileName(pathStr: string): string;
|
|
321
|
+
/**
|
|
322
|
+
* Extracts the directory path without the file name
|
|
323
|
+
*
|
|
324
|
+
* Returns the directory containing the file.
|
|
325
|
+
*
|
|
326
|
+
* @param pathStr - Full path
|
|
327
|
+
* @returns Directory path
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* getDirName('/home/user/file.txt') // "/home/user"
|
|
331
|
+
* getDirName('file.txt') // "." (current directory)
|
|
332
|
+
* getDirName('/home/user/') // "/home/user"
|
|
333
|
+
* getDirName('') // "."
|
|
334
|
+
* getDirName('/') // "/" (root)
|
|
335
|
+
*
|
|
336
|
+
* @edge-cases
|
|
337
|
+
* - Returns "." for relative paths without directory
|
|
338
|
+
* - Trailing slashes are normalized
|
|
339
|
+
*/
|
|
340
|
+
export declare function getDirName(pathStr: string): string;
|
|
341
|
+
/**
|
|
342
|
+
* Extracts the file extension (without the dot)
|
|
343
|
+
*
|
|
344
|
+
* Gets the extension of a file.
|
|
345
|
+
*
|
|
346
|
+
* @param pathStr - File path
|
|
347
|
+
* @returns Extension without dot, or empty string
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* getFileExtension('/home/user/file.txt') // "txt"
|
|
351
|
+
* getFileExtension('archive.tar.gz') // "gz"
|
|
352
|
+
* getFileExtension('file') // ""
|
|
353
|
+
* getFileExtension('.gitignore') // ""
|
|
354
|
+
* getFileExtension('/path/.hidden') // ""
|
|
355
|
+
* getFileExtension('') // ""
|
|
356
|
+
*
|
|
357
|
+
* @edge-cases
|
|
358
|
+
* - Hidden files starting with . don't have extension
|
|
359
|
+
* - Returns only the last extension (use custom parser for .tar.gz)
|
|
360
|
+
* - Case preserved (not lowercased)
|
|
361
|
+
*/
|
|
362
|
+
export declare function getFileExtension(pathStr: string): string;
|
|
363
|
+
/**
|
|
364
|
+
* Gets file name without extension
|
|
365
|
+
*
|
|
366
|
+
* Returns just the base file name.
|
|
367
|
+
*
|
|
368
|
+
* @param pathStr - File path
|
|
369
|
+
* @returns File name without extension
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* getBaseName('/home/user/file.txt') // "file"
|
|
373
|
+
* getBaseName('document.pdf') // "document"
|
|
374
|
+
* getBaseName('archive.tar.gz') // "archive.tar" (only removes last ext)
|
|
375
|
+
* getBaseName('noextension') // "noextension"
|
|
376
|
+
* getBaseName('') // ""
|
|
377
|
+
*
|
|
378
|
+
* @edge-cases
|
|
379
|
+
* - Only removes the last extension
|
|
380
|
+
* - For .tar.gz, returns "archive.tar"
|
|
381
|
+
*/
|
|
382
|
+
export declare function getBaseName(pathStr: string): string;
|
|
383
|
+
/**
|
|
384
|
+
* SECURITY: Compares two paths for equality
|
|
385
|
+
*
|
|
386
|
+
* Safe comparison that handles path variations (normalization, case sensitivity).
|
|
387
|
+
* Important for security checks.
|
|
388
|
+
*
|
|
389
|
+
* @param pathA - First path
|
|
390
|
+
* @param pathB - Second path
|
|
391
|
+
* @param caseSensitive - Case-sensitive comparison (default: true on Unix, false on Windows)
|
|
392
|
+
* @returns true if paths refer to the same location
|
|
393
|
+
*
|
|
394
|
+
* @example
|
|
395
|
+
* comparePaths('/home/user', '/home/user') // true
|
|
396
|
+
* comparePaths('/home/user/', '/home/user') // true (trailing slash removed)
|
|
397
|
+
* comparePaths('./file', 'file') // true (when run from same directory)
|
|
398
|
+
* comparePaths('/HOME/user', '/home/user', false) // true (case-insensitive)
|
|
399
|
+
* comparePaths('/home/user', '/other/path') // false
|
|
400
|
+
*
|
|
401
|
+
* @edge-cases
|
|
402
|
+
* - Normalizes paths before comparison
|
|
403
|
+
* - Case sensitivity depends on filesystem
|
|
404
|
+
* - Relative paths resolved to current directory
|
|
405
|
+
*
|
|
406
|
+
* @security-notes
|
|
407
|
+
* - Use for validating against whitelists
|
|
408
|
+
* - Prevents bypass via path normalization tricks
|
|
409
|
+
*/
|
|
410
|
+
export declare function comparePaths(pathA: string, pathB: string, caseSensitive?: boolean): boolean;
|
|
411
|
+
/**
|
|
412
|
+
* Checks if a path is contained within a base directory
|
|
413
|
+
*
|
|
414
|
+
* Useful for sandboxing and access control.
|
|
415
|
+
*
|
|
416
|
+
* @param pathStr - Path to check
|
|
417
|
+
* @param baseDir - Base directory
|
|
418
|
+
* @returns true if pathStr is within baseDir
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* isPathWithinBase('/home/user/file.txt', '/home/user') // true
|
|
422
|
+
* isPathWithinBase('/home/user/docs/file.txt', '/home/user') // true
|
|
423
|
+
* isPathWithinBase('/home/user', '/home/user/subdir') // false
|
|
424
|
+
* isPathWithinBase('/etc/passwd', '/home/user') // false
|
|
425
|
+
* isPathWithinBase('/home/user/../etc/passwd', '/home/user') // false
|
|
426
|
+
*
|
|
427
|
+
* @edge-cases
|
|
428
|
+
* - Resolves paths before comparison
|
|
429
|
+
* - Trailing slashes ignored
|
|
430
|
+
* - Case-insensitive on Windows
|
|
431
|
+
*
|
|
432
|
+
* @security-notes
|
|
433
|
+
* - Critical for file upload handlers
|
|
434
|
+
* - Prevents directory traversal in validation
|
|
435
|
+
* - Use with normalizePath() for defense in depth
|
|
436
|
+
*/
|
|
437
|
+
export declare function isPathWithinBase(pathStr: string, baseDir: string): boolean;
|
|
438
|
+
/**
|
|
439
|
+
* Detects if a path contains directory traversal patterns
|
|
440
|
+
*
|
|
441
|
+
* Simple pattern-based detection for common attack vectors.
|
|
442
|
+
*
|
|
443
|
+
* @param pathStr - Path to check
|
|
444
|
+
* @returns true if path contains traversal patterns
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
* hasTraversalPattern('../../etc/passwd') // true
|
|
448
|
+
* hasTraversalPattern('file.txt') // false
|
|
449
|
+
* hasTraversalPattern('./file.txt') // false
|
|
450
|
+
* hasTraversalPattern('..\\..\\windows\\system32') // true (Windows)
|
|
451
|
+
* hasTraversalPattern('foo/..') // true
|
|
452
|
+
* hasTraversalPattern('') // false
|
|
453
|
+
*
|
|
454
|
+
* @edge-cases
|
|
455
|
+
* - Detects both / and \ separators
|
|
456
|
+
* - Catches .. patterns anywhere in path
|
|
457
|
+
* - May have false positives (validate with isPathSafe)
|
|
458
|
+
*
|
|
459
|
+
* @security-notes
|
|
460
|
+
* - Use as quick check before detailed validation
|
|
461
|
+
* - Not sufficient alone - use isPathSafe() for security
|
|
462
|
+
*/
|
|
463
|
+
export declare function hasTraversalPattern(pathStr: string): boolean;
|
|
464
|
+
/**
|
|
465
|
+
* Detects if a path contains null bytes (injection attempt)
|
|
466
|
+
*
|
|
467
|
+
* Null bytes can truncate paths in C string libraries.
|
|
468
|
+
* Critical security check for some codebases.
|
|
469
|
+
*
|
|
470
|
+
* @param pathStr - Path to check
|
|
471
|
+
* @returns true if path contains null bytes
|
|
472
|
+
*
|
|
473
|
+
* @example
|
|
474
|
+
* hasNullBytes('file.txt') // false
|
|
475
|
+
* hasNullBytes('file.txt\0.jsp') // true
|
|
476
|
+
* hasNullBytes('') // false
|
|
477
|
+
*
|
|
478
|
+
* @edge-cases
|
|
479
|
+
* - Only relevant for C-based systems
|
|
480
|
+
* - Node.js handles this automatically in most cases
|
|
481
|
+
*/
|
|
482
|
+
export declare function hasNullBytes(pathStr: string): boolean;
|
|
483
|
+
/**
|
|
484
|
+
* Sanitizes a path by removing dangerous characters
|
|
485
|
+
*
|
|
486
|
+
* Removes null bytes, excess whitespace, and potentially problematic characters.
|
|
487
|
+
* Use for defensive programming.
|
|
488
|
+
*
|
|
489
|
+
* @param pathStr - Path to sanitize
|
|
490
|
+
* @returns Sanitized path
|
|
491
|
+
*
|
|
492
|
+
* @example
|
|
493
|
+
* sanitizePath('file.txt') // "file.txt"
|
|
494
|
+
* sanitizePath('file.txt\0.jsp') // "file.txt.jsp"
|
|
495
|
+
* sanitizePath('file name.txt') // "file name.txt"
|
|
496
|
+
* sanitizePath('') // ""
|
|
497
|
+
*
|
|
498
|
+
* @edge-cases
|
|
499
|
+
* - Doesn't validate path, only removes dangerous chars
|
|
500
|
+
* - Use with isPathSafe() for full validation
|
|
501
|
+
*/
|
|
502
|
+
export declare function sanitizePath(pathStr: string): string;
|
|
503
|
+
/**
|
|
504
|
+
* Gets the relative path between two paths
|
|
505
|
+
*
|
|
506
|
+
* Safe version of path.relative with error handling.
|
|
507
|
+
*
|
|
508
|
+
* @param from - Starting path
|
|
509
|
+
* @param to - Target path
|
|
510
|
+
* @returns Relative path from 'from' to 'to'
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* getRelativePath('/home/user', '/home/user/file.txt')
|
|
514
|
+
* // "file.txt"
|
|
515
|
+
*
|
|
516
|
+
* getRelativePath('/home/user/docs', '/home/user/file.txt')
|
|
517
|
+
* // "../file.txt"
|
|
518
|
+
*
|
|
519
|
+
* getRelativePath('/home', '/var')
|
|
520
|
+
* // "../../var"
|
|
521
|
+
*
|
|
522
|
+
* @edge-cases
|
|
523
|
+
* - Empty paths treated as current directory
|
|
524
|
+
* - May produce .. patterns
|
|
525
|
+
*/
|
|
526
|
+
export declare function getRelativePath(from: string, to: string): string;
|
|
527
|
+
/**
|
|
528
|
+
* Configuration for path list operations
|
|
529
|
+
*/
|
|
530
|
+
export interface PathListOptions {
|
|
531
|
+
/** Base directory for validation */
|
|
532
|
+
base?: string;
|
|
533
|
+
/** Filter out unsafe paths (default: true) */
|
|
534
|
+
filterUnsafe?: boolean;
|
|
535
|
+
/** Normalize paths (default: true) */
|
|
536
|
+
normalize?: boolean;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* SECURITY: Validates a list of paths
|
|
540
|
+
*
|
|
541
|
+
* Batch validation useful for multi-file operations.
|
|
542
|
+
*
|
|
543
|
+
* @param paths - Array of paths to validate
|
|
544
|
+
* @param options - Validation options
|
|
545
|
+
* @returns Array of valid paths
|
|
546
|
+
*
|
|
547
|
+
* @example
|
|
548
|
+
* validatePaths(userPaths, {
|
|
549
|
+
* base: '/app/uploads',
|
|
550
|
+
* filterUnsafe: true,
|
|
551
|
+
* })
|
|
552
|
+
*
|
|
553
|
+
* @edge-cases
|
|
554
|
+
* - Filters out duplicates if normalize: true
|
|
555
|
+
* - Returns empty array if no valid paths
|
|
556
|
+
*/
|
|
557
|
+
export declare function validatePaths(paths: string[], options?: PathListOptions): string[];
|
|
558
|
+
/**
|
|
559
|
+
* Creates a pattern to detect path variations
|
|
560
|
+
*
|
|
561
|
+
* Useful for accepting different path formats.
|
|
562
|
+
*
|
|
563
|
+
* @param pathStr - Base path
|
|
564
|
+
* @returns Test function for path equivalence
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* const isSameFile = createPathMatcher('/home/user/file.txt');
|
|
568
|
+
* isSameFile('/home/user/file.txt') // true
|
|
569
|
+
* isSameFile('/home/user//file.txt') // true
|
|
570
|
+
* isSameFile('/home/user/./file.txt') // true
|
|
571
|
+
* isSameFile('~/file.txt') // false (if ~ not expanded)
|
|
572
|
+
*
|
|
573
|
+
* @edge-cases
|
|
574
|
+
* - Doesn't expand ~ (home directory)
|
|
575
|
+
* - Case-sensitive on Unix, insensitive on Windows
|
|
576
|
+
*/
|
|
577
|
+
export declare function createPathMatcher(pathStr: string): (other: string) => boolean;
|
|
578
|
+
/**
|
|
579
|
+
* Checks if a file path looks like a suspicious upload
|
|
580
|
+
*
|
|
581
|
+
* Detects common file upload attack patterns.
|
|
582
|
+
*
|
|
583
|
+
* @param pathStr - File path to check
|
|
584
|
+
* @returns Array of detected issues (empty if safe)
|
|
585
|
+
*
|
|
586
|
+
* @example
|
|
587
|
+
* detectUploadThreats('shell.php.txt') // ['suspicious_extension_combo']
|
|
588
|
+
* detectUploadThreats('../../../etc/passwd') // ['traversal_pattern']
|
|
589
|
+
* detectUploadThreats('file.txt') // []
|
|
590
|
+
* detectUploadThreats('.htaccess') // ['hidden_file']
|
|
591
|
+
*
|
|
592
|
+
* @edge-cases
|
|
593
|
+
* - Uses heuristics, not definitive
|
|
594
|
+
* - May have false positives
|
|
595
|
+
* - Combine with extension whitelisting
|
|
596
|
+
*
|
|
597
|
+
* @security-notes
|
|
598
|
+
* - Use as additional layer, not primary validation
|
|
599
|
+
* - Always validate against whitelist of extensions
|
|
600
|
+
* - Store uploads outside web root
|
|
601
|
+
*/
|
|
602
|
+
export declare function detectUploadThreats(pathStr: string): string[];
|
|
603
|
+
//# sourceMappingURL=path-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-validator.d.ts","sourceRoot":"","sources":["../../src/utils/path-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAKH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM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