@opengeni/contracts 1.0.1 → 2.3.0-canary.0
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/agent-authored-durable-text.d.ts +64 -0
- package/dist/atlassian.d.ts +1 -0
- package/dist/atlassian.js +14 -13
- package/dist/{chunk-Y3MLSLB4.js → chunk-3SIZGL3O.js} +42 -30
- package/dist/chunk-3SIZGL3O.js.map +1 -0
- package/dist/{chunk-JBCIY7QD.js → chunk-7RMTKFJW.js} +45 -22
- package/dist/chunk-7RMTKFJW.js.map +1 -0
- package/dist/{chunk-5UDNP7AO.js → chunk-MRWYRAS5.js} +56 -8
- package/dist/chunk-MRWYRAS5.js.map +1 -0
- package/dist/{chunk-LW7OH6CS.js → chunk-N6GRVXAJ.js} +6 -5
- package/dist/chunk-N6GRVXAJ.js.map +1 -0
- package/dist/{chunk-TZ6YEYN4.js → chunk-NVJMJWLL.js} +3 -1
- package/dist/chunk-NVJMJWLL.js.map +1 -0
- package/dist/chunk-PX3VCKAU.js +29 -0
- package/dist/chunk-PX3VCKAU.js.map +1 -0
- package/dist/{chunk-LSB7GRLG.js → chunk-TXTQIYCV.js} +15 -11
- package/dist/chunk-TXTQIYCV.js.map +1 -0
- package/dist/{chunk-NX5JNF4L.js → chunk-XW2RKNEU.js} +9410 -5799
- package/dist/chunk-XW2RKNEU.js.map +1 -0
- package/dist/{chunk-CADSX6UN.js → chunk-Y3KNXVTD.js} +2 -2
- package/dist/chunk-YBW5JSA3.js +251 -0
- package/dist/chunk-YBW5JSA3.js.map +1 -0
- package/dist/company-brain-governed-writes.d.ts +475 -0
- package/dist/company-brain.d.ts +398 -0
- package/dist/company-profile.d.ts +268 -0
- package/dist/connection-authority.d.ts +501 -0
- package/dist/connection-authority.js +364 -0
- package/dist/connection-authority.js.map +1 -0
- package/dist/connector-attachments.d.ts +95 -0
- package/dist/connector-attachments.js +51 -0
- package/dist/connector-attachments.js.map +1 -0
- package/dist/editable-artifact-codec-registry.d.ts +16 -7
- package/dist/editable-artifact-codec-registry.js +18 -8
- package/dist/editable-artifact-committed-transaction.d.ts +2 -2
- package/dist/editable-artifact-committed-transaction.js +2 -2
- package/dist/editable-artifact-live.d.ts +11 -12
- package/dist/editable-artifact-live.js +111 -46
- package/dist/editable-artifact-live.js.map +1 -1
- package/dist/editable-artifact-serialized-commit.d.ts +2 -1
- package/dist/editable-artifact-serialized-commit.js +9 -8
- package/dist/editable-artifact-versions.d.ts +20 -5
- package/dist/editable-artifact-versions.js +23 -5
- package/dist/editable-artifacts.d.ts +2 -0
- package/dist/editable-artifacts.js +51 -39
- package/dist/google-drive.d.ts +1 -0
- package/dist/google-drive.js +14 -13
- package/dist/google-drive.js.map +1 -1
- package/dist/governed-learning-activation.d.ts +154 -0
- package/dist/governed-learning-evaluator.d.ts +152 -0
- package/dist/index.d.ts +12426 -1313
- package/dist/index.js +855 -115
- package/dist/interaction.d.ts +68 -0
- package/dist/knowledge.d.ts +119 -0
- package/dist/organization-membership-lifecycle.d.ts +516 -0
- package/dist/permissions.d.ts +52 -0
- package/dist/personal-github.d.ts +319 -0
- package/dist/personal-github.js +209 -0
- package/dist/personal-github.js.map +1 -0
- package/dist/preference-registry.d.ts +17 -0
- package/dist/remember.d.ts +331 -0
- package/dist/sandbox-file-artifacts.d.ts +56 -0
- package/dist/sandbox-snapshots.d.ts +21 -0
- package/dist/slack-bot-scopes.d.ts +34 -14
- package/dist/slack-bot-scopes.js +5 -1
- package/dist/spreadsheet-artifact-commands.d.ts +2 -3
- package/dist/spreadsheet-artifact-commands.js +4 -2
- package/dist/spreadsheet-artifact-query.js +3 -2
- package/dist/task-notes.d.ts +42 -1
- package/dist/tool-result-spill.d.ts +16 -0
- package/dist/workspace-instruction-policies.d.ts +81 -0
- package/dist/workspace-learning-administration.d.ts +289 -0
- package/package.json +13 -1
- package/src/agent-authored-durable-text.ts +105 -0
- package/src/company-brain-governed-writes.ts +356 -0
- package/src/company-brain.ts +201 -0
- package/src/company-profile.ts +122 -1
- package/src/connection-authority.ts +413 -0
- package/src/connector-attachments.ts +327 -0
- package/src/editable-artifact-codec-registry.ts +55 -17
- package/src/editable-artifact-committed-transaction.ts +44 -31
- package/src/editable-artifact-live.ts +123 -57
- package/src/editable-artifact-serialized-commit.ts +2 -1
- package/src/editable-artifact-versions.ts +26 -5
- package/src/editable-artifacts.ts +2 -0
- package/src/governed-learning-activation.ts +191 -0
- package/src/governed-learning-evaluator.ts +176 -0
- package/src/index.ts +3148 -369
- package/src/interaction.ts +55 -1
- package/src/knowledge.ts +118 -6
- package/src/organization-membership-lifecycle.ts +330 -0
- package/src/permissions.ts +55 -0
- package/src/personal-github.ts +267 -0
- package/src/preference-registry.ts +17 -0
- package/src/remember.ts +242 -0
- package/src/sandbox-file-artifacts.ts +65 -0
- package/src/sandbox-snapshots.ts +78 -0
- package/src/slack-bot-scopes.ts +81 -9
- package/src/spreadsheet-artifact-commands.ts +12 -13
- package/src/task-notes.ts +14 -1
- package/src/tool-result-spill.ts +35 -0
- package/src/workspace-instruction-policies.ts +30 -0
- package/src/workspace-learning-administration.ts +88 -0
- package/dist/chunk-5UDNP7AO.js.map +0 -1
- package/dist/chunk-BVGIYW7D.js +0 -11
- package/dist/chunk-BVGIYW7D.js.map +0 -1
- package/dist/chunk-JBCIY7QD.js.map +0 -1
- package/dist/chunk-LSB7GRLG.js.map +0 -1
- package/dist/chunk-LW7OH6CS.js.map +0 -1
- package/dist/chunk-NX5JNF4L.js.map +0 -1
- package/dist/chunk-TZ6YEYN4.js.map +0 -1
- package/dist/chunk-Y3MLSLB4.js.map +0 -1
- /package/dist/{chunk-CADSX6UN.js.map → chunk-Y3KNXVTD.js.map} +0 -0
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
MAX_COMMITTED_TRANSACTION_CELLS,
|
|
5
5
|
MAX_COMMITTED_TRANSACTION_OPERATIONS,
|
|
6
6
|
decodeCommittedTransactionSummary
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3SIZGL3O.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMITTED_TRANSACTION_PROTOCOL_VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PX3VCKAU.js";
|
|
11
11
|
export {
|
|
12
12
|
COMMITTED_TRANSACTION_PROTOCOL_VERSION,
|
|
13
13
|
MAX_COMMITTED_TRANSACTION_BYTES,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type EditableArtifactCausalEntry } from "./editable-artifacts.js";
|
|
2
|
-
export
|
|
2
|
+
export { EDITABLE_ARTIFACT_LIVE_WIRE_VERSION } from "./editable-artifact-versions.js";
|
|
3
3
|
export type EditableArtifactId = string;
|
|
4
4
|
export type EditableArtifactRequestHash = string;
|
|
5
5
|
export type EditableArtifactStateHash = string;
|
|
@@ -31,8 +31,7 @@ type EditableArtifactLiveResumeCommon = Readonly<{
|
|
|
31
31
|
requireSnapshot: boolean;
|
|
32
32
|
}>;
|
|
33
33
|
export type EditableArtifactLiveResume = (EditableArtifactLiveResumeCommon & Readonly<{
|
|
34
|
-
|
|
35
|
-
modality?: "spreadsheet";
|
|
34
|
+
modality: "spreadsheet";
|
|
36
35
|
localCausalFrontier: EditableArtifactCausalFrontier;
|
|
37
36
|
}>) | (EditableArtifactLiveResumeCommon & Readonly<{
|
|
38
37
|
modality: "document" | "presentation";
|
|
@@ -56,9 +55,10 @@ type EditableArtifactLiveSnapshotCommon = Readonly<{
|
|
|
56
55
|
bytes: Uint8Array;
|
|
57
56
|
}>;
|
|
58
57
|
export type EditableArtifactLiveSnapshot = (EditableArtifactLiveSnapshotCommon & Readonly<{
|
|
59
|
-
modality
|
|
58
|
+
modality: "spreadsheet";
|
|
60
59
|
causalFrontier: EditableArtifactCausalFrontier;
|
|
61
|
-
|
|
60
|
+
operationProtocolVersion: number;
|
|
61
|
+
snapshotVersion: number;
|
|
62
62
|
}>) | (EditableArtifactLiveSnapshotCommon & Readonly<{
|
|
63
63
|
modality: "document" | "presentation";
|
|
64
64
|
nativeRevision: number;
|
|
@@ -74,9 +74,9 @@ type EditableArtifactLiveCommittedTransactionCommon = Readonly<{
|
|
|
74
74
|
committedTransactionBytes: Uint8Array;
|
|
75
75
|
}>;
|
|
76
76
|
export type EditableArtifactLiveCommittedTransaction = (EditableArtifactLiveCommittedTransactionCommon & Readonly<{
|
|
77
|
-
modality
|
|
77
|
+
modality: "spreadsheet";
|
|
78
78
|
causalFrontier: EditableArtifactCausalFrontier;
|
|
79
|
-
|
|
79
|
+
operationProtocolVersion: number;
|
|
80
80
|
/** Exact canonical whole OGACO transaction envelope. */
|
|
81
81
|
committedTransactionBytes: Uint8Array;
|
|
82
82
|
}>) | (EditableArtifactLiveCommittedTransactionCommon & Readonly<{
|
|
@@ -138,8 +138,7 @@ export type EditableArtifactLiveServerFrame = Readonly<{
|
|
|
138
138
|
protocolVersion: number;
|
|
139
139
|
artifactId: EditableArtifactId;
|
|
140
140
|
streamEpoch: string;
|
|
141
|
-
|
|
142
|
-
modality?: EditableArtifactLiveModality;
|
|
141
|
+
modality: EditableArtifactLiveModality;
|
|
143
142
|
writable: boolean;
|
|
144
143
|
headSequence: number;
|
|
145
144
|
minimumReplaySequence: number;
|
|
@@ -165,9 +164,10 @@ export type EditableArtifactLiveServerFrame = Readonly<{
|
|
|
165
164
|
final: boolean;
|
|
166
165
|
bytes: Uint8Array;
|
|
167
166
|
}> & (Readonly<{
|
|
168
|
-
|
|
169
|
-
modality?: "spreadsheet";
|
|
167
|
+
modality: "spreadsheet";
|
|
170
168
|
causalFrontier: EditableArtifactCausalFrontier;
|
|
169
|
+
operationProtocolVersion: number;
|
|
170
|
+
snapshotVersion: number;
|
|
171
171
|
}> | Readonly<{
|
|
172
172
|
modality: "document" | "presentation";
|
|
173
173
|
nativeRevision: number;
|
|
@@ -273,4 +273,3 @@ export declare function inspectEditableArtifactLiveWireEnvelope(bytes: Uint8Arra
|
|
|
273
273
|
metadata: Readonly<Record<string, unknown>>;
|
|
274
274
|
payload: Uint8Array;
|
|
275
275
|
}>;
|
|
276
|
-
export {};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EDITABLE_ARTIFACT_INTENT_MAX_BYTES,
|
|
3
3
|
hashEditableArtifactMutationIntentBytes
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-NVJMJWLL.js";
|
|
5
|
+
import "./chunk-7RMTKFJW.js";
|
|
6
|
+
import "./chunk-Y3KNXVTD.js";
|
|
7
7
|
import "./chunk-RIY7GYQS.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-YRKRZ6OF.js";
|
|
9
9
|
import "./chunk-D2HKF2EF.js";
|
|
10
10
|
import "./chunk-MYBZRDTY.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import
|
|
11
|
+
import "./chunk-TXTQIYCV.js";
|
|
12
|
+
import {
|
|
13
|
+
EDITABLE_ARTIFACT_LIVE_WIRE_VERSION
|
|
14
|
+
} from "./chunk-PX3VCKAU.js";
|
|
13
15
|
|
|
14
16
|
// src/editable-artifact-live.ts
|
|
15
|
-
var MAGIC = new TextEncoder().encode("
|
|
17
|
+
var MAGIC = new TextEncoder().encode("OGALV002");
|
|
16
18
|
var HEADER_BYTES = 20;
|
|
17
19
|
var MAX_METADATA_BYTES = 64 * 1024;
|
|
18
20
|
var MAX_TOKEN_BYTES = 4096;
|
|
@@ -47,7 +49,6 @@ var MUTATION_REJECTION_CODES = /* @__PURE__ */ new Set([
|
|
|
47
49
|
"unsupported",
|
|
48
50
|
"unavailable"
|
|
49
51
|
]);
|
|
50
|
-
var EDITABLE_ARTIFACT_LIVE_WIRE_VERSION = 1;
|
|
51
52
|
var EditableArtifactLiveError = class extends Error {
|
|
52
53
|
constructor(code, message, options = {}) {
|
|
53
54
|
super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
|
|
@@ -101,6 +102,7 @@ function encodeEditableArtifactLiveOpenWireFrame(frame) {
|
|
|
101
102
|
protocolVersion,
|
|
102
103
|
artifactId,
|
|
103
104
|
token,
|
|
105
|
+
modality: resume.modality,
|
|
104
106
|
localCursor: resume.localCursor,
|
|
105
107
|
localStateHash: resume.localStateHash,
|
|
106
108
|
localCausalFrontier: resume.localCausalFrontier,
|
|
@@ -144,26 +146,22 @@ function encodeEditableArtifactLiveMutationWireFrame(frame) {
|
|
|
144
146
|
function encodeEditableArtifactLiveServerWireFrame(frame) {
|
|
145
147
|
switch (frame.type) {
|
|
146
148
|
case "open": {
|
|
147
|
-
const { modality, ...metadata } = frame;
|
|
148
149
|
return encodeEnvelope(
|
|
149
150
|
SERVER_OPEN,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
maxInFlightTransactions: metadata.maxInFlightTransactions,
|
|
165
|
-
maxInFlightBytes: metadata.maxInFlightBytes
|
|
166
|
-
} : metadata,
|
|
151
|
+
{
|
|
152
|
+
...serverFrameIdentity(frame),
|
|
153
|
+
modality: frame.modality,
|
|
154
|
+
writable: frame.writable,
|
|
155
|
+
headSequence: frame.headSequence,
|
|
156
|
+
minimumReplaySequence: frame.minimumReplaySequence,
|
|
157
|
+
maxClientFrameBytes: frame.maxClientFrameBytes,
|
|
158
|
+
maxCommandBytes: frame.maxCommandBytes,
|
|
159
|
+
maxIntentBytes: frame.maxIntentBytes,
|
|
160
|
+
maxCommittedTransactionBytes: frame.maxCommittedTransactionBytes,
|
|
161
|
+
maxSnapshotBytes: frame.maxSnapshotBytes,
|
|
162
|
+
maxInFlightTransactions: frame.maxInFlightTransactions,
|
|
163
|
+
maxInFlightBytes: frame.maxInFlightBytes
|
|
164
|
+
},
|
|
167
165
|
EMPTY_BYTES
|
|
168
166
|
);
|
|
169
167
|
}
|
|
@@ -197,9 +195,12 @@ function encodeEditableArtifactLiveServerWireFrame(frame) {
|
|
|
197
195
|
protocolVersion: metadata.protocolVersion,
|
|
198
196
|
artifactId: metadata.artifactId,
|
|
199
197
|
streamEpoch: metadata.streamEpoch,
|
|
198
|
+
modality,
|
|
200
199
|
sequence: metadata.sequence,
|
|
201
200
|
stateHash: metadata.stateHash,
|
|
202
201
|
causalFrontier: metadata.causalFrontier,
|
|
202
|
+
operationProtocolVersion: metadata.operationProtocolVersion,
|
|
203
|
+
snapshotVersion: metadata.snapshotVersion,
|
|
203
204
|
digest: metadata.digest,
|
|
204
205
|
kernelVersion: metadata.kernelVersion,
|
|
205
206
|
modelSchemaVersion: metadata.modelSchemaVersion,
|
|
@@ -213,8 +214,9 @@ function encodeEditableArtifactLiveServerWireFrame(frame) {
|
|
|
213
214
|
case "transaction": {
|
|
214
215
|
const { committedTransactionBytes, ...transaction } = frame.transaction;
|
|
215
216
|
const serializedTransaction = transaction;
|
|
216
|
-
const transactionMetadata = transaction.modality ===
|
|
217
|
+
const transactionMetadata = transaction.modality === "spreadsheet" ? {
|
|
217
218
|
artifactId: transaction.artifactId,
|
|
219
|
+
modality: transaction.modality,
|
|
218
220
|
transactionId: transaction.transactionId,
|
|
219
221
|
requestHash: transaction.requestHash,
|
|
220
222
|
startSequence: transaction.startSequence,
|
|
@@ -222,7 +224,7 @@ function encodeEditableArtifactLiveServerWireFrame(frame) {
|
|
|
222
224
|
priorStateHash: transaction.priorStateHash,
|
|
223
225
|
stateHash: transaction.stateHash,
|
|
224
226
|
causalFrontier: transaction.causalFrontier,
|
|
225
|
-
|
|
227
|
+
operationProtocolVersion: transaction.operationProtocolVersion
|
|
226
228
|
} : {
|
|
227
229
|
artifactId: serializedTransaction.artifactId,
|
|
228
230
|
modality: serializedTransaction.modality,
|
|
@@ -238,26 +240,75 @@ function encodeEditableArtifactLiveServerWireFrame(frame) {
|
|
|
238
240
|
};
|
|
239
241
|
return encodeEnvelope(
|
|
240
242
|
SERVER_TRANSACTION,
|
|
241
|
-
{ ...frame, transaction: transactionMetadata },
|
|
243
|
+
{ ...serverFrameIdentity(frame), transaction: transactionMetadata },
|
|
242
244
|
committedTransactionBytes
|
|
243
245
|
);
|
|
244
246
|
}
|
|
245
247
|
case "barrier":
|
|
246
|
-
return encodeEnvelope(
|
|
248
|
+
return encodeEnvelope(
|
|
249
|
+
SERVER_BARRIER,
|
|
250
|
+
{ ...serverFrameIdentity(frame), sequence: frame.sequence, stateHash: frame.stateHash },
|
|
251
|
+
EMPTY_BYTES
|
|
252
|
+
);
|
|
247
253
|
case "watermark":
|
|
248
|
-
return encodeEnvelope(
|
|
254
|
+
return encodeEnvelope(
|
|
255
|
+
SERVER_WATERMARK,
|
|
256
|
+
{ ...serverFrameIdentity(frame), headSequence: frame.headSequence },
|
|
257
|
+
EMPTY_BYTES
|
|
258
|
+
);
|
|
249
259
|
case "resyncRequired":
|
|
250
|
-
return encodeEnvelope(
|
|
260
|
+
return encodeEnvelope(
|
|
261
|
+
SERVER_RESYNC_REQUIRED,
|
|
262
|
+
{ ...serverFrameIdentity(frame), reason: frame.reason, headSequence: frame.headSequence },
|
|
263
|
+
EMPTY_BYTES
|
|
264
|
+
);
|
|
251
265
|
case "applied":
|
|
252
|
-
return encodeEnvelope(
|
|
266
|
+
return encodeEnvelope(
|
|
267
|
+
SERVER_APPLIED,
|
|
268
|
+
{ ...serverFrameIdentity(frame), sequence: frame.sequence, stateHash: frame.stateHash },
|
|
269
|
+
EMPTY_BYTES
|
|
270
|
+
);
|
|
253
271
|
case "authorizationChanged":
|
|
254
|
-
return encodeEnvelope(
|
|
272
|
+
return encodeEnvelope(
|
|
273
|
+
SERVER_AUTHORIZATION_CHANGED,
|
|
274
|
+
{ ...serverFrameIdentity(frame), writable: frame.writable },
|
|
275
|
+
EMPTY_BYTES
|
|
276
|
+
);
|
|
255
277
|
case "mutationAccepted":
|
|
256
|
-
return encodeEnvelope(
|
|
278
|
+
return encodeEnvelope(
|
|
279
|
+
SERVER_MUTATION_ACCEPTED,
|
|
280
|
+
{
|
|
281
|
+
...serverFrameIdentity(frame),
|
|
282
|
+
requestHash: frame.requestHash,
|
|
283
|
+
clientTransactionId: frame.clientTransactionId,
|
|
284
|
+
transactionId: frame.transactionId,
|
|
285
|
+
startSequence: frame.startSequence,
|
|
286
|
+
endSequence: frame.endSequence,
|
|
287
|
+
stateHash: frame.stateHash
|
|
288
|
+
},
|
|
289
|
+
EMPTY_BYTES
|
|
290
|
+
);
|
|
257
291
|
case "mutationRejected":
|
|
258
|
-
return encodeEnvelope(
|
|
292
|
+
return encodeEnvelope(
|
|
293
|
+
SERVER_MUTATION_REJECTED,
|
|
294
|
+
{
|
|
295
|
+
...serverFrameIdentity(frame),
|
|
296
|
+
requestHash: frame.requestHash,
|
|
297
|
+
code: frame.code,
|
|
298
|
+
retryable: frame.retryable
|
|
299
|
+
},
|
|
300
|
+
EMPTY_BYTES
|
|
301
|
+
);
|
|
259
302
|
}
|
|
260
303
|
}
|
|
304
|
+
function serverFrameIdentity(frame) {
|
|
305
|
+
return {
|
|
306
|
+
type: frame.type,
|
|
307
|
+
protocolVersion: frame.protocolVersion,
|
|
308
|
+
artifactId: frame.artifactId,
|
|
309
|
+
streamEpoch: frame.streamEpoch
|
|
310
|
+
};
|
|
311
|
+
}
|
|
261
312
|
function decodeEditableArtifactLiveServerWireFrame(bytes) {
|
|
262
313
|
const decoded = decodeEnvelope(bytes);
|
|
263
314
|
const metadata = decoded.metadata;
|
|
@@ -266,7 +317,7 @@ function decodeEditableArtifactLiveServerWireFrame(bytes) {
|
|
|
266
317
|
requireNoPayload(decoded.payload);
|
|
267
318
|
const modality = serverModality(metadata);
|
|
268
319
|
requireServerKeys(metadata, "open", [
|
|
269
|
-
|
|
320
|
+
"modality",
|
|
270
321
|
"writable",
|
|
271
322
|
"headSequence",
|
|
272
323
|
"minimumReplaySequence",
|
|
@@ -300,15 +351,16 @@ function decodeEditableArtifactLiveServerWireFrame(bytes) {
|
|
|
300
351
|
),
|
|
301
352
|
maxInFlightBytes: positiveInteger(metadata.maxInFlightBytes, "maxInFlightBytes")
|
|
302
353
|
};
|
|
303
|
-
return Object.freeze(
|
|
354
|
+
return Object.freeze({ ...common, modality });
|
|
304
355
|
}
|
|
305
356
|
case SERVER_SNAPSHOT: {
|
|
306
357
|
const modality = serverModality(metadata);
|
|
307
358
|
requireServerKeys(metadata, "snapshot", [
|
|
308
|
-
|
|
359
|
+
"modality",
|
|
309
360
|
"sequence",
|
|
310
361
|
"stateHash",
|
|
311
362
|
modality === "spreadsheet" ? "causalFrontier" : "nativeRevision",
|
|
363
|
+
...modality === "spreadsheet" ? ["operationProtocolVersion", "snapshotVersion"] : [],
|
|
312
364
|
"digest",
|
|
313
365
|
"kernelVersion",
|
|
314
366
|
"modelSchemaVersion",
|
|
@@ -344,7 +396,13 @@ function decodeEditableArtifactLiveServerWireFrame(bytes) {
|
|
|
344
396
|
return Object.freeze(
|
|
345
397
|
modality === "spreadsheet" ? {
|
|
346
398
|
...common,
|
|
347
|
-
|
|
399
|
+
modality,
|
|
400
|
+
causalFrontier: requiredFrontier(metadata.causalFrontier),
|
|
401
|
+
operationProtocolVersion: positiveInteger(
|
|
402
|
+
metadata.operationProtocolVersion,
|
|
403
|
+
"operationProtocolVersion"
|
|
404
|
+
),
|
|
405
|
+
snapshotVersion: positiveInteger(metadata.snapshotVersion, "snapshotVersion")
|
|
348
406
|
} : {
|
|
349
407
|
...common,
|
|
350
408
|
modality,
|
|
@@ -360,6 +418,7 @@ function decodeEditableArtifactLiveServerWireFrame(bytes) {
|
|
|
360
418
|
transaction,
|
|
361
419
|
modality === "spreadsheet" ? [
|
|
362
420
|
"artifactId",
|
|
421
|
+
"modality",
|
|
363
422
|
"transactionId",
|
|
364
423
|
"requestHash",
|
|
365
424
|
"startSequence",
|
|
@@ -367,7 +426,7 @@ function decodeEditableArtifactLiveServerWireFrame(bytes) {
|
|
|
367
426
|
"priorStateHash",
|
|
368
427
|
"stateHash",
|
|
369
428
|
"causalFrontier",
|
|
370
|
-
"
|
|
429
|
+
"operationProtocolVersion"
|
|
371
430
|
] : [
|
|
372
431
|
"artifactId",
|
|
373
432
|
"modality",
|
|
@@ -413,8 +472,12 @@ function decodeEditableArtifactLiveServerWireFrame(bytes) {
|
|
|
413
472
|
transaction: Object.freeze(
|
|
414
473
|
modality === "spreadsheet" ? {
|
|
415
474
|
...common.transaction,
|
|
475
|
+
modality,
|
|
416
476
|
causalFrontier: requiredFrontier(transaction.causalFrontier),
|
|
417
|
-
|
|
477
|
+
operationProtocolVersion: positiveInteger(
|
|
478
|
+
transaction.operationProtocolVersion,
|
|
479
|
+
"operationProtocolVersion"
|
|
480
|
+
)
|
|
418
481
|
} : {
|
|
419
482
|
...common.transaction,
|
|
420
483
|
modality,
|
|
@@ -531,6 +594,7 @@ function decodeOpen(metadata, payload) {
|
|
|
531
594
|
"protocolVersion",
|
|
532
595
|
"artifactId",
|
|
533
596
|
"token",
|
|
597
|
+
"modality",
|
|
534
598
|
"localCursor",
|
|
535
599
|
"localStateHash",
|
|
536
600
|
"localCausalFrontier",
|
|
@@ -702,12 +766,13 @@ function normalizeResume(resume) {
|
|
|
702
766
|
if (localCursor === null !== (localStateHash === null)) {
|
|
703
767
|
throw invalidFrame("resume cursor and state hash must both be null or both be present");
|
|
704
768
|
}
|
|
705
|
-
const modality = resume.modality
|
|
769
|
+
const modality = editableArtifactLiveModality(resume.modality);
|
|
706
770
|
if (modality === "spreadsheet") {
|
|
707
771
|
if (!("localCausalFrontier" in resume)) {
|
|
708
772
|
throw invalidFrame("spreadsheet resume requires a causal frontier");
|
|
709
773
|
}
|
|
710
774
|
return Object.freeze({
|
|
775
|
+
modality,
|
|
711
776
|
localCursor,
|
|
712
777
|
localStateHash,
|
|
713
778
|
localCausalFrontier: requiredFrontier(resume.localCausalFrontier),
|
|
@@ -748,13 +813,13 @@ function editableArtifactLiveModality(value) {
|
|
|
748
813
|
return value;
|
|
749
814
|
}
|
|
750
815
|
function clientOpenModality(metadata) {
|
|
751
|
-
return
|
|
816
|
+
return editableArtifactLiveModality(metadata.modality);
|
|
752
817
|
}
|
|
753
818
|
function serverModality(metadata) {
|
|
754
|
-
return
|
|
819
|
+
return editableArtifactLiveModality(metadata.modality);
|
|
755
820
|
}
|
|
756
821
|
function transactionModality(transaction) {
|
|
757
|
-
return
|
|
822
|
+
return editableArtifactLiveModality(transaction.modality);
|
|
758
823
|
}
|
|
759
824
|
function requireExactKeys(record, expected) {
|
|
760
825
|
const keys = Object.keys(record);
|