Commit graph

8 commits

Author SHA1 Message Date
opencode-agent
bb2093b67f chore(repo): bump version to 1.0.5 2026-08-04 12:08:56 +00:00
Sergey
186403c2d5
chore(repo): bump version to 1.0.4 and add AGENTS.md (#45)
## Что сделано

- Создан `AGENTS.md` в корне репо — проект-specific правила для агентов
(дистилляция memory-файла): version bump (CRITICAL), `@connect`,
dist-деплой, `@icon`, селекторы композера, стек, команды, структура
`src/`, тесты.
- Version bump 1.0.3 → 1.0.4 синхронно в двух файлах: `vite.config.ts`
(`userscript.version`) + `package.json` (`version`).

## Почему

PR #43 смержен с фичами (custom endpoint, temperature, short prompt)
**без** version bump — Tampermonkey/Violentmonkey не видят
автообновление, юзеры не получат новую версию. В репо отсутствовал
`AGENTS.md` — subagent'ы работали вслепую без проект-specific правил,
что и привело к пропущенному bump'у. `AGENTS.md` фиксирует критичные
инварианты для будущих PR-агентов.

## Watch out

- `AGENTS.md` дополняет глобальный `~/.config/opencode/AGENTS.md`, НЕ
заменяет его — opencode грузит оба файла вместе.
- Version bump — patch increment (semver-совместимый). Без bump
`@version` userscript-менеджеры не триггерят автообновление.
- Файлы `src/`, `tests/`, `@connect`, селекторы композера — НЕ тронуты
(вне scope).
- `dist` ветка обновится автоматически через `deploy.yml` после merge в
`main`.

## Pending

- Авто-деплой в `dist` после merge (deploy.yml,
peaceiris/actions-gh-pages@v4).

Closes #44

Closes #44

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-08-04 12:49:01 +03:00
Sergey
e4ec12960f
fix(ui): skip composer injection in child session (#33)
## Что сделано

Фикс бага из issue #32: в child session (subagent) кнопка 🎤 появлялась
над disabled-блоком "Prompt is disabled / Back to parent", а клик падал
с toast "Could not find input field".

- **`src/ui.ts` `findComposer()`** — добавлен guard:
`session-prompt-dock` skip'ается в цикле `COMPOSER_SELECTORS`, если
внутри него НЕТ `[data-component="prompt-input"]` или
`[data-component="prompt-input-v2"]`. В child session внутри dock'а
только disabled-блок — guard срабатывает, `findComposer()` возвращает
`null`, кнопка не вставляется.
- **`src/ui.ts` `injectIntoComposer()`** — defence-in-depth: ранний
return, если в документе нет `[data-component="prompt-input"],
[data-component="prompt-input-v2"]`. Страховка от любых future-случаев
отсутствия реального composer (не только child session).
- **Бамп `@version`** 1.0.2 → 1.0.3 синхронно в `package.json` и
`vite.config.ts` — разблокировать автообновление userscript-менеджеров
(ловушка PR #29#30).
- **`tests/ui.test.ts`** (новый, 5 кейсов): dock с `prompt-input-v2` →
кнопка есть; dock с `prompt-input` → кнопка есть; dock без composer
(child session disabled-блок) → кнопки нет; пустой dock → кнопки нет;
question-dock открыт → composer-кнопки нет (PR #31 regression guard).
Тестирует через публичный `setupUI` + side-effect (`.ocvd-btn` в DOM).
- **Handoff** `docs/handoff/pr-XX-child-session-disabled-composer.md` и
**ADR 0004** `docs/decisions/0004-pr-XX-child-session-composer-guard.md`
с placeholder'ом PR-номера (исправлю после получения номера).

Это тот же класс бага, что и PR #31 (question-dock duplicate button) —
`session-prompt-dock` использовался как composer-target когда реальный
composer внутри не отрендерен. PR #31 пофиксил question-dock case, этот
PR закрывает child-session case.

## Почему

- **`session-prompt-dock` — общий wrapper для трёх состояний.** В
`anomalyco/opencode` (`session-composer-region.tsx`) dock рендерится
всегда когда `showComposer()` truthy (`!blocked() || !!parentID()` → в
child session всегда truthy). Внутри условно: question-dock (PR #31),
disabled-блок "Prompt is disabled / Back to parent" (child session, этот
PR), или реальный composer.
- **`findComposer()` выбирал wrapper.** `COMPOSER_SELECTORS` =
[`prompt-input-v2`, `session-prompt-dock`, `session-new-composer`,
`session-composer`] (ADR 0001). В child session `prompt-input-v2`
отсутствует, `session-prompt-dock` присутствует. Guard PR #31 (skip если
внутри `session-question-dock`) не срабатывал — внутри disabled-блок, не
question-dock.
- **Клик падал.** Кнопка вставлялась в dock через `injectIntoElement`
(`position: absolute; top: 8px; right: 8px`). При клике →
`insertIntoContenteditable()` →
`querySelector('[data-component="prompt-input"]')` = `null` → toast
"Could not find input field".
- **Defence-in-depth.** Guard в `findComposer` (не возвращать dock без
composer внутри) + guard в `injectIntoComposer` (не вставлять если в
документе нет composer). Оба слоя независимы — любой один достаточно,
второй страховка на race conditions. Аналог паттерна PR #31 / ADR 0003.

Closes #32

Closes #32

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-26 17:18:08 +03:00
Sergey
02601cb360
fix(ui): prevent duplicate mic button in question-dock (#31)
## Что сделано
- `findComposer()` в `src/ui.ts` теперь skip `session-prompt-dock` если
внутри есть `session-question-dock` — общий wrapper не используется как
composer-target пока открыт question
- `injectIntoComposer()` в `src/ui.ts` добавлен guard: не вставлять
composer-кнопку если в DOM есть `[data-slot="question-custom-input"]`
(открыт textarea "Свой ответ")
- Бамп `@version` 1.0.1 → 1.0.2 в `package.json` и `vite.config.ts` —
разблокировать автообновление

## Почему
`session-prompt-dock` в OpenCode v1.18.3 — общий wrapper И для
question-dock, И для composer. Когда агент задаёт вопрос
(`questionRequest`), composer скрывается (`blocked=true`), но wrapper
остаётся. `findComposer()` находил wrapper и вставлял кнопку в верх
блока вопросов → дубликат + кнопка застревала после закрытия question.
Defence-in-depth: guard в findComposer + guard в injectIntoComposer.

Closes #28

Closes #28

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-25 02:23:39 +03:00
Sergey
36169b4b08
fix(ui): broaden page gate + debug logging + version bump (#30)
## Что сделано
- Расширен gate `isOpencodePage()` в `src/insert.ts`: теперь проверяет
любой из 6 селекторов (`prompt-input`, `prompt-input-v2`,
`session-prompt-dock`, `session-composer`, `session-new-composer`,
`question-custom-input`) вместо одного `prompt-input`. Это активирует
скрипт раньше на v1.18.x, где композер может монтироваться lazy.
- Добавлено отладочное логирование с префиксом `[ocvd]` в `src/index.ts`
(init, gate retry) и `src/ui.ts` (composer found/not found, mic button
injected). Пользователь может видеть в DevTools Console где скрипт
останавливается.
- Бамп `@version` до `1.0.1` в `package.json` и `vite.config.ts` —
разблокирует автообновление userscript-менеджеров (после PR #29 версия
осталась `1.0.0`, автообновление не сработает).

## Почему
PR #29 добавил корректные селекторы для v1.18.x, но пользователи не
получили обновление из-за не-бампнутой `@version`. Также gate
`isOpencodePage()` проверял только `prompt-input`, которого может не
быть в DOM на ранних этапах lazy-mount. Добавление логирования поможет
диагностировать runtime-проблемы в DevTools.

Closes #28

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-25 02:03:39 +03:00
dependabot[bot]
32c7995572
build(deps-dev): bump @types/node from 22.20.0 to 26.1.1 (#16)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.20.0 to 26.1.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.20.0&new-version=26.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergey <93754860+slaid098@users.noreply.github.com>
2026-07-09 08:19:28 +03:00
dependabot[bot]
f5956d0268
build(deps-dev): bump happy-dom from 17.6.3 to 20.10.6 (#6)
Bumps [happy-dom](https://github.com/capricorn86/happy-dom) from 17.6.3
to 20.10.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/capricorn86/happy-dom/releases">happy-dom's
releases</a>.</em></p>
<blockquote>
<h2>v20.10.6</h2>
<h3>👷‍♂️ Patch fixes</h3>
<ul>
<li>Await NodeJS internal ReadableStream promise during teardown - By
<strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2217">#2217</a></li>
</ul>
<h2>v20.10.5</h2>
<h3>👷‍♂️ Patch fixes</h3>
<ul>
<li>Adds cache to query selector parser - By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2142">#2142</a>
<ul>
<li>The selector parser degraded in performance in v20.6.3 to solve more
complex selectors</li>
<li>Parsing is still a bit slower, but the cache will hopefully mitigate
most of the problem</li>
</ul>
</li>
</ul>
<h2>v20.10.4</h2>
<h3>👷‍♂️ Patch fixes</h3>
<ul>
<li>Coerce null qualifiedName to empty string in createDocument - By
<strong><a
href="https://github.com/Firer"><code>@​Firer</code></a></strong> in
task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2206">#2206</a></li>
</ul>
<h2>v20.10.3</h2>
<h3>👷‍♂️ Patch fixes</h3>
<ul>
<li>Fix &quot;~=&quot; attribute selector matching hyphenated substrings
in CSS selectors - By <strong><a
href="https://github.com/mixelburg"><code>@​mixelburg</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2194">#2194</a></li>
</ul>
<h2>v20.10.2</h2>
<h3>👷‍♂️ Patch fixes</h3>
<ul>
<li>Updates external dependencies - By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2163">#2163</a></li>
</ul>
<h2>v20.10.0</h2>
<h3>🎨 Features</h3>
<ul>
<li>Adds support for setting a canvas adapter for handling the canvas
rendering using the browser setting <a
href="https://github.com/capricorn86/happy-dom/wiki/IOptionalBrowserSettings">canvasAdapter</a>
- By <strong><a
href="https://github.com/RAprogramm"><code>@​RAprogramm</code></a></strong>
and <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li>
<li>Adds new package <a
href="https://github.com/capricorn86/happy-dom/tree/master/packages/%40happy-dom/node-canvas-adapter">@​happy-dom/node-canvas-adapter</a>
- By <strong><a
href="https://github.com/RAprogramm"><code>@​RAprogramm</code></a></strong>
and <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a>
<ul>
<li><a
href="https://github.com/capricorn86/happy-dom/tree/master/packages/%40happy-dom/node-canvas-adapter">@​happy-dom/node-canvas-adapter</a>
is a pluggable canvas adapter for Happy DOM using <a
href="https://github.com/Automattic/node-canvas">node-canvas</a>.</li>
</ul>
</li>
<li>Adds support for loading image files when enabling the browser
setting <a
href="https://github.com/capricorn86/happy-dom/wiki/IOptionalBrowserSettings">enableImageFileLoading</a>
- By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li>
<li>Adds support for loading image data URLs - By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li>
<li>Adds support for <a
href="https://developer.mozilla.org/en-US/docs/Web/API/ImageData">ImageData</a>
- By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li>
<li>Adds support for <a
href="https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap">ImageBitmap</a>
- By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li>
<li>Adds support for <a
href="https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap">Window.createImageBitmap()</a>
- By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li>
</ul>
<h2>v20.9.0</h2>
<h3>🎨 Features</h3>
<ul>
<li>Adds support for event listener properties on Window (e.g.
<code>Window.onkeydown</code>) - By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2131">#2131</a></li>
</ul>
<h2>v20.8.9</h2>
<h3>👷‍♂️ Patch fixes</h3>
<ul>
<li>Fixes issue where cookies from the current origin was being
forwarded to the target origin in fetch requests - By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2117">#2117</a>
<ul>
<li>A security advisory (<a
href="https://github.com/capricorn86/happy-dom/security/advisories/GHSA-w4gp-fjgq-3q4g">GHSA-w4gp-fjgq-3q4g</a>)
was reported for this security vulnerability. Big thanks to <a
href="https://github.com/r74tech"><code>@​r74tech</code></a> for
reporting this!</li>
</ul>
</li>
</ul>
<h2>v20.8.8</h2>
<h3>👷‍♂️ Patch fixes</h3>
<ul>
<li>Fixes issue where export names can be interpolated as executable
code in ESM - By <strong><a
href="https://github.com/capricorn86"><code>@​capricorn86</code></a></strong>
in task <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2113">#2113</a>
<ul>
<li>A security advisory (<a
href="https://github.com/capricorn86/happy-dom/security/advisories/GHSA-6q6h-j7hj-3r64">GHSA-6q6h-j7hj-3r64</a>)
has been reported that shows a security vulnerability where it may be
possible to escape the VM context and get access to process level
functionality in unsafe environments using CommonJS. Big thanks to <a
href="https://github.com/tndud042713"><code>@​tndud042713</code></a> for
reporting this!</li>
</ul>
</li>
</ul>
<h2>v20.8.7</h2>
<h3>👷‍♂️ Patch fixes</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fed1de2680"><code>fed1de2</code></a>
fix: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2217">#2217</a>
Await NodeJS internal ReadableStream promise during teardown (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2">#2</a>...</li>
<li><a
href="6a9adb5334"><code>6a9adb5</code></a>
fix: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2142">#2142</a>
Adds cache to query selector parser (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2214">#2214</a>)</li>
<li><a
href="4440f5fc95"><code>4440f5f</code></a>
fix: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2206">#2206</a>
Coerce null qualifiedName to empty string in createDocument (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2207">#2207</a>)</li>
<li><a
href="05e5465314"><code>05e5465</code></a>
chore: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2208">#2208</a>
Updates contribution guidelines (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2211">#2211</a>)</li>
<li><a
href="7103b05998"><code>7103b05</code></a>
chore: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2208">#2208</a>
Updates contribution guidelines (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2210">#2210</a>)</li>
<li><a
href="4c292ef101"><code>4c292ef</code></a>
chore: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2208">#2208</a>
Updates contribution guidelines (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2209">#2209</a>)</li>
<li><a
href="7e25c97fe6"><code>7e25c97</code></a>
fix: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2194">#2194</a>
Fix ~= attribute selector matching hyphenated substrings (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2205">#2205</a>)</li>
<li><a
href="b334a12fc3"><code>b334a12</code></a>
fix: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2163">#2163</a>
Updates external dependencies (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2188">#2188</a>)</li>
<li><a
href="20f89aa787"><code>20f89aa</code></a>
fix: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2180">#2180</a>
Try to fix publish workflow (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2181">#2181</a>)</li>
<li><a
href="f08c3fa773"><code>f08c3fa</code></a>
chore: <a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2177">#2177</a>
Update happy-conventional-commit (<a
href="https://redirect.github.com/capricorn86/happy-dom/issues/2179">#2179</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/capricorn86/happy-dom/compare/v17.6.3...v20.10.6">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~GitHub%20Actions">GitHub Actions</a>, a new
releaser for happy-dom since your current version.</p>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=happy-dom&package-manager=npm_and_yarn&previous-version=17.6.3&new-version=20.10.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergey <93754860+slaid098@users.noreply.github.com>
2026-07-08 09:51:33 +03:00
opencode-agent
3bd443dde3 feat: initial implementation of OpenCode Voice Dictation
- TypeScript + Vite (vite-plugin-monkey) userscript
- Groq API integration with whisper-large-v3
- Tap-to-toggle recording with noise suppression
- Contenteditable text insertion for OpenCode web
- Ctrl+Space keyboard shortcut (desktop)
- Custom Whisper prompt for software development context
- Recording timer, toast notifications, auto-submit option
- 44 unit tests, 100% line coverage
- Biome linter, Knip, Vitest, CI/CD pipeline
- Bilingual README (EN/RU) with compatibility table
2026-07-08 05:37:17 +00:00