Skip to content

ResourcesAPI

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

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

fn-92

register(descriptor, resolver): Promise<string>

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

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:323

Unregisters a provider by token.

string

Promise<void>


beginBatch(): Promise<ResourceBatchHandle>

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

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

Promise<ResourceBatchHandle>


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

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

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:329

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:331

Cancels a watch.

string

Promise<void>


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

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

Lists registered resource descriptors. [resources.read]

AnyJSONValue

Promise<ResourceDescriptor[]>


notifyChange(token, uri): Promise<void>

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

Signals that a provider-owned URI changed.

string

string

Promise<void>