@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
File without changes
@@ -1,9 +0,0 @@
1
- /**
2
- * @module keystone.respec.mts
3
- *
4
- * @see {@link './math-keystone/math-keystone.respec.mts'}
5
- *
6
- * In order to test the keystone at the base class, you have to create a mock.
7
- * I've gone ahead and made a simplistic keystone at ./math-keystone which acts
8
- * as this base keystone test.
9
- */
@@ -1,45 +0,0 @@
1
- import {
2
- MathChallengeInfo, MathChallengeType, MathChallengeInfo_Add
3
- } from "./math-keystone-types.mjs";
4
-
5
- import { GLOBAL_LOG_A_LOT } from '../../../core-constants.mjs';
6
- /**
7
- * use for verbose logging.
8
- */
9
- const logalot = GLOBAL_LOG_A_LOT;
10
-
11
- /**
12
- * creates a new simple math challenge. only does 'add' atow.
13
- *
14
- * @returns math challenge info
15
- */
16
- export async function getMathChallenge({
17
- challengeType,
18
- }: {
19
- /**
20
- * If provided, will create this type of challenge.
21
- */
22
- challengeType?: MathChallengeType,
23
- }): Promise<MathChallengeInfo> {
24
- const lc = `[${getMathChallenge.name}]`;
25
- try {
26
- if (logalot) { console.log(`${lc} starting... (I: 75a805603968ca8a4b076caa2cf9bd23)`); }
27
- if (challengeType && challengeType !== 'add') { throw new Error(`only 'add' implemented atow (E: 1e5bc2395395b8d48d61135b63a77923)`); }
28
-
29
- // add
30
- const x = Math.ceil(Math.random() * 999999);
31
- const y = Math.ceil(Math.random() * 999999);
32
- const challenge: MathChallengeInfo_Add = {
33
- id: 'hmm',
34
- op: 'add',
35
- a: x,
36
- b: y,
37
- }
38
- return challenge;
39
- } catch (error) {
40
- console.error(`${lc} ${error.message}`);
41
- throw error;
42
- } finally {
43
- if (logalot) { console.log(`${lc} complete.`); }
44
- }
45
- }
@@ -1,115 +0,0 @@
1
- /**
2
- * @module math-keystone-types
3
- */
4
-
5
- import { IbGibData_V1, IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
6
- import { IbGib } from '@ibgib/ts-gib/dist/types.mjs';
7
-
8
- import {
9
- KeystoneData_V1, KeystoneRel8ns_V1,
10
- KeystoneOptionsData, KeystoneOptionsRel8ns, KeystoneOptionsIbGib,
11
- KeystoneResultData, KeystoneResultRel8ns, KeystoneResultIbGib,
12
- } from '../keystone-types.mjs';
13
-
14
-
15
- import { GLOBAL_LOG_A_LOT } from '../../../core-constants.mjs';
16
- /**
17
- * use for verbose logging.
18
- */
19
- const logalot = GLOBAL_LOG_A_LOT;
20
-
21
- export interface MathKeystoneData_V1 extends KeystoneData_V1<MathChallengeInfo[], MathSolutionInfo[]> {
22
- challengeAtom: 'math';
23
- }
24
-
25
- export interface MathKeystoneRel8ns_V1 extends KeystoneRel8ns_V1 {
26
- }
27
-
28
- /**
29
- * needed? yagni?
30
- */
31
- export interface MathKeystoneAddlMetadata {
32
- // atom: string;
33
- // classnameIsh: string;
34
- // nameIsh: string;
35
- // idIsh: string;
36
- }
37
-
38
- /**
39
- * keystone for math problem challenges.
40
- *
41
- * I'm using this largely as a test implementation, which both gives me a chance
42
- * to futz around and learn, as well as help corroborate that unit tests are
43
- * properly scoped.
44
- */
45
- export interface MathKeystoneIbGib_V1<MathKeystoneData_V1 extends IbGibData_V1, MathKeystoneRel8ns_V1 extends IbGibRel8ns_V1>
46
- extends IbGib_V1<MathKeystoneData_V1, MathKeystoneRel8ns_V1> {
47
-
48
- }
49
-
50
- export interface MathKeystoneOptionsData extends KeystoneOptionsData {
51
- }
52
-
53
- export interface MathKeystoneOptionsRel8ns extends KeystoneOptionsRel8ns {
54
- }
55
-
56
- export interface MathKeystoneOptionsIbGib extends KeystoneOptionsIbGib {
57
- }
58
-
59
- /**
60
- * @see {@link WitnessResultData}
61
- */
62
- export interface MathKeystoneResultData extends KeystoneResultData {
63
- }
64
-
65
- /**
66
- */
67
- export interface MathKeystoneResultRel8ns extends KeystoneResultRel8ns { }
68
-
69
- /**
70
- * Shape of result ibgib if used for a robbot.
71
- *
72
- * I'm not sure what to do with this atm, so I'm just stubbing out...
73
- */
74
- export interface MathKeystoneResultIbGib
75
- extends KeystoneResultIbGib<IbGib_V1, MathKeystoneResultData, MathKeystoneResultRel8ns> {
76
- }
77
-
78
- export type MathChallengeOperation = 'add' | 'subtract';
79
-
80
- /**
81
- * info about our (simple atow) math challenge.
82
- */
83
- export interface MathChallengeInfo {
84
- /**
85
- * operation to be performed on number's `a` and `b`.
86
- */
87
- op: MathChallengeOperation;
88
- /**
89
- * id of the challenge
90
- */
91
- id: string;
92
- /**
93
- * left hand side of math challenge expression.
94
- */
95
- a: number;
96
- /**
97
- * right hande side of math challenge expression.
98
- */
99
- b: number;
100
- }
101
-
102
- export interface MathChallengeInfo_Add extends MathChallengeInfo {
103
- }
104
-
105
- /**
106
- * info about our (simple atow) math challenge's solution.
107
- */
108
- export interface MathSolutionInfo {
109
- challengeId: string;
110
- solution: number;
111
- }
112
-
113
- export interface MathChallengeType {
114
-
115
- }
@@ -1,139 +0,0 @@
1
- import { IbGib_V1 } from "@ibgib/ts-gib/dist/V1/types.mjs";
2
- import { WitnessWithContextBase_V1 } from "../../witness-with-context/witness-with-context-base-v1.mjs";
3
- import {
4
- MathKeystoneOptionsData, MathKeystoneOptionsIbGib, MathKeystoneOptionsRel8ns,
5
- MathKeystoneResultData, MathKeystoneResultIbGib, MathKeystoneResultRel8ns,
6
- MathKeystoneData_V1, MathKeystoneRel8ns_V1, MathKeystoneIbGib_V1,
7
- MathKeystoneAddlMetadata,
8
- MathChallengeInfo, MathSolutionInfo,
9
- } from "./math-keystone-types.mjs";
10
- import { KeystoneBase_V1 } from "../keystone-base-v1.mjs";
11
-
12
- import { GLOBAL_LOG_A_LOT } from '../../../core-constants.mjs';
13
- const logalot = GLOBAL_LOG_A_LOT;
14
-
15
- /**
16
- * witness for keystones that have math problems as the challenges.
17
- *
18
- * @see {@link MathKeystoneIbGib_V1}
19
- */
20
- export class MathKeystoneWitness_V1 extends KeystoneBase_V1<
21
- MathChallengeInfo[], MathSolutionInfo[],
22
- MathKeystoneOptionsData, MathKeystoneOptionsRel8ns, MathKeystoneOptionsIbGib,
23
- MathKeystoneResultData, MathKeystoneResultRel8ns, MathKeystoneResultIbGib,
24
- MathKeystoneData_V1, MathKeystoneRel8ns_V1> {
25
-
26
- protected parseAddlMetadataString<TParseResult>({ ib }: { ib: string; }): TParseResult {
27
- // const addlMetadataText = `${atom}_${classnameIsh}_${nameIsh}_${idIsh}`;
28
- if (!ib) { throw new Error(`ib required (E: f3883d3ce90c4c15907dffa1c46e77d6)`); }
29
- const lc = `[${this.parseAddlMetadataString.name}]`;
30
- try {
31
- const [atom, classnameIsh, nameIsh, idIsh] = ib.split('_');
32
- const result = { atom, classnameIsh, nameIsh, idIsh, } as MathKeystoneAddlMetadata;
33
- return result as TParseResult; // i'm not liking the TParseResult...hmm
34
- } catch (error) {
35
- console.error(`${lc} ${error.message}`);
36
- throw error;
37
- }
38
- }
39
-
40
- /**
41
- * this is the primary command handler when extending a keystone, i.e. when
42
- * signing some payload.
43
- */
44
- protected async extend({
45
- arg,
46
- }: {
47
- arg: MathKeystoneOptionsIbGib,
48
- }): Promise<MathKeystoneResultIbGib> {
49
- const lc = `${this.lc}[${this.extend.name}]`;
50
- try {
51
- if (logalot) { console.log(`${lc} starting...`); }
52
- // 1 .look at the specs for the keystone
53
- // 2. determine requirements for keystone extension
54
- // * for now, this is just the default (i.e. we skip these steps)
55
-
56
- let nextChallenges: MathChallengeInfo[] = await this.getNextChallenges({ arg });
57
- // get the next challenges to solve
58
- // prompt user (if required) solve challenges
59
- let nextSolutions: MathSolutionInfo[] = await this.getNextSolutions({ arg, nextChallenges });
60
-
61
- throw new Error(`not impl (E: 470834fb2562dd33b49b8ec6c9be9423)`);
62
-
63
- // validate nextSolutions
64
- // await this.validateNextSolutions({ arg, nextChallenges, nextSolutions });
65
-
66
- // perform keystone graph extension
67
- // now that we have solutions
68
-
69
- } catch (error) {
70
- console.error(`${lc} ${error.message}`);
71
- throw error;
72
- } finally {
73
- if (logalot) { console.log(`${lc} complete.`); }
74
- }
75
- }
76
-
77
- /**
78
- * chooses the next challenge infos in order to extend the keystone
79
- * timeline.
80
- */
81
- async getNextChallenges({
82
- arg,
83
- }: {
84
- arg: MathKeystoneOptionsIbGib,
85
- }): Promise<MathChallengeInfo[]> {
86
- const lc = `${this.lc}[${this.getNextChallenges.name}]`;
87
- try {
88
-
89
- if (logalot) { console.log(`${lc} starting... (I: e5cf6a884a093eddc1f297b2a63dd123)`); }
90
- throw new Error(`not impl (E: 602bdd6bfa38db5acbd798e60c861623)`);
91
-
92
- } catch (error) {
93
- console.error(`${lc} ${error.message}`);
94
- throw error;
95
- } finally {
96
- if (logalot) { console.log(`${lc} complete.`); }
97
- }
98
- }
99
-
100
- async getNextSolutions({
101
- arg,
102
- nextChallenges,
103
- }: {
104
- arg: MathKeystoneOptionsIbGib,
105
- nextChallenges: MathChallengeInfo[],
106
- }): Promise<MathSolutionInfo[]> {
107
- const lc = `${this.lc}[${this.getNextSolutions.name}]`;
108
- try {
109
- if (logalot) { console.log(`${lc} starting... (I: f77696f021a32ec474de3ebc2c7d7823)`); }
110
-
111
- throw new Error(`not impl (E: d727a9e378da4ddcb90d0be3a995daeb)`);
112
- } catch (error) {
113
- console.error(`${lc} ${error.message}`);
114
- throw error;
115
- } finally {
116
- if (logalot) { console.log(`${lc} complete.`); }
117
- }
118
- }
119
-
120
- async validateNextSolutions({
121
- arg,
122
- }: {
123
- arg: MathKeystoneOptionsIbGib,
124
- }): Promise<string[]> {
125
- const lc = `${this.lc}[${this.validateNextSolutions.name}]`;
126
- let errors: string[] = [];
127
- try {
128
- if (logalot) { console.log(`${lc} starting... (I: 49fda11783ede527b64bf20e8a9feb23)`); }
129
-
130
- throw new Error(`not impl (E: 5407f3d0b3d9729ee361a64cd411ea23)`);
131
-
132
- } catch (error) {
133
- console.error(`${lc} ${error.message}`);
134
- throw error;
135
- } finally {
136
- if (logalot) { console.log(`${lc} complete.`); }
137
- }
138
- }
139
- }
@@ -1,122 +0,0 @@
1
- import * as pathUtils from 'path';
2
-
3
- import {
4
- firstOfAll, firstOfEach, ifWe, ifWeMight, iReckon,
5
- lastOfAll, lastOfEach, respecfully, respecfullyDear,
6
- } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
7
- const maam = `[${import.meta.url}]`, sir = maam;
8
-
9
- import { Gib } from '@ibgib/ts-gib/dist/types.mjs';
10
- import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
11
-
12
- import { KeystoneData_V1, KeystoneIbGib_V1, KeystoneRel8ns_V1 } from '../keystone-types.mjs';
13
- import { IbGibKeystoneAny } from '../keystone-base-v1.mjs';
14
-
15
- import { GLOBAL_LOG_A_LOT } from '../../../core-constants.mjs';
16
- import { WitnessWithContextBase_V1 } from '../../witness-with-context/witness-with-context-base-v1.mjs';
17
-
18
- const logalot: boolean | number = GLOBAL_LOG_A_LOT;
19
-
20
- const lcFile: string = `[${pathUtils.basename(import.meta.url)}]`;
21
-
22
- // #region math mock/test helper functions/types
23
-
24
- interface MathKeystoneData_V1 extends KeystoneData_V1<any, any> { }
25
- interface MathKeystoneRel8ns_V1 extends KeystoneRel8ns_V1 { }
26
- /**
27
- * this keystone has math problems as its challenges
28
- */
29
- interface MathKeystoneIbGib_V1 extends KeystoneIbGib_V1<MathKeystoneData_V1, MathKeystoneRel8ns_V1> {
30
- }
31
- type MathType = "arithmetic";
32
- interface MathKeystoneAddlMetadata {
33
- atom: 'keystone_math';
34
- mathType: MathType;
35
- tjpGib: Gib;
36
- }
37
- export async function createKeystone(): Promise<IbGibKeystoneAny> {
38
- const lc = `[${createKeystone.name}]`;
39
- try {
40
- if (logalot) { console.log(`${lc} starting... (I: ba9c092ad0b19a7fd1c5d98fb27b5923)`); }
41
-
42
- throw new Error(`not impl (E: db37bc8b249841397316812a006bc223)`);
43
-
44
- } catch (error) {
45
- console.error(`${lc} ${error.message}`);
46
- throw error;
47
- } finally {
48
- if (logalot) { console.log(`${lc} complete.`); }
49
- }
50
- }
51
-
52
- /**
53
- *
54
- * @returns validation error if any, else returns null
55
- */
56
- export async function validateKeystone({
57
- keystoneLatest,
58
- }: {
59
- /**
60
- * the latest (i.e. "head") keystone in the keystone's timeline.
61
- */
62
- keystoneLatest?: IbGibKeystoneAny,
63
- /**
64
- * keystones are a graph, and the idea is
65
- */
66
- dependencyGraph?: { [addr: string]: IbGib_V1 },
67
- }): Promise<string[] | null> {
68
- const lc = `[${validateKeystone.name}]`;
69
- try {
70
- throw new Error(`not imple yet (E: 2a80e8b2e6934b10a27df67395402c29)`);
71
- } catch (error) {
72
- console.error(`${lc} ${error.message}`);
73
- throw error;
74
- }
75
- }
76
-
77
- // #endregion math mock/test helper functions/types
78
-
79
- /**
80
- * witness for keystones that have math problems as the challenges.
81
- */
82
- class MathKeystoneWitness_V1
83
- extends WitnessWithContextBase_V1<
84
- any, any, any, // options
85
- any, any, any, // result
86
- MathKeystoneData_V1, MathKeystoneRel8ns_V1> {
87
-
88
- protected parseAddlMetadataString<TParseResult>({ ib }: { ib: string; }): TParseResult {
89
- // const addlMetadataText = `${atom}_${classnameIsh}_${nameIsh}_${idIsh}`;
90
- if (!ib) { throw new Error(`ib required (E: f3883d3ce90c4c15907dffa1c46e77d6)`); }
91
- const lc = `[${this.parseAddlMetadataString.name}]`;
92
- try {
93
- const [atom, classnameIsh, nameIsh, idIsh] = ib.split('_');
94
- const result = { atom, classnameIsh, nameIsh, idIsh, } as unknown as MathKeystoneAddlMetadata;
95
- return result as TParseResult; // i'm not liking the TParseResult...hmm
96
- } catch (error) {
97
- console.error(`${lc} ${error.message}`);
98
- throw error;
99
- }
100
- }
101
- protected witnessImpl(arg: any): Promise<any> {
102
- throw new Error('Method not implemented.');
103
- }
104
-
105
- }
106
-
107
- await respecfully(maam, lcFile, async () => {
108
- let lc = lcFile.concat();
109
-
110
- await respecfully(maam, `simple keystones (not composite)`, async () => {
111
-
112
- await ifWe(maam, `createKeystone`, async () => {
113
-
114
- });
115
- await ifWe(maam, `validateKeystone`, async () => { });
116
- await ifWe(maam, `iterateKeystone`, async () => { });
117
- await ifWe(maam, `createKeystoneChallenge`, async () => { });
118
- await ifWe(maam, `createKeystoneChallenge`, async () => { });
119
-
120
- });
121
-
122
- }, { logalot: !!logalot });