Server API methods
Server API methods
serverApi.probe()
Probe server health through RPC.
async probe(signal?: AbortSignal): Promise<void>;
Kind: instance method of ServerApi
serverApi.getConfig()
Read server configuration, including provider instances and models.
getConfig(signal?: AbortSignal): Promise<RpcSuccess<RpcMethods, "server.getConfig">>;
Kind: instance method of ServerApi
serverApi.getSettings()
Read server settings, which the server serves as part of its configuration.
async getSettings(signal?: AbortSignal): Promise<ServerSettings>;
Kind: instance method of ServerApi
serverApi.refreshProviders()
Refresh the selected provider instances. reloadSecrets reads secret
references again and can prompt on the host. workspaceSnapshotsOnDemand
replies without snapshots or, with instanceId and cwd, with only that
instance’s snapshot of that folder and empty models, slashCommands and
skills. usageLimitsCommand adds /usage-limits to that reply.
providerCatalogsOnDemand replies with the machine catalog as a pending
snapshot when the workspace scan fails. modelCatalogOnly refetches a stale
model manifest and ignores the other fields; watchConfig carries the result.
refreshProviders(
input: RpcPayload<RpcMethods, "server.refreshProviders"> = {},
signal?: AbortSignal,
): Promise<RpcSuccess<RpcMethods, "server.refreshProviders">>;
Kind: instance method of ServerApi
serverApi.getNpmRelease()
Find a t3 release in the npm registry that the server is configured to use.
spec is latest, nightly or an exact version. Resolves to null when
there is no such release, and fails with ServerNpmReleaseError when the
lookup cannot complete. Servers that advertise npmReleaseLookup answer it.
getNpmRelease(
input: RpcPayload<RpcMethods, "server.getNpmRelease">,
signal?: AbortSignal,
): Promise<RpcSuccess<RpcMethods, "server.getNpmRelease">>;
Kind: instance method of ServerApi
serverApi.prepareTriage()
Write triage session files on the server and get composer text that links
them, for a new thread. The server also starts to clone the T3 Code source in
its own folder when it can. client names this client in the session.
Servers that advertise triage answer it.
prepareTriage(
input: RpcPayload<RpcMethods, "server.prepareTriage">,
signal?: AbortSignal,
): Promise<RpcSuccess<RpcMethods, "server.prepareTriage">>;
Kind: instance method of ServerApi
serverApi.watchConfig()
Subscribe to configuration changes; decode failures remain stream items.
watchConfig(
options: WatchServerConfigOptions = {},
): AsyncIterable<DecodedStreamItem<RpcSuccess<RpcMethods, "subscribeServerConfig">>>;
Kind: instance method of ServerApi
serverApi.watchLifecycle()
Subscribe to server lifecycle events.
watchLifecycle(
options: WatchServerLifecycleOptions = {},
): AsyncIterable<DecodedStreamItem<RpcSuccess<RpcMethods, "subscribeServerLifecycle">>>;
Kind: instance method of ServerApi
serverApi.watchDatabaseStorage()
Follow the state database’s size and reclaimable space; decode failures remain stream items.
watchDatabaseStorage(
options: WatchDatabaseStorageOptions = {},
): AsyncIterable<DecodedStreamItem<RpcSuccess<RpcMethods, "server.getDatabaseStorage">>>;
Kind: instance method of ServerApi
serverApi.environment()
Read the public environment descriptor over HTTP.
environment(signal?: AbortSignal): Promise<ExecutionEnvironmentDescriptorType>;
Kind: instance method of ServerApi
serverApi.providers()
List configured provider instances.
async providers(signal?: AbortSignal): Promise<ServerProvider[]>;
Kind: instance method of ServerApi
serverApi.providerStatus()
Current provider records with auth, installation, availability and usage
limits, from the live configuration. instanceId selects one instance
exactly; an unknown id yields an empty list. Reading does not log in,
install, refresh or consume reset credits.
async providerStatus(instanceId?: string, signal?: AbortSignal): Promise<ServerProvider[]>;
Kind: instance method of ServerApi
serverApi.usageSummary()
Historical token usage and cost from provider transcripts (diagnostics:read).
Buckets keep provider, model and cost source; sources report scan status.
The result has no grand total: costs from different sources, and tokens
of different kinds, are not added together. modelFilter keeps or drops
records by provider and original model id; settings usageModelFilter
holds the filter a user saved, and the result echoes the filter applied.
usageSummary(input: UsageSummaryInput, signal?: AbortSignal): Promise<UsageSummary>;
Kind: instance method of ServerApi
serverApi.findModel()
Find a provider model by slug or alias; return undefined when absent.
async findModel(
instanceId: string,
model: string,
): Promise<
{ readonly provider: ServerProvider; readonly model: ServerProviderModel } | undefined
>;
Kind: instance method of ServerApi