@peer-agent/protocol 0.1.0-rc.5 → 0.1.0-rc.51

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.
Files changed (130) hide show
  1. package/dist/acceptance-close-gate.d.ts +10 -1
  2. package/dist/acceptance-close-gate.js +12 -0
  3. package/dist/agent-supervision.d.ts +81 -0
  4. package/dist/agent-supervision.js +1 -0
  5. package/dist/attention.d.ts +44 -0
  6. package/dist/attention.js +1 -0
  7. package/dist/bot-access-policy.d.ts +29 -0
  8. package/dist/bot-access-policy.js +1 -0
  9. package/dist/bot-conversation-read.d.ts +67 -0
  10. package/dist/bot-conversation-read.js +9 -0
  11. package/dist/bot-direct-step.d.ts +11 -0
  12. package/dist/bot-direct-step.js +1 -0
  13. package/dist/bot-git.d.ts +55 -0
  14. package/dist/bot-git.js +1 -0
  15. package/dist/bot-model-selection.d.ts +13 -0
  16. package/dist/bot-model-selection.js +1 -0
  17. package/dist/browser-window.d.ts +48 -0
  18. package/dist/browser-window.js +23 -0
  19. package/dist/capability-admission.d.ts +20 -0
  20. package/dist/capability-admission.js +1 -0
  21. package/dist/compaction-history-selection.d.ts +15 -0
  22. package/dist/compaction-history-selection.js +30 -0
  23. package/dist/compaction.d.ts +5 -0
  24. package/dist/compaction.js +6 -0
  25. package/dist/context-accounting.d.ts +3 -0
  26. package/dist/conversation-execution.d.ts +68 -0
  27. package/dist/conversation-execution.js +222 -0
  28. package/dist/delegation-coordination.d.ts +81 -0
  29. package/dist/delegation-coordination.js +1 -0
  30. package/dist/delegation.d.ts +260 -7
  31. package/dist/delegation.js +97 -39
  32. package/dist/document-reference.d.ts +111 -0
  33. package/dist/document-reference.js +1 -0
  34. package/dist/evidence-inspection.d.ts +84 -0
  35. package/dist/evidence-inspection.js +1 -0
  36. package/dist/gemini-standard-pricing.json +105 -0
  37. package/dist/goal.d.ts +50 -2
  38. package/dist/group-chat.d.ts +87 -0
  39. package/dist/group-chat.js +1 -0
  40. package/dist/hook-observation.d.ts +2 -0
  41. package/dist/hook-observation.js +19 -0
  42. package/dist/index.d.ts +117 -25
  43. package/dist/index.js +41 -0
  44. package/dist/input-prediction.d.ts +86 -0
  45. package/dist/input-prediction.js +48 -0
  46. package/dist/intent-coordination.d.ts +201 -0
  47. package/dist/intent-coordination.js +1 -0
  48. package/dist/interactive-result.d.ts +363 -0
  49. package/dist/interactive-result.js +215 -0
  50. package/dist/interactive-verification.d.ts +41 -0
  51. package/dist/interactive-verification.js +65 -0
  52. package/dist/local-git.d.ts +44 -0
  53. package/dist/local-git.js +3 -0
  54. package/dist/local-image.d.ts +53 -0
  55. package/dist/local-image.js +5 -0
  56. package/dist/local-read.d.ts +9 -0
  57. package/dist/local-read.js +1 -0
  58. package/dist/memory.d.ts +117 -12
  59. package/dist/memory.js +12 -0
  60. package/dist/model-reasoning.d.ts +16 -0
  61. package/dist/model-reasoning.js +25 -0
  62. package/dist/model-routing.d.ts +39 -3
  63. package/dist/model-routing.js +31 -5
  64. package/dist/native-process.d.ts +21 -0
  65. package/dist/native-process.js +51 -0
  66. package/dist/parent-coordination.d.ts +104 -0
  67. package/dist/parent-coordination.js +2 -0
  68. package/dist/persistent-workspace.d.ts +519 -0
  69. package/dist/persistent-workspace.js +1 -0
  70. package/dist/project-agent-failure.d.ts +30 -0
  71. package/dist/project-agent-failure.js +44 -0
  72. package/dist/project-input-recovery.d.ts +83 -0
  73. package/dist/project-input-recovery.js +25 -0
  74. package/dist/project-matter.d.ts +359 -0
  75. package/dist/project-matter.js +1 -0
  76. package/dist/project-recovery.d.ts +43 -0
  77. package/dist/project-recovery.js +1 -0
  78. package/dist/project.d.ts +233 -0
  79. package/dist/project.js +134 -5
  80. package/dist/prompt-skill.d.ts +31 -0
  81. package/dist/prompt-skill.js +1 -0
  82. package/dist/quiet-reply.d.ts +9 -0
  83. package/dist/quiet-reply.js +43 -0
  84. package/dist/remote-access.d.ts +15 -0
  85. package/dist/remote-access.js +1 -1
  86. package/dist/reply-delivery.d.ts +28 -0
  87. package/dist/reply-delivery.js +1 -0
  88. package/dist/resource-edit-execution.d.ts +68 -0
  89. package/dist/resource-edit-execution.js +96 -0
  90. package/dist/resource-edit.d.ts +237 -0
  91. package/dist/resource-edit.js +134 -0
  92. package/dist/resource-feedback-transport.d.ts +26 -0
  93. package/dist/resource-feedback-transport.js +94 -0
  94. package/dist/resource-feedback.d.ts +110 -0
  95. package/dist/resource-feedback.js +168 -0
  96. package/dist/resource-file-replace.d.ts +36 -0
  97. package/dist/resource-file-replace.js +40 -0
  98. package/dist/resource-reference-hints.d.ts +3 -0
  99. package/dist/resource-reference-hints.js +58 -0
  100. package/dist/resource-window.d.ts +222 -0
  101. package/dist/resource-window.js +252 -0
  102. package/dist/routine.d.ts +82 -0
  103. package/dist/routine.js +1 -0
  104. package/dist/runtime-session-facts.d.ts +58 -0
  105. package/dist/runtime-session-facts.js +57 -0
  106. package/dist/session-control.d.ts +211 -0
  107. package/dist/session-control.js +48 -0
  108. package/dist/session-facts.d.ts +29 -0
  109. package/dist/session-facts.js +35 -0
  110. package/dist/skill-marketplace.d.ts +39 -4
  111. package/dist/spend-budget.d.ts +69 -0
  112. package/dist/spend-budget.js +1 -0
  113. package/dist/system-context.d.ts +7 -0
  114. package/dist/task-overview.d.ts +91 -0
  115. package/dist/task-overview.js +325 -17
  116. package/dist/tool-activity-preview.d.ts +4 -0
  117. package/dist/tool-activity-preview.js +72 -0
  118. package/dist/updater.d.ts +13 -3
  119. package/dist/usage-accounting.d.ts +42 -1
  120. package/dist/user-anchor.d.ts +17 -0
  121. package/dist/user-anchor.js +1 -0
  122. package/dist/work-coordination.d.ts +188 -0
  123. package/dist/work-coordination.js +1 -0
  124. package/dist/work-hook.d.ts +3 -0
  125. package/dist/work-hook.js +76 -0
  126. package/dist/working-plan.d.ts +18 -0
  127. package/dist/working-plan.js +1 -0
  128. package/dist/workspace.d.ts +35 -0
  129. package/dist/workspace.js +1 -0
  130. package/package.json +1 -1
@@ -0,0 +1,201 @@
1
+ /** ADR 117: model interpretations are continuity facts, never permissions or task acceptance. */
2
+ export type InputDispositionKind = 'discuss' | 'answer' | 'delegate' | 'augment' | 'revise' | 'withdraw';
3
+ export interface InputDisposition {
4
+ readonly inputId: string;
5
+ readonly kind: InputDispositionKind;
6
+ readonly reason: string;
7
+ }
8
+ export interface IntentRequirement {
9
+ readonly requirementId: string;
10
+ readonly text: string;
11
+ readonly sourceInputIds: readonly string[];
12
+ }
13
+ export interface IntentInterpretation {
14
+ readonly outcome: string;
15
+ readonly constraints: readonly string[];
16
+ readonly nonGoals: readonly string[];
17
+ readonly openQuestions: readonly string[];
18
+ readonly requirements: readonly IntentRequirement[];
19
+ }
20
+ export interface GoalCoverageItem {
21
+ readonly requirementId: string;
22
+ readonly status: 'remaining' | 'covered' | 'uncertain';
23
+ readonly explanation: string;
24
+ readonly sources: readonly {
25
+ readonly sessionId: string;
26
+ readonly sourceRevision: string;
27
+ readonly evidenceRefs: readonly string[];
28
+ }[];
29
+ }
30
+ export type WorkDisposition = {
31
+ readonly kind: 'continue';
32
+ readonly operationRefs: readonly string[];
33
+ } | {
34
+ readonly kind: 'wait';
35
+ readonly waitFor: readonly {
36
+ readonly kind: 'session' | 'human_request' | 'resource' | 'recovery';
37
+ readonly id: string;
38
+ readonly revision: string;
39
+ }[];
40
+ }
41
+ /** Host-reserved reply reference; local bindings resolve the actual canonical message or digest. */
42
+ | {
43
+ readonly kind: 'return';
44
+ readonly replyRef: string;
45
+ } | {
46
+ readonly kind: 'blocked_system';
47
+ readonly code: string;
48
+ readonly recoveryRef: string;
49
+ } | {
50
+ readonly kind: 'withdraw';
51
+ readonly controlRef: string;
52
+ };
53
+ export interface IntentAssessment {
54
+ readonly operationId: string;
55
+ readonly workId: string;
56
+ /** Semantic coordination revision, independent of budget writes and journal sequence. */
57
+ readonly expectedWorkRevision: number;
58
+ readonly expectedGoalRevision: number;
59
+ readonly sourceInputIds: readonly string[];
60
+ readonly sourceEventIds: readonly string[];
61
+ readonly sourceDecisionRef?: string;
62
+ readonly inputs: readonly InputDisposition[];
63
+ readonly interpretation?: IntentInterpretation;
64
+ readonly coverage: readonly GoalCoverageItem[];
65
+ readonly disposition: WorkDisposition;
66
+ readonly reason: string;
67
+ }
68
+ export interface IntentCoordination {
69
+ readonly schemaVersion: 1;
70
+ readonly revision: number;
71
+ readonly goalRevision: number;
72
+ readonly interpretation: IntentInterpretation;
73
+ readonly inputs: Readonly<Record<string, InputDisposition>>;
74
+ readonly coverage: readonly GoalCoverageItem[];
75
+ readonly decision: IntentAssessment;
76
+ readonly decisionTurnId?: string;
77
+ readonly lifecycle: 'active' | 'fulfilled' | 'cancelled';
78
+ readonly updatedAt: string;
79
+ readonly review?: {
80
+ readonly reviewRef: string;
81
+ readonly passed: boolean;
82
+ readonly goalRevision: number;
83
+ readonly intentRevision: number;
84
+ readonly coverageDigest: string;
85
+ readonly sources: readonly {
86
+ readonly sessionId: string;
87
+ readonly sourceRevision: string;
88
+ readonly observationRevision: string;
89
+ }[];
90
+ readonly evidenceRefs: readonly string[];
91
+ readonly at: string;
92
+ };
93
+ readonly closure?: {
94
+ readonly operationId: string;
95
+ readonly replyRef?: string;
96
+ readonly replyRefs?: readonly string[];
97
+ readonly intentReplyRef?: string;
98
+ readonly reviewRef?: string;
99
+ readonly at: string;
100
+ };
101
+ }
102
+ export interface IntentClosureRequest {
103
+ readonly operationId: string;
104
+ readonly workId: string;
105
+ readonly expectedWorkRevision: number;
106
+ readonly expectedGoalRevision: number;
107
+ readonly lifecycle: 'fulfilled' | 'cancelled';
108
+ }
109
+ export interface IntentDecisionReceipt {
110
+ readonly operationId: string;
111
+ readonly workId: string;
112
+ readonly workRevision: number;
113
+ readonly goalRevision: number;
114
+ readonly at: string;
115
+ readonly turnId?: string;
116
+ readonly continuation?: boolean;
117
+ }
118
+ export type IntentCoordinationRequest = {
119
+ readonly action: 'query';
120
+ readonly workId: string;
121
+ readonly expectedRevision?: number;
122
+ readonly expectedWorkRevision?: number;
123
+ readonly afterSessionId?: string;
124
+ readonly afterInputId?: string;
125
+ readonly inputId?: string;
126
+ readonly eventId?: string;
127
+ readonly payloadOffset?: number;
128
+ } | {
129
+ readonly action: 'assess';
130
+ readonly assessment: Omit<IntentAssessment, 'operationId'>;
131
+ };
132
+ /** Bounded host projection. Available actions are a snapshot, not grants. */
133
+ export interface CoordinationDecisionFrame {
134
+ readonly resourceWaits?: readonly import('./runtime-session-facts.ts').ResourceWaitFact[];
135
+ readonly resourceWaitError?: string;
136
+ readonly workId: string;
137
+ readonly workRevision: number;
138
+ readonly goalRevision: number;
139
+ readonly sourceInputIds: readonly string[];
140
+ readonly sourceEventIds: readonly string[];
141
+ readonly sourceDecisionRef?: string;
142
+ readonly intent: {
143
+ readonly lifecycle: IntentCoordination['lifecycle'];
144
+ readonly outcome: string;
145
+ readonly constraints: readonly string[];
146
+ readonly nonGoals: readonly string[];
147
+ readonly openQuestions: readonly string[];
148
+ readonly openQuestionCount: number;
149
+ readonly remainingRequirementCount: number;
150
+ readonly inputDispositions: readonly InputDisposition[];
151
+ readonly requirements: readonly (IntentRequirement & {
152
+ readonly status: GoalCoverageItem['status'];
153
+ })[];
154
+ readonly disposition: WorkDisposition['kind'];
155
+ readonly review?: {
156
+ readonly reviewRef: string;
157
+ readonly passed: boolean;
158
+ readonly current: boolean;
159
+ readonly goalRevision: number;
160
+ } | null;
161
+ } | null;
162
+ readonly sessions: readonly {
163
+ readonly sessionId: string;
164
+ readonly title: string;
165
+ readonly status: string;
166
+ readonly sourceRevision?: string;
167
+ readonly observationRevision?: string;
168
+ readonly humanGate: boolean;
169
+ }[];
170
+ readonly events: readonly {
171
+ readonly eventId: string;
172
+ readonly kind: string;
173
+ readonly sessionId?: string;
174
+ readonly payload: Readonly<Record<string, unknown>>;
175
+ }[];
176
+ readonly questions: readonly Readonly<Record<string, unknown>>[];
177
+ readonly operations: readonly Readonly<Record<string, unknown>>[];
178
+ readonly unknownEffects: readonly Readonly<Record<string, unknown>>[];
179
+ readonly controls: Readonly<Record<string, unknown>>;
180
+ readonly omitted: Readonly<Record<string, number | boolean>>;
181
+ readonly retrieval: {
182
+ readonly tool: 'coordinate_work';
183
+ readonly action: 'query';
184
+ readonly workId: string;
185
+ readonly expectedRevision: number;
186
+ readonly afterSessionId?: string;
187
+ };
188
+ readonly availableActions: readonly {
189
+ readonly action: string;
190
+ readonly allowed: boolean;
191
+ readonly reason?: string;
192
+ }[];
193
+ readonly truncated: boolean;
194
+ }
195
+ export interface ProgressObservation {
196
+ readonly kind: 'observed' | 'admitted' | 'advanced';
197
+ readonly fingerprint: string;
198
+ readonly failure: boolean;
199
+ /** Host-normalized facts; this record is neither Evidence nor an execution/permission receipt. */
200
+ readonly fact: Readonly<Record<string, unknown>>;
201
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,363 @@
1
+ import type { DataLevel } from './index.ts';
2
+ import type { SessionExecutionIdentity } from './session-control.ts';
3
+ /** Host-neutral content and presentation contracts. References never grant access. */
4
+ export type InteractiveJSON = null | boolean | number | string | readonly InteractiveJSON[] | {
5
+ readonly [key: string]: InteractiveJSON;
6
+ };
7
+ export interface InteractiveOwner {
8
+ readonly workspaceId: string;
9
+ readonly conversationId: string;
10
+ }
11
+ export interface InteractiveResultReference {
12
+ readonly owner: InteractiveOwner;
13
+ readonly resultId: string;
14
+ readonly contentVersion: string;
15
+ }
16
+ export interface InteractivePublicationCallReference {
17
+ readonly owner: InteractiveOwner;
18
+ readonly conversationId: string;
19
+ readonly toolCallId: string;
20
+ }
21
+ export type InteractivePublicationIntent = {
22
+ readonly kind: 'create';
23
+ } | {
24
+ readonly kind: 'revise';
25
+ readonly base: InteractiveResultReference;
26
+ };
27
+ export type AdmittedMaterialReference = {
28
+ readonly kind: 'tool-result';
29
+ readonly conversationId: string;
30
+ readonly toolCallId: string;
31
+ readonly expectedContentVersion: string;
32
+ } | {
33
+ readonly kind: 'user-material';
34
+ readonly messageId: string;
35
+ readonly attachmentId: string;
36
+ readonly expectedContentVersion: string;
37
+ } | {
38
+ readonly kind: 'model-data';
39
+ readonly value: InteractiveJSON;
40
+ };
41
+ export interface BoundedDataSelector {
42
+ readonly path?: readonly string[];
43
+ readonly fields?: readonly string[];
44
+ readonly start?: number;
45
+ readonly limit?: number;
46
+ }
47
+ export interface InteractiveInputBinding {
48
+ readonly bindingId: string;
49
+ readonly source: AdmittedMaterialReference;
50
+ readonly selector?: BoundedDataSelector;
51
+ }
52
+ export interface InteractiveMaterialNotice {
53
+ readonly source: Exclude<AdmittedMaterialReference, {
54
+ readonly kind: 'model-data';
55
+ }>;
56
+ readonly format: 'peer-tool-observation-1' | 'peer-user-upload-1';
57
+ readonly selectorRoots: readonly string[];
58
+ readonly dataLevel: DataLevel;
59
+ readonly truncated: boolean;
60
+ readonly redacted: boolean;
61
+ }
62
+ /** Host-only Provider observation, attached non-enumerably to its actual Tool Result. */
63
+ export interface CanonicalToolMaterialObservation {
64
+ readonly schemaVersion: 1;
65
+ readonly toolCallId: string;
66
+ readonly capabilityId: string;
67
+ readonly evidenceId: string;
68
+ readonly payload: InteractiveJSON;
69
+ }
70
+ export interface InteractiveResultDraft {
71
+ readonly publication: InteractivePublicationIntent;
72
+ readonly title: string;
73
+ readonly textFallback: string;
74
+ readonly program: string;
75
+ readonly inputs: readonly InteractiveInputBinding[];
76
+ }
77
+ export interface InteractiveMaterialProvenance {
78
+ readonly bindingId: string;
79
+ readonly source: Exclude<AdmittedMaterialReference, {
80
+ readonly kind: 'model-data';
81
+ }> | {
82
+ readonly kind: 'model-data';
83
+ readonly contentDigest: string;
84
+ };
85
+ readonly contentVersion: string;
86
+ readonly selectedDigest: string;
87
+ readonly selector?: BoundedDataSelector;
88
+ readonly observedAt: string;
89
+ readonly capturedAt: string;
90
+ readonly truncated: boolean;
91
+ readonly redacted: boolean;
92
+ readonly dataLevel: DataLevel;
93
+ readonly evidenceRefs: readonly string[];
94
+ }
95
+ export type InteractiveStateValue = string | number | boolean;
96
+ export interface InteractiveStateField {
97
+ readonly type: 'string' | 'number' | 'boolean';
98
+ readonly min?: number;
99
+ readonly max?: number;
100
+ readonly options?: readonly string[];
101
+ }
102
+ export type InteractiveStateSchema = Readonly<Record<string, InteractiveStateField>>;
103
+ export type InteractiveStateValues = Readonly<Record<string, InteractiveStateValue>>;
104
+ export interface InteractiveStateSnapshot {
105
+ readonly result: InteractiveResultReference;
106
+ readonly specHash: string;
107
+ readonly stateSchemaHash: string;
108
+ readonly stateRevision: number;
109
+ readonly values: InteractiveStateValues;
110
+ readonly inputDrafts: Readonly<Record<string, string>>;
111
+ readonly stateDigest: string;
112
+ readonly updatedAt: string;
113
+ readonly requestId: string;
114
+ }
115
+ export interface InteractiveElement {
116
+ readonly type: 'element';
117
+ readonly typeName: string;
118
+ readonly statementId?: string;
119
+ readonly stateTarget?: string;
120
+ readonly props: Readonly<Record<string, unknown>>;
121
+ }
122
+ export interface InteractiveContent {
123
+ readonly schemaVersion: 1;
124
+ readonly engine: string;
125
+ readonly libraryVersion: string;
126
+ readonly specHash: string;
127
+ readonly title: string;
128
+ readonly textFallback: string;
129
+ readonly program: string;
130
+ readonly bindings: Readonly<Record<string, InteractiveJSON>>;
131
+ readonly initialValues: InteractiveStateValues;
132
+ readonly stateSchema: InteractiveStateSchema;
133
+ readonly stateSchemaHash: string;
134
+ readonly numberPolicy: string;
135
+ readonly tree?: InteractiveElement;
136
+ }
137
+ export interface InteractivePublishedResult {
138
+ readonly reference: InteractiveResultReference;
139
+ readonly content: InteractiveContent;
140
+ readonly source: SessionExecutionIdentity & {
141
+ readonly conversationId: string;
142
+ readonly workId?: string;
143
+ readonly toolCallId: string;
144
+ };
145
+ readonly provenance: readonly InteractiveMaterialProvenance[];
146
+ readonly predecessor?: InteractiveResultReference;
147
+ readonly evidenceRef: string;
148
+ readonly artifactRef: string;
149
+ readonly dataLevel: InteractiveMaterialProvenance['dataLevel'];
150
+ readonly createdAt: string;
151
+ }
152
+ export interface InteractivePublicationPermissionScope {
153
+ readonly kind: 'interactive-result';
154
+ readonly capabilityId: typeof INTERACTIVE_PUBLISH_CAPABILITY;
155
+ readonly owner: InteractiveOwner;
156
+ readonly source: InteractivePublishedResult['source'];
157
+ readonly parameterDigest: string;
158
+ readonly dataLevel: DataLevel;
159
+ }
160
+ export interface InteractiveUserArtifact {
161
+ readonly kind: 'interactive';
162
+ readonly ref: string;
163
+ readonly label: string;
164
+ readonly reference: InteractiveResultReference;
165
+ readonly specHash: string;
166
+ }
167
+ export type InteractivePublicationStatus = 'not_committed' | 'index_pending' | 'published' | 'unknown';
168
+ export interface InteractiveInspectRequest {
169
+ readonly target: {
170
+ readonly kind: 'result';
171
+ readonly reference: InteractiveResultReference;
172
+ } | {
173
+ readonly kind: 'publication';
174
+ readonly reference: InteractivePublicationCallReference;
175
+ };
176
+ readonly view: 'metadata' | 'text' | 'program' | 'data' | 'evaluate';
177
+ readonly bindingId?: string;
178
+ readonly selector?: BoundedDataSelector;
179
+ /** Only an explicitly admitted, immutable user selection; never the latest mutable state. */
180
+ readonly followupId?: string;
181
+ readonly offset?: number;
182
+ readonly limit?: number;
183
+ }
184
+ export interface InteractiveViewHandle {
185
+ readonly viewId: string;
186
+ readonly windowId: string;
187
+ readonly generation: string;
188
+ }
189
+ export interface InteractiveWriter {
190
+ readonly viewId: string;
191
+ readonly generation: string;
192
+ readonly token: string;
193
+ }
194
+ export interface InteractiveFollowup {
195
+ readonly followupId: string;
196
+ readonly recipient: InteractiveOwner;
197
+ readonly result: InteractiveResultReference;
198
+ readonly specHash: string;
199
+ readonly stateRevision: number;
200
+ readonly stateDigest: string;
201
+ readonly selectionDigest: string;
202
+ readonly values: InteractiveStateValues;
203
+ readonly dataLevel: DataLevel;
204
+ readonly capturedAt: string;
205
+ readonly excerpt: string;
206
+ }
207
+ export type InteractiveResultSummary = {
208
+ readonly reference: InteractiveResultReference;
209
+ readonly title: string;
210
+ readonly textFallback: string;
211
+ readonly dataLevel: DataLevel;
212
+ } & ({
213
+ readonly availability?: 'available';
214
+ readonly specHash: string;
215
+ readonly libraryVersion: string;
216
+ } | {
217
+ readonly availability: 'cleaned';
218
+ readonly cleanedAt: string;
219
+ readonly truncated: boolean;
220
+ });
221
+ export type InteractiveResult<T extends object = Record<never, never>> = ({
222
+ readonly ok: true;
223
+ } & T) | {
224
+ readonly ok: false;
225
+ readonly code: string;
226
+ readonly summary?: InteractiveResultSummary;
227
+ };
228
+ export interface InteractiveSourceIssue {
229
+ readonly bindingId: string;
230
+ readonly status: 'attachment_removed' | 'source_changed' | 'source_unavailable';
231
+ }
232
+ export interface InteractiveOpenView {
233
+ readonly handle: InteractiveViewHandle;
234
+ readonly result: InteractivePublishedResult;
235
+ readonly state: InteractiveStateSnapshot;
236
+ readonly sourceIssues?: readonly InteractiveSourceIssue[];
237
+ }
238
+ export interface InteractiveVersionNavigation {
239
+ readonly reference: InteractiveResultReference;
240
+ readonly head: InteractiveResultReference;
241
+ readonly predecessor?: InteractiveResultReference;
242
+ }
243
+ export type InteractiveSaveResult = {
244
+ readonly ok: true;
245
+ readonly state: InteractiveStateSnapshot;
246
+ readonly writerCurrent?: boolean;
247
+ } | {
248
+ readonly ok: false;
249
+ readonly code: 'interactive_owner_replaced';
250
+ readonly saveStatus?: 'committed' | 'not_committed';
251
+ } | {
252
+ readonly ok: false;
253
+ readonly code: string;
254
+ readonly saveStatus?: 'not_committed';
255
+ };
256
+ export interface InteractiveResultsApi {
257
+ open(request: {
258
+ readonly reference: InteractiveResultReference;
259
+ readonly requestId: string;
260
+ }): Promise<InteractiveResult<InteractiveOpenView>>;
261
+ cancelOpen?(request: {
262
+ readonly requestId: string;
263
+ }): Promise<InteractiveResult>;
264
+ readState(request: {
265
+ readonly handle: InteractiveViewHandle;
266
+ }): Promise<InteractiveResult<{
267
+ readonly state: InteractiveStateSnapshot;
268
+ }>>;
269
+ readVersions?(request: {
270
+ readonly handle: InteractiveViewHandle;
271
+ }): Promise<InteractiveResult<{
272
+ readonly versions: InteractiveVersionNavigation;
273
+ }>>;
274
+ openVersion?(request: {
275
+ readonly handle: InteractiveViewHandle;
276
+ readonly relation: 'head' | 'predecessor';
277
+ readonly expectedReference: InteractiveResultReference;
278
+ }): Promise<InteractiveResult<{
279
+ readonly reference: InteractiveResultReference;
280
+ }>>;
281
+ acquire(request: {
282
+ readonly handle: InteractiveViewHandle;
283
+ readonly expectedRevision: number;
284
+ readonly takeover?: boolean;
285
+ }): Promise<InteractiveResult<{
286
+ readonly writer: InteractiveWriter;
287
+ }>>;
288
+ save(request: {
289
+ readonly handle: InteractiveViewHandle;
290
+ readonly writer: InteractiveWriter;
291
+ readonly expectedRevision: number;
292
+ readonly requestId: string;
293
+ readonly values: InteractiveStateValues;
294
+ readonly inputDrafts: Readonly<Record<string, string>>;
295
+ }): Promise<InteractiveSaveResult>;
296
+ release(request: {
297
+ readonly handle: InteractiveViewHandle;
298
+ readonly writer?: InteractiveWriter;
299
+ }): Promise<InteractiveResult>;
300
+ prepareFollowup(request: {
301
+ readonly handle: InteractiveViewHandle;
302
+ readonly stateRevision: number;
303
+ readonly stateDigest: string;
304
+ readonly fields: readonly string[];
305
+ readonly requestId: string;
306
+ }): Promise<InteractiveResult<{
307
+ readonly followup: InteractiveFollowup;
308
+ }>>;
309
+ prepareDraft?(request: {
310
+ readonly handle: InteractiveViewHandle;
311
+ readonly followupId: string;
312
+ }): Promise<InteractiveResult<{
313
+ readonly followupId: string;
314
+ }>>;
315
+ }
316
+ export declare const INTERACTIVE_PUBLISH_CAPABILITY = "local.interactive.publish";
317
+ export declare const INTERACTIVE_INSPECT_CAPABILITY = "local.interactive.inspect";
318
+ export declare const INTERACTIVE_PUBLISH_TOOL = "publish_interactive_result";
319
+ export declare const INTERACTIVE_INSPECT_TOOL = "inspect_interactive_result";
320
+ export declare const INTERACTIVE_RESULT_SCHEMA_VERSION = 1;
321
+ export declare const INTERACTIVE_RESULT_LIMITS: Readonly<{
322
+ programBytes: number;
323
+ fallbackBytes: number;
324
+ inputBytes: number;
325
+ bindings: 16;
326
+ astNodes: 1000;
327
+ astDepth: 24;
328
+ expandedNodes: 300;
329
+ expandedDepth: 12;
330
+ stateFields: 64;
331
+ stateBytes: number;
332
+ collectionItems: 500;
333
+ textChars: 8192;
334
+ tablePageRows: 100;
335
+ tablePageCells: 1000;
336
+ chartSeries: 6;
337
+ chartPoints: 500;
338
+ evaluationSteps: 40000;
339
+ workerTimeoutMs: 2000;
340
+ resultsPerBot: 256;
341
+ storeBytes: number;
342
+ manifestBytes: number;
343
+ contentRepairs: 2;
344
+ localActionSteps: 16;
345
+ }>;
346
+ export declare const interactiveBindingId: (v: unknown) => v is string;
347
+ export declare const interactiveToken: (v: unknown) => v is string;
348
+ export declare const interactiveDigest: (v: unknown) => v is string;
349
+ export declare function normalizeInteractiveMaterialNotice(raw: unknown): InteractiveMaterialNotice | undefined;
350
+ export declare function normalizeInteractiveOwner(raw: unknown): InteractiveOwner | undefined;
351
+ export declare function normalizeInteractiveReference(raw: unknown): InteractiveResultReference | undefined;
352
+ /** Syntax and budget only. The host must match the actual immutable freeze receipt. */
353
+ export declare function normalizeInteractiveFollowup(raw: unknown): InteractiveFollowup | undefined;
354
+ export declare function normalizeInteractiveViewHandle(raw: unknown): InteractiveViewHandle | undefined;
355
+ export declare function normalizeInteractiveWriter(raw: unknown): InteractiveWriter | undefined;
356
+ export declare function normalizeInteractivePublicationReference(raw: unknown): InteractivePublicationCallReference | undefined;
357
+ export declare function normalizeInteractiveSelector(raw: unknown): BoundedDataSelector | undefined;
358
+ export declare function normalizeInteractiveDraft(raw: unknown): InteractiveResultDraft | undefined;
359
+ export declare function normalizeInteractiveInspect(raw: unknown): InteractiveInspectRequest | undefined;
360
+ /** An opaque, version-pinned locator. Hosts must revalidate the canonical publication receipt. */
361
+ export declare function interactiveArtifactRef(ref: InteractiveResultReference): string;
362
+ export declare function parseInteractiveArtifactRef(raw: unknown): InteractiveResultReference | undefined;
363
+ export declare function normalizeInteractiveUserArtifact(raw: unknown): InteractiveUserArtifact | undefined;