codex-work-receipt 0.3.0
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 +23 -0
- package/CODE_OF_CONDUCT.md +4 -0
- package/CONTRIBUTING.md +23 -0
- package/LICENSE +674 -0
- package/README.en.md +167 -0
- package/README.md +244 -0
- package/SECURITY.md +7 -0
- package/assets/README.md +11 -0
- package/assets/miniprogram-code.png +0 -0
- package/docs/data-schema.md +25 -0
- package/docs/images/readme-hero.jpg +0 -0
- package/docs/images/receipts/receipt-classic.jpg +0 -0
- package/docs/images/receipts/receipt-diner.jpg +0 -0
- package/docs/images/receipts/receipt-payroll.jpg +0 -0
- package/docs/images/sponsors/modelflare-logo.png +0 -0
- package/docs/mobile-import.md +15 -0
- package/docs/privacy.md +12 -0
- package/package.json +57 -0
- package/skills/ai-work-receipt/SKILL.md +42 -0
- package/skills/ai-work-receipt/agents/openai.yaml +4 -0
- package/src/cli.mjs +109 -0
- package/src/core/args.mjs +84 -0
- package/src/core/metrics.mjs +149 -0
- package/src/core/presentation.mjs +239 -0
- package/src/core/qr-payload.mjs +69 -0
- package/src/core/receipt-record.mjs +121 -0
- package/src/core/skill-installer.mjs +38 -0
- package/src/lib/time.mjs +53 -0
- package/src/parsers/codex.mjs +51 -0
- package/src/renderers/html.mjs +398 -0
- package/templates/README.md +10 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Codex Work Receipt
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="./README.md">中文</a> · <strong>English</strong>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Turn local Codex activity into a work receipt you can keep and share.</strong><br>
|
|
9
|
+
One command · Local-first · Chinese & English · Three themes · Mobile QR import
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img alt="Node.js 20+" src="https://img.shields.io/badge/Node.js-20%2B-339933?logo=node.js&logoColor=white">
|
|
14
|
+
<img alt="Local first" src="https://img.shields.io/badge/data-local--first-17231F">
|
|
15
|
+
<img alt="Privacy first" src="https://img.shields.io/badge/privacy-no%20prompts%20or%20code-42CDA7">
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<img src="docs/images/readme-hero.jpg" alt="Three Codex Work Receipt themes" width="920">
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
The tool reads timestamps and numerical metadata from local Codex sessions. Generated receipts do not contain prompts, responses, source code, project paths, or file names.
|
|
23
|
+
|
|
24
|
+
## Sponsor
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<a href="https://modelflare.dev/">
|
|
28
|
+
<img src="docs/images/sponsors/modelflare-logo.png" alt="ModelFlare Logo" width="72">
|
|
29
|
+
</a>
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<a href="https://modelflare.dev/"><strong>ModelFlare</strong></a><br>
|
|
34
|
+
<a href="https://modelflare.dev/">modelflare.dev</a><br>
|
|
35
|
+
<sub>Stable access to leading AI model APIs at a very low cost, with developer-friendly pricing, transparent billing, and clear usage visibility.</sub>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
## Receipt themes
|
|
39
|
+
|
|
40
|
+
<table>
|
|
41
|
+
<tr>
|
|
42
|
+
<td align="center"><strong>Classic</strong></td>
|
|
43
|
+
<td align="center"><strong>Vintage Diner</strong></td>
|
|
44
|
+
<td align="center"><strong>Night Payroll</strong></td>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<td><img src="docs/images/receipts/receipt-classic.jpg" alt="Classic work receipt" width="320"></td>
|
|
48
|
+
<td><img src="docs/images/receipts/receipt-diner.jpg" alt="Vintage diner work receipt" width="320"></td>
|
|
49
|
+
<td><img src="docs/images/receipts/receipt-payroll.jpg" alt="Night payroll work receipt" width="320"></td>
|
|
50
|
+
</tr>
|
|
51
|
+
</table>
|
|
52
|
+
|
|
53
|
+
## Quick start
|
|
54
|
+
|
|
55
|
+
Requires Node.js 20+ and local Codex session records.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx codex-work-receipt@latest --latest --lang en
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Summarize all Codex activity from today in your local timezone:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx codex-work-receipt@latest --today --lang en
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Outputs are written to `./codex-work-receipt-output/` by default.
|
|
68
|
+
|
|
69
|
+
## Desktop-to-mobile flow
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
Local Codex sessions
|
|
73
|
+
→ run one command
|
|
74
|
+
→ generate an HTML receipt and data QR code
|
|
75
|
+
→ scan from the companion mini program
|
|
76
|
+
→ change themes, save, and share
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The companion mini program supports QR import, local history, themes, and image export. Scan the official mini-program code with WeChat, then scan the adjacent data QR code to import the current receipt.
|
|
80
|
+
|
|
81
|
+
## Ask Codex directly
|
|
82
|
+
|
|
83
|
+
Install the AI Work Receipt skill once:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx codex-work-receipt@latest --install-skill --lang en
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then ask Codex naturally:
|
|
90
|
+
|
|
91
|
+
> Create an AI work receipt for my latest Codex session.
|
|
92
|
+
|
|
93
|
+
> Generate today's AI work receipt with the diner theme.
|
|
94
|
+
|
|
95
|
+
Codex will select the correct mode and theme, run the CLI, and open the generated page. You can also invoke `$ai-work-receipt` explicitly.
|
|
96
|
+
|
|
97
|
+
The skill is installed at `~/.agents/skills/ai-work-receipt/` and does not modify the current repository. Restart Codex if the current session does not detect it.
|
|
98
|
+
|
|
99
|
+
## Features
|
|
100
|
+
|
|
101
|
+
- Latest-session and today summaries
|
|
102
|
+
- Complete Chinese and English receipt copy
|
|
103
|
+
- Three visual receipt themes
|
|
104
|
+
- Turns, user messages, tool calls, interruptions, Tokens, duration, and models
|
|
105
|
+
- Playful AI work points, job titles, and reviews
|
|
106
|
+
- Versioned `cwr1` QR payload for mobile import
|
|
107
|
+
- Local JSON snapshots and deduplicated history
|
|
108
|
+
- Installable Codex skill for natural-language generation
|
|
109
|
+
- No prompt, response, code, path, or file-name export
|
|
110
|
+
|
|
111
|
+
## Common options
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx codex-work-receipt@latest --latest --lang en --theme diner
|
|
115
|
+
npx codex-work-receipt@latest --latest --lang en --no-open
|
|
116
|
+
npx codex-work-receipt@latest --today --lang en --timezone Asia/Shanghai --output ./my-receipt.html
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Run `npx codex-work-receipt@latest --help` for the full option list.
|
|
120
|
+
|
|
121
|
+
## Privacy
|
|
122
|
+
|
|
123
|
+
- Reads `~/.codex/sessions/**/*.jsonl` by default
|
|
124
|
+
- Extracts event types, timestamps, model names, and numerical statistics only
|
|
125
|
+
- Does not store prompts, responses, source code, project paths, or file names
|
|
126
|
+
- Does not send session data over the network while running
|
|
127
|
+
- Saves HTML and structured history locally
|
|
128
|
+
|
|
129
|
+
See [docs/privacy.md](docs/privacy.md) and [docs/data-schema.md](docs/data-schema.md).
|
|
130
|
+
|
|
131
|
+
## Open-source boundary
|
|
132
|
+
|
|
133
|
+
This repository contains the desktop CLI, receipt renderer, QR data protocol, tests, and documentation. It does not contain the companion mini-program source code or server implementation.
|
|
134
|
+
|
|
135
|
+
## Local development
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
git clone https://github.com/a-bai-2026/ai-work-receipt.git
|
|
139
|
+
cd codex-work-receipt
|
|
140
|
+
npm install
|
|
141
|
+
npm test
|
|
142
|
+
npm run receipt -- --latest
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md) before contributing. Never submit real Codex sessions.
|
|
146
|
+
|
|
147
|
+
## Roadmap
|
|
148
|
+
|
|
149
|
+
- More receipt themes
|
|
150
|
+
- Cursor and WorkBuddy data sources
|
|
151
|
+
- Cross-tool activity reports
|
|
152
|
+
- Weekly and monthly AI work archives
|
|
153
|
+
- More parser fixtures and end-to-end compatibility tests
|
|
154
|
+
|
|
155
|
+
## License and disclaimer
|
|
156
|
+
|
|
157
|
+
- The desktop source code in this repository is licensed under [GNU GPL v3](LICENSE) (`GPL-3.0-only`)
|
|
158
|
+
- Modified or redistributed versions must continue to comply with GPLv3 and provide the corresponding source code
|
|
159
|
+
- GPLv3 applies only to the desktop project in this repository; it does not cover the companion mini program, backend services, or other independent products
|
|
160
|
+
- This is an unofficial community project and is not affiliated with or endorsed by OpenAI
|
|
161
|
+
- Codex and other product names belong to their respective owners
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
<p align="center">
|
|
166
|
+
<strong>If the receipt made you smile, consider leaving a Star.</strong>
|
|
167
|
+
</p>
|
package/README.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Codex AI 打工小票
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>中文</strong> · <a href="./README.en.md">English</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>把本机 Codex 的工作记录,开成一张可以带走的 AI 打工小票。</strong><br>
|
|
9
|
+
一行命令 · 完全本地 · 中英双语 · 三种主题 · 扫码传到手机
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img alt="Node.js 20+" src="https://img.shields.io/badge/Node.js-20%2B-339933?logo=node.js&logoColor=white">
|
|
14
|
+
<img alt="Local first" src="https://img.shields.io/badge/data-local--first-17231F">
|
|
15
|
+
<img alt="Privacy first" src="https://img.shields.io/badge/privacy-no%20prompts%20or%20code-42CDA7">
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<img src="docs/images/readme-hero.jpg" alt="Codex AI 打工小票三种主题效果" width="920">
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
只读取本机 Codex 会话中的时间和数字统计。<br>
|
|
24
|
+
不会把 Prompt、回复正文、代码、项目路径或文件名写入小票。
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
## 赞助商
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://modelflare.dev/">
|
|
31
|
+
<img src="docs/images/sponsors/modelflare-logo.png" alt="ModelFlare Logo" width="72">
|
|
32
|
+
</a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<a href="https://modelflare.dev/"><strong>ModelFlare</strong></a><br>
|
|
37
|
+
<a href="https://modelflare.dev/">modelflare.dev</a><br>
|
|
38
|
+
<sub>让个人开发者也能以很低的成本稳定接入前沿 AI 模型 API,价格友好、计费透明、用量清晰可见。</sub>
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
## 三种小票主题
|
|
42
|
+
|
|
43
|
+
<table>
|
|
44
|
+
<tr>
|
|
45
|
+
<td align="center"><strong>经典白票</strong></td>
|
|
46
|
+
<td align="center"><strong>复古粉票</strong></td>
|
|
47
|
+
<td align="center"><strong>夜班绿票</strong></td>
|
|
48
|
+
</tr>
|
|
49
|
+
<tr>
|
|
50
|
+
<td><img src="docs/images/receipts/receipt-classic.jpg" alt="AI 打工小票经典白票" width="320"></td>
|
|
51
|
+
<td><img src="docs/images/receipts/receipt-diner.jpg" alt="AI 打工小票复古粉票" width="320"></td>
|
|
52
|
+
<td><img src="docs/images/receipts/receipt-payroll.jpg" alt="AI 打工小票夜班绿票" width="320"></td>
|
|
53
|
+
</tr>
|
|
54
|
+
</table>
|
|
55
|
+
|
|
56
|
+
三种主题只改变视觉表达,不改变统计口径。生成网页后也可以即时切换主题。
|
|
57
|
+
|
|
58
|
+
## 30 秒快速开始
|
|
59
|
+
|
|
60
|
+
需要 Node.js 20 或更高版本,并且本机已经使用过 Codex。
|
|
61
|
+
|
|
62
|
+
不需要克隆仓库,统计最近一次会话并自动打开小票:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx codex-work-receipt@latest --latest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
汇总本地时区今天发生的全部 Codex 活动:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx codex-work-receipt@latest --today
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
生成英文版小票:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx codex-work-receipt@latest --latest --lang en
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
生成结果默认保存在:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
./codex-work-receipt-output/
|
|
84
|
+
├── codex-receipt-latest.html
|
|
85
|
+
└── codex-receipt-latest.json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 从电脑到手机
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
Codex 本地会话
|
|
92
|
+
↓
|
|
93
|
+
运行一行命令
|
|
94
|
+
↓
|
|
95
|
+
生成 AI 打工小票网页和数据二维码
|
|
96
|
+
↓
|
|
97
|
+
在配套小程序中扫码导入
|
|
98
|
+
↓
|
|
99
|
+
换模板、保存图片、分享
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
配套小程序已经支持扫码导入、本地历史、主题切换和保存图片。微信扫码即可进入配套小程序,再扫描旁边的数据二维码导入当前小票。
|
|
103
|
+
|
|
104
|
+
数据二维码只携带版本化的脱敏统计,不携带图片和原始会话。桌面端与小程序端分别根据同一份结构数据渲染小票。
|
|
105
|
+
|
|
106
|
+
## 直接跟 Codex 说
|
|
107
|
+
|
|
108
|
+
只需安装一次 AI 打工小票 Skill:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npx codex-work-receipt@latest --install-skill
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
以后可以直接对 Codex 说:
|
|
115
|
+
|
|
116
|
+
> 给刚刚这次工作开一张 AI 打工小票。
|
|
117
|
+
|
|
118
|
+
> 生成我今天的 AI 打工小票,使用复古粉票。
|
|
119
|
+
|
|
120
|
+
> 用英文生成刚刚这次工作的 AI 打工小票。
|
|
121
|
+
|
|
122
|
+
Codex 会自动判断 `--latest` 或 `--today`、选择主题、执行命令并打开生成的网页。也可以通过 `$ai-work-receipt` 显式调用。
|
|
123
|
+
|
|
124
|
+
Skill 安装在用户目录 `~/.agents/skills/ai-work-receipt/`,不会写入当前代码仓库;如果当前会话没有识别到,请重启 Codex。
|
|
125
|
+
|
|
126
|
+
## 它能做什么
|
|
127
|
+
|
|
128
|
+
- 统计最近一次 Codex 会话,或汇总今天的全部活动
|
|
129
|
+
- 生成经典白票、复古粉票、夜班绿票三种主题
|
|
130
|
+
- 支持中文和英文两套完整小票文案
|
|
131
|
+
- 统计会话、轮次、用户消息、工具调用和中断次数
|
|
132
|
+
- 展示 Token、缓存输入、AI 工作时长和模型
|
|
133
|
+
- 根据工作量生成娱乐化的 AI 工分、今日工种和点评
|
|
134
|
+
- 生成可供配套小程序扫描的 `cwr1` 数据二维码
|
|
135
|
+
- 在本机保存结构 JSON 和去重后的历史记录
|
|
136
|
+
- 安装可通过自然语言触发的 Codex Skill
|
|
137
|
+
- 全程不上传 Prompt、回复、代码或项目路径
|
|
138
|
+
|
|
139
|
+
## 常用命令
|
|
140
|
+
|
|
141
|
+
选择默认主题:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npx codex-work-receipt@latest --latest --theme diner
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
仅生成文件,不自动打开浏览器:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npx codex-work-receipt@latest --latest --no-open
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
指定时区和输出路径:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npx codex-work-receipt@latest --today \
|
|
157
|
+
--timezone Asia/Shanghai \
|
|
158
|
+
--output ./my-receipt.html
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
可用参数:
|
|
162
|
+
|
|
163
|
+
| 参数 | 说明 |
|
|
164
|
+
| --- | --- |
|
|
165
|
+
| `--latest` | 统计最近活跃的 Codex 会话,默认模式 |
|
|
166
|
+
| `--today` | 汇总指定时区今天发生的 Codex 活动 |
|
|
167
|
+
| `--timezone <name>` | 指定 IANA 时区,例如 `Asia/Shanghai` |
|
|
168
|
+
| `--lang <name>` | `zh-CN`(默认)或 `en` |
|
|
169
|
+
| `--theme <name>` | `classic`、`diner` 或 `payroll` |
|
|
170
|
+
| `--output <file>` | 指定 HTML 输出路径 |
|
|
171
|
+
| `--data-dir <directory>` | 指定本地结构历史目录 |
|
|
172
|
+
| `--install-skill` | 将 AI 打工小票 Skill 安装到当前用户的 Codex |
|
|
173
|
+
| `--no-open` | 生成后不自动打开浏览器 |
|
|
174
|
+
|
|
175
|
+
## 本地保存的数据
|
|
176
|
+
|
|
177
|
+
每次运行会生成或更新:
|
|
178
|
+
|
|
179
|
+
- `codex-work-receipt-output/codex-receipt-*.html`:可切换主题的小票网页
|
|
180
|
+
- `codex-work-receipt-output/codex-receipt-*.json`:当前小票的版本化结构数据
|
|
181
|
+
- `~/.codex-work-receipt/receipts/*.json`:本机历史快照
|
|
182
|
+
- `~/.codex-work-receipt/latest.json`:最近生成的一张小票
|
|
183
|
+
- `~/.codex-work-receipt/history.jsonl`:去重后的本地历史,方便未来批量迁移
|
|
184
|
+
|
|
185
|
+
数据结构和二维码协议见 [docs/data-schema.md](docs/data-schema.md)。
|
|
186
|
+
|
|
187
|
+
## 隐私设计
|
|
188
|
+
|
|
189
|
+
- 默认只读取 `~/.codex/sessions/**/*.jsonl`
|
|
190
|
+
- 只提取事件类型、时间、模型名称和数字统计
|
|
191
|
+
- 不保存 Prompt、回复正文、代码、项目路径或文件名
|
|
192
|
+
- 运行期间不向网络发送会话数据
|
|
193
|
+
- HTML、结构 JSON 和历史记录全部保存在本机
|
|
194
|
+
- 二维码等同于一份可扫描的数据文件,请只向信任的人展示
|
|
195
|
+
|
|
196
|
+
更完整的隐私说明见 [docs/privacy.md](docs/privacy.md)。
|
|
197
|
+
|
|
198
|
+
## 当前限制
|
|
199
|
+
|
|
200
|
+
- 暂不统计修改文件数和代码行数,避免在不同工具调用方式下产生误导
|
|
201
|
+
- `--today` 默认扫描最近 72 小时有变动的会话文件,再按事件日期筛选
|
|
202
|
+
- 当前只支持 Codex;Cursor、WorkBuddy 等数据源仍在规划中
|
|
203
|
+
- 网页端不直接导出图片,移动端渲染和保存由配套小程序完成
|
|
204
|
+
|
|
205
|
+
## 本地开发
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
git clone https://github.com/a-bai-2026/ai-work-receipt.git
|
|
209
|
+
cd codex-work-receipt
|
|
210
|
+
npm install
|
|
211
|
+
npm test
|
|
212
|
+
npm run receipt -- --latest
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
贡献前请阅读:
|
|
216
|
+
|
|
217
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
218
|
+
- [SECURITY.md](SECURITY.md)
|
|
219
|
+
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
220
|
+
|
|
221
|
+
测试数据必须是人工构造或彻底脱敏的 fixture,禁止提交真实 Codex 会话。
|
|
222
|
+
|
|
223
|
+
## Roadmap
|
|
224
|
+
|
|
225
|
+
- 增加更多可传播的小票主题
|
|
226
|
+
- 支持 Cursor、WorkBuddy 等 AI 工作工具
|
|
227
|
+
- 完善跨工具的统一数据结构
|
|
228
|
+
- 支持周报、月报和长期 AI 工作档案
|
|
229
|
+
- 改进 Codex 不同版本的日志兼容性和端到端测试
|
|
230
|
+
|
|
231
|
+
## 许可与声明
|
|
232
|
+
|
|
233
|
+
- 本仓库中的电脑端源码采用 [GNU GPL v3](LICENSE)(`GPL-3.0-only`)许可
|
|
234
|
+
- 修改或分发本项目时,必须继续遵守 GPLv3 并提供相应源码
|
|
235
|
+
- GPLv3 仅适用于本仓库中的电脑端项目,不覆盖配套小程序、后台服务或其他独立产品
|
|
236
|
+
- 本项目是非 OpenAI 官方社区工具,与 OpenAI 无隶属或背书关系
|
|
237
|
+
- Codex、Cursor、WorkBuddy 及相关名称和商标归各自权利人所有
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
<p align="center">
|
|
242
|
+
<strong>如果这张小票让你觉得有点意思,欢迎点一个 Star。</strong><br>
|
|
243
|
+
让每一次 AI 打工,都留下一张可以带走的记录。
|
|
244
|
+
</p>
|
package/SECURITY.md
ADDED
package/assets/README.md
ADDED
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Receipt data schema
|
|
2
|
+
|
|
3
|
+
当前结构版本为 `1`。每次生成都会在本机保存一份结构记录。
|
|
4
|
+
|
|
5
|
+
主要字段:
|
|
6
|
+
|
|
7
|
+
- `schema_version`:结构版本
|
|
8
|
+
- `locale`:当前桌面小票语言,支持 `zh-CN` 和 `en`
|
|
9
|
+
- `id`:根据统计快照生成的匿名ID
|
|
10
|
+
- `generated_at`:生成时间
|
|
11
|
+
- `source`:数据来源和统计范围
|
|
12
|
+
- `period`:开始、结束和时区
|
|
13
|
+
- `stats`:轮次、消息、工具、Token、时长等统计
|
|
14
|
+
- `presentation`:默认主题、语言无关的 `work_profile`、本地化工种、点评和 AI 工分
|
|
15
|
+
- `privacy`:明确声明不包含的敏感内容
|
|
16
|
+
|
|
17
|
+
同一个最近会话、或同一天的 `id` 保持稳定;重复生成会更新该记录,而不是不断制造重复历史。`source.snapshot_hash` 用于识别统计内容是否发生变化。
|
|
18
|
+
|
|
19
|
+
二维码使用精简字段,并采用以下格式:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
cwr1.<checksum>.<deflateRaw(JSON) 的 Base64URL>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
二维码中的 `presentation.compensation` 为娱乐化 AI 工分,不代表真实 API 费用。为兼容当前中文小程序,二维码中的展示文案继续使用中文,同时通过精简字段 `l` 和 `r` 携带桌面语言及工种语义 ID;英文 HTML 和本地 JSON 不受影响。小程序应先检查前缀和校验值,再解析数据。未来结构升级通过 `v` 字段兼容。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Mobile import
|
|
2
|
+
|
|
3
|
+
当前桌面网页会生成真实的数据二维码,配套小程序已经支持无服务器导入:
|
|
4
|
+
|
|
5
|
+
1. 扫描固定小程序码并打开小程序。
|
|
6
|
+
2. 点击“从电脑导入”。
|
|
7
|
+
3. 使用小程序扫码能力扫描网页右侧的数据二维码。
|
|
8
|
+
4. 校验 `cwr1` 前缀、checksum 和结构版本。
|
|
9
|
+
5. 解压并解析统计数据。
|
|
10
|
+
6. 写入小程序本地历史,并根据小票 ID 去重。
|
|
11
|
+
7. 使用 Canvas 重新绘制选定模板并保存到手机相册。
|
|
12
|
+
|
|
13
|
+
二维码不传输图片。桌面端与小程序端分别根据同一份结构数据渲染。
|
|
14
|
+
|
|
15
|
+
配套小程序是独立产品,本仓库不包含其源码、AppID、后台代码或服务端密钥。
|
package/docs/privacy.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "codex-work-receipt",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Generate a privacy-first Codex work receipt from local session metadata.",
|
|
6
|
+
"author": "a-bai-2026",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/a-bai-2026/ai-work-receipt.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/a-bai-2026/ai-work-receipt#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/a-bai-2026/ai-work-receipt/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "GPL-3.0-only",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"codex",
|
|
18
|
+
"codex-skill",
|
|
19
|
+
"receipt",
|
|
20
|
+
"developer-tools",
|
|
21
|
+
"local-first",
|
|
22
|
+
"privacy"
|
|
23
|
+
],
|
|
24
|
+
"bin": {
|
|
25
|
+
"codex-work-receipt": "src/cli.mjs"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"receipt": "node src/cli.mjs",
|
|
29
|
+
"test": "node --test",
|
|
30
|
+
"check": "node --check src/cli.mjs && node --check src/core/skill-installer.mjs",
|
|
31
|
+
"prepublishOnly": "npm test && npm run check"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"src",
|
|
35
|
+
"skills",
|
|
36
|
+
"templates",
|
|
37
|
+
"assets",
|
|
38
|
+
"docs",
|
|
39
|
+
"CHANGELOG.md",
|
|
40
|
+
"CODE_OF_CONDUCT.md",
|
|
41
|
+
"CONTRIBUTING.md",
|
|
42
|
+
"README.md",
|
|
43
|
+
"README.en.md",
|
|
44
|
+
"SECURITY.md",
|
|
45
|
+
"LICENSE"
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=20"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"qrcode": "^1.5.4"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-work-receipt
|
|
3
|
+
description: Generate and open a privacy-first local AI work receipt from Codex session metadata. Use when the user asks Codex to create, regenerate, open, or locate an “AI 打工小票” or “AI work receipt” for the latest session or today, in Chinese or English, including requests for the classic, diner, or payroll theme. Do not use for real invoices, salary calculations, API billing, or non-Codex activity.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AI 打工小票
|
|
7
|
+
|
|
8
|
+
Use the published `codex-work-receipt` CLI as the only statistics and rendering engine. Execute the command for the user instead of merely describing it. Do not reimplement or inspect Codex session parsing yourself.
|
|
9
|
+
|
|
10
|
+
## Interpret the request
|
|
11
|
+
|
|
12
|
+
- Use `--latest` for “刚刚”“这次”“最近一次”“上一段工作” or an unspecified request for one receipt.
|
|
13
|
+
- Use `--today` for “今天”“今日”“今天全部工作” or a daily summary.
|
|
14
|
+
- Use `--theme classic` for “经典白票” or no specified theme.
|
|
15
|
+
- Use `--theme diner` for “复古粉票”“粉色小票” or “diner”.
|
|
16
|
+
- Use `--theme payroll` for “夜班绿票”“绿色小票” or “payroll”.
|
|
17
|
+
- Add `--no-open` only when the user asks not to open the browser.
|
|
18
|
+
- Add `--timezone <IANA name>` only when the user explicitly requests another timezone.
|
|
19
|
+
- Use `--lang en` when the user requests English or asks for the receipt in English. Use `--lang zh-CN` otherwise.
|
|
20
|
+
- If the user asks for an unsupported date range, explain that the current version supports only the latest session or today. Do not invent flags.
|
|
21
|
+
|
|
22
|
+
## Execute
|
|
23
|
+
|
|
24
|
+
1. Check `node --version`. Require Node.js 20 or newer. If it is missing or older, report the requirement and stop.
|
|
25
|
+
2. Run from the user's current working directory:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx --yes codex-work-receipt@latest --latest --lang zh-CN --theme classic
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Replace only the mode and optional flags according to the request.
|
|
32
|
+
|
|
33
|
+
3. Let the CLI open the generated HTML unless the user requested `--no-open`.
|
|
34
|
+
4. On success, report the HTML path and tell the user to scan the official mini-program code first, then the adjacent data QR code.
|
|
35
|
+
|
|
36
|
+
## Privacy and failures
|
|
37
|
+
|
|
38
|
+
- Do not read, quote, summarize, or expose prompt text, response text, code, project paths, or file names from Codex sessions.
|
|
39
|
+
- Do not upload session data or add custom mini-program codes. The CLI reads numerical metadata locally and uses the fixed official mini-program code.
|
|
40
|
+
- If `npx` needs network permission to fetch the package, request the narrow permission needed to run it.
|
|
41
|
+
- If no Codex session is found, report that the user must complete at least one Codex task locally before generating a receipt.
|
|
42
|
+
- If generation fails, return the CLI error concisely and do not claim that a receipt was created.
|