agent-desk-mcp 1.0.3 → 1.0.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.
- package/dist/index.js +4 -0
- package/package.json +1 -1
- package/src/index.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -150,6 +150,7 @@ Returns: User's answers concatenated with newlines, or timeout message.`,
|
|
|
150
150
|
async handleAskUser(args) {
|
|
151
151
|
const { agent_summary, context, questions, timeout_seconds, } = args;
|
|
152
152
|
const sessionId = crypto.randomUUID();
|
|
153
|
+
console.error(`[${new Date().toISOString()}] START handleAskUser: ${sessionId} - ${agent_summary}`);
|
|
153
154
|
// Ensure questions have IDs
|
|
154
155
|
const processedQuestions = questions.map((q, i) => ({
|
|
155
156
|
...q,
|
|
@@ -162,6 +163,7 @@ Returns: User's answers concatenated with newlines, or timeout message.`,
|
|
|
162
163
|
while (true) {
|
|
163
164
|
// Check timeout
|
|
164
165
|
if (timeout_seconds && (Date.now() - startTime) >= timeout_seconds * 1000) {
|
|
166
|
+
console.error(`[${new Date().toISOString()}] TIMEOUT handleAskUser: ${sessionId}`);
|
|
165
167
|
return {
|
|
166
168
|
content: [
|
|
167
169
|
{
|
|
@@ -174,6 +176,7 @@ Returns: User's answers concatenated with newlines, or timeout message.`,
|
|
|
174
176
|
// Check for answer
|
|
175
177
|
const agent = await this.apiClient.getAgent(sessionId);
|
|
176
178
|
if (agent && agent.status === "answered") {
|
|
179
|
+
console.error(`[${new Date().toISOString()}] ANSWERED handleAskUser: ${sessionId}`);
|
|
177
180
|
const answers = agent.questions
|
|
178
181
|
.filter((q) => q.answer)
|
|
179
182
|
.map((q) => `${q.id}: ${q.answer}`);
|
|
@@ -186,6 +189,7 @@ Returns: User's answers concatenated with newlines, or timeout message.`,
|
|
|
186
189
|
],
|
|
187
190
|
};
|
|
188
191
|
}
|
|
192
|
+
console.error(`[${new Date().toISOString()}] POLLING handleAskUser: ${sessionId}`);
|
|
189
193
|
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
190
194
|
}
|
|
191
195
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -199,6 +199,7 @@ Returns: User's answers concatenated with newlines, or timeout message.`,
|
|
|
199
199
|
};
|
|
200
200
|
|
|
201
201
|
const sessionId = crypto.randomUUID();
|
|
202
|
+
console.error(`[${new Date().toISOString()}] START handleAskUser: ${sessionId} - ${agent_summary}`);
|
|
202
203
|
|
|
203
204
|
// Ensure questions have IDs
|
|
204
205
|
const processedQuestions = questions.map((q, i) => ({
|
|
@@ -221,6 +222,7 @@ Returns: User's answers concatenated with newlines, or timeout message.`,
|
|
|
221
222
|
while (true) {
|
|
222
223
|
// Check timeout
|
|
223
224
|
if (timeout_seconds && (Date.now() - startTime) >= timeout_seconds * 1000) {
|
|
225
|
+
console.error(`[${new Date().toISOString()}] TIMEOUT handleAskUser: ${sessionId}`);
|
|
224
226
|
return {
|
|
225
227
|
content: [
|
|
226
228
|
{
|
|
@@ -234,6 +236,7 @@ Returns: User's answers concatenated with newlines, or timeout message.`,
|
|
|
234
236
|
// Check for answer
|
|
235
237
|
const agent = await this.apiClient!.getAgent(sessionId);
|
|
236
238
|
if (agent && agent.status === "answered") {
|
|
239
|
+
console.error(`[${new Date().toISOString()}] ANSWERED handleAskUser: ${sessionId}`);
|
|
237
240
|
const answers = agent.questions
|
|
238
241
|
.filter((q) => q.answer)
|
|
239
242
|
.map((q) => `${q.id}: ${q.answer}`);
|
|
@@ -247,6 +250,7 @@ Returns: User's answers concatenated with newlines, or timeout message.`,
|
|
|
247
250
|
};
|
|
248
251
|
}
|
|
249
252
|
|
|
253
|
+
console.error(`[${new Date().toISOString()}] POLLING handleAskUser: ${sessionId}`);
|
|
250
254
|
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
251
255
|
}
|
|
252
256
|
}
|