Recursive AI

Public API of the 1.0 libraries

All onescope docs

Generated by tools/ApiList from the built assemblies; every member has an XML doc comment in the source (units, limits, exceptions).

RecursiveAI.OneScope.Sdk

static class AxisIds

  • const string Time

struct AxisInfo

  • AxisInfo(string Id, string Name, int PositionCount)
  • string Id { get; init; }
  • string Name { get; init; }
  • int PositionCount { get; init; }

sealed class Branch

  • History Parent { get; }
  • History History { get; }
  • long ForkStep { get; }
  • int PendingPokes { get; }
  • long? DivergenceStep { get; }
  • void ClearPending()
  • void Poke(in PokeCall call)
  • bool Step()

struct Color32

  • Color32(byte R, byte G, byte B, byte A = 255)
  • byte R { get; init; }
  • byte G { get; init; }
  • byte B { get; init; }
  • byte A { get; init; }
  • static Color32 White { get; }
  • static Color32 Grey { get; }

enum ColorMap

Values: Viridis, Heat, CoolWarm, Grayscale

static class ColorMaps

  • static Color32 NoData { get; }
  • static Color32 Evaluate(ColorMap map, float t)
  • static Color32 Evaluate(in FieldInfo field, float value)
  • static float Normalize(in FieldInfo field, float value)

struct Difference

  • Difference(EntityId Entity, string Field, string Left, string Right)
  • EntityId Entity { get; init; }
  • string Field { get; init; }
  • string Left { get; init; }
  • string Right { get; init; }

enum DrawFlags

Values: None, Wireframe, OnTop

struct DrawItem

  • DrawKind Kind
  • DrawFlags Flags
  • byte Overlay
  • int Layer
  • Color32 Color
  • EntityId Entity
  • Vector3 A
  • Vector3 B
  • int Field
  • Vector3 C
  • Quaternion Rotation
  • Vector3 Size
  • int First
  • int Count

enum DrawKind

Values: Line, Point, Triangle, Mesh, Box, Sphere, Capsule, Cylinder, Arrow, Label

sealed class DrawList

  • DrawList()
  • const int MaxItems
  • const int MaxVertices
  • const int MaxChars
  • const int MaxFieldBindings
  • const int MaxFieldValues
  • ReadOnlySpan<DrawItem> Items { get; }
  • ReadOnlySpan<Vector3> Vertices { get; }
  • ReadOnlySpan<int> Indices { get; }
  • ReadOnlySpan<char> TextChars { get; }
  • int Dropped { get; }
  • IReadOnlyList<FieldBinding> FieldBindings { get; }
  • ReadOnlySpan<float> FieldValues { get; }
  • void Arrow(Vector3 from, Vector3 to, float headSize, in DrawStyle style)
  • void Box(Vector3 center, Vector3 halfExtents, Quaternion rotation, in DrawStyle style)
  • void Capsule(Vector3 a, Vector3 b, float radius, in DrawStyle style)
  • void Clear()
  • void Cylinder(Vector3 a, Vector3 b, float radius, in DrawStyle style)
  • Color32 FieldColorAt(in DrawItem item, int indexPosition)
  • void FieldMesh(ReadOnlySpan<Vector3> vertices, ReadOnlySpan<int> indices, ReadOnlySpan<float> values, FieldDomain domain, in FieldInfo field, in DrawStyle style)
  • void FieldPoints(ReadOnlySpan<Vector3> positions, ReadOnlySpan<float> values, in FieldInfo field, float pixels, in DrawStyle style)
  • float FieldValueAt(in DrawItem item, int indexPosition)
  • float FieldValueOf(in DrawItem item)
  • void Label(Vector3 at, ReadOnlySpan<char> text, in DrawStyle style)
  • void Line(Vector3 a, Vector3 b, in DrawStyle style)
  • void Mesh(ReadOnlySpan<Vector3> vertices, ReadOnlySpan<int> indices, in DrawStyle style)
  • void Point(Vector3 at, float pixels, in DrawStyle style)
  • void Sphere(Vector3 center, float radius, in DrawStyle style)
  • ReadOnlySpan<char> TextOf(in DrawItem item)
  • void Triangle(Vector3 a, Vector3 b, Vector3 c, in DrawStyle style)

