@fenglimg/fabric-shared 1.7.0 → 1.8.0-rc.2
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/chunk-3SZRB42B.js +90 -0
- package/dist/{chunk-5H2PVNB2.js → chunk-BLXHC5HA.js} +30 -10
- package/dist/chunk-GI6L6VTT.js +176 -0
- package/dist/chunk-KV27CZH3.js +223 -0
- package/dist/errors/index.d.ts +65 -0
- package/dist/errors/index.js +30 -0
- package/dist/i18n/index.js +1 -1
- package/dist/index.d.ts +718 -254
- package/dist/index.js +354 -309
- package/dist/node/atomic-write.d.ts +14 -0
- package/dist/node/atomic-write.js +60 -0
- package/dist/node/bootstrap-guide.d.ts +12 -0
- package/dist/node/bootstrap-guide.js +52 -0
- package/dist/node/mcp-payload-guard.d.ts +16 -0
- package/dist/node/mcp-payload-guard.js +40 -0
- package/dist/node.js +3 -172
- package/dist/schemas/api-contracts.d.ts +883 -0
- package/dist/schemas/api-contracts.js +36 -0
- package/dist/types/index.d.ts +6 -4
- package/package.json +28 -4
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
declare abstract class FabricError extends Error {
|
|
2
|
+
abstract readonly code: string;
|
|
3
|
+
readonly actionHint: string;
|
|
4
|
+
readonly fixable: boolean;
|
|
5
|
+
readonly details?: unknown;
|
|
6
|
+
abstract readonly httpStatus: number;
|
|
7
|
+
constructor(message: string, opts: {
|
|
8
|
+
actionHint: string;
|
|
9
|
+
fixable?: boolean;
|
|
10
|
+
details?: unknown;
|
|
11
|
+
});
|
|
12
|
+
toJSON(): {
|
|
13
|
+
details?: {} | null | undefined;
|
|
14
|
+
name: string;
|
|
15
|
+
code: string;
|
|
16
|
+
message: string;
|
|
17
|
+
actionHint: string;
|
|
18
|
+
fixable: boolean;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare abstract class ConfigError extends FabricError {
|
|
23
|
+
readonly httpStatus = 400;
|
|
24
|
+
}
|
|
25
|
+
declare class ConfigPathInvalidError extends ConfigError {
|
|
26
|
+
readonly code = "config_path_invalid";
|
|
27
|
+
}
|
|
28
|
+
declare class GenericConfigError extends ConfigError {
|
|
29
|
+
readonly code = "config_error";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare abstract class RuleError extends FabricError {
|
|
33
|
+
readonly httpStatus: number;
|
|
34
|
+
}
|
|
35
|
+
declare class RuleValidationError extends RuleError {
|
|
36
|
+
readonly code = "rule_validation_error";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare abstract class IOFabricError extends FabricError {
|
|
40
|
+
readonly httpStatus: number;
|
|
41
|
+
}
|
|
42
|
+
declare class PathEscapeError extends IOFabricError {
|
|
43
|
+
readonly code = "PATH_OUTSIDE_PROJECT_ROOT";
|
|
44
|
+
readonly httpStatus = 403;
|
|
45
|
+
}
|
|
46
|
+
declare class GenericIOError extends IOFabricError {
|
|
47
|
+
readonly code = "io_error";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare abstract class MCPError extends FabricError {
|
|
51
|
+
abstract readonly httpStatus: number;
|
|
52
|
+
}
|
|
53
|
+
declare class McpToolError extends MCPError {
|
|
54
|
+
readonly code = "mcp_tool_error";
|
|
55
|
+
readonly httpStatus = 500;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare abstract class InitError extends FabricError {
|
|
59
|
+
readonly httpStatus = 500;
|
|
60
|
+
}
|
|
61
|
+
declare class InitFrameworkUnknownError extends InitError {
|
|
62
|
+
readonly code = "init_framework_unknown";
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { ConfigError, ConfigPathInvalidError, FabricError, GenericConfigError, GenericIOError, IOFabricError, InitError, InitFrameworkUnknownError, MCPError, McpToolError, PathEscapeError, RuleError, RuleValidationError };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigError,
|
|
3
|
+
ConfigPathInvalidError,
|
|
4
|
+
FabricError,
|
|
5
|
+
GenericConfigError,
|
|
6
|
+
GenericIOError,
|
|
7
|
+
IOFabricError,
|
|
8
|
+
InitError,
|
|
9
|
+
InitFrameworkUnknownError,
|
|
10
|
+
MCPError,
|
|
11
|
+
McpToolError,
|
|
12
|
+
PathEscapeError,
|
|
13
|
+
RuleError,
|
|
14
|
+
RuleValidationError
|
|
15
|
+
} from "../chunk-3SZRB42B.js";
|
|
16
|
+
export {
|
|
17
|
+
ConfigError,
|
|
18
|
+
ConfigPathInvalidError,
|
|
19
|
+
FabricError,
|
|
20
|
+
GenericConfigError,
|
|
21
|
+
GenericIOError,
|
|
22
|
+
IOFabricError,
|
|
23
|
+
InitError,
|
|
24
|
+
InitFrameworkUnknownError,
|
|
25
|
+
MCPError,
|
|
26
|
+
McpToolError,
|
|
27
|
+
PathEscapeError,
|
|
28
|
+
RuleError,
|
|
29
|
+
RuleValidationError
|
|
30
|
+
};
|