@a5c-ai/babysitter-codex 0.1.6-staging.2dca8387 → 0.1.6-staging.2df34517

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 (73) hide show
  1. package/.codex-plugin/plugin.json +44 -0
  2. package/README.md +57 -108
  3. package/bin/cli.js +104 -0
  4. package/bin/install-shared.js +424 -0
  5. package/bin/install.js +48 -0
  6. package/bin/uninstall.js +40 -37
  7. package/hooks/babysitter-session-start.sh +37 -0
  8. package/hooks/babysitter-stop-hook.sh +37 -0
  9. package/hooks/user-prompt-submit.sh +39 -0
  10. package/{.codex/hooks.json → hooks.json} +3 -3
  11. package/package.json +12 -16
  12. package/scripts/team-install.js +32 -205
  13. package/skills/assimilate/SKILL.md +17 -0
  14. package/skills/babysit/SKILL.md +414 -0
  15. package/skills/call/SKILL.md +16 -0
  16. package/skills/doctor/SKILL.md +16 -0
  17. package/skills/forever/SKILL.md +15 -0
  18. package/skills/help/SKILL.md +15 -0
  19. package/skills/issue/SKILL.md +16 -0
  20. package/skills/model/SKILL.md +15 -0
  21. package/skills/observe/SKILL.md +15 -0
  22. package/skills/plan/SKILL.md +16 -0
  23. package/skills/project-install/SKILL.md +15 -0
  24. package/skills/resume/SKILL.md +15 -0
  25. package/skills/retrospect/SKILL.md +15 -0
  26. package/skills/team-install/SKILL.md +15 -0
  27. package/skills/user-install/SKILL.md +15 -0
  28. package/skills/yolo/SKILL.md +16 -0
  29. package/.codex/AGENTS.md +0 -53
  30. package/.codex/command-catalog.json +0 -130
  31. package/.codex/config.toml +0 -24
  32. package/.codex/hooks/babysitter-session-start.sh +0 -15
  33. package/.codex/hooks/babysitter-stop-hook.sh +0 -15
  34. package/.codex/hooks/user-prompt-submit.sh +0 -15
  35. package/.codex/plugin.json +0 -132
  36. package/.codex/skills/babysitter/assimilate/SKILL.md +0 -58
  37. package/.codex/skills/babysitter/call/SKILL.md +0 -590
  38. package/.codex/skills/babysitter/doctor/SKILL.md +0 -89
  39. package/.codex/skills/babysitter/forever/SKILL.md +0 -45
  40. package/.codex/skills/babysitter/help/SKILL.md +0 -49
  41. package/.codex/skills/babysitter/issue/SKILL.md +0 -36
  42. package/.codex/skills/babysitter/model/SKILL.md +0 -31
  43. package/.codex/skills/babysitter/observe/SKILL.md +0 -38
  44. package/.codex/skills/babysitter/plan/SKILL.md +0 -44
  45. package/.codex/skills/babysitter/project-install/SKILL.md +0 -65
  46. package/.codex/skills/babysitter/resume/SKILL.md +0 -30
  47. package/.codex/skills/babysitter/retrospect/SKILL.md +0 -43
  48. package/.codex/skills/babysitter/team-install/SKILL.md +0 -31
  49. package/.codex/skills/babysitter/user-install/SKILL.md +0 -53
  50. package/.codex/skills/babysitter/yolo/SKILL.md +0 -48
  51. package/AGENTS.md +0 -91
  52. package/CHANGELOG.md +0 -162
  53. package/SKILL.md +0 -89
  54. package/agents/openai.yaml +0 -4
  55. package/bin/postinstall.js +0 -225
  56. package/commands/README.md +0 -23
  57. package/commands/assimilate.md +0 -27
  58. package/commands/call.md +0 -30
  59. package/commands/doctor.md +0 -27
  60. package/commands/forever.md +0 -27
  61. package/commands/help.md +0 -28
  62. package/commands/issue.md +0 -27
  63. package/commands/model.md +0 -27
  64. package/commands/observe.md +0 -27
  65. package/commands/plan.md +0 -27
  66. package/commands/project-install.md +0 -31
  67. package/commands/resume.md +0 -29
  68. package/commands/retrospect.md +0 -27
  69. package/commands/team-install.md +0 -29
  70. package/commands/user-install.md +0 -27
  71. package/commands/yolo.md +0 -28
  72. package/test/integration.test.js +0 -69
  73. package/test/packaged-install.test.js +0 -191
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "babysitter-codex",
3
+ "version": "0.1.5",
4
+ "description": "Babysitter orchestration plugin for Codex with skill entrypoints and lifecycle hooks.",
5
+ "author": {
6
+ "name": "a5c.ai",
7
+ "email": "support@a5c.ai",
8
+ "url": "https://github.com/a5c-ai/babysitter"
9
+ },
10
+ "homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-codex#readme",
11
+ "repository": "https://github.com/a5c-ai/babysitter",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "babysitter",
15
+ "codex",
16
+ "orchestration",
17
+ "hooks",
18
+ "skills"
19
+ ],
20
+ "skills": "./skills/",
21
+ "hooks": "./hooks.json",
22
+ "interface": {
23
+ "displayName": "Babysitter",
24
+ "shortDescription": "Run Babysitter orchestration flows from Codex",
25
+ "longDescription": "Babysitter adds orchestration entrypoints such as $call, $plan, and $resume, plus Codex lifecycle hooks that keep runs and workspace state in sync.",
26
+ "developerName": "a5c.ai",
27
+ "category": "Coding",
28
+ "capabilities": [
29
+ "Interactive",
30
+ "Read",
31
+ "Write"
32
+ ],
33
+ "websiteURL": "https://github.com/a5c-ai/babysitter",
34
+ "privacyPolicyURL": "https://github.com/a5c-ai/babysitter",
35
+ "termsOfServiceURL": "https://github.com/a5c-ai/babysitter",
36
+ "defaultPrompt": [
37
+ "Use Babysitter to start a new orchestration run",
38
+ "Plan a Babysitter workflow before executing it",
39
+ "Resume the latest Babysitter run in this workspace"
40
+ ],
41
+ "brandColor": "#0F766E",
42
+ "screenshots": []
43
+ }
44
+ }
package/README.md CHANGED
@@ -1,145 +1,94 @@
1
1
  # @a5c-ai/babysitter-codex