struct DrawRequest

  • DrawRequest(ulong Overlays)
  • ulong Overlays { get; init; }
  • bool IsOn(int overlay)

struct DrawStyle

  • DrawStyle(Color32 Color, int Overlay = 0, int Layer = 0, DrawFlags Flags = None, EntityId Entity = default)
  • DrawStyle(Color32 color, int overlay, int layer, DrawFlags flags)
  • Color32 Color { get; init; }
  • int Overlay { get; init; }
  • int Layer { get; init; }
  • DrawFlags Flags { get; init; }
  • EntityId Entity { get; init; }

struct EntityId

  • EntityId(ulong Value)
  • ulong Value { get; init; }
  • static EntityId None { get; }
  • bool IsSome { get; }

struct EntityInfo

  • EntityInfo(EntityId Id, EntityId Parent, string Kind, string Name)
  • EntityId Id { get; init; }
  • EntityId Parent { get; init; }
  • string Kind { get; init; }
  • string Name { get; init; }

struct EntityKindInfo

  • EntityKindInfo(string Id, string Name)
  • string Id { get; init; }
  • string Name { get; init; }
  • EntityLink(EntityId Entity, LinkDirection Direction, string Source, EntityId Other, long Step)
  • EntityId Entity { get; init; }
  • LinkDirection Direction { get; init; }
  • string Source { get; init; }
  • EntityId Other { get; init; }
  • long Step { get; init; }

sealed class EntityMap

  • static EntityMap Identity { get; }
  • bool IsIdentity { get; }
  • int PairCount { get; }
  • static EntityMap FromPairs(IEnumerable<KeyValuePair<EntityId, EntityId>> pairs)
  • bool TryMap(EntityId left, out EntityId right)

struct FieldBinding

  • FieldBinding(FieldInfo Field, FieldDomain Domain, int ValueStart, int ValueCount, int VertexBase)
  • FieldInfo Field { get; init; }
  • FieldDomain Domain { get; init; }
  • int ValueStart { get; init; }
  • int ValueCount { get; init; }
  • int VertexBase { get; init; }

enum FieldDomain

Values: Vertex, Element

struct FieldInfo

  • FieldInfo(string Id, string Name, ColorMap Map, double Min, double Max, string Unit = )
  • string Id { get; init; }
  • string Name { get; init; }
  • ColorMap Map { get; init; }
  • double Min { get; init; }
  • double Max { get; init; }
  • string Unit { get; init; }

sealed class Finding

  • Finding(long Step, string Code, Severity Severity, IReadOnlyList<EntityId> Entities, string Text, string SuggestedChange)
  • long Step { get; init; }
  • string Code { get; init; }
  • Severity Severity { get; init; }
  • IReadOnlyList<EntityId> Entities { get; init; }
  • string Text { get; init; }
  • string SuggestedChange { get; init; }

struct GhostInfo

  • GhostInfo(string ModuleId, string LibraryVersion, string Scene, string Replay)
  • string ModuleId { get; init; }
  • string LibraryVersion { get; init; }
  • string Scene { get; init; }
  • string Replay { get; init; }

sealed class History

  • History(IScopeSource source, ScopeHistoryOptions options = default)
  • const string MismatchCode
  • IScopeSource Source { get; }
  • Recording Recording { get; }
  • long CurrentStep { get; }
  • long StartStep { get; }
  • long EndStep { get; }
  • long StepCount { get; }
  • long? FirstHashMismatch { get; }
  • IScopeWorld World { get; }
  • IScopeWorld View { get; }
  • string ViewAxis { get; }
  • int ViewPosition { get; }
  • ulong StateHash { get; }
  • int KeyframeCount { get; }
  • long KeyframeBytes { get; }
  • IEnumerable<long> KeyframeSteps { get; }
  • long ScannedThrough { get; }
  • IReadOnlyList<TrackData> Tracks { get; }
  • IReadOnlyList<Finding> Findings { get; }
  • IReadOnlyList<Branch> Branches { get; }
  • Branch Adopt(History child, long forkStep)
  • Difference? Diff(History other, long step)
  • Branch Fork(long step)
  • void Scan(long throughStep = 9223372036854775807)
  • void Seek(long step)
  • void Seek(string axis, long position)
  • bool Step()
  • bool Step(string axis, long delta = 1)

