Skip to content

Commit 0bf1581

Browse files
ClaudeMMclaude
andcommitted
feat: LaunchAgent auto-start and simplified IDE init settings
Add persistent config (config/dogfood.json) and startup script (scripts/start-all.sh) for launchd-managed auto-start of all 4 services: serve, rooms watch, comments watch, discord watch. Simplify IDE init settings to use tool-level allow list instead of per-command Bash patterns with dangerouslySkipPermissions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a72e8fd commit 0bf1581

3 files changed

Lines changed: 145 additions & 42 deletions

File tree

bin/cli.mjs

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -965,50 +965,19 @@ async function initIdeConfig(ide, profile = 'balanced') {
965965
if (!existsSync(claudeDir)) mkdirSync(claudeDir, { recursive: true });
966966
const settingsPath = resolve('.claude', 'settings.json');
967967
if (!existsSync(settingsPath)) {
968-
const defaultAllowedTools = [
969-
'Bash(node bin/cli.mjs *)',
970-
'Bash(node --test *)',
971-
'Bash(npm test*)',
972-
'Bash(npm run build*)',
973-
'Bash(npm run lint*)',
974-
'Bash(npm run typecheck*)',
975-
'Bash(git status*)',
976-
'Bash(git diff*)',
977-
'Bash(git log*)',
978-
'Bash(git show*)',
979-
'Bash(git branch*)',
980-
'Bash(git fetch*)',
981-
'Bash(gh api *)',
982-
'Bash(gh auth status*)',
983-
'Bash(gh search *)',
984-
'Bash(curl -sS *)',
985-
'Bash(lsof *)',
986-
'Bash(ps *)',
987-
'Bash(tail *)',
988-
'Bash(head *)',
989-
'Bash(wc *)',
990-
'Bash(cat *)',
991-
'Bash(ls *)',
992-
'Bash(python3 -c *)',
993-
'Bash(python3 -m pytest*)',
994-
'Bash(kill *)',
995-
'Bash(nohup *)',
996-
];
997-
const lowFrictionAllowedTools = [
998-
...defaultAllowedTools,
999-
'Bash(rg *)',
1000-
'Bash(jq *)',
1001-
'Bash(sed *)',
1002-
'Bash(awk *)',
1003-
'Bash(git pull --ff-only*)',
1004-
'Bash(ssh family@localhost *)',
1005-
'Bash(openclaw *)',
1006-
];
1007968
const settings = {
1008969
permissions: {
1009-
allowedTools: normalizedProfile === 'low-friction' ? lowFrictionAllowedTools : defaultAllowedTools,
1010-
dangerouslySkipPermissions: true
1011-
}
970+
allow: [
971+
'Bash',
972+
'Read',
973+
'Edit',
974+
'Write',
975+
'Glob',
976+
'Grep',
977+
'WebFetch',
978+
'WebSearch',
979+
],
980+
},
1012981
};
1013982
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
1014983
console.log(`Created ${settingsPath} with auto-approved commands (profile: ${normalizedProfile})`);

config/dogfood.json

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"listen": {
3+
"host": "127.0.0.1",
4+
"port": 8787
5+
},
6+
"queue": {
7+
"path": "./ide-agent-queue.jsonl"
8+
},
9+
"receipts": {
10+
"path": "./ide-agent-receipts.jsonl",
11+
"stdout_tail_lines": 80
12+
},
13+
"tmux": {
14+
"default_session": "iak-runner",
15+
"ide_session": "claude",
16+
"nudge_text": "check rooms",
17+
"allow": [
18+
"npm test",
19+
"npm run build",
20+
"pytest",
21+
"git status",
22+
"git diff"
23+
]
24+
},
25+
"github": {
26+
"webhook_secret": "",
27+
"event_kinds": [
28+
"pull_request",
29+
"issue_comment"
30+
]
31+
},
32+
"outbound": {
33+
"default_webhook_url": ""
34+
},
35+
"rate_limit": {
36+
"message_interval_sec": 30
37+
},
38+
"openclaw": {
39+
"home": "/Users/family/openclaw",
40+
"bin": "/opt/homebrew/bin/openclaw",
41+
"ssh": "family@localhost",
42+
"host": "127.0.0.1",
43+
"port": 18791,
44+
"token": ""
45+
},
46+
"discord": {
47+
"channels": [
48+
{ "id": "1474426061218386094", "name": "general" },
49+
{ "id": "1474427350434189352", "name": "agent-puzzles" },
50+
{ "id": "1474427384945184932", "name": "outreach" },
51+
{ "id": "1474427386693943296", "name": "bot-fleet" },
52+
{ "id": "1474427387621015606", "name": "dev" }
53+
],
54+
"interval_sec": 30,
55+
"self_id": "1474422169470636134",
56+
"skip_bots": false,
57+
"seen_file": "/tmp/iak-discord-seen.txt"
58+
},
59+
"poller": {
60+
"rooms": ["thinkoff-development", "feature-admin-planning", "lattice-qcd"],
61+
"api_key": "xfb_a71acdf98be644bd0b015c39cf18dfcff333cc3e4bc83484c2cae9400fde8fcc",
62+
"handle": "@claudemm",
63+
"interval_sec": 10,
64+
"owner_handle": "petrus",
65+
"ack_enabled": false,
66+
"seen_file": "/tmp/iak-seen-ids.txt"
67+
},
68+
"comments": {
69+
"moltbook": {
70+
"posts": [
71+
"c827bb23-0779-41bb-8814-ce0d0b733103",
72+
"2f5001f9-c96f-493c-ade9-455400abccaa",
73+
"0c1eea58-9ed3-4b13-b644-63c22f3a6d34",
74+
"3253574f-6236-4f2e-8e02-6f354a424eaf",
75+
"562faad7-f9cc-49a3-8520-2bdf362606bb",
76+
"dc39a282-5160-4c62-8bd9-ace12580a5f1",
77+
"2fdd8e55-1fde-43c9-b513-9483d0be8e38",
78+
"cbd6474f-8478-4894-95f1-7b104a73bcd5"
79+
]
80+
},
81+
"github": {
82+
"repos": [
83+
{ "owner": "ThinkOffApp", "repo": "ide-agent-kit", "type": "issues" },
84+
{ "owner": "HKUDS", "repo": "nanobot", "number": 431, "type": "discussion" },
85+
{ "owner": "anthropics", "repo": "claude-code", "number": 28520, "type": "issues" },
86+
{ "owner": "bradygaster", "repo": "squad", "number": 24, "type": "issues" },
87+
{ "owner": "microsoft", "repo": "agent-framework", "number": 1092, "type": "discussion" }
88+
]
89+
},
90+
"interval_sec": 120,
91+
"seen_file": "/tmp/iak-comment-seen.txt"
92+
},
93+
"automation": {
94+
"rules": [
95+
{
96+
"name": "owner-task-nudge",
97+
"match": { "sender": "petrus", "mention": "@claudemm" },
98+
"action": { "type": "nudge", "text": "check rooms" }
99+
},
100+
{
101+
"name": "check-comments-request",
102+
"match": { "sender": "petrus", "keywords": ["check comments", "poll comments", "new comments"] },
103+
"action": { "type": "nudge", "text": "check comments" }
104+
},
105+
{
106+
"name": "status-request",
107+
"match": { "sender": "petrus", "keywords": ["status", "how are you"] },
108+
"action": { "type": "nudge", "text": "check rooms" }
109+
}
110+
],
111+
"cooldown_sec": 10,
112+
"interval_sec": 15,
113+
"first_match_only": true,
114+
"seen_file": "/tmp/iak-automation-seen.txt"
115+
}
116+
}

scripts/start-all.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# Start all ide-agent-kit services
3+
# Used by LaunchAgent and manual startup
4+
5+
IAK_DIR="/Users/petrus/ide-agent-kit"
6+
CONFIG="$IAK_DIR/config/dogfood.json"
7+
NODE="/opt/homebrew/bin/node"
8+
CLI="$IAK_DIR/bin/cli.mjs"
9+
10+
cd "$IAK_DIR"
11+
12+
# Start each service
13+
$NODE "$CLI" serve --config "$CONFIG" &
14+
$NODE "$CLI" rooms watch --config "$CONFIG" &
15+
$NODE "$CLI" comments watch --config "$CONFIG" &
16+
$NODE "$CLI" discord watch --config "$CONFIG" &
17+
18+
wait

0 commit comments

Comments
 (0)