@teamvibe/poller 0.1.1 → 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 +7 -3
- package/dist/config.js +9 -3
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
3
3
|
AWS_REGION: z.ZodDefault<z.ZodString>;
|
|
4
4
|
SQS_QUEUE_URL: z.ZodOptional<z.ZodString>;
|
|
5
5
|
SESSIONS_TABLE: z.ZodOptional<z.ZodString>;
|
|
6
|
-
TEAMVIBE_API_URL: z.
|
|
6
|
+
TEAMVIBE_API_URL: z.ZodDefault<z.ZodString>;
|
|
7
7
|
TEAMVIBE_POLLER_TOKEN: z.ZodOptional<z.ZodString>;
|
|
8
8
|
MAX_CONCURRENT_SESSIONS: z.ZodDefault<z.ZodNumber>;
|
|
9
9
|
POLL_WAIT_TIME_SECONDS: z.ZodDefault<z.ZodNumber>;
|
|
@@ -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>;
|
|
@@ -18,12 +19,14 @@ declare const configSchema: z.ZodObject<{
|
|
|
18
19
|
KB_UPDATE_COOLDOWN_MS: z.ZodDefault<z.ZodNumber>;
|
|
19
20
|
}, "strip", z.ZodTypeAny, {
|
|
20
21
|
AWS_REGION: string;
|
|
22
|
+
TEAMVIBE_API_URL: string;
|
|
21
23
|
MAX_CONCURRENT_SESSIONS: number;
|
|
22
24
|
POLL_WAIT_TIME_SECONDS: number;
|
|
23
25
|
VISIBILITY_TIMEOUT_SECONDS: number;
|
|
24
26
|
HEARTBEAT_INTERVAL_MS: number;
|
|
25
27
|
CLAUDE_TIMEOUT_MS: number;
|
|
26
28
|
STALE_LOCK_TIMEOUT_MS: number;
|
|
29
|
+
TEAMVIBE_DATA_DIR: string;
|
|
27
30
|
KB_BASE_PATH: string;
|
|
28
31
|
DEFAULT_KB_PATH: string;
|
|
29
32
|
CLAUDE_CLI_PATH: string;
|
|
@@ -31,7 +34,6 @@ declare const configSchema: z.ZodObject<{
|
|
|
31
34
|
KB_UPDATE_COOLDOWN_MS: number;
|
|
32
35
|
SQS_QUEUE_URL?: string | undefined;
|
|
33
36
|
SESSIONS_TABLE?: string | undefined;
|
|
34
|
-
TEAMVIBE_API_URL?: string | undefined;
|
|
35
37
|
TEAMVIBE_POLLER_TOKEN?: string | undefined;
|
|
36
38
|
}, {
|
|
37
39
|
AWS_REGION?: string | undefined;
|
|
@@ -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;
|
|
@@ -55,12 +58,14 @@ export type Config = z.infer<typeof configSchema>;
|
|
|
55
58
|
export declare function loadConfig(): Config;
|
|
56
59
|
export declare const config: {
|
|
57
60
|
AWS_REGION: string;
|
|
61
|
+
TEAMVIBE_API_URL: string;
|
|
58
62
|
MAX_CONCURRENT_SESSIONS: number;
|
|
59
63
|
POLL_WAIT_TIME_SECONDS: number;
|
|
60
64
|
VISIBILITY_TIMEOUT_SECONDS: number;
|
|
61
65
|
HEARTBEAT_INTERVAL_MS: number;
|
|
62
66
|
CLAUDE_TIMEOUT_MS: number;
|
|
63
67
|
STALE_LOCK_TIMEOUT_MS: number;
|
|
68
|
+
TEAMVIBE_DATA_DIR: string;
|
|
64
69
|
KB_BASE_PATH: string;
|
|
65
70
|
DEFAULT_KB_PATH: string;
|
|
66
71
|
CLAUDE_CLI_PATH: string;
|
|
@@ -68,7 +73,6 @@ export declare const config: {
|
|
|
68
73
|
KB_UPDATE_COOLDOWN_MS: number;
|
|
69
74
|
SQS_QUEUE_URL?: string | undefined;
|
|
70
75
|
SESSIONS_TABLE?: string | undefined;
|
|
71
|
-
TEAMVIBE_API_URL?: string | undefined;
|
|
72
76
|
TEAMVIBE_POLLER_TOKEN?: string | undefined;
|
|
73
77
|
};
|
|
74
78
|
export {};
|
package/dist/config.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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'),
|
|
7
8
|
SQS_QUEUE_URL: z.string().optional(),
|
|
8
9
|
SESSIONS_TABLE: z.string().optional(),
|
|
9
10
|
// Token-based auth (alternative to direct AWS credentials)
|
|
10
|
-
TEAMVIBE_API_URL: z.string().
|
|
11
|
+
TEAMVIBE_API_URL: z.string().default('https://poller.api.teamvibe.ai'),
|
|
11
12
|
TEAMVIBE_POLLER_TOKEN: z.string().optional(),
|
|
12
13
|
// Poller settings
|
|
13
14
|
MAX_CONCURRENT_SESSIONS: z.coerce.number().default(5),
|
|
@@ -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();
|