@ibgib/space-gib 0.0.5 → 0.0.6
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/client/bootstrap.mjs +1 -1
- package/dist/client/chunk-734MMI4C.mjs +42 -0
- package/dist/client/chunk-734MMI4C.mjs.map +7 -0
- package/dist/client/{chunk-IRGFDQRD.mjs → chunk-SMOZ2D5E.mjs} +170 -41
- package/dist/client/chunk-SMOZ2D5E.mjs.map +7 -0
- package/dist/client/index.html +35 -14
- package/dist/client/index.mjs +1 -1
- package/dist/client/script.mjs +1 -1
- package/dist/client/style.css +29 -5
- package/dist/server/server.mjs +101 -25
- package/dist/server/server.mjs.map +3 -3
- package/package.json +4 -4
- package/src/client/AUTO-GENERATED-version.mts +1 -1
- package/src/client/components/identity-header/identity-header.css +40 -2
- package/src/client/components/identity-header/identity-header.html +3 -2
- package/src/client/components/identity-header/identity-header.mts +87 -26
- package/src/client/components/identity-manager/identity-manager.css +39 -0
- package/src/client/components/identity-manager/identity-manager.html +20 -0
- package/src/client/components/identity-manager/identity-manager.mts +59 -0
- package/src/client/components/keystone-creator/keystone-creator.mts +88 -12
- package/src/client/dev-tools/common.mts +505 -10
- package/src/client/dev-tools/phase-4-1.mts +19 -4
- package/src/client/dev-tools/phase-4-10.mts +77 -305
- package/src/client/dev-tools/phase-4-2.mts +46 -212
- package/src/client/dev-tools/phase-4-3.mts +57 -198
- package/src/client/dev-tools/phase-4-4.mts +57 -170
- package/src/client/dev-tools/phase-4-5.mts +48 -204
- package/src/client/dev-tools/phase-4-6.mts +37 -103
- package/src/client/dev-tools/phase-4-7.mts +44 -228
- package/src/client/dev-tools/phase-4-8.mts +33 -136
- package/src/client/dev-tools/phase-4-9.mts +33 -137
- package/src/client/dev-tools/phase-4.mts +30 -6
- package/src/client/dev-tools.mts +18 -0
- package/src/client/index.html +35 -14
- package/src/client/style.css +29 -5
- package/src/client/types.mts +4 -1
- package/dist/client/chunk-ANGVYAEK.mjs +0 -42
- package/dist/client/chunk-ANGVYAEK.mjs.map +0 -7
- package/dist/client/chunk-IRGFDQRD.mjs.map +0 -7
- package/dist/respec-gib.node.mjs +0 -5
package/dist/client/index.html
CHANGED
|
@@ -104,8 +104,29 @@
|
|
|
104
104
|
<section class="dev-panel" id="dev-panel" aria-label="Developer tools">
|
|
105
105
|
<h2 class="dev-panel-title">Dev Tools</h2>
|
|
106
106
|
|
|
107
|
+
<div class="dev-panel-select-container">
|
|
108
|
+
<label for="dev-tools-row-select" style="color: var(--clr-warn); font-size: 0.9rem; font-weight: 500;">Select Phase:</label>
|
|
109
|
+
<select id="dev-tools-row-select" class="dev-select">
|
|
110
|
+
<option value="all">Show All</option>
|
|
111
|
+
<option value="00">Row 00 (POC)</option>
|
|
112
|
+
<option value="1B">Row 1B (Phase 1B)</option>
|
|
113
|
+
<option value="2B">Row 2B (Phase 2B)</option>
|
|
114
|
+
<option value="3B">Row 3B (Phase 3B)</option>
|
|
115
|
+
<option value="4.1B">Row 4.1B (Phase 4.1B)</option>
|
|
116
|
+
<option value="4.2B">Row 4.2B (Phase 4.2B)</option>
|
|
117
|
+
<option value="4.3B">Row 4.3B (Phase 4.3B)</option>
|
|
118
|
+
<option value="4.4B">Row 4.4B (Phase 4.4B)</option>
|
|
119
|
+
<option value="4.5B">Row 4.5B (Phase 4.5B)</option>
|
|
120
|
+
<option value="4.6B">Row 4.6B (Phase 4.6B)</option>
|
|
121
|
+
<option value="4.7B">Row 4.7B (Phase 4.7B)</option>
|
|
122
|
+
<option value="4.8B">Row 4.8B (Phase 4.8B)</option>
|
|
123
|
+
<option value="4.9B">Row 4.9B (Phase 4.9B)</option>
|
|
124
|
+
<option value="4.10B">Row 4.10B (Phase 4.10B)</option>
|
|
125
|
+
</select>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
107
128
|
<!-- Row 00: Raw POC buttons -->
|
|
108
|
-
<div class="dev-panel-row-container">
|
|
129
|
+
<div class="dev-panel-row-container" data-row-id="00">
|
|
109
130
|
<span class="dev-panel-row-label">00</span>
|
|
110
131
|
<div class="dev-panel-row">
|
|
111
132
|
<button id="btn-print-dev-state" class="dev-btn">Print Dev State</button>
|
|
@@ -119,7 +140,7 @@
|
|
|
119
140
|
</div>
|
|
120
141
|
|
|
121
142
|
<!-- Row 1B: Phase 1B -->
|
|
122
|
-
<div class="dev-panel-row-container">
|
|
143
|
+
<div class="dev-panel-row-container" data-row-id="1B">
|
|
123
144
|
<span class="dev-panel-row-label">1B</span>
|
|
124
145
|
<div class="dev-panel-row">
|
|
125
146
|
<button id="btn-1b-setup" class="dev-btn">1B Setup</button>
|
|
@@ -129,7 +150,7 @@
|
|
|
129
150
|
</div>
|
|
130
151
|
|
|
131
152
|
<!-- Row 2B: Phase 2B -->
|
|
132
|
-
<div class="dev-panel-row-container">
|
|
153
|
+
<div class="dev-panel-row-container" data-row-id="2B">
|
|
133
154
|
<span class="dev-panel-row-label">2B</span>
|
|
134
155
|
<div class="dev-panel-row">
|
|
135
156
|
<button id="btn-2b-setup" class="dev-btn">2B Setup</button>
|
|
@@ -139,7 +160,7 @@
|
|
|
139
160
|
</div>
|
|
140
161
|
|
|
141
162
|
<!-- Row 3B: Phase 3B -->
|
|
142
|
-
<div class="dev-panel-row-container">
|
|
163
|
+
<div class="dev-panel-row-container" data-row-id="3B">
|
|
143
164
|
<span class="dev-panel-row-label">3B</span>
|
|
144
165
|
<div class="dev-panel-row">
|
|
145
166
|
<button id="btn-3b-setup" class="dev-btn">3B Setup</button>
|
|
@@ -149,7 +170,7 @@
|
|
|
149
170
|
</div>
|
|
150
171
|
|
|
151
172
|
<!-- Row 4.1B: Phase 4.1B -->
|
|
152
|
-
<div class="dev-panel-row-container">
|
|
173
|
+
<div class="dev-panel-row-container" data-row-id="4.1B">
|
|
153
174
|
<span class="dev-panel-row-label">4.1B</span>
|
|
154
175
|
<div class="dev-panel-row">
|
|
155
176
|
<button id="btn-4-1b-setup" class="dev-btn">4.1B Setup</button>
|
|
@@ -159,7 +180,7 @@
|
|
|
159
180
|
</div>
|
|
160
181
|
|
|
161
182
|
<!-- Row 4.2B: Phase 4.2B -->
|
|
162
|
-
<div class="dev-panel-row-container">
|
|
183
|
+
<div class="dev-panel-row-container" data-row-id="4.2B">
|
|
163
184
|
<span class="dev-panel-row-label">4.2B</span>
|
|
164
185
|
<div class="dev-panel-row">
|
|
165
186
|
<button id="btn-4-2b-setup" class="dev-btn">4.2B Setup</button>
|
|
@@ -169,7 +190,7 @@
|
|
|
169
190
|
</div>
|
|
170
191
|
|
|
171
192
|
<!-- Row 4.3B: Phase 4.3B -->
|
|
172
|
-
<div class="dev-panel-row-container">
|
|
193
|
+
<div class="dev-panel-row-container" data-row-id="4.3B">
|
|
173
194
|
<span class="dev-panel-row-label">4.3B</span>
|
|
174
195
|
<div class="dev-panel-row">
|
|
175
196
|
<button id="btn-4-3b-setup" class="dev-btn">4.3B Setup</button>
|
|
@@ -179,7 +200,7 @@
|
|
|
179
200
|
</div>
|
|
180
201
|
|
|
181
202
|
<!-- Row 4.4B: Phase 4.4B -->
|
|
182
|
-
<div class="dev-panel-row-container">
|
|
203
|
+
<div class="dev-panel-row-container" data-row-id="4.4B">
|
|
183
204
|
<span class="dev-panel-row-label">4.4B</span>
|
|
184
205
|
<div class="dev-panel-row">
|
|
185
206
|
<button id="btn-4-4b-setup" class="dev-btn">4.4B Setup</button>
|
|
@@ -189,7 +210,7 @@
|
|
|
189
210
|
</div>
|
|
190
211
|
|
|
191
212
|
<!-- Row 4.5B: Phase 4.5B -->
|
|
192
|
-
<div class="dev-panel-row-container">
|
|
213
|
+
<div class="dev-panel-row-container" data-row-id="4.5B">
|
|
193
214
|
<span class="dev-panel-row-label">4.5B</span>
|
|
194
215
|
<div class="dev-panel-row">
|
|
195
216
|
<button id="btn-4-5b-setup" class="dev-btn">4.5B Setup</button>
|
|
@@ -199,7 +220,7 @@
|
|
|
199
220
|
</div>
|
|
200
221
|
|
|
201
222
|
<!-- Row 4.6B: Phase 4.6B -->
|
|
202
|
-
<div class="dev-panel-row-container">
|
|
223
|
+
<div class="dev-panel-row-container" data-row-id="4.6B">
|
|
203
224
|
<span class="dev-panel-row-label">4.6B</span>
|
|
204
225
|
<div class="dev-panel-row">
|
|
205
226
|
<button id="btn-4-6b-setup" class="dev-btn">4.6B Setup</button>
|
|
@@ -209,7 +230,7 @@
|
|
|
209
230
|
</div>
|
|
210
231
|
|
|
211
232
|
<!-- Row 4.7B: Phase 4.7B -->
|
|
212
|
-
<div class="dev-panel-row-container">
|
|
233
|
+
<div class="dev-panel-row-container" data-row-id="4.7B">
|
|
213
234
|
<span class="dev-panel-row-label">4.7B</span>
|
|
214
235
|
<div class="dev-panel-row">
|
|
215
236
|
<button id="btn-4-7b-setup" class="dev-btn">4.7B Setup</button>
|
|
@@ -219,7 +240,7 @@
|
|
|
219
240
|
</div>
|
|
220
241
|
|
|
221
242
|
<!-- Row 4.8B: Phase 4.8B -->
|
|
222
|
-
<div class="dev-panel-row-container">
|
|
243
|
+
<div class="dev-panel-row-container" data-row-id="4.8B">
|
|
223
244
|
<span class="dev-panel-row-label">4.8B</span>
|
|
224
245
|
<div class="dev-panel-row">
|
|
225
246
|
<button id="btn-4-8b-setup" class="dev-btn">4.8B Setup</button>
|
|
@@ -229,7 +250,7 @@
|
|
|
229
250
|
</div>
|
|
230
251
|
|
|
231
252
|
<!-- Row 4.9B: Phase 4.9B -->
|
|
232
|
-
<div class="dev-panel-row-container">
|
|
253
|
+
<div class="dev-panel-row-container" data-row-id="4.9B">
|
|
233
254
|
<span class="dev-panel-row-label">4.9B</span>
|
|
234
255
|
<div class="dev-panel-row">
|
|
235
256
|
<button id="btn-4-9b-setup" class="dev-btn">4.9B Setup</button>
|
|
@@ -239,7 +260,7 @@
|
|
|
239
260
|
</div>
|
|
240
261
|
|
|
241
262
|
<!-- Row 4.10B: Phase 4.10B -->
|
|
242
|
-
<div class="dev-panel-row-container">
|
|
263
|
+
<div class="dev-panel-row-container" data-row-id="4.10B">
|
|
243
264
|
<span class="dev-panel-row-label">4.10B</span>
|
|
244
265
|
<div class="dev-panel-row">
|
|
245
266
|
<button id="btn-4-10b-setup" class="dev-btn">4.10B Setup</button>
|
package/dist/client/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Qb as c,Rb as l,Tb as a,a as r,i as e,mb as n,
|
|
1
|
+
import{Qb as c,Rb as l,Tb as a,a as r,i as e,mb as n,nb as i,oc as s}from"./chunk-734MMI4C.mjs";l(i);var m=n;async function d(){let o=`[${d.name}]`;try{m&&console.log(`${o} starting... (I: 3d893846d02c4ff49181f9b8e586eb74)`),console.time(o),document.addEventListener("DOMContentLoaded",async()=>{try{console.timeLog(o,"DOMContentLoaded fired"),await c(i),console.timeLog(o,"initIbGibStorage complete"),await a("./bootstrap.mjs"),console.timeLog(o,"dynamicallyLoadBootstrapScript complete"),s(),console.timeLog(o,"initDevTools complete"),console.timeEnd(o)}catch(t){throw console.error(`${o} ${e(t)}`),t}})}catch(t){console.timeEnd(o);debugger;throw console.error(`${o} ${e(t)}`),t}finally{m&&console.log(`${o} complete.`)}}r(d,"spinOffStartup");d();
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/client/script.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e}from"./chunk-
|
|
1
|
+
import{p as e}from"./chunk-SMOZ2D5E.mjs";import"./chunk-734MMI4C.mjs";console.log("space-gib early script executing...");e();
|
|
2
2
|
//# sourceMappingURL=script.mjs.map
|
package/dist/client/style.css
CHANGED
|
@@ -702,7 +702,8 @@ body::before {
|
|
|
702
702
|
|
|
703
703
|
/* ── Dev Tools Panel (diagnostic only — remove when WS sync confirmed) ── */
|
|
704
704
|
.dev-panel {
|
|
705
|
-
max-width:
|
|
705
|
+
max-width: 100%;
|
|
706
|
+
width: 100%;
|
|
706
707
|
margin: 0 auto;
|
|
707
708
|
padding: 1.5rem;
|
|
708
709
|
border: 1px dashed rgba(255, 204, 68, 0.35);
|
|
@@ -712,8 +713,7 @@ body::before {
|
|
|
712
713
|
flex-direction: column;
|
|
713
714
|
gap: 1rem;
|
|
714
715
|
margin-bottom: 3rem;
|
|
715
|
-
max-height:
|
|
716
|
-
overflow-y: auto;
|
|
716
|
+
max-height: none;
|
|
717
717
|
}
|
|
718
718
|
|
|
719
719
|
.dev-panel-title {
|
|
@@ -725,6 +725,30 @@ body::before {
|
|
|
725
725
|
opacity: 0.7;
|
|
726
726
|
}
|
|
727
727
|
|
|
728
|
+
.dev-panel-select-container {
|
|
729
|
+
display: flex;
|
|
730
|
+
align-items: center;
|
|
731
|
+
gap: 0.75rem;
|
|
732
|
+
margin-bottom: 0.5rem;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.dev-select {
|
|
736
|
+
background: var(--clr-bg-surface);
|
|
737
|
+
color: var(--clr-text-primary);
|
|
738
|
+
border: 1px solid rgba(255, 204, 68, 0.4);
|
|
739
|
+
padding: 0.5rem 1rem;
|
|
740
|
+
border-radius: var(--radius-sm);
|
|
741
|
+
font-family: var(--font-sans);
|
|
742
|
+
outline: none;
|
|
743
|
+
cursor: pointer;
|
|
744
|
+
font-size: 0.9rem;
|
|
745
|
+
transition: border-color var(--t-fast);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.dev-select:hover {
|
|
749
|
+
border-color: rgba(255, 204, 68, 0.7);
|
|
750
|
+
}
|
|
751
|
+
|
|
728
752
|
.dev-panel-row {
|
|
729
753
|
display: flex;
|
|
730
754
|
gap: 0.75rem;
|
|
@@ -763,11 +787,11 @@ body::before {
|
|
|
763
787
|
border: 1px solid var(--clr-border);
|
|
764
788
|
border-radius: var(--radius-sm);
|
|
765
789
|
padding: 0.75rem 1rem;
|
|
766
|
-
max-height:
|
|
790
|
+
max-height: 800px;
|
|
767
791
|
overflow-y: auto;
|
|
768
792
|
white-space: pre-wrap;
|
|
769
793
|
word-break: break-all;
|
|
770
|
-
min-height:
|
|
794
|
+
min-height: 10rem;
|
|
771
795
|
}
|
|
772
796
|
|
|
773
797
|
/* dev tools row styles */
|
package/dist/server/server.mjs
CHANGED
|
@@ -18861,7 +18861,7 @@ var KeystoneService_V1 = class _KeystoneService_V1 {
|
|
|
18861
18861
|
* to the parent's `delegates` map. This operation is signed using the parent's `manage` pool.
|
|
18862
18862
|
* Validates the delegate keystone's entire graph/timeline before registering.
|
|
18863
18863
|
*/
|
|
18864
|
-
async registerDelegate({ parentKeystone, delegateKeystone, masterSecret, frameDetails, metaspace, space }) {
|
|
18864
|
+
async registerDelegate({ parentKeystone, delegateKeystone, masterSecret, frameDetails, metaspace, space, allowedVerbs }) {
|
|
18865
18865
|
const lc2 = `${this.lc}[${this.registerDelegate.name}]`;
|
|
18866
18866
|
try {
|
|
18867
18867
|
if (logalot41) {
|
|
@@ -18893,7 +18893,9 @@ var KeystoneService_V1 = class _KeystoneService_V1 {
|
|
|
18893
18893
|
currentDelegates[delegateTjpAddr] = {
|
|
18894
18894
|
delegateTjpAddr,
|
|
18895
18895
|
delegateAddr: getIbGibAddr({ ibGib: delegateKeystone }),
|
|
18896
|
-
thisAddr: getIbGibAddr({ ibGib: parentKeystone })
|
|
18896
|
+
thisAddr: getIbGibAddr({ ibGib: parentKeystone }),
|
|
18897
|
+
// allowedVerbs: allowedVerbs ?? [KEYSTONE_VERB_SYNC], // NO! We cannot default to sync just to get things to work right now
|
|
18898
|
+
allowedVerbs
|
|
18897
18899
|
};
|
|
18898
18900
|
const evolved = await this.sign({
|
|
18899
18901
|
latestKeystone: parentKeystone,
|
|
@@ -19477,30 +19479,64 @@ async function validateAndRegisterEvolveKeystone({ domainAddr, keystoneIbGib, re
|
|
|
19477
19479
|
if (intrinsicErrors && intrinsicErrors.length > 0) {
|
|
19478
19480
|
throw new Error(`Intrinsic keystone validation failed: ${intrinsicErrors.join(", ")} (E: 38ea984585edc6ee88d2a698c7895826)`);
|
|
19479
19481
|
}
|
|
19480
|
-
const infoAddr = getGibInfo({ ibGibAddr: addr });
|
|
19481
|
-
const tjpGib = infoAddr.tjpGib ?? infoAddr.punctiliarHash;
|
|
19482
|
-
const infoDomain = getGibInfo({ ibGibAddr: domainAddr });
|
|
19483
|
-
const expectedTjpGib = infoDomain.tjpGib ?? infoDomain.punctiliarHash;
|
|
19484
|
-
if (tjpGib !== expectedTjpGib) {
|
|
19485
|
-
throw new Error(`Keystone tjpGib (${tjpGib}) does not match URL domainAddr tjpGib (${expectedTjpGib})`);
|
|
19486
|
-
}
|
|
19487
19482
|
const keystoneService = new KeystoneService_V1();
|
|
19488
|
-
let
|
|
19483
|
+
let parentKeystone;
|
|
19489
19484
|
try {
|
|
19490
|
-
|
|
19485
|
+
parentKeystone = await keystoneService.getLatestKeystone({
|
|
19491
19486
|
addr: domainAddr,
|
|
19492
19487
|
metaspace,
|
|
19493
19488
|
space
|
|
19494
19489
|
});
|
|
19495
19490
|
} catch (error) {
|
|
19496
|
-
throw new Error(`Could not retrieve
|
|
19491
|
+
throw new Error(`Could not retrieve root Domain Identity tip for ${domainAddr}: ${extractErrorMsg(error)} (E: b73ed8aeb0d837d248718b487345d326)`);
|
|
19497
19492
|
}
|
|
19498
|
-
const
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19493
|
+
const parentTjpAddr = getTjpAddr({ ibGib: parentKeystone });
|
|
19494
|
+
const incomingTjpAddr = getTjpAddr({ ibGib: keystoneIbGib });
|
|
19495
|
+
if (!incomingTjpAddr) {
|
|
19496
|
+
throw new Error(`Incoming keystone does not have a TJP address (E: d288fae39b7d825d)`);
|
|
19497
|
+
}
|
|
19498
|
+
const isDelegate = incomingTjpAddr !== parentTjpAddr;
|
|
19499
|
+
let prevIbGib;
|
|
19500
|
+
if (isDelegate) {
|
|
19501
|
+
const delegateInfo = parentKeystone.data?.delegates?.[incomingTjpAddr];
|
|
19502
|
+
if (!delegateInfo) {
|
|
19503
|
+
throw new Error(`Incoming delegate keystone (${incomingTjpAddr}) is not registered under parent Domain Identity (${parentTjpAddr}) (E: c288fae39b7d82fe)`);
|
|
19504
|
+
}
|
|
19505
|
+
const allowedVerbs = delegateInfo.allowedVerbs ?? [];
|
|
19506
|
+
if (!allowedVerbs.includes(KEYSTONE_VERB_SYNC)) {
|
|
19507
|
+
throw new Error(`Incoming delegate keystone is not authorized for sync. Allowed verbs: ${allowedVerbs.join(", ")} (E: a288fae39b7d82ff)`);
|
|
19508
|
+
}
|
|
19509
|
+
const delegateLatestAddr = await metaspace.getLatestAddr({
|
|
19510
|
+
addr: incomingTjpAddr,
|
|
19511
|
+
space
|
|
19512
|
+
});
|
|
19513
|
+
if (delegateLatestAddr) {
|
|
19514
|
+
const resGet = await metaspace.get({ addr: delegateLatestAddr, space });
|
|
19515
|
+
if (resGet.success && resGet.ibGibs && resGet.ibGibs.length > 0) {
|
|
19516
|
+
prevIbGib = resGet.ibGibs[0];
|
|
19517
|
+
}
|
|
19518
|
+
}
|
|
19519
|
+
} else {
|
|
19520
|
+
prevIbGib = parentKeystone;
|
|
19521
|
+
}
|
|
19522
|
+
if (prevIbGib) {
|
|
19523
|
+
const validationErrors = await keystoneService.validate({
|
|
19524
|
+
currentIbGib: keystoneIbGib,
|
|
19525
|
+
prevIbGib
|
|
19526
|
+
});
|
|
19527
|
+
if (validationErrors && validationErrors.length > 0) {
|
|
19528
|
+
throw new Error(`Keystone evolution validation failed: ${validationErrors.join(", ")} (E: 5212f8492ac839953842631834bcd826)`);
|
|
19529
|
+
}
|
|
19530
|
+
} else {
|
|
19531
|
+
const validationErrors = await keystoneService.validateKeystoneGraph({
|
|
19532
|
+
keystoneIbGib,
|
|
19533
|
+
getLatest: false,
|
|
19534
|
+
invalidIfMoreRecentKeystoneFoundInSpace: false,
|
|
19535
|
+
space
|
|
19536
|
+
});
|
|
19537
|
+
if (validationErrors && validationErrors.length > 0) {
|
|
19538
|
+
throw new Error(`Keystone graph validation failed: ${validationErrors.join(", ")} (E: 3a288fae39b7d82e)`);
|
|
19539
|
+
}
|
|
19504
19540
|
}
|
|
19505
19541
|
const proofs = keystoneIbGib.data?.proofs ?? [];
|
|
19506
19542
|
if (proofs.length === 0) {
|
|
@@ -19528,8 +19564,36 @@ async function validateAndRegisterEvolveKeystone({ domainAddr, keystoneIbGib, re
|
|
|
19528
19564
|
if (!verb) {
|
|
19529
19565
|
throw new Error(`claim.verb is falsy (E: 92cf38af58db2cd90e7132b8940fe326)`);
|
|
19530
19566
|
}
|
|
19567
|
+
if (verb === "manage") {
|
|
19568
|
+
const prevDelegates = prevIbGib?.data?.delegates ?? {};
|
|
19569
|
+
const currDelegates = keystoneIbGib.data?.delegates ?? {};
|
|
19570
|
+
for (const [delegateTjpAddr, delegateInfo] of Object.entries(currDelegates)) {
|
|
19571
|
+
if (!prevDelegates[delegateTjpAddr]) {
|
|
19572
|
+
const delegateAddr = delegateInfo.delegateAddr;
|
|
19573
|
+
const delegateIbGib = relatedIbGibs.find((ibGib) => getIbGibAddr({ ibGib }) === delegateAddr);
|
|
19574
|
+
if (!delegateIbGib) {
|
|
19575
|
+
throw new Error(`Evolved delegate keystone ${delegateAddr} must be provided in relatedIbGibs (E: 1fe5a68438e288ab4e86c90d81d142826)`);
|
|
19576
|
+
}
|
|
19577
|
+
const delegateErrors = await keystoneService.validateGenesisKeystone({ keystoneIbGib: delegateIbGib });
|
|
19578
|
+
if (delegateErrors && delegateErrors.length > 0) {
|
|
19579
|
+
throw new Error(`Genesis validation failed for delegate keystone ${delegateAddr}: ${delegateErrors.join(", ")} (E: d8afdc1dbed48c000455b35585dc26826)`);
|
|
19580
|
+
}
|
|
19581
|
+
}
|
|
19582
|
+
}
|
|
19583
|
+
await metaspace.put({ ibGibs: [keystoneIbGib, ...relatedIbGibs], space });
|
|
19584
|
+
await metaspace.registerNewIbGib({ ibGib: keystoneIbGib, space });
|
|
19585
|
+
for (const related of relatedIbGibs) {
|
|
19586
|
+
if (related.ib?.startsWith("keystone")) {
|
|
19587
|
+
await metaspace.registerNewIbGib({ ibGib: related, space });
|
|
19588
|
+
}
|
|
19589
|
+
}
|
|
19590
|
+
return;
|
|
19591
|
+
}
|
|
19531
19592
|
if (verb !== "sync") {
|
|
19532
|
-
throw new Error(`non-sync keystone evolution not yet implemented (E: eca4681b05486d1f784c0cb815ef9926)`);
|
|
19593
|
+
throw new Error(`non-sync/non-manage keystone evolution not yet implemented (E: eca4681b05486d1f784c0cb815ef9926)`);
|
|
19594
|
+
}
|
|
19595
|
+
if (!isDelegate) {
|
|
19596
|
+
throw new Error(`Root Domain Identity (${parentTjpAddr}) is not allowed to sync directly. A delegate must be used. (E: 2c88fae39b7d82fd)`);
|
|
19533
19597
|
}
|
|
19534
19598
|
const sAddr = claim.target;
|
|
19535
19599
|
if (!sAddr) {
|
|
@@ -21621,13 +21685,16 @@ var SyncPeer_V1 = class _SyncPeer_V1 extends LightWitnessBase_V1 {
|
|
|
21621
21685
|
if (!this.opts) {
|
|
21622
21686
|
throw new Error(`(UNEXPECTED) this.opts falsy? Call initializeOpts first. (E: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c526)`);
|
|
21623
21687
|
}
|
|
21624
|
-
const { senderIdentity, fnSenderSecret, sagaId, localMetaspace, localSpace } = this.opts;
|
|
21688
|
+
const { senderIdentity, fnSenderSecret, senderDomainAddr, sagaId, localMetaspace, localSpace } = this.opts;
|
|
21625
21689
|
if (!senderIdentity || !fnSenderSecret) {
|
|
21626
21690
|
if (logalot54) {
|
|
21627
21691
|
console.log(`${lc2} no senderIdentity/fnSenderSecret \u2014 skipping establish (I: f29348a77d1542326d14043ea4b69126)`);
|
|
21628
21692
|
}
|
|
21629
21693
|
return void 0;
|
|
21630
21694
|
}
|
|
21695
|
+
if (!senderDomainAddr) {
|
|
21696
|
+
throw new Error(`(UNEXPECTED) senderDomainAddr falsy but senderIdentity/fnSenderSecret truthy? if identity is used, senderDomainAddr must be provided. (E: c288fa8e9d3d82fc)`);
|
|
21697
|
+
}
|
|
21631
21698
|
const senderIdentityAddr = getIbGibAddr({ ibGib: senderIdentity });
|
|
21632
21699
|
const senderIdentityTjpAddr = getTjpAddr({ ibGib: senderIdentity });
|
|
21633
21700
|
if (!senderIdentityTjpAddr) {
|
|
@@ -22911,7 +22978,7 @@ var SyncSagaCoordinator = class _SyncSagaCoordinator {
|
|
|
22911
22978
|
* **Execution Context**: **Sender (Local)**.
|
|
22912
22979
|
* This method is the entry point for starting a sync saga.
|
|
22913
22980
|
*/
|
|
22914
|
-
async sync({ peer, domainIbGibs,
|
|
22981
|
+
async sync({ peer, domainIbGibs, senderIdentityInfo, fnSenderSecret, conflictStrategy = SyncConflictStrategy.abort, metaspace, localSpace }) {
|
|
22915
22982
|
const lc2 = `${this.lc}[${this.sync.name}]`;
|
|
22916
22983
|
if (logalot58) {
|
|
22917
22984
|
console.log(`${lc2} starting...`);
|
|
@@ -22920,14 +22987,22 @@ var SyncSagaCoordinator = class _SyncSagaCoordinator {
|
|
|
22920
22987
|
debugger;
|
|
22921
22988
|
throw new Error(`${lc2} source (or localSpace) required (E: 25df3761f7686a1099a552f83c95d326)`);
|
|
22922
22989
|
}
|
|
22923
|
-
if (
|
|
22924
|
-
if (!
|
|
22925
|
-
throw new Error(`(UNEXPECTED)
|
|
22990
|
+
if (senderIdentityInfo || fnSenderSecret) {
|
|
22991
|
+
if (!senderIdentityInfo) {
|
|
22992
|
+
throw new Error(`(UNEXPECTED) senderIdentityInfo falsy but fnSenderSecret truthy? if either is used, both must be truthy. (E: e366628a4919c7d727d2cbd8e5b75e26)`);
|
|
22926
22993
|
}
|
|
22927
22994
|
if (!fnSenderSecret) {
|
|
22928
|
-
throw new Error(`(UNEXPECTED) fnSenderSecret falsy but
|
|
22995
|
+
throw new Error(`(UNEXPECTED) fnSenderSecret falsy but senderIdentityInfo truthy? if either is used, both must be truthy. (E: 7d55ce37ae482fec48e3398158161926)`);
|
|
22996
|
+
}
|
|
22997
|
+
const { senderIdentity: senderIdentity2, senderDomainAddr: senderDomainAddr2 } = senderIdentityInfo;
|
|
22998
|
+
if (!senderIdentity2) {
|
|
22999
|
+
throw new Error(`(UNEXPECTED) senderIdentity falsy in senderIdentityInfo? if senderIdentityInfo is provided, both senderIdentity and senderDomainAddr must be truthy. (E: a3c17fae2978926d)`);
|
|
23000
|
+
}
|
|
23001
|
+
if (!senderDomainAddr2) {
|
|
23002
|
+
throw new Error(`(UNEXPECTED) senderDomainAddr falsy in senderIdentityInfo? if senderIdentityInfo is provided, both senderIdentity and senderDomainAddr must be truthy. (E: d288fae39b7d825c)`);
|
|
22929
23003
|
}
|
|
22930
23004
|
}
|
|
23005
|
+
const { senderIdentity, senderDomainAddr } = senderIdentityInfo ?? {};
|
|
22931
23006
|
const sagaId = await getUUID();
|
|
22932
23007
|
const updates$ = await newupSubject();
|
|
22933
23008
|
if (!updates$.next) {
|
|
@@ -22960,6 +23035,7 @@ var SyncSagaCoordinator = class _SyncSagaCoordinator {
|
|
|
22960
23035
|
peer.setOptionalOpts({
|
|
22961
23036
|
sagaId,
|
|
22962
23037
|
senderIdentity,
|
|
23038
|
+
senderDomainAddr,
|
|
22963
23039
|
fnSenderSecret,
|
|
22964
23040
|
sessionConnectPoolConfig: this.defaultSessionConnectPoolConfig(),
|
|
22965
23041
|
sessionSyncPoolConfig: this.defaultSessionSyncPoolConfig(),
|