2
2
 
3
- Babysitter integration package for OpenAI Codex CLI. It packages Codex-facing
4
- skills, install helpers, mapping docs, and the hook assets used to keep
5
- Babysitter in the Codex lifecycle loop.
3
+ Babysitter integration package for OpenAI Codex CLI.
6
4
 
7
- This is a Codex skill bundle plus workspace hook templates. It is not a
8
- Claude-style manifest plugin, but it does rely on Codex's real lifecycle hook
9
- engine through `.codex/hooks.json`, and the package postinstall now wires the
10
- active workspace when the global install is launched from that workspace.
5
+ This package now ships as a real Codex plugin bundle:
11
6
 
12
- ## What This Package Owns
7
+ - `.codex-plugin/plugin.json`
8
+ - `skills/`
9
+ - `hooks.json`
10
+ - `hooks/`
13
11
 
14
- - Codex skill payload under `~/.codex/skills/babysitter-codex`
15
- - Codex-facing command docs
16
- - Codex runtime hook helpers under `.codex/`
17
- - Codex mapping and compatibility policy for SDK-driven orchestration
18
-
19
- ## Active Process-Library Model
20
-
21
- `babysitter-codex` does not ship the process library. Workspace onboarding
22
- fetches the original Babysitter repo through the SDK CLI and binds the active
23
- process root in `.a5c/active/process-library.json`.
24
-
25
- Active-use process discovery should prefer:
26
-
27
- 1. Project-local `.a5c/processes`
28
- 2. The SDK-managed active process-library binding returned by
29
- `babysitter process-library:active --state-dir .a5c --json`
30
-
31
- `project-install` and `team-install` layer config, rules, profiles, and pinned
32
- content metadata. They should not be documented as creating an exclusive
33
- project/team process-library scope.
34
-
35
- ## Codex User Experience
36
-
37
- Codex should be integrated through its real hook engine:
38
-
39
- - `SessionStart` initializes Babysitter session state
40
- - `UserPromptSubmit` handles prompt-time transformations safely
41
- - `Stop` keeps Babysitter in the orchestration loop after each yielded turn
42
-
43
- Current contract:
44
-
45
- - start, resume, and inspect work through Codex command phrases such as
46
- `babysitter call`, `babysitter resume`, and `babysitter doctor`
47
- - let the installed Codex hook assets handle runtime state, result posting,
48
- and continuation
49
- - stop after each completed phase so the `Stop` hook can decide whether Codex
50
- exits or receives the next Babysitter iteration message
51
- - finish only when `completionProof` is emitted and echoed as
52
- `<promise>...</promise>`
53
-
54
- Do not document external supervisors, hidden wrapper loops, or `notify` as the
55
- continuation mechanism for the plugin path.
12
+ It still uses the Babysitter SDK CLI and the shared `~/.a5c` process-library
13
+ state, but it no longer installs itself by copying fake skill and hook payloads
14
+ into `~/.codex/skills` and `~/.codex/hooks.json`.
56
15
 
57
16
  ## Installation
58
17
 
59
- Install from npm:
18
+ Install the SDK CLI first:
60
19
 
