@opengeni/contracts 1.0.1 → 2.2.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-NX5JNF4L.js → chunk-7ZZ3R27P.js} +9322 -5798
- package/dist/chunk-7ZZ3R27P.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-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 +12224 -1328
- package/dist/index.js +831 -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 +3033 -392
- 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
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
hashEditableArtifactMutationIntentBytes,
|
|
4
4
|
type EditableArtifactCausalEntry,
|
|
5
5
|
} from "./editable-artifacts";
|
|
6
|
+
import { EDITABLE_ARTIFACT_LIVE_WIRE_VERSION } from "./editable-artifact-versions";
|
|
6
7
|
|
|
7
|
-
const MAGIC = new TextEncoder().encode("
|
|
8
|
+
const MAGIC = new TextEncoder().encode("OGALV002");
|
|
8
9
|
const HEADER_BYTES = 20;
|
|
9
10
|
const MAX_METADATA_BYTES = 64 * 1024;
|
|
10
11
|
const MAX_TOKEN_BYTES = 4_096;
|
|
@@ -42,7 +43,7 @@ const MUTATION_REJECTION_CODES = new Set([
|
|
|
42
43
|
"unavailable",
|
|
43
44
|
]);
|
|
44
45
|
|
|
45
|
-
export
|
|
46
|
+
export { EDITABLE_ARTIFACT_LIVE_WIRE_VERSION } from "./editable-artifact-versions";
|
|
46
47
|
|
|
47
48
|
export type EditableArtifactId = string;
|
|
48
49
|
export type EditableArtifactRequestHash = string;
|
|
@@ -101,8 +102,7 @@ type EditableArtifactLiveResumeCommon = Readonly<{
|
|
|
101
102
|
export type EditableArtifactLiveResume =
|
|
102
103
|
| (EditableArtifactLiveResumeCommon &
|
|
103
104
|
Readonly<{
|
|
104
|
-
|
|
105
|
-
modality?: "spreadsheet";
|
|
105
|
+
modality: "spreadsheet";
|
|
106
106
|
localCausalFrontier: EditableArtifactCausalFrontier;
|
|
107
107
|
}>)
|
|
108
108
|
| (EditableArtifactLiveResumeCommon &
|
|
@@ -133,9 +133,10 @@ type EditableArtifactLiveSnapshotCommon = Readonly<{
|
|
|
133
133
|
export type EditableArtifactLiveSnapshot =
|
|
134
134
|
| (EditableArtifactLiveSnapshotCommon &
|
|
135
135
|
Readonly<{
|
|
136
|
-
modality
|
|
136
|
+
modality: "spreadsheet";
|
|
137
137
|
causalFrontier: EditableArtifactCausalFrontier;
|
|
138
|
-
|
|
138
|
+
operationProtocolVersion: number;
|
|
139
|
+
snapshotVersion: number;
|
|
139
140
|
}>)
|
|
140
141
|
| (EditableArtifactLiveSnapshotCommon &
|
|
141
142
|
Readonly<{
|
|
@@ -157,9 +158,9 @@ type EditableArtifactLiveCommittedTransactionCommon = Readonly<{
|
|
|
157
158
|
export type EditableArtifactLiveCommittedTransaction =
|
|
158
159
|
| (EditableArtifactLiveCommittedTransactionCommon &
|
|
159
160
|
Readonly<{
|
|
160
|
-
modality
|
|
161
|
+
modality: "spreadsheet";
|
|
161
162
|
causalFrontier: EditableArtifactCausalFrontier;
|
|
162
|
-
|
|
163
|
+
operationProtocolVersion: number;
|
|
163
164
|
/** Exact canonical whole OGACO transaction envelope. */
|
|
164
165
|
committedTransactionBytes: Uint8Array;
|
|
165
166
|
}>)
|
|
@@ -252,8 +253,7 @@ export type EditableArtifactLiveServerFrame =
|
|
|
252
253
|
protocolVersion: number;
|
|
253
254
|
artifactId: EditableArtifactId;
|
|
254
255
|
streamEpoch: string;
|
|
255
|
-
|
|
256
|
-
modality?: EditableArtifactLiveModality;
|
|
256
|
+
modality: EditableArtifactLiveModality;
|
|
257
257
|
writable: boolean;
|
|
258
258
|
headSequence: number;
|
|
259
259
|
minimumReplaySequence: number;
|
|
@@ -282,9 +282,10 @@ export type EditableArtifactLiveServerFrame =
|
|
|
282
282
|
}> &
|
|
283
283
|
(
|
|
284
284
|
| Readonly<{
|
|
285
|
-
|
|
286
|
-
modality?: "spreadsheet";
|
|
285
|
+
modality: "spreadsheet";
|
|
287
286
|
causalFrontier: EditableArtifactCausalFrontier;
|
|
287
|
+
operationProtocolVersion: number;
|
|
288
|
+
snapshotVersion: number;
|
|
288
289
|
}>
|
|
289
290
|
| Readonly<{
|
|
290
291
|
modality: "document" | "presentation";
|
|
@@ -439,6 +440,7 @@ export function encodeEditableArtifactLiveOpenWireFrame(
|
|
|
439
440
|
protocolVersion,
|
|
440
441
|
artifactId,
|
|
441
442
|
token,
|
|
443
|
+
modality: resume.modality,
|
|
442
444
|
localCursor: resume.localCursor,
|
|
443
445
|
localStateHash: resume.localStateHash,
|
|
444
446
|
localCausalFrontier: resume.localCausalFrontier,
|
|
@@ -491,28 +493,22 @@ export function encodeEditableArtifactLiveServerWireFrame(
|
|
|
491
493
|
): Uint8Array {
|
|
492
494
|
switch (frame.type) {
|
|
493
495
|
case "open": {
|
|
494
|
-
const { modality, ...metadata } = frame;
|
|
495
496
|
return encodeEnvelope(
|
|
496
497
|
SERVER_OPEN,
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
maxSnapshotBytes: metadata.maxSnapshotBytes,
|
|
512
|
-
maxInFlightTransactions: metadata.maxInFlightTransactions,
|
|
513
|
-
maxInFlightBytes: metadata.maxInFlightBytes,
|
|
514
|
-
}
|
|
515
|
-
: metadata,
|
|
498
|
+
{
|
|
499
|
+
...serverFrameIdentity(frame),
|
|
500
|
+
modality: frame.modality,
|
|
501
|
+
writable: frame.writable,
|
|
502
|
+
headSequence: frame.headSequence,
|
|
503
|
+
minimumReplaySequence: frame.minimumReplaySequence,
|
|
504
|
+
maxClientFrameBytes: frame.maxClientFrameBytes,
|
|
505
|
+
maxCommandBytes: frame.maxCommandBytes,
|
|
506
|
+
maxIntentBytes: frame.maxIntentBytes,
|
|
507
|
+
maxCommittedTransactionBytes: frame.maxCommittedTransactionBytes,
|
|
508
|
+
maxSnapshotBytes: frame.maxSnapshotBytes,
|
|
509
|
+
maxInFlightTransactions: frame.maxInFlightTransactions,
|
|
510
|
+
maxInFlightBytes: frame.maxInFlightBytes,
|
|
511
|
+
},
|
|
516
512
|
EMPTY_BYTES,
|
|
517
513
|
);
|
|
518
514
|
}
|
|
@@ -555,10 +551,14 @@ export function encodeEditableArtifactLiveServerWireFrame(
|
|
|
555
551
|
protocolVersion: metadata.protocolVersion,
|
|
556
552
|
artifactId: metadata.artifactId,
|
|
557
553
|
streamEpoch: metadata.streamEpoch,
|
|
554
|
+
modality,
|
|
558
555
|
sequence: metadata.sequence,
|
|
559
556
|
stateHash: metadata.stateHash,
|
|
560
557
|
causalFrontier: (metadata as { causalFrontier: EditableArtifactCausalFrontier })
|
|
561
558
|
.causalFrontier,
|
|
559
|
+
operationProtocolVersion: (metadata as { operationProtocolVersion: number })
|
|
560
|
+
.operationProtocolVersion,
|
|
561
|
+
snapshotVersion: (metadata as { snapshotVersion: number }).snapshotVersion,
|
|
562
562
|
digest: metadata.digest,
|
|
563
563
|
kernelVersion: metadata.kernelVersion,
|
|
564
564
|
modelSchemaVersion: metadata.modelSchemaVersion,
|
|
@@ -576,9 +576,10 @@ export function encodeEditableArtifactLiveServerWireFrame(
|
|
|
576
576
|
{ modality: "document" | "presentation" }
|
|
577
577
|
>;
|
|
578
578
|
const transactionMetadata =
|
|
579
|
-
transaction.modality ===
|
|
579
|
+
transaction.modality === "spreadsheet"
|
|
580
580
|
? {
|
|
581
581
|
artifactId: transaction.artifactId,
|
|
582
|
+
modality: transaction.modality,
|
|
582
583
|
transactionId: transaction.transactionId,
|
|
583
584
|
requestHash: transaction.requestHash,
|
|
584
585
|
startSequence: transaction.startSequence,
|
|
@@ -586,7 +587,7 @@ export function encodeEditableArtifactLiveServerWireFrame(
|
|
|
586
587
|
priorStateHash: transaction.priorStateHash,
|
|
587
588
|
stateHash: transaction.stateHash,
|
|
588
589
|
causalFrontier: transaction.causalFrontier,
|
|
589
|
-
|
|
590
|
+
operationProtocolVersion: transaction.operationProtocolVersion,
|
|
590
591
|
}
|
|
591
592
|
: {
|
|
592
593
|
artifactId: serializedTransaction.artifactId,
|
|
@@ -603,27 +604,82 @@ export function encodeEditableArtifactLiveServerWireFrame(
|
|
|
603
604
|
};
|
|
604
605
|
return encodeEnvelope(
|
|
605
606
|
SERVER_TRANSACTION,
|
|
606
|
-
{ ...frame, transaction: transactionMetadata },
|
|
607
|
+
{ ...serverFrameIdentity(frame), transaction: transactionMetadata },
|
|
607
608
|
committedTransactionBytes,
|
|
608
609
|
);
|
|
609
610
|
}
|
|
610
611
|
case "barrier":
|
|
611
|
-
return encodeEnvelope(
|
|
612
|
+
return encodeEnvelope(
|
|
613
|
+
SERVER_BARRIER,
|
|
614
|
+
{ ...serverFrameIdentity(frame), sequence: frame.sequence, stateHash: frame.stateHash },
|
|
615
|
+
EMPTY_BYTES,
|
|
616
|
+
);
|
|
612
617
|
case "watermark":
|
|
613
|
-
return encodeEnvelope(
|
|
618
|
+
return encodeEnvelope(
|
|
619
|
+
SERVER_WATERMARK,
|
|
620
|
+
{ ...serverFrameIdentity(frame), headSequence: frame.headSequence },
|
|
621
|
+
EMPTY_BYTES,
|
|
622
|
+
);
|
|
614
623
|
case "resyncRequired":
|
|
615
|
-
return encodeEnvelope(
|
|
624
|
+
return encodeEnvelope(
|
|
625
|
+
SERVER_RESYNC_REQUIRED,
|
|
626
|
+
{ ...serverFrameIdentity(frame), reason: frame.reason, headSequence: frame.headSequence },
|
|
627
|
+
EMPTY_BYTES,
|
|
628
|
+
);
|
|
616
629
|
case "applied":
|
|
617
|
-
return encodeEnvelope(
|
|
630
|
+
return encodeEnvelope(
|
|
631
|
+
SERVER_APPLIED,
|
|
632
|
+
{ ...serverFrameIdentity(frame), sequence: frame.sequence, stateHash: frame.stateHash },
|
|
633
|
+
EMPTY_BYTES,
|
|
634
|
+
);
|
|
618
635
|
case "authorizationChanged":
|
|
619
|
-
return encodeEnvelope(
|
|
636
|
+
return encodeEnvelope(
|
|
637
|
+
SERVER_AUTHORIZATION_CHANGED,
|
|
638
|
+
{ ...serverFrameIdentity(frame), writable: frame.writable },
|
|
639
|
+
EMPTY_BYTES,
|
|
640
|
+
);
|
|
620
641
|
case "mutationAccepted":
|
|
621
|
-
return encodeEnvelope(
|
|
642
|
+
return encodeEnvelope(
|
|
643
|
+
SERVER_MUTATION_ACCEPTED,
|
|
644
|
+
{
|
|
645
|
+
...serverFrameIdentity(frame),
|
|
646
|
+
requestHash: frame.requestHash,
|
|
647
|
+
clientTransactionId: frame.clientTransactionId,
|
|
648
|
+
transactionId: frame.transactionId,
|
|
649
|
+
startSequence: frame.startSequence,
|
|
650
|
+
endSequence: frame.endSequence,
|
|
651
|
+
stateHash: frame.stateHash,
|
|
652
|
+
},
|
|
653
|
+
EMPTY_BYTES,
|
|
654
|
+
);
|
|
622
655
|
case "mutationRejected":
|
|
623
|
-
return encodeEnvelope(
|
|
656
|
+
return encodeEnvelope(
|
|
657
|
+
SERVER_MUTATION_REJECTED,
|
|
658
|
+
{
|
|
659
|
+
...serverFrameIdentity(frame),
|
|
660
|
+
requestHash: frame.requestHash,
|
|
661
|
+
code: frame.code,
|
|
662
|
+
retryable: frame.retryable,
|
|
663
|
+
},
|
|
664
|
+
EMPTY_BYTES,
|
|
665
|
+
);
|
|
624
666
|
}
|
|
625
667
|
}
|
|
626
668
|
|
|
669
|
+
function serverFrameIdentity(frame: EditableArtifactLiveServerFrame): Readonly<{
|
|
670
|
+
type: EditableArtifactLiveServerFrame["type"];
|
|
671
|
+
protocolVersion: number;
|
|
672
|
+
artifactId: EditableArtifactId;
|
|
673
|
+
streamEpoch: string;
|
|
674
|
+
}> {
|
|
675
|
+
return {
|
|
676
|
+
type: frame.type,
|
|
677
|
+
protocolVersion: frame.protocolVersion,
|
|
678
|
+
artifactId: frame.artifactId,
|
|
679
|
+
streamEpoch: frame.streamEpoch,
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
|
|
627
683
|
/** Strict inverse used by browser/desktop SDK transports. */
|
|
628
684
|
export function decodeEditableArtifactLiveServerWireFrame(
|
|
629
685
|
bytes: Uint8Array,
|
|
@@ -635,7 +691,7 @@ export function decodeEditableArtifactLiveServerWireFrame(
|
|
|
635
691
|
requireNoPayload(decoded.payload);
|
|
636
692
|
const modality = serverModality(metadata);
|
|
637
693
|
requireServerKeys(metadata, "open", [
|
|
638
|
-
|
|
694
|
+
"modality",
|
|
639
695
|
"writable",
|
|
640
696
|
"headSequence",
|
|
641
697
|
"minimumReplaySequence",
|
|
@@ -669,15 +725,18 @@ export function decodeEditableArtifactLiveServerWireFrame(
|
|
|
669
725
|
),
|
|
670
726
|
maxInFlightBytes: positiveInteger(metadata.maxInFlightBytes, "maxInFlightBytes"),
|
|
671
727
|
} as const;
|
|
672
|
-
return Object.freeze(
|
|
728
|
+
return Object.freeze({ ...common, modality });
|
|
673
729
|
}
|
|
674
730
|
case SERVER_SNAPSHOT: {
|
|
675
731
|
const modality = serverModality(metadata);
|
|
676
732
|
requireServerKeys(metadata, "snapshot", [
|
|
677
|
-
|
|
733
|
+
"modality",
|
|
678
734
|
"sequence",
|
|
679
735
|
"stateHash",
|
|
680
736
|
modality === "spreadsheet" ? "causalFrontier" : "nativeRevision",
|
|
737
|
+
...(modality === "spreadsheet"
|
|
738
|
+
? (["operationProtocolVersion", "snapshotVersion"] as const)
|
|
739
|
+
: []),
|
|
681
740
|
"digest",
|
|
682
741
|
"kernelVersion",
|
|
683
742
|
"modelSchemaVersion",
|
|
@@ -714,7 +773,13 @@ export function decodeEditableArtifactLiveServerWireFrame(
|
|
|
714
773
|
modality === "spreadsheet"
|
|
715
774
|
? {
|
|
716
775
|
...common,
|
|
776
|
+
modality,
|
|
717
777
|
causalFrontier: requiredFrontier(metadata.causalFrontier),
|
|
778
|
+
operationProtocolVersion: positiveInteger(
|
|
779
|
+
metadata.operationProtocolVersion,
|
|
780
|
+
"operationProtocolVersion",
|
|
781
|
+
),
|
|
782
|
+
snapshotVersion: positiveInteger(metadata.snapshotVersion, "snapshotVersion"),
|
|
718
783
|
}
|
|
719
784
|
: {
|
|
720
785
|
...common,
|
|
@@ -732,6 +797,7 @@ export function decodeEditableArtifactLiveServerWireFrame(
|
|
|
732
797
|
modality === "spreadsheet"
|
|
733
798
|
? [
|
|
734
799
|
"artifactId",
|
|
800
|
+
"modality",
|
|
735
801
|
"transactionId",
|
|
736
802
|
"requestHash",
|
|
737
803
|
"startSequence",
|
|
@@ -739,7 +805,7 @@ export function decodeEditableArtifactLiveServerWireFrame(
|
|
|
739
805
|
"priorStateHash",
|
|
740
806
|
"stateHash",
|
|
741
807
|
"causalFrontier",
|
|
742
|
-
"
|
|
808
|
+
"operationProtocolVersion",
|
|
743
809
|
]
|
|
744
810
|
: [
|
|
745
811
|
"artifactId",
|
|
@@ -787,8 +853,12 @@ export function decodeEditableArtifactLiveServerWireFrame(
|
|
|
787
853
|
modality === "spreadsheet"
|
|
788
854
|
? {
|
|
789
855
|
...common.transaction,
|
|
856
|
+
modality,
|
|
790
857
|
causalFrontier: requiredFrontier(transaction.causalFrontier),
|
|
791
|
-
|
|
858
|
+
operationProtocolVersion: positiveInteger(
|
|
859
|
+
transaction.operationProtocolVersion,
|
|
860
|
+
"operationProtocolVersion",
|
|
861
|
+
),
|
|
792
862
|
}
|
|
793
863
|
: {
|
|
794
864
|
...common.transaction,
|
|
@@ -923,6 +993,7 @@ function decodeOpen(
|
|
|
923
993
|
"protocolVersion",
|
|
924
994
|
"artifactId",
|
|
925
995
|
"token",
|
|
996
|
+
"modality",
|
|
926
997
|
"localCursor",
|
|
927
998
|
"localStateHash",
|
|
928
999
|
"localCausalFrontier",
|
|
@@ -1125,12 +1196,13 @@ function normalizeResume(resume: EditableArtifactLiveResume): EditableArtifactLi
|
|
|
1125
1196
|
if ((localCursor === null) !== (localStateHash === null)) {
|
|
1126
1197
|
throw invalidFrame("resume cursor and state hash must both be null or both be present");
|
|
1127
1198
|
}
|
|
1128
|
-
const modality = resume.modality
|
|
1199
|
+
const modality = editableArtifactLiveModality(resume.modality);
|
|
1129
1200
|
if (modality === "spreadsheet") {
|
|
1130
1201
|
if (!("localCausalFrontier" in resume)) {
|
|
1131
1202
|
throw invalidFrame("spreadsheet resume requires a causal frontier");
|
|
1132
1203
|
}
|
|
1133
1204
|
return Object.freeze({
|
|
1205
|
+
modality,
|
|
1134
1206
|
localCursor,
|
|
1135
1207
|
localStateHash,
|
|
1136
1208
|
localCausalFrontier: requiredFrontier(resume.localCausalFrontier),
|
|
@@ -1176,23 +1248,17 @@ function editableArtifactLiveModality(value: unknown): EditableArtifactLiveModal
|
|
|
1176
1248
|
function clientOpenModality(
|
|
1177
1249
|
metadata: Readonly<Record<string, unknown>>,
|
|
1178
1250
|
): EditableArtifactLiveModality {
|
|
1179
|
-
return metadata.modality
|
|
1180
|
-
? "spreadsheet"
|
|
1181
|
-
: editableArtifactLiveModality(metadata.modality);
|
|
1251
|
+
return editableArtifactLiveModality(metadata.modality);
|
|
1182
1252
|
}
|
|
1183
1253
|
|
|
1184
1254
|
function serverModality(metadata: Readonly<Record<string, unknown>>): EditableArtifactLiveModality {
|
|
1185
|
-
return metadata.modality
|
|
1186
|
-
? "spreadsheet"
|
|
1187
|
-
: editableArtifactLiveModality(metadata.modality);
|
|
1255
|
+
return editableArtifactLiveModality(metadata.modality);
|
|
1188
1256
|
}
|
|
1189
1257
|
|
|
1190
1258
|
function transactionModality(
|
|
1191
1259
|
transaction: Readonly<Record<string, unknown>>,
|
|
1192
1260
|
): EditableArtifactLiveModality {
|
|
1193
|
-
return transaction.modality
|
|
1194
|
-
? "spreadsheet"
|
|
1195
|
-
: editableArtifactLiveModality(transaction.modality);
|
|
1261
|
+
return editableArtifactLiveModality(transaction.modality);
|
|
1196
1262
|
}
|
|
1197
1263
|
|
|
1198
1264
|
function requireExactKeys(
|
|
@@ -22,8 +22,9 @@ import {
|
|
|
22
22
|
type EditableArtifactMutationIntent,
|
|
23
23
|
} from "./editable-artifacts";
|
|
24
24
|
import { editableArtifactCodecFor } from "./editable-artifact-codec-registry";
|
|
25
|
+
import { EDITABLE_ARTIFACT_SERIALIZED_COMMIT_VERSION } from "./editable-artifact-versions";
|
|
25
26
|
|
|
26
|
-
export
|
|
27
|
+
export { EDITABLE_ARTIFACT_SERIALIZED_COMMIT_VERSION } from "./editable-artifact-versions";
|
|
27
28
|
export const EDITABLE_ARTIFACT_SERIALIZED_COMMIT_MAX_BYTES = 8 * 1024 * 1024;
|
|
28
29
|
export const EDITABLE_ARTIFACT_NATIVE_RECEIPT_MAX_BYTES = 512 * 1024;
|
|
29
30
|
|
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export const
|
|
1
|
+
/** Modality-specific durable semantic/schema versions. */
|
|
2
|
+
export const SPREADSHEET_ARTIFACT_MODEL_SCHEMA_VERSION = 2 as const;
|
|
3
|
+
export const DOCUMENT_ARTIFACT_MODEL_SCHEMA_VERSION = 1 as const;
|
|
4
|
+
export const PRESENTATION_ARTIFACT_MODEL_SCHEMA_VERSION = 1 as const;
|
|
3
5
|
|
|
4
|
-
/**
|
|
5
|
-
export const
|
|
6
|
+
/** Direct kernel workbook snapshot version (OGARTK02), never the durable CRDT snapshot. */
|
|
7
|
+
export const SPREADSHEET_KERNEL_SNAPSHOT_VERSION = 2 as const;
|
|
8
|
+
|
|
9
|
+
/** Modality-specific canonical snapshot versions. */
|
|
10
|
+
export const DOCUMENT_ARTIFACT_SNAPSHOT_VERSION = 1 as const;
|
|
11
|
+
export const PRESENTATION_ARTIFACT_SNAPSHOT_VERSION = 1 as const;
|
|
12
|
+
|
|
13
|
+
/** Canonical internal spreadsheet kernel command-envelope version. */
|
|
14
|
+
export const SPREADSHEET_KERNEL_COMMAND_VERSION = 2 as const;
|
|
15
|
+
|
|
16
|
+
/** Canonical public, identity-free spreadsheet command-envelope version. */
|
|
17
|
+
export const SPREADSHEET_ARTIFACT_COMMAND_VERSION = 2 as const;
|
|
18
|
+
|
|
19
|
+
/** Canonical durable spreadsheet collaboration-snapshot version. */
|
|
20
|
+
export const SPREADSHEET_COLLABORATION_SNAPSHOT_VERSION = 2 as const;
|
|
6
21
|
|
|
7
22
|
/** Canonical committed spreadsheet transaction protocol version. */
|
|
8
|
-
export const COMMITTED_TRANSACTION_PROTOCOL_VERSION =
|
|
23
|
+
export const COMMITTED_TRANSACTION_PROTOCOL_VERSION = 2 as const;
|
|
24
|
+
|
|
25
|
+
/** Canonical document/presentation serialized-commit protocol version. */
|
|
26
|
+
export const EDITABLE_ARTIFACT_SERIALIZED_COMMIT_VERSION = 1 as const;
|
|
27
|
+
|
|
28
|
+
/** Canonical editable-artifact live transport protocol version. */
|
|
29
|
+
export const EDITABLE_ARTIFACT_LIVE_WIRE_VERSION = 2 as const;
|
|
@@ -9,6 +9,8 @@ export * from "./presentation-artifact-commands";
|
|
|
9
9
|
export * from "./editable-artifact-codec-registry";
|
|
10
10
|
|
|
11
11
|
export const EDITABLE_ARTIFACT_INTENT_VERSION = 1 as const;
|
|
12
|
+
/** Semantic protocol carried inside the unchanged OGATX001 envelope. */
|
|
13
|
+
export const EDITABLE_ARTIFACT_INTENT_PROTOCOL_VERSION = 1 as const;
|
|
12
14
|
export const EDITABLE_ARTIFACT_INTENT_MAX_BYTES = 5 * 1024 * 1024;
|
|
13
15
|
export const EDITABLE_ARTIFACT_COMMAND_MAX_BYTES = 4 * 1024 * 1024;
|
|
14
16
|
export const EDITABLE_ARTIFACT_KERNEL_VERSION_MAX_BYTES = 512;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
const sha256 = z.string().regex(/^[0-9a-f]{64}$/);
|
|
4
|
+
const boundedActor = z.string().trim().min(1).max(1_024);
|
|
5
|
+
|
|
6
|
+
export const GovernedLearningActivationDestination = z.enum(["instruction_policy", "preference"]);
|
|
7
|
+
export const GovernedLearningActivationAuthorityKind = z.enum(["automatic", "human_confirmed"]);
|
|
8
|
+
export type GovernedLearningActivationAuthorityKind = z.infer<
|
|
9
|
+
typeof GovernedLearningActivationAuthorityKind
|
|
10
|
+
>;
|
|
11
|
+
export type GovernedLearningActivationDestination = z.infer<
|
|
12
|
+
typeof GovernedLearningActivationDestination
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
export const GovernedLearningActivationCaller = z
|
|
16
|
+
.object({
|
|
17
|
+
workspaceId: z.string().uuid(),
|
|
18
|
+
subjectId: boundedActor,
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
21
|
+
export type GovernedLearningActivationCaller = z.infer<typeof GovernedLearningActivationCaller>;
|
|
22
|
+
|
|
23
|
+
export const ActivateGovernedLearningDecisionRequest = z
|
|
24
|
+
.object({
|
|
25
|
+
operationId: z.string().uuid(),
|
|
26
|
+
decisionReceiptId: z.string().uuid(),
|
|
27
|
+
})
|
|
28
|
+
.strict();
|
|
29
|
+
export type ActivateGovernedLearningDecisionRequest = z.infer<
|
|
30
|
+
typeof ActivateGovernedLearningDecisionRequest
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export const UndoGovernedLearningActivationRequest = z
|
|
34
|
+
.object({
|
|
35
|
+
operationId: z.string().uuid(),
|
|
36
|
+
activationReceiptId: z.string().uuid(),
|
|
37
|
+
})
|
|
38
|
+
.strict();
|
|
39
|
+
export type UndoGovernedLearningActivationRequest = z.infer<
|
|
40
|
+
typeof UndoGovernedLearningActivationRequest
|
|
41
|
+
>;
|
|
42
|
+
|
|
43
|
+
const destinationBoundary = {
|
|
44
|
+
destination: GovernedLearningActivationDestination,
|
|
45
|
+
destinationProposalId: z.string().uuid(),
|
|
46
|
+
destinationRevisionId: z.string().uuid(),
|
|
47
|
+
destinationOldRevisionId: z.string().uuid().nullable(),
|
|
48
|
+
destinationOldContentHash: sha256.nullable(),
|
|
49
|
+
destinationOldVersion: z.number().int().nonnegative(),
|
|
50
|
+
destinationNewContentHash: sha256,
|
|
51
|
+
destinationNewVersion: z.number().int().positive(),
|
|
52
|
+
destinationEventId: z.string().uuid(),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Immutable content-free proof that one final automatic evaluator receipt was
|
|
57
|
+
* revalidated and applied through the destination-owned lifecycle.
|
|
58
|
+
*/
|
|
59
|
+
export const GovernedLearningActivationReceipt = z
|
|
60
|
+
.object({
|
|
61
|
+
id: z.string().uuid(),
|
|
62
|
+
operationId: z.string().uuid(),
|
|
63
|
+
inputHash: sha256,
|
|
64
|
+
accountId: z.string().uuid(),
|
|
65
|
+
workspaceId: z.string().uuid(),
|
|
66
|
+
decisionReceiptId: z.string().uuid(),
|
|
67
|
+
initiatingHumanSubjectId: boundedActor,
|
|
68
|
+
serviceActorSubjectId: boundedActor,
|
|
69
|
+
policyRevisionId: z.string().uuid(),
|
|
70
|
+
policyHash: sha256,
|
|
71
|
+
policyActivationVersion: z.number().int().positive(),
|
|
72
|
+
sourceKind: z.enum(["scoped-knowledge-evidence", "task-note"]),
|
|
73
|
+
sourceId: z.string().uuid(),
|
|
74
|
+
sourceAuthorityHash: sha256,
|
|
75
|
+
proposalId: z.string().uuid(),
|
|
76
|
+
claimId: z.string().uuid(),
|
|
77
|
+
evidenceId: z.string().uuid(),
|
|
78
|
+
knowledgePreviousReviewId: z.string().uuid(),
|
|
79
|
+
knowledgePreviousReviewRevision: z.number().int().positive(),
|
|
80
|
+
knowledgeApprovalReviewId: z.string().uuid(),
|
|
81
|
+
knowledgeApprovalReviewRevision: z.number().int().positive(),
|
|
82
|
+
knowledgeApprovalInputHash: sha256,
|
|
83
|
+
...destinationBoundary,
|
|
84
|
+
outcome: z.literal("activated"),
|
|
85
|
+
effectiveAt: z.string().datetime(),
|
|
86
|
+
/**
|
|
87
|
+
* `automatic`: a final eligible evaluator receipt under an automatic policy.
|
|
88
|
+
* `human_confirmed`: the exact initiating human answered the bound
|
|
89
|
+
* `remember:<proposalId>` structured human-input question with `save`.
|
|
90
|
+
*/
|
|
91
|
+
authorityKind: GovernedLearningActivationAuthorityKind,
|
|
92
|
+
humanInputRequestId: z.string().uuid().nullable(),
|
|
93
|
+
rollback: z
|
|
94
|
+
.object({
|
|
95
|
+
supported: z.literal(true),
|
|
96
|
+
mechanism: z.literal("exact_head_and_latest_review"),
|
|
97
|
+
})
|
|
98
|
+
.strict(),
|
|
99
|
+
createdAt: z.string().datetime(),
|
|
100
|
+
})
|
|
101
|
+
.strict();
|
|
102
|
+
export type GovernedLearningActivationReceipt = z.infer<typeof GovernedLearningActivationReceipt>;
|
|
103
|
+
|
|
104
|
+
export const ActivateHumanConfirmedLearningDecisionRequest = z
|
|
105
|
+
.object({
|
|
106
|
+
operationId: z.string().uuid(),
|
|
107
|
+
decisionReceiptId: z.string().uuid(),
|
|
108
|
+
humanInputRequestId: z.string().uuid(),
|
|
109
|
+
})
|
|
110
|
+
.strict();
|
|
111
|
+
export type ActivateHumanConfirmedLearningDecisionRequest = z.infer<
|
|
112
|
+
typeof ActivateHumanConfirmedLearningDecisionRequest
|
|
113
|
+
>;
|
|
114
|
+
|
|
115
|
+
/** Append-only compensation proof. Undo never deletes prior evidence. */
|
|
116
|
+
export const GovernedLearningActivationUndoReceipt = z
|
|
117
|
+
.object({
|
|
118
|
+
id: z.string().uuid(),
|
|
119
|
+
operationId: z.string().uuid(),
|
|
120
|
+
inputHash: sha256,
|
|
121
|
+
accountId: z.string().uuid(),
|
|
122
|
+
workspaceId: z.string().uuid(),
|
|
123
|
+
activationReceiptId: z.string().uuid(),
|
|
124
|
+
initiatingHumanSubjectId: boundedActor,
|
|
125
|
+
serviceActorSubjectId: boundedActor,
|
|
126
|
+
destination: GovernedLearningActivationDestination,
|
|
127
|
+
knowledgeApprovalReviewId: z.string().uuid(),
|
|
128
|
+
knowledgeRevocationReviewId: z.string().uuid(),
|
|
129
|
+
knowledgeRevocationReviewRevision: z.number().int().positive(),
|
|
130
|
+
knowledgeRevocationInputHash: sha256,
|
|
131
|
+
destinationActivatedRevisionId: z.string().uuid(),
|
|
132
|
+
destinationRestoredRevisionId: z.string().uuid().nullable(),
|
|
133
|
+
destinationActivatedContentHash: sha256,
|
|
134
|
+
destinationRestoredContentHash: sha256.nullable(),
|
|
135
|
+
destinationOldVersion: z.number().int().positive(),
|
|
136
|
+
destinationNewVersion: z.number().int().positive(),
|
|
137
|
+
destinationEventId: z.string().uuid(),
|
|
138
|
+
outcome: z.literal("undone"),
|
|
139
|
+
superseded: z.literal(false),
|
|
140
|
+
effectiveAt: z.string().datetime(),
|
|
141
|
+
createdAt: z.string().datetime(),
|
|
142
|
+
})
|
|
143
|
+
.strict();
|
|
144
|
+
export type GovernedLearningActivationUndoReceipt = z.infer<
|
|
145
|
+
typeof GovernedLearningActivationUndoReceipt
|
|
146
|
+
>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Immutable content-free proof that the exact initiating human confirmed a
|
|
150
|
+
* user-directed Knowledge claim (`remember` with lane `knowledge`) through the
|
|
151
|
+
* bound structured human-input question, after which the claim's latest
|
|
152
|
+
* `proposed` review was superseded by an `approved` service review.
|
|
153
|
+
*/
|
|
154
|
+
export const RememberKnowledgeConfirmationReceipt = z
|
|
155
|
+
.object({
|
|
156
|
+
id: z.string().uuid(),
|
|
157
|
+
operationId: z.string().uuid(),
|
|
158
|
+
inputHash: sha256,
|
|
159
|
+
accountId: z.string().uuid(),
|
|
160
|
+
workspaceId: z.string().uuid(),
|
|
161
|
+
sessionId: z.string().uuid(),
|
|
162
|
+
turnId: z.string().uuid(),
|
|
163
|
+
executionGeneration: z.number().int().positive(),
|
|
164
|
+
initiatingHumanSubjectId: boundedActor,
|
|
165
|
+
serviceActorSubjectId: boundedActor,
|
|
166
|
+
claimId: z.string().uuid(),
|
|
167
|
+
evidenceId: z.string().uuid(),
|
|
168
|
+
taskNoteId: z.string().uuid(),
|
|
169
|
+
taskNoteTextHash: sha256,
|
|
170
|
+
humanInputRequestId: z.string().uuid(),
|
|
171
|
+
previousReviewId: z.string().uuid(),
|
|
172
|
+
previousReviewRevision: z.number().int().positive(),
|
|
173
|
+
approvalReviewId: z.string().uuid(),
|
|
174
|
+
approvalReviewRevision: z.number().int().positive(),
|
|
175
|
+
createdAt: z.string().datetime(),
|
|
176
|
+
})
|
|
177
|
+
.strict();
|
|
178
|
+
export type RememberKnowledgeConfirmationReceipt = z.infer<
|
|
179
|
+
typeof RememberKnowledgeConfirmationReceipt
|
|
180
|
+
>;
|
|
181
|
+
|
|
182
|
+
export const ConfirmRememberKnowledgeClaimRequest = z
|
|
183
|
+
.object({
|
|
184
|
+
operationId: z.string().uuid(),
|
|
185
|
+
claimId: z.string().uuid(),
|
|
186
|
+
humanInputRequestId: z.string().uuid(),
|
|
187
|
+
})
|
|
188
|
+
.strict();
|
|
189
|
+
export type ConfirmRememberKnowledgeClaimRequest = z.infer<
|
|
190
|
+
typeof ConfirmRememberKnowledgeClaimRequest
|
|
191
|
+
>;
|