@gik-ai/controlface
v0.1.5
Published
Control-plane projection surface (full capability catalog) for the Generative Interaction Kernel.
Maintainers
Readme
@gik-ai/controlface
Control-plane projection surface for the Generative Interaction Kernel. A ControlFace is a
host-side live object that wraps one kernel (plus its transport broker); createControlFaceDispatcher
exposes the control-plane projection over the shared face tool catalog (authoring + inspect + drive + time-travel).
npm install @gik-ai/controlfaceimport { ControlFace, createControlFaceDispatcher } from "@gik-ai/controlface";
const controlFace = new ControlFace(/* bundle */);
const dispatch = createControlFaceDispatcher(controlFace);If you only need to lower a blueprint into vocabulary/program/state JSON, use the narrower subpath:
import { openBlueprint } from "@gik-ai/controlface/blueprint";
const runtime = openBlueprint(blueprint);Mount the returned dispatcher over a transport chosen by the host, or expose
the narrower agent-safe projection with @gik-ai/agentface.
Exported API
Live runtime
ControlFaceis the host-side live runtime class exported from the package root.- Constructor:
new ControlFace(vocabulary: Enveloped<ProjectedVocabularyManifest>, program: Enveloped<ExecutableProgramDefinition>, options?: ControlFaceOptions). ControlFaceOptionsmay supplystate,orchestrator,sink,serviceHost,blueprint, andexternalContext.- Transport method:
attach(transport, fromRev?). - Runtime methods:
emit(event),getState(),getTree(),checkpoint(),restore(checkpoint),effectsSince(rev), andcompensate(effects). - Blueprint-related methods:
getBlueprint(),getProgram(),inspectBlueprintStructureChange(request), andreconfigureBlueprint(patch).reconfigureBlueprint(patch)returns aBlueprintReconfigurationResultwith the acceptedblueprint, and includesprogramPatchandtransitiononly when executable structure changed. - Service-host methods:
describeServiceKinds(),listServiceRequests(), andprobeService(serviceId). They use the optionalserviceHostfromControlFaceOptions.
- Constructor:
RuntimeFaceis the structural subset ofControlFaceconsumed by the exported tool-catalog helpers.
Tool catalog and dispatcher
fullCatalogTools(face: RuntimeFace): McpTool[]returns the shared full tool catalog: the authoring tools plus the live runtime tools.controlFaceTools(face: RuntimeFace): McpTool[]returns that full catalog unchanged.createControlFaceDispatcher(face: RuntimeFace): McpDispatcherwraps that catalog in an MCP dispatcher whose advertised server info is{ name: "genui-controlface", version: "0.1" }.MCP_PROTOCOL_VERSIONis"2025-06-18".McpToolis the tool contract:name,description,inputSchema,handler, and optionalagentSafe.McpDispatcherexposestools,listTools(),callTool(name, args?), andhandleMcpMessage(message).McpServerInfois the{ name, version }metadata shape used during MCP initialization.
Service-host exports
QueueFaceis a thin wrapper over a suppliedServiceHost, withsubmit(effect),getRequest(id),listRequests(), andcancel(id).ServiceHostis the host contract for service discovery, validation, invocation, queueing, request lookup, and cancellation.DefaultServiceHostis the defaultServiceHostimplementation exported by the package.ServiceKindRegistryregisters service-kind factories, reports availability, validates declarations, and materializes adapters.UnsatisfiedServiceDependencyErrorreports a missing host-supplied dependency during service execution.- The package also exports the service request and service-kind contracts used
by those classes, including:
- queue/service contracts:
ContractAssurance,ServiceCapabilityDescriptor,ServiceProviderDescriptor,ServiceCatalogSnapshot,ServiceRequestInput,ServiceRequest,ServiceValidationReport,ServiceProbeResult,ServiceSimulationResult,ServiceExecutionResult,ServiceAgentTool,ServiceAdapterContext,ServiceAdapter,ServiceExecutionMode,ServiceRequestStatus,ServiceRequestRecord,ServiceRequestStore,InMemoryServiceRequestStore,DefaultServiceHostOptions, andBlueprintServiceResolver. - service-kind contracts:
ServiceExecutionSubjectKind,ServiceKindManifest,ServiceKindContext,ServiceDependency,ServiceKindFactory,ServiceKindDescription,BlueprintServiceIdentity, andserviceConfig(declaration).
- queue/service contracts:
Security boundary
controlface exposes the complete privileged control surface. Do not give an
untrusted agent direct access to it. Capability policy belongs to the
projection; transports only carry already-authorized calls.
License
MIT
