@lobehub/market-sdk 0.26.1 → 0.27.1
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 +41 -3
- package/dist/index.mjs +47 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AgentItem, MarketItemBase, PluginConnectionType, InstallFailureAnalysisQuery, InstallFailureAnalysis, RangeQuery, RangeStats, TopPluginsQuery, TopPlugin, PluginManifest, AdminPluginItem, AdminPluginItemDetail, PluginVersion, PluginVersionLocalization, AdminDeploymentOption, InstallationDetails, SystemDependency, IncompleteI18nPlugin, CategoryListQuery, CategoryItem, PluginItemDetail, InstallReportRequest, InstallReportResponse, CallReportRequest, CallReportResponse, CloudGatewayRequest, CloudGatewayResponse } from '@lobehub/market-types';
|
|
2
|
+
import { AgentItem, MarketItemBase, PluginConnectionType, InstallFailureAnalysisQuery, InstallFailureAnalysis, RangeQuery, RangeStats, TopPluginsQuery, TopPlugin, PluginManifest, AdminPluginItem, AdminPluginItemDetail, PluginVersion, PluginVersionLocalization, AdminDeploymentOption, InstallationDetails, SystemDependency, IncompleteI18nPlugin, AgentEventRequest, CategoryListQuery, CategoryItem, PluginItemDetail, InstallReportRequest, InstallReportResponse, CallReportRequest, CallReportResponse, PluginEventRequest, CloudGatewayRequest, CloudGatewayResponse } from '@lobehub/market-types';
|
|
3
3
|
export * from '@lobehub/market-types';
|
|
4
4
|
export { CategoryItem, CategoryListQuery, CategoryListResponse } from '@lobehub/market-types';
|
|
5
5
|
|
|
@@ -288,16 +288,24 @@ interface AgentDetailQuery {
|
|
|
288
288
|
interface AgentItemDetail extends AgentItem {
|
|
289
289
|
/** A2A protocol version */
|
|
290
290
|
a2aProtocolVersion?: string;
|
|
291
|
-
/** Author
|
|
291
|
+
/** Author or organization name */
|
|
292
292
|
author?: string;
|
|
293
293
|
/** Avatar URL for the agent, can be a emoji */
|
|
294
294
|
avatar: string;
|
|
295
|
+
/** Category name used for classification */
|
|
296
|
+
category?: string;
|
|
295
297
|
/** Total comment count */
|
|
296
298
|
commentCount?: number;
|
|
299
|
+
/** Optional: Compatibility information for different platforms or versions */
|
|
300
|
+
compatibility?: Record<string, any>;
|
|
297
301
|
/** Agent configuration JSON */
|
|
298
302
|
config: any;
|
|
303
|
+
/** Resource creation date in the marketplace (ISO 8601 format) */
|
|
304
|
+
createdAt: string;
|
|
299
305
|
/** Current version id */
|
|
300
306
|
currentVersionId?: number;
|
|
307
|
+
/** Localized short description displayed in the marketplace listing */
|
|
308
|
+
description: string;
|
|
301
309
|
/** URL to human-readable documentation */
|
|
302
310
|
documentationUrl?: string;
|
|
303
311
|
/** Editor data for saving prompt content in editor mode */
|
|
@@ -312,8 +320,14 @@ interface AgentItemDetail extends AgentItem {
|
|
|
312
320
|
hasStateTransitionHistory?: boolean;
|
|
313
321
|
/** Whether streaming is supported */
|
|
314
322
|
hasStreaming?: boolean;
|
|
323
|
+
/** URL to the resource's homepage or documentation */
|
|
324
|
+
homepage?: string;
|
|
325
|
+
/** Icon URL or Emoji character */
|
|
326
|
+
icon?: string;
|
|
315
327
|
/** Agent database id */
|
|
316
328
|
id?: number;
|
|
329
|
+
/** Globally unique identifier, typically contains author/namespace and name */
|
|
330
|
+
identifier: string;
|
|
317
331
|
/** Total install count */
|
|
318
332
|
installCount?: number;
|
|
319
333
|
/** Additional interfaces supported */
|
|
@@ -324,6 +338,10 @@ interface AgentItemDetail extends AgentItem {
|
|
|
324
338
|
isOfficial?: boolean;
|
|
325
339
|
/** Locale */
|
|
326
340
|
locale?: string;
|
|
341
|
+
/** URL pointing to the detailed manifest file for this resource */
|
|
342
|
+
manifestUrl: string;
|
|
343
|
+
/** Localized display name shown in the marketplace listing */
|
|
344
|
+
name: string;
|
|
327
345
|
/** Owner ID */
|
|
328
346
|
ownerId?: number;
|
|
329
347
|
/** The transport of the preferred endpoint */
|
|
@@ -344,10 +362,12 @@ interface AgentItemDetail extends AgentItem {
|
|
|
344
362
|
summary?: string;
|
|
345
363
|
/** Whether the agent supports authenticated extended card */
|
|
346
364
|
supportsAuthenticatedExtendedCard?: boolean;
|
|
347
|
-
/**
|
|
365
|
+
/** List of localized tags for filtering and categorization */
|
|
348
366
|
tags?: string[];
|
|
349
367
|
/** Token usage */
|
|
350
368
|
tokenUsage?: number;
|
|
369
|
+
/** Resource's last update date in the marketplace (ISO 8601 format) */
|
|
370
|
+
updatedAt: string;
|
|
351
371
|
/** Agent or A2A implementation version string */
|
|
352
372
|
version: string;
|
|
353
373
|
/** Version display name */
|
|
@@ -2976,6 +2996,15 @@ declare class AgentService extends BaseSDK {
|
|
|
2976
2996
|
* @returns Promise resolving to true if agent exists, false otherwise
|
|
2977
2997
|
*/
|
|
2978
2998
|
checkAgentExists(identifier: string, options?: globalThis.RequestInit): Promise<boolean>;
|
|
2999
|
+
/**
|
|
3000
|
+
* Record an agent event for the authenticated user
|
|
3001
|
+
*
|
|
3002
|
+
* Records agent usage actions (add, chat, click) for analytics.
|
|
3003
|
+
*
|
|
3004
|
+
* @param eventData - The agent event payload
|
|
3005
|
+
* @param options - Optional request init overrides
|
|
3006
|
+
*/
|
|
3007
|
+
createEvent(eventData: AgentEventRequest, options?: globalThis.RequestInit): Promise<void>;
|
|
2979
3008
|
/**
|
|
2980
3009
|
* Increases the install count for an agent
|
|
2981
3010
|
*
|
|
@@ -3296,6 +3325,15 @@ declare class PluginsService extends BaseSDK {
|
|
|
3296
3325
|
* @returns Promise resolving to the report submission response
|
|
3297
3326
|
*/
|
|
3298
3327
|
reportCall(reportData: CallReportRequest): Promise<CallReportResponse>;
|
|
3328
|
+
/**
|
|
3329
|
+
* Record a plugin event for the authenticated user
|
|
3330
|
+
*
|
|
3331
|
+
* Records plugin usage actions (install, activate, uninstall, click) for analytics.
|
|
3332
|
+
*
|
|
3333
|
+
* @param eventData - The plugin event payload
|
|
3334
|
+
* @param options - Optional request init overrides
|
|
3335
|
+
*/
|
|
3336
|
+
createEvent(eventData: PluginEventRequest, options?: globalThis.RequestInit): Promise<void>;
|
|
3299
3337
|
/**
|
|
3300
3338
|
* Call a cloud-hosted plugin tool via the cloud gateway
|
|
3301
3339
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -88,6 +88,9 @@ var BaseSDK = class {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
log("Request successful: %s", url);
|
|
91
|
+
if (response.status === 204) {
|
|
92
|
+
return void 0;
|
|
93
|
+
}
|
|
91
94
|
return response.json();
|
|
92
95
|
}
|
|
93
96
|
/**
|
|
@@ -1790,6 +1793,25 @@ var AgentService2 = class extends BaseSDK {
|
|
|
1790
1793
|
return false;
|
|
1791
1794
|
}
|
|
1792
1795
|
}
|
|
1796
|
+
/**
|
|
1797
|
+
* Record an agent event for the authenticated user
|
|
1798
|
+
*
|
|
1799
|
+
* Records agent usage actions (add, chat, click) for analytics.
|
|
1800
|
+
*
|
|
1801
|
+
* @param eventData - The agent event payload
|
|
1802
|
+
* @param options - Optional request init overrides
|
|
1803
|
+
*/
|
|
1804
|
+
async createEvent(eventData, options) {
|
|
1805
|
+
log10("Recording agent event: %s for %s", eventData.event, eventData.identifier);
|
|
1806
|
+
await this.request("/v1/agents/events", {
|
|
1807
|
+
body: JSON.stringify(eventData),
|
|
1808
|
+
headers: {
|
|
1809
|
+
"Content-Type": "application/json"
|
|
1810
|
+
},
|
|
1811
|
+
method: "POST",
|
|
1812
|
+
...options
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1793
1815
|
/**
|
|
1794
1816
|
* Increases the install count for an agent
|
|
1795
1817
|
*
|
|
@@ -2409,6 +2431,25 @@ var PluginsService = class extends BaseSDK {
|
|
|
2409
2431
|
log14("Call report submitted successfully: %O", result);
|
|
2410
2432
|
return result;
|
|
2411
2433
|
}
|
|
2434
|
+
/**
|
|
2435
|
+
* Record a plugin event for the authenticated user
|
|
2436
|
+
*
|
|
2437
|
+
* Records plugin usage actions (install, activate, uninstall, click) for analytics.
|
|
2438
|
+
*
|
|
2439
|
+
* @param eventData - The plugin event payload
|
|
2440
|
+
* @param options - Optional request init overrides
|
|
2441
|
+
*/
|
|
2442
|
+
async createEvent(eventData, options) {
|
|
2443
|
+
log14("Recording plugin event: %s for %s", eventData.event, eventData.identifier);
|
|
2444
|
+
await this.request("/v1/plugins/events", {
|
|
2445
|
+
body: JSON.stringify(eventData),
|
|
2446
|
+
headers: {
|
|
2447
|
+
"Content-Type": "application/json"
|
|
2448
|
+
},
|
|
2449
|
+
method: "POST",
|
|
2450
|
+
...options
|
|
2451
|
+
});
|
|
2452
|
+
}
|
|
2412
2453
|
/**
|
|
2413
2454
|
* Call a cloud-hosted plugin tool via the cloud gateway
|
|
2414
2455
|
*
|
|
@@ -2479,7 +2520,12 @@ var PluginsService = class extends BaseSDK {
|
|
|
2479
2520
|
* ```
|
|
2480
2521
|
*/
|
|
2481
2522
|
async runBuildInTool(toolName, params, context, options) {
|
|
2482
|
-
log14(
|
|
2523
|
+
log14(
|
|
2524
|
+
"Running built-in tool: %s for user %s, topic %s",
|
|
2525
|
+
toolName,
|
|
2526
|
+
context.userId,
|
|
2527
|
+
context.topicId
|
|
2528
|
+
);
|
|
2483
2529
|
const result = await this.request("/v1/plugins/run-buildin-tools", {
|
|
2484
2530
|
body: JSON.stringify({
|
|
2485
2531
|
params,
|