@ariestools/browser-kit

中文文档
2.0.0发布于 2026/09/19LGPL-3.0-onlyTypeScriptES Module近 30 天下载 2758

Config-driven provider actor launcher shared by browser realms

原始使用文档

@ariestools/browser-kit

Browser-facing config-driven launcher for provider actors used by pages, workers, service workers, and extension/plugin realms.

The package delegates platform-neutral catalog selection, provider planning, provisioning, actor construction, supervision, and sessions to @ariestools/actor-system. It adds a descriptor-free browser system manifest and attaches actors in other realms using typed proxy factories without resolving provider bindings again.

import {
  compileBrowserSystem,
  launchCompiledBrowserSystem,
} from '@ariestools/browser-kit'

const compiled = compileBrowserSystem({ actorCatalog, config, providerDescriptors })
const session = await launchCompiledBrowserSystem({ actorCatalog, compiled })

Compilation acquires no providers and constructs no actors. The compiled value retains installed descriptors and must stay in its owner realm. Use a BrowserSystemManifest plus a typed proxy adapter when another realm attaches. launchBrowserSystem remains the one-step compile-and-launch convenience.

Cross-realm manifests distinguish a compatible planId from the exact systemInstanceId. Neither identifier is authentication; realm adapters must authenticate their peers.

Retained startup

startBrowserSystem(options) returns synchronously before compilation. Its whenReady() joins the same compiled browser launcher; snapshot() and subscribe() retain the neutral bounded graph and resource events even when compilation or acquisition fails. Pass the handle to bindPageLifecycle or bindWorkerShutdown before awaiting readiness. A stop request waits for an in-flight factory and rolls back at the next owned acquisition checkpoint.

Runtime options, including diagnostic sinks, cancellation checkpoints and strict resident termination signals, pass through to actor-system. Custom provisioners remain responsible for enforcing declared access internally and reporting their actual acquisitions. Cross-realm attachment is a separate operation and does not yet expose this pre-boot handle.

Proxy factory authority

A proxy factory represents only the owner-selected monikers assigned to its provider ID in the attached system. Its transport facade permits requests for those monikers only, exposes no transport-close operation, and rejects new or late completed requests after that proxy's cleanup. The scope remains live during its own disposer and closes even if disposal fails. Remote provider dependencies execute in the owning realm; their declarations do not grant a proxy factory unrelated remote service access. The transport owner alone closes the shared connection after all proxy disposers have run.

版本与发布记录

@ariestools/browser-kit 共发布 6 个版本,首次发布于 2026/08/01;过去 12 个月发布了 6 个版本。

版本发布日期距今
2.0.0latest2026/09/191 个月前
1.1.02026/08/112 个月前
1.0.02026/08/112 个月前
0.1.22026/08/112 个月前
0.1.12026/08/013 个月前
0.1.02026/08/013 个月前

关于 @ariestools/browser-kit 的常见问题

@ariestools/browser-kit 是什么?

Config-driven provider actor launcher shared by browser realms

如何安装 @ariestools/browser-kit?

在项目目录运行 npm install @ariestools/browser-kit,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(^4.6)、@ariestools/provider(^1.3 || ^2.0)、@ariestools/actor-model(^1.3 || ^2.0)、@ariestools/actor-system(^1.3 || ^2.0)、@ariestools/provider-model(^1.3 || ^2.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@ariestools/browser-kit 支持 TypeScript 吗?

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

@ariestools/browser-kit 支持 ESM 还是 CommonJS?

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

@ariestools/browser-kit 需要什么版本的 Node.js?

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

@ariestools/browser-kit 可以商用吗?

@ariestools/browser-kit 使用 LGPL-3.0-only 许可。弱 Copyleft:作为库被调用时通常不要求开源你自己的代码,但修改库本身需以 LGPL 开源;前端打包合并后的适用边界存在不同理解。以上为概括,不构成法律意见,请以许可原文为准。

@ariestools/browser-kit 的下载量有多少?

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

@ariestools/browser-kit 还在维护吗?

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