Briyah SDK - v2.0.6
    Preparing search index...

    Class PackService

    Index
    • Parameters

      • userPaths: UserPathsService
      • userConfig: UserConfigService
      • registeredToolNames: () => readonly string[]

        Native tool names the process has registered, for the missing-tool warning.

      Returns PackService

    • Creates an empty pack owned by this user, and enables it.

      Enabling is part of creating because a pack the user just made and cannot see is a bug report. Tool code is never part of this: a user pack can grant tools the host has registered, but only the host installs the code.

      Parameters

      • packName: string

        The new pack's name

      • Optionaltitle: string

        Optional display name

      Returns PackView

      The created pack

      If the name is not a legal pack name

      If a pack of that name already exists

    • Deletes a pack this user owns.

      Only ever their own directory. Agents and rooms already created from the pack are untouched and stay visible — they carry the pack's name, and a name with no pack behind it is treated as visible rather than hidden, so deleting a pack never makes a user's own work disappear.

      Parameters

      • packName: string

        The pack to delete

      Returns void

      If no such pack is installed

      If the pack was installed by the host

    • The packs this user has enabled, as a thunk-friendly snapshot.

      Filtered to packs that are actually installed, so a name left behind by a pack the host removed does not make the resolver stat a directory that will never exist. The name stays in the config, so reinstalling brings it back.

      Returns readonly string[]

      Enabled pack names, sorted

    • Reads one pack.

      Parameters

      • packName: string

        The pack name

      Returns PackView

      The pack

      If no such pack is installed

    • Every pack name on disk, host and user, deduped.

      Returns string[]

    • Whether something stamped with this pack name should be listed.

      An item with no pack is always visible, and so is one naming a pack that is not installed — otherwise deleting a pack would hide the user's own agents and rooms rather than just the templates they came from.

      Parameters

      • OptionalpackName: string

        The pack stamped on the item, if any

      Returns boolean

      True when the item should appear in a listing

    • Lists every installed pack with this user's view of it.

      Returns PackView[]

      The packs, sorted by title

    • Turns a pack on or off for this user.

      Parameters

      • packName: string

        The pack to change

      • enabled: boolean

        Whether it should be on

      Returns void

      If no such pack is installed