CoAgent8
    Preparing search index...

    Function extractRuntimePath

    • Extracts and strictly validates the runtime path from a CoAgent8 stdio registration entry.

      Parameters

      • entry: unknown

        The candidate registration entry or object containing args.

      • Optionalroot: string

        The base runtime root (e.g. ~/.coagent8), or omitted to resolve from environment/globalStorage.

      • OptionalargsPrefix: string[]

        Optional permitted launcher argument prefix from resolved Node CLI.

      Returns string | null

      The validated absolute runtime path, or null if the layout, containment, or path shape is invalid.

      Recognizes modern [...node.argsPrefix, runtimePath, 'mcp'] and legacy [...node.argsPrefix, runtimePath] argument layouts. The candidate path must resolve inside the owned runtime root or extension global storage with a 64-character hex subdirectory and index.cjs basename. Foreign tokens or extra flags yield null.