@a5c-ai/babysitter-github 5.0.1-staging.d73033a7 → 5.0.1-staging.daf8e165bc4a

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.
Files changed (63) hide show
  1. package/README.md +33 -25
  2. package/bin/cli.js +14 -26
  3. package/bin/install-shared.js +398 -215
  4. package/bin/install.js +49 -89
  5. package/bin/uninstall.js +30 -60
  6. package/commands/blueprints.md +64 -0
  7. package/commands/call.md +11 -7
  8. package/commands/check-forbidden-markers.md +68 -0
  9. package/commands/cleanup.md +37 -9
  10. package/commands/contrib.md +31 -31
  11. package/commands/doctor.md +7 -8
  12. package/commands/forever.md +6 -6
  13. package/commands/help.md +246 -244
  14. package/commands/observe.md +17 -12
  15. package/commands/plan.md +17 -7
  16. package/commands/plugins.md +22 -255
  17. package/commands/project-install.md +10 -10
  18. package/commands/resume.md +8 -8
  19. package/commands/retrospect.md +55 -55
  20. package/commands/user-install.md +10 -10
  21. package/commands/yolo.md +11 -7
  22. package/hooks/babysitter-proxied-post-tool-use.ps1 +12 -0
  23. package/hooks/babysitter-proxied-post-tool-use.sh +3 -0
  24. package/hooks/babysitter-proxied-pre-compact.ps1 +12 -0
  25. package/hooks/babysitter-proxied-pre-compact.sh +3 -0
  26. package/hooks/babysitter-proxied-pre-tool-use.ps1 +12 -0
  27. package/hooks/babysitter-proxied-pre-tool-use.sh +3 -0
  28. package/hooks/babysitter-proxied-session-end.ps1 +10 -114
  29. package/hooks/babysitter-proxied-session-end.sh +2 -111
  30. package/hooks/babysitter-proxied-session-start.ps1 +10 -187
  31. package/hooks/babysitter-proxied-session-start.sh +6 -168
  32. package/hooks/babysitter-proxied-user-prompt-submitted.ps1 +10 -90
  33. package/hooks/babysitter-proxied-user-prompt-submitted.sh +2 -86
  34. package/hooks.json +33 -9
  35. package/package.json +20 -21
  36. package/plugin.json +7 -6
  37. package/scripts/create-release-tag.mjs +18 -0
  38. package/scripts/publish-from-tag.mjs +41 -0
  39. package/scripts/team-install.js +14 -84
  40. package/skills/babysit/SKILL.md +32 -46
  41. package/skills/blueprints/SKILL.md +66 -0
  42. package/skills/call/SKILL.md +5 -1
  43. package/skills/check-forbidden-markers/SKILL.md +69 -0
  44. package/skills/cleanup/SKILL.md +49 -0
  45. package/skills/contrib/SKILL.md +34 -0
  46. package/skills/doctor/SKILL.md +7 -8
  47. package/skills/forever/SKILL.md +8 -0
  48. package/skills/help/SKILL.md +13 -11
  49. package/skills/observe/SKILL.md +7 -2
  50. package/skills/plan/SKILL.md +11 -1
  51. package/skills/plugins/SKILL.md +24 -0
  52. package/skills/project-install/SKILL.md +18 -0
  53. package/skills/yolo/SKILL.md +12 -0
  54. package/versions.json +2 -1
  55. package/.github/plugin.json +0 -25
  56. package/hooks/proxied-hooks.json +0 -29
  57. package/hooks/session-end.ps1 +0 -69
  58. package/hooks/session-end.sh +0 -54
  59. package/hooks/session-start.ps1 +0 -111
  60. package/hooks/session-start.sh +0 -101
  61. package/hooks/user-prompt-submitted.ps1 +0 -52
  62. package/hooks/user-prompt-submitted.sh +0 -31
  63. package/scripts/sync-command-surfaces.js +0 -62
@@ -1,92 +1,12 @@
1
- # Unified userPromptSubmitted Hook for GitHub Copilot CLI (PowerShell)
2
- # Routes through hooks-proxy for all hook execution.
3
- #
4
- # Applies density-filter compression to long user prompts.
5
- #
6
- # NOTE: Output from this hook is IGNORED by Copilot CLI.
7
- # This hook is for logging and side-effects only.
8
-
9
- $ErrorActionPreference = "Continue"
10
-
11
- $PluginRoot = if ($env:COPILOT_PLUGIN_DIR) { $env:COPILOT_PLUGIN_DIR } else { Split-Path -Parent $PSScriptRoot }
12
- $ProxyMarkerFile = Join-Path $PluginRoot ".hooks-proxy-install-attempted"
13
-
14
- $GlobalRoot = if ($env:BABYSITTER_GLOBAL_STATE_DIR) { $env:BABYSITTER_GLOBAL_STATE_DIR } else { Join-Path $HOME ".a5c" }
15
- $LogDir = if ($env:BABYSITTER_LOG_DIR) { $env:BABYSITTER_LOG_DIR } else { Join-Path $GlobalRoot "logs" }
16
- New-Item -ItemType Directory -Path $LogDir -Force -ErrorAction SilentlyContinue | Out-Null
17
-
18
- # Get required version from versions.json (used for hooks-proxy)
19
- $versionsFile = Join-Path $PluginRoot "versions.json"
20
- try {
21
- $SdkVersion = (Get-Content $versionsFile -Raw | ConvertFrom-Json).sdkVersion
22
- if (-not $SdkVersion) { $SdkVersion = "latest" }
23
- } catch {
24
- $SdkVersion = "latest"
25
- }
26
-
27
- # ---------------------------------------------------------------------------
28
- # Hooks-proxy install (same pattern as SDK install in session-start)
29
- # ---------------------------------------------------------------------------
30
-
31
- function Install-HooksProxy {
32
- param([string]$TargetVersion)
33
- try {
34
- & npm i -g "@a5c-ai/hooks-proxy-cli@$TargetVersion" --loglevel=error 2>$null
35
- if ($LASTEXITCODE -eq 0) { return $true }
36
- } catch {}
37
- try {
38
- $prefix = Join-Path $env:USERPROFILE ".local"
39
- & npm i -g "@a5c-ai/hooks-proxy-cli@$TargetVersion" --prefix $prefix --loglevel=error 2>$null
40
- if ($LASTEXITCODE -eq 0) {
41
- $env:PATH = "$prefix\bin;$env:PATH"
42
- return $true
43
- }
44
- } catch {}
45
- return $false
46
- }
47
-
48
- # Resolve hooks-proxy binary
49
- $Proxy = $null
50
- if (Get-Command a5c-hooks-proxy -ErrorAction SilentlyContinue) {
51
- $Proxy = "a5c-hooks-proxy"
1
+ # PowerShell hook wrapper sets env vars and delegates to bash
2
+ $env:HOOK_TYPE = 'user-prompt-submit'
3
+ $env:ADAPTER_NAME = 'copilot'
4
+ $env:PLUGIN_ROOT = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
5
+
6
+ $input_data = [Console]::In.ReadToEnd()
7
+ $result = $input_data | & bash "$PSScriptRoot/../$($MyInvocation.MyCommand.Name -replace '\.ps1$','.sh')" 2>$null
8
+ if ($LASTEXITCODE -eq 0 -and $result) {
9
+ Write-Output $result
52
10
  } else {
53
- $localProxy = Join-Path $env:USERPROFILE ".local\bin\a5c-hooks-proxy.exe"
54
- if (Test-Path $localProxy) {
55
- $Proxy = $localProxy
56
- }
11
+ Write-Output '{}'
57
12
  }
58
-
59
- # Install if not found (only attempt once per plugin version)
60
- if (-not $Proxy -and -not (Test-Path $ProxyMarkerFile)) {
61
- Install-HooksProxy $SdkVersion | Out-Null
62
- Set-Content -Path $ProxyMarkerFile -Value $SdkVersion -ErrorAction SilentlyContinue
63
- if (Get-Command a5c-hooks-proxy -ErrorAction SilentlyContinue) {
64
- $Proxy = "a5c-hooks-proxy"
65
- } else {
66
- $localProxy = Join-Path $env:USERPROFILE ".local\bin\a5c-hooks-proxy.exe"
67
- if (Test-Path $localProxy) {
68
- $Proxy = $localProxy
69
- }
70
- }
71
- }
72
-
73
- # ---------------------------------------------------------------------------
74
- # Capture stdin and delegate to hooks-proxy
75
- # ---------------------------------------------------------------------------
76
-
77
- $InputFile = [System.IO.Path]::GetTempFileName()
78
- $input | Out-File -FilePath $InputFile -Encoding utf8
79
-
80
- $stderrLog = Join-Path $LogDir "babysitter-user-prompt-submitted-hook-stderr.log"
81
-
82
- try {
83
- if ($Proxy) {
84
- Get-Content $InputFile | & $Proxy invoke --adapter copilot --handler "babysitter hook:run --harness unified --hook-type user-prompt-submitted --json" --json 2>$stderrLog | Out-Null
85
- } else {
86
- Get-Content $InputFile | & npx -y "@a5c-ai/hooks-proxy-cli@$SdkVersion" invoke --adapter copilot --handler "babysitter hook:run --harness unified --hook-type user-prompt-submitted --json" --json 2>$stderrLog | Out-Null
87
- }
88
- } catch {}
89
-
90
- Remove-Item $InputFile -Force -ErrorAction SilentlyContinue
91
-
92
- exit 0
@@ -1,87 +1,3 @@
1
1
  #!/bin/bash
2
- # Unified userPromptSubmitted Hook for GitHub Copilot CLI
3
- # Routes through hooks-proxy for all hook execution.
4
- #
5
- # Applies density-filter compression to long user prompts.
6
- # Delegates to SDK CLI: babysitter hook:run --hook-type user-prompt-submitted
7
- #
8
- # NOTE: Output from this hook is IGNORED by Copilot CLI.
9
- # This hook is for logging and side-effects only.
10
-
11
- PLUGIN_ROOT="${COPILOT_PLUGIN_DIR:-$(cd "$(dirname "$0")/.." && pwd)}"
12
- PROXY_MARKER_FILE="${PLUGIN_ROOT}/.hooks-proxy-install-attempted"
13
-
14
- GLOBAL_ROOT="${BABYSITTER_GLOBAL_STATE_DIR:-$HOME/.a5c}"
15
- LOG_DIR="${BABYSITTER_LOG_DIR:-${GLOBAL_ROOT}/logs}"
16
- mkdir -p "$LOG_DIR" 2>/dev/null
17
-
18
- # Get required version from versions.json (used for hooks-proxy)
19
- SDK_VERSION=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('${PLUGIN_ROOT}/versions.json','utf8')).sdkVersion||'latest')}catch{console.log('latest')}" 2>/dev/null || echo "latest")
20
-
21
- # ---------------------------------------------------------------------------
22
- # Hooks-proxy install (same pattern as SDK install in session-start)
23
- # ---------------------------------------------------------------------------
24
-
25
- install_hooks_proxy() {
26
- local target_version="$1"
27
- if npm i -g "@a5c-ai/hooks-proxy-cli@${target_version}" --loglevel=error 2>/dev/null; then
28
- return 0
29
- else
30
- if npm i -g "@a5c-ai/hooks-proxy-cli@${target_version}" --prefix "$HOME/.local" --loglevel=error 2>/dev/null; then
31
- export PATH="$HOME/.local/bin:$PATH"
32
- return 0
33
- fi
34
- fi
35
- return 1
36
- }
37
-
38
- # Resolve hooks-proxy binary
39
- PROXY=""
40
- if command -v a5c-hooks-proxy &>/dev/null; then
41
- PROXY="a5c-hooks-proxy"
42
- elif [ -f "$HOME/.local/bin/a5c-hooks-proxy" ]; then
43
- PROXY="$HOME/.local/bin/a5c-hooks-proxy"
44
- fi
45
-
46
- # Install if not found (only attempt once per plugin version)
47
- if [ -z "$PROXY" ] && [ ! -f "$PROXY_MARKER_FILE" ]; then
48
- install_hooks_proxy "$SDK_VERSION"
49
- echo "$SDK_VERSION" > "$PROXY_MARKER_FILE" 2>/dev/null
50
- if command -v a5c-hooks-proxy &>/dev/null; then
51
- PROXY="a5c-hooks-proxy"
52
- elif [ -f "$HOME/.local/bin/a5c-hooks-proxy" ]; then
53
- PROXY="$HOME/.local/bin/a5c-hooks-proxy"
54
- fi
55
- fi
56
-
57
- # npx fallback if still not found
58
- if [ -z "$PROXY" ]; then
59
- PROXY="npx -y @a5c-ai/hooks-proxy-cli@${SDK_VERSION} "
60
- fi
61
-
62
- # ---------------------------------------------------------------------------
63
- # Capture stdin and delegate to hooks-proxy
64
- # ---------------------------------------------------------------------------
65
-
66
- INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/hook-user-prompt-submitted-$$.json")
67
- cat > "$INPUT_FILE"
68
-
69
- if command -v babysitter &>/dev/null; then
70
- babysitter log --type hook --label "hook:user-prompt-submitted" --message "Unified hook invoked" --source shell-hook 2>/dev/null || true
71
- fi
72
-
73
- STDERR_LOG="$LOG_DIR/babysitter-user-prompt-submitted-hook-stderr.log"
74
-
75
- $PROXY invoke \
76
- --adapter copilot \
77
- --handler "babysitter hook:run --harness unified --hook-type user-prompt-submitted --json" \
78
- --json \
79
- < "$INPUT_FILE" 2>"$STDERR_LOG" || true
80
-
81
- if command -v babysitter &>/dev/null; then
82
- babysitter log --type hook --label "hook:user-prompt-submitted" --message "Hook complete" --source shell-hook 2>/dev/null || true
83
- fi
84
-
85
- rm -f "$INPUT_FILE" 2>/dev/null
86
-
87
- exit 0
2
+ set -euo pipefail
3
+ babysitter hook:run --harness unified --hook-type user-prompt-submit --json
package/hooks.json CHANGED
@@ -4,25 +4,49 @@
4
4
  "sessionStart": [
5
5
  {
6
6
  "type": "command",
7
- "bash": "bash \"./hooks/babysitter-proxied-session-start.sh\"",
8
- "powershell": "powershell -NoProfile -ExecutionPolicy Bypass -File \"./hooks/babysitter-proxied-session-start.ps1\"",
7
+ "bash": "./hooks/babysitter-proxied-session-start.sh",
8
+ "powershell": "./hooks/babysitter-proxied-session-start.ps1",
9
9
  "timeoutSec": 30
10
10
  }
11
11
  ],
12
- "sessionEnd": [
12
+ "userPromptSubmitted": [
13
13
  {
14
14
  "type": "command",
15
- "bash": "bash \"./hooks/babysitter-proxied-session-end.sh\"",
16
- "powershell": "powershell -NoProfile -ExecutionPolicy Bypass -File \"./hooks/babysitter-proxied-session-end.ps1\"",
15
+ "bash": "./hooks/babysitter-proxied-user-prompt-submitted.sh",
16
+ "powershell": "./hooks/babysitter-proxied-user-prompt-submitted.ps1",
17
+ "timeoutSec": 15
18
+ }
19
+ ],
20
+ "preToolUse": [
21
+ {
22
+ "type": "command",
23
+ "bash": "./hooks/babysitter-proxied-pre-tool-use.sh",
24
+ "powershell": "./hooks/babysitter-proxied-pre-tool-use.ps1",
17
25
  "timeoutSec": 30
18
26
  }
19
27
  ],
20
- "userPromptSubmitted": [
28
+ "postToolUse": [
21
29
  {
22
30
  "type": "command",
23
- "bash": "bash \"./hooks/babysitter-proxied-user-prompt-submitted.sh\"",
24
- "powershell": "powershell -NoProfile -ExecutionPolicy Bypass -File \"./hooks/babysitter-proxied-user-prompt-submitted.ps1\"",
25
- "timeoutSec": 15
31
+ "bash": "./hooks/babysitter-proxied-post-tool-use.sh",
32
+ "powershell": "./hooks/babysitter-proxied-post-tool-use.ps1",
33
+ "timeoutSec": 30
34
+ }
35
+ ],
36
+ "PreCompact": [
37
+ {
38
+ "type": "command",
39
+ "bash": "./hooks/babysitter-proxied-pre-compact.sh",
40
+ "powershell": "./hooks/babysitter-proxied-pre-compact.ps1",
41
+ "timeoutSec": 30
42
+ }
43
+ ],
44
+ "sessionEnd": [
45
+ {
46
+ "type": "command",
47
+ "bash": "./hooks/babysitter-proxied-session-end.sh",
48
+ "powershell": "./hooks/babysitter-proxied-session-end.ps1",
49
+ "timeoutSec": 30
26
50
  }
27
51
  ]
28
52
  }
package/package.json CHANGED
@@ -1,50 +1,49 @@
1
1
  {
2
2
  "name": "@a5c-ai/babysitter-github",
3
- "version": "5.0.1-staging.d73033a7",
4
- "description": "Babysitter orchestration plugin for GitHub Copilot CLI with lifecycle hooks and SDK-managed process-library bootstrapping",
3
+ "version": "5.0.1-staging.daf8e165bc4a",
4
+ "description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
5
5
  "scripts": {
6
- "test": "node scripts/sync-command-surfaces.js --check && node test/cloud-agent-install.test.js",
7
- "sync:commands": "node scripts/sync-command-surfaces.js",
8
- "postinstall": "node bin/install.js",
9
- "preuninstall": "node bin/uninstall.js",
10
- "team:install": "node scripts/team-install.js",
11
6
  "deploy": "npm publish --access public",
12
- "deploy:staging": "npm publish --access public --tag staging"
7
+ "deploy:staging": "npm publish --access public --tag staging",
8
+ "plugin:install": "node bin/install.js --global",
9
+ "plugin:uninstall": "node bin/uninstall.js --global",
10
+ "team:install": "node scripts/team-install.js"
13
11
  },
14
12
  "bin": {
15
13
  "babysitter-github": "bin/cli.js"
16
14
  },
17
15
  "files": [
18
- "plugin.json",
16
+ "bin/",
19
17
  "hooks.json",
18
+ "AGENTS.md",
20
19
  "hooks/",
21
20
  "skills/",
22
- "bin/",
21
+ "commands/",
23
22
  "scripts/",
23
+ "plugin.json",
24
+ "README.md",
24
25
  "versions.json",
25
- "AGENTS.md",
26
- "commands/",
27
- ".github/",
28
- "README.md"
26
+ "package.json"
29
27
  ],
30
28
  "keywords": [
31
29
  "babysitter",
32
30
  "github-copilot",
33
- "orchestration",
34
- "ai-agent",
35
- "sdk-integration"
31
+ "orchestration"
36
32
  ],
37
33
  "author": "a5c.ai",
38
34
  "license": "MIT",
39
35
  "publishConfig": {
40
36
  "access": "public"
41
37
  },
38
+ "dependencies": {
39
+ "@a5c-ai/babysitter-sdk": "5.0.1-staging.daf8e165bc4a"
40
+ },
42
41
  "repository": {
43
42
  "type": "git",
44
- "url": "https://github.com/a5c-ai/babysitter"
43
+ "url": "git+https://github.com/a5c-ai/babysitter-github-copilot.git"
45
44
  },
46
- "homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-github#readme",
47
- "dependencies": {
48
- "@a5c-ai/babysitter-sdk": "5.0.1-staging.d73033a7"
45
+ "homepage": "https://github.com/a5c-ai/babysitter-github-copilot#readme",
46
+ "bugs": {
47
+ "url": "https://github.com/a5c-ai/babysitter-github-copilot/issues"
49
48
  }
50
49
  }
package/plugin.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "babysitter",
3
- "version": "5.0.1-staging.d73033a7",
4
- "description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval -- powered by the Babysitter SDK",
3
+ "version": "5.0.1-staging.daf8e165bc4a",
4
+ "description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
5
5
  "author": {
6
- "name": "a5c.ai",
7
- "email": "support@a5c.ai"
6
+ "name": "a5c.ai"
8
7
  },
9
8
  "license": "MIT",
10
9
  "skills": "skills/",
@@ -21,8 +20,10 @@
21
20
  "automation",
22
21
  "event-sourced",
23
22
  "hooks",
24
- "github-copilot",
23
+ "TDD",
24
+ "quality-convergence",
25
25
  "agent",
26
- "LLM"
26
+ "LLM",
27
+ "github-copilot"
27
28
  ]
28
29
  }
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { existsSync, readFileSync } from 'node:fs';
4
+
5
+ function run(command, args) {
6
+ const result = spawnSync(command, args, { encoding: 'utf8', stdio: 'inherit' });
7
+ if (result.status !== 0) process.exit(result.status || 1);
8
+ }
9
+
10
+ const branch = process.env.GITHUB_REF_NAME || 'develop';
11
+ const sha = (process.env.GITHUB_SHA || '').slice(0, 12);
12
+ const version = existsSync('package.json') ? JSON.parse(readFileSync('package.json', 'utf8')).version : JSON.parse(readFileSync('versions.json', 'utf8')).sdkVersion;
13
+ const normalized = String(version).replace(/[^0-9A-Za-z._-]/g, '-');
14
+ const tag = 'release/' + branch + '/v' + normalized + '-' + sha;
15
+ run('git', ['config', 'user.name', 'github-actions[bot]']);
16
+ run('git', ['config', 'user.email', 'github-actions[bot]@users.noreply.github.com']);
17
+ run('git', ['tag', tag]);
18
+ run('git', ['push', 'origin', tag]);
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { readFileSync } from 'node:fs';
4
+
5
+ function run(command, args, options = {}) {
6
+ const result = spawnSync(command, args, { stdio: options.stdio || 'inherit', encoding: options.encoding });
7
+ if (result.status !== 0 && !options.allowFailure) process.exit(result.status || 1);
8
+ return result;
9
+ }
10
+
11
+ function npmView(packageSpec) {
12
+ return run('npm', ['view', packageSpec, 'version'], { allowFailure: true, stdio: 'pipe', encoding: 'utf8' }).status === 0;
13
+ }
14
+
15
+ const pkg = JSON.parse(readFileSync('package.json', 'utf8'));
16
+ const ref = process.env.GITHUB_REF_NAME || '';
17
+ const branch = ref.split('/')[1] || 'develop';
18
+ const tag = branch === 'main' ? 'latest' : branch;
19
+
20
+ if (!process.env.NODE_AUTH_TOKEN) {
21
+ console.log('NODE_AUTH_TOKEN is not configured; skipping npm publish.');
22
+ process.exit(0);
23
+ }
24
+
25
+ if (npmView(pkg.name + '@' + pkg.version)) {
26
+ console.log(pkg.name + '@' + pkg.version + ' already exists; ensuring dist-tag ' + tag + '.');
27
+ run('npm', ['dist-tag', 'add', pkg.name + '@' + pkg.version, tag], { allowFailure: true });
28
+ process.exit(0);
29
+ }
30
+
31
+ for (const field of ['dependencies', 'peerDependencies', 'optionalDependencies']) {
32
+ for (const [name, version] of Object.entries(pkg[field] || {})) {
33
+ if (!name.startsWith('@a5c-ai/') || version.startsWith('^') || version.startsWith('~') || version === '*' || version.startsWith('workspace:')) continue;
34
+ if (!npmView(name + '@' + version)) {
35
+ console.log('Required internal dependency ' + name + '@' + version + ' is not published yet; skipping npm publish.');
36
+ process.exit(0);
37
+ }
38
+ }
39
+ }
40
+
41
+ run('npm', ['publish', '--access', 'public', '--tag', tag]);
@@ -1,93 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- const fs = require('fs');
5
- const path = require('path');
6
- const {
7
- copyPluginBundle,
8
- ensureGlobalProcessLibrary,
9
- ensureMarketplaceEntry,
10
- installCopilotSurface,
11
- registerCopilotPlugin,
12
- warnWindowsHooks,
13
- writeJson,
14
- } = require('../bin/install-shared');
4
+ var path = require('path');
5
+ var shared = require('../bin/install-shared');
15
6
 
16
- function parseArgs(argv) {
17
- const args = {
18
- workspace: process.cwd(),
19
- cloudAgent: false,
20
- dryRun: false,
21
- };
22
- for (let i = 2; i < argv.length; i += 1) {
23
- if (argv[i] === '--workspace' && argv[i + 1]) {
24
- args.workspace = path.resolve(argv[++i]);
25
- } else if (argv[i] === '--cloud-agent') {
26
- args.cloudAgent = true;
27
- } else if (argv[i] === '--dry-run') {
28
- args.dryRun = true;
29
- }
7
+ var workspace = process.cwd();
8
+ for (var i = 0; i < process.argv.length; i++) {
9
+ if (process.argv[i] === '--workspace' && process.argv[i + 1]) {
10
+ workspace = path.resolve(process.argv[i + 1]);
30
11
  }
31
- return args;
32
12
  }
33
13
 
34
- function main() {
35
- const args = parseArgs(process.argv);
36
- const packageRoot = path.resolve(process.env.BABYSITTER_PACKAGE_ROOT || path.join(__dirname, '..'));
37
- const workspaceRoot = args.workspace;
38
- const workspacePluginRoot = path.join(workspaceRoot, 'plugins', 'babysitter');
39
- const workspaceMarketplacePath = path.join(workspaceRoot, '.agents', 'plugins', 'marketplace.json');
40
- const workspaceCopilotDir = path.join(workspaceRoot, '.copilot');
14
+ var src = process.env.PLUGIN_PACKAGE_ROOT || path.resolve(__dirname, '..');
15
+ var dest = shared.getHomePluginRoot('workspace');
16
+ console.log('[babysitter] Team install to ' + dest);
41
17
 
42
- const installInfo = {
43
- installedAt: new Date().toISOString(),
44
- packageRoot,
45
- workspaceRoot,
46
- pluginRoot: workspacePluginRoot,
47
- marketplacePath: workspaceMarketplacePath,
48
- copilotDir: workspaceCopilotDir,
49
- };
50
-
51
- if (args.dryRun) {
52
- console.log(JSON.stringify({
53
- ok: true,
54
- dryRun: true,
55
- installInfo,
56
- }, null, 2));
57
- return;
58
- }
59
-
60
- copyPluginBundle(packageRoot, workspacePluginRoot);
61
- ensureMarketplaceEntry(workspaceMarketplacePath, workspacePluginRoot);
62
- registerCopilotPlugin(workspacePluginRoot);
63
- installCopilotSurface(packageRoot, workspaceCopilotDir);
64
- if (args.cloudAgent) {
65
- const { installCloudAgentSurface } = require('../bin/install-shared');
66
- installInfo.cloudAgent = installCloudAgentSurface(packageRoot, workspaceRoot);
67
- }
68
-
69
- const active = ensureGlobalProcessLibrary(packageRoot);
70
- installInfo.processLibraryStateFile = active.stateFile;
71
- installInfo.processLibraryRoot = active.binding?.dir || '';
72
- installInfo.processLibraryCloneDir = active.defaultSpec?.cloneDir || '';
73
-
74
- const outDir = path.join(workspaceRoot, '.a5c', 'team');
75
- fs.mkdirSync(outDir, { recursive: true });
76
- writeJson(path.join(outDir, 'install.json'), installInfo);
77
-
78
- const profilePath = path.join(outDir, 'profile.json');
79
- if (!fs.existsSync(profilePath)) {
80
- writeJson(profilePath, {
81
- teamName: 'default',
82
- pluginRoot: workspacePluginRoot,
83
- marketplacePath: workspaceMarketplacePath,
84
- copilotDir: workspaceCopilotDir,
85
- processLibraryLookupCommand: 'babysitter process-library:active --json',
86
- });
87
- }
88
-
89
- warnWindowsHooks();
90
- console.log('[team-install] complete');
18
+ shared.copyPluginBundle(src, dest);
19
+ if (typeof shared.harnessTeamInstall === 'function') {
20
+ shared.harnessTeamInstall(src, dest, workspace);
91
21
  }
92
-
93
- main();
22
+ shared.runPostInstall(dest);
23
+ console.log('[babysitter] Team install complete.');
@@ -1,14 +1,24 @@
1
1
  ---
2
2
  name: babysit
3
- description: >-
4
- Orchestrate via @babysitter. Use this skill when asked to babysit a run,
5
- orchestrate a process or whenever it is called explicitly. (babysit,
6
- babysitter, orchestrate, orchestrate a run, workflow, etc.)
3
+ description: Execute via @babysitter. Use this skill when asked to babysit a task, do anything that is structured process-driven (even a loop) or whenever it is called explicitly. (babysit, babysitter, with a process, orchestrate, orchestrate a run, workflow, loop until, etc.)
4
+ allowed-tools: Read, Grep, Write, Task, Bash, Edit, Grep, Glob, WebFetch, WebSearch, Search, AskUserQuestion, TodoWrite, TodoRead, Skill, BashOutput, KillShell, MultiEdit, LS
5
+ version: 0.1.3
7
6
  ---
8
7
 
9
8
  # babysit
10
9
 
11
- Orchestrate `.a5c/runs/<runId>/` through iterative execution.
10
+ Follow the commands below exactly. but apply judgement and creativity to get the job done. no matter how small or simple the task may seem, you must use the babysitter SDK and run lifecycle to execute it. This is non-negotiable. If you are asked to do something that seems like it could be done with a simple tool call, you must still use the babysitter SDK to create a run, define tasks, execute them, and complete the run. This is how you will learn and demonstrate mastery of the babysitter system. Always follow the full process, even for trivial tasks.
11
+
12
+ Subagents that need a scratch checkout or working directory must create it under
13
+ `/tmp/<descriptive-name>/`, not under `.a5c/runs/<runId>/work`. Before returning
14
+ deliverables, validate that no run-dir worktree was left behind, for example:
15
+
16
+ ```bash
17
+ find .a5c/runs -maxdepth 3 -name work -type d -print
18
+ ```
19
+
20
+ That command should print nothing. If it prints a non-empty work directory, move
21
+ or remove only the scratch data you created before returning.
12
22
 
13
23
  ## Dependencies
14
24
 
@@ -17,13 +27,19 @@ Orchestrate `.a5c/runs/<runId>/` through iterative execution.
17
27
  Read the SDK version from `versions.json` to ensure version compatibility:
18
28
 
19
29
  ```bash
20
- SDK_VERSION=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('${PLUGIN_ROOT}/versions.json','utf8')).sdkVersion||'latest')}catch{console.log('latest')}")
21
- npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION
22
-
23
- CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
30
+ SDK_VERSION=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('${COPILOT_PLUGIN_DIR}/versions.json','utf8')).sdkVersion||'latest')}catch{console.log('latest')}")
31
+ npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION || npm i -g @a5c-ai/babysitter-sdk@latest
32
+
33
+ if command -v babysitter >/dev/null 2>&1 && babysitter --version >/dev/null 2>&1; then
34
+ CLI="babysitter"
35
+ else
36
+ CLI="npm exec --yes --package @a5c-ai/babysitter-sdk@$SDK_VERSION -- babysitter"
37
+ fi
24
38
  ```
25
39
 
26
- If `babysitter` is already installed globally at the correct version, you may use `CLI="babysitter"` instead.
40
+ If the pinned version fails to install (e.g. not yet published), the fallback installs `latest`.
41
+
42
+ If a stale or broken global shim fails with `MODULE_NOT_FOUND`, repair it with `npm rm -g @a5c-ai/babysitter @a5c-ai/babysitter-sdk && npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION`, then re-run `babysitter --version`.
27
43
 
28
44
  ### jq
29
45
 
@@ -31,46 +47,16 @@ Make sure `jq` is installed and available in the path. If not, install it.
31
47
 
32
48
  ## Instructions
33
49
 
34
- Run the following command to get full orchestration instructions:
50
+ Run the following command to get full instructions:
35
51
 
36
52
  ```bash
37
- $CLI instructions:babysit-skill --harness github-copilot --json
53
+ $CLI instructions:babysit-skill --harness github-copilot --interactive
38
54
  ```
39
55
 
40
- Follow the instructions returned by the command above to orchestrate the run.
41
-
42
- ## GitHub Copilot CLI -- In-Turn Loop Model
43
-
44
- **IMPORTANT**: Unlike Claude Code, GitHub Copilot CLI does NOT have a Stop hook
45
- that can drive the orchestration loop between turns. The `sessionEnd` hook output
46
- is ignored and cannot block or restart the session.
47
-
48
- Therefore, you MUST use **in-turn iteration**: run the full orchestration loop
49
- within a single session turn. The pattern is:
50
-
51
- 1. `$CLI run:iterate --json` -- get pending actions
52
- 2. For each pending action: execute it (run tasks, post results via `task:post`)
53
- 3. `$CLI run:iterate --json` -- check for more pending actions
54
- 4. Repeat steps 2-3 until run completes or reaches a breakpoint requiring user input
55
- 5. If a breakpoint requires user input, ask the user and post the response, then continue iterating
56
-
57
- All iteration happens within the same turn -- do NOT rely on hooks to re-enter
58
- the orchestration loop. The agent drives the loop directly by calling
59
- `run:iterate` repeatedly until completion.
60
-
61
- ### Loop Example
56
+ For non-interactive mode (running with `-p` flag or no AskUserQuestion tool):
62
57
 
63
58
  ```bash
64
- # Initial iterate
65
- RESULT=$($CLI run:iterate --run-id "$RUN_ID" --json)
66
- STATUS=$(echo "$RESULT" | jq -r '.status')
67
-
68
- while [ "$STATUS" != "completed" ] && [ "$STATUS" != "failed" ]; do
69
- # Process pending actions from RESULT
70
- # ... execute tasks, post results ...
71
-
72
- # Iterate again
73
- RESULT=$($CLI run:iterate --run-id "$RUN_ID" --json)
74
- STATUS=$(echo "$RESULT" | jq -r '.status')
75
- done
59
+ $CLI instructions:babysit-skill --harness github-copilot --no-interactive
76
60
  ```
61
+
62
+ Follow the instructions returned by the command above to orchestrate the run.