interface ILiveModule : IScopeModule

  • ILiveSource OpenLive(string libraryVersion, int formatVersion, ReadOnlyMemory<byte> snapshot, string name)

interface ILiveSource

  • IScopeSource Source { get; }
  • void AppendRecord(ReadOnlySpan<byte> record)

interface IScopeModule

  • string Id { get; }
  • string Name { get; }
  • IScopeSource Open(ReadOnlyMemory<byte> data, string name)

interface IScopeSource

  • SourceInfo Info { get; }
  • Recording Recording { get; }
  • IScopeWorld CreateWorld()
  • IScopeSource WithRecording(Recording recording)
  • void WriteReplay(IBufferWriter<byte> writer)

interface IScopeWorld

  • long Step { get; }
  • void Advance(ReadOnlySpan<byte> input, TimelineSink sink)
  • void AdvanceAxis(string axis, int position, ReadOnlySpan<byte> input)
  • void CollectEntities(List<EntityInfo> into)
  • void CollectLinks(List<EntityLink> into)
  • SharedDifference CompareShared(IScopeWorld other, EntityMap map)
  • void Draw(DrawList into, in DrawRequest request)
  • void EncodePoke(in PokeCall call, IBufferWriter<byte> into)
  • Difference? FirstDifference(IScopeWorld other)
  • ulong Hash()
  • bool Inspect(EntityId entity, PropertyList into)
  • void Restore(ReadOnlySpan<byte> snapshot)
  • bool TryReadField(string field, EntityId entity, out double value)
  • bool TryReadFieldAt(string field, Vector3 point, out double value)
  • void WriteSnapshot(IBufferWriter<byte> writer)

struct LengthUnit

  • LengthUnit(string Name, double Metres)
  • string Name { get; init; }
  • double Metres { get; init; }
  • static LengthUnit Metre { get; }
  • static LengthUnit Millimetre { get; }
  • static LengthUnit Centimetre { get; }
  • static LengthUnit Kilometre { get; }
  • static LengthUnit Inch { get; }
  • static LengthUnit Foot { get; }
  • static LengthUnit Pixel { get; }
  • bool HasPhysicalSize { get; }

enum LinkDirection

Values: Continues, ContinuedBy

struct OverlayInfo

  • OverlayInfo(int Id, string Name, bool DefaultOn)
  • int Id { get; init; }
  • string Name { get; init; }
  • bool DefaultOn { get; init; }

struct ParamInfo

  • ParamInfo(string Name, ValueKind Kind)
  • string Name { get; init; }
  • ValueKind Kind { get; init; }

struct PokeCall

  • PokeCall(string Poke, ScopeValue[] Args)
  • string Poke { get; init; }
  • ScopeValue[] Args { get; init; }

struct PokeInfo

  • PokeInfo(string Id, string Name, ParamInfo[] Params)
  • string Id { get; init; }
  • string Name { get; init; }
  • ParamInfo[] Params { get; init; }
  • PokeRole Role { get; init; }

enum PokeRole

Values: None, DragToPoint

sealed class PoseCache

  • const ushort Version
  • const int MaxBytes
  • const int MaxEntities
  • const int MaxFrames
  • const int MaxTextBytes
  • static ReadOnlySpan<byte> Magic { get; }
  • PoseCacheInfo Info { get; }
  • IReadOnlyList<PoseEntity> Entities { get; }
  • int FrameCount { get; }
  • long StartStep { get; }
  • static PoseCache Create(PoseCacheInfo info, IReadOnlyList<PoseEntity> entities, float[] poses)
  • static bool HasMagic(ReadOnlySpan<byte> data)
  • static PoseCache Parse(ReadOnlyMemory<byte> data, string name)
  • bool TryGetPose(int frame, int entity, out Vector3 position, out Quaternion rotation)
  • void Write(IBufferWriter<byte> writer)

struct PoseCacheInfo

  • PoseCacheInfo(int Dimensions, LengthUnit Unit, long StartStep, string ModuleId, string LibraryVersion, string Scene, string Replay, string Label)
  • int Dimensions { get; init; }
  • LengthUnit Unit { get; init; }
  • long StartStep { get; init; }
  • string ModuleId { get; init; }
  • string LibraryVersion { get; init; }
  • string Scene { get; init; }
  • string Replay { get; init; }
  • string Label { get; init; }

