@cavell/kit API
    Preparing search index...

    Function useAgent

    • Parameters

      • Optional__namedParameters: UseAgentProps

      Returns { agent: AbstractAgent; isReady: boolean }

      • agent: AbstractAgent
      • isReady: boolean

        Whether agent is the real, runtime-synced (or locally-registered) agent rather than a provisional stand-in returned while the runtime is still connecting (or in an error state).

        agent is always a fully-constructed AbstractAgent, so calling agent.subscribe(...), agent.setState(...), etc. is always safe. But while isReady is false the instance is a placeholder that will be swapped for the real agent once the runtime /info sync resolves, at which point agent changes reference and dependent effects re-run. Guard on isReady when you only want to act against the real agent — e.g. subscribing to run-lifecycle events you don't want to miss during the provisional window (#5000).