@tryinget/pi-runtime-registry
v0.2.0
Published
Shared runtime instance registry for pi-interaction extensions
Maintainers
Readme
summary: "@tryinget/pi-runtime-registry package overview." read_when:
- "Orienting to this package or directory before changing its behavior."
@tryinget/pi-runtime-registry
Shared runtime instance registry for pi-interaction extensions.
Purpose
Provides a central place for registering and discovering runtime instances across extensions. Extensions can:
- Register their runtime instances with capability descriptors
- Discover runtimes by owner or capability
- Query registry state for diagnostics
Usage
import { createRuntimeRegistry, getGlobalRuntimeRegistry } from "@tryinget/pi-runtime-registry";
// Use the global singleton for cross-extension discovery
const registry = getGlobalRuntimeRegistry();
// Register a runtime with capabilities
registry.register(
"my-extension",
"main-runtime",
myRuntimeInstance,
[
{ id: "picker", description: "Fuzzy picker interactions" },
{ id: "editor", description: "Editor ownership" }
]
);
// Find runtimes by capability
const pickerRuntimes = registry.findByCapability("picker");
// Get diagnostics
console.log(registry.diagnostics());API
createRuntimeRegistry(options?)
Create a new registry instance.
getGlobalRuntimeRegistry()
Get the process-wide singleton registry for cross-extension discovery.
Registry Methods
register(ownerId, runtimeId, instance, capabilities?)- Register a runtimeunregister(ownerId, runtimeId)- Remove a runtimeget(ownerId, runtimeId)- Get a specific runtimegetByOwner(ownerId)- Get all runtimes for an ownerfindByCapability(capabilityId)- Find runtimes with a capabilitylist()- List all runtimesdiagnostics()- Get registry diagnosticsclear()- Clear all runtimes
