Vana SDK - v4.1.0
    Preparing search index...

    Function getDerivativeStatus

    • Read the lifecycle of the question behind a derived scope.

      Parameters

      Returns Promise<
          {
              derivedScope: string;
              status: "pending"
              | "failed"
              | "ready"
              | "stale";
              lastComputedAt: string | null;
              derivedVersion: number | null;
              derivedCollectedAt: string | null;
              errorCode:
                  | NonNullable<
                      | "internal"
                      | "inference_unavailable"
                      | "source_missing"
                      | "grant_invalid",
                  >
                  | null;
              retryAfterSeconds: number
              | null;
          },
      >

      The status of the derived scope. When several registrations write it, the most optimistic true state answers — ready, then stale, then pending, then failed — because a duplicate that never wrote anything must not report away an answer the scope has.

      Sends GET /v1/derivatives/status?derivedScope=<scope> with a Web3Signed Authorization header carrying grantId, the same authentication a data read uses. Nothing is charged: the route authorizes, it does not serve data, so a priced grant raises no 402 here.

      404: the caller may read the scope but no question stands behind it (and, on an older Personal Server, the route itself is unknown).

      403: the grant does not cover the derived scope. The check runs before any store lookup, so a caller cannot probe which scopes have questions.

      On any other non-2xx answer or an unparseable body.

      When fetch itself failed.

      On a missing derivedScope or no fetch.

      const status = await getDerivativeStatus({
      personalServerUrl: "https://ps.example.com",
      derivedScope: "coach.weekly",
      grantId,
      signer,
      });
      if (status.status === "ready") {
      const record = await readPersonalServerData({ ... });
      } else if (status.retryAfterSeconds !== null) {
      // Computing or retrying: come back then.
      }