@teamvibe/poller 0.1.22 → 0.1.24
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/dist/brain-manager.d.ts +1 -1
- package/dist/brain-manager.js +16 -14
- package/package.json +1 -1
package/dist/brain-manager.d.ts
CHANGED
package/dist/brain-manager.js
CHANGED
|
@@ -5,30 +5,32 @@ import { join } from 'path';
|
|
|
5
5
|
import { config } from './config.js';
|
|
6
6
|
import { logger } from './logger.js';
|
|
7
7
|
const execAsync = promisify(exec);
|
|
8
|
-
// Clean env for git commands
|
|
9
|
-
// prevents
|
|
8
|
+
// Clean env for git commands:
|
|
9
|
+
// - npm/npx sets GIT_ASKPASS which prevents credential helpers from working
|
|
10
|
+
// - PERSISTENT_STORAGE_PATH/bin may contain tools like gh not in default PATH
|
|
10
11
|
const gitEnv = { ...process.env };
|
|
11
12
|
delete gitEnv['GIT_ASKPASS'];
|
|
13
|
+
if (config.PERSISTENT_STORAGE_PATH) {
|
|
14
|
+
const binDir = `${config.PERSISTENT_STORAGE_PATH}/bin`;
|
|
15
|
+
if (!gitEnv['PATH']?.includes(binDir)) {
|
|
16
|
+
gitEnv['PATH'] = `${binDir}:${gitEnv['PATH'] || ''}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
12
19
|
function gitExec(command, options) {
|
|
13
20
|
return execAsync(command, { ...options, env: gitEnv });
|
|
14
21
|
}
|
|
15
22
|
/**
|
|
16
23
|
* Configure git auth using `gh auth setup-git`.
|
|
17
|
-
*
|
|
24
|
+
* Uses gitEnv which includes /data/bin in PATH.
|
|
18
25
|
*/
|
|
19
26
|
export async function configureGitAuth() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
// try next path
|
|
29
|
-
}
|
|
27
|
+
try {
|
|
28
|
+
await gitExec('gh auth setup-git');
|
|
29
|
+
logger.info('Git authentication configured via gh');
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
logger.warn(`Could not configure git auth: ${error instanceof Error ? error.message : error}`);
|
|
30
33
|
}
|
|
31
|
-
logger.warn('Could not configure git auth: gh not found in PATH or /data/bin');
|
|
32
34
|
}
|
|
33
35
|
// Cooldown tracker per brain
|
|
34
36
|
const lastUpdateTimes = new Map();
|