@a5c-ai/babysitter-codex 0.1.6-staging.05b1f6af

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.
@@ -0,0 +1,39 @@
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:-$PLUGIN_ROOT/.a5c/logs}"
8
+ LOG_FILE="$LOG_DIR/babysitter-user-prompt-submit-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
+ echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) Hook script invoked"
16
+ echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) PLUGIN_ROOT=$PLUGIN_ROOT"
17
+ echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) STATE_DIR=$STATE_DIR"
18
+ } >> "$LOG_FILE" 2>/dev/null
19
+
20
+ INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/codex-user-prompt-submit-hook-$$.json")
21
+ cat > "$INPUT_FILE"
22
+
23
+ echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) Hook input received ($(wc -c < "$INPUT_FILE") bytes)" >> "$LOG_FILE" 2>/dev/null
24
+
25
+ RESULT=$(babysitter hook:run \
26
+ --hook-type user-prompt-submit \
27
+ --harness codex \
28
+ --plugin-root "${CODEX_PLUGIN_ROOT}" \
29
+ --state-dir "${BABYSITTER_STATE_DIR}" \
30
+ < "$INPUT_FILE" 2>"$LOG_DIR/babysitter-user-prompt-submit-hook-stderr.log")
31
+ EXIT_CODE=$?
32
+
33
+ echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) CLI exit code=$EXIT_CODE" >> "$LOG_FILE" 2>/dev/null
34
+
35
+ rm -f "$INPUT_FILE" 2>/dev/null
36
+ if [ -n "$RESULT" ]; then
37
+ printf '%s\n' "$RESULT"
38
+ fi
39
+ exit $EXIT_CODE
package/hooks.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "*",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "./hooks/babysitter-session-start.sh"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "UserPromptSubmit": [
15
+ {
16
+ "matcher": "*",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "./hooks/user-prompt-submit.sh"
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "Stop": [
26
+ {
27
+ "matcher": "*",
28
+ "hooks": [
29
+ {
30
+ "type": "command",
31
+ "command": "./hooks/babysitter-stop-hook.sh"
32
+ }
33
+ ]
34
+ }
35
+ ]
36
+ }
37
+ }
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@a5c-ai/babysitter-codex",
3
+ "version": "0.1.6-staging.05b1f6af",
4
+ "description": "Babysitter Codex skill bundle and integration package for OpenAI Codex CLI with SDK-managed process-library bootstrapping, 15 orchestration modes, and BOM-safe SKILL installation",
5
+ "scripts": {
6
+ "test": "node test/integration.test.js && node test/packaged-install.test.js",
7
+ "test:integration": "node test/integration.test.js",
8
+ "team:install": "node scripts/team-install.js",
9
+ "lint": "node -e \"const fs=require('fs'); const path=require('path'); const cp=require('child_process'); const walk=(dir)=>{for(const entry of fs.readdirSync(dir)){const file=path.join(dir, entry); const stat=fs.statSync(file); if(stat.isDirectory()) walk(file); else if(file.endsWith('.js')) cp.execFileSync(process.execPath,['--check',file],{stdio:'inherit'});}}; ['skills','bin','scripts','test'].forEach((dir)=>{if(fs.existsSync(dir)) walk(dir);});\"",
10
+ "deploy": "npm publish --access public",
11
+ "deploy:staging": "npm publish --access public --tag staging"
12
+ },
13
+ "bin": {
14
+ "babysitter-codex": "bin/cli.js"
15
+ },
16
+ "files": [
17
+ ".codex-plugin/",
18
+ ".app.json",
19
+ "assets/",
20
+ "hooks/",
21
+ "hooks.json",
22
+ "skills/",
23
+ "bin/",
24
+ "scripts/",
25
+ "babysitter.lock.json"
26
+ ],
27
+ "keywords": [
28
+ "babysitter",
29
+ "codex",
30
+ "orchestration",
31
+ "ai-agent",
32
+ "sdk-integration",
33
+ "codex-skill"
34
+ ],
35
+ "author": "a5c.ai",
36
+ "license": "MIT",
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/a5c-ai/babysitter"
43
+ },
44
+ "homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-codex#readme",
45
+ "dependencies": {
46
+ "@a5c-ai/babysitter-sdk": "0.0.183-staging.05b1f6af"
47
+ }
48
+ }
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const {
7
+ copyPluginBundle,
8
+ ensureGlobalProcessLibrary,
9
+ ensureMarketplaceEntry,
10
+ installCodexSurface,
11
+ mergeCodexConfigFile,
12
+ warnWindowsHooks,
13
+ writeJson,
14
+ } = require('../bin/install-shared');
15
+
16
+ function parseArgs(argv) {
17
+ const args = {
18
+ workspace: process.cwd(),
19
+ dryRun: false,
20
+ };
21
+ for (let i = 2; i < argv.length; i += 1) {
22
+ if (argv[i] === '--workspace' && argv[i + 1]) {
23
+ args.workspace = path.resolve(argv[++i]);
24
+ } else if (argv[i] === '--dry-run') {
25
+ args.dryRun = true;
26
+ }
27
+ }
28
+ return args;
29
+ }
30
+
31
+ function main() {
32
+ const args = parseArgs(process.argv);
33
+ const packageRoot = path.resolve(process.env.BABYSITTER_PACKAGE_ROOT || path.join(__dirname, '..'));
34
+ const workspaceRoot = args.workspace;
35
+ const workspacePluginRoot = path.join(workspaceRoot, 'plugins', 'babysitter-codex');
36
+ const workspaceMarketplacePath = path.join(workspaceRoot, '.agents', 'plugins', 'marketplace.json');
37
+ const workspaceConfigPath = path.join(workspaceRoot, '.codex', 'config.toml');
38
+
39
+ const installInfo = {
40
+ installedAt: new Date().toISOString(),
41
+ packageRoot,
42
+ workspaceRoot,
43
+ pluginRoot: workspacePluginRoot,
44
+ marketplacePath: workspaceMarketplacePath,
45
+ codexConfigPath: workspaceConfigPath,
46
+ };
47
+
48
+ if (args.dryRun) {
49
+ console.log(JSON.stringify({
50
+ ok: true,
51
+ dryRun: true,
52
+ installInfo,
53
+ }, null, 2));
54
+ return;
55
+ }
56
+
57
+ copyPluginBundle(packageRoot, workspacePluginRoot);
58
+ ensureMarketplaceEntry(workspaceMarketplacePath, workspacePluginRoot);
59
+ mergeCodexConfigFile(workspaceConfigPath);
60
+ installCodexSurface(packageRoot, path.join(workspaceRoot, '.codex'));
61
+
62
+ const active = ensureGlobalProcessLibrary(packageRoot);
63
+ installInfo.processLibraryStateFile = active.stateFile;
64
+ installInfo.processLibraryRoot = active.binding?.dir || '';
65
+ installInfo.processLibraryCloneDir = active.defaultSpec?.cloneDir || '';
66
+
67
+ const outDir = path.join(workspaceRoot, '.a5c', 'team');
68
+ fs.mkdirSync(outDir, { recursive: true });
69
+ writeJson(path.join(outDir, 'install.json'), installInfo);
70
+
71
+ const profilePath = path.join(outDir, 'profile.json');
72
+ if (!fs.existsSync(profilePath)) {
73
+ writeJson(profilePath, {
74
+ teamName: 'default',
75
+ pluginRoot: workspacePluginRoot,
76
+ marketplacePath: workspaceMarketplacePath,
77
+ codexConfigPath: workspaceConfigPath,
78
+ processLibraryLookupCommand: 'babysitter process-library:active --json',
79
+ });
80
+ }
81
+
82
+ warnWindowsHooks();
83
+ console.log('[team-install] complete');
84
+ }
85
+
86
+ main();
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: assimilate
3
+ description: Assimilate an external methodology, repo, spec, or process into a Babysitter workflow.
4
+ ---
5
+
6
+ # assimilate
7
+
8
+ Load and use the installed `babysit` skill.
9
+
10
+ Resolve the request in `assimilate` mode:
11
+
12
+ - treat everything after `$assimilate` as the target repo, methodology, spec,
13
+ or reference to ingest
14
+ - follow the `babysit` skill contract for research, process-library discovery,
15
+ and orchestration
16
+ - do not create a separate command surface here; this skill only forwards into
17
+ `babysit`