PHPackages                             papi-ai/effect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. papi-ai/effect

ActiveLibrary

papi-ai/effect
==============

Effect/fiber async bridge for PapiAI, built on phunkie/effect and phunkie/streams

v0.10.0(yesterday)00MITPHP ^8.2

Since Jul 19Compare

[ Source](https://github.com/papi-ai/effect)[ Packagist](https://packagist.org/packages/papi-ai/effect)[ RSS](/packages/papi-ai-effect/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

papi-ai/effect
==============

[](#papi-aieffect)

Effect/fiber async bridge for [PapiAI](https://papi-ai.org), built on [`phunkie/effect`](https://packagist.org/packages/phunkie/effect) and [`phunkie/streams`](https://packagist.org/packages/phunkie/streams).

Long-running capabilities such as video generation (Google Veo, OpenAI Sora) can take minutes. This package lets you describe those jobs as pure `IO` effects, fork them into background fibers, and await the result later — **without** Symfony Messenger or any external queue.

Install
-------

[](#install)

```
composer require papi-ai/effect
```

Requires `papi-ai/papi-core` `^0.10` and a video-capable provider (e.g. `papi-ai/google` or `papi-ai/openai`).

Usage
-----

[](#usage)

```
use PapiAI\Google\GoogleProvider;
use PapiAI\Effect\EffectVideo;

$effect = new EffectVideo(new GoogleProvider($apiKey));

// Describe the work as a lazy IO (nothing runs yet)
$io = $effect->generateVideoIO('a cat surfing a giant wave', ['durationSeconds' => 8]);

// Fork into a background fiber and carry on
$handle = $effect->generateVideoAsync('a cat surfing a giant wave', ['durationSeconds' => 8]);
// ... do other work ...
$video = $handle->await();      // VideoResponse
$video->save('surf.mp4');
```

Compose the effects with `map()` / `flatMap()`, or run them synchronously with `unsafeRun()`.

### Progress as a stream

[](#progress-as-a-stream)

```
$jobId = $effect->startVideoIO('a neon city at night')->unsafeRun();

foreach ($effect->progressStream($jobId)->toArray() as $status) {
    echo $status->status, "\n"; // running, running, ... completed
}
```

API
---

[](#api)

`EffectVideo` wraps any `VideoProviderInterface`:

MethodReturnsNotes`generateVideoIO($prompt, $options)``IO`blocking generation as a lazy effect`startVideoIO($prompt, $options)``IO`submit, produce a job id`videoStatusIO($jobId)``IO`poll status`fetchVideoIO($jobId)``IO`fetch a completed job`generateVideoAsync($prompt, $options, $context?)``AsyncHandle`fork into a fiber; `await()` later`progressStream($jobId, $maxPolls = 60)``Stream`observed statuses until terminalLicense
-------

[](#license)

MIT © Marcello Duarte

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/70713?v=4)[md](/maintainers/md)[@md](https://github.com/md)

###  Code Quality

TestsPest

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/papi-ai-effect/health.svg)

```
[![Health](https://phpackages.com/badges/papi-ai-effect/health.svg)](https://phpackages.com/packages/papi-ai-effect)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
