dsh-niuma 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/README.en.md +73 -0
- package/README.md +85 -2
- package/THIRD-PARTY-NOTICES.md +20 -0
- package/cordis.patch.yml +15 -0
- package/docs/preview-light-dark.png +0 -0
- package/lib/client.js +1106 -0
- package/lib/client.js.map +7 -0
- package/lib/index.js +415 -0
- package/package.json +101 -4
- package/src/client/index.js +838 -0
- package/src/core.mjs +433 -0
- package/src/holidays.mjs +48 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本文件记录用户可感知的变化。版本号遵循语义化版本。
|
|
4
|
+
|
|
5
|
+
## 0.1.1 — 2026-10-21
|
|
6
|
+
|
|
7
|
+
发布链路改为**自动直发**(用户可感知:以后发版不用人工批准)。
|
|
8
|
+
|
|
9
|
+
- 推 tag `vX.Y.Z` → GitHub Actions 用 npm Trusted Publishing(OIDC)直接 `npm publish --provenance --access public`
|
|
10
|
+
- 发布带 **SLSA provenance**(0.1.0 是本地手动发布,没有 provenance)
|
|
11
|
+
- 保留人工模式:手动 Run workflow 选 `mode=stage`,可走「暂存 + 在 npm 网页批准」
|
|
12
|
+
- 前提:npm 包设置里的 Trusted Publisher 绑定页勾选 “Allow npm publish”
|
|
13
|
+
|
|
14
|
+
## 0.1.0 — 2026-10-21
|
|
15
|
+
|
|
16
|
+
首个版本。
|
|
17
|
+
|
|
18
|
+
- 新增「牛马」侧栏入口与主面板:把**实收月薪**换算成每秒滚动的现金计数器
|
|
19
|
+
- 六档工资换算:秒工资、分工资、时工资、日工资、周工资、月工资
|
|
20
|
+
- 工作日口径:周一至周五上班;法定节假日不算工作日(日工资因此变高);调休上班日算工作日
|
|
21
|
+
- 内置 2026 年法定节假日与调休上班日(来源:国办发明电〔2025〕7号),面板内可编辑
|
|
22
|
+
- 可设置上下班时间、午休起止,并可勾选「午休是否算工时」;午休不算工时时金额冻结
|
|
23
|
+
- 今日已赚按秒刷新(4 位小数)、今日进度条、距上班/下班倒计时、状态徽标
|
|
24
|
+
- 设置面板内直接保存到 DSH 设置;非法输入就地提示,不白屏
|
|
25
|
+
- 中英双语
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 oli20
|
|
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.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# dsh-niuma · Salary Ticker for DSH
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-niuma)
|
|
4
|
+
|
|
5
|
+
> A DSH (DeepSeek Harness) plugin that turns your **monthly take-home pay** into a **live cash counter that ticks every second**.
|
|
6
|
+
> Glance at it during work: your money grows before your eyes. After hours it stops — a tiny daily reality check.
|
|
7
|
+
|
|
8
|
+
[中文](README.md) | English
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
> **Community plugin, not affiliated with DeepSeek.** All amounts are local estimates from the salary and working
|
|
13
|
+
> hours you enter — not a payslip, not a bill, not labor or financial advice.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## What it computes
|
|
18
|
+
|
|
19
|
+
Set it up once, then the panel refreshes every second:
|
|
20
|
+
|
|
21
|
+
- **Earned today**: your effective work income accumulated per second, 4 decimals, visibly ticking
|
|
22
|
+
- **Per-second / per-minute / per-hour / per-day / per-week / per-month** wage breakdown
|
|
23
|
+
- **Working-day rules**: Mon–Fri count as working days; **statutory holidays do NOT count** (so the daily wage rises); **make-up workdays DO count**
|
|
24
|
+
- Editable lunch break, with a checkbox for **whether lunch counts as paid work time** (unpaid lunch freezes the counter)
|
|
25
|
+
- Status badge: day off / not started / working / on lunch / off work
|
|
26
|
+
- Progress bar for today, countdown to start / end of shift
|
|
27
|
+
|
|
28
|
+
### Formulas
|
|
29
|
+
|
|
30
|
+
| Metric | Formula |
|
|
31
|
+
|---|---|
|
|
32
|
+
| Paid minutes per day | (end − start) − (lunch enabled and unpaid ? lunch length : 0) |
|
|
33
|
+
| Working days this month | Mon–Fri, minus statutory holidays, plus make-up workdays |
|
|
34
|
+
| Daily wage | monthly take-home ÷ working days this month |
|
|
35
|
+
| Hourly wage | daily wage ÷ paid hours |
|
|
36
|
+
| Minute / second wage | hourly ÷ 60 / ÷ 3600 |
|
|
37
|
+
| Weekly wage | daily wage × working days this week (Mon–Sun) |
|
|
38
|
+
| Earned today | paid seconds today × second wage (capped at the daily wage) |
|
|
39
|
+
|
|
40
|
+
Ships with the **2026** China statutory holiday and make-up workday calendar
|
|
41
|
+
([State Council notice](https://www.gov.cn/zhengce/content/202511/content_7047090.htm)); both lists are editable in the panel.
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
dsh plugin --profile desktop add dsh-niuma
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or add it to your profile's `package.json` dependencies and `dsh.profile.bundles`, then fully quit and reopen DSH.
|
|
50
|
+
**Plugins load at startup — a restart is required.**
|
|
51
|
+
|
|
52
|
+
## Privacy
|
|
53
|
+
|
|
54
|
+
No network calls, no telemetry. Your salary and schedule live in your local DSH settings only.
|
|
55
|
+
|
|
56
|
+
## Compatibility
|
|
57
|
+
|
|
58
|
+
- DSH 0.2.x (verified on 0.2.1-rc.2)
|
|
59
|
+
- Node ≥ 22.19.0
|
|
60
|
+
|
|
61
|
+
## Development
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm run setup # link DSH base modules + esbuild (once)
|
|
65
|
+
npm run build # build lib/client.js (the built artifact is committed)
|
|
66
|
+
npm test # 5 checks: core / holidays / host smoke / client smoke / render smoke
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
See [`SPEC.md`](SPEC.md) for the implementation contract.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-niuma · 牛马加速器
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-niuma)
|
|
4
|
+
|
|
5
|
+
> DSH(DeepSeek Harness)插件:把**实收月薪**换算成**每秒跳动的现金计数器**。
|
|
6
|
+
> 上班摸鱼看一眼,今天的钱正在一秒一秒地长大;下班后它停住,提醒你「今天又白干了」还是「今天赚够了」。
|
|
7
|
+
|
|
8
|
+
[English](README.en.md) | 中文
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
> **社区插件,并非 DeepSeek 官方插件。** 与深度求索(DeepSeek)无隶属、合作或背书关系。
|
|
13
|
+
> 所有金额都是按你填的工资与工时**本地估算**,不是工资条、不是账单,不构成任何劳动/财务建议。
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 它算什么
|
|
20
|
+
|
|
21
|
+
填一次你的情况,面板每秒更新:
|
|
22
|
+
|
|
23
|
+
- **今日已赚**:按秒累加的有效工作收益,4 位小数,肉眼可见地跳
|
|
24
|
+
- **秒工资 / 分工资 / 时工资 / 日工资 / 周工资 / 月工资** 六档换算
|
|
25
|
+
- **工作日口径**:周一至周五上班;**法定节假日不算工作日**;**调休上班日算工作日**
|
|
26
|
+
- 节假日不算工作日 → 当月工作日变少 → **日工资更高**(这正是「牛马加速器」的核心体感)
|
|
27
|
+
- 午休可设置起止,**可勾选午休是否算工时**;午休不算工时则午休期间金额冻结
|
|
28
|
+
- 状态徽标:休息日 / 未上班 / 搬砖中 / 午休中 / 已下班
|
|
29
|
+
- 今日进度条、距上班/距下班倒计时
|
|
30
|
+
|
|
31
|
+
### 口径公式
|
|
32
|
+
|
|
33
|
+
| 指标 | 公式 |
|
|
34
|
+
|---|---|
|
|
35
|
+
| 日有效工时 | (下班 − 上班)−(午休启用且不计薪 ? 午休时长 : 0) |
|
|
36
|
+
| 当月工作日数 | 当月内「周一至周五,扣除法定节假日,加上调休上班日」的天数 |
|
|
37
|
+
| 日工资 | 实收月薪 ÷ 当月工作日数 |
|
|
38
|
+
| 时工资 | 日工资 ÷ 日有效工时 |
|
|
39
|
+
| 分工资 / 秒工资 | 时工资 ÷ 60 / ÷ 3600 |
|
|
40
|
+
| 周工资 | 日工资 × 本周(周一~周日)工作日数 |
|
|
41
|
+
| 今日已赚 | 今日有效工作秒数 × 秒工资(封顶日工资) |
|
|
42
|
+
|
|
43
|
+
默认内置 **2026 年**法定节假日与调休上班日,来源:
|
|
44
|
+
[国务院办公厅关于2026年部分节假日安排的通知(国办发明电〔2025〕7号)](https://www.gov.cn/zhengce/content/202511/content_7047090.htm)。
|
|
45
|
+
跨年后可在面板里直接编辑「节假日 / 调休上班日」(一行一个 `YYYY-MM-DD`)。
|
|
46
|
+
|
|
47
|
+
## 安装
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# 在 DSH profile 里安装(包名:dsh-niuma)
|
|
51
|
+
dsh plugin --profile desktop add dsh-niuma
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
或写进 profile 的 `package.json` 依赖与 `dsh.profile.bundles` 后重启 DSH。
|
|
55
|
+
**插件是启动时加载的,安装/升级后必须完全退出并重开 DSH。**
|
|
56
|
+
|
|
57
|
+
## 使用
|
|
58
|
+
|
|
59
|
+
1. 打开 DSH 侧栏 → 点 **牛马** 图标
|
|
60
|
+
2. 展开「设置」:填实收月薪、上下班时间、午休时间,勾选午休是否算工时
|
|
61
|
+
3. 保存后回到顶部看「今日已赚」按秒滚动
|
|
62
|
+
|
|
63
|
+
## 隐私
|
|
64
|
+
|
|
65
|
+
- 不联网、不上传、不统计。工资、作息只存在你本机的 DSH 设置里。
|
|
66
|
+
- 面板所有数字(除了节假日表)都由本机时间实时计算。
|
|
67
|
+
|
|
68
|
+
## 兼容性
|
|
69
|
+
|
|
70
|
+
- DSH 0.2.x(开发与验证版本:0.2.1-rc.2)
|
|
71
|
+
- Node ≥ 22.19.0(DSH 自带运行时满足)
|
|
72
|
+
|
|
73
|
+
## 开发
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm run setup # 链接 DSH 基座模块 + esbuild(只需一次)
|
|
77
|
+
npm run build # 构建 lib/client.js(构建产物必须入库)
|
|
78
|
+
npm test # 5 项自检:core / holidays / host 烟测 / client 烟测 / 渲染烟测
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`lib/client.js` 是构建产物,源码在 `src/client/index.js`;宿主半侧在 `lib/index.js`,纯逻辑在 `src/core.mjs`。
|
|
82
|
+
实现契约与验收口径见 [`SPEC.md`](SPEC.md)。
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
dsh-niuma 本身以 MIT 协议发布(见 `LICENSE`)。
|
|
4
|
+
|
|
5
|
+
## 运行时依赖
|
|
6
|
+
|
|
7
|
+
**无。** 插件运行时不带任何第三方 npm 依赖:宿主半侧只 import DSH 本体提供的服务
|
|
8
|
+
(`@deepseek-ai/schemastery` 为可选依赖,动态加载失败即降级),浏览器半侧由 DSH 外壳注入 React。
|
|
9
|
+
|
|
10
|
+
## 构建期依赖
|
|
11
|
+
|
|
12
|
+
| 包 | 用途 | 协议 |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| [esbuild](https://esbuild.github.io/) | 构建 `lib/client.js` | MIT |
|
|
15
|
+
| [@deepseek-ai/schemastery](https://www.npmjs.com/package/@deepseek-ai/schemastery) | 宿主侧设置 schema(来自 DSH 本体) | 见 DSH 许可 |
|
|
16
|
+
|
|
17
|
+
## 数据来源
|
|
18
|
+
|
|
19
|
+
- 2026 年法定节假日与调休上班日:国务院办公厅《关于2026年部分节假日安排的通知》(国办发明电〔2025〕7号),
|
|
20
|
+
<https://www.gov.cn/zhengce/content/202511/content_7047090.htm>(政府公开信息)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# dsh-niuma bundle patch:把自己插进 DSH 的 profile 层栈。
|
|
2
|
+
# 宿主半侧(Node)从这里被 Loader 加载;浏览器半侧由 package.json 的 dsh.client 声明。
|
|
3
|
+
#
|
|
4
|
+
# row id 必须唯一:内核 @deepseek-ai/dsh-base 已经占了 `niuma` 之外的常用 id,
|
|
5
|
+
# 这里统一用 `niuma`,与包名去前缀一致。
|
|
6
|
+
- insert:
|
|
7
|
+
- id: niuma
|
|
8
|
+
name: 'dsh-niuma'
|
|
9
|
+
config:
|
|
10
|
+
# 留空即用默认值(见 tools 里的 schema / README)。
|
|
11
|
+
# 想改默认值可以在这里写,例如:
|
|
12
|
+
# monthlySalary: 12000
|
|
13
|
+
# workStart: '09:30'
|
|
14
|
+
# lunchPaid: true
|
|
15
|
+
{}
|
|
Binary file
|