
ggoggam/vitre
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Kotlinマルチプラットフォーム向けのWebView自動化。Android、iOS、デスクトップの組み込みWebViewで、アプリ、テスト、またはMCPやKoog経由でLLMエージェントからページワークフローを実行します。
概要
ページに対して何をしたいかをステップのリストとして説明し、Android、iOS、デスクトップの埋め込みWebView内で実行します。アプリから、テストから、またはモデルコンテキストプロトコル(Koog)を介してLLMエージェントから実行してください。 同じ語彙は4通り用意されています。上記のKotlin DSLのように、画面にドロップするCompose composableとして、そしてページを見たことのないエージェント向けにはMCPツールやKoogツールとして利用可能です。後者2つは、1つのセマンティクスセットの2つの実装ではなく、2つの実装です。 ブロックはスクリプトではなくビルダーです。最初に一度だけ実行され、WorkflowEngineが歩くステップリストを組み立てます。つまり、通常のKotlinがワークフローに含まれる内容を選択します。決定が実行に属する場合(時々存在する要素、以前のステップで抽出された値)、runIfがステップに付加します。
概要(AI 翻訳)
Kotlinマルチプラットフォーム向けのWebView自動化。 ページに対して何をしたいかをリストとして説明してください。 ステップを踏み、Android、iOS、デスクトップの埋め込みWebView内で実行します:アプリから、 テスト、またはモデルコンテキストプロトコル(Koog)上のLLMエージェントによるもの。
同じ語彙は4通り利用可能です:上記のKotlin DSLや、Compose可能な構成ツールなどです 画面にドロップし、ページを見たことのないエージェントにとっては、MCPツールやKoogツールとして機能します。 後者2つは1つの意味論の2つの実装ではなく、2つの実装である。
ブロックはスクリプトではなくビルダーです。最初に一度だけ実行して、ステップリストを組み立てます。
WorkflowEngineは歩くため、通常のKotlinifがワークフローに含む内容を選択します。
決定がランに属する場合、それは時々しか存在しない要素であり、価値は
先に抽出されたステップ — runIf は、エンジンがページに対して評価するステップを付け加えます。その
WorkflowStep 構造体は公開的かつ同等のままです;これらは vitre-mcp が使用するものです。
エージェントのステップはKotlinではなくJSONとして届きます。
なぜ
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Vitre
WebView automation for Kotlin Multiplatform. Describe what you want done to a page as a list of steps, then run it inside an embedded WebView on Android, iOS and the desktop: from your app, from a test, or from an LLM agent over the Model Context Protocol or Koog.
val workflow = workflow("hn-top-story", "Hacker News top story") {
navigate("https://news.ycombinator.com/")
waitFor(".titleline > a", timeoutMs = 15_000)
extract(".titleline > a", into = "headline")
extract(".titleline > a", into = "url", from = Source.Attribute("href"))
}
WorkflowEngine(controller).run(workflow).collect { event ->
if (event is WorkflowEvent.Completed) println(event.variables["headline"])
}
The same vocabulary is available four ways: as the Kotlin DSL above, as a Compose composable you drop into a screen, and, for an agent that has never seen the page, as MCP tools or as Koog tools. Those last two are two deliveries of one set of semantics rather than two implementations of them.
The block is a builder rather than a script. It runs once, up front, to assemble the step list that
WorkflowEngine then walks, so ordinary Kotlin if inside it chooses what the workflow contains.
When the decision belongs to the run instead — an element that is only sometimes there, a value an
earlier step extracted — runIf appends a step the engine evaluates against the page. The
WorkflowStep constructors remain public and equivalent; they are what vitre-mcp uses, since
an agent’s steps arrive as JSON rather than as Kotlin.
Why
Mobile apps already embed WebViews, and everything people want to do with them (read a page, fill a
form, talk to the page’s own script, scrape a table, run four sites at once) ends up as one-off
evaluateJavascript calls glued to a callback. Those calls race each other, they race the UI, and
none of it is shared between Android, iOS and the desktop.
Vitre makes the page something you can drive: one ordering guarantee, one step vocabulary, one codebase for every platform, and a snapshot format an agent can read.
- The steps are declarative:
Navigate,LoadHtml,WaitFor,Click,Input,Extract,ExtractRows,Snapshot,EvaluateJs,PostMessage,AwaitMessage,Iffor the branches the page decides rather than the builder, andForEachto visit every page an earlier step found — search results in, one product page each out. - Elements are addressed three ways: CSS, XPath, and handles issued by a page snapshot.
evaluateJsreturns a script’s result JSON-encoded on every platform, so
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →