@ibgib/web-gib 0.0.1

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 (372) hide show
  1. package/.ibgibignore +30 -0
  2. package/.vscode/ibgib-snippets.code-snippets +309 -0
  3. package/.vscode/launch.json +25 -0
  4. package/.vscode/settings.json +68 -0
  5. package/.vscode/tasks.json +38 -0
  6. package/CHANGELOG.md +427 -0
  7. package/README.md +66 -0
  8. package/dist/agent-texts/common-agent-texts.d.mts +14 -0
  9. package/dist/agent-texts/common-agent-texts.d.mts.map +1 -0
  10. package/dist/agent-texts/common-agent-texts.mjs +51 -0
  11. package/dist/agent-texts/common-agent-texts.mjs.map +1 -0
  12. package/dist/agent-texts/primary-agent-texts.d.mts +16 -0
  13. package/dist/agent-texts/primary-agent-texts.d.mts.map +1 -0
  14. package/dist/agent-texts/primary-agent-texts.mjs +27 -0
  15. package/dist/agent-texts/primary-agent-texts.mjs.map +1 -0
  16. package/dist/agent-texts/project-agent-texts.d.mts +8 -0
  17. package/dist/agent-texts/project-agent-texts.d.mts.map +1 -0
  18. package/dist/agent-texts/project-agent-texts.mjs +29 -0
  19. package/dist/agent-texts/project-agent-texts.mjs.map +1 -0
  20. package/dist/agent-texts/project-child-text-agent-texts.d.mts +5 -0
  21. package/dist/agent-texts/project-child-text-agent-texts.d.mts.map +1 -0
  22. package/dist/agent-texts/project-child-text-agent-texts.mjs +26 -0
  23. package/dist/agent-texts/project-child-text-agent-texts.mjs.map +1 -0
  24. package/dist/agent-texts/projects-agent-texts.d.mts +4 -0
  25. package/dist/agent-texts/projects-agent-texts.d.mts.map +1 -0
  26. package/dist/agent-texts/projects-agent-texts.mjs +15 -0
  27. package/dist/agent-texts/projects-agent-texts.mjs.map +1 -0
  28. package/dist/agent-texts/raw-agent-texts.d.mts +4 -0
  29. package/dist/agent-texts/raw-agent-texts.d.mts.map +1 -0
  30. package/dist/agent-texts/raw-agent-texts.mjs +17 -0
  31. package/dist/agent-texts/raw-agent-texts.mjs.map +1 -0
  32. package/dist/agent-texts/text-editor-agent-texts.d.mts +6 -0
  33. package/dist/agent-texts/text-editor-agent-texts.d.mts.map +1 -0
  34. package/dist/agent-texts/text-editor-agent-texts.mjs +19 -0
  35. package/dist/agent-texts/text-editor-agent-texts.mjs.map +1 -0
  36. package/dist/api/api-constants.d.mts +9 -0
  37. package/dist/api/api-constants.d.mts.map +1 -0
  38. package/dist/api/api-constants.mjs +9 -0
  39. package/dist/api/api-constants.mjs.map +1 -0
  40. package/dist/api/api-index.d.mts +10 -0
  41. package/dist/api/api-index.d.mts.map +1 -0
  42. package/dist/api/api-index.mjs +121 -0
  43. package/dist/api/api-index.mjs.map +1 -0
  44. package/dist/api/api-types.d.mts +36 -0
  45. package/dist/api/api-types.d.mts.map +1 -0
  46. package/dist/api/api-types.mjs +2 -0
  47. package/dist/api/api-types.mjs.map +1 -0
  48. package/dist/api/commands/chat/chat-index.d.mts +3 -0
  49. package/dist/api/commands/chat/chat-index.d.mts.map +1 -0
  50. package/dist/api/commands/chat/chat-index.mjs +9 -0
  51. package/dist/api/commands/chat/chat-index.mjs.map +1 -0
  52. package/dist/api/commands/chat/get-context-info.d.mts +71 -0
  53. package/dist/api/commands/chat/get-context-info.d.mts.map +1 -0
  54. package/dist/api/commands/chat/get-context-info.mjs +130 -0
  55. package/dist/api/commands/chat/get-context-info.mjs.map +1 -0
  56. package/dist/api/commands/chat/hello-world.d.mts +63 -0
  57. package/dist/api/commands/chat/hello-world.d.mts.map +1 -0
  58. package/dist/api/commands/chat/hello-world.mjs +132 -0
  59. package/dist/api/commands/chat/hello-world.mjs.map +1 -0
  60. package/dist/api/commands/chat/tell-user.d.mts +57 -0
  61. package/dist/api/commands/chat/tell-user.d.mts.map +1 -0
  62. package/dist/api/commands/chat/tell-user.mjs +199 -0
  63. package/dist/api/commands/chat/tell-user.mjs.map +1 -0
  64. package/dist/api/commands/command-constants.d.mts +22 -0
  65. package/dist/api/commands/command-constants.d.mts.map +1 -0
  66. package/dist/api/commands/command-constants.mjs +17 -0
  67. package/dist/api/commands/command-constants.mjs.map +1 -0
  68. package/dist/api/commands/command-helpers.d.mts +47 -0
  69. package/dist/api/commands/command-helpers.d.mts.map +1 -0
  70. package/dist/api/commands/command-helpers.mjs +76 -0
  71. package/dist/api/commands/command-helpers.mjs.map +1 -0
  72. package/dist/api/commands/command-service-v1.d.mts +28 -0
  73. package/dist/api/commands/command-service-v1.d.mts.map +1 -0
  74. package/dist/api/commands/command-service-v1.mjs +122 -0
  75. package/dist/api/commands/command-service-v1.mjs.map +1 -0
  76. package/dist/api/commands/command-service.respec.d.mts +7 -0
  77. package/dist/api/commands/command-service.respec.d.mts.map +1 -0
  78. package/dist/api/commands/command-service.respec.mjs +66 -0
  79. package/dist/api/commands/command-service.respec.mjs.map +1 -0
  80. package/dist/api/commands/command-types.d.mts +48 -0
  81. package/dist/api/commands/command-types.d.mts.map +1 -0
  82. package/dist/api/commands/command-types.mjs +12 -0
  83. package/dist/api/commands/command-types.mjs.map +1 -0
  84. package/dist/api/commands/ibgib/get-ibgibs.d.mts +94 -0
  85. package/dist/api/commands/ibgib/get-ibgibs.d.mts.map +1 -0
  86. package/dist/api/commands/ibgib/get-ibgibs.mjs +219 -0
  87. package/dist/api/commands/ibgib/get-ibgibs.mjs.map +1 -0
  88. package/dist/api/commands/ibgib/ibgib-index.d.mts +3 -0
  89. package/dist/api/commands/ibgib/ibgib-index.d.mts.map +1 -0
  90. package/dist/api/commands/ibgib/ibgib-index.mjs +7 -0
  91. package/dist/api/commands/ibgib/ibgib-index.mjs.map +1 -0
  92. package/dist/api/commands/ibgib/mut8-ibgib.d.mts +135 -0
  93. package/dist/api/commands/ibgib/mut8-ibgib.d.mts.map +1 -0
  94. package/dist/api/commands/ibgib/mut8-ibgib.mjs +318 -0
  95. package/dist/api/commands/ibgib/mut8-ibgib.mjs.map +1 -0
  96. package/dist/api/commands/templates/api-function-info.template.d.mts +73 -0
  97. package/dist/api/commands/templates/api-function-info.template.d.mts.map +1 -0
  98. package/dist/api/commands/templates/api-function-info.template.mjs +161 -0
  99. package/dist/api/commands/templates/api-function-info.template.mjs.map +1 -0
  100. package/dist/api/commands/text/text-edit.d.mts +54 -0
  101. package/dist/api/commands/text/text-edit.d.mts.map +1 -0
  102. package/dist/api/commands/text/text-edit.mjs +170 -0
  103. package/dist/api/commands/text/text-edit.mjs.map +1 -0
  104. package/dist/api/commands/text/text-index.d.mts +3 -0
  105. package/dist/api/commands/text/text-index.d.mts.map +1 -0
  106. package/dist/api/commands/text/text-index.mjs +5 -0
  107. package/dist/api/commands/text/text-index.mjs.map +1 -0
  108. package/dist/api/commands/ui/ui-index.d.mts +3 -0
  109. package/dist/api/commands/ui/ui-index.d.mts.map +1 -0
  110. package/dist/api/commands/ui/ui-index.mjs +5 -0
  111. package/dist/api/commands/ui/ui-index.mjs.map +1 -0
  112. package/dist/api/commands/ui/update-css-variables.d.mts +48 -0
  113. package/dist/api/commands/ui/update-css-variables.d.mts.map +1 -0
  114. package/dist/api/commands/ui/update-css-variables.mjs +145 -0
  115. package/dist/api/commands/ui/update-css-variables.mjs.map +1 -0
  116. package/dist/api/function-infos.web.d.mts +15 -0
  117. package/dist/api/function-infos.web.d.mts.map +1 -0
  118. package/dist/api/function-infos.web.mjs +63 -0
  119. package/dist/api/function-infos.web.mjs.map +1 -0
  120. package/dist/assumptions.respec.d.mts +2 -0
  121. package/dist/assumptions.respec.d.mts.map +1 -0
  122. package/dist/assumptions.respec.mjs +41 -0
  123. package/dist/assumptions.respec.mjs.map +1 -0
  124. package/dist/common/project/project-constants.d.mts +38 -0
  125. package/dist/common/project/project-constants.d.mts.map +1 -0
  126. package/dist/common/project/project-constants.mjs +71 -0
  127. package/dist/common/project/project-constants.mjs.map +1 -0
  128. package/dist/common/project/project-helper.d.mts +127 -0
  129. package/dist/common/project/project-helper.d.mts.map +1 -0
  130. package/dist/common/project/project-helper.mjs +683 -0
  131. package/dist/common/project/project-helper.mjs.map +1 -0
  132. package/dist/common/project/project-types.d.mts +91 -0
  133. package/dist/common/project/project-types.d.mts.map +1 -0
  134. package/dist/common/project/project-types.mjs +31 -0
  135. package/dist/common/project/project-types.mjs.map +1 -0
  136. package/dist/common/prompt-functions.web.d.mts +90 -0
  137. package/dist/common/prompt-functions.web.d.mts.map +1 -0
  138. package/dist/common/prompt-functions.web.mjs +426 -0
  139. package/dist/common/prompt-functions.web.mjs.map +1 -0
  140. package/dist/common/settings/settings-constants.d.mts +33 -0
  141. package/dist/common/settings/settings-constants.d.mts.map +1 -0
  142. package/dist/common/settings/settings-constants.mjs +54 -0
  143. package/dist/common/settings/settings-constants.mjs.map +1 -0
  144. package/dist/common/settings/settings-helpers.d.mts +59 -0
  145. package/dist/common/settings/settings-helpers.d.mts.map +1 -0
  146. package/dist/common/settings/settings-helpers.mjs +253 -0
  147. package/dist/common/settings/settings-helpers.mjs.map +1 -0
  148. package/dist/common/settings/settings-types.d.mts +118 -0
  149. package/dist/common/settings/settings-types.d.mts.map +1 -0
  150. package/dist/common/settings/settings-types.mjs +13 -0
  151. package/dist/common/settings/settings-types.mjs.map +1 -0
  152. package/dist/constants.d.mts +34 -0
  153. package/dist/constants.d.mts.map +1 -0
  154. package/dist/constants.mjs +35 -0
  155. package/dist/constants.mjs.map +1 -0
  156. package/dist/foo.d.mts +2 -0
  157. package/dist/foo.d.mts.map +1 -0
  158. package/dist/foo.mjs +19 -0
  159. package/dist/foo.mjs.map +1 -0
  160. package/dist/helpers.d.mts +137 -0
  161. package/dist/helpers.d.mts.map +1 -0
  162. package/dist/helpers.mjs +514 -0
  163. package/dist/helpers.mjs.map +1 -0
  164. package/dist/helpers.web.d.mts +324 -0
  165. package/dist/helpers.web.d.mts.map +1 -0
  166. package/dist/helpers.web.mjs +1133 -0
  167. package/dist/helpers.web.mjs.map +1 -0
  168. package/dist/helpers.web.respec.d.mts +2 -0
  169. package/dist/helpers.web.respec.d.mts.map +1 -0
  170. package/dist/helpers.web.respec.mjs +12 -0
  171. package/dist/helpers.web.respec.mjs.map +1 -0
  172. package/dist/index.d.mts +2 -0
  173. package/dist/index.d.mts.map +1 -0
  174. package/dist/index.mjs +3 -0
  175. package/dist/index.mjs.map +1 -0
  176. package/dist/respec-gib.node.d.mts +2 -0
  177. package/dist/respec-gib.node.d.mts.map +1 -0
  178. package/dist/respec-gib.node.mjs +211 -0
  179. package/dist/respec-gib.node.mjs.map +1 -0
  180. package/dist/spec-helper.node.respec.d.mts +13 -0
  181. package/dist/spec-helper.node.respec.d.mts.map +1 -0
  182. package/dist/spec-helper.node.respec.mjs +50 -0
  183. package/dist/spec-helper.node.respec.mjs.map +1 -0
  184. package/dist/storage/storage-helpers.web.d.mts +108 -0
  185. package/dist/storage/storage-helpers.web.d.mts.map +1 -0
  186. package/dist/storage/storage-helpers.web.mjs +757 -0
  187. package/dist/storage/storage-helpers.web.mjs.map +1 -0
  188. package/dist/storage/storage-types.web.d.mts +30 -0
  189. package/dist/storage/storage-types.web.d.mts.map +1 -0
  190. package/dist/storage/storage-types.web.mjs +2 -0
  191. package/dist/storage/storage-types.web.mjs.map +1 -0
  192. package/dist/types.web.d.mts +42 -0
  193. package/dist/types.web.d.mts.map +1 -0
  194. package/dist/types.web.mjs +2 -0
  195. package/dist/types.web.mjs.map +1 -0
  196. package/dist/ui/component/component-types.d.mts +225 -0
  197. package/dist/ui/component/component-types.d.mts.map +1 -0
  198. package/dist/ui/component/component-types.mjs +2 -0
  199. package/dist/ui/component/component-types.mjs.map +1 -0
  200. package/dist/ui/component/ibgib-component-service.d.mts +70 -0
  201. package/dist/ui/component/ibgib-component-service.d.mts.map +1 -0
  202. package/dist/ui/component/ibgib-component-service.mjs +201 -0
  203. package/dist/ui/component/ibgib-component-service.mjs.map +1 -0
  204. package/dist/ui/component/ibgib-dynamic-component-bases.d.mts +338 -0
  205. package/dist/ui/component/ibgib-dynamic-component-bases.d.mts.map +1 -0
  206. package/dist/ui/component/ibgib-dynamic-component-bases.mjs +1304 -0
  207. package/dist/ui/component/ibgib-dynamic-component-bases.mjs.map +1 -0
  208. package/dist/ui/ui-constants.d.mts +12 -0
  209. package/dist/ui/ui-constants.d.mts.map +1 -0
  210. package/dist/ui/ui-constants.mjs +93 -0
  211. package/dist/ui/ui-constants.mjs.map +1 -0
  212. package/dist/ui/ui-helpers.d.mts +42 -0
  213. package/dist/ui/ui-helpers.d.mts.map +1 -0
  214. package/dist/ui/ui-helpers.mjs +198 -0
  215. package/dist/ui/ui-helpers.mjs.map +1 -0
  216. package/dist/ui/ui-types.d.mts +13 -0
  217. package/dist/ui/ui-types.d.mts.map +1 -0
  218. package/dist/ui/ui-types.mjs +2 -0
  219. package/dist/ui/ui-types.mjs.map +1 -0
  220. package/dist/witness/agent/agent-constants.d.mts +97 -0
  221. package/dist/witness/agent/agent-constants.d.mts.map +1 -0
  222. package/dist/witness/agent/agent-constants.mjs +98 -0
  223. package/dist/witness/agent/agent-constants.mjs.map +1 -0
  224. package/dist/witness/agent/agent-helpers.d.mts +106 -0
  225. package/dist/witness/agent/agent-helpers.d.mts.map +1 -0
  226. package/dist/witness/agent/agent-helpers.mjs +601 -0
  227. package/dist/witness/agent/agent-helpers.mjs.map +1 -0
  228. package/dist/witness/agent/agent-one-file.app.d.mts +2 -0
  229. package/dist/witness/agent/agent-one-file.app.d.mts.map +1 -0
  230. package/dist/witness/agent/agent-one-file.app.mjs +8 -0
  231. package/dist/witness/agent/agent-one-file.app.mjs.map +1 -0
  232. package/dist/witness/agent/agent-one-file.d.mts +478 -0
  233. package/dist/witness/agent/agent-one-file.d.mts.map +1 -0
  234. package/dist/witness/agent/agent-one-file.mjs +1462 -0
  235. package/dist/witness/agent/agent-one-file.mjs.map +1 -0
  236. package/dist/witness/agent/agent-types.d.mts +83 -0
  237. package/dist/witness/agent/agent-types.d.mts.map +1 -0
  238. package/dist/witness/agent/agent-types.mjs +2 -0
  239. package/dist/witness/agent/agent-types.mjs.map +1 -0
  240. package/dist/witness/agent/agents-service-v1.d.mts +99 -0
  241. package/dist/witness/agent/agents-service-v1.d.mts.map +1 -0
  242. package/dist/witness/agent/agents-service-v1.mjs +453 -0
  243. package/dist/witness/agent/agents-service-v1.mjs.map +1 -0
  244. package/dist/witness/agent/function-info/function-info-one-file.d.mts +192 -0
  245. package/dist/witness/agent/function-info/function-info-one-file.d.mts.map +1 -0
  246. package/dist/witness/agent/function-info/function-info-one-file.mjs +192 -0
  247. package/dist/witness/agent/function-info/function-info-one-file.mjs.map +1 -0
  248. package/dist/witness/agent/gemini/agent-witness-gemini-v1.d.mts +51 -0
  249. package/dist/witness/agent/gemini/agent-witness-gemini-v1.d.mts.map +1 -0
  250. package/dist/witness/agent/gemini/agent-witness-gemini-v1.mjs +928 -0
  251. package/dist/witness/agent/gemini/agent-witness-gemini-v1.mjs.map +1 -0
  252. package/dist/witness/agent/gemini/gemini-agent-factory.d.mts +27 -0
  253. package/dist/witness/agent/gemini/gemini-agent-factory.d.mts.map +1 -0
  254. package/dist/witness/agent/gemini/gemini-agent-factory.mjs +144 -0
  255. package/dist/witness/agent/gemini/gemini-agent-factory.mjs.map +1 -0
  256. package/dist/witness/agent/gemini/gemini-constants.d.mts +36 -0
  257. package/dist/witness/agent/gemini/gemini-constants.d.mts.map +1 -0
  258. package/dist/witness/agent/gemini/gemini-constants.mjs +47 -0
  259. package/dist/witness/agent/gemini/gemini-constants.mjs.map +1 -0
  260. package/dist/witness/agent/gemini/gemini-helpers.d.mts +58 -0
  261. package/dist/witness/agent/gemini/gemini-helpers.d.mts.map +1 -0
  262. package/dist/witness/agent/gemini/gemini-helpers.mjs +210 -0
  263. package/dist/witness/agent/gemini/gemini-helpers.mjs.map +1 -0
  264. package/dist/witness/agent/gemini/gemini-types.d.mts +82 -0
  265. package/dist/witness/agent/gemini/gemini-types.d.mts.map +1 -0
  266. package/dist/witness/agent/gemini/gemini-types.mjs +3 -0
  267. package/dist/witness/agent/gemini/gemini-types.mjs.map +1 -0
  268. package/dist/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.d.mts +136 -0
  269. package/dist/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.d.mts.map +1 -0
  270. package/dist/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.mjs +334 -0
  271. package/dist/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.mjs.map +1 -0
  272. package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.d.mts +35 -0
  273. package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.d.mts.map +1 -0
  274. package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.mjs +267 -0
  275. package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.mjs.map +1 -0
  276. package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace.d.mts +134 -0
  277. package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace.d.mts.map +1 -0
  278. package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace.mjs +389 -0
  279. package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace.mjs.map +1 -0
  280. package/dist/witness/space/web-filesystem-space/web-filesystem-space-constants.d.mts +2 -0
  281. package/dist/witness/space/web-filesystem-space/web-filesystem-space-constants.d.mts.map +1 -0
  282. package/dist/witness/space/web-filesystem-space/web-filesystem-space-constants.mjs +2 -0
  283. package/dist/witness/space/web-filesystem-space/web-filesystem-space-constants.mjs.map +1 -0
  284. package/dist/witness/space/web-filesystem-space/web-filesystem-space-helper.d.mts +104 -0
  285. package/dist/witness/space/web-filesystem-space/web-filesystem-space-helper.d.mts.map +1 -0
  286. package/dist/witness/space/web-filesystem-space/web-filesystem-space-helper.mjs +457 -0
  287. package/dist/witness/space/web-filesystem-space/web-filesystem-space-helper.mjs.map +1 -0
  288. package/dist/witness/space/web-filesystem-space/web-filesystem-space-types.d.mts +93 -0
  289. package/dist/witness/space/web-filesystem-space/web-filesystem-space-types.d.mts.map +1 -0
  290. package/dist/witness/space/web-filesystem-space/web-filesystem-space-types.mjs +98 -0
  291. package/dist/witness/space/web-filesystem-space/web-filesystem-space-types.mjs.map +1 -0
  292. package/dist/witness/space/web-filesystem-space/web-filesystem-space-v1.d.mts +73 -0
  293. package/dist/witness/space/web-filesystem-space/web-filesystem-space-v1.d.mts.map +1 -0
  294. package/dist/witness/space/web-filesystem-space/web-filesystem-space-v1.mjs +650 -0
  295. package/dist/witness/space/web-filesystem-space/web-filesystem-space-v1.mjs.map +1 -0
  296. package/generate-version-file.js +29 -0
  297. package/package.json +60 -0
  298. package/src/agent-texts/common-agent-texts.mts +61 -0
  299. package/src/agent-texts/primary-agent-texts.mts +32 -0
  300. package/src/agent-texts/project-agent-texts.mts +29 -0
  301. package/src/agent-texts/project-child-text-agent-texts.mts +30 -0
  302. package/src/agent-texts/projects-agent-texts.mts +17 -0
  303. package/src/agent-texts/raw-agent-texts.mts +18 -0
  304. package/src/agent-texts/text-editor-agent-texts.mts +20 -0
  305. package/src/api/api-constants.mts +8 -0
  306. package/src/api/api-index.mts +110 -0
  307. package/src/api/api-types.mts +36 -0
  308. package/src/api/commands/chat/chat-index.mts +10 -0
  309. package/src/api/commands/chat/get-context-info.mts +196 -0
  310. package/src/api/commands/chat/hello-world.mts +183 -0
  311. package/src/api/commands/chat/tell-user.mts +241 -0
  312. package/src/api/commands/command-constants.mts +17 -0
  313. package/src/api/commands/command-helpers.mts +105 -0
  314. package/src/api/commands/command-service-v1.mts +136 -0
  315. package/src/api/commands/command-service.respec.mts +72 -0
  316. package/src/api/commands/command-types.mts +71 -0
  317. package/src/api/commands/ibgib/get-ibgibs.mts +269 -0
  318. package/src/api/commands/ibgib/ibgib-index.mts +8 -0
  319. package/src/api/commands/ibgib/mut8-ibgib.mts +418 -0
  320. package/src/api/commands/templates/api-function-info.template.mts +212 -0
  321. package/src/api/commands/text/text-edit.mts +217 -0
  322. package/src/api/commands/text/text-index.mts +6 -0
  323. package/src/api/commands/ui/ui-index.mts +6 -0
  324. package/src/api/commands/ui/update-css-variables.mts +187 -0
  325. package/src/api/function-infos.web.mts +66 -0
  326. package/src/assets/fullscreen-dialog.html +18 -0
  327. package/src/assumptions.respec.mts +51 -0
  328. package/src/common/project/project-constants.mts +83 -0
  329. package/src/common/project/project-helper.mts +730 -0
  330. package/src/common/project/project-types.mts +121 -0
  331. package/src/common/prompt-functions.web.mts +447 -0
  332. package/src/common/settings/settings-constants.mts +72 -0
  333. package/src/common/settings/settings-helpers.mts +280 -0
  334. package/src/common/settings/settings-types.mts +137 -0
  335. package/src/constants.mts +39 -0
  336. package/src/foo.mts +13 -0
  337. package/src/helpers.mts +574 -0
  338. package/src/helpers.web.mts +1277 -0
  339. package/src/helpers.web.respec.mts +16 -0
  340. package/src/index.mts +3 -0
  341. package/src/respec-gib.node.mts +199 -0
  342. package/src/spec-helper.node.respec.mts +50 -0
  343. package/src/storage/storage-helpers.web.mts +728 -0
  344. package/src/storage/storage-types.web.mts +29 -0
  345. package/src/types.web.mts +42 -0
  346. package/src/ui/component/component-types.mts +241 -0
  347. package/src/ui/component/ibgib-component-service.mts +201 -0
  348. package/src/ui/component/ibgib-dynamic-component-bases.mts +1369 -0
  349. package/src/ui/ui-constants.mts +101 -0
  350. package/src/ui/ui-helpers.mts +222 -0
  351. package/src/ui/ui-types.mts +11 -0
  352. package/src/witness/agent/agent-constants.mts +122 -0
  353. package/src/witness/agent/agent-helpers.mts +681 -0
  354. package/src/witness/agent/agent-one-file.app.mts +8 -0
  355. package/src/witness/agent/agent-one-file.mts +1665 -0
  356. package/src/witness/agent/agent-types.mts +92 -0
  357. package/src/witness/agent/agents-service-v1.mts +482 -0
  358. package/src/witness/agent/function-info/function-info-one-file.mts +362 -0
  359. package/src/witness/agent/gemini/agent-witness-gemini-v1.mts +910 -0
  360. package/src/witness/agent/gemini/gemini-agent-factory.mts +135 -0
  361. package/src/witness/agent/gemini/gemini-constants.mts +79 -0
  362. package/src/witness/agent/gemini/gemini-helpers.mts +216 -0
  363. package/src/witness/agent/gemini/gemini-types.mts +88 -0
  364. package/src/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.mts +321 -0
  365. package/src/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.mts +290 -0
  366. package/src/witness/space/metaspace/metaspace-webspace/metaspace-webspace.mts +407 -0
  367. package/src/witness/space/web-filesystem-space/web-filesystem-space-constants.mts +1 -0
  368. package/src/witness/space/web-filesystem-space/web-filesystem-space-helper.mts +491 -0
  369. package/src/witness/space/web-filesystem-space/web-filesystem-space-types.mts +172 -0
  370. package/src/witness/space/web-filesystem-space/web-filesystem-space-v1.mts +670 -0
  371. package/tsconfig.json +17 -0
  372. package/tsconfig.test.json +10 -0
@@ -0,0 +1,1133 @@
1
+ /**
2
+ * @module helpers.web
3
+ *
4
+ * helper functions specific to the web version.
5
+ */
6
+ import { delay, extractErrorMsg, pretty, } from "@ibgib/helper-gib/dist/helpers/utils-helper.mjs";
7
+ import { getIbAndGib, getIbGibAddr } from "@ibgib/ts-gib/dist/helper.mjs";
8
+ import { GIB } from "@ibgib/ts-gib/dist/V1/constants.mjs";
9
+ import { getGibInfo, isPrimitive } from "@ibgib/ts-gib/dist/V1/transforms/transform-helper.mjs";
10
+ import { validateIbGibIntrinsically } from "@ibgib/ts-gib/dist/V1/validate-helper.mjs";
11
+ import { decompressIbGibGraphFromString, deserializeStringToGraph } from "@ibgib/core-gib/dist/common/other/other-helper.web.mjs";
12
+ import { getRawExportIbGib } from "@ibgib/core-gib/dist/common/import-export/import-export-helper.web.mjs";
13
+ import { GLOBAL_LOG_A_LOT, DEFAULT_IBGIB_COLOR, DEFAULT_IBGIB_COLOR_CONTRAST, DEFAULT_IBGIB_TRANSLUCENT, GEMINI_API_KEY_REGEXP, CONFIG_OPTION_GEMINI_API_KEY_LOCATION_HELP } from "./constants.mjs";
14
+ import { showFullscreenDialog } from "./ui/ui-helpers.mjs";
15
+ import { storagePut } from "./storage/storage-helpers.web.mjs";
16
+ /**
17
+ * used in verbose logging
18
+ */
19
+ const logalot = GLOBAL_LOG_A_LOT;
20
+ /**
21
+ * converts string to Uint8Array.
22
+ * @param str to convert
23
+ * @returns array
24
+ */
25
+ export function stringToUint8Array(str) {
26
+ const encoder = new TextEncoder();
27
+ return encoder.encode(str);
28
+ }
29
+ /**
30
+ * converts Uint8Array to string.
31
+ * @param array to convert
32
+ * @returns string
33
+ */
34
+ export function uint8ArrayToString(array) {
35
+ const decoder = new TextDecoder();
36
+ return decoder.decode(array);
37
+ }
38
+ /**
39
+ * Helper class that exposes pathUtils functions. Note that this is relative to
40
+ * an individual space.
41
+ */
42
+ export class PathUtilsHelper {
43
+ /** class-level log context */
44
+ lc = `[${PathUtilsHelper.name}]`;
45
+ // /**
46
+ // * this path utils helper is per space, so this is the id of that space.
47
+ // */
48
+ // spaceId: SpaceId;
49
+ /**
50
+ *
51
+ */
52
+ // constructor({ spaceId, initialCwd, }: { spaceId: SpaceId, initialCwd: string }) {
53
+ // const lc = `${this.lc}[ctor]`;
54
+ // this.spaceId = spaceId;
55
+ // let ibGibGlobalThis = getIbGibGlobalThis();
56
+ // if (!ibGibGlobalThis.spaceShim[spaceId]) {
57
+ // console.log(`${lc} initializing IbGibGlobalThis data`);
58
+ // // initialize
59
+ // ibGibGlobalThis.spaceShim[spaceId] = {
60
+ // cwd: initialCwd,
61
+ // initialCwd,
62
+ // };
63
+ // } else {
64
+ // if (logalot) { console.log(`${lc} ibgib global this already initialized (I: e48b0cb4075e536d150919e87ddc1f24)`); }
65
+ // }
66
+ // }
67
+ /**
68
+ *
69
+ */
70
+ constructor() { }
71
+ isAbsolute(path) {
72
+ if (!path) {
73
+ throw new Error(`(UNEXPECTED) path falsy? (E: dcb92e11770ba06205c0afe3e6560b24)`);
74
+ }
75
+ return path.startsWith('/');
76
+ }
77
+ isRelative(path) {
78
+ return !this.isAbsolute(path);
79
+ }
80
+ // resolve(path: string): string {
81
+ // const lc = `${this.lc}[${this.resolve.name}]`;
82
+ // if (!path) { throw new Error(`(UNEXPECTED) path falsy? (E: 76161b12dbd446a0c2a9e18f4847fc24)`); }
83
+ // // for our implementation, we will throw if there is a relative path
84
+ // // specifier (. or ..) in the middle of the path. the proper
85
+ // // implementation probably resolves these concretely.
86
+ // if (this.isAbsolute(path)) {
87
+ // if (path.includes('/../') || path.endsWith('/..')) { throw new Error(`path is absolute but contains "/../" in it or ends with "../"? (E: 16145bf37d874abc886111c32c035124)`); }
88
+ // return path;
89
+ // }
90
+ // // we have a relative path. get the cwd from global for this particular space. If this space has no
91
+ // let ibGibGlobalThis = getIbGibGlobalThis();
92
+ // let info = ibGibGlobalThis.spaceShim[this.spaceId];
93
+ // if (!info) { throw new Error(`(UNEXPECTED) no info for spaceId in ibgibglobalthis? (E: c063f34ed784e70ccd19a6b2026eb924)`); }
94
+ // const { cwd } = info;
95
+ // if (!cwd) { throw new Error(`(UNEXPECTED) cwd falsy? (E: 91cbd7418a51d9d152ae53d4f87b3a24)`); }
96
+ // if (path.startsWith(cwd)) {
97
+ // console.log(`${lc} path already resolved (starts with cwd). path: ${path} (I: 1d99a4bad47398174fe127b85088fb24)`);
98
+ // }
99
+ // if (cwd.endsWith('/')) {
100
+ // // cwd does end with slash, so slice off initial if needed
101
+ // return cwd + (path.startsWith('/') ? path.slice(1) : path);
102
+ // } else {
103
+ // // cwd does NOT end with slash, so add if needed
104
+ // return cwd + (path.startsWith('/') ? path : `/${path}`);
105
+ // }
106
+ // }
107
+ join(...paths) {
108
+ const lc = `${this.lc}[${this.join.name}]`;
109
+ if (paths.length === 0) {
110
+ console.log(`${lc} paths.length === 0. returning '.' per node convention. (I: 153da80765ff6160675fae895ebac225)`);
111
+ return '.'; /* <<<< returns early */
112
+ }
113
+ if (paths.length === 1 && paths[0] === '..') {
114
+ console.log(`${lc} paths.length === 1 && paths[0] === '..'. returning '..' per node convention. (I: 9af242b7615430a8c6899b1a332e9925)`);
115
+ return '..'; /* <<<< returns early */
116
+ }
117
+ let joined = '';
118
+ for (let i = 0; i < paths.length; i++) {
119
+ let path = paths[i];
120
+ if (path === '..') {
121
+ joined = joined.split('/').slice(0, -1).join('/');
122
+ }
123
+ else {
124
+ if (path.startsWith('/')) {
125
+ path = path.slice(1);
126
+ }
127
+ if (path.endsWith('/')) {
128
+ path = path.slice(0, -1);
129
+ }
130
+ joined += (i > 0 ? '/' : '') + path;
131
+ }
132
+ }
133
+ return joined;
134
+ }
135
+ dirname(path) {
136
+ return path.split('/').slice(0, -1).join('/');
137
+ }
138
+ basename(path, ext) {
139
+ return path.split('/').pop() ?? '';
140
+ }
141
+ }
142
+ export async function copyToClipboard({ data, logalot, }) {
143
+ const lc = `[${copyToClipboard.name}]`;
144
+ try {
145
+ if (logalot) {
146
+ console.log(`${lc} starting... (I: 37d6a4e3c3ee9fa46a0b1cd5c8a5cf24)`);
147
+ }
148
+ let { title, text, url } = data;
149
+ const textToCopy = [
150
+ `${data.title || ''}`,
151
+ `${data.text || ''}`,
152
+ `${data.url || ''}`,
153
+ ].join('\n').trim();
154
+ await navigator.clipboard.writeText(textToCopy);
155
+ console.log('Content copied to clipboard!');
156
+ }
157
+ catch (error) {
158
+ console.error(`${lc} ${extractErrorMsg(error)}`);
159
+ throw error;
160
+ }
161
+ finally {
162
+ if (logalot) {
163
+ console.log(`${lc} complete.`);
164
+ }
165
+ }
166
+ }
167
+ /**
168
+ * helper to trigger browser's share functionality (or fallback).
169
+ */
170
+ export async function shareContent({ data, logalot, }) {
171
+ const lc = `[${shareContent.name}]`;
172
+ try {
173
+ if (logalot) {
174
+ console.log(`${lc} starting... (I: bfc7e484eba91f9126c3f5fc381e6424)`);
175
+ }
176
+ if (navigator.share) {
177
+ await navigator.share(data);
178
+ console.log('Content shared successfully!');
179
+ }
180
+ else {
181
+ console.warn('Web Share API not supported. Copying to clipboard instead.');
182
+ alert(`Share info copied to clipboard!`);
183
+ await copyToClipboard({ data, logalot });
184
+ }
185
+ }
186
+ catch (error) {
187
+ console.error(`${lc} ${extractErrorMsg(error)}`);
188
+ throw error;
189
+ }
190
+ finally {
191
+ if (logalot) {
192
+ console.log(`${lc} complete.`);
193
+ }
194
+ }
195
+ }
196
+ /**
197
+ * useful for knowing if we are executing in our website or within an iframe.
198
+ *
199
+ * ## driving use case
200
+ *
201
+ * When we are loading an embedded iframe for link-gib, it is trying to trigger
202
+ * the router which is no bueno.
203
+ *
204
+ * This is causing a problem though when testing inside an iframe in Project
205
+ * IDX...I guess I'll have to whitelist embedded sites like link-gib
206
+ *
207
+ * @returns true if we are executing in an iframe, false otherwise.
208
+ */
209
+ export function isExecutingInBlankGibWebAppProper({ metaName_appId, metaContent_appId }) {
210
+ const metaElement = document.querySelector(`meta[name=${metaName_appId}]`);
211
+ return !!metaElement && metaElement.content === metaContent_appId;
212
+ }
213
+ /**
214
+ * Low-level plumbing for prompting the user for some text.
215
+ *
216
+ * ## notes
217
+ *
218
+ * * if an empty string is entered, confirm is automatic/always happens.
219
+ * * if confirm is true, will confirm on any entry
220
+ * * can just hit ENTER to confirm anything
221
+ * * this should be parameterized
222
+ *
223
+ * @returns the text the user entered.
224
+ */
225
+ export async function promptForText({ msg, title, confirm, noNewLine, rl, defaultValue, dontCloseRl, cancelable, }) {
226
+ const lc = `[${promptForText.name}]`;
227
+ try {
228
+ if (!msg) {
229
+ throw new Error(`msg required (E: 7f4d67bca4cf98ea95fa110aabc98924)`);
230
+ }
231
+ let result;
232
+ let attempts = 0;
233
+ let maxAttempts = 5;
234
+ do {
235
+ attempts++;
236
+ if (attempts >= maxAttempts) {
237
+ throw new Error(`max attempts reached (E: 1ef20ae955622d4b39479f3da91a1d25)`);
238
+ }
239
+ await delay(50);
240
+ result = await showFullscreenDialog({
241
+ title: title || 'Prompt for Info',
242
+ msg,
243
+ prompt: true,
244
+ showInput: true,
245
+ isPassword: false,
246
+ defaultValue,
247
+ });
248
+ } while (result === undefined && !cancelable);
249
+ return result ?? '';
250
+ // let userText: string | undefined = undefined;
251
+ // try {
252
+ // do {
253
+ // title = title ? `[${title}] ` : '';
254
+ // let promptMessage = `${title}${msg}${noNewLine ? ' ' : '\n'}`;
255
+ // let prompt = window.prompt;
256
+ // // Handle default value (Note: `prompt` can't pre-fill like readline.write)
257
+ // if (defaultValue) {
258
+ // if (defaultValue.includes('\n')) {
259
+ // if (logalot) { console.log(`defaultValue includes newline. (I: 147d4ea942995d0f92a19c3534c18a24)`); }
260
+ // // We can't pre-fill with newline in prompt, so we'll just inform if needed
261
+ // }
262
+ // promptMessage += ` (Default: ${defaultValue})`;
263
+ // }
264
+ // let userText1 = prompt(promptMessage);
265
+ // // Check for cancellation (prompt returns null on cancel)
266
+ // if (userText1 === null) {
267
+ // // return null; // User cancelled
268
+ // throw new Error(`user cancelled (E: bf3a221626f8cd14b2a945bfe661cb24)`);
269
+ // }
270
+ // if (userText1 === "") {
271
+ // let userText2 = prompt(`empty string entered. confirm:${noNewLine ? ' ' : '\n'}`);
272
+ // if (userText2 === userText1) {
273
+ // userText = userText1;
274
+ // break;
275
+ // } else {
276
+ // console.log(`confirm failed. please try again.`);
277
+ // }
278
+ // } else if (confirm) {
279
+ // let userText2 = prompt(`confirm by either hitting ENTER (empty string) or retype input:${noNewLine ? ' ' : '\n'}`);
280
+ // if (userText2 === '' || userText2 === userText1) {
281
+ // userText = userText1;
282
+ // } else {
283
+ // console.log(`confirm failed. please try again.`);
284
+ // }
285
+ // } else {
286
+ // userText = userText1;
287
+ // }
288
+ // } while (userText === undefined);
289
+ // return userText;
290
+ // } catch (error) {
291
+ // throw error;
292
+ // }
293
+ }
294
+ catch (error) {
295
+ debugger; // in error block promptForText
296
+ console.error(`${lc} ${extractErrorMsg(error)}`);
297
+ throw error;
298
+ }
299
+ }
300
+ /**
301
+ * not implemented atow (12/2024). I think we'll have perhaps a modal dialog
302
+ * with a known name and get at it that way.
303
+ */
304
+ export async function promptForSecret({ msg, confirm, }) {
305
+ const lc = `[${promptForSecret.name}]`;
306
+ try {
307
+ if (logalot) {
308
+ console.log(`${lc} starting... (I: 795a4ce348ddb9a5119770f4c572ac24)`);
309
+ }
310
+ let result = undefined;
311
+ let firstTry = true;
312
+ let attempts = 0;
313
+ let maxAttempts = 5;
314
+ do {
315
+ attempts++;
316
+ if (attempts >= maxAttempts) {
317
+ throw new Error(`max attempts reached (E: d4166b4bf37aff0c6d44567792e9ad25)`);
318
+ }
319
+ await delay(50);
320
+ result = await showFullscreenDialog({
321
+ title: firstTry ? 'Shh...' : 'Secrets didn\'t match, try again...',
322
+ msg: msg || 'Enter Your Secret...',
323
+ prompt: true,
324
+ showInput: true,
325
+ isPassword: true,
326
+ defaultValue: undefined,
327
+ });
328
+ if (result === undefined) {
329
+ throw new Error(`user cancelled (E: 91519d04378e84106f3df8eb36d99725)`);
330
+ }
331
+ if (confirm) {
332
+ await delay(250);
333
+ let result2 = await showFullscreenDialog({
334
+ title: 'Shh...',
335
+ msg: 'Confirm...',
336
+ prompt: true,
337
+ showInput: true,
338
+ isPassword: true,
339
+ defaultValue: undefined,
340
+ });
341
+ if (result2 === undefined) {
342
+ result = undefined;
343
+ }
344
+ if (result !== result2) {
345
+ result = undefined;
346
+ firstTry = false;
347
+ await delay(250);
348
+ }
349
+ }
350
+ } while (result === undefined);
351
+ return result;
352
+ }
353
+ catch (error) {
354
+ console.error(`${lc} ${extractErrorMsg(error)}`);
355
+ throw error;
356
+ }
357
+ finally {
358
+ if (logalot) {
359
+ console.log(`${lc} complete.`);
360
+ }
361
+ }
362
+ }
363
+ /**
364
+ * prompt specifically looking to confirm something. if "cancelled", returns
365
+ * false.
366
+ */
367
+ export async function promptForConfirm({ msg, yesLabel, noLabel, }) {
368
+ const lc = `[${promptForConfirm.name}]`;
369
+ try {
370
+ await delay(50);
371
+ let result = await showFullscreenDialog({
372
+ title: 'Confirm?',
373
+ msg: msg ?? 'Confirm?',
374
+ okButtonTitle: yesLabel || undefined,
375
+ cancelButtonTitle: noLabel || undefined,
376
+ prompt: true,
377
+ });
378
+ return !!result;
379
+ // msg ||= 'confirm?';
380
+ // yesLabel ||= '(y)es';
381
+ // noLabel ||= '(n)o';
382
+ // try {
383
+ // const fnAnswerMatchesLabel = (answer: string, label: string) => {
384
+ // if (answer === label.replace(/[\(\)]/g, '').toLowerCase()) {
385
+ // // matched full label
386
+ // return true; /* <<<< returns early */
387
+ // } else {
388
+ // // check for short answers
389
+ // const regexCaptureCharsInsideParens = /\((\w+)\)/;
390
+ // const shortLabel = label.match(regexCaptureCharsInsideParens);
391
+ // if ((shortLabel ?? []).length >= 2) {
392
+ // if (answer === shortLabel![1].toLowerCase()) {
393
+ // // matched short label
394
+ // return true; /* <<<< returns early */
395
+ // }
396
+ // }
397
+ // }
398
+ // // if got this far, nothing positive matched
399
+ // return false;
400
+ // };
401
+ // const prompt = window.prompt;
402
+ // // try up to three times. if match found, either way, return early.
403
+ // const maxTries = 3;
404
+ // for (let i = 0; i < maxTries; i++) {
405
+ // let answer = prompt(`${msg} [${yesLabel}, ${noLabel}]\n`);
406
+ // if (answer) {
407
+ // answer = answer.toLowerCase();
408
+ // const matchesYesLabel = fnAnswerMatchesLabel(answer, yesLabel);
409
+ // if (matchesYesLabel) { return true; /* <<<< returns early */ }
410
+ // const matchesNoLabel = fnAnswerMatchesLabel(answer, noLabel);
411
+ // if (matchesNoLabel) { return false; /* <<<< returns early */ }
412
+ // } else {
413
+ // `no answer provided. defaulting to no...`;
414
+ // console.log('huh?');
415
+ // }
416
+ // }
417
+ // // max tries reached
418
+ // throw new Error(`could not confirm (E: ebbd2f642bde103c41d0102cf7e38d24)`);
419
+ // } catch (error) {
420
+ // throw error;
421
+ // }
422
+ }
423
+ catch (error) {
424
+ console.error(`${lc} ${error.message}`);
425
+ throw error;
426
+ }
427
+ finally {
428
+ if (logalot) {
429
+ console.log(`${lc} complete.`);
430
+ }
431
+ }
432
+ }
433
+ export async function alertUser({ msg, title, skipHitEnterToContinue, }) {
434
+ const lc = `[${alertUser.name}]`;
435
+ try {
436
+ if (!msg) {
437
+ throw new Error(`msg required (E: ffcf7dd00324df7cea2792223d229524)`);
438
+ }
439
+ try {
440
+ title ??= '';
441
+ await delay(50);
442
+ await showFullscreenDialog({
443
+ title,
444
+ msg,
445
+ });
446
+ }
447
+ catch (error) {
448
+ throw error;
449
+ }
450
+ }
451
+ catch (error) {
452
+ console.error(`${lc} ${extractErrorMsg(error)}`);
453
+ throw error;
454
+ }
455
+ }
456
+ export function getUserPreferredColorScheme() {
457
+ const lc = `[${getUserPreferredColorScheme.name}]`;
458
+ try {
459
+ if (logalot) {
460
+ console.log(`${lc} starting... (I: 196286d17b656bce5ce16f358f386525)`);
461
+ }
462
+ const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
463
+ return prefersDark ? 'dark' : 'light';
464
+ }
465
+ catch (error) {
466
+ console.error(`${lc} ${extractErrorMsg(error)}`);
467
+ throw error;
468
+ }
469
+ finally {
470
+ if (logalot) {
471
+ console.log(`${lc} complete.`);
472
+ }
473
+ }
474
+ }
475
+ /**
476
+ * helper function to get a query param in the current url.
477
+ *
478
+ * # ONLY IN BROWSER
479
+ *
480
+ * not for use in node.js
481
+ *
482
+ * @returns raw
483
+ */
484
+ export function getQueryParam({ paramName, parseJSON, logalot, }) {
485
+ const lc = `[${getQueryParam.name}]`;
486
+ try {
487
+ if (logalot) {
488
+ console.log(`${lc} starting... (I: f1a61ecdbb52cff1b958d1ceaea85f24)`);
489
+ }
490
+ const url = new URL(window.location.href);
491
+ const rawValue = url.searchParams.get(paramName);
492
+ if (rawValue) {
493
+ const decodedValue = decodeURIComponent(rawValue);
494
+ if (parseJSON) {
495
+ try {
496
+ return JSON.parse(decodedValue);
497
+ }
498
+ catch (parseError) {
499
+ console.error(`${lc} Error parsing JSON from query parameter ${paramName}: ${parseError} (E: fa8128dbe8ed41fc9fdf57a8146d88de)`);
500
+ throw parseError;
501
+ }
502
+ }
503
+ else {
504
+ return decodedValue;
505
+ }
506
+ }
507
+ else {
508
+ return undefined;
509
+ }
510
+ }
511
+ catch (error) {
512
+ console.error(`${lc} ${extractErrorMsg(error)}`);
513
+ throw error;
514
+ }
515
+ finally {
516
+ if (logalot) {
517
+ console.log(`${lc} complete.`);
518
+ }
519
+ }
520
+ }
521
+ /**
522
+ * helper function to set a query param in the current url.
523
+ *
524
+ * # ONLY IN BROWSER
525
+ *
526
+ * not for use in node.js
527
+ */
528
+ export function setQueryParam({ paramName, paramValue, rmParam, logalot, }) {
529
+ const lc = `[${setQueryParam.name}]`;
530
+ try {
531
+ if (logalot) {
532
+ console.log(`${lc} starting... (I: f3c557d19f5b3a723611c59aa4a20324)`);
533
+ }
534
+ const url = new URL(window.location.href);
535
+ if (rmParam) {
536
+ url.searchParams.delete(paramName);
537
+ }
538
+ else {
539
+ const actualValue = typeof paramValue === 'string' ?
540
+ paramValue :
541
+ JSON.stringify(paramValue);
542
+ url.searchParams.set(paramName, actualValue);
543
+ }
544
+ // Update the URL without reloading the page
545
+ window.history.replaceState({}, '', url.toString());
546
+ }
547
+ catch (error) {
548
+ console.error(`${lc} ${extractErrorMsg(error)}`);
549
+ throw error;
550
+ }
551
+ finally {
552
+ if (logalot) {
553
+ console.log(`${lc} complete.`);
554
+ }
555
+ }
556
+ }
557
+ /**
558
+ * helper to highlight an element with border/background.
559
+ *
560
+ * ## requires
561
+ *
562
+ * .highlight and .unhighlight classes
563
+ *
564
+ * The unhighlight is for correctly showing the transition/animation.
565
+ *
566
+ * ## intent
567
+ *
568
+ * Just making this to make highlighting things (drawing the user's eye)
569
+ * easier and more consistent.
570
+ *
571
+ * @see {@link unhighlightElement}
572
+ */
573
+ export async function highlightElement({ el, magicHighlightTimingMs, scrollIntoView, }) {
574
+ const lc = `[${highlightElement.name}]`;
575
+ try {
576
+ if (logalot) {
577
+ console.log(`${lc} starting... (I: 1820329f88bb937b21ff98e624c03e25)`);
578
+ }
579
+ if (scrollIntoView) {
580
+ el.scrollIntoView({ behavior: 'smooth' });
581
+ }
582
+ el.classList.add('highlight');
583
+ if (magicHighlightTimingMs) {
584
+ await delay(magicHighlightTimingMs);
585
+ el.classList.add('unhighlight');
586
+ el.classList.remove('highlight');
587
+ await delay(magicHighlightTimingMs);
588
+ el.classList.remove('unhighlight');
589
+ }
590
+ }
591
+ catch (error) {
592
+ console.error(`${lc} ${extractErrorMsg(error)}`);
593
+ throw error;
594
+ }
595
+ finally {
596
+ if (logalot) {
597
+ console.log(`${lc} complete.`);
598
+ }
599
+ }
600
+ }
601
+ /**
602
+ * @see {@link highlightElement}
603
+ */
604
+ export async function unhighlightElement({ el, }) {
605
+ const lc = `[${unhighlightElement.name}]`;
606
+ try {
607
+ if (logalot) {
608
+ console.log(`${lc} starting... (I: ee5894b05ec31085883098cc512e1c25)`);
609
+ }
610
+ el.classList.add('unhighlight');
611
+ el.classList.remove('highlight');
612
+ await delay(500);
613
+ el.classList.remove('unhighlight');
614
+ }
615
+ catch (error) {
616
+ console.error(`${lc} ${extractErrorMsg(error)}`);
617
+ throw error;
618
+ }
619
+ finally {
620
+ if (logalot) {
621
+ console.log(`${lc} complete.`);
622
+ }
623
+ }
624
+ }
625
+ /**
626
+ * builds a color schema based on the gib.
627
+ *
628
+ * note that the alpha drives the translucent property, but the solid color is
629
+ * always built
630
+ */
631
+ export function getDeterministicColorInfo({ ibGibAddr, gib, ibGib, translucentAlpha = 10, }) {
632
+ const lc = `[${getDeterministicColorInfo.name}]`;
633
+ try {
634
+ if (logalot) {
635
+ console.log(`${lc} starting... (I: 3b70af42d1c4f6ae91870f3a15c6c625)`);
636
+ }
637
+ if (!ibGibAddr && !gib && !ibGib) {
638
+ gib = GIB;
639
+ }
640
+ gib ??= ibGib?.gib ?? getIbAndGib({ ibGibAddr }).gib;
641
+ const gibInfo = getGibInfo({ gib });
642
+ translucentAlpha ??= 10;
643
+ /**
644
+ * we want to color coordinate according to timeline if possible, i.e.,
645
+ * by tjpGib.
646
+ */
647
+ let drivingHash = '';
648
+ if (gibInfo.isPrimitive) {
649
+ return {
650
+ gib,
651
+ gibInfo,
652
+ punctiliarColor: DEFAULT_IBGIB_COLOR,
653
+ punctiliarColorTranslucent: DEFAULT_IBGIB_TRANSLUCENT,
654
+ punctiliarColorContrast: DEFAULT_IBGIB_COLOR_CONTRAST,
655
+ }; /* <<<< returns early */
656
+ }
657
+ else {
658
+ drivingHash = gibInfo.tjpGib ?? gibInfo.punctiliarHash ?? gib; // hmm, gib should be punctiliar but meh
659
+ }
660
+ /**
661
+ * gets the color string
662
+ */
663
+ // const fnGetColorStr = (drivingHash: string) => {
664
+ // function getContrastColor(hexcolor: string) {
665
+ // const c = hexcolor.concat().replace("#", "");
666
+ // var r = parseInt(c.substr(0, 2), 16);
667
+ // var g = parseInt(c.substr(2, 2), 16);
668
+ // var b = parseInt(c.substr(4, 2), 16);
669
+ // var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
670
+ // return (yiq >= 128) ? '#000000' : '#FFFFFF';
671
+ // }
672
+ // let alphaStr = '';
673
+ // if (translucentAlpha || translucentAlpha === 0) {
674
+ // if (translucentAlpha < 0 || translucentAlpha > 100) {
675
+ // throw new Error(`alpha must be between 0 and 100 (E: c78faeb1477482c739b03dd32d2e1825)`);
676
+ // }
677
+ // if (translucentAlpha === 100) {
678
+ // alphaStr = '';
679
+ // } else if (translucentAlpha >= 0 && translucentAlpha < 10) {
680
+ // // single digit
681
+ // alphaStr = `0${translucentAlpha}`;
682
+ // } else {
683
+ // alphaStr = translucentAlpha.toString();
684
+ // }
685
+ // }
686
+ // const color = `#${drivingHash.substring(0, 6)}`;
687
+ // const colorTranslucent = `#${drivingHash.substring(0, 6)}${alphaStr}`;
688
+ // const colorContrast = getContrastColor(color);
689
+ // return [color, colorTranslucent, colorContrast];
690
+ // };
691
+ const [punctiliarColor, punctiliarColorTranslucent, punctiliarColorContrast] = getColorStrings(translucentAlpha, gibInfo.punctiliarHash ?? gib);
692
+ const [tjpColor, tjpColorTranslucent, tjpColorContrast] = !!gibInfo.tjpGib ?
693
+ getColorStrings(translucentAlpha, gibInfo.tjpGib) :
694
+ [undefined, undefined, undefined];
695
+ return {
696
+ gib,
697
+ gibInfo,
698
+ punctiliarColor, punctiliarColorTranslucent, punctiliarColorContrast,
699
+ tjpColor, tjpColorTranslucent, tjpColorContrast,
700
+ };
701
+ }
702
+ catch (error) {
703
+ const errorMsg = `${lc} ${extractErrorMsg(error)}`;
704
+ console.error(errorMsg);
705
+ return {
706
+ gib: gib ?? GIB,
707
+ gibInfo: { isPrimitive: true },
708
+ punctiliarColor: '#ff0000',
709
+ punctiliarColorTranslucent: '#ff000010',
710
+ punctiliarColorContrast: '#ffffff',
711
+ errorMsg,
712
+ };
713
+ }
714
+ finally {
715
+ if (logalot) {
716
+ console.log(`${lc} complete.`);
717
+ }
718
+ }
719
+ }
720
+ /**
721
+ * gets the color, colorTranslucent and colorContrast
722
+ */
723
+ export function getColorStrings(translucentAlpha, drivingHash) {
724
+ function getContrastColor(hexcolor) {
725
+ const c = hexcolor.concat().replace("#", "");
726
+ var r = parseInt(c.substr(0, 2), 16);
727
+ var g = parseInt(c.substr(2, 2), 16);
728
+ var b = parseInt(c.substr(4, 2), 16);
729
+ var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
730
+ return (yiq >= 128) ? '#000000' : '#FFFFFF';
731
+ }
732
+ let alphaStr = '';
733
+ if (translucentAlpha || translucentAlpha === 0) {
734
+ if (translucentAlpha < 0 || translucentAlpha > 100) {
735
+ throw new Error(`alpha must be between 0 and 100 (E: c78faeb1477482c739b03dd32d2e1825)`);
736
+ }
737
+ if (translucentAlpha === 100) {
738
+ alphaStr = '';
739
+ }
740
+ else if (translucentAlpha >= 0 && translucentAlpha < 10) {
741
+ // single digit
742
+ alphaStr = `0${translucentAlpha}`;
743
+ }
744
+ else {
745
+ alphaStr = translucentAlpha.toString();
746
+ }
747
+ }
748
+ const color = `#${drivingHash.substring(0, 6)}`;
749
+ const colorTranslucent = `#${drivingHash.substring(0, 6)}${alphaStr}`;
750
+ const colorContrast = getContrastColor(color);
751
+ return [color, colorTranslucent, colorContrast];
752
+ }
753
+ ;
754
+ /**
755
+ * Takes an incoming string. Assumes it's invalid. Does best effort at validating this.
756
+ * Gets the raw export ibgib if it can. If so, and if it is compressed, decompresses the
757
+ * compressed graph contained in the export ibgib.
758
+ *
759
+ * @returns RawExportIbGib_V1 and its decompressed graph
760
+ */
761
+ export async function getRawExportIbGibAndGraphFromJsonString({ exportIbGibJsonString, metaspace, }) {
762
+ const lc = `[${getRawExportIbGibAndGraphFromJsonString.name}]`;
763
+ try {
764
+ debugger; // walk thru getRawExportIbGibAndGraphFromJsonString
765
+ if (logalot) {
766
+ console.log(`${lc} starting... (I: genuuid)`);
767
+ }
768
+ if (!metaspace) {
769
+ throw new Error(`(UNEXPECTED) metaspace falsy? (E: genuuid)`);
770
+ }
771
+ const space = await metaspace.getLocalUserSpace({ lock: false });
772
+ if (!space) {
773
+ throw new Error(`(UNEXPECTED) couldn't get default local user space? (E: genuuid)`);
774
+ }
775
+ let parsedIbGib_notYetValidated;
776
+ let parsedExportIbGib_dependenciesNotValidated;
777
+ try {
778
+ parsedIbGib_notYetValidated = JSON.parse(exportIbGibJsonString);
779
+ }
780
+ catch (error) {
781
+ const emsg = `Error during parse JSON. error: ${extractErrorMsg(error)} (E: genuuid)`;
782
+ const errorHack = new Error(emsg);
783
+ errorHack.cause = error;
784
+ throw errorHack;
785
+ }
786
+ try {
787
+ const validationErrors = await validateIbGibIntrinsically({ ibGib: parsedIbGib_notYetValidated }) ?? [];
788
+ if (validationErrors.length > 0) {
789
+ throw new Error(`validation errors when validating the parsed ibgib that should be a RawExportIbGib_V1: ${validationErrors} (E: 8ba178d3b26e8eca28a67c182fe16825)`);
790
+ }
791
+ // todo: other validation raw export ibgib, maybe to see if it's a full dependency graph, etc.
792
+ parsedExportIbGib_dependenciesNotValidated = parsedIbGib_notYetValidated;
793
+ if (!parsedExportIbGib_dependenciesNotValidated.data) {
794
+ throw new Error(`(UNEXPECTED) rawExportIbGib.data falsy? (E: ef1824d1cca5584ab8e34288346e9825)`);
795
+ }
796
+ }
797
+ catch (error) {
798
+ const emsg = `Error during parse JSON. error: ${extractErrorMsg(error)} (E: genuuid)`;
799
+ const errorHack = new Error(emsg);
800
+ errorHack.cause = error;
801
+ throw errorHack;
802
+ }
803
+ // at this point, we have a possibly quite large ibGib whose data
804
+ // includes a dependencyGraphAsString. this could possibly be
805
+ // compressed.
806
+ let payloadGraph;
807
+ if (!!parsedExportIbGib_dependenciesNotValidated.data.compression) {
808
+ switch (parsedExportIbGib_dependenciesNotValidated.data.compression) {
809
+ case 'gzip':
810
+ payloadGraph = await decompressIbGibGraphFromString({
811
+ compressedBase64: parsedExportIbGib_dependenciesNotValidated.data.dependencyGraphAsString,
812
+ });
813
+ break;
814
+ default:
815
+ throw new Error(`unknown value of rawExportIbGib.data.compression: ${parsedExportIbGib_dependenciesNotValidated.data.compression} (E: 784672fae568312d887ddbb841199925)`);
816
+ }
817
+ }
818
+ else {
819
+ payloadGraph = await deserializeStringToGraph({
820
+ jsonString: parsedExportIbGib_dependenciesNotValidated.data.dependencyGraphAsString
821
+ });
822
+ }
823
+ const validationErrorMap = {};
824
+ for (const [addr, payloadIbGib] of Object.entries(payloadGraph)) {
825
+ const validationErrors = await validateIbGibIntrinsically({ ibGib: payloadIbGib }) ?? [];
826
+ if (validationErrors.length > 0) {
827
+ validationErrorMap[addr] = validationErrors;
828
+ }
829
+ }
830
+ if (Object.keys(validationErrorMap).length > 0) {
831
+ throw new Error(`there were validation errors for the RawExportIbGib_V1.data payload (contained in data.dependencyGraphAsString). Here is the validationErrorMap:\n${pretty({ validationErrorMap })} (E: e63f38b182a84122d83a55befb369825)`);
832
+ }
833
+ const exportIbGib_validated = parsedExportIbGib_dependenciesNotValidated;
834
+ return [exportIbGib_validated, payloadGraph];
835
+ }
836
+ catch (error) {
837
+ console.error(`${lc} ${extractErrorMsg(error)}`);
838
+ throw error;
839
+ }
840
+ finally {
841
+ if (logalot) {
842
+ console.log(`${lc} complete.`);
843
+ }
844
+ }
845
+ }
846
+ /**
847
+ * exports a given ibgib to the default local userspace in the metaspace.
848
+ */
849
+ export async function exportIbGib({ ibGib, compress,
850
+ // downloadAnchorEl,
851
+ metaspace, space, }) {
852
+ const lc = `[${exportIbGib.name}]`;
853
+ try {
854
+ if (logalot) {
855
+ console.log(`${lc} starting... (I: 623d9463d919683be81f749821a95825)`);
856
+ }
857
+ if (isPrimitive({ ibGib })) {
858
+ throw new Error(`ibGib is primitive. Can't export primitive. (E: dd42c42e9fda0707e81c692af1a2a225)`);
859
+ }
860
+ const resGetExport = await getRawExportIbGib({
861
+ ibGib,
862
+ live: true,
863
+ compress,
864
+ metaspace: metaspace,
865
+ space,
866
+ });
867
+ const { rawExportIbGib: exportIbGib, errors: exportErrors } = resGetExport;
868
+ if ((exportErrors ?? []).length > 0) {
869
+ throw new Error(`Export had errors: ${exportErrors} (E: 05faf83f25d3449ab809dfd24eeaf825)`);
870
+ }
871
+ // at this point, we have a possibly quite large ibGib whose data includes
872
+ // every single other ibgib that ibGib relates to (its dependency graph). This
873
+ // so now we can save this file and later import from it.
874
+ /**
875
+ * exportIbGib is guaranteed to have a serializable structure, i.e.,
876
+ * the data has only primitives. (there are no Uint8Array)
877
+ */
878
+ const exportIbGibAsString = JSON.stringify(exportIbGib);
879
+ // thank you SO, OP and volzotan at https://stackoverflow.com/questions/19721439/download-json-object-as-a-file-from-browser
880
+ // set the anchor's href to a data stream
881
+ const dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(exportIbGibAsString);
882
+ // get the filename for the anchor to suggest for the "download"
883
+ const exportAddr = getIbGibAddr({ ibGib: exportIbGib });
884
+ const filename = `${exportAddr}.json`;
885
+ // trigger the click
886
+ const downloadAnchorEl = document.createElement('a');
887
+ downloadAnchorEl.setAttribute("style", "none");
888
+ downloadAnchorEl.setAttribute("href", dataStr);
889
+ downloadAnchorEl.setAttribute("download", filename);
890
+ const div = document.getElementsByTagName('div')[0]; // just append to the first div then remove it
891
+ div.appendChild(downloadAnchorEl);
892
+ downloadAnchorEl.click();
893
+ div.removeChild(downloadAnchorEl);
894
+ }
895
+ catch (error) {
896
+ console.error(`${lc} ${extractErrorMsg(error)}`);
897
+ throw error;
898
+ }
899
+ finally {
900
+ if (logalot) {
901
+ console.log(`${lc} complete.`);
902
+ }
903
+ }
904
+ }
905
+ export async function promptForAPIKey({ msg, }) {
906
+ const lc = `[${promptForAPIKey.name}]`;
907
+ try {
908
+ if (logalot) {
909
+ console.log(`${lc} starting... (I: genuuid)`);
910
+ }
911
+ let resAPIKey = '';
912
+ let tryAgain = false;
913
+ let attempts = 0;
914
+ let maxAttempts = 5;
915
+ do {
916
+ attempts++;
917
+ if (attempts >= maxAttempts) {
918
+ throw new Error(`too many attempts (E: genuuid)`);
919
+ }
920
+ resAPIKey = await promptForSecret({
921
+ msg,
922
+ confirm: false,
923
+ });
924
+ if (resAPIKey) {
925
+ if (resAPIKey.match(GEMINI_API_KEY_REGEXP)) {
926
+ tryAgain = false;
927
+ // return resAPIKey; /* <<<< returns early */
928
+ }
929
+ else {
930
+ await alertUser({
931
+ title: `That's an API Key?`,
932
+ msg: `That doesn't look like a valid API key, please try again, or hit cancel if you don't want to at this time.`,
933
+ });
934
+ tryAgain = true;
935
+ }
936
+ }
937
+ else {
938
+ console.log(`${lc} user cancelled entering API key. (I: genuuid)`);
939
+ tryAgain = false;
940
+ }
941
+ } while (tryAgain);
942
+ return resAPIKey;
943
+ }
944
+ catch (error) {
945
+ console.error(`${lc} ${extractErrorMsg(error)}`);
946
+ throw error;
947
+ }
948
+ finally {
949
+ if (logalot) {
950
+ console.log(`${lc} complete.`);
951
+ }
952
+ }
953
+ }
954
+ /**
955
+ * updates the given {@link apiKey}. if {@link force} is true and `apiKey` is
956
+ * empty, then this will set an empty string for the apiKey, effectively
957
+ * deleting it.
958
+ */
959
+ export async function updateAPIKeyInStorage({ dbName, storeName, key, apiKey, force, }) {
960
+ const lc = `[${updateAPIKeyInStorage.name}]`;
961
+ try {
962
+ if (logalot) {
963
+ console.log(`${lc} starting... (I: 64951b38da35ec5ff847004d53b2d425)`);
964
+ }
965
+ const matches = apiKey.match(GEMINI_API_KEY_REGEXP);
966
+ if (matches || force) {
967
+ await storagePut({
968
+ dbName, storeName,
969
+ key,
970
+ value: apiKey,
971
+ });
972
+ if (apiKey) {
973
+ // set a new truthy key
974
+ await alertUser({ title: `need to reload...`, msg: `Cool! We successfully SAVED your Gemini API key in your browser's IndexedDB.\n\nIf you'd like to remove it later, you can clear it out by using the ${CONFIG_OPTION_GEMINI_API_KEY_LOCATION_HELP}.\n\nWe must now reload the page to use the new API key... (investment would be a good thing to improve this UX workflow!)` });
975
+ }
976
+ else {
977
+ // cleared out the key
978
+ await alertUser({ title: `need to reload...`, msg: `Cool! We successfully CLEARED your Gemini API key from your browser's IndexedDB.\n\nIf you'd like to set a new key, use the ${CONFIG_OPTION_GEMINI_API_KEY_LOCATION_HELP}.\n\nThe API key is already removed, but we must now reload the page for this to propagate throughout the web page... (investment would be a good thing to improve this UX workflow!)` });
979
+ }
980
+ window.location.reload();
981
+ }
982
+ else {
983
+ throw new Error(`apiKey does not match apiKeyRegex (${GEMINI_API_KEY_REGEXP.source}) and force is false. (E: 2d6c798803e6b71bf6aa70bd60170825)`);
984
+ }
985
+ }
986
+ catch (error) {
987
+ console.error(`${lc} ${extractErrorMsg(error)}`);
988
+ throw error;
989
+ }
990
+ finally {
991
+ if (logalot) {
992
+ console.log(`${lc} complete.`);
993
+ }
994
+ }
995
+ }
996
+ /**
997
+ * wrapper for simplifying/asserting an element that is expected to exist.
998
+ *
999
+ * ## intent
1000
+ *
1001
+ * This avoids using TypeScript truthy assertions (!) or excessive
1002
+ * falsy/exception checks.
1003
+ */
1004
+ export function getElementById_throwsIfFalsy({ id, shadowRoot, }) {
1005
+ const lc = `[${getElementById_throwsIfFalsy.name}]`;
1006
+ try {
1007
+ if (logalot) {
1008
+ console.log(`${lc} starting... (I: 18a338c6dab8690c72b8759b8d952925)`);
1009
+ }
1010
+ let resElement = !!shadowRoot ?
1011
+ shadowRoot.getElementById(id) :
1012
+ document.getElementById(id);
1013
+ if (resElement) {
1014
+ return resElement;
1015
+ }
1016
+ else {
1017
+ throw new Error(`${!!shadowRoot ? 'shadowRoot' : 'document'}.getElementById(${id}) returned null. So...Element was not found. (E: 5e501f6835cc74cd4c2faf0d9e387825)`);
1018
+ }
1019
+ }
1020
+ catch (error) {
1021
+ console.error(`${lc} ${extractErrorMsg(error)}`);
1022
+ throw error;
1023
+ }
1024
+ finally {
1025
+ if (logalot) {
1026
+ console.log(`${lc} complete.`);
1027
+ }
1028
+ }
1029
+ }
1030
+ /**
1031
+ * wrapper that throws if element not found.
1032
+ * @param id of Element
1033
+ * @returns Element of type TElement or throws.
1034
+ * @see {@link shadowRoot_getElementById}
1035
+ *
1036
+ * ## intent
1037
+ *
1038
+ * This avoids using TypeScript truthy assertions (!) or excessive
1039
+ * falsy/exception checks.
1040
+ */
1041
+ export function document_getElementById(id) {
1042
+ return getElementById_throwsIfFalsy({ id });
1043
+ }
1044
+ /**
1045
+ * wrapper that throws if element not found.
1046
+ * @param shadowRoot in which the element MUST be truthy or throws
1047
+ * @param id of Element
1048
+ * @returns Element of type TElement or throws.
1049
+ * @see {@link document_getElementById}
1050
+ *
1051
+ * ## intent
1052
+ *
1053
+ * This avoids using TypeScript truthy assertions (!) or excessive
1054
+ * falsy/exception checks.
1055
+ */
1056
+ export function shadowRoot_getElementById(shadowRoot, id) {
1057
+ return getElementById_throwsIfFalsy({ id, shadowRoot });
1058
+ }
1059
+ export function getGlobalMetaspace_waitIfNeeded() {
1060
+ const lc = `[${getGlobalMetaspace_waitIfNeeded.name}]`;
1061
+ try {
1062
+ if (logalot) {
1063
+ console.log(`${lc} starting... (I: 96e9b89ef4986c33e819340ec7d05325)`);
1064
+ }
1065
+ throw new Error(`not implemented (E: eb1258f32cb543ce684812845dd28c25)`);
1066
+ }
1067
+ catch (error) {
1068
+ console.error(`${lc} ${extractErrorMsg(error)}`);
1069
+ throw error;
1070
+ }
1071
+ finally {
1072
+ if (logalot) {
1073
+ console.log(`${lc} complete.`);
1074
+ }
1075
+ }
1076
+ }
1077
+ export function getGlobalStoreName() {
1078
+ const lc = `[${getGlobalStoreName.name}]`;
1079
+ try {
1080
+ if (logalot) {
1081
+ console.log(`${lc} starting... (I: 62a29f9982b4b5ecd91ff58ca4dd6825)`);
1082
+ }
1083
+ // ARMY_STORE
1084
+ throw new Error(`not implemented (E: 33bc38b63bb8ab5244c6a0388aadaa25)`);
1085
+ }
1086
+ catch (error) {
1087
+ console.error(`${lc} ${extractErrorMsg(error)}`);
1088
+ throw error;
1089
+ }
1090
+ finally {
1091
+ if (logalot) {
1092
+ console.log(`${lc} complete.`);
1093
+ }
1094
+ }
1095
+ }
1096
+ export function getGlobalDbName() {
1097
+ const lc = `[${getGlobalDbName.name}]`;
1098
+ try {
1099
+ if (logalot) {
1100
+ console.log(`${lc} starting... (I: 8c8f08728fc7384f87697377358cc825)`);
1101
+ }
1102
+ // BLANK_GIB_DB_NAME
1103
+ throw new Error(`not implemented (E: 6586f8982de8bcea91f922982c3ea825)`);
1104
+ }
1105
+ catch (error) {
1106
+ console.error(`${lc} ${extractErrorMsg(error)}`);
1107
+ throw error;
1108
+ }
1109
+ finally {
1110
+ if (logalot) {
1111
+ console.log(`${lc} complete.`);
1112
+ }
1113
+ }
1114
+ }
1115
+ export function getGlobalIndexedDbKey_APIKey() {
1116
+ const lc = `[${getGlobalIndexedDbKey_APIKey.name}]`;
1117
+ try {
1118
+ if (logalot) {
1119
+ console.log(`${lc} starting... (I: 59a2510a85051f97ed15fbc8825b6825)`);
1120
+ }
1121
+ throw new Error(`not implemented (E: 7e05c81caed719f2a6dcf7824e948825)`);
1122
+ }
1123
+ catch (error) {
1124
+ console.error(`${lc} ${extractErrorMsg(error)}`);
1125
+ throw error;
1126
+ }
1127
+ finally {
1128
+ if (logalot) {
1129
+ console.log(`${lc} complete.`);
1130
+ }
1131
+ }
1132
+ }
1133
+ //# sourceMappingURL=helpers.web.mjs.map