Theia API Documentation v1.77.0
    Preparing search index...
    Index
    aiConfigurationService: AiConfigurationService
    shellCommandAnalyzer: ShellCommandAnalyzer
    • 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.

      Throws synchronously if any pattern is invalid. The returned promise resolves once the preference write completes and rejects if the write fails.

      Parameters

      • ...patterns: string[]

      Returns Promise<void>

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

      Throws synchronously if any pattern is invalid. The returned promise resolves once the preference write completes and rejects if the write fails.

      Parameters

      • ...patterns: string[]

      Returns Promise<void>

    • Adds the patterns missing from the list without the session value (set via --session-preference), which writing the effective list back would save to a settings file. Writes when a pattern is missing from either list: the write clears the session value, unless the written list equals it, so a pattern that only the saved list has takes effect too.

      Parameters

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

      Returns Promise<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

    • Why pattern is not acceptable, or undefined when it is. Same rules as the add methods, exposed for UI that refuses a pattern before writing it, so those rules live in one place.

      Parameters

      • pattern: string

      Returns string | undefined

    • 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

    • Removes the pattern from the list without the session value, and writes that list when the pattern is in either list. The write clears the session value, so a pattern that only the session value has goes too. When the written list equals the session value, nothing is written, and the effective list is already right.

      Parameters

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

      Returns Promise<void>

    • Validates a pattern and returns the trimmed version. Throws an error if the pattern is invalid.

      Parameters

      • pattern: string

      Returns string