{"id":51216369,"url":"https://github.com/agent-network-protocol/anp-miniapp-dock","last_synced_at":"2026-06-28T04:03:57.545Z","repository":{"id":363759166,"uuid":"1264656580","full_name":"agent-network-protocol/anp-miniapp-dock","owner":"agent-network-protocol","description":"A DID-native Skill runtime for running MiniApp MCP-compatible agent skills over ANP.","archived":false,"fork":false,"pushed_at":"2026-06-11T08:31:55.000Z","size":16321,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-11T09:04:27.206Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agent-network-protocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-10T04:28:11.000Z","updated_at":"2026-06-11T08:31:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/agent-network-protocol/anp-miniapp-dock","commit_stats":null,"previous_names":["agentconnect/anp-miniapp-dock","agent-network-protocol/anp-miniapp-dock"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/agent-network-protocol/anp-miniapp-dock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fanp-miniapp-dock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fanp-miniapp-dock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fanp-miniapp-dock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fanp-miniapp-dock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agent-network-protocol","download_url":"https://codeload.github.com/agent-network-protocol/anp-miniapp-dock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fanp-miniapp-dock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34876285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-28T04:03:54.533Z","updated_at":"2026-06-28T04:03:57.529Z","avatar_url":"https://github.com/agent-network-protocol.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# anp-miniapp-dock\n\n`anp-miniapp-dock` is a DID-native Rust Skill runtime for running MiniApp MCP-compatible agent skills over ANP.\n\nThe MVP is now implemented as a Cargo workspace. It can load a MiniApp MCP-style Skill, validate `mcp.json`, run atomic API JavaScript in an isolated QuickJS-backed VM, compile and execute a MiniApp MCP component runtime subset, route high-risk actions through consent/audit, and run a local coffee ordering demo through `dock-cli` and `demo-server`.\n\n## Architecture Documents\n\n- [Agentic MiniApp Container MVP PRD](docs/architecture/agentic-miniapp-container-prd.md)\n- [anp-miniapp-dock System Architecture](docs/architecture/anp-skill-dock-architecture.md)\n- [Current capability baseline](docs/architecture/current-capability-baseline.md)\n- [wx API compatibility matrix](docs/architecture/wx-api-compatibility-matrix.md)\n- [Component compatibility matrix](docs/architecture/component-compatibility-matrix.md)\n- [MiniApp MCP Compatibility MVP](docs/architecture/miniapp-mcp-compatibility-mvp.md)\n- [MiniApp MCP Component Runtime](docs/architecture/miniapp-mcp-component-runtime.md)\n- [MiniApp MCP protocol notes](docs/weichat-miniapp-mcp-protocol/weichat-miniapp-mcp.txt)\n- [Local demo runbook](docs/runbook/local-demo.md)\n- [Security runbook](docs/runbook/security.md)\n- [Threat model](docs/security/threat-model.md)\n- [Release gates runbook](docs/runbook/release-gates.md)\n- [Release process, canary, and rollback runbook](docs/runbook/release-process.md)\n- [Operations runbook](docs/runbook/operations.md)\n- [Troubleshooting runbook](docs/runbook/troubleshooting.md)\n- [Privacy deletion runbook](docs/runbook/privacy-deletion.md)\n- [Developer docs](docs/developer/README.md)\n  - [Import WeChat MiniApp MCP Skill](docs/developer/import-wechat-mcp-skill.md)\n  - [wx API compatibility guide](docs/developer/wx-api-compatibility.md)\n  - [Component compatibility guide](docs/developer/component-compatibility.md)\n  - [Security guidelines](docs/developer/security-guidelines.md)\n  - [Host adapter guide](docs/developer/host-adapter-guide.md)\n- [Production readiness roadmap](docs/plan/production-readiness-roadmap.md)\n  - [Detailed production readiness phase plans](docs/plan/production-readiness/README.md)\n\n## Workspace Layout\n\n- `crates/mcp-schema`: MiniApp MCP manifest/result models and validation.\n- `crates/skill-loader`: `SKILL.md`, `mcp.json`, API module, and component package loading.\n- `crates/dock-core`: Orchestrator, API registry, permission, consent, audit, and render routing boundaries.\n- `crates/js-runtime-quickjs`: QuickJS-backed atomic API VM using `rquickjs`.\n- `crates/wx-compat`: P0 `wx` capability profiles, scoped storage, request broker traits, and model context helpers.\n- `crates/anp-adapter`: ANP DID-aware signed HTTP, challenge proof contracts, allowlist, and scoped capability token cache.\n- `crates/consent-audit`: risk policy, mock consent provider, proof, audit records, and redaction.\n- `crates/card-spec`: structured fallback card schema.\n- `crates/component-runtime`: Component VM, WXML/WXSS subset compiler, events, and Render IR.\n- `crates/demo-server`: coffee merchant Agent demo server.\n- `crates/dock-cli`: developer CLI and coffee E2E harness.\n- `examples/coffee-skill`: mock MiniApp MCP coffee Skill fixture.\n- `examples/fixtures`: mock-only compatibility fixtures for address-form, media-review, dynamic-status, and location-map-preview, each with README, expected `test-skill` JSON summary, and Render IR snapshot evidence.\n- `testdata/render-ir`: golden Render IR snapshots for fixture regression tests.\n- `testdata/perf`: local performance/stress smoke baseline JSON artifacts.\n- `scripts/release-gates.sh`: local vendor-neutral release gate runner and JSON report generator.\n- `examples/coffee-fastapi-server`: Python/FastAPI localhost coffee service used to simulate a remote HTTP merchant.\n- `mac-app/AnpMiniappDockMac`: SwiftUI/Xcode chatbot host that recognizes user intent, calls the local MiniApp container, and renders Skill components.\n\n## Development Commands\n\nThe repository pins Rust `1.88.0` through `rust-toolchain.toml` to match the ANP Rust SDK path dependency.\n\n```bash\ncargo metadata --format-version 1 --no-deps\ncargo fmt --check\ncargo clippy --workspace --all-targets -- -D warnings\ncargo test --workspace\n```\n\nFocused commands:\n\n```bash\ncargo test -p dock-cli --test coffee_order_flow\ncargo test -p component-runtime snapshot\ncargo test -p dock-cli fixture\ncargo test -p dock-cli perf\ncargo test -p demo-server\ncargo test -p component-runtime component_vm\n```\n\nRelease gate runner:\n\n```bash\n./scripts/release-gates.sh\n```\n\nThe runner emits `dock.release-gates-report.v1` at `target/release-gates/release-gates-report.json` by default. It runs the release gates from `docs/runbook/release-gates.md`, records pass/fail/skip, treats skip as not-pass, and marks redaction failure, consent bypass, sandbox escape, and token/Authorization/Signature leakage as hard blockers. Use `--quick` only to validate the script/report plumbing during development; it is not release approval. Pass `--release-notes \u003cpath\u003e` or `RELEASE_NOTES_PATH=\u003cpath\u003e` when a release notes file exists.\n\nLocal canary/release dry-run:\n\n```bash\n./scripts/release-gates.sh --release-notes docs/runbook/releases/2026-06-14-local-canary.md\n```\n\n## CLI\n\n`dock-cli` prints JSON so outputs can be used as validation evidence or piped into other tools.\nFor the end-to-end developer workflow, read the [developer docs](docs/developer/README.md).\n`validate` emits the stable `dock.validate-report.v1` schema. Its `status` / `reportStatus`\ndescribe release-readiness (`ok`, `warning`, or `error`), while `commandStatus: \"ok\"` means the\nCLI command itself completed. Local absolute paths and sensitive material are redacted from the\nreport; the coffee fixture remains `compatibilityLevel: \"demo-only\"` because it is unsigned and\nuses demo-only localhost compatibility metadata.\n\n```bash\ncargo run -p dock-cli -- validate examples/coffee-skill\ncargo run -p dock-cli -- inspect examples/coffee-skill\ncargo run -p dock-cli -- test-skill examples/coffee-skill\ncargo run -p dock-cli -- validate examples/fixtures/address-form\ncargo run -p dock-cli -- test-skill examples/fixtures/address-form\ncargo run -p dock-cli -- test-skill examples/fixtures/media-review\ncargo run -p dock-cli -- test-skill examples/fixtures/dynamic-status\ncargo run -p dock-cli -- test-skill examples/fixtures/location-map-preview\ncargo run -p dock-cli -- import-wechat-mcp examples/coffee-skill --dry-run\ncargo run -p dock-cli -- doctor\ncargo run -p dock-cli -- perf examples/coffee-skill --iterations 1\ncargo run -p dock-cli -- call-api examples/coffee-skill searchDrinks '{}'\ncargo run -p dock-cli -- preview-component examples/coffee-skill components/drink-list/index '{\"apiName\":\"searchDrinks\",\"structuredContent\":{\"drinks\":[{\"id\":\"latte\",\"name\":\"Latte\",\"price\":18}]}}'\ncargo run -p dock-cli -- preview-card '{\"content\":[{\"type\":\"text\",\"text\":\"paid\"}],\"structuredContent\":{\"orderId\":\"order_demo_001\",\"status\":\"paid\"}}'\n```\n\n`doctor` emits `dock.doctor-report.v1` and checks the local toolchain, workspace, runtime config contract, Skill package, DID identity, signing credential file permissions, resolver, allowlist, storage/audit backend profile, Host providers, sandbox gate surface, and optional remote server health. Without `--server`, server health is `skip`, not `pass`; with `--ci`, failing checks produce `commandStatus: \"failed\"` after the JSON report is written. Local default config and headless/demo backends remain warning/skip evidence, not production-ready evidence.\n\n`perf` emits `dock.perf-baseline-report.v1` and records local, hardware-dependent smoke evidence for Skill load, API VM calls, component render, Render IR size, token lookup, storage read/write, process RSS memory sample, concurrent sessions, multi-Skill, multi-component render, dynamic request/timer, and resource-limit fail-closed behavior. The sample artifact in `testdata/perf/coffee-smoke-baseline.json` is release evidence and schema documentation, not a production SLO.\n\nTo run the coffee flow against the Python/FastAPI localhost service:\n\n```bash\ncd examples/coffee-fastapi-server\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\nuvicorn app:app --host 127.0.0.1 --port 8008\n# in another shell from the repo root:\ncargo run -p dock-cli -- run-demo --skill examples/coffee-skill --server http://127.0.0.1:8008\n```\n\nThe Rust demo server remains available for focused tests:\n\n```bash\ncargo run -p demo-server -- \\\n  --host 127.0.0.1 \\\n  --port 3000 \\\n  --skill examples/coffee-skill \\\n  --token-issuer-secret test-only-local-secret \\\n  --trusted-did-document '\u003cuser-did\u003e=examples/identity/did_document.json'\n\ncargo run -p dock-cli -- run-demo \\\n  --skill examples/coffee-skill \\\n  --server http://127.0.0.1:3000\n```\n\n`run-demo` performs ANP DID challenge/login, exercises demo-server coffee business APIs, runs the local Skill API VM through `dock-core`, lets the Skill JavaScript call `wx.login` and `wx.request` to the localhost coffee HTTP service, triggers component `api/call` actions, mock-approves high-risk consent, renders Component VM output to Render IR JSON, and verifies card expiration. Capability tokens are used internally and redacted from CLI output. By default, the CLI reads `examples/identity/did_document.json` and `examples/identity/key-1-private.pem`, deriving the user DID from the DID document `id`. Those files are test fixtures only; real DID credentials must stay local and ignored by Git. The DID passed to `--trusted-did-document` must match the DID document `id`.\n\n## Mac Chatbot Demo\n\nThe Mac host is a real Xcode project and Swift Package. It provides a PC-style chatbot UI:\n\n1. the user enters a need such as `我要点一杯咖啡`;\n2. the app reads `OPENAI_BASE_URL`, `OPENAI_API_KEY`, and `OPENAI_MODEL` from the process environment or `source ~/.zshrc`;\n3. an OpenAI-compatible chat-completions call recognizes the coffee-order intent;\n4. the app calls the local MiniApp container / Coffee Skill and renders returned components in the chat.\n\nPrepare the optional FastAPI localhost service first if you want the app to use it instead of the Rust fallback server:\n\n```bash\ncd examples/coffee-fastapi-server\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\nRun the host:\n\n```bash\nopen mac-app/AnpMiniappDockMac/AnpMiniappDockMac.xcodeproj\n\n# or smoke test without opening a window:\ncd mac-app/AnpMiniappDockMac\nANP_DOCK_MAC_HEADLESS=1 ANP_DOCK_CHAT_PROMPT='我要点一杯咖啡' swift run\n```\n\nSet `ANP_DOCK_DISABLE_OPENAI=1` to force local fallback intent recognition for deterministic smoke tests.\n\n## MVP Boundary\n\nThe MVP is contract-compatible with the MiniApp MCP Skill shape, not a full WeChat Mini Program runtime.\n\nP0 implemented:\n\n- `SKILL.md`, `mcp.json`, `apis[]`, `components[]`, `_meta.ui.componentPath`.\n- Atomic API JS loading with restricted CommonJS, `wx.modelContext.createSkill`, `registerAPI`, middleware, input validation, timeout, and sandboxed globals.\n- Runtime boundaries for permission, consent, audit, render routing, and model-visible result filtering.\n- ANP DID-aware adapter contracts, signed request helper, `anp-http-signature/v1` challenge proof, allowlist, and scoped capability token cache.\n- Component runtime subset: `Component({})`, `data`, `properties`, `methods`, `created/attached/detached`, `setData`, `NotificationType.Input/Result/Expire`, `sendFollowUpMessage`, `api/call`, `expirePreviousCards`, tap/image events, WXML/WXSS subset, Render IR JSON.\n- CardSpec fallback for structured results or render failures.\n- Coffee merchant demo server and CLI/E2E flow.\n\nP0.5 auth/token now uses real ANP DID challenge signing and scoped capability tokens for the demo server flow. The runtime still intentionally does not implement a real Flutter host, complete WXML/WXSS, full component/page routing, WeChat login, real payment provider, cloud development, social APIs, consent UI, or host renderer.\n\n## Security Notes\n\nDo not commit private keys, DID credentials, capability tokens, merchant secrets, OpenAI API keys, or real user data. The coffee Skill and demo server use mock-only business data, but challenge/login and capability tokens are no longer mock. Runtime code should keep DID signing, tokens, and high-risk authorization below the Skill/CLI boundary, and user-facing output should redact tokens and signatures.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-network-protocol%2Fanp-miniapp-dock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagent-network-protocol%2Fanp-miniapp-dock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-network-protocol%2Fanp-miniapp-dock/lists"}