@ibgib/core-gib 0.0.8 → 0.0.11

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 (154) hide show
  1. package/README.md +5 -10
  2. package/dist/assumptions.respec.d.mts +2 -0
  3. package/dist/assumptions.respec.d.mts.map +1 -0
  4. package/dist/assumptions.respec.mjs +41 -0
  5. package/dist/assumptions.respec.mjs.map +1 -0
  6. package/dist/core-constants.d.mts +0 -2
  7. package/dist/core-constants.d.mts.map +1 -1
  8. package/dist/core-constants.mjs +0 -2
  9. package/dist/core-constants.mjs.map +1 -1
  10. package/dist/core-helper.respec.d.mts +2 -0
  11. package/dist/core-helper.respec.d.mts.map +1 -0
  12. package/dist/core-helper.respec.mjs +53 -0
  13. package/dist/core-helper.respec.mjs.map +1 -0
  14. package/dist/core-types.d.mts +22 -0
  15. package/dist/core-types.d.mts.map +1 -1
  16. package/dist/respec-gib.node.d.mts +2 -0
  17. package/dist/respec-gib.node.d.mts.map +1 -0
  18. package/dist/respec-gib.node.mjs +211 -0
  19. package/dist/respec-gib.node.mjs.map +1 -0
  20. package/dist/spec-helper.node.respec.d.mts +12 -0
  21. package/dist/spec-helper.node.respec.d.mts.map +1 -0
  22. package/dist/spec-helper.node.respec.mjs +43 -0
  23. package/dist/spec-helper.node.respec.mjs.map +1 -0
  24. package/dist/witness/app/app-base-v1.d.mts +2 -2
  25. package/dist/witness/app/app-base-v1.d.mts.map +1 -1
  26. package/dist/witness/app/app-base-v1.mjs +23 -141
  27. package/dist/witness/app/app-base-v1.mjs.map +1 -1
  28. package/dist/witness/app/app-constants.d.mts +2 -0
  29. package/dist/witness/app/app-constants.d.mts.map +1 -1
  30. package/dist/witness/app/app-constants.mjs +2 -0
  31. package/dist/witness/app/app-constants.mjs.map +1 -1
  32. package/dist/witness/app/app-helper.d.mts.map +1 -1
  33. package/dist/witness/app/app-helper.mjs +2 -1
  34. package/dist/witness/app/app-helper.mjs.map +1 -1
  35. package/dist/witness/app/app-types.d.mts +2 -1
  36. package/dist/witness/app/app-types.d.mts.map +1 -1
  37. package/dist/witness/robbot/robbot-base-v1.d.mts +12 -164
  38. package/dist/witness/robbot/robbot-base-v1.d.mts.map +1 -1
  39. package/dist/witness/robbot/robbot-base-v1.mjs +41 -657
  40. package/dist/witness/robbot/robbot-base-v1.mjs.map +1 -1
  41. package/dist/witness/robbot/robbot-helper.mjs +3 -3
  42. package/dist/witness/robbot/robbot-helper.mjs.map +1 -1
  43. package/dist/witness/robbot/robbot-helper.respec.d.mts +2 -0
  44. package/dist/witness/robbot/robbot-helper.respec.d.mts.map +1 -0
  45. package/dist/witness/robbot/robbot-helper.respec.mjs +106 -0
  46. package/dist/witness/robbot/robbot-helper.respec.mjs.map +1 -0
  47. package/dist/witness/robbot/robbot-types.d.mts +6 -3
  48. package/dist/witness/robbot/robbot-types.d.mts.map +1 -1
  49. package/dist/witness/robbot/robbot-types.mjs +1 -0
  50. package/dist/witness/robbot/robbot-types.mjs.map +1 -1
  51. package/dist/witness/space/filesystem-space/filesystem-space-v1.d.mts +1 -1
  52. package/dist/witness/space/filesystem-space/filesystem-space-v1.d.mts.map +1 -1
  53. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.d.mts +2 -0
  54. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.d.mts.map +1 -0
  55. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.mjs +107 -0
  56. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.mjs.map +1 -0
  57. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.d.mts.map +1 -1
  58. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.mjs +1 -1
  59. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.mjs.map +1 -1
  60. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.node.respec.d.mts +2 -0
  61. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.node.respec.d.mts.map +1 -0
  62. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.node.respec.mjs +129 -0
  63. package/dist/witness/space/filesystem-space/node-filesystem-space-v1.node.respec.mjs.map +1 -0
  64. package/dist/witness/space/inner-space/inner-space-v1.respec.d.mts +2 -0
  65. package/dist/witness/space/inner-space/inner-space-v1.respec.d.mts.map +1 -0
  66. package/dist/witness/space/inner-space/inner-space-v1.respec.mjs +56 -0
  67. package/dist/witness/space/inner-space/inner-space-v1.respec.mjs.map +1 -0
  68. package/dist/witness/space/metaspace/metaspace-base.d.mts +795 -0
  69. package/dist/witness/space/metaspace/metaspace-base.d.mts.map +1 -0
  70. package/dist/witness/space/metaspace/metaspace-base.mjs +3251 -0
  71. package/dist/witness/space/metaspace/metaspace-base.mjs.map +1 -0
  72. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.d.mts +4 -0
  73. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.d.mts.map +1 -0
  74. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs +117 -0
  75. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs.map +1 -0
  76. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.d.mts +34 -0
  77. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.d.mts.map +1 -0
  78. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.mjs +76 -0
  79. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.mjs.map +1 -0
  80. package/dist/witness/space/metaspace/metaspace-types.d.mts +580 -0
  81. package/dist/witness/space/metaspace/metaspace-types.d.mts.map +1 -0
  82. package/dist/witness/space/metaspace/metaspace-types.mjs +6 -0
  83. package/dist/witness/space/metaspace/metaspace-types.mjs.map +1 -0
  84. package/dist/witness/space/space-helper.d.mts.map +1 -1
  85. package/dist/witness/space/space-helper.mjs +2 -1
  86. package/dist/witness/space/space-helper.mjs.map +1 -1
  87. package/dist/witness/space/{space-spec-helper.d.mts → space-respec-helper.d.mts} +15 -5
  88. package/dist/witness/space/space-respec-helper.d.mts.map +1 -0
  89. package/dist/witness/space/space-respec-helper.mjs +186 -0
  90. package/dist/witness/space/space-respec-helper.mjs.map +1 -0
  91. package/dist/witness/space/space-types.d.mts +2 -1
  92. package/dist/witness/space/space-types.d.mts.map +1 -1
  93. package/dist/witness/space/space-types.mjs.map +1 -1
  94. package/dist/witness/witness-base-v1.d.mts.map +1 -1
  95. package/dist/witness/witness-base-v1.mjs +7 -7
  96. package/dist/witness/witness-base-v1.mjs.map +1 -1
  97. package/dist/witness/witness-cmd/witness-cmd-types.d.mts +31 -0
  98. package/dist/witness/witness-cmd/witness-cmd-types.d.mts.map +1 -0
  99. package/dist/witness/witness-cmd/witness-cmd-types.mjs +2 -0
  100. package/dist/witness/witness-cmd/witness-cmd-types.mjs.map +1 -0
  101. package/dist/witness/witness-helper.d.mts +8 -0
  102. package/dist/witness/witness-helper.d.mts.map +1 -1
  103. package/dist/witness/witness-helper.mjs +30 -0
  104. package/dist/witness/witness-helper.mjs.map +1 -1
  105. package/dist/witness/witness-types.d.mts +26 -36
  106. package/dist/witness/witness-types.d.mts.map +1 -1
  107. package/dist/witness/witness-with-context/witness-with-context-base-v1.d.mts +235 -0
  108. package/dist/witness/witness-with-context/witness-with-context-base-v1.d.mts.map +1 -0
  109. package/dist/witness/witness-with-context/witness-with-context-base-v1.mjs +742 -0
  110. package/dist/witness/witness-with-context/witness-with-context-base-v1.mjs.map +1 -0
  111. package/dist/witness/witness-with-context/witness-with-context-types.d.mts +17 -0
  112. package/dist/witness/witness-with-context/witness-with-context-types.d.mts.map +1 -0
  113. package/dist/witness/witness-with-context/witness-with-context-types.mjs +2 -0
  114. package/dist/witness/witness-with-context/witness-with-context-types.mjs.map +1 -0
  115. package/package.json +12 -15
  116. package/src/{assumptions.spec.mts → assumptions.respec.mts} +11 -5
  117. package/src/core-constants.mts +0 -2
  118. package/src/core-helper.respec.mts +71 -0
  119. package/src/core-types.mts +20 -0
  120. package/src/respec-gib.node.mts +199 -0
  121. package/src/witness/app/app-base-v1.mts +19 -212
  122. package/src/witness/app/app-constants.mts +3 -0
  123. package/src/witness/app/app-helper.mts +2 -1
  124. package/src/witness/app/app-types.mts +1 -1
  125. package/src/witness/robbot/robbot-base-v1.mts +39 -690
  126. package/src/witness/robbot/robbot-helper.mts +1 -1
  127. package/src/witness/robbot/{robbot-helper.spec.mts → robbot-helper.respec.mts} +39 -33
  128. package/src/witness/robbot/robbot-types.mts +5 -3
  129. package/src/witness/space/filesystem-space/filesystem-space-v1.mts +1 -1
  130. package/src/witness/space/filesystem-space/{filesystem-space-v1.spec.mts → filesystem-space-v1.respec.mts} +17 -8
  131. package/src/witness/space/filesystem-space/node-filesystem-space-v1.mts +3 -11
  132. package/src/witness/space/filesystem-space/{node-filesystem-space-v1.node.spec.mts → node-filesystem-space-v1.node.respec.mts} +18 -14
  133. package/src/witness/space/inner-space/{inner-space-v1.spec.mts → inner-space-v1.respec.mts} +17 -8
  134. package/src/witness/space/metaspace/metaspace-base.mts +3702 -0
  135. package/src/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mts +116 -0
  136. package/src/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.mts +88 -0
  137. package/src/witness/space/metaspace/metaspace-types.mts +614 -0
  138. package/src/witness/space/space-helper.mts +2 -1
  139. package/src/witness/space/{space-spec-helper.mts → space-respec-helper.mts} +76 -57
  140. package/src/witness/space/space-types.mts +2 -1
  141. package/src/witness/witness-base-v1.mts +8 -6
  142. package/src/witness/witness-cmd/witness-cmd-types.mts +38 -0
  143. package/src/witness/witness-helper.mts +31 -0
  144. package/src/witness/witness-types.mts +31 -41
  145. package/src/witness/witness-with-context/witness-with-context-base-v1.mts +809 -0
  146. package/src/witness/witness-with-context/witness-with-context-types.mts +24 -0
  147. package/tsconfig.json +1 -0
  148. package/dist/witness/space/space-spec-helper.d.mts.map +0 -1
  149. package/dist/witness/space/space-spec-helper.mjs +0 -179
  150. package/dist/witness/space/space-spec-helper.mjs.map +0 -1
  151. package/jasmine-browser.json +0 -18
  152. package/jasmine.json +0 -6
  153. package/src/core-helper.spec.mts +0 -64
  154. /package/src/{spec-helper.node.spec.mts → spec-helper.node.respec.mts} +0 -0
