@a5c-ai/babysitter-github 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/bin/cli.js +7 -8
- package/bin/install-shared.js +65 -22
- package/bin/install.js +30 -14
- package/bin/uninstall.js +25 -4
- package/hooks.json +6 -6
- package/package.json +13 -11
- package/plugin.json +1 -1
- package/scripts/sync-command-surfaces.js +12 -54
- package/scripts/team-install.js +4 -1
- package/versions.json +2 -1
- package/hooks/session-end.ps1 +0 -12
- package/hooks/session-end.sh +0 -3
- package/hooks/session-start.ps1 +0 -12
- package/hooks/session-start.sh +0 -11
- package/hooks/user-prompt-submitted.ps1 +0 -12
- package/hooks/user-prompt-submitted.sh +0 -3
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([
|
|
@@ -18,7 +20,6 @@ function printUsage() {
|
|
|
18
20
|
function parseInstallArgs(argv) {
|
|
19
21
|
let scope = 'global';
|
|
20
22
|
let workspace = null;
|
|
21
|
-
let cloudAgent = false;
|
|
22
23
|
const passthrough = [];
|
|
23
24
|
|
|
24
25
|
for (let i = 0; i < argv.length; i += 1) {
|
|
@@ -38,15 +39,10 @@ function parseInstallArgs(argv) {
|
|
|
38
39
|
}
|
|
39
40
|
continue;
|
|
40
41
|
}
|
|
41
|
-
if (arg === '--cloud-agent') {
|
|
42
|
-
cloudAgent = true;
|
|
43
|
-
passthrough.push(arg);
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
42
|
passthrough.push(arg);
|
|
47
43
|
}
|
|
48
44
|
|
|
49
|
-
return { scope, workspace,
|
|
45
|
+
return { scope, workspace, passthrough };
|
|
50
46
|
}
|
|
51
47
|
|
|
52
48
|
function runNodeScript(scriptPath, args, extraEnv = {}) {
|
|
@@ -67,8 +63,11 @@ function main() {
|
|
|
67
63
|
}
|
|
68
64
|
|
|
69
65
|
if (command === 'install') {
|
|
66
|
+
if (shared && typeof shared.harnessCliRoute === 'function' && shared.harnessCliRoute(rest, PACKAGE_ROOT, runNodeScript)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
70
69
|
const parsed = parseInstallArgs(rest);
|
|
71
|
-
if (parsed.
|
|
70
|
+
if (parsed.passthrough.includes('--cloud-agent')) {
|
|
72
71
|
const args = [...parsed.passthrough];
|
|
73
72
|
if (parsed.workspace) {
|
|
74
73
|
args.push('--workspace', parsed.workspace);
|
package/bin/install-shared.js
CHANGED
|
@@ -13,7 +13,7 @@ function getUserHome() {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function getHarnessHome() {
|
|
16
|
-
return path.join(os.homedir(),
|
|
16
|
+
return path.join(os.homedir(), ".copilot");
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function getHomePluginRoot(scope) {
|
|
@@ -206,12 +206,12 @@ const LEGACY_HOOK_SCRIPT_NAMES = [
|
|
|
206
206
|
'user-prompt-submit.sh',
|
|
207
207
|
];
|
|
208
208
|
const HOOK_SCRIPT_NAMES = [
|
|
209
|
-
'session-start.sh',
|
|
210
|
-
'session-start.ps1',
|
|
211
|
-
'session-end.sh',
|
|
212
|
-
'session-end.ps1',
|
|
213
|
-
'user-prompt-submitted.sh',
|
|
214
|
-
'user-prompt-submitted.ps1',
|
|
209
|
+
'babysitter-proxied-session-start.sh',
|
|
210
|
+
'babysitter-proxied-session-start.ps1',
|
|
211
|
+
'babysitter-proxied-session-end.sh',
|
|
212
|
+
'babysitter-proxied-session-end.ps1',
|
|
213
|
+
'babysitter-proxied-user-prompt-submitted.sh',
|
|
214
|
+
'babysitter-proxied-user-prompt-submitted.ps1',
|
|
215
215
|
];
|
|
216
216
|
const DEFAULT_MARKETPLACE = {
|
|
217
217
|
name: 'local-plugins',
|
|
@@ -454,8 +454,9 @@ function installManagedHooks(packageRoot, copilotHome) {
|
|
|
454
454
|
mergeManagedHooksConfig(packageRoot, copilotHome);
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
function
|
|
458
|
-
|
|
457
|
+
function removeManagedHooks(copilotHome) {
|
|
458
|
+
const managedHookNames = [...LEGACY_HOOK_SCRIPT_NAMES, ...HOOK_SCRIPT_NAMES];
|
|
459
|
+
for (const hookName of managedHookNames) {
|
|
459
460
|
fs.rmSync(path.join(copilotHome, 'hooks', hookName), { force: true });
|
|
460
461
|
}
|
|
461
462
|
|
|
@@ -476,10 +477,17 @@ function removeLegacyHooks(copilotHome) {
|
|
|
476
477
|
const eventHooks = Array.isArray(hooksConfig.hooks[eventName]) ? hooksConfig.hooks[eventName] : [];
|
|
477
478
|
const filteredMatchers = eventHooks
|
|
478
479
|
.map((matcher) => {
|
|
480
|
+
const directBash = String(matcher?.bash || matcher?.command || '');
|
|
481
|
+
const directPs = String(matcher?.powershell || '');
|
|
482
|
+
const hasDirectHook = directBash.length > 0 || directPs.length > 0;
|
|
483
|
+
const directIsManaged = managedHookNames.some((name) => directBash.includes(name) || directPs.includes(name));
|
|
484
|
+
if (hasDirectHook) {
|
|
485
|
+
return directIsManaged ? null : matcher;
|
|
486
|
+
}
|
|
479
487
|
const hooks = Array.isArray(matcher.hooks) ? matcher.hooks : [];
|
|
480
488
|
const keptHooks = hooks.filter((hook) => {
|
|
481
489
|
const command = String(hook.command || '');
|
|
482
|
-
return !
|
|
490
|
+
return !managedHookNames.some((name) => command.includes(name));
|
|
483
491
|
});
|
|
484
492
|
return keptHooks.length > 0 ? { ...matcher, hooks: keptHooks } : null;
|
|
485
493
|
})
|
|
@@ -498,11 +506,13 @@ function removeLegacyHooks(copilotHome) {
|
|
|
498
506
|
}
|
|
499
507
|
|
|
500
508
|
function installCopilotSurface(packageRoot, copilotHome) {
|
|
501
|
-
|
|
509
|
+
removeManagedHooks(copilotHome);
|
|
502
510
|
installManagedSkills(packageRoot, copilotHome);
|
|
503
511
|
installManagedHooks(packageRoot, copilotHome);
|
|
504
512
|
}
|
|
505
513
|
|
|
514
|
+
const removeLegacyHooks = removeManagedHooks;
|
|
515
|
+
|
|
506
516
|
function renderCloudAgentAgentsBlock() {
|
|
507
517
|
return [
|
|
508
518
|
'## Babysitter Cloud Agent',
|
|
@@ -787,6 +797,36 @@ function copyRecursive(src, dest) {
|
|
|
787
797
|
fs.copyFileSync(src, dest);
|
|
788
798
|
}
|
|
789
799
|
|
|
800
|
+
function harnessCliRoute(argv, packageRoot, runNodeScript) {
|
|
801
|
+
if (argv.includes('--cloud-agent')) {
|
|
802
|
+
const args = argv.filter(a => a !== '--cloud-agent');
|
|
803
|
+
args.push('--cloud-agent');
|
|
804
|
+
runNodeScript(path.join(packageRoot, 'bin', 'install.js'), args);
|
|
805
|
+
return true;
|
|
806
|
+
}
|
|
807
|
+
return false;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
function harnessInstall(packageRoot, _pluginRoot) {
|
|
811
|
+
const argv = process.argv.slice(2);
|
|
812
|
+
if (!argv.includes('--cloud-agent')) return;
|
|
813
|
+
const workspaceIdx = argv.indexOf('--workspace');
|
|
814
|
+
const workspaceRoot = (workspaceIdx >= 0 && argv[workspaceIdx + 1])
|
|
815
|
+
? path.resolve(argv[workspaceIdx + 1])
|
|
816
|
+
: process.cwd();
|
|
817
|
+
console.log(`[${PLUGIN_NAME}] Installing cloud-agent support into ${workspaceRoot}`);
|
|
818
|
+
const activeProcessLibrary = runCli(packageRoot, [
|
|
819
|
+
'process-library:active',
|
|
820
|
+
'--json',
|
|
821
|
+
], { stdio: 'pipe' });
|
|
822
|
+
if (activeProcessLibrary.status !== 0) {
|
|
823
|
+
ensureGlobalProcessLibrary(packageRoot);
|
|
824
|
+
}
|
|
825
|
+
installCloudAgentSurface(packageRoot, workspaceRoot);
|
|
826
|
+
console.log(`[${PLUGIN_NAME}] Cloud-agent installation complete!`);
|
|
827
|
+
process.exit(0);
|
|
828
|
+
}
|
|
829
|
+
|
|
790
830
|
|
|
791
831
|
module.exports = {
|
|
792
832
|
PLUGIN_NAME,
|
|
@@ -801,10 +841,19 @@ module.exports = {
|
|
|
801
841
|
resolveCliCommand,
|
|
802
842
|
runCli,
|
|
803
843
|
ensureGlobalProcessLibrary,
|
|
844
|
+
PLUGIN_BUNDLE_ENTRIES,
|
|
845
|
+
copyRecursive,
|
|
846
|
+
copyPluginBundle,
|
|
847
|
+
DEFAULT_MARKETPLACE,
|
|
848
|
+
normalizeMarketplaceSourcePath,
|
|
849
|
+
ensureMarketplaceEntry,
|
|
850
|
+
removeMarketplaceEntry,
|
|
851
|
+
installManagedSkills,
|
|
852
|
+
mergeManagedHooksConfig,
|
|
853
|
+
installManagedHooks,
|
|
854
|
+
warnWindowsHooks,
|
|
804
855
|
LEGACY_HOOK_SCRIPT_NAMES,
|
|
805
856
|
HOOK_SCRIPT_NAMES,
|
|
806
|
-
DEFAULT_MARKETPLACE,
|
|
807
|
-
PLUGIN_BUNDLE_ENTRIES,
|
|
808
857
|
CLOUD_AGENT_BUNDLE_ENTRIES,
|
|
809
858
|
MANAGED_BLOCK_START,
|
|
810
859
|
MANAGED_BLOCK_END,
|
|
@@ -819,10 +868,8 @@ module.exports = {
|
|
|
819
868
|
rewriteCloudSkill,
|
|
820
869
|
registerCopilotPlugin,
|
|
821
870
|
deregisterCopilotPlugin,
|
|
822
|
-
installManagedSkills,
|
|
823
|
-
mergeManagedHooksConfig,
|
|
824
|
-
installManagedHooks,
|
|
825
871
|
removeLegacyHooks,
|
|
872
|
+
removeManagedHooks,
|
|
826
873
|
installCopilotSurface,
|
|
827
874
|
renderCloudAgentAgentsBlock,
|
|
828
875
|
renderCloudAgentCopilotInstructionsBlock,
|
|
@@ -832,10 +879,6 @@ module.exports = {
|
|
|
832
879
|
installCloudAgentInstructions,
|
|
833
880
|
installCloudAgentSetupSteps,
|
|
834
881
|
installCloudAgentSurface,
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
removeMarketplaceEntry,
|
|
838
|
-
warnWindowsHooks,
|
|
839
|
-
copyPluginBundle,
|
|
840
|
-
copyRecursive,
|
|
882
|
+
harnessCliRoute,
|
|
883
|
+
harnessInstall,
|
|
841
884
|
};
|
package/bin/install.js
CHANGED
|
@@ -7,8 +7,8 @@ const shared = require('./install-shared');
|
|
|
7
7
|
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
8
8
|
|
|
9
9
|
function parseArgs(argv) {
|
|
10
|
-
let cloudAgent = false;
|
|
11
10
|
let workspace = null;
|
|
11
|
+
let cloudAgent = false;
|
|
12
12
|
|
|
13
13
|
for (let i = 0; i < argv.length; i += 1) {
|
|
14
14
|
const arg = argv[i];
|
|
@@ -31,26 +31,30 @@ function parseArgs(argv) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function main() {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const options = parseArgs(process.argv.slice(2));
|
|
35
|
+
|
|
36
|
+
if (options.cloudAgent) {
|
|
37
|
+
if (!options.workspace) {
|
|
38
|
+
console.error(`[${shared.PLUGIN_NAME}] Failed to install: --cloud-agent requires --workspace <path>.`);
|
|
39
|
+
process.exitCode = 1;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
38
42
|
|
|
39
43
|
try {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const installResult = shared.installCloudAgentSurface(PACKAGE_ROOT, options.workspace);
|
|
45
|
+
shared.ensureGlobalProcessLibrary(PACKAGE_ROOT);
|
|
46
|
+
console.log(`[${shared.PLUGIN_NAME}] Installed cloud-agent support into ${options.workspace}`);
|
|
47
|
+
if (installResult.setupWorkflow && installResult.setupWorkflow.examplePath) {
|
|
48
|
+
console.log(
|
|
49
|
+
`[${shared.PLUGIN_NAME}] Existing copilot setup workflow preserved; merge candidate written to ${installResult.setupWorkflow.examplePath}`,
|
|
50
|
+
);
|
|
46
51
|
}
|
|
47
|
-
|
|
48
|
-
console.log(`[${shared.PLUGIN_NAME}] Cloud-agent installation complete!`);
|
|
52
|
+
return;
|
|
49
53
|
} catch (err) {
|
|
50
54
|
console.error(`[${shared.PLUGIN_NAME}] Failed to install cloud-agent support: ${err.message}`);
|
|
51
55
|
process.exitCode = 1;
|
|
56
|
+
return;
|
|
52
57
|
}
|
|
53
|
-
return;
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
const pluginRoot = shared.getHomePluginRoot();
|
|
@@ -61,6 +65,18 @@ function main() {
|
|
|
61
65
|
try {
|
|
62
66
|
shared.copyPluginBundle(PACKAGE_ROOT, pluginRoot);
|
|
63
67
|
shared.ensureMarketplaceEntry(marketplacePath, pluginRoot);
|
|
68
|
+
if (typeof shared.registerCopilotPlugin === 'function') {
|
|
69
|
+
shared.registerCopilotPlugin(pluginRoot);
|
|
70
|
+
}
|
|
71
|
+
if (typeof shared.installCopilotSurface === 'function' && typeof shared.getCopilotHome === 'function') {
|
|
72
|
+
shared.installCopilotSurface(PACKAGE_ROOT, shared.getCopilotHome());
|
|
73
|
+
}
|
|
74
|
+
if (typeof shared.warnWindowsHooks === 'function') {
|
|
75
|
+
shared.warnWindowsHooks();
|
|
76
|
+
}
|
|
77
|
+
if (typeof shared.harnessInstall === 'function') {
|
|
78
|
+
shared.harnessInstall(PACKAGE_ROOT, pluginRoot);
|
|
79
|
+
}
|
|
64
80
|
shared.runPostInstall && shared.runPostInstall(pluginRoot);
|
|
65
81
|
console.log(`[${shared.PLUGIN_NAME}] Installation complete!`);
|
|
66
82
|
console.log(`[${shared.PLUGIN_NAME}] Restart your IDE/CLI to pick up the plugin.`);
|
package/bin/uninstall.js
CHANGED
|
@@ -7,17 +7,38 @@ const shared = require('./install-shared');
|
|
|
7
7
|
|
|
8
8
|
function main() {
|
|
9
9
|
const pluginRoot = shared.getHomePluginRoot();
|
|
10
|
+
const marketplacePath = typeof shared.getHomeMarketplacePath === 'function'
|
|
11
|
+
? shared.getHomeMarketplacePath()
|
|
12
|
+
: null;
|
|
13
|
+
const copilotHome = typeof shared.getCopilotHome === 'function'
|
|
14
|
+
? shared.getCopilotHome()
|
|
15
|
+
: null;
|
|
10
16
|
|
|
11
17
|
if (!fs.existsSync(pluginRoot)) {
|
|
12
18
|
console.log(`[${shared.PLUGIN_NAME}] Plugin not installed at ${pluginRoot}`);
|
|
13
|
-
|
|
19
|
+
} else {
|
|
20
|
+
try {
|
|
21
|
+
fs.rmSync(pluginRoot, { recursive: true, force: true });
|
|
22
|
+
console.log(`[${shared.PLUGIN_NAME}] Uninstalled from ${pluginRoot}`);
|
|
23
|
+
} catch (err) {
|
|
24
|
+
console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
|
|
25
|
+
process.exitCode = 1;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
14
28
|
}
|
|
15
29
|
|
|
16
30
|
try {
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
if (typeof shared.deregisterCopilotPlugin === 'function') {
|
|
32
|
+
shared.deregisterCopilotPlugin(pluginRoot);
|
|
33
|
+
}
|
|
34
|
+
if (copilotHome && typeof shared.removeManagedHooks === 'function') {
|
|
35
|
+
shared.removeManagedHooks(copilotHome);
|
|
36
|
+
}
|
|
37
|
+
if (marketplacePath && typeof shared.removeMarketplaceEntry === 'function') {
|
|
38
|
+
shared.removeMarketplaceEntry(marketplacePath);
|
|
39
|
+
}
|
|
19
40
|
} catch (err) {
|
|
20
|
-
console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
|
|
41
|
+
console.error(`[${shared.PLUGIN_NAME}] Failed to clean up uninstall state: ${err.message}`);
|
|
21
42
|
process.exitCode = 1;
|
|
22
43
|
}
|
|
23
44
|
}
|
package/hooks.json
CHANGED
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
"sessionStart": [
|
|
5
5
|
{
|
|
6
6
|
"type": "command",
|
|
7
|
-
"bash": "./hooks/session-start.sh",
|
|
8
|
-
"powershell": "./hooks/session-start.ps1",
|
|
7
|
+
"bash": "./hooks/babysitter-proxied-session-start.sh",
|
|
8
|
+
"powershell": "./hooks/babysitter-proxied-session-start.ps1",
|
|
9
9
|
"timeoutSec": 30
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"userPromptSubmitted": [
|
|
13
13
|
{
|
|
14
14
|
"type": "command",
|
|
15
|
-
"bash": "./hooks/user-prompt-submitted.sh",
|
|
16
|
-
"powershell": "./hooks/user-prompt-submitted.ps1",
|
|
15
|
+
"bash": "./hooks/babysitter-proxied-user-prompt-submitted.sh",
|
|
16
|
+
"powershell": "./hooks/babysitter-proxied-user-prompt-submitted.ps1",
|
|
17
17
|
"timeoutSec": 15
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
20
|
"sessionEnd": [
|
|
21
21
|
{
|
|
22
22
|
"type": "command",
|
|
23
|
-
"bash": "./hooks/session-end.sh",
|
|
24
|
-
"powershell": "./hooks/session-end.ps1",
|
|
23
|
+
"bash": "./hooks/babysitter-proxied-session-end.sh",
|
|
24
|
+
"powershell": "./hooks/babysitter-proxied-session-end.ps1",
|
|
25
25
|
"timeoutSec": 30
|
|
26
26
|
}
|
|
27
27
|
]
|
package/package.json
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter-github",
|
|
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
6
|
"deploy": "npm publish --access public",
|
|
7
7
|
"deploy:staging": "npm publish --access public --tag staging",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"team:install": "node scripts/team-install.js"
|
|
11
|
-
"test": "node scripts/sync-command-surfaces.js --check",
|
|
12
|
-
"sync:commands": "node scripts/sync-command-surfaces.js"
|
|
8
|
+
"plugin:install": "node bin/install.js --global",
|
|
9
|
+
"plugin:uninstall": "node bin/uninstall.js --global",
|
|
10
|
+
"team:install": "node scripts/team-install.js"
|
|
13
11
|
},
|
|
14
12
|
"bin": {
|
|
15
|
-
"babysitter-github
|
|
13
|
+
"babysitter-github": "bin/cli.js"
|
|
16
14
|
},
|
|
17
15
|
"files": [
|
|
18
16
|
"bin/",
|
|
19
17
|
"hooks.json",
|
|
18
|
+
"AGENTS.md",
|
|
20
19
|
"hooks/",
|
|
21
20
|
"skills/",
|
|
22
21
|
"commands/",
|
|
23
22
|
"scripts/",
|
|
24
23
|
"plugin.json",
|
|
25
|
-
"AGENTS.md",
|
|
26
24
|
"README.md",
|
|
27
25
|
"versions.json",
|
|
28
26
|
"package.json"
|
|
@@ -38,11 +36,15 @@
|
|
|
38
36
|
"access": "public"
|
|
39
37
|
},
|
|
40
38
|
"dependencies": {
|
|
41
|
-
"@a5c-ai/babysitter-sdk": "5.0.1-staging.
|
|
39
|
+
"@a5c-ai/babysitter-sdk": "5.0.1-staging.26a773f9"
|
|
42
40
|
},
|
|
43
41
|
"repository": {
|
|
44
42
|
"type": "git",
|
|
45
|
-
"url": "https://github.com/a5c-ai/babysitter"
|
|
43
|
+
"url": "git+https://github.com/a5c-ai/babysitter.git",
|
|
44
|
+
"directory": "plugins/babysitter-github"
|
|
46
45
|
},
|
|
47
|
-
"homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-github#readme"
|
|
46
|
+
"homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-github#readme",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/a5c-ai/babysitter/issues"
|
|
49
|
+
}
|
|
48
50
|
}
|
package/plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babysitter",
|
|
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
|
"author": {
|
|
6
6
|
"name": "a5c.ai"
|
|
@@ -1,62 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
const path = require('path');
|
|
4
|
-
const {
|
|
5
|
-
listDirectories,
|
|
6
|
-
listMarkdownBasenames,
|
|
7
|
-
reportCheckResult,
|
|
8
|
-
syncCommandMirrors,
|
|
9
|
-
syncSkillsFromCommands,
|
|
10
|
-
} = require('../../../scripts/plugin-command-sync-lib.cjs');
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
11
6
|
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const PLUGIN_COMMANDS = path.join(PACKAGE_ROOT, 'commands');
|
|
16
|
-
const PLUGIN_SKILLS = path.join(PACKAGE_ROOT, 'skills');
|
|
17
|
-
const LABEL = 'babysitter-github sync';
|
|
7
|
+
const REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
8
|
+
const syncScript = path.join(REPO_ROOT, 'scripts', 'sync-plugin-commands.cjs');
|
|
9
|
+
const args = [syncScript, '--target', 'github-copilot'];
|
|
18
10
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return listMarkdownBasenames(ROOT_COMMANDS).filter((name) => local.has(name));
|
|
11
|
+
if (process.argv.includes('--check')) {
|
|
12
|
+
args.push('--check');
|
|
22
13
|
}
|
|
23
14
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function main() {
|
|
30
|
-
const check = process.argv.includes('--check');
|
|
31
|
-
const mirrorResult = syncCommandMirrors({
|
|
32
|
-
label: LABEL,
|
|
33
|
-
sourceRoot: ROOT_COMMANDS,
|
|
34
|
-
targetRoot: PLUGIN_COMMANDS,
|
|
35
|
-
names: getMirroredCommandNames(),
|
|
36
|
-
check,
|
|
37
|
-
cwd: PACKAGE_ROOT,
|
|
38
|
-
});
|
|
39
|
-
const skillsResult = syncSkillsFromCommands({
|
|
40
|
-
label: LABEL,
|
|
41
|
-
sourceRoot: PLUGIN_COMMANDS,
|
|
42
|
-
skillsRoot: PLUGIN_SKILLS,
|
|
43
|
-
names: getDerivedSkillNames(),
|
|
44
|
-
check,
|
|
45
|
-
cwd: PACKAGE_ROOT,
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
if (check) {
|
|
49
|
-
reportCheckResult(LABEL, [...mirrorResult.stale, ...skillsResult.stale]);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const updated = mirrorResult.updated + skillsResult.updated;
|
|
54
|
-
if (updated === 0) {
|
|
55
|
-
console.log(`[${LABEL}] no GitHub plugin command changes were needed.`);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
console.log(`[${LABEL}] updated ${updated} GitHub plugin file(s).`);
|
|
60
|
-
}
|
|
15
|
+
const result = spawnSync(process.execPath, args, {
|
|
16
|
+
cwd: REPO_ROOT,
|
|
17
|
+
stdio: 'inherit',
|
|
18
|
+
});
|
|
61
19
|
|
|
62
|
-
|
|
20
|
+
process.exit(result.status ?? 1);
|
package/scripts/team-install.js
CHANGED
|
@@ -11,10 +11,13 @@ for (var i = 0; i < process.argv.length; i++) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
var src = process.env.PLUGIN_PACKAGE_ROOT || path.resolve(__dirname, '..');
|
|
14
15
|
var dest = shared.getHomePluginRoot('workspace');
|
|
15
16
|
console.log('[babysitter] Team install to ' + dest);
|
|
16
17
|
|
|
17
|
-
var src = process.env.PLUGIN_PACKAGE_ROOT || path.resolve(__dirname, '..');
|
|
18
18
|
shared.copyPluginBundle(src, dest);
|
|
19
|
+
if (typeof shared.harnessTeamInstall === 'function') {
|
|
20
|
+
shared.harnessTeamInstall(src, dest, workspace);
|
|
21
|
+
}
|
|
19
22
|
shared.runPostInstall(dest);
|
|
20
23
|
console.log('[babysitter] Team install complete.');
|
package/versions.json
CHANGED
package/hooks/session-end.ps1
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# PowerShell hook wrapper — sets env vars and delegates to bash
|
|
2
|
-
$env:HOOK_TYPE = 'session-end'
|
|
3
|
-
$env:ADAPTER_NAME = 'copilot'
|
|
4
|
-
$env:PLUGIN_ROOT = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
|
|
5
|
-
|
|
6
|
-
$input_data = [Console]::In.ReadToEnd()
|
|
7
|
-
$result = $input_data | & bash "$PSScriptRoot/../$($MyInvocation.MyCommand.Name -replace '\.ps1$','.sh')" 2>$null
|
|
8
|
-
if ($LASTEXITCODE -eq 0 -and $result) {
|
|
9
|
-
Write-Output $result
|
|
10
|
-
} else {
|
|
11
|
-
Write-Output '{}'
|
|
12
|
-
}
|
package/hooks/session-end.sh
DELETED
package/hooks/session-start.ps1
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# PowerShell hook wrapper — sets env vars and delegates to bash
|
|
2
|
-
$env:HOOK_TYPE = 'session-start'
|
|
3
|
-
$env:ADAPTER_NAME = 'copilot'
|
|
4
|
-
$env:PLUGIN_ROOT = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
|
|
5
|
-
|
|
6
|
-
$input_data = [Console]::In.ReadToEnd()
|
|
7
|
-
$result = $input_data | & bash "$PSScriptRoot/../$($MyInvocation.MyCommand.Name -replace '\.ps1$','.sh')" 2>$null
|
|
8
|
-
if ($LASTEXITCODE -eq 0 -and $result) {
|
|
9
|
-
Write-Output $result
|
|
10
|
-
} else {
|
|
11
|
-
Write-Output '{}'
|
|
12
|
-
}
|
package/hooks/session-start.sh
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Session Start — installs SDK if needed, then runs hook handler.
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
PLUGIN_ROOT="${PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"
|
|
5
|
-
SDK_VERSION=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('${PLUGIN_ROOT}/versions.json','utf8')).sdkVersion||'latest')}catch{console.log('latest')}" 2>/dev/null || echo "latest")
|
|
6
|
-
if ! command -v babysitter &>/dev/null; then
|
|
7
|
-
npm i -g "@a5c-ai/babysitter-sdk@${SDK_VERSION}" --loglevel=error 2>/dev/null || \
|
|
8
|
-
npm i -g "@a5c-ai/babysitter-sdk@${SDK_VERSION}" --prefix "$HOME/.local" --loglevel=error 2>/dev/null || true
|
|
9
|
-
[ -d "$HOME/.local/bin" ] && export PATH="$HOME/.local/bin:$PATH"
|
|
10
|
-
fi
|
|
11
|
-
babysitter hook:run --harness unified --hook-type session-start --json
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# PowerShell hook wrapper — sets env vars and delegates to bash
|
|
2
|
-
$env:HOOK_TYPE = 'user-prompt-submit'
|
|
3
|
-
$env:ADAPTER_NAME = 'copilot'
|
|
4
|
-
$env:PLUGIN_ROOT = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
|
|
5
|
-
|
|
6
|
-
$input_data = [Console]::In.ReadToEnd()
|
|
7
|
-
$result = $input_data | & bash "$PSScriptRoot/../$($MyInvocation.MyCommand.Name -replace '\.ps1$','.sh')" 2>$null
|
|
8
|
-
if ($LASTEXITCODE -eq 0 -and $result) {
|
|
9
|
-
Write-Output $result
|
|
10
|
-
} else {
|
|
11
|
-
Write-Output '{}'
|
|
12
|
-
}
|