@dxos/compute - v0.16.0
    Preparing search index...

    Interface SpawnOptions

    Options for spawning a process.

    interface SpawnOptions {
        annotations?: Dictionary;
        environment?: Environment;
        guard?: Guard;
        name?: string;
        notify?: {
            error?:
                | string
                | [string, { count?: number; defaultValue?: string; ns: string }];
            start?:
                | string
                | [string, { count?: number; defaultValue?: string; ns: string }];
            success?:
                | string
                | [string, { count?: number; defaultValue?: string; ns: string }];
        };
        origin?: Origin;
        parentProcessId?: string & Brand<"ProcessId">;
        target?: URI;
        traceMeta?: {
            conversation?: Ref<Unknown>;
            parentPid?: string;
            parentThread?: string;
            pid?: string;
            processName?: string;
            runId?: string;
            runtimeName?: string & Brand<"@dxos/compute/Trace/RuntimeName">;
            space?: string;
            thread?: string;
            toolCallId?: string;
            trigger?: Ref<Trigger.Trigger & OfKind<Object> & Unknown>;
        };
    }
    Index

    Properties

    annotations?: Dictionary

    User-defined annotations to attach to the process. Caller-supplied entries are merged over the target/notify shorthands.

    environment?: Environment
    guard?: Guard

    Admits the operations this process invokes that declare requirements. Inherited by children; a child's own guard is combined with its parent's, never replaces it. Not persisted, so a rehydrated process holds none and refuses operations that declare requirements.

    name?: string

    Process name for debugging purposes.

    notify?: {
        error?:
            | string
            | [string, { count?: number; defaultValue?: string; ns: string }];
        start?:
            | string
            | [string, { count?: number; defaultValue?: string; ns: string }];
        success?:
            | string
            | [string, { count?: number; defaultValue?: string; ns: string }];
    }

    User-facing notifications requested for this process's lifecycle phases. Ergonomic shorthand folded into NotifyAnnotation on the process annotations.

    Type declaration

    • Optional Readonlyerror?: string | [string, { count?: number; defaultValue?: string; ns: string }]

      Shown when the invocation fails.

    • Optional Readonlystart?: string | [string, { count?: number; defaultValue?: string; ns: string }]

      Shown when the invocation starts.

    • Optional Readonlysuccess?: string | [string, { count?: number; defaultValue?: string; ns: string }]

      Shown when the invocation succeeds.

    origin?: Origin

    Who the process's database writes are attributed to (see Database.Origin); also the origin of every process it invokes. Persisted with the process, so a restored process keeps it.

    parentProcessId?: string & Brand<"ProcessId">

    Parent process ID — child inherits the parent's trace context. Inside a process, its ManagerService defaults this to that process; pass undefined explicitly to spawn a detached process.

    target?: URI

    Target object that this process is assigned to. Ergonomic shorthand folded into TargetAnnotation on the process annotations.

    traceMeta?: {
        conversation?: Ref<Unknown>;
        parentPid?: string;
        parentThread?: string;
        pid?: string;
        processName?: string;
        runId?: string;
        runtimeName?: string & Brand<"@dxos/compute/Trace/RuntimeName">;
        space?: string;
        thread?: string;
        toolCallId?: string;
        trigger?: Ref<Trigger.Trigger & OfKind<Object> & Unknown>;
    }

    Tracing metadata for this invocation.

    Type declaration

    • Optional Readonlyconversation?: Ref<Unknown>

      Ref to the conversation feed object if present.

    • Optional ReadonlyparentPid?: string
    • Optional ReadonlyparentThread?: string

      Light thread of the parent process's turn that spawned this process.

    • Optional Readonlypid?: string
    • Optional ReadonlyprocessName?: string
    • Optional ReadonlyrunId?: string

      Pid of the first invocation of the run this message belongs to. A run that calls Operation.runAgain() continues in a new invocation with its own pid; each continuation carries the first invocation's pid here so consumers can show the run as one unit. Absent on the first invocation, whose own pid is the run's id.

    • Optional ReadonlyruntimeName?: string & Brand<"@dxos/compute/Trace/RuntimeName">

      Extensible name informing which runtime executed the code that produced the event.

    • Optional Readonlyspace?: string

      Space the message was produced in. Stored as a string to avoid circular dependency on @dxos/keys.

    • Optional Readonlythread?: string

      Lane of the process's turn that produced the event (see CurrentThread).

    • Optional ReadonlytoolCallId?: string

      ID of the tool call that created the current process.

    • Optional Readonlytrigger?: Ref<Trigger.Trigger & OfKind<Object> & Unknown>

      Ref to the trigger object if invocation resulted from a trigger.