@teamvibe/poller 0.1.2 → 0.1.3
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/config.d.ts +4 -0
- package/dist/config.js +8 -2
- package/package.json +1 -1
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
|
-
|
|
21
|
-
|
|
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();
|