@@ -0,0 +1,795 @@
1
+ import { Observable, ReplaySubject, Subscription } from 'rxjs';
2
+ import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
3
+ import { IbGibAddr, TransformResult } from '@ibgib/ts-gib';
4
+ import { DeleteIbGibOpts, DeleteIbGibResult, GetIbGibOpts, GetIbGibResult, PutIbGibOpts, PutIbGibResult } from '../../../common/other/other-types.mjs';
5
+ import { TagIbGib_V1 } from '../../../common/tag/tag-types.mjs';
6
+ import { ParticipantInfo, SyncSagaInfo, SyncSpaceResultIbGib, SyncStatusIbGib } from '../../../witness/space/outer-space/outer-space-types.mjs';
7
+ import { SpaceId } from '../../../witness/space/space-types.mjs';
8
+ import { IbGibSpaceAny } from '../../../witness/space/space-base-v1.mjs';
9
+ import { IbGibTimelineUpdateInfo, SpecialIbGibType } from '../../../common/other/other-types.mjs';
10
+ import { RootData } from '../../../common/root/root-types.mjs';
11
+ import { CiphertextIbGib_V1, EncryptionData_V1, EncryptionIbGib, SecretData_V1, SecretIbGib_V1 } from '../../../common/encrypt/encrypt-types.mjs';
12
+ import { RobbotIbGib_V1 } from '../../../witness/robbot/robbot-types.mjs';
13
+ import { AppIbGib_V1 } from '../../../witness/app/app-types.mjs';
14
+ import { GetDependencyGraphOptions } from '../../../common/other/graph-helper.mjs';
15
+ import { IbGibCacheService } from '../../../common/cache/cache-types.mjs';
16
+ import { MetaspaceInitializeOptions, CreateLocalSpaceOptions, LocalSpaceFactoryFunction, MetaspaceFactory } from './metaspace-types.mjs';
17
+ import { MetaspaceService, TempCacheEntry } from './metaspace-types.mjs';
18
+ /**
19
+ * All-purpose mega service (todo: which we'll need to break up!) to interact
20
+ * with ibgibs at the app/device level.
21
+ *
22
+ * This works with the local app user space.
23
+ *
24
+ * ## regarding special ibgibs
25
+ *
26
+ * Special ibgibs' behaviors are what hold in other apps configuration data.
27
+ * Of course the difference is that most special ibgibs can leverage the "on-chain"
28
+ * functionality of "regular" ibgibs.
29
+ *
30
+ * There are a couple meta ibgibs (which I also call "special"):
31
+ * * roots^gib
32
+ * * tracks other special root^gib ibgibs, which are like local app-level indexes.
33
+ * * tags^gib
34
+ * * tracks other special tag^gib ibgibs, which you can apply to any ibgib
35
+ * * latest^gib
36
+ * * tracks mappings between tjp -> latest ib^gib address
37
+ * * ephemeral (deletes past rel8ns and past ibGib frames)
38
+ * * ...
39
+ *
40
+ * ## regarding latest ibgibs
41
+ *
42
+ * The tjp (temporal junction point) defines atow the beginning of an ibGib
43
+ * timeline. it's like the birthday for an ibGib. (Or you can think if it as
44
+ * the id for the stream of ibgib frames in a given timeline.)
45
+ *
46
+ * The latest ibGib in that timeline is also special, because it's often what
47
+ * you want to work with.
48
+ *
49
+ * So ideally, when an ibgib, A, has a tjp A1, and it is updated to A2, A3, An
50
+ * via `mut8` and/or `rel8` transforms, that ibgib creates a single timeline.
51
+ * This service attempts to track the relationship between that starting tjp
52
+ * address and its corresponding latest frame in that timeline, i.e., A1 -> An.
53
+ *
54
+ * ### mapping persistence implementation details
55
+ *
56
+ * The latest ibGib service is backed by a special ibgib that maintains the
57
+ * mapping index. It does this by rel8-ing that special backing ibgib via the
58
+ * tjp pointer, e.g. [special latest ibgib^XXX000].rel8ns[A^TJP123] ===
59
+ * [A^N12345] . It does this via the ib^gib content address pointer, so this
60
+ * becomes a mapping from A^TJP123 to A^N12345.
61
+ *
62
+ * This backing ibGib is special (even for special ibGibs) in that:
63
+ * * it does not relate itself with the current root of the application
64
+ * * it does not maintain references to its past (i.e. rel8ns['past'] === [])
65
+ * * it DELETES its previous incarnation from the files service
66
+ *
67
+ * In other words, this service is meant to be as ephemeral as possible. I am
68
+ * keeping it as an ibGib and not some other data format (like straight in
69
+ * storage/some other db) because I've found this is often useful and what I end
70
+ * up doing anyway to leverage other ibgib behavior. For example, in the future
71
+ * it may be good to take snapshots, which is a simple copy operation of the
72
+ * file persistence.
73
+ *
74
+ * ### current naive implementation notes
75
+ *
76
+ * questions:
77
+ * * What do we want to do if we can't locate an ibGib record?
78
+ * * How/when do we want to alert the user/our own code that we've found
79
+ * multiple timelines for an ibGib with a tjp (usually a thing we want to
80
+ * avoid)?
81
+ * * Who do we want to notify when new ibGibs arrive?
82
+ * * How often do we want to check external sources for latest?
83
+ * * When do we get to merging ibGib timelines?
84
+ *
85
+ * This is behavior that is somewhat taken care of, e.g. in git, with the HEAD
86
+ * pointer for a repo. But we're talking about here basically as a metarepo or
87
+ * "repo of repos", and unlike git, we don't want our HEAD metadata living "off
88
+ * chain" (outside of the DLT itself that it's modifying). So eventually, what
89
+ * we want is just like what we want with ALL ibGibs: perspective. From "the
90
+ * app"'s perspective, the latest is mapped. But really, apps can't view slices
91
+ * of ibGib graphs in all sorts of interesting ways and still be productive &
92
+ * beneficial to the ecosystem as a whole.
93
+ */
94
+ export declare abstract class MetaspaceBase implements MetaspaceService {
95
+ protected cacheSvc: IbGibCacheService | undefined;
96
+ protected lc: string;
97
+ instanceId: string;
98
+ protected _initialized: boolean;
99
+ get initialized(): boolean;
100
+ protected _initializedSubj: ReplaySubject<void>;
101
+ initialized$: Observable<void>;
102
+ protected _initializing: boolean;
103
+ get initializing(): boolean;
104
+ protected _latestSubj: ReplaySubject<IbGibTimelineUpdateInfo>;
105
+ latestObs: Observable<IbGibTimelineUpdateInfo>;
106
+ /**
107
+ * gets the current local user space
108
+ */
109
+ getLocalUserSpace({ lock, localSpaceId, }: {
110
+ /**
111
+ * If true, then we lock by bootstrap/spaceId before trying to retrieve.
112
+ *
113
+ * @default true
114
+ */
115
+ lock?: boolean;
116
+ /**
117
+ * If provided, will look for the space via this id in the bootstrap ibgib.
118
+ * If not provided, will use the bootstrap ibgib's default spaceId.
119
+ */
120
+ localSpaceId?: SpaceId;
121
+ }): Promise<IbGibSpaceAny | undefined>;
122
+ /**
123
+ * gets all local user spaces known in bootstrap ibgib, according to
124
+ * spaceIds property
125
+ *
126
+ * (`bootstrapIbGib.data[BOOTSTRAP_DATA_KNOWN_SPACE_IDS_KEY]` atow)
127
+ *
128
+ * ## example bootstrap ibgib atow
129
+ *
130
+ ```json
131
+ {
132
+ "ib":"bootstrap",
133
+ "gib":"gib",
134
+ "data":{
135
+ "defaultSpaceId":"d455d9a72807617634ccbf1e532b71037c45762f824ec85fcd9a4c2275562f33",
136
+ "spaceIds":["d455d9a72807617634ccbf1e532b71037c45762f824ec85fcd9a4c2275562f33"]
137
+ },
138
+ "rel8ns":{
139
+ "d455d9a72807617634ccbf1e532b71037c45762f824ec85fcd9a4c2275562f33":[
140
+ "witness space IonicSpace_V1 oij d455d9a72807617634ccbf1e532b71037c45762f824ec85fcd9a4c2275562f33^B336251655E8C56B38E9E86F20E0E42E6C153785F1A0A798ADE6916E71CF055B"
141
+ ]
142
+ }
143
+ }
144
+ ```
145
+ *
146
+ * so this enumerates `data.spaceIds` and gets the corresponding addrs in the `rel8ns`.
147
+ * it then gets the space ibgibs themselves via the local zero space.
148
+ *
149
+ * @returns array of known local user spaces
150
+ *
151
+ * @throws if no local user spaces found (there should be at least one atow i think)
152
+ */
153
+ getLocalUserSpaces({ lock, }: {
154
+ /**
155
+ * If true, then we lock by bootstrap/spaceId before trying to retrieve.
156
+ *
157
+ * @default true
158
+ */
159
+ lock?: boolean;
160
+ }): Promise<IbGibSpaceAny[]>;
161
+ abstract get zeroSpace(): IbGibSpaceAny;
162
+ /**
163
+ * Just to prevent plaintext passwords from just sitting in memory,
164
+ * this is a slight layer of indirection for caching.
165
+ */
166
+ protected passwordCache: {
167
+ [addr: string]: TempCacheEntry;
168
+ };
169
+ protected _syncing: boolean;
170
+ /**
171
+ * should only syncIbGibs when not already syncing.
172
+ */
173
+ get syncing(): boolean;
174
+ protected sagaInfoMap: {
175
+ [sagaId: string]: SyncSagaInfo;
176
+ };
177
+ /**
178
+ * unique set of tjp addresses that will auto sync to sync spaces.
179
+ */
180
+ protected _alwaysAutosyncTjpAddrsCache: Set<string>;
181
+ /**
182
+ * Hmm, hacky way of tracking if we're prompt the user for something.
183
+ * We don't want to prompt while we're already prompting, and this
184
+ * is a straight-forward approach.
185
+ *
186
+ * @see {@link getPasswordForSecrets}
187
+ */
188
+ protected isPrompting: boolean;
189
+ /**
190
+ * getUUID is async. there are many times we want a throwaway id
191
+ * synchronously. So we'll prepopulate them here.
192
+ */
193
+ protected _precalculatedIds: string[];
194
+ getUUIDSync(): string;
195
+ precalculateSomeUUIDsPlease(): Promise<void>;
196
+ protected metaspaceFactory: MetaspaceFactory;
197
+ /**
198
+ * used in alerting user of things... carryover of mvp. should be in initialize
199
+ */
200
+ protected getFnAlert: (() => (arg: {
201
+ title: string;
202
+ msg: string;
203
+ }) => Promise<void>) | undefined;
204
+ /**
205
+ * used in prompting user for passwords... carryover of mvp. should be in initialize
206
+ */
207
+ protected getFnPrompt: (() => ((arg: {
208
+ title: string;
209
+ msg: string;
210
+ }) => Promise<string>)) | undefined;
211
+ /**
212
+ * used in prompting user for passwords... carryover of mvp. should be in initialize
213
+ */
214
+ protected getFnPromptPassword: (() => (title: string, msg: string) => Promise<string | null>) | undefined;
215
+ constructor(cacheSvc: IbGibCacheService | undefined);
216
+ protected initializeMetaspaceFactory({ metaspaceFactory }: {
217
+ metaspaceFactory: MetaspaceFactory;
218
+ }): Promise<void>;
219
+ initialize({ spaceName, metaspaceFactory, getFnAlert, getFnPrompt, getFnPromptPassword, }: MetaspaceInitializeOptions): Promise<void>;
220
+ protected initializeSpecialIbGibs_required({ timerName }: {
221
+ timerName: string;
222
+ }): Promise<void>;
223
+ protected initializeSpecialIbGibs_outerspaces({ timerName }: {
224
+ timerName: string;
225
+ }): Promise<void>;
226
+ protected initializeSpecialIbGibs_other({ timerName }: {
227
+ timerName: string;
228
+ }): Promise<void>;
229
+ /**
230
+ * Make sure we have a bootstrapped space. This is like a node...kinda in peer
231
+ * to peer systems.
232
+ *
233
+ * For all intents and purposes here to begin with, I'm using this initially
234
+ * as where to put the settings ibGib that will contain pointers for this app, be it an
235
+ * ionic android/web app or a browser extension. This is because the initial
236
+ * intent of doing the spaces, besides it being necessary for the distributed
237
+ * nature of the architecture, is to obviate the use of ionic Storage.
238
+ * That is currently where we are storing things like the pointers to special
239
+ * ibGibs like tags^ibgib, roots ibgibs, etc.
240
+ */
241
+ protected initializeLocalSpaces({ spaceName, }: {
242
+ spaceName: string | undefined;
243
+ }): Promise<void>;
244
+ /**
245
+ * wrapping dispatch factory function for creating local spaces. If a factory
246
+ * functionis provided, will use that. If not, then will use
247
+ * this.fnDefaultLocalSpaceFactory function. Ifthat is also falsy, then this
248
+ * will default to the NodeFSSpace factory function
249
+ * `fnCreateNewLocalSpace_NodeFSSpace`.
250
+ *
251
+ * @returns newly created local space, or undefined if there was a problem.
252
+ */
253
+ createNewLocalSpace({ opts, fnLocalSpaceFactory, }: {
254
+ opts: CreateLocalSpaceOptions;
255
+ fnLocalSpaceFactory?: LocalSpaceFactoryFunction;
256
+ }): Promise<IbGibSpaceAny | undefined>;
257
+ createLocalSpaceAndUpdateBootstrap({ zeroSpace, allowCancel, createBootstrap, spaceName, }: {
258
+ zeroSpace: IbGibSpaceAny;
259
+ allowCancel: boolean;
260
+ createBootstrap: boolean;
261
+ spaceName: string | undefined;
262
+ }): Promise<IbGibSpaceAny | undefined>;
263
+ createTagIbGib({ text, icon, description, space, }: {
264
+ text: string;
265
+ icon?: string;
266
+ description?: string;
267
+ space?: IbGibSpaceAny;
268
+ }): Promise<{
269
+ newTagIbGib: TagIbGib_V1;
270
+ newTagsAddr: string;
271
+ }>;
272
+ trash({ ibGib_Context, rel8nName_Context, addr, space, }: {
273
+ ibGib_Context: IbGib_V1;
274
+ rel8nName_Context: IbGibAddr;
275
+ addr: IbGibAddr;
276
+ space?: IbGibSpaceAny;
277
+ }): Promise<void>;
278
+ archive({ ibGib_Context, rel8nName_Context, addr, space, }: {
279
+ ibGib_Context: IbGib_V1;
280
+ rel8nName_Context: IbGibAddr;
281
+ addr: IbGibAddr;
282
+ space?: IbGibSpaceAny;
283
+ }): Promise<void>;
284
+ /**
285
+ * Gets a config addr from the current space via the given key
286
+ * as the space's rel8n name.
287
+ *
288
+ * For example, for `key = tags`, a space may look like:
289
+ *
290
+ * ```json
291
+ * {
292
+ * ib: space xyz,
293
+ * gib: e89ff8a1c4954db28432007615a78952,
294
+ * rel8ns: {
295
+ * past: [space xyz^21cb29cc353f45a491d2b49ff2f130db],
296
+ * ancestor: [space^gib],
297
+ * tags: [tags^99b388355f8f4a979ca30ba284d3a686], // <<< rel8n with name specified by key
298
+ * }
299
+ * }
300
+ * ```
301
+ *
302
+ * @param key config key
303
+ * @returns addr in config if exists, else undefined
304
+ */
305
+ getConfigAddr({ key, space, }: {
306
+ key: string;
307
+ space?: IbGibSpaceAny;
308
+ }): Promise<string | undefined>;
309
+ fnUpdateBootstrap: (newSpace: IbGibSpaceAny) => Promise<void>;
310
+ fnBroadcast: (info: IbGibTimelineUpdateInfo) => void;
311
+ /**
312
+ * Takes the given `key`, which should be unique in the given space (or
313
+ * zerospace), and uses that to persist the given `addr` in that space.
314
+ *
315
+ * # notes
316
+ *
317
+ * configuration is stored in "special" ibgibs, and so we need only to persist
318
+ * the address of that configuration.
319
+ */
320
+ setConfigAddr({ key, addr, space, }: {
321
+ key: string;
322
+ addr: string;
323
+ space?: IbGibSpaceAny;
324
+ }): Promise<IbGibSpaceAny>;
325
+ getCurrentRoot({ space, }: {
326
+ space?: IbGibSpaceAny;
327
+ }): Promise<IbGib_V1<RootData> | undefined>;
328
+ setCurrentRoot({ root, space, }: {
329
+ root: IbGib_V1<RootData>;
330
+ space?: IbGibSpaceAny;
331
+ }): Promise<void>;
332
+ /**
333
+ * Every tjp should be related to one of the roots in a space.
334
+ *
335
+ * You should NOT relate every ibgib frame of a given ibGib.
336
+ */
337
+ rel8ToCurrentRoot({ ibGib, linked, rel8nName, space, }: {
338
+ ibGib: IbGib_V1;
339
+ linked?: boolean;
340
+ rel8nName?: string;
341
+ space?: IbGibSpaceAny;
342
+ }): Promise<void>;
343
+ /**
344
+ * rel8s given ibgibs to special ibgib.
345
+ * @see {@link rel8ToSpecialIbGib}
346
+ * @returns new special ibgib addr
347
+ */
348
+ rel8ToSpecialIbGib({ type, rel8nName, ibGibsToRel8, ibGibsToUnRel8, linked, severPast, deletePreviousSpecialIbGib, space, }: {
349
+ type: SpecialIbGibType;
350
+ rel8nName: string;
351
+ /**
352
+ * multiple ibgibs to rel8
353
+ */
354
+ ibGibsToRel8?: IbGib_V1[];
355
+ /**
356
+ * multiple ibgibs to remove rel8n.
357
+ */
358
+ ibGibsToUnRel8?: IbGib_V1[];
359
+ linked?: boolean;
360
+ /**
361
+ * Clears out the special.rel8ns.past array to an empty array.
362
+ *
363
+ * {@see deletePreviousSpecialIbGib} for driving use case.
364
+ */
365
+ severPast?: boolean;
366
+ /**
367
+ * Deletes the previous special ibGib.
368
+ *
369
+ * ## driving use case
370
+ *
371
+ * the latest ibGib is one that is completely ephemeral. It doesn't get attached
372
+ * to the current root, and it only has the current instance. So we don't want to
373
+ * keep around past incarnations.
374
+ */
375
+ deletePreviousSpecialIbGib?: boolean;
376
+ space?: IbGibSpaceAny;
377
+ }): Promise<IbGibAddr>;
378
+ /**
379
+ * Used for tracking tjpAddr -> latest ibGibAddr.
380
+ *
381
+ * Call this when you create a new ibGib.
382
+ *
383
+ * Need to put this in another service at some point, but crunch crunch
384
+ * like pacman's lunch.
385
+ */
386
+ registerNewIbGib({ ibGib, space, }: {
387
+ ibGib: IbGib_V1;
388
+ space?: IbGibSpaceAny;
389
+ }): Promise<void>;
390
+ /**
391
+ * Will trigger a latest info event to be fired.
392
+ * @param param0
393
+ */
394
+ pingLatest_Local({ ibGib, tjpIbGib, space, useCache, }: {
395
+ ibGib: IbGib_V1<any>;
396
+ tjpIbGib: IbGib_V1<any> | undefined;
397
+ space?: IbGibSpaceAny;
398
+ /**
399
+ * If true, then will check the latest ibgib cache first. if found, will
400
+ * just return that.
401
+ */
402
+ useCache: boolean;
403
+ }): Promise<void>;
404
+ /**
405
+ * Convenience function for persisting a transform result, which has
406
+ * a newIbGib and optionally intermediate ibGibs and/or dnas.
407
+ *
408
+ * it persists these ibgibs into the given space, else the current space.
409
+ */
410
+ persistTransformResult({ resTransform, isMeta, force, space, }: {
411
+ resTransform: TransformResult<IbGib_V1>;
412
+ isMeta?: boolean;
413
+ force?: boolean;
414
+ space?: IbGibSpaceAny;
415
+ }): Promise<void>;
416
+ /**
417
+ * Wrapper for retrieving ibgib from a given space, else the current space.
418
+ */
419
+ get({ addr, addrs, isMeta, isDna, space, }: GetIbGibOpts): Promise<GetIbGibResult>;
420
+ /**
421
+ * Wrapper for saving ibgib in a given space, else the current space.
422
+ */
423
+ put({ ibGib, ibGibs, isMeta, isDna, force, space, }: PutIbGibOpts): Promise<PutIbGibResult>;
424
+ /**
425
+ * Wrapper for removing ibgib from the a given space, else the current space.
426
+ */
427
+ delete({ addr, isMeta, isDna, space, }: DeleteIbGibOpts): Promise<DeleteIbGibResult>;
428
+ /**
429
+ * Wrapper for `getDependencyGraph` fn in `helper/space.ts`, but using
430
+ * `this.localUserSpace` as default space.
431
+ *
432
+ * (refactoring!)
433
+ *
434
+ * ## note on space
435
+ *
436
+ * pass in `null` for space if you want to
437
+ *
438
+ * ## warning
439
+ *
440
+ * This does not (YET) have a flag that gets the latest ibgibs for the graph.
441
+ * It only climbs the current graph, which may not cover all ibgibs when you
442
+ * deal with ibGibs with tjps (timelines). We're going to eventually
443
+ * combat this with auto-updating our rel8ns, but for now we're just going
444
+ * to earmark this for the future.
445
+ *
446
+ * todo: auto-update or better
447
+ *
448
+ * @returns map of addr => ibGib
449
+ */
450
+ getDependencyGraph(opts: GetDependencyGraphOptions): Promise<{
451
+ [addr: string]: IbGib_V1;
452
+ }>;
453
+ /**
454
+ * Wrapper for getting the latest addr in the given space.
455
+ *
456
+ * ## warnings
457
+ *
458
+ * * This was written early and makes many assumptions.
459
+ * * Meant to work with Ionic space atow.
460
+ *
461
+ * @returns latest addr in a given space (or localUserSpace)
462
+ */
463
+ getLatestAddr({ ibGib, addr, tjpAddr, tjp, space, }: {
464
+ ibGib?: IbGib_V1<any>;
465
+ addr?: IbGibAddr;
466
+ tjpAddr?: IbGibAddr;
467
+ tjp?: IbGib_V1<any>;
468
+ space?: IbGibSpaceAny;
469
+ }): Promise<IbGibAddr | undefined>;
470
+ /**
471
+ * Gets the tjpIbGib for the given `ibGib` in the given `space`.
472
+ * atow, naive must be true.
473
+ *
474
+ *
475
+ *
476
+ * @returns tjpIbGib for the given `ibGib`
477
+ */
478
+ getTjpIbGib({ ibGib, naive, space, }: {
479
+ ibGib: IbGib_V1<any>;
480
+ naive?: boolean;
481
+ space?: IbGibSpaceAny;
482
+ }): Promise<IbGib_V1<any> | undefined>;
483
+ /**
484
+ * Gets one of the app's special ibGibs, e.g., TagsIbGib.
485
+ *
486
+ * When initializing tags, this will generate some boilerplate tags.
487
+ * I'm going to be doing roots here also, and who knows what else, but each
488
+ * one will have its own initialize specifics.
489
+ *
490
+ * @param initialize initialize (i.e. create) ONLY IF IbGib not found. Used for initializing app (first run).
491
+ *
492
+ * @see {@link createSpecial}
493
+ * @see {@link createTags}
494
+ */
495
+ getSpecialIbGib({ type, initialize, space, lock, }: {
496
+ type: SpecialIbGibType;
497
+ initialize?: boolean;
498
+ space?: IbGibSpaceAny;
499
+ lock?: boolean;
500
+ }): Promise<IbGib_V1 | null>;
501
+ getSpecialRel8dIbGibs<TIbGib extends IbGib_V1 = IbGib_V1>({ type, rel8nName, space, }: {
502
+ type: SpecialIbGibType;
503
+ rel8nName: string;
504
+ space?: IbGibSpaceAny;
505
+ }): Promise<TIbGib[]>;
506
+ /**
507
+ * Feels klugy.
508
+ */
509
+ getPasswordForSecrets({ secretIbGibs, fnPromptPassword, dontPrompt, checkCacheFirst, cacheAfter, }: {
510
+ secretIbGibs: IbGib_V1<SecretData_V1>[];
511
+ fnPromptPassword: (title: string, msg: string) => Promise<string | null>;
512
+ dontPrompt?: boolean;
513
+ checkCacheFirst?: boolean;
514
+ cacheAfter?: boolean;
515
+ }): Promise<string | null>;
516
+ getCiphertextIbGib<TEncryptionIbGib extends IbGib_V1<EncryptionData_V1>, TMetadata = any>({ plaintext, password, encryptionIbGib, confirm, persist, ibRoot, publicIbMetadata, publicMetadata, }: {
517
+ /**
518
+ * Um...data...to...erm...encrypt...(as a string)
519
+ */
520
+ plaintext: string;
521
+ /**
522
+ * Password to perform the encryption.
523
+ */
524
+ password: string;
525
+ /**
526
+ * Information about encryption, i.e. encryption settings.
527
+ */
528
+ encryptionIbGib: TEncryptionIbGib;
529
+ /**
530
+ * Decrypts and checks against original data
531
+ */
532
+ confirm?: boolean;
533
+ /**
534
+ * If true, will persist the ibgib
535
+ */
536
+ persist?: boolean;
537
+ /**
538
+ * If you provide this, the resulting ibgib will have the following format:
539
+ * `${ibRoot} ${publicIbMetadata}`. Otherwise, this will default to:
540
+ * `ciphertext ${publicIbMetadata}`, or just `ciphertext` if
541
+ * `publicIbMetadata` is falsy.
542
+ */
543
+ ibRoot?: string;
544
+ /**
545
+ * If you want to include metadata in the ib itself of the
546
+ * ciphertext ibgib. This will of course make this metadata
547
+ * available without loading the full ibgib, but will increase
548
+ * storage size because every address linking to the ibgib will
549
+ * include this as well.
550
+ */
551
+ publicIbMetadata?: string;
552
+ /**
553
+ * If you want to include public, unencrypted metadata in the ibgib's
554
+ * data body itself.
555
+ */
556
+ publicMetadata?: TMetadata;
557
+ }): Promise<TransformResult<CiphertextIbGib_V1>>;
558
+ /**
559
+ * Brings together a ciphertext and secretIbGibs to decrypt
560
+ * the `ciphertextIbGib.data.ciphertext`
561
+ * @returns plaintext string of `ciphertextIbGib.data.ciphertext`
562
+ */
563
+ getPlaintextString({ ciphertextIbGib, secretIbGibs, fnPromptPassword, dontPrompt, space, }: {
564
+ ciphertextIbGib: CiphertextIbGib_V1;
565
+ secretIbGibs: SecretIbGib_V1[];
566
+ fnPromptPassword: (title: string, msg: string) => Promise<string | null>;
567
+ dontPrompt?: boolean;
568
+ space: IbGibSpaceAny;
569
+ }): Promise<string>;
570
+ unwrapEncryptedSyncSpace({ encryptedSpace, fnPromptPassword, dontPrompt, space, fnSpaceFactory, }: {
571
+ encryptedSpace: IbGibSpaceAny;
572
+ fnPromptPassword: (title: string, msg: string) => Promise<string | null>;
573
+ dontPrompt?: boolean;
574
+ space?: IbGibSpaceAny;
575
+ fnSpaceFactory: (unencryptedSpaceData: any) => Promise<IbGibSpaceAny>;
576
+ }): Promise<IbGibSpaceAny>;
577
+ /**
578
+ * Caching user password secret in memory only.
579
+ *
580
+ * Just to prevent plaintext passwords from just sitting in memory,
581
+ * this is a slight layer of indirection for caching
582
+ *
583
+ * @returns user password
584
+ */
585
+ protected getCachedSecretPassword({ cacheKey, }: {
586
+ cacheKey: string;
587
+ }): Promise<string | undefined>;
588
+ protected setCachedSecretPassword({ cacheKey, secretPassword, force, }: {
589
+ cacheKey: string;
590
+ secretPassword: string;
591
+ force?: boolean;
592
+ }): Promise<void>;
593
+ /**
594
+ * If we don't have outerspaces/cloud endpoints, we'll do that here.
595
+ *
596
+ * @returns true if creation was successfully created, else false.
597
+ */
598
+ protected _createOuterspaceAndRequiredIbGibs({ space, fnPromptSecret, fnPromptEncryption, fnPromptOuterSpace, }: {
599
+ space: IbGibSpaceAny;
600
+ fnPromptSecret: (space: IbGibSpaceAny) => Promise<SecretIbGib_V1 | undefined>;
601
+ fnPromptEncryption: (space: IbGibSpaceAny) => Promise<EncryptionIbGib | undefined>;
602
+ fnPromptOuterSpace: (space: IbGibSpaceAny) => Promise<IbGibSpaceAny | undefined>;
603
+ }): Promise<boolean>;
604
+ protected _createSecret({ space, fnPromptSecret, }: {
605
+ space: IbGibSpaceAny;
606
+ fnPromptSecret: (space: IbGibSpaceAny) => Promise<SecretIbGib_V1 | undefined>;
607
+ }): Promise<boolean>;
608
+ protected _createEncryption({ space, fnPromptEncryption, }: {
609
+ space: IbGibSpaceAny;
610
+ fnPromptEncryption: (space: IbGibSpaceAny) => Promise<EncryptionIbGib | undefined>;
611
+ }): Promise<boolean>;
612
+ protected _createOuterspace({ space, fnPromptOuterSpace, }: {
613
+ space: IbGibSpaceAny;
614
+ fnPromptOuterSpace: (space: IbGibSpaceAny) => Promise<IbGibSpaceAny | undefined>;
615
+ }): Promise<boolean>;
616
+ getAppSyncSpaces({ unwrapEncrypted, createIfNone, dontPrompt, space, fnSpaceFactory, fnPromptSecret, fnPromptEncryption, fnPromptOuterSpace, }: {
617
+ unwrapEncrypted: boolean;
618
+ createIfNone: boolean;
619
+ /**
620
+ * If true, don't prompt the user if we don't have it already cached.
621
+ *
622
+ * We don't want the user to hit the page and then always have to type in
623
+ * the password, just because my password code sucks atow.
624
+ */
625
+ dontPrompt?: boolean;
626
+ space?: IbGibSpaceAny;
627
+ fnSpaceFactory: (unencryptedSpaceData: any) => Promise<IbGibSpaceAny>;
628
+ fnPromptSecret: (space: IbGibSpaceAny) => Promise<SecretIbGib_V1 | undefined>;
629
+ fnPromptEncryption: (space: IbGibSpaceAny) => Promise<EncryptionIbGib | undefined>;
630
+ fnPromptOuterSpace: (space: IbGibSpaceAny) => Promise<IbGibSpaceAny | undefined>;
631
+ }): Promise<IbGibSpaceAny[]>;
632
+ getAppRobbotIbGibs({ createIfNone, space, }: {
633
+ createIfNone: boolean;
634
+ space?: IbGibSpaceAny;
635
+ }): Promise<RobbotIbGib_V1[]>;
636
+ getAppAppIbGibs({ createIfNone, space, }: {
637
+ createIfNone: boolean;
638
+ space?: IbGibSpaceAny;
639
+ }): Promise<AppIbGib_V1[]>;
640
+ protected subSagaSyncTimeLog: Subscription | undefined;
641
+ syncIbGibs({ dependencyGraphIbGibs, watch, fnPreSyncProgress, fnSpaceFactory, fnPromptSecret, fnPromptEncryption, fnPromptOuterSpace, }: {
642
+ dependencyGraphIbGibs?: IbGib_V1[];
643
+ /**
644
+ * If true, will watch ibgibs in dependency graph that have timelines
645
+ * (tjps).
646
+ */
647
+ watch?: boolean;
648
+ /**
649
+ * The meat of the sync process is tracked via a status within the sync
650
+ * spaces themselves. I'm addign this fn to track the pre and post progress
651
+ * stuff, since decrypting takes some time, and building the dependency
652
+ * graphs takes time. Both of these happen before the actual syncing occurs
653
+ * in the spaces.
654
+ */
655
+ fnPreSyncProgress?: (msg: string) => Promise<void>;
656
+ fnSpaceFactory: (unencryptedSpaceData: any) => Promise<IbGibSpaceAny>;
657
+ fnPromptSecret: (space: IbGibSpaceAny) => Promise<SecretIbGib_V1 | undefined>;
658
+ fnPromptEncryption: (space: IbGibSpaceAny) => Promise<EncryptionIbGib | undefined>;
659
+ fnPromptOuterSpace: (space: IbGibSpaceAny) => Promise<IbGibSpaceAny | undefined>;
660
+ }): Promise<SyncSagaInfo[] | undefined>;
661
+ protected finalizeSyncSaga({ sagaInfo, error, }: {
662
+ sagaInfo: SyncSagaInfo;
663
+ error?: any;
664
+ }): void;
665
+ protected finalizeAllSyncSagas_NoThrow({ error, }: {
666
+ error?: any;
667
+ }): void;
668
+ protected _updateSagaInfoMapAndIsSyncingFlag(): void;
669
+ protected _createNewSyncSagaInfo({ multiSpaceOpId, allIbGibsToSync, syncSpace, participants, sagaId, syncStatus$, }: {
670
+ multiSpaceOpId: string;
671
+ allIbGibsToSync: IbGib_V1[];
672
+ syncSpace: IbGibSpaceAny;
673
+ participants: ParticipantInfo[];
674
+ /**
675
+ * have to make this early to enable the console.time/Log calls.
676
+ */
677
+ sagaId: string;
678
+ /**
679
+ * have to make this early to enable the console.time/Log calls.
680
+ */
681
+ syncStatus$: ReplaySubject<SyncStatusIbGib>;
682
+ }): Promise<SyncSagaInfo>;
683
+ /**
684
+ * this {@link IbGibsService} acts as the local app space intermediary,
685
+ * a broker between the local space and the sync space(s). So this
686
+ * function's job is to coordinate sending the given ibgibs
687
+ * to a single sync space and return the observable (subject)
688
+ * corresponding to the multi-step sync process.
689
+ *
690
+ * The caller will be responsible for coordinating among sync
691
+ * space results and handling updates to local space ibgib's,
692
+ * such as rebasing/updating/etc.
693
+ *
694
+ * @returns
695
+ */
696
+ protected _startSync({ syncSagaInfo, watch, syncTimelogName, }: {
697
+ syncSagaInfo: SyncSagaInfo;
698
+ watch?: boolean;
699
+ /**
700
+ * Will confirm via checking existence of ibgibs in sync space after
701
+ * writing them.
702
+ *
703
+ * NOTE: IGNORED ATM
704
+ */
705
+ syncTimelogName: string;
706
+ }): Promise<SyncSpaceResultIbGib>;
707
+ /**
708
+ * Coming in to this function, we have results from one or more
709
+ * sync spaces. Here are the combinations of expected outcomes:
710
+ *
711
+ * 1. All success, each returns the exact same new ib^gib address(es).
712
+ * 2. All success, but different spaces return different ib^gib address(es).
713
+ * 3. Some success, which returns exact same new ib^gib, some error.
714
+ * 4. Some success, more than one ib^gib address(es), some error.
715
+ * 5. All error.
716
+ *
717
+ * For the first naive implementation, we will always be optimistic,
718
+ * assuming that errors will be resolved with enough attempts. This
719
+ * is closely related to our initial optimistic strategy of
720
+ * "access is authorization" + "unordered dna equivalence". These
721
+ * strategies mean that we are simply, optimistically, and
722
+ * naively applying incoming dna transforms to ibgib timelines.
723
+ * So failure should only result from a failure at the communication
724
+ * layer, assuming non-adversarial conditions.
725
+ *
726
+ * ## future
727
+ *
728
+ * The handling of this should absolutely be generalized to the
729
+ * requirements for interspatial relationships. This is the language
730
+ * that must be implemented to deal with this in a dynamic fashion.
731
+ *
732
+ * This does not equate to only "ad hoc" in the sense of untested/untried.
733
+ * This means that we have an "on-chain", public linked requirement
734
+ * for consensus as opposed to a hard-coded consensus as is defined
735
+ * in this function.
736
+ *
737
+ * It is in this generalization that byzantine resolution can be
738
+ * achieved through whichever mechanism is correct for the use case.
739
+ */
740
+ protected _handleSagaUpdates(): Promise<void>;
741
+ protected _handleSyncStatusIbGib({ status, sagaInfo, }: {
742
+ status: SyncStatusIbGib;
743
+ sagaInfo: SyncSagaInfo;
744
+ }): Promise<void>;
745
+ protected handleSyncStatus_Merged({ status, }: {
746
+ status: SyncStatusIbGib;
747
+ }): Promise<void>;
748
+ protected handleSyncStatus_Complete({ sagaInfo, }: {
749
+ sagaInfo: SyncSagaInfo;
750
+ }): Promise<void>;
751
+ /**
752
+ * Searches through timelines and gets every single one of them
753
+ * in the local space. (ideally)
754
+ *
755
+ * ## notes
756
+ *
757
+ * So if you pass in an ibgib with a reference to old ibgibs that
758
+ * have not been updated to the latest, this will get those latest.
759
+ *
760
+ * @returns all ibgibs related to given ibgibs
761
+ */
762
+ protected _getLatestIbGibsWithTjps({ ibGibs, warnIfMultipleLocalTimelines, }: {
763
+ ibGibs: IbGib_V1[];
764
+ /**
765
+ * I've already written the code to check for this. But I think
766
+ * this will be normal when put/merging.
767
+ */
768
+ warnIfMultipleLocalTimelines?: boolean;
769
+ }): Promise<IbGib_V1[]>;
770
+ protected handleWatchTjpUpdates({ updates, outerSpace, localUserSpace, }: {
771
+ updates: {
772
+ [tjpAddr: string]: IbGibAddr;
773
+ };
774
+ outerSpace: IbGibSpaceAny;
775
+ localUserSpace: IbGibSpaceAny;
776
+ }): Promise<void>;
777
+ enableAutosync({ tjpIbGibs, }: {
778
+ tjpIbGibs: IbGib_V1[];
779
+ }): Promise<void>;
780
+ disableAutosync({ tjpIbGibs, }: {
781
+ tjpIbGibs: IbGib_V1[];
782
+ }): Promise<void>;
783
+ protected loadAutoSyncs(): Promise<void>;
784
+ /**
785
+ * checks to see if autosync is enabled for a given `tjp`.
786
+ *
787
+ * NOTE: this only checks cache atm.
788
+ *
789
+ * @returns true if autosync is enabled for the given tjp, else false
790
+ */
791
+ autosyncIsEnabled({ tjp, }: {
792
+ tjp: IbGib_V1;
793
+ }): boolean;
794
+ }
795
+ //# sourceMappingURL=metaspace-base.d.mts.map