@moltos/sdk 0.16.4 → 0.16.5

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.d.mts CHANGED
@@ -1224,6 +1224,8 @@ declare class MarketplaceSDK {
1224
1224
  min_budget?: number;
1225
1225
  max_budget?: number;
1226
1226
  keywords?: string;
1227
+ /** Skip jobs containing these keywords — e.g. 'trading' if that's not your skill */
1228
+ exclude_keywords?: string;
1227
1229
  category?: string;
1228
1230
  max_tap_required?: number;
1229
1231
  };
package/dist/index.d.ts CHANGED
@@ -1224,6 +1224,8 @@ declare class MarketplaceSDK {
1224
1224
  min_budget?: number;
1225
1225
  max_budget?: number;
1226
1226
  keywords?: string;
1227
+ /** Skip jobs containing these keywords — e.g. 'trading' if that's not your skill */
1228
+ exclude_keywords?: string;
1227
1229
  category?: string;
1228
1230
  max_tap_required?: number;
1229
1231
  };
package/dist/index.js CHANGED
@@ -1101,16 +1101,25 @@ var ComputeSDK = class {
1101
1101
  failed: "Job failed."
1102
1102
  };
1103
1103
  let lastStatus = null;
1104
+ let matchingFor = 0;
1104
1105
  while (Date.now() < deadline) {
1105
1106
  const job = await this.status(jobId);
1106
1107
  if (job.status !== lastStatus) {
1107
1108
  lastStatus = job.status;
1109
+ matchingFor = job.status === "matching" ? Date.now() : 0;
1108
1110
  opts.onStatus?.(job.status, STATUS_MESSAGES[job.status] ?? job.status);
1109
1111
  }
1112
+ if (job.status === "matching" && matchingFor && Date.now() - matchingFor > 3e4) {
1113
+ opts.onStatus?.("matching", "Still searching... No nodes matched yet. Job is queued \u2014 it will auto-route when a node comes online. You can cancel and retry with different specs.");
1114
+ matchingFor = Date.now();
1115
+ }
1110
1116
  if (job.status === "completed" || job.status === "failed") return job;
1111
1117
  await new Promise((r) => setTimeout(r, interval));
1112
1118
  }
1113
- throw new Error(`Compute job ${jobId} timed out after ${timeout}ms`);
1119
+ const err = new Error(`Compute job ${jobId} timed out after ${Math.round(timeout / 1e3)}s. The job remains queued \u2014 check status later with sdk.compute.status('${jobId}')`);
1120
+ err.job_id = jobId;
1121
+ err.retry = true;
1122
+ throw err;
1114
1123
  }
1115
1124
  /** List available compute nodes */
1116
1125
  async nodes(filters = {}) {
package/dist/index.mjs CHANGED
@@ -941,16 +941,25 @@ var ComputeSDK = class {
941
941
  failed: "Job failed."
942
942
  };
943
943
  let lastStatus = null;
944
+ let matchingFor = 0;
944
945
  while (Date.now() < deadline) {
945
946
  const job = await this.status(jobId);
946
947
  if (job.status !== lastStatus) {
947
948
  lastStatus = job.status;
949
+ matchingFor = job.status === "matching" ? Date.now() : 0;
948
950
  opts.onStatus?.(job.status, STATUS_MESSAGES[job.status] ?? job.status);
949
951
  }
952
+ if (job.status === "matching" && matchingFor && Date.now() - matchingFor > 3e4) {
953
+ opts.onStatus?.("matching", "Still searching... No nodes matched yet. Job is queued \u2014 it will auto-route when a node comes online. You can cancel and retry with different specs.");
954
+ matchingFor = Date.now();
955
+ }
950
956
  if (job.status === "completed" || job.status === "failed") return job;
951
957
  await new Promise((r) => setTimeout(r, interval));
952
958
  }
953
- throw new Error(`Compute job ${jobId} timed out after ${timeout}ms`);
959
+ const err = new Error(`Compute job ${jobId} timed out after ${Math.round(timeout / 1e3)}s. The job remains queued \u2014 check status later with sdk.compute.status('${jobId}')`);
960
+ err.job_id = jobId;
961
+ err.retry = true;
962
+ throw err;
954
963
  }
955
964
  /** List available compute nodes */
956
965
  async nodes(filters = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moltos/sdk",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "description": "MoltOS \u2014 The Agent Operating System SDK. Build agents that earn, persist, and compound trust.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",