61
20
  ```bash
62
- npm install -g @a5c-ai/babysitter-codex
21
+ npm install -g @a5c-ai/babysitter-sdk
63
22
  ```
64
23
 
65
- If you run that command from inside the target repository, postinstall will:
66
-
67
- - install the skill payload into `CODEX_HOME`
68
- - merge `~/.codex/config.toml` so `codex_hooks` is enabled
69
- - materialize workspace `.codex/hooks.json` and `.codex/config.toml` for the
70
- active workspace
71
- - clone or update the original Babysitter repo into `.a5c/process-library/...`
72
- - bind `.a5c/process-library/.../library` for active use through the SDK CLI
73
-
74
- If you installed from somewhere else, run:
24
+ Install the Codex plugin globally:
75
25
 
76
26
  ```bash
77
- npm install -g @a5c-ai/babysitter-sdk
78
- babysitter harness:install-plugin codex --workspace /path/to/repo
27
+ npx @a5c-ai/babysitter-codex install
79
28
  ```
80
29
 
81
- `babysitter harness:install-plugin ...` is provided by the SDK CLI, so make
82
- sure `@a5c-ai/babysitter-sdk` is installed first.
30
+ This copies the plugin into `~/.codex/plugins/babysitter-codex`, registers it
31
+ in `~/.agents/plugins/marketplace.json`, merges the required global Codex
32
+ config into `~/.codex/config.toml`, and ensures the Babysitter process library
33
+ is active in `~/.a5c`.
83
34
 
84
- Or from a local checkout:
35
+ Install the plugin into a specific workspace:
85
36
 
86
37
  ```bash
87
- cd /path/to/babysitter-codex
88
- npm install -g .
38
+ npx @a5c-ai/babysitter-codex install --workspace /path/to/repo
89
39
  ```
90
40
 
91
- Verify the installed skill payload:
41
+ This copies the plugin into `<workspace>/plugins/babysitter-codex`, registers
42
+ it in `<workspace>/.agents/plugins/marketplace.json`, merges
43
+ `<workspace>/.codex/config.toml`, and records install metadata under
44
+ `<workspace>/.a5c/team/`.
92
45
 
93
- ```bash
94
- npm ls -g @a5c-ai/babysitter-codex --depth=0
95
- ls -1 ~/.codex/skills/babysitter-codex
96
- test -f ~/.codex/skills/babysitter-codex/scripts/team-install.js
97
- test -f ~/.codex/skills/babysitter-codex/.codex/hooks.json
98
- test -f ~/.codex/skills/babysitter-codex/.codex/hooks/babysitter-stop-hook.sh
99
- ```
46
+ ## Integration Model
100
47
 
101
- Verify the active process-library binding:
48
+ The plugin provides:
102
49
 
103
- ```bash
104
- babysitter process-library:active --state-dir /path/to/repo/.a5c --json
105
- ```
50
+ - `skills/babysit/SKILL.md` as the core entrypoint
51
+ - mode wrapper skills such as `$call`, `$plan`, and `$resume`
52
+ - plugin-level lifecycle hooks for `SessionStart`, `UserPromptSubmit`, and
53
+ `Stop`
106
54
 
107
- Manual bootstrap uses the same SDK CLI flow:
55
+ The process library is fetched and bound through the SDK CLI in
56
+ `~/.a5c/active/process-library.json`.
108
57
 
109
- ```bash
110
- babysitter process-library:clone --repo https://github.com/a5c-ai/babysitter.git --dir .a5c/process-library/babysitter-repo
111
- babysitter process-library:use --dir .a5c/process-library/babysitter-repo/library --state-dir .a5c
112
- babysitter process-library:active --state-dir .a5c --json
113
- ```
58
+ ## Workspace Output
114
59
 
115
- ## Quick Start
60
+ After `install --workspace`, the important files are:
116
61
 
117
- Use command phrases in Codex chat:
62
+ - `plugins/babysitter-codex/.codex-plugin/plugin.json`
63
+ - `plugins/babysitter-codex/skills/babysit/SKILL.md`
64
+ - `plugins/babysitter-codex/hooks.json`
65
+ - `.agents/plugins/marketplace.json`
66
+ - `.codex/config.toml`
67
+ - `.a5c/team/install.json`
68
+ - `.a5c/team/profile.json`
118
69
 
119
- ```text
120
- babysitter help
121
- babysitter call implement authentication with tests
122
- babysitter yolo fix lint and failing tests
123
- babysitter resume latest incomplete run
124
- babysitter doctor current run
125
- ```
70
+ ## Verification
126
71
 
127
- For Codex users, the expected interface is the Codex command phrases plus the
128
- workspace hook install created by onboarding. Raw Babysitter CLI primitives are
129
- internal harness details and live in the Codex skill, not in this user-facing
130
- README.
72
+ Verify the installed plugin bundle:
131
73
 
