Theia API Documentation v1.69.0
    Preparing search index...
    Index

    Constructors

    Properties

    preferenceService: PreferenceService
    shellCommandAnalyzer: ShellCommandAnalyzer

    Methods

    • Adds one or more patterns to the allowlist in a single update. Rejects empty or whitespace-only patterns, "*" alone, and invalid wildcard positions. Trims patterns before adding and avoids duplicates.

      Parameters

      • ...patterns: string[]

      Returns void

    • Adds one or more patterns to the denylist in a single update. Uses the same validation as allowlist patterns.

      Parameters

      • ...patterns: string[]

      Returns void

    • Parameters

      • patterns: string[]
      • preferenceKey: string
      • getCurrentPatterns: () => string[]

      Returns void

    • Checks a command and returns detailed result with precedence:

      1. Matches denylist → { allowed: false, reason: 'denied', matchedPattern }
      2. Matches dangerous patterns → { allowed: false, reason: 'dangerous' }
      3. Matches allowlist → { allowed: true }
      4. Otherwise → { allowed: false, reason: 'not-allowed' }

      Parameters

      • command: string

      Returns CommandCheckResult

    • Checks if a command is allowed based on the allowlist patterns. Returns false if the command contains dangerous patterns, is on the denylist, or if the allowlist is empty. Returns true only if ALL sub-commands match at least one allowlist pattern.

      Parameters

      • command: string

      Returns boolean

    • Checks if a sub-command matches an allowlist pattern using Claude Code compatible syntax. Supports * wildcards: trailing (optional args), leading (suffix match), middle (required match).

      Parameters

      • subCommand: string
      • pattern: string

      Returns boolean

    • Parameters

      • pattern: string
      • preferenceKey: string
      • getCurrentPatterns: () => string[]

      Returns void