Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
distribution: temurin
java-version: '21'
- uses: android-actions/setup-android@v3
with:
# v3's default also installs the obsolete `tools` package, which
# current runner cmdline-tools no longer provide.
packages: platform-tools
- name: Install Android SDK
run: sdkmanager 'platforms;android-36' 'build-tools;36.0.0'
- name: Assemble, unit test and lint Android
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
distribution: temurin
java-version: '21'
- uses: android-actions/setup-android@v3
with:
# v3's default also installs the obsolete `tools` package, which
# current runner cmdline-tools no longer provide.
packages: platform-tools
- name: Install Android SDK
run: sdkmanager 'platforms;android-36' 'build-tools;36.0.0'
- name: Assemble, unit test and lint Android
Expand Down
12 changes: 11 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,14 @@ handled or safely ignored.
- Skill toggling edits only the `disable-model-invocation` frontmatter key on the target `SKILL.md`; keep that surgical so user formatting survives.
- `/api/skills/install` shells through `npx skills add ... --agent universal`, which installs into the ecosystem-standard `.agents/skills` dirs omp reads; project installs run with the selected cwd.

[Showing lines 1-300 of 376. Use :301 to continue]
[Showing lines 1-300 of 376. Use :301 to continue]

<!-- BEGIN:nextjs-agent-rules -->

# This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.

This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

<!-- END:nextjs-agent-rules -->
43 changes: 35 additions & 8 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Browser
│ HTTP / Server-Sent Events
▼
ompgui (Next.js on Node)
├─ reads native OMP session files and selected configuration
├─ reads native OMP sessions and catalog-filtered global/project settings
├─ serves allow-listed project files
└─ starts one `omp --mode rpc-ui` child per active session
│ NDJSON over stdio
Expand Down Expand Up @@ -96,13 +96,40 @@ atomic where possible; archive or deletion stops the associated live process
first. ompgui does not provide a general editor for session JSONL or opaque OMP
state.

Models and allow-listed OMP settings use surgical YAML updates that preserve
unrelated content. Plugin operations run the installed `omp plugin` CLI. MCP
configuration is project-local, validated before writing, and saved atomically.
Renaming a server to an existing name returns HTTP 409 without overwriting either
configuration.
Configuration replacements use exclusive, owner-only temporary files. Project
configuration targets are checked through symlinks before creating directories.
Models use surgical YAML updates. Native OMP settings are defined once in
`lib/omp/settings-catalog.ts`; `/api/omp-settings` and Relay's `settings.get` /
`settings.update` call the same settings service, so browser and Android receive
the same catalog, validation, scope policy, redaction, confirmation rules, and
per-layer/effective-value DTOs. Values in that DTO are saved configuration, not
live-session state or environment/CLI overrides; clients supply catalog defaults
for absent effective values.

The global layer reads `~/.omp/agent/config.yml`, falling back to an existing
`config.yaml`; an authorized project layer reads and writes only `.omp/config.yml`.
Project values recursively merge over global values for display; a null project
model-role entry inherits the global role, and ordered role-selector arrays are
preserved. Scoped model/provider registry arrays that the simple editor cannot
represent are marked read-only and protected against replacement or reset.
A save applies a minimal leaf patch, with structured records replacing that record at the selected
layer and ordered arrays remaining ordered; reset removes the selected-layer leaf
so defaults or inheritance apply. Catalog-designated secret values are never
returned, only presence, and sensitive changes fail closed without their required
confirmation. YAML aliases are isolated before mutation so editing an anchor
does not change unrelated alias consumers. Unrelated YAML and comments are
preserved. New or restarted OMP sessions consume saved changes; ompgui does not
silently restart a live RPC child.

Every settings read-modify-write holds OMP's native cross-process config lock and
then performs an atomic replacement. The Node implementation uses `koffi` for the
platform primitives and `xxhash-wasm` for OMP-compatible lock names; Darwin
interoperability has been exercised, while the Linux and Windows implementations
are source-complete but were not runtime-tested in that verification pass.
Configuration replacements use exclusive, owner-only temporary files, and project
targets are checked through symlinks before directories are created.

Plugin operations run the installed `omp plugin` CLI. MCP configuration is
project-local, validated before writing, and saved atomically. Renaming a server
to an existing name returns HTTP 409 without overwriting either configuration.

### Server-owned pre-dispatch queue