struct PoseEntity

  • PoseEntity(EntityId Id, string Name, PoseShape Shape, Vector3 Size)
  • EntityId Id { get; init; }
  • string Name { get; init; }
  • PoseShape Shape { get; init; }
  • Vector3 Size { get; init; }

enum PoseShape

Values: Point, Sphere, Box, Capsule

struct Property

  • Property(string Group, string Name, ScopeValue Value)
  • string Group { get; init; }
  • string Name { get; init; }
  • ScopeValue Value { get; init; }

sealed class PropertyList

  • PropertyList()
  • const int MaxRows
  • IReadOnlyList<Property> Rows { get; }
  • void Add(string group, string name, ScopeValue value)
  • void Clear()

sealed class Recording

  • const int MaxInputBytes
  • ReadOnlyMemory<byte> Setup { get; }
  • long StartStep { get; }
  • long StepCount { get; }
  • long EndStep { get; }
  • ReadOnlyMemory<ulong> ExpectedHashes { get; }
  • bool IsWritable { get; }
  • void Append(ReadOnlySpan<byte> input)
  • static Recording Create(ReadOnlyMemory<byte> setup, IEnumerable<ReadOnlyMemory<byte>> inputs)
  • static Recording Create(ReadOnlyMemory<byte> setup, IEnumerable<ReadOnlyMemory<byte>> inputs, long startStep, ReadOnlyMemory<ulong> expectedHashes = default)
  • long? FirstDifference(Recording other)
  • Recording Fork(long step)
  • ReadOnlyMemory<byte> InputAt(long step)

sealed class ScopeFormatException : Exception

  • ScopeFormatException(string input, string message)
  • string Input { get; }

sealed class ScopeHistoryOptions

  • ScopeHistoryOptions()
  • const int DefaultKeyframeInterval
  • int KeyframeInterval { get; init; }
  • int MaxKeyframes { get; init; }
  • int MaxTrackSamples { get; init; }
  • int MaxFindings { get; init; }

struct ScopeValue

  • ValueKind Kind { get; }
  • bool Equals(ScopeValue other)
  • bool Equals(object obj)
  • bool GetBool()
  • EntityId GetEntity()
  • int GetHashCode()
  • long GetInteger()
  • double GetNumber()
  • string GetText()
  • Vector3 GetVector()
  • static ScopeValue OfBool(bool value)
  • static ScopeValue OfEntity(EntityId value)
  • static ScopeValue OfInteger(long value)
  • static ScopeValue OfNumber(double value)
  • static ScopeValue OfText(string value)
  • static ScopeValue OfVector(Vector3 value)
  • string ToString()

enum Severity

Values: Info, Warning, Error

static class SharedDiff

  • static SharedDifference Compare(IScopeWorld left, IScopeWorld right, EntityMap map)

struct SharedDifference

  • SharedDifference(Difference? First, int Shared, int OnlyLeft, int OnlyRight)
  • Difference? First { get; init; }
  • int Shared { get; init; }
  • int OnlyLeft { get; init; }
  • int OnlyRight { get; init; }

sealed class SourceInfo

  • SourceInfo()
  • string ModuleId { get; init; }
  • string Name { get; init; }
  • int Dimensions { get; init; }
  • LengthUnit Unit { get; init; }
  • IReadOnlyList<AxisInfo> Axes { get; init; }
  • IReadOnlyList<EntityKindInfo> EntityKinds { get; init; }
  • IReadOnlyList<OverlayInfo> Overlays { get; init; }
  • IReadOnlyList<PokeInfo> Pokes { get; init; }
  • IReadOnlyList<TrackInfo> Tracks { get; init; }
  • IReadOnlyList<FieldInfo> Fields { get; init; }
  • string LinkKey { get; init; }
  • string EffectiveLinkKey { get; }
  • GhostInfo? Ghost { get; init; }

sealed class TimelineSink

  • static TimelineSink None { get; }
  • bool IsRecording { get; }
  • long Step { get; }
  • void Event(string track, EntityId entity, string text)
  • void Finding(string code, Severity severity, IReadOnlyList<EntityId> entities, string text, string suggestedChange = default)
  • void Marker(string track, string label)
  • void Sample(string track, double value)

