pi-landstrip 0.11.12 → 0.12.0
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/index.ts +6 -12
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -71,6 +71,7 @@ interface LandstripPolicy {
|
|
|
71
71
|
allowAllUnixSockets: boolean;
|
|
72
72
|
allowUnixSockets: string[];
|
|
73
73
|
httpProxyPort?: number;
|
|
74
|
+
socksProxyPort?: number;
|
|
74
75
|
};
|
|
75
76
|
filesystem: SandboxFilesystemConfig;
|
|
76
77
|
}
|
|
@@ -86,6 +87,7 @@ interface LandstripErrorResponse {
|
|
|
86
87
|
program?: string;
|
|
87
88
|
type?: LandstripErrorType;
|
|
88
89
|
source?: string;
|
|
90
|
+
mechanism?: string;
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
interface LandstripBashCallbacks {
|
|
@@ -93,7 +95,7 @@ interface LandstripBashCallbacks {
|
|
|
93
95
|
onErrorFd?: (data: Buffer) => void;
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
const LANDSTRIP_VERSION = [0,
|
|
98
|
+
const LANDSTRIP_VERSION = [0, 12, 2] as const;
|
|
97
99
|
const REQUIRED_LANDSTRIP_VERSION = LANDSTRIP_VERSION.join('.');
|
|
98
100
|
const LANDSTRIP_ERROR_REASONS = new Set<LandstripErrorReason>([
|
|
99
101
|
'Other',
|
|
@@ -538,6 +540,8 @@ function parseLandstripErrors(output: string): LandstripErrorResponse[] {
|
|
|
538
540
|
error.type = obj.type;
|
|
539
541
|
}
|
|
540
542
|
|
|
543
|
+
if (typeof obj.mechanism === 'string') error.mechanism = obj.mechanism;
|
|
544
|
+
|
|
541
545
|
errors.push(error);
|
|
542
546
|
} catch {
|
|
543
547
|
// Ignore non-JSON lines (e.g. stderr from child processes)
|
|
@@ -1138,17 +1142,7 @@ export function createLandstripIntegration(
|
|
|
1138
1142
|
const allowNetwork = config.network.allowNetwork;
|
|
1139
1143
|
const proxy = allowNetwork ? null : await startProxy(ctx, cwd);
|
|
1140
1144
|
const policy = writePolicyFile(cwd, proxy?.port ?? null);
|
|
1141
|
-
const landstripArgs = [
|
|
1142
|
-
'--error-fd',
|
|
1143
|
-
'3',
|
|
1144
|
-
'--error-format',
|
|
1145
|
-
'json',
|
|
1146
|
-
'-p',
|
|
1147
|
-
policy.path,
|
|
1148
|
-
shell,
|
|
1149
|
-
...args,
|
|
1150
|
-
command,
|
|
1151
|
-
];
|
|
1145
|
+
const landstripArgs = ['--trap-fd', '3', '-p', policy.path, shell, ...args, command];
|
|
1152
1146
|
|
|
1153
1147
|
return new Promise((resolvePromise, reject) => {
|
|
1154
1148
|
let timeoutHandle: NodeJS.Timeout | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-landstrip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Landlock-based sandboxing for pi with interactive permission prompts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"landstrip",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@earendil-works/pi-tui": "^0.78.0",
|
|
34
|
-
"@jarkkojs/landstrip": "^0.
|
|
34
|
+
"@jarkkojs/landstrip": "^0.12.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@earendil-works/pi-coding-agent": "^0.78.0",
|