@dexto/core 1.5.4 → 1.5.6
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/agent/DextoAgent.cjs +61 -155
- package/dist/agent/DextoAgent.d.ts +11 -54
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +61 -155
- package/dist/context/compaction/strategies/reactive-overflow.cjs +5 -3
- package/dist/context/compaction/strategies/reactive-overflow.d.ts +1 -0
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -1
- package/dist/context/compaction/strategies/reactive-overflow.js +5 -3
- package/dist/context/compaction/types.d.ts +13 -1
- package/dist/context/compaction/types.d.ts.map +1 -1
- package/dist/errors/types.cjs +0 -2
- package/dist/errors/types.d.ts +1 -5
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/errors/types.js +0 -2
- package/dist/events/index.cjs +0 -2
- package/dist/events/index.d.ts +6 -25
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +0 -2
- package/dist/llm/executor/stream-processor.cjs +85 -27
- package/dist/llm/executor/stream-processor.d.ts +4 -0
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +85 -27
- package/dist/llm/executor/turn-executor.cjs +58 -130
- package/dist/llm/executor/turn-executor.d.ts +9 -43
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +58 -130
- package/dist/llm/executor/types.d.ts +0 -28
- package/dist/llm/executor/types.d.ts.map +1 -1
- package/dist/llm/services/vercel.cjs +2 -5
- package/dist/llm/services/vercel.d.ts +1 -6
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +2 -5
- package/dist/logger/logger.cjs +6 -7
- package/dist/logger/logger.d.ts +1 -0
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +6 -7
- package/dist/session/chat-session.cjs +19 -12
- package/dist/session/chat-session.d.ts +3 -6
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +19 -12
- package/dist/session/session-manager.cjs +0 -135
- package/dist/session/session-manager.d.ts +0 -43
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +0 -135
- package/dist/telemetry/telemetry.cjs +12 -5
- package/dist/telemetry/telemetry.d.ts.map +1 -1
- package/dist/telemetry/telemetry.js +12 -5
- package/dist/tools/schemas.cjs +2 -2
- package/dist/tools/schemas.js +2 -2
- package/package.json +15 -5
- package/dist/filesystem/error-codes.cjs +0 -53
- package/dist/filesystem/error-codes.d.ts +0 -31
- package/dist/filesystem/error-codes.d.ts.map +0 -1
- package/dist/filesystem/error-codes.js +0 -30
- package/dist/filesystem/errors.cjs +0 -303
- package/dist/filesystem/errors.d.ts +0 -109
- package/dist/filesystem/errors.d.ts.map +0 -1
- package/dist/filesystem/errors.js +0 -280
- package/dist/filesystem/filesystem-service.cjs +0 -534
- package/dist/filesystem/filesystem-service.d.ts +0 -97
- package/dist/filesystem/filesystem-service.d.ts.map +0 -1
- package/dist/filesystem/filesystem-service.js +0 -501
- package/dist/filesystem/index.cjs +0 -37
- package/dist/filesystem/index.d.ts +0 -11
- package/dist/filesystem/index.d.ts.map +0 -1
- package/dist/filesystem/index.js +0 -11
- package/dist/filesystem/path-validator.cjs +0 -250
- package/dist/filesystem/path-validator.d.ts +0 -103
- package/dist/filesystem/path-validator.d.ts.map +0 -1
- package/dist/filesystem/path-validator.js +0 -217
- package/dist/filesystem/types.cjs +0 -16
- package/dist/filesystem/types.d.ts +0 -175
- package/dist/filesystem/types.d.ts.map +0 -1
- package/dist/filesystem/types.js +0 -0
- package/dist/process/command-validator.cjs +0 -554
- package/dist/process/command-validator.d.ts +0 -49
- package/dist/process/command-validator.d.ts.map +0 -1
- package/dist/process/command-validator.js +0 -531
- package/dist/process/error-codes.cjs +0 -47
- package/dist/process/error-codes.d.ts +0 -25
- package/dist/process/error-codes.d.ts.map +0 -1
- package/dist/process/error-codes.js +0 -24
- package/dist/process/errors.cjs +0 -244
- package/dist/process/errors.d.ts +0 -87
- package/dist/process/errors.d.ts.map +0 -1
- package/dist/process/errors.js +0 -221
- package/dist/process/index.cjs +0 -37
- package/dist/process/index.d.ts +0 -11
- package/dist/process/index.d.ts.map +0 -1
- package/dist/process/index.js +0 -11
- package/dist/process/process-service.cjs +0 -497
- package/dist/process/process-service.d.ts +0 -69
- package/dist/process/process-service.d.ts.map +0 -1
- package/dist/process/process-service.js +0 -464
- package/dist/process/types.cjs +0 -16
- package/dist/process/types.d.ts +0 -107
- package/dist/process/types.d.ts.map +0 -1
- package/dist/process/types.js +0 -0
- package/dist/session/compaction-service.cjs +0 -139
- package/dist/session/compaction-service.d.ts +0 -81
- package/dist/session/compaction-service.d.ts.map +0 -1
- package/dist/session/compaction-service.js +0 -106
|
@@ -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
|
-
};
|