本文へ移動
cccskills
無料GitHub で公開日本語紹介

connection-import-wasm

DBeaverやNavicatなどの接続情報を取り込むWASM拡張の実装から、マニフェスト設定、ホスト連携、表示やプレビューの不具合調査まで扱います。

原文原文の説明を見る

Use when implementing, debugging, packaging, or host-enabling onetcli WASM connection importers such as DBeaver, Navicat, Navicat Lite, Termius, connection-import.wit components, wasm32-wasip2 importers, composite extension manifests, local importer visibility, or connection import UI freezes.

feigeCode/navopスター 1,953(GitHub 1,953 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 新しい接続インポーターを作りたいとき
  • WASM拡張が表示されない原因を調べたいとき
  • 接続プレビューの停止を調査したいとき
  • 拡張のマニフェストや梱包を確認したいとき
  • 認証情報の取り込みを確認したいとき

日本語での紹介

できること

onetcli向けに、アプリの接続設定を読み込むWASMコンポーネント型インポーターを実装・デバッグする手順を扱います。設定ファイルの場所を調べ、形式に応じたパーサーを作り、WITの契約に沿うJSONを返し、extension.json やルートマニフェストに登録してローカルで確認します。DBeaverやNavicatなどのデータベース用インポーターの例があり、WASMランタイム、権限、候補ファイル、拡張の表示、プレビュー画面の応答性といったホスト側の確認点も含みます。パスワードを含める設定が無効な場合に、平文の認証情報を返さない扱いも説明します。

こんなときに便利

新しいアプリの接続情報を取り込みたいときや、拡張が一覧に出ない、レコードが見つからない、プレビュー画面が止まるといった問題を調べるときに向いています。拡張のパッケージングやホスト連携を担当する開発者にも使えます。

使い方の例

  • 「Navicat Liteの接続設定を読み込むインポーターを追加して」
  • 「ローカル拡張が一覧に表示されない原因を調べて」
  • 「接続インポートのプレビューが固まる問題を追って」

注意点

Rust、WASMコンポーネント、onetcliの拡張形式を扱います。ホスト側の確認にはonetcliリポジトリが必要になる場合があります。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(8)

  • SKILL.md10.6 KB
  • agents/openai.yaml208 B
  • references/database-importers.md3.3 KB
  • references/manifest-and-packaging.md3.3 KB
  • references/new-application-playbook.md6.3 KB
  • references/protocol-and-records.md4.0 KB
  • references/source-discovery.md3.3 KB
  • references/testing-and-troubleshooting.md3.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Connection Import WASM

Overview

Build one connection importer as one WASM component. Keep parser logic in the extension repo, keep host capabilities generic in ../onetcli, and verify the whole path from WIT contract to local composite extension visibility.

Use DBeaver as the reference implementation, but avoid baking DBeaver-specific assumptions into the host.

Reference Library

When developing an importer for a new application, read the playbook first, then load the topic references needed by the app's storage format and output kind:

NeedReference
End-to-end workflow for a new applicationNew Application Playbook
Finding app config files across macOS, Windows, and LinuxSource Discovery
Mapping parser output to host protocol JSONProtocol and Records
Writing extension.json, root manifest entries, and local installsManifest and Packaging
Fixtures, tests, local host checks, and release verificationTesting and Troubleshooting
Database importer patterns such as DBeaver and Navicat LiteDatabase Importers
SSH importer patterns such as OpenSSH config and known_hostsssh-connection-import

Repo Map

AreaPath
Extension workspaceonetcli-extensions
Importer cratesextensions/wasm/<tool>-importer
Shared extension WITwit/connection-import.wit
Marketplace entrymanifest.json with "kind": "composite"
Composite packagingscripts/package-composite-extension.sh, scripts/verify-composite-package.sh, scripts/release-driver.mjs
Host repo../onetcli
Host WITcrates/extension-api/wit/connection-import.wit
Host WASM runtimecrates/extension-wasm/src/connection_import.rs
Host manifest/providercrates/extension-runtime/src/connection_import_provider.rs, crates/extension-runtime/src/extension/composite_provider.rs
Import UImain/src/home/connection_import_*

Implementation Workflow

  1. Implement one tool per WASM component. Prefer extensions/wasm/<tool>-importer, with src/component.rs for WIT bindings and src/<tool>.rs for parser logic.
  2. Keep connection-import.wit vendored in this repo under wit/. Do not make extension crates import the host repo WIT directly. Add or keep drift checks against ../onetcli when the host repo is present.
  3. Generate bindings from ../../../wit in each importer crate:
wit_bindgen::generate!({
    path: "../../../wit",
    world: "connection-importer",
});
  1. Export descriptor, scan, and preview. Return JSON matching connection-import-protocol. Use structured parsers such as serde_json, plist, or product-specific parsers; avoid ad hoc string slicing for config formats.
  2. Gate secrets strictly. If ImportOptions.include_passwords is false, never return plaintext passwords even when they exist in config files.
  3. Declare candidates and permissions in extension.json. Include all product paths per platform, for example macOS ~/... and Windows %APPDATA%/....
  4. Register the importer in root manifest.json as a composite extension. Composite importers install under ~/.config/one-hub/extensions/composite/<extension-id>.
  5. Package and install locally before host debugging. The installed folder must contain extension.json and wasm/<module>.wasm.

Host Capability Checklist

When an importer fails in the host, fix the host generically:

  • WASI Preview2: crates/extension-wasm/src/connection_import.rs must add wasmtime_wasi::p2::add_to_linker_async, store WasiCtx, and implement WasiView with a ResourceTable. A wasm32-wasip2 component commonly imports wasi:io/poll@0.2.6.
  • Manifest permissions: %APPDATA%/... and ~/... file permissions must validate in extension/manifest/security_rules.rs.
  • Candidate path expansion: connection_import_provider.rs must expand ~/ and %VAR%/... before reading files.
  • Local visibility: CompositeExtensionProvider uses load_and_check; host version checks must use the app version, not the extension-runtime crate version.
  • UI responsiveness: never call futures::executor::block_on from GPUI import actions/dialogs. Open the preview dialog in a loading state and run preview work through one_core::gpui_tokio::Tokio.
  • Feature wiring: main must enable extension-runtime with features = ["wasm-components"], including --no-default-features builds when the app should still expose WASM importers.

Manifest Pattern

Use a composite manifest shape like this:

{
  "schema_version": 1,
  "id": "com.onetcli.importer.<tool>",
  "name": "<Tool> Importer",
  "version": "0.1.0",
  "engines": { "onetcli": ">=0.7.0" },
  "runtime": {
    "wasm": [{
      "id": "<tool>-importer",
      "module": "wasm/<tool>_importer_wasm.wasm",
      "kind": "component"
    }]
  },
  "permissions": [
    "fs:read:~/Library/...",
    "fs:read:%APPDATA%/..."
  ],
  "contributes": {
    "connectionImporters": [{
      "id": "<tool>",
      "runtimeId": "<tool>-importer",
      "displayName": "<Tool>",
      "outputKinds": ["database"],
      "platforms": ["macos", "windows"],
      "candidateFiles": [{
        "id": "<tool>-macos-config",
        "platform": "macos",
        "path": "~/Library/..."
      }]
    }]
  }
}

Database Importer Notes

For database tools, fixtures from one product edition are not enough. Check every edition and platform path the importer claims in extension.json.

Navicat-specific rules:

  • Premium Lite stores shared connection data at macOS ~/Library/Application Support/PremiumSoft CyberTech/Navicat CC/Common/conn.plist.
  • The Windows analogue is expected under %APPDATA%/PremiumSoft CyberTech/Navicat CC/Common/conn.plist; declare it separately from the classic Navicat paths.
  • Navicat plist files may be XML or binary. Use plist::Value::from_reader(Cursor::new(bytes)) when binary support matters, not XML-only parsing.
  • Lite records may use lowercase fields such as host, port, username, and defaultdatabase.
  • serviceprovider = Default is not a database type. Infer the database type from stable path/key segments such as MySQL, PostgreSQL, Oracle, or SQL Server-specific containers.
  • Skip nested parameter dictionaries that are not database connections, including ssh_param, http_param, ssl_param, and compatibility_param.

Add focused fixtures for each schema variant. At minimum, cover classic Navicat entries and Lite conn.plist entries with lowercase fields and path-derived database types.

For SSH-focused importers, use ssh-connection-import. Keep this skill for shared WASM packaging, manifests, host capability, and database importer behavior.

Testing

Extension repo:

rtk cargo test -p <tool>_importer_wasm
rtk cargo fmt --all --check
rtk cargo build --release -p <tool>_importer_wasm --target wasm32-wasip2
rtk node --test tests/scripts.test.mjs
rtk node scripts/release-driver.mjs <tool>-importer 0.1.0 --target universal --artifact-dir artifacts

Host repo:

rtk cargo test -p extension-wasm
rtk cargo test -p extension-runtime connection_import
rtk cargo test -p extension-runtime composite_provider_lists_connection_importer_with_windows_env_permission
rtk cargo check -p main
rtk cargo check -p main --no-default-features
rtk cargo build -p main

Add focused tests for every host ability that was missing. Useful examples include:

  • A real or fixture wasm32-wasip2 component that reproduces wasi:io/poll@0.2.6 linker failures.
  • A manifest with %APPDATA%/... permissions and candidate files.
  • A provider/listing test proving the local composite importer appears in Installed extensions.
  • A preview-provider test that runs DBeaver/Termius fixture components.
  • A parser fixture for every product edition/path variant declared in the manifest.
  • A serialized JSON assertion for any field backed by a host serde enum or externally tagged protocol shape.

Troubleshooting

SymptomLikely causeFix
component imports instance wasi:io/poll@0.2.6Connection-import runtime lacks WASI Preview2 linkerAdd wasmtime_wasi::p2::add_to_linker_async plus WasiView state.
Local importer not visibleManifest rejected by permissions or host version checkValidate %APPDATA% fs permissions and ensure app version is used for engines.onetcli.
Preview dialog freezesUI thread is running WASM/filesystem workReplace block_on with Tokio::spawn and loading-state entity updates.
Records import passwords when disabledParser ignores include_passwordsEnsure parser omits config and credential passwords unless enabled.
Component returns zero recordsCandidate id, permission, or path mismatchCheck candidateFiles, fs:read:*, platform filtering, and host path expansion.
Navicat Lite returns zero recordsLite path/schema differs from classic NavicatAdd Navicat CC/Common/conn.plist, lowercase field handling, path-derived database type inference, and plist binary/XML parsing.
Source is visible but preview has no rowsAvailability only proves manifest/candidate visibilityCheck host logs for file read, WASM output, and connection import preview failed decode errors.
unknown variant kind during previewImporter emitted an internally tagged enum shape rejected by connection-import-protocolMatch the host serde JSON shape exactly; for SSH auth use ssh-connection-import.

Guardrails

  • Do not combine DBeaver, Navicat, and Termius into one component unless the product explicitly shares storage and parsing semantics. Independent tools should remain separate WASM importers.
  • Do not special-case product ids in the host. Add generic manifest, permission, WIT, or runtime capability support.
  • Do not let the extension repo depend on ../onetcli at build time. Use vendored WIT and drift verification.
  • Do not claim local installation works until the installed composite folder is present and the host provider can list it.
  • Do not leave long-running dev app processes active after build/test work unless the user asked to run the app.
  • Do not trust display labels such as Default as database types when the product stores type information in surrounding keys or path segments.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

gpui

無料概要あり

GPUIアプリの開発で、キー操作や画面レイアウト、状態管理、イベント、テストなどのAPIや実装パターンを調べ、必要な知識を参照できます。

  • GPUIのAPIを調べたいとき
  • キー操作やフォーカスを実装したいとき
  • イベントや状態を管理したいとき
feigeCode/navop1,9532026年10月26日 更新

gpui-component

無料概要あり

GPUIアプリのUIをgpui-componentで組み立てる際に、コンポーネントの選び方や状態管理、テーマ、レイアウト、操作設計、実装規約を確認できます。

  • 画面に合う部品を選びたいとき
  • コンポーネントをセットアップしたいとき
  • 状態管理やテーマを確認したいとき
feigeCode/navop1,9532026年10月26日 更新

ipc-driver-development

無料概要あり

onetcliのIPCデータベースドライバーを、マニフェストやJSON-RPCの契約に沿って設計・実装・レビューし、メタデータ、DDL、入出力や配布まで扱うスキルです。

  • IPCデータベースドライバーを新規作成したいとき
  • driver.jsonの機能やメソッドを設計したいとき
  • スキーマやDDLの不具合を調べたいとき
feigeCode/navop1,9532026年10月26日 更新

navop

無料概要あり

起動中のNavopデスクトップアプリが公開するリソースや操作を、CLIから確認して実行できます。利用可能なツールや権限を調べ、承認に沿って処理を進めます。

  • Navopの利用可能なツールを調べたいとき
  • 操作前に入力スキーマを確認したいとき
  • Navop経由でリソースを操作したいとき
feigeCode/navop1,9532026年10月26日 更新

navop-release-notes

無料概要あり

Navopの変更内容を中国語と英語でまとめ、CHANGELOG.mdを基準にGitHub ReleasesやR2のリリースノートを準備・確認するスキルです。

  • Navopの二言語リリースノートを作りたいとき
  • CHANGELOG.mdの項目を確認したいとき
  • タグ作成前にリリース内容を整理したいとき
feigeCode/navop1,9532026年10月26日 更新

new-component

無料概要あり

既存の実装やデザイン規則に沿って、GPUIの新しいUIコンポーネントを設計・実装し、関連ドキュメントとストーリーも用意するスキルです。

  • GPUIに新しいUI部品を追加したいとき
  • 状態を持つかどうか判断したいとき
  • 既存の部品とAPIや見た目をそろえたいとき
feigeCode/navop1,9532026年10月26日 更新

feigeCode のスキルをすべて見る

このスキルの問題を報告する