@teamvibe/poller 0.1.7 → 0.1.9
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/index.js +21 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -81,8 +81,28 @@ async function processMessage(received) {
|
|
|
81
81
|
sessionLog.info(`Brain: ${queueMessage.teamvibe.brain?.brainId ?? 'none'}`);
|
|
82
82
|
sessionLog.info(`Type: ${queueMessage.type}`);
|
|
83
83
|
sessionLog.info(`Log file: ${sessionLog.getLogFile()}`);
|
|
84
|
+
const hasSlackContext = Boolean(queueMessage.response_context.slack?.channel &&
|
|
85
|
+
queueMessage.response_context.slack?.message_ts);
|
|
84
86
|
// Get brain path for this channel
|
|
85
|
-
|
|
87
|
+
let kbPath;
|
|
88
|
+
try {
|
|
89
|
+
kbPath = await getBrainPath(queueMessage.teamvibe.brain);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
93
|
+
sessionLog.error(`Failed to clone brain: ${errorMessage}`);
|
|
94
|
+
if (hasSlackContext) {
|
|
95
|
+
try {
|
|
96
|
+
await sendSlackError(queueMessage, `Failed to clone brain repository: ${errorMessage}`);
|
|
97
|
+
await addReaction(queueMessage, 'x');
|
|
98
|
+
}
|
|
99
|
+
catch (slackError) {
|
|
100
|
+
sessionLog.error(`Failed to send Slack error: ${slackError}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
await deleteMessage(receiptHandle);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
86
106
|
// Try to acquire session lock
|
|
87
107
|
let lockResult = await acquireSessionLock(threadId, kbPath);
|
|
88
108
|
if (!lockResult.success) {
|
|
@@ -108,8 +128,6 @@ async function processMessage(received) {
|
|
|
108
128
|
logQueueState(`Lock acquired for ${threadId}`);
|
|
109
129
|
processingMessages.add(messageId);
|
|
110
130
|
const heartbeat = startHeartbeat(receiptHandle, sessionLog);
|
|
111
|
-
const hasSlackContext = Boolean(queueMessage.response_context.slack?.channel &&
|
|
112
|
-
queueMessage.response_context.slack?.message_ts);
|
|
113
131
|
// Start typing indicator
|
|
114
132
|
const stopTyping = hasSlackContext
|
|
115
133
|
? startTypingIndicator(queueMessage)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamvibe/poller",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"dev": "tsx watch src/index.ts",
|
|
14
14
|
"build": "tsc -p tsconfig.build.json",
|
|
15
15
|
"start": "node dist/index.js",
|
|
16
|
-
"typecheck": "tsc --noEmit"
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"publish:npm": "bun run build && NPM_TOKEN=$(grep NPM_TOKEN ../../.env | cut -d= -f2) && npm publish --access public --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$NPM_TOKEN"
|
|
17
18
|
},
|
|
18
19
|
"publishConfig": {
|
|
19
20
|
"access": "public"
|