# OpenMAIC Fire-and-Forget Action Types: Spotlight and Laser Effects Explained

> Explore OpenMAIC's fire-and-forget action types spotlight and laser. Trigger visual effects without blocking playback in your presentations.

- Repository: [MAIC/OpenMAIC](https://github.com/THU-MAIC/OpenMAIC)
- Tags: deep-dive
- Published: 2026-09-05

---

**OpenMAIC's Action Engine supports exactly two fire-and-forget action types—`spotlight` and `laser`—which trigger visual effects on presentation slides without blocking the playback cursor.**

The OpenMAIC framework provides a declarative DSL for creating interactive presentations, where the Action Engine orchestrates how visual effects execute during playback. Understanding these OpenMAIC fire-and-forget action types is essential for developers who need to implement non-blocking visual cues that enhance slides while maintaining smooth timeline progression.

## What Are Fire-and-Forget Actions?

Fire-and-forget actions in OpenMAIC are visual effects that execute immediately and persist on screen for a predefined duration without halting the presentation timeline. Unlike blocking actions that pause playback until completion, these actions allow the cursor to advance instantly while the effect remains visible.

According to the source code in [`lib/choreography/timeline.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/choreography/timeline.ts), fire-and-forget actions "do not block: playback continues immediately, and the effect persists visually for `EFFECT_AUTO_CLEAR_MS` before auto-clearing." This behavior makes them ideal for highlighting content without disrupting the presentation flow.

## Supported Fire-and-Forget Action Types

OpenMAIC defines these actions as distinct TypeScript interfaces in `packages/@openmaic/dsl/src/action.ts`. The engine recognizes them through the `FIRE_AND_FORGET_ACTIONS` constant array.

### Spotlight Action

The **SpotlightAction** highlights a single element on the slide while dimming all surrounding content. This creates a focus effect that draws audience attention to specific content without stopping the presentation.

The interface is defined at lines 30-34 of `packages/@openmaic/dsl/src/action.ts` and includes properties for targeting specific elements and controlling the dim opacity level.

```typescript
// Example: Spotlight fire-and-forget action
const spotlight: SpotlightAction = {
  id: 'action-01',
  type: 'spotlight',
  elementId: 'slide-element-42',
  dimOpacity: 0.4,
};

```

### Laser Action

The **LaserAction** projects a laser pointer effect onto a specific slide element. This simulates a physical laser pointer, providing temporary emphasis that automatically clears after the configured duration.

Defined at lines 36-41 of `packages/@openmaic/dsl/src/action.ts`, this action type accepts a color property to customize the laser appearance.

```typescript
// Example: Laser fire-and-forget action
const laser: LaserAction = {
  id: 'action-02',
  type: 'laser',
  elementId: 'slide-element-99',
  color: '#ff00ff',
};

```

## Timeline Resolution and Non-Blocking Behavior

The timeline resolver in [`lib/choreography/timeline.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/choreography/timeline.ts) differentiates fire-and-forget actions from blocking actions using a `Set` constructed from `FIRE_AND_FORGET_ACTIONS`.

The resolver instantiates a lookup Set for O(1) testing:

```typescript
const FIRE_AND_FORGET = new Set<string>(FIRE_AND_FORGET_ACTIONS);

```

When processing actions, the engine checks against this Set to determine cursor behavior. If an action type exists in `FIRE_AND_FORGET`, the engine immediately advances to the next action while keeping the visual effect active. After `EFFECT_AUTO_CLEAR_MS` milliseconds, the effect automatically clears from the slide.

This implementation ensures that **spotlight** and **laser** effects remain the only non-blocking visual actions in the OpenMAIC system, as defined by the constants in the choreography layer.

## Summary

OpenMAIC provides precisely two fire-and-forget action types for non-blocking visual effects:

- **SpotlightAction**: Highlights individual elements while dimming surrounding content, defined in `packages/@openmaic/dsl/src/action.ts`
- **LaserAction**: Projects a colored laser pointer onto specific elements with automatic timeout behavior
- Both actions are identified by the `FIRE_AND_FORGET_ACTIONS` constant and processed by the timeline resolver in [`lib/choreography/timeline.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/choreography/timeline.ts)
- The playback cursor advances immediately when these actions trigger, with effects auto-clearing after `EFFECT_AUTO_CLEAR_MS` milliseconds

## Frequently Asked Questions

### How do fire-and-forget actions differ from blocking actions in OpenMAIC?

Fire-and-forget actions allow the playback cursor to advance immediately after triggering, whereas blocking actions pause timeline progression until completion. According to the timeline resolver implementation in [`lib/choreography/timeline.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/choreography/timeline.ts), fire-and-forget effects persist visually for a configured duration (`EFFECT_AUTO_CLEAR_MS`) without holding up subsequent actions.

### Can I create custom fire-and-forget action types in OpenMAIC?

Currently, OpenMAIC hardcodes the `FIRE_AND_FORGET_ACTIONS` constant to include only `spotlight` and `laser` types. The timeline resolver builds a static Set from this constant at initialization, meaning the engine recognizes only these two action types as non-blocking. Extending this behavior would require modifying the constants in both `packages/@openmaic/dsl/src/action.ts` and [`lib/choreography/timeline.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/choreography/timeline.ts).

### What determines how long fire-and-forget effects remain visible?

The visibility duration is controlled by the `EFFECT_AUTO_CLEAR_MS` constant referenced in [`lib/choreography/timeline.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/choreography/timeline.ts). This configuration specifies the millisecond delay before the engine automatically clears fire-and-forget visual effects from the slide, ensuring temporary highlights do not persist indefinitely.

### Which source files define the fire-and-forget action interfaces?

The TypeScript interfaces for `SpotlightAction` and `LaserAction` reside in `packages/@openmaic/dsl/src/action.ts` at lines 30-34 and 36-41 respectively. The runtime recognition logic and Set-based testing mechanism exist in [`lib/choreography/timeline.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/choreography/timeline.ts), where the `FIRE_AND_FORGET_ACTIONS` constant drives the non-blocking behavior detection.