/** * Self resolution stays parse-only: `_self` becomes a Path/IdPath with no graph * read. The dispatcher later attaches lazy node()/call helpers once it has a kernel. */ import type { BoundNode, InstanceDispatch, NodeBinder } from '@astrale-os/kernel-client/schema'; import type { Node } from '@astrale-os/kernel-core/graph'; import type { Schema } from '@astrale-os/kernel-dsl'; import { Path, type NodeId } from '@astrale-os/kernel-core'; import type { Kernel } from '../method/context.js'; /** The node a non-static method runs on — its full record, id guaranteed. */ export type ResolvedSelfNode = Node & { id: NodeId; }; /** The bare parse of a self target — no kernel, no fetch. */ export type ParsedSelf = { path: Path; /** Set when `path` is an `IdPath` (i.e. `@::method` calls). */ id?: NodeId; }; export type SelfResult = ParsedSelf & { /** * Lazy point-in-time self read. Memoized per dispatch; `{ reload: true }` * forces a fresh `function.get`. */ node(opts?: { reload?: boolean; }): Promise; }; /** Schema-typed self: short-keyed props and typed same-instance call proxy. */ export type TypedSelf = ParsedSelf & { /** * Fetch THIS node as a typed `BoundNode`. Memoized exactly like * {@link SelfResult.node} — one in-flight `function.get`, rejection-clearing, * `{ reload: true }` refetches — so the zero-extra-graph-read dispatch * invariant holds: nothing is read until called, then at most once. */ node(opts?: { reload?: boolean; }): Promise>; /** Own instance methods — typed, address-only (`::method`), no read. */ readonly call: InstanceDispatch; }; export declare function resolveSelf(ref: string): ParsedSelf; /** Attach memoized node(); unauthenticated contexts reject instead of reading. */ export declare function withNode(parsed: ParsedSelf, kernel: Kernel | null): SelfResult; /** * Schema-typed self helper: lazy BoundNode plus address-only call proxy. With no * kernel, both node() and call thunks fail loudly. */ export declare function withBoundNode(parsed: ParsedSelf, kernel: Kernel | null, binder: NodeBinder, typeName: string): TypedSelf; //# sourceMappingURL=self.d.ts.map