pi-landstrip 0.16.5 → 0.16.7

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.
Files changed (2) hide show
  1. package/index.ts +11 -6
  2. package/package.json +2 -2
package/index.ts CHANGED
@@ -572,8 +572,9 @@ function notify(ctx: ExtensionContext, message: string, level: NotificationLevel
572
572
  }
573
573
 
574
574
  function hasTuiStatus(ctx: ExtensionContext): boolean {
575
- const { mode } = ctx as ExtensionContext & { mode?: string };
576
- return mode === undefined ? ctx.hasUI : mode === 'tui';
575
+ if (!ctx.hasUI) return false;
576
+ const mode = 'mode' in ctx ? (ctx as Record<string, unknown>).mode : undefined;
577
+ return mode === undefined || mode === 'tui';
577
578
  }
578
579
 
579
580
  function setTuiStatus(ctx: ExtensionContext, key: string, value: string | undefined): void {
@@ -862,9 +863,9 @@ type LandstripBashTool = ReturnType<typeof createBashToolDefinition>;
862
863
  /** Options for creating a landstrip sandbox integration. */
863
864
  export interface LandstripIntegrationOptions {
864
865
  /** Register a sandboxed bash tool when the integration is registered. */
865
- registerBashTool?: boolean;
866
+ readonly registerBashTool?: boolean;
866
867
  /** Working directory used when registering the default bash tool. */
867
- cwd?: string;
868
+ readonly cwd?: string;
868
869
  }
869
870
 
870
871
  /** Landstrip sandbox integration hooks for Pi. */
@@ -1158,13 +1159,17 @@ export function createLandstripIntegration(
1158
1159
  server.on('error', reject);
1159
1160
  let client: NetSocket | null = null;
1160
1161
  server.on('connection', (serverEnd) => {
1162
+ server.removeListener('error', reject);
1161
1163
  server.close();
1162
1164
  try {
1163
1165
  rmSync(sockPath, { force: true });
1164
1166
  } catch {
1165
1167
  /* ok */
1166
1168
  }
1167
- if (client) resolve([client, serverEnd]);
1169
+ if (client) {
1170
+ client.removeListener('error', reject);
1171
+ resolve([client, serverEnd]);
1172
+ }
1168
1173
  });
1169
1174
  server.listen(sockPath, () => {
1170
1175
  client = new NetSocket();
@@ -1218,7 +1223,7 @@ export function createLandstripIntegration(
1218
1223
  childEnd.destroy();
1219
1224
 
1220
1225
  function killChild(): void {
1221
- if (!child.pid) return;
1226
+ if (child.pid === undefined) return;
1222
1227
  try {
1223
1228
  process.kill(-child.pid, 'SIGKILL');
1224
1229
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-landstrip",
3
- "version": "0.16.5",
3
+ "version": "0.16.7",
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.8"
34
+ "@landstrip/landstrip": "^0.16.11"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@earendil-works/pi-coding-agent": "^0.74.2",