@agentshouse/app-bridge

中文文档
0.1.0-c1e5c86e4cadd发布于 2026/11/08MITTypeScriptES Module零依赖近 30 天下载 4.3万

Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications, status, App release code, App and Site screenshot reads, App messages and the Chat, with an accessor and an in-page te

原始使用文档

@agentshouse/app-bridge

The types of the agents.house App bridge, an accessor and an in-page test host. House builds the bridge object in every App it serves and hands it to the page before the App's own scripts run; houseBridge() returns that object, so an App carries no bridge code of its own. It carries these families: navigation, ceremonies, installation, notifications, Telegram, status, App release code, external calls, App messages, App and Site screenshot reads and the Chat. docs/families.md describes each and the test host.

The bridge carries no credential handling and no Runtime family. House builds the MD Runtime client into the page beside the bridge and serves it the Chat, so the App imports, constructs and bundles neither: bridge.runtime resolves to the client.

House's guide to building an App is its Guide's apps/ pages, which guide/open opens.

Use

import { houseBridge } from '@agentshouse/app-bridge';

const bridge = houseBridge();
const md = await bridge.runtime;

bridge.onAddress((address) => render(address));
bridge.onStatus((status) => showSync(status.sync));
bridge.setTab({ title: 'Atlas (3)' });

open('/rooms/atlas');
function open(address) {
  bridge.push(address);
}

async function manageSecurity(securityPath) {
  try {
    await bridge.ceremony(securityPath);
  } catch (refusal) {
    if (refusal.name === 'HouseCeremonyRefused') report(refusal.path);
  }
}

bridge.runtime resolves to the MdRuntimeClient of @agentshouse/mdruntime/client, whose README describes its members. Its call(method, params) is a remote procedure call to a House act by its name, such as call('rooms/members/list', { room_ref }): HouseMethods names each with House's own input, HouseParams<Name>, and answer, HouseResult<Name>.

Test without a House

import { houseBridge } from '@agentshouse/app-bridge';
import { createHouseBridgeTestHost } from '@agentshouse/app-bridge/test-host';

const host = createHouseBridgeTestHost({ address: '/rooms/atlas' });
const bridge = houseBridge();

bridge.push('/rooms/atlas/members');
host.open('/rooms/atlas');

版本与发布记录

@agentshouse/app-bridge 共发布 338 个版本,首次发布于 2026/09/19;过去 12 个月发布了 338 个版本。

版本发布日期距今
0.1.0-c1e5c86e4caddlatest2026/11/08今天
0.1.0-c4ed9ded90f192026/11/08今天
0.1.0-c40090dc288872026/11/07今天
0.1.0-c16d1cd66abf82026/11/07今天
0.1.0-c5b5f2cb999702026/11/07今天
0.1.0-cbdd0f22603b12026/11/07今天

其他发布通道:alpha → 0.1.0-alpha.1,pushed → 0.1.0-ccef427e0f56d。

关于 @agentshouse/app-bridge 的常见问题

@agentshouse/app-bridge 是什么?

Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications, status, App release code, App and Site screenshot reads, App messages and the Chat, with an accessor and an in-page te

如何安装 @agentshouse/app-bridge?

在项目目录运行 npm install @agentshouse/app-bridge,或使用 pnpm add / yarn add / bun add。

@agentshouse/app-bridge 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@agentshouse/app-bridge 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agentshouse/app-bridge 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@agentshouse/app-bridge 可以商用吗?

@agentshouse/app-bridge 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@agentshouse/app-bridge 的下载量有多少?

根据 npm 官方下载统计,@agentshouse/app-bridge 在 2026/10/05 – 2026/11/03 这 30 天内被下载 42,858 次,日均约 1,429 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agentshouse/app-bridge 还在维护吗?

最新版本 0.1.0-c1e5c86e4cadd 发布于 2026/11/08(今天);至今共发布 338 个版本,其中过去 12 个月发布了 338 个;首次发布于 2026/09/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。