132
- ## Project And Team Install
74
+ ```bash
75
+ npm ls -g @a5c-ai/babysitter-codex --depth=0
76
+ test -f ~/.codex/plugins/babysitter-codex/.codex-plugin/plugin.json
77
+ test -f ~/.codex/plugins/babysitter-codex/hooks.json
78
+ test -f ~/.codex/plugins/babysitter-codex/hooks/babysitter-stop-hook.sh
79
+ test -f ~/.codex/plugins/babysitter-codex/skills/babysit/SKILL.md
80
+ test -f ~/.agents/plugins/marketplace.json
81
+ ```
133
82
 
134
- Use `babysitter team-install` and `babysitter project-install` from Codex chat
135
- when you want workspace onboarding. They layer pinned config and setup around
136
- the active process roots already used at runtime; they are not the source of
137
- truth for process discovery.
83
+ Verify the active shared process-library binding:
138
84
 
139
- ## Documentation
85
+ ```bash
86
+ babysitter process-library:active --json
87
+ ```
140
88
 
141
- - [commands/README.md](./commands/README.md)
142
- - Internal orchestration details: [.codex/skills/babysitter/call/SKILL.md](./.codex/skills/babysitter/call/SKILL.md)
89
+ On native Windows, Codex currently does not execute hooks. The plugin still
90
+ installs correctly, but the lifecycle hooks will not fire until Codex enables
91
+ Windows hook execution.
143
92
 
144
93
  ## License
145
94
 
package/bin/cli.js ADDED
@@ -0,0 +1,104 @@
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
+
9
+ function printUsage() {
10
+ console.error([
11
+ 'Usage:',
12
+ ' babysitter-codex install [--global]',
13
+ ' babysitter-codex install --workspace [path]',
14
+ ' babysitter-codex uninstall',
15
+ ].join('\n'));
16
+ }
17
+
18
+ function parseInstallArgs(argv) {
19
+ let scope = 'global';
20
+ let workspace = null;
21
+ const passthrough = [];
22
+
23
+ for (let i = 0; i < argv.length; i += 1) {
24
+ const arg = argv[i];
25
+ if (arg === '--global') {
26
+ if (scope === 'workspace') {
27
+ throw new Error('install accepts either --global or --workspace, not both');
28
+ }
29
+ scope = 'global';
30
+ continue;
31
+ }
32
+ if (arg === '--workspace') {
33
+ if (scope === 'global' && workspace !== null) {
34
+ throw new Error('install accepts either --global or --workspace, not both');
35
+ }
36
+ scope = 'workspace';
37
+ const next = argv[i + 1];
38
+ if (next && !next.startsWith('-')) {
39
+ workspace = path.resolve(next);
40
+ i += 1;
41
+ } else {
42
+ workspace = process.cwd();
43
+ }
44
+ continue;
45
+ }
46
+ passthrough.push(arg);
47
+ }
48
+
49
+ return {
50
+ scope,
51
+ workspace,
52
+ passthrough,
53
+ };
54
+ }
55
+
56
+ function runNodeScript(scriptPath, args, extraEnv = {}) {
57
+ const result = spawnSync(process.execPath, [scriptPath, ...args], {
58
+ cwd: process.cwd(),
59
+ stdio: 'inherit',
60
+ env: {
61
+ ...process.env,
62
+ ...extraEnv,
63
+ },
64
+ });
65
+ process.exitCode = result.status ?? 1;
66
+ }
67
+
68
+ function main() {
69
+ const [command, ...rest] = process.argv.slice(2);
70
+ if (!command || command === '--help' || command === '-h' || command === 'help') {
71
+ printUsage();
72
+ process.exitCode = command ? 0 : 1;
73
+ return;
74
+ }
75
+
76
+ if (command === 'install') {
77
+ const parsed = parseInstallArgs(rest);
78
+ if (parsed.scope === 'workspace') {
79
+ const args = [];
80
+ if (parsed.workspace) {
81
+ args.push('--workspace', parsed.workspace);
82
+ }
83
+ args.push(...parsed.passthrough);
84
+ runNodeScript(
85
+ path.join(PACKAGE_ROOT, 'scripts', 'team-install.js'),
86
+ args,
87
+ { BABYSITTER_PACKAGE_ROOT: PACKAGE_ROOT },
88
+ );
89
+ return;
90
+ }
91
+ runNodeScript(path.join(PACKAGE_ROOT, 'bin', 'install.js'), parsed.passthrough);
92
+ return;
93
+ }
94
+
95
+ if (command === 'uninstall') {
96
+ runNodeScript(path.join(PACKAGE_ROOT, 'bin', 'uninstall.js'), rest);
97
+ return;
98
+ }
99
+
100
+ printUsage();
101
+ process.exitCode = 1;
102
+ }
103
+
104
+ main();