opencode-landstrip 0.17.18 → 0.17.19

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/package.json +2 -2
  2. package/tui.ts +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-landstrip",
3
- "version": "0.17.18",
3
+ "version": "0.17.19",
4
4
  "description": "Landlock-based sandboxing for opencode with landstrip",
5
5
  "keywords": [
6
6
  "landlock",
@@ -48,7 +48,7 @@
48
48
  "ci:test": "npm test"
49
49
  },
50
50
  "dependencies": {
51
- "@landstrip/landstrip": "^0.17.18",
51
+ "@landstrip/landstrip": "^0.17.19",
52
52
  "@opentui/solid": ">=0.3.4",
53
53
  "solid-js": "1.9.12"
54
54
  },
package/tui.ts CHANGED
@@ -444,6 +444,8 @@ const tui: TuiPlugin = async (api, options, meta) => {
444
444
  }
445
445
 
446
446
  const unsubscribeAsked = api.event.on('permission.asked', (event) => {
447
+ const directory = api.state.path.directory || process.cwd();
448
+ if (!loadConfig(directory, optionOverrides).enabled) return;
447
449
  const pending = event.properties as PendingPermission;
448
450
  enqueue(pending);
449
451
  reconcile(pending.sessionID);
@@ -483,11 +485,17 @@ const tui: TuiPlugin = async (api, options, meta) => {
483
485
  buffer = buffer.slice(newline + 1);
484
486
 
485
487
  for (const trap of parseLandstripTraps(line)) {
488
+ const directory = api.state.path.directory || process.cwd();
486
489
  if (trap.kind !== 'filesystem' && trap.kind !== 'network') continue;
487
490
  if (trap.state !== 'query') continue;
488
491
  if (seen.has(trap.query_id)) continue;
489
492
  seen.add(trap.query_id);
490
493
 
494
+ if (!loadConfig(directory, optionOverrides).enabled) {
495
+ respondQuery(socket, trap.query_id, 'allow');
496
+ continue;
497
+ }
498
+
491
499
  if (trap.kind === 'filesystem') {
492
500
  const sessionPaths =
493
501
  trap.operation === 'read' ? sessionAllowedReadPaths : sessionAllowedWritePaths;