@bluelibs/runner - v6.3.1
    Preparing search index...

    Function subtreeOf

    • Creates an IsolationSubtreeFilter that targets every item registered inside resource's registration subtree.

      Unlike string selectors, this binds to the resource object — so overridable ids or any nested child registration is caught automatically at bootstrap, regardless of what the concrete id strings look like at runtime.

      Parameters

      Returns IsolationSubtreeFilter

      import { subtreeOf, defineResource, defineTask } from "@bluelibs/runner";

      const agentResource = defineResource({ id: "agent", register: [agentTask] });

      // Deny all tasks from agentResource's subtree
      const boundary = defineResource({
      id: "my.boundary",
      register: [consumerTask],
      isolate: { deny: [subtreeOf(agentResource, { types: ["task"] })] },
      });

      // Only allow events from agentResource's subtree (plus internal items)
      const strict = defineResource({
      id: "strict.consumer",
      register: [listenerTask],
      isolate: { only: [subtreeOf(agentResource, { types: ["event"] })] },
      });