@dexto/core 1.5.4 → 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.
- 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/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/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,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FileSystem Service Error Codes
|
|
3
|
-
*
|
|
4
|
-
* Standardized error codes for file system operations
|
|
5
|
-
*/
|
|
6
|
-
export declare enum FileSystemErrorCode {
|
|
7
|
-
FILE_NOT_FOUND = "FILESYSTEM_FILE_NOT_FOUND",
|
|
8
|
-
DIRECTORY_NOT_FOUND = "FILESYSTEM_DIRECTORY_NOT_FOUND",
|
|
9
|
-
PERMISSION_DENIED = "FILESYSTEM_PERMISSION_DENIED",
|
|
10
|
-
PATH_NOT_ALLOWED = "FILESYSTEM_PATH_NOT_ALLOWED",
|
|
11
|
-
PATH_BLOCKED = "FILESYSTEM_PATH_BLOCKED",
|
|
12
|
-
INVALID_PATH = "FILESYSTEM_INVALID_PATH",
|
|
13
|
-
PATH_TRAVERSAL_DETECTED = "FILESYSTEM_PATH_TRAVERSAL_DETECTED",
|
|
14
|
-
INVALID_FILE_EXTENSION = "FILESYSTEM_INVALID_FILE_EXTENSION",
|
|
15
|
-
INVALID_ENCODING = "FILESYSTEM_INVALID_ENCODING",
|
|
16
|
-
FILE_TOO_LARGE = "FILESYSTEM_FILE_TOO_LARGE",
|
|
17
|
-
TOO_MANY_RESULTS = "FILESYSTEM_TOO_MANY_RESULTS",
|
|
18
|
-
READ_FAILED = "FILESYSTEM_READ_FAILED",
|
|
19
|
-
WRITE_FAILED = "FILESYSTEM_WRITE_FAILED",
|
|
20
|
-
BACKUP_FAILED = "FILESYSTEM_BACKUP_FAILED",
|
|
21
|
-
EDIT_FAILED = "FILESYSTEM_EDIT_FAILED",
|
|
22
|
-
STRING_NOT_UNIQUE = "FILESYSTEM_STRING_NOT_UNIQUE",
|
|
23
|
-
STRING_NOT_FOUND = "FILESYSTEM_STRING_NOT_FOUND",
|
|
24
|
-
GLOB_FAILED = "FILESYSTEM_GLOB_FAILED",
|
|
25
|
-
SEARCH_FAILED = "FILESYSTEM_SEARCH_FAILED",
|
|
26
|
-
INVALID_PATTERN = "FILESYSTEM_INVALID_PATTERN",
|
|
27
|
-
REGEX_TIMEOUT = "FILESYSTEM_REGEX_TIMEOUT",
|
|
28
|
-
INVALID_CONFIG = "FILESYSTEM_INVALID_CONFIG",
|
|
29
|
-
SERVICE_NOT_INITIALIZED = "FILESYSTEM_SERVICE_NOT_INITIALIZED"
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/filesystem/error-codes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oBAAY,mBAAmB;IAE3B,cAAc,8BAA8B;IAC5C,mBAAmB,mCAAmC;IAGtD,iBAAiB,iCAAiC;IAClD,gBAAgB,gCAAgC;IAChD,YAAY,4BAA4B;IAGxC,YAAY,4BAA4B;IACxC,uBAAuB,uCAAuC;IAC9D,sBAAsB,sCAAsC;IAC5D,gBAAgB,gCAAgC;IAGhD,cAAc,8BAA8B;IAC5C,gBAAgB,gCAAgC;IAGhD,WAAW,2BAA2B;IACtC,YAAY,4BAA4B;IACxC,aAAa,6BAA6B;IAC1C,WAAW,2BAA2B;IACtC,iBAAiB,iCAAiC;IAClD,gBAAgB,gCAAgC;IAGhD,WAAW,2BAA2B;IACtC,aAAa,6BAA6B;IAC1C,eAAe,+BAA+B;IAC9C,aAAa,6BAA6B;IAG1C,cAAc,8BAA8B;IAC5C,uBAAuB,uCAAuC;CACjE"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import "../chunk-PTJYTZNU.js";
|
|
2
|
-
var FileSystemErrorCode = /* @__PURE__ */ ((FileSystemErrorCode2) => {
|
|
3
|
-
FileSystemErrorCode2["FILE_NOT_FOUND"] = "FILESYSTEM_FILE_NOT_FOUND";
|
|
4
|
-
FileSystemErrorCode2["DIRECTORY_NOT_FOUND"] = "FILESYSTEM_DIRECTORY_NOT_FOUND";
|
|
5
|
-
FileSystemErrorCode2["PERMISSION_DENIED"] = "FILESYSTEM_PERMISSION_DENIED";
|
|
6
|
-
FileSystemErrorCode2["PATH_NOT_ALLOWED"] = "FILESYSTEM_PATH_NOT_ALLOWED";
|
|
7
|
-
FileSystemErrorCode2["PATH_BLOCKED"] = "FILESYSTEM_PATH_BLOCKED";
|
|
8
|
-
FileSystemErrorCode2["INVALID_PATH"] = "FILESYSTEM_INVALID_PATH";
|
|
9
|
-
FileSystemErrorCode2["PATH_TRAVERSAL_DETECTED"] = "FILESYSTEM_PATH_TRAVERSAL_DETECTED";
|
|
10
|
-
FileSystemErrorCode2["INVALID_FILE_EXTENSION"] = "FILESYSTEM_INVALID_FILE_EXTENSION";
|
|
11
|
-
FileSystemErrorCode2["INVALID_ENCODING"] = "FILESYSTEM_INVALID_ENCODING";
|
|
12
|
-
FileSystemErrorCode2["FILE_TOO_LARGE"] = "FILESYSTEM_FILE_TOO_LARGE";
|
|
13
|
-
FileSystemErrorCode2["TOO_MANY_RESULTS"] = "FILESYSTEM_TOO_MANY_RESULTS";
|
|
14
|
-
FileSystemErrorCode2["READ_FAILED"] = "FILESYSTEM_READ_FAILED";
|
|
15
|
-
FileSystemErrorCode2["WRITE_FAILED"] = "FILESYSTEM_WRITE_FAILED";
|
|
16
|
-
FileSystemErrorCode2["BACKUP_FAILED"] = "FILESYSTEM_BACKUP_FAILED";
|
|
17
|
-
FileSystemErrorCode2["EDIT_FAILED"] = "FILESYSTEM_EDIT_FAILED";
|
|
18
|
-
FileSystemErrorCode2["STRING_NOT_UNIQUE"] = "FILESYSTEM_STRING_NOT_UNIQUE";
|
|
19
|
-
FileSystemErrorCode2["STRING_NOT_FOUND"] = "FILESYSTEM_STRING_NOT_FOUND";
|
|
20
|
-
FileSystemErrorCode2["GLOB_FAILED"] = "FILESYSTEM_GLOB_FAILED";
|
|
21
|
-
FileSystemErrorCode2["SEARCH_FAILED"] = "FILESYSTEM_SEARCH_FAILED";
|
|
22
|
-
FileSystemErrorCode2["INVALID_PATTERN"] = "FILESYSTEM_INVALID_PATTERN";
|
|
23
|
-
FileSystemErrorCode2["REGEX_TIMEOUT"] = "FILESYSTEM_REGEX_TIMEOUT";
|
|
24
|
-
FileSystemErrorCode2["INVALID_CONFIG"] = "FILESYSTEM_INVALID_CONFIG";
|
|
25
|
-
FileSystemErrorCode2["SERVICE_NOT_INITIALIZED"] = "FILESYSTEM_SERVICE_NOT_INITIALIZED";
|
|
26
|
-
return FileSystemErrorCode2;
|
|
27
|
-
})(FileSystemErrorCode || {});
|
|
28
|
-
export {
|
|
29
|
-
FileSystemErrorCode
|
|
30
|
-
};
|
|
@@ -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/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,MAAM,WAAW,sBAAsB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CA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