@teamvibe/poller 0.1.2 → 0.1.4

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.
@@ -5,7 +5,7 @@ import { WebClient } from '@slack/web-api';
5
5
  import { config } from './config.js';
6
6
  import { logger } from './logger.js';
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
- const SLACK_TOOL_PATH = join(__dirname, 'scripts/slack-tool.ts');
8
+ const SLACK_TOOL_PATH = join(__dirname, 'scripts/slack-tool.js');
9
9
  // Per-token Slack client cache for thread context
10
10
  const slackClients = new Map();
11
11
  function getSlackClient(botToken) {
@@ -50,27 +50,27 @@ You have Slack tools available via Bash. Use these commands to communicate:
50
50
 
51
51
  **Send a message** (REQUIRED - always use this to respond):
52
52
  \`\`\`bash
53
- npx tsx $SLACK_TOOL_PATH send_message "Your message here"
53
+ node $SLACK_TOOL_PATH send_message "Your message here"
54
54
  \`\`\`
55
55
 
56
56
  **Add emoji reaction:**
57
57
  \`\`\`bash
58
- npx tsx $SLACK_TOOL_PATH add_reaction emoji_name
58
+ node $SLACK_TOOL_PATH add_reaction emoji_name
59
59
  \`\`\`
60
60
 
61
61
  **Remove emoji reaction:**
62
62
  \`\`\`bash
63
- npx tsx $SLACK_TOOL_PATH remove_reaction emoji_name
63
+ node $SLACK_TOOL_PATH remove_reaction emoji_name
64
64
  \`\`\`
65
65
 
66
66
  **Read thread history:**
67
67
  \`\`\`bash
68
- npx tsx $SLACK_TOOL_PATH read_thread [limit]
68
+ node $SLACK_TOOL_PATH read_thread [limit]
69
69
  \`\`\`
70
70
 
71
71
  **Upload code/text snippet:**
72
72
  \`\`\`bash
73
- npx tsx $SLACK_TOOL_PATH upload_snippet "title" "content" [filetype]
73
+ node $SLACK_TOOL_PATH upload_snippet "title" "content" [filetype]
74
74
  \`\`\`
75
75
 
76
76
  **Important:** To respond to the user, you MUST use the send_message command via Bash - plain text output will NOT be seen by the user. Always send at least one message back.
package/dist/config.d.ts CHANGED
@@ -11,6 +11,7 @@ declare const configSchema: z.ZodObject<{
11
11
  HEARTBEAT_INTERVAL_MS: z.ZodDefault<z.ZodNumber>;
12
12
  CLAUDE_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
13
13
  STALE_LOCK_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
14
+ TEAMVIBE_DATA_DIR: z.ZodDefault<z.ZodString>;
14
15
  KB_BASE_PATH: z.ZodDefault<z.ZodString>;
15
16
  DEFAULT_KB_PATH: z.ZodDefault<z.ZodString>;
16
17
  CLAUDE_CLI_PATH: z.ZodDefault<z.ZodString>;
@@ -25,6 +26,7 @@ declare const configSchema: z.ZodObject<{
25
26
  HEARTBEAT_INTERVAL_MS: number;
26
27
  CLAUDE_TIMEOUT_MS: number;
27
28
  STALE_LOCK_TIMEOUT_MS: number;
29
+ TEAMVIBE_DATA_DIR: string;
28
30
  KB_BASE_PATH: string;
29
31
  DEFAULT_KB_PATH: string;
30
32
  CLAUDE_CLI_PATH: string;
@@ -45,6 +47,7 @@ declare const configSchema: z.ZodObject<{
45
47
  HEARTBEAT_INTERVAL_MS?: number | undefined;
46
48
  CLAUDE_TIMEOUT_MS?: number | undefined;
47
49
  STALE_LOCK_TIMEOUT_MS?: number | undefined;
50
+ TEAMVIBE_DATA_DIR?: string | undefined;
48
51
  KB_BASE_PATH?: string | undefined;
49
52
  DEFAULT_KB_PATH?: string | undefined;
50
53
  CLAUDE_CLI_PATH?: string | undefined;
@@ -62,6 +65,7 @@ export declare const config: {
62
65
  HEARTBEAT_INTERVAL_MS: number;
63
66
  CLAUDE_TIMEOUT_MS: number;
64
67
  STALE_LOCK_TIMEOUT_MS: number;
68
+ TEAMVIBE_DATA_DIR: string;
65
69
  KB_BASE_PATH: string;
66
70
  DEFAULT_KB_PATH: string;
67
71
  CLAUDE_CLI_PATH: string;
package/dist/config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { config as dotenvConfig } from 'dotenv';
3
3
  dotenvConfig();
4
+ const DEFAULT_DATA_DIR = `${process.env['HOME']}/.teamvibe`;
4
5
  const configSchema = z.object({
5
6
  // AWS
6
7
  AWS_REGION: z.string().default('eu-central-1'),
@@ -17,8 +18,9 @@ const configSchema = z.object({
17
18
  CLAUDE_TIMEOUT_MS: z.coerce.number().default(1800000), // 30 minutes
18
19
  STALE_LOCK_TIMEOUT_MS: z.coerce.number().default(2100000), // 35 minutes
19
20
  // Paths
20
- KB_BASE_PATH: z.string().default(`${process.env['HOME']}/.teamvibe/knowledge-bases`),
21
- DEFAULT_KB_PATH: z.string().default(`${process.env['HOME']}/.teamvibe/default-kb`),
21
+ TEAMVIBE_DATA_DIR: z.string().default(DEFAULT_DATA_DIR),
22
+ KB_BASE_PATH: z.string().default(''),
23
+ DEFAULT_KB_PATH: z.string().default(''),
22
24
  CLAUDE_CLI_PATH: z.string().default('claude'),
23
25
  // Knowledge base auto-update
24
26
  KB_AUTO_UPDATE: z
@@ -43,6 +45,10 @@ export function loadConfig() {
43
45
  console.error('Configuration error: Provide either TEAMVIBE_API_URL + TEAMVIBE_POLLER_TOKEN (token mode) or SQS_QUEUE_URL + SESSIONS_TABLE (direct mode)');
44
46
  process.exit(1);
45
47
  }
48
+ // Derive paths from TEAMVIBE_DATA_DIR if not explicitly set
49
+ const dataDir = data.TEAMVIBE_DATA_DIR;
50
+ data.KB_BASE_PATH = data.KB_BASE_PATH || `${dataDir}/knowledge-bases`;
51
+ data.DEFAULT_KB_PATH = data.DEFAULT_KB_PATH || `${dataDir}/default-kb`;
46
52
  return data;
47
53
  }
48
54
  export const config = loadConfig();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamvibe/poller",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {