officepals 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +122 -2
- package/bin/officepals.mjs +196 -0
- package/package.json +39 -4
- package/src/hook.mjs +370 -0
- package/src/install.mjs +197 -0
- package/src/paths.mjs +20 -0
- package/src/server.mjs +289 -0
- package/src/sessions.mjs +73 -0
- package/src/state.mjs +295 -0
- package/src/stats.mjs +72 -0
- package/src/title.mjs +100 -0
- package/web/index.html +2946 -0
- package/web/tool-kinds.js +43 -0
- package/web/vendor/three/CSS2DRenderer.js +238 -0
- package/web/vendor/three/LICENSE +21 -0
- package/web/vendor/three/OrbitControls.js +1523 -0
- package/web/vendor/three/README.md +5 -0
- package/web/vendor/three/RoundedBoxGeometry.js +155 -0
- package/web/vendor/three/three.module.min.js +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 guluguludog0-commits
|
|
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.md
CHANGED
|
@@ -1,3 +1,123 @@
|
|
|
1
|
-
#
|
|
1
|
+
# officepals
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**A cozy 3D office for your AI coding agents — they'll go on strike if you keep them waiting.**
|
|
4
|
+
|
|
5
|
+
[English](#english) · [中文](#中文)
|
|
6
|
+
|
|
7
|
+
> Formerly **cozy-agents**. Already had it? Just run `npx officepals`: it moves your hooks and stats over. 原名 cozy-agents;之前装过的话,直接运行 `npx officepals`,会自动把 hooks 和统计搬过来。
|
|
8
|
+
|
|
9
|
+
> 🚧 **Early preview** — it works, and it's still growing. Star the repo to follow along.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## English
|
|
14
|
+
|
|
15
|
+
Every Claude Code session becomes a little coworker in a tiny 3D office. They walk to the bookshelf when they read files, type at their desks when they edit code, run to the server rack when they run commands, and send little helpers off when they spawn sub-agents. Each one is named after its conversation's title (the one Claude Code shows in its session list), and the label over its head shows the to-do step it's on and what it's doing right now. The whiteboard on the wall carries everyone's to-do lists as sticky notes (to do, doing, done), one colour each; a new plan gets written up there first.
|
|
16
|
+
|
|
17
|
+
And when an agent needs **you** — a permission prompt, a question, a plan to approve — it walks over to your desk and waits. Leave it hanging and it gets impatient:
|
|
18
|
+
|
|
19
|
+
| Waiting | What you see |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| just asked | raises a hand, a patience bar appears |
|
|
22
|
+
| 20 s | waves harder, taps a foot, starts to sweat |
|
|
23
|
+
| 1 min | red in the face, jumping up and down, steaming |
|
|
24
|
+
| 3 min | lies down on the floor next to a **"strike!"** sign |
|
|
25
|
+
|
|
26
|
+
Approve it and it jumps up, cheers, and gets back to work.
|
|
27
|
+
|
|
28
|
+
### Made to sit in the corner of your screen
|
|
29
|
+
|
|
30
|
+
You won't watch it all day — it's there for a glance:
|
|
31
|
+
|
|
32
|
+
- **🔔 Alerts.** Turn them on and an agent that starts waiting on you plays a chime; if the page is out of sight you also get a system notification, and another one if it goes on strike. The tab title shows how many are waiting. When a job that took a minute or more is done, the agent cheers and you get a "done" chime and notification, so you can switch to something else meanwhile.
|
|
33
|
+
- **⧉ Pop out.** Shrink the office into an always-on-top mini window (Chrome / Edge 116+) and keep it next to your editor. Other browsers get a small window you can park in a corner.
|
|
34
|
+
|
|
35
|
+
### Run it
|
|
36
|
+
|
|
37
|
+
Requires Node.js 18+ and [Claude Code](https://docs.anthropic.com/en/docs/claude-code).
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx officepals
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The first run asks to add officepals' hooks to `~/.claude/settings.json` (your existing settings are kept and backed up), then opens the office at `http://127.0.0.1:4747`. Start a Claude Code session in any terminal and your new coworker walks in.
|
|
44
|
+
|
|
45
|
+
**Codex works too.** If Codex is installed (CLI or app), the same step adds the hooks to `~/.codex/hooks.json`. Codex asks you to trust new hooks once: run `/hooks` in the Codex CLI, or open Settings → Hooks in the Codex app. Codex coworkers carry a small "Codex" tag.
|
|
46
|
+
|
|
47
|
+
- `npx officepals --demo` — scripted demo agents, no Claude Code needed
|
|
48
|
+
- `npx officepals uninstall` — remove the hooks again
|
|
49
|
+
- `npx officepals --help` — all options
|
|
50
|
+
|
|
51
|
+
The office speaks English and Chinese: it follows your browser's language, and the button next to the status badge switches it (or add `?lang=en` / `?lang=zh` to the URL).
|
|
52
|
+
|
|
53
|
+
Everything it needs ships in the package (three.js included), so it works offline.
|
|
54
|
+
|
|
55
|
+
<details><summary>Run from source</summary>
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
git clone https://github.com/guluguludog0-commits/officepals.git
|
|
59
|
+
cd officepals
|
|
60
|
+
node bin/officepals.mjs
|
|
61
|
+
```
|
|
62
|
+
</details>
|
|
63
|
+
|
|
64
|
+
### Privacy
|
|
65
|
+
|
|
66
|
+
Everything stays on your machine. The hook relay forwards only session ids, tool names, a short label (a file's name, a host name, the description Claude gives a command), the kind of a shell command (test, build, install, git or look, never the command itself), for a permission request how risky it looks (judged inside the relay, e.g. "deletes files"), the question or plan title it asks you about, the session's to-do list (each step's title, clipped, and its status) and the path of the session's log to a server that listens on `127.0.0.1` only. The server reads just the conversation's title from that log, locally. It also checks Claude Code's list of running sessions (`~/.claude/sessions`: session ids, folders, names, busy or idle) so that sessions already open show up at once and closed ones leave within seconds. Daily totals (how often and how long agents waited on you, how many turns they finished) are kept in `~/.officepals/stats.json`, numbers only. Prompts, code, command lines and tool output never leave Claude Code. The hooks run in the background, so they never slow it down.
|
|
67
|
+
|
|
68
|
+
### Roadmap
|
|
69
|
+
|
|
70
|
+
- [x] 3D office prototype: walking, working, moods, strike, approvals
|
|
71
|
+
- [x] Live data from Claude Code hooks (sessions, tools, sub-agents, permission waits)
|
|
72
|
+
- [x] One-command start: `npx officepals`
|
|
73
|
+
- [x] Six desks in two pods, plus the sofa and the whiteboard; the rest queue for a seat
|
|
74
|
+
- [x] What each one is working on: its title, to-do list on the whiteboard, stations by kind of work
|
|
75
|
+
- [x] Alerts, a pop-out window, a done chime for long jobs, risk hints on approvals
|
|
76
|
+
- [x] Today's totals, kept across restarts
|
|
77
|
+
- [ ] Daily stats page: how long did your agents wait on you this week?
|
|
78
|
+
- [x] A door to come and go by; day and night on the office clock (or yours)
|
|
79
|
+
- [x] Codex (CLI and app)
|
|
80
|
+
- [ ] More agents: Gemini CLI, …
|
|
81
|
+
|
|
82
|
+
### Credits
|
|
83
|
+
|
|
84
|
+
- Inspired by [Pixel Agents](https://github.com/pixel-agents-hq/pixel-agents), which first turned coding agents into office characters.
|
|
85
|
+
- Built with [three.js](https://threejs.org/).
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 中文
|
|
90
|
+
|
|
91
|
+
**给你的 AI 编程助手一间舒适的 3D 小办公室。让它们等太久,它们会罢工。**
|
|
92
|
+
|
|
93
|
+
每个 Claude Code 会话都是办公室里的一位小同事:读文件时走到书架前,改代码时坐在工位上打字,执行命令时跑去服务器机柜,派出子 Agent 时会变出一个小助手帮忙。
|
|
94
|
+
|
|
95
|
+
当 Agent 需要**你**(批准权限、回答问题、审批计划)时,它会走到你的工位旁边等着。晾着它不管,它会越来越着急:
|
|
96
|
+
|
|
97
|
+
| 等了多久 | 你会看到 |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| 刚开始 | 举手示意,头顶出现耐心条 |
|
|
100
|
+
| 20 秒 | 挥手、跺脚、开始冒汗 |
|
|
101
|
+
| 1 分钟 | 脸涨得通红,原地蹦跳,头顶冒蒸汽 |
|
|
102
|
+
| 3 分钟 | 躺倒在地,旁边插着「罢工!」牌子 |
|
|
103
|
+
|
|
104
|
+
点一下「批准」,它会跳起来欢呼,然后回去继续干活。
|
|
105
|
+
|
|
106
|
+
每个小人用会话标题当名字(就是 Claude Code 会话列表里显示的那个),头顶标签显示它正在做哪一步待办、手上在干什么。左墙的白板上贴着每个人的待办清单(待办 / 进行中 / 已完成),一人一种颜色;接到新计划时,小人会先走到白板前把计划写上去。
|
|
107
|
+
|
|
108
|
+
它不需要你一直盯着看,而是放在屏幕角落用余光扫一眼:
|
|
109
|
+
|
|
110
|
+
- **🔔 提醒**:开启后,有 Agent 开始等你时会响提示音;页面不在眼前时还会弹系统通知,等到罢工时再提醒一次。浏览器标签标题也会显示有几位在等你。干了一分钟以上的活完成时,小人会欢呼,同时响「完成」提示音并弹通知,等它的时候你可以放心去做别的事。
|
|
111
|
+
- **⧉ 悬浮小窗**:一键把办公室缩成置顶小窗(Chrome / Edge 116+),放在编辑器旁边。其他浏览器会打开一个可以拖到屏幕角落的小窗口。
|
|
112
|
+
|
|
113
|
+
界面支持中文和英文:默认跟随浏览器语言,也可以点左上角状态旁的按钮切换(或在网址后加 `?lang=zh` / `?lang=en`)。
|
|
114
|
+
|
|
115
|
+
**一条命令启动:** `npx officepals`(需要 Node.js 18+ 和 Claude Code)。第一次运行会询问是否安装 hooks,你原有的配置会保留并备份;不想用了运行 `npx officepals uninstall` 即可完整卸载。
|
|
116
|
+
|
|
117
|
+
**也支持 Codex:** 电脑上装了 Codex(命令行或桌面应用)时,会同时把 hooks 加到 `~/.codex/hooks.json`。Codex 要求新 hooks 先经你信任一次:在 Codex 命令行里输入 `/hooks`,或在 Codex 应用的"设置 → Hooks"里确认。Codex 的同事头顶会带一个小小的"Codex"标记。
|
|
118
|
+
|
|
119
|
+
所有数据只在你的电脑上,不记录提示词、代码和命令内容(终端命令只转发类型,比如"测试""git";需要你批准时,风险由 hook 脚本在本地判断,只转发"会删除文件"这类结论;提问和审批计划会转发问题本身和计划标题)。待办清单会转发每一步的标题(截短)和状态,用来画白板。每天的统计(等了你几次、多久,完成几轮)只记数字,存在 `~/.officepals/stats.json`。会话标题由本地服务器直接从 Claude Code 的会话记录里读取,只读标题这一项。服务器还会查看 Claude Code 正在运行的会话列表(`~/.claude/sessions` 里的会话 id、文件夹、名字和忙闲状态),这样已经开着的会话一启动就能看到,关掉的会话几秒内就会离开。
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// npx officepals [install | uninstall | status] [--port N] [--no-open] [--demo]
|
|
3
|
+
import { execFile } from 'node:child_process';
|
|
4
|
+
import * as fs from 'node:fs';
|
|
5
|
+
import * as path from 'node:path';
|
|
6
|
+
import * as readline from 'node:readline/promises';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
import { areHooksInstalled, hasLegacyHooks, installHooks, SettingsError, uninstallHooks } from '../src/install.mjs';
|
|
10
|
+
import { claudeSettingsPath, codexHome, codexHooksPath, DEFAULT_PORT, legacyHomeDir, statsFile } from '../src/paths.mjs';
|
|
11
|
+
import { startServer } from '../src/server.mjs';
|
|
12
|
+
|
|
13
|
+
const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
|
|
14
|
+
const webDir = fileURLToPath(new URL('../web/', import.meta.url));
|
|
15
|
+
|
|
16
|
+
const HELP = `officepals ${pkg.version} — a cozy 3D office for your AI coding agents
|
|
17
|
+
|
|
18
|
+
Usage:
|
|
19
|
+
npx officepals start the office (asks to install hooks the first time)
|
|
20
|
+
npx officepals install add officepals' hooks to ~/.claude/settings.json
|
|
21
|
+
(and ~/.codex/hooks.json when Codex is installed)
|
|
22
|
+
npx officepals uninstall remove them again (nothing else is touched)
|
|
23
|
+
npx officepals status show whether the hooks are installed
|
|
24
|
+
|
|
25
|
+
Options:
|
|
26
|
+
--port <n> port to listen on (default ${DEFAULT_PORT})
|
|
27
|
+
--no-open don't open the browser
|
|
28
|
+
--demo open the office with scripted demo agents
|
|
29
|
+
--verbose print every hook event
|
|
30
|
+
--home <dir> keep officepals' files here instead of ~/.officepals
|
|
31
|
+
-h, --help show this help`;
|
|
32
|
+
|
|
33
|
+
function parse(argv) {
|
|
34
|
+
const args = { cmd: 'start', port: DEFAULT_PORT, open: true, demo: false, verbose: false };
|
|
35
|
+
for (let i = 0; i < argv.length; i++) {
|
|
36
|
+
const a = argv[i];
|
|
37
|
+
if (['install', 'uninstall', 'status', 'start'].includes(a)) args.cmd = a;
|
|
38
|
+
else if (a === '--port') args.port = Number(argv[++i]);
|
|
39
|
+
else if (a === '--no-open') args.open = false;
|
|
40
|
+
else if (a === '--demo') args.demo = true;
|
|
41
|
+
else if (a === '--verbose') args.verbose = true;
|
|
42
|
+
else if (a === '--home') process.env.OFFICEPALS_HOME = argv[++i];
|
|
43
|
+
else if (a === '-h' || a === '--help') args.cmd = 'help';
|
|
44
|
+
else if (a === '-v' || a === '--version') args.cmd = 'version';
|
|
45
|
+
else throw new Error(`Unknown argument: ${a}`);
|
|
46
|
+
}
|
|
47
|
+
if (!Number.isInteger(args.port) || args.port < 1 || args.port > 65535) throw new Error('--port must be 1-65535');
|
|
48
|
+
return args;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function openBrowser(url) {
|
|
52
|
+
const [cmd, args] =
|
|
53
|
+
process.platform === 'darwin' ? ['open', [url]] : process.platform === 'win32' ? ['cmd', ['/c', 'start', '', url]] : ['xdg-open', [url]];
|
|
54
|
+
execFile(cmd, args, () => {});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Codex is on this machine (its folder exists). */
|
|
58
|
+
const hasCodex = () => fs.existsSync(codexHome());
|
|
59
|
+
|
|
60
|
+
const DISCLOSURE = () => `
|
|
61
|
+
officepals needs Claude Code hooks to see what your agents are doing.
|
|
62
|
+
It will add entries to ${claudeSettingsPath()}${hasCodex() ? `
|
|
63
|
+
and, for Codex, to ${codexHooksPath()}` : ''}:
|
|
64
|
+
• your existing settings and hooks are kept; a one-time backup is saved
|
|
65
|
+
• events stay on this machine and carry only ids, tool names and short
|
|
66
|
+
labels (a file's name, a host) — never prompts, code or command lines
|
|
67
|
+
• the hooks run in the background and never slow Claude Code down
|
|
68
|
+
• undo any time with: npx officepals uninstall
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
async function confirm(question) {
|
|
72
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
73
|
+
const answer = (await rl.question(question)).trim().toLowerCase();
|
|
74
|
+
rl.close();
|
|
75
|
+
return answer === '' || answer === 'y' || answer === 'yes';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const CODEX_TRUST = ` Codex asks you to trust new hooks once: run /hooks in the Codex CLI, or open
|
|
79
|
+
Settings → Hooks in the Codex app, and trust the officepals entries.`;
|
|
80
|
+
|
|
81
|
+
function doInstall() {
|
|
82
|
+
const { added, backup } = installHooks();
|
|
83
|
+
console.log(added > 0 ? `✓ Claude Code hooks installed (backup: ${backup})` : '✓ Claude Code hooks were already installed');
|
|
84
|
+
if (hasCodex()) {
|
|
85
|
+
const codex = installHooks({ provider: 'codex' });
|
|
86
|
+
console.log(codex.added > 0 ? `✓ Codex hooks installed (backup: ${codex.backup})` : '✓ Codex hooks were already installed');
|
|
87
|
+
if (codex.added > 0) console.log(CODEX_TRUST);
|
|
88
|
+
}
|
|
89
|
+
console.log(' Sessions started from now on will appear in the office.');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Coming from cozy-agents (this project's earlier name): its hooks are
|
|
94
|
+
* swapped for ours (Claude Code, and Codex if it had them), and its daily
|
|
95
|
+
* stats are copied over. Its folder is left as it was.
|
|
96
|
+
*/
|
|
97
|
+
function migrateFromCozyAgents() {
|
|
98
|
+
let moved = false;
|
|
99
|
+
if (hasLegacyHooks() && !areHooksInstalled()) {
|
|
100
|
+
installHooks();
|
|
101
|
+
moved = true;
|
|
102
|
+
}
|
|
103
|
+
if (hasLegacyHooks(codexHooksPath(), 'codex') && !areHooksInstalled(codexHooksPath(), undefined, 'codex')) {
|
|
104
|
+
installHooks({ provider: 'codex' });
|
|
105
|
+
moved = true;
|
|
106
|
+
}
|
|
107
|
+
const oldStats = path.join(legacyHomeDir(), 'stats.json');
|
|
108
|
+
if (!fs.existsSync(statsFile()) && fs.existsSync(oldStats)) {
|
|
109
|
+
fs.mkdirSync(path.dirname(statsFile()), { recursive: true, mode: 0o700 });
|
|
110
|
+
fs.copyFileSync(oldStats, statsFile());
|
|
111
|
+
moved = true;
|
|
112
|
+
}
|
|
113
|
+
if (moved) console.log('✓ cozy-agents is now officepals: moved your hooks and stats over.');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function start(args) {
|
|
117
|
+
migrateFromCozyAgents();
|
|
118
|
+
if (areHooksInstalled()) {
|
|
119
|
+
// Keep an earlier install current: refresh the relay script and add any
|
|
120
|
+
// hook events newer versions listen to (nothing else is touched).
|
|
121
|
+
const { added } = installHooks();
|
|
122
|
+
if (added > 0) console.log(`✓ Updated the hooks (${added} new event${added > 1 ? 's' : ''}).`);
|
|
123
|
+
if (areHooksInstalled(codexHooksPath(), undefined, 'codex')) installHooks({ provider: 'codex' });
|
|
124
|
+
else if (hasCodex()) console.log('Codex found: run `npx officepals install` to bring Codex sessions into the office too.');
|
|
125
|
+
} else {
|
|
126
|
+
if (process.stdin.isTTY) {
|
|
127
|
+
console.log(DISCLOSURE());
|
|
128
|
+
if (await confirm('Install the hooks now? [Y/n] ')) doInstall();
|
|
129
|
+
else console.log('Skipped. The office will stay empty until you run: npx officepals install\n');
|
|
130
|
+
} else {
|
|
131
|
+
console.log('Hooks are not installed yet. Run: npx officepals install');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let srv;
|
|
136
|
+
try {
|
|
137
|
+
srv = await startServer({
|
|
138
|
+
port: args.port,
|
|
139
|
+
webDir,
|
|
140
|
+
log: args.verbose ? (m) => console.log(` · ${m}`) : () => {},
|
|
141
|
+
});
|
|
142
|
+
} catch (err) {
|
|
143
|
+
if (err.code === 'EADDRINUSE') {
|
|
144
|
+
console.error(`Port ${args.port} is busy — is officepals already running? Try --port ${args.port + 1}.`);
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
throw err;
|
|
148
|
+
}
|
|
149
|
+
const url = `http://127.0.0.1:${srv.port}/${args.demo ? '?demo' : ''}`;
|
|
150
|
+
console.log(`\n🏢 officepals is running at ${url}\n Press Ctrl+C to stop.\n`);
|
|
151
|
+
if (args.open) openBrowser(url);
|
|
152
|
+
|
|
153
|
+
const stop = async () => {
|
|
154
|
+
await srv.close();
|
|
155
|
+
process.exit(0);
|
|
156
|
+
};
|
|
157
|
+
process.on('SIGINT', stop);
|
|
158
|
+
process.on('SIGTERM', stop);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function main() {
|
|
162
|
+
let args;
|
|
163
|
+
try {
|
|
164
|
+
args = parse(process.argv.slice(2));
|
|
165
|
+
} catch (err) {
|
|
166
|
+
console.error(err.message + '\n\n' + HELP);
|
|
167
|
+
process.exit(1);
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
if (args.cmd === 'help') console.log(HELP);
|
|
171
|
+
else if (args.cmd === 'version') console.log(pkg.version);
|
|
172
|
+
else if (args.cmd === 'install') {
|
|
173
|
+
migrateFromCozyAgents();
|
|
174
|
+
doInstall();
|
|
175
|
+
}
|
|
176
|
+
else if (args.cmd === 'uninstall') {
|
|
177
|
+
const removed = uninstallHooks().removed + uninstallHooks({ provider: 'codex' }).removed;
|
|
178
|
+
console.log(removed > 0 ? `✓ Removed ${removed} officepals hook entries.` : 'Nothing to remove.');
|
|
179
|
+
} else if (args.cmd === 'status') {
|
|
180
|
+
console.log(areHooksInstalled() ? '✓ Claude Code hooks are installed.' : '✗ Claude Code hooks are not installed. Run: npx officepals install');
|
|
181
|
+
if (hasCodex()) {
|
|
182
|
+
console.log(areHooksInstalled(codexHooksPath(), undefined, 'codex')
|
|
183
|
+
? '✓ Codex hooks are installed (trust them in Codex: /hooks, or Settings → Hooks).'
|
|
184
|
+
: '✗ Codex hooks are not installed. Run: npx officepals install');
|
|
185
|
+
}
|
|
186
|
+
} else await start(args);
|
|
187
|
+
} catch (err) {
|
|
188
|
+
if (err instanceof SettingsError) {
|
|
189
|
+
console.error(`✗ ${err.message}`);
|
|
190
|
+
process.exit(1);
|
|
191
|
+
}
|
|
192
|
+
throw err;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "officepals",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "A cozy 3D office for your AI coding agents — they'll go on strike if you keep them waiting.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"officepals": "bin/officepals.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"src/",
|
|
12
|
+
"web/",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"start": "node bin/officepals.mjs",
|
|
18
|
+
"test": "node --test test/"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"claude-code",
|
|
25
|
+
"ai-agents",
|
|
26
|
+
"three.js",
|
|
27
|
+
"visualization",
|
|
28
|
+
"hooks",
|
|
29
|
+
"developer-tools"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/guluguludog0-commits/officepals.git"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/guluguludog0-commits/officepals#readme",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/guluguludog0-commits/officepals/issues"
|
|
39
|
+
},
|
|
40
|
+
"author": "guluguludog0-commits"
|
|
41
|
+
}
|