@peer-agent/protocol 0.0.4-beta.4 → 0.0.5-beta.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.
@@ -17,7 +17,7 @@ export interface AttachmentContextItem {
17
17
  readonly contentIncluded: boolean;
18
18
  readonly transport: AttachmentContextTransport;
19
19
  }
20
- export type ContextAttachmentSourceKind = 'user_upload' | 'clipboard' | 'skill' | 'memory' | 'hook' | 'mcp' | 'runtime' | string;
20
+ export type ContextAttachmentSourceKind = 'user_upload' | 'clipboard' | 'skill' | 'memory' | 'hook' | 'mcp' | 'runtime' | 'session_reference' | 'workspace_file' | 'workspace_dir' | 'git_diff' | string;
21
21
  export type ContextAttachmentScope = 'turn' | 'conversation' | 'workspace' | 'session' | string;
22
22
  export type ContextAttachmentLifecycle = 'ephemeral' | 'durable_ref' | 'evidence_ref' | string;
23
23
  export interface ContextAttachmentItem extends AttachmentContextItem {
@@ -59,12 +59,42 @@ export type TaskNextAction = 'approve_plan' | 'confirm_scope' | 'grant_permissio
59
59
  * status 与 GoalTask.status / ExecutionStatus 字面量对齐。
60
60
  */
61
61
  export type TaskOverviewPlanStepStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'waiting_user';
62
+ export type TaskOverviewArtifactKind = 'code' | 'file' | 'image';
63
+ export interface TaskOverviewCodePreview {
64
+ readonly kind: 'code';
65
+ readonly additions: number;
66
+ readonly deletions: number;
67
+ readonly diffLines: readonly string[];
68
+ }
69
+ export interface TaskOverviewImagePreview {
70
+ readonly kind: 'image';
71
+ readonly dataUrl: string;
72
+ readonly width: number;
73
+ readonly height: number;
74
+ }
75
+ export type TaskOverviewArtifactPreview = TaskOverviewCodePreview | TaskOverviewImagePreview;
76
+ /** 由 GoalTask.evidenceRefs / EvidenceIndex 派生的用户可浏览产物。 */
77
+ export interface TaskOverviewArtifact {
78
+ /** 原始 Artifact 引用;仅用于追溯与列表 key,不直接展示给用户。 */
79
+ readonly ref: string;
80
+ readonly kind: TaskOverviewArtifactKind;
81
+ /** 用户可理解的产物名称,不得包含内部 UUID 或协议引用。 */
82
+ readonly label: string;
83
+ /** 与产物类型匹配的动作文案,例如“预览截图”“查看结果”。 */
84
+ readonly actionLabel: string;
85
+ /** Provider 产生、main 规范化后的有界 hover 内容。 */
86
+ readonly preview?: TaskOverviewArtifactPreview;
87
+ /** main 进程确认可安全打开后才提供。 */
88
+ readonly openPath?: string;
89
+ }
62
90
  export interface TaskOverviewPlanStep {
63
91
  readonly taskId: string;
64
92
  readonly title: string;
65
93
  readonly status: TaskOverviewPlanStepStatus;
66
94
  /** 当前 Runner 正在推进的步骤。 */
67
95
  readonly current?: boolean;
96
+ /** 仅属于该叶子任务的 Evidence 派生产物。 */
97
+ readonly artifacts?: readonly TaskOverviewArtifact[];
68
98
  }
69
99
  export interface TaskOverviewItem {
70
100
  /** 稳定投影身份(conversationId、planId 或 automationId+runId)。 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peer-agent/protocol",
3
- "version": "0.0.4-beta.4",
3
+ "version": "0.0.5-beta.1",
4
4
  "description": "Shared host-neutral protocol contracts for Peer Agent runtimes and clients.",
5
5
  "type": "module",
6
6
  "license": "MIT",