PHPackages                             carono/yii2-ai-dialog - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. carono/yii2-ai-dialog

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

carono/yii2-ai-dialog
=====================

Yii2 widget that embeds an AI assistant dialog for use during development

1.0.0(2d ago)00BSD-3-ClausePHPPHP ^8.1

Since Jun 7Pushed 2d agoCompare

[ Source](https://github.com/carono/yii2-ai-dialog)[ Packagist](https://packagist.org/packages/carono/yii2-ai-dialog)[ Docs](https://github.com/carono/yii2-ai-dialog)[ RSS](/packages/carono-yii2-ai-dialog/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (10)Versions (2)Used By (0)

 [ ![Yii](https://camo.githubusercontent.com/8317c17418b39410a660f5149071d26c5023c0d5fb2b7ebb771324812f666d73/68747470733a2f2f796969736f66742e6769746875622e696f2f646f63732f696d616765732f7969695f6c6f676f2e737667) ](https://github.com/yiisoft)

Yii AI Dialog
=============

[](#yii-ai-dialog)

[![Latest Stable Version](https://camo.githubusercontent.com/f43c1b76369ed32dad1f190be30217d99e605a32856a868dff9e01bf8b2d1c1a/68747470733a2f2f706f7365722e707567782e6f72672f6361726f6e6f2f796969322d61692d6469616c6f672f76)](https://packagist.org/packages/carono/yii2-ai-dialog)[![Total Downloads](https://camo.githubusercontent.com/2116d63ac78a0e0b899be6fcada58e9a7058b3d922febe8e5b1cc54883be5acf/68747470733a2f2f706f7365722e707567782e6f72672f6361726f6e6f2f796969322d61692d6469616c6f672f646f776e6c6f616473)](https://packagist.org/packages/carono/yii2-ai-dialog)[![Build status](https://github.com/carono/yii2-ai-dialog/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/carono/yii2-ai-dialog/actions/workflows/build.yml?query=branch%3Amaster)[![Code Coverage](https://camo.githubusercontent.com/2e2a44dbdf8dfc69543f34e298088f7ce76b6a02f1b1238cbecb416a8b8d6cac/68747470733a2f2f636f6465636f762e696f2f67682f6361726f6e6f2f796969322d61692d6469616c6f672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/carono/yii2-ai-dialog)[![Mutation testing badge](https://camo.githubusercontent.com/4c7d72879fea99a95307b91cd379a1cc1476fc8b11c78e981cd3bf7e1d4d762f/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532466361726f6e6f253246796969322d61692d6469616c6f672532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/carono/yii2-ai-dialog/master)[![Static analysis](https://github.com/carono/yii2-ai-dialog/actions/workflows/static.yml/badge.svg?branch=master)](https://github.com/carono/yii2-ai-dialog/actions/workflows/static.yml?query=branch%3Amaster)[![type-coverage](https://camo.githubusercontent.com/cf0b9428f6582dedd15b380a98b47b454a6bb0d535abae2d3ff632987852bf52/68747470733a2f2f73686570686572642e6465762f6769746875622f6361726f6e6f2f796969322d61692d6469616c6f672f636f7665726167652e737667)](https://shepherd.dev/github/carono/yii2-ai-dialog)[![psalm-level](https://camo.githubusercontent.com/6ce50bee93cfe6f122650455132ad2089705786b0f5092c3b60c8c3c41f2f603/68747470733a2f2f73686570686572642e6465762f6769746875622f6361726f6e6f2f796969322d61692d6469616c6f672f6c6576656c2e737667)](https://shepherd.dev/github/carono/yii2-ai-dialog)

This package embeds the [ai-dialog](https://github.com/carono/ai-dialog) AI chat widget into a Yii2 application: a 💬 button in the page corner that sends the current page context to a shared gateway and streams the answer back. It is wired up **like the debug toolbar** — through `bootstrap` in the dev section of the config, guarded by IP. Nothing is added to the project's code (layout, assets): the widget bundle `widget.js` is pulled in as an npm-asset Composer dependency and wired up automatically.

> 🇷🇺 Документация на русском: [`docs/README.ru.md`](docs/README.ru.md).

Requirements
------------

[](#requirements)

- PHP 8.1 or higher.

Installation
------------

[](#installation)

The widget bundle is distributed as an npm-asset (`npm-asset/carono-ai-dialog-widget`) and pulled in by Composer. Because Composer does not inherit repositories from dependencies, the **consuming project's `composer.json`** must enable asset-packagist once:

```
{
    "repositories": [
        { "type": "composer", "url": "https://asset-packagist.org" }
    ],
    "config": {
        "allow-plugins": {
            "composer/installers": true,
            "oomphinc/composer-installers-extender": true
        }
    },
    "extra": {
        "installer-types": ["npm-asset"],
        "installer-paths": {
            "vendor/npm-asset/{$name}": ["type:npm-asset"]
        }
    }
}
```

Then:

```
composer require carono/yii2-ai-dialog
```

> If Composer reports `npm-asset/carono-ai-dialog-widget could not be found`, asset-packagist has not indexed the package yet. As a temporary workaround add an inline repository to the project and re-run `require`:
>
> ```
> {
>     "type": "package",
>     "package": {
>         "name": "npm-asset/carono-ai-dialog-widget",
>         "version": "0.2.0",
>         "type": "npm-asset",
>         "dist": { "type": "tar", "url": "https://registry.npmjs.org/carono-ai-dialog-widget/-/carono-ai-dialog-widget-0.2.0.tgz" }
>     }
> }
> ```

Setup
-----

[](#setup)

All configuration lives in the config, in the dev section. As with `yii2-debug`, wrap the registration in `YII_ENV_DEV` so the widget never reaches production.

`config/web.php`:

```
$config = [ /* ... */ ];

if (YII_ENV_DEV) {
    $config['bootstrap'][] = 'aiDialog';
    $config['modules']['aiDialog'] = [
        'class'   => \Carono\AiDialog\Module::class,
        'project' => 'myapp',          // = the project key in the gateway's projects.json
        'token'   => 'project-secret', // = this project's token on the gateway
        // optional:
        // 'gateway'    => 'wss://wss.carono.site', // gateway address (this is the default)
        // 'allowedIPs' => ['127.0.0.1', '::1'],    // who sees the widget (same as debug)
        // 'enabled'    => true,                    // master switch
    ];

    // usually already present for debug/gii:
    // $config['bootstrap'][] = 'debug';
    // $config['modules']['debug'] = ['class' => \yii\debug\Module::class];
}
```

Three values must match the gateway side (`projects.json`):

Module optionWhat it isMust match`project`project identifierthe object key in `projects.json``token`project secretthe `token` field of that project`gateway`WebSocket gateway addressthe shared `wss://wss.carono.site`Registering a project on the gateway and the overall architecture are described in `docs/INTEGRATION.md` of the [ai-dialog](https://github.com/carono/ai-dialog) repository. In short: add a project entry to `projects.json` and restart the gateway.

### How it works

[](#how-it-works)

The module implements `BootstrapInterface`. On every request it checks the client IP against `allowedIPs` (the same logic as `yii\debug\Module`) and, if access is allowed and the response is a regular HTML page, appends a `` tag at the end of ``. JSON/AJAX responses are left untouched.

> Widget access is restricted by `allowedIPs` only; that is enough for local development. Protection of the gateway itself (the project token) lives on its side.

Documentation
-------------

[](#documentation)

- [Internals](docs/internals.md)

If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that. You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).

License
-------

[](#license)

The Yii AI Dialog is free software. It is released under the terms of the BSD License. Please see [`LICENSE`](./LICENSE.md) for more information.

Maintained by [Yii Software](https://www.yiiframework.com/).

Support the project
-------------------

[](#support-the-project)

[![Open Collective](https://camo.githubusercontent.com/a2b15f8e2268d4e3842e00d41ff7a57cce2ad8bd8d8769c5dc4fa05a546a4f62/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f70656e253230436f6c6c6563746976652d73706f6e736f722d3765616466313f6c6f676f3d6f70656e253230636f6c6c656374697665266c6f676f436f6c6f723d376561646631266c6162656c436f6c6f723d353535353535)](https://opencollective.com/yiisoft)

Follow updates
--------------

[](#follow-updates)

[![Official website](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)](https://www.yiiframework.com/)[![Twitter](https://camo.githubusercontent.com/d077c362ac639792171af8bc002ee827816733dfc0925f70b557e6d151022226/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f747769747465722d666f6c6c6f772d3144413146323f6c6f676f3d74776974746572266c6f676f436f6c6f723d314441314632266c6162656c436f6c6f723d3535353535353f7374796c653d666c6174)](https://twitter.com/yiiframework)[![Telegram](https://camo.githubusercontent.com/4e38dd12535575c39c65bea7119b95e663abb2d1f4e3d669a27bbda07ef603f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74656c656772616d2d6a6f696e2d3144413146323f7374796c653d666c6174266c6f676f3d74656c656772616d)](https://t.me/yii3en)[![Facebook](https://camo.githubusercontent.com/48204e301b34b29b0815854544f04c337fc0692096cab35e9a1f8c53a42c2307/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f66616365626f6f6b2d6a6f696e2d3144413146323f7374796c653d666c6174266c6f676f3d66616365626f6f6b266c6f676f436f6c6f723d666666666666)](https://www.facebook.com/groups/yiitalk)[![Slack](https://camo.githubusercontent.com/1a3645ba1c97e6684d0349bc478201e1621ba0d3efad516d81035364d442bad7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736c61636b2d6a6f696e2d3144413146323f7374796c653d666c6174266c6f676f3d736c61636b)](https://yiiframework.com/go/slack)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

2d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6193985?v=4)[Александр Касьянов](/maintainers/carono)[@carono](https://github.com/carono)

---

Tags

aidevelopmentyii2widgetdialogassistant

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/carono-yii2-ai-dialog/health.svg)

```
[![Health](https://phpackages.com/badges/carono-yii2-ai-dialog/health.svg)](https://phpackages.com/packages/carono-yii2-ai-dialog)
```

###  Alternatives

[softark/yii2-dual-listbox

Bootstrap Dual Listbox Widget for Yii 2

20149.1k11](/packages/softark-yii2-dual-listbox)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1358.5k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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