@segmentstream/ontology/server
3 public exports from @segmentstream/ontology/server.
Public exports
installWorkflowRuntime
Prepares the process for serving the ontology's runs; the starter's `server/plugin.ts` calls it at startup. Until the flow handler loads, which sets the Workflow SDK's base path itself from the build, it sets the base path to `/api/ontology`, so that runs started first call back at `/api/ontology/.well-known/workflow/v1/*`; once a base path is set it changes nothing. It also registers synchronous argument codecs and the Workflow SDK's runtime operations, loaded on first use, for the service's workflow routes, which refuse to serve until registered. Only this entry exports it, so that neither the service nor a workflow file's imports load the Workflow SDK. This process serves the ontology's queue only, so it names the ontology's queue namespace in `WORKFLOW_QUEUE_NAMESPACE`, where the Workflow SDK reads it whenever its API takes none: `resumeHook`, which an agent task's result resumes its workflow with, enqueues the run there. `start` and the flow handler name the namespace themselves.
function installWorkflowRuntime(): void;
registerPlatformWorkflows
Registers the platform's workflow functions, compiled by the Workflow SDK in the server build: the plugin `ontologyWorkflows()` generates calls it at startup with the functions of the file it wrote beside the workspace's workflows. Without it, an action whose triggers may fire is refused, since the service could not arm the recovery run that guarantees its starts.
function registerPlatformWorkflows(workflows: PlatformWorkflows): void;
registerWorkflowStructures
Registers what the build read of each workflow's code, by workflow id: the plugin `ontologyWorkflows()` generates calls it at startup, and the service serves each declared workflow's structure beside its runs. Without it, the service answers that it has none.
function registerWorkflowStructures(structures: WorkflowStructures): void;