@teamvibe/poller 0.1.20 → 0.1.22

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.
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Log git auth diagnostics to help debug credential issues.
2
+ * Configure git auth using `gh auth setup-git`.
3
+ * Finds gh binary in PATH or common locations (/data/bin).
3
4
  */
4
- export declare function logGitDiagnostics(): Promise<void>;
5
+ export declare function configureGitAuth(): Promise<void>;
5
6
  interface BrainConfig {
6
7
  brainId: string;
7
8
  gitRepoUrl: string;
@@ -13,27 +13,22 @@ function gitExec(command, options) {
13
13
  return execAsync(command, { ...options, env: gitEnv });
14
14
  }
15
15
  /**
16
- * Log git auth diagnostics to help debug credential issues.
16
+ * Configure git auth using `gh auth setup-git`.
17
+ * Finds gh binary in PATH or common locations (/data/bin).
17
18
  */
18
- export async function logGitDiagnostics() {
19
- const diag = async (label, cmd) => {
19
+ export async function configureGitAuth() {
20
+ const ghPaths = ['gh', '/data/bin/gh'];
21
+ for (const gh of ghPaths) {
20
22
  try {
21
- const { stdout } = await execAsync(cmd);
22
- logger.info(`[git-diag] ${label}: ${stdout.trim()}`);
23
+ await execAsync(`${gh} auth setup-git`);
24
+ logger.info(`Git authentication configured via ${gh}`);
25
+ return;
23
26
  }
24
- catch (e) {
25
- logger.warn(`[git-diag] ${label}: FAILED - ${e instanceof Error ? e.message : e}`);
27
+ catch {
28
+ // try next path
26
29
  }
27
- };
28
- logger.info(`[git-diag] GIT_ASKPASS=${process.env['GIT_ASKPASS'] ?? '(unset)'}`);
29
- logger.info(`[git-diag] GIT_TERMINAL_PROMPT=${process.env['GIT_TERMINAL_PROMPT'] ?? '(unset)'}`);
30
- logger.info(`[git-diag] GITHUB_TOKEN=${process.env['GITHUB_TOKEN'] ? '***set***' : '(unset)'}`);
31
- logger.info(`[git-diag] HOME=${process.env['HOME'] ?? '(unset)'}`);
32
- await diag('git version', 'git --version');
33
- await diag('gh version', 'gh --version | head -1');
34
- await diag('credential.helper', 'git config --global credential.helper || echo "(not set)"');
35
- await diag('credential.github', 'git config --global --get-regexp "credential.*github" || echo "(not set)"');
36
- await diag('gh auth status', 'gh auth status 2>&1 || true');
30
+ }
31
+ logger.warn('Could not configure git auth: gh not found in PATH or /data/bin');
37
32
  }
38
33
  // Cooldown tracker per brain
39
34
  const lastUpdateTimes = new Map();
package/dist/poller.js CHANGED
@@ -4,7 +4,7 @@ import { pollMessages, deleteMessage, extendVisibility, } from './sqs-poller.js'
4
4
  import { spawnClaudeCode, isAtCapacity, getActiveProcessCount } from './claude-spawner.js';
5
5
  import { sendSlackError, addReaction, getUserInfo, startTypingIndicator } from './slack-client.js';
6
6
  import { acquireSessionLock, releaseSessionLock, updateSessionId } from './session-store.js';
7
- import { getBrainPath, ensureDirectories, ensureBaseBrain, pushBrainChanges, logGitDiagnostics } from './brain-manager.js';
7
+ import { getBrainPath, ensureDirectories, ensureBaseBrain, pushBrainChanges, configureGitAuth } from './brain-manager.js';
8
8
  import { initAuth, stopRefresh } from './auth-provider.js';
9
9
  // Track active message processing
10
10
  const processingMessages = new Set();
@@ -254,7 +254,7 @@ export async function startPoller() {
254
254
  logger.info(` Queue: ${config.SQS_QUEUE_URL}`);
255
255
  logger.info(` Sessions table: ${config.SESSIONS_TABLE}`);
256
256
  }
257
- await logGitDiagnostics();
257
+ await configureGitAuth();
258
258
  await ensureDirectories();
259
259
  await ensureBaseBrain();
260
260
  await pollLoop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamvibe/poller",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {