import type { AgentEnvironmentObservation, ResourceProfile, SafeEndpoint } from "@tangle-network/agent-interface"; import type { SandboxClientLike, SandboxConnectionLike, SandboxInstanceLike } from "./tangle-types.js"; import type { ExecutionUsageLog } from "./tangle-usage-log.js"; /** Everything one observation reads, resolved when the environment is composed. */ export interface TangleObservationSources { box: SandboxInstanceLike; client: SandboxClientLike; provider: string; environmentId: string; /** Compute shape the caller asked for. Absent on an environment rebuilt by id. */ requestedResources?: ResourceProfile; usageLog: ExecutionUsageLog; } /** * Which observation surfaces this environment can put a value on. * * A flag is true only when a concrete source backs the surface for THIS * sandbox. `identity` and `lifecycle` are unconditional because the sandbox id * and status are always readable. `modelUsage` is unconditional for a * different reason: the adapter measures the usage of every execution that * runs through the handle, and reports the surface as unavailable until one * completes. Every other flag rests on a source that can be absent. */ export interface ObservationSurfaceSupport { identity: boolean; lifecycle: boolean; endpoint: boolean; placement: boolean; resources: boolean; resourceUse: boolean; modelUsage: boolean; computeBilling: boolean; accountUsage: boolean; } export declare function observationSurfaceSupport(box: SandboxInstanceLike, client: SandboxClientLike, requestedResources: ResourceProfile | undefined): ObservationSurfaceSupport; /** * Account usage and the client-side placement surface are the only observation * facts a client can establish before a sandbox exists. The rest rest on one * environment's data, so a provider-stage document keeps them at the declared * ceiling and each concrete sandbox measures them. */ export declare function clientObservationSurfaceSupport(client: SandboxClientLike): ObservationSurfaceSupport; /** * Read the credential-free network location of the sandbox runtime. * * Only the scheme, host, and explicit port of the runtime URL are carried. * Userinfo, path, and query are dropped, and the bearer beside the URL is * never read, so an endpoint payload cannot transport a credential. A port the * URL leaves to its scheme default is omitted rather than inferred. The result * is held to the contract's own endpoint schema, so a runtime URL the contract * refuses reads as no endpoint instead of failing the whole observation. */ export declare function safeEndpointFromConnection(connection: SandboxConnectionLike | undefined): SafeEndpoint | undefined; /** Build the normalized, freshness-tagged observation of one environment. */ export declare function observeTangleEnvironment(sources: TangleObservationSources, options?: { signal?: AbortSignal; }): Promise;