pi-landstrip 0.16.13 → 0.16.15
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 +8 -36
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -105,8 +105,6 @@ interface LandstripBashCallbacks {
|
|
|
105
105
|
promptOnBlock?: boolean;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const LANDSTRIP_VERSION = [0, 16, 4] as const;
|
|
109
|
-
const REQUIRED_LANDSTRIP_VERSION = LANDSTRIP_VERSION.join('.');
|
|
110
108
|
const SUPPORTED_PLATFORMS = new Set<NodeJS.Platform>(['linux', 'darwin', 'win32']);
|
|
111
109
|
|
|
112
110
|
const packageDir = dirname(fileURLToPath(import.meta.url));
|
|
@@ -767,28 +765,14 @@ function promptWriteBlock(ctx: ExtensionContext, filePath: string): Promise<Perm
|
|
|
767
765
|
);
|
|
768
766
|
}
|
|
769
767
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
const match = version.match(/\b(\d+)\.(\d+)\.(\d+)\b/);
|
|
778
|
-
if (!match) return null;
|
|
779
|
-
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
function hasMinimumVersion(version: string, minimum: readonly [number, number, number]): boolean {
|
|
783
|
-
const parsed = parseVersion(version);
|
|
784
|
-
if (!parsed) return false;
|
|
785
|
-
|
|
786
|
-
for (let i = 0; i < minimum.length; i++) {
|
|
787
|
-
if (parsed[i] > minimum[i]) return true;
|
|
788
|
-
if (parsed[i] < minimum[i]) return false;
|
|
768
|
+
// The binary is bundled and version-locked to @landstrip/landstrip via npm, so
|
|
769
|
+
// compatibility is settled at install time; only confirm it is runnable here.
|
|
770
|
+
function landstripAvailable(): boolean {
|
|
771
|
+
try {
|
|
772
|
+
return spawnSync(binaryPath(), ['--version']).status === 0;
|
|
773
|
+
} catch {
|
|
774
|
+
return false;
|
|
789
775
|
}
|
|
790
|
-
|
|
791
|
-
return true;
|
|
792
776
|
}
|
|
793
777
|
|
|
794
778
|
function proxyEnv(env: NodeJS.ProcessEnv | undefined, port: number): NodeJS.ProcessEnv {
|
|
@@ -1591,8 +1575,7 @@ export function createLandstripIntegration(
|
|
|
1591
1575
|
return false;
|
|
1592
1576
|
}
|
|
1593
1577
|
|
|
1594
|
-
|
|
1595
|
-
if (!version) {
|
|
1578
|
+
if (!landstripAvailable()) {
|
|
1596
1579
|
sandboxEnabled = false;
|
|
1597
1580
|
sandboxReady = false;
|
|
1598
1581
|
notify(
|
|
@@ -1603,17 +1586,6 @@ export function createLandstripIntegration(
|
|
|
1603
1586
|
return false;
|
|
1604
1587
|
}
|
|
1605
1588
|
|
|
1606
|
-
if (!hasMinimumVersion(version, LANDSTRIP_VERSION)) {
|
|
1607
|
-
sandboxEnabled = false;
|
|
1608
|
-
sandboxReady = false;
|
|
1609
|
-
notify(
|
|
1610
|
-
ctx,
|
|
1611
|
-
`landstrip ${REQUIRED_LANDSTRIP_VERSION} or newer is required; found: ${version}`,
|
|
1612
|
-
'error',
|
|
1613
|
-
);
|
|
1614
|
-
return false;
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
1589
|
sandboxEnabled = true;
|
|
1618
1590
|
sandboxReady = true;
|
|
1619
1591
|
warnIfAllDomainsAllowed(ctx, config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-landstrip",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.15",
|
|
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
|
-
"@landstrip/landstrip": "^0.16.
|
|
34
|
+
"@landstrip/landstrip": "^0.16.16"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@earendil-works/pi-coding-agent": "^0.74.2",
|