import { ILogService } from "../../log/common/log.service.js"; /** Constructs only hostname boundaries expressible by both the legacy filter and the runtime. */ export declare function buildManagedDomainBoundary(patterns: readonly string[], logService: ILogService): string[]; /** Validates the bridge's canonical hostname subset, not arbitrary runtime-managed rule syntax. */ export declare function isManagedDomainBoundaryRule(rule: string): boolean; /** Each connected client's boundary must admit a host; omission is neutral and [] is deny-all. */ export declare function intersectManagedDomainBoundaries(left: readonly string[] | undefined, right: readonly string[] | undefined): string[] | undefined; /** * Construction and validation of Copilot SDK managed permission rules. * * The SDK parses every rule it receives with a strict grammar, and a single * malformed rule rejects the **entire** managed permissions document rather * than just the offending entry. Because VS Code sends this document as part of * session create/resume, an untranslatable rule derived from a user's settings * would fail the session outright. Everything this bridge emits therefore goes * through {@link buildManagedRule}, which returns `undefined` for anything the * SDK would reject so the caller can drop it and continue. * * The grammar mirrored here is `parse_managed_rule` in the agent runtime * (`src/runtime/src/permissions/managed.rs`). */ /** * Rule families the SDK understands. Any other family is a parse error for the * whole document, so there is deliberately no escape hatch for arbitrary tool * names — see `parse_managed_rule`'s "Unsupported managed permission rule * family" branch. */ export declare enum ManagedRuleFamily { /** Shell/terminal commands. Matches `Bash` and `PowerShell` on the SDK side too. */ Shell = "Shell", /** File reads. */ Read = "Read", /** File writes. The SDK treats `Edit` as an alias. */ Write = "Write", /** Network access, matched as a URL pattern. */ Domain = "Domain" } /** * A rule with no argument, which matches **every** request in its family — the * SDK's matchers return `true` as soon as the family matches and the argument is * absent. This is the only correct way to express "all of X"; an argument of * `*` is *not* a universal wildcard for {@link ManagedRuleFamily.Domain}, * because domain arguments are normalized as URL patterns whose only wildcard * form is a `*.host` subdomain match. */ export declare function buildManagedFamilyRule(family: ManagedRuleFamily): string; /** * Builds a single managed permission rule, or returns `undefined` when the * argument cannot be expressed in the SDK grammar. * * Callers must treat `undefined` as "this restriction is not translatable" and * skip it — never fall back to a broader rule, which would silently over-restrict. */ export declare function buildManagedRule(family: ManagedRuleFamily, argument: string): string | undefined;