@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/index.js CHANGED
@@ -2312,6 +2312,16 @@ function createOrchestratorTools(client, _options) {
2312
2312
  try {
2313
2313
  const content = validateStringParam(params, "content", true);
2314
2314
  const taskId = validateStringParam(params, "taskId", false);
2315
+ if (!content.trim()) {
2316
+ return {
2317
+ content: [
2318
+ {
2319
+ type: "text",
2320
+ text: "Skipped: content was empty. Provide a non-empty message."
2321
+ }
2322
+ ]
2323
+ };
2324
+ }
2315
2325
  await client.sendMessage({ content, taskId });
2316
2326
  return {
2317
2327
  content: [{ type: "text", text: "Message sent successfully" }]
@@ -2421,6 +2431,16 @@ function createWorkerTools(client, options) {
2421
2431
  try {
2422
2432
  const content = validateStringParam(params, "content", true);
2423
2433
  const taskId = validateStringParam(params, "taskId", false);
2434
+ if (!content.trim()) {
2435
+ return {
2436
+ content: [
2437
+ {
2438
+ type: "text",
2439
+ text: "Skipped: content was empty. Provide a non-empty message."
2440
+ }
2441
+ ]
2442
+ };
2443
+ }
2424
2444
  await client.sendMessage({ content, taskId });
2425
2445
  return {
2426
2446
  content: [{ type: "text", text: "Message sent successfully" }]
@@ -6980,12 +7000,13 @@ var init_dist = __esm({
6980
7000
  * Validates that a string parameter is non-empty.
6981
7001
  * Catches invalid inputs before they hit the network.
6982
7002
  */
6983
- requireNonEmpty(value, name) {
7003
+ requireNonEmpty(value, name, caller) {
6984
7004
  if (!value || value.trim() === "") {
7005
+ const ctx = caller ? ` (in ${caller})` : "";
6985
7006
  throw new DeskFreeError(
6986
7007
  "client",
6987
7008
  name,
6988
- `${name} is required and cannot be empty`,
7009
+ `${name} is required and cannot be empty${ctx}`,
6989
7010
  `Missing required parameter: ${name}. Please provide a valid value.`
6990
7011
  );
6991
7012
  }
@@ -7011,7 +7032,7 @@ var init_dist = __esm({
7011
7032
  * @param input - Message content, optional userId, taskId, attachments
7012
7033
  */
7013
7034
  async sendMessage(input) {
7014
- this.requireNonEmpty(input.content, "content");
7035
+ this.requireNonEmpty(input.content, "content", "sendMessage");
7015
7036
  return this.request("POST", "messages.send", input);
7016
7037
  }
7017
7038
  /** Fetch paginated message history for a conversation. */
@@ -7048,8 +7069,8 @@ var init_dist = __esm({
7048
7069
  }
7049
7070
  /** Update the content of an existing file. */
7050
7071
  async updateFile(input) {
7051
- this.requireNonEmpty(input.fileId, "fileId");
7052
- this.requireNonEmpty(input.content, "content");
7072
+ this.requireNonEmpty(input.fileId, "fileId", "updateFile");
7073
+ this.requireNonEmpty(input.content, "content", "updateFile");
7053
7074
  return this.request("POST", "files.update", input);
7054
7075
  }
7055
7076
  /** Create a new persistent file. */
@@ -7093,13 +7114,13 @@ var init_dist = __esm({
7093
7114
  }
7094
7115
  /** Report a learning observation from a worker task. Posts a system message in the task thread AND writes to memory_entries. */
7095
7116
  async reportLearning(input) {
7096
- this.requireNonEmpty(input.content, "content");
7117
+ this.requireNonEmpty(input.content, "content", "reportLearning");
7097
7118
  return this.request("POST", "tasks.learning", input);
7098
7119
  }
7099
7120
  // ── Memory ──────────────────────────────────────────────────
7100
7121
  /** Add a memory entry directly (bypasses system message — used by consolidation). */
7101
7122
  async addMemory(input) {
7102
- this.requireNonEmpty(input.content, "content");
7123
+ this.requireNonEmpty(input.content, "content", "addMemory");
7103
7124
  return this.request("POST", "memory.add", input);
7104
7125
  }
7105
7126
  /**
@@ -7980,7 +8001,7 @@ Do NOT record: one-time task details, things already in project docs, or obvious
7980
8001
  this.closed = true;
7981
8002
  await this.queue;
7982
8003
  const text = finalText ?? (this.fullText || this.currentText);
7983
- if (this.messageId) {
8004
+ if (this.messageId && text) {
7984
8005
  for (let attempt = 0; attempt < CLOSE_MAX_RETRIES; attempt++) {
7985
8006
  try {
7986
8007
  await this.client.updateMessage({
@@ -14450,7 +14471,7 @@ async function startAgent(opts) {
14450
14471
  log.info("DeskFree Agent Runtime starting...");
14451
14472
  const { getRotationToken: getRotationToken2, setInitialRotationToken: setInitialRotationToken2 } = await Promise.resolve().then(() => (init_ws_gateway(), ws_gateway_exports));
14452
14473
  const { collectFingerprint: collectFingerprint2 } = await Promise.resolve().then(() => (init_fingerprint(), fingerprint_exports));
14453
- const runtimeVersion = "0.6.6";
14474
+ const runtimeVersion = "0.6.8";
14454
14475
  const fingerprint = collectFingerprint2(localConfig.stateDir, runtimeVersion);
14455
14476
  log.info("Connecting to DeskFree...", { wsUrl: localConfig.wsUrl });
14456
14477
  const connectResult = await initialConnect({