wave-agent-sdk 0.17.2 → 0.17.3

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.
@@ -49,7 +49,7 @@ export declare class MarketplaceService {
49
49
  */
50
50
  getCacheRegistry(): Promise<KnownMarketplacesRegistry | null>;
51
51
  /**
52
- * Legacy method: loads known marketplaces with builtin injection.
52
+ * Legacy method: loads known marketplaces from cache.
53
53
  * @deprecated Use listMarketplaces() instead, which combines scoped settings.
54
54
  */
55
55
  getKnownMarketplaces(): Promise<KnownMarketplacesRegistry>;
@@ -90,7 +90,7 @@ export declare class MarketplaceService {
90
90
  */
91
91
  addMarketplace(input: string, scope?: Scope): Promise<KnownMarketplace>;
92
92
  /**
93
- * Lists all registered marketplaces by combining scoped settings + built-in
93
+ * Lists all registered marketplaces by combining scoped settings + cache
94
94
  */
95
95
  listMarketplaces(): Promise<KnownMarketplace[]>;
96
96
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MarketplaceService.d.ts","sourceRoot":"","sources":["../../src/services/MarketplaceService.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAqB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAG1E;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;IACzC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO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;IAkBnE;;OAEG;IACG,iBAAiB,CACrB,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GACpC,OAAO,CAAC,IAAI,CAAC;IA2GhB;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBpC;;OAEG;IACG,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BrE;;OAEG;IACG,aAAa,CACjB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,eAAe,CAAC;IA8H3B;;OAEG;IACG,eAAe,CACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC;IAoChB;;OAEG;IACG,YAAY,CAAC,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAM1E"}
@@ -155,30 +155,19 @@ export class MarketplaceService {
155
155
  }
156
156
  }
157
157
  /**
158
- * Legacy method: loads known marketplaces with builtin injection.
158
+ * Legacy method: loads known marketplaces from cache.
159
159
  * @deprecated Use listMarketplaces() instead, which combines scoped settings.
160
160
  */
161
161
  async getKnownMarketplaces() {
162
162
  const cache = await this.getCacheRegistry();
163
- // If cache is null (file doesn't exist or has no parseable content), inject builtin
164
163
  if (cache === null) {
165
- return {
166
- marketplaces: [
167
- {
168
- ...MarketplaceService.BUILTIN_MARKETPLACE,
169
- isBuiltin: true,
170
- declaredScope: "builtin",
171
- },
172
- ],
173
- };
164
+ return { marketplaces: [] };
174
165
  }
175
- // File has valid JSON - respect user's explicit choice even if empty
176
- const hasBuiltin = cache.marketplaces.some((m) => m.name === MarketplaceService.BUILTIN_MARKETPLACE.name);
177
166
  return {
178
167
  marketplaces: cache.marketplaces.map((m) => ({
179
168
  ...m,
180
169
  isBuiltin: m.isBuiltin || m.name === MarketplaceService.BUILTIN_MARKETPLACE.name,
181
- declaredScope: m.declaredScope ?? (hasBuiltin ? "builtin" : "user"),
170
+ declaredScope: m.declaredScope ?? "user",
182
171
  })),
183
172
  };
184
173
  }
@@ -293,14 +282,14 @@ export class MarketplaceService {
293
282
  * Finds which scope declared a marketplace (user, project, local, or builtin)
294
283
  */
295
284
  getMarketplaceDeclaringSource(name) {
296
- if (name === MarketplaceService.BUILTIN_MARKETPLACE.name)
297
- return "builtin";
298
285
  const scopes = ["local", "project", "user"];
299
286
  for (const scope of scopes) {
300
287
  const scoped = this.configurationService.getScopedMarketplaces(this.workdir, scope);
301
288
  if (scoped[name])
302
289
  return scope;
303
290
  }
291
+ if (name === MarketplaceService.BUILTIN_MARKETPLACE.name)
292
+ return "builtin";
304
293
  return null;
305
294
  }
306
295
  /**
@@ -381,37 +370,28 @@ export class MarketplaceService {
381
370
  });
382
371
  }
383
372
  /**
384
- * Lists all registered marketplaces by combining scoped settings + built-in
373
+ * Lists all registered marketplaces by combining scoped settings + cache
385
374
  */
386
375
  async listMarketplaces() {
387
376
  const scopedMarketplaces = this.configurationService.getMergedMarketplaces(this.workdir);
388
377
  const cacheRegistry = await this.getCacheRegistry();
389
378
  const cacheMap = new Map((cacheRegistry?.marketplaces ?? []).map((m) => [m.name, m]));
390
379
  const result = [];
391
- // Add built-in marketplace
392
- result.push({
393
- ...MarketplaceService.BUILTIN_MARKETPLACE,
394
- isBuiltin: true,
395
- declaredScope: "builtin",
396
- });
397
380
  // Add all scoped marketplaces (local overrides project overrides user)
398
381
  for (const [name, config] of Object.entries(scopedMarketplaces)) {
399
- if (name === MarketplaceService.BUILTIN_MARKETPLACE.name)
400
- continue;
401
382
  const cache = cacheMap.get(name);
402
383
  const declaredScope = this.getMarketplaceDeclaringSource(name);
403
384
  result.push(await this.buildMarketplaceEntry(name, config, cache, declaredScope));
404
385
  }
405
386
  // Add cache entries not yet in scoped settings (backwards compatibility)
406
387
  for (const [name, cache] of cacheMap.entries()) {
407
- if (name === MarketplaceService.BUILTIN_MARKETPLACE.name)
408
- continue;
409
388
  if (scopedMarketplaces[name])
410
389
  continue;
390
+ const isBuiltin = name === MarketplaceService.BUILTIN_MARKETPLACE.name;
411
391
  result.push({
412
392
  ...cache,
413
- isBuiltin: false,
414
- declaredScope: cache.declaredScope ?? "user",
393
+ isBuiltin,
394
+ declaredScope: cache.declaredScope ?? (isBuiltin ? "builtin" : "user"),
415
395
  });
416
396
  }
417
397
  return result;
@@ -422,10 +402,9 @@ export class MarketplaceService {
422
402
  async removeMarketplace(name, scope) {
423
403
  return this.withLock(async () => {
424
404
  const targetScope = scope || this.getMarketplaceDeclaringSource(name) || "user";
425
- if (targetScope === "builtin") {
426
- throw new Error("Cannot remove built-in marketplace");
405
+ if (targetScope !== "builtin") {
406
+ await this.configurationService.removeMarketplaceFromScope(this.workdir, targetScope, name);
427
407
  }
428
- await this.configurationService.removeMarketplaceFromScope(this.workdir, targetScope, name);
429
408
  // Also remove from cache
430
409
  await this.removeFromCache(name);
431
410
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-agent-sdk",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "description": "SDK for building AI-powered development tools and agents",
5
5
  "keywords": [
6
6
  "ai",
@@ -217,33 +217,20 @@ export class MarketplaceService {
217
217
  }
218
218
 
219
219
  /**
220
- * Legacy method: loads known marketplaces with builtin injection.
220
+ * Legacy method: loads known marketplaces from cache.
221
221
  * @deprecated Use listMarketplaces() instead, which combines scoped settings.
222
222
  */
223
223
  async getKnownMarketplaces(): Promise<KnownMarketplacesRegistry> {
224
224
  const cache = await this.getCacheRegistry();
225
- // If cache is null (file doesn't exist or has no parseable content), inject builtin
226
225
  if (cache === null) {
227
- return {
228
- marketplaces: [
229
- {
230
- ...MarketplaceService.BUILTIN_MARKETPLACE,
231
- isBuiltin: true,
232
- declaredScope: "builtin",
233
- },
234
- ],
235
- };
226
+ return { marketplaces: [] };
236
227
  }
237
- // File has valid JSON - respect user's explicit choice even if empty
238
- const hasBuiltin = cache.marketplaces.some(
239
- (m) => m.name === MarketplaceService.BUILTIN_MARKETPLACE.name,
240
- );
241
228
  return {
242
229
  marketplaces: cache.marketplaces.map((m) => ({
243
230
  ...m,
244
231
  isBuiltin:
245
232
  m.isBuiltin || m.name === MarketplaceService.BUILTIN_MARKETPLACE.name,
246
- declaredScope: m.declaredScope ?? (hasBuiltin ? "builtin" : "user"),
233
+ declaredScope: m.declaredScope ?? "user",
247
234
  })),
248
235
  };
249
236
  }
@@ -385,8 +372,6 @@ export class MarketplaceService {
385
372
  * Finds which scope declared a marketplace (user, project, local, or builtin)
386
373
  */
387
374
  getMarketplaceDeclaringSource(name: string): Scope | "builtin" | null {
388
- if (name === MarketplaceService.BUILTIN_MARKETPLACE.name) return "builtin";
389
-
390
375
  const scopes: Scope[] = ["local", "project", "user"];
391
376
  for (const scope of scopes) {
392
377
  const scoped = this.configurationService.getScopedMarketplaces(
@@ -395,6 +380,7 @@ export class MarketplaceService {
395
380
  );
396
381
  if (scoped[name]) return scope;
397
382
  }
383
+ if (name === MarketplaceService.BUILTIN_MARKETPLACE.name) return "builtin";
398
384
  return null;
399
385
  }
400
386
 
@@ -503,7 +489,7 @@ export class MarketplaceService {
503
489
  }
504
490
 
505
491
  /**
506
- * Lists all registered marketplaces by combining scoped settings + built-in
492
+ * Lists all registered marketplaces by combining scoped settings + cache
507
493
  */
508
494
  async listMarketplaces(): Promise<KnownMarketplace[]> {
509
495
  const scopedMarketplaces = this.configurationService.getMergedMarketplaces(
@@ -516,16 +502,8 @@ export class MarketplaceService {
516
502
 
517
503
  const result: KnownMarketplace[] = [];
518
504
 
519
- // Add built-in marketplace
520
- result.push({
521
- ...MarketplaceService.BUILTIN_MARKETPLACE,
522
- isBuiltin: true,
523
- declaredScope: "builtin",
524
- });
525
-
526
505
  // Add all scoped marketplaces (local overrides project overrides user)
527
506
  for (const [name, config] of Object.entries(scopedMarketplaces)) {
528
- if (name === MarketplaceService.BUILTIN_MARKETPLACE.name) continue;
529
507
  const cache = cacheMap.get(name);
530
508
  const declaredScope = this.getMarketplaceDeclaringSource(name) as
531
509
  | "user"
@@ -538,12 +516,12 @@ export class MarketplaceService {
538
516
 
539
517
  // Add cache entries not yet in scoped settings (backwards compatibility)
540
518
  for (const [name, cache] of cacheMap.entries()) {
541
- if (name === MarketplaceService.BUILTIN_MARKETPLACE.name) continue;
542
519
  if (scopedMarketplaces[name]) continue;
520
+ const isBuiltin = name === MarketplaceService.BUILTIN_MARKETPLACE.name;
543
521
  result.push({
544
522
  ...cache,
545
- isBuiltin: false,
546
- declaredScope: cache.declaredScope ?? "user",
523
+ isBuiltin,
524
+ declaredScope: cache.declaredScope ?? (isBuiltin ? "builtin" : "user"),
547
525
  });
548
526
  }
549
527
 
@@ -558,16 +536,14 @@ export class MarketplaceService {
558
536
  const targetScope =
559
537
  scope || this.getMarketplaceDeclaringSource(name) || "user";
560
538
 
561
- if (targetScope === "builtin") {
562
- throw new Error("Cannot remove built-in marketplace");
539
+ if (targetScope !== "builtin") {
540
+ await this.configurationService.removeMarketplaceFromScope(
541
+ this.workdir,
542
+ targetScope,
543
+ name,
544
+ );
563
545
  }
564
546
 
565
- await this.configurationService.removeMarketplaceFromScope(
566
- this.workdir,
567
- targetScope,
568
- name,
569
- );
570
-
571
547
  // Also remove from cache
572
548
  await this.removeFromCache(name);
573
549
  });