sealed class TrackData

  • TrackInfo Info { get; }
  • IReadOnlyList<TrackSample> Samples { get; }
  • bool Truncated { get; }

struct TrackInfo

  • TrackInfo(string Id, string Name, TrackKind Kind)
  • string Id { get; init; }
  • string Name { get; init; }
  • TrackKind Kind { get; init; }

enum TrackKind

Values: Event, Marker, Series

struct TrackSample

  • TrackSample(long Step, double Value, EntityId Entity, string Text)
  • long Step { get; init; }
  • double Value { get; init; }
  • EntityId Entity { get; init; }
  • string Text { get; init; }

enum ValueKind

Values: None, Bool, Integer, Number, Text, Vector, Entity

RecursiveAI.OneScope.Probe

interface ISnapshotSource

  • void WriteSnapshot(IBufferWriter<byte> writer)

static class ProbeDirectory

  • const string OverrideVariable
  • const string SocketExtension
  • static string Default()
  • static void Prepare(string directory)

sealed class ProbeFormatException : Exception

  • ProbeFormatException(string input, string message)
  • string Input { get; }

enum ProbeFrameKind

Values: Snapshot, Record, End

struct ProbeHandshake

  • ProbeHandshake(ProbeInfo Info, int ProcessId)
  • ProbeInfo Info { get; init; }
  • int ProcessId { get; init; }

struct ProbeInfo

  • ProbeInfo(string ModuleId, string LibraryVersion, int FormatVersion)
  • string ModuleId { get; init; }
  • string LibraryVersion { get; init; }
  • int FormatVersion { get; init; }

struct ProbeLimits

  • ProbeLimits(int MaxSnapshotBytes, int MaxRecordBytes)
  • int MaxSnapshotBytes { get; init; }
  • int MaxRecordBytes { get; init; }
  • static ProbeLimits Default { get; }

sealed class ProbeOptions

  • ProbeOptions()
  • string Directory { get; init; }
  • bool Listen { get; init; }
  • int MaxBufferedBytes { get; init; }
  • int MaxSnapshotBytes { get; init; }
  • int SendTimeoutMilliseconds { get; init; }

static class ProbeWire

  • const ushort ProtocolVersion
  • const byte AttachCommand
  • const int HandshakeHeaderLength
  • const int MaxStringBytes
  • const int MaxHandshakeLength
  • const int FrameHeaderLength
  • static int HandshakeLength(in ProbeInfo info)
  • static ProbeHandshake ParseHandshake(ReadOnlySpan<byte> bytes, string input)
  • static ValueTuple<ProbeFrameKind, int> ReadFrameHeader(ReadOnlySpan<byte> header, in ProbeLimits limits, bool first, string input)
  • static int ReadHandshakeStringBytes(ReadOnlySpan<byte> header, string input)
  • static void WriteFrameHeader(Span<byte> destination, ProbeFrameKind kind, int length)
  • static int WriteHandshake(Span<byte> destination, in ProbeInfo info, int processId)

sealed class ScopeProbe

  • ProbeInfo Info { get; }
  • ISnapshotSource Snapshots { get; }
  • bool IsConnected { get; }
  • bool IsListening { get; }
  • string SocketPath { get; }
  • int DroppedViewers { get; }
  • string LastDropReason { get; }
  • static ScopeProbe Attach(ProbeInfo info, ISnapshotSource snapshots)
  • static ScopeProbe Attach(ProbeInfo info, ISnapshotSource snapshots, ProbeOptions options)
  • void Dispose()
  • void Poll()
  • void Record(ReadOnlySpan<byte> record)

RecursiveAI.OneScope.Attach

enum ClientState

Values: Streaming, Ended, Disconnected, Failed, Closed

sealed class LiveSession

  • const int RecordOverheadBytes
  • const long DefaultMaxRecordBytes
  • string Name { get; }
  • ProbeHandshake Handshake { get; }
  • ILiveSource Live { get; }
  • History History { get; }
  • ClientState State { get; }
  • long MaxRecordBytes { get; }
  • long RecordBytes { get; }
  • bool Capped { get; }
  • ProbeFormatException StreamError { get; }
  • static LiveSession Connect(string socketPath, IReadOnlyList<IScopeModule> modules, ScopeHistoryOptions options = default, ProbeLimits? limits = default, long maxRecordBytes = 268435456, int timeoutMilliseconds = 5000)
  • void Dispose()
  • int Pump(int max = 2147483647)

