@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,121 @@
1
+ import { CommentData_V1 } from "@ibgib/core-gib/dist/common/comment/comment-types.mjs";
2
+ import { IbGib_V1, IbGibRel8ns_V1 } from "@ibgib/ts-gib/dist/V1/types.mjs";
3
+ import type { getProjectIb } from './project-helper.mjs';
4
+ import { AGENT_REL8N_NAME } from "../../witness/agent/agent-constants.mjs";
5
+ import { IbGibAddr } from "@ibgib/ts-gib/dist/types.mjs";
6
+
7
+ // #region constants - Pulled in from project-constants, but we need default data/rel8ns structure here
8
+
9
+ export const DEFAULT_PROJECT_TEXT = 'default project text';
10
+ export const DEFAULT_PROJECT_NAME = 'untitled_project';
11
+ export const DEFAULT_PROJECT_DESCRIPTION = 'This is an ibgib project. ';
12
+
13
+ /**
14
+ * Default rel8ns values for a Project. Includes inherited defaults from IbGib.
15
+ */
16
+ export const DEFAULT_PROJECT_REL8NS_V1: ProjectRel8ns_V1 | undefined = undefined;
17
+
18
+ // #endregion constants
19
+
20
+ /**
21
+ * Represents the data structure for a Project ibGib.
22
+ * Contains the core information defining a project.
23
+ */
24
+ export interface ProjectData_V1 extends CommentData_V1 {
25
+ /**
26
+ * Description of the project.
27
+ * This can be a more detailed explanation of the project's purpose or scope.
28
+ * Optional.
29
+ */
30
+ description?: string;
31
+ }
32
+
33
+ /**
34
+ * Represents the relationships structure for a Project ibGib.
35
+ * Currently holds standard ibGib relationships but can be extended
36
+ * in the future if projects require specific relationship types (e.g., rel8n_tasks).
37
+ */
38
+ export interface ProjectRel8ns_V1 extends IbGibRel8ns_V1 {
39
+ // Add any project-specific rel8ns here if needed.
40
+ [AGENT_REL8N_NAME]?: IbGibAddr[];
41
+ }
42
+
43
+ /**
44
+ * Represents a fully formed Project ibGib, combining its data and relationships.
45
+ * This is the primary type used when interacting with Project ibGibs.
46
+ */
47
+ export interface ProjectIbGib_V1 extends IbGib_V1<ProjectData_V1, ProjectRel8ns_V1> {
48
+ }
49
+
50
+ /**
51
+ * Default data values for a Project. Includes inherited defaults from Comment/IbGib.
52
+ */
53
+ export const DEFAULT_PROJECT_DATA_V1: ProjectData_V1 = {
54
+ // Inherited from CommentData_V1 -> IbGibData_V1
55
+ name: DEFAULT_PROJECT_NAME, // Default project name
56
+ text: DEFAULT_PROJECT_TEXT, // Default comment text
57
+ textTimestamp: '',
58
+
59
+ // ProjectData_V1 specific (or CommentData_V1 overrides)
60
+ description: DEFAULT_PROJECT_DESCRIPTION, // Default project description
61
+ };
62
+
63
+ /**
64
+ * Represents the parsed information extracted from the `addlMetadataText`
65
+ * segment within a project's `ib` string. This segment follows the `safeName`
66
+ * and is delimited by underscores internally if multiple fields are present.
67
+ */
68
+ export interface ProjectAddlMetadataInfo {
69
+ /**
70
+ * Ticks version of the timestamp derived from ibgib.data.timestamp.
71
+ * This value is encoded within the addlMetadataText segment of the ib string.
72
+ */
73
+ timestampInTicks: number;
74
+ // Add other fields here if the addlMetadataText segment grows,
75
+ // ensuring they are underscore-delimited in the raw text.
76
+ }
77
+
78
+
79
+ /**
80
+ * Represents the parsed information extracted from a project's `ib` string.
81
+ * The `ib` string contains core metadata encoded for efficient referencing.
82
+ *
83
+ * @see {@link getProjectIb} for ib schema
84
+ */
85
+ export interface ProjectIbInfo {
86
+ /** The atom identifier (must be 'project'). Checked during parsing. */
87
+ atom: 'project';
88
+ /**
89
+ * A 'saferized', often truncated, version of the name (project title).
90
+ * Extracted as the first space-delimited segment after the atom.
91
+ */
92
+ safeName: string;
93
+ /**
94
+ * The raw string containing underscore-delimited additional metadata (e.g., "1678886400000").
95
+ * Extracted as the second space-delimited segment after safeName.
96
+ *
97
+ * @see {@link addlMetadata}
98
+ */
99
+ addlMetadataText: string;
100
+ /**
101
+ * The parsed content of the addlMetadataText segment.
102
+ *
103
+ * @see {@link addlMetadataText}
104
+ */
105
+ addlMetadata: ProjectAddlMetadataInfo;
106
+ }
107
+
108
+ // #region LensMode
109
+ export const LENS_MODE_RAW = 'raw';
110
+ export const LENS_MODE_TEXT = 'text';
111
+ export const LENS_MODE_MINIGAME = 'minigame';
112
+ export type LensMode =
113
+ | typeof LENS_MODE_RAW
114
+ | typeof LENS_MODE_TEXT
115
+ | typeof LENS_MODE_MINIGAME;
116
+ export const LensMode = {
117
+ raw: LENS_MODE_RAW,
118
+ text: LENS_MODE_TEXT,
119
+ minigame: LENS_MODE_MINIGAME,
120
+ } satisfies { [key in LensMode]: LensMode };
121
+ // #endregion LensMode
@@ -0,0 +1,447 @@
1
+ import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
2
+ import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
3
+ import { IbGibSpaceAny } from '@ibgib/core-gib/dist/witness/space/space-base-v1.mjs';
4
+ // import { SecretModalFormComponent } from '../modals/secret-modal-form/secret-modal-form.component';
5
+ // import { EncryptionModalFormComponent } from '../modals/encryption-modal-form/encryption-modal-form.component';
6
+ // import { OuterspaceModalFormComponent } from '../modals/outerspace-modal-form/outerspace-modal-form.component';
7
+ // import { UpdatePicModalFormComponent, UpdatePicPromptResult } from '../modals/update-pic-modal-form/update-pic-modal-form.component';
8
+ // import { UpdateCommentModalFormComponent, UpdateCommentPromptResult } from '../modals/update-comment-modal-form/update-comment-modal-form.component';
9
+ // import { EncryptionData_V1 } from '@ibgib/core-gib/dist/common/encrypt/encrypt-types.mjs';
10
+ // import { OuterSpaceIbGib } from '@ibgib/core-gib/dist/witness/space/outer-space/outer-space-types.mjs';
11
+ // import { PicIbGib_V1 } from '@ibgib/core-gib/dist/common/pic/pic-types.mjs';
12
+ // import { RobbotIbGib_V1 } from '@ibgib/core-gib/dist/witness/robbot/robbot-types.mjs';
13
+ // import {
14
+ // RobbotModalFormComponent, RobbotPromptResult
15
+ // } from '@ibgib/core-gib/dist/modals/robbot-modal-form/robbot-modal-form.component';
16
+ // import { AppIbGib_V1 } from '@ibgib/core-gib/dist/witness/app/app-types.mjs';
17
+ // import {
18
+ // AppModalFormComponent, AppPromptResult
19
+ // } from '@ibgib/core-gib/dist../modals/app-modal-form/app-modal-form.component';
20
+ // import { clearDoCancelModalOnBackButton, registerCancelModalOnBackButton } from '@ibgib/core-gib/dist./utils';
21
+ // import { CommentIbGib_V1 } from '@ibgib/core-gib/dist/common/comment/comment-types.mjs';
22
+ // import { SECRET_REL8N_NAME } from '@ibgib/core-gib/dist/common/encrypt/encrypt-constants.mjs';
23
+
24
+ import { GLOBAL_LOG_A_LOT } from '../constants.mjs';
25
+ import { alertUser, promptForConfirm, promptForText } from '../helpers.web.mjs';
26
+
27
+ const logalot = GLOBAL_LOG_A_LOT || false;
28
+
29
+
30
+ /**
31
+ * Wrapper for alerting via atow capacitor modals.
32
+ *
33
+ * @returns FUNCTION that alerts (doesn't actually do the alert)
34
+ */
35
+ export function getFnAlert(): ({ title, msg }: { title: string, msg: string }) => Promise<void> {
36
+ return async ({ title, msg }: { title: string, msg: string }) => {
37
+ // await Dialog.alert({ title, message: msg });
38
+ // const titlePlusMsg = `${title}: ${msg}`;
39
+ // console.log(titlePlusMsg);
40
+ // alert(titlePlusMsg)
41
+ await alertUser({ msg, title });
42
+ };
43
+ }
44
+
45
+ /**
46
+ * Wrapper for prompting via custom dialog function.
47
+ *
48
+ * @returns FUNCTION that prompts (doesn't actually do the prompt, just creates
49
+ * the function that will)
50
+ */
51
+ export function getFnPrompt(): ({ title, msg }: { title: string, msg: string }) => Promise<string | null> {
52
+ return async ({ title, msg }: { title: string, msg: string }) => {
53
+ const lc = `[${getFnPrompt.name}]`;
54
+ let answer: string;
55
+ try {
56
+ if (!msg) { throw new Error(`msg required. (E: c39d1656b6b803e11bad46efe15b6823)`); }
57
+
58
+ answer = await promptForText({ title, msg });
59
+
60
+ // const titlePlusMsg = `${title}: ${msg}`;
61
+ // console.log(`${lc} ${titlePlusMsg}`);
62
+ // answer = window.prompt(titlePlusMsg) ?? '';
63
+ // if (logalot) { console.log(`${lc} answer: ${answer} (I: 89e4379f368c136a31e52107447b7b24)`); }
64
+
65
+ // const rl = readline.createInterface({ input: stdin, output: stdout });
66
+ // try {
67
+ // const text = title ? `\n# ${title}:\n\n${msg}\n` : `${msg}\n`;
68
+ // answer = await rl.question(text);
69
+ // if (logalot) { console.log(`${lc} text: ${text}. answer: ${answer} (I: 7f0375b3abd7eba9c75636d31bbca323)`); }
70
+ // } catch (error) {
71
+ // throw error;
72
+ // } finally {
73
+ // rl.close();
74
+ // }
75
+ } catch (error) {
76
+ console.error(`${lc} ${extractErrorMsg(error)}`);
77
+ throw error;
78
+ }
79
+ return answer || answer === '' ? answer : null;
80
+ };
81
+ }
82
+
83
+ /**
84
+ * Wrapper for confirming via commandline/terminal prompt.
85
+ *
86
+ * @returns FUNCTION that prompts (doesn't actually do the prompt)
87
+ */
88
+ export function getFnConfirm():
89
+ ({ title, msg, okButtonTitle, cancelButtonTitle }:
90
+ { title: string, msg: string, okButtonTitle?: string, cancelButtonTitle?: string }) => Promise<boolean> {
91
+ return async ({ title, msg, okButtonTitle, cancelButtonTitle }:
92
+ { title: string, msg: string, okButtonTitle?: string, cancelButtonTitle?: string }) => {
93
+ okButtonTitle ||= 'yes';
94
+ cancelButtonTitle ||= 'no';
95
+
96
+ if (okButtonTitle === cancelButtonTitle) { throw new Error(`okButtonTitle (${okButtonTitle}) must be different than cancelButtonTitle (${cancelButtonTitle}) (E: 254e92fed2e99edc362de337e8bf3123)`); }
97
+ // if (okButtonTitle[0] === cancelButtonTitle[0]) { throw new Error(`okButtonTitle (${okButtonTitle}) must start with a different character than cancelButtonTitle (${cancelButtonTitle}) (E: 8bdd34b0d90f479399d911af58df9190)`); }
98
+
99
+ let result = await promptForConfirm({
100
+ msg,
101
+ yesLabel: okButtonTitle,
102
+ noLabel: cancelButtonTitle,
103
+ });
104
+
105
+ return result;
106
+
107
+ // const promptFn = getFnPrompt();
108
+ // let result: string | null = null;
109
+ // do {
110
+ // // result = await promptFn({ title, msg: `${msg} (${okButtonTitle}/${cancelButtonTitle})` });
111
+ // result = await promptForConfirm({
112
+ // title,
113
+ // msg: `${msg} (${okButtonTitle}/${cancelButtonTitle})`
114
+ // }) ?? null;
115
+ // result = result ? result!.toLowerCase() : null;
116
+ // } while (!result);
117
+
118
+ // if (result === okButtonTitle![0].toLowerCase()) { result = okButtonTitle!; }
119
+ // return result === okButtonTitle;
120
+ };
121
+ }
122
+
123
+ /**
124
+ * Prompts the user for a password using an ionic capacitor (atow) alert
125
+ * controller with an input of type `'password'`.
126
+ *
127
+ *
128
+ *
129
+ * @returns either the password or null if cancelled
130
+ */
131
+ export function getFnPromptPassword(): (title: string, msg: string) => Promise<string | null> {
132
+ const lc = `[${getFnPromptPassword.name}]`;
133
+ try {
134
+ throw new Error(`not implemented yet. i have added PromptPasswordFunction type in core-gib/core-types (E: 78c7dbb8958f8f353730d0dbb86b5423)`);
135
+ // if (!alertController) { throw new Error('alertController required.'); }
136
+ // let fnPromptPassword = async (title: string, msg: string) => {
137
+ // const alert = await alertController.create({
138
+ // header: title,
139
+ // message: msg,
140
+ // inputs: [
141
+ // { name: 'password', type: 'password', label: 'Password: ', },
142
+ // ],
143
+ // buttons: ['OK', 'Cancel'],
144
+ // });
145
+ // await alert.present();
146
+ // let result = await alert.onDidDismiss();
147
+ // if (result?.data?.values?.password) {
148
+ // return result!.data!.values!.password;
149
+ // } else {
150
+ // return null;
151
+ // }
152
+ // };
153
+ // return fnPromptPassword;
154
+ } catch (error) {
155
+ console.error(`${lc} ${extractErrorMsg(error)}`);
156
+ throw error;
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Creates a function with a single `space` arg. This fn when called shows a
162
+ * modal to create an secret ibgib. If the user chooses to save, then the
163
+ * modal will create the secret ibgib, save the transform result in the
164
+ * given `space` (atow this is the local user space), and return the new
165
+ * secret ibgib.
166
+ */
167
+ export function getFn_promptCreateSecretIbGib(
168
+ ): (space: IbGibSpaceAny) => Promise<IbGib_V1 | undefined> {
169
+ const lc = `[${getFn_promptCreateSecretIbGib.name}]`;
170
+ return async (space: IbGibSpaceAny) => {
171
+ throw new Error(`not impl yet (E: 990b79f9b8c2302163cc656deceaf923)`);
172
+ // /** hacked untyped document reference to hack a solution to the back button leaving modals open. */
173
+ // try {
174
+ // const modal = await common.modalController.create({
175
+ // component: SecretModalFormComponent,
176
+ // });
177
+ // // have to register/clear modal for cancelling in case the user
178
+ // // presses the back button while the modal is still visible
179
+ // registerCancelModalOnBackButton(modal);
180
+ // await modal.present();
181
+ // let resModal = await modal.onWillDismiss();
182
+ // // clear the cancel since it dismissed naturally
183
+ // clearDoCancelModalOnBackButton();
184
+ // if (resModal.data) {
185
+ // const resNewSecret = <TransformResult<SecretIbGib_V1>>resModal.data;
186
+ // await common.ibgibs.persistTransformResult({ resTransform: resNewSecret, space });
187
+ // const addr = getIbGibAddr({ ibGib: resNewSecret.newIbGib });
188
+ // if (logalot) { console.log(`${lc} created secret. addr: ${addr}`); }
189
+ // await common.ibgibs.rel8ToSpecialIbGib({
190
+ // type: "secrets",
191
+ // rel8nName: SECRET_REL8N_NAME,
192
+ // ibGibsToRel8: [resNewSecret.newIbGib],
193
+ // space,
194
+ // });
195
+ // return resNewSecret.newIbGib;
196
+ // } else {
197
+ // // didn't create one
198
+ // console.warn(`${lc} didn't create at this time.`);
199
+ // return undefined;
200
+ // }
201
+ // } catch (error) {
202
+ // console.error(`${lc} error: ${extractErrorMsg(error)}`);
203
+ // return undefined;
204
+ // }
205
+ }
206
+ }
207
+
208
+ /**
209
+ * Creates a function with a single `space` arg. This fn when called shows a
210
+ * modal to create an encryption ibgib. If the user chooses to save, then the
211
+ * modal will create the encryption ibgib, save the transform result in the
212
+ * given `space` (atow this is the local user space), and return the new
213
+ * encryption ibgib.
214
+ */
215
+ export function getFn_promptCreateEncryptionIbGib(
216
+ // common: CommonService,
217
+ ): (space: IbGibSpaceAny) => Promise<IbGib_V1 | undefined> {
218
+ throw new Error(`not impl yet (E: 69c7d552de7318a97457363adfd34f23)`);
219
+ // const lc = `[${getFn_promptCreateEncryptionIbGib.name}]`;
220
+ // return async (space: IbGibSpaceAny) => {
221
+ // try {
222
+ // const modal = await common.modalController.create({
223
+ // component: EncryptionModalFormComponent,
224
+ // });
225
+ // // have to register/clear modal for cancelling in case the user
226
+ // // presses the back button while the modal is still visible
227
+ // registerCancelModalOnBackButton(modal);
228
+ // await modal.present();
229
+ // let resModal = await modal.onWillDismiss();
230
+ // // clear the cancel since it dismissed naturally
231
+ // clearDoCancelModalOnBackButton();
232
+ // if (resModal.data) {
233
+ // const resNewEncryption = <TransformResult<IbGib_V1<EncryptionData_V1>>>resModal.data;
234
+ // await common.ibgibs.persistTransformResult({ resTransform: resNewEncryption, space });
235
+ // const addr = getIbGibAddr({ ibGib: resNewEncryption.newIbGib });
236
+ // if (logalot) { console.log(`${lc} created encryption. addr: ${addr}`); }
237
+ // return resNewEncryption.newIbGib;
238
+ // } else {
239
+ // // didn't create one
240
+ // console.warn(`${lc} didn't create at this time.`);
241
+ // return undefined;
242
+ // }
243
+ // } catch (error) {
244
+ // console.error(`${lc} error: ${extractErrorMsg(error)}`);
245
+ // return undefined;
246
+ // }
247
+ // }
248
+ }
249
+
250
+ /**
251
+ * Creates a function with a single `space` arg. This fn when called shows a
252
+ * modal to create an outerspace ibgib. If the user chooses to save, then the
253
+ * modal will create the outerspace ibgib, save the transform result in the
254
+ * given `space` (atow this is the local user space), and return the new
255
+ * outerspace ibgib.
256
+ */
257
+ export function getFn_promptCreateOuterSpaceIbGib(
258
+ // common: CommonService,
259
+ ): (space: IbGibSpaceAny) => Promise<IbGib_V1 | undefined> {
260
+ throw new Error(`not impl yet (E: e48ef8a7b4252cfe795dde791de99523)`);
261
+ // const lc = `[${getFn_promptCreateOuterSpaceIbGib.name}]`;
262
+ // return async (space: IbGibSpaceAny) => {
263
+ // try {
264
+ // const modal = await common.modalController.create({
265
+ // component: OuterspaceModalFormComponent,
266
+ // });
267
+ // // have to register/clear modal for cancelling in case the user
268
+ // // presses the back button while the modal is still visible
269
+ // registerCancelModalOnBackButton(modal);
270
+ // await modal.present();
271
+ // let resModal = await modal.onWillDismiss();
272
+ // // clear the cancel since it dismissed naturally
273
+ // clearDoCancelModalOnBackButton();
274
+ // if (resModal.data) {
275
+ // const resOuterSpace = <TransformResult<OuterSpaceIbGib>>resModal.data;
276
+ // await common.ibgibs.persistTransformResult({ resTransform: resOuterSpace, space });
277
+ // const addr = getIbGibAddr({ ibGib: resOuterSpace.newIbGib });
278
+ // if (logalot) { console.log(`${lc} created outerspace. addr: ${addr}`); }
279
+ // return resOuterSpace.newIbGib;
280
+ // } else {
281
+ // // didn't create one
282
+ // console.warn(`${lc} didn't create outerspace at this time.`);
283
+ // return undefined;
284
+ // }
285
+ // } catch (error) {
286
+ // console.error(`${lc} error: ${extractErrorMsg(error)}`);
287
+ // return undefined;
288
+ // }
289
+ // }
290
+ }
291
+
292
+ /**
293
+ * Creates a function with a single `space` arg. This fn when called shows a
294
+ * modal to mutate a pic ibgib. If the user chooses to save, then the modal will
295
+ * perform the mutation, save the transform result in the given `space`, and
296
+ * return the new pic ibgib.
297
+ */
298
+ // export function getFn_promptUpdatePicIbGib(
299
+ // common: CommonService,
300
+ // ): (space: IbGibSpaceAny, picIbGib: PicIbGib_V1) => Promise<UpdatePicPromptResult | undefined> {
301
+ // const lc = `[${getFn_promptUpdatePicIbGib.name}]`;
302
+ // return async (space: IbGibSpaceAny, picIbGib: PicIbGib_V1) => {
303
+ // try {
304
+ // const modal = await common.modalController.create({
305
+ // component: UpdatePicModalFormComponent,
306
+ // componentProps: { picIbGib, space },
307
+ // });
308
+ // // have to register/clear modal for cancelling in case the user
309
+ // // presses the back button while the modal is still visible
310
+ // registerCancelModalOnBackButton(modal);
311
+ // await modal.present();
312
+ // let resModal = await modal.onWillDismiss();
313
+ // // clear the cancel since it dismissed naturally
314
+ // clearDoCancelModalOnBackButton();
315
+ // if (resModal.data) {
316
+ // const result = <UpdatePicPromptResult>resModal.data;
317
+ // const [resCreatePic, _resCreateBin] = result;
318
+ // const addr = getIbGibAddr({ ibGib: resCreatePic.newIbGib });
319
+ // if (logalot) { console.log(`${lc} updated pic. addr: ${addr}`); }
320
+ // return result;
321
+ // } else {
322
+ // // didn't create one
323
+ // console.warn(`${lc} didn't create at this time.`);
324
+ // return undefined;
325
+ // }
326
+ // } catch (error) {
327
+ // console.error(`${lc} error: ${extractErrorMsg(error)}`);
328
+ // return undefined;
329
+ // }
330
+ // }
331
+ // }
332
+
333
+ /**
334
+ * Creates a function with a single `space` arg. This fn when called shows a
335
+ * modal to mutate a comment ibgib. If the user chooses to save, then the modal will
336
+ * perform the mutation, save the transform result in the given `space`, and
337
+ * return the new comment ibgib.
338
+ */
339
+ // export function getFn_promptUpdateCommentIbGib(
340
+ // common: CommonService,
341
+ // ): (space: IbGibSpaceAny, commentIbGib: CommentIbGib_V1) => Promise<UpdateCommentPromptResult | undefined> {
342
+ // const lc = `[${getFn_promptUpdateCommentIbGib.name}]`;
343
+ // return async (space: IbGibSpaceAny, commentIbGib: CommentIbGib_V1) => {
344
+ // try {
345
+ // const modal = await common.modalController.create({
346
+ // component: UpdateCommentModalFormComponent,
347
+ // componentProps: { commentIbGib, space },
348
+ // });
349
+ // // have to register/clear modal for cancelling in case the user
350
+ // // presses the back button while the modal is still visible
351
+ // registerCancelModalOnBackButton(modal);
352
+ // await modal.present();
353
+ // let resModal = await modal.onWillDismiss();
354
+ // // clear the cancel since it dismissed naturally
355
+ // clearDoCancelModalOnBackButton();
356
+ // if (resModal.data) {
357
+ // const resCreateComment = <UpdateCommentPromptResult>resModal.data;
358
+ // const addr = getIbGibAddr({ ibGib: resCreateComment.newIbGib });
359
+ // if (logalot) { console.log(`${lc} updated comment. addr: ${addr}`); }
360
+ // return resCreateComment;
361
+ // } else {
362
+ // // didn't create one
363
+ // console.warn(`${lc} didn't create at this time.`);
364
+ // return undefined;
365
+ // }
366
+ // } catch (error) {
367
+ // console.error(`${lc} error: ${extractErrorMsg(error)}`);
368
+ // return undefined;
369
+ // }
370
+ // }
371
+ // }
372
+
373
+ /**
374
+ * Creates a function with a single `space` arg. This fn when called shows a
375
+ * modal to create a robbot ibgib. If the user chooses to save, then the modal will
376
+ * perform the mutation, save the transform result in the given `space`, and
377
+ * return the new pic ibgib.
378
+ */
379
+ // export function getFn_promptRobbotIbGib(
380
+ // common: CommonService,
381
+ // ): (space: IbGibSpaceAny, ibGib: RobbotIbGib_V1) => Promise<RobbotPromptResult | undefined> {
382
+ // const lc = `[${getFn_promptRobbotIbGib.name}]`;
383
+ // return async (space: IbGibSpaceAny, ibGib: RobbotIbGib_V1) => {
384
+ // try {
385
+ // const modal = await common.modalController.create({
386
+ // component: RobbotModalFormComponent,
387
+ // componentProps: { ibGib, space },
388
+ // });
389
+ // // have to register/clear modal for cancelling in case the user
390
+ // // presses the back button while the modal is still visible
391
+ // registerCancelModalOnBackButton(modal);
392
+ // await modal.present();
393
+ // let resModal = await modal.onWillDismiss();
394
+ // // clear the cancel since it dismissed naturally
395
+ // clearDoCancelModalOnBackButton();
396
+ // if (resModal.data) {
397
+ // const result = <RobbotPromptResult>resModal.data;
398
+ // return result;
399
+ // } else {
400
+ // // didn't create one
401
+ // console.warn(`${lc} didn't create at this time.`);
402
+ // return undefined;
403
+ // }
404
+ // } catch (error) {
405
+ // console.error(`${lc} error: ${extractErrorMsg(error)}`);
406
+ // return undefined;
407
+ // }
408
+ // }
409
+ // }
410
+
411
+ /**
412
+ * Creates a function with a single `space` arg. This fn when called shows a
413
+ * modal to create a app ibgib. If the user chooses to save, then the modal will
414
+ * perform the mutation, save the transform result in the given `space`, and
415
+ * return the new pic ibgib.
416
+ */
417
+ // export function getFn_promptAppIbGib(
418
+ // common: CommonService,
419
+ // ): (space: IbGibSpaceAny, ibGib: AppIbGib_V1) => Promise<AppPromptResult | undefined> {
420
+ // const lc = `[${getFn_promptAppIbGib.name}]`;
421
+ // return async (space: IbGibSpaceAny, ibGib: AppIbGib_V1) => {
422
+ // try {
423
+ // const modal = await common.modalController.create({
424
+ // component: AppModalFormComponent,
425
+ // componentProps: { ibGib, space },
426
+ // });
427
+ // // have to register/clear modal for cancelling in case the user
428
+ // // presses the back button while the modal is still visible
429
+ // registerCancelModalOnBackButton(modal);
430
+ // await modal.present();
431
+ // let resModal = await modal.onWillDismiss();
432
+ // // clear the cancel since it dismissed naturally
433
+ // clearDoCancelModalOnBackButton();
434
+ // if (resModal.data) {
435
+ // const result = <AppPromptResult>resModal.data;
436
+ // return result;
437
+ // } else {
438
+ // // didn't create one
439
+ // console.warn(`${lc} didn't create at this time.`);
440
+ // return undefined;
441
+ // }
442
+ // } catch (error) {
443
+ // console.error(`${lc} error: ${extractErrorMsg(error)}`);
444
+ // return undefined;
445
+ // }
446
+ // }
447
+ // }
@@ -0,0 +1,72 @@
1
+ import { Settings_Chronologys, Settings_General, Settings_Minigame, Settings_Project, Settings_TextEditor, SettingsData_V1 } from "./settings-types.mjs";
2
+
3
+ export const SETTINGS_ATOM = 'settings';
4
+
5
+ // #region SettingsType enum
6
+ export const SETTINGS_TYPE_GENERAL = 'general';
7
+ export const SETTINGS_TYPE_TEXTEDITOR = 'text-editor';
8
+ export const SETTINGS_TYPE_PROJECTS = 'projects';
9
+ export const SETTINGS_TYPE_PROJECTSEXPLORER = 'projects-explorer';
10
+ export const SETTINGS_TYPE_PROJECTSDROPDOWN = 'projects-dropdown';
11
+ export const SETTINGS_TYPE_PROJECT = 'project';
12
+ export const SETTINGS_TYPE_MINIGAME = 'minigame';
13
+ export const SETTINGS_TYPE_CHRONOLOGYS = 'chronologys';
14
+ /**
15
+ * Discriminator for Settings info
16
+ */
17
+ export type SettingsType =
18
+ | typeof SETTINGS_TYPE_GENERAL
19
+ | typeof SETTINGS_TYPE_TEXTEDITOR
20
+ | typeof SETTINGS_TYPE_PROJECTS
21
+ | typeof SETTINGS_TYPE_PROJECTSEXPLORER
22
+ | typeof SETTINGS_TYPE_PROJECTSDROPDOWN
23
+ | typeof SETTINGS_TYPE_PROJECT
24
+ | typeof SETTINGS_TYPE_MINIGAME
25
+ | typeof SETTINGS_TYPE_CHRONOLOGYS
26
+ ;
27
+ export const SettingsType = {
28
+ general: SETTINGS_TYPE_GENERAL satisfies SettingsType,
29
+ textEditor: SETTINGS_TYPE_TEXTEDITOR satisfies SettingsType,
30
+ projects: SETTINGS_TYPE_PROJECTS satisfies SettingsType,
31
+ projectsExplorer: SETTINGS_TYPE_PROJECTSEXPLORER satisfies SettingsType,
32
+ projectsDropdown: SETTINGS_TYPE_PROJECTSDROPDOWN satisfies SettingsType,
33
+ project: SETTINGS_TYPE_PROJECT satisfies SettingsType,
34
+ minigame: SETTINGS_TYPE_MINIGAME satisfies SettingsType,
35
+ chronologys: SETTINGS_TYPE_CHRONOLOGYS satisfies SettingsType,
36
+ } satisfies { readonly [key: string]: SettingsType; };
37
+ export const SETTINGS_TYPE_VALID_VALUES: SettingsType[] = Object.values(SettingsType);
38
+ export function isSettingsType(value: any): value is SettingsType {
39
+ return SETTINGS_TYPE_VALID_VALUES.includes(value);
40
+ }
41
+ // #endregion SettingsType enum
42
+
43
+ export const DEFAULT_SETTINGS_GENERAL: Settings_General = {
44
+ type: SettingsType.general,
45
+ editor: undefined,
46
+ readonly: true,
47
+ viewer: 'ibgib-raw-viewer',
48
+ }
49
+ export const DEFAULT_SETTINGS_TEXTEDITOR: Settings_TextEditor = {
50
+ type: SettingsType.textEditor,
51
+ wrap: 'wrap',
52
+ }
53
+ export const DEFAULT_SETTINGS_PROJECT: Settings_Project = {
54
+ type: SettingsType.project,
55
+ openChildTjpAddrs: [],
56
+ activeChildTjpAddr: undefined,
57
+ lensMode: 'raw',
58
+ }
59
+ export const DEFAULT_SETTINGS_MINIGAME: Settings_Minigame = {
60
+ type: SettingsType.minigame,
61
+ }
62
+
63
+ export const DEFAULT_SETTINGS_CHRONOLOGYS: Settings_Chronologys = {
64
+ type: SettingsType.chronologys,
65
+ openChildTjpAddrs: [],
66
+ activeChildTjpAddr: undefined,
67
+ }
68
+
69
+ export const DEFAULT_SETTINGS_DATA_V1: SettingsData_V1 = {
70
+ sections: {},
71
+ children: {},
72
+ }