@lobehub/market-sdk 0.0.6 → 0.0.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.d.mts CHANGED
@@ -21,9 +21,14 @@ interface ConnectionConfig {
21
21
  args?: string[];
22
22
  url?: string;
23
23
  }
24
+ interface InstallationDetails {
25
+ packageName?: string;
26
+ repositoryUrlToClone?: string;
27
+ setupSteps?: string[];
28
+ }
24
29
  interface DeploymentOption {
25
30
  installationMethod: string;
26
- installationDetails?: Record<string, any>;
31
+ installationDetails?: InstallationDetails;
27
32
  connection: ConnectionConfig;
28
33
  isRecommended?: boolean;
29
34
  notes?: string;
@@ -219,4 +224,4 @@ declare class MarketSDK {
219
224
  clearAuthToken(): void;
220
225
  }
221
226
 
222
- export { type ConnectionConfig, type ConnectionType, ConnectionTypeEnum, type DeploymentOption, type DiscoveryDocument, type InstallationMethod, InstallationMethodEnum, MarketSDK, type MarketSDKOptions, type PluginCompatibility, type PluginItem, type PluginListResponse, type PluginManifest, type PluginPrompt, type PluginResource, type PluginTool, type PluginType, PluginTypeEnum, type PromptArgument, type SystemDependency };
227
+ export { type ConnectionConfig, type ConnectionType, ConnectionTypeEnum, type DeploymentOption, type DiscoveryDocument, type InstallationDetails, type InstallationMethod, InstallationMethodEnum, MarketSDK, type MarketSDKOptions, type PluginCompatibility, type PluginItem, type PluginListResponse, type PluginManifest, type PluginPrompt, type PluginResource, type PluginTool, type PluginType, PluginTypeEnum, type PromptArgument, type SystemDependency };
package/dist/index.mjs CHANGED
@@ -1,803 +1,3 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
- mod
31
- ));
32
-
33
- // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
34
- var require_ms = __commonJS({
35
- "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
36
- "use strict";
37
- var s = 1e3;
38
- var m = s * 60;
39
- var h = m * 60;
40
- var d = h * 24;
41
- var w = d * 7;
42
- var y = d * 365.25;
43
- module.exports = function(val, options) {
44
- options = options || {};
45
- var type = typeof val;
46
- if (type === "string" && val.length > 0) {
47
- return parse(val);
48
- } else if (type === "number" && isFinite(val)) {
49
- return options.long ? fmtLong(val) : fmtShort(val);
50
- }
51
- throw new Error(
52
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
53
- );
54
- };
55
- function parse(str) {
56
- str = String(str);
57
- if (str.length > 100) {
58
- return;
59
- }
60
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
61
- str
62
- );
63
- if (!match) {
64
- return;
65
- }
66
- var n = parseFloat(match[1]);
67
- var type = (match[2] || "ms").toLowerCase();
68
- switch (type) {
69
- case "years":
70
- case "year":
71
- case "yrs":
72
- case "yr":
73
- case "y":
74
- return n * y;
75
- case "weeks":
76
- case "week":
77
- case "w":
78
- return n * w;
79
- case "days":
80
- case "day":
81
- case "d":
82
- return n * d;
83
- case "hours":
84
- case "hour":
85
- case "hrs":
86
- case "hr":
87
- case "h":
88
- return n * h;
89
- case "minutes":
90
- case "minute":
91
- case "mins":
92
- case "min":
93
- case "m":
94
- return n * m;
95
- case "seconds":
96
- case "second":
97
- case "secs":
98
- case "sec":
99
- case "s":
100
- return n * s;
101
- case "milliseconds":
102
- case "millisecond":
103
- case "msecs":
104
- case "msec":
105
- case "ms":
106
- return n;
107
- default:
108
- return void 0;
109
- }
110
- }
111
- function fmtShort(ms) {
112
- var msAbs = Math.abs(ms);
113
- if (msAbs >= d) {
114
- return Math.round(ms / d) + "d";
115
- }
116
- if (msAbs >= h) {
117
- return Math.round(ms / h) + "h";
118
- }
119
- if (msAbs >= m) {
120
- return Math.round(ms / m) + "m";
121
- }
122
- if (msAbs >= s) {
123
- return Math.round(ms / s) + "s";
124
- }
125
- return ms + "ms";
126
- }
127
- function fmtLong(ms) {
128
- var msAbs = Math.abs(ms);
129
- if (msAbs >= d) {
130
- return plural(ms, msAbs, d, "day");
131
- }
132
- if (msAbs >= h) {
133
- return plural(ms, msAbs, h, "hour");
134
- }
135
- if (msAbs >= m) {
136
- return plural(ms, msAbs, m, "minute");
137
- }
138
- if (msAbs >= s) {
139
- return plural(ms, msAbs, s, "second");
140
- }
141
- return ms + " ms";
142
- }
143
- function plural(ms, msAbs, n, name) {
144
- var isPlural = msAbs >= n * 1.5;
145
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
146
- }
147
- }
148
- });
149
-
150
- // ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js
151
- var require_common = __commonJS({
152
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js"(exports, module) {
153
- "use strict";
154
- function setup(env) {
155
- createDebug.debug = createDebug;
156
- createDebug.default = createDebug;
157
- createDebug.coerce = coerce;
158
- createDebug.disable = disable;
159
- createDebug.enable = enable;
160
- createDebug.enabled = enabled;
161
- createDebug.humanize = require_ms();
162
- createDebug.destroy = destroy;
163
- Object.keys(env).forEach((key) => {
164
- createDebug[key] = env[key];
165
- });
166
- createDebug.names = [];
167
- createDebug.skips = [];
168
- createDebug.formatters = {};
169
- function selectColor(namespace) {
170
- let hash = 0;
171
- for (let i = 0; i < namespace.length; i++) {
172
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
173
- hash |= 0;
174
- }
175
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
176
- }
177
- createDebug.selectColor = selectColor;
178
- function createDebug(namespace) {
179
- let prevTime;
180
- let enableOverride = null;
181
- let namespacesCache;
182
- let enabledCache;
183
- function debug2(...args) {
184
- if (!debug2.enabled) {
185
- return;
186
- }
187
- const self = debug2;
188
- const curr = Number(/* @__PURE__ */ new Date());
189
- const ms = curr - (prevTime || curr);
190
- self.diff = ms;
191
- self.prev = prevTime;
192
- self.curr = curr;
193
- prevTime = curr;
194
- args[0] = createDebug.coerce(args[0]);
195
- if (typeof args[0] !== "string") {
196
- args.unshift("%O");
197
- }
198
- let index = 0;
199
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
200
- if (match === "%%") {
201
- return "%";
202
- }
203
- index++;
204
- const formatter = createDebug.formatters[format];
205
- if (typeof formatter === "function") {
206
- const val = args[index];
207
- match = formatter.call(self, val);
208
- args.splice(index, 1);
209
- index--;
210
- }
211
- return match;
212
- });
213
- createDebug.formatArgs.call(self, args);
214
- const logFn = self.log || createDebug.log;
215
- logFn.apply(self, args);
216
- }
217
- debug2.namespace = namespace;
218
- debug2.useColors = createDebug.useColors();
219
- debug2.color = createDebug.selectColor(namespace);
220
- debug2.extend = extend;
221
- debug2.destroy = createDebug.destroy;
222
- Object.defineProperty(debug2, "enabled", {
223
- enumerable: true,
224
- configurable: false,
225
- get: () => {
226
- if (enableOverride !== null) {
227
- return enableOverride;
228
- }
229
- if (namespacesCache !== createDebug.namespaces) {
230
- namespacesCache = createDebug.namespaces;
231
- enabledCache = createDebug.enabled(namespace);
232
- }
233
- return enabledCache;
234
- },
235
- set: (v) => {
236
- enableOverride = v;
237
- }
238
- });
239
- if (typeof createDebug.init === "function") {
240
- createDebug.init(debug2);
241
- }
242
- return debug2;
243
- }
244
- function extend(namespace, delimiter) {
245
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
246
- newDebug.log = this.log;
247
- return newDebug;
248
- }
249
- function enable(namespaces) {
250
- createDebug.save(namespaces);
251
- createDebug.namespaces = namespaces;
252
- createDebug.names = [];
253
- createDebug.skips = [];
254
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
255
- for (const ns of split) {
256
- if (ns[0] === "-") {
257
- createDebug.skips.push(ns.slice(1));
258
- } else {
259
- createDebug.names.push(ns);
260
- }
261
- }
262
- }
263
- function matchesTemplate(search, template) {
264
- let searchIndex = 0;
265
- let templateIndex = 0;
266
- let starIndex = -1;
267
- let matchIndex = 0;
268
- while (searchIndex < search.length) {
269
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
270
- if (template[templateIndex] === "*") {
271
- starIndex = templateIndex;
272
- matchIndex = searchIndex;
273
- templateIndex++;
274
- } else {
275
- searchIndex++;
276
- templateIndex++;
277
- }
278
- } else if (starIndex !== -1) {
279
- templateIndex = starIndex + 1;
280
- matchIndex++;
281
- searchIndex = matchIndex;
282
- } else {
283
- return false;
284
- }
285
- }
286
- while (templateIndex < template.length && template[templateIndex] === "*") {
287
- templateIndex++;
288
- }
289
- return templateIndex === template.length;
290
- }
291
- function disable() {
292
- const namespaces = [
293
- ...createDebug.names,
294
- ...createDebug.skips.map((namespace) => "-" + namespace)
295
- ].join(",");
296
- createDebug.enable("");
297
- return namespaces;
298
- }
299
- function enabled(name) {
300
- for (const skip of createDebug.skips) {
301
- if (matchesTemplate(name, skip)) {
302
- return false;
303
- }
304
- }
305
- for (const ns of createDebug.names) {
306
- if (matchesTemplate(name, ns)) {
307
- return true;
308
- }
309
- }
310
- return false;
311
- }
312
- function coerce(val) {
313
- if (val instanceof Error) {
314
- return val.stack || val.message;
315
- }
316
- return val;
317
- }
318
- function destroy() {
319
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
320
- }
321
- createDebug.enable(createDebug.load());
322
- return createDebug;
323
- }
324
- module.exports = setup;
325
- }
326
- });
327
-
328
- // ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js
329
- var require_browser = __commonJS({
330
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js"(exports, module) {
331
- "use strict";
332
- exports.formatArgs = formatArgs;
333
- exports.save = save;
334
- exports.load = load;
335
- exports.useColors = useColors;
336
- exports.storage = localstorage();
337
- exports.destroy = /* @__PURE__ */ (() => {
338
- let warned = false;
339
- return () => {
340
- if (!warned) {
341
- warned = true;
342
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
343
- }
344
- };
345
- })();
346
- exports.colors = [
347
- "#0000CC",
348
- "#0000FF",
349
- "#0033CC",
350
- "#0033FF",
351
- "#0066CC",
352
- "#0066FF",
353
- "#0099CC",
354
- "#0099FF",
355
- "#00CC00",
356
- "#00CC33",
357
- "#00CC66",
358
- "#00CC99",
359
- "#00CCCC",
360
- "#00CCFF",
361
- "#3300CC",
362
- "#3300FF",
363
- "#3333CC",
364
- "#3333FF",
365
- "#3366CC",
366
- "#3366FF",
367
- "#3399CC",
368
- "#3399FF",
369
- "#33CC00",
370
- "#33CC33",
371
- "#33CC66",
372
- "#33CC99",
373
- "#33CCCC",
374
- "#33CCFF",
375
- "#6600CC",
376
- "#6600FF",
377
- "#6633CC",
378
- "#6633FF",
379
- "#66CC00",
380
- "#66CC33",
381
- "#9900CC",
382
- "#9900FF",
383
- "#9933CC",
384
- "#9933FF",
385
- "#99CC00",
386
- "#99CC33",
387
- "#CC0000",
388
- "#CC0033",
389
- "#CC0066",
390
- "#CC0099",
391
- "#CC00CC",
392
- "#CC00FF",
393
- "#CC3300",
394
- "#CC3333",
395
- "#CC3366",
396
- "#CC3399",
397
- "#CC33CC",
398
- "#CC33FF",
399
- "#CC6600",
400
- "#CC6633",
401
- "#CC9900",
402
- "#CC9933",
403
- "#CCCC00",
404
- "#CCCC33",
405
- "#FF0000",
406
- "#FF0033",
407
- "#FF0066",
408
- "#FF0099",
409
- "#FF00CC",
410
- "#FF00FF",
411
- "#FF3300",
412
- "#FF3333",
413
- "#FF3366",
414
- "#FF3399",
415
- "#FF33CC",
416
- "#FF33FF",
417
- "#FF6600",
418
- "#FF6633",
419
- "#FF9900",
420
- "#FF9933",
421
- "#FFCC00",
422
- "#FFCC33"
423
- ];
424
- function useColors() {
425
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
426
- return true;
427
- }
428
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
429
- return false;
430
- }
431
- let m;
432
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
433
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
434
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
435
- typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
436
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
437
- }
438
- function formatArgs(args) {
439
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
440
- if (!this.useColors) {
441
- return;
442
- }
443
- const c = "color: " + this.color;
444
- args.splice(1, 0, c, "color: inherit");
445
- let index = 0;
446
- let lastC = 0;
447
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
448
- if (match === "%%") {
449
- return;
450
- }
451
- index++;
452
- if (match === "%c") {
453
- lastC = index;
454
- }
455
- });
456
- args.splice(lastC, 0, c);
457
- }
458
- exports.log = console.debug || console.log || (() => {
459
- });
460
- function save(namespaces) {
461
- try {
462
- if (namespaces) {
463
- exports.storage.setItem("debug", namespaces);
464
- } else {
465
- exports.storage.removeItem("debug");
466
- }
467
- } catch (error) {
468
- }
469
- }
470
- function load() {
471
- let r;
472
- try {
473
- r = exports.storage.getItem("debug");
474
- } catch (error) {
475
- }
476
- if (!r && typeof process !== "undefined" && "env" in process) {
477
- r = process.env.DEBUG;
478
- }
479
- return r;
480
- }
481
- function localstorage() {
482
- try {
483
- return localStorage;
484
- } catch (error) {
485
- }
486
- }
487
- module.exports = require_common()(exports);
488
- var { formatters } = module.exports;
489
- formatters.j = function(v) {
490
- try {
491
- return JSON.stringify(v);
492
- } catch (error) {
493
- return "[UnexpectedJSONParseError]: " + error.message;
494
- }
495
- };
496
- }
497
- });
498
-
499
- // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
500
- var require_has_flag = __commonJS({
501
- "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
502
- "use strict";
503
- module.exports = (flag, argv = process.argv) => {
504
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
505
- const position = argv.indexOf(prefix + flag);
506
- const terminatorPosition = argv.indexOf("--");
507
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
508
- };
509
- }
510
- });
511
-
512
- // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
513
- var require_supports_color = __commonJS({
514
- "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
515
- "use strict";
516
- var os = __require("os");
517
- var tty = __require("tty");
518
- var hasFlag = require_has_flag();
519
- var { env } = process;
520
- var forceColor;
521
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
522
- forceColor = 0;
523
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
524
- forceColor = 1;
525
- }
526
- if ("FORCE_COLOR" in env) {
527
- if (env.FORCE_COLOR === "true") {
528
- forceColor = 1;
529
- } else if (env.FORCE_COLOR === "false") {
530
- forceColor = 0;
531
- } else {
532
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
533
- }
534
- }
535
- function translateLevel(level) {
536
- if (level === 0) {
537
- return false;
538
- }
539
- return {
540
- level,
541
- hasBasic: true,
542
- has256: level >= 2,
543
- has16m: level >= 3
544
- };
545
- }
546
- function supportsColor(haveStream, streamIsTTY) {
547
- if (forceColor === 0) {
548
- return 0;
549
- }
550
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
551
- return 3;
552
- }
553
- if (hasFlag("color=256")) {
554
- return 2;
555
- }
556
- if (haveStream && !streamIsTTY && forceColor === void 0) {
557
- return 0;
558
- }
559
- const min = forceColor || 0;
560
- if (env.TERM === "dumb") {
561
- return min;
562
- }
563
- if (process.platform === "win32") {
564
- const osRelease = os.release().split(".");
565
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
566
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
567
- }
568
- return 1;
569
- }
570
- if ("CI" in env) {
571
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
572
- return 1;
573
- }
574
- return min;
575
- }
576
- if ("TEAMCITY_VERSION" in env) {
577
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
578
- }
579
- if (env.COLORTERM === "truecolor") {
580
- return 3;
581
- }
582
- if ("TERM_PROGRAM" in env) {
583
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
584
- switch (env.TERM_PROGRAM) {
585
- case "iTerm.app":
586
- return version >= 3 ? 3 : 2;
587
- case "Apple_Terminal":
588
- return 2;
589
- }
590
- }
591
- if (/-256(color)?$/i.test(env.TERM)) {
592
- return 2;
593
- }
594
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
595
- return 1;
596
- }
597
- if ("COLORTERM" in env) {
598
- return 1;
599
- }
600
- return min;
601
- }
602
- function getSupportLevel(stream) {
603
- const level = supportsColor(stream, stream && stream.isTTY);
604
- return translateLevel(level);
605
- }
606
- module.exports = {
607
- supportsColor: getSupportLevel,
608
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
609
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
610
- };
611
- }
612
- });
613
-
614
- // ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js
615
- var require_node = __commonJS({
616
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js"(exports, module) {
617
- "use strict";
618
- var tty = __require("tty");
619
- var util = __require("util");
620
- exports.init = init;
621
- exports.log = log2;
622
- exports.formatArgs = formatArgs;
623
- exports.save = save;
624
- exports.load = load;
625
- exports.useColors = useColors;
626
- exports.destroy = util.deprecate(
627
- () => {
628
- },
629
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
630
- );
631
- exports.colors = [6, 2, 3, 4, 5, 1];
632
- try {
633
- const supportsColor = require_supports_color();
634
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
635
- exports.colors = [
636
- 20,
637
- 21,
638
- 26,
639
- 27,
640
- 32,
641
- 33,
642
- 38,
643
- 39,
644
- 40,
645
- 41,
646
- 42,
647
- 43,
648
- 44,
649
- 45,
650
- 56,
651
- 57,
652
- 62,
653
- 63,
654
- 68,
655
- 69,
656
- 74,
657
- 75,
658
- 76,
659
- 77,
660
- 78,
661
- 79,
662
- 80,
663
- 81,
664
- 92,
665
- 93,
666
- 98,
667
- 99,
668
- 112,
669
- 113,
670
- 128,
671
- 129,
672
- 134,
673
- 135,
674
- 148,
675
- 149,
676
- 160,
677
- 161,
678
- 162,
679
- 163,
680
- 164,
681
- 165,
682
- 166,
683
- 167,
684
- 168,
685
- 169,
686
- 170,
687
- 171,
688
- 172,
689
- 173,
690
- 178,
691
- 179,
692
- 184,
693
- 185,
694
- 196,
695
- 197,
696
- 198,
697
- 199,
698
- 200,
699
- 201,
700
- 202,
701
- 203,
702
- 204,
703
- 205,
704
- 206,
705
- 207,
706
- 208,
707
- 209,
708
- 214,
709
- 215,
710
- 220,
711
- 221
712
- ];
713
- }
714
- } catch (error) {
715
- }
716
- exports.inspectOpts = Object.keys(process.env).filter((key) => {
717
- return /^debug_/i.test(key);
718
- }).reduce((obj, key) => {
719
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
720
- return k.toUpperCase();
721
- });
722
- let val = process.env[key];
723
- if (/^(yes|on|true|enabled)$/i.test(val)) {
724
- val = true;
725
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
726
- val = false;
727
- } else if (val === "null") {
728
- val = null;
729
- } else {
730
- val = Number(val);
731
- }
732
- obj[prop] = val;
733
- return obj;
734
- }, {});
735
- function useColors() {
736
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
737
- }
738
- function formatArgs(args) {
739
- const { namespace: name, useColors: useColors2 } = this;
740
- if (useColors2) {
741
- const c = this.color;
742
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
743
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
744
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
745
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
746
- } else {
747
- args[0] = getDate() + name + " " + args[0];
748
- }
749
- }
750
- function getDate() {
751
- if (exports.inspectOpts.hideDate) {
752
- return "";
753
- }
754
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
755
- }
756
- function log2(...args) {
757
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
758
- }
759
- function save(namespaces) {
760
- if (namespaces) {
761
- process.env.DEBUG = namespaces;
762
- } else {
763
- delete process.env.DEBUG;
764
- }
765
- }
766
- function load() {
767
- return process.env.DEBUG;
768
- }
769
- function init(debug2) {
770
- debug2.inspectOpts = {};
771
- const keys = Object.keys(exports.inspectOpts);
772
- for (let i = 0; i < keys.length; i++) {
773
- debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
774
- }
775
- }
776
- module.exports = require_common()(exports);
777
- var { formatters } = module.exports;
778
- formatters.o = function(v) {
779
- this.inspectOpts.colors = this.useColors;
780
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
781
- };
782
- formatters.O = function(v) {
783
- this.inspectOpts.colors = this.useColors;
784
- return util.inspect(v, this.inspectOpts);
785
- };
786
- }
787
- });
788
-
789
- // ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js
790
- var require_src = __commonJS({
791
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"(exports, module) {
792
- "use strict";
793
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
794
- module.exports = require_browser();
795
- } else {
796
- module.exports = require_node();
797
- }
798
- }
799
- });
800
-
801
1
  // src/types.ts
