@ibgib/core-gib 0.1.3 → 0.1.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.
Files changed (187) hide show
  1. package/README.md +26 -0
  2. package/dist/assumptions.respec.mjs.map +1 -1
  3. package/dist/common/alias/alias-helper.mjs +1 -1
  4. package/dist/common/alias/alias-helper.mjs.map +1 -1
  5. package/dist/common/comment/comment-helper.mjs.map +1 -1
  6. package/dist/common/display/display-helper.mjs.map +1 -1
  7. package/dist/common/display/display-types.d.mts +1 -1
  8. package/dist/common/display/display-types.d.mts.map +1 -1
  9. package/dist/common/encrypt/encrypt-helper.mjs.map +1 -1
  10. package/dist/common/encrypt/encrypt-types.d.mts +1 -1
  11. package/dist/common/encrypt/encrypt-types.d.mts.map +1 -1
  12. package/dist/common/error/error-helper.mjs.map +1 -1
  13. package/dist/common/form/form-helper.mjs.map +1 -1
  14. package/dist/common/form/form-items.d.mts.map +1 -1
  15. package/dist/common/import-export/import-export-helper.web.mjs.map +1 -1
  16. package/dist/common/link/link-helper.mjs.map +1 -1
  17. package/dist/common/meta-stone/meta-stone-helper.mjs.map +1 -1
  18. package/dist/common/meta-stone/meta-stone.respec.mjs.map +1 -1
  19. package/dist/common/other/graph-helper.mjs +3 -3
  20. package/dist/common/other/graph-helper.mjs.map +1 -1
  21. package/dist/common/other/ibgib-helper.mjs.map +1 -1
  22. package/dist/common/other/ibgib-helper.respec.mjs.map +1 -1
  23. package/dist/common/other/other-constants.mjs +4 -4
  24. package/dist/common/other/other-constants.mjs.map +1 -1
  25. package/dist/common/other/other-helper.web.mjs.map +1 -1
  26. package/dist/common/other/other-types.d.mts +10 -10
  27. package/dist/common/other/other-types.d.mts.map +1 -1
  28. package/dist/common/other/svg-helper.mjs.map +1 -1
  29. package/dist/common/pic/pic-helper.mjs.map +1 -1
  30. package/dist/common/pubsub/observable/observable-base-v1.mjs +1 -1
  31. package/dist/common/pubsub/observable/observable-base-v1.mjs.map +1 -1
  32. package/dist/common/pubsub/observable/observable-event/observable-event-helper.mjs.map +1 -1
  33. package/dist/common/pubsub/observable/observable-helper.mjs.map +1 -1
  34. package/dist/common/pubsub/observable/observable-types.d.mts +1 -1
  35. package/dist/common/pubsub/observable/observable-types.d.mts.map +1 -1
  36. package/dist/common/pubsub/observer/observer-helper.mjs.map +1 -1
  37. package/dist/common/pubsub/observer/observer-types.d.mts.map +1 -1
  38. package/dist/common/pubsub/subject/subject-helper.mjs.map +1 -1
  39. package/dist/common/pubsub/subject/subject-types.d.mts +1 -1
  40. package/dist/common/pubsub/subject/subject-types.d.mts.map +1 -1
  41. package/dist/common/pubsub/subject/subject-v1.mjs.map +1 -1
  42. package/dist/common/pubsub/subject/subject.respec.mjs.map +1 -1
  43. package/dist/common/pubsub/subscription/subscription-helper.mjs.map +1 -1
  44. package/dist/common/pubsub/subscription/subscription-types.d.mts.map +1 -1
  45. package/dist/common/pubsub/subscription/subscription-v1.mjs.map +1 -1
  46. package/dist/common/secret/secret-helper.mjs.map +1 -1
  47. package/dist/common/secret/secret-types.d.mts +1 -1
  48. package/dist/common/secret/secret-types.d.mts.map +1 -1
  49. package/dist/common/secret/secret.respec.mjs +1 -1
  50. package/dist/common/secret/secret.respec.mjs.map +1 -1
  51. package/dist/common/tag/tag-helper.mjs.map +1 -1
  52. package/dist/core-helper.respec.mjs.map +1 -1
  53. package/dist/respec-gib.node.mjs +3 -1
  54. package/dist/respec-gib.node.mjs.map +1 -1
  55. package/dist/spec-helper.node.respec.d.mts.map +1 -1
  56. package/dist/spec-helper.node.respec.mjs +4 -6
  57. package/dist/spec-helper.node.respec.mjs.map +1 -1
  58. package/dist/timeline/timeline-api.mjs +12 -12
  59. package/dist/timeline/timeline-api.mjs.map +1 -1
  60. package/dist/witness/anonymous-fn/anonymous-fn-helper.mjs.map +1 -1
  61. package/dist/witness/anonymous-fn/anonymous-fn-v1.mjs.map +1 -1
  62. package/dist/witness/app/app-base-v1.mjs.map +1 -1
  63. package/dist/witness/app/app-helper.mjs.map +1 -1
  64. package/dist/witness/app/app-types.d.mts.map +1 -1
  65. package/dist/witness/factory/dynamic-form-factory-base.mjs.map +1 -1
  66. package/dist/witness/light-witness-base-v1.mjs.map +1 -1
  67. package/dist/witness/robbot/robbot-base-v1.mjs +1 -1
  68. package/dist/witness/robbot/robbot-base-v1.mjs.map +1 -1
  69. package/dist/witness/robbot/robbot-helper.mjs.map +1 -1
  70. package/dist/witness/robbot/robbot-types.d.mts +20 -20
  71. package/dist/witness/robbot/robbot-types.d.mts.map +1 -1
  72. package/dist/witness/space/bootstrap/bootstrap-helper.mjs.map +1 -1
  73. package/dist/witness/space/filesystem-space/filesystem-space-v1.mjs.map +1 -1
  74. package/dist/witness/space/filesystem-space/filesystem-space-v1.respec.mjs.map +1 -1
  75. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.mjs.map +1 -1
  76. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.d.mts.map +1 -1
  77. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.mjs +1 -1
  78. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.mjs.map +1 -1
  79. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.mjs.map +1 -1
  80. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.mjs.map +1 -1
  81. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.mjs.map +1 -1
  82. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.mjs.map +1 -1
  83. package/dist/witness/space/inner-space/inner-space-v1.mjs.map +1 -1
  84. package/dist/witness/space/inner-space/inner-space-v1.respec.mjs +4 -5
  85. package/dist/witness/space/inner-space/inner-space-v1.respec.mjs.map +1 -1
  86. package/dist/witness/space/metaspace/metaspace-base.mjs +1 -1
  87. package/dist/witness/space/metaspace/metaspace-base.mjs.map +1 -1
  88. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs.map +1 -1
  89. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.mjs.map +1 -1
  90. package/dist/witness/space/outer-space/outer-space-helper.mjs.map +1 -1
  91. package/dist/witness/space/outer-space/outer-space-types.d.mts.map +1 -1
  92. package/dist/witness/space/outer-space/outer-space-types.mjs +1 -1
  93. package/dist/witness/space/outer-space/outer-space-types.mjs.map +1 -1
  94. package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs.map +1 -1
  95. package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs.map +1 -1
  96. package/dist/witness/space/space-base-v1.mjs.map +1 -1
  97. package/dist/witness/space/space-constants.mjs +4 -4
  98. package/dist/witness/space/space-constants.mjs.map +1 -1
  99. package/dist/witness/space/space-helper.mjs +2 -2
  100. package/dist/witness/space/space-helper.mjs.map +1 -1
  101. package/dist/witness/space/space-respec-helper.mjs.map +1 -1
  102. package/dist/witness/space/space-types.d.mts +4 -4
  103. package/dist/witness/space/space-types.d.mts.map +1 -1
  104. package/dist/witness/witness-base-v1.mjs.map +1 -1
  105. package/dist/witness/witness-form-builder.mjs.map +1 -1
  106. package/dist/witness/witness-helper.mjs.map +1 -1
  107. package/dist/witness/witness-with-context/witness-with-context-base-v1.mjs.map +1 -1
  108. package/package.json +5 -5
  109. package/src/respec-gib.node.mts +3 -1
  110. package/src/spec-helper.node.respec.mts +4 -6
  111. package/src/witness/robbot/robbot-base-v1.mts +1 -1
  112. package/src/witness/space/inner-space/inner-space-v1.respec.mts +4 -6
  113. package/dist/witness/keystone/keystone-base-v1.d.mts +0 -177
  114. package/dist/witness/keystone/keystone-base-v1.d.mts.map +0 -1
  115. package/dist/witness/keystone/keystone-base-v1.mjs +0 -397
  116. package/dist/witness/keystone/keystone-base-v1.mjs.map +0 -1
  117. package/dist/witness/keystone/keystone-constants.d.mts +0 -2
  118. package/dist/witness/keystone/keystone-constants.d.mts.map +0 -1
  119. package/dist/witness/keystone/keystone-constants.mjs +0 -2
  120. package/dist/witness/keystone/keystone-constants.mjs.map +0 -1
  121. package/dist/witness/keystone/keystone-helper.d.mts +0 -9
  122. package/dist/witness/keystone/keystone-helper.d.mts.map +0 -1
  123. package/dist/witness/keystone/keystone-helper.mjs +0 -53
  124. package/dist/witness/keystone/keystone-helper.mjs.map +0 -1
  125. package/dist/witness/keystone/keystone-types.d.mts +0 -164
  126. package/dist/witness/keystone/keystone-types.d.mts.map +0 -1
  127. package/dist/witness/keystone/keystone-types.mjs +0 -46
  128. package/dist/witness/keystone/keystone-types.mjs.map +0 -1
  129. package/dist/witness/keystone/keystone.d.mts +0 -2
  130. package/dist/witness/keystone/keystone.d.mts.map +0 -1
  131. package/dist/witness/keystone/keystone.mjs +0 -2
  132. package/dist/witness/keystone/keystone.mjs.map +0 -1
  133. package/dist/witness/keystone/keystone.respec.d.mts +0 -11
  134. package/dist/witness/keystone/keystone.respec.d.mts.map +0 -1
  135. package/dist/witness/keystone/keystone.respec.mjs +0 -11
  136. package/dist/witness/keystone/keystone.respec.mjs.map +0 -1
  137. package/dist/witness/keystone/math-keystone/math-keystone-constants.d.mts +0 -2
  138. package/dist/witness/keystone/math-keystone/math-keystone-constants.d.mts.map +0 -1
  139. package/dist/witness/keystone/math-keystone/math-keystone-constants.mjs +0 -2
  140. package/dist/witness/keystone/math-keystone/math-keystone-constants.mjs.map +0 -1
  141. package/dist/witness/keystone/math-keystone/math-keystone-helper.d.mts +0 -13
  142. package/dist/witness/keystone/math-keystone/math-keystone-helper.d.mts.map +0 -1
  143. package/dist/witness/keystone/math-keystone/math-keystone-helper.mjs +0 -41
  144. package/dist/witness/keystone/math-keystone/math-keystone-helper.mjs.map +0 -1
  145. package/dist/witness/keystone/math-keystone/math-keystone-types.d.mts +0 -80
  146. package/dist/witness/keystone/math-keystone/math-keystone-types.d.mts.map +0 -1
  147. package/dist/witness/keystone/math-keystone/math-keystone-types.mjs +0 -9
  148. package/dist/witness/keystone/math-keystone/math-keystone-types.mjs.map +0 -1
  149. package/dist/witness/keystone/math-keystone/math-keystone-v1.d.mts +0 -34
  150. package/dist/witness/keystone/math-keystone/math-keystone-v1.d.mts.map +0 -1
  151. package/dist/witness/keystone/math-keystone/math-keystone-v1.mjs +0 -119
  152. package/dist/witness/keystone/math-keystone/math-keystone-v1.mjs.map +0 -1
  153. package/dist/witness/keystone/math-keystone/math-keystone.respec.d.mts +0 -20
  154. package/dist/witness/keystone/math-keystone/math-keystone.respec.d.mts.map +0 -1
  155. package/dist/witness/keystone/math-keystone/math-keystone.respec.mjs +0 -76
  156. package/dist/witness/keystone/math-keystone/math-keystone.respec.mjs.map +0 -1
  157. package/dist/witness/keystone/zkp-keystone/zkp-keystone-constants.d.mts +0 -2
  158. package/dist/witness/keystone/zkp-keystone/zkp-keystone-constants.d.mts.map +0 -1
  159. package/dist/witness/keystone/zkp-keystone/zkp-keystone-constants.mjs +0 -2
  160. package/dist/witness/keystone/zkp-keystone/zkp-keystone-constants.mjs.map +0 -1
  161. package/dist/witness/keystone/zkp-keystone/zkp-keystone-helper.d.mts +0 -2
  162. package/dist/witness/keystone/zkp-keystone/zkp-keystone-helper.d.mts.map +0 -1
  163. package/dist/witness/keystone/zkp-keystone/zkp-keystone-helper.mjs +0 -2
  164. package/dist/witness/keystone/zkp-keystone/zkp-keystone-helper.mjs.map +0 -1
  165. package/dist/witness/keystone/zkp-keystone/zkp-keystone-types.d.mts +0 -2
  166. package/dist/witness/keystone/zkp-keystone/zkp-keystone-types.d.mts.map +0 -1
  167. package/dist/witness/keystone/zkp-keystone/zkp-keystone-types.mjs +0 -2
  168. package/dist/witness/keystone/zkp-keystone/zkp-keystone-types.mjs.map +0 -1
  169. package/dist/witness/keystone/zkp-keystone/zkp-keystone-v1.d.mts +0 -2
  170. package/dist/witness/keystone/zkp-keystone/zkp-keystone-v1.d.mts.map +0 -1
  171. package/dist/witness/keystone/zkp-keystone/zkp-keystone-v1.mjs +0 -2
  172. package/dist/witness/keystone/zkp-keystone/zkp-keystone-v1.mjs.map +0 -1
  173. package/src/witness/keystone/keystone-base-v1.mts +0 -450
  174. package/src/witness/keystone/keystone-constants.mts +0 -0
  175. package/src/witness/keystone/keystone-helper.mts +0 -56
  176. package/src/witness/keystone/keystone-types.mts +0 -200
  177. package/src/witness/keystone/keystone.mts +0 -0
  178. package/src/witness/keystone/keystone.respec.mts +0 -9
  179. package/src/witness/keystone/math-keystone/math-keystone-constants.mts +0 -0
  180. package/src/witness/keystone/math-keystone/math-keystone-helper.mts +0 -45
  181. package/src/witness/keystone/math-keystone/math-keystone-types.mts +0 -115
  182. package/src/witness/keystone/math-keystone/math-keystone-v1.mts +0 -139
  183. package/src/witness/keystone/math-keystone/math-keystone.respec.mts +0 -122
  184. package/src/witness/keystone/zkp-keystone/zkp-keystone-constants.mts +0 -0
  185. package/src/witness/keystone/zkp-keystone/zkp-keystone-helper.mts +0 -0
  186. package/src/witness/keystone/zkp-keystone/zkp-keystone-types.mts +0 -0
  187. package/src/witness/keystone/zkp-keystone/zkp-keystone-v1.mts +0 -0
