@dexto/core 1.5.3 → 1.5.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.
Files changed (143) hide show
  1. package/dist/agent/DextoAgent.cjs +190 -1
  2. package/dist/agent/DextoAgent.d.ts +71 -0
  3. package/dist/agent/DextoAgent.d.ts.map +1 -1
  4. package/dist/agent/DextoAgent.js +181 -1
  5. package/dist/agent/schemas.d.ts +51 -21
  6. package/dist/agent/schemas.d.ts.map +1 -1
  7. package/dist/context/compaction/overflow.cjs +6 -10
  8. package/dist/context/compaction/overflow.d.ts +14 -11
  9. package/dist/context/compaction/overflow.d.ts.map +1 -1
  10. package/dist/context/compaction/overflow.js +6 -10
  11. package/dist/context/compaction/providers/reactive-overflow-provider.cjs +15 -0
  12. package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +15 -0
  13. package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +1 -1
  14. package/dist/context/compaction/providers/reactive-overflow-provider.js +15 -0
  15. package/dist/context/compaction/schemas.cjs +22 -2
  16. package/dist/context/compaction/schemas.d.ts +45 -0
  17. package/dist/context/compaction/schemas.d.ts.map +1 -1
  18. package/dist/context/compaction/schemas.js +22 -2
  19. package/dist/context/compaction/strategies/reactive-overflow.cjs +168 -26
  20. package/dist/context/compaction/strategies/reactive-overflow.d.ts +22 -0
  21. package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -1
  22. package/dist/context/compaction/strategies/reactive-overflow.js +168 -26
  23. package/dist/context/compaction/types.d.ts +13 -1
  24. package/dist/context/compaction/types.d.ts.map +1 -1
  25. package/dist/context/manager.cjs +278 -31
  26. package/dist/context/manager.d.ts +192 -5
  27. package/dist/context/manager.d.ts.map +1 -1
  28. package/dist/context/manager.js +285 -32
  29. package/dist/context/types.d.ts +6 -0
  30. package/dist/context/types.d.ts.map +1 -1
  31. package/dist/context/utils.cjs +77 -11
  32. package/dist/context/utils.d.ts +86 -8
  33. package/dist/context/utils.d.ts.map +1 -1
  34. package/dist/context/utils.js +71 -11
  35. package/dist/errors/types.cjs +0 -2
  36. package/dist/errors/types.d.ts +1 -5
  37. package/dist/errors/types.d.ts.map +1 -1
  38. package/dist/errors/types.js +0 -2
  39. package/dist/events/index.cjs +2 -0
  40. package/dist/events/index.d.ts +21 -6
  41. package/dist/events/index.d.ts.map +1 -1
  42. package/dist/events/index.js +2 -0
  43. package/dist/llm/executor/stream-processor.cjs +104 -28
  44. package/dist/llm/executor/stream-processor.d.ts +7 -0
  45. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  46. package/dist/llm/executor/stream-processor.js +104 -28
  47. package/dist/llm/executor/turn-executor.cjs +147 -30
  48. package/dist/llm/executor/turn-executor.d.ts +28 -10
  49. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  50. package/dist/llm/executor/turn-executor.js +147 -30
  51. package/dist/llm/formatters/vercel.cjs +36 -28
  52. package/dist/llm/formatters/vercel.d.ts.map +1 -1
  53. package/dist/llm/formatters/vercel.js +36 -28
  54. package/dist/llm/services/factory.cjs +3 -2
  55. package/dist/llm/services/factory.d.ts +3 -1
  56. package/dist/llm/services/factory.d.ts.map +1 -1
  57. package/dist/llm/services/factory.js +3 -2
  58. package/dist/llm/services/vercel.cjs +31 -6
  59. package/dist/llm/services/vercel.d.ts +18 -3
  60. package/dist/llm/services/vercel.d.ts.map +1 -1
  61. package/dist/llm/services/vercel.js +31 -6
  62. package/dist/session/chat-session.cjs +29 -13
  63. package/dist/session/chat-session.d.ts +6 -4
  64. package/dist/session/chat-session.d.ts.map +1 -1
  65. package/dist/session/chat-session.js +29 -13
  66. package/dist/session/session-manager.cjs +11 -0
  67. package/dist/session/session-manager.d.ts +7 -0
  68. package/dist/session/session-manager.d.ts.map +1 -1
  69. package/dist/session/session-manager.js +11 -0
  70. package/dist/session/title-generator.cjs +2 -2
  71. package/dist/session/title-generator.js +2 -2
  72. package/dist/systemPrompt/in-built-prompts.cjs +36 -0
  73. package/dist/systemPrompt/in-built-prompts.d.ts +18 -1
  74. package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
  75. package/dist/systemPrompt/in-built-prompts.js +25 -0
  76. package/dist/systemPrompt/manager.cjs +22 -0
  77. package/dist/systemPrompt/manager.d.ts +10 -0
  78. package/dist/systemPrompt/manager.d.ts.map +1 -1
  79. package/dist/systemPrompt/manager.js +22 -0
  80. package/dist/systemPrompt/registry.cjs +2 -1
  81. package/dist/systemPrompt/registry.d.ts +1 -1
  82. package/dist/systemPrompt/registry.d.ts.map +1 -1
  83. package/dist/systemPrompt/registry.js +2 -1
  84. package/dist/systemPrompt/schemas.cjs +7 -0
  85. package/dist/systemPrompt/schemas.d.ts +13 -13
  86. package/dist/systemPrompt/schemas.d.ts.map +1 -1
  87. package/dist/systemPrompt/schemas.js +7 -0
  88. package/dist/telemetry/telemetry.cjs +12 -5
  89. package/dist/telemetry/telemetry.d.ts.map +1 -1
  90. package/dist/telemetry/telemetry.js +12 -5
  91. package/dist/utils/index.cjs +3 -1
  92. package/dist/utils/index.d.ts +1 -0
  93. package/dist/utils/index.d.ts.map +1 -1
  94. package/dist/utils/index.js +1 -0
  95. package/package.json +15 -5
  96. package/dist/filesystem/error-codes.cjs +0 -53
  97. package/dist/filesystem/error-codes.d.ts +0 -31
  98. package/dist/filesystem/error-codes.d.ts.map +0 -1
  99. package/dist/filesystem/error-codes.js +0 -30
  100. package/dist/filesystem/errors.cjs +0 -303
  101. package/dist/filesystem/errors.d.ts +0 -109
  102. package/dist/filesystem/errors.d.ts.map +0 -1
  103. package/dist/filesystem/errors.js +0 -280
  104. package/dist/filesystem/filesystem-service.cjs +0 -534
  105. package/dist/filesystem/filesystem-service.d.ts +0 -97
  106. package/dist/filesystem/filesystem-service.d.ts.map +0 -1
  107. package/dist/filesystem/filesystem-service.js +0 -501
  108. package/dist/filesystem/index.cjs +0 -37
  109. package/dist/filesystem/index.d.ts +0 -11
  110. package/dist/filesystem/index.d.ts.map +0 -1
  111. package/dist/filesystem/index.js +0 -11
  112. package/dist/filesystem/path-validator.cjs +0 -250
  113. package/dist/filesystem/path-validator.d.ts +0 -103
  114. package/dist/filesystem/path-validator.d.ts.map +0 -1
  115. package/dist/filesystem/path-validator.js +0 -217
  116. package/dist/filesystem/types.cjs +0 -16
  117. package/dist/filesystem/types.d.ts +0 -175
  118. package/dist/filesystem/types.d.ts.map +0 -1
  119. package/dist/filesystem/types.js +0 -0
  120. package/dist/process/command-validator.cjs +0 -554
  121. package/dist/process/command-validator.d.ts +0 -49
  122. package/dist/process/command-validator.d.ts.map +0 -1
  123. package/dist/process/command-validator.js +0 -531
  124. package/dist/process/error-codes.cjs +0 -47
  125. package/dist/process/error-codes.d.ts +0 -25
  126. package/dist/process/error-codes.d.ts.map +0 -1
  127. package/dist/process/error-codes.js +0 -24
  128. package/dist/process/errors.cjs +0 -244
  129. package/dist/process/errors.d.ts +0 -87
  130. package/dist/process/errors.d.ts.map +0 -1
  131. package/dist/process/errors.js +0 -221
  132. package/dist/process/index.cjs +0 -37
  133. package/dist/process/index.d.ts +0 -11
  134. package/dist/process/index.d.ts.map +0 -1
  135. package/dist/process/index.js +0 -11
  136. package/dist/process/process-service.cjs +0 -497
  137. package/dist/process/process-service.d.ts +0 -69
  138. package/dist/process/process-service.d.ts.map +0 -1
  139. package/dist/process/process-service.js +0 -464
  140. package/dist/process/types.cjs +0 -16
  141. package/dist/process/types.d.ts +0 -107
  142. package/dist/process/types.d.ts.map +0 -1
  143. package/dist/process/types.js +0 -0
@@ -1,303 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var errors_exports = {};
20
- __export(errors_exports, {
21
- FileSystemError: () => FileSystemError
22
- });
23
- module.exports = __toCommonJS(errors_exports);
24
- var import_errors = require("../errors/index.js");
25
- var import_types = require("../errors/types.js");
26
- var import_error_codes = require("./error-codes.js");
27
- class FileSystemError {
28
- constructor() {
29
- }
30
- /**
31
- * File not found error
32
- */
33
- static fileNotFound(path) {
34
- return new import_errors.DextoRuntimeError(
35
- import_error_codes.FileSystemErrorCode.FILE_NOT_FOUND,
36
- import_types.ErrorScope.FILESYSTEM,
37
- import_types.ErrorType.NOT_FOUND,
38
- `File not found: ${path}`,
39
- { path }
40
- );
41
- }
42
- /**
43
- * Directory not found error
44
- */
45
- static directoryNotFound(path) {
46
- return new import_errors.DextoRuntimeError(
47
- import_error_codes.FileSystemErrorCode.DIRECTORY_NOT_FOUND,
48
- import_types.ErrorScope.FILESYSTEM,
49
- import_types.ErrorType.NOT_FOUND,
50
- `Directory not found: ${path}`,
51
- { path }
52
- );
53
- }
54
- /**
55
- * Permission denied error
56
- */
57
- static permissionDenied(path, operation) {
58
- return new import_errors.DextoRuntimeError(
59
- import_error_codes.FileSystemErrorCode.PERMISSION_DENIED,
60
- import_types.ErrorScope.FILESYSTEM,
61
- import_types.ErrorType.FORBIDDEN,
62
- `Permission denied: cannot ${operation} ${path}`,
63
- { path, operation }
64
- );
65
- }
66
- /**
67
- * Path not allowed error
68
- */
69
- static pathNotAllowed(path, allowedPaths) {
70
- return new import_errors.DextoRuntimeError(
71
- import_error_codes.FileSystemErrorCode.PATH_NOT_ALLOWED,
72
- import_types.ErrorScope.FILESYSTEM,
73
- import_types.ErrorType.USER,
74
- `Path not allowed: ${path}. Must be within allowed paths: ${allowedPaths.join(", ")}`,
75
- { path, allowedPaths },
76
- "Ensure the path is within the configured allowed paths"
77
- );
78
- }
79
- /**
80
- * Path blocked error
81
- */
82
- static pathBlocked(path, reason) {
83
- return new import_errors.DextoRuntimeError(
84
- import_error_codes.FileSystemErrorCode.PATH_BLOCKED,
85
- import_types.ErrorScope.FILESYSTEM,
86
- import_types.ErrorType.FORBIDDEN,
87
- `Path is blocked: ${path}. Reason: ${reason}`,
88
- { path, reason }
89
- );
90
- }
91
- /**
92
- * Invalid path error
93
- */
94
- static invalidPath(path, reason) {
95
- return new import_errors.DextoRuntimeError(
96
- import_error_codes.FileSystemErrorCode.INVALID_PATH,
97
- import_types.ErrorScope.FILESYSTEM,
98
- import_types.ErrorType.USER,
99
- `Invalid path: ${path}. ${reason}`,
100
- { path, reason }
101
- );
102
- }
103
- /**
104
- * Path traversal detected
105
- */
106
- static pathTraversal(path) {
107
- return new import_errors.DextoRuntimeError(
108
- import_error_codes.FileSystemErrorCode.PATH_TRAVERSAL_DETECTED,
109
- import_types.ErrorScope.FILESYSTEM,
110
- import_types.ErrorType.FORBIDDEN,
111
- `Path traversal detected in: ${path}`,
112
- { path }
113
- );
114
- }
115
- /**
116
- * Invalid file extension error
117
- */
118
- static invalidExtension(path, blockedExtensions) {
119
- return new import_errors.DextoRuntimeError(
120
- import_error_codes.FileSystemErrorCode.INVALID_FILE_EXTENSION,
121
- import_types.ErrorScope.FILESYSTEM,
122
- import_types.ErrorType.USER,
123
- `Invalid file extension: ${path}. Blocked extensions: ${blockedExtensions.join(", ")}`,
124
- { path, blockedExtensions }
125
- );
126
- }
127
- /**
128
- * File too large error
129
- */
130
- static fileTooLarge(path, size, maxSize) {
131
- return new import_errors.DextoRuntimeError(
132
- import_error_codes.FileSystemErrorCode.FILE_TOO_LARGE,
133
- import_types.ErrorScope.FILESYSTEM,
134
- import_types.ErrorType.USER,
135
- `File too large: ${path} (${size} bytes). Maximum allowed: ${maxSize} bytes`,
136
- { path, size, maxSize }
137
- );
138
- }
139
- /**
140
- * Too many results error
141
- */
142
- static tooManyResults(operation, count, maxResults) {
143
- return new import_errors.DextoRuntimeError(
144
- import_error_codes.FileSystemErrorCode.TOO_MANY_RESULTS,
145
- import_types.ErrorScope.FILESYSTEM,
146
- import_types.ErrorType.USER,
147
- `Too many results from ${operation}: ${count}. Maximum allowed: ${maxResults}`,
148
- { operation, count, maxResults },
149
- "Narrow your search pattern or increase maxResults limit"
150
- );
151
- }
152
- /**
153
- * Read operation failed
154
- */
155
- static readFailed(path, cause) {
156
- return new import_errors.DextoRuntimeError(
157
- import_error_codes.FileSystemErrorCode.READ_FAILED,
158
- import_types.ErrorScope.FILESYSTEM,
159
- import_types.ErrorType.SYSTEM,
160
- `Failed to read file: ${path}. ${cause}`,
161
- { path, cause }
162
- );
163
- }
164
- /**
165
- * Write operation failed
166
- */
167
- static writeFailed(path, cause) {
168
- return new import_errors.DextoRuntimeError(
169
- import_error_codes.FileSystemErrorCode.WRITE_FAILED,
170
- import_types.ErrorScope.FILESYSTEM,
171
- import_types.ErrorType.SYSTEM,
172
- `Failed to write file: ${path}. ${cause}`,
173
- { path, cause }
174
- );
175
- }
176
- /**
177
- * Backup creation failed
178
- */
179
- static backupFailed(path, cause) {
180
- return new import_errors.DextoRuntimeError(
181
- import_error_codes.FileSystemErrorCode.BACKUP_FAILED,
182
- import_types.ErrorScope.FILESYSTEM,
183
- import_types.ErrorType.SYSTEM,
184
- `Failed to create backup for: ${path}. ${cause}`,
185
- { path, cause }
186
- );
187
- }
188
- /**
189
- * Edit operation failed
190
- */
191
- static editFailed(path, cause) {
192
- return new import_errors.DextoRuntimeError(
193
- import_error_codes.FileSystemErrorCode.EDIT_FAILED,
194
- import_types.ErrorScope.FILESYSTEM,
195
- import_types.ErrorType.SYSTEM,
196
- `Failed to edit file: ${path}. ${cause}`,
197
- { path, cause }
198
- );
199
- }
200
- /**
201
- * String not unique error
202
- */
203
- static stringNotUnique(path, searchString, occurrences) {
204
- return new import_errors.DextoRuntimeError(
205
- import_error_codes.FileSystemErrorCode.STRING_NOT_UNIQUE,
206
- import_types.ErrorScope.FILESYSTEM,
207
- import_types.ErrorType.USER,
208
- `String is not unique in ${path}: "${searchString}" found ${occurrences} times. Use replaceAll=true or provide a more specific string.`,
209
- { path, searchString, occurrences },
210
- "Use replaceAll option or provide more context in the search string"
211
- );
212
- }
213
- /**
214
- * String not found error
215
- */
216
- static stringNotFound(path, searchString) {
217
- return new import_errors.DextoRuntimeError(
218
- import_error_codes.FileSystemErrorCode.STRING_NOT_FOUND,
219
- import_types.ErrorScope.FILESYSTEM,
220
- import_types.ErrorType.USER,
221
- `String not found in ${path}: "${searchString}"`,
222
- { path, searchString }
223
- );
224
- }
225
- /**
226
- * Glob operation failed
227
- */
228
- static globFailed(pattern, cause) {
229
- return new import_errors.DextoRuntimeError(
230
- import_error_codes.FileSystemErrorCode.GLOB_FAILED,
231
- import_types.ErrorScope.FILESYSTEM,
232
- import_types.ErrorType.SYSTEM,
233
- `Glob operation failed for pattern: ${pattern}. ${cause}`,
234
- { pattern, cause }
235
- );
236
- }
237
- /**
238
- * Search operation failed
239
- */
240
- static searchFailed(pattern, cause) {
241
- return new import_errors.DextoRuntimeError(
242
- import_error_codes.FileSystemErrorCode.SEARCH_FAILED,
243
- import_types.ErrorScope.FILESYSTEM,
244
- import_types.ErrorType.SYSTEM,
245
- `Search operation failed for pattern: ${pattern}. ${cause}`,
246
- { pattern, cause }
247
- );
248
- }
249
- /**
250
- * Invalid pattern error
251
- */
252
- static invalidPattern(pattern, cause) {
253
- return new import_errors.DextoRuntimeError(
254
- import_error_codes.FileSystemErrorCode.INVALID_PATTERN,
255
- import_types.ErrorScope.FILESYSTEM,
256
- import_types.ErrorType.USER,
257
- `Invalid pattern: ${pattern}. ${cause}`,
258
- { pattern, cause }
259
- );
260
- }
261
- /**
262
- * Regex timeout error
263
- */
264
- static regexTimeout(pattern) {
265
- return new import_errors.DextoRuntimeError(
266
- import_error_codes.FileSystemErrorCode.REGEX_TIMEOUT,
267
- import_types.ErrorScope.FILESYSTEM,
268
- import_types.ErrorType.TIMEOUT,
269
- `Regex operation timed out for pattern: ${pattern}`,
270
- { pattern },
271
- "Simplify your regex pattern or increase timeout"
272
- );
273
- }
274
- /**
275
- * Invalid configuration error
276
- */
277
- static invalidConfig(reason) {
278
- return new import_errors.DextoRuntimeError(
279
- import_error_codes.FileSystemErrorCode.INVALID_CONFIG,
280
- import_types.ErrorScope.FILESYSTEM,
281
- import_types.ErrorType.USER,
282
- `Invalid FileSystem configuration: ${reason}`,
283
- { reason }
284
- );
285
- }
286
- /**
287
- * Service not initialized error
288
- */
289
- static notInitialized() {
290
- return new import_errors.DextoRuntimeError(
291
- import_error_codes.FileSystemErrorCode.SERVICE_NOT_INITIALIZED,
292
- import_types.ErrorScope.FILESYSTEM,
293
- import_types.ErrorType.SYSTEM,
294
- "FileSystemService has not been initialized",
295
- {},
296
- "Initialize the FileSystemService before using it"
297
- );
298
- }
299
- }
300
- // Annotate the CommonJS export names for ESM import in node:
301
- 0 && (module.exports = {
302
- FileSystemError
303
- });
@@ -1,109 +0,0 @@
1
- /**
2
- * FileSystem Service Errors
3
- *
4
- * Error classes for file system operations
5
- */
6
- import { DextoRuntimeError } from '../errors/index.js';
7
- export interface FileSystemErrorContext {
8
- path?: string;
9
- pattern?: string;
10
- size?: number;
11
- maxSize?: number;
12
- encoding?: string;
13
- operation?: string;
14
- }
15
- /**
16
- * Factory class for creating FileSystem-related errors
17
- */
18
- export declare class FileSystemError {
19
- private constructor();
20
- /**
21
- * File not found error
22
- */
23
- static fileNotFound(path: string): DextoRuntimeError;
24
- /**
25
- * Directory not found error
26
- */
27
- static directoryNotFound(path: string): DextoRuntimeError;
28
- /**
29
- * Permission denied error
30
- */
31
- static permissionDenied(path: string, operation: string): DextoRuntimeError;
32
- /**
33
- * Path not allowed error
34
- */
35
- static pathNotAllowed(path: string, allowedPaths: string[]): DextoRuntimeError;
36
- /**
37
- * Path blocked error
38
- */
39
- static pathBlocked(path: string, reason: string): DextoRuntimeError;
40
- /**
41
- * Invalid path error
42
- */
43
- static invalidPath(path: string, reason: string): DextoRuntimeError;
44
- /**
45
- * Path traversal detected
46
- */
47
- static pathTraversal(path: string): DextoRuntimeError;
48
- /**
49
- * Invalid file extension error
50
- */
51
- static invalidExtension(path: string, blockedExtensions: string[]): DextoRuntimeError;
52
- /**
53
- * File too large error
54
- */
55
- static fileTooLarge(path: string, size: number, maxSize: number): DextoRuntimeError;
56
- /**
57
- * Too many results error
58
- */
59
- static tooManyResults(operation: string, count: number, maxResults: number): DextoRuntimeError;
60
- /**
61
- * Read operation failed
62
- */
63
- static readFailed(path: string, cause: string): DextoRuntimeError;
64
- /**
65
- * Write operation failed
66
- */
67
- static writeFailed(path: string, cause: string): DextoRuntimeError;
68
- /**
69
- * Backup creation failed
70
- */
71
- static backupFailed(path: string, cause: string): DextoRuntimeError;
72
- /**
73
- * Edit operation failed
74
- */
75
- static editFailed(path: string, cause: string): DextoRuntimeError;
76
- /**
77
- * String not unique error
78
- */
79
- static stringNotUnique(path: string, searchString: string, occurrences: number): DextoRuntimeError;
80
- /**
81
- * String not found error
82
- */
83
- static stringNotFound(path: string, searchString: string): DextoRuntimeError;
84
- /**
85
- * Glob operation failed
86
- */
87
- static globFailed(pattern: string, cause: string): DextoRuntimeError;
88
- /**
89
- * Search operation failed
90
- */
91
- static searchFailed(pattern: string, cause: string): DextoRuntimeError;
92
- /**
93
- * Invalid pattern error
94
- */
95
- static invalidPattern(pattern: string, cause: string): DextoRuntimeError;
96
- /**
97
- * Regex timeout error
98
- */
99
- static regexTimeout(pattern: string): DextoRuntimeError;
100
- /**
101
- * Invalid configuration error
102
- */
103
- static invalidConfig(reason: string): DextoRuntimeError;
104
- /**
105
- * Service not initialized error
106
- */
107
- static notInitialized(): DextoRuntimeError;
108
- }
109
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/filesystem/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;IACH,MAAM,CAAC,cAAc,IAAI,iBAAiB;CAU7C"}
@@ -1,280 +0,0 @@
1
- import "../chunk-PTJYTZNU.js";
2
- import { DextoRuntimeError } from "../errors/index.js";
3
- import { ErrorScope, ErrorType } from "../errors/types.js";
4
- import { FileSystemErrorCode } from "./error-codes.js";
5
- class FileSystemError {
6
- constructor() {
7
- }
8
- /**
9
- * File not found error
10
- */
11
- static fileNotFound(path) {
12
- return new DextoRuntimeError(
13
- FileSystemErrorCode.FILE_NOT_FOUND,
14
- ErrorScope.FILESYSTEM,
15
- ErrorType.NOT_FOUND,
16
- `File not found: ${path}`,
17
- { path }
18
- );
19
- }
20
- /**
21
- * Directory not found error
22
- */
23
- static directoryNotFound(path) {
24
- return new DextoRuntimeError(
25
- FileSystemErrorCode.DIRECTORY_NOT_FOUND,
26
- ErrorScope.FILESYSTEM,
27
- ErrorType.NOT_FOUND,
28
- `Directory not found: ${path}`,
29
- { path }
30
- );
31
- }
32
- /**
33
- * Permission denied error
34
- */
35
- static permissionDenied(path, operation) {
36
- return new DextoRuntimeError(
37
- FileSystemErrorCode.PERMISSION_DENIED,
38
- ErrorScope.FILESYSTEM,
39
- ErrorType.FORBIDDEN,
40
- `Permission denied: cannot ${operation} ${path}`,
41
- { path, operation }
42
- );
43
- }
44
- /**
45
- * Path not allowed error
46
- */
47
- static pathNotAllowed(path, allowedPaths) {
48
- return new DextoRuntimeError(
49
- FileSystemErrorCode.PATH_NOT_ALLOWED,
50
- ErrorScope.FILESYSTEM,
51
- ErrorType.USER,
52
- `Path not allowed: ${path}. Must be within allowed paths: ${allowedPaths.join(", ")}`,
53
- { path, allowedPaths },
54
- "Ensure the path is within the configured allowed paths"
55
- );
56
- }
57
- /**
58
- * Path blocked error
59
- */
60
- static pathBlocked(path, reason) {
61
- return new DextoRuntimeError(
62
- FileSystemErrorCode.PATH_BLOCKED,
63
- ErrorScope.FILESYSTEM,
64
- ErrorType.FORBIDDEN,
65
- `Path is blocked: ${path}. Reason: ${reason}`,
66
- { path, reason }
67
- );
68
- }
69
- /**
70
- * Invalid path error
71
- */
72
- static invalidPath(path, reason) {
73
- return new DextoRuntimeError(
74
- FileSystemErrorCode.INVALID_PATH,
75
- ErrorScope.FILESYSTEM,
76
- ErrorType.USER,
77
- `Invalid path: ${path}. ${reason}`,
78
- { path, reason }
79
- );
80
- }
81
- /**
82
- * Path traversal detected
83
- */
84
- static pathTraversal(path) {
85
- return new DextoRuntimeError(
86
- FileSystemErrorCode.PATH_TRAVERSAL_DETECTED,
87
- ErrorScope.FILESYSTEM,
88
- ErrorType.FORBIDDEN,
89
- `Path traversal detected in: ${path}`,
90
- { path }
91
- );
92
- }
93
- /**
94
- * Invalid file extension error
95
- */
96
- static invalidExtension(path, blockedExtensions) {
97
- return new DextoRuntimeError(
98
- FileSystemErrorCode.INVALID_FILE_EXTENSION,
99
- ErrorScope.FILESYSTEM,
100
- ErrorType.USER,
101
- `Invalid file extension: ${path}. Blocked extensions: ${blockedExtensions.join(", ")}`,
102
- { path, blockedExtensions }
103
- );
104
- }
105
- /**
106
- * File too large error
107
- */
108
- static fileTooLarge(path, size, maxSize) {
109
- return new DextoRuntimeError(
110
- FileSystemErrorCode.FILE_TOO_LARGE,
111
- ErrorScope.FILESYSTEM,
112
- ErrorType.USER,
113
- `File too large: ${path} (${size} bytes). Maximum allowed: ${maxSize} bytes`,
114
- { path, size, maxSize }
115
- );
116
- }
117
- /**
118
- * Too many results error
119
- */
120
- static tooManyResults(operation, count, maxResults) {
121
- return new DextoRuntimeError(
122
- FileSystemErrorCode.TOO_MANY_RESULTS,
123
- ErrorScope.FILESYSTEM,
124
- ErrorType.USER,
125
- `Too many results from ${operation}: ${count}. Maximum allowed: ${maxResults}`,
126
- { operation, count, maxResults },
127
- "Narrow your search pattern or increase maxResults limit"
128
- );
129
- }
130
- /**
131
- * Read operation failed
132
- */
133
- static readFailed(path, cause) {
134
- return new DextoRuntimeError(
135
- FileSystemErrorCode.READ_FAILED,
136
- ErrorScope.FILESYSTEM,
137
- ErrorType.SYSTEM,
138
- `Failed to read file: ${path}. ${cause}`,
139
- { path, cause }
140
- );
141
- }
142
- /**
143
- * Write operation failed
144
- */
145
- static writeFailed(path, cause) {
146
- return new DextoRuntimeError(
147
- FileSystemErrorCode.WRITE_FAILED,
148
- ErrorScope.FILESYSTEM,
149
- ErrorType.SYSTEM,
150
- `Failed to write file: ${path}. ${cause}`,
151
- { path, cause }
152
- );
153
- }
154
- /**
155
- * Backup creation failed
156
- */
157
- static backupFailed(path, cause) {
158
- return new DextoRuntimeError(
159
- FileSystemErrorCode.BACKUP_FAILED,
160
- ErrorScope.FILESYSTEM,
161
- ErrorType.SYSTEM,
162
- `Failed to create backup for: ${path}. ${cause}`,
163
- { path, cause }
164
- );
165
- }
166
- /**
167
- * Edit operation failed
168
- */
169
- static editFailed(path, cause) {
170
- return new DextoRuntimeError(
171
- FileSystemErrorCode.EDIT_FAILED,
172
- ErrorScope.FILESYSTEM,
173
- ErrorType.SYSTEM,
174
- `Failed to edit file: ${path}. ${cause}`,
175
- { path, cause }
176
- );
177
- }
178
- /**
179
- * String not unique error
180
- */
181
- static stringNotUnique(path, searchString, occurrences) {
182
- return new DextoRuntimeError(
183
- FileSystemErrorCode.STRING_NOT_UNIQUE,
184
- ErrorScope.FILESYSTEM,
185
- ErrorType.USER,
186
- `String is not unique in ${path}: "${searchString}" found ${occurrences} times. Use replaceAll=true or provide a more specific string.`,
187
- { path, searchString, occurrences },
188
- "Use replaceAll option or provide more context in the search string"
189
- );
190
- }
191
- /**
192
- * String not found error
193
- */
194
- static stringNotFound(path, searchString) {
195
- return new DextoRuntimeError(
196
- FileSystemErrorCode.STRING_NOT_FOUND,
197
- ErrorScope.FILESYSTEM,
198
- ErrorType.USER,
199
- `String not found in ${path}: "${searchString}"`,
200
- { path, searchString }
201
- );
202
- }
203
- /**
204
- * Glob operation failed
205
- */
206
- static globFailed(pattern, cause) {
207
- return new DextoRuntimeError(
208
- FileSystemErrorCode.GLOB_FAILED,
209
- ErrorScope.FILESYSTEM,
210
- ErrorType.SYSTEM,
211
- `Glob operation failed for pattern: ${pattern}. ${cause}`,
212
- { pattern, cause }
213
- );
214
- }
215
- /**
216
- * Search operation failed
217
- */
218
- static searchFailed(pattern, cause) {
219
- return new DextoRuntimeError(
220
- FileSystemErrorCode.SEARCH_FAILED,
221
- ErrorScope.FILESYSTEM,
222
- ErrorType.SYSTEM,
223
- `Search operation failed for pattern: ${pattern}. ${cause}`,
224
- { pattern, cause }
225
- );
226
- }
227
- /**
228
- * Invalid pattern error
229
- */
230
- static invalidPattern(pattern, cause) {
231
- return new DextoRuntimeError(
232
- FileSystemErrorCode.INVALID_PATTERN,
233
- ErrorScope.FILESYSTEM,
234
- ErrorType.USER,
235
- `Invalid pattern: ${pattern}. ${cause}`,
236
- { pattern, cause }
237
- );
238
- }
239
- /**
240
- * Regex timeout error
241
- */
242
- static regexTimeout(pattern) {
243
- return new DextoRuntimeError(
244
- FileSystemErrorCode.REGEX_TIMEOUT,
245
- ErrorScope.FILESYSTEM,
246
- ErrorType.TIMEOUT,
247
- `Regex operation timed out for pattern: ${pattern}`,
248
- { pattern },
249
- "Simplify your regex pattern or increase timeout"
250
- );
251
- }
252
- /**
253
- * Invalid configuration error
254
- */
255
- static invalidConfig(reason) {
256
- return new DextoRuntimeError(
257
- FileSystemErrorCode.INVALID_CONFIG,
258
- ErrorScope.FILESYSTEM,
259
- ErrorType.USER,
260
- `Invalid FileSystem configuration: ${reason}`,
261
- { reason }
262
- );
263
- }
264
- /**
265
- * Service not initialized error
266
- */
267
- static notInitialized() {
268
- return new DextoRuntimeError(
269
- FileSystemErrorCode.SERVICE_NOT_INITIALIZED,
270
- ErrorScope.FILESYSTEM,
271
- ErrorType.SYSTEM,
272
- "FileSystemService has not been initialized",
273
- {},
274
- "Initialize the FileSystemService before using it"
275
- );
276
- }
277
- }
278
- export {
279
- FileSystemError
280
- };