@a5c-ai/babysitter-codex 5.0.1-staging.25e625f3 → 5.0.1-staging.26a773f9
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 +1 -1
- package/bin/cli.js +5 -0
- package/bin/install-shared.js +66 -14
- package/bin/install.js +3 -4
- package/bin/uninstall.js +0 -1
- package/hooks.json +3 -3
- package/package.json +12 -8
- package/scripts/sync-command-skills.js +1 -0
- package/scripts/team-install.js +8 -34
- package/hooks/hooks.json +0 -37
package/bin/cli.js
CHANGED
|
@@ -5,6 +5,8 @@ const path = require('path');
|
|
|
5
5
|
const { spawnSync } = require('child_process');
|
|
6
6
|
|
|
7
7
|
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
8
|
+
let shared;
|
|
9
|
+
try { shared = require('./install-shared'); } catch {}
|
|
8
10
|
|
|
9
11
|
function printUsage() {
|
|
10
12
|
console.error([
|
|
@@ -61,6 +63,9 @@ function main() {
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
if (command === 'install') {
|
|
66
|
+
if (shared && typeof shared.harnessCliRoute === 'function' && shared.harnessCliRoute(rest, PACKAGE_ROOT, runNodeScript)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
64
69
|
const parsed = parseInstallArgs(rest);
|
|
65
70
|
if (parsed.scope === 'workspace') {
|
|
66
71
|
const args = [];
|
package/bin/install-shared.js
CHANGED
|
@@ -13,16 +13,16 @@ function getUserHome() {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function getHarnessHome() {
|
|
16
|
-
return path.join(os.homedir(),
|
|
16
|
+
return path.join(os.homedir(), ".codex");
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function getHomePluginRoot(scope) {
|
|
20
20
|
if (scope === 'workspace') return path.join(process.cwd(), '.a5c', 'plugins', PLUGIN_NAME);
|
|
21
|
-
return path.join(path.join(os.homedir(),
|
|
21
|
+
return path.join(path.join(os.homedir(), ".agents/plugins"), PLUGIN_NAME);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function getHomeMarketplacePath() {
|
|
25
|
-
return path.join(os.homedir(),
|
|
25
|
+
return path.join(os.homedir(), ".agents/plugins/marketplace.json");
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function writeFileIfChanged(filePath, contents) {
|
|
@@ -279,6 +279,14 @@ function getHomeMarketplacePath() {
|
|
|
279
279
|
return path.join(getUserHome(), '.agents', 'plugins', 'marketplace.json');
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
+
function getWorkspacePluginRoot(workspaceRoot) {
|
|
283
|
+
return path.join(path.resolve(workspaceRoot), '.agents', 'plugins', PLUGIN_NAME);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function getWorkspaceMarketplacePath(workspaceRoot) {
|
|
287
|
+
return path.join(path.resolve(workspaceRoot), '.agents', 'plugins', 'marketplace.json');
|
|
288
|
+
}
|
|
289
|
+
|
|
282
290
|
function renderCodexConfigToml() {
|
|
283
291
|
return [
|
|
284
292
|
'approval_policy = "on-request"',
|
|
@@ -697,6 +705,46 @@ function installCodexSurface(packageRoot, codexHome) {
|
|
|
697
705
|
installManagedHooks(packageRoot, codexHome);
|
|
698
706
|
}
|
|
699
707
|
|
|
708
|
+
function harnessTeamInstall(packageRoot, pluginRoot, workspace) {
|
|
709
|
+
var workspaceRoot = path.resolve(workspace);
|
|
710
|
+
var resolvedPluginRoot = pluginRoot ? path.resolve(pluginRoot) : getWorkspacePluginRoot(workspaceRoot);
|
|
711
|
+
var marketplacePath = getWorkspaceMarketplacePath(workspaceRoot);
|
|
712
|
+
var codexHome = path.join(workspaceRoot, '.codex');
|
|
713
|
+
var codexConfigPath = path.join(codexHome, 'config.toml');
|
|
714
|
+
var teamDir = path.join(workspaceRoot, '.a5c', 'team');
|
|
715
|
+
|
|
716
|
+
var processLibraryState = ensureGlobalProcessLibrary(packageRoot);
|
|
717
|
+
ensureMarketplaceEntry(marketplacePath, resolvedPluginRoot);
|
|
718
|
+
mergeCodexConfigFile(codexConfigPath);
|
|
719
|
+
installCodexSurface(packageRoot, codexHome);
|
|
720
|
+
warnWindowsHooks();
|
|
721
|
+
|
|
722
|
+
writeJson(path.join(teamDir, 'install.json'), {
|
|
723
|
+
packageRoot: packageRoot,
|
|
724
|
+
workspaceRoot: workspaceRoot,
|
|
725
|
+
pluginRoot: resolvedPluginRoot,
|
|
726
|
+
marketplacePath: marketplacePath,
|
|
727
|
+
codexConfigPath: codexConfigPath,
|
|
728
|
+
processLibraryCloneDir: (processLibraryState.defaultSpec && processLibraryState.defaultSpec.cloneDir)
|
|
729
|
+
|| (processLibraryState.binding && processLibraryState.binding.dir),
|
|
730
|
+
processLibraryStateFile: processLibraryState.stateFile
|
|
731
|
+
|| path.join(getGlobalStateDir(), 'active', 'process-library.json'),
|
|
732
|
+
});
|
|
733
|
+
writeJson(path.join(teamDir, 'profile.json'), {
|
|
734
|
+
pluginRoot: resolvedPluginRoot,
|
|
735
|
+
marketplacePath: marketplacePath,
|
|
736
|
+
codexConfigPath: codexConfigPath,
|
|
737
|
+
processLibraryLookupCommand: 'babysitter process-library:active --json',
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
function harnessInstall(packageRoot, _pluginRoot) {
|
|
742
|
+
const codexConfigPath = path.join(getCodexHome(), 'config.toml');
|
|
743
|
+
mergeCodexConfigFile(codexConfigPath);
|
|
744
|
+
ensureGlobalProcessLibrary(packageRoot);
|
|
745
|
+
warnWindowsHooks();
|
|
746
|
+
}
|
|
747
|
+
|
|
700
748
|
function warnWindowsHooks() {
|
|
701
749
|
if (process.platform !== 'win32') {
|
|
702
750
|
return;
|
|
@@ -723,19 +771,28 @@ module.exports = {
|
|
|
723
771
|
resolveCliCommand,
|
|
724
772
|
runCli,
|
|
725
773
|
ensureGlobalProcessLibrary,
|
|
774
|
+
PLUGIN_BUNDLE_ENTRIES,
|
|
775
|
+
copyRecursive,
|
|
776
|
+
copyPluginBundle,
|
|
777
|
+
DEFAULT_MARKETPLACE,
|
|
778
|
+
normalizeMarketplaceSourcePath,
|
|
779
|
+
ensureMarketplaceEntry,
|
|
780
|
+
removeMarketplaceEntry,
|
|
781
|
+
installManagedSkills,
|
|
782
|
+
mergeManagedHooksConfig,
|
|
783
|
+
installManagedHooks,
|
|
784
|
+
warnWindowsHooks,
|
|
726
785
|
LEGACY_MARKETPLACE_PLUGIN_NAMES,
|
|
727
786
|
LEGACY_SKILL_NAMES,
|
|
728
787
|
LEGACY_PROMPT_NAMES,
|
|
729
788
|
LEGACY_HOOK_SCRIPT_NAMES,
|
|
730
789
|
MANAGED_HOOK_SCRIPT_NAMES,
|
|
731
|
-
DEFAULT_MARKETPLACE,
|
|
732
|
-
PLUGIN_BUNDLE_ENTRIES,
|
|
733
790
|
getCodexHome,
|
|
734
791
|
getHomePluginRoot,
|
|
735
792
|
getHomeMarketplacePath,
|
|
793
|
+
getWorkspacePluginRoot,
|
|
794
|
+
getWorkspaceMarketplacePath,
|
|
736
795
|
renderCodexConfigToml,
|
|
737
|
-
copyRecursive,
|
|
738
|
-
copyPluginBundle,
|
|
739
796
|
insertRootKey,
|
|
740
797
|
ensureSectionLine,
|
|
741
798
|
ensureWritableRoots,
|
|
@@ -745,13 +802,8 @@ module.exports = {
|
|
|
745
802
|
runBabysitterCli,
|
|
746
803
|
ensureGlobalProcessLibrary,
|
|
747
804
|
getMarketplaceRootDir,
|
|
748
|
-
normalizeMarketplaceSourcePath,
|
|
749
|
-
ensureMarketplaceEntry,
|
|
750
|
-
removeMarketplaceEntry,
|
|
751
805
|
removeLegacyCodexSurface,
|
|
752
|
-
installManagedSkills,
|
|
753
|
-
mergeManagedHooksConfig,
|
|
754
|
-
installManagedHooks,
|
|
755
806
|
installCodexSurface,
|
|
756
|
-
|
|
807
|
+
harnessInstall,
|
|
808
|
+
harnessTeamInstall,
|
|
757
809
|
};
|
package/bin/install.js
CHANGED
|
@@ -9,16 +9,15 @@ const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
|
9
9
|
function main() {
|
|
10
10
|
const pluginRoot = shared.getHomePluginRoot();
|
|
11
11
|
const marketplacePath = shared.getHomeMarketplacePath();
|
|
12
|
-
const codexConfigPath = path.join(shared.getCodexHome(), 'config.toml');
|
|
13
12
|
|
|
14
13
|
console.log(`[${shared.PLUGIN_NAME}] Installing plugin to ${pluginRoot}`);
|
|
15
14
|
|
|
16
15
|
try {
|
|
17
16
|
shared.copyPluginBundle(PACKAGE_ROOT, pluginRoot);
|
|
18
17
|
shared.ensureMarketplaceEntry(marketplacePath, pluginRoot);
|
|
19
|
-
shared.
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
if (typeof shared.harnessInstall === 'function') {
|
|
19
|
+
shared.harnessInstall(PACKAGE_ROOT, pluginRoot);
|
|
20
|
+
}
|
|
22
21
|
shared.runPostInstall && shared.runPostInstall(pluginRoot);
|
|
23
22
|
console.log(`[${shared.PLUGIN_NAME}] Installation complete!`);
|
|
24
23
|
console.log(`[${shared.PLUGIN_NAME}] Restart your IDE/CLI to pick up the plugin.`);
|
package/bin/uninstall.js
CHANGED
package/hooks.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "npx -y @a5c-ai/hooks-
|
|
9
|
+
"command": "npx -y -p @a5c-ai/hooks-mux-cli -c \"a5c-hooks-mux invoke --adapter codex --handler 'bash ./hooks/babysitter-proxied-session-start.sh' --json\""
|
|
10
10
|
}
|
|
11
11
|
]
|
|
12
12
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"hooks": [
|
|
18
18
|
{
|
|
19
19
|
"type": "command",
|
|
20
|
-
"command": "npx -y @a5c-ai/hooks-
|
|
20
|
+
"command": "npx -y -p @a5c-ai/hooks-mux-cli -c \"a5c-hooks-mux invoke --adapter codex --handler 'bash ./hooks/babysitter-proxied-stop.sh' --json\""
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"hooks": [
|
|
29
29
|
{
|
|
30
30
|
"type": "command",
|
|
31
|
-
"command": "npx -y @a5c-ai/hooks-
|
|
31
|
+
"command": "npx -y -p @a5c-ai/hooks-mux-cli -c \"a5c-hooks-mux invoke --adapter codex --handler 'bash ./hooks/babysitter-proxied-user-prompt-submit.sh' --json\""
|
|
32
32
|
}
|
|
33
33
|
]
|
|
34
34
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter-codex",
|
|
3
|
-
"version": "5.0.1-staging.
|
|
3
|
+
"version": "5.0.1-staging.26a773f9",
|
|
4
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": "
|
|
7
|
-
"
|
|
6
|
+
"test": "npm run validate:ci",
|
|
7
|
+
"test:integration": "node test/integration.test.js",
|
|
8
|
+
"test:packaged-install": "node test/packaged-install.test.js",
|
|
9
|
+
"validate:ci": "npm run test:integration && npm run test:packaged-install",
|
|
10
|
+
"team:install": "node scripts/team-install.js",
|
|
8
11
|
"deploy": "npm publish --access public",
|
|
9
|
-
"deploy:staging": "npm publish --access public --tag staging"
|
|
10
|
-
"sync:skills": "node scripts/sync-command-skills.js"
|
|
12
|
+
"deploy:staging": "npm publish --access public --tag staging"
|
|
11
13
|
},
|
|
12
14
|
"bin": {
|
|
13
15
|
"babysitter-codex": "bin/cli.js"
|
|
@@ -36,9 +38,11 @@
|
|
|
36
38
|
},
|
|
37
39
|
"repository": {
|
|
38
40
|
"type": "git",
|
|
39
|
-
"url": "https://github.com/a5c-ai/babysitter"
|
|
41
|
+
"url": "git+https://github.com/a5c-ai/babysitter.git",
|
|
42
|
+
"directory": "plugins/babysitter-codex"
|
|
40
43
|
},
|
|
41
|
-
"
|
|
42
|
-
|
|
44
|
+
"homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-codex#readme",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/a5c-ai/babysitter/issues"
|
|
43
47
|
}
|
|
44
48
|
}
|
package/scripts/team-install.js
CHANGED
|
@@ -12,38 +12,12 @@ for (var i = 0; i < process.argv.length; i++) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
var src = process.env.PLUGIN_PACKAGE_ROOT || path.resolve(__dirname, '..');
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var codexHome = path.join(workspace, '.codex');
|
|
18
|
-
var codexConfigPath = path.join(codexHome, 'config.toml');
|
|
19
|
-
var teamDir = path.join(workspace, '.a5c', 'team');
|
|
15
|
+
var dest = shared.getWorkspacePluginRoot(workspace);
|
|
16
|
+
console.log('[babysitter] Team install to ' + dest);
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
shared.
|
|
26
|
-
|
|
27
|
-
shared.installCodexSurface(src, codexHome);
|
|
28
|
-
shared.warnWindowsHooks();
|
|
29
|
-
shared.runPostInstall(pluginRoot);
|
|
30
|
-
|
|
31
|
-
shared.writeJson(path.join(teamDir, 'install.json'), {
|
|
32
|
-
packageRoot: src,
|
|
33
|
-
workspaceRoot: workspace,
|
|
34
|
-
pluginRoot: pluginRoot,
|
|
35
|
-
marketplacePath: marketplacePath,
|
|
36
|
-
codexConfigPath: codexConfigPath,
|
|
37
|
-
processLibraryCloneDir: (processLibraryState.defaultSpec && processLibraryState.defaultSpec.cloneDir)
|
|
38
|
-
|| (processLibraryState.binding && processLibraryState.binding.dir),
|
|
39
|
-
processLibraryStateFile: processLibraryState.stateFile
|
|
40
|
-
|| path.join(shared.getGlobalStateDir(), 'active', 'process-library.json'),
|
|
41
|
-
});
|
|
42
|
-
shared.writeJson(path.join(teamDir, 'profile.json'), {
|
|
43
|
-
pluginRoot: pluginRoot,
|
|
44
|
-
marketplacePath: marketplacePath,
|
|
45
|
-
codexConfigPath: codexConfigPath,
|
|
46
|
-
processLibraryLookupCommand: 'babysitter process-library:active --json',
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
console.log('[team-install] complete');
|
|
18
|
+
shared.copyPluginBundle(src, dest);
|
|
19
|
+
if (typeof shared.harnessTeamInstall === 'function') {
|
|
20
|
+
shared.harnessTeamInstall(src, dest, workspace);
|
|
21
|
+
}
|
|
22
|
+
shared.runPostInstall(dest);
|
|
23
|
+
console.log('[babysitter] Team install complete.');
|
package/hooks/hooks.json
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hooks": {
|
|
3
|
-
"SessionStart": [
|
|
4
|
-
{
|
|
5
|
-
"matcher": ".*",
|
|
6
|
-
"hooks": [
|
|
7
|
-
{
|
|
8
|
-
"type": "command",
|
|
9
|
-
"command": "npx -y @a5c-ai/hooks-proxy-cli invoke --adapter codex --handler \"bash ./hooks/babysitter-proxied-session-start.sh\" --json"
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"Stop": [
|
|
15
|
-
{
|
|
16
|
-
"matcher": ".*",
|
|
17
|
-
"hooks": [
|
|
18
|
-
{
|
|
19
|
-
"type": "command",
|
|
20
|
-
"command": "npx -y @a5c-ai/hooks-proxy-cli invoke --adapter codex --handler \"bash ./hooks/babysitter-proxied-stop.sh\" --json"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"UserPromptSubmit": [
|
|
26
|
-
{
|
|
27
|
-
"matcher": ".*",
|
|
28
|
-
"hooks": [
|
|
29
|
-
{
|
|
30
|
-
"type": "command",
|
|
31
|
-
"command": "npx -y @a5c-ai/hooks-proxy-cli invoke --adapter codex --handler \"bash ./hooks/babysitter-proxied-user-prompt-submit.sh\" --json"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
}
|