@questionbase/deskfree 0.3.0-alpha.17 → 0.3.0-alpha.19

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 CHANGED
@@ -4563,11 +4563,18 @@ var wrapper_default = import_websocket.default;
4563
4563
 
4564
4564
  // src/gateway.ts
4565
4565
  var activeTaskId = null;
4566
+ var completedTaskId = null;
4566
4567
  function setActiveTaskId(taskId) {
4568
+ if (taskId === null && activeTaskId !== null) {
4569
+ completedTaskId = activeTaskId;
4570
+ }
4567
4571
  activeTaskId = taskId;
4568
4572
  }
4569
4573
  function getActiveTaskId() {
4570
- return activeTaskId;
4574
+ return activeTaskId ?? completedTaskId;
4575
+ }
4576
+ function clearCompletedTaskId() {
4577
+ completedTaskId = null;
4571
4578
  }
4572
4579
  async function runS3CommandWithCredentials(client, buildCommand, workspacePath, log) {
4573
4580
  try {
@@ -5262,6 +5269,7 @@ async function pollAndDeliver(client, ctx, cursor, log, account) {
5262
5269
  deliveredMessageIds.add(message.messageId);
5263
5270
  continue;
5264
5271
  }
5272
+ clearCompletedTaskId();
5265
5273
  await deliverMessageToAgent(ctx, message, client);
5266
5274
  deliveredMessageIds.add(message.messageId);
5267
5275
  deliveredCount++;
@@ -8902,6 +8910,10 @@ function createOrchestratorTools(api) {
8902
8910
  title,
8903
8911
  instructions
8904
8912
  });
8913
+ await client.sendMessage({
8914
+ content: `\u{1F4CB} Created task: "${task.title}"`
8915
+ }).catch(() => {
8916
+ });
8905
8917
  return formatTaskResponse(
8906
8918
  task,
8907
8919
  `Created task "${task.title}" with ID ${task.taskId}`,
@@ -8977,6 +8989,11 @@ function createOrchestratorTools(api) {
8977
8989
  const result = await client.completeTask({ taskId, outcome });
8978
8990
  setActiveTaskId(null);
8979
8991
  const summaryVerb = outcome === "done" ? "completed" : "blocked";
8992
+ const icon = outcome === "done" ? "\u2705" : "\u{1F6AB}";
8993
+ await client.sendMessage({
8994
+ content: `${icon} Task ${summaryVerb}: "${result.title}"`
8995
+ }).catch(() => {
8996
+ });
8980
8997
  return formatTaskResponse(
8981
8998
  result,
8982
8999
  `Task "${result.title}" marked as ${summaryVerb} \u2014 waiting for human`,