Expand Down
13 changes: 11 additions & 2 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

[English](./README.md) | [한국어](./README.ko.md) | [日本語](./README.ja.md) | [简体中文](./README.zh-CN.md)

> **Android APK (Android 12+)** — Kotlin 製のコンパニオンアプリでリモートの ompgui サーバーに接続し、最新セッションの読み取り専用オフラインスナップショットを利用できます。[ompgui Remote v0.7.10 をダウンロード](https://github.com/dbc-hbin/ompgui/releases/download/android-v0.7.10/ompgui-remote-v0.7.10.apk) · [リリースノート](https://github.com/dbc-hbin/ompgui/releases/tag/android-v0.7.10)
> **Android APK (Android 12+)** — Kotlin 製のコンパニオンアプリでリモートの ompgui サーバーに接続し、最新セッションの読み取り専用オフラインスナップショットを利用できます。[ompgui Remote v0.7.11 をダウンロード](https://github.com/dbc-hbin/ompgui/releases/download/v0.7.11/ompgui-remote-v0.7.11.apk) · [リリースノート](https://github.com/dbc-hbin/ompgui/releases/tag/v0.7.11)

> `android/` の実験的なネイティブ Compose クライアントは、認証済みの `/relay` WebSocket を使用し、セッション・履歴の操作、リンク付きメッセージ、オフラインの Mermaid 図とコードの構文強調、画像/PDF/音声/HTML/Markdown/DOCX のインラインプレビューを提供します。ファイルの自動更新は表示中のみ動作し、未保存の編集を保持します。許可された隠しファイルの閲覧とアーカイブ検索にも対応します。モデル・設定には公開 models.dev カタログ、高度な OMP 設定、構成とは別に表示されるセッションごとの実際の MCP 実行状態が含まれます。添付ファイルは端末上で巨大な単一 JSON にまとめず、ストリーミングでステージングします。画像は各 10 MiB で最大 10 件、テキスト添付は独立した枠で各 256 KiB、最大 10 件です。OMP 自体の画像正規化とプロバイダーごとの画像数制限は引き続き適用されます。
>
> **現在の設定機能:** Web と Android APK は、スコープ、継承、リセット、検証、保護されたシークレット/管理者操作を含む同一の検索・カテゴリ対応 OMP 設定カタログを使用します。端末ローカルの思考表示設定は会話の描画だけを変え、最終回答は隠しません。
>
> このクライアントはホスト型/E2E リレーを追加するものではありません。JDK 21 を使用し、リポジトリのルートで `npm install` を実行してから、`android/` で `./gradlew :app:assembleDebug` を実行します。オフラインアセットはインストール済みの npm 依存パッケージから生成されます。出力先は `android/app/build/outputs/apk/debug/app-debug.apk` です。サーバーで無効化されている更新、ログアウト、保存済み API キーの変更操作は引き続き利用できません。

[oh-my-pi (omp) コーディングエージェント](https://github.com/can1357/oh-my-pi)のローカル Web UI です。ompgui はローカルの omp セッションファイルを読み込み、セッションの閲覧、リアルタイムチャット、モデル設定、スキル管理、プロジェクトファイルのプレビューを行えるブラウザワークスペースを提供します。
Expand Down Expand Up @@ -127,7 +129,7 @@ OMP_WEB_HOSTNAME=0.0.0.0 OMP_WEB_PASSWORD="your-strong-password" ompgui
- **ブランチをまたいで作業**: サイドバーから Git ワークツリーを切り替えると、新しいセッションとエクスプローラーが選択したチェックアウトに追従します。
- **プロジェクトを見ながらチャット**: エージェントの作業中に、左側でファイルを閲覧し、右側でソース、ドキュメント、画像、音声、PDF をプレビューできます。
- **セッション状態をひと目で把握**: コンテキスト使用量、コスト、コンパクション状態、システムプロンプトの詳細をトップバーで確認できます。
- **ターミナルに頼らない設定**: モデル、ログイン/APIキー、モデルテスト、ネイティブ OMP 制御(アドバイザー、承認、Bash ポリシー、思考、コンパクション、メモリ、自動学習、リトライ/フォールバック)、スキル、プラグイン、プロジェクト MCP サーバーを Web UI から管理できます。
- **OMP 設定を一貫して管理**: Web と Android が、モデル、エージェント、ツール、安全性、システム動作のための検索・カテゴリ対応カタログを共有し、グローバル/プロジェクト継承、デフォルトへのリセット、高度な値の検証を提供します。
- **Settings で MCP を管理**: 専用の MCP タブでプロジェクトサーバーの状態(有効 / 無効 / 無効な設定)を表示し、追加、編集、名前変更、検証、削除を行えます。設定エラーはトーストで通知されます。
- **OMP を最新に保つ**: Settings からインストール済みランタイムを確認・更新し、必要に応じてアクティブなセッションを再起動できます。
- **完了を見逃さない**: エージェント完了時のブラウザー通知を有効にし、インストール済みスキルの更新を確認できます。
Expand All @@ -146,13 +148,20 @@ OMP_WEB_HOSTNAME=0.0.0.0 OMP_WEB_PASSWORD="your-strong-password" ompgui
| `PI_CODING_AGENT_DIR` | 別の omp エージェントディレクトリを指定(デフォルト `~/.omp/agent`) |
| `HTTP_PROXY` / `HTTPS_PROXY` / `NO_PROXY` | サーバーサイドリクエスト用の標準プロキシ変数 |

### OMP 設定

Web UI と Android APK は同じ共有カタログをカテゴリと検索で表示し、デフォルト値、グローバルまたはプロジェクトのスコープ、継承された有効値、リセットに対応します。グローバル設定は `~/.omp/agent/config.yml` を使用し、`config.yml` が存在せず既存の `config.yaml` がある場合に限り、後者を読み書きのフォールバックとして使用します。プロジェクト設定は、許可されたワークスペースの正規パス `.omp/config.yml` だけを使用します。表示する有効値では、プロジェクト層をグローバル層へ再帰的にマージします。保存時には、構造化レコードが選択した層の該当レコード全体を置換し、順序付き配列は順序を保持します。数値、列挙値、配列、構造化値は最小限の YAML 更新前に検証され、無関係なキーとコメントは保持されます。

表示される有効値は保存済みのグローバル/プロジェクト構成を統合したもので、実行中セッションの実値でも、環境変数や CLI による上書きでもありません。変更は新規または再起動したセッションで反映され、保存だけで実行中の RPC セッションが自動再起動することはありません。カタログで確認対象に指定された変更には明示的な確認が必要です。シークレットは書き込み専用で、クライアントには有無だけが返され、置換または削除はできますが保存値は読み取れません。端末ごとの思考表示設定はローカル表示だけに作用し、思考ブロックを隠しても最終回答は隠しません。

## アーキテクチャ

ompgui は Node 上でホストされる Next.js アプリで、インストール済みの `omp` バイナリを操作します。エージェント自体は同梱していません:

- **ライブセッション**: `omp --mode rpc-ui`(stdio 上の NDJSON)を、アクティブなセッションごとに 1 つの子プロセスとして起動します。そのため、エージェントのバージョンは常にインストールされているものと完全に一致します。
- **セッション閲覧**: omp のセッションファイル(`~/.omp/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl`)を直接読み込みます。タイトル変更、アーカイブ、削除は、OMP のライブ書き込みと競合しないよう保護されたネイティブファイルのメンテナンス操作です。
- **モデルと認証**: omp 子プロセスに対する RPC コマンドを使用します。モデルパネルは omp エージェントディレクトリ内の `models.yml` を編集します。
- **OMP 設定**: `lib/omp/settings-catalog.ts` が Web と Relay/Android で共有するカタログを定義し、設定サービスがカタログで絞り込んだ各層/有効値を返して、検証済みの最小パッチを適用します。グローバルおよび許可されたプロジェクトへの書き込みは、OMP 互換のプロセス間ロックとアトミック置換を使い、ネイティブ OMP と ompgui が互いのファイル世代を上書きしないようにします。
- **スキルとプラグイン**: omp のスキルディレクトリ(`~/.omp/agent/skills`、プロジェクトの `.omp/skills`、互換ディレクトリ)をスキャンし、プラグイン管理には `omp plugin` を呼び出します。
- **ファイルアクセス**: ファイルの閲覧とプレビューは、選択したプロジェクトディレクトリとセッションに現れる作業ディレクトリに限定されます。
- **フォークとセッション内ブランチの違い**: フォークは新しい `.jsonl` ファイルを作成します。「ここから編集」は同じセッションファイル内に別のブランチを作成します。
Expand Down
Loading
Loading