@questionbase/deskfree 0.3.0-alpha.27 → 0.3.0-alpha.28

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
@@ -4655,6 +4655,17 @@ async function deliverMessageToAgent(ctx, message, client) {
4655
4655
  replyOptions
4656
4656
  });
4657
4657
  log.info(`Message ${message.messageId} dispatched successfully.`);
4658
+ const activeSession = streamingSession;
4659
+ if (activeSession?.isActive()) {
4660
+ try {
4661
+ await activeSession.close(accumulatedText || void 0);
4662
+ log.info("Streaming reply finalized (post-dispatch cleanup).");
4663
+ } catch (closeErr) {
4664
+ const msg = closeErr instanceof Error ? closeErr.message : String(closeErr);
4665
+ log.warn(`Post-dispatch streaming close failed: ${msg}`);
4666
+ }
4667
+ streamingSession = null;
4668
+ }
4658
4669
  } catch (err) {
4659
4670
  const session = streamingSession;
4660
4671
  if (session?.isActive()) {
@@ -8794,11 +8805,12 @@ You are the orchestrator. Your job: turn human intent into approved tasks, then
8794
8805
  3. **Dispatch** \u2192 spawn a sub-agent for each approved task. Pass the taskId.
8795
8806
  4. **Communicate** \u2192 \`deskfree_send_message\` for updates outside task threads.
8796
8807
 
8797
- **Bias toward action, not questions.** When a human gives you a direction:
8798
- - Don't ask clarifying questions in the main thread. Propose tasks instead.
8799
- - If the request is clear ("audit my LinkedIn profile"), propose the task directly \u2014 no scoping needed.
8800
- - If the request is ambiguous ("I want to be a LinkedIn influencer"), propose a scoping task first: "Research current state and draft a plan" \u2014 the worker reports back with findings and follow-up proposals.
8801
- - Discovery happens inside tasks, not in conversation. Tasks produce deliverables; questions don't.
8808
+ **Always explain before proposing.** When a human gives you a direction:
8809
+ - First, respond in chat with your understanding and plan \u2014 what you'll do, how you'll break it down, what the deliverables will be.
8810
+ - Then call \`deskfree_propose\` with the concrete tasks. The human sees your thinking first, then the actionable proposal.
8811
+ - If the request is clear ("audit my LinkedIn profile"), a brief "Here's what I'll do:" is enough before proposing.
8812
+ - If the request is ambiguous ("I want to be a LinkedIn influencer"), explain your approach, then propose a scoping task.
8813
+ - Never call \`deskfree_propose\` as your first action \u2014 always write a message first.
8802
8814
 
8803
8815
  You do NOT claim tasks or do work directly. Sub-agents handle execution.
8804
8816
  - When a human writes in a task thread, you receive it with recent context. Use \`deskfree_reopen_task\` if it needs more work.