opencode-landstrip 0.2.0 → 0.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/index.ts +30 -4
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -75,7 +75,7 @@ interface BashSandboxState {
|
|
|
75
75
|
|
|
76
76
|
type ToastVariant = 'info' | 'success' | 'warning' | 'error';
|
|
77
77
|
|
|
78
|
-
const LANDSTRIP_VERSION = [0, 9,
|
|
78
|
+
const LANDSTRIP_VERSION = [0, 9, 7] as const;
|
|
79
79
|
const SUPPORTED_PLATFORMS = new Set<NodeJS.Platform>(['linux', 'darwin', 'win32']);
|
|
80
80
|
|
|
81
81
|
const DEFAULT_CONFIG: SandboxConfig = {
|
|
@@ -777,7 +777,7 @@ export default (async ({ client, directory }: PluginInput, options?: PluginOptio
|
|
|
777
777
|
if (!hasMinimumVersion(version, LANDSTRIP_VERSION)) {
|
|
778
778
|
landstripCheck = {
|
|
779
779
|
ok: false,
|
|
780
|
-
reason: `landstrip 0.9.
|
|
780
|
+
reason: `landstrip 0.9.7 or newer is required; found: ${version}`,
|
|
781
781
|
};
|
|
782
782
|
return landstripCheck;
|
|
783
783
|
}
|
|
@@ -942,8 +942,34 @@ export default (async ({ client, directory }: PluginInput, options?: PluginOptio
|
|
|
942
942
|
Object.assign(output.env, proxyEnv(state.port));
|
|
943
943
|
},
|
|
944
944
|
|
|
945
|
-
'tool.execute.after': async (input) => {
|
|
946
|
-
if (input.tool
|
|
945
|
+
'tool.execute.after': async (input, output) => {
|
|
946
|
+
if (input.tool !== 'bash') return;
|
|
947
|
+
|
|
948
|
+
const state = activeBash.get(input.callID);
|
|
949
|
+
if (!state) return;
|
|
950
|
+
|
|
951
|
+
const errors = parseLandstripErrors(output?.output ?? '');
|
|
952
|
+
if (errors.length > 0) {
|
|
953
|
+
const message = formatLandstripErrors(errors);
|
|
954
|
+
await client.tui
|
|
955
|
+
.showToast({
|
|
956
|
+
body: { title: 'opencode-landstrip', message, variant: 'error' },
|
|
957
|
+
query: { directory },
|
|
958
|
+
})
|
|
959
|
+
.catch(() => undefined);
|
|
960
|
+
await client.app
|
|
961
|
+
.log({
|
|
962
|
+
body: {
|
|
963
|
+
service: 'opencode-landstrip',
|
|
964
|
+
level: 'error',
|
|
965
|
+
message,
|
|
966
|
+
},
|
|
967
|
+
query: { directory },
|
|
968
|
+
})
|
|
969
|
+
.catch(() => undefined);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
await cleanupBash(input.callID);
|
|
947
973
|
},
|
|
948
974
|
|
|
949
975
|
dispose: async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-landstrip",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Landlock-based sandboxing for opencode with landstrip",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"landlock",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"ci:test": "npm test"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@jarkkojs/landstrip": "^0.9.
|
|
45
|
+
"@jarkkojs/landstrip": "^0.9.7"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@opencode-ai/plugin": "^1.16.2",
|