@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.
- package/.ibgibignore +30 -0
- package/.vscode/ibgib-snippets.code-snippets +309 -0
- package/.vscode/launch.json +25 -0
- package/.vscode/settings.json +68 -0
- package/.vscode/tasks.json +38 -0
- package/CHANGELOG.md +427 -0
- package/README.md +66 -0
- package/dist/agent-texts/common-agent-texts.d.mts +14 -0
- package/dist/agent-texts/common-agent-texts.d.mts.map +1 -0
- package/dist/agent-texts/common-agent-texts.mjs +51 -0
- package/dist/agent-texts/common-agent-texts.mjs.map +1 -0
- package/dist/agent-texts/primary-agent-texts.d.mts +16 -0
- package/dist/agent-texts/primary-agent-texts.d.mts.map +1 -0
- package/dist/agent-texts/primary-agent-texts.mjs +27 -0
- package/dist/agent-texts/primary-agent-texts.mjs.map +1 -0
- package/dist/agent-texts/project-agent-texts.d.mts +8 -0
- package/dist/agent-texts/project-agent-texts.d.mts.map +1 -0
- package/dist/agent-texts/project-agent-texts.mjs +29 -0
- package/dist/agent-texts/project-agent-texts.mjs.map +1 -0
- package/dist/agent-texts/project-child-text-agent-texts.d.mts +5 -0
- package/dist/agent-texts/project-child-text-agent-texts.d.mts.map +1 -0
- package/dist/agent-texts/project-child-text-agent-texts.mjs +26 -0
- package/dist/agent-texts/project-child-text-agent-texts.mjs.map +1 -0
- package/dist/agent-texts/projects-agent-texts.d.mts +4 -0
- package/dist/agent-texts/projects-agent-texts.d.mts.map +1 -0
- package/dist/agent-texts/projects-agent-texts.mjs +15 -0
- package/dist/agent-texts/projects-agent-texts.mjs.map +1 -0
- package/dist/agent-texts/raw-agent-texts.d.mts +4 -0
- package/dist/agent-texts/raw-agent-texts.d.mts.map +1 -0
- package/dist/agent-texts/raw-agent-texts.mjs +17 -0
- package/dist/agent-texts/raw-agent-texts.mjs.map +1 -0
- package/dist/agent-texts/text-editor-agent-texts.d.mts +6 -0
- package/dist/agent-texts/text-editor-agent-texts.d.mts.map +1 -0
- package/dist/agent-texts/text-editor-agent-texts.mjs +19 -0
- package/dist/agent-texts/text-editor-agent-texts.mjs.map +1 -0
- package/dist/api/api-constants.d.mts +9 -0
- package/dist/api/api-constants.d.mts.map +1 -0
- package/dist/api/api-constants.mjs +9 -0
- package/dist/api/api-constants.mjs.map +1 -0
- package/dist/api/api-index.d.mts +10 -0
- package/dist/api/api-index.d.mts.map +1 -0
- package/dist/api/api-index.mjs +121 -0
- package/dist/api/api-index.mjs.map +1 -0
- package/dist/api/api-types.d.mts +36 -0
- package/dist/api/api-types.d.mts.map +1 -0
- package/dist/api/api-types.mjs +2 -0
- package/dist/api/api-types.mjs.map +1 -0
- package/dist/api/commands/chat/chat-index.d.mts +3 -0
- package/dist/api/commands/chat/chat-index.d.mts.map +1 -0
- package/dist/api/commands/chat/chat-index.mjs +9 -0
- package/dist/api/commands/chat/chat-index.mjs.map +1 -0
- package/dist/api/commands/chat/get-context-info.d.mts +71 -0
- package/dist/api/commands/chat/get-context-info.d.mts.map +1 -0
- package/dist/api/commands/chat/get-context-info.mjs +130 -0
- package/dist/api/commands/chat/get-context-info.mjs.map +1 -0
- package/dist/api/commands/chat/hello-world.d.mts +63 -0
- package/dist/api/commands/chat/hello-world.d.mts.map +1 -0
- package/dist/api/commands/chat/hello-world.mjs +132 -0
- package/dist/api/commands/chat/hello-world.mjs.map +1 -0
- package/dist/api/commands/chat/tell-user.d.mts +57 -0
- package/dist/api/commands/chat/tell-user.d.mts.map +1 -0
- package/dist/api/commands/chat/tell-user.mjs +199 -0
- package/dist/api/commands/chat/tell-user.mjs.map +1 -0
- package/dist/api/commands/command-constants.d.mts +22 -0
- package/dist/api/commands/command-constants.d.mts.map +1 -0
- package/dist/api/commands/command-constants.mjs +17 -0
- package/dist/api/commands/command-constants.mjs.map +1 -0
- package/dist/api/commands/command-helpers.d.mts +47 -0
- package/dist/api/commands/command-helpers.d.mts.map +1 -0
- package/dist/api/commands/command-helpers.mjs +76 -0
- package/dist/api/commands/command-helpers.mjs.map +1 -0
- package/dist/api/commands/command-service-v1.d.mts +28 -0
- package/dist/api/commands/command-service-v1.d.mts.map +1 -0
- package/dist/api/commands/command-service-v1.mjs +122 -0
- package/dist/api/commands/command-service-v1.mjs.map +1 -0
- package/dist/api/commands/command-service.respec.d.mts +7 -0
- package/dist/api/commands/command-service.respec.d.mts.map +1 -0
- package/dist/api/commands/command-service.respec.mjs +66 -0
- package/dist/api/commands/command-service.respec.mjs.map +1 -0
- package/dist/api/commands/command-types.d.mts +48 -0
- package/dist/api/commands/command-types.d.mts.map +1 -0
- package/dist/api/commands/command-types.mjs +12 -0
- package/dist/api/commands/command-types.mjs.map +1 -0
- package/dist/api/commands/ibgib/get-ibgibs.d.mts +94 -0
- package/dist/api/commands/ibgib/get-ibgibs.d.mts.map +1 -0
- package/dist/api/commands/ibgib/get-ibgibs.mjs +219 -0
- package/dist/api/commands/ibgib/get-ibgibs.mjs.map +1 -0
- package/dist/api/commands/ibgib/ibgib-index.d.mts +3 -0
- package/dist/api/commands/ibgib/ibgib-index.d.mts.map +1 -0
- package/dist/api/commands/ibgib/ibgib-index.mjs +7 -0
- package/dist/api/commands/ibgib/ibgib-index.mjs.map +1 -0
- package/dist/api/commands/ibgib/mut8-ibgib.d.mts +135 -0
- package/dist/api/commands/ibgib/mut8-ibgib.d.mts.map +1 -0
- package/dist/api/commands/ibgib/mut8-ibgib.mjs +318 -0
- package/dist/api/commands/ibgib/mut8-ibgib.mjs.map +1 -0
- package/dist/api/commands/templates/api-function-info.template.d.mts +73 -0
- package/dist/api/commands/templates/api-function-info.template.d.mts.map +1 -0
- package/dist/api/commands/templates/api-function-info.template.mjs +161 -0
- package/dist/api/commands/templates/api-function-info.template.mjs.map +1 -0
- package/dist/api/commands/text/text-edit.d.mts +54 -0
- package/dist/api/commands/text/text-edit.d.mts.map +1 -0
- package/dist/api/commands/text/text-edit.mjs +170 -0
- package/dist/api/commands/text/text-edit.mjs.map +1 -0
- package/dist/api/commands/text/text-index.d.mts +3 -0
- package/dist/api/commands/text/text-index.d.mts.map +1 -0
- package/dist/api/commands/text/text-index.mjs +5 -0
- package/dist/api/commands/text/text-index.mjs.map +1 -0
- package/dist/api/commands/ui/ui-index.d.mts +3 -0
- package/dist/api/commands/ui/ui-index.d.mts.map +1 -0
- package/dist/api/commands/ui/ui-index.mjs +5 -0
- package/dist/api/commands/ui/ui-index.mjs.map +1 -0
- package/dist/api/commands/ui/update-css-variables.d.mts +48 -0
- package/dist/api/commands/ui/update-css-variables.d.mts.map +1 -0
- package/dist/api/commands/ui/update-css-variables.mjs +145 -0
- package/dist/api/commands/ui/update-css-variables.mjs.map +1 -0
- package/dist/api/function-infos.web.d.mts +15 -0
- package/dist/api/function-infos.web.d.mts.map +1 -0
- package/dist/api/function-infos.web.mjs +63 -0
- package/dist/api/function-infos.web.mjs.map +1 -0
- package/dist/assumptions.respec.d.mts +2 -0
- package/dist/assumptions.respec.d.mts.map +1 -0
- package/dist/assumptions.respec.mjs +41 -0
- package/dist/assumptions.respec.mjs.map +1 -0
- package/dist/common/project/project-constants.d.mts +38 -0
- package/dist/common/project/project-constants.d.mts.map +1 -0
- package/dist/common/project/project-constants.mjs +71 -0
- package/dist/common/project/project-constants.mjs.map +1 -0
- package/dist/common/project/project-helper.d.mts +127 -0
- package/dist/common/project/project-helper.d.mts.map +1 -0
- package/dist/common/project/project-helper.mjs +683 -0
- package/dist/common/project/project-helper.mjs.map +1 -0
- package/dist/common/project/project-types.d.mts +91 -0
- package/dist/common/project/project-types.d.mts.map +1 -0
- package/dist/common/project/project-types.mjs +31 -0
- package/dist/common/project/project-types.mjs.map +1 -0
- package/dist/common/prompt-functions.web.d.mts +90 -0
- package/dist/common/prompt-functions.web.d.mts.map +1 -0
- package/dist/common/prompt-functions.web.mjs +426 -0
- package/dist/common/prompt-functions.web.mjs.map +1 -0
- package/dist/common/settings/settings-constants.d.mts +33 -0
- package/dist/common/settings/settings-constants.d.mts.map +1 -0
- package/dist/common/settings/settings-constants.mjs +54 -0
- package/dist/common/settings/settings-constants.mjs.map +1 -0
- package/dist/common/settings/settings-helpers.d.mts +59 -0
- package/dist/common/settings/settings-helpers.d.mts.map +1 -0
- package/dist/common/settings/settings-helpers.mjs +253 -0
- package/dist/common/settings/settings-helpers.mjs.map +1 -0
- package/dist/common/settings/settings-types.d.mts +118 -0
- package/dist/common/settings/settings-types.d.mts.map +1 -0
- package/dist/common/settings/settings-types.mjs +13 -0
- package/dist/common/settings/settings-types.mjs.map +1 -0
- package/dist/constants.d.mts +34 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +35 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/foo.d.mts +2 -0
- package/dist/foo.d.mts.map +1 -0
- package/dist/foo.mjs +19 -0
- package/dist/foo.mjs.map +1 -0
- package/dist/helpers.d.mts +137 -0
- package/dist/helpers.d.mts.map +1 -0
- package/dist/helpers.mjs +514 -0
- package/dist/helpers.mjs.map +1 -0
- package/dist/helpers.web.d.mts +324 -0
- package/dist/helpers.web.d.mts.map +1 -0
- package/dist/helpers.web.mjs +1133 -0
- package/dist/helpers.web.mjs.map +1 -0
- package/dist/helpers.web.respec.d.mts +2 -0
- package/dist/helpers.web.respec.d.mts.map +1 -0
- package/dist/helpers.web.respec.mjs +12 -0
- package/dist/helpers.web.respec.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/dist/respec-gib.node.d.mts +2 -0
- package/dist/respec-gib.node.d.mts.map +1 -0
- package/dist/respec-gib.node.mjs +211 -0
- package/dist/respec-gib.node.mjs.map +1 -0
- package/dist/spec-helper.node.respec.d.mts +13 -0
- package/dist/spec-helper.node.respec.d.mts.map +1 -0
- package/dist/spec-helper.node.respec.mjs +50 -0
- package/dist/spec-helper.node.respec.mjs.map +1 -0
- package/dist/storage/storage-helpers.web.d.mts +108 -0
- package/dist/storage/storage-helpers.web.d.mts.map +1 -0
- package/dist/storage/storage-helpers.web.mjs +757 -0
- package/dist/storage/storage-helpers.web.mjs.map +1 -0
- package/dist/storage/storage-types.web.d.mts +30 -0
- package/dist/storage/storage-types.web.d.mts.map +1 -0
- package/dist/storage/storage-types.web.mjs +2 -0
- package/dist/storage/storage-types.web.mjs.map +1 -0
- package/dist/types.web.d.mts +42 -0
- package/dist/types.web.d.mts.map +1 -0
- package/dist/types.web.mjs +2 -0
- package/dist/types.web.mjs.map +1 -0
- package/dist/ui/component/component-types.d.mts +225 -0
- package/dist/ui/component/component-types.d.mts.map +1 -0
- package/dist/ui/component/component-types.mjs +2 -0
- package/dist/ui/component/component-types.mjs.map +1 -0
- package/dist/ui/component/ibgib-component-service.d.mts +70 -0
- package/dist/ui/component/ibgib-component-service.d.mts.map +1 -0
- package/dist/ui/component/ibgib-component-service.mjs +201 -0
- package/dist/ui/component/ibgib-component-service.mjs.map +1 -0
- package/dist/ui/component/ibgib-dynamic-component-bases.d.mts +338 -0
- package/dist/ui/component/ibgib-dynamic-component-bases.d.mts.map +1 -0
- package/dist/ui/component/ibgib-dynamic-component-bases.mjs +1304 -0
- package/dist/ui/component/ibgib-dynamic-component-bases.mjs.map +1 -0
- package/dist/ui/ui-constants.d.mts +12 -0
- package/dist/ui/ui-constants.d.mts.map +1 -0
- package/dist/ui/ui-constants.mjs +93 -0
- package/dist/ui/ui-constants.mjs.map +1 -0
- package/dist/ui/ui-helpers.d.mts +42 -0
- package/dist/ui/ui-helpers.d.mts.map +1 -0
- package/dist/ui/ui-helpers.mjs +198 -0
- package/dist/ui/ui-helpers.mjs.map +1 -0
- package/dist/ui/ui-types.d.mts +13 -0
- package/dist/ui/ui-types.d.mts.map +1 -0
- package/dist/ui/ui-types.mjs +2 -0
- package/dist/ui/ui-types.mjs.map +1 -0
- package/dist/witness/agent/agent-constants.d.mts +97 -0
- package/dist/witness/agent/agent-constants.d.mts.map +1 -0
- package/dist/witness/agent/agent-constants.mjs +98 -0
- package/dist/witness/agent/agent-constants.mjs.map +1 -0
- package/dist/witness/agent/agent-helpers.d.mts +106 -0
- package/dist/witness/agent/agent-helpers.d.mts.map +1 -0
- package/dist/witness/agent/agent-helpers.mjs +601 -0
- package/dist/witness/agent/agent-helpers.mjs.map +1 -0
- package/dist/witness/agent/agent-one-file.app.d.mts +2 -0
- package/dist/witness/agent/agent-one-file.app.d.mts.map +1 -0
- package/dist/witness/agent/agent-one-file.app.mjs +8 -0
- package/dist/witness/agent/agent-one-file.app.mjs.map +1 -0
- package/dist/witness/agent/agent-one-file.d.mts +478 -0
- package/dist/witness/agent/agent-one-file.d.mts.map +1 -0
- package/dist/witness/agent/agent-one-file.mjs +1462 -0
- package/dist/witness/agent/agent-one-file.mjs.map +1 -0
- package/dist/witness/agent/agent-types.d.mts +83 -0
- package/dist/witness/agent/agent-types.d.mts.map +1 -0
- package/dist/witness/agent/agent-types.mjs +2 -0
- package/dist/witness/agent/agent-types.mjs.map +1 -0
- package/dist/witness/agent/agents-service-v1.d.mts +99 -0
- package/dist/witness/agent/agents-service-v1.d.mts.map +1 -0
- package/dist/witness/agent/agents-service-v1.mjs +453 -0
- package/dist/witness/agent/agents-service-v1.mjs.map +1 -0
- package/dist/witness/agent/function-info/function-info-one-file.d.mts +192 -0
- package/dist/witness/agent/function-info/function-info-one-file.d.mts.map +1 -0
- package/dist/witness/agent/function-info/function-info-one-file.mjs +192 -0
- package/dist/witness/agent/function-info/function-info-one-file.mjs.map +1 -0
- package/dist/witness/agent/gemini/agent-witness-gemini-v1.d.mts +51 -0
- package/dist/witness/agent/gemini/agent-witness-gemini-v1.d.mts.map +1 -0
- package/dist/witness/agent/gemini/agent-witness-gemini-v1.mjs +928 -0
- package/dist/witness/agent/gemini/agent-witness-gemini-v1.mjs.map +1 -0
- package/dist/witness/agent/gemini/gemini-agent-factory.d.mts +27 -0
- package/dist/witness/agent/gemini/gemini-agent-factory.d.mts.map +1 -0
- package/dist/witness/agent/gemini/gemini-agent-factory.mjs +144 -0
- package/dist/witness/agent/gemini/gemini-agent-factory.mjs.map +1 -0
- package/dist/witness/agent/gemini/gemini-constants.d.mts +36 -0
- package/dist/witness/agent/gemini/gemini-constants.d.mts.map +1 -0
- package/dist/witness/agent/gemini/gemini-constants.mjs +47 -0
- package/dist/witness/agent/gemini/gemini-constants.mjs.map +1 -0
- package/dist/witness/agent/gemini/gemini-helpers.d.mts +58 -0
- package/dist/witness/agent/gemini/gemini-helpers.d.mts.map +1 -0
- package/dist/witness/agent/gemini/gemini-helpers.mjs +210 -0
- package/dist/witness/agent/gemini/gemini-helpers.mjs.map +1 -0
- package/dist/witness/agent/gemini/gemini-types.d.mts +82 -0
- package/dist/witness/agent/gemini/gemini-types.d.mts.map +1 -0
- package/dist/witness/agent/gemini/gemini-types.mjs +3 -0
- package/dist/witness/agent/gemini/gemini-types.mjs.map +1 -0
- package/dist/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.d.mts +136 -0
- package/dist/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.d.mts.map +1 -0
- package/dist/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.mjs +334 -0
- package/dist/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.mjs.map +1 -0
- package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.d.mts +35 -0
- package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.d.mts.map +1 -0
- package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.mjs +267 -0
- package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.mjs.map +1 -0
- package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace.d.mts +134 -0
- package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace.d.mts.map +1 -0
- package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace.mjs +389 -0
- package/dist/witness/space/metaspace/metaspace-webspace/metaspace-webspace.mjs.map +1 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-constants.d.mts +2 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-constants.d.mts.map +1 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-constants.mjs +2 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-constants.mjs.map +1 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-helper.d.mts +104 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-helper.d.mts.map +1 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-helper.mjs +457 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-helper.mjs.map +1 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-types.d.mts +93 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-types.d.mts.map +1 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-types.mjs +98 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-types.mjs.map +1 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-v1.d.mts +73 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-v1.d.mts.map +1 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-v1.mjs +650 -0
- package/dist/witness/space/web-filesystem-space/web-filesystem-space-v1.mjs.map +1 -0
- package/generate-version-file.js +29 -0
- package/package.json +60 -0
- package/src/agent-texts/common-agent-texts.mts +61 -0
- package/src/agent-texts/primary-agent-texts.mts +32 -0
- package/src/agent-texts/project-agent-texts.mts +29 -0
- package/src/agent-texts/project-child-text-agent-texts.mts +30 -0
- package/src/agent-texts/projects-agent-texts.mts +17 -0
- package/src/agent-texts/raw-agent-texts.mts +18 -0
- package/src/agent-texts/text-editor-agent-texts.mts +20 -0
- package/src/api/api-constants.mts +8 -0
- package/src/api/api-index.mts +110 -0
- package/src/api/api-types.mts +36 -0
- package/src/api/commands/chat/chat-index.mts +10 -0
- package/src/api/commands/chat/get-context-info.mts +196 -0
- package/src/api/commands/chat/hello-world.mts +183 -0
- package/src/api/commands/chat/tell-user.mts +241 -0
- package/src/api/commands/command-constants.mts +17 -0
- package/src/api/commands/command-helpers.mts +105 -0
- package/src/api/commands/command-service-v1.mts +136 -0
- package/src/api/commands/command-service.respec.mts +72 -0
- package/src/api/commands/command-types.mts +71 -0
- package/src/api/commands/ibgib/get-ibgibs.mts +269 -0
- package/src/api/commands/ibgib/ibgib-index.mts +8 -0
- package/src/api/commands/ibgib/mut8-ibgib.mts +418 -0
- package/src/api/commands/templates/api-function-info.template.mts +212 -0
- package/src/api/commands/text/text-edit.mts +217 -0
- package/src/api/commands/text/text-index.mts +6 -0
- package/src/api/commands/ui/ui-index.mts +6 -0
- package/src/api/commands/ui/update-css-variables.mts +187 -0
- package/src/api/function-infos.web.mts +66 -0
- package/src/assets/fullscreen-dialog.html +18 -0
- package/src/assumptions.respec.mts +51 -0
- package/src/common/project/project-constants.mts +83 -0
- package/src/common/project/project-helper.mts +730 -0
- package/src/common/project/project-types.mts +121 -0
- package/src/common/prompt-functions.web.mts +447 -0
- package/src/common/settings/settings-constants.mts +72 -0
- package/src/common/settings/settings-helpers.mts +280 -0
- package/src/common/settings/settings-types.mts +137 -0
- package/src/constants.mts +39 -0
- package/src/foo.mts +13 -0
- package/src/helpers.mts +574 -0
- package/src/helpers.web.mts +1277 -0
- package/src/helpers.web.respec.mts +16 -0
- package/src/index.mts +3 -0
- package/src/respec-gib.node.mts +199 -0
- package/src/spec-helper.node.respec.mts +50 -0
- package/src/storage/storage-helpers.web.mts +728 -0
- package/src/storage/storage-types.web.mts +29 -0
- package/src/types.web.mts +42 -0
- package/src/ui/component/component-types.mts +241 -0
- package/src/ui/component/ibgib-component-service.mts +201 -0
- package/src/ui/component/ibgib-dynamic-component-bases.mts +1369 -0
- package/src/ui/ui-constants.mts +101 -0
- package/src/ui/ui-helpers.mts +222 -0
- package/src/ui/ui-types.mts +11 -0
- package/src/witness/agent/agent-constants.mts +122 -0
- package/src/witness/agent/agent-helpers.mts +681 -0
- package/src/witness/agent/agent-one-file.app.mts +8 -0
- package/src/witness/agent/agent-one-file.mts +1665 -0
- package/src/witness/agent/agent-types.mts +92 -0
- package/src/witness/agent/agents-service-v1.mts +482 -0
- package/src/witness/agent/function-info/function-info-one-file.mts +362 -0
- package/src/witness/agent/gemini/agent-witness-gemini-v1.mts +910 -0
- package/src/witness/agent/gemini/gemini-agent-factory.mts +135 -0
- package/src/witness/agent/gemini/gemini-constants.mts +79 -0
- package/src/witness/agent/gemini/gemini-helpers.mts +216 -0
- package/src/witness/agent/gemini/gemini-types.mts +88 -0
- package/src/witness/live-proxy-ibgib/live-proxy-ibgib-one-file.mts +321 -0
- package/src/witness/space/metaspace/metaspace-webspace/metaspace-webspace-helper.mts +290 -0
- package/src/witness/space/metaspace/metaspace-webspace/metaspace-webspace.mts +407 -0
- package/src/witness/space/web-filesystem-space/web-filesystem-space-constants.mts +1 -0
- package/src/witness/space/web-filesystem-space/web-filesystem-space-helper.mts +491 -0
- package/src/witness/space/web-filesystem-space/web-filesystem-space-types.mts +172 -0
- package/src/witness/space/web-filesystem-space/web-filesystem-space-v1.mts +670 -0
- package/tsconfig.json +17 -0
- package/tsconfig.test.json +10 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module text-edit.mts Provides the API Function Info to edit an ibgib's `data.text`. This is commonly found on a CommentIbGib_V1.
|
|
3
|
+
*
|
|
4
|
+
* ## notes
|
|
5
|
+
*
|
|
6
|
+
* ### ordering imports
|
|
7
|
+
*
|
|
8
|
+
* import sections always go:
|
|
9
|
+
* 1. non-ibgib deps first
|
|
10
|
+
* 2. @ibgib/helper-gib, @ibgib/encrypt-gib, @ibgib/ts-gib, @ibgib/core-gib packages (in that order)
|
|
11
|
+
* 3. import GLOBAL_LOG_A_LOT then remaining project imports
|
|
12
|
+
* 4. code proper starts with the definition of `const logalot` (if applicable)
|
|
13
|
+
*
|
|
14
|
+
* Each section is separated by a blank line.
|
|
15
|
+
*/
|
|
16
|
+
import { extractErrorMsg, getTimestamp, getTimestampInTicks, pretty } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
17
|
+
import { getCommentIb } from '@ibgib/core-gib/dist/common/comment/comment-helper.mjs';
|
|
18
|
+
import { mut8Timeline } from '@ibgib/core-gib/dist/timeline/timeline-api.mjs';
|
|
19
|
+
import { GLOBAL_LOG_A_LOT } from '../../../constants.mjs';
|
|
20
|
+
import { COMMAND_BASE_SCHEMA_PROPERTIES } from "../command-constants.mjs";
|
|
21
|
+
import { getCommandService } from "../command-service-v1.mjs";
|
|
22
|
+
import { getGlobalMetaspace_waitIfNeeded } from '../../../helpers.web.mjs';
|
|
23
|
+
import { FUNCTION_CALL_EXAMPLES_HEADER } from '../../api-constants.mjs';
|
|
24
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
25
|
+
// #region constants
|
|
26
|
+
/**
|
|
27
|
+
* camelCased name of the command itself.
|
|
28
|
+
*/
|
|
29
|
+
const FUNCTION_NAME = 'editText';
|
|
30
|
+
/**
|
|
31
|
+
* agent is the broad command which basically acts like a category of commands at this point.
|
|
32
|
+
*/
|
|
33
|
+
const CMD_CATEGORY = 'ibgib';
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
const CMD_MODIFIERS = [FUNCTION_NAME];
|
|
38
|
+
const EXAMPLE_INPUT_EDIT_TEXT = {
|
|
39
|
+
ibGibAddr: 'comment HelloThereImBob 1748386170000^A2D75E05B14E264619D2ACCCCABF234128E183B4524CC26029E54B84BF7BFD73.61985691826359867236266716461787826378AFFF23984723987FDA2013C8CB',
|
|
40
|
+
newText: `This is the newly edited text`,
|
|
41
|
+
notesToSelf: `Example of an ibgib's data.text property.`,
|
|
42
|
+
repromptWithResult: false,
|
|
43
|
+
};
|
|
44
|
+
const EXAMPLES = [
|
|
45
|
+
FUNCTION_CALL_EXAMPLES_HEADER,
|
|
46
|
+
pretty(EXAMPLE_INPUT_EDIT_TEXT),
|
|
47
|
+
].join('\n');
|
|
48
|
+
const FUNCTION_DESCRIPTION = [
|
|
49
|
+
`Edits an ibGib's data.text property and performs additional business logic on other fields within the ibGib record, like timestamps, updating the ib, etc.`,
|
|
50
|
+
``,
|
|
51
|
+
EXAMPLES,
|
|
52
|
+
].join('\n');
|
|
53
|
+
const FUNCTION_SCHEMA = {
|
|
54
|
+
name: FUNCTION_NAME,
|
|
55
|
+
description: FUNCTION_DESCRIPTION,
|
|
56
|
+
parameters: {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
...COMMAND_BASE_SCHEMA_PROPERTIES,
|
|
60
|
+
spaceId: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: `The id of the local user space. If not provided, will use the default local space. Only provide this if you don't want to use the default space. Agents should either leave this unset, or if they are trying to mut8 an ibGib that is inside *their* subspace, then they should provide this. Otherwise, it will look in the default space which will be incorrect. In the future, agents will have a different API for interacting with their subspaces, but for now this may be used (if the agent even has access to their subspace id. it's so early in dev, I'm not sure if this is true.)`,
|
|
63
|
+
},
|
|
64
|
+
ibGibAddr: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
description: 'The content address of the ibGib to edit.',
|
|
67
|
+
},
|
|
68
|
+
newText: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: 'The new text to set for the ibGib\'s data.text property.',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
required: [
|
|
74
|
+
'ibGibAddr',
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Wrapper function to enqueue the mut8IbGib command.
|
|
80
|
+
* @param {EditIbGibTextOpts} opts - @see {@link EditIbGibTextOpts}
|
|
81
|
+
* @returns {Promise<void>} A promise that resolves when the command finishes execution.
|
|
82
|
+
*/
|
|
83
|
+
function viaCmd(opts) {
|
|
84
|
+
const commandService = getCommandService();
|
|
85
|
+
const command = {
|
|
86
|
+
...opts,
|
|
87
|
+
cmd: CMD_CATEGORY,
|
|
88
|
+
cmdModifiers: CMD_MODIFIERS,
|
|
89
|
+
};
|
|
90
|
+
return new Promise((resolve, reject) => {
|
|
91
|
+
commandService.enqueueCommand({ command, resolve, reject });
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Implementation function for the mut8IbGib command.
|
|
96
|
+
*
|
|
97
|
+
* @param {EditIbGibTextOpts} opts - @see {@link EditIbGibTextOpts}
|
|
98
|
+
* @returns {Promise<IbGib_V1>} the new timeline ibgib
|
|
99
|
+
*/
|
|
100
|
+
async function fnImpl(opts) {
|
|
101
|
+
const lc = `[${fnImpl.name}]`;
|
|
102
|
+
try {
|
|
103
|
+
if (logalot) {
|
|
104
|
+
console.log(`${lc} starting... (I: genuuid)`);
|
|
105
|
+
}
|
|
106
|
+
console.log(`${lc} ${CMD_CATEGORY} ${CMD_MODIFIERS} opts: ${pretty(opts)}`);
|
|
107
|
+
let { spaceId, ibGibAddr, newText, } = opts;
|
|
108
|
+
const metaspace = await getGlobalMetaspace_waitIfNeeded();
|
|
109
|
+
if (!metaspace) {
|
|
110
|
+
throw new Error(`${lc} metaspace falsy (E: 1a3f5e6c8d9a7b01f2e3d4c5b6a708d9)`);
|
|
111
|
+
}
|
|
112
|
+
const space = await metaspace.getLocalUserSpace({ localSpaceId: spaceId });
|
|
113
|
+
if (!space) {
|
|
114
|
+
if (!spaceId) {
|
|
115
|
+
throw new Error(`(UNEXPECTED) couldn't get default local user space? (E: 593028fc4038c1cb713a8b1d757da825)`);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
throw new Error(`could not get local user space for spaceId (${spaceId}) (E: 61fc28fbdf3fd69ae7c9214fe74c2825)`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
newText ??= '';
|
|
122
|
+
if (!ibGibAddr) {
|
|
123
|
+
throw new Error(`${lc} ibGibAddr is required. (E: genuuid)`);
|
|
124
|
+
}
|
|
125
|
+
const newIb = getCommentIb({ commentText: newText, addlMetadataText: getTimestampInTicks() });
|
|
126
|
+
// 3. Perform the mut8 transform
|
|
127
|
+
if (logalot) {
|
|
128
|
+
console.log(`${lc} Mutating timeline ibGib... (I: genuuid)`);
|
|
129
|
+
}
|
|
130
|
+
const newTimelineIbGib = await mut8Timeline({
|
|
131
|
+
timelineAddr: ibGibAddr,
|
|
132
|
+
mut8Opts: {
|
|
133
|
+
dataToAddOrPatch: {
|
|
134
|
+
text: newText,
|
|
135
|
+
textTimestamp: getTimestamp(),
|
|
136
|
+
},
|
|
137
|
+
mut8Ib: newIb,
|
|
138
|
+
},
|
|
139
|
+
metaspace,
|
|
140
|
+
space,
|
|
141
|
+
});
|
|
142
|
+
if (!newTimelineIbGib) {
|
|
143
|
+
throw new Error(`${lc} Mutate timeline transform failed: No new timeline ibGib returned. (E: genuuid)`);
|
|
144
|
+
}
|
|
145
|
+
console.log(`${lc} Mutated timeline ibGib processed.`);
|
|
146
|
+
return newTimelineIbGib;
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
150
|
+
throw error; // Re-throw the error to be caught by the command service
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
// This finally block will execute regardless of whether the try block succeeds or fails.
|
|
154
|
+
if (logalot) {
|
|
155
|
+
console.log(`${lc} complete.`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* API function info for the mut8IbGib command.
|
|
161
|
+
*/
|
|
162
|
+
export const editTextFunctionInfo = {
|
|
163
|
+
nameOrId: FUNCTION_NAME,
|
|
164
|
+
fnViaCmd: viaCmd,
|
|
165
|
+
functionImpl: fnImpl,
|
|
166
|
+
cmd: CMD_CATEGORY,
|
|
167
|
+
cmdModifiers: CMD_MODIFIERS,
|
|
168
|
+
schema: FUNCTION_SCHEMA,
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=text-edit.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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AC,EAAE,CAAC,CAAC;QACjD,MAAM,KAAK,CAAC,CAAC,yDAAyD;KACzE;YAAS;QACN,yFAAyF;QACzF,IAAI,OAAO,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAAE;KACnD;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAmC;IAChE,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE,MAAM;IACpB,GAAG,EAAE,YAAY;IACjB,YAAY,EAAE,aAAa;IAC3B,MAAM,EAAE,eAAe;CAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-index.d.mts","sourceRoot":"","sources":["../../../../src/api/commands/text/text-index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,GAAG,CAAC,EAEtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-index.mjs","sourceRoot":"","sources":["../../../../src/api/commands/text/text-index.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IACxD,oBAAoB;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-index.d.mts","sourceRoot":"","sources":["../../../../src/api/commands/ui/ui-index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,GAAG,CAAC,EAEtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-index.mjs","sourceRoot":"","sources":["../../../../src/api/commands/ui/ui-index.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAE5E,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IACxD,8BAA8B;CACjC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { APIFunctionInfo } from "../../api-types.mjs";
|
|
2
|
+
import { CommandDataBase } from "../command-types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* 'ui' is the broad command which basically acts like a category of commands at this point.
|
|
5
|
+
*/
|
|
6
|
+
declare const CMD_CATEGORY = "ui";
|
|
7
|
+
/**
|
|
8
|
+
* This should be camelCased actual name of the function.
|
|
9
|
+
*/
|
|
10
|
+
declare const CMD_MODIFIERS: string[];
|
|
11
|
+
/**
|
|
12
|
+
* @interface UpdateCSSVariablesOpts - Options for the updateCSSVariables command.
|
|
13
|
+
* @extends CommandDataBase
|
|
14
|
+
*/
|
|
15
|
+
export interface UpdateCSSVariablesOpts extends CommandDataBase<typeof CMD_CATEGORY, typeof CMD_MODIFIERS> {
|
|
16
|
+
/**
|
|
17
|
+
* @property cssVariables - An object where keys are CSS variable names
|
|
18
|
+
* (e.g., '--text-color-base') and values are their new values (e.g., 'blue').
|
|
19
|
+
*/
|
|
20
|
+
cssVariables: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @interface UpdateCSSVariablesCommandData - Command data for the updateCSSVariables command.
|
|
26
|
+
* @extends CommandDataBase
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
export interface UpdateCSSVariablesCommandData extends CommandDataBase<typeof CMD_CATEGORY, typeof CMD_MODIFIERS> {
|
|
30
|
+
/**
|
|
31
|
+
* @see {@link UpdateCSSVariablesOpts.cssVariables}
|
|
32
|
+
*/
|
|
33
|
+
cssVariables: {
|
|
34
|
+
[key: string]: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Wrapper function to enqueue the updateCSSVariables command.
|
|
39
|
+
* @param {UpdateCSSVariablesOpts} opts - Options for updating CSS variables.
|
|
40
|
+
* @returns {Promise<void>} A promise that resolves when the command is enqueued.
|
|
41
|
+
*/
|
|
42
|
+
declare function updateCSSVariablesViaCmd(opts: UpdateCSSVariablesOpts): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* API function info for the updateCSSVariables command.
|
|
45
|
+
*/
|
|
46
|
+
export declare const updateCSSVariablesFunctionInfo: APIFunctionInfo<typeof updateCSSVariablesViaCmd>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=update-css-variables.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-css-variables.d.mts","sourceRoot":"","sources":["../../../../src/api/commands/ui/update-css-variables.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAgBvD;;GAEG;AACH,QAAA,MAAM,YAAY,OAAO,CAAC;AAE1B;;GAEG;AACH,QAAA,MAAM,aAAa,EAAE,MAAM,EAAoB,CAAC;AAiChD;;;GAGG;AACH,MAAM,WAAW,sBACb,SAAQ,eAAe,CAAC,OAAO,YAAY,EAAE,OAAO,aAAa,CAAC;IAClE;;;OAGG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC3C;AAGD;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,eAAe,CAAC,OAAO,YAAY,EAAE,OAAO,aAAa,CAAC;IAC7G;;OAEG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED;;;;GAIG;AACH,iBAAS,wBAAwB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAa7E;AA8CD;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,eAAe,CAAC,OAAO,wBAAwB,CA8B3F,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { extractErrorMsg, pretty } from "@ibgib/helper-gib/dist/helpers/utils-helper.mjs";
|
|
2
|
+
import { GLOBAL_LOG_A_LOT } from "../../../constants.mjs";
|
|
3
|
+
import { COMMAND_BASE_SCHEMA_PROPERTIES } from "../command-constants.mjs";
|
|
4
|
+
import { getCommandService } from "../command-service-v1.mjs";
|
|
5
|
+
import { FUNCTION_CALL_EXAMPLES_HEADER } from "../../api-constants.mjs";
|
|
6
|
+
import { UI_THEME_INFO_KEY, VALID_CSS_VARIABLES } from "../../../ui/ui-constants.mjs";
|
|
7
|
+
import { storagePut } from "../../../storage/storage-helpers.web.mjs";
|
|
8
|
+
import { getExistingUIInfo } from "../../../ui/ui-helpers.mjs";
|
|
9
|
+
import { getGlobalDbName, getGlobalStoreName } from "../../../helpers.web.mjs";
|
|
10
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
11
|
+
// #region constants
|
|
12
|
+
/**
|
|
13
|
+
* camelCased name of the command itself.
|
|
14
|
+
*/
|
|
15
|
+
const FUNCTION_NAME = 'updateCSSVariables';
|
|
16
|
+
/**
|
|
17
|
+
* 'ui' is the broad command which basically acts like a category of commands at this point.
|
|
18
|
+
*/
|
|
19
|
+
const CMD_CATEGORY = 'ui';
|
|
20
|
+
/**
|
|
21
|
+
* This should be camelCased actual name of the function.
|
|
22
|
+
*/
|
|
23
|
+
const CMD_MODIFIERS = [FUNCTION_NAME];
|
|
24
|
+
const EXAMPLE_INPUT_UPDATECSS = {
|
|
25
|
+
cssVariables: {
|
|
26
|
+
'--button-background-color-base': '#4CAF50',
|
|
27
|
+
'--button-text-color-base': 'white',
|
|
28
|
+
'--button-border-color-base': '#4CAF50',
|
|
29
|
+
'--button-border-width-base': '1px',
|
|
30
|
+
'--button-border-style-base': 'solid',
|
|
31
|
+
'--button-border-radius-base': '4px',
|
|
32
|
+
'--button-padding-base': '10px 20px',
|
|
33
|
+
'--button-hover-background-color': '#45a049',
|
|
34
|
+
'--button-hover-text-color': 'white',
|
|
35
|
+
'--button-hover-border-color': '#45a049',
|
|
36
|
+
},
|
|
37
|
+
notesToSelf: 'Example of an updateCSSVariables function call that is updating a theme section that corresponds to the buttons. I still will do the other sections.',
|
|
38
|
+
repromptWithResult: true,
|
|
39
|
+
};
|
|
40
|
+
const EXAMPLES = [
|
|
41
|
+
FUNCTION_CALL_EXAMPLES_HEADER,
|
|
42
|
+
pretty(EXAMPLE_INPUT_UPDATECSS),
|
|
43
|
+
].join('\n');
|
|
44
|
+
const FUNCTION_DESCRIPTION = [
|
|
45
|
+
`Use this to update global CSS variables, effectively changing the visual theme of the application. Provide an object where keys are CSS variable names (e.g., '--text-color-base') and values are their new values (e.g., 'blue'). REMEMBER! When you are asked to change an entire theme, BE SURE TO CHANGE ALL PARTS TO MATCH THE THEME! BUT...apply the changes to related sections of variables together (e.g., all tab-related variables, all button-related variables, etc.) instead of individual properties, otherwise you'll hit the reprompt limit if you try to do each one by itself. To help do this, _first_ categorize ALL the properties into smaller sections, and then tell the user your plan for each section: primary bases (fonts, main text, main background), buttons, tabs, scrollbars, fonts, and any others I might have forgotten. THEN do each group with a single function call but be sure to prompt yourself until you have gone through all of them.`,
|
|
46
|
+
'',
|
|
47
|
+
EXAMPLES,
|
|
48
|
+
].join('\n');
|
|
49
|
+
/**
|
|
50
|
+
* Wrapper function to enqueue the updateCSSVariables command.
|
|
51
|
+
* @param {UpdateCSSVariablesOpts} opts - Options for updating CSS variables.
|
|
52
|
+
* @returns {Promise<void>} A promise that resolves when the command is enqueued.
|
|
53
|
+
*/
|
|
54
|
+
function updateCSSVariablesViaCmd(opts) {
|
|
55
|
+
const commandService = getCommandService();
|
|
56
|
+
const command = {
|
|
57
|
+
...opts,
|
|
58
|
+
cmd: CMD_CATEGORY,
|
|
59
|
+
cmdModifiers: [FUNCTION_NAME],
|
|
60
|
+
// cssVariables: opts.cssVariables,
|
|
61
|
+
// repromptWithResult: opts?.repromptWithResult,
|
|
62
|
+
// notesToSelf: opts?.notesToSelf,
|
|
63
|
+
};
|
|
64
|
+
return new Promise((resolve, reject) => {
|
|
65
|
+
commandService.enqueueCommand({ command, resolve, reject });
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Implementation function for the updateCSSVariables command (atow, does nothing other than resolve).
|
|
70
|
+
* @param {UpdateCSSVariablesOpts} opts - Options for updating CSS variables.
|
|
71
|
+
* @returns {Promise<void>} A promise that resolves when the command is executed (immediately).
|
|
72
|
+
*/
|
|
73
|
+
async function updateCSSVariablesImpl(opts) {
|
|
74
|
+
const lc = `[${updateCSSVariablesImpl.name}]`;
|
|
75
|
+
try {
|
|
76
|
+
if (logalot) {
|
|
77
|
+
console.log(`${lc} starting... (I: badce195ed1817dd686c7098511e1f25)`);
|
|
78
|
+
}
|
|
79
|
+
// In the actual implementation, this function would update the CSS variables.
|
|
80
|
+
console.log(`${lc} Updating CSS variables: ${JSON.stringify(opts.cssVariables)}`);
|
|
81
|
+
// Actual implementation to be added here:
|
|
82
|
+
for (const [variableName, value] of Object.entries(opts.cssVariables)) {
|
|
83
|
+
document.documentElement.style.setProperty(variableName, value);
|
|
84
|
+
}
|
|
85
|
+
// update the theme in the options
|
|
86
|
+
const dbName = getGlobalDbName();
|
|
87
|
+
const storeName = await getGlobalStoreName();
|
|
88
|
+
const existingUIInfo = await getExistingUIInfo({ dbName, storeName }) ?? { cssVariableOverrides: {}, };
|
|
89
|
+
const newUIInfo = {
|
|
90
|
+
...existingUIInfo,
|
|
91
|
+
cssVariableOverrides: {
|
|
92
|
+
...existingUIInfo.cssVariableOverrides,
|
|
93
|
+
...opts.cssVariables,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
await storagePut({
|
|
97
|
+
dbName,
|
|
98
|
+
storeName: await getGlobalStoreName(),
|
|
99
|
+
key: UI_THEME_INFO_KEY,
|
|
100
|
+
value: JSON.stringify(newUIInfo),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
if (logalot) {
|
|
109
|
+
console.log(`${lc} complete.`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* API function info for the updateCSSVariables command.
|
|
115
|
+
*/
|
|
116
|
+
export const updateCSSVariablesFunctionInfo = {
|
|
117
|
+
nameOrId: FUNCTION_NAME,
|
|
118
|
+
fnViaCmd: updateCSSVariablesViaCmd,
|
|
119
|
+
functionImpl: updateCSSVariablesImpl,
|
|
120
|
+
cmd: CMD_CATEGORY,
|
|
121
|
+
cmdModifiers: CMD_MODIFIERS,
|
|
122
|
+
schema: {
|
|
123
|
+
name: FUNCTION_NAME,
|
|
124
|
+
description: FUNCTION_DESCRIPTION,
|
|
125
|
+
parameters: {
|
|
126
|
+
type: 'object',
|
|
127
|
+
properties: {
|
|
128
|
+
...COMMAND_BASE_SCHEMA_PROPERTIES,
|
|
129
|
+
cssVariables: {
|
|
130
|
+
type: 'object',
|
|
131
|
+
description: 'CSS variables to update when theming or otherwise changing these visual aspects of the web app per user preferences or the user directly asking for it. (atow there are no preferences saved or anything, so this is just user-driven if they ask for it.)',
|
|
132
|
+
properties: Object.fromEntries(VALID_CSS_VARIABLES.map(varName => [
|
|
133
|
+
varName,
|
|
134
|
+
{
|
|
135
|
+
type: 'string',
|
|
136
|
+
description: `configurable css variable`,
|
|
137
|
+
},
|
|
138
|
+
])),
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
required: ['cssVariables'],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=update-css-variables.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-css-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AAG,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC/B,OAAO;wBACP;4BACI,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,2BAA2B;yBAC3C;qBACJ,CAAC,CACL;iBACJ;aACJ;YACD,QAAQ,EAAE,CAAC,cAAc,CAAC;SAC7B;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module function-infos.web.mts
|
|
3
|
+
*
|
|
4
|
+
* Web app-specific function infos, as opposed to extension or other function
|
|
5
|
+
* infos.
|
|
6
|
+
*
|
|
7
|
+
* funky structure because AllFunctionInfos started as just a global constant,
|
|
8
|
+
* but when broke out extension, we needed to separate web extension function
|
|
9
|
+
* infos from web app function infos.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* This should be called early on when initializing the web app.
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerDeprecatedFunctionNamesAndFunctionInfos_Web(): void;
|
|
15
|
+
//# sourceMappingURL=function-infos.web.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-infos.web.d.mts","sourceRoot":"","sources":["../../src/api/function-infos.web.mts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqCH;;GAEG;AACH,wBAAgB,mDAAmD,IAAI,IAAI,CAgB1E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module function-infos.web.mts
|
|
3
|
+
*
|
|
4
|
+
* Web app-specific function infos, as opposed to extension or other function
|
|
5
|
+
* infos.
|
|
6
|
+
*
|
|
7
|
+
* funky structure because AllFunctionInfos started as just a global constant,
|
|
8
|
+
* but when broke out extension, we needed to separate web extension function
|
|
9
|
+
* infos from web app function infos.
|
|
10
|
+
*/
|
|
11
|
+
import { extractErrorMsg } from "@ibgib/helper-gib/dist/helpers/utils-helper.mjs";
|
|
12
|
+
import { GLOBAL_LOG_A_LOT } from "../constants.mjs";
|
|
13
|
+
import { UIAgentFunctionInfos } from "./commands/ui/ui-index.mjs";
|
|
14
|
+
import { ProjectFunctionInfos } from "../common/project/project-constants.mjs";
|
|
15
|
+
import { IbGibAPIFunctionInfos } from "./commands/ibgib/ibgib-index.mjs";
|
|
16
|
+
import { ChatAPIFunctionInfos } from "./commands/chat/chat-index.mjs";
|
|
17
|
+
import { TextAPIFunctionInfos } from "./commands/text/text-index.mjs";
|
|
18
|
+
import { registerDeprecatedFunctionInfoName, registerFunctionInfos } from "./api-index.mjs";
|
|
19
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
20
|
+
/**
|
|
21
|
+
* Map of all available API functions for agents.
|
|
22
|
+
*
|
|
23
|
+
* NOTE: Any and all functions should be added to this.
|
|
24
|
+
*/
|
|
25
|
+
// export const AllFunctionInfos: { [nameOrId: string]: APIFunctionInfo<any> } = {
|
|
26
|
+
// ...RenderAgentFunctionInfos.reduce((acc, info) => ({ ...acc, [info.nameOrId]: info }), {}),
|
|
27
|
+
// }
|
|
28
|
+
const AllFunctionInfos_Web = new Map([
|
|
29
|
+
...ChatAPIFunctionInfos,
|
|
30
|
+
...TextAPIFunctionInfos,
|
|
31
|
+
...ProjectFunctionInfos,
|
|
32
|
+
...UIAgentFunctionInfos,
|
|
33
|
+
...IbGibAPIFunctionInfos,
|
|
34
|
+
].map(x => [x.nameOrId, x]));
|
|
35
|
+
const DeprecatedFunctionInfoNames_Web = [
|
|
36
|
+
// 'minigameBuilderAddStimuli',
|
|
37
|
+
// 'minigameBuilderEditStimuli', // debug only...this is a valid function and this needs to be removed from this list. i'm just trying to cause the prune action to happen for debugging.
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
* This should be called early on when initializing the web app.
|
|
41
|
+
*/
|
|
42
|
+
export function registerDeprecatedFunctionNamesAndFunctionInfos_Web() {
|
|
43
|
+
const lc = `[${registerDeprecatedFunctionNamesAndFunctionInfos_Web.name}]`;
|
|
44
|
+
try {
|
|
45
|
+
if (logalot) {
|
|
46
|
+
console.log(`${lc} starting... (I: 31efff44c2be8ac45dac33d8824c4c25)`);
|
|
47
|
+
}
|
|
48
|
+
for (const nameOrId of DeprecatedFunctionInfoNames_Web) {
|
|
49
|
+
registerDeprecatedFunctionInfoName({ nameOrId });
|
|
50
|
+
}
|
|
51
|
+
registerFunctionInfos({ functionInfos: AllFunctionInfos_Web });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
if (logalot) {
|
|
59
|
+
console.log(`${lc} complete.`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=function-infos.web.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-infos.web.mjs","sourceRoot":"","sources":["../../src/api/function-infos.web.mts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,kCAAkC,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE5F,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC;;;;GAIG;AACH,kFAAkF;AAClF,kGAAkG;AAClG,IAAI;AAEJ,MAAM,oBAAoB,GAAsC,IAAI,GAAG,CAAC;IACpE,GAAG,oBAAoB;IACvB,GAAG,oBAAoB;IACvB,GAAG,oBAAoB;IACvB,GAAG,oBAAoB;IACvB,GAAG,qBAAqB;CAC3B,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7B,MAAM,+BAA+B,GAAa;AAC9C,+BAA+B;AAC/B,yLAAyL;CAC5L,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,mDAAmD;IAC/D,MAAM,EAAE,GAAG,IAAI,mDAAmD,CAAC,IAAI,GAAG,CAAC;IAC3E,IAAI;QACA,IAAI,OAAO,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,oDAAoD,CAAC,CAAC;SAAE;QAExF,KAAK,MAAM,QAAQ,IAAI,+BAA+B,EAAE;YACpD,kCAAkC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;SACpD;QAED,qBAAqB,CAAC,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC,CAAC;KAClE;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjD,MAAM,KAAK,CAAC;KACf;YAAS;QACN,IAAI,OAAO,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAAE;KACnD;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assumptions.respec.d.mts","sourceRoot":"","sources":["../src/assumptions.respec.mts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ifWe, iReckon, respecfully } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
|
|
2
|
+
const maam = `[${import.meta.url}]`, sir = maam;
|
|
3
|
+
/**
|
|
4
|
+
* wrapper that uses crypto.subtle under the hood (i.e. doesn't hash using ts-gib)
|
|
5
|
+
*
|
|
6
|
+
* notes:
|
|
7
|
+
*
|
|
8
|
+
* * i did in fact copy this from ts-gib though, but we're testing simply that the
|
|
9
|
+
* context (node/browser/whatever) has this since it's integral to all things ibgib.
|
|
10
|
+
*/
|
|
11
|
+
async function cryptoSubtleHash({ s, algorithm = 'SHA-256', }) {
|
|
12
|
+
let { subtle } = globalThis.crypto;
|
|
13
|
+
if (!s) {
|
|
14
|
+
throw new Error(`[${cryptoSubtleHash.name}] s is required`);
|
|
15
|
+
}
|
|
16
|
+
if (!algorithm) {
|
|
17
|
+
throw new Error(`[${cryptoSubtleHash.name}] algorithm is required`);
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const msgUint8 = new TextEncoder().encode(s);
|
|
21
|
+
const buffer = await subtle.digest(algorithm, msgUint8);
|
|
22
|
+
const asArray = Array.from(new Uint8Array(buffer));
|
|
23
|
+
return asArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
console.error(e.message ?? e);
|
|
27
|
+
throw e;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
await respecfully(sir, `non-ts-gib isomorphic crypto hashing`, async () => {
|
|
31
|
+
await ifWe(sir, `should digest simple string consistently using crypto.subtle directly `, async () => {
|
|
32
|
+
let h = await cryptoSubtleHash({ s: '42' });
|
|
33
|
+
iReckon(sir, h).asTo('42').isGonnaBe('73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049');
|
|
34
|
+
});
|
|
35
|
+
await ifWe(sir, `should digest simple stringified ibgib consistently using crypto.subtle directly `, async () => {
|
|
36
|
+
let ibgib = { ib: 'ib', gib: 'gib' };
|
|
37
|
+
let h = await cryptoSubtleHash({ s: JSON.stringify(ibgib) }); // doesn't use ts-gib but consistent stringifying json is important
|
|
38
|
+
iReckon(sir, h).asTo('ib^gib').isGonnaBe('cbad0694a257358c044611ea1fa88ace71a01a9b8409d2354d0387d8043f7671');
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=assumptions.respec.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assumptions.respec.mjs","sourceRoot":"","sources":["../src/assumptions.respec.mts"],"names":[],"mappings":"AAAA,OAAO,EACsB,IAAI,EAElB,OAAO,EAAE,WAAW,EAClC,MAAM,kDAAkD,CAAC;AAC1D,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;AAGhD;;;;;;;GAOG;AACH,KAAK,UAAU,gBAAgB,CAAC,EAC5B,CAAC,EACD,SAAS,GAAG,SAAS,GAIxB;IACG,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC;IACnC,IAAI,CAAC,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,gBAAgB,CAAC,IAAI,iBAAiB,CAAC,CAAA;KAAE;IACvE,IAAI,CAAC,SAAS,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,gBAAgB,CAAC,IAAI,yBAAyB,CAAC,CAAA;KAAE;IACvF,IAAI;QACA,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QACnD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACrE;IAAC,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,CAAC;KACX;AACL,CAAC;AAED,MAAM,WAAW,CAAC,GAAG,EAAE,sCAAsC,EAAE,KAAK,IAAI,EAAE;IAEtE,MAAM,IAAI,CAAC,GAAG,EAAE,wEAAwE,EAAE,KAAK,IAAI,EAAE;QACjG,IAAI,CAAC,GAAG,MAAM,gBAAgB,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,kEAAkE,CAAC,CAAC;IAC7G,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,CAAC,GAAG,EAAE,mFAAmF,EAAE,KAAK,IAAI,EAAE;QAC5G,IAAI,KAAK,GAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;QAC/C,IAAI,CAAC,GAAG,MAAM,gBAAgB,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,mEAAmE;QACjI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,kEAAkE,CAAC,CAAC;IACjH,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { APIFunctionInfo } from "../../api/api-types.mjs";
|
|
2
|
+
export declare const PROJECT_ATOM = "project";
|
|
3
|
+
/**
|
|
4
|
+
* must match {@link PROJECT_MAX_NAME_LENGTH}
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROJECT_NAME_REGEXP: RegExp;
|
|
7
|
+
export declare const PROJECT_DESC_REGEXP: RegExp;
|
|
8
|
+
/**
|
|
9
|
+
* must match {@link PROJECT_NAME_REGEXP}
|
|
10
|
+
*/
|
|
11
|
+
export declare const PROJECT_MAX_NAME_LENGTH = 128;
|
|
12
|
+
export declare const PROJECT_SETTINGS_SCOPE = "settings_project";
|
|
13
|
+
export declare const DEFAULT_PROJECT_SAFE_NAME_LENGTH = 32;
|
|
14
|
+
/**
|
|
15
|
+
* change this in the future if we add more fields
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_PROJECT_ADDL_METADATA_LENGTH = 32;
|
|
18
|
+
export declare const PROJECT_REL8N_NAME = "project";
|
|
19
|
+
/**
|
|
20
|
+
* project children are ibgibs that are expected to be shown in a project tab.
|
|
21
|
+
* These are _kinda_ like contained files/folders when viewing the project as a
|
|
22
|
+
* folder.
|
|
23
|
+
*/
|
|
24
|
+
export declare const PROJECT_CHILD_DEFAULT_REL8N_NAME = "child";
|
|
25
|
+
/**
|
|
26
|
+
* all over the place, but the idea is here that barring a few key rel8nNames
|
|
27
|
+
* (e.g. dna, ancestor, past, etc.), all other rel8nNames are considered
|
|
28
|
+
* "children".
|
|
29
|
+
*/
|
|
30
|
+
export declare const PROJECT_CHILD_TEXT_REL8N_NAME = "text";
|
|
31
|
+
/**
|
|
32
|
+
* @constant ProjectAgentFunctionInfos - An array of all available API functions for project agents.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ProjectFunctionInfos: APIFunctionInfo<any>[];
|
|
35
|
+
export declare const ProjectChildTextFunctionInfos: APIFunctionInfo<any>[];
|
|
36
|
+
export declare const AGENT_AVAILABLE_FUNCTIONS_PROJECTAGENT: APIFunctionInfo<any>[];
|
|
37
|
+
export declare const AGENT_AVAILABLE_FUNCTIONS_PROJECTCHILDTEXTAGENT: APIFunctionInfo<any>[];
|
|
38
|
+
//# sourceMappingURL=project-constants.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-constants.d.mts","sourceRoot":"","sources":["../../../src/common/project/project-constants.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAS1D,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAA8B,CAAC;AAC/D,eAAO,MAAM,mBAAmB,QAAa,CAAC;AAC9C;;GAEG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,sBAAsB,qBAAqC,CAAC;AAEzE,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD;;GAEG;AACH,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAKvD,eAAO,MAAM,kBAAkB,YAAe,CAAC;AAC/C;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,UAAU,CAAC;AACxD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,SAAS,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,GAAG,CAAC,EAEtD,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,eAAe,CAAC,GAAG,CAAC,EAE/D,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,eAAe,CAAC,GAAG,CAAC,EAMxE,CAAC;AAEF,eAAO,MAAM,+CAA+C,EAAE,eAAe,CAAC,GAAG,CAAC,EAIjF,CAAC"}
|