/// SPDX-License-Identifier: GPL-3.0-or-later /// SPDX-FileCopyrightText: Copyright © 2023 Tony Garnock-Jones // Each Turn executes one Task import type { AnyValue, Handle, Ref, Facet } from './actor.js'; import type { IdentitySet } from '@preserves/core'; export type Task = StructuredTask; export interface StructuredTask { perform(): void; describe(): T; } export type TaskDescription = | { type: 'bootActor', detail?: AnyValue } | { type: 'turn', tasks: TaskAction[] } ; export type TaskAction = { targetFacet: Facet, action: ActionDescription }; export type ActionDescription = | { type: 'spawnActor', detail?: AnyValue, initialAssertions: IdentitySet } | { type: 'stopActor', err?: AnyValue } | { type: 'inertCheck' } | { type: 'assert', target: Ref, handle: Handle, assertion: AnyValue } | { type: 'retract', target: Ref, handle: Handle } | { type: 'message', target: Ref, assertion: AnyValue } | { type: 'sync', target: Ref, callback: Ref } ;