Documentation
    Preparing search index...

    Interface ServiceRuntimeContext

    Narrow runtime-owned access granted to a registered service.

    The context exposes current immutable identity values and policy-aware target delivery without exposing the mutable session registry, ACL state, adapter hooks, or raw transport.

    interface ServiceRuntimeContext {
        hasCapability(
            windowId: string,
            capability:
                | "relay:read"
                | "relay:write"
                | "cache:read"
                | "cache:write"
                | "hotkey:forward"
                | "state:read"
                | "state:write"
                | "identity:read"
                | "keys:bind"
                | "keys:forward"
                | "media:control"
                | "notify:send"
                | "notify:channel"
                | "theme:read"
                | "config:read"
                | "resource:fetch"
                | "cvm:call"
                | "outbox:read"
                | "outbox:write"
                | "upload:write"
                | "intent:read"
                | "intent:write"
                | "dm:read"
                | "dm:write"
                | "fs:read"
                | "fs:write",
        ): boolean;
        listWindowIds(): readonly string[];
        resolveDTag(windowId: string): string | undefined;
        sendToEligibleNapplet(windowId: string, message: NappletMessage): boolean;
    }
    Index

    Methods

    • Check a capability against the current source-bound ACL grant.

      Parameters

      • windowId: string

        Requesting live window.

      • capability:
            | "relay:read"
            | "relay:write"
            | "cache:read"
            | "cache:write"
            | "hotkey:forward"
            | "state:read"
            | "state:write"
            | "identity:read"
            | "keys:bind"
            | "keys:forward"
            | "media:control"
            | "notify:send"
            | "notify:channel"
            | "theme:read"
            | "config:read"
            | "resource:fetch"
            | "cvm:call"
            | "outbox:read"
            | "outbox:write"
            | "upload:write"
            | "intent:read"
            | "intent:write"
            | "dm:read"
            | "dm:write"
            | "fs:read"
            | "fs:write"

        Capability to check for that source.

      Returns boolean

      true when the live source currently holds the grant.

    • List current registered window identifiers.

      Returns readonly string[]

      A fresh frozen snapshot of live window identifiers.

    • Resolve a currently registered window to its authenticated napplet dTag.

      Parameters

      • windowId: string

        Internal live window identifier.

      Returns string | undefined

      The authenticated dTag, or undefined when no live session exists.

    • Send a runtime-originated message after current recipient policy checks.

      The message must have a recipient capability mapping. The target must be a live session whose immutable domain environment and current ACL grant both permit the message.

      Parameters

      • windowId: string

        Intended live recipient window.

      • message: NappletMessage

        Runtime-originated NIP-5D envelope.

      Returns boolean

      true only when the message was delivered to the adapter.