@devaccel-labs/app-comments-toolbar

中文文档
1.1.0发布于 2026/10/14UNLICENSEDTypeScriptES Module近 30 天下载 7224

In-app comment toolbar for host apps on MyStatusFlow App comments: Vite plugin, , and the same-origin session route.

原始使用文档

@devaccel-labs/app-comments-toolbar

The in-app comment toolbar that host apps (Officers Assist, JebelAI) load at runtime from the App comments worker as /v1/toolbar/1.js. Ported from the comment-service repo (packages/core and packages/react) on 2026-10-12; this is the source of record for the runtime.

  • src/core: anchor model and resolution (resolveAnchor), DOM-free.
  • src/runtime: the React runtime (runtime.tsx is the bundle entry), element capture and placement, sync, attachments, page screenshots (page-image.ts), styles, and the live update (update.ts, build-id.ts). loader.tsx is the host-side <CommentToolbar>.
  • src/compiler, src/vite, src/server: the Vite plugin that stamps components with data-cs-cmp / data-cs-file, and the same-origin session route. Entry points src/react.ts, src/vite.ts, src/server.ts.
  • Tests: tests/unit/app-comments-toolbar-*.spec.ts.

How the toolbar ships

The toolbar is released by deploying MyStatusFlow, nothing else (ADR-APPC-008):

  • bun scripts/app-comments/build-toolbar.mjs writes workers/app-comments/toolbar-dist/v1/toolbar/ (checked in; see docs/policies/generated-files-policy.md) with a build id hashed from the runtime's source, stamped into the bundle and written to build.json. bun scripts/dev/dev-app-comments.mjs builds it too.
  • bun run deploy:staging (and the CI deploy) rebuilds it as its own phase and deploys the worker; a worker's served assets count toward the deploy's change detection.
  • A toolbar that is open reads /v1/toolbar/build.json when its live socket reconnects (a deploy restarts it), when its tab becomes visible, and every five minutes. A different id makes it import the new bundle and remount itself in place, once nobody is mid-draft, mid-reply, recording or editing.

The npm package

Hosts install the package for the three things that are host-side by nature: the Vite plugin (build time), the session route (server side) and the <CommentToolbar> loader. The package holds no runtime (since 1.1.0), so it only changes when the loader contract (runtimeVersion) does. bun run build here writes dist/; publish with npm publish from this directory. The COMMENT_SERVICE_* env names in hosts are unchanged.

/v1 responses and the runtime's storage keys must stay compatible with whatever package version the hosts have installed; the runtime itself is always the worker's current build.

版本与发布记录

@devaccel-labs/app-comments-toolbar 共发布 3 个版本,首次发布于 2026/10/13;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.1.0latest2026/10/1429 天前
1.0.02026/10/1329 天前
0.0.0-stage2026/10/1329 天前

关于 @devaccel-labs/app-comments-toolbar 的常见问题

@devaccel-labs/app-comments-toolbar 是什么?

In-app comment toolbar for host apps on MyStatusFlow App comments: Vite plugin, , and the same-origin session route.

如何安装 @devaccel-labs/app-comments-toolbar?

在项目目录运行 npm install @devaccel-labs/app-comments-toolbar,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18)、react-dom(>=18)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@devaccel-labs/app-comments-toolbar 支持 TypeScript 吗?

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

@devaccel-labs/app-comments-toolbar 支持 ESM 还是 CommonJS?

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

@devaccel-labs/app-comments-toolbar 可以商用吗?

@devaccel-labs/app-comments-toolbar 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@devaccel-labs/app-comments-toolbar 的下载量有多少?

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

@devaccel-labs/app-comments-toolbar 还在维护吗?

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