@peer-agent/protocol 0.0.2-beta.3 → 0.0.2-beta.4
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.ts +4 -1
- package/dist/index.js +1 -0
- package/dist/skill-marketplace.d.ts +126 -0
- package/dist/skill-marketplace.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -80,12 +80,14 @@ export interface AvailableSkillSummary {
|
|
|
80
80
|
readonly sourceDir: string;
|
|
81
81
|
readonly linked: boolean;
|
|
82
82
|
}
|
|
83
|
-
/** linkSkill / unlinkSkill 的返回结果。 */
|
|
83
|
+
/** linkSkill / unlinkSkill / uninstallSkill 的返回结果。 */
|
|
84
84
|
export interface SkillLinkResult {
|
|
85
85
|
readonly ok: boolean;
|
|
86
86
|
readonly error?: string;
|
|
87
87
|
readonly detail?: string;
|
|
88
88
|
readonly alreadyLinked?: boolean;
|
|
89
|
+
/** uninstallSkill 成功时:deleted=删除用户安装目录;unlinked=仅取消借用软链。 */
|
|
90
|
+
readonly mode?: 'deleted' | 'unlinked';
|
|
89
91
|
}
|
|
90
92
|
export interface RuntimeProjection {
|
|
91
93
|
readonly projectionId: string;
|
|
@@ -790,3 +792,4 @@ export * from './goal.ts';
|
|
|
790
792
|
export * from './updater.ts';
|
|
791
793
|
export * from './appshot.ts';
|
|
792
794
|
export * from './automation.ts';
|
|
795
|
+
export * from './skill-marketplace.ts';
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { DataLevel } from './index.ts';
|
|
2
|
+
export type SkillMarketplaceReviewStatus = 'approved' | 'pending' | 'rejected';
|
|
3
|
+
export type SkillMarketplaceSourceKind = 'local-directory' | 'github-directory';
|
|
4
|
+
export interface SkillMarketplaceSourceRef {
|
|
5
|
+
readonly sourceId: string;
|
|
6
|
+
readonly kind: SkillMarketplaceSourceKind;
|
|
7
|
+
readonly repository?: string;
|
|
8
|
+
readonly revision?: string;
|
|
9
|
+
readonly path: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SkillMarketplaceArtifact {
|
|
12
|
+
readonly downloadUrl: string;
|
|
13
|
+
readonly sha256: string;
|
|
14
|
+
readonly size: number;
|
|
15
|
+
readonly format: 'zip';
|
|
16
|
+
}
|
|
17
|
+
export interface SkillMarketplaceEntry {
|
|
18
|
+
readonly catalogId: string;
|
|
19
|
+
readonly skillId: string;
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly description: string;
|
|
22
|
+
readonly whenToUse: string;
|
|
23
|
+
readonly version: string;
|
|
24
|
+
readonly category: string;
|
|
25
|
+
readonly tags: readonly string[];
|
|
26
|
+
readonly dataLevel: DataLevel;
|
|
27
|
+
readonly reviewStatus: SkillMarketplaceReviewStatus;
|
|
28
|
+
readonly reviewedAt?: string;
|
|
29
|
+
readonly source: SkillMarketplaceSourceRef;
|
|
30
|
+
readonly artifact: SkillMarketplaceArtifact;
|
|
31
|
+
}
|
|
32
|
+
export interface SkillMarketplaceCatalog {
|
|
33
|
+
readonly schemaVersion: 1;
|
|
34
|
+
readonly catalogId: 'peer-agent';
|
|
35
|
+
readonly generatedAt: string;
|
|
36
|
+
readonly entries: readonly SkillMarketplaceEntry[];
|
|
37
|
+
}
|
|
38
|
+
export interface SkillMarketplaceInstallResult {
|
|
39
|
+
readonly ok: boolean;
|
|
40
|
+
readonly skillId?: string;
|
|
41
|
+
readonly error?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 市场横向筛选 / 排序语义:
|
|
45
|
+
* - score: 全部 / 综合评分
|
|
46
|
+
* - featured: 推荐精选(认证优先,再按评分)
|
|
47
|
+
* - rising: 近期飙升(近期更新 + 下载量,本地近似)
|
|
48
|
+
* - downloads: 下载量
|
|
49
|
+
* - stars: 收藏量
|
|
50
|
+
* - created: 最近上新
|
|
51
|
+
* - updated: 最近更新
|
|
52
|
+
*/
|
|
53
|
+
export type SkillHubMarketplaceSort = 'score' | 'featured' | 'rising' | 'downloads' | 'stars' | 'created' | 'updated';
|
|
54
|
+
export interface SkillHubMarketplaceEntry {
|
|
55
|
+
readonly catalogId: string;
|
|
56
|
+
readonly namespace: string;
|
|
57
|
+
readonly canonicalName: string;
|
|
58
|
+
readonly slug: string;
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly description: string;
|
|
61
|
+
readonly descriptionOriginal: string;
|
|
62
|
+
readonly version: string;
|
|
63
|
+
readonly category: string;
|
|
64
|
+
readonly subCategories: readonly {
|
|
65
|
+
readonly key: string;
|
|
66
|
+
readonly name: string;
|
|
67
|
+
}[];
|
|
68
|
+
readonly labels: Readonly<Record<string, unknown>>;
|
|
69
|
+
readonly source: string;
|
|
70
|
+
readonly sourceUrl: string | null;
|
|
71
|
+
readonly iconUrl: string | null;
|
|
72
|
+
readonly ownerName: string;
|
|
73
|
+
readonly score: number;
|
|
74
|
+
readonly downloads: number;
|
|
75
|
+
readonly installs: number;
|
|
76
|
+
readonly stars: number;
|
|
77
|
+
readonly verified: boolean;
|
|
78
|
+
readonly createdAt: number;
|
|
79
|
+
readonly updatedAt: number;
|
|
80
|
+
}
|
|
81
|
+
export interface SkillHubSyncStatus {
|
|
82
|
+
readonly status: 'idle' | 'syncing' | 'error';
|
|
83
|
+
readonly nextPage: number;
|
|
84
|
+
readonly total: number;
|
|
85
|
+
readonly indexed: number;
|
|
86
|
+
readonly updatedAt: number | null;
|
|
87
|
+
readonly error: string | null;
|
|
88
|
+
readonly skipped: number;
|
|
89
|
+
readonly skippedReasons: Readonly<Record<string, number>>;
|
|
90
|
+
}
|
|
91
|
+
export interface SkillHubMarketplaceQuery {
|
|
92
|
+
readonly page?: number;
|
|
93
|
+
readonly pageSize?: number;
|
|
94
|
+
readonly keyword?: string;
|
|
95
|
+
readonly category?: string;
|
|
96
|
+
readonly sortBy?: SkillHubMarketplaceSort;
|
|
97
|
+
}
|
|
98
|
+
export interface SkillHubMarketplacePage {
|
|
99
|
+
readonly page: number;
|
|
100
|
+
readonly pageSize: number;
|
|
101
|
+
readonly total: number;
|
|
102
|
+
readonly items: readonly SkillHubMarketplaceEntry[];
|
|
103
|
+
readonly sync: SkillHubSyncStatus;
|
|
104
|
+
}
|
|
105
|
+
/** SkillHub 安装作用域:全局用户目录或当前工作区 skills/。 */
|
|
106
|
+
export type SkillHubInstallScope = 'global' | 'workspace';
|
|
107
|
+
export interface SkillHubInstallRequest {
|
|
108
|
+
readonly namespace: string;
|
|
109
|
+
readonly slug: string;
|
|
110
|
+
readonly version: string;
|
|
111
|
+
/** 默认 global;workspace 需已打开工作区。 */
|
|
112
|
+
readonly scope?: SkillHubInstallScope;
|
|
113
|
+
}
|
|
114
|
+
export interface SkillHubCategory {
|
|
115
|
+
readonly key: string;
|
|
116
|
+
readonly name: string;
|
|
117
|
+
readonly nameEn: string;
|
|
118
|
+
readonly sortOrder: number;
|
|
119
|
+
readonly active: boolean;
|
|
120
|
+
readonly level: number;
|
|
121
|
+
readonly version: number;
|
|
122
|
+
}
|
|
123
|
+
export interface SkillHubCategoriesResult {
|
|
124
|
+
readonly count: number;
|
|
125
|
+
readonly items: readonly SkillHubCategory[];
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|