sealed class ProbeClient

  • static long MaxQueuedBytes { get; }
  • ProbeHandshake Handshake { get; }
  • byte[] Snapshot { get; }
  • ClientState State { get; }
  • ProbeFormatException Error { get; }
  • static ProbeClient Connect(string socketPath, ProbeLimits? limits = default, int timeoutMilliseconds = 5000)
  • void Dispose()
  • int Drain(List<byte[]> into, int max = 2147483647)

sealed class ProbeEntry

  • ProbeEntry(string SocketPath, ProbeHandshake Handshake)
  • string SocketPath { get; init; }
  • ProbeHandshake Handshake { get; init; }
  • int ProcessId { get; }

static class ProbeFinder

  • static ProbeListing List(string directory = default, int timeoutMilliseconds = 2000)
  • static ProbeHandshake ReadHandshake(string socketPath, int timeoutMilliseconds = 2000)

sealed class ProbeListing

  • ProbeListing(IReadOnlyList<ProbeEntry> Running, IReadOnlyList<string> Removed, IReadOnlyList<string> Unreadable)
  • IReadOnlyList<ProbeEntry> Running { get; init; }
  • IReadOnlyList<string> Removed { get; init; }
  • IReadOnlyList<string> Unreadable { get; init; }

sealed class RestoredSession

  • RestoredSession(long CursorStep, ReadOnlyMemory<byte> Layout, IReadOnlyList<RestoredSource> Sources)
  • long CursorStep { get; init; }
  • ReadOnlyMemory<byte> Layout { get; init; }
  • IReadOnlyList<RestoredSource> Sources { get; init; }

sealed class RestoredSource

  • RestoredSource(int Index, string Name, IScopeSource Source, History History, int ParentIndex, long ForkStep, long? DivergenceStep, Branch Branch = default)
  • int Index { get; init; }
  • string Name { get; init; }
  • IScopeSource Source { get; init; }
  • History History { get; init; }
  • int ParentIndex { get; init; }
  • long ForkStep { get; init; }
  • long? DivergenceStep { get; init; }
  • Branch Branch { get; init; }

sealed class SessionFile

  • SessionFile()
  • const ushort Version
  • const int HeaderLength
  • const int SourceHeaderLength
  • const int MaxStringBytes
  • long CursorStep { get; set; }
  • List<SessionSource> Sources { get; }
  • ReadOnlyMemory<byte> Layout { get; set; }
  • static SessionFile Load(string path, SessionLimits? limits = default)
  • static SessionFile Parse(ReadOnlyMemory<byte> bytes, string input, SessionLimits? limits = default)
  • void Write(IBufferWriter<byte> writer)

struct SessionLimits

  • SessionLimits(long MaxFileBytes, int MaxSources, int MaxLayoutBytes)
  • long MaxFileBytes { get; init; }
  • int MaxSources { get; init; }
  • int MaxLayoutBytes { get; init; }
  • static SessionLimits Default { get; }

static class SessionRestore

  • static RestoredSession Open(SessionFile file, IReadOnlyList<IScopeModule> modules, Func<string, byte[]> readFile)

sealed class SessionSource

  • string ModuleId { get; }
  • string Name { get; }
  • SessionSourceKind Kind { get; }
  • int ParentIndex { get; }
  • long ForkStep { get; }
  • int KeyframeInterval { get; }
  • ReadOnlyMemory<byte> Replay { get; }
  • string Path { get; }
  • byte[] Sha256 { get; }
  • static SessionSource Embed(IScopeSource source, int keyframeInterval = 64)
  • static SessionSource EmbedFork(IScopeSource source, int parentIndex, long forkStep, int keyframeInterval = 64)
  • static SessionSource Reference(string moduleId, string name, string path, ReadOnlySpan<byte> fileBytes, int keyframeInterval = 64)

enum SessionSourceKind

Values: Embedded, Referenced