attention-secretary 0.1.0 → 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/README.md +75 -82
- package/bin/attention.js +38 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,38 +1,26 @@
|
|
|
1
|
-
# Attention
|
|
1
|
+
# Attention
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**A personal secretary for your Mac. It keeps track of everything on your plate and puts what matters in front of you.**
|
|
4
4
|
|
|
5
|
-
[
|
|
5
|
+
English | [中文](https://github.com/markd88/attention-secretary/blob/main/README.zh-CN.md)
|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> Early version (0.1). The author uses it every day and it is still being polished. Problems and ideas are welcome as [Issues](https://github.com/markd88/attention-secretary/issues).
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## What it is
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
- **需要你拍板**:只有需要你决定的事、等你看的结果才会出现在这里。
|
|
13
|
-
- **秘书**:一个常驻的终端,直接打字就是跟它说话;它派出去的执行者各占一个标签,你随时可以点进去接手。
|
|
14
|
-
- **全部事项**:按工作分组,每件事的进度、下一步、项目目录都在详情里。
|
|
15
|
-
- **桌宠**:一只小猫(布偶猫或金渐层)待在桌面上,秘书在忙、有事等你拍板、你完成一件事时,它的动作会跟着变。单击摸摸它,双击打开工作窗口。
|
|
11
|
+
Attention is a macOS app that uses your own [Claude Code](https://docs.claude.com/en/docs/claude-code) or [Codex](https://github.com/openai/codex) as a secretary. It remembers everything you hand it, picks the few things that matter most each day, keeps track of how each piece of work is going, and brings you what needs your decision. The actual work goes to sessions it starts for you, or that you take over yourself.
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
- **Today**: the 3–5 things that matter most today, one line each.
|
|
14
|
+
- **Needs you**: only decisions that are yours to make, and results waiting for you.
|
|
15
|
+
- **Secretary**: a resident terminal. Type in it to talk to the secretary; each session it starts gets its own tab you can step into.
|
|
16
|
+
- **All items**: everything, grouped by area of work, with progress and the next step.
|
|
17
|
+
- **Desktop pet**: a cat that reacts when the secretary is busy, when something needs you, and when you finish something.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Install
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
- **Claude Code 或 Codex 已经装好并且登录了**:在终端里运行 `claude`(或 `codex`)能正常对话就行。Attention 用的就是你终端里的那个,你的登录方式、网关、API Key 都原样沿用。第一次打开时选用哪一个,之后可以在设置里换。
|
|
23
|
-
- 用 npm 安装需要 Node.js 18 或更新。
|
|
21
|
+
You need macOS 13 or later, and Claude Code or Codex installed and signed in (running `claude` or `codex` in Terminal works). Attention uses that same one, with your sign-in and settings as they are.
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
curl -fsSL https://claude.ai/install.sh | bash
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
装好后在终端运行一次 `claude` 完成登录。
|
|
32
|
-
|
|
33
|
-
## 安装
|
|
34
|
-
|
|
35
|
-
### 用 npm(推荐)
|
|
23
|
+
With npm (Node.js 18 or later):
|
|
36
24
|
|
|
37
25
|
```bash
|
|
38
26
|
npm install -g attention-secretary
|
|
@@ -42,82 +30,87 @@ npm install -g attention-secretary
|
|
|
42
30
|
attention install
|
|
43
31
|
```
|
|
44
32
|
|
|
45
|
-
`
|
|
33
|
+
Or download the DMG for your chip (`arm64` for Apple silicon, `x86_64` for Intel) from [Releases](https://github.com/markd88/attention-secretary/releases) and drag Attention into Applications.
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| `attention open` | 打开工作窗口 |
|
|
35
|
+
Attention is not notarized by Apple. If macOS blocks the first launch, go to System Settings → Privacy & Security and click **Open Anyway**.
|
|
36
|
+
|
|
37
|
+
## You stay in control
|
|
38
|
+
|
|
39
|
+
- A new item is shown to you as a draft and recorded only after you agree.
|
|
40
|
+
- Only you can mark something done.
|
|
41
|
+
- Anything outward-facing (sending messages, committing, paying, publishing) needs your authorization.
|
|
55
42
|
|
|
56
|
-
|
|
43
|
+
Your data stays on your Mac in `~/.attention`. Conversations go through your own Claude Code or Codex to the model service you chose. Attention's only network request of its own is a daily check for a new version number.
|
|
57
44
|
|
|
58
|
-
|
|
45
|
+
## More
|
|
59
46
|
|
|
60
|
-
|
|
47
|
+
<details>
|
|
48
|
+
<summary>CLI commands</summary>
|
|
61
49
|
|
|
62
|
-
|
|
50
|
+
Installing the npm package runs no scripts; nothing happens until you type one of these:
|
|
51
|
+
|
|
52
|
+
| Command | What it does |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `attention install` | Download, verify (release signature and checksums) and install |
|
|
55
|
+
| `attention update` | Update to the latest version, keeping your data |
|
|
56
|
+
| `attention rollback` | Go back to the previous version |
|
|
57
|
+
| `attention uninstall` | Uninstall; your data stays in `~/.attention` |
|
|
58
|
+
| `attention doctor` | Check that Claude Code can run the secretary |
|
|
59
|
+
| `attention open` | Open the work window |
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
2. 打开「系统设置 → 隐私与安全性」,往下翻到安全性那一栏,会看到“已阻止打开 Attention”,点「仍要打开」。
|
|
66
|
-
3. 输入密码确认。
|
|
61
|
+
When a new version is out, the About page says so. "Update Attention" there, or `attention update`, waits until the secretary finishes its current round. Without Node.js, download the new DMG and replace the app.
|
|
67
62
|
|
|
68
|
-
|
|
63
|
+
</details>
|
|
69
64
|
|
|
70
|
-
|
|
65
|
+
<details>
|
|
66
|
+
<summary>What the secretary does on its own</summary>
|
|
71
67
|
|
|
72
|
-
|
|
68
|
+
Day to day the secretary only keeps track. The one thing it does on its own is **pre-research**: for an item that hasn't started and whose first step is looking things up, it starts a session to do a first round of research, writes it up, and stops, waiting for you.
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
2
|
|
76
|
-
|
|
77
|
-
4. 直接在秘书终端里跟它说你手上有哪些事,它会整理成事项草稿给你确认,再排出今天该做的。比如:
|
|
78
|
-
- “帮我记一件事:周五前给王琳回邮件。”
|
|
79
|
-
- “把我今天要做的整理一下,按优先级排出来。”
|
|
80
|
-
- “这个任务在 `~/code/shop-app` 里做。”
|
|
70
|
+
- It works only in Attention's own workspace, never in your project folders, and takes no outward-facing action.
|
|
71
|
+
- At most 2 at a time; the rest wait in a queue.
|
|
72
|
+
- You can step in any time. Typing in its tab means you've taken over; "Stop", "No research" or closing the tab means that item won't be researched on its own again.
|
|
81
73
|
|
|
82
|
-
|
|
74
|
+
</details>
|
|
83
75
|
|
|
84
|
-
|
|
76
|
+
<details>
|
|
77
|
+
<summary>Skills, MCP servers and persona</summary>
|
|
85
78
|
|
|
86
|
-
|
|
79
|
+
In Settings:
|
|
87
80
|
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
- 列表上会显示「秘书调研中」或「秘书排队调研」。
|
|
91
|
-
- 你随时可以插手:打开看看不算打断;在里面说话就算你接手;点「停下」「不用调研」或关掉标签,这件事以后不会再被自动调研。
|
|
81
|
+
- **Skills / MCP**: on first launch the secretary gets the Skills, plugins and MCP servers you already have in Claude Code (or Codex). Remove what you don't need; to add one, ask the secretary. It changes these only when you ask.
|
|
82
|
+
- **Persona**: how the secretary talks and what you prefer, like CLAUDE.md / AGENTS.md. It can't override the secretary's core rules.
|
|
92
83
|
|
|
93
|
-
|
|
84
|
+
</details>
|
|
94
85
|
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
<details>
|
|
87
|
+
<summary>Tasks with a project folder</summary>
|
|
97
88
|
|
|
98
|
-
|
|
89
|
+
Tell the secretary "this happens in `~/code/xxx`" and the task remembers the folder. Sessions for it start right there, just as if you ran `claude` in that folder yourself: the project's CLAUDE.md, Skills, MCP servers and your own permission settings. The secretary never starts work in your project on its own; you click "Work on it" or tell it to.
|
|
99
90
|
|
|
100
|
-
|
|
91
|
+
</details>
|
|
101
92
|
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
<details>
|
|
94
|
+
<summary>Closing the window and quitting</summary>
|
|
104
95
|
|
|
105
|
-
|
|
96
|
+
- **Close the work window (⌘W)**: the menu bar, the pet and the secretary keep working.
|
|
97
|
+
- **Quit Attention (⌘Q)**: stops the secretary and its sessions, then quits. Items and history stay. It starts again the next time you open Attention, not at login.
|
|
106
98
|
|
|
107
|
-
|
|
99
|
+
</details>
|
|
108
100
|
|
|
109
|
-
|
|
101
|
+
<details>
|
|
102
|
+
<summary>Data and cost</summary>
|
|
110
103
|
|
|
111
|
-
|
|
104
|
+
- Items, results and settings are stored in `~/.attention`.
|
|
105
|
+
- Conversations, and what the work reads, go through your Claude Code / Codex to the model service you chose (or your gateway). Attention doesn't handle or forward them.
|
|
106
|
+
- The update check sends none of your data. There are no usage statistics.
|
|
107
|
+
- The secretary checks in every 30 minutes by default; saver mode checks less often during the day and stays quiet at night. Model calls use your own account's quota.
|
|
112
108
|
|
|
113
|
-
|
|
114
|
-
- 对话和工作中读到的内容,会经由你的 Claude Code / Codex 发给你自己选的模型服务(或你配置的网关);Attention 不经手、不转发。
|
|
115
|
-
- Attention 自己唯一的对外请求,是每天问一次 GitHub 上最新的版本号,不带任何你的数据,可以在关于页关掉。没有使用统计。
|
|
116
|
-
- 秘书默认每 30 分钟巡检一次;节约模式下白天间隔更长、夜间不打扰。模型调用消耗的是你自己账号的额度。
|
|
109
|
+
</details>
|
|
117
110
|
|
|
118
|
-
##
|
|
111
|
+
## Build from source
|
|
119
112
|
|
|
120
|
-
|
|
113
|
+
You need Python 3.12, the Xcode command line tools and Node.js (for some tests).
|
|
121
114
|
|
|
122
115
|
```bash
|
|
123
116
|
python3.12 -m venv .venv && .venv/bin/python -m pip install -e '.[api,dev,build]'
|
|
@@ -131,13 +124,13 @@ python3.12 -m venv .venv && .venv/bin/python -m pip install -e '.[api,dev,build]
|
|
|
131
124
|
.venv/bin/python scripts/build_app.py --output dist/Attention.app
|
|
132
125
|
```
|
|
133
126
|
|
|
134
|
-
|
|
127
|
+
See [docs/architecture.md](https://github.com/markd88/attention-secretary/blob/main/docs/architecture.md) and [RELEASING.md](https://github.com/markd88/attention-secretary/blob/main/RELEASING.md).
|
|
135
128
|
|
|
136
|
-
##
|
|
129
|
+
## Feedback
|
|
137
130
|
|
|
138
|
-
-
|
|
139
|
-
-
|
|
131
|
+
- Problems and ideas: [GitHub Issues](https://github.com/markd88/attention-secretary/issues). Remove private conversations, item titles, paths and credentials before posting.
|
|
132
|
+
- Security problems: report privately as described in [SECURITY.md](https://github.com/markd88/attention-secretary/blob/main/SECURITY.md).
|
|
140
133
|
|
|
141
|
-
##
|
|
134
|
+
## License
|
|
142
135
|
|
|
143
|
-
[MIT](LICENSE)
|
|
136
|
+
[MIT](https://github.com/markd88/attention-secretary/blob/main/LICENSE). Third-party components and the pet artwork's sources are listed in [THIRD_PARTY_NOTICES.md](https://github.com/markd88/attention-secretary/blob/main/THIRD_PARTY_NOTICES.md).
|
package/bin/attention.js
CHANGED
|
@@ -14,7 +14,7 @@ const https = require("https");
|
|
|
14
14
|
const http = require("http");
|
|
15
15
|
const os = require("os");
|
|
16
16
|
const path = require("path");
|
|
17
|
-
const { spawnSync } = require("child_process");
|
|
17
|
+
const { spawn, spawnSync } = require("child_process");
|
|
18
18
|
|
|
19
19
|
const pkg = require("../package.json");
|
|
20
20
|
const RELEASE_TRUST=require("../release-trust.json");
|
|
@@ -45,6 +45,9 @@ const EN = {
|
|
|
45
45
|
"下载 {name} …": "Downloading {name} …",
|
|
46
46
|
"下载的文件和发布时的校验值对不上,可能被篡改或下载不完整,不安装。": "The download doesn't match the release's checksum; it may be tampered with or incomplete. Not installing.",
|
|
47
47
|
"校验通过。": "Checksum OK.",
|
|
48
|
+
"正在解压并检查安装包 …": "Unpacking and checking the package …",
|
|
49
|
+
"正在安装到 {path} …": "Installing to {path} …",
|
|
50
|
+
"正在启动 Attention …": "Starting Attention …",
|
|
48
51
|
"解压失败:{error}": "Couldn't unpack: {error}",
|
|
49
52
|
"安装包里没有 Attention.app。": "The package has no Attention.app.",
|
|
50
53
|
"安装包的签名检查没有通过,不安装。": "The package's signature check failed; not installing.",
|
|
@@ -84,7 +87,23 @@ function T(text, values = {}) {
|
|
|
84
87
|
for (const [name, value] of Object.entries(values)) out = out.split("{" + name + "}").join(String(value));
|
|
85
88
|
return out;
|
|
86
89
|
}
|
|
87
|
-
function say(text) { process.stdout.write(text + "\n"); }
|
|
90
|
+
function say(text) { process.stdout.write((spinning ? "\r\x1b[K" : "") + text + "\n"); }
|
|
91
|
+
// A spinner for the slow steps, so the terminal doesn't look stuck. It runs in its own tiny process because most of
|
|
92
|
+
// these steps block this one (spawnSync, hashing). Without a terminal (CI, the app's updater) it just prints the line.
|
|
93
|
+
const SPINNER = `const label=process.argv[1],frames="⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏",start=Date.now();let i=0;
|
|
94
|
+
setInterval(()=>{const s=Math.floor((Date.now()-start)/1000);process.stdout.write("\\r\\x1b[K"+frames[i++%frames.length]+" "+label+(s>=5?" ("+s+"s)":""));},80);`;
|
|
95
|
+
let spinning = null;
|
|
96
|
+
function spin(label) {
|
|
97
|
+
stopSpin();
|
|
98
|
+
if (!process.stdout.isTTY) { say(label); return; }
|
|
99
|
+
spinning = spawn(process.execPath, ["-e", SPINNER, label], { stdio: ["ignore", "inherit", "ignore"] });
|
|
100
|
+
}
|
|
101
|
+
function stopSpin() {
|
|
102
|
+
if (!spinning) return;
|
|
103
|
+
spinning.kill("SIGKILL"); spinning = null;
|
|
104
|
+
process.stdout.write("\r\x1b[K");
|
|
105
|
+
}
|
|
106
|
+
process.on("exit", () => { if (spinning) spinning.kill("SIGKILL"); });
|
|
88
107
|
function fail(text) { throw new Error(text); }
|
|
89
108
|
function run(cmd, args, options = {}) {
|
|
90
109
|
const result = spawnSync(cmd, args, { encoding: "utf8", ...options });
|
|
@@ -220,13 +239,15 @@ async function download(info) {
|
|
|
220
239
|
const expected=sumText.toString("utf8").split("\n").map(line=>line.trim().split(/\s+/)).find(parts=>parts[1] && parts[1].replace(/^\*/,"")===asset.name);
|
|
221
240
|
if(!expected || !/^[a-fA-F0-9]{64}$/.test(expected[0]) || expected[0].toLowerCase()!==actual || actual!==signed.sha256 || fs.statSync(file).size!==signed.bytes)failTagged("verify", "checksum_failed", T("下载的文件和发布时的校验值对不上,可能被篡改或下载不完整,不安装。"));
|
|
222
241
|
say(T("校验通过。"));
|
|
242
|
+
spin(T("正在解压并检查安装包 …"));
|
|
223
243
|
const unzip=run("/usr/bin/ditto",["-x","-k",file,dir],{timeout:120000});
|
|
224
244
|
if(!unzip.ok)failTagged("unpack", "install_failed", T("解压失败:{error}",{error:unzip.err}));
|
|
225
245
|
const app=path.join(dir,APP_NAME);
|
|
226
246
|
if(!fs.existsSync(app) || fs.lstatSync(app).isSymbolicLink())failTagged("unpack", "install_failed", T("安装包里没有 Attention.app。"));
|
|
227
247
|
if(!run("/usr/bin/codesign",["--verify","--deep","--strict",app],{timeout:30000}).ok)failTagged("verify", "signature_failed", T("安装包的签名检查没有通过,不安装。"));
|
|
248
|
+
stopSpin();
|
|
228
249
|
return app;
|
|
229
|
-
} catch(error) {fs.rmSync(dir,{recursive:true,force:true});throw error;}
|
|
250
|
+
} catch(error) {stopSpin();fs.rmSync(dir,{recursive:true,force:true});throw error;}
|
|
230
251
|
}
|
|
231
252
|
|
|
232
253
|
// ---- the running app -----------------------------------------------------------------------------------------
|
|
@@ -526,9 +547,12 @@ function moveToBackup(app) {
|
|
|
526
547
|
if(!run("/bin/mv", [app, path.join(BACKUPS, name)],{timeout:30000}).ok)throw Error("Backup move failed; not continuing");
|
|
527
548
|
return name;
|
|
528
549
|
}
|
|
529
|
-
function doctor(app, model) {
|
|
550
|
+
function doctor(app, model, label) {
|
|
530
551
|
const args = ["check"]; if (model) args.push("--model");
|
|
531
|
-
|
|
552
|
+
if (label) spin(label);
|
|
553
|
+
const result = spawnSync(backend(app), args, { encoding: "utf8", stdio: ["inherit", "pipe", "pipe"] });
|
|
554
|
+
stopSpin();
|
|
555
|
+
process.stdout.write(result.stdout || ""); process.stderr.write(result.stderr || "");
|
|
532
556
|
return result.status === 0;
|
|
533
557
|
}
|
|
534
558
|
|
|
@@ -580,17 +604,20 @@ async function install(version, mustBeNewer,fromApp=false) {
|
|
|
580
604
|
const target = path.join(current ? path.dirname(current) : targetDir(), APP_NAME);
|
|
581
605
|
fs.mkdirSync(BACKUPS,{recursive:true,mode:0o700});
|
|
582
606
|
const backup=path.join(BACKUPS,`Attention-${current?appVersion(current):"new"}-${Date.now()}.app`);
|
|
607
|
+
const ops=bundleOperations(current),record=ops.journal;
|
|
608
|
+
// The spinner follows the transaction: installing, then starting the new copy.
|
|
609
|
+
ops.journal=state=>{record(state);if(state.phase==="starting")spin(T("正在启动 Attention …"));};
|
|
610
|
+
spin(T("正在安装到 {path} …",{path:path.dirname(target)}));
|
|
583
611
|
try {
|
|
584
|
-
await replaceBundle(fresh,target,backup,
|
|
585
|
-
}finally{fs.rmSync(path.dirname(fresh),{recursive:true,force:true});}
|
|
612
|
+
await replaceBundle(fresh,target,backup,ops);
|
|
613
|
+
}finally{stopSpin();fs.rmSync(path.dirname(fresh),{recursive:true,force:true});}
|
|
586
614
|
say(T("✓ Attention {version} 已安装在 {path}", { version: latest, path: target }));
|
|
587
615
|
if(fromApp)return; // app update never triggers an extra paid model probe
|
|
588
616
|
if (!tools.claude) {
|
|
589
617
|
say(T("\n第一次打开时,在工作窗口里选 Codex,窗口会检查它能不能运行秘书。"));
|
|
590
618
|
return;
|
|
591
619
|
}
|
|
592
|
-
|
|
593
|
-
if (doctor(target, true)) {
|
|
620
|
+
if (doctor(target, true, T("正在检查你的 Claude Code 能不能运行秘书 …"))) {
|
|
594
621
|
say(T("\n第一次启动时,在工作窗口的「秘书」页面里会看到 Claude 问是否信任这个文件夹,选 “Yes, I trust this folder” 回车即可。"));
|
|
595
622
|
} else {
|
|
596
623
|
say(T("\n按上面的提示处理好以后,在工作窗口里点「重新检查」,或运行 attention doctor。"));
|
|
@@ -654,7 +681,7 @@ async function main() {
|
|
|
654
681
|
case "recover": return withInstallLock(()=>recover());
|
|
655
682
|
case "rollback": return withInstallLock(()=>rollback());
|
|
656
683
|
case "uninstall": return withInstallLock(()=>uninstall());
|
|
657
|
-
case "doctor": { const app = installedApp(); if (!app) fail(T("还没有安装 Attention,先运行 attention install。")); process.exit(doctor(app, true) ? 0 : 2); }
|
|
684
|
+
case "doctor": { const app = installedApp(); if (!app) fail(T("还没有安装 Attention,先运行 attention install。")); process.exit(doctor(app, true, T("正在检查你的 Claude Code 能不能运行秘书 …")) ? 0 : 2); }
|
|
658
685
|
case "open": { const app = installedApp(); if (!app) fail(T("还没有安装 Attention。")); run("/usr/bin/open", [app]); return; }
|
|
659
686
|
case "--version": case "-v": say(pkg.version); return;
|
|
660
687
|
default:
|
|
@@ -670,4 +697,4 @@ async function main() {
|
|
|
670
697
|
}
|
|
671
698
|
}
|
|
672
699
|
if (require.main === module) main().catch(error => {process.stderr.write("✗ "+error.message+"\n");process.exitCode=1;});
|
|
673
|
-
else module.exports = { installedApp, installedCopies, download, newer, plistXml, get, checkedUrl, readEndpoint, localGet, replaceBundle, start, rollbackBundle, ensureTransactionSettled, withInstallLock, recoverBundle, bundleFingerprint, writeBackupReceipt, readBackupReceipt, trustedBackups };
|
|
700
|
+
else module.exports = { installedApp, installedCopies, download, newer, plistXml, get, checkedUrl, readEndpoint, localGet, replaceBundle, start, rollbackBundle, ensureTransactionSettled, withInstallLock, recoverBundle, bundleFingerprint, writeBackupReceipt, readBackupReceipt, trustedBackups, spin, stopSpin, say };
|
package/package.json
CHANGED