Skip to content

ResourcesAPI

Defined in: namespaces-core-plugins.ts:350

Shared read plane for AppOS state (fn-92).

fn-92

register(descriptor, resolver): Promise<string>

Defined in: namespaces-core-plugins.ts:352

Registers a resource provider. Returns a provider token. [resources.provider.register]

ResourceDescriptor

(uri) => AnyJSONValue | Promise<AnyJSONValue>

Promise<string>


unregister(token): Promise<void>

Defined in: namespaces-core-plugins.ts:354

Unregisters a provider by token.

string

Promise<void>


beginBatch(): Promise<ResourceBatchHandle>

Defined in: namespaces-core-plugins.ts:356

Begins a transactional multi-provider registration batch. [resources.provider.register]

Promise<ResourceBatchHandle>


resolve(uri, opts?): Promise<ResourceDocument>

Defined in: namespaces-core-plugins.ts:358

Resolves a URI to a document (SWR cache + single-flight). [resources.read]

string

AnyJSONValue

Promise<ResourceDocument>


watch(uri, handler, opts?): Promise<string>

Defined in: namespaces-core-plugins.ts:360

Watches a URI (200ms coalesced). Returns a watch token. [resources.watch]

string

(doc) => void

AnyJSONValue

Promise<string>


unwatch(token): Promise<void>

Defined in: namespaces-core-plugins.ts:362

Cancels a watch.

string

Promise<void>


list(opts?): Promise<ResourceDescriptor[]>

Defined in: namespaces-core-plugins.ts:364

Lists registered resource descriptors. [resources.read]

AnyJSONValue

Promise<ResourceDescriptor[]>


notifyChange(token, uri): Promise<void>

Defined in: namespaces-core-plugins.ts:366

Signals that a provider-owned URI changed.

string

string

Promise<void>