@a5c-ai/babysitter-github 5.0.1-staging.22bf451f → 5.0.1-staging.25e625f3
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/bin/cli.js +8 -19
- package/bin/install-shared.js +344 -204
- package/bin/install.js +35 -91
- package/bin/uninstall.js +12 -63
- package/commands/doctor.md +5 -5
- package/commands/help.md +245 -244
- package/commands/observe.md +12 -12
- package/hooks/babysitter-proxied-session-end.ps1 +10 -114
- package/hooks/babysitter-proxied-session-end.sh +2 -111
- package/hooks/babysitter-proxied-session-start.ps1 +10 -187
- package/hooks/babysitter-proxied-session-start.sh +6 -168
- package/hooks/babysitter-proxied-user-prompt-submitted.ps1 +10 -90
- package/hooks/babysitter-proxied-user-prompt-submitted.sh +2 -86
- package/hooks/session-end.ps1 +11 -68
- package/hooks/session-end.sh +2 -53
- package/hooks/session-start.ps1 +10 -109
- package/hooks/session-start.sh +6 -96
- package/hooks/user-prompt-submitted.ps1 +11 -51
- package/hooks/user-prompt-submitted.sh +2 -30
- package/hooks.json +10 -10
- package/package.json +18 -20
- package/plugin.json +7 -6
- package/scripts/team-install.js +12 -85
- package/skills/cleanup/SKILL.md +21 -0
- package/skills/contrib/SKILL.md +34 -0
- package/skills/doctor/SKILL.md +5 -5
- package/skills/forever/SKILL.md +8 -0
- package/skills/help/SKILL.md +3 -2
- package/skills/observe/SKILL.md +1 -1
- package/skills/plugins/SKILL.md +257 -0
- package/skills/project-install/SKILL.md +18 -0
- package/skills/resume/SKILL.md +1 -1
- package/skills/retrospect/SKILL.md +48 -48
- package/skills/user-install/SKILL.md +3 -3
- package/skills/yolo/SKILL.md +8 -0
- package/versions.json +1 -1
- package/.github/plugin.json +0 -25
- package/hooks/proxied-hooks.json +0 -29
package/bin/install.js
CHANGED
|
@@ -2,126 +2,70 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const
|
|
6
|
-
const {
|
|
7
|
-
copyPluginBundle,
|
|
8
|
-
ensureGlobalProcessLibrary,
|
|
9
|
-
ensureMarketplaceEntry,
|
|
10
|
-
getCopilotHome,
|
|
11
|
-
getHomeMarketplacePath,
|
|
12
|
-
getHomePluginRoot,
|
|
13
|
-
installCloudAgentSurface,
|
|
14
|
-
installCopilotSurface,
|
|
15
|
-
warnWindowsHooks,
|
|
16
|
-
} = require('./install-shared');
|
|
5
|
+
const shared = require('./install-shared');
|
|
17
6
|
|
|
18
7
|
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
19
8
|
|
|
20
9
|
function parseArgs(argv) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
workspace: process.cwd(),
|
|
24
|
-
};
|
|
10
|
+
let cloudAgent = false;
|
|
11
|
+
let workspace = null;
|
|
25
12
|
|
|
26
13
|
for (let i = 0; i < argv.length; i += 1) {
|
|
27
14
|
const arg = argv[i];
|
|
28
15
|
if (arg === '--cloud-agent') {
|
|
29
|
-
|
|
16
|
+
cloudAgent = true;
|
|
30
17
|
continue;
|
|
31
18
|
}
|
|
32
19
|
if (arg === '--workspace') {
|
|
33
20
|
const next = argv[i + 1];
|
|
34
21
|
if (next && !next.startsWith('-')) {
|
|
35
|
-
|
|
22
|
+
workspace = path.resolve(next);
|
|
36
23
|
i += 1;
|
|
37
24
|
} else {
|
|
38
|
-
|
|
25
|
+
workspace = process.cwd();
|
|
39
26
|
}
|
|
40
27
|
}
|
|
41
28
|
}
|
|
42
29
|
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Attempt to register the plugin via `copilot plugin install ./path`.
|
|
48
|
-
* Falls back to manual config.json registration if the CLI is not available.
|
|
49
|
-
*/
|
|
50
|
-
function registerViaCopilotCli(pluginRoot) {
|
|
51
|
-
const result = spawnSync('copilot', ['plugin', 'install', pluginRoot], {
|
|
52
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
53
|
-
encoding: 'utf8',
|
|
54
|
-
timeout: 30000,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (result.status === 0) {
|
|
58
|
-
console.log(`[babysitter] Registered plugin via 'copilot plugin install'`);
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// CLI not available or failed -- fall back to manual registration
|
|
63
|
-
const stderr = (result.stderr || '').trim();
|
|
64
|
-
if (result.error || stderr.includes('not found') || stderr.includes('not recognized')) {
|
|
65
|
-
console.log(`[babysitter] Copilot CLI not found, using manual registration`);
|
|
66
|
-
} else {
|
|
67
|
-
console.warn(`[babysitter] 'copilot plugin install' failed: ${stderr || 'unknown error'}, using manual registration`);
|
|
68
|
-
}
|
|
69
|
-
return false;
|
|
30
|
+
return { cloudAgent, workspace };
|
|
70
31
|
}
|
|
71
32
|
|
|
72
33
|
function main() {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
console.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
34
|
+
const parsed = parseArgs(process.argv.slice(2));
|
|
35
|
+
if (parsed.cloudAgent) {
|
|
36
|
+
const workspaceRoot = parsed.workspace || process.cwd();
|
|
37
|
+
console.log(`[${shared.PLUGIN_NAME}] Installing cloud-agent support into ${workspaceRoot}`);
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
const activeProcessLibrary = shared.runCli(PACKAGE_ROOT, [
|
|
41
|
+
'process-library:active',
|
|
42
|
+
'--json',
|
|
43
|
+
], { stdio: 'pipe' });
|
|
44
|
+
if (activeProcessLibrary.status !== 0) {
|
|
45
|
+
shared.ensureGlobalProcessLibrary(PACKAGE_ROOT);
|
|
46
|
+
}
|
|
47
|
+
shared.installCloudAgentSurface(PACKAGE_ROOT, workspaceRoot);
|
|
48
|
+
console.log(`[${shared.PLUGIN_NAME}] Cloud-agent installation complete!`);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
console.error(`[${shared.PLUGIN_NAME}] Failed to install cloud-agent support: ${err.message}`);
|
|
51
|
+
process.exitCode = 1;
|
|
91
52
|
}
|
|
92
|
-
console.log(`[babysitter] process library: ${active.binding?.dir}`);
|
|
93
|
-
console.log(`[babysitter] process library state: ${active.stateFile}`);
|
|
94
|
-
console.log('[babysitter] Cloud-agent installation complete!');
|
|
95
53
|
return;
|
|
96
54
|
}
|
|
97
55
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
try {
|
|
101
|
-
copyPluginBundle(PACKAGE_ROOT, pluginRoot);
|
|
102
|
-
ensureMarketplaceEntry(marketplacePath, pluginRoot);
|
|
56
|
+
const pluginRoot = shared.getHomePluginRoot();
|
|
57
|
+
const marketplacePath = shared.getHomeMarketplacePath();
|
|
103
58
|
|
|
104
|
-
|
|
105
|
-
if (!registerViaCopilotCli(pluginRoot)) {
|
|
106
|
-
const { registerCopilotPlugin } = require('./install-shared');
|
|
107
|
-
registerCopilotPlugin(pluginRoot);
|
|
108
|
-
}
|
|
59
|
+
console.log(`[${shared.PLUGIN_NAME}] Installing plugin to ${pluginRoot}`);
|
|
109
60
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
console.log(`[
|
|
115
|
-
console.log(`[
|
|
116
|
-
if (active.defaultSpec?.cloneDir) {
|
|
117
|
-
console.log(`[babysitter] process library clone: ${active.defaultSpec.cloneDir}`);
|
|
118
|
-
}
|
|
119
|
-
console.log(`[babysitter] process library state: ${active.stateFile}`);
|
|
120
|
-
warnWindowsHooks();
|
|
121
|
-
console.log('[babysitter] Installation complete!');
|
|
122
|
-
console.log('[babysitter] Restart GitHub Copilot CLI to pick up the installed plugin and config changes.');
|
|
61
|
+
try {
|
|
62
|
+
shared.copyPluginBundle(PACKAGE_ROOT, pluginRoot);
|
|
63
|
+
shared.ensureMarketplaceEntry(marketplacePath, pluginRoot);
|
|
64
|
+
shared.runPostInstall && shared.runPostInstall(pluginRoot);
|
|
65
|
+
console.log(`[${shared.PLUGIN_NAME}] Installation complete!`);
|
|
66
|
+
console.log(`[${shared.PLUGIN_NAME}] Restart your IDE/CLI to pick up the plugin.`);
|
|
123
67
|
} catch (err) {
|
|
124
|
-
console.error(`[
|
|
68
|
+
console.error(`[${shared.PLUGIN_NAME}] Failed to install: ${err.message}`);
|
|
125
69
|
process.exitCode = 1;
|
|
126
70
|
}
|
|
127
71
|
}
|
package/bin/uninstall.js
CHANGED
|
@@ -1,76 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
const path = require('path');
|
|
4
5
|
const fs = require('fs');
|
|
5
|
-
const
|
|
6
|
-
const {
|
|
7
|
-
deregisterCopilotPlugin,
|
|
8
|
-
getCopilotHome,
|
|
9
|
-
getHomeMarketplacePath,
|
|
10
|
-
getHomePluginRoot,
|
|
11
|
-
removeLegacyHooks,
|
|
12
|
-
removeMarketplaceEntry,
|
|
13
|
-
} = require('./install-shared');
|
|
14
|
-
|
|
15
|
-
const PLUGIN_NAME = 'babysitter';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Attempt to unregister the plugin via `copilot plugin uninstall`.
|
|
19
|
-
* Falls back to manual config.json cleanup if the CLI is not available.
|
|
20
|
-
*/
|
|
21
|
-
function unregisterViaCopilotCli() {
|
|
22
|
-
const result = spawnSync('copilot', ['plugin', 'uninstall', PLUGIN_NAME], {
|
|
23
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
24
|
-
encoding: 'utf8',
|
|
25
|
-
timeout: 30000,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
if (result.status === 0) {
|
|
29
|
-
console.log(`[${PLUGIN_NAME}] Unregistered plugin via 'copilot plugin uninstall'`);
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// CLI not available or failed
|
|
34
|
-
const stderr = (result.stderr || '').trim();
|
|
35
|
-
if (result.error || stderr.includes('not found') || stderr.includes('not recognized')) {
|
|
36
|
-
console.log(`[${PLUGIN_NAME}] Copilot CLI not found, using manual cleanup`);
|
|
37
|
-
} else {
|
|
38
|
-
console.warn(`[${PLUGIN_NAME}] 'copilot plugin uninstall' failed: ${stderr || 'unknown error'}, using manual cleanup`);
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
6
|
+
const shared = require('./install-shared');
|
|
42
7
|
|
|
43
8
|
function main() {
|
|
44
|
-
const
|
|
45
|
-
const pluginRoot = getHomePluginRoot();
|
|
46
|
-
const marketplacePath = getHomeMarketplacePath();
|
|
47
|
-
let removedPlugin = false;
|
|
9
|
+
const pluginRoot = shared.getHomePluginRoot();
|
|
48
10
|
|
|
49
|
-
if (fs.existsSync(pluginRoot)) {
|
|
50
|
-
|
|
51
|
-
fs.rmSync(pluginRoot, { recursive: true, force: true });
|
|
52
|
-
console.log(`[${PLUGIN_NAME}] Removed ${pluginRoot}`);
|
|
53
|
-
removedPlugin = true;
|
|
54
|
-
} catch (err) {
|
|
55
|
-
console.warn(`[${PLUGIN_NAME}] Warning: Could not remove plugin directory ${pluginRoot}: ${err.message}`);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
removeMarketplaceEntry(marketplacePath);
|
|
60
|
-
|
|
61
|
-
// Try native copilot CLI unregistration first; fall back to manual config.json
|
|
62
|
-
if (!unregisterViaCopilotCli()) {
|
|
63
|
-
deregisterCopilotPlugin(pluginRoot);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
removeLegacyHooks(copilotHome);
|
|
67
|
-
|
|
68
|
-
if (!removedPlugin) {
|
|
69
|
-
console.log(`[${PLUGIN_NAME}] Plugin directory not found, config and hooks cleaned if present.`);
|
|
11
|
+
if (!fs.existsSync(pluginRoot)) {
|
|
12
|
+
console.log(`[${shared.PLUGIN_NAME}] Plugin not installed at ${pluginRoot}`);
|
|
70
13
|
return;
|
|
71
14
|
}
|
|
72
15
|
|
|
73
|
-
|
|
16
|
+
try {
|
|
17
|
+
fs.rmSync(pluginRoot, { recursive: true, force: true });
|
|
18
|
+
console.log(`[${shared.PLUGIN_NAME}] Uninstalled from ${pluginRoot}`);
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
|
|
21
|
+
process.exitCode = 1;
|
|
22
|
+
}
|
|
74
23
|
}
|
|
75
24
|
|
|
76
25
|
main();
|
package/commands/doctor.md
CHANGED
|
@@ -362,13 +362,13 @@ Mark as FAIL if:
|
|
|
362
362
|
- Parse the output and inspect the `resolvedFrom` field. Classify as follows:
|
|
363
363
|
- `resolvedFrom: "pid-marker"` → mark as PASS ("Session ID derives from the live Claude Code ancestor process -- authoritative").
|
|
364
364
|
- `resolvedFrom: "env-file"` → mark as PASS with a note ("CLAUDE_ENV_FILE was used; typically healthy").
|
|
365
|
-
- `resolvedFrom: "env-var"` → mark as WARN ("`
|
|
366
|
-
- Remediation: run `babysitter session:cleanup` and start a fresh Claude Code session, or `unset
|
|
365
|
+
- `resolvedFrom: "env-var"` → mark as WARN ("`AGENT_SESSION_ID` is set without a corroborating PID marker. Likely stale from a prior Claude Code session -- see GitHub issue #130").
|
|
366
|
+
- Remediation: run `babysitter session:cleanup` and start a fresh Claude Code session, or `unset AGENT_SESSION_ID` before invoking babysitter.
|
|
367
367
|
- `resolvedFrom: "none"` → mark as ERROR ("No session ID resolvable. Either no session-start hook fired, or the ancestor walk failed").
|
|
368
368
|
|
|
369
369
|
**Env-var shadow check:**
|
|
370
370
|
- Independently inspect `envVarPresent` and `envVarMatches` in the output.
|
|
371
|
-
- If `envVarPresent && !envVarMatches`, mark as WARN ("`
|
|
371
|
+
- If `envVarPresent && !envVarMatches`, mark as WARN ("`AGENT_SESSION_ID` in env does not match the resolved session ID; a stale value is shadowing the authoritative one. Unset the env var").
|
|
372
372
|
|
|
373
373
|
---
|
|
374
374
|
|
|
@@ -390,7 +390,7 @@ Mark as FAIL if:
|
|
|
390
390
|
|
|
391
391
|
- Enumerate files in `~/.a5c/` matching the pattern `current-session-*-pid-*`.
|
|
392
392
|
- Count markers per harness (derived from the filename).
|
|
393
|
-
- If more than one live marker exists for the same harness, mark as INFO ("Multiple live Claude Code / harness sessions detected; ensure each shell scopes `
|
|
393
|
+
- If more than one live marker exists for the same harness, mark as INFO ("Multiple live Claude Code / harness sessions detected; ensure each shell scopes `AGENT_SESSION_ID` appropriately -- the PID marker handles this automatically").
|
|
394
394
|
- Otherwise mark as PASS.
|
|
395
395
|
|
|
396
396
|
---
|
|
@@ -501,7 +501,7 @@ babysitter session:cleanup --dry-run # preview
|
|
|
501
501
|
babysitter session:cleanup # apply
|
|
502
502
|
|
|
503
503
|
# 2. Unset a stale env var
|
|
504
|
-
unset
|
|
504
|
+
unset AGENT_SESSION_ID
|
|
505
505
|
|
|
506
506
|
# 3. Re-bind a run explicitly if needed
|
|
507
507
|
babysitter session:resume --session-id <fresh-id> --state-dir ~/.a5c --run-id <runId> --runs-dir .a5c/runs
|