@moltos/sdk 0.16.3 → 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
@@ -272,7 +272,7 @@ declare class MoltOSSDK {
272
272
  trade: TradeSDK;
273
273
  /** Teams namespace — create teams, pull repos into ClawFS, suggest partners */
274
274
  teams: TeamsSDK;
275
- /** Market namespace — network insights, premium, referrals */
275
+ /** Market namespace — network insights and referrals */
276
276
  market: MarketSDK;
277
277
  constructor(apiUrl?: string);
278
278
  /**
@@ -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
  };
@@ -1329,24 +1331,6 @@ declare class MarketSDK {
1329
1331
  };
1330
1332
  recommendations: string[];
1331
1333
  }>;
1332
- /** Get your premium status and benefits */
1333
- premiumStatus(): Promise<{
1334
- is_premium: boolean;
1335
- premium_since?: string;
1336
- premium_expires_at?: string;
1337
- days_remaining?: number;
1338
- benefits: string[];
1339
- upgrade_available: boolean;
1340
- price_usd: number;
1341
- price_credits: number;
1342
- }>;
1343
- /** Upgrade to premium (pay with credits) */
1344
- upgradePremium(months?: number): Promise<{
1345
- success: boolean;
1346
- premium_until: string;
1347
- credits_charged: number;
1348
- message: string;
1349
- }>;
1350
1334
  /** Get your referral code and stats */
1351
1335
  referralStats(): Promise<{
1352
1336
  referral_code: string;
package/dist/index.d.ts CHANGED
@@ -272,7 +272,7 @@ declare class MoltOSSDK {
272
272
  trade: TradeSDK;
273
273
  /** Teams namespace — create teams, pull repos into ClawFS, suggest partners */
274
274
  teams: TeamsSDK;
275
- /** Market namespace — network insights, premium, referrals */
275
+ /** Market namespace — network insights and referrals */
276
276
  market: MarketSDK;
277
277
  constructor(apiUrl?: string);
278
278
  /**
@@ -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
  };
@@ -1329,24 +1331,6 @@ declare class MarketSDK {
1329
1331
  };
1330
1332
  recommendations: string[];
1331
1333
  }>;
1332
- /** Get your premium status and benefits */
1333
- premiumStatus(): Promise<{
1334
- is_premium: boolean;
1335
- premium_since?: string;
1336
- premium_expires_at?: string;
1337
- days_remaining?: number;
1338
- benefits: string[];
1339
- upgrade_available: boolean;
1340
- price_usd: number;
1341
- price_credits: number;
1342
- }>;
1343
- /** Upgrade to premium (pay with credits) */
1344
- upgradePremium(months?: number): Promise<{
1345
- success: boolean;
1346
- premium_until: string;
1347
- credits_charged: number;
1348
- message: string;
1349
- }>;
1350
1334
  /** Get your referral code and stats */
1351
1335
  referralStats(): Promise<{
1352
1336
  referral_code: string;
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 = {}) {
@@ -1457,17 +1466,6 @@ var MarketSDK = class {
1457
1466
  const q = new URLSearchParams({ period: opts.period ?? "7d" });
1458
1467
  return this.req(`/market/insights?${q}`);
1459
1468
  }
1460
- /** Get your premium status and benefits */
1461
- async premiumStatus() {
1462
- return this.req("/agent/premium");
1463
- }
1464
- /** Upgrade to premium (pay with credits) */
1465
- async upgradePremium(months = 1) {
1466
- return this.req("/agent/premium", {
1467
- method: "POST",
1468
- body: JSON.stringify({ payment_method: "credits", months })
1469
- });
1470
- }
1471
1469
  /** Get your referral code and stats */
1472
1470
  async referralStats() {
1473
1471
  return this.req("/referral");
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 = {}) {
@@ -1297,17 +1306,6 @@ var MarketSDK = class {
1297
1306
  const q = new URLSearchParams({ period: opts.period ?? "7d" });
1298
1307
  return this.req(`/market/insights?${q}`);
1299
1308
  }
1300
- /** Get your premium status and benefits */
1301
- async premiumStatus() {
1302
- return this.req("/agent/premium");
1303
- }
1304
- /** Upgrade to premium (pay with credits) */
1305
- async upgradePremium(months = 1) {
1306
- return this.req("/agent/premium", {
1307
- method: "POST",
1308
- body: JSON.stringify({ payment_method: "credits", months })
1309
- });
1310
- }
1311
1309
  /** Get your referral code and stats */
1312
1310
  async referralStats() {
1313
1311
  return this.req("/referral");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moltos/sdk",
3
- "version": "0.16.3",
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",