802
2
  import { z } from "zod";
803
3
  var PluginTypeEnum = z.enum(["lobe", "openai", "mcp"]);
@@ -812,8 +12,8 @@ var InstallationMethodEnum = z.enum([
812
12
  ]);
813
13
 
814
14
  // src/market-sdk.ts
815
- var import_debug = __toESM(require_src());
816
- var log = (0, import_debug.default)("lobe-market-sdk");
15
+ import debug from "debug";
16
+ var log = debug("lobe-market-sdk");
817
17
  var MarketSDK = class {
818
18
  /**
819
19
  * Create MarketSDK instance
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js","../../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js","../../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js","../../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js","../../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js","../../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js","../../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js","../src/types.ts","../src/market-sdk.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(' ', ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","import { z } from 'zod';\n\n// 插件类型\nexport const PluginTypeEnum = z.enum(['lobe', 'openai', 'mcp']);\nexport type PluginType = z.infer<typeof PluginTypeEnum>;\n\n// 连接类型\nexport const ConnectionTypeEnum = z.enum(['http', 'stdio']);\nexport type ConnectionType = z.infer<typeof ConnectionTypeEnum>;\n\n// 安装方法\nexport const InstallationMethodEnum = z.enum([\n 'npm',\n 'docker',\n 'git',\n 'binaryUrl',\n 'manual',\n 'none',\n]);\nexport type InstallationMethod = z.infer<typeof InstallationMethodEnum>;\n\n// 系统依赖项\nexport interface SystemDependency {\n name: string;\n type?: string;\n requiredVersion?: string;\n checkCommand?: string;\n installInstructions?: Record<string, string>;\n versionParsingRequired?: boolean;\n notes?: string;\n}\n\n// 连接配置\nexport interface ConnectionConfig {\n type: string;\n command?: string;\n args?: string[];\n url?: string;\n}\n\n// 部署选项\nexport interface DeploymentOption {\n installationMethod: string;\n installationDetails?: Record<string, any>;\n connection: ConnectionConfig;\n isRecommended?: boolean;\n notes?: string;\n systemDependencies?: SystemDependency[];\n}\n\n// 兼容性信息\nexport interface PluginCompatibility {\n platforms?: string[];\n minAppVersion?: string;\n maxAppVersion?: string;\n}\n\n// 插件项\nexport interface PluginItem {\n identifier: string;\n version: string;\n isLatest: boolean;\n name: string;\n createdAt: string;\n type: PluginType;\n manifestUrl?: string;\n manifestVersion: string;\n icon?: string;\n author?: string;\n homepage?: string;\n category?: string;\n connectionType?: ConnectionType;\n compatibility?: PluginCompatibility;\n capabilities: {\n tools: boolean;\n prompts: boolean;\n resources: boolean;\n };\n description: string;\n tags?: string[];\n authRequirement?: string;\n isInstallable?: boolean;\n toolsCount?: number;\n promptsCount?: number;\n resourcesCount?: number;\n isValidated?: boolean;\n installCount?: number;\n ratingAverage?: number;\n ratingCount?: number;\n commentCount?: number;\n}\n\n// 插件列表响应\nexport interface PluginListResponse {\n items: PluginItem[];\n totalCount: number;\n currentPage: number;\n pageSize: number;\n totalPages: number;\n categories: string[];\n tags: string[];\n}\n\n// 工具项定义\nexport interface PluginTool {\n name: string;\n description?: string;\n parameters?: Record<string, any>;\n}\n\n// 资源项定义\nexport interface PluginResource {\n uri: string;\n name?: string;\n mimeType?: string;\n}\n\n// 提示词参数定义\nexport interface PromptArgument {\n name: string;\n required?: boolean;\n description?: string;\n type?: string;\n}\n\n// 提示词项定义\nexport interface PluginPrompt {\n name: string;\n description: string;\n arguments?: PromptArgument[];\n}\n\n// 插件清单\nexport interface PluginManifest {\n id: string;\n name: string;\n version: string;\n description: string;\n category?: string;\n tags?: string[];\n author?: {\n name: string;\n url?: string;\n };\n homepage?: string;\n icon?: string;\n capabilities?: {\n tools?: boolean;\n prompts?: boolean;\n resources?: boolean;\n };\n deploymentOptions?: DeploymentOption[];\n compatibility?: PluginCompatibility;\n // 工具定义\n tools?: PluginTool[];\n // 资源定义\n resources?: PluginResource[];\n // 提示词定义 \n prompts?: PluginPrompt[];\n // 验证信息\n isValidated?: boolean;\n validatedAt?: string;\n}\n\n// 市场服务发现文档\nexport interface DiscoveryDocument {\n issuer: string;\n market_index_schema_version: number;\n resource_types_supported: string[];\n resource_endpoints: Record<string, string>;\n manifest_endpoint_template: string | Record<string, string>;\n support_locales: string[];\n response_types_supported: string[];\n authentication?: {\n schemes_supported: Array<'none' | 'apiKey' | 'oauth2'>;\n };\n api_documentation_url?: string;\n policy_url?: string;\n terms_of_service_url?: string;\n}\n\n// SDK 配置选项\nexport interface MarketSDKOptions {\n baseUrl?: string;\n defaultLocale?: string;\n apiKey?: string;\n}\n","import {\n DiscoveryDocument,\n MarketSDKOptions,\n PluginItem,\n PluginListResponse,\n PluginManifest,\n} from './types';\nimport debug from 'debug';\n\n// Create debug instance\nconst log = debug('lobe-market-sdk');\n\n/**\n * LobeHub Market SDK Client\n */\nexport class MarketSDK {\n private baseUrl: string;\n private defaultLocale: string;\n private discoveryDoc?: DiscoveryDocument;\n private headers: Record<string, string>;\n\n /**\n * Create MarketSDK instance\n * @param options SDK configuration options\n */\n constructor(options: MarketSDKOptions = {}) {\n this.baseUrl = options.baseUrl || 'https://market.lobehub.com/api';\n this.defaultLocale = options.defaultLocale || 'zh-CN';\n this.headers = {\n 'Content-Type': 'application/json',\n ...(options.apiKey ? { Authorization: `Bearer ${options.apiKey}` } : {}),\n };\n log('MarketSDK instance created: %O', { baseUrl: this.baseUrl, defaultLocale: this.defaultLocale });\n }\n\n /**\n * Send request and handle response\n * @param url Request URL\n * @param options fetch options\n * @returns Response data\n */\n private async request<T>(url: string, options: RequestInit = {}): Promise<T> {\n log('Sending request: %s', `${this.baseUrl}${url}`);\n \n const response = await fetch(`${this.baseUrl}${url}`, {\n ...options,\n headers: {\n ...this.headers,\n ...options.headers,\n },\n });\n\n if (!response.ok) {\n const errorMsg = `Request failed: ${response.status} ${response.statusText}`;\n log('Request error: %s', errorMsg);\n throw new Error(errorMsg);\n }\n\n log('Request successful: %s', url);\n return response.json() as Promise<T>;\n }\n\n /**\n * Build query string\n * @param params Query parameters\n * @returns Query string\n */\n private buildQueryString(params: Record<string, any>): string {\n const query = Object.entries(params)\n .filter(([_, value]) => value !== undefined && value !== null)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)\n .join('&');\n \n return query ? `?${query}` : '';\n }\n\n /**\n * Get market service discovery document\n * @returns Service discovery document\n */\n async getDiscoveryDocument(): Promise<DiscoveryDocument> {\n log('Getting service discovery document');\n if (this.discoveryDoc) {\n log('Returning cached discovery document');\n return this.discoveryDoc;\n }\n\n this.discoveryDoc = await this.request<DiscoveryDocument>('/market/.well-known/discovery');\n log('Successfully retrieved service discovery document');\n return this.discoveryDoc;\n }\n\n /**\n * Get plugin list\n * @param params Query parameters\n * @returns Plugin list response\n */\n async getPluginList(params: {\n page?: number;\n pageSize?: number;\n category?: string;\n tags?: string;\n q?: string;\n sort?: 'installCount' | 'createdAt' | 'updatedAt' | 'ratingAverage';\n order?: 'asc' | 'desc';\n locale?: string;\n } = {}): Promise<PluginListResponse> {\n const locale = params.locale || this.defaultLocale;\n const queryParams = { ...params, locale };\n const queryString = this.buildQueryString(queryParams);\n\n log('Getting plugin list: %O', queryParams);\n\n const result = await this.request<PluginListResponse>(`/v1/plugins${queryString}`);\n log('Retrieved %d plugins', result.items.length);\n return result;\n }\n\n /**\n * Get plugin manifest\n * @param identifier Plugin identifier\n * @param locale Language\n * @param version Version\n * @returns Plugin manifest\n */\n async getPluginManifest(\n identifier: string,\n locale?: string,\n version?: string,\n ): Promise<PluginManifest> {\n log('Getting plugin manifest: %O', { identifier, version, locale });\n const localeParam = locale || this.defaultLocale;\n const params: Record<string, string> = { locale: localeParam };\n if (version) {\n params.version = version;\n }\n const queryString = this.buildQueryString(params);\n\n const manifest = await this.request<PluginManifest>(`/v1/plugins/${identifier}/manifest${queryString}`);\n log('Successfully retrieved plugin manifest: %s', identifier);\n return manifest;\n }\n\n /**\n * Import plugin manifests (requires admin privileges)\n * @param manifests Plugin manifest array\n * @param ownerId Owner ID\n * @returns Import result\n */\n async importManifests(manifests: PluginManifest[], ownerId?: number): Promise<{ success: number; failed: number }> {\n log(`Starting batch import of ${manifests.length} manifests`);\n if (ownerId) {\n log(`Using specified owner ID: ${ownerId}`);\n }\n\n const response = await this.request<{ data: { success: number; failed: number } }>('/v1/admin/plugins/import', {\n method: 'POST',\n body: JSON.stringify({\n manifests,\n ownerId,\n }),\n });\n\n log(`Batch import completed: ${response.data.success} successful, ${response.data.failed} failed`);\n return response.data;\n }\n\n /**\n * Set authentication token\n * @param token Authentication token\n */\n setAuthToken(token: string): void {\n log('Setting authentication token');\n this.headers.Authorization = `Bearer ${token}`;\n }\n\n /**\n * Clear authentication token\n */\n clearAuthToken(): void {\n log('Clearing authentication token');\n delete this.headers.Authorization;\n }\n} "],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAU,KAAK,SAAS;AACvC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO,MAAM,GAAG;AAAA,MAClB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,eAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,MACnD;AACA,YAAM,IAAI;AAAA,QACR,0DACE,KAAK,UAAU,GAAG;AAAA,MACtB;AAAA,IACF;AAUA,aAAS,MAAM,KAAK;AAClB,YAAM,OAAO,GAAG;AAChB,UAAI,IAAI,SAAS,KAAK;AACpB;AAAA,MACF;AACA,UAAI,QAAQ,mIAAmI;AAAA,QAC7I;AAAA,MACF;AACA,UAAI,CAAC,OAAO;AACV;AAAA,MACF;AACA,UAAI,I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AS,KAAK,OAAO,gBAAgB,SAAS,KAAK,MAAM,SAAS;AACjG,WAAO,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAa,OAAqB;AAChC,QAAI,8BAA8B;AAClC,SAAK,QAAQ,gBAAgB,UAAU,KAAK;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAuB;AACrB,QAAI,+BAA+B;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;AACF;","names":["debug","log","useColors","debug","debug"]}
1
+ {"version":3,"sources":["../src/types.ts","../src/market-sdk.ts"],"sourcesContent":["import { z } from 'zod';\n\n// 插件类型\nexport const PluginTypeEnum = z.enum(['lobe', 'openai', 'mcp']);\nexport type PluginType = z.infer<typeof PluginTypeEnum>;\n\n// 连接类型\nexport const ConnectionTypeEnum = z.enum(['http', 'stdio']);\nexport type ConnectionType = z.infer<typeof ConnectionTypeEnum>;\n\n// 安装方法\nexport const InstallationMethodEnum = z.enum([\n 'npm',\n 'docker',\n 'git',\n 'binaryUrl',\n 'manual',\n 'none',\n]);\nexport type InstallationMethod = z.infer<typeof InstallationMethodEnum>;\n\n// 系统依赖项\nexport interface SystemDependency {\n name: string;\n type?: string;\n requiredVersion?: string;\n checkCommand?: string;\n installInstructions?: Record<string, string>;\n versionParsingRequired?: boolean;\n notes?: string;\n}\n\n// 连接配置\nexport interface ConnectionConfig {\n type: string;\n command?: string;\n args?: string[];\n url?: string;\n}\n\nexport interface InstallationDetails {\n packageName?: string;\n repositoryUrlToClone?: string;\n setupSteps?: string[];\n}\n// 部署选项\nexport interface DeploymentOption {\n installationMethod: string;\n installationDetails?: InstallationDetails;\n connection: ConnectionConfig;\n isRecommended?: boolean;\n notes?: string;\n systemDependencies?: SystemDependency[];\n}\n\n// 兼容性信息\nexport interface PluginCompatibility {\n platforms?: string[];\n minAppVersion?: string;\n maxAppVersion?: string;\n}\n\n// 插件项\nexport interface PluginItem {\n identifier: string;\n version: string;\n isLatest: boolean;\n name: string;\n createdAt: string;\n type: PluginType;\n manifestUrl?: string;\n manifestVersion: string;\n icon?: string;\n author?: string;\n homepage?: string;\n category?: string;\n connectionType?: ConnectionType;\n compatibility?: PluginCompatibility;\n capabilities: {\n tools: boolean;\n prompts: boolean;\n resources: boolean;\n };\n description: string;\n tags?: string[];\n authRequirement?: string;\n isInstallable?: boolean;\n toolsCount?: number;\n promptsCount?: number;\n resourcesCount?: number;\n isValidated?: boolean;\n installCount?: number;\n ratingAverage?: number;\n ratingCount?: number;\n commentCount?: number;\n}\n\n// 插件列表响应\nexport interface PluginListResponse {\n items: PluginItem[];\n totalCount: number;\n currentPage: number;\n pageSize: number;\n totalPages: number;\n categories: string[];\n tags: string[];\n}\n\n// 工具项定义\nexport interface PluginTool {\n name: string;\n description?: string;\n parameters?: Record<string, any>;\n}\n\n// 资源项定义\nexport interface PluginResource {\n uri: string;\n name?: string;\n mimeType?: string;\n}\n\n// 提示词参数定义\nexport interface PromptArgument {\n name: string;\n required?: boolean;\n description?: string;\n type?: string;\n}\n\n// 提示词项定义\nexport interface PluginPrompt {\n name: string;\n description: string;\n arguments?: PromptArgument[];\n}\n\n// 插件清单\nexport interface PluginManifest {\n id: string;\n name: string;\n version: string;\n description: string;\n category?: string;\n tags?: string[];\n author?: {\n name: string;\n url?: string;\n };\n homepage?: string;\n icon?: string;\n capabilities?: {\n tools?: boolean;\n prompts?: boolean;\n resources?: boolean;\n };\n deploymentOptions?: DeploymentOption[];\n compatibility?: PluginCompatibility;\n // 工具定义\n tools?: PluginTool[];\n // 资源定义\n resources?: PluginResource[];\n // 提示词定义\n prompts?: PluginPrompt[];\n // 验证信息\n isValidated?: boolean;\n validatedAt?: string;\n}\n\n// 市场服务发现文档\nexport interface DiscoveryDocument {\n issuer: string;\n market_index_schema_version: number;\n resource_types_supported: string[];\n resource_endpoints: Record<string, string>;\n manifest_endpoint_template: string | Record<string, string>;\n support_locales: string[];\n response_types_supported: string[];\n authentication?: {\n schemes_supported: Array<'none' | 'apiKey' | 'oauth2'>;\n };\n api_documentation_url?: string;\n policy_url?: string;\n terms_of_service_url?: string;\n}\n\n// SDK 配置选项\nexport interface MarketSDKOptions {\n baseUrl?: string;\n defaultLocale?: string;\n apiKey?: string;\n}\n","import {\n DiscoveryDocument,\n MarketSDKOptions,\n PluginItem,\n PluginListResponse,\n PluginManifest,\n} from './types';\nimport debug from 'debug';\n\n// Create debug instance\nconst log = debug('lobe-market-sdk');\n\n/**\n * LobeHub Market SDK Client\n */\nexport class MarketSDK {\n private baseUrl: string;\n private defaultLocale: string;\n private discoveryDoc?: DiscoveryDocument;\n private headers: Record<string, string>;\n\n /**\n * Create MarketSDK instance\n * @param options SDK configuration options\n */\n constructor(options: MarketSDKOptions = {}) {\n this.baseUrl = options.baseUrl || 'https://market.lobehub.com/api';\n this.defaultLocale = options.defaultLocale || 'zh-CN';\n this.headers = {\n 'Content-Type': 'application/json',\n ...(options.apiKey ? { Authorization: `Bearer ${options.apiKey}` } : {}),\n };\n log('MarketSDK instance created: %O', { baseUrl: this.baseUrl, defaultLocale: this.defaultLocale });\n }\n\n /**\n * Send request and handle response\n * @param url Request URL\n * @param options fetch options\n * @returns Response data\n */\n private async request<T>(url: string, options: RequestInit = {}): Promise<T> {\n log('Sending request: %s', `${this.baseUrl}${url}`);\n \n const response = await fetch(`${this.baseUrl}${url}`, {\n ...options,\n headers: {\n ...this.headers,\n ...options.headers,\n },\n });\n\n if (!response.ok) {\n const errorMsg = `Request failed: ${response.status} ${response.statusText}`;\n log('Request error: %s', errorMsg);\n throw new Error(errorMsg);\n }\n\n log('Request successful: %s', url);\n return response.json() as Promise<T>;\n }\n\n /**\n * Build query string\n * @param params Query parameters\n * @returns Query string\n */\n private buildQueryString(params: Record<string, any>): string {\n const query = Object.entries(params)\n .filter(([_, value]) => value !== undefined && value !== null)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)\n .join('&');\n \n return query ? `?${query}` : '';\n }\n\n /**\n * Get market service discovery document\n * @returns Service discovery document\n */\n async getDiscoveryDocument(): Promise<DiscoveryDocument> {\n log('Getting service discovery document');\n if (this.discoveryDoc) {\n log('Returning cached discovery document');\n return this.discoveryDoc;\n }\n\n this.discoveryDoc = await this.request<DiscoveryDocument>('/market/.well-known/discovery');\n log('Successfully retrieved service discovery document');\n return this.discoveryDoc;\n }\n\n /**\n * Get plugin list\n * @param params Query parameters\n * @returns Plugin list response\n */\n async getPluginList(params: {\n page?: number;\n pageSize?: number;\n category?: string;\n tags?: string;\n q?: string;\n sort?: 'installCount' | 'createdAt' | 'updatedAt' | 'ratingAverage';\n order?: 'asc' | 'desc';\n locale?: string;\n } = {}): Promise<PluginListResponse> {\n const locale = params.locale || this.defaultLocale;\n const queryParams = { ...params, locale };\n const queryString = this.buildQueryString(queryParams);\n\n log('Getting plugin list: %O', queryParams);\n\n const result = await this.request<PluginListResponse>(`/v1/plugins${queryString}`);\n log('Retrieved %d plugins', result.items.length);\n return result;\n }\n\n /**\n * Get plugin manifest\n * @param identifier Plugin identifier\n * @param locale Language\n * @param version Version\n * @returns Plugin manifest\n */\n async getPluginManifest(\n identifier: string,\n locale?: string,\n version?: string,\n ): Promise<PluginManifest> {\n log('Getting plugin manifest: %O', { identifier, version, locale });\n const localeParam = locale || this.defaultLocale;\n const params: Record<string, string> = { locale: localeParam };\n if (version) {\n params.version = version;\n }\n const queryString = this.buildQueryString(params);\n\n const manifest = await this.request<PluginManifest>(`/v1/plugins/${identifier}/manifest${queryString}`);\n log('Successfully retrieved plugin manifest: %s', identifier);\n return manifest;\n }\n\n /**\n * Import plugin manifests (requires admin privileges)\n * @param manifests Plugin manifest array\n * @param ownerId Owner ID\n * @returns Import result\n */\n async importManifests(manifests: PluginManifest[], ownerId?: number): Promise<{ success: number; failed: number }> {\n log(`Starting batch import of ${manifests.length} manifests`);\n if (ownerId) {\n log(`Using specified owner ID: ${ownerId}`);\n }\n\n const response = await this.request<{ data: { success: number; failed: number } }>('/v1/admin/plugins/import', {\n method: 'POST',\n body: JSON.stringify({\n manifests,\n ownerId,\n }),\n });\n\n log(`Batch import completed: ${response.data.success} successful, ${response.data.failed} failed`);\n return response.data;\n }\n\n /**\n * Set authentication token\n * @param token Authentication token\n */\n setAuthToken(token: string): void {\n log('Setting authentication token');\n this.headers.Authorization = `Bearer ${token}`;\n }\n\n /**\n * Clear authentication token\n */\n clearAuthToken(): void {\n log('Clearing authentication token');\n delete this.headers.Authorization;\n }\n} "],"mappings":";AAAA,SAAS,SAAS;AAGX,IAAM,iBAAiB,EAAE,KAAK,CAAC,QAAQ,UAAU,KAAK,CAAC;AAIvD,IAAM,qBAAqB,EAAE,KAAK,CAAC,QAAQ,OAAO,CAAC;AAInD,IAAM,yBAAyB,EAAE,KAAK;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;;;ACXD,OAAO,WAAW;AAGlB,IAAM,MAAM,MAAM,iBAAiB;AAK5B,IAAM,YAAN,MAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,EAUrB,YAAY,UAA4B,CAAC,GAAG;AAC1C,SAAK,UAAU,QAAQ,WAAW;AAClC,SAAK,gBAAgB,QAAQ,iBAAiB;AAC9C,SAAK,UAAU;AAAA,MACb,gBAAgB;AAAA,MAChB,GAAI,QAAQ,SAAS,EAAE,eAAe,UAAU,QAAQ,MAAM,GAAG,IAAI,CAAC;AAAA,IACxE;AACA,QAAI,kCAAkC,EAAE,SAAS,KAAK,SAAS,eAAe,KAAK,cAAc,CAAC;AAAA,EACpG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAc,QAAW,KAAa,UAAuB,CAAC,GAAe;AAC3E,QAAI,uBAAuB,GAAG,KAAK,OAAO,GAAG,GAAG,EAAE;AAElD,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,GAAG,GAAG,IAAI;AAAA,MACpD,GAAG;AAAA,MACH,SAAS;AAAA,QACP,GAAG,KAAK;AAA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AA;AAAA,EASA,MAAM,kBACJ,YACA,QACA,SACyB;AACzB,QAAI,+BAA+B,EAAE,YAAY,SAAS,OAAO,CAAC;AAClE,UAAM,cAAc,UAAU,KAAK;AACnC,UAAM,SAAiC,EAAE,QAAQ,YAAY;AAC7D,QAAI,SAAS;AACX,aAAO,UAAU;AAAA,IACnB;AACA,UAAM,cAAc,KAAK,iBAAiB,MAAM;AAEhD,UAAM,WAAW,MAAM,KAAK,QAAwB,eAAe,UAAU,YAAY,WAAW,EAAE;AACtG,QAAI,8CAA8C,UAAU;AAC5D,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,gBAAgB,WAA6B,SAAgE;AACjH,QAAI,4BAA4B,UAAU,MAAM,YAAY;AAC5D,QAAI,SAAS;AACX,UAAI,6BAA6B,OAAO,EAAE;AAAA,IAC5C;AAEA,UAAM,WAAW,MAAM,KAAK,QAAuD,4BAA4B;AAAA,MAC7G,QAAQ;AAAA,MACR,MAAM,KAAK,UAAU;AAAA,QACnB;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAED,QAAI,2BAA2B,SAAS,KAAK,OAAO,gBAAgB,SAAS,KAAK,MAAM,SAAS;AACjG,WAAO,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAa,OAAqB;AAChC,QAAI,8BAA8B;AAClC,SAAK,QAAQ,gBAAgB,UAAU,KAAK;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAuB;AACrB,QAAI,+BAA+B;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/market-sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "LobeHub Market JavaScript SDK",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -30,7 +30,11 @@
30
30
  "prepublishOnly": "npm run build",
31
31
  "release": "npm publish"
32
32
  },
33
+ "dependencies": {
34
+ "debug": "^4.4.1"
35
+ },
33
36
  "devDependencies": {
37
+ "@types/debug": "^4.1.12",
34
38
  "tsup": "^8.4.0",
35
39
  "typescript": "^5.8.3",
36
40
  "zod": "^3.24.4"