@letterblack/lbe-exec 1.2.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/LICENSE +1 -0
- package/README.md +26 -0
- package/dist/index.js +1762 -0
- package/dist/lbe_engine.wasm +0 -0
- package/dist/wasm.lock.json +4 -0
- package/package.json +28 -0
- package/types.d.ts +19 -0
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@letterblack/lbe-exec",
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"description": "Local host-signed execution layer for LetterBlack LBE.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "types.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./types.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/",
|
|
16
|
+
"README.md",
|
|
17
|
+
"types.d.ts",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"tweetnacl": "^1.0.3",
|
|
22
|
+
"json-canonicalize": "^1.0.4"
|
|
23
|
+
},
|
|
24
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=20.9.0"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type LBEExecutionIntent = 'read_file' | 'write_file' | 'patch_file' | 'delete_file' | 'run_shell';
|
|
2
|
+
export interface LBERequest {
|
|
3
|
+
id?: string; actor?: string; intent: LBEExecutionIntent; target?: string; content?: string; patch?: unknown;
|
|
4
|
+
command?: { cmd: string; args: string[]; cwd?: string; timeoutMs?: number; maxOutputBytes?: number }; reason?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LBEResult {
|
|
7
|
+
ok: boolean; decision: 'allow' | 'deny' | 'observe'; executed: boolean; dryRun: boolean;
|
|
8
|
+
error?: { code: string; message: string; recoverable: boolean }; matchedRules?: string[]; auditId?: string;
|
|
9
|
+
rollback?: { available: boolean; performed: boolean; backupId?: string };
|
|
10
|
+
}
|
|
11
|
+
export interface LocalExecutor {
|
|
12
|
+
rootDir: string;
|
|
13
|
+
validate(request: LBERequest): Promise<LBEResult>;
|
|
14
|
+
dryRun(request: LBERequest): Promise<LBEResult>;
|
|
15
|
+
execute(request: LBERequest): Promise<LBEResult>;
|
|
16
|
+
policy: { read(): unknown; proposeRule(rule: { effect: 'allow' | 'deny'; type: 'path' | 'command'; pattern: string; from: string }): unknown; addRule(rule: { effect: 'allow' | 'deny'; type: 'path' | 'command'; pattern: string; from: string }): unknown };
|
|
17
|
+
audit: { verify(): unknown };
|
|
18
|
+
}
|
|
19
|
+
export function createLocalExecutor(options?: { rootDir?: string; keyId?: string; mode?: 'observe' | 'enforce'; shell?: { allowCommands?: string[]; denyCommands?: string[]; maxRequests?: number } }): LocalExecutor;
|