@a5c-ai/babysitter-codex 0.1.11-staging.fd3ab4c2 → 5.0.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/.codex-plugin/plugin.json +14 -12
- package/README.md +21 -18
- package/assets/logo.png +0 -0
- package/bin/cli.js +8 -16
- package/bin/install-shared.js +365 -65
- package/bin/install.js +12 -30
- package/bin/uninstall.js +11 -27
- package/hooks/babysitter-proxied-session-start.sh +11 -0
- package/hooks/babysitter-proxied-stop.sh +3 -0
- package/hooks/babysitter-proxied-user-prompt-submit.sh +3 -0
- package/hooks.json +8 -8
- package/package.json +13 -16
- package/plugin.lock.json +153 -0
- package/scripts/create-release-tag.mjs +18 -0
- package/scripts/publish-from-tag.mjs +12 -0
- package/scripts/team-install.js +14 -77
- package/skills/babysit/SKILL.md +2 -0
- package/skills/cleanup/SKILL.md +21 -0
- package/skills/contrib/SKILL.md +34 -0
- package/skills/doctor/SKILL.md +5 -5
- package/skills/help/SKILL.md +3 -2
- package/skills/observe/SKILL.md +1 -1
- package/skills/plugins/SKILL.md +257 -0
- package/babysitter.lock.json +0 -18
- package/hooks/babysitter-session-start.sh +0 -44
- package/hooks/babysitter-stop-hook.sh +0 -44
- package/hooks/user-prompt-submit.sh +0 -33
- package/scripts/sync-command-skills.js +0 -45
- package/skills/issue/SKILL.md +0 -16
- package/skills/model/SKILL.md +0 -15
- package/skills/team-install/SKILL.md +0 -15
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plugins
|
|
3
|
+
description: manage babysitter plugins. use this command to see the list of installed babysitter plugins, their status, and manage them (install, update, uninstall, list from marketplace, add marketplace, configure plugin, create new plugin, etc).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# plugins
|
|
7
|
+
|
|
8
|
+
This command installs and manages plugins for babysitter. A plugin is a version-managed package of contextual instructions (for install, uninstall, configure, and update/migrate between versions), not a conventional software plugin.
|
|
9
|
+
|
|
10
|
+
if the command is run without arguments, it lists all installed plugins with their name, version, marketplace, installation date, and last update date. as well as marketplaces added to the system. and instructions on how to install new plugins from marketplaces.
|
|
11
|
+
if there are no marketplaces added, add the default marketplace:
|
|
12
|
+
```bash
|
|
13
|
+
babysitter plugin:add-marketplace --marketplace-url https://github.com/a5c-ai/babysitter --marketplace-path plugins/a5c/marketplace/marketplace.json --global --json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Plugins can be installed at two scopes:
|
|
17
|
+
- **global** (`--global`): stored under `~/.a5c/`, available for all projects
|
|
18
|
+
- **project** (`--project`): stored under `<projectDir>/.a5c/`, project-specific
|
|
19
|
+
|
|
20
|
+
## Marketplace Management
|
|
21
|
+
|
|
22
|
+
Marketplaces are git repositories containing a `marketplace.json` manifest and plugin package directories. The SDK clones them locally with `--depth 1`.
|
|
23
|
+
|
|
24
|
+
**Storage locations:**
|
|
25
|
+
- Global: `~/.a5c/marketplaces/<name>/`
|
|
26
|
+
- Project: `<projectDir>/.a5c/marketplaces/<name>/`
|
|
27
|
+
|
|
28
|
+
The marketplace name is derived from the git URL's last path segment (stripping `.git` suffix and trailing slashes).
|
|
29
|
+
|
|
30
|
+
### Adding a marketplace
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
babysitter plugin:add-marketplace --marketplace-url <url> [--marketplace-path <relative-path>] [--marketplace-branch <ref>] [--force] --global|--project [--json]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Clones the marketplace repository to the local marketplaces directory. Use `--marketplace-path` to specify the relative path to `marketplace.json` within the repo (for monorepos or repos where the manifest is not at the root). Use `--marketplace-branch` to clone a specific branch, tag, or ref (defaults to the repo's default branch). Use `--force` to replace an existing marketplace clone (deletes and re-clones).
|
|
37
|
+
|
|
38
|
+
### Updating a marketplace
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
babysitter plugin:update-marketplace --marketplace-name <name> [--marketplace-branch <ref>] --global|--project [--json]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Runs `git pull` on the local marketplace clone to fetch latest changes. Use `--marketplace-branch` to switch to a different branch before pulling (works even with shallow clones).
|
|
45
|
+
|
|
46
|
+
### Listing plugins in a marketplace
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
babysitter plugin:list-plugins --marketplace-name <name> --global|--project [--json]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Reads the `marketplace.json` manifest and returns all available plugins sorted alphabetically by name. Each entry includes: name, description, latestVersion, versions array, packagePath, tags, and author.
|
|
53
|
+
|
|
54
|
+
## Plugin Installation
|
|
55
|
+
|
|
56
|
+
**Note:** For `plugin:install`, `plugin:update`, `plugin:configure`, and `plugin:list-plugins`, the `--marketplace-name` flag is auto-detected when only one marketplace is cloned for the given scope. You can omit it if there's only one marketplace.
|
|
57
|
+
|
|
58
|
+
### Flow
|
|
59
|
+
|
|
60
|
+
1. Update the marketplace: `babysitter plugin:update-marketplace --marketplace-name <name> --global|--project`
|
|
61
|
+
2. Check current state: `babysitter plugin:list-installed --global|--project` to see installed plugins and versions
|
|
62
|
+
3. Install the plugin:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
babysitter plugin:install --plugin-name <name> [--marketplace-name <mp>] --global|--project [--json]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
This command resolves the plugin package path from the marketplace manifest, reads `install.md` from the plugin package directory, and returns the installation instructions. If an `install-process.js` file exists, the instructions may reference it as an automated install process.
|
|
69
|
+
|
|
70
|
+
4. The agent performs the installation steps as defined in `install.md`
|
|
71
|
+
5. The agent updates the registry:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
babysitter plugin:update-registry --plugin-name <name> --plugin-version <ver> --marketplace-name <mp> --global|--project [--json]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Plugin Update (with migrations)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
babysitter plugin:update --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This command:
|
|
84
|
+
1. Reads the currently installed version from the registry
|
|
85
|
+
2. Resolves the latest version from the marketplace manifest
|
|
86
|
+
3. Looks in the plugin package's `migrations/` directory for migration files
|
|
87
|
+
4. Uses BFS over the migration graph to find the shortest path from the installed version to the target version
|
|
88
|
+
5. Returns the ordered migration instructions (content of each migration file in sequence)
|
|
89
|
+
|
|
90
|
+
**Migration filename format:** `<fromVersion>_to_<toVersion>.<ext>` where:
|
|
91
|
+
- Versions may contain alphanumerics, dots, dashes (e.g. `1.0.0`, `2.0.0-beta`)
|
|
92
|
+
- Extensions: `.md` for markdown instructions, `.js` for executable process files
|
|
93
|
+
- Examples: `1.0.0_to_1.1.0.md`, `2.0.0-beta_to_2.0.0.js`
|
|
94
|
+
|
|
95
|
+
After performing the migration steps, update the registry:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
babysitter plugin:update-registry --plugin-name <name> --plugin-version <new-ver> --marketplace-name <mp> --global|--project [--json]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Plugin Uninstallation
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
babysitter plugin:uninstall --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Reads `uninstall.md` from the plugin package directory and returns the uninstall instructions. After performing the uninstall steps, remove from registry:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
babysitter plugin:remove-from-registry --plugin-name <name> --global|--project [--json]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Plugin Configuration
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
babysitter plugin:configure --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Reads `configure.md` from the plugin package directory and returns configuration instructions.
|
|
120
|
+
|
|
121
|
+
## Registry Management
|
|
122
|
+
|
|
123
|
+
The plugin registry (`plugin-registry.json`) tracks installed plugins with schema version `2026.01.plugin-registry-v1`. Writes use atomic file operations (temp + rename) for crash safety.
|
|
124
|
+
|
|
125
|
+
**Storage locations:**
|
|
126
|
+
- Global: `~/.a5c/plugin-registry.json`
|
|
127
|
+
- Project: `<projectDir>/.a5c/plugin-registry.json`
|
|
128
|
+
|
|
129
|
+
### List installed plugins
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
babysitter plugin:list-installed --global|--project [--json]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Returns all installed plugins sorted alphabetically. In `--json` mode, returns an array of registry entries. In human mode, displays a formatted table with name, version, marketplace, and timestamps.
|
|
136
|
+
|
|
137
|
+
### Remove from registry
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
babysitter plugin:remove-from-registry --plugin-name <name> --global|--project [--json]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Removes a plugin entry from the registry. Returns error if the plugin is not present.
|
|
144
|
+
|
|
145
|
+
## Plugin Creation
|
|
146
|
+
|
|
147
|
+
To create a new plugin package from scratch, use the `meta/plugin-creation` babysitter process. This process guides you through requirements analysis, structure design, instruction authoring, optional process file generation, validation, and marketplace integration.
|
|
148
|
+
|
|
149
|
+
### Using the plugin creation process
|
|
150
|
+
|
|
151
|
+
Orchestrate a babysitter run with the plugin creation process:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Create inputs file
|
|
155
|
+
cat > /tmp/plugin-inputs.json << 'EOF'
|
|
156
|
+
{
|
|
157
|
+
"pluginName": "my-plugin",
|
|
158
|
+
"description": "What the plugin does — be specific about install/configure/uninstall behavior",
|
|
159
|
+
"scope": "project",
|
|
160
|
+
"outputDir": "./plugins",
|
|
161
|
+
"components": {
|
|
162
|
+
"installProcess": false,
|
|
163
|
+
"configureProcess": false,
|
|
164
|
+
"uninstallProcess": false,
|
|
165
|
+
"migrations": false,
|
|
166
|
+
"processFiles": false
|
|
167
|
+
},
|
|
168
|
+
"marketplace": {
|
|
169
|
+
"name": "my-marketplace",
|
|
170
|
+
"author": "my-org",
|
|
171
|
+
"tags": ["category1", "category2"]
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
EOF
|
|
175
|
+
|
|
176
|
+
# Create and run
|
|
177
|
+
babysitter run:create \
|
|
178
|
+
--process-id meta/plugin-creation \
|
|
179
|
+
--entry library/specializations/meta/plugin-creation.js#process \
|
|
180
|
+
--inputs /tmp/plugin-inputs.json \
|
|
181
|
+
--prompt "Create a new babysitter plugin package" \
|
|
182
|
+
--json
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### What the process generates
|
|
186
|
+
|
|
187
|
+
The process creates a complete plugin package directory:
|
|
188
|
+
|
|
189
|
+
| File | Description |
|
|
190
|
+
|------|-------------|
|
|
191
|
+
| `install.md` | Agent-readable installation instructions with numbered steps |
|
|
192
|
+
| `uninstall.md` | Reversal instructions for clean removal |
|
|
193
|
+
| `configure.md` | Configuration options table and adjustment instructions |
|
|
194
|
+
| `install-process.js` | *(optional)* Automated babysitter process for complex install steps |
|
|
195
|
+
| `configure-process.js` | *(optional)* Automated configuration process |
|
|
196
|
+
| `process/main.js` | *(optional)* Main process the plugin contributes |
|
|
197
|
+
| `marketplace-entry.json` | Ready-to-use marketplace.json entry for publishing |
|
|
198
|
+
|
|
199
|
+
### Process phases
|
|
200
|
+
|
|
201
|
+
1. **Requirements Analysis** — Analyzes plugin purpose, prerequisites, config options, file structure
|
|
202
|
+
2. **Structure Design** — Plans directory layout and file inventory (with review breakpoint)
|
|
203
|
+
3. **Instruction Authoring** — Writes install.md, uninstall.md, configure.md
|
|
204
|
+
4. **Process Files** — Creates optional babysitter process files (install-process.js, configure-process.js, process/main.js)
|
|
205
|
+
5. **Validation** — Verifies package completeness, instruction quality, path correctness
|
|
206
|
+
6. **Marketplace Integration** — Generates marketplace.json entry for publishing
|
|
207
|
+
|
|
208
|
+
### Quick creation (without orchestration)
|
|
209
|
+
|
|
210
|
+
For simple plugins that only need instruction files, you can create the package manually following the structure below and the [Plugin Author Guide](docs/plugins/plugin-author-guide.md).
|
|
211
|
+
|
|
212
|
+
## Plugin Package Structure
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
my-plugin/
|
|
216
|
+
package.json # Optional (name field used as plugin ID, falls back to directory name)
|
|
217
|
+
install.md # Markdown instructions for installation
|
|
218
|
+
uninstall.md # Markdown instructions for removal
|
|
219
|
+
configure.md # Markdown instructions for configuration
|
|
220
|
+
install-process.js # Optional automated install process
|
|
221
|
+
uninstall-process.js # Optional automated uninstall process
|
|
222
|
+
configure-process.js # Optional automated configure process
|
|
223
|
+
migrations/ # Version migration files
|
|
224
|
+
1.0.0_to_1.1.0.md
|
|
225
|
+
1.1.0_to_2.0.0.js
|
|
226
|
+
process/ # Process definition files (collected recursively)
|
|
227
|
+
main.js
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## All CLI Commands Summary
|
|
231
|
+
|
|
232
|
+
All commands accept `--json` for machine-readable output and `--global|--project`.
|
|
233
|
+
|
|
234
|
+
| Command | Required Flags | Description |
|
|
235
|
+
|---------|---------------|-------------|
|
|
236
|
+
| `plugin:add-marketplace` | `--marketplace-url`, `--global\|--project` [`--marketplace-path`, `--marketplace-branch`, `--force`] | Clone a marketplace repository |
|
|
237
|
+
| `plugin:update-marketplace` | `--marketplace-name`, `--global\|--project` [`--marketplace-branch`] | Pull latest marketplace changes (optionally switch branch) |
|
|
238
|
+
| `plugin:list-plugins` | `--marketplace-name`, `--global\|--project` | List available plugins in a marketplace |
|
|
239
|
+
| `plugin:install` | `--plugin-name`, `--marketplace-name`, `--global\|--project` | Get install instructions for a plugin |
|
|
240
|
+
| `plugin:uninstall` | `--plugin-name`, `--marketplace-name`, `--global\|--project` | Get uninstall instructions for a plugin |
|
|
241
|
+
| `plugin:update` | `--plugin-name`, `--marketplace-name`, `--global\|--project` | Resolve migration chain and get update instructions |
|
|
242
|
+
| `plugin:configure` | `--plugin-name`, `--marketplace-name`, `--global\|--project` | Get configuration instructions for a plugin |
|
|
243
|
+
| `plugin:list-installed` | `--global\|--project` | List all installed plugins |
|
|
244
|
+
| `plugin:update-registry` | `--plugin-name`, `--plugin-version`, `--marketplace-name`, `--global\|--project` | Register or update a plugin entry |
|
|
245
|
+
| `plugin:remove-from-registry` | `--plugin-name`, `--global\|--project` | Remove a plugin entry from the registry |
|
|
246
|
+
|
|
247
|
+
## After Plugin Work: Contribute Back
|
|
248
|
+
|
|
249
|
+
After working with plugins, prompt the user to share improvements or report issues:
|
|
250
|
+
|
|
251
|
+
- **Improved a plugin's install/configure/uninstall instructions**: `/babysitter:contrib library contribution: improved [plugin-name] [install|configure|uninstall] instructions`
|
|
252
|
+
- **Created a new plugin**: `/babysitter:contrib library contribution: new plugin [plugin-name] -- [description]`
|
|
253
|
+
- **Found a bug in a plugin or the plugin system**: `/babysitter:contrib bug report: [description, e.g. "plugin:update-registry fails when marketplace hasn't been cloned"]`
|
|
254
|
+
- **Plugin install/configure instructions were confusing or wrong**: `/babysitter:contrib bug report: [plugin-name] install instructions [description of what was wrong]`
|
|
255
|
+
- **Have an idea for a new plugin**: `/babysitter:contrib feature request: plugin idea -- [description]`
|
|
256
|
+
|
|
257
|
+
Even reporting that a plugin's instructions were unclear helps improve it for the next user.
|
package/babysitter.lock.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"generatedAt": "2026-03-11T00:00:00.000Z",
|
|
4
|
-
"runtime": {
|
|
5
|
-
"name": "@a5c/babysitter-codex-runtime",
|
|
6
|
-
"version": "0.1.4"
|
|
7
|
-
},
|
|
8
|
-
"content": {
|
|
9
|
-
"name": "@a5c/babysitter-codex-content",
|
|
10
|
-
"version": "0.1.4",
|
|
11
|
-
"processLibrary": {
|
|
12
|
-
"repo": "https://github.com/a5c-ai/babysitter.git",
|
|
13
|
-
"processSubpath": "library",
|
|
14
|
-
"referenceSubpath": "library/reference",
|
|
15
|
-
"snapshotCommit": "unknown"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
|
-
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
|
-
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
-
LOG_DIR="${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}"
|
|
8
|
-
LOG_FILE="$LOG_DIR/babysitter-session-start-hook.log"
|
|
9
|
-
|
|
10
|
-
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
11
|
-
export BABYSITTER_STATE_DIR="${STATE_DIR}"
|
|
12
|
-
|
|
13
|
-
mkdir -p "$LOG_DIR" 2>/dev/null
|
|
14
|
-
|
|
15
|
-
blog() {
|
|
16
|
-
local msg="$1"
|
|
17
|
-
local ts
|
|
18
|
-
ts="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
19
|
-
echo "[INFO] $ts $msg" >> "$LOG_FILE" 2>/dev/null
|
|
20
|
-
babysitter log --type hook --label "hook:session-start" --message "$msg" --source shell-hook 2>/dev/null || true
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
blog "Hook script invoked"
|
|
24
|
-
blog "PLUGIN_ROOT=$PLUGIN_ROOT"
|
|
25
|
-
blog "STATE_DIR=$STATE_DIR"
|
|
26
|
-
|
|
27
|
-
INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/codex-session-start-hook-$$.json")
|
|
28
|
-
cat > "$INPUT_FILE"
|
|
29
|
-
|
|
30
|
-
blog "Hook input received ($(wc -c < "$INPUT_FILE") bytes)"
|
|
31
|
-
|
|
32
|
-
RESULT=$(babysitter hook:run \
|
|
33
|
-
--hook-type session-start \
|
|
34
|
-
--harness codex \
|
|
35
|
-
--plugin-root "${CODEX_PLUGIN_ROOT}" \
|
|
36
|
-
--state-dir "${BABYSITTER_STATE_DIR}" \
|
|
37
|
-
< "$INPUT_FILE" 2>"$LOG_DIR/babysitter-session-start-hook-stderr.log")
|
|
38
|
-
EXIT_CODE=$?
|
|
39
|
-
|
|
40
|
-
blog "CLI exit code=$EXIT_CODE"
|
|
41
|
-
|
|
42
|
-
rm -f "$INPUT_FILE" 2>/dev/null
|
|
43
|
-
printf '%s\n' "$RESULT"
|
|
44
|
-
exit $EXIT_CODE
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
|
-
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
|
-
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
-
LOG_DIR="${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}"
|
|
8
|
-
LOG_FILE="$LOG_DIR/babysitter-stop-hook.log"
|
|
9
|
-
|
|
10
|
-
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
11
|
-
export BABYSITTER_STATE_DIR="${STATE_DIR}"
|
|
12
|
-
|
|
13
|
-
mkdir -p "$LOG_DIR" 2>/dev/null
|
|
14
|
-
|
|
15
|
-
blog() {
|
|
16
|
-
local msg="$1"
|
|
17
|
-
local ts
|
|
18
|
-
ts="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
19
|
-
echo "[INFO] $ts $msg" >> "$LOG_FILE" 2>/dev/null
|
|
20
|
-
babysitter log --type hook --label "hook:stop" --message "$msg" --source shell-hook 2>/dev/null || true
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
blog "Hook script invoked"
|
|
24
|
-
blog "PLUGIN_ROOT=$PLUGIN_ROOT"
|
|
25
|
-
blog "STATE_DIR=$STATE_DIR"
|
|
26
|
-
|
|
27
|
-
INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/codex-stop-hook-$$.json")
|
|
28
|
-
cat > "$INPUT_FILE"
|
|
29
|
-
|
|
30
|
-
blog "Hook input received ($(wc -c < "$INPUT_FILE") bytes)"
|
|
31
|
-
|
|
32
|
-
RESULT=$(babysitter hook:run \
|
|
33
|
-
--hook-type stop \
|
|
34
|
-
--harness codex \
|
|
35
|
-
--plugin-root "${CODEX_PLUGIN_ROOT}" \
|
|
36
|
-
--state-dir "${BABYSITTER_STATE_DIR}" \
|
|
37
|
-
< "$INPUT_FILE" 2>"$LOG_DIR/babysitter-stop-hook-stderr.log")
|
|
38
|
-
EXIT_CODE=$?
|
|
39
|
-
|
|
40
|
-
blog "CLI exit code=$EXIT_CODE"
|
|
41
|
-
|
|
42
|
-
rm -f "$INPUT_FILE" 2>/dev/null
|
|
43
|
-
printf '%s\n' "$RESULT"
|
|
44
|
-
exit $EXIT_CODE
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
|
-
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
|
-
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
-
LOG_DIR="${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}"
|
|
8
|
-
|
|
9
|
-
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
10
|
-
export BABYSITTER_STATE_DIR="${STATE_DIR}"
|
|
11
|
-
|
|
12
|
-
mkdir -p "$LOG_DIR" 2>/dev/null
|
|
13
|
-
|
|
14
|
-
INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/codex-user-prompt-submit-hook-$$.json")
|
|
15
|
-
cat > "$INPUT_FILE"
|
|
16
|
-
|
|
17
|
-
babysitter log --type hook --label "hook:user-prompt-submit" --message "Hook invoked" --source shell-hook 2>/dev/null || true
|
|
18
|
-
|
|
19
|
-
RESULT=$(babysitter hook:run \
|
|
20
|
-
--hook-type user-prompt-submit \
|
|
21
|
-
--harness codex \
|
|
22
|
-
--plugin-root "${CODEX_PLUGIN_ROOT}" \
|
|
23
|
-
--state-dir "${BABYSITTER_STATE_DIR}" \
|
|
24
|
-
< "$INPUT_FILE" 2>"$LOG_DIR/babysitter-user-prompt-submit-hook-stderr.log")
|
|
25
|
-
EXIT_CODE=$?
|
|
26
|
-
|
|
27
|
-
babysitter log --type hook --label "hook:user-prompt-submit" --message "CLI exit code=$EXIT_CODE" --source shell-hook 2>/dev/null || true
|
|
28
|
-
|
|
29
|
-
rm -f "$INPUT_FILE" 2>/dev/null
|
|
30
|
-
if [ -n "$RESULT" ]; then
|
|
31
|
-
printf '%s\n' "$RESULT"
|
|
32
|
-
fi
|
|
33
|
-
exit $EXIT_CODE
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const {
|
|
6
|
-
listDirectories,
|
|
7
|
-
reportCheckResult,
|
|
8
|
-
syncSkillsFromCommands,
|
|
9
|
-
} = require('../../../scripts/plugin-command-sync-lib.cjs');
|
|
10
|
-
|
|
11
|
-
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
12
|
-
const REPO_ROOT = path.resolve(PACKAGE_ROOT, '..', '..');
|
|
13
|
-
const COMMANDS_ROOT = path.join(REPO_ROOT, 'plugins', 'babysitter', 'commands');
|
|
14
|
-
const SKILLS_ROOT = path.join(PACKAGE_ROOT, 'skills');
|
|
15
|
-
const LABEL = 'babysitter-codex sync';
|
|
16
|
-
|
|
17
|
-
function getCommandBackedSkillNames() {
|
|
18
|
-
return listDirectories(SKILLS_ROOT)
|
|
19
|
-
.filter((name) => fs.existsSync(path.join(COMMANDS_ROOT, `${name}.md`)));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function main() {
|
|
23
|
-
const result = syncSkillsFromCommands({
|
|
24
|
-
label: LABEL,
|
|
25
|
-
sourceRoot: COMMANDS_ROOT,
|
|
26
|
-
skillsRoot: SKILLS_ROOT,
|
|
27
|
-
names: getCommandBackedSkillNames(),
|
|
28
|
-
check: process.argv.includes('--check'),
|
|
29
|
-
cwd: PACKAGE_ROOT,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
if (process.argv.includes('--check')) {
|
|
33
|
-
reportCheckResult(LABEL, result.stale);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (result.updated === 0) {
|
|
38
|
-
console.log(`[${LABEL}] no Codex skill changes were needed.`);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
console.log(`[${LABEL}] updated ${result.updated} Codex skill file(s).`);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
main();
|
package/skills/issue/SKILL.md
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: issue
|
|
3
|
-
description: Run an issue-centric Babysitter workflow.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# issue
|
|
7
|
-
|
|
8
|
-
Load and use the installed `babysit` skill.
|
|
9
|
-
|
|
10
|
-
Resolve the request in `issue` mode:
|
|
11
|
-
|
|
12
|
-
- treat everything after `$issue` as the issue selector and any extra issue-mode
|
|
13
|
-
instructions
|
|
14
|
-
- focus on the issue-driven orchestration flow
|
|
15
|
-
- do not create a separate command surface here; this skill only forwards into
|
|
16
|
-
`babysit`
|
package/skills/model/SKILL.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: model
|
|
3
|
-
description: Inspect or change Babysitter model-routing policy by phase.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# model
|
|
7
|
-
|
|
8
|
-
Load and use the installed `babysit` skill.
|
|
9
|
-
|
|
10
|
-
Resolve the request in `model` mode:
|
|
11
|
-
|
|
12
|
-
- treat everything after `$model` as the model-routing request
|
|
13
|
-
- focus on showing, clearing, or setting model-routing policy by phase
|
|
14
|
-
- do not create a separate command surface here; this skill only forwards into
|
|
15
|
-
`babysit`
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: team-install
|
|
3
|
-
description: Install the team-pinned Babysitter Codex workspace setup.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# team-install
|
|
7
|
-
|
|
8
|
-
Load and use the installed `babysit` skill.
|
|
9
|
-
|
|
10
|
-
Resolve the request in `team-install` mode:
|
|
11
|
-
|
|
12
|
-
- treat everything after `$team-install` as team-install arguments or intent
|
|
13
|
-
- focus on shared workspace setup and team-pinned configuration
|
|
14
|
-
- do not create a separate command surface here; this skill only forwards into
|
|
15
|
-
`babysit`
|