Skip to content

Commit 4e1856a

Browse files
Add A/时差保安 (timezone-guard): a two-clock verdict panel for the other time zone (#61)
* Add A/时差保安 (timezone-guard): a two-clock verdict panel for the other time zone * README: correct the preview timestamp, bump to 1.0.1 The preview captions claimed the target clock read 19:49, but the screenshot actually shows 20:23 (08:23 晚上 in the 12-hour Chinese format). Both READMEs now say 20:23. Version 1.0.0 -> 1.0.1, because the package content changed after the pull request was opened. --------- Co-authored-by: FineCat <LiuChen19960902@users.noreply.github.com>
1 parent 55c13bd commit 4e1856a

17 files changed

Lines changed: 3432 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ The MiniMax Code Agent communicates through the host MCP client. Business reques
7575
| [Anatomy Gallery](plugins/zch0227/anatomy-gallery/) | A gallery for interactive isometric figures made with the anatomy skill: hang them in rooms you organize, view light and dark editions full screen, keep every version, and have an Agent create or edit figures from the gallery with a per-run process log. The anatomy skill is bundled. Requires MiniMax Code 3.1.2 or later | [zch0227](https://github.com/zch0227) |
7676
| [仓库透视 / Repo X-Ray](plugins/yujiachen-y/repo-xray/) | Understand a codebase from its Git history: a code map you can drill into, hotspots and bug magnets, high-risk files, owners and knowledge loss, commit rhythm and firefighting, and the tech stack. Works with GitHub, GitLab, and local repositories; analysis runs on your machine | [yujiachen-y](https://github.com/yujiachen-y) |
7777
| [Disk Insight](plugins/zch0227/disk-insight/) | See where disk space went on macOS and Windows with a sunburst space map, find junk files sorted into three safety tiers, large and duplicate files, and how much code repositories and Git worktrees take; ask an Agent about any item, and permanently delete what you select after a confirmation that lists every item. Requires MiniMax Code 3.1.2 or later | [zch0227](https://github.com/zch0227) |
78+
| [A/时差保安 / Timezone Guard](plugins/liuchen19960902/timezone-guard/) | Check the other side's local time before you message: the target city's clock turns into a green "now is fine", yellow "keep it short", or red "go to sleep" verdict. Requires MiniMax Code 3.1.2 or later | [FineCat](https://github.com/LiuChen19960902) |
7879

7980
<details>
8081
<summary>Preview: Token Usage Board</summary>

‎README.zh-CN.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ MiniMax Code Agent 通过宿主 MCP 客户端与 MiniApp 协作。业务请求
7575
| [Anatomy 画廊](plugins/zch0227/anatomy-gallery/README.zh-CN.md) | 集中展示 anatomy 技能做出的交互式等距图解:按自建展区挂墙,全屏查看明暗两版,保留全部历史版本;在画廊里让 Agent 新建或修改作品,每次运行都有过程记录。自带 anatomy 技能。需要 MiniMax Code 3.1.2 或更高版本 | [zch0227](https://github.com/zch0227) |
7676
| [仓库透视](plugins/yujiachen-y/repo-xray/README.zh-CN.md) | 从 Git 历史看懂一个代码仓库:可逐层下钻的代码地图、热点与 Bug 磁铁、高风险文件、负责人与知识流失、提交节奏与救火记录、技术栈;支持 GitHub、GitLab 和本机仓库,全部在本机分析 | [yujiachen-y](https://github.com/yujiachen-y) |
7777
| [磁盘透视](plugins/zch0227/disk-insight/README.zh-CN.md) | 查看 macOS 和 Windows 的磁盘空间去向:旭日图空间地图,按三档风险分类的垃圾文件,大文件和重复文件,代码仓库和 Git worktree 的占用;任何条目都可以问 Agent,选中的条目在确认框里逐一列出,确认后直接永久删除。需要 MiniMax Code 3.1.2 或更高版本 | [zch0227](https://github.com/zch0227) |
78+
| [A/时差保安](plugins/liuchen19960902/timezone-guard/README.zh-CN.md) | 发消息前先看对方那边几点:按对方城市当地时间给出「现在可以聊 / 短聊就好 / 先睡,别发」三档判定。需要 MiniMax Code 3.1.2 或更高版本 | [FineCat](https://github.com/LiuChen19960902) |
7879

7980
<details>
8081
<summary>预览:Token 用量看板</summary>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"schemaVersion": 1,
3+
"name": "timezone-guard",
4+
"displayName": "A/时差保安",
5+
"version": "1.0.1",
6+
"description": "别在对方睡着的时区跟 Claude 聊天。A/时差保安实时对照对方当地时间:绿了正常聊,黄了短聊,红了先睡。",
7+
"author": "FineCat",
8+
"icon": "icon.png",
9+
"category": "Productivity",
10+
"exampleQueries": [
11+
"打开A/时差保安,看看洛杉矶现在该不该开口",
12+
"洛杉矶现在几点,对照上海"
13+
],
14+
"apps": [],
15+
"mcpServers": [],
16+
"skills": []
17+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 FineCat
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# A/时差保安 (Timezone Guard)
2+
3+
[English](README.md) | [简体中文](README.zh-CN.md)
4+
5+
One clock, one verdict: is it a reasonable time to message someone in another time zone? The verdict
6+
follows the **other** city's local time, because what matters is whether *they* are awake.
7+
8+
Author: [FineCat](https://github.com/LiuChen19960902) · Version: `1.0.1`
9+
10+
![A/时差保安 showing the verdict, with the target city clock above the local one](docs/preview.png)
11+
12+
*The page itself is in Chinese. This screenshot is the light theme, taken while Los Angeles was at
13+
20:23 (the evening band); the dark theme is below.*
14+
15+
![A/时差保安 in the dark theme](docs/preview-dark.png)
16+
17+
## What it answers
18+
19+
**Whether to speak up right now.**
20+
21+
The verdict reads the **target city's local time**, not yours — it is their convenience that
22+
matters. Your own city is shown for reference only. The thresholds are the same for every city,
23+
regardless of hemisphere or local habits.
24+
25+
| Target local time | Band | Verdict |
26+
| --- | --- | --- |
27+
| 09:00–18:00 | Day (green) | Now is fine |
28+
| 18:00–22:00 | Evening (yellow) | Keep it short |
29+
| 06:00–09:00 | Early morning (yellow) | Don't go deep |
30+
| 22:00–06:00 | Night (red) | Go to sleep, don't send |
31+
32+
## What is on the page
33+
34+
- **One verdict** — a 24 px status-coloured headline, the single subject of the page. Colour is
35+
never the only carrier of meaning; text and shape carry it too.
36+
- **Two clocks** — the target city on top, your own below, each with its date and short time zone
37+
name (PDT, GMT+8, and so on). 12-hour and 24-hour formats are both available.
38+
- **A 24-cell strip** — one cell per hour of the target city's day, drawn as a sun, a half sun on
39+
the horizon, or a moon. The current hour is filled with the verdict colour, and the four
40+
thresholds land exactly on cell boundaries.
41+
- **A one-line tip** — under the verdict, one line reads "their band + time range + one sentence
42+
of advice", and below it an optional time-difference note appears when your own side is the
43+
later one. No message templates, no copy button, and nothing is pushed into a chat box.
44+
- **Every time zone** — all 418 time zones the runtime knows about are covered, and in the tables
45+
shipped with this package each one has a Chinese name (the count follows the runtime's own time
46+
zone database; a zone the runtime adds later and the shipped tables do not know yet falls back
47+
to its English name). Country-level entries such as "China (default)" are there too. Either
48+
city can be changed on its own, and the ⇄ in the title swaps the two in one click.
49+
50+
Times and offsets are computed locally with the browser's `Intl` and the runtime's own time zone
51+
database, so daylight saving time is handled for you. **No network, no account, no push, not a
52+
calendar.**
53+
54+
## Install
55+
56+
Copy the whole directory, **including the hidden `.minimax-plugin` directory**, into the MiniMax
57+
Code plugins directory:
58+
59+
| System | Target path |
60+
| --- | --- |
61+
| Windows | `C:\Users\<you>\.minimax\plugins\timezone-guard` |
62+
| macOS | `/Users/<you>/.minimax/plugins/timezone-guard` |
63+
| Linux | `/home/<you>/.minimax/plugins/timezone-guard` |
64+
65+
`.minimax` is a hidden directory: on Windows enable "Hidden items" in File Explorer, on macOS press
66+
`Cmd + Shift + .`. If your client uses a custom data directory, put the package in that
67+
directory's `plugins/` folder instead.
68+
69+
Then restart MiniMax Code, confirm the plugin is recognised and enabled, and ask the Agent to open
70+
"A/时差保安" — or say "打开A/时差保安,看看洛杉矶现在该不该开口".
71+
72+
To update, close the app and exit MiniMax Code first, then replace the whole plugin directory.
73+
74+
## Tested environment
75+
76+
MiniMax Code desktop **3.1.4** on Windows 11 Home (10.0.26300, x64). This package was developed
77+
and tested against 3.1.4.
78+
79+
Requires MiniMax Code **3.1.2** or later: the package declares `surface.window` (the size of the
80+
popped-out window), so older clients cannot install it at all.
81+
82+
Checked inside the client: install and open; the verdict switches correctly across its four time
83+
bands (day, early morning, evening, night); either city can be changed on its own, and the ⇄ in
84+
the title swaps the pair with one click (checked with a mouse click and with Enter / Space — both
85+
clocks, the time difference, the hour strip, the verdict and the two city inputs all follow the
86+
swap and persist); the city list
87+
covers every time zone the runtime knows about (418 on the tested runtime), each with a Chinese
88+
name and no dead entry; the 12/24-hour toggle persists; both the light and the dark theme render
89+
correctly; the page renders at the panel's default width.
90+
91+
Layout was additionally measured against this package's own client files in Chromium 155 at 400 /
92+
460 / 560 / 680 / 1100 / 1440 CSS pixels wide: no horizontal overflow, no double scrollbar, no
93+
stray whitespace under the card.
94+
95+
**Not verified:** macOS and Linux; popping the page out into its own window (`surface.window`) was
96+
never exercised — the page is a single responsive column either way.
97+
98+
## Data & access
99+
100+
- **Files read** — only the four static files inside its own package directory:
101+
`miniapp/client/index.html`, `styles.css`, `cities.js`, `app.js`. Nothing outside the package is
102+
read, and the disk is never scanned.
103+
- **Files written** — none. `context.dataDir` is not used and nothing is written anywhere.
104+
- **Browser storage** — interface preferences only, under the key `timezone-guard.prefs.v1`: the
105+
selected pair of cities, the theme, and the 12/24-hour format. No session and no content data.
106+
- **Network** — none. The page loads its assets from the plugin's own loopback server; there is no
107+
telemetry, and no remote font, icon, or script.
108+
- **Processes** — none spawned.
109+
- **Agent turns** — none. The package declares no `agentAccess` and starts no Agent turn.
110+
- **Credentials** — no API key, no account, no configuration of any kind.
111+
112+
## Files
113+
114+
```text
115+
.minimax-plugin/plugin.json Plugin manifest
116+
package.json Mini App declaration
117+
miniapp/miniapp.json Payload roots, Node entry, page route
118+
miniapp/client/index.html The page served at /dashboard, including the SVG sprite
119+
miniapp/client/styles.css Visual layer
120+
miniapp/client/app.js Time zone logic, verdict, city picker, 24-hour strip
121+
miniapp/client/cities.js City list and Chinese names for every time zone
122+
miniapp/node/server.mjs Node entry: start(context) → { dispose }
123+
miniapp/node/miniapp-api.ts Type declarations for the runtime context
124+
docs/preview.png Screenshot of the page, light theme
125+
docs/preview-dark.png Screenshot of the page, dark theme
126+
icon.png Plugin icon
127+
```
128+
129+
The page is plain HTML, CSS, and JavaScript — no framework, no CDN, no build step, fully offline.
130+
The Node entry only serves `/dashboard` and those four files on the port the Host assigns. There
131+
are **no third-party runtime dependencies**: the Node side uses built-in modules only, and the
132+
browser side uses native APIs only.
133+
134+
## License
135+
136+
[MIT](./LICENSE).
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# A/时差保安
2+
3+
[English](README.md) | 简体中文
4+
5+
发消息之前先看一眼对方那边几点。一个只有结论、没有废话的时差仪表:**该正常聊、该短聊、还是该先睡**,一律按对方城市的当地时间判定。
6+
7+
作者:[FineCat](https://github.com/LiuChen19960902) · 版本:`1.0.1`
8+
9+
![A/时差保安:判定区给出「短聊就好」,下方是对方城市与自己的两个时钟](docs/preview.png)
10+
11+
*浅色主题。截图拍摄时洛杉矶是 20:23,落在傍晚档;深色主题见下图。*
12+
13+
![A/时差保安:深色主题](docs/preview-dark.png)
14+
15+
## 它回答什么
16+
17+
**此刻该不该开口跟对方说话。**
18+
19+
判定只看**对方城市的当地时间** —— 不方便的是对方,不是你;自己的城市只作对照。所以人在上海盯洛杉矶,和人在伦敦盯上海,是同一套标准。
20+
21+
| 对方当地时间 | 档位 | 结论 |
22+
| --- | --- | --- |
23+
| 09:00–18:00 | 白天(绿) | 现在可以聊 |
24+
| 18:00–22:00 | 傍晚(黄) | 短聊就好 |
25+
| 06:00–09:00 | 清晨(黄) | 先别展开 |
26+
| 22:00–06:00 | 深夜(红) | 先睡,别发 |
27+
28+
阈值对所有城市完全一致,不因东西半球或作息文化而变。
29+
30+
## 页面里有什么
31+
32+
- **一个判定** —— 24 px 状态色大字,页面的唯一主角。颜色之外始终有文字和形状,不靠颜色单独传意。
33+
- **两个时钟** —— 对方城市在上,自己的在下,各带日期和时区短名(PDT、GMT+8 这类)。12H / 24H 可切换。
34+
- **一条 24 格图标带** —— 对方城市一天里的每一小时占一格,画成太阳、贴地平线的半日或月亮;当前那一格铺上判定色。四个阈值正好落在格子边界上。
35+
- **一句话提醒** —— 判定下方一行写明「对方档位 + 时间段 + 一句话建议」,再往下是可选的时差提醒(只有你这边更晚时才出现)。不生成话术、不提供一键复制、不往聊天框里塞东西。
36+
- **所有时区都能选** —— 运行时认识的 418 个时区全部覆盖,在随包的这套表里每个都有中文名(数量随运行时 tzdata 版本增减;若运行时新增了表里还没有的时区,该条目会退回英文名)。另按国家给出「中国(默认)」这类国家级条目。两侧的城市都能单独切换,标题中间那个 ⇄ 还能一键对调。
37+
38+
时间与偏移全部由浏览器的 `Intl` 和运行时自带的时区数据库算出,夏令时自动处理。**不联网、无账号、无推送、不做日历。**
39+
40+
## 安装与使用
41+
42+
把整个目录(**含隐藏的 `.minimax-plugin` 目录**)复制到用户主目录下的 `.minimax/plugins/`:
43+
44+
| 系统 | 目标路径 |
45+
| --- | --- |
46+
| Windows | `C:\Users\<用户名>\.minimax\plugins\timezone-guard` |
47+
| macOS | `/Users/<用户名>/.minimax/plugins/timezone-guard` |
48+
| Linux | `/home/<用户名>/.minimax/plugins/timezone-guard` |
49+
50+
`.minimax` 是隐藏目录:Windows 上需在文件资源管理器开启「显示隐藏的项目」,macOS 上按 `Cmd + Shift + .`。只要用过 MiniMax Code,这个目录通常已经存在。如果客户端使用了自定义数据目录,请放到那个目录下的 `plugins/` 里。
51+
52+
然后重启 MiniMax Code,确认插件已被识别并启用,让 Agent 帮你打开「A/时差保安」,或直接说「打开A/时差保安,看看洛杉矶现在该不该开口」。
53+
54+
更新时先关闭应用并退出 MiniMax Code,再整体替换插件目录。卸载同理,删除该目录即可。
55+
56+
## 已验证环境
57+
58+
MiniMax Code 桌面版 **3.1.4**,Windows 11 家庭版(10.0.26300,x64)。本插件在 3.1.4 上开发并测试。
59+
60+
需要 MiniMax Code **3.1.2** 或更高版本:包里声明了 `surface.window`(弹出独立窗口的尺寸),更早的版本装不上这个包。
61+
62+
在客户端里验证过:安装与打开;判定在白天 / 清晨 / 傍晚 / 深夜四个时段档各自正确切换;两个城市分别可切换,标题里的 ⇄ 点击后可一键对调(鼠标点击与键盘 Enter / Space 都试过,对调后两个时钟、时差、图标带、判定与两个城市输入框全部跟着翻转并持久化);城市库覆盖运行时全部时区(实测运行时为 418 个)、每个都有中文名、无失效条目;12H / 24H 切换并持久化;浅色与深色两套主题;面板默认宽度下渲染正常。
63+
64+
布局另在本包的 client 文件上用 Chromium 155 直接测过 400 / 460 / 560 / 680 / 1100 / 1440 px 六档宽度:无横向溢出、无双滚动条、卡片底部无多余留白。
65+
66+
**未验证:** macOS 与 Linux;把面板弹成独立窗口(`surface.window`)这条路径没有实测过 —— 页面本身仍是一列响应式布局。
67+
68+
## 数据与访问范围
69+
70+
- **读取的文件** —— 只有它自己包目录下的四个静态文件:`miniapp/client/index.html`、`styles.css`、`cities.js`、`app.js`。不读包目录以外的任何文件,也不扫描磁盘。
71+
- **写入的文件** —— 无。不写 `context.dataDir`,不写任何地方。
72+
- **浏览器存储** —— 只存界面偏好,键名 `timezone-guard.prefs.v1`:选中的两个城市、主题、12H/24H 制式。不存会话、不存任何内容数据。
73+
- **网络** —— 无。页面只从插件自己的回环服务加载静态资源,没有遥测,没有远程字体、图标或脚本。
74+
- **子进程** —— 无。
75+
- **Agent 轮次** —— 无。包没有声明 `agentAccess`,运行期不发起任何 Agent 调用。
76+
- **凭据** —— 不需要 API key、不需要账号、不需要任何配置。
77+
78+
## 源码与验证情况
79+
80+
页面是 `miniapp/client/index.html`(无框架、无 CDN、无构建步骤,离线可用),视觉层在 `styles.css`,逻辑在 `app.js`,城市库与全时区中文名在 `cities.js`;Node 入口是 `miniapp/node/server.mjs`,它只负责把 `/dashboard` 和这四个静态文件挂到宿主分配的端口上;供编辑器类型检查用的 Host API 类型定义在 `miniapp/node/miniapp-api.ts`。**没有任何第三方运行时依赖** —— Node 侧只用内置模块,浏览器侧只用原生 API。
81+
82+
## 许可
83+
84+
[MIT](LICENSE)。
93.6 KB
Loading
94.2 KB
Loading
4.67 KB
Loading

0 commit comments

Comments
 (0)