@teamvibe/poller 0.1.56 → 0.1.57

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.
@@ -12,6 +12,7 @@ interface AuthConfig {
12
12
  export declare function initAuth(apiUrl: string, token: string): Promise<void>;
13
13
  export declare function getCredentials(): AuthCredentials;
14
14
  export declare function getAuthConfig(): AuthConfig;
15
+ export declare function getPollerId(): string | null;
15
16
  export declare function isTokenMode(): boolean;
16
17
  export declare function stopRefresh(): void;
17
18
  export {};
@@ -2,6 +2,7 @@ import { POLLER_VERSION } from './config.js';
2
2
  import { logger } from './logger.js';
3
3
  let currentCredentials = null;
4
4
  let currentConfig = null;
5
+ let currentPollerId = null;
5
6
  let refreshTimer = null;
6
7
  let heartbeatTimer = null;
7
8
  const REFRESH_INTERVAL_MS = 50 * 60 * 1000; // 50 minutes (before 1hr expiry)
@@ -43,6 +44,7 @@ export async function initAuth(apiUrl, token) {
43
44
  const auth = await fetchCredentials(apiUrl, token);
44
45
  currentCredentials = auth.credentials;
45
46
  currentConfig = auth.config;
47
+ currentPollerId = auth.pollerId;
46
48
  logger.info(`Authenticated successfully. Region: ${auth.config.region}`);
47
49
  logger.info(` SQS Queue: ${auth.config.sqsQueueUrl}`);
48
50
  logger.info(` Sessions Table: ${auth.config.sessionsTable}`);
@@ -75,6 +77,9 @@ export function getAuthConfig() {
75
77
  }
76
78
  return currentConfig;
77
79
  }
80
+ export function getPollerId() {
81
+ return currentPollerId;
82
+ }
78
83
  export function isTokenMode() {
79
84
  return currentCredentials !== null;
80
85
  }
@@ -5,6 +5,7 @@ import { WebClient } from '@slack/web-api';
5
5
  import { config } from './config.js';
6
6
  import { logger } from './logger.js';
7
7
  import { getBaseBrainPath } from './brain-manager.js';
8
+ import { getPollerId } from './auth-provider.js';
8
9
  /**
9
10
  * Maps tool names (or prefixes) to human-readable status messages.
10
11
  * More specific patterns are checked first.
@@ -136,6 +137,17 @@ function buildPrompt(msg, resumeHint) {
136
137
  if (msg.type === 'button_click' && msg.button) {
137
138
  prompt += `\n\n**Button Click:** User clicked button \`${msg.button.action_id}\` with value \`${msg.button.value}\``;
138
139
  }
140
+ if (msg.type === 'modal_submission' && msg.modal) {
141
+ prompt += `\n\n**Modal Submitted:** User filled out "${msg.modal.callbackId}"\n`;
142
+ if (msg.modal.values) {
143
+ for (const [key, value] of Object.entries(msg.modal.values)) {
144
+ prompt += `- ${key}: ${value}\n`;
145
+ }
146
+ }
147
+ }
148
+ if (msg.type === 'view_closed' && msg.modal) {
149
+ prompt += `\n\n**Modal Dismissed:** User closed "${msg.modal.callbackId}" without submitting.`;
150
+ }
139
151
  if (msg.teamvibe.emailChannelPrompt) {
140
152
  prompt += '\n\n**Channel Instructions:**\n' + msg.teamvibe.emailChannelPrompt + '\n';
141
153
  }
@@ -295,6 +307,8 @@ async function runClaudeCode(msg, sessionLog, cwd, sessionId, isFirstMessage = t
295
307
  TEAMVIBE_POLLER_TOKEN: config.TEAMVIBE_POLLER_TOKEN || '',
296
308
  TEAMVIBE_WORKSPACE_ID: msg.teamvibe.workspaceId,
297
309
  TEAMVIBE_CHANNEL_ID: msg.teamvibe.channelId,
310
+ TEAMVIBE_BOT_ID: msg.teamvibe.botId,
311
+ TEAMVIBE_POLLER_ID: getPollerId() || '',
298
312
  },
299
313
  stdio: ['pipe', 'pipe', 'pipe'],
300
314
  });
package/dist/types.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface TeamVibeQueueMessage {
26
26
  inReplyTo?: string;
27
27
  };
28
28
  };
29
- type: 'message' | 'approval_response' | 'button_click';
29
+ type: 'message' | 'approval_response' | 'button_click' | 'modal_submission' | 'view_closed';
30
30
  approval?: {
31
31
  action_id: string;
32
32
  approved: boolean;
@@ -35,6 +35,11 @@ export interface TeamVibeQueueMessage {
35
35
  action_id: string;
36
36
  value: string;
37
37
  };
38
+ modal?: {
39
+ callbackId: string;
40
+ modalDefId: string;
41
+ values?: Record<string, string>;
42
+ };
38
43
  teamvibe: {
39
44
  workspaceId: string;
40
45
  botId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamvibe/poller",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {