@ibgib/core-gib 0.1.9 → 0.1.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 (157) hide show
  1. package/dist/agent-helpers.d.mts +36 -0
  2. package/dist/agent-helpers.d.mts.map +1 -0
  3. package/dist/agent-helpers.mjs +133 -0
  4. package/dist/agent-helpers.mjs.map +1 -0
  5. package/dist/keystone/keystone-config-builder.respec.mjs +4 -4
  6. package/dist/keystone/keystone-config-builder.respec.mjs.map +1 -1
  7. package/dist/keystone/keystone-service-v1.respec.mjs +65 -62
  8. package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
  9. package/dist/sync/sync-constants.d.mts +17 -0
  10. package/dist/sync/sync-constants.d.mts.map +1 -0
  11. package/dist/sync/sync-constants.mjs +16 -0
  12. package/dist/sync/sync-constants.mjs.map +1 -0
  13. package/dist/sync/sync-helpers.d.mts +15 -0
  14. package/dist/sync/sync-helpers.d.mts.map +1 -0
  15. package/dist/sync/sync-helpers.mjs +46 -0
  16. package/dist/sync/sync-helpers.mjs.map +1 -0
  17. package/dist/sync/sync-innerspace.respec.d.mts +8 -0
  18. package/dist/sync/sync-innerspace.respec.d.mts.map +1 -0
  19. package/dist/sync/sync-innerspace.respec.mjs +120 -0
  20. package/dist/sync/sync-innerspace.respec.mjs.map +1 -0
  21. package/dist/sync/sync-local-spaces.respec.d.mts +2 -0
  22. package/dist/sync/sync-local-spaces.respec.d.mts.map +1 -0
  23. package/dist/sync/sync-local-spaces.respec.mjs +159 -0
  24. package/dist/sync/sync-local-spaces.respec.mjs.map +1 -0
  25. package/dist/sync/sync-saga-coordinator.d.mts +118 -0
  26. package/dist/sync/sync-saga-coordinator.d.mts.map +1 -0
  27. package/dist/sync/sync-saga-coordinator.mjs +399 -0
  28. package/dist/sync/sync-saga-coordinator.mjs.map +1 -0
  29. package/dist/sync/sync-saga-coordinator.respec.d.mts +2 -0
  30. package/dist/sync/sync-saga-coordinator.respec.d.mts.map +1 -0
  31. package/dist/sync/sync-saga-coordinator.respec.mjs +40 -0
  32. package/dist/sync/sync-saga-coordinator.respec.mjs.map +1 -0
  33. package/dist/sync/sync-types.d.mts +103 -0
  34. package/dist/sync/sync-types.d.mts.map +1 -0
  35. package/dist/sync/sync-types.mjs +2 -0
  36. package/dist/sync/sync-types.mjs.map +1 -0
  37. package/dist/test/mock-space.d.mts +39 -0
  38. package/dist/test/mock-space.d.mts.map +1 -0
  39. package/dist/test/mock-space.mjs +79 -0
  40. package/dist/test/mock-space.mjs.map +1 -0
  41. package/dist/timeline/timeline-api.respec.d.mts +7 -0
  42. package/dist/timeline/timeline-api.respec.d.mts.map +1 -0
  43. package/dist/timeline/timeline-api.respec.mjs +183 -0
  44. package/dist/timeline/timeline-api.respec.mjs.map +1 -0
  45. package/dist/witness/space/inner-space/inner-space-v1.respec.mjs +163 -201
  46. package/dist/witness/space/inner-space/inner-space-v1.respec.mjs.map +1 -1
  47. package/dist/witness/space/metaspace/metaspace-base.d.mts.map +1 -1
  48. package/dist/witness/space/metaspace/metaspace-base.mjs +33 -5
  49. package/dist/witness/space/metaspace/metaspace-base.mjs.map +1 -1
  50. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.d.mts.map +1 -1
  51. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs +3 -2
  52. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs.map +1 -1
  53. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.respec.d.mts +7 -0
  54. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.respec.d.mts.map +1 -0
  55. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.respec.mjs +67 -0
  56. package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.respec.mjs.map +1 -0
  57. package/dist/witness/space/space-helper.d.mts.map +1 -1
  58. package/dist/witness/space/space-helper.mjs +43 -4
  59. package/dist/witness/space/space-helper.mjs.map +1 -1
  60. package/dist/witness/space/space-helper.respec.d.mts +2 -0
  61. package/dist/witness/space/space-helper.respec.d.mts.map +1 -0
  62. package/dist/witness/space/space-helper.respec.mjs +30 -0
  63. package/dist/witness/space/space-helper.respec.mjs.map +1 -0
  64. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/017DF612D9A86192706EE567B059C489EC8DA0B2B558166EFE61F75D8BF1ECEE/test ib.json +1 -0
  65. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/0EF68E1CA839A24CAEDB224A8AF92F258BD1F364A97E708705150595B3F67985/test ib.json +1 -0
  66. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/12EF728E4F98DDB89990D4CDAF3AC852729E804CE37E2041AF18CBA239328085/test ib.json +1 -0
  67. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/152DD42FA80FA6ABD0B4DAAAE9CE1AFCF94E649B210A08955DB8B86E09AF08BE/test ib.json +1 -0
  68. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/16A46B37492E2688088C69F237E5CDC4F4E8C1015CF8E66D044DC2FE115F6211/test ib.json +1 -0
  69. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/1F7942767491C1D740FFC87E046C2470697FE8D154806B51876C53E607B7F007/test ib.json +1 -0
  70. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/35754C7AD2967D57C34396084F1214343C48F9C1AAF1C11CDFB57B5CB95536F5/test ib.json +1 -0
  71. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/38CFD2C2DFD185FC1E5BEE8C55C8A4FFBD83B03F533B4F92537000C505939E39/test ib.json +1 -0
  72. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/43635745EEAE9EBD3426CC4AD88D2362DE15B2F8E4D1C694B3AE8687E8C6489D/test ib.json +1 -0
  73. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/5C4BCD98E1B3494CCFAC355D2C61025DCD43A1D3041E637ABDA83F0E1E7FA0BE/test ib.json +1 -0
  74. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/5FC1BCCA0F1EB6E656233401E330A7928BF58C09EF6B6B56EC69FCFAC0B3A47A/test ib.json +1 -0
  75. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/60B8ED34520992236C9E1859FAE4BA9DF206CC6BD75DA574E815EAF7B577C1BD/test ib.json +1 -0
  76. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/68B53978461355B04CA96CEE33E448CBC39CDEFEA8E907879C1D2E6A542672C4/test ib.json +1 -0
  77. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/6B62E238B88A3B5050DFF02AB91402C6702A822389315B4150308B774F5A0D01/test ib.json +1 -0
  78. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/6F7EC702F1109A564CFE009F634B27E5F82D6A309CF51B11F49846ABEEAD04B1/test ib.json +1 -0
  79. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/7AE69551608DB82E23DBA98CA7D059DF3F5C9E37174E581F7C154935F4362AA7/test ib.json +1 -0
  80. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/8C851E9DD394053BB50716EA6CDD07A48FA76AF5BB55513F898A18B2A4C64D1F/test ib.json +1 -0
  81. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/984DAD369079FEF2F83082F1CD944A432690F1CB0A5ECA9F009D50B385C4061A/test ib.json +1 -0
  82. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/C466B016831B11EEEC611208EDB50FD7BACD7E37D0037C0D1D78BD5B3D892794/test ib.json +1 -0
  83. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/C5D0AA2C7A2C01C52EFDF70242AA6CAAE06BCA80301A425D4E508E9ACD33DF44/test ib.json +1 -0
  84. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/CDDFD5D61010F7B15CFD78C49865C0134E8E037779DD80C6B4DED7DEB0D4CBB7/test ib.json +1 -0
  85. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/DDFAB26C3991470523BD7543D946A24A9CFEC9D5BEC197B7BD963E1507057A93/test ib.json +1 -0
  86. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/E174442450BBA2A570B0166CDF04844C3A5D1F7199DC59E0FA49F1BBACA47F5F/test ib.json +1 -0
  87. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/E6CE9621CF266A675DB7E3EBABD5D636E46E8006F116A0F7F0769B87DDDBFBB0/test ib.json +1 -0
  88. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 -1 1766860935000^7978FD0F9DD4EB6208A2D2113011F95E5C7EE80072BA3B7E4AC737CC771D621B.json +1 -0
  89. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 0 1766860935000^013C09075DF303BB5822FEEFE57F26B9F0DEE6DD382B116816FCDC2B7CAF0696.json +1 -0
  90. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 1 1766860935000^4EEBAD21A82BAC51A7B952DA32DACB37A653695D5D512A348CF15DB9B7DED5AC.json +1 -0
  91. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 10 1766860938000^84544F34B1297ED8F5FD4B437FCD4F1044FD0D40A0B270F8C7E79D89AA058DD6.json +1 -0
  92. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 11 1766860938000^023B07336455CD39B03DC52AF523DA19B588FD32ED7A4BB5BBE9ABE59ED75195.json +1 -0
  93. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 12 1766860939000^49685AA6F0064868886EBA984B072F6C63F92FC3315C29DDDF750D5B56E87D6B.json +1 -0
  94. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 13 1766860939000^A2475B1C99AC9F8B9A4D8B2BD8CB39A76FAA2E13AB2F7CEADA4AB02B42FF8BE4.json +1 -0
  95. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 14 1766860939000^2D0C93D837FFF096346E10F276BD1F08ECE4A2EC94BE9BC58759EBABAB1F2E42.json +1 -0
  96. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 15 1766860939000^4FA9AFA0EA50B833B342716C7745B9A39A7C0F9A09B4666CA67080A49EAB611B.json +1 -0
  97. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 16 1766860939000^A65760BEED125117DE7DF2F481A0F7CD250FFB579138ECC1A19C8401DAFCEB51.json +1 -0
  98. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 17 1766860940000^226FA64E1B4591C150F595D8408530502417C7FFEE3915589382F9C3B585053C.json +1 -0
  99. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 18 1766860940000^1ABF20687FB34275E0EE737538E7E5D4F15CDCB128C4F332043CB76AC78B0F05.json +1 -0
  100. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 19 1766860940000^89A44A1912B20AE873402C287CE09C4D41073F0A5B703CB22FD5272BB907FC19.json +1 -0
  101. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 2 1766860936000^A8D1C5244B85155B130EFCA9CF25185A9B7060F549603B993F2CA98FB269B178.json +1 -0
  102. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 20 1766860940000^72905A7F6A0A859003049827534B579BE090F0B6A221D14584745DAE6A999943.json +1 -0
  103. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 21 1766860948000^71168CE7419FFDB6E945655E1B3597A726111666C305EDA9A76D97FD7215E929.json +1 -0
  104. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 22 1766860967000^A5E8805E1AC44CF2A07606613DE14704BC1943268EFF48BF181E7216D8F07AA3.json +1 -0
  105. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 3 1766860936000^66806071E91EAC9E8F90A81700DD37FB56B7DFDE7B32FE47E142BAC58907173C.json +1 -0
  106. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 4 1766860937000^1A097ACE63079C7D91AC964F783834D172C41CD3FAD0D27A5B95DC6E1E5B7D6A.json +1 -0
  107. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 5 1766860937000^746153300B51309B664E4035E092CAE07F487A2B44D5DB79B770C7D9968D45CA.json +1 -0
  108. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 6 1766860937000^3F1EFF11C729D6175922400928667D3391E3D7B4B29CECD67987F3259A5003C5.json +1 -0
  109. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 7 1766860938000^D2867FC7F2A08C6678BAA320EE449F89E56D81EDC3BFFA79F9DA64BF98701014.json +1 -0
  110. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 8 1766860938000^AA9E5246E533F704E42BED13B878B830B91143AE71C8603FFCF187CF39904915.json +1 -0
  111. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 9 1766860938000^E4B12653516EB8690ED18ECFF3EA7AB5EA3FF70881D730F5859F193F5872DF15.json +1 -0
  112. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/test ib.json +1 -0
  113. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/04E79CE54F49DCEA75652ADF674DC9B21BA641944AD97ED7ED1369CF3A880E8D/mut8.json +1 -0
  114. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/0647EB78DB2C48AF3AE9D3EF7989A3DDA1A797D04BE18DB1210B3504BC39BA4E/mut8.json +1 -0
  115. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/08B4A7A62BC7DE27C180A3F70FA7C6C8F9728A98E79B200D9B2EE2D11E62CD97/mut8.json +1 -0
  116. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/0B2FEF92D3630CDFDD14C453DDDA288478022CEB778E0BB4ACC9C9511C770A39/mut8.json +1 -0
  117. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/3757E01592FABCA5D139026F156318A7F86AC097CC10ABA243D4E665EB3550C5/mut8.json +1 -0
  118. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/3A66623B180568E2AE3E95BD6C48684E765B6B8C2147A4DD13426B6808AC2567/mut8.json +1 -0
  119. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/3EADB84024E06764489225E537F285BF7F7F85C3ACC013F0FCB28B79E227DE2D/mut8.json +1 -0
  120. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/471A5F0BA13425E3412A376452549E5158CD5516C4E005872A50A10D7390CF12/mut8.json +1 -0
  121. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/6E6EA2A701C3AC1B5BCD766F39C59BA7BC5139AAF0EB5E9DE8814F77C4A192A7/mut8.json +1 -0
  122. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/7EF033B1C3C39C05359C89C301DEE7365F6F7A816776F6A0E540CE1A212CD612/mut8.json +1 -0
  123. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/834AECEDC108F37DADA5BD3583FA9C1E612AFA3FFFB1153CA0CD2F51239AD93F/mut8.json +1 -0
  124. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/8CA9BDE2ED96C7C8039D5AF78AEF620A985E32352238DEACACC7E2329006B9B9/mut8.json +1 -0
  125. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/90C61CC1159B21E9FE686C06D5C76FF6F5236F8C7D39CC183B8C81CE36471D9C/fork.json +1 -0
  126. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/A89842F2240358AEC12AE59014A14875AB6FC5C8EF2A5C50D8BD92EB5F54F4B6/mut8.json +1 -0
  127. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/B10FBD60588500D94D6CDA19E5E24DF7F4C3EDF66368E5875F13C4BFF9A8FD03/mut8.json +1 -0
  128. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/B5A0CAF33ACC64A57647ADD18B4F0CAD820F427819BB4615567131994D0399AB/mut8.json +1 -0
  129. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/C0223AA1B3B147E3AFC4233C60025BE4C975652EBF77C24D8B8FABC413594137/mut8.json +1 -0
  130. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/D07097470D6970574C539E1E16AEFCE0A3A67987C7554C9EEFA7204D6D1D81D4/mut8.json +1 -0
  131. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/D92466D1FCE56DB0828A2509590DDA0040FF250FD4FCE7F3E45B5D84887C83F0/mut8.json +1 -0
  132. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/E035FDD6BDD26B164AF5AD675D0567BC0FFB6E10E14BAFA6617EDB536EE162B9/mut8.json +1 -0
  133. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/E8B2955902784AFC4B4A251C771EC770D94234440C8B02C63B12628C29447069/mut8.json +1 -0
  134. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/EF9D3619C817B27EC4402BC215D08CC95A83E5042F4FC35AE2E737AC33B05629/mut8.json +1 -0
  135. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/F0D5006EF21791D68460DB0111983602EC450BBFFB3E47134D357A1BCD9FBD15/mut8.json +1 -0
  136. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/F15D698186AADD2BA9F3028F4F84630505D06220AB6482381FB35755AFC77E5F/mut8.json +1 -0
  137. package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/F1913D9CF3C4F2CDE56C39EA86F8EB9A65D8FA22750DACD2B496EF27D88DE260/mut8.json +1 -0
  138. package/package.json +2 -2
  139. package/src/agent-helpers.mts +159 -0
  140. package/src/keystone/keystone-config-builder.respec.mts +3 -3
  141. package/src/keystone/keystone-service-v1.respec.mts +66 -60
  142. package/src/sync/sync-constants.mts +24 -0
  143. package/src/sync/sync-helpers.mts +59 -0
  144. package/src/sync/sync-innerspace.respec.mts +144 -0
  145. package/src/sync/sync-local-spaces.respec.mts +200 -0
  146. package/src/sync/sync-saga-coordinator.mts +477 -0
  147. package/src/sync/sync-saga-coordinator.respec.mts +52 -0
  148. package/src/sync/sync-types.mts +120 -0
  149. package/src/test/mock-space.mts +85 -0
  150. package/src/timeline/timeline-api.respec.mts +237 -0
  151. package/src/witness/space/inner-space/inner-space-v1.respec.mts +181 -228
  152. package/src/witness/space/metaspace/metaspace-base.mts +31 -5
  153. package/src/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mts +4 -2
  154. package/src/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.respec.mts +90 -0
  155. package/src/witness/space/space-helper.mts +42 -4
  156. package/src/witness/space/space-helper.respec.mts +42 -0
  157. package/tmp.md +11 -0
@@ -0,0 +1,159 @@
1
+ /**
2
+ * @module agent-helpers
3
+ *
4
+ * Helper functions designed to simplify common ibGib operations for agentic usage.
5
+ * These abstract away the low-level Factory_V1 details and provide clear, semantic
6
+ * actions for creating and modifying data.
7
+ */
8
+
9
+ import { extractErrorMsg, getUUID } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
10
+ import { IbGib_V1, IbGibRel8ns_V1, IbGibData_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
11
+
12
+ import { GLOBAL_LOG_A_LOT } from './core-constants.mjs';
13
+ import { KeystoneService_V1 } from './keystone/keystone-service-v1.mjs';
14
+ import { IbGibSpaceAny } from './witness/space/space-base-v1.mjs';
15
+ import { Factory_V1 } from '@ibgib/ts-gib/dist/V1/factory.mjs';
16
+ import { createTimeline } from './timeline/timeline-api.mjs';
17
+ import { persistTransformResult, registerNewIbGib } from './witness/space/space-helper.mjs';
18
+ import { MetaspaceService } from './witness/space/metaspace/metaspace-types.mjs';
19
+ import { TransformResult } from '@ibgib/ts-gib/dist/types.mjs';
20
+
21
+ const logalot = GLOBAL_LOG_A_LOT;
22
+
23
+ /**
24
+ * Creates a "Stone" ibGib - an immutable, primitive-like data record with no history/timeline.
25
+ * Useful for static data, configurations, or standalone records.
26
+ */
27
+ export async function createStoneHelper<TData extends IbGibData_V1 = any>({
28
+ ib,
29
+ data,
30
+ rel8ns,
31
+ uuid,
32
+ noTimestamp,
33
+ }: {
34
+ ib: string;
35
+ data?: TData;
36
+ rel8ns?: IbGibRel8ns_V1;
37
+ uuid?: boolean; // If true, generates a UUID in data
38
+ noTimestamp?: boolean;
39
+ }): Promise<IbGib_V1<TData>> {
40
+ const lc = `[${createStoneHelper.name}]`;
41
+ try {
42
+ if (logalot) { console.log(`${lc} starting... (I: e4b15ee74de22ec9a917c578adc83425)`); }
43
+
44
+ if (!ib) { throw new Error(`ib required (E: 3d5df8fd5b880e0e0dcedd37dbc3f825)`); }
45
+
46
+ // the parent primitive ib is almost always the atom of the ib.
47
+ const atom = ib.split(' ').at(0)!;
48
+
49
+ if (uuid) {
50
+ if (!data) { data = {} as TData; }
51
+ data.uuid = await getUUID();
52
+ }
53
+
54
+ const stone = await Factory_V1.stone({
55
+ parentPrimitiveIb: atom,
56
+ ib,
57
+ data,
58
+ rel8ns,
59
+ uuid,
60
+ });
61
+
62
+ return stone;
63
+ } catch (error) {
64
+ console.error(`${lc} ${extractErrorMsg(error)}`);
65
+ throw error;
66
+ } finally {
67
+ if (logalot) { console.log(`${lc} complete.`); }
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Creates a new "Living" Timeline Root.
73
+ * This is the starting point for any mutable data structure (a file, a user profile, a post).
74
+ */
75
+ export async function createTimelineRootHelper<TData extends IbGibData_V1 = any>({
76
+ ib,
77
+ data,
78
+ space,
79
+ }: {
80
+ ib: string; // e.g. "comment" or "task"
81
+ data?: TData; // Initial data
82
+ space: IbGibSpaceAny; // Where to persist this new root
83
+ }): Promise<IbGib_V1<TData>> {
84
+ const lc = `[${createTimelineRootHelper.name}]`;
85
+ try {
86
+ if (logalot) { console.log(`${lc} starting... (I: 8f50a8cf0268742048f7c188feb5a825)`); }
87
+
88
+ // const resTimeline = await createTimeline({
89
+ // ib,
90
+ // data,
91
+ // rel8ns: undefined,
92
+ // metaspace, space
93
+ // });
94
+ // const timeline = resTimeline.newIbGib;
95
+
96
+ // return timeline;
97
+
98
+ // Determine the parent to fork based on the provided options.
99
+ const atom = ib.split(' ').at(0)!;
100
+ const parentIbGib = Factory_V1.primitive({ ib: atom });
101
+
102
+ const resNew = await Factory_V1.firstGen<TData>({
103
+ parentIbGib,
104
+ ib,
105
+ data,
106
+ rel8ns: undefined,
107
+ // these options are what make this a "timeline"
108
+ dna: true,
109
+ nCounter: true,
110
+ tjp: { timestamp: true, uuid: true },
111
+ });
112
+
113
+ // Persist the new timeline and its DNA to the designated space.
114
+ await persistTransformResult({ resTransform: resNew, space });
115
+ await registerNewIbGib({
116
+ ibGib: resNew.newIbGib,
117
+ space,
118
+ /**
119
+ * We don't need to broadcast here because it's a new, independent
120
+ * timeline, so there are no listeners yet.
121
+ */
122
+ fnBroadcast: undefined,
123
+ });
124
+
125
+ // We don't need to lock here because it's a new, independent timeline,
126
+ // so there are no concurrency concerns yet.
127
+
128
+ return resNew.newIbGib as IbGib_V1<TData>;
129
+ } catch (error) {
130
+ console.error(`${lc} ${extractErrorMsg(error)}`);
131
+ throw error;
132
+ } finally {
133
+ if (logalot) { console.log(`${lc} complete.`); }
134
+ }
135
+ }
136
+
137
+ /**
138
+ * Creates a valid, mock Keystone Service for testing purposes.
139
+ * This mocks the identity and signing logic needed for Sync operations.
140
+ */
141
+ export async function getTestKeystoneServiceHelper(): Promise<KeystoneService_V1> {
142
+ class MockKeystoneService extends KeystoneService_V1 {
143
+ async getIdentity(): Promise<any> {
144
+ // Return a dummy identity
145
+ // We use the Factory directly here to just get *something* that looks like an ibgib
146
+ const res = await Factory_V1.firstGen({
147
+ parentIbGib: Factory_V1.primitive({ ib: 'identity' }),
148
+ ib: 'identity',
149
+ data: { uuid: await getUUID() },
150
+ dna: true,
151
+ });
152
+ return res.newIbGib;
153
+ }
154
+ // Implement other methods as no-ops or simple mocks
155
+ async sign(args: any): Promise<any> { return args.latestKeystone; /* minimal mock */ }
156
+ async verify(args: any): Promise<any> { return []; /* no errors */ }
157
+ }
158
+ return new MockKeystoneService() as unknown as KeystoneService_V1;
159
+ }
@@ -12,9 +12,9 @@ import { KEYSTONE_VERB_REVOKE, } from './keystone-constants.mjs';
12
12
  const logalot = GLOBAL_LOG_A_LOT;
13
13
 
14
14
 
15
- await respecfullyDear(sir, 'Config Builders', async () => {
15
+ await respecfully(sir, 'Config Builders', async () => {
16
16
 
17
- await ifWeMight(sir, 'createStandardPoolConfig defaults are correct', async () => {
17
+ await ifWe(sir, 'createStandardPoolConfig defaults are correct', async () => {
18
18
  const config = createStandardPoolConfig("test_salt") as KeystonePoolConfig_HashV1;
19
19
 
20
20
  iReckon(sir, config.salt).willEqual("test_salt");
@@ -32,7 +32,7 @@ await respecfullyDear(sir, 'Config Builders', async () => {
32
32
  iReckon(sir, config.allowedVerbs.length).willEqual(0);
33
33
  });
34
34
 
35
- await ifWeMight(sir, 'createRevocationPoolConfig defaults are correct', async () => {
35
+ await ifWe(sir, 'createRevocationPoolConfig defaults are correct', async () => {
36
36
  const config = createRevocationPoolConfig("revoke_salt") as KeystonePoolConfig_HashV1;
37
37
 
38
38
  iReckon(sir, config.salt).willEqual("revoke_salt");
@@ -200,7 +200,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
200
200
 
201
201
  await respecfully(sir, 'Derivation Logic', async () => {
202
202
 
203
- await ifWeMight(sir, 'derivePoolSecret with same inputs returns same output', async () => {
203
+ await ifWe(sir, 'derivePoolSecret with same inputs returns same output', async () => {
204
204
  const strategy = KeystoneStrategyFactory.create({ config });
205
205
 
206
206
  const secretA = await strategy.derivePoolSecret({ masterSecret });
@@ -210,7 +210,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
210
210
  iReckon(sir, secretA).asTo('secret length').isGonnaBeTruthy();
211
211
  });
212
212
 
213
- await ifWeMight(sir, 'derivePoolSecret with different master secret returns different output', async () => {
213
+ await ifWe(sir, 'derivePoolSecret with different master secret returns different output', async () => {
214
214
  const strategy = KeystoneStrategyFactory.create({ config });
215
215
 
216
216
  const secretA = await strategy.derivePoolSecret({ masterSecret });
@@ -219,7 +219,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
219
219
  iReckon(sir, secretA).asTo('secrets differ').not.willEqual(secretB);
220
220
  });
221
221
 
222
- await ifWeMight(sir, 'derivePoolSecret with different salt returns different output', async () => {
222
+ await ifWe(sir, 'derivePoolSecret with different salt returns different output', async () => {
223
223
  // Modify salt in a copy of config
224
224
  const configB = { ...config, salt: "OtherPool" };
225
225
  const strategyA = KeystoneStrategyFactory.create({ config });
@@ -234,7 +234,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
234
234
 
235
235
  await respecfully(sir, 'Challenge/Solution Logic', async () => {
236
236
 
237
- await ifWeMight(sir, 'generateSolution -> generateChallenge -> validateSolution loop works', async () => {
237
+ await ifWe(sir, 'generateSolution -> generateChallenge -> validateSolution loop works', async () => {
238
238
  const strategy = KeystoneStrategyFactory.create({ config });
239
239
  const poolSecret = await strategy.derivePoolSecret({ masterSecret });
240
240
  const challengeId = "a3ff7843552870fc28bef2b"; // arbitrary random challengeId
@@ -253,7 +253,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
253
253
  iReckon(sir, isValid).asTo('valid pair should pass').isGonnaBeTrue();
254
254
  });
255
255
 
256
- await ifWeMight(sir, 'validateSolution fails for mismatched values', async () => {
256
+ await ifWe(sir, 'validateSolution fails for mismatched values', async () => {
257
257
  const strategy = KeystoneStrategyFactory.create({ config });
258
258
  const poolSecret = await strategy.derivePoolSecret({ masterSecret });
259
259
  const challengeId = "8c994f3ed598f150e25513"; // arbitrary random challengeId
@@ -269,7 +269,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
269
269
  iReckon(sir, isValid).asTo('tampered solution should fail').isGonnaBeFalse();
270
270
  });
271
271
 
272
- await ifWeMight(sir, 'validateSolution fails for mismatched challenge hashes', async () => {
272
+ await ifWe(sir, 'validateSolution fails for mismatched challenge hashes', async () => {
273
273
  const strategy = KeystoneStrategyFactory.create({ config });
274
274
  const poolSecret = await strategy.derivePoolSecret({ masterSecret });
275
275
 
@@ -310,7 +310,7 @@ await respecfully(sir, 'Suite B: Service Lifecycle', async () => {
310
310
  });
311
311
 
312
312
  await respecfully(sir, 'Genesis', async () => {
313
- await ifWeMight(sir, 'creates a valid genesis frame and persists it', async () => {
313
+ await ifWe(sir, 'creates a valid genesis frame and persists it', async () => {
314
314
  const config = createStandardPoolConfig(POOL_ID_DEFAULT);
315
315
 
316
316
  genesisKeystone = await service.genesis({
@@ -338,7 +338,7 @@ await respecfully(sir, 'Suite B: Service Lifecycle', async () => {
338
338
  });
339
339
 
340
340
  await respecfully(sir, 'Signing (Evolution)', async () => {
341
- await ifWeMight(sir, 'evolves the keystone with a valid proof', async () => {
341
+ await ifWe(sir, 'evolves the keystone with a valid proof', async () => {
342
342
  const claim: Partial<KeystoneClaim> = {
343
343
  target: "comment 123^gib",
344
344
  verb: "post"
@@ -368,7 +368,7 @@ await respecfully(sir, 'Suite B: Service Lifecycle', async () => {
368
368
  });
369
369
 
370
370
  await respecfully(sir, 'Validation', async () => {
371
- await ifWeMight(sir, 'validates the genesis->signed transition', async () => {
371
+ await ifWe(sir, 'validates the genesis->signed transition', async () => {
372
372
  const errors = await service.validate({
373
373
  prevIbGib: genesisKeystone,
374
374
  currentIbGib: signedKeystone,
@@ -411,7 +411,7 @@ await respecfully(sir, 'Suite C: Security Vectors', async () => {
411
411
  });
412
412
 
413
413
  await respecfully(sir, 'Wrong Secret (Forgery)', async () => {
414
- await ifWeMight(sir, 'prevents creation of forged frames', async () => {
414
+ await ifWe(sir, 'prevents creation of forged frames', async () => {
415
415
  const claim: Partial<KeystoneClaim> = { target: "comment 123^gib", verb: "post" };
416
416
 
417
417
  let errorCaught = false;
@@ -440,7 +440,7 @@ await respecfully(sir, 'Suite C: Security Vectors', async () => {
440
440
  });
441
441
 
442
442
  await respecfully(sir, 'Policy Violation (Restricted Verbs)', async () => {
443
- await ifWeMight(sir, 'throws error if signing forbidden verb with restricted pool', async () => {
443
+ await ifWe(sir, 'throws error if signing forbidden verb with restricted pool', async () => {
444
444
  // Create a specific restricted pool config manually
445
445
  const restrictedPoolId = "read_only_pool";
446
446
  const restrictedConfig = createStandardPoolConfig(restrictedPoolId);
@@ -481,7 +481,7 @@ await respecfully(sir, 'Suite C: Security Vectors', async () => {
481
481
  // SUITE D: REVOCATION
482
482
  // ===========================================================================
483
483
 
484
- await respecfullyDear(sir, 'Suite D: Revocation', async () => {
484
+ await respecfully(sir, 'Suite D: Revocation', async () => {
485
485
 
486
486
  const service = new KeystoneService_V1();
487
487
  const masterSecret = "AliceSecret_RevokeTest";
@@ -509,7 +509,7 @@ await respecfullyDear(sir, 'Suite D: Revocation', async () => {
509
509
  await respecfully(sir, 'Revoke Lifecycle', async () => {
510
510
  let revokedKeystone: KeystoneIbGib_V1;
511
511
 
512
- await ifWeMight(sir, 'successfully creates a revocation frame', async () => {
512
+ await ifWe(sir, 'successfully creates a revocation frame', async () => {
513
513
  revokedKeystone = await service.revoke({
514
514
  latestKeystone: genesisKeystone,
515
515
  masterSecret,
@@ -527,7 +527,7 @@ await respecfullyDear(sir, 'Suite D: Revocation', async () => {
527
527
  iReckon(sir, data.revocationInfo!.proof.claim.verb).willEqual(KEYSTONE_VERB_REVOKE);
528
528
  });
529
529
 
530
- await ifWeMight(sir, 'validates the revocation frame', async () => {
530
+ await ifWe(sir, 'validates the revocation frame', async () => {
531
531
  const errors = await service.validate({
532
532
  prevIbGib: genesisKeystone,
533
533
  currentIbGib: revokedKeystone!,
@@ -538,7 +538,7 @@ await respecfullyDear(sir, 'Suite D: Revocation', async () => {
538
538
  iReckon(sir, errors.length).asTo('no validation errors').willEqual(0);
539
539
  });
540
540
 
541
- await ifWeMight(sir, 'consumed the revocation pool (Scorched Earth)', async () => {
541
+ await ifWe(sir, 'consumed the revocation pool (Scorched Earth)', async () => {
542
542
  const data = revokedKeystone!.data!;
543
543
  const revokePool = data.challengePools.find(p => p.id === POOL_ID_REVOKE);
544
544
 
@@ -556,7 +556,7 @@ await respecfullyDear(sir, 'Suite D: Revocation', async () => {
556
556
  // SUITE E: STRUCTURAL EVOLUTION (addPools)
557
557
  // ===========================================================================
558
558
 
559
- await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async () => {
559
+ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
560
560
 
561
561
  const service = new KeystoneService_V1();
562
562
  const aliceSecret = "Alice_Master_Key";
@@ -615,7 +615,7 @@ await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async ()
615
615
  });
616
616
 
617
617
  await respecfully(sir, 'Happy Path', async () => {
618
- await ifWeMight(sir, 'authorizes and adds a foreign pool', async () => {
618
+ await ifWe(sir, 'authorizes and adds a foreign pool', async () => {
619
619
  const bobPool = await createForeignPool("pool_bob", ["post"]);
620
620
 
621
621
  const updatedKeystone = await service.addPools({
@@ -654,7 +654,7 @@ await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async ()
654
654
  });
655
655
 
656
656
  await respecfully(sir, 'Permissions & Logic', async () => {
657
- await ifWeMight(sir, 'fails if no pool allows "manage" verb', async () => {
657
+ await ifWe(sir, 'fails if no pool allows "manage" verb', async () => {
658
658
  // 1. Create a restricted keystone
659
659
  const restrictedConfig = createStandardPoolConfig("read_only");
660
660
  restrictedConfig.allowedVerbs = ['read']; // No 'manage'
@@ -686,7 +686,7 @@ await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async ()
686
686
  iReckon(sir, errorCaught).asTo('permission denied').isGonnaBeTrue();
687
687
  });
688
688
 
689
- await ifWeMight(sir, 'fails on ID collision', async () => {
689
+ await ifWe(sir, 'fails on ID collision', async () => {
690
690
  // Try to add "pool_bob" again (it was added in Happy Path)
691
691
  const duplicatePool = await createForeignPool("pool_bob");
692
692
 
@@ -713,7 +713,7 @@ await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async ()
713
713
  // SUITE E: STRUCTURAL EVOLUTION (addPools)
714
714
  // ===========================================================================
715
715
 
716
- await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async () => {
716
+ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
717
717
 
718
718
  const service = new KeystoneService_V1();
719
719
  const aliceSecret = "Alice_Master_Key";
@@ -772,7 +772,7 @@ await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async ()
772
772
  });
773
773
 
774
774
  await respecfully(sir, 'Happy Path', async () => {
775
- await ifWeMight(sir, 'authorizes and adds a foreign pool', async () => {
775
+ await ifWe(sir, 'authorizes and adds a foreign pool', async () => {
776
776
  const bobPool = await createForeignPool("pool_bob", ["post"]);
777
777
 
778
778
  const updatedKeystone = await service.addPools({
@@ -811,7 +811,7 @@ await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async ()
811
811
  });
812
812
 
813
813
  await respecfully(sir, 'Permissions & Logic', async () => {
814
- await ifWeMight(sir, 'fails if no pool allows "manage" verb', async () => {
814
+ await ifWe(sir, 'fails if no pool allows "manage" verb', async () => {
815
815
  // 1. Create a restricted keystone (read-only)
816
816
  const restrictedConfig = createStandardPoolConfig("read_only");
817
817
  restrictedConfig.allowedVerbs = ['read']; // No 'manage'
@@ -843,7 +843,7 @@ await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async ()
843
843
  iReckon(sir, errorCaught).asTo('permission denied').isGonnaBeTrue();
844
844
  });
845
845
 
846
- await ifWeMight(sir, 'fails on ID collision', async () => {
846
+ await ifWe(sir, 'fails on ID collision', async () => {
847
847
  // Try to add "pool_bob" again (it was added in Happy Path)
848
848
  const duplicatePool = await createForeignPool("pool_bob");
849
849
 
@@ -870,7 +870,7 @@ await respecfullyDear(sir, 'Suite E: Structural Evolution (addPools)', async ()
870
870
  // SUITE F: DEEP INSPECTION (Granularity & Serialization)
871
871
  // ===========================================================================
872
872
 
873
- await respecfullyDear(sir, 'Suite F: Deep Inspection', async () => {
873
+ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
874
874
 
875
875
  const service = new KeystoneService_V1();
876
876
  const aliceSecret = "Alice_Deep_Inspect";
@@ -880,6 +880,8 @@ await respecfullyDear(sir, 'Suite F: Deep Inspection', async () => {
880
880
  let mockMetaspace: any;
881
881
  let genesisKeystone: KeystoneIbGib_V1;
882
882
 
883
+ let signedKeystone: KeystoneIbGib_V1;
884
+
883
885
  // We use a specific hybrid config to test exact selection logic
884
886
  const hybridConfig = createStandardPoolConfig(salt) as KeystonePoolConfig_HashV1;
885
887
  // 2 FIFO + 2 Random = 4 Total per sign
@@ -900,9 +902,8 @@ await respecfullyDear(sir, 'Suite F: Deep Inspection', async () => {
900
902
  });
901
903
 
902
904
  await respecfully(sir, 'Proof Granularity & Math', async () => {
903
- let signedKeystone: KeystoneIbGib_V1;
904
905
 
905
- await ifWeMight(sir, 'generates exactly the expected number of solutions', async () => {
906
+ await ifWe(sir, 'generates exactly the expected number of solutions', async () => {
906
907
  signedKeystone = await service.sign({
907
908
  latestKeystone: genesisKeystone,
908
909
  masterSecret: aliceSecret,
@@ -919,7 +920,7 @@ await respecfullyDear(sir, 'Suite F: Deep Inspection', async () => {
919
920
  iReckon(sir, solutions.length).asTo('solution count').willEqual(4);
920
921
  });
921
922
 
922
- await ifWeMight(sir, 'verifies the math manually (White-box Crypto Check)', async () => {
923
+ await ifWe(sir, 'verifies the math manually (White-box Crypto Check)', async () => {
923
924
  const proof = signedKeystone.data!.proofs[0];
924
925
  const poolSnapshot = genesisKeystone.data!.challengePools.find(p => p.id === salt)!;
925
926
 
@@ -948,7 +949,7 @@ await respecfullyDear(sir, 'Suite F: Deep Inspection', async () => {
948
949
  }
949
950
  });
950
951
 
951
- await ifWeMight(sir, 'verifies FIFO logic (Deterministic Selection)', async () => {
952
+ await ifWe(sir, 'verifies FIFO logic (Deterministic Selection)', async () => {
952
953
  const proof = signedKeystone.data!.proofs[0];
953
954
  const poolSnapshot = genesisKeystone.data!.challengePools.find(p => p.id === salt)!;
954
955
 
@@ -968,45 +969,50 @@ await respecfullyDear(sir, 'Suite F: Deep Inspection', async () => {
968
969
  });
969
970
  });
970
971
 
971
- // await respecfully(sir, 'DTO & Serialization', async () => {
972
+ await respecfully(sir, 'DTO & Serialization', async () => {
973
+
974
+ await ifWe(sir, 'survives a clone/JSON-cycle without corruption', async () => {
975
+ // 1. Create a DTO (simulate network transmission/storage)
976
+ // 'clone' does a JSON stringify/parse under the hood (usually) or structured clone.
977
+ const dto = clone(signedKeystone);
972
978
 
973
- // await ifWeMight(sir, 'survives a clone/JSON-cycle without corruption', async () => {
974
- // // 1. Create a DTO (simulate network transmission/storage)
975
- // // 'clone' does a JSON stringify/parse under the hood (usually) or structured clone.
976
- // const dto = clone(signedKeystone);
979
+ // 2. Structural checks
980
+ iReckon(sir, dto).asTo('dto exists').isGonnaBeTruthy();
981
+ iReckon(sir, dto.data).asTo('dto data').isGonnaBeTruthy();
982
+ iReckon(sir, dto.data!.proofs).asTo('dto proofs').isGonnaBeTruthy();
983
+
984
+ // 3. Functional check: Can the service validate this DTO?
985
+ // This ensures no prototypes or hidden properties were lost that the service depends on.
986
+ const errors = await service.validate({
987
+ prevIbGib: genesisKeystone,
988
+ currentIbGib: dto, // Passing the DTO, not the original object
989
+ });
977
990
 
978
- // // 2. Structural checks
979
- // iReckon(sir, dto).asTo('dto exists').isGonnaBeTruthy();
980
- // iReckon(sir, dto.data).asTo('dto data').isGonnaBeTruthy();
981
- // iReckon(sir, dto.data!.proofs).asTo('dto proofs').isGonnaBeTruthy();
991
+ iReckon(sir, errors.length).asTo('DTO validation errors').willEqual(0);
992
+ });
982
993
 
983
- // // 3. Functional check: Can the service validate this DTO?
984
- // // This ensures no prototypes or hidden properties were lost that the service depends on.
985
- // const errors = await service.validate({
986
- // prevIbGib: genesisKeystone,
987
- // currentIbGib: dto, // Passing the DTO, not the original object
988
- // });
994
+ await ifWe(sir, 'ensures data contains no functions or circular refs', async () => {
995
+ // A crude but effective test: ensure JSON.stringify doesn't throw
996
+ // and the result is equal to the object (if we parsed it back).
989
997
 
990
- // iReckon(sir, errors.length).asTo('DTO validation errors').willEqual(0);
991
- // });
998
+ const jsonStr = JSON.stringify(signedKeystone);
999
+ const parsed = JSON.parse(jsonStr);
992
1000
 
993
- // await ifWeMight(sir, 'ensures data contains no functions or circular refs', async () => {
994
- // // A crude but effective test: ensure JSON.stringify doesn't throw
995
- // // and the result is equal to the object (if we parsed it back).
1001
+ // Compare specific deep fields
1002
+ const originalSolution = signedKeystone.data!.proofs[0].solutions[0].value;
1003
+ const parsedSolution = parsed.data.proofs[0].solutions[0].value;
996
1004
 
997
- // const jsonStr = JSON.stringify(signedKeystone);
998
- // const parsed = JSON.parse(jsonStr);
1005
+ iReckon(sir, parsedSolution).asTo('deep property survives stringify').willEqual(originalSolution);
999
1006
 
1000
- // // Compare specific deep fields
1001
- // const originalSolution = signedKeystone.data!.proofs[0].solutions[0].value;
1002
- // const parsedSolution = parsed.data.proofs[0].solutions[0].value;
1007
+ // Ensure no extra properties were lost
1008
+ // FIX: JSON.stringify removes keys with 'undefined' values.
1009
+ // We must filter the original keys to match this behavior for a fair comparison.
1010
+ const origKeys = Object.keys(signedKeystone.data!)
1011
+ .filter(k => (signedKeystone.data as any)[k] !== undefined);
1003
1012
 
1004
- // iReckon(sir, parsedSolution).asTo('deep property survives stringify').willEqual(originalSolution);
1013
+ const parsedKeys = Object.keys(parsed.data);
1014
+ iReckon(sir, parsedKeys.length).asTo('key count matches').willEqual(origKeys.length);
1015
+ });
1005
1016
 
1006
- // // Ensure no extra properties were lost (rudimentary check)
1007
- // const origKeys = Object.keys(signedKeystone.data!);
1008
- // const parsedKeys = Object.keys(parsed.data);
1009
- // iReckon(sir, parsedKeys.length).asTo('key count matches').willEqual(origKeys.length);
1010
- // });
1011
- // });
1017
+ });
1012
1018
  });
@@ -0,0 +1,24 @@
1
+ export const SYNC_ATOM = "sync";
2
+
3
+ /**
4
+ * Protocol version string for V1.
5
+ */
6
+ export const SYNC_PROTOCOL_V1 = "sync 1.0.0";
7
+
8
+ export const SYNC_STAGE_INIT = "init";
9
+ export const SYNC_STAGE_REQUEST = "request";
10
+ export const SYNC_STAGE_DELTA = "delta";
11
+ export const SYNC_STAGE_COMMIT = "commit";
12
+
13
+ export type SyncStage =
14
+ | typeof SYNC_STAGE_INIT
15
+ | typeof SYNC_STAGE_REQUEST
16
+ | typeof SYNC_STAGE_DELTA
17
+ | typeof SYNC_STAGE_COMMIT;
18
+
19
+ export const SyncStage = {
20
+ init: SYNC_STAGE_INIT,
21
+ request: SYNC_STAGE_REQUEST,
22
+ delta: SYNC_STAGE_DELTA,
23
+ commit: SYNC_STAGE_COMMIT,
24
+ } as const;
@@ -0,0 +1,59 @@
1
+ import { extractErrorMsg } from "@ibgib/helper-gib/dist/helpers/utils-helper.mjs";
2
+ import { Ib } from "@ibgib/ts-gib/dist/types.mjs";
3
+ import { SYNC_ATOM } from "./sync-constants.mjs";
4
+ import { SyncData_V1, SyncIbInfo_V1 } from "./sync-types.mjs";
5
+
6
+ const GLOBAL_LOG_A_LOT = false; // Todo: import from core constants if needed
7
+ const logalot = GLOBAL_LOG_A_LOT;
8
+
9
+ /**
10
+ * Constructs the standard 'ib' string for a Sync frame.
11
+ */
12
+ export async function getSyncIb({
13
+ data,
14
+ }: {
15
+ data: SyncData_V1,
16
+ }): Promise<Ib> {
17
+ const lc = `[${getSyncIb.name}]`;
18
+ try {
19
+ // sync uuid stage
20
+ // e.g. "sync 1234-5678 init"
21
+ const ib = [
22
+ SYNC_ATOM,
23
+ data.uuid,
24
+ data.stage
25
+ ].join(' ');
26
+
27
+ return ib;
28
+ } catch (error) {
29
+ console.error(`${lc} ${extractErrorMsg(error)}`);
30
+ throw error;
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Parses a standard Sync 'ib' string.
36
+ */
37
+ export async function parseSyncIb({
38
+ ib,
39
+ }: {
40
+ ib: Ib,
41
+ }): Promise<SyncIbInfo_V1> {
42
+ const lc = `[${parseSyncIb.name}]`;
43
+ try {
44
+ const parts = ib.split(' ');
45
+ if (parts.length !== 3) {
46
+ throw new Error(`Invalid sync ib. Expected 3 parts [atom uuid stage]. Got ${parts.length}. (E: 7c8d9...)`);
47
+ }
48
+ const [atom, uuid, stage] = parts;
49
+
50
+ if (atom !== SYNC_ATOM) {
51
+ throw new Error(`Invalid sync ib. Expected atom '${SYNC_ATOM}', got '${atom}'. (E: 8f9e1...)`);
52
+ }
53
+
54
+ return { atom, uuid, stage: stage as any };
55
+ } catch (error) {
56
+ console.error(`${lc} ${extractErrorMsg(error)}`);
57
+ throw error;
58
+ }
59
+ }