From 341b8e78c90ed171a8578e6bf5662e532f69219e Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Sat, 25 Apr 2026 11:11:42 +1000 Subject: [PATCH] perms --- packages/opencode/src/tool/shell/arity.ts | 7 ++----- packages/opencode/test/permission/arity.test.ts | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/opencode/src/tool/shell/arity.ts b/packages/opencode/src/tool/shell/arity.ts index 073b62053d..ec7d7e728a 100644 --- a/packages/opencode/src/tool/shell/arity.ts +++ b/packages/opencode/src/tool/shell/arity.ts @@ -1,11 +1,8 @@ import { BashArity } from "@/permission/arity" -import { ShellKind } from "./id" +import type { ShellKind } from "./id" export namespace ShellArity { - export function prefix(tokens: string[], shellType: ShellKind.ID) { - if (ShellKind.powershell(shellType) && tokens.length > 0 && /^[a-z]+-[a-z]+$/i.test(tokens[0])) { - return [tokens[0]] - } + export function prefix(tokens: string[], _shellType: ShellKind.ID) { return BashArity.prefix(tokens) } } diff --git a/packages/opencode/test/permission/arity.test.ts b/packages/opencode/test/permission/arity.test.ts index 5e2af7afc1..01a0dfba61 100644 --- a/packages/opencode/test/permission/arity.test.ts +++ b/packages/opencode/test/permission/arity.test.ts @@ -36,4 +36,5 @@ test("powershell verb-noun structures", () => { expect(ShellArity.prefix(["Get-Content", "file.txt"], "pwsh")).toEqual(["Get-Content"]) expect(ShellArity.prefix(["Remove-Item", "-Recurse", "dir"], "powershell")).toEqual(["Remove-Item"]) expect(ShellArity.prefix(["git", "checkout", "main"], "pwsh")).toEqual(["git", "checkout"]) + expect(ShellArity.prefix(["redis-cli", "ping"], "pwsh")).toEqual(["redis-cli", "ping"]) })