@questionbase/deskfree 0.6.6 → 0.6.8

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/bin.js CHANGED
@@ -2767,6 +2767,16 @@ function createOrchestratorTools(client, _options) {
2767
2767
  try {
2768
2768
  const content = validateStringParam(params, "content", true);
2769
2769
  const taskId = validateStringParam(params, "taskId", false);
2770
+ if (!content.trim()) {
2771
+ return {
2772
+ content: [
2773
+ {
2774
+ type: "text",
2775
+ text: "Skipped: content was empty. Provide a non-empty message."
2776
+ }
2777
+ ]
2778
+ };
2779
+ }
2770
2780
  await client.sendMessage({ content, taskId });
2771
2781
  return {
2772
2782
  content: [{ type: "text", text: "Message sent successfully" }]
@@ -2876,6 +2886,16 @@ function createWorkerTools(client, options) {
2876
2886
  try {
2877
2887
  const content = validateStringParam(params, "content", true);
2878
2888
  const taskId = validateStringParam(params, "taskId", false);
2889
+ if (!content.trim()) {
2890
+ return {
2891
+ content: [
2892
+ {
2893
+ type: "text",
2894
+ text: "Skipped: content was empty. Provide a non-empty message."
2895
+ }
2896
+ ]
2897
+ };
2898
+ }
2879
2899
  await client.sendMessage({ content, taskId });
2880
2900
  return {
2881
2901
  content: [{ type: "text", text: "Message sent successfully" }]
@@ -7435,12 +7455,13 @@ var init_dist = __esm({
7435
7455
  * Validates that a string parameter is non-empty.
7436
7456
  * Catches invalid inputs before they hit the network.
7437
7457
  */
7438
- requireNonEmpty(value, name2) {
7458
+ requireNonEmpty(value, name2, caller) {
7439
7459
  if (!value || value.trim() === "") {
7460
+ const ctx = caller ? ` (in ${caller})` : "";
7440
7461
  throw new DeskFreeError(
7441
7462
  "client",
7442
7463
  name2,
7443
- `${name2} is required and cannot be empty`,
7464
+ `${name2} is required and cannot be empty${ctx}`,
7444
7465
  `Missing required parameter: ${name2}. Please provide a valid value.`
7445
7466
  );
7446
7467
  }
@@ -7466,7 +7487,7 @@ var init_dist = __esm({
7466
7487
  * @param input - Message content, optional userId, taskId, attachments
7467
7488
  */
7468
7489
  async sendMessage(input) {
7469
- this.requireNonEmpty(input.content, "content");
7490
+ this.requireNonEmpty(input.content, "content", "sendMessage");
7470
7491
  return this.request("POST", "messages.send", input);
7471
7492
  }
7472
7493
  /** Fetch paginated message history for a conversation. */
@@ -7503,8 +7524,8 @@ var init_dist = __esm({
7503
7524
  }
7504
7525
  /** Update the content of an existing file. */
7505
7526
  async updateFile(input) {
7506
- this.requireNonEmpty(input.fileId, "fileId");
7507
- this.requireNonEmpty(input.content, "content");
7527
+ this.requireNonEmpty(input.fileId, "fileId", "updateFile");
7528
+ this.requireNonEmpty(input.content, "content", "updateFile");
7508
7529
  return this.request("POST", "files.update", input);
7509
7530
  }
7510
7531
  /** Create a new persistent file. */
@@ -7548,13 +7569,13 @@ var init_dist = __esm({
7548
7569
  }
7549
7570
  /** Report a learning observation from a worker task. Posts a system message in the task thread AND writes to memory_entries. */
7550
7571
  async reportLearning(input) {
7551
- this.requireNonEmpty(input.content, "content");
7572
+ this.requireNonEmpty(input.content, "content", "reportLearning");
7552
7573
  return this.request("POST", "tasks.learning", input);
7553
7574
  }
7554
7575
  // ── Memory ──────────────────────────────────────────────────
7555
7576
  /** Add a memory entry directly (bypasses system message — used by consolidation). */
7556
7577
  async addMemory(input) {
7557
- this.requireNonEmpty(input.content, "content");
7578
+ this.requireNonEmpty(input.content, "content", "addMemory");
7558
7579
  return this.request("POST", "memory.add", input);
7559
7580
  }
7560
7581
  /**
@@ -8435,7 +8456,7 @@ Do NOT record: one-time task details, things already in project docs, or obvious
8435
8456
  this.closed = true;
8436
8457
  await this.queue;
8437
8458
  const text = finalText ?? (this.fullText || this.currentText);
8438
- if (this.messageId) {
8459
+ if (this.messageId && text) {
8439
8460
  for (let attempt = 0; attempt < CLOSE_MAX_RETRIES; attempt++) {
8440
8461
  try {
8441
8462
  await this.client.updateMessage({
@@ -14962,7 +14983,7 @@ async function startAgent(opts) {
14962
14983
  log.info("DeskFree Agent Runtime starting...");
14963
14984
  const { getRotationToken: getRotationToken2, setInitialRotationToken: setInitialRotationToken2 } = await Promise.resolve().then(() => (init_ws_gateway(), ws_gateway_exports));
14964
14985
  const { collectFingerprint: collectFingerprint2 } = await Promise.resolve().then(() => (init_fingerprint(), fingerprint_exports));
14965
- const runtimeVersion = "0.6.6";
14986
+ const runtimeVersion = "0.6.8";
14966
14987
  const fingerprint = collectFingerprint2(localConfig.stateDir, runtimeVersion);
14967
14988
  log.info("Connecting to DeskFree...", { wsUrl: localConfig.wsUrl });
14968
14989
  const connectResult = await initialConnect({