npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

poi-plugin-gimmick-tracker

v0.1.1

Published

Track and confirm KanColle event-map gimmick conditions in poi.

Downloads

252

Readme

poi-plugin-gimmick-tracker

面向 poi 11.1.0 的舰队 Collection“解密·削甲记录”插件。插件平时在后台记录当前出击事实;检测到解密或削甲生效信号时聚焦内嵌页签,展示待确认卡片。插件不使用独立窗口,不联网,也不依赖 poi-plugin-battle-detail 的战斗分组。

能做什么

  • 直接监听 windowgame.response,记录 /api_req_map/startnextair_raid 路线。
  • 直接覆盖 sortie / combined battle 的 battleairbattleld_airbattlenight_to_daysp_midnightmidnight 等响应,并由 battleresult 补充胜利 Rank。
  • 观测节点到达、节点胜利、api_kouku.api_stage1.api_disp_seiku 节点制空,以及 api_destruction_battle 基地防空制空;路线明确标出 ld_airbattle 舰队空袭和基地防空,并保存时间戳与 API 路径引用。
  • 从 FCD fcd.map["<area>-<map>"].route[api_no][1] 解析 DA2 等节点标签;数据缺失时显示 #<api_no>,不会令监听器崩溃。
  • 支持粘贴 D点S胜2次C2点到达2次A2点空优1次守家空优2次,可用中英文逗号、分号、空格混排。
  • 按海域显示事实观测数与人工确认状态。A胜 接受 A/S/SS,S胜 接受 S/SS;制空条件按“达到或优于”匹配,例如空确也满足空优。
  • 待确认卡片左侧显示本次完整路线和触发时间,右侧下拉选择本次完成条件;按海域的清单会保留该图上一次触发出击的路线。

触发与确认语义

主信号是 /kcsapi/api_port/portbody.api_event_object.api_m_flag2 === 1。辅助信号包括任意 */battleresultbody.api_m2 === 1,以及 start / next / air_raid 中对象或数组形态 api_destruction_battle 元素的 api_m2 === 1

同一 sortie 只生成一张 review;辅助信号可先创建 pending,回港事件再封存完整快照。确认攻略 condition 只设置 confirmed / confirmedAt,不会把事实观测数再加一次。只有该海域没有攻略 condition 时,确认观测候选才生成自由完成记录。

如果插件在出击中途才加载,可能只收到带 m_flag2 的回港响应。此时仍会生成 pending 并聚焦,但路线为空且明确标记“未捕获到完整出击”,不会静默漏记。

本地数据与生命周期

状态按宿主 store 中的 info.basic.api_member_id 分开保存:

<window.APPDATA_PATH>/gimmick-tracker/<memberId>/state-v1.json

JSON 含 schemaVersion,写入采用同目录临时文件加 rename。memberId 未知或非法时不会创建目录,JSON 内也不重复保存 memberId。插件只保存地图、节点、Rank、制空、时间戳和用户确认状态,不保存 API token、舰队、装备或其他账号内容,不发起网络请求。

监听器在模块级 controller 中管理:pluginDidLoad 幂等注册一次,pluginWillUnload 对称移除;热重载不会在同一模块实例内重复监听。

自动聚焦优先使用 poi 11.1.0 从 views/env 暴露的 ipc.access('MainWindow').ipcFocusPlugin(id),随后才尝试 deprecated window.ipc。IPC 不可用时按单栏/双栏布局 dispatch 新 shape @@TabSwitch;再失败只调用 window.success。所有路径都被隔离,宿主异常不会中断事件处理。

开发与验收

npm install
npm test
npm run typecheck
npm run build
npm pack --dry-run

React 18、ReactDOM 和 Blueprint 5 都是 peer dependency,并在 CJS 构建中 external;安装进 poi 后复用宿主实例,不打包第二份 React。