@peer-agent/protocol 0.0.2-beta.2 → 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.
@@ -41,6 +41,8 @@ export interface AutomationNotificationPolicy {
41
41
  readonly needsAttention: 'system_and_badge' | 'badge_only';
42
42
  readonly failed: boolean;
43
43
  readonly succeeded: boolean;
44
+ /** When enabled, successful runs notify only if their result differs from the previous completed run. */
45
+ readonly succeededOnlyOnChange?: boolean;
44
46
  }
45
47
  export interface AutomationBudget {
46
48
  readonly timeoutMs: number;
@@ -105,6 +107,10 @@ export interface AutomationRunChangeSet {
105
107
  export interface AutomationRunReceipt {
106
108
  readonly summary?: string;
107
109
  readonly error?: string;
110
+ /** Bounded snapshot of the previous completed result; never used as executable prompt context. */
111
+ readonly previousSummary?: string;
112
+ readonly resultChanged?: boolean;
113
+ readonly comparisonSummary?: string;
108
114
  readonly evidence: readonly Evidence[];
109
115
  readonly evidenceRefs: readonly string[];
110
116
  readonly verifications: readonly AutomationRunVerification[];
@@ -248,6 +254,8 @@ export interface AutomationCreateContext {
248
254
  readonly source: AutomationCreateContextSource;
249
255
  readonly status: AutomationCreateContextStatus;
250
256
  readonly activeProposal?: AutomationChatProposal | null;
257
+ /** Most recent terminal proposal retained for durable idempotent action replay. */
258
+ readonly lastSettledProposal?: AutomationChatProposal | null;
251
259
  readonly rejectedFingerprints: readonly string[];
252
260
  readonly createdAt: string;
253
261
  readonly updatedAt: string;
@@ -277,3 +285,19 @@ export interface AutomationProposalActionResult {
277
285
  readonly receipt?: AutomationCreationReceipt | null;
278
286
  readonly replayed: boolean;
279
287
  }
288
+ /**
289
+ * Durable conversation origin for automation Fresh Runs.
290
+ * Distinct from AutomationCreateContext (chat → create automation draft).
291
+ * UI badges and audit links must read this field, not title prefixes.
292
+ */
293
+ export type ConversationAutomationOriginKind = 'automation_run';
294
+ export interface ConversationAutomationOrigin {
295
+ readonly kind: ConversationAutomationOriginKind;
296
+ readonly automationId: string;
297
+ readonly runId: string;
298
+ readonly automationName: string;
299
+ readonly triggerSource: AutomationTriggerSource;
300
+ /** User-facing workspace that owns the Automation; execution may use a worktree. */
301
+ readonly originWorkspacePath?: string;
302
+ readonly createdAt: string;
303
+ }
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
@@ -23,3 +23,4 @@ export * from "./goal.js";
23
23
  export * from "./updater.js";
24
24
  export * from "./appshot.js";
25
25
  export * from "./automation.js";
26
+ export * from "./skill-marketplace.js";
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peer-agent/protocol",
3
- "version": "0.0.2-beta.2",
3
+ "version": "0.0.2-beta.4",
4
4
  "description": "Shared host-neutral protocol contracts for Peer Agent runtimes and clients.",
5
5
  "type": "module",
6
6
  "license": "MIT",