Skip to content

[WIP]feat(miniapp): add built-in bitfun-loopx console MiniApp (replaces #2382) - #2836

Open
xielixing wants to merge 2 commits into
GCWing:mainfrom
xielixing:builtin/loopx-miniapp
Open

[WIP]feat(miniapp): add built-in bitfun-loopx console MiniApp (replaces #2382)#2836
xielixing wants to merge 2 commits into
GCWing:mainfrom
xielixing:builtin/loopx-miniapp

Conversation

@xielixing

Copy link
Copy Markdown

Summary

Replaces #2382 (closed when main was replaced with the 1.0.0 codebase). This PR reapplies the built-in bitfun-loopx console MiniApp on the new main and links back to #2382 for review context.

内置 MiniApp bitfun-loopx(品牌统一为 bitfun-loopx,src/crates/contracts/product-domains/src/miniapp/builtin/assets/bitfun-loopx/ 即权威源码,不依赖任何外部仓库快照):粘贴 GitHub Issue 链接,由 OpenBitFun 宿主 Agent 驱动本机 loopx 持续修复,心跳调度、人工审批、中途插话。

Ported from #2382 (adapted to the 1.0.0 codebase)

  1. 内置 miniapp: assets committed under product-domains/src/miniapp/builtin/assets/bitfun-loopx/; registered in BUILTIN_APPS (builtin.rs) with the content-hash seed policy of the 1.0.0 codebase; private_bridge_extension exposes app.loopx.* only to the verified built-in identity (builtin-bitfun-loopx).
  2. Rust contracts: product-domains/src/miniapp/loopx/{types,ports,policy,bridge}.rs — typed DTOs, narrow ports, pure lifecycle policy (cargo test -p openbitfun-product-domains --features miniapp covered by loopx_contracts).
  3. Services: services-integrations/src/miniapp/loopx_{cli,github,workspace}.rs behind the new miniapp-loopx feature — pinned sidecar selection + typed CLI argv/JSON translation + durable readback, GitHub intake adapter, Git/worktree service.
  4. Assembly/core: core/src/miniapp/loopx/{controller,agent_adapter,store,subscriber,tool_activity}.rs — host driver, batch/queue, fair rotation, recovery and state projection; custom-agent-runner path per the LoopX mainstream cooperative runner contract.
  5. Desktop: miniapp_loopx_api.rs (7 Tauri commands, registered in lib.rs, declared in the Product Operation Registry with Unsupported/ControllerLocal stances), bundled loopx sidecar resolution (BITFUN_RESOURCE_DIR), worker_host.js policy/environment handling.
  6. Packaging: scripts/build-loopx.mjs (pinned loopx v0.5.1 @ 1bb42f4c, PyInstaller onefile) invoked by scripts/desktop-tauri-build.mjs (prepareBundledLoopx + injectLoopxResource, --no-bundle skip) and scripts/dev.cjs (ensureLoopxSidecar); CI (desktop-package.yml / nightly-artifacts.yml) installs Python 3.13; THIRD_PARTY_NOTICES.md carries the LoopX MIT/NOTICE/TRADEMARKS obligations; resources/loopx/ is gitignored (generated artifact).
  7. Web UI: LoopxAPI.ts, loopxBridgeProtocol.ts, MiniApp scene/bridge updates, FlowChat/event wiring, locales (zh-CN/zh-TW/en-US).
  8. Docs: asset AGENTS.md/README.md updated to OpenBitFun naming; desktop AGENTS.md reconciled with the registry-driven peer/workspace policy.

Deviations / notes

  • BitFun-Installer lockfile commit from feat(miniapp): add builtin bitfun-loopx console MiniApp #2382 is dropped: the 1.0.0 repo pins generated installer lockfiles out of git (.gitignore, OpenBitFun-Installer).
  • Peer/workspace stances now live in remote_surface/table.rs (Product Operation Registry) instead of the removed hand-written tables; loopx commands are Unsupported on remote workspaces, ControllerLocal under Peer Device Mode (contracts to be negotiated across peers), CLI peer host refuses before dispatch.
  • LoopX CLI pin: v0.5.1 @ 1bb42f4c (same as feat(miniapp): add builtin bitfun-loopx console MiniApp #2382's later state).
  • Verification on the new codebase: cargo check -p openbitfun-product-domains --features miniapp, cargo check -p openbitfun-services-integrations --no-default-features --features miniapp-runtime,miniapp-loopx, plus the desktop/core compile chain (see checklist).

Fixes # (none; replaces the closed #2382)

Type and Areas

Type: Feature

Areas: contracts/product-domains (builtin MiniApp assets, loopx contracts), services-integrations (loopx CLI/GitHub/workspace adapters), assembly/core (LoopX controller), Desktop (Tauri commands, sidecar bundling), Web UI, scripts/CI, docs, THIRD_PARTY_NOTICES

Motivation / Impact

loopx (huangruiteng/loopx) is a control plane CLI for long-running Agent tasks: goals, todos, gates, quotas are all recorded, but it has no scheduler or executor. bitfun-loopx adds both: a heartbeat alarm and the OpenBitFun host Agent as the hand. Marketplace installs are limited by the marketStrict runtime tier and cannot run the repair loop; the built-in version is not.

The bundled sidecar means users need neither Python, git, nor network access to use loopx; the MIT redistribution obligations ship alongside the binary (LICENSE / NOTICE / LICENSE-MIT / TRADEMARKS / manifest.json in resources/loopx/, plus THIRD_PARTY_NOTICES.md).

Verification

  • cargo check -p openbitfun-product-domains --features miniapp — passes (loopx_contracts + builtin_miniapp covered)
  • cargo check -p openbitfun-services-integrations --no-default-features --features miniapp-runtime,miniapp-loopx — passes
  • node --test scripts/desktop-tauri-build.test.mjs — 17/17
  • node scripts/check-core-boundaries.test.mjs — loopx feature-ownership rules included (see the env-artifact note during migration)
  • (list the final desktop/core check results once the chain completes)

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Replaces GCWing#2382, which was closed when main was replaced with the 1.0.0
codebase; this branch is based on the new main and reapplies the built-in
LoopX console MiniApp for OpenBitFun.

Highlights:
- Built-in MiniApp assets (product-domains/src/miniapp/builtin/assets/bitfun-loopx)
  registered via BUILTIN_APPS with the content-hash seed policy; private
  app.loopx.* bridge is injected only for the verified built-in identity
  (builtin-bitfun-loopx).
- LoopX contracts (types/ports/policy/bridge) in product-domains; pinned
  sidecar CLI adapter + GitHub intake + worktree service behind the new
  services-integrations 'miniapp-loopx' feature.
- Core LoopX controller, agent adapter, store, subscriber, tool activity in
  assembly/core (custom-agent-runner path per the LoopX cooperative runner
  contract); desktop Tauri surface (7 commands) with Product Operation
  Registry rows (Unsupported / ControllerLocal / REFUSED).
- Bundled loopx sidecar build pipeline: scripts/build-loopx.mjs (pinned
  v0.5.1 @ 1bb42f4c) wired into desktop-tauri-build.mjs and dev.cjs,
  Python 3.13 in the packaging CI, THIRD_PARTY_NOTICES obligations.
- Web UI: LoopxAPI/loopxBridgeProtocol, bridge + flow-chat wiring, locales.
- Dropped the closed-PR installer-lockfile commit: the 1.0.0 repo pins
  generated installer lockfiles out of git (OpenBitFun-Installer policy).

Verified: cargo check -p openbitfun-product-domains --features miniapp;
cargo check -p openbitfun-services-integrations with
miniapp-runtime,miniapp-loopx,web-tools; cargo check -p openbitfun-core
--features product-full; cargo check -p openbitfun-desktop;
cargo test -p openbitfun-product-domains remote_surface (19/19);
pnpm run capabilities:generate; pnpm --dir src/web-ui run gen:types;
pnpm run type-check:web; node --test scripts/desktop-tauri-build.test.mjs.
@xielixing

Copy link
Copy Markdown
Author

Replaces closed PR #2382 (feat(miniapp): add builtin bitfun-loopx console MiniApp) — same work reapplied on the current \main, per the migration note on #2382. See #2382 for the original review context.

@xielixing xielixing changed the title feat(miniapp): add built-in bitfun-loopx console MiniApp (replaces #2382) [WIP]feat(miniapp): add built-in bitfun-loopx console MiniApp (replaces #2382) Sep 6, 2026
…fy approval copy

- loopx_cli.rs: decode sidecar stdout/stderr/payload as strict UTF-8 first, then GBK (the PyInstaller bundle ignores PYTHONUTF8 and always emits the ANSI code page, so lossy UTF-8 decode turned Chinese gate messages into U+FFFD mojibake); keep PYTHONUTF8/PYTHONIOENCODING for the managed-source Python entrypoint; add encoding_rs behind the miniapp-loopx feature

- ui.js/index.html: open the raw request by default; rewrite approve/reject/recommendation copy to name the concrete boundary (writes/commits, builds, installs, real-run validation) and why approval is needed; stop duplicating the request text in the decision card
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant