@a5c-ai/babysitter-antigravity-cli 5.1.1-staging.0ad6ac75ae4a
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 +204 -0
- package/bin/cli.js +96 -0
- package/bin/install-shared.js +219 -0
- package/bin/install.js +30 -0
- package/bin/uninstall.js +24 -0
- package/commands/assimilate.md +37 -0
- package/commands/blueprints.md +64 -0
- package/commands/call.md +11 -0
- package/commands/check-forbidden-markers.md +68 -0
- package/commands/cleanup.md +48 -0
- package/commands/contrib.md +33 -0
- package/commands/doctor.md +511 -0
- package/commands/forever.md +7 -0
- package/commands/help.md +246 -0
- package/commands/observe.md +17 -0
- package/commands/plan.md +17 -0
- package/commands/plugins.md +22 -0
- package/commands/project-install.md +17 -0
- package/commands/resume.md +8 -0
- package/commands/retrospect.md +55 -0
- package/commands/user-install.md +17 -0
- package/commands/yolo.md +11 -0
- package/hooks/babysitter-proxied-after-agent.sh +3 -0
- package/hooks/babysitter-proxied-post-tool-use.sh +3 -0
- package/hooks/babysitter-proxied-pre-tool-use.sh +3 -0
- package/hooks/babysitter-proxied-session-end.sh +3 -0
- package/hooks/babysitter-proxied-session-idle.sh +3 -0
- package/hooks/babysitter-proxied-session-start.sh +11 -0
- package/hooks/hooks.json +83 -0
- package/package.json +47 -0
- package/plugin.json +37 -0
- package/scripts/create-release-tag.mjs +18 -0
- package/scripts/publish-from-tag.mjs +41 -0
- package/scripts/team-install.js +23 -0
- package/skills/babysit/SKILL.md +62 -0
- package/versions.json +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# @a5c-ai/babysitter-antigravity
|
|
2
|
+
|
|
3
|
+
Babysitter integration package for Antigravity CLI.
|
|
4
|
+
|
|
5
|
+
Antigravity CLI is Google's successor to Gemini CLI. It uses a workflow-driven
|
|
6
|
+
hook model and a SKILL.md plugin system. It is model-agnostic, supporting
|
|
7
|
+
Gemini, Claude, and GPT providers.
|
|
8
|
+
|
|
9
|
+
This package ships an Antigravity CLI plugin bundle:
|
|
10
|
+
|
|
11
|
+
- `SKILL.md` — Antigravity-native skill manifest with YAML frontmatter
|
|
12
|
+
- `plugin.json` — Babysitter plugin manifest
|
|
13
|
+
- `workflow.json` — Workflow orchestration descriptor
|
|
14
|
+
- `mcp.json` — MCP config for multi-provider tool integration
|
|
15
|
+
- `commands/` — Slash command definitions for all babysitter workflows
|
|
16
|
+
- `hooks/` — Workflow-driven hook scripts
|
|
17
|
+
- `bin/cli.js` — `babysitter-antigravity` installer CLI
|
|
18
|
+
|
|
19
|
+
It uses the Babysitter SDK CLI and the shared `~/.a5c` process-library state.
|
|
20
|
+
The plugin registers workflow-driven hooks and commands so Antigravity CLI can
|
|
21
|
+
drive the Babysitter orchestration loop from within the agent session.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
Install the Babysitter CLI once:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g @a5c-ai/babysitter
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Install the Antigravity plugin through the SDK helper:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Global install
|
|
35
|
+
babysitter harness:install-plugin antigravity-cli
|
|
36
|
+
|
|
37
|
+
# Workspace install
|
|
38
|
+
babysitter harness:install-plugin antigravity-cli --workspace /path/to/project
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
You can also run the published package installer directly:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx --yes @a5c-ai/babysitter-antigravity install --global
|
|
45
|
+
npx --yes @a5c-ai/babysitter-antigravity install --workspace /path/to/project
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For development, use a symlink instead of copying files:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
babysitter-antigravity install --symlink
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
After installation, restart Antigravity CLI to activate the plugin.
|
|
55
|
+
|
|
56
|
+
## How It Works
|
|
57
|
+
|
|
58
|
+
The plugin implements a workflow-driven orchestration loop:
|
|
59
|
+
|
|
60
|
+
1. `SessionStart` fires when a new Antigravity CLI session begins. It ensures
|
|
61
|
+
the correct SDK CLI version is installed (pinned via `versions.json`) and
|
|
62
|
+
initializes session state under `~/.a5c/state/`.
|
|
63
|
+
|
|
64
|
+
2. The `SKILL.md` context file is loaded into every session, instructing the
|
|
65
|
+
agent on the full 8-step orchestration workflow -- from interviewing the user
|
|
66
|
+
and creating a process definition through iterating effects and posting results.
|
|
67
|
+
|
|
68
|
+
3. The agent performs **one orchestration phase per turn**, then stops.
|
|
69
|
+
|
|
70
|
+
4. `AfterAgent` fires after every agent turn. It checks whether a babysitter run
|
|
71
|
+
is bound to the current session. If the run is not yet complete, the hook
|
|
72
|
+
returns `{"decision":"block","reason":"...","systemMessage":"..."}` to keep
|
|
73
|
+
the session alive and inject the next iteration prompt. Once the agent emits
|
|
74
|
+
`<promise>COMPLETION_PROOF</promise>`, the hook allows the session to exit.
|
|
75
|
+
|
|
76
|
+
## Hook Types
|
|
77
|
+
|
|
78
|
+
| Hook | Event | Type | Purpose |
|
|
79
|
+
|------|-------|------|---------|
|
|
80
|
+
| Session initialization | `SessionStart` | workflow | Installs the correct SDK version, creates session state |
|
|
81
|
+
| Continuation loop | `AfterAgent` | workflow | Blocks session exit and drives the orchestration loop until the run completes |
|
|
82
|
+
|
|
83
|
+
Both hooks delegate to the SDK CLI via `babysitter hook:run` for all business
|
|
84
|
+
logic. The workflow-driven hook model replaces the shell-hook scripts used by
|
|
85
|
+
Gemini CLI.
|
|
86
|
+
|
|
87
|
+
## Differences from Gemini CLI
|
|
88
|
+
|
|
89
|
+
| Feature | Gemini CLI | Antigravity CLI |
|
|
90
|
+
|---------|-----------|----------------|
|
|
91
|
+
| Hook model | Shell-hook scripts | Workflow-driven hooks |
|
|
92
|
+
| Plugin manifest | `gemini-extension.json` | `SKILL.md` (YAML frontmatter) |
|
|
93
|
+
| Model support | Gemini only | Gemini, Claude, GPT (model-agnostic) |
|
|
94
|
+
| Tool integration | Native | MCP-based multi-provider |
|
|
95
|
+
| Orchestration | Extension-based | Workflow + SKILL.md |
|
|
96
|
+
|
|
97
|
+
## Available Commands
|
|
98
|
+
|
|
99
|
+
All commands follow the orchestration workflow described in `SKILL.md`.
|
|
100
|
+
Invoke them in Antigravity CLI with `/babysitter:<command>`.
|
|
101
|
+
|
|
102
|
+
### Primary Orchestration Commands
|
|
103
|
+
|
|
104
|
+
| Command | Description |
|
|
105
|
+
|---------|-------------|
|
|
106
|
+
| `/babysitter:call [instructions]` | Start a babysitter-orchestrated run |
|
|
107
|
+
| `/babysitter:plan [instructions]` | Generate a detailed execution plan without running anything |
|
|
108
|
+
| `/babysitter:yolo [instructions]` | Start a run in fully autonomous mode |
|
|
109
|
+
| `/babysitter:forever [instructions]` | Start a run that loops indefinitely |
|
|
110
|
+
| `/babysitter:resume [run-id]` | Resume a paused or interrupted run |
|
|
111
|
+
|
|
112
|
+
### Diagnostic and Analysis Commands
|
|
113
|
+
|
|
114
|
+
| Command | Description |
|
|
115
|
+
|---------|-------------|
|
|
116
|
+
| `/babysitter:doctor [run-id]` | Run a health check on a run |
|
|
117
|
+
| `/babysitter:retrospect [run-id...]` | Analyze completed runs and suggest improvements |
|
|
118
|
+
|
|
119
|
+
### Lifecycle Management Commands
|
|
120
|
+
|
|
121
|
+
| Command | Description |
|
|
122
|
+
|---------|-------------|
|
|
123
|
+
| `/babysitter:assimilate [target]` | Convert an external methodology into native babysitter process definitions |
|
|
124
|
+
| `/babysitter:cleanup [--dry-run]` | Aggregate insights then remove old run data |
|
|
125
|
+
| `/babysitter:observe` | Launch the real-time observer dashboard |
|
|
126
|
+
|
|
127
|
+
### Setup Commands
|
|
128
|
+
|
|
129
|
+
| Command | Description |
|
|
130
|
+
|---------|-------------|
|
|
131
|
+
| `/babysitter:user-install` | First-time onboarding and user profile setup |
|
|
132
|
+
| `/babysitter:project-install` | Onboard a project for babysitter orchestration |
|
|
133
|
+
|
|
134
|
+
### Plugin and Community Commands
|
|
135
|
+
|
|
136
|
+
| Command | Description |
|
|
137
|
+
|---------|-------------|
|
|
138
|
+
| `/babysitter:blueprints [action]` | Manage Babysitter blueprints |
|
|
139
|
+
| `/babysitter:contrib [feedback]` | Submit feedback or contribute to the babysitter project |
|
|
140
|
+
| `/babysitter:help [topic]` | Show help for babysitter commands and workflows |
|
|
141
|
+
|
|
142
|
+
## Configuration
|
|
143
|
+
|
|
144
|
+
| Source | Purpose |
|
|
145
|
+
|--------|---------|
|
|
146
|
+
| `versions.json` | Pins the required `@a5c-ai/babysitter-sdk` version |
|
|
147
|
+
| `SKILL.md` | Antigravity-native skill manifest with YAML frontmatter metadata |
|
|
148
|
+
| `plugin.json` | Babysitter plugin manifest declaring hooks, commands, and harness |
|
|
149
|
+
| `workflow.json` | Workflow orchestration descriptor for hook execution graph |
|
|
150
|
+
| `mcp.json` | MCP config for multi-provider tool integration |
|
|
151
|
+
| `ANTIGRAVITY_SKILL_PATH` env var | Path to the installed plugin root |
|
|
152
|
+
| `BABYSITTER_LOG_DIR` env var | Override the log directory (defaults to `~/.a5c/logs`) |
|
|
153
|
+
| `~/.a5c/state/` | Session state directory |
|
|
154
|
+
| `~/.a5c/user-profile.json` | User profile for personalizing orchestration |
|
|
155
|
+
|
|
156
|
+
## Verification
|
|
157
|
+
|
|
158
|
+
Verify the installed plugin bundle:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
babysitter-antigravity status --global
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Verify the SDK CLI is available:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
babysitter --version
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Verify the active process-library binding:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
babysitter process-library:active --json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Troubleshooting
|
|
177
|
+
|
|
178
|
+
### SDK CLI not found after session start
|
|
179
|
+
|
|
180
|
+
The SessionStart hook installs the SDK automatically. If permissions prevent
|
|
181
|
+
a global install, check the session-start log:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
cat ~/.a5c/logs/babysitter-session-start-hook.log
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
If the CLI is still missing, install it manually:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npm install -g @a5c-ai/babysitter-sdk
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Hook logs location
|
|
194
|
+
|
|
195
|
+
| Log file | Contents |
|
|
196
|
+
|----------|----------|
|
|
197
|
+
| `~/.a5c/logs/babysitter-session-start-hook.log` | SessionStart hook output |
|
|
198
|
+
| `~/.a5c/logs/babysitter-session-start-hook-stderr.log` | SessionStart SDK stderr |
|
|
199
|
+
| `~/.a5c/logs/babysitter-after-agent-hook.log` | AfterAgent hook output |
|
|
200
|
+
| `~/.a5c/logs/babysitter-after-agent-hook-stderr.log` | AfterAgent SDK stderr |
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
8
|
+
let shared;
|
|
9
|
+
try { shared = require('./install-shared'); } catch {}
|
|
10
|
+
|
|
11
|
+
function printUsage() {
|
|
12
|
+
console.error([
|
|
13
|
+
'Usage:',
|
|
14
|
+
' babysitter-antigravity-cli install [--global]',
|
|
15
|
+
' babysitter-antigravity-cli install --workspace [path]',
|
|
16
|
+
' babysitter-antigravity-cli uninstall',
|
|
17
|
+
].join('\n'));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function parseInstallArgs(argv) {
|
|
21
|
+
let scope = 'global';
|
|
22
|
+
let workspace = null;
|
|
23
|
+
const passthrough = [];
|
|
24
|
+
|
|
25
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
26
|
+
const arg = argv[i];
|
|
27
|
+
if (arg === '--global') {
|
|
28
|
+
scope = 'global';
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (arg === '--workspace') {
|
|
32
|
+
scope = 'workspace';
|
|
33
|
+
const next = argv[i + 1];
|
|
34
|
+
if (next && !next.startsWith('-')) {
|
|
35
|
+
workspace = path.resolve(next);
|
|
36
|
+
i += 1;
|
|
37
|
+
} else {
|
|
38
|
+
workspace = process.cwd();
|
|
39
|
+
}
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
passthrough.push(arg);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return { scope, workspace, passthrough };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function runNodeScript(scriptPath, args, extraEnv = {}) {
|
|
49
|
+
const result = spawnSync(process.execPath, [scriptPath, ...args], {
|
|
50
|
+
cwd: process.cwd(),
|
|
51
|
+
stdio: 'inherit',
|
|
52
|
+
env: { ...process.env, ...extraEnv },
|
|
53
|
+
});
|
|
54
|
+
process.exitCode = result.status ?? 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function main() {
|
|
58
|
+
const [command, ...rest] = process.argv.slice(2);
|
|
59
|
+
if (!command || command === '--help' || command === '-h' || command === 'help') {
|
|
60
|
+
printUsage();
|
|
61
|
+
process.exitCode = command ? 0 : 1;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (command === 'install') {
|
|
66
|
+
if (shared && typeof shared.harnessCliRoute === 'function' && shared.harnessCliRoute(rest, PACKAGE_ROOT, runNodeScript)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const parsed = parseInstallArgs(rest);
|
|
70
|
+
if (parsed.scope === 'workspace') {
|
|
71
|
+
const args = [];
|
|
72
|
+
if (parsed.workspace) {
|
|
73
|
+
args.push('--workspace', parsed.workspace);
|
|
74
|
+
}
|
|
75
|
+
args.push(...parsed.passthrough);
|
|
76
|
+
runNodeScript(
|
|
77
|
+
path.join(PACKAGE_ROOT, 'scripts', 'team-install.js'),
|
|
78
|
+
args,
|
|
79
|
+
{ PLUGIN_PACKAGE_ROOT: PACKAGE_ROOT },
|
|
80
|
+
);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
runNodeScript(path.join(PACKAGE_ROOT, 'bin', 'install.js'), parsed.passthrough);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (command === 'uninstall') {
|
|
88
|
+
runNodeScript(path.join(PACKAGE_ROOT, 'bin', 'uninstall.js'), rest);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
printUsage();
|
|
93
|
+
process.exitCode = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
main();
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const { spawnSync } = require('child_process');
|
|
7
|
+
|
|
8
|
+
const PLUGIN_NAME = "babysitter";
|
|
9
|
+
const PLUGIN_CATEGORY = 'Coding';
|
|
10
|
+
|
|
11
|
+
function getUserHome() {
|
|
12
|
+
return os.homedir();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getHarnessHome() {
|
|
16
|
+
return path.join(os.homedir(), '.a5c');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function getHomePluginRoot(scope) {
|
|
20
|
+
if (scope === 'workspace') return path.join(process.cwd(), '.a5c', 'plugins', PLUGIN_NAME);
|
|
21
|
+
return path.join(path.join(getHarnessHome(), 'plugins'), PLUGIN_NAME);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getHomeMarketplacePath() {
|
|
25
|
+
return path.join(getHarnessHome(), 'plugins', 'marketplace.json');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function writeFileIfChanged(filePath, contents) {
|
|
29
|
+
try {
|
|
30
|
+
const existing = fs.readFileSync(filePath, 'utf8');
|
|
31
|
+
if (existing === contents) return false;
|
|
32
|
+
} catch (e) { process.stderr.write('[extensions-adapter] file read failed for ' + filePath + ', overwriting: ' + (e instanceof Error ? e.message : String(e)) + '\n'); }
|
|
33
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
34
|
+
fs.writeFileSync(filePath, contents);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function copyRecursive(src, dest) {
|
|
39
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
40
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
41
|
+
if (entry.name === 'node_modules' || entry.name === '.git') continue;
|
|
42
|
+
const s = path.join(src, entry.name);
|
|
43
|
+
const d = path.join(dest, entry.name);
|
|
44
|
+
if (entry.isDirectory()) {
|
|
45
|
+
copyRecursive(s, d);
|
|
46
|
+
} else {
|
|
47
|
+
fs.copyFileSync(s, d);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function copyPluginBundle(packageRoot, pluginRoot) {
|
|
53
|
+
const bundleEntries = fs.readdirSync(packageRoot).filter(
|
|
54
|
+
e => !['node_modules', '.git', 'test', 'dist'].includes(e)
|
|
55
|
+
);
|
|
56
|
+
fs.mkdirSync(pluginRoot, { recursive: true });
|
|
57
|
+
for (const entry of bundleEntries) {
|
|
58
|
+
const src = path.join(packageRoot, entry);
|
|
59
|
+
const dest = path.join(pluginRoot, entry);
|
|
60
|
+
const stat = fs.statSync(src);
|
|
61
|
+
if (stat.isDirectory()) {
|
|
62
|
+
copyRecursive(src, dest);
|
|
63
|
+
} else {
|
|
64
|
+
fs.copyFileSync(src, dest);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function readJson(filePath) {
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
72
|
+
} catch {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function writeJson(filePath, value) {
|
|
78
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
79
|
+
fs.writeFileSync(filePath, JSON.stringify(value, null, 2) + '\n');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function ensureExecutable(filePath) {
|
|
83
|
+
try {
|
|
84
|
+
fs.chmodSync(filePath, 0o755);
|
|
85
|
+
} catch (e) { process.stderr.write('[extensions-adapter] chmod failed for ' + filePath + ': ' + (e instanceof Error ? e.message : String(e)) + '\n'); }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function normalizeMarketplaceSourcePath(source, marketplacePath) {
|
|
89
|
+
if (typeof source === 'string') {
|
|
90
|
+
return path.relative(path.dirname(marketplacePath), source).replace(/\\/g, '/');
|
|
91
|
+
}
|
|
92
|
+
return source;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function ensureMarketplaceEntry(marketplacePath, pluginRoot) {
|
|
96
|
+
let marketplace = readJson(marketplacePath) || {
|
|
97
|
+
name: "a5c.ai",
|
|
98
|
+
plugins: [],
|
|
99
|
+
};
|
|
100
|
+
if (!Array.isArray(marketplace.plugins)) marketplace.plugins = [];
|
|
101
|
+
const idx = marketplace.plugins.findIndex(p => p.name === PLUGIN_NAME);
|
|
102
|
+
const relSource = './' + normalizeMarketplaceSourcePath(pluginRoot, marketplacePath);
|
|
103
|
+
const entry = {
|
|
104
|
+
name: PLUGIN_NAME,
|
|
105
|
+
source: relSource,
|
|
106
|
+
description: "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
|
|
107
|
+
version: "5.1.1-staging.0ad6ac75ae4a",
|
|
108
|
+
author: { name: "a5c.ai" },
|
|
109
|
+
};
|
|
110
|
+
if (idx >= 0) marketplace.plugins[idx] = entry;
|
|
111
|
+
else marketplace.plugins.push(entry);
|
|
112
|
+
writeJson(marketplacePath, marketplace);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function removeMarketplaceEntry(marketplacePath) {
|
|
116
|
+
const marketplace = readJson(marketplacePath);
|
|
117
|
+
if (!marketplace || !Array.isArray(marketplace.plugins)) return;
|
|
118
|
+
marketplace.plugins = marketplace.plugins.filter(p => p.name !== PLUGIN_NAME);
|
|
119
|
+
writeJson(marketplacePath, marketplace);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function warnWindowsHooks() {
|
|
123
|
+
if (process.platform === 'win32') {
|
|
124
|
+
console.warn('[' + PLUGIN_NAME + '] Windows detected — shell hooks (.sh) require Git Bash or WSL.');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function runPostInstall(pluginRoot) {
|
|
129
|
+
const postInstall = path.join(pluginRoot, 'scripts', 'post-install.js');
|
|
130
|
+
if (fs.existsSync(postInstall)) {
|
|
131
|
+
spawnSync(process.execPath, [postInstall], {
|
|
132
|
+
cwd: pluginRoot, stdio: 'inherit',
|
|
133
|
+
env: { ...process.env, PLUGIN_ROOT: pluginRoot, CLAUDE_PLUGIN_ROOT: pluginRoot },
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function getGlobalStateDir() {
|
|
139
|
+
return process.env.BABYSITTER_GLOBAL_STATE_DIR || path.join(getUserHome(), '.a5c');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function resolveCliCommand(packageRoot) {
|
|
143
|
+
try {
|
|
144
|
+
const result = spawnSync('babysitter', ['--version'], { stdio: 'pipe', timeout: 10000 });
|
|
145
|
+
if (result.status === 0) return 'babysitter';
|
|
146
|
+
} catch {}
|
|
147
|
+
const versionsPath = path.join(packageRoot, 'versions.json');
|
|
148
|
+
const versions = readJson(versionsPath) || {};
|
|
149
|
+
const ver = versions.sdkVersion || 'latest';
|
|
150
|
+
return `npm exec --yes --package @a5c-ai/babysitter-sdk@${ver} -- babysitter`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function runCli(packageRoot, cliArgs, options = {}) {
|
|
154
|
+
const cmd = resolveCliCommand(packageRoot);
|
|
155
|
+
const parts = cmd.split(' ');
|
|
156
|
+
const result = spawnSync(parts[0], [...parts.slice(1), ...cliArgs], {
|
|
157
|
+
stdio: options.stdio || 'inherit',
|
|
158
|
+
timeout: options.timeout || 120000,
|
|
159
|
+
cwd: options.cwd || process.cwd(),
|
|
160
|
+
env: { ...process.env, ...options.env },
|
|
161
|
+
});
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function ensureGlobalProcessLibrary(packageRoot) {
|
|
166
|
+
const stateDir = getGlobalStateDir();
|
|
167
|
+
const activeFile = path.join(stateDir, 'active', 'process-library.json');
|
|
168
|
+
let active = readJson(activeFile);
|
|
169
|
+
if (active && active.binding && active.binding.dir) {
|
|
170
|
+
return active;
|
|
171
|
+
}
|
|
172
|
+
const defaultSpec = readJson(path.join(stateDir, 'process-library-defaults.json'));
|
|
173
|
+
const cloneDir = defaultSpec && defaultSpec.cloneDir
|
|
174
|
+
? defaultSpec.cloneDir
|
|
175
|
+
: path.join(stateDir, 'process-library', PLUGIN_NAME + '-repo');
|
|
176
|
+
runCli(packageRoot, [
|
|
177
|
+
'process-library:clone',
|
|
178
|
+
'--dir', cloneDir,
|
|
179
|
+
'--state-dir', stateDir,
|
|
180
|
+
'--json',
|
|
181
|
+
], { stdio: 'pipe' });
|
|
182
|
+
runCli(packageRoot, [
|
|
183
|
+
'process-library:use',
|
|
184
|
+
'--dir', cloneDir,
|
|
185
|
+
'--state-dir', stateDir,
|
|
186
|
+
'--json',
|
|
187
|
+
], { stdio: 'pipe' });
|
|
188
|
+
active = readJson(activeFile);
|
|
189
|
+
return {
|
|
190
|
+
binding: active && active.binding ? active.binding : { dir: cloneDir },
|
|
191
|
+
defaultSpec: defaultSpec || { cloneDir },
|
|
192
|
+
stateFile: activeFile,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
module.exports = {
|
|
198
|
+
PLUGIN_NAME,
|
|
199
|
+
PLUGIN_CATEGORY,
|
|
200
|
+
getUserHome,
|
|
201
|
+
getHarnessHome,
|
|
202
|
+
getHomePluginRoot,
|
|
203
|
+
getHomeMarketplacePath,
|
|
204
|
+
writeFileIfChanged,
|
|
205
|
+
copyRecursive,
|
|
206
|
+
copyPluginBundle,
|
|
207
|
+
readJson,
|
|
208
|
+
writeJson,
|
|
209
|
+
ensureExecutable,
|
|
210
|
+
normalizeMarketplaceSourcePath,
|
|
211
|
+
ensureMarketplaceEntry,
|
|
212
|
+
removeMarketplaceEntry,
|
|
213
|
+
warnWindowsHooks,
|
|
214
|
+
runPostInstall,
|
|
215
|
+
getGlobalStateDir,
|
|
216
|
+
resolveCliCommand,
|
|
217
|
+
runCli,
|
|
218
|
+
ensureGlobalProcessLibrary,
|
|
219
|
+
};
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const shared = require('./install-shared');
|
|
6
|
+
|
|
7
|
+
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
8
|
+
|
|
9
|
+
function main() {
|
|
10
|
+
const pluginRoot = shared.getHomePluginRoot();
|
|
11
|
+
const marketplacePath = shared.getHomeMarketplacePath();
|
|
12
|
+
|
|
13
|
+
console.log(`[${shared.PLUGIN_NAME}] Installing plugin to ${pluginRoot}`);
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
shared.copyPluginBundle(PACKAGE_ROOT, pluginRoot);
|
|
17
|
+
shared.ensureMarketplaceEntry(marketplacePath, pluginRoot);
|
|
18
|
+
if (typeof shared.harnessInstall === 'function') {
|
|
19
|
+
shared.harnessInstall(PACKAGE_ROOT, pluginRoot);
|
|
20
|
+
}
|
|
21
|
+
shared.runPostInstall && shared.runPostInstall(pluginRoot);
|
|
22
|
+
console.log(`[${shared.PLUGIN_NAME}] Installation complete!`);
|
|
23
|
+
console.log(`[${shared.PLUGIN_NAME}] Restart your IDE/CLI to pick up the plugin.`);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
console.error(`[${shared.PLUGIN_NAME}] Failed to install: ${err.message}`);
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
main();
|
package/bin/uninstall.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const shared = require('./install-shared');
|
|
6
|
+
|
|
7
|
+
function main() {
|
|
8
|
+
const pluginRoot = shared.getHomePluginRoot();
|
|
9
|
+
|
|
10
|
+
if (!fs.existsSync(pluginRoot)) {
|
|
11
|
+
console.log(`[${shared.PLUGIN_NAME}] Plugin not installed at ${pluginRoot}`);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
fs.rmSync(pluginRoot, { recursive: true, force: true });
|
|
17
|
+
console.log(`[${shared.PLUGIN_NAME}] Uninstalled from ${pluginRoot}`);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
main();
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Assimilate an external methodology, harness, or specification into babysitter process definitions with skills and agents.
|
|
3
|
+
argument-hint: Target to assimilate (e.g. repo URL, harness name, or spec path)
|
|
4
|
+
allowed-tools: Read, Grep, Write, Task, Bash, Edit, Grep, Glob, WebFetch, WebSearch, Search, AskUserQuestion, TodoWrite, TodoRead, Skill, BashOutput, KillShell, MultiEdit, LS
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
|
|
8
|
+
|
|
9
|
+
Use the assimilation domain processes from the active process library to convert external sources into well-defined babysitter process definitions with accompanying skills/ and agents/ directories.
|
|
10
|
+
|
|
11
|
+
If the workspace does not already have an active process-library binding, initialize it first through the shared global SDK binding:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
babysitter process-library:active --json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Run the process after formalizing it.
|
|
18
|
+
|
|
19
|
+
Available assimilation workflows:
|
|
20
|
+
- **methodology-assimilation** (`specializations/meta/assimilation/workflows/methodology-assimilation`) - Learns an external methodology from its repo and converts procedural instructions, commands, and manual flows into babysitter processes with refactored skills and agents. Supports output as methodology or specialization.
|
|
21
|
+
- **harness integration** (`specializations/meta/assimilation/harness/*`) - Integrates babysitter SDK with a specific AI coding harness (generic, codex, opencode, gemini-cli, openclaw, antigravity).
|
|
22
|
+
|
|
23
|
+
During the interview phase, determine which assimilation workflow to use based on the user's target:
|
|
24
|
+
- If the target is a **repo URL or methodology name** then use the methodology-assimilation workflow.
|
|
25
|
+
- If the target is a **harness name** (e.g. codex, opencode, antigravity) then use the matching harness process.
|
|
26
|
+
- If the target is a **specification or other source** then adapt the methodology-assimilation workflow for the spec format.
|
|
27
|
+
- If unclear, ask the user to clarify the assimilation target and type.
|
|
28
|
+
|
|
29
|
+
## After Assimilation: Contribute Back
|
|
30
|
+
|
|
31
|
+
After successfully assimilating a methodology or harness integration, prompt the user to share it with the community. The assimilated process definitions, skills, and agents could benefit other babysitter users:
|
|
32
|
+
|
|
33
|
+
- **Completed a methodology assimilation**: `/babysitter:contrib library contribution: assimilated [methodology-name] into babysitter process definitions`
|
|
34
|
+
- **Completed a harness integration**: `/babysitter:contrib library contribution: [harness-name] harness integration`
|
|
35
|
+
- **Hit issues during assimilation** (e.g. unsupported patterns, missing SDK features): `/babysitter:contrib bug report: assimilation of [target] failed because [description]` or `/babysitter:contrib feature request: [what the SDK needs to support]`
|
|
36
|
+
|
|
37
|
+
Even just reporting that an assimilation didn't work well helps improve babysitter for everyone.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: manage Babysitter blueprints. Use this command to list installed blueprints, browse marketplaces, install, update, uninstall, configure, or create a new blueprint.
|
|
3
|
+
argument-hint: Blueprint action and options.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
This command installs and manages Babysitter blueprints. A blueprint is a version-managed package of contextual instructions or deterministic Babysitter processes, not a conventional software plugin.
|
|
7
|
+
|
|
8
|
+
If the command is run without arguments, list installed blueprints with their name, version, marketplace, installation date, and last update date. Also list configured marketplaces and show how to add the default marketplace when none exist.
|
|
9
|
+
|
|
10
|
+
Blueprints can be installed at two scopes:
|
|
11
|
+
|
|
12
|
+
- **global** (`--global`): stored under `~/.a5c/`, available for all projects
|
|
13
|
+
- **project** (`--project`): stored under `<projectDir>/.a5c/`, project-specific
|
|
14
|
+
|
|
15
|
+
## Marketplace Management
|
|
16
|
+
|
|
17
|
+
Marketplaces are git repositories containing a `marketplace.json` manifest and blueprint package directories. The SDK clones new marketplaces to `.a5c/blueprints/marketplaces/` for the selected scope and reads legacy `.a5c/marketplaces/` clones for compatibility.
|
|
18
|
+
|
|
19
|
+
### Add a marketplace
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
babysitter blueprints:add-marketplace --marketplace-url <url> [--marketplace-path <relative-path>] [--marketplace-branch <ref>] [--force] --global|--project [--json]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Update a marketplace
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
babysitter blueprints:update-marketplace --marketplace-name <name> [--marketplace-branch <ref>] --global|--project [--json]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### List blueprints in a marketplace
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
babysitter blueprints:list-plugins --marketplace-name <name> --global|--project [--json]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Blueprint Lifecycle
|
|
38
|
+
|
|
39
|
+
For `blueprint:install`, `blueprint:update`, `blueprint:configure`, and `blueprint:list-plugins`, the `--marketplace-name` flag is auto-detected when only one marketplace is cloned for the selected scope.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
babysitter blueprints:install --plugin-name <name> [--marketplace-name <mp>] --global|--project [--json]
|
|
43
|
+
babysitter blueprints:update --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
|
|
44
|
+
babysitter blueprints:configure --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
|
|
45
|
+
babysitter blueprints:uninstall --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The `--plugin-name` flag is preserved for CLI compatibility with existing marketplace manifests. User-facing docs should call the installable a blueprint.
|
|
49
|
+
|
|
50
|
+
## Registry Management
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
babysitter blueprints:list-installed --global|--project [--json]
|
|
54
|
+
babysitter blueprints:update-registry --plugin-name <name> --plugin-version <ver> --marketplace-name <mp> --global|--project [--json]
|
|
55
|
+
babysitter blueprints:remove-from-registry --plugin-name <name> --global|--project [--json]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Deprecated Aliases
|
|
59
|
+
|
|
60
|
+
The old `plugin:*` commands remain available as deprecated aliases for one release. Prefer `blueprint:*` in new docs, skills, and process instructions.
|
|
61
|
+
|
|
62
|
+
## Agent Plugins Are Separate
|
|
63
|
+
|
|
64
|
+
Do not rename or reinterpret agent harness plugins while handling blueprints. `CLAUDE_PLUGIN_ROOT`, `PI_PLUGIN_ROOT`, `.claude/plugins/`, hooks-adapter, extensions-adapter, and agent plugin manifests stay plugin-specific.
|
package/commands/call.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Orchestrate a babysitter run. use this command to start babysitting a complex workflow.
|
|
3
|
+
argument-hint: Specific instructions for the run.
|
|
4
|
+
allowed-tools: Read, Grep, Write, Task, Bash, Edit, Grep, Glob, WebFetch, WebSearch, Search, AskUserQuestion, TodoWrite, TodoRead, Skill, BashOutput, KillShell, MultiEdit, LS
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md). Then continue executing the returned instructions in this same turn. Do not stop after the Skill tool returns; carry the requested run through to completion proof.
|
|
8
|
+
|
|
9
|
+
User arguments for this command:
|
|
10
|
+
|
|
11
|
+
$ARGUMENTS
|