aicodeman 1.13.0 → 1.14.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/README.md +26 -2
- package/dist/ai-checker-base.d.ts +2 -0
- package/dist/ai-checker-base.d.ts.map +1 -1
- package/dist/ai-checker-base.js +31 -3
- package/dist/ai-checker-base.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +142 -14
- package/dist/cli.js.map +1 -1
- package/dist/config/service-names.d.ts +23 -0
- package/dist/config/service-names.d.ts.map +1 -0
- package/dist/config/service-names.js +29 -0
- package/dist/config/service-names.js.map +1 -0
- package/dist/daemon-control.d.ts +126 -0
- package/dist/daemon-control.d.ts.map +1 -0
- package/dist/daemon-control.js +433 -0
- package/dist/daemon-control.js.map +1 -0
- package/dist/hooks-config.d.ts +28 -8
- package/dist/hooks-config.d.ts.map +1 -1
- package/dist/hooks-config.js +205 -29
- package/dist/hooks-config.js.map +1 -1
- package/dist/service-installer.d.ts +96 -0
- package/dist/service-installer.d.ts.map +1 -0
- package/dist/service-installer.js +333 -0
- package/dist/service-installer.js.map +1 -0
- package/dist/web/public/admin-ui.js.gz +0 -0
- package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
- package/dist/web/public/app.b24f795e.js.gz +0 -0
- package/dist/web/public/constants.e7175b95.js.gz +0 -0
- package/dist/web/public/cron-ui.js.gz +0 -0
- package/dist/web/public/entrance-animations.js.gz +0 -0
- package/dist/web/public/i18n.da34cfaf.js.gz +0 -0
- package/dist/web/public/image-input.ee16ad88.js.gz +0 -0
- package/dist/web/public/index.html +1 -1
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.63794d0b.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.9936227d.js.gz +0 -0
- package/dist/web/public/mobile-handlers.32fdd57f.js.gz +0 -0
- package/dist/web/public/mobile-overview.js.gz +0 -0
- package/dist/web/public/mobile.32cacde5.css.gz +0 -0
- package/dist/web/public/notification-manager.5d229063.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/panels-ui.1d4203e0.js.gz +0 -0
- package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
- package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
- package/dist/web/public/respawn-ui.ff0dae4c.js.gz +0 -0
- package/dist/web/public/sanitize-html.bc7078d6.js.gz +0 -0
- package/dist/web/public/session-ui.1356a4f4.js.gz +0 -0
- package/dist/web/public/settings-ui.ea63d5db.js.gz +0 -0
- package/dist/web/public/styles.b10e5edd.css.gz +0 -0
- package/dist/web/public/subagent-windows.4cc8b005.js.gz +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/{terminal-ui.78c71f3a.js → terminal-ui.d5ae6dcf.js} +2 -2
- package/dist/web/public/terminal-ui.d5ae6dcf.js.br +0 -0
- package/dist/web/public/terminal-ui.d5ae6dcf.js.gz +0 -0
- package/dist/web/public/ultracode-panel.js.gz +0 -0
- package/dist/web/public/ultracode-windows.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.137ad9f0.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.085e9e73.js.gz +0 -0
- package/dist/web/public/webview-tabs.js.gz +0 -0
- package/dist/web/self-update.d.ts.map +1 -1
- package/dist/web/self-update.js +4 -4
- package/dist/web/self-update.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/terminal-ui.78c71f3a.js.br +0 -0
- package/dist/web/public/terminal-ui.78c71f3a.js.gz +0 -0
package/dist/hooks-config.d.ts
CHANGED
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
* Key exports:
|
|
11
11
|
* - `generateHooksConfig()` — returns hooks object for settings.local.json
|
|
12
12
|
* - `writeHooksConfig(casePath)` — writes hooks + env config to disk
|
|
13
|
+
* - `ensureCodemanHooks(casePath)` — safely installs/updates hooks for a managed case
|
|
13
14
|
* - `updateCaseEnvVars(casePath, envVars)` — merges env vars into settings
|
|
14
15
|
*
|
|
15
16
|
* Hook events generated: `idle_prompt`, `permission_prompt`, `elicitation_dialog`,
|
|
16
17
|
* `stop`, `teammate_idle`, `task_completed`
|
|
17
18
|
*
|
|
18
|
-
* Hook categories: `Notification` (3 matchers), `Stop` (1), `
|
|
19
|
-
* `TaskCompleted` (1), `PostToolUse` (1 self-contained
|
|
19
|
+
* Hook categories: `Notification` (3 matchers), `Stop` (1), `SubagentStop` (1),
|
|
20
|
+
* `TeammateIdle` (1), `TaskCompleted` (1), `PostToolUse` (1 self-contained
|
|
21
|
+
* background Bash rewake)
|
|
20
22
|
*
|
|
21
23
|
* @dependencies types (HookEventType), config/auth-config (HOOK_TIMEOUT_SECONDS)
|
|
22
24
|
* @consumedby web/server (session creation), session-cli-builder (env setup)
|
|
@@ -27,8 +29,10 @@
|
|
|
27
29
|
* Inline Node helper for Claude Code's `asyncRewake` hook.
|
|
28
30
|
*
|
|
29
31
|
* A background Bash tool returns immediately with a task ID, then Claude writes
|
|
30
|
-
* its completion as a queue-operation in the transcript.
|
|
31
|
-
*
|
|
32
|
+
* its completion as a queue-operation in the top-level transcript. Subagent hooks
|
|
33
|
+
* receive their own transcript path even though their completion is parent-owned,
|
|
34
|
+
* so the helper watches both paths. Watching durable records avoids injecting
|
|
35
|
+
* terminal input (which could submit a user's draft).
|
|
32
36
|
* The helper is embedded in settings via `node -e`, so it has no script path
|
|
33
37
|
* that can go stale after an install or plugin-cache cleanup.
|
|
34
38
|
*
|
|
@@ -38,6 +42,12 @@
|
|
|
38
42
|
* forever. The ppid check misses subreaper setups; the deadline is the backstop.
|
|
39
43
|
*/
|
|
40
44
|
export declare function generateBackgroundWakeScript(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Keep a Claude subagent alive while its Monitor or background Bash work is live.
|
|
47
|
+
* Claude otherwise can publish the worker's last progress sentence as an Agent
|
|
48
|
+
* result when one watcher ends, even if other tracked tasks are still running.
|
|
49
|
+
*/
|
|
50
|
+
export declare function generateSubagentStopGuardScript(): string;
|
|
41
51
|
/**
|
|
42
52
|
* Generates the hooks section for .claude/settings.local.json
|
|
43
53
|
*
|
|
@@ -72,6 +82,15 @@ export declare function updateCaseModel(casePath: string, model: string | null):
|
|
|
72
82
|
* Merges with existing file content, only touching the `hooks` key.
|
|
73
83
|
*/
|
|
74
84
|
export declare function writeHooksConfig(casePath: string): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Ensures an explicitly managed case has the current Codeman hooks.
|
|
87
|
+
*
|
|
88
|
+
* Unlike `refreshStaleCodemanHooks`, this may add Codeman handlers to a valid
|
|
89
|
+
* user-owned settings file. It is therefore reserved for case quick-starts,
|
|
90
|
+
* where the user has explicitly asked Codeman to manage that workspace. A
|
|
91
|
+
* malformed existing file is left untouched rather than replaced.
|
|
92
|
+
*/
|
|
93
|
+
export declare function ensureCodemanHooks(casePath: string): Promise<void>;
|
|
75
94
|
/**
|
|
76
95
|
* Self-heal a case's Codeman-owned hooks block.
|
|
77
96
|
*
|
|
@@ -79,10 +98,11 @@ export declare function writeHooksConfig(casePath: string): Promise<void>;
|
|
|
79
98
|
* X-Codeman-Hook-Secret header was added (COD-54, 2026-06-10) keep hook curls in their
|
|
80
99
|
* settings.local.json that POST to /api/hook-event WITHOUT the secret — which, once the
|
|
81
100
|
* gate requires it unconditionally (COD-91), silently 401 on a password-protected install.
|
|
82
|
-
* Older Codeman blocks also lack the background Bash async-rewake hook
|
|
83
|
-
* shape: hook curls without `-k`, which exit 60 on
|
|
84
|
-
* cert is self-signed), swallowed by the hooks'
|
|
85
|
-
* silently. Refresh any of these stale shapes
|
|
101
|
+
* Older Codeman blocks also lack the current background Bash async-rewake hook or the
|
|
102
|
+
* SubagentStop guard. A further stale shape: hook curls without `-k`, which exit 60 on
|
|
103
|
+
* every --https/tailscale install (the cert is self-signed), swallowed by the hooks'
|
|
104
|
+
* own `|| true` — all six hook events die silently. Refresh any of these stale shapes
|
|
105
|
+
* on launch so existing cases heal.
|
|
86
106
|
*
|
|
87
107
|
* Deliberately surgical: regenerates ONLY when settings.local.json already contains
|
|
88
108
|
* Codeman's own hook curls (they target `/api/hook-event`) and they are stale. No-op
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-config.d.ts","sourceRoot":"","sources":["../src/hooks-config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hooks-config.d.ts","sourceRoot":"","sources":["../src/hooks-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAmCH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CA4GrD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,CA0ExD;AAiBD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAiF1E;AA0ED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BvG;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BxG;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB3F;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBtE;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBxE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B9E;AAKD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAalD;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B7F"}
|
package/dist/hooks-config.js
CHANGED
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
* Key exports:
|
|
11
11
|
* - `generateHooksConfig()` — returns hooks object for settings.local.json
|
|
12
12
|
* - `writeHooksConfig(casePath)` — writes hooks + env config to disk
|
|
13
|
+
* - `ensureCodemanHooks(casePath)` — safely installs/updates hooks for a managed case
|
|
13
14
|
* - `updateCaseEnvVars(casePath, envVars)` — merges env vars into settings
|
|
14
15
|
*
|
|
15
16
|
* Hook events generated: `idle_prompt`, `permission_prompt`, `elicitation_dialog`,
|
|
16
17
|
* `stop`, `teammate_idle`, `task_completed`
|
|
17
18
|
*
|
|
18
|
-
* Hook categories: `Notification` (3 matchers), `Stop` (1), `
|
|
19
|
-
* `TaskCompleted` (1), `PostToolUse` (1 self-contained
|
|
19
|
+
* Hook categories: `Notification` (3 matchers), `Stop` (1), `SubagentStop` (1),
|
|
20
|
+
* `TeammateIdle` (1), `TaskCompleted` (1), `PostToolUse` (1 self-contained
|
|
21
|
+
* background Bash rewake)
|
|
20
22
|
*
|
|
21
23
|
* @dependencies types (HookEventType), config/auth-config (HOOK_TIMEOUT_SECONDS)
|
|
22
24
|
* @consumedby web/server (session creation), session-cli-builder (env setup)
|
|
@@ -48,14 +50,18 @@ const BACKGROUND_WAKE_MARKER_PREFIX = 'CODEMAN_BACKGROUND_REWAKE_V';
|
|
|
48
50
|
* changes: `refreshStaleCodemanHooks` treats the absence of the CURRENT marker as
|
|
49
51
|
* stale, so healed cases pick up the new script on next launch.
|
|
50
52
|
*/
|
|
51
|
-
const BACKGROUND_WAKE_MARKER = `${BACKGROUND_WAKE_MARKER_PREFIX}
|
|
53
|
+
const BACKGROUND_WAKE_MARKER = `${BACKGROUND_WAKE_MARKER_PREFIX}3`;
|
|
54
|
+
const SUBAGENT_STOP_GUARD_MARKER_PREFIX = 'CODEMAN_SUBAGENT_STOP_GUARD_V';
|
|
55
|
+
const SUBAGENT_STOP_GUARD_MARKER = `${SUBAGENT_STOP_GUARD_MARKER_PREFIX}1`;
|
|
52
56
|
const BACKGROUND_WAKE_TIMEOUT_SECONDS = 6 * 60 * 60;
|
|
53
57
|
/**
|
|
54
58
|
* Inline Node helper for Claude Code's `asyncRewake` hook.
|
|
55
59
|
*
|
|
56
60
|
* A background Bash tool returns immediately with a task ID, then Claude writes
|
|
57
|
-
* its completion as a queue-operation in the transcript.
|
|
58
|
-
*
|
|
61
|
+
* its completion as a queue-operation in the top-level transcript. Subagent hooks
|
|
62
|
+
* receive their own transcript path even though their completion is parent-owned,
|
|
63
|
+
* so the helper watches both paths. Watching durable records avoids injecting
|
|
64
|
+
* terminal input (which could submit a user's draft).
|
|
59
65
|
* The helper is embedded in settings via `node -e`, so it has no script path
|
|
60
66
|
* that can go stale after an install or plugin-cache cleanup.
|
|
61
67
|
*
|
|
@@ -67,8 +73,12 @@ const BACKGROUND_WAKE_TIMEOUT_SECONDS = 6 * 60 * 60;
|
|
|
67
73
|
export function generateBackgroundWakeScript() {
|
|
68
74
|
return [
|
|
69
75
|
"const fs = require('node:fs');",
|
|
76
|
+
"const path = require('node:path');",
|
|
70
77
|
`const ${BACKGROUND_WAKE_MARKER} = true;`,
|
|
71
78
|
`const deadline = Date.now() + ${BACKGROUND_WAKE_TIMEOUT_SECONDS} * 1000;`,
|
|
79
|
+
"const RESULT_BEGIN = '=== CODEMAN_RESULT_BEGIN ===';",
|
|
80
|
+
"const RESULT_END = '=== CODEMAN_RESULT_END ===';",
|
|
81
|
+
'const MAX_RESULT_CHARS = 65536;',
|
|
72
82
|
'let input = {};',
|
|
73
83
|
"try { input = JSON.parse(fs.readFileSync(0, 'utf8') || '{}'); } catch { process.exit(0); }",
|
|
74
84
|
'function findTaskId(value) {',
|
|
@@ -93,45 +103,162 @@ export function generateBackgroundWakeScript() {
|
|
|
93
103
|
'const taskId = findTaskId(input.tool_response);',
|
|
94
104
|
"const transcriptPath = typeof input.transcript_path === 'string' ? input.transcript_path : '';",
|
|
95
105
|
'if (!taskId || !transcriptPath) process.exit(0);',
|
|
96
|
-
'
|
|
97
|
-
'
|
|
98
|
-
"
|
|
106
|
+
'const transcriptPaths = [transcriptPath];',
|
|
107
|
+
'const sessionDir = path.dirname(path.dirname(transcriptPath));',
|
|
108
|
+
"if (typeof input.agent_id === 'string' && path.basename(path.dirname(transcriptPath)) === 'subagents' &&",
|
|
109
|
+
" typeof input.session_id === 'string' && path.basename(sessionDir) === input.session_id) {",
|
|
110
|
+
" transcriptPaths.push(sessionDir + '.jsonl');",
|
|
111
|
+
'}',
|
|
112
|
+
'const transcripts = [...new Set(transcriptPaths)].map((transcript) => {',
|
|
113
|
+
' let position = 0;',
|
|
114
|
+
' try { position = Math.max(0, fs.statSync(transcript).size - 262144); } catch {}',
|
|
115
|
+
" return { path: transcript, position, carry: '' };",
|
|
116
|
+
'});',
|
|
117
|
+
'if (!transcripts.some((transcript) => fs.existsSync(transcript.path))) process.exit(0);',
|
|
118
|
+
'function readMarkedResult(outputPath) {',
|
|
119
|
+
" if (!outputPath || !path.isAbsolute(outputPath) || path.basename(outputPath) !== taskId + '.output') return '';",
|
|
120
|
+
" if (path.basename(path.dirname(outputPath)) !== 'tasks') return '';",
|
|
121
|
+
' try {',
|
|
122
|
+
' const size = fs.statSync(outputPath).size;',
|
|
123
|
+
' const length = Math.min(size, MAX_RESULT_CHARS * 2);',
|
|
124
|
+
' const buffer = Buffer.allocUnsafe(length);',
|
|
125
|
+
" const fd = fs.openSync(outputPath, 'r');",
|
|
126
|
+
' const bytes = fs.readSync(fd, buffer, 0, length, size - length);',
|
|
127
|
+
' fs.closeSync(fd);',
|
|
128
|
+
" const text = buffer.subarray(0, bytes).toString('utf8');",
|
|
129
|
+
' const begin = text.lastIndexOf(RESULT_BEGIN);',
|
|
130
|
+
' const end = text.indexOf(RESULT_END, begin + RESULT_BEGIN.length);',
|
|
131
|
+
" if (begin < 0 || end < 0) return '';",
|
|
132
|
+
' let result = text.slice(begin + RESULT_BEGIN.length, end).trim();',
|
|
133
|
+
" if (!result) return '';",
|
|
134
|
+
' if (result.length > MAX_RESULT_CHARS) {',
|
|
135
|
+
' const half = Math.floor(MAX_RESULT_CHARS / 2);',
|
|
136
|
+
" result = result.slice(0, half) + '\\n\\n[report truncated by Codeman]\\n\\n' + result.slice(-half);",
|
|
137
|
+
' }',
|
|
138
|
+
" return '\\n\\nCompleted task report:\\n<codeman-background-result>\\n' + result + '\\n</codeman-background-result>';",
|
|
139
|
+
" } catch { return ''; }",
|
|
140
|
+
'}',
|
|
99
141
|
'function inspect(text) {',
|
|
100
142
|
' for (const line of text.split(/\\r?\\n/)) {',
|
|
101
143
|
' if (!line.includes(taskId)) continue;',
|
|
102
144
|
' let entry;',
|
|
103
145
|
' try { entry = JSON.parse(line); } catch { continue; }',
|
|
104
|
-
" if (entry.type !== 'queue-operation' || typeof entry.content !== 'string') continue;",
|
|
146
|
+
" if (entry.type !== 'queue-operation' || entry.operation !== 'enqueue' || typeof entry.content !== 'string') continue;",
|
|
105
147
|
" if (!entry.content.includes('<task-id>' + taskId + '</task-id>')) continue;",
|
|
106
148
|
' const status = entry.content.match(/<status>(completed|failed|killed|error)<\\/status>/i);',
|
|
107
149
|
' if (!status) continue;',
|
|
108
150
|
' const output = entry.content.match(/<output-file>([^<]+)<\\/output-file>/i);',
|
|
109
|
-
" const
|
|
110
|
-
"
|
|
151
|
+
" const outputPath = output ? output[1].trim() : '';",
|
|
152
|
+
" const location = outputPath ? ' Read ' + outputPath + ' and' : '';",
|
|
153
|
+
' const result = readMarkedResult(outputPath);',
|
|
154
|
+
" console.error('Background command ' + taskId + ' ' + status[1].toLowerCase() + '.' + location + ' continue the task.' + result);",
|
|
111
155
|
' process.exit(2);',
|
|
112
156
|
' }',
|
|
113
157
|
'}',
|
|
114
|
-
'function
|
|
115
|
-
' if (Date.now() > deadline || process.ppid === 1) process.exit(0);',
|
|
158
|
+
'function pollTranscript(transcript) {',
|
|
116
159
|
' try {',
|
|
117
|
-
' const size = fs.statSync(
|
|
118
|
-
" if (size < position) { position = 0; carry = ''; }",
|
|
119
|
-
' if (size > position) {',
|
|
120
|
-
' const length = Math.min(size - position, 1048576);',
|
|
160
|
+
' const size = fs.statSync(transcript.path).size;',
|
|
161
|
+
" if (size < transcript.position) { transcript.position = 0; transcript.carry = ''; }",
|
|
162
|
+
' if (size > transcript.position) {',
|
|
163
|
+
' const length = Math.min(size - transcript.position, 1048576);',
|
|
121
164
|
' const buffer = Buffer.allocUnsafe(length);',
|
|
122
|
-
" const fd = fs.openSync(
|
|
123
|
-
' const bytes = fs.readSync(fd, buffer, 0, length, position);',
|
|
165
|
+
" const fd = fs.openSync(transcript.path, 'r');",
|
|
166
|
+
' const bytes = fs.readSync(fd, buffer, 0, length, transcript.position);',
|
|
124
167
|
' fs.closeSync(fd);',
|
|
125
|
-
' position += bytes;',
|
|
126
|
-
" carry = (carry + buffer.subarray(0, bytes).toString('utf8')).slice(-262144);",
|
|
127
|
-
' inspect(carry);',
|
|
168
|
+
' transcript.position += bytes;',
|
|
169
|
+
" transcript.carry = (transcript.carry + buffer.subarray(0, bytes).toString('utf8')).slice(-262144);",
|
|
170
|
+
' inspect(transcript.carry);',
|
|
128
171
|
' }',
|
|
129
172
|
' } catch {}',
|
|
173
|
+
'}',
|
|
174
|
+
'function poll() {',
|
|
175
|
+
' if (Date.now() > deadline || process.ppid === 1) process.exit(0);',
|
|
176
|
+
' for (const transcript of transcripts) pollTranscript(transcript);',
|
|
130
177
|
' setTimeout(poll, 1000);',
|
|
131
178
|
'}',
|
|
132
179
|
'poll();',
|
|
133
180
|
].join('\n');
|
|
134
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Keep a Claude subagent alive while its Monitor or background Bash work is live.
|
|
184
|
+
* Claude otherwise can publish the worker's last progress sentence as an Agent
|
|
185
|
+
* result when one watcher ends, even if other tracked tasks are still running.
|
|
186
|
+
*/
|
|
187
|
+
export function generateSubagentStopGuardScript() {
|
|
188
|
+
return [
|
|
189
|
+
"const fs = require('node:fs');",
|
|
190
|
+
`const ${SUBAGENT_STOP_GUARD_MARKER} = true;`,
|
|
191
|
+
'let input = {};',
|
|
192
|
+
"try { input = JSON.parse(fs.readFileSync(0, 'utf8') || '{}'); } catch { process.exit(0); }",
|
|
193
|
+
"const transcriptPath = typeof input.agent_transcript_path === 'string' ? input.agent_transcript_path : '';",
|
|
194
|
+
'if (!transcriptPath) process.exit(0);',
|
|
195
|
+
'let text;',
|
|
196
|
+
'try {',
|
|
197
|
+
' const size = fs.statSync(transcriptPath).size;',
|
|
198
|
+
' const length = Math.min(size, 16 * 1024 * 1024);',
|
|
199
|
+
' const buffer = Buffer.allocUnsafe(length);',
|
|
200
|
+
" const fd = fs.openSync(transcriptPath, 'r');",
|
|
201
|
+
' const bytes = fs.readSync(fd, buffer, 0, length, size - length);',
|
|
202
|
+
' fs.closeSync(fd);',
|
|
203
|
+
" text = buffer.subarray(0, bytes).toString('utf8');",
|
|
204
|
+
'} catch { process.exit(0); }',
|
|
205
|
+
'const launched = new Set();',
|
|
206
|
+
'const finished = new Set();',
|
|
207
|
+
'function inspectToolResult(value) {',
|
|
208
|
+
" const serialized = typeof value === 'string' ? value : JSON.stringify(value ?? '');",
|
|
209
|
+
' for (const match of serialized.matchAll(/Command running in background with ID:\\s*([A-Za-z0-9_-]+)/gi)) launched.add(match[1]);',
|
|
210
|
+
' for (const match of serialized.matchAll(/Monitor started \\(task ([A-Za-z0-9_-]+)/gi)) launched.add(match[1]);',
|
|
211
|
+
'}',
|
|
212
|
+
'function inspectNotifications(value) {',
|
|
213
|
+
" if (typeof value !== 'string' || !value.includes('<task-notification>')) return;",
|
|
214
|
+
' for (const match of value.matchAll(/<task-notification>([\\s\\S]*?)<\\/task-notification>/gi)) {',
|
|
215
|
+
' const body = match[1];',
|
|
216
|
+
' const id = body.match(/<task-id>([^<]+)<\\/task-id>/i);',
|
|
217
|
+
' const status = body.match(/<status>(completed|failed|killed|error)<\\/status>/i);',
|
|
218
|
+
' if (id && status) finished.add(id[1].trim());',
|
|
219
|
+
' }',
|
|
220
|
+
'}',
|
|
221
|
+
'for (const line of text.split(/\\r?\\n/)) {',
|
|
222
|
+
' let entry;',
|
|
223
|
+
' try { entry = JSON.parse(line); } catch { continue; }',
|
|
224
|
+
' const content = entry && entry.message ? entry.message.content : undefined;',
|
|
225
|
+
' if (Array.isArray(content)) {',
|
|
226
|
+
' for (const block of content) {',
|
|
227
|
+
" if (block && block.type === 'tool_result') inspectToolResult(block.content);",
|
|
228
|
+
" if (block && block.type === 'text') inspectNotifications(block.text);",
|
|
229
|
+
' }',
|
|
230
|
+
' } else {',
|
|
231
|
+
' inspectNotifications(content);',
|
|
232
|
+
' }',
|
|
233
|
+
' inspectNotifications(entry && entry.content);',
|
|
234
|
+
'}',
|
|
235
|
+
'function findLiveTasks(candidates) {',
|
|
236
|
+
' const live = new Set();',
|
|
237
|
+
" if (candidates.size === 0 || !fs.existsSync('/proc')) return live;",
|
|
238
|
+
' let processIds;',
|
|
239
|
+
" try { processIds = fs.readdirSync('/proc').filter((name) => /^\\d+$/.test(name)); } catch { return live; }",
|
|
240
|
+
' for (const processId of processIds) {',
|
|
241
|
+
" for (const descriptor of ['0', '1', '2']) {",
|
|
242
|
+
' let target;',
|
|
243
|
+
" try { target = fs.readlinkSync('/proc/' + processId + '/fd/' + descriptor); } catch { continue; }",
|
|
244
|
+
' const match = target.match(/[\\/]tasks[\\/]([A-Za-z0-9_-]+)\\.output(?: \\(deleted\\))?$/);',
|
|
245
|
+
' if (match && candidates.has(match[1])) live.add(match[1]);',
|
|
246
|
+
' }',
|
|
247
|
+
' if (live.size === candidates.size) break;',
|
|
248
|
+
' }',
|
|
249
|
+
' return live;',
|
|
250
|
+
'}',
|
|
251
|
+
'const unfinished = new Set([...launched].filter((taskId) => !finished.has(taskId)));',
|
|
252
|
+
'const active = [...findLiveTasks(unfinished)];',
|
|
253
|
+
'if (active.length === 0) process.exit(0);',
|
|
254
|
+
'const shown = active.slice(0, 8);',
|
|
255
|
+
"const suffix = active.length > shown.length ? ' and ' + (active.length - shown.length) + ' more' : '';",
|
|
256
|
+
'process.stdout.write(JSON.stringify({',
|
|
257
|
+
" decision: 'block',",
|
|
258
|
+
" reason: 'You still own active background work (' + shown.join(', ') + suffix + '). Do not return an intermediate progress message as your final report. Process the task notifications or keep actively polling until every task completes, then return one complete summary.',",
|
|
259
|
+
'}));',
|
|
260
|
+
].join('\n');
|
|
261
|
+
}
|
|
135
262
|
function withSettingsLock(path, fn) {
|
|
136
263
|
const prev = settingsWriteLocks.get(path) ?? Promise.resolve();
|
|
137
264
|
const run = prev.then(fn, fn); // run after the prior writer, regardless of its outcome
|
|
@@ -193,6 +320,18 @@ export function generateHooksConfig() {
|
|
|
193
320
|
hooks: [{ type: 'command', command: curlCmd('stop'), timeout: HOOK_TIMEOUT_SECONDS }],
|
|
194
321
|
},
|
|
195
322
|
],
|
|
323
|
+
SubagentStop: [
|
|
324
|
+
{
|
|
325
|
+
hooks: [
|
|
326
|
+
{
|
|
327
|
+
type: 'command',
|
|
328
|
+
command: 'node',
|
|
329
|
+
args: ['-e', generateSubagentStopGuardScript()],
|
|
330
|
+
timeout: HOOK_TIMEOUT_SECONDS,
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
],
|
|
196
335
|
TeammateIdle: [
|
|
197
336
|
{
|
|
198
337
|
hooks: [{ type: 'command', command: curlCmd('teammate_idle'), timeout: HOOK_TIMEOUT_SECONDS }],
|
|
@@ -223,8 +362,10 @@ export function generateHooksConfig() {
|
|
|
223
362
|
function isCodemanHookHandler(value) {
|
|
224
363
|
try {
|
|
225
364
|
const serialized = JSON.stringify(value);
|
|
226
|
-
//
|
|
227
|
-
return serialized.includes('/api/hook-event') ||
|
|
365
|
+
// Prefixes, not versioned markers: older script versions must still be ours.
|
|
366
|
+
return (serialized.includes('/api/hook-event') ||
|
|
367
|
+
serialized.includes(BACKGROUND_WAKE_MARKER_PREFIX) ||
|
|
368
|
+
serialized.includes(SUBAGENT_STOP_GUARD_MARKER_PREFIX));
|
|
228
369
|
}
|
|
229
370
|
catch {
|
|
230
371
|
return false;
|
|
@@ -405,6 +546,39 @@ export async function writeHooksConfig(casePath) {
|
|
|
405
546
|
await writeFile(settingsPath, JSON.stringify(merged, null, 2) + '\n');
|
|
406
547
|
});
|
|
407
548
|
}
|
|
549
|
+
/**
|
|
550
|
+
* Ensures an explicitly managed case has the current Codeman hooks.
|
|
551
|
+
*
|
|
552
|
+
* Unlike `refreshStaleCodemanHooks`, this may add Codeman handlers to a valid
|
|
553
|
+
* user-owned settings file. It is therefore reserved for case quick-starts,
|
|
554
|
+
* where the user has explicitly asked Codeman to manage that workspace. A
|
|
555
|
+
* malformed existing file is left untouched rather than replaced.
|
|
556
|
+
*/
|
|
557
|
+
export async function ensureCodemanHooks(casePath) {
|
|
558
|
+
const claudeDir = join(casePath, '.claude');
|
|
559
|
+
const settingsPath = join(claudeDir, 'settings.local.json');
|
|
560
|
+
await withSettingsLock(settingsPath, async () => {
|
|
561
|
+
if (!existsSync(claudeDir)) {
|
|
562
|
+
await mkdir(claudeDir, { recursive: true });
|
|
563
|
+
}
|
|
564
|
+
let existing = {};
|
|
565
|
+
try {
|
|
566
|
+
const parsed = JSON.parse(await readFile(settingsPath, 'utf-8'));
|
|
567
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
568
|
+
return;
|
|
569
|
+
existing = parsed;
|
|
570
|
+
}
|
|
571
|
+
catch (err) {
|
|
572
|
+
if (err.code !== 'ENOENT')
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
const generated = generateHooksConfig();
|
|
576
|
+
const hooks = mergeCodemanHooks(existing.hooks, generated.hooks);
|
|
577
|
+
if (JSON.stringify(existing.hooks ?? {}) === JSON.stringify(hooks))
|
|
578
|
+
return;
|
|
579
|
+
await writeFile(settingsPath, JSON.stringify({ ...existing, hooks }, null, 2) + '\n');
|
|
580
|
+
});
|
|
581
|
+
}
|
|
408
582
|
/**
|
|
409
583
|
* Self-heal a case's Codeman-owned hooks block.
|
|
410
584
|
*
|
|
@@ -412,10 +586,11 @@ export async function writeHooksConfig(casePath) {
|
|
|
412
586
|
* X-Codeman-Hook-Secret header was added (COD-54, 2026-06-10) keep hook curls in their
|
|
413
587
|
* settings.local.json that POST to /api/hook-event WITHOUT the secret — which, once the
|
|
414
588
|
* gate requires it unconditionally (COD-91), silently 401 on a password-protected install.
|
|
415
|
-
* Older Codeman blocks also lack the background Bash async-rewake hook
|
|
416
|
-
* shape: hook curls without `-k`, which exit 60 on
|
|
417
|
-
* cert is self-signed), swallowed by the hooks'
|
|
418
|
-
* silently. Refresh any of these stale shapes
|
|
589
|
+
* Older Codeman blocks also lack the current background Bash async-rewake hook or the
|
|
590
|
+
* SubagentStop guard. A further stale shape: hook curls without `-k`, which exit 60 on
|
|
591
|
+
* every --https/tailscale install (the cert is self-signed), swallowed by the hooks'
|
|
592
|
+
* own `|| true` — all six hook events die silently. Refresh any of these stale shapes
|
|
593
|
+
* on launch so existing cases heal.
|
|
419
594
|
*
|
|
420
595
|
* Deliberately surgical: regenerates ONLY when settings.local.json already contains
|
|
421
596
|
* Codeman's own hook curls (they target `/api/hook-event`) and they are stale. No-op
|
|
@@ -444,7 +619,8 @@ export async function refreshStaleCodemanHooks(casePath) {
|
|
|
444
619
|
// as a substring, so this cleanly identifies hook curls that die with exit 60
|
|
445
620
|
// on a self-signed HTTPS install.
|
|
446
621
|
const hasTlsFlaglessCurl = hooksJson.includes('curl -s -X POST');
|
|
447
|
-
|
|
622
|
+
const hasSubagentStopGuard = hooksJson.includes(SUBAGENT_STOP_GUARD_MARKER);
|
|
623
|
+
if (!isOurs || (hasSecret && hasBackgroundWake && hasSubagentStopGuard && !hasTlsFlaglessCurl))
|
|
448
624
|
return;
|
|
449
625
|
const generated = generateHooksConfig();
|
|
450
626
|
const merged = {
|
package/dist/hooks-config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-config.js","sourceRoot":"","sources":["../src/hooks-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAC/D;;;;;GAKG;AACH,MAAM,6BAA6B,GAAG,6BAA6B,CAAC;AACpE;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,GAAG,6BAA6B,GAAG,CAAC;AACnE,MAAM,+BAA+B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;AAEpD;;;;;;;;;;;;;GAa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Q,CAAC,UAAU,CAAC;QAC7B,CAAC;QAED,MAAM,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `codeman service install|uninstall|status`: write and load the
|
|
3
|
+
* systemd user unit (Linux) or LaunchAgent (macOS) that supervises `codeman web`.
|
|
4
|
+
*
|
|
5
|
+
* This is the "always running" half of issue #231, next to the "detached right
|
|
6
|
+
* now" half in daemon-control.ts. `install.sh` already does this for people who
|
|
7
|
+
* install with the one-liner; this exists for `npm i -g aicodeman` users, who
|
|
8
|
+
* otherwise have to hand-write a plist.
|
|
9
|
+
*
|
|
10
|
+
* Two details are load-bearing and easy to get wrong by hand:
|
|
11
|
+
*
|
|
12
|
+
* - **PATH.** launchd hands a job `/usr/bin:/bin:/usr/sbin:/sbin` and systemd's
|
|
13
|
+
* user manager is nearly as bare, so a Homebrew or nvm `node`, `tmux` or
|
|
14
|
+
* `claude` is simply not found and sessions fail in a way that reads as a
|
|
15
|
+
* Codeman bug. The unit therefore carries the PATH of the shell that ran the
|
|
16
|
+
* install, with the running node's own directory in front.
|
|
17
|
+
* - **The job name.** It is the one `install.sh` and the self-updater already use
|
|
18
|
+
* (config/service-names.ts), so re-running install.sh later updates this unit
|
|
19
|
+
* instead of supervising a second copy of the server.
|
|
20
|
+
*
|
|
21
|
+
* Secrets are deliberately NOT written here. `CODEMAN_PASSWORD` in the installing
|
|
22
|
+
* shell is not copied into the unit; the caller is told where to add it instead,
|
|
23
|
+
* because a unit file is long-lived, world-readable by default, and gets copied
|
|
24
|
+
* into bug reports.
|
|
25
|
+
*
|
|
26
|
+
* The file writers are pure string builders so they can be unit-tested without
|
|
27
|
+
* touching launchctl/systemctl.
|
|
28
|
+
*
|
|
29
|
+
* @module service-installer
|
|
30
|
+
*/
|
|
31
|
+
import { type WebLaunchOptions } from './daemon-control.js';
|
|
32
|
+
export type ServiceKind = 'launchd' | 'systemd';
|
|
33
|
+
/** Everything a unit file needs, resolved from the environment by the caller. */
|
|
34
|
+
export interface ServicePlan {
|
|
35
|
+
kind: ServiceKind;
|
|
36
|
+
/** systemd unit filename or launchd label. */
|
|
37
|
+
name: string;
|
|
38
|
+
nodePath: string;
|
|
39
|
+
/** Runner flags carried over from the current process (tsx loader in dev). */
|
|
40
|
+
execArgv: string[];
|
|
41
|
+
scriptPath: string;
|
|
42
|
+
args: string[];
|
|
43
|
+
env: Record<string, string>;
|
|
44
|
+
logPath: string;
|
|
45
|
+
workingDir: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ServiceActionResult {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
message: string;
|
|
50
|
+
/** Path of the unit/plist that was written or removed. */
|
|
51
|
+
unitPath?: string;
|
|
52
|
+
warnings?: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface ServiceStatusResult {
|
|
55
|
+
kind: ServiceKind | null;
|
|
56
|
+
name: string;
|
|
57
|
+
unitPath: string;
|
|
58
|
+
installed: boolean;
|
|
59
|
+
loaded: boolean;
|
|
60
|
+
responding: boolean;
|
|
61
|
+
version?: string;
|
|
62
|
+
url: string;
|
|
63
|
+
}
|
|
64
|
+
/** XML text escaping for plist `<string>` values. */
|
|
65
|
+
export declare function xmlEscape(value: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* PATH for the supervised process: the running node's directory first (so an nvm
|
|
68
|
+
* or Homebrew node is used rather than whatever the supervisor finds), then the
|
|
69
|
+
* installing shell's PATH, then the fallbacks that are still missing.
|
|
70
|
+
*
|
|
71
|
+
* `node_modules/.bin` entries are dropped. npm and npx inject those for the
|
|
72
|
+
* lifetime of one command, and baking a project's local bin dir into a unit file
|
|
73
|
+
* that outlives the checkout is how a service ends up running a binary the
|
|
74
|
+
* operator deleted months ago.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildServicePath(nodeDir: string, currentPath: string, home: string): string;
|
|
77
|
+
/** Environment written into the unit. Never includes secrets (see module docs). */
|
|
78
|
+
export declare function buildServiceEnv(nodeDir: string, currentPath: string, home: string, lang?: string): Record<string, string>;
|
|
79
|
+
/** systemd accepts double-quoted values; escape the two characters that matter. */
|
|
80
|
+
export declare function systemdQuote(value: string): string;
|
|
81
|
+
export declare function buildLaunchAgentPlist(plan: ServicePlan): string;
|
|
82
|
+
export declare function buildSystemdUnit(plan: ServicePlan): string;
|
|
83
|
+
export declare function detectServiceKind(): ServiceKind | null;
|
|
84
|
+
export declare function unitPathFor(kind: ServiceKind): string;
|
|
85
|
+
/** Resolve a full plan from the current process and the requested web options. */
|
|
86
|
+
export declare function resolveServicePlan(kind: ServiceKind, options: WebLaunchOptions): ServicePlan;
|
|
87
|
+
/**
|
|
88
|
+
* Write the unit, load it, and confirm the server actually answers before
|
|
89
|
+
* reporting success. `launchctl load` and `systemctl enable` are both quiet about
|
|
90
|
+
* a job that starts and immediately dies, which is the whole reason install.sh
|
|
91
|
+
* verifies too.
|
|
92
|
+
*/
|
|
93
|
+
export declare function installService(options: WebLaunchOptions): Promise<ServiceActionResult>;
|
|
94
|
+
export declare function uninstallService(): ServiceActionResult;
|
|
95
|
+
export declare function serviceStatus(options: WebLaunchOptions): Promise<ServiceStatusResult>;
|
|
96
|
+
//# sourceMappingURL=service-installer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-installer.d.ts","sourceRoot":"","sources":["../src/service-installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AASH,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAEhD,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,8CAA8C;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