@radcliffetech/symbolos-core
Version:
Core symbolic simulation and execution engine for Symbolos
43 lines (42 loc) • 2.17 kB
TypeScript
import type { PipelineRun, SymbolicAction, SymbolicObject } from "../types";
/**
* Creates a PipelineRun object with the given pipeline identifiers and run metadata.
* @param pipelineId - The ID of the pipeline.
* @param runId - The unique identifier for this run.
* @param tick - The tick count for this run.
* @param stepCount - The number of steps executed in this run.
* @param forkedFromRunId - (Optional) The runId from which this run was forked.
* @returns A new PipelineRun object.
*/
export declare function createPipelineRunObject(pipelineId: string, runId: string, tick: number, stepCount: number, forkedFromRunId?: string): PipelineRun;
interface RecordSymbolicActionParams {
context: Record<string, any>;
entry: SymbolicObject;
transformationId: string;
instrumentId: string;
purpose: string;
tick: number;
stepPrefix?: string;
outputObject?: SymbolicObject | null;
}
/**
* Records a SymbolicAction in the provided context's artifact store.
* Creates a SymbolicAction object based on the given parameters and adds it to the context.
* @param params - An object containing entry, transformationId, context, instrumentId, purpose, tick, and optionally outputObject.
* @returns A Promise that resolves to the created SymbolicAction object.
*/
export declare const recordSymbolicAction: ({ entry, transformationId, context, instrumentId, purpose, tick, outputObject, }: RecordSymbolicActionParams) => Promise<SymbolicAction>;
/**
* Adds an object to the context's artifact map using the object's id as the key.
* @param context - The context object containing an _artifactsById Map.
* @param obj - The object to add; must have an 'id' property.
*/
export declare function addToArtifacts(context: Record<string, any>, obj: any): void;
/**
* Recursively flattens a nested structure of symbolic objects into a flat array.
* Only objects with both 'id' and 'type' properties are included.
* @param obj - The root object or collection to flatten.
* @returns An array of SymbolicObject instances found in the structure.
*/
export declare function flattenSymbolicObjects(obj: any): SymbolicObject[];
export {};