@@ -1,397 +0,0 @@
1
- import { argy_, isArg, isCommand, resulty_ } from '../witness-helper.mjs';
2
- import { WitnessWithContextBase_V1 } from '../witness-with-context/witness-with-context-base-v1.mjs';
3
- import { getErrorIbGib } from '../../common/error/error-helper.mjs';
4
- import { KeystoneCmd,
5
- // KeystoneCmd,
6
- // KeystoneCmdData, KeystoneCmdRel8ns, KeystoneCmdIbGib,
7
- // KeystoneResultData, KeystoneResultRel8ns, KeystoneResultIbGib,
8
- } from './keystone-types.mjs';
9
- import { validateCommonKeystoneData } from './keystone-helper.mjs';
10
- import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
11
- const logalot = GLOBAL_LOG_A_LOT;
12
- /**
13
- * Keystone is the last major piece of the ibgib architecture. This is used to
14
- * implement distributed identity that gets added on-chain alongside other data
15
- * and metadata, instead of only relying solely upon asymmetric crypto for e.g.
16
- * signatures.
17
- *
18
- * Override this class with specific concrete implementations of keystones,
19
- * which atow I believe will differ mainly in their specific challenge
20
- * implementations.
21
- *
22
- * ## notes
23
- *
24
- * ### composite keystones
25
- *
26
- * At first I was thinking I was going to make keystones composite (super
27
- * keystones with rel8ns pointing to other keystones), but at least to start
28
- * with, I will have a specific concrete implementation class that covers
29
- * multiple keystone composition.
30
- */
31
- export class KeystoneBase_V1 extends WitnessWithContextBase_V1 {
32
- /**
33
- * Log context for convenience with logging. (Ignore if you don't want to use this.)
34
- */
35
- lc = `[${KeystoneBase_V1.name}]`;
36
- // /**
37
- // * Reference to the local ibgibs service, which is one way at getting at the
38
- // * local user space.
39
- // */
40
- // metaspace: MetaspaceService | undefined;
41
- constructor(initialData, initialRel8ns) {
42
- super(initialData, initialRel8ns);
43
- }
44
- /**
45
- * At this point in time, the arg has already been intrinsically validated,
46
- * as well as the internal state of this keystone.
47
- */
48
- async witnessImpl(arg) {
49
- const lc = `${this.lc}[${this.witnessImpl.name}]`;
50
- try {
51
- if (logalot) {
52
- console.log(`${lc} starting...`);
53
- }
54
- await this.loadNewerSelfIfAvailable();
55
- let result = undefined;
56
- if (isArg({ ibGib: arg })) {
57
- result = await this.routeAndDoArg({ arg });
58
- }
59
- else {
60
- result = await this.doNonArg({ ibGib: arg });
61
- }
62
- // if we didn't get a result, try the default.
63
- if (!result) {
64
- console.warn(`${lc} result still falsy. doing default handler. (W: 924d1fc93ad5464e81f71f2783d778a8)`);
65
- result = await this.doDefault({ ibGib: arg });
66
- }
67
- if (!result) {
68
- console.warn(`${lc} result falsy...Could not produce result? Was doDefault implemented in concrete class? (W: 78861cb3c37546fa8f0b2bee4c50f832)`);
69
- }
70
- return result;
71
- }
72
- catch (error) {
73
- console.error(`${lc} ${error.message}`);
74
- throw error;
75
- }
76
- finally {
77
- if (logalot) {
78
- console.log(`${lc} complete.`);
79
- }
80
- }
81
- }
82
- /**
83
- * Base routing executes different if incoming is a cmd options arg, i.e.,
84
- * if the `data.cmd` is truthy (atow). {@link isArg} is expected to be true
85
- * at this point. If not, logs an error, **but does not throw**, and returns
86
- * undefined.
87
- *
88
- * Default routing checks arg for command, or if not, checks if comment/pic.
89
- * If neither of those, then returns undefined atow.
90
- *
91
- * Override this function to create more advanced custom routing.
92
- *
93
- * ## notes
94
- *
95
- * In general, an app ibgib acts more like a normal application in that it
96
- * accepts commands and not requests. Robbots are more geared to requests,
97
- * handled semantically.
98
- *
99
- * @see {@link isArg}
100
- * @see {@link doCmdArg}
101
- * @see {@link doDefault}.
102
- */
103
- async routeAndDoArg({ arg, }) {
104
- const lc = `${this.lc}[${this.routeAndDoArg.name}]`;
105
- try {
106
- if (logalot) {
107
- console.log(`${lc} starting...`);
108
- }
109
- const ibGib = arg;
110
- if (!isArg({ ibGib })) {
111
- throw new Error(`ibGib is not an arg (E: 7e5ed6e3be45480e992c75a1c21f1b4e)`);
112
- }
113
- if (isCommand({ ibGib })) {
114
- return this.doCmdArg({ arg });
115
- }
116
- else {
117
- return undefined;
118
- }
119
- }
120
- catch (error) {
121
- console.error(`${lc} ${error.message}`);
122
- if (this.data?.catchAllErrors) {
123
- return (await getErrorIbGib({ rawMsg: error.message }));
124
- }
125
- else {
126
- throw error;
127
- }
128
- }
129
- finally {
130
- if (logalot) {
131
- console.log(`${lc} complete.`);
132
- }
133
- }
134
- }
135
- // #region do cmd args
136
- /**
137
- * By default, this routes to {@link doCmdIb}, {@link doCmdGib} & {@link
138
- * doCmdIbgib}. This is largely to limit scope of responsibility of app to
139
- * basic functions. But this is not a concrete rule written in stone.
140
- *
141
- * You can always override this and route to other commands before calling
142
- * this with `super.doCmdArg` as a fallback (if you still want to use this
143
- * function.)
144
- *
145
- * Note that this @throws an error if the data.cmd is not recognized. In this
146
- * implementation, this occurs if it isn't an ib/gib/ibgib _command_.
147
- *
148
- * ## commands
149
- *
150
- * ### confirm
151
- *
152
- * confirm possession of the keystone via the keystone's challenges as set
153
- * out in the keystone's metadata.
154
- *
155
- * ### confirm final
156
- *
157
- * final confirmation of a secret of the stone. "kills" the stone once used.
158
- * The point is to verify if a participant has the full secret of the stone,
159
- * and not just mimicked part of the stone's ownership.
160
- *
161
- * ### revoke
162
- *
163
- * revoke due to being broken.
164
- * maybe is a flavor of the confirm final?
165
- */
166
- doCmdArg({ arg, }) {
167
- const lc = `${this.lc}[${this.doCmdArg.name}]`;
168
- try {
169
- if (logalot) {
170
- console.log(`${lc} starting...`);
171
- }
172
- if (!arg.data?.cmd) {
173
- throw new Error(`invalid cmd arg. arg.data.cmd required. (E: 470aabf26ca6406b84dbae3b9b39639d)`);
174
- }
175
- if (arg.data.cmd === KeystoneCmd.ib) {
176
- return this.doCmdIb({ arg: arg });
177
- }
178
- else if (arg.data.cmd === KeystoneCmd.gib) {
179
- return this.doCmdGib({ arg: arg });
180
- }
181
- else if (arg.data.cmd === KeystoneCmd.ibgib) {
182
- return this.doCmdIbgib({ arg: arg });
183
- }
184
- else {
185
- throw new Error(`unknown arg.data.cmd: ${arg.data.cmd} (E: 0eb81ae8c3834f47865af0ac7b7a9fd6)`);
186
- }
187
- }
188
- catch (error) {
189
- console.error(`${lc} ${error.message}`);
190
- throw error;
191
- }
192
- finally {
193
- if (logalot) {
194
- console.log(`${lc} complete.`);
195
- }
196
- }
197
- }
198
- doCmdIb({ arg, }) {
199
- return this.extend({ arg });
200
- }
201
- doCmdGib({ arg, }) {
202
- const lc = `${this.lc}[${this.doCmdGib.name}]`;
203
- try {
204
- if (logalot) {
205
- console.log(`${lc} starting...`);
206
- }
207
- throw new Error(`not implemented in base class (E: bb16814f46984a9dafac5b85d8ec1f74)`);
208
- }
209
- catch (error) {
210
- console.error(`${lc} ${error.message}`);
211
- throw error;
212
- }
213
- finally {
214
- if (logalot) {
215
- console.log(`${lc} complete.`);
216
- }
217
- }
218
- }
219
- doCmdIbgib({ arg, }) {
220
- const lc = `${this.lc}[${this.doCmdIbgib.name}]`;
221
- try {
222
- if (logalot) {
223
- console.log(`${lc} starting...`);
224
- }
225
- throw new Error(`not implemented in base class (E: 6f3ed691d16a43f49145b2ed46fb28ba)`);
226
- }
227
- catch (error) {
228
- console.error(`${lc} ${error.message}`);
229
- throw error;
230
- }
231
- finally {
232
- if (logalot) {
233
- console.log(`${lc} complete.`);
234
- }
235
- }
236
- }
237
- // #endregion do cmd args
238
- // #region other stubbed do functions (doPic, doComment, doDefault)
239
- /**
240
- * Stubbed in base class for convenience. Doesn't have to be implemented.
241
- *
242
- * in the future, this may be able to be used for physical object
243
- * verification via picture.
244
- */
245
- doPic({ ibGib, }) {
246
- const lc = `${this.lc}[${this.doPic.name}]`;
247
- try {
248
- if (logalot) {
249
- console.log(`${lc} starting...`);
250
- }
251
- throw new Error(`not implemented in base class (E: ce5c9b30622f4b3bab198dde04de75e7)`);
252
- }
253
- catch (error) {
254
- console.error(`${lc} ${error.message}`);
255
- throw error;
256
- }
257
- finally {
258
- if (logalot) {
259
- console.log(`${lc} complete.`);
260
- }
261
- }
262
- }
263
- /**
264
- * Stubbed in base class for convenience. Doesn't have to be implemented.
265
- *
266
- * in the future, this may be able to handle natural language and route
267
- * accordingly.
268
- */
269
- doComment({ ibGib, }) {
270
- const lc = `${this.lc}[${this.doComment.name}]`;
271
- try {
272
- if (logalot) {
273
- console.log(`${lc} starting...`);
274
- }
275
- throw new Error(`not implemented in base class (E: c90f5bddaa58446fb4de638816974b6c)`);
276
- }
277
- catch (error) {
278
- console.error(`${lc} ${error.message}`);
279
- throw error;
280
- }
281
- finally {
282
- if (logalot) {
283
- console.log(`${lc} complete.`);
284
- }
285
- }
286
- }
287
- doNonArg({ ibGib, }) {
288
- const lc = `${this.lc}[${this.doNonArg.name}]`;
289
- try {
290
- if (logalot) {
291
- console.log(`${lc} starting...`);
292
- }
293
- return this.doDefault({ ibGib });
294
- }
295
- catch (error) {
296
- console.error(`${lc} ${error.message}`);
297
- throw error;
298
- }
299
- finally {
300
- if (logalot) {
301
- console.log(`${lc} complete.`);
302
- }
303
- }
304
- }
305
- /**
306
- * Stubbed in base class for convenience. Doesn't have to be implemented.
307
- */
308
- doDefault({ ibGib, }) {
309
- const lc = `${this.lc}[${this.doDefault.name}]`;
310
- try {
311
- if (logalot) {
312
- console.log(`${lc} starting...`);
313
- }
314
- throw new Error(`not implemented in base class (E: bee031bb4c974a71bae82df7cff2b4e1)`);
315
- // return this.doDefaultImpl({ibGib});
316
- }
317
- catch (error) {
318
- console.error(`${lc} ${error.message}`);
319
- throw error;
320
- }
321
- finally {
322
- if (logalot) {
323
- console.log(`${lc} complete.`);
324
- }
325
- }
326
- }
327
- // #endregion other stubbed do functions (doPic, doComment, doDefault)
328
- /**
329
- * validates against common app qualities.
330
- *
331
- * Override this with a call to `super.validateThis` for custom validation
332
- * for descending app classes.
333
- *
334
- * @returns validation errors common to all apps, if any errors exist.
335
- */
336
- async validateThis() {
337
- const lc = `${this.lc}[${this.validateThis.name}]`;
338
- try {
339
- if (logalot) {
340
- console.log(`${lc} starting...`);
341
- }
342
- if (!this.data) {
343
- throw new Error(`(UNEXPECTED) this.data falsy? (E: bd4b0fc836774eb288b8b07ec79cb4af)`);
344
- }
345
- const errors = [
346
- // ...await super.validateThis(),
347
- ...validateCommonKeystoneData({ appData: this.data }),
348
- ];
349
- return errors;
350
- }
351
- catch (error) {
352
- console.error(`${lc} ${error.message}`);
353
- throw error;
354
- }
355
- finally {
356
- if (logalot) {
357
- console.log(`${lc} complete.`);
358
- }
359
- }
360
- }
361
- /**
362
- * builds an arg ibGib.
363
- *
364
- * wrapper convenience to avoid long generic calls.
365
- */
366
- async argy({ argData, ibMetadata, noTimestamp, ibGibs, }) {
367
- const arg = await argy_({
368
- argData,
369
- ibMetadata,
370
- noTimestamp
371
- });
372
- if (ibGibs) {
373
- arg.ibGibs = ibGibs;
374
- }
375
- return arg;
376
- }
377
- /**
378
- * builds a result ibGib, if indeed a result ibgib is required.
379
- *
380
- * This is only useful in apps that have more structured inputs/outputs.
381
- * For those that simply accept any ibgib incoming and return a
382
- * primitive like ib^gib or whatever, then this is unnecessary.
383
- *
384
- * wrapper convenience to avoid long generic calls.
385
- */
386
- async resulty({ resultData, ibGibs, }) {
387
- const result = await resulty_({
388
- // ibMetadata: getKeystoneResultMetadata({space: this}),
389
- resultData,
390
- });
391
- if (ibGibs) {
392
- result.ibGibs = ibGibs;
393
- }
394
- return result;
395
- }
396
- }
397
- //# sourceMappingURL=keystone-base-v1.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keystone-base-v1.mjs","sourceRoot":"","sources":["../../../src/witness/keystone/keystone-base-v1.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0DAA0D,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAIH,WAAW;AACX,eAAe;AACf,wDAAwD;AACxD,iEAAiE;EACpE,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAMnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAgB,eAWlB,SAAQ,yBAGW;IAGnB;;OAEG;IACO,EAAE,GAAW,IAAI,eAAe,CAAC,IAAI,GAAG,CAAC;IAEnD,MAAM;IACN,+EAA+E;IAC/E,uBAAuB;IACvB,MAAM;IACN,2CAA2C;IAE3C,YAAY,WAAmB,EAAE,aAAuB;QACpD,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,WAAW,CAAC,GAAkB;QAC1C,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,W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AAC,OAAO,EAAE,CAAC,CAAC;YACxC,MAAM,KAAK,CAAC;SACf;gBAAS;YACN,IAAI,OAAO,EAAE;gBAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;aAAE;SACnD;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAKR,EACE,OAAO,EACP,UAAU,EACV,WAAW,EACX,MAAM,GAMT;QACG,MAAM,GAAG,GAAG,MAAM,KAAK,CAA8C;YACjE,OAAO;YACP,UAAU;YACV,WAAW;SACd,CAAC,CAAC;QAEH,IAAI,MAAM,EAAE;YAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;SAAE;QAEpC,OAAO,GAAG,CAAC;IACf,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,CAKX,EACE,UAAU,EACV,MAAM,GAIT;QACG,MAAM,MAAM,GAAG,MAAM,QAAQ,CAA4B;YACrD,wDAAwD;YACxD,UAAU;SACb,CAAC,CAAC;QACH,IAAI,MAAM,EAAE;YAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;SAAE;QACvC,OAAO,MAAM,CAAC;IAClB,CAAC;CAEJ"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=keystone-constants.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keystone-constants.d.mts","sourceRoot":"","sources":["../../../src/witness/keystone/keystone-constants.mts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=keystone-constants.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keystone-constants.mjs","sourceRoot":"","sources":["../../../src/witness/keystone/keystone-constants.mts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import { KeystoneData_V1 } from "./keystone-types.mjs";
2
- /**
3
- * validation of data common to all keystones (i.e. at the base class level).
4
- * @returns error strings array of any validation errors. empty if none
5
- */
6
- export declare function validateCommonKeystoneData({ appData, }: {
7
- appData: KeystoneData_V1<any, any> | undefined;
8
- }): string[];
9
- //# sourceMappingURL=keystone-helper.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keystone-helper.d.mts","sourceRoot":"","sources":["../../../src/witness/keystone/keystone-helper.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,EACvC,OAAO,GACV,EAAE;IACC,OAAO,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CAClD,GAAG,MAAM,EAAE,CA0CX"}
@@ -1,53 +0,0 @@
1
- import { GLOBAL_LOG_A_LOT } from "../../core-constants.mjs";
2
- const logalot = GLOBAL_LOG_A_LOT || false;
3
- /**
4
- * validation of data common to all keystones (i.e. at the base class level).
5
- * @returns error strings array of any validation errors. empty if none
6
- */
7
- export function validateCommonKeystoneData({ appData, }) {
8
- const lc = `[${validateCommonKeystoneData.name}]`;
9
- try {
10
- if (logalot) {
11
- console.log(`${lc} starting...`);
12
- }
13
- if (!appData) {
14
- throw new Error(`appData required (E: e22bd1940d1d436fbbed8126c11aa529)`);
15
- }
16
- const errors = [];
17
- console.warn(`${lc} not impl yet`);
18
- // const {
19
- // name, uuid, classname,
20
- // } =
21
- // appData;
22
- // if (name) {
23
- // if (!name.match(APP_NAME_REGEXP)) {
24
- // errors.push(`name must match regexp: ${APP_NAME_REGEXP}`);
25
- // }
26
- // } else {
27
- // errors.push(`name required.`);
28
- // }
29
- // if (uuid) {
30
- // if (!uuid.match(UUID_REGEXP)) {
31
- // errors.push(`uuid must match regexp: ${UUID_REGEXP}`);
32
- // }
33
- // } else {
34
- // errors.push(`uuid required.`);
35
- // }
36
- // if (classname) {
37
- // if (!classname.match(APP_NAME_REGEXP)) {
38
- // errors.push(`classname must match regexp: ${APP_NAME_REGEXP}`);
39
- // }
40
- // }
41
- return errors;
42
- }
43
- catch (error) {
44
- console.error(`${lc} ${error.message}`);
45
- throw error;
46
- }
47
- finally {
48
- if (logalot) {
49
- console.log(`${lc} complete.`);
50
- }
51
- }
52
- }
53
- //# sourceMappingURL=keystone-helper.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keystone-helper.mjs","sourceRoot":"","sources":["../../../src/witness/keystone/keystone-helper.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,MAAM,OAAO,GAAG,gBAAgB,IAAI,KAAK,CAAC;AAE1C;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACvC,OAAO,GAGV;IACG,MAAM,EAAE,GAAG,IAAI,0BAA0B,CAAC,IAAI,GAAG,CAAC;IAClD,IAAI;QACA,IAAI,OAAO,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SAAE;QAClD,IAAI,CAAC,OAAO,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;SAAE;QAC5F,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA;QAClC,UAAU;QACV,6BAA6B;QAC7B,MAAM;QACN,eAAe;QAEf,cAAc;QACd,0CAA0C;QAC1C,qEAAqE;QACrE,QAAQ;QACR,WAAW;QACX,qCAAqC;QACrC,IAAI;QAEJ,cAAc;QACd,sCAAsC;QACtC,iEAAiE;QACjE,QAAQ;QACR,WAAW;QACX,qCAAqC;QACrC,IAAI;QAEJ,mBAAmB;QACnB,+CAA+C;QAC/C,0EAA0E;QAC1E,QAAQ;QACR,IAAI;QAEJ,OAAO,MAAM,CAAC;KACjB;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACxC,MAAM,KAAK,CAAC;KACf;YAAS;QACN,IAAI,OAAO,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAAE;KACnD;AACL,CAAC"}
@@ -1,164 +0,0 @@
1
- /**
2
- * @module keystone-types
3
- */
4
- import { IbGibData_V1, IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
5
- import { IbGib, IbGibAddr, TransformResult } from '@ibgib/ts-gib/dist/types.mjs';
6
- import { WitnessWithContextData_V1, WitnessWithContextRel8ns_V1 } from '../witness-with-context/witness-with-context-types.mjs';
7
- import { WitnessCmdData, WitnessCmdIbGib, WitnessCmdRel8ns } from '../witness-cmd/witness-cmd-types.mjs';
8
- import { WitnessResultData, WitnessResultIbGib, WitnessResultRel8ns } from '../witness-types.mjs';
9
- import { IbGibSpaceAny } from '../space/space-base-v1.mjs';
10
- import { MetaspaceService } from '../space/metaspace/metaspace-types.mjs';
11
- import { IbGibKeystoneAny } from './keystone-base-v1.mjs';
12
- export type KeystoneScope = "any" | "transform";
13
- export type KeystoneSubScope = "any" | "";
14
- export type ExpirationFormat = "UTC";
15
- export interface KeystoneData_V1<TChallenges, TSolutions> extends WitnessWithContextData_V1 {
16
- /**
17
- * @optional setting, which if set, this keystone has internal knowledge of
18
- * its use.
19
- */
20
- scope?: string;
21
- /**
22
- *
23
- */
24
- tjpGib?: string;
25
- /**
26
- * @optional formatting of expiration timestamp
27
- */
28
- expirationFormat?: ExpirationFormat;
29
- /**
30
- * @optional timestamp at which time the keystone will be invalid.
31
- */
32
- expiration?: string;
33
- /**
34
- * If truthy, then there is a limited number of uses that the keystone can
35
- * be utilized (challenged/mutated).
36
- *
37
- * # intent
38
- *
39
- * temporary keystones could be used for finite, pre-known numbers of
40
- * "transactions".
41
- */
42
- remainingUses?: number;
43
- /**
44
- * atom corresponding to the type of challenge.
45
- *
46
- * @example 'zkp'
47
- * @example 'math'
48
- * @example 'honor'
49
- */
50
- challengeAtom: string;
51
- challenges: TChallenges;
52
- solutions: TSolutions;
53
- }
54
- export interface KeystoneRel8ns_V1 extends WitnessWithContextRel8ns_V1 {
55
- }
56
- /**
57
- * Base of the ibgib data for any keystone.
58
- *
59
- * concrete implementations of keystones should add customized data.
60
- */
61
- export interface KeystoneIbGib_V1<KeystoneData_V1 extends IbGibData_V1, KeystoneRel8ns_V1 extends IbGibRel8ns_V1> extends IbGib_V1<KeystoneData_V1, KeystoneRel8ns_V1> {
62
- }
63
- /**
64
- * Cmds for interacting with ibgib spaces.
65
- *
66
- * Not all of these will be implemented for every space.
67
- *
68
- * ## todo
69
- *
70
- * change these commands to better structure, e.g., verb/do/mod, can/get/addrs
71
- * */
72
- export type KeystoneCmd = 'challenge' | 'revoke';
73
- /** Cmds for interacting with ibgib spaces. */
74
- export declare const KeystoneCmd: {
75
- /**
76
- * it's more like a grunt that is intepreted by context from the robbot.
77
- *
78
- * my initial use of this will be to extend a keystone.
79
- */
80
- ib: KeystoneCmd;
81
- /**
82
- * it's more like a grunt that is intepreted by context from the robbot.
83
- *
84
- * my initial use of this will be to validate a keystone.
85
- */
86
- gib: KeystoneCmd;
87
- /**
88
- * third placeholder command.
89
- *
90
- * my initial use of this will be to finalize a keystone.
91
- */
92
- ibgib: KeystoneCmd;
93
- };
94
- export type KeystoneCmdModifier = 'final';
95
- /**
96
- * Flags to affect the command's interpretation.
97
- */
98
- export declare const KeystoneCmdModifier: {
99
- /**
100
- * If final, then the cmd will be the last of the stone.
101
- *
102
- * ## notes
103
- *
104
- * I think this may just signal the beginning of the end, there may actually
105
- * technically be more commands executed by the witness. but they would be
106
- * cleanup commands. the point is that after this option
107
- */
108
- final: "final";
109
- };
110
- /**
111
- * Information commonly required for keystones.
112
- */
113
- export interface KeystoneOptionsData extends WitnessCmdData<KeystoneCmd, KeystoneCmdModifier> {
114
- spaceId?: string;
115
- spaceAddr?: string;
116
- }
117
- export interface KeystoneOptionsRel8ns extends WitnessCmdRel8ns {
118
- }
119
- export interface KeystoneOptionsIbGib<TIbGib extends IbGib = IbGib_V1, TOptsData extends KeystoneOptionsData = KeystoneOptionsData, TOptsRel8ns extends KeystoneOptionsRel8ns = KeystoneOptionsRel8ns> extends WitnessCmdIbGib<TIbGib, KeystoneCmd, KeystoneCmdModifier, TOptsData, TOptsRel8ns> {
120
- space: IbGibSpaceAny;
121
- metaspace: MetaspaceService;
122
- }
123
- /**
124
- * Optional shape of result data to witness interactions.
125
- *
126
- * This is in addition of course to {@link WitnessResultData}.
127
- *
128
- * ## notes
129
- *
130
- * * I'm not sure what to do with this atm, so I'm just stubbing out...
131
- */
132
- export interface KeystoneResultData extends WitnessResultData {
133
- /**
134
- * redeclared from {@link WitnessResultData} for explicit focus. (i.e. not
135
- * really necessary but it makes it more obvious that this is used.)
136
- *
137
- * ## when extending keystone
138
- *
139
- * new addrs added to the keystone dependency graph will be here.
140
- */
141
- addrs?: IbGibAddr[];
142
- }
143
- /**
144
- * Marker interface rel8ns atm...
145
- *
146
- * I'm not sure what to do with this atm, so I'm just stubbing out...
147
- */
148
- export interface KeystoneResultRel8ns extends WitnessResultRel8ns {
149
- }
150
- /**
151
- * Shape of result ibgib if used for a robbot.
152
- *
153
- * I'm not sure what to do with this atm, so I'm just stubbing out...
154
- */
155
- export interface KeystoneResultIbGib<TIbGib extends IbGib_V1, TResultData extends KeystoneResultData, TResultRel8ns extends KeystoneResultRel8ns> extends WitnessResultIbGib<TIbGib, TResultData, TResultRel8ns> {
156
- /**
157
- * In addition to the {@link WitnessResultIbGib} `ibGibs` property, this is
158
- * provided for convenience which should differentiate between the most
159
- * recent (newly created) keystone ibgib and the intermediate ibgibs created
160
- * (e.g. dna).
161
- */
162
- resTransform: TransformResult<IbGibKeystoneAny>;
163
- }
164
- //# sourceMappingURL=keystone-types.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keystone-types.d.mts","sourceRoot":"","sources":["../../../src/witness/keystone/keystone-types.mts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,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