@peer-agent/protocol 0.1.0-rc.4 → 0.1.0-rc.41
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/acceptance-close-gate.d.ts +10 -1
- package/dist/acceptance-close-gate.js +12 -0
- package/dist/agent-supervision.d.ts +81 -0
- package/dist/agent-supervision.js +1 -0
- package/dist/attention.d.ts +44 -0
- package/dist/attention.js +1 -0
- package/dist/bot-access-policy.d.ts +29 -0
- package/dist/bot-access-policy.js +1 -0
- package/dist/bot-conversation-read.d.ts +25 -0
- package/dist/bot-conversation-read.js +9 -0
- package/dist/bot-model-selection.d.ts +13 -0
- package/dist/bot-model-selection.js +1 -0
- package/dist/browser-window.d.ts +48 -0
- package/dist/browser-window.js +23 -0
- package/dist/capability-admission.d.ts +20 -0
- package/dist/capability-admission.js +1 -0
- package/dist/delegation-coordination.d.ts +81 -0
- package/dist/delegation-coordination.js +1 -0
- package/dist/delegation.d.ts +216 -7
- package/dist/delegation.js +43 -39
- package/dist/document-reference.d.ts +83 -0
- package/dist/document-reference.js +1 -0
- package/dist/evidence-inspection.d.ts +64 -0
- package/dist/evidence-inspection.js +1 -0
- package/dist/goal.d.ts +50 -2
- package/dist/index.d.ts +56 -5
- package/dist/index.js +25 -0
- package/dist/input-prediction.d.ts +86 -0
- package/dist/input-prediction.js +48 -0
- package/dist/intent-coordination.d.ts +201 -0
- package/dist/intent-coordination.js +1 -0
- package/dist/interactive-result.d.ts +363 -0
- package/dist/interactive-result.js +215 -0
- package/dist/interactive-verification.d.ts +41 -0
- package/dist/interactive-verification.js +65 -0
- package/dist/local-git.d.ts +44 -0
- package/dist/local-git.js +3 -0
- package/dist/local-image.d.ts +53 -0
- package/dist/local-image.js +5 -0
- package/dist/model-reasoning.d.ts +13 -0
- package/dist/model-reasoning.js +18 -0
- package/dist/model-routing.d.ts +37 -3
- package/dist/model-routing.js +31 -5
- package/dist/project-agent-failure.d.ts +30 -0
- package/dist/project-agent-failure.js +44 -0
- package/dist/project-input-recovery.d.ts +65 -0
- package/dist/project-input-recovery.js +5 -0
- package/dist/project-recovery.d.ts +43 -0
- package/dist/project-recovery.js +1 -0
- package/dist/project.d.ts +81 -0
- package/dist/project.js +8 -5
- package/dist/remote-access.d.ts +15 -0
- package/dist/remote-access.js +1 -1
- package/dist/reply-delivery.d.ts +28 -0
- package/dist/reply-delivery.js +1 -0
- package/dist/resource-edit-execution.d.ts +68 -0
- package/dist/resource-edit-execution.js +96 -0
- package/dist/resource-edit.d.ts +237 -0
- package/dist/resource-edit.js +134 -0
- package/dist/resource-feedback-transport.d.ts +25 -0
- package/dist/resource-feedback-transport.js +93 -0
- package/dist/resource-feedback.d.ts +98 -0
- package/dist/resource-feedback.js +151 -0
- package/dist/resource-file-replace.d.ts +36 -0
- package/dist/resource-file-replace.js +40 -0
- package/dist/resource-reference-hints.d.ts +3 -0
- package/dist/resource-reference-hints.js +58 -0
- package/dist/resource-window.d.ts +222 -0
- package/dist/resource-window.js +252 -0
- package/dist/runtime-session-facts.d.ts +58 -0
- package/dist/runtime-session-facts.js +55 -0
- package/dist/session-control.d.ts +196 -0
- package/dist/session-control.js +48 -0
- package/dist/session-facts.d.ts +29 -0
- package/dist/session-facts.js +35 -0
- package/dist/system-context.d.ts +6 -0
- package/dist/task-overview.d.ts +90 -0
- package/dist/task-overview.js +322 -17
- package/dist/tool-activity-preview.d.ts +4 -0
- package/dist/tool-activity-preview.js +72 -0
- package/dist/usage-accounting.d.ts +1 -1
- package/dist/user-anchor.d.ts +17 -0
- package/dist/user-anchor.js +1 -0
- package/dist/work-coordination.d.ts +165 -0
- package/dist/work-coordination.js +1 -0
- package/package.json +1 -1
package/dist/project.d.ts
CHANGED
|
@@ -162,6 +162,14 @@ export interface BotProfile {
|
|
|
162
162
|
readonly acceptancePolicy?: 'auto' | 'confirm';
|
|
163
163
|
/** Policy acceptance keeps a separate merge confirmation unless explicitly enabled. */
|
|
164
164
|
readonly autoHandoffOnPolicyAccept?: boolean;
|
|
165
|
+
/** ADR 127: user-delegated unknown-outcome closure policy. Absent or null means ask; the model can never write it. */
|
|
166
|
+
readonly unknownOutcomePolicy?: {
|
|
167
|
+
readonly tier: 'ask' | 'bot_verified';
|
|
168
|
+
readonly policyId: string;
|
|
169
|
+
readonly revision: number;
|
|
170
|
+
readonly delegatedAt?: string;
|
|
171
|
+
readonly updatedAt: string;
|
|
172
|
+
} | null;
|
|
165
173
|
/** Archived deletion intent, retained until each cleanup step is persisted. */
|
|
166
174
|
readonly deletionCleanup?: {
|
|
167
175
|
readonly folder: string;
|
|
@@ -173,6 +181,7 @@ export interface BotProfile {
|
|
|
173
181
|
}
|
|
174
182
|
export interface BotRowState {
|
|
175
183
|
readonly needsYou: number;
|
|
184
|
+
readonly attentionExpiresAt?: string;
|
|
176
185
|
readonly unread: number;
|
|
177
186
|
readonly running: number;
|
|
178
187
|
/** Ephemeral status of the runner hosted by this desktop process. */
|
|
@@ -189,6 +198,75 @@ export interface BotListFilter {
|
|
|
189
198
|
readonly query?: string;
|
|
190
199
|
readonly needsYouOnly?: boolean;
|
|
191
200
|
}
|
|
201
|
+
/** Bounded, redacted display preview; never an execution or Evidence object. */
|
|
202
|
+
export interface ProjectAgentToolPreview {
|
|
203
|
+
readonly text: string;
|
|
204
|
+
readonly truncated: boolean;
|
|
205
|
+
readonly redacted: boolean;
|
|
206
|
+
}
|
|
207
|
+
export interface ProjectAgentToolActivity {
|
|
208
|
+
readonly kind: 'tool';
|
|
209
|
+
readonly id: string;
|
|
210
|
+
readonly name: string;
|
|
211
|
+
readonly status: 'preparing' | 'running' | 'awaiting_permission' | 'done' | 'error' | 'stopped';
|
|
212
|
+
readonly startedAt?: string;
|
|
213
|
+
readonly finishedAt?: string;
|
|
214
|
+
readonly summary?: string;
|
|
215
|
+
readonly input?: ProjectAgentToolPreview;
|
|
216
|
+
readonly result?: ProjectAgentToolPreview;
|
|
217
|
+
readonly receivedChars?: number;
|
|
218
|
+
readonly permissionDeadlineAt?: string;
|
|
219
|
+
}
|
|
220
|
+
/** Public conversation update, never hidden reasoning, Tool Result or Evidence.
|
|
221
|
+
* User agent_turn records may persist these as publicUpdates (100 / 32000 chars).
|
|
222
|
+
* Legacy rounds[].text is not a public-update source.
|
|
223
|
+
* role is the host-assigned display identity (ADR87 D4): opening = the first public
|
|
224
|
+
* text before any tool activity in the visible reply; every other public text is
|
|
225
|
+
* narration. Absent role means a pre-2026-11-09 legacy record; do not guess one.
|
|
226
|
+
*/
|
|
227
|
+
export interface ProjectAgentPublicUpdate {
|
|
228
|
+
readonly id: string;
|
|
229
|
+
readonly text: string;
|
|
230
|
+
readonly role?: 'opening' | 'narration';
|
|
231
|
+
}
|
|
232
|
+
/** Display contract version for persisted agent_turn records (ADR87 D4).
|
|
233
|
+
* Version 2: public text carries role, the canonical agent_reply is the only
|
|
234
|
+
* answer body, and the implicit pure-text fallback reply is closed. Absent
|
|
235
|
+
* version means a legacy record and must keep legacy presentation.
|
|
236
|
+
*/
|
|
237
|
+
export declare const AGENT_TURN_DISPLAY_CONTRACT: 2;
|
|
238
|
+
/** Ephemeral interactive-turn presentation, including explicit wake retries. No hidden reasoning or Evidence. */
|
|
239
|
+
export interface ProjectAgentActivity {
|
|
240
|
+
/** Same-turn successful local file results only; navigation hints never grant access. */
|
|
241
|
+
readonly resourceReferences?: readonly import('./document-reference.ts').BotResourceReferenceHint[];
|
|
242
|
+
readonly workspaceId: string;
|
|
243
|
+
readonly conversationId: string;
|
|
244
|
+
readonly turnId: string;
|
|
245
|
+
/** Existing coordination identity; several execution attempts may serve one reply. */
|
|
246
|
+
readonly workId?: string;
|
|
247
|
+
readonly revision: number;
|
|
248
|
+
readonly startedAt: string;
|
|
249
|
+
readonly finishedAt?: string;
|
|
250
|
+
readonly modelSelection?: Pick<import('./model-routing.ts').RuntimeModelSelection, 'modelProviderId' | 'reasoningEffort'>;
|
|
251
|
+
readonly replyTo: readonly string[];
|
|
252
|
+
readonly phase: 'waiting' | 'thinking' | 'responding' | 'tool' | 'awaiting_permission' | 'settling' | 'done' | 'error' | 'stopped' | 'disposed';
|
|
253
|
+
readonly replyText: string;
|
|
254
|
+
/** A factual recovery event, cleared when the next provider event arrives. */
|
|
255
|
+
readonly recovery?: 'connection' | 'provider';
|
|
256
|
+
readonly segments: readonly (({
|
|
257
|
+
readonly kind: 'text';
|
|
258
|
+
} & ProjectAgentPublicUpdate) | ProjectAgentToolActivity)[];
|
|
259
|
+
}
|
|
260
|
+
export interface ProjectAgentStopResponseRequest {
|
|
261
|
+
readonly workspaceId: string;
|
|
262
|
+
readonly turnId: string;
|
|
263
|
+
}
|
|
264
|
+
export type ProjectAgentStopResponseResult = {
|
|
265
|
+
readonly ok: true;
|
|
266
|
+
} | {
|
|
267
|
+
readonly ok: false;
|
|
268
|
+
readonly code: 'PROJECT_AGENT_DISABLED' | 'NOT_FOUND' | 'HOST_OFFLINE' | 'STALE_TURN' | 'INVALID_INPUT';
|
|
269
|
+
};
|
|
192
270
|
export interface BotListSession {
|
|
193
271
|
readonly status: WorkSessionStatus;
|
|
194
272
|
readonly updatedAt?: string;
|
|
@@ -213,6 +291,9 @@ export declare function projectBotListItem(input: {
|
|
|
213
291
|
readonly lastMessage?: BotListMessage | null;
|
|
214
292
|
readonly sessions?: readonly BotListSession[];
|
|
215
293
|
readonly approvals?: readonly BotListApproval[];
|
|
294
|
+
readonly attention?: readonly {
|
|
295
|
+
readonly id: string;
|
|
296
|
+
}[];
|
|
216
297
|
readonly readCursor?: string | null;
|
|
217
298
|
}): BotListItem;
|
|
218
299
|
export declare function sortBotList(items: readonly BotListItem[]): BotListItem[];
|
package/dist/project.js
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
* Bot list projection. Sort is recent activity only.
|
|
3
3
|
* needsYou changes the badge and the filter, not the order.
|
|
4
4
|
*/
|
|
5
|
+
/** Display contract version for persisted agent_turn records (ADR87 D4).
|
|
6
|
+
* Version 2: public text carries role, the canonical agent_reply is the only
|
|
7
|
+
* answer body, and the implicit pure-text fallback reply is closed. Absent
|
|
8
|
+
* version means a legacy record and must keep legacy presentation.
|
|
9
|
+
*/
|
|
10
|
+
export const AGENT_TURN_DISPLAY_CONTRACT = 2;
|
|
5
11
|
export const BOT_AVATAR_SHAPES = [
|
|
6
12
|
'circle',
|
|
7
13
|
'square',
|
|
@@ -22,7 +28,6 @@ export const BOT_AVATAR_COLORS = [
|
|
|
22
28
|
'#55bac7',
|
|
23
29
|
'#a8a59f',
|
|
24
30
|
];
|
|
25
|
-
const NEEDS_YOU_STATUSES = new Set(['waiting_user', 'result_ready']);
|
|
26
31
|
const RUNNING_STATUSES = new Set(['starting', 'running', 'verifying']);
|
|
27
32
|
function fnv1a(text) {
|
|
28
33
|
let hash = 0x811c9dc5;
|
|
@@ -51,9 +56,7 @@ function latestIso(values) {
|
|
|
51
56
|
}
|
|
52
57
|
export function projectBotListItem(input) {
|
|
53
58
|
const sessions = input.sessions ?? [];
|
|
54
|
-
const
|
|
55
|
-
const openApprovals = approvals.filter((item) => item.state === 'open' || item.state === 'stale').length;
|
|
56
|
-
const waitingSessions = sessions.filter((item) => NEEDS_YOU_STATUSES.has(item.status)).length;
|
|
59
|
+
const attention = new Set((input.attention ?? []).map(item => item.id));
|
|
57
60
|
const running = sessions.filter((item) => RUNNING_STATUSES.has(item.status)).length;
|
|
58
61
|
const lastMessage = input.lastMessage ?? null;
|
|
59
62
|
const unread = lastMessage
|
|
@@ -72,7 +75,7 @@ export function projectBotListItem(input) {
|
|
|
72
75
|
...sessions.map((item) => item.updatedAt),
|
|
73
76
|
]),
|
|
74
77
|
state: {
|
|
75
|
-
needsYou:
|
|
78
|
+
needsYou: attention.size,
|
|
76
79
|
unread,
|
|
77
80
|
running,
|
|
78
81
|
},
|
package/dist/remote-access.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export declare const REMOTE_PROJECT_LIMITS: Readonly<{
|
|
|
54
54
|
projects: 200;
|
|
55
55
|
messages: 50;
|
|
56
56
|
text: 4000;
|
|
57
|
+
interactiveResults: 8;
|
|
58
|
+
interactiveSummary: 256;
|
|
57
59
|
requestBytes: number;
|
|
58
60
|
delegationBytes: number;
|
|
59
61
|
resultBytes: number;
|
|
@@ -90,6 +92,19 @@ export type RemoteProjectRequest = RemoteProjectRequestBase & ({
|
|
|
90
92
|
readonly workspaceId: string;
|
|
91
93
|
readonly text: string;
|
|
92
94
|
});
|
|
95
|
+
/** Optional fixed-result projection on the existing project.session.read response. */
|
|
96
|
+
export type RemoteProjectInteractiveResult = {
|
|
97
|
+
readonly ref: string;
|
|
98
|
+
readonly availability: 'available' | 'cleaned';
|
|
99
|
+
} & ({
|
|
100
|
+
readonly title: string;
|
|
101
|
+
readonly summary: string;
|
|
102
|
+
readonly truncated: boolean;
|
|
103
|
+
} | {
|
|
104
|
+
readonly title?: never;
|
|
105
|
+
readonly summary?: never;
|
|
106
|
+
readonly truncated?: never;
|
|
107
|
+
});
|
|
93
108
|
export interface RemoteProjectContext extends Omit<RemoteReadContext, 'delegation' | 'task'> {
|
|
94
109
|
readonly delegation: {
|
|
95
110
|
readonly version: number;
|
package/dist/remote-access.js
CHANGED
|
@@ -57,7 +57,7 @@ export function admitRemoteRead(value, context) {
|
|
|
57
57
|
return parsed;
|
|
58
58
|
}
|
|
59
59
|
export const REMOTE_PROJECT_LIMITS = Object.freeze({
|
|
60
|
-
projects: 200, messages: 50, text: 4000,
|
|
60
|
+
projects: 200, messages: 50, text: 4000, interactiveResults: 8, interactiveSummary: 256,
|
|
61
61
|
requestBytes: 32 * 1024, delegationBytes: 128 * 1024, resultBytes: 2 * 1024 * 1024,
|
|
62
62
|
});
|
|
63
63
|
const projectBaseFields = [
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** The old delivered aggregate still requires both canonical commit and host settlement. */
|
|
2
|
+
export interface ReplyDeliveryReceipt {
|
|
3
|
+
readonly state: 'prepared' | 'delivered' | 'invalidated' | 'deferred' | 'aggregated';
|
|
4
|
+
readonly heldAt?: string;
|
|
5
|
+
readonly deliveredBy?: string;
|
|
6
|
+
readonly canonicalCommittedAt?: string;
|
|
7
|
+
readonly settlement?: {
|
|
8
|
+
readonly operationId: string;
|
|
9
|
+
readonly status: 'pending' | 'failed' | 'applied';
|
|
10
|
+
readonly attempts: number;
|
|
11
|
+
readonly updatedAt: string;
|
|
12
|
+
readonly phase?: 'commit' | 'settlement';
|
|
13
|
+
readonly error?: string;
|
|
14
|
+
readonly retryAt?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Derived locally from current assessments, never accepted from assistant reply metadata. */
|
|
18
|
+
export interface IntentReplyBinding {
|
|
19
|
+
readonly workId: string;
|
|
20
|
+
readonly goalRevision: number;
|
|
21
|
+
readonly intentRevision: number;
|
|
22
|
+
readonly decisionRef: string;
|
|
23
|
+
readonly replyRef: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ReplyGoalScope {
|
|
26
|
+
readonly workId: string;
|
|
27
|
+
readonly goalRevision: number;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type ResourceEditOperation, type ResourceEditReceipt } from './resource-edit.ts';
|
|
2
|
+
import { RESOURCE_FILE_REPLACE_CAPABILITY, RESOURCE_FILE_REPLACE_TOOL, type ResourceFileReplacePreview, type ResourceFileReplaceInput } from './resource-file-replace.ts';
|
|
3
|
+
import type { PermissionGrant } from './index.ts';
|
|
4
|
+
export declare const RESOURCE_EDIT_EXECUTION_BYTES = 32768;
|
|
5
|
+
export declare const RESOURCE_EDIT_POSTLUDE_BYTES = 16384;
|
|
6
|
+
export declare const RESOURCE_EDIT_EXECUTION_TOTAL_BYTES: number;
|
|
7
|
+
/** Stored facts have their own schema; they never contain the complete Tool Call arguments. */
|
|
8
|
+
export interface ResourceEditExecutionRecord {
|
|
9
|
+
readonly schemaVersion: 1;
|
|
10
|
+
readonly workspaceId: string;
|
|
11
|
+
readonly requestId: string;
|
|
12
|
+
readonly payloadHash: string;
|
|
13
|
+
readonly projectionId: string;
|
|
14
|
+
readonly sessionId: string;
|
|
15
|
+
readonly call: {
|
|
16
|
+
readonly toolCallId: string;
|
|
17
|
+
readonly capabilityId: typeof RESOURCE_FILE_REPLACE_CAPABILITY;
|
|
18
|
+
readonly toolName: typeof RESOURCE_FILE_REPLACE_TOOL;
|
|
19
|
+
readonly argumentsDigest: string;
|
|
20
|
+
readonly occurredAt: string;
|
|
21
|
+
readonly permissionCallId?: string;
|
|
22
|
+
};
|
|
23
|
+
readonly grant: Omit<PermissionGrant, 'scope'> & {
|
|
24
|
+
readonly scope?: typeof RESOURCE_FILE_REPLACE_CAPABILITY | null;
|
|
25
|
+
};
|
|
26
|
+
readonly result: {
|
|
27
|
+
readonly toolCallId: string;
|
|
28
|
+
readonly status: 'success' | 'failed' | 'denied' | 'cancelled';
|
|
29
|
+
readonly completedAt: string;
|
|
30
|
+
readonly observation?: ResourceFileReplacePreview;
|
|
31
|
+
readonly blockedReason?: string;
|
|
32
|
+
readonly evidence: {
|
|
33
|
+
readonly evidenceId: string;
|
|
34
|
+
readonly toolCallId: string;
|
|
35
|
+
readonly summary: string;
|
|
36
|
+
readonly locale: string;
|
|
37
|
+
readonly returnedToCloud: false;
|
|
38
|
+
readonly dataLevel: 'D2_sensitive';
|
|
39
|
+
readonly redactions: readonly string[];
|
|
40
|
+
readonly artifactRefs: readonly string[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface ResourceEditHookFact {
|
|
45
|
+
readonly id?: string;
|
|
46
|
+
readonly event?: 'PreToolUse' | 'PostToolUse';
|
|
47
|
+
readonly decision: 'allow' | 'ask' | 'deny';
|
|
48
|
+
readonly reason?: string;
|
|
49
|
+
readonly outcome?: string;
|
|
50
|
+
readonly durationMs?: number;
|
|
51
|
+
readonly exitCode?: number | null;
|
|
52
|
+
}
|
|
53
|
+
export interface ResourceEditPostlude {
|
|
54
|
+
readonly schemaVersion: 1;
|
|
55
|
+
readonly requestId: string;
|
|
56
|
+
readonly payloadHash: string;
|
|
57
|
+
readonly completedAt: string;
|
|
58
|
+
readonly status: 'recorded' | 'unconfirmed';
|
|
59
|
+
readonly reason?: string;
|
|
60
|
+
readonly hookFinalDecision?: 'allow' | 'ask' | 'deny';
|
|
61
|
+
readonly hooks?: readonly ResourceEditHookFact[];
|
|
62
|
+
}
|
|
63
|
+
export declare function resourceFileReplaceArgumentPayload(raw: ResourceFileReplaceInput): string;
|
|
64
|
+
export declare function normalizeResourceEditExecutionRecord(raw: unknown): ResourceEditExecutionRecord | undefined;
|
|
65
|
+
export declare function resourceEditExecutionMatches(record: ResourceEditExecutionRecord, raw: ResourceEditOperation): boolean;
|
|
66
|
+
/** Caller must have obtained this record from the actual host execution index, never model text. */
|
|
67
|
+
export declare function resourceEditExecutionReceipt(record: ResourceEditExecutionRecord, operation: ResourceEditOperation): ResourceEditReceipt | undefined;
|
|
68
|
+
export declare function normalizeResourceEditPostlude(raw: unknown): ResourceEditPostlude | undefined;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { normalizeResourceEditOperation, resourceEditToken, resourceEditDigest } from "./resource-edit.js";
|
|
2
|
+
import { normalizeResourceFileReplacePreview, normalizeResourceFileReplaceInput, RESOURCE_FILE_REPLACE_CAPABILITY, RESOURCE_FILE_REPLACE_PROVIDER, RESOURCE_FILE_REPLACE_TOOL } from "./resource-file-replace.js";
|
|
3
|
+
export const RESOURCE_EDIT_EXECUTION_BYTES = 32768;
|
|
4
|
+
export const RESOURCE_EDIT_POSTLUDE_BYTES = 16384;
|
|
5
|
+
export const RESOURCE_EDIT_EXECUTION_TOTAL_BYTES = 8 * 1024 * 1024;
|
|
6
|
+
const object = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
7
|
+
const keys = (v, allowed) => Object.keys(v).every(key => allowed.includes(key));
|
|
8
|
+
const text = (v, max) => typeof v === 'string' && v.length > 0 && v.length <= max && !/[\u0000-\u0008\u000b\u000c\u000e-\u001f]/.test(v);
|
|
9
|
+
const timestamp = (v) => typeof v === 'string' && v.length <= 40 && Number.isFinite(Date.parse(v));
|
|
10
|
+
function bounded(raw, max) { try {
|
|
11
|
+
return new TextEncoder().encode(JSON.stringify(raw)).byteLength <= max;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return false;
|
|
15
|
+
} }
|
|
16
|
+
const strings = (v, maxItems, maxChars) => Array.isArray(v) && v.length <= maxItems && v.every(item => text(item, maxChars));
|
|
17
|
+
export function resourceFileReplaceArgumentPayload(raw) {
|
|
18
|
+
const input = normalizeResourceFileReplaceInput(raw);
|
|
19
|
+
if (!input)
|
|
20
|
+
throw TypeError('INVALID_RESOURCE_EDIT_ARGUMENTS');
|
|
21
|
+
return JSON.stringify(input);
|
|
22
|
+
}
|
|
23
|
+
export function normalizeResourceEditExecutionRecord(raw) {
|
|
24
|
+
if (!object(raw) || !bounded(raw, RESOURCE_EDIT_EXECUTION_BYTES) || !keys(raw, ['schemaVersion', 'workspaceId', 'requestId', 'payloadHash', 'projectionId', 'sessionId', 'call', 'grant', 'result'])
|
|
25
|
+
|| raw.schemaVersion !== 1 || !resourceEditToken(raw.workspaceId) || !resourceEditToken(raw.requestId) || !resourceEditDigest(raw.payloadHash)
|
|
26
|
+
|| raw.projectionId !== `resource-edit:${raw.requestId}` || !text(raw.sessionId, 256) || !object(raw.call) || !object(raw.grant) || !object(raw.result))
|
|
27
|
+
return;
|
|
28
|
+
const call = raw.call, grant = raw.grant, result = raw.result;
|
|
29
|
+
if (!keys(call, ['toolCallId', 'capabilityId', 'toolName', 'argumentsDigest', 'occurredAt', 'permissionCallId']) || call.toolCallId !== `resource-edit:${raw.requestId}`
|
|
30
|
+
|| call.permissionCallId !== undefined && ![call.toolCallId, `chat-permission:${call.toolCallId}`].includes(call.permissionCallId)
|
|
31
|
+
|| call.capabilityId !== RESOURCE_FILE_REPLACE_CAPABILITY || call.toolName !== RESOURCE_FILE_REPLACE_TOOL || !resourceEditDigest(call.argumentsDigest) || !timestamp(call.occurredAt)
|
|
32
|
+
|| !keys(grant, ['grantId', 'toolCallId', 'granted', 'duration', 'scope', 'decidedAt', 'policyRevision']) || !resourceEditToken(grant.grantId) || grant.toolCallId !== call.toolCallId
|
|
33
|
+
|| typeof grant.granted !== 'boolean' || !['once', 'task', 'session', 'scope', 'persistent', 'denied'].includes(grant.duration)
|
|
34
|
+
|| grant.granted && (grant.duration === 'denied' || grant.scope !== call.capabilityId)
|
|
35
|
+
|| !grant.granted && grant.scope !== undefined && grant.scope !== null && grant.scope !== call.capabilityId || !timestamp(grant.decidedAt)
|
|
36
|
+
|| grant.policyRevision !== undefined && !text(grant.policyRevision, 512)
|
|
37
|
+
|| !keys(result, ['toolCallId', 'status', 'completedAt', 'observation', 'blockedReason', 'evidence']) || result.toolCallId !== call.toolCallId || !timestamp(result.completedAt)
|
|
38
|
+
|| !['success', 'failed', 'denied', 'cancelled'].includes(result.status) || !object(result.evidence))
|
|
39
|
+
return;
|
|
40
|
+
const observation = result.observation === undefined ? undefined : normalizeResourceFileReplacePreview(result.observation);
|
|
41
|
+
if (result.observation !== undefined && !observation || observation && (observation.requestId !== raw.requestId || observation.status !== result.status
|
|
42
|
+
|| observation.permissionCallId !== undefined && (![call.toolCallId, `chat-permission:${call.toolCallId}`].includes(observation.permissionCallId)
|
|
43
|
+
|| call.permissionCallId !== undefined && observation.permissionCallId !== call.permissionCallId)
|
|
44
|
+
|| observation.outcome === 'applied' && !grant.granted)
|
|
45
|
+
|| !observation && (!['denied', 'cancelled'].includes(result.status) || grant.granted || !text(result.blockedReason, 2048))
|
|
46
|
+
|| observation && result.blockedReason !== undefined)
|
|
47
|
+
return;
|
|
48
|
+
const evidence = result.evidence;
|
|
49
|
+
if (!keys(evidence, ['evidenceId', 'toolCallId', 'summary', 'locale', 'returnedToCloud', 'dataLevel', 'redactions', 'artifactRefs']) || !resourceEditToken(evidence.evidenceId)
|
|
50
|
+
|| evidence.toolCallId !== call.toolCallId || !text(evidence.summary, 4096) || !text(evidence.locale, 32) || evidence.returnedToCloud !== false || evidence.dataLevel !== 'D2_sensitive'
|
|
51
|
+
|| !strings(evidence.redactions, 32, 256) || !strings(evidence.artifactRefs, 32, 2048))
|
|
52
|
+
return;
|
|
53
|
+
return { schemaVersion: 1, workspaceId: raw.workspaceId, requestId: raw.requestId, payloadHash: raw.payloadHash, projectionId: raw.projectionId, sessionId: raw.sessionId,
|
|
54
|
+
call: { toolCallId: call.toolCallId, capabilityId: RESOURCE_FILE_REPLACE_CAPABILITY, toolName: RESOURCE_FILE_REPLACE_TOOL, argumentsDigest: call.argumentsDigest, occurredAt: call.occurredAt,
|
|
55
|
+
...(call.permissionCallId !== undefined || observation?.permissionCallId !== undefined ? { permissionCallId: (call.permissionCallId ?? observation?.permissionCallId) } : {}) },
|
|
56
|
+
grant: { grantId: grant.grantId, toolCallId: grant.toolCallId, granted: grant.granted, duration: grant.duration,
|
|
57
|
+
...(grant.scope !== undefined ? { scope: grant.scope } : {}),
|
|
58
|
+
decidedAt: grant.decidedAt, ...(grant.policyRevision !== undefined ? { policyRevision: grant.policyRevision } : {}) },
|
|
59
|
+
result: { toolCallId: result.toolCallId, status: result.status, completedAt: result.completedAt,
|
|
60
|
+
...(observation ? { observation } : { blockedReason: result.blockedReason }), evidence: { evidenceId: evidence.evidenceId, toolCallId: evidence.toolCallId,
|
|
61
|
+
summary: evidence.summary, locale: evidence.locale, returnedToCloud: false, dataLevel: 'D2_sensitive', redactions: [...evidence.redactions], artifactRefs: [...evidence.artifactRefs] } } };
|
|
62
|
+
}
|
|
63
|
+
export function resourceEditExecutionMatches(record, raw) {
|
|
64
|
+
const op = normalizeResourceEditOperation(raw), value = record.result.observation;
|
|
65
|
+
return !!op && op.providerId === RESOURCE_FILE_REPLACE_PROVIDER && op.requestId === record.requestId && op.target.recipient.workspaceId === record.workspaceId && op.payloadHash === record.payloadHash && record.sessionId === (op.target.reference.task?.sessionId ?? op.target.recipient.conversationId)
|
|
66
|
+
&& (!value || value.path === op.target.reference.path && value.resourceId === op.target.base.resourceId && value.expectedVersion === op.target.base.contentVersion && value.proposedVersion === op.proposedVersion);
|
|
67
|
+
}
|
|
68
|
+
/** Caller must have obtained this record from the actual host execution index, never model text. */
|
|
69
|
+
export function resourceEditExecutionReceipt(record, operation) {
|
|
70
|
+
if (!resourceEditExecutionMatches(record, operation))
|
|
71
|
+
return;
|
|
72
|
+
const outcome = record.result.observation?.outcome ?? (record.result.status === 'cancelled' ? 'cancelled' : 'denied');
|
|
73
|
+
if (outcome === 'uncertain')
|
|
74
|
+
return;
|
|
75
|
+
return { outcome, toolCallId: record.call.toolCallId, evidenceRef: `tool-result://${record.call.toolCallId}`,
|
|
76
|
+
...(record.result.observation?.observedVersion ? { observedVersion: record.result.observation.observedVersion } : {}) };
|
|
77
|
+
}
|
|
78
|
+
export function normalizeResourceEditPostlude(raw) {
|
|
79
|
+
if (!object(raw) || !bounded(raw, RESOURCE_EDIT_POSTLUDE_BYTES) || !keys(raw, ['schemaVersion', 'requestId', 'payloadHash', 'completedAt', 'status', 'reason', 'hookFinalDecision', 'hooks'])
|
|
80
|
+
|| raw.schemaVersion !== 1 || !resourceEditToken(raw.requestId) || !resourceEditDigest(raw.payloadHash) || !timestamp(raw.completedAt) || !['recorded', 'unconfirmed'].includes(raw.status)
|
|
81
|
+
|| raw.status === 'unconfirmed' && !text(raw.reason, 2048) || raw.reason !== undefined && !text(raw.reason, 2048) || raw.hookFinalDecision !== undefined && !['allow', 'ask', 'deny'].includes(raw.hookFinalDecision)
|
|
82
|
+
|| raw.hooks !== undefined && (!Array.isArray(raw.hooks) || raw.hooks.length > 64))
|
|
83
|
+
return;
|
|
84
|
+
const hooks = [];
|
|
85
|
+
for (const item of (raw.hooks ?? [])) {
|
|
86
|
+
if (!object(item) || !keys(item, ['id', 'event', 'decision', 'reason', 'outcome', 'durationMs', 'exitCode']) || !['allow', 'ask', 'deny'].includes(item.decision)
|
|
87
|
+
|| item.id !== undefined && !text(item.id, 512) || item.event !== undefined && !['PreToolUse', 'PostToolUse'].includes(item.event)
|
|
88
|
+
|| item.reason !== undefined && !text(item.reason, 2048) || item.outcome !== undefined && !text(item.outcome, 128)
|
|
89
|
+
|| item.durationMs !== undefined && (typeof item.durationMs !== 'number' || !Number.isFinite(item.durationMs) || item.durationMs < 0)
|
|
90
|
+
|| item.exitCode !== undefined && item.exitCode !== null && !Number.isSafeInteger(item.exitCode))
|
|
91
|
+
return;
|
|
92
|
+
hooks.push({ ...item });
|
|
93
|
+
}
|
|
94
|
+
return { schemaVersion: 1, requestId: raw.requestId, payloadHash: raw.payloadHash, completedAt: raw.completedAt, status: raw.status,
|
|
95
|
+
...(raw.reason !== undefined ? { reason: raw.reason } : {}), ...(raw.hookFinalDecision !== undefined ? { hookFinalDecision: raw.hookFinalDecision } : {}), ...(raw.hooks !== undefined ? { hooks } : {}) };
|
|
96
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import type { BotDocumentReference } from './document-reference.ts';
|
|
2
|
+
import type { ResourceFeedbackRecipient, ResourceFeedbackPreparationIdentity } from './resource-feedback.ts';
|
|
3
|
+
/** Recoverable intent only. These records never grant filesystem access or prove execution. */
|
|
4
|
+
export interface ResourceEditTarget {
|
|
5
|
+
readonly recipient: ResourceFeedbackRecipient;
|
|
6
|
+
readonly reference: BotDocumentReference;
|
|
7
|
+
readonly base: {
|
|
8
|
+
readonly resourceId: string;
|
|
9
|
+
readonly contentVersion: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface ResourceTextDraft {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly target: ResourceEditTarget;
|
|
15
|
+
readonly baseText: string;
|
|
16
|
+
readonly text: string;
|
|
17
|
+
readonly revision: number;
|
|
18
|
+
readonly createdAt: string;
|
|
19
|
+
readonly updatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
/** Host validates the real sender separately. A token cannot substitute for PermissionGrant. */
|
|
22
|
+
export interface ResourceEditWriter extends ResourceFeedbackPreparationIdentity {
|
|
23
|
+
readonly token: string;
|
|
24
|
+
readonly lease: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ResourceEditReceipt {
|
|
27
|
+
readonly outcome: 'applied' | 'conflict' | 'denied' | 'cancelled' | 'failed';
|
|
28
|
+
readonly toolCallId?: string;
|
|
29
|
+
readonly evidenceRef?: string;
|
|
30
|
+
readonly observedVersion?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ResourceEditOperation {
|
|
33
|
+
readonly requestId: string;
|
|
34
|
+
readonly draftId: string;
|
|
35
|
+
readonly draftRevision: number;
|
|
36
|
+
readonly target: ResourceEditTarget;
|
|
37
|
+
readonly providerId: string;
|
|
38
|
+
readonly proposedVersion: string;
|
|
39
|
+
readonly payloadHash: string;
|
|
40
|
+
readonly createdAt: string;
|
|
41
|
+
readonly updatedAt: string;
|
|
42
|
+
readonly phase: 'prepared' | 'running' | 'uncertain' | 'settled';
|
|
43
|
+
readonly hostEpoch?: string;
|
|
44
|
+
readonly receipt?: ResourceEditReceipt;
|
|
45
|
+
}
|
|
46
|
+
export declare const RESOURCE_TEXT_DRAFT_LIMIT = 16;
|
|
47
|
+
export declare const RESOURCE_EDIT_OPERATION_LIMIT = 64;
|
|
48
|
+
export declare const RESOURCE_EDIT_TEXT_BYTES: number;
|
|
49
|
+
export declare const resourceEditToken: (v: unknown) => v is string;
|
|
50
|
+
export declare const resourceEditDigest: (v: unknown) => v is string;
|
|
51
|
+
export declare function validResourceEditText(v: unknown): v is string;
|
|
52
|
+
export declare function normalizeResourceEditTarget(raw: unknown): ResourceEditTarget | undefined;
|
|
53
|
+
export declare function normalizeResourceTextDraft(raw: unknown): ResourceTextDraft | undefined;
|
|
54
|
+
export declare function normalizeResourceEditWriter(raw: unknown): ResourceEditWriter | undefined;
|
|
55
|
+
export declare function normalizeResourceEditReceipt(raw: unknown): ResourceEditReceipt | undefined;
|
|
56
|
+
export declare function normalizeResourceEditOperation(raw: unknown): ResourceEditOperation | undefined;
|
|
57
|
+
/** Retained text is a version, not current filesystem authority or task acceptance. */
|
|
58
|
+
export interface ResourceTextSnapshot {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly target: ResourceEditTarget;
|
|
61
|
+
readonly version: string;
|
|
62
|
+
readonly createdAt: string;
|
|
63
|
+
readonly purpose: 'before' | 'after' | 'delivery';
|
|
64
|
+
readonly availability: 'retained' | 'cleaned';
|
|
65
|
+
readonly evidenceRef: string;
|
|
66
|
+
readonly toolCallId?: string;
|
|
67
|
+
readonly operationId?: string;
|
|
68
|
+
readonly artifactRef?: string;
|
|
69
|
+
}
|
|
70
|
+
export declare function normalizeResourceTextSnapshot(raw: unknown): ResourceTextSnapshot | undefined;
|
|
71
|
+
export type ResourceEditSource = {
|
|
72
|
+
readonly kind: 'document';
|
|
73
|
+
readonly reference: BotDocumentReference;
|
|
74
|
+
readonly observed: ResourceEditTarget['base'];
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: 'native';
|
|
77
|
+
readonly identity: import('./resource-window.ts').ResourceWindowIdentity;
|
|
78
|
+
readonly path?: string;
|
|
79
|
+
readonly observed: ResourceEditTarget['base'];
|
|
80
|
+
};
|
|
81
|
+
export interface ResourceEditViewHandle {
|
|
82
|
+
readonly viewId: string;
|
|
83
|
+
readonly windowId: string;
|
|
84
|
+
readonly generation: number;
|
|
85
|
+
readonly draftId: string;
|
|
86
|
+
}
|
|
87
|
+
export interface ResourceEditView {
|
|
88
|
+
readonly handle: ResourceEditViewHandle;
|
|
89
|
+
readonly draft: ResourceTextDraft;
|
|
90
|
+
}
|
|
91
|
+
export type ResourceEditResult<T extends object = Record<never, never>> = ({
|
|
92
|
+
readonly ok: true;
|
|
93
|
+
} & T) | {
|
|
94
|
+
readonly ok: false;
|
|
95
|
+
readonly code: string;
|
|
96
|
+
};
|
|
97
|
+
export interface ResourceEditScope {
|
|
98
|
+
readonly workspaceId: string;
|
|
99
|
+
readonly handle?: ResourceEditViewHandle;
|
|
100
|
+
}
|
|
101
|
+
export interface ResourceEditDraftInfo extends Omit<ResourceTextDraft, 'baseText' | 'text'> {
|
|
102
|
+
readonly hasChanges: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface ResourceEditNotice {
|
|
105
|
+
readonly workspaceId: string;
|
|
106
|
+
readonly draftId?: string;
|
|
107
|
+
readonly kind: 'writer' | 'saved' | 'discarded' | 'history' | 'operation';
|
|
108
|
+
readonly requestId?: string;
|
|
109
|
+
readonly writerViewId?: string;
|
|
110
|
+
readonly revision?: number;
|
|
111
|
+
}
|
|
112
|
+
export interface ResourceEditSaveReceipt {
|
|
113
|
+
readonly draftId: string;
|
|
114
|
+
readonly revision: number;
|
|
115
|
+
readonly updatedAt: string;
|
|
116
|
+
readonly textVersion: string;
|
|
117
|
+
}
|
|
118
|
+
export interface ResourceEditOperationRequest {
|
|
119
|
+
readonly handle: ResourceEditViewHandle;
|
|
120
|
+
readonly requestId: string;
|
|
121
|
+
}
|
|
122
|
+
export interface ResourceEditPermissionChallenge {
|
|
123
|
+
readonly requestId: string;
|
|
124
|
+
readonly challengeId: string;
|
|
125
|
+
readonly argsDigest: string;
|
|
126
|
+
readonly deadlineAt: string;
|
|
127
|
+
readonly path: string;
|
|
128
|
+
readonly expectedVersion: string;
|
|
129
|
+
readonly proposedVersion: string;
|
|
130
|
+
readonly reason: string;
|
|
131
|
+
readonly confirmation?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface ResourceEditOperationStatus {
|
|
134
|
+
readonly operation: ResourceEditOperation;
|
|
135
|
+
readonly live: boolean;
|
|
136
|
+
readonly hostOwnedHere?: boolean;
|
|
137
|
+
readonly hasActualResult: boolean;
|
|
138
|
+
readonly governance: 'pending' | 'recorded' | 'unconfirmed' | 'unavailable';
|
|
139
|
+
readonly permission: ResourceEditPermissionChallenge | null;
|
|
140
|
+
readonly permissionElsewhere?: boolean;
|
|
141
|
+
readonly observation?: 'matches_proposed' | 'matches_base' | 'changed' | 'unavailable';
|
|
142
|
+
}
|
|
143
|
+
export interface ResourceEditsApi {
|
|
144
|
+
readonly onChanged: (listener: (notice: ResourceEditNotice) => void) => () => void;
|
|
145
|
+
readonly open: (request: {
|
|
146
|
+
readonly requestId: string;
|
|
147
|
+
readonly source: ResourceEditSource;
|
|
148
|
+
}) => Promise<ResourceEditResult<ResourceEditView>>;
|
|
149
|
+
readonly resume: (request: {
|
|
150
|
+
readonly requestId: string;
|
|
151
|
+
readonly workspaceId: string;
|
|
152
|
+
readonly draftId: string;
|
|
153
|
+
readonly source?: ResourceEditSource;
|
|
154
|
+
}) => Promise<ResourceEditResult<ResourceEditView>>;
|
|
155
|
+
readonly cancelOpen: (requestId: string) => Promise<ResourceEditResult>;
|
|
156
|
+
readonly read: (handle: ResourceEditViewHandle) => Promise<ResourceEditResult<ResourceEditView>>;
|
|
157
|
+
readonly acquire: (request: {
|
|
158
|
+
readonly handle: ResourceEditViewHandle;
|
|
159
|
+
readonly takeover?: boolean;
|
|
160
|
+
}) => Promise<ResourceEditResult<ResourceEditView & {
|
|
161
|
+
readonly writer: ResourceEditWriter;
|
|
162
|
+
}>>;
|
|
163
|
+
readonly save: (request: {
|
|
164
|
+
readonly handle: ResourceEditViewHandle;
|
|
165
|
+
readonly writer: ResourceEditWriter;
|
|
166
|
+
readonly revision: number;
|
|
167
|
+
readonly text: string;
|
|
168
|
+
}) => Promise<ResourceEditResult<{
|
|
169
|
+
readonly saved: ResourceEditSaveReceipt;
|
|
170
|
+
}>>;
|
|
171
|
+
readonly discard: (request: {
|
|
172
|
+
readonly handle: ResourceEditViewHandle;
|
|
173
|
+
readonly writer: ResourceEditWriter;
|
|
174
|
+
readonly revision: number;
|
|
175
|
+
}) => Promise<ResourceEditResult>;
|
|
176
|
+
readonly close: (handle: ResourceEditViewHandle) => Promise<ResourceEditResult>;
|
|
177
|
+
readonly list: (request: ResourceEditScope & {
|
|
178
|
+
readonly cursor?: string;
|
|
179
|
+
readonly limit?: number;
|
|
180
|
+
}) => Promise<ResourceEditResult<{
|
|
181
|
+
readonly drafts: readonly ResourceEditDraftInfo[];
|
|
182
|
+
readonly operations: readonly ResourceEditOperation[];
|
|
183
|
+
readonly nextCursor: string | null;
|
|
184
|
+
readonly staleCount: number;
|
|
185
|
+
}>>;
|
|
186
|
+
readonly history: (request: ResourceEditScope & {
|
|
187
|
+
readonly cursor?: string;
|
|
188
|
+
readonly limit?: number;
|
|
189
|
+
}) => Promise<ResourceEditResult<{
|
|
190
|
+
readonly items: readonly ResourceTextSnapshot[];
|
|
191
|
+
readonly nextCursor: string | null;
|
|
192
|
+
readonly unavailableCount: number;
|
|
193
|
+
}>>;
|
|
194
|
+
readonly readSnapshot: (request: ResourceEditScope & {
|
|
195
|
+
readonly id: string;
|
|
196
|
+
}) => Promise<ResourceEditResult<{
|
|
197
|
+
readonly snapshot: ResourceTextSnapshot;
|
|
198
|
+
readonly content: string;
|
|
199
|
+
}>>;
|
|
200
|
+
readonly cleanup: (request: ResourceEditScope & {
|
|
201
|
+
readonly requestIds: readonly string[];
|
|
202
|
+
}) => Promise<ResourceEditResult<{
|
|
203
|
+
readonly removedBytes: number;
|
|
204
|
+
}>>;
|
|
205
|
+
readonly archive: (request: ResourceEditScope & {
|
|
206
|
+
readonly requestId: string;
|
|
207
|
+
}) => Promise<ResourceEditResult>;
|
|
208
|
+
readonly clearDelivery: (request: ResourceEditScope & {
|
|
209
|
+
readonly id: string;
|
|
210
|
+
}) => Promise<ResourceEditResult<{
|
|
211
|
+
readonly removedBytes: number;
|
|
212
|
+
}>>;
|
|
213
|
+
readonly submit: (request: ResourceEditOperationRequest & {
|
|
214
|
+
readonly writer: ResourceEditWriter;
|
|
215
|
+
readonly revision: number;
|
|
216
|
+
}) => Promise<ResourceEditResult<ResourceEditOperationStatus>>;
|
|
217
|
+
readonly continueSubmission: (request: ResourceEditOperationRequest) => Promise<ResourceEditResult<ResourceEditOperationStatus>>;
|
|
218
|
+
readonly operationStatus: (request: ResourceEditOperationRequest) => Promise<ResourceEditResult<ResourceEditOperationStatus>>;
|
|
219
|
+
readonly reconcileSubmission: (request: ResourceEditOperationRequest) => Promise<ResourceEditResult<ResourceEditOperationStatus>>;
|
|
220
|
+
readonly cancelSubmission: (request: ResourceEditOperationRequest) => Promise<ResourceEditResult<ResourceEditOperationStatus>>;
|
|
221
|
+
readonly decideSubmissionPermission: (request: ResourceEditOperationRequest & {
|
|
222
|
+
readonly challengeId: string;
|
|
223
|
+
readonly argsDigest: string;
|
|
224
|
+
readonly allow: boolean;
|
|
225
|
+
}) => Promise<ResourceEditResult>;
|
|
226
|
+
readonly readExecution: (request: ResourceEditOperationRequest) => Promise<ResourceEditResult<{
|
|
227
|
+
readonly record: import('./resource-edit-execution.ts').ResourceEditExecutionRecord;
|
|
228
|
+
readonly postlude: import('./resource-edit-execution.ts').ResourceEditPostlude | null;
|
|
229
|
+
}>>;
|
|
230
|
+
readonly readSubmission: (request: ResourceEditOperationRequest) => Promise<ResourceEditResult<{
|
|
231
|
+
readonly operation: ResourceEditOperation;
|
|
232
|
+
readonly baseText: string;
|
|
233
|
+
readonly text: string;
|
|
234
|
+
}>>;
|
|
235
|
+
}
|
|
236
|
+
export declare function normalizeResourceEditSource(raw: unknown): ResourceEditSource | undefined;
|
|
237
|
+
export declare function normalizeResourceEditHandle(raw: unknown): ResourceEditViewHandle | undefined;
|