@peer-agent/protocol 0.1.0-rc.47 → 0.1.0-rc.48
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/document-reference.d.ts +29 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/project-matter.d.ts +223 -0
- package/dist/project-matter.js +1 -0
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ export interface LocalDocumentObservation extends LocalDocumentIdentity {
|
|
|
43
43
|
export interface LocalDocumentReadResult {
|
|
44
44
|
readonly metadataOnly?: boolean;
|
|
45
45
|
readonly ok: boolean;
|
|
46
|
-
readonly status: 'ok' | 'not_found' | 'not_file' | 'too_large' | 'binary' | 'invalid_path' | 'error' | 'permission_denied' | 'scope_denied' | 'ambiguous_path' | 'workspace_unavailable' | 'relative_base_required' | 'version_changed' | 'source_changed' | 'version_unavailable' | 'not_git_repo' | 'invalid_ref' | 'revision_unavailable' | 'unsupported_entry';
|
|
46
|
+
readonly status: 'ok' | 'not_found' | 'not_file' | 'too_large' | 'binary' | 'invalid_path' | 'error' | 'permission_denied' | 'sensitive_path' | 'scope_denied' | 'ambiguous_path' | 'workspace_unavailable' | 'relative_base_required' | 'version_changed' | 'source_changed' | 'version_unavailable' | 'not_git_repo' | 'invalid_ref' | 'revision_unavailable' | 'unsupported_entry';
|
|
47
47
|
readonly content: string;
|
|
48
48
|
readonly size?: number;
|
|
49
49
|
readonly resolvedFrom?: string;
|
|
@@ -81,3 +81,31 @@ export interface BotResourceSearchResult {
|
|
|
81
81
|
readonly visited?: number;
|
|
82
82
|
readonly error?: string;
|
|
83
83
|
}
|
|
84
|
+
/** Renderer click context is a lookup hint. The Desktop host owns the authorization. */
|
|
85
|
+
export interface DocumentPreviewRequest {
|
|
86
|
+
readonly reference: BotDocumentReference;
|
|
87
|
+
readonly conversationId: string;
|
|
88
|
+
readonly messageId?: string;
|
|
89
|
+
readonly evidenceRef?: string;
|
|
90
|
+
readonly challenge?: string;
|
|
91
|
+
}
|
|
92
|
+
export type DocumentPreviewAccessResult = {
|
|
93
|
+
readonly ok: true;
|
|
94
|
+
readonly status: 'scoped';
|
|
95
|
+
} | {
|
|
96
|
+
readonly ok: true;
|
|
97
|
+
readonly status: 'allowed';
|
|
98
|
+
readonly token: string;
|
|
99
|
+
readonly path: string;
|
|
100
|
+
readonly source: 'external' | 'conversation' | 'worktree';
|
|
101
|
+
} | {
|
|
102
|
+
readonly ok: false;
|
|
103
|
+
readonly status: 'scope_denied';
|
|
104
|
+
readonly canRequestSingleFilePreview: true;
|
|
105
|
+
readonly path: string;
|
|
106
|
+
readonly challenge: string;
|
|
107
|
+
} | {
|
|
108
|
+
readonly ok: false;
|
|
109
|
+
readonly status: LocalDocumentReadResult['status'];
|
|
110
|
+
readonly canRequestSingleFilePreview?: never;
|
|
111
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -944,3 +944,4 @@ export type { ConversationExecutionIdentity, ConversationExecution } from './con
|
|
|
944
944
|
export * from './quiet-reply.js';
|
|
945
945
|
export type { WorkingPlanStepStatus, WorkingPlanStepView, WorkingPlanView } from './working-plan.ts';
|
|
946
946
|
export * from "./parent-coordination.js";
|
|
947
|
+
export * from "./project-matter.ts";
|
package/dist/index.js
CHANGED
|
@@ -74,3 +74,4 @@ export * from "./interactive-verification.js";
|
|
|
74
74
|
export { normalizeConversationExecution, conversationExecutionPermitsNewRun, validConversationSpend } from "./conversation-execution.js";
|
|
75
75
|
export * from './quiet-reply.js';
|
|
76
76
|
export * from "./parent-coordination.js";
|
|
77
|
+
export * from "./project-matter.js";
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/** Rust Core project.matter.* v1, used by the trusted Desktop bridge. */
|
|
2
|
+
export type MatterStatus = 'pending' | 'in_progress' | 'waiting' | 'delivered' | 'cancelled';
|
|
3
|
+
export type MatterGroup = 'needsYou' | 'active' | 'delivered' | 'cancelled';
|
|
4
|
+
export type MatterCriterion = {
|
|
5
|
+
id: string;
|
|
6
|
+
text: string;
|
|
7
|
+
status?: 'open' | 'met' | 'waived';
|
|
8
|
+
waiverReceiptRef?: string;
|
|
9
|
+
};
|
|
10
|
+
export type MatterBrief = {
|
|
11
|
+
title: string;
|
|
12
|
+
goal: string;
|
|
13
|
+
constraints?: readonly string[];
|
|
14
|
+
doneMeans: string | readonly MatterCriterion[];
|
|
15
|
+
};
|
|
16
|
+
export type MatterSource = {
|
|
17
|
+
kind: string;
|
|
18
|
+
ref?: string;
|
|
19
|
+
};
|
|
20
|
+
export type MatterSummary = {
|
|
21
|
+
matterId: string;
|
|
22
|
+
number: number;
|
|
23
|
+
title: string;
|
|
24
|
+
status: MatterStatus;
|
|
25
|
+
needsYou: boolean;
|
|
26
|
+
revision: number;
|
|
27
|
+
briefRevision: number;
|
|
28
|
+
waitReason: string | null;
|
|
29
|
+
cancelReason: string | null;
|
|
30
|
+
cancelSettling: boolean;
|
|
31
|
+
lastEffectiveChangeAt: string;
|
|
32
|
+
};
|
|
33
|
+
export type MatterDecisionDraft = {
|
|
34
|
+
context: string;
|
|
35
|
+
question: string;
|
|
36
|
+
options: readonly {
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
recommended?: boolean;
|
|
40
|
+
}[];
|
|
41
|
+
approveDoneMeans?: MatterBrief['doneMeans'];
|
|
42
|
+
};
|
|
43
|
+
export type MatterDecision = MatterDecisionDraft & {
|
|
44
|
+
requestId: string;
|
|
45
|
+
};
|
|
46
|
+
export type MatterGit = {
|
|
47
|
+
repo: string | null;
|
|
48
|
+
baseBranch: string | null;
|
|
49
|
+
baseSha: string | null;
|
|
50
|
+
taskBranch: string | null;
|
|
51
|
+
isolation: string | null;
|
|
52
|
+
};
|
|
53
|
+
export type MatterArtifact = {
|
|
54
|
+
kind?: string;
|
|
55
|
+
ref?: string;
|
|
56
|
+
path?: string;
|
|
57
|
+
title?: string;
|
|
58
|
+
label?: string;
|
|
59
|
+
};
|
|
60
|
+
export type MatterDelivery = {
|
|
61
|
+
summary: string;
|
|
62
|
+
deliveredAt: string;
|
|
63
|
+
git?: MatterGit | null;
|
|
64
|
+
evidenceRefs?: readonly string[];
|
|
65
|
+
artifacts?: readonly MatterArtifact[];
|
|
66
|
+
};
|
|
67
|
+
export type Matter = MatterBrief & Omit<MatterSummary, 'waitReason'> & {
|
|
68
|
+
origin: MatterSource;
|
|
69
|
+
waiting?: {
|
|
70
|
+
reason: string;
|
|
71
|
+
source: MatterSource;
|
|
72
|
+
} | null;
|
|
73
|
+
needsYouDecision?: MatterDecision | null;
|
|
74
|
+
delivery?: MatterDelivery | null;
|
|
75
|
+
deliveryHistory: readonly MatterDelivery[];
|
|
76
|
+
historyWithheld?: boolean;
|
|
77
|
+
};
|
|
78
|
+
export type MatterRun = {
|
|
79
|
+
sessionId: string;
|
|
80
|
+
followUpEpoch: number;
|
|
81
|
+
role: string;
|
|
82
|
+
state: string;
|
|
83
|
+
hostStatus?: string;
|
|
84
|
+
executionMode?: string;
|
|
85
|
+
git?: MatterGit | null;
|
|
86
|
+
briefRevision?: number | null;
|
|
87
|
+
};
|
|
88
|
+
export type MatterActivity = {
|
|
89
|
+
activityId: string;
|
|
90
|
+
seq: number;
|
|
91
|
+
kind: string;
|
|
92
|
+
actorKind: string;
|
|
93
|
+
body: string;
|
|
94
|
+
payload: Record<string, unknown>;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
};
|
|
97
|
+
export type MatterChanged = {
|
|
98
|
+
workspaceId: string;
|
|
99
|
+
matterId: string;
|
|
100
|
+
revision: number;
|
|
101
|
+
};
|
|
102
|
+
export type MatterListPage = {
|
|
103
|
+
limit?: number;
|
|
104
|
+
deliveredLimit?: number;
|
|
105
|
+
} & Partial<Record<`${MatterGroup}Cursor`, string>>;
|
|
106
|
+
export type MatterDetailPage = {
|
|
107
|
+
afterSeq?: number;
|
|
108
|
+
activityLimit?: number;
|
|
109
|
+
runOffset?: number;
|
|
110
|
+
runLimit?: number;
|
|
111
|
+
};
|
|
112
|
+
type Scope = {
|
|
113
|
+
workspaceId: string;
|
|
114
|
+
version?: 1;
|
|
115
|
+
};
|
|
116
|
+
type Write = Scope & {
|
|
117
|
+
operationId: string;
|
|
118
|
+
};
|
|
119
|
+
type Target = {
|
|
120
|
+
matterId: string;
|
|
121
|
+
};
|
|
122
|
+
type CAS = {
|
|
123
|
+
revision: number;
|
|
124
|
+
briefRevision?: number;
|
|
125
|
+
};
|
|
126
|
+
type Answer = {
|
|
127
|
+
requestId: string;
|
|
128
|
+
} & ({
|
|
129
|
+
optionId: string;
|
|
130
|
+
text?: never;
|
|
131
|
+
} | {
|
|
132
|
+
text: string;
|
|
133
|
+
optionId?: never;
|
|
134
|
+
});
|
|
135
|
+
type Patch = {
|
|
136
|
+
brief?: MatterBrief;
|
|
137
|
+
status?: MatterStatus;
|
|
138
|
+
waiting?: {
|
|
139
|
+
reason: string;
|
|
140
|
+
source: MatterSource & {
|
|
141
|
+
ref: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
decision?: MatterDecisionDraft;
|
|
145
|
+
userReceiptRef?: string;
|
|
146
|
+
delivery?: {
|
|
147
|
+
summary: string;
|
|
148
|
+
sessionId?: string;
|
|
149
|
+
followUpEpoch?: number;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
export type MatterList = Record<MatterGroup, readonly MatterSummary[]> & Record<`${MatterGroup}Cursor`, string | null> & {
|
|
153
|
+
activeCount: number;
|
|
154
|
+
cancelledCount: number;
|
|
155
|
+
};
|
|
156
|
+
export type MatterDetail = {
|
|
157
|
+
matter: Matter;
|
|
158
|
+
activities: readonly MatterActivity[];
|
|
159
|
+
runs: readonly MatterRun[];
|
|
160
|
+
nextActivitySeq: number | null;
|
|
161
|
+
nextRunOffset: number | null;
|
|
162
|
+
};
|
|
163
|
+
type Receipt = Target & CAS & {
|
|
164
|
+
number: number;
|
|
165
|
+
status: MatterStatus;
|
|
166
|
+
seq?: number;
|
|
167
|
+
activityId?: string;
|
|
168
|
+
};
|
|
169
|
+
interface MatterRequests {
|
|
170
|
+
list: Scope & {
|
|
171
|
+
page?: MatterListPage;
|
|
172
|
+
};
|
|
173
|
+
get: Scope & Target & {
|
|
174
|
+
page?: MatterDetailPage;
|
|
175
|
+
};
|
|
176
|
+
create: Write & {
|
|
177
|
+
brief: MatterBrief;
|
|
178
|
+
};
|
|
179
|
+
update: Write & Target & CAS & {
|
|
180
|
+
patch: Patch;
|
|
181
|
+
};
|
|
182
|
+
comment: Write & Target & {
|
|
183
|
+
body: string;
|
|
184
|
+
};
|
|
185
|
+
answer_decision: Write & Target & CAS & {
|
|
186
|
+
answer: Answer;
|
|
187
|
+
};
|
|
188
|
+
reopen: Write & Target & CAS & {
|
|
189
|
+
reason: string;
|
|
190
|
+
};
|
|
191
|
+
cancel: Write & Target & CAS & {
|
|
192
|
+
reason: string;
|
|
193
|
+
};
|
|
194
|
+
claim_session: Write & {
|
|
195
|
+
claim: {
|
|
196
|
+
sessionId: string;
|
|
197
|
+
} & ({
|
|
198
|
+
brief: MatterBrief;
|
|
199
|
+
} | (Target & Pick<CAS, 'revision'>));
|
|
200
|
+
};
|
|
201
|
+
export_markdown: Scope & Target;
|
|
202
|
+
}
|
|
203
|
+
type ReadResults = {
|
|
204
|
+
list: MatterList;
|
|
205
|
+
get: MatterDetail;
|
|
206
|
+
export_markdown: Target & {
|
|
207
|
+
markdown: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
type MatterFailure = {
|
|
211
|
+
ok: false;
|
|
212
|
+
code: string;
|
|
213
|
+
revision?: number;
|
|
214
|
+
briefRevision?: number;
|
|
215
|
+
};
|
|
216
|
+
export type MatterResult<K extends keyof MatterRequests> = MatterFailure | ({
|
|
217
|
+
ok: true;
|
|
218
|
+
version: 1;
|
|
219
|
+
} & (K extends keyof ReadResults ? ReadResults[K] : Receipt));
|
|
220
|
+
export type ProjectMatterRpc = <K extends keyof MatterRequests>(request: MatterRequests[K] & {
|
|
221
|
+
method: K;
|
|
222
|
+
}) => Promise<MatterResult<K>>;
|
|
223
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|