@superblocksteam/vite-plugin-file-sync 2.0.3-next.46
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/LICENSE.txt +87 -0
- package/dist/ai-service/artifacts/bolt.d.ts +8 -0
- package/dist/ai-service/artifacts/bolt.d.ts.map +1 -0
- package/dist/ai-service/artifacts/bolt.js +34 -0
- package/dist/ai-service/artifacts/bolt.js.map +1 -0
- package/dist/ai-service/const.d.ts +8 -0
- package/dist/ai-service/const.d.ts.map +1 -0
- package/dist/ai-service/const.js +9 -0
- package/dist/ai-service/const.js.map +1 -0
- package/dist/ai-service/eval/template-renderer.d.ts +13 -0
- package/dist/ai-service/eval/template-renderer.d.ts.map +1 -0
- package/dist/ai-service/eval/template-renderer.js +66 -0
- package/dist/ai-service/eval/template-renderer.js.map +1 -0
- package/dist/ai-service/index.d.ts +18 -0
- package/dist/ai-service/index.d.ts.map +1 -0
- package/dist/ai-service/index.js +140 -0
- package/dist/ai-service/index.js.map +1 -0
- package/dist/ai-service/integrations/const.d.ts +41 -0
- package/dist/ai-service/integrations/const.d.ts.map +1 -0
- package/dist/ai-service/integrations/const.js +76 -0
- package/dist/ai-service/integrations/const.js.map +1 -0
- package/dist/ai-service/integrations/from-prompt-context.d.ts +4 -0
- package/dist/ai-service/integrations/from-prompt-context.d.ts.map +1 -0
- package/dist/ai-service/integrations/from-prompt-context.js +56 -0
- package/dist/ai-service/integrations/from-prompt-context.js.map +1 -0
- package/dist/ai-service/integrations/to-sdk-prompt.d.ts +3 -0
- package/dist/ai-service/integrations/to-sdk-prompt.d.ts.map +1 -0
- package/dist/ai-service/integrations/to-sdk-prompt.js +47 -0
- package/dist/ai-service/integrations/to-sdk-prompt.js.map +1 -0
- package/dist/ai-service/integrations/types.d.ts +31 -0
- package/dist/ai-service/integrations/types.d.ts.map +1 -0
- package/dist/ai-service/integrations/types.js +2 -0
- package/dist/ai-service/integrations/types.js.map +1 -0
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.d.ts +2 -0
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.d.ts.map +1 -0
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.js +386 -0
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.js.map +1 -0
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.d.ts +2 -0
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.d.ts.map +1 -0
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.js +219 -0
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.js.map +1 -0
- package/dist/ai-service/prompts/generated/index.d.ts +4 -0
- package/dist/ai-service/prompts/generated/index.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/index.js +6 -0
- package/dist/ai-service/prompts/generated/index.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbKeyValuePropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbKeyValuePropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbKeyValuePropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbKeyValuePropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.js +6 -0
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/index.d.ts +18 -0
- package/dist/ai-service/prompts/generated/library-components/index.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-components/index.js +20 -0
- package/dist/ai-service/prompts/generated/library-components/index.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.js +6 -0
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.d.ts +2 -0
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.js +6 -0
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.js.map +1 -0
- package/dist/ai-service/prompts/generated/library-typedefs/index.d.ts +3 -0
- package/dist/ai-service/prompts/generated/library-typedefs/index.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/library-typedefs/index.js +5 -0
- package/dist/ai-service/prompts/generated/library-typedefs/index.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/index.d.ts +12 -0
- package/dist/ai-service/prompts/generated/subprompts/index.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/index.js +14 -0
- package/dist/ai-service/prompts/generated/subprompts/index.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-timers.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-timers.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-timers.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/superblocks-timers.js.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/system.d.ts +2 -0
- package/dist/ai-service/prompts/generated/subprompts/system.d.ts.map +1 -0
- package/dist/ai-service/prompts/generated/subprompts/system.js +6 -0
- package/dist/ai-service/prompts/generated/subprompts/system.js.map +1 -0
- package/dist/ai-service/prompts/markdown-loader.d.ts +9 -0
- package/dist/ai-service/prompts/markdown-loader.d.ts.map +1 -0
- package/dist/ai-service/prompts/markdown-loader.js +55 -0
- package/dist/ai-service/prompts/markdown-loader.js.map +1 -0
- package/dist/ai-service/prompts/system.d.ts +2 -0
- package/dist/ai-service/prompts/system.d.ts.map +1 -0
- package/dist/ai-service/prompts/system.js +145 -0
- package/dist/ai-service/prompts/system.js.map +1 -0
- package/dist/ai-service/result-buffer/bolt.d.ts +15 -0
- package/dist/ai-service/result-buffer/bolt.d.ts.map +1 -0
- package/dist/ai-service/result-buffer/bolt.js +73 -0
- package/dist/ai-service/result-buffer/bolt.js.map +1 -0
- package/dist/ai-service/result-buffer/shared.d.ts +13 -0
- package/dist/ai-service/result-buffer/shared.d.ts.map +1 -0
- package/dist/ai-service/result-buffer/shared.js +7 -0
- package/dist/ai-service/result-buffer/shared.js.map +1 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts +158 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -0
- package/dist/ai-service/state-machine/clark-fsm.js +62 -0
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -0
- package/dist/ai-service/state-machine/fsm.d.ts +42 -0
- package/dist/ai-service/state-machine/fsm.d.ts.map +1 -0
- package/dist/ai-service/state-machine/fsm.js +55 -0
- package/dist/ai-service/state-machine/fsm.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts +3 -0
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/agent-planning.js +209 -0
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts +3 -0
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/awaiting-user.js +21 -0
- package/dist/ai-service/state-machine/handlers/awaiting-user.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/idle.d.ts +3 -0
- package/dist/ai-service/state-machine/handlers/idle.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/idle.js +22 -0
- package/dist/ai-service/state-machine/handlers/idle.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +3 -0
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/llm-generating.js +123 -0
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/play-dead.d.ts +3 -0
- package/dist/ai-service/state-machine/handlers/play-dead.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/play-dead.js +11 -0
- package/dist/ai-service/state-machine/handlers/play-dead.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts +3 -0
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/post-processing.js +50 -0
- package/dist/ai-service/state-machine/handlers/post-processing.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.d.ts +3 -0
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js +37 -0
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/metadata.d.ts +6 -0
- package/dist/ai-service/state-machine/helpers/metadata.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/metadata.js +11 -0
- package/dist/ai-service/state-machine/helpers/metadata.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/peer.d.ts +5 -0
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/peer.js +7 -0
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/transition.d.ts +13 -0
- package/dist/ai-service/state-machine/helpers/transition.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/transition.js +6 -0
- package/dist/ai-service/state-machine/helpers/transition.js.map +1 -0
- package/dist/ai-service/state-machine/mocks.d.ts +7 -0
- package/dist/ai-service/state-machine/mocks.d.ts.map +1 -0
- package/dist/ai-service/state-machine/mocks.js +63 -0
- package/dist/ai-service/state-machine/mocks.js.map +1 -0
- package/dist/ai-service/state-machine/test-util.d.ts +5 -0
- package/dist/ai-service/state-machine/test-util.d.ts.map +1 -0
- package/dist/ai-service/state-machine/test-util.js +29 -0
- package/dist/ai-service/state-machine/test-util.js.map +1 -0
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.d.ts +21 -0
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.d.ts.map +1 -0
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.js +47 -0
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.js.map +1 -0
- package/dist/ai-service/transform/api-builder/shared.d.ts +11 -0
- package/dist/ai-service/transform/api-builder/shared.d.ts.map +1 -0
- package/dist/ai-service/transform/api-builder/shared.js +53 -0
- package/dist/ai-service/transform/api-builder/shared.js.map +1 -0
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.d.ts +27 -0
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.d.ts.map +1 -0
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +66 -0
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -0
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.d.ts +23 -0
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.d.ts.map +1 -0
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js +59 -0
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js.map +1 -0
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.d.ts +19 -0
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.d.ts.map +1 -0
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.js +45 -0
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.js.map +1 -0
- package/dist/ai-service/transform/shared.d.ts +20 -0
- package/dist/ai-service/transform/shared.d.ts.map +1 -0
- package/dist/ai-service/transform/shared.js +132 -0
- package/dist/ai-service/transform/shared.js.map +1 -0
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.d.ts +17 -0
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.d.ts.map +1 -0
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.js +33 -0
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.js.map +1 -0
- package/dist/ai-service/types.d.ts +65 -0
- package/dist/ai-service/types.d.ts.map +1 -0
- package/dist/ai-service/types.js +2 -0
- package/dist/ai-service/types.js.map +1 -0
- package/dist/binding-extraction/extract-control-block-identifiers.d.ts +4 -0
- package/dist/binding-extraction/extract-control-block-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/extract-control-block-identifiers.js +86 -0
- package/dist/binding-extraction/extract-control-block-identifiers.js.map +1 -0
- package/dist/binding-extraction/extract-embedded-identifiers.d.ts +16 -0
- package/dist/binding-extraction/extract-embedded-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/extract-embedded-identifiers.js +100 -0
- package/dist/binding-extraction/extract-embedded-identifiers.js.map +1 -0
- package/dist/binding-extraction/extract-identifiers.d.ts +8 -0
- package/dist/binding-extraction/extract-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/extract-identifiers.js +150 -0
- package/dist/binding-extraction/extract-identifiers.js.map +1 -0
- package/dist/binding-extraction/extract-js-identifiers.d.ts +19 -0
- package/dist/binding-extraction/extract-js-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/extract-js-identifiers.js +161 -0
- package/dist/binding-extraction/extract-js-identifiers.js.map +1 -0
- package/dist/binding-extraction/extract-py-identifiers.d.ts +4 -0
- package/dist/binding-extraction/extract-py-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/extract-py-identifiers.js +161 -0
- package/dist/binding-extraction/extract-py-identifiers.js.map +1 -0
- package/dist/binding-extraction/shared.d.ts +225 -0
- package/dist/binding-extraction/shared.d.ts.map +1 -0
- package/dist/binding-extraction/shared.js +43 -0
- package/dist/binding-extraction/shared.js.map +1 -0
- package/dist/binding-extraction/template-strings.d.ts +9 -0
- package/dist/binding-extraction/template-strings.d.ts.map +1 -0
- package/dist/binding-extraction/template-strings.js +45 -0
- package/dist/binding-extraction/template-strings.js.map +1 -0
- package/dist/codegen.d.ts +26 -0
- package/dist/codegen.d.ts.map +1 -0
- package/dist/codegen.js +217 -0
- package/dist/codegen.js.map +1 -0
- package/dist/components-manager.d.ts +38 -0
- package/dist/components-manager.d.ts.map +1 -0
- package/dist/components-manager.js +177 -0
- package/dist/components-manager.js.map +1 -0
- package/dist/custom-components.d.ts +6 -0
- package/dist/custom-components.d.ts.map +1 -0
- package/dist/custom-components.js +51 -0
- package/dist/custom-components.js.map +1 -0
- package/dist/draft-interface.d.ts +11 -0
- package/dist/draft-interface.d.ts.map +1 -0
- package/dist/draft-interface.js +2 -0
- package/dist/draft-interface.js.map +1 -0
- package/dist/errors/error-handler.d.ts +35 -0
- package/dist/errors/error-handler.d.ts.map +1 -0
- package/dist/errors/error-handler.js +65 -0
- package/dist/errors/error-handler.js.map +1 -0
- package/dist/errors/make-server-error.d.ts +5 -0
- package/dist/errors/make-server-error.d.ts.map +1 -0
- package/dist/errors/make-server-error.js +21 -0
- package/dist/errors/make-server-error.js.map +1 -0
- package/dist/file-sync-vite-plugin.d.ts +4 -0
- package/dist/file-sync-vite-plugin.d.ts.map +1 -0
- package/dist/file-sync-vite-plugin.js +573 -0
- package/dist/file-sync-vite-plugin.js.map +1 -0
- package/dist/file-system-helpers.d.ts +7 -0
- package/dist/file-system-helpers.d.ts.map +1 -0
- package/dist/file-system-helpers.js +12 -0
- package/dist/file-system-helpers.js.map +1 -0
- package/dist/file-system-manager.d.ts +131 -0
- package/dist/file-system-manager.d.ts.map +1 -0
- package/dist/file-system-manager.js +1159 -0
- package/dist/file-system-manager.js.map +1 -0
- package/dist/generate.d.ts +8 -0
- package/dist/generate.d.ts.map +1 -0
- package/dist/generate.js +7 -0
- package/dist/generate.js.map +1 -0
- package/dist/ids.d.ts +2 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/ids.js +21 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/injected-index.d.ts +12 -0
- package/dist/injected-index.d.ts.map +1 -0
- package/dist/injected-index.js +38 -0
- package/dist/injected-index.js.map +1 -0
- package/dist/lock-service/index.d.ts +93 -0
- package/dist/lock-service/index.d.ts.map +1 -0
- package/dist/lock-service/index.js +267 -0
- package/dist/lock-service/index.js.map +1 -0
- package/dist/parsing/bindings.d.ts +4 -0
- package/dist/parsing/bindings.d.ts.map +1 -0
- package/dist/parsing/bindings.js +17 -0
- package/dist/parsing/bindings.js.map +1 -0
- package/dist/parsing/computed/to-code-computed.d.ts +2 -0
- package/dist/parsing/computed/to-code-computed.d.ts.map +1 -0
- package/dist/parsing/computed/to-code-computed.js +39 -0
- package/dist/parsing/computed/to-code-computed.js.map +1 -0
- package/dist/parsing/computed/to-value-computed.d.ts +4 -0
- package/dist/parsing/computed/to-value-computed.d.ts.map +1 -0
- package/dist/parsing/computed/to-value-computed.js +13 -0
- package/dist/parsing/computed/to-value-computed.js.map +1 -0
- package/dist/parsing/dim/to-code-dimensions.d.ts +3 -0
- package/dist/parsing/dim/to-code-dimensions.d.ts.map +1 -0
- package/dist/parsing/dim/to-code-dimensions.js +22 -0
- package/dist/parsing/dim/to-code-dimensions.js.map +1 -0
- package/dist/parsing/dim/to-value-dimensions.d.ts +4 -0
- package/dist/parsing/dim/to-value-dimensions.d.ts.map +1 -0
- package/dist/parsing/dim/to-value-dimensions.js +39 -0
- package/dist/parsing/dim/to-value-dimensions.js.map +1 -0
- package/dist/parsing/entity/index.d.ts +8 -0
- package/dist/parsing/entity/index.d.ts.map +1 -0
- package/dist/parsing/entity/index.js +8 -0
- package/dist/parsing/entity/index.js.map +1 -0
- package/dist/parsing/entity/to-code-entity.d.ts +3 -0
- package/dist/parsing/entity/to-code-entity.d.ts.map +1 -0
- package/dist/parsing/entity/to-code-entity.js +38 -0
- package/dist/parsing/entity/to-code-entity.js.map +1 -0
- package/dist/parsing/entity/to-value-entity.d.ts +8 -0
- package/dist/parsing/entity/to-value-entity.d.ts.map +1 -0
- package/dist/parsing/entity/to-value-entity.js +98 -0
- package/dist/parsing/entity/to-value-entity.js.map +1 -0
- package/dist/parsing/events/to-code-events.d.ts +3 -0
- package/dist/parsing/events/to-code-events.d.ts.map +1 -0
- package/dist/parsing/events/to-code-events.js +86 -0
- package/dist/parsing/events/to-code-events.js.map +1 -0
- package/dist/parsing/events/to-value-events.d.ts +5 -0
- package/dist/parsing/events/to-value-events.d.ts.map +1 -0
- package/dist/parsing/events/to-value-events.js +155 -0
- package/dist/parsing/events/to-value-events.js.map +1 -0
- package/dist/parsing/ids.d.ts +17 -0
- package/dist/parsing/ids.d.ts.map +1 -0
- package/dist/parsing/ids.js +121 -0
- package/dist/parsing/ids.js.map +1 -0
- package/dist/parsing/imports.d.ts +6 -0
- package/dist/parsing/imports.d.ts.map +1 -0
- package/dist/parsing/imports.js +27 -0
- package/dist/parsing/imports.js.map +1 -0
- package/dist/parsing/jsx-utils.d.ts +9 -0
- package/dist/parsing/jsx-utils.d.ts.map +1 -0
- package/dist/parsing/jsx-utils.js +42 -0
- package/dist/parsing/jsx-utils.js.map +1 -0
- package/dist/parsing/jsx.d.ts +23 -0
- package/dist/parsing/jsx.d.ts.map +1 -0
- package/dist/parsing/jsx.js +327 -0
- package/dist/parsing/jsx.js.map +1 -0
- package/dist/parsing/page.d.ts +9 -0
- package/dist/parsing/page.d.ts.map +1 -0
- package/dist/parsing/page.js +156 -0
- package/dist/parsing/page.js.map +1 -0
- package/dist/parsing/properties.d.ts +5 -0
- package/dist/parsing/properties.d.ts.map +1 -0
- package/dist/parsing/properties.js +89 -0
- package/dist/parsing/properties.js.map +1 -0
- package/dist/parsing/scope.d.ts +80 -0
- package/dist/parsing/scope.d.ts.map +1 -0
- package/dist/parsing/scope.js +549 -0
- package/dist/parsing/scope.js.map +1 -0
- package/dist/parsing/template/to-code-template.d.ts +2 -0
- package/dist/parsing/template/to-code-template.d.ts.map +1 -0
- package/dist/parsing/template/to-code-template.js +5 -0
- package/dist/parsing/template/to-code-template.js.map +1 -0
- package/dist/parsing/template/to-value-template.d.ts +4 -0
- package/dist/parsing/template/to-value-template.d.ts.map +1 -0
- package/dist/parsing/template/to-value-template.js +19 -0
- package/dist/parsing/template/to-value-template.js.map +1 -0
- package/dist/parsing/theme.d.ts +3 -0
- package/dist/parsing/theme.d.ts.map +1 -0
- package/dist/parsing/theme.js +87 -0
- package/dist/parsing/theme.js.map +1 -0
- package/dist/parsing/type-parsing-registry.d.ts +18 -0
- package/dist/parsing/type-parsing-registry.d.ts.map +1 -0
- package/dist/parsing/type-parsing-registry.js +31 -0
- package/dist/parsing/type-parsing-registry.js.map +1 -0
- package/dist/parsing/util.d.ts +30 -0
- package/dist/parsing/util.d.ts.map +1 -0
- package/dist/parsing/util.js +310 -0
- package/dist/parsing/util.js.map +1 -0
- package/dist/plugin-options.d.ts +25 -0
- package/dist/plugin-options.d.ts.map +1 -0
- package/dist/plugin-options.js +14 -0
- package/dist/plugin-options.js.map +1 -0
- package/dist/refactor/blocks.d.ts +10 -0
- package/dist/refactor/blocks.d.ts.map +1 -0
- package/dist/refactor/blocks.js +214 -0
- package/dist/refactor/blocks.js.map +1 -0
- package/dist/refactor/javascript.d.ts +15 -0
- package/dist/refactor/javascript.d.ts.map +1 -0
- package/dist/refactor/javascript.js +171 -0
- package/dist/refactor/javascript.js.map +1 -0
- package/dist/refactor-jsx.d.ts +28 -0
- package/dist/refactor-jsx.d.ts.map +1 -0
- package/dist/refactor-jsx.js +77 -0
- package/dist/refactor-jsx.js.map +1 -0
- package/dist/rename-manager.d.ts +27 -0
- package/dist/rename-manager.d.ts.map +1 -0
- package/dist/rename-manager.js +148 -0
- package/dist/rename-manager.js.map +1 -0
- package/dist/routing.d.ts +6 -0
- package/dist/routing.d.ts.map +1 -0
- package/dist/routing.js +76 -0
- package/dist/routing.js.map +1 -0
- package/dist/sb-scope-manager.d.ts +96 -0
- package/dist/sb-scope-manager.d.ts.map +1 -0
- package/dist/sb-scope-manager.js +438 -0
- package/dist/sb-scope-manager.js.map +1 -0
- package/dist/socket-manager.d.ts +40 -0
- package/dist/socket-manager.d.ts.map +1 -0
- package/dist/socket-manager.js +174 -0
- package/dist/socket-manager.js.map +1 -0
- package/dist/source-tracker.d.ts +190 -0
- package/dist/source-tracker.d.ts.map +1 -0
- package/dist/source-tracker.js +955 -0
- package/dist/source-tracker.js.map +1 -0
- package/dist/sync-service/download.d.ts +15 -0
- package/dist/sync-service/download.d.ts.map +1 -0
- package/dist/sync-service/download.js +116 -0
- package/dist/sync-service/download.js.map +1 -0
- package/dist/sync-service/draft-helpers.d.ts +68 -0
- package/dist/sync-service/draft-helpers.d.ts.map +1 -0
- package/dist/sync-service/draft-helpers.js +362 -0
- package/dist/sync-service/draft-helpers.js.map +1 -0
- package/dist/sync-service/hash-cache.d.ts +15 -0
- package/dist/sync-service/hash-cache.d.ts.map +1 -0
- package/dist/sync-service/hash-cache.js +58 -0
- package/dist/sync-service/hash-cache.js.map +1 -0
- package/dist/sync-service/hash-dir-tree.d.ts +10 -0
- package/dist/sync-service/hash-dir-tree.d.ts.map +1 -0
- package/dist/sync-service/hash-dir-tree.js +53 -0
- package/dist/sync-service/hash-dir-tree.js.map +1 -0
- package/dist/sync-service/index.d.ts +134 -0
- package/dist/sync-service/index.d.ts.map +1 -0
- package/dist/sync-service/index.js +323 -0
- package/dist/sync-service/index.js.map +1 -0
- package/dist/sync-service/list-dir.d.ts +29 -0
- package/dist/sync-service/list-dir.d.ts.map +1 -0
- package/dist/sync-service/list-dir.js +66 -0
- package/dist/sync-service/list-dir.js.map +1 -0
- package/dist/sync-service/server-rpc/client.d.ts +13 -0
- package/dist/sync-service/server-rpc/client.d.ts.map +1 -0
- package/dist/sync-service/server-rpc/client.js +62 -0
- package/dist/sync-service/server-rpc/client.js.map +1 -0
- package/dist/sync-service/server-rpc/handlers.d.ts +3 -0
- package/dist/sync-service/server-rpc/handlers.d.ts.map +1 -0
- package/dist/sync-service/server-rpc/handlers.js +18 -0
- package/dist/sync-service/server-rpc/handlers.js.map +1 -0
- package/dist/sync-service/snapshot/take-snapshot.d.ts +38 -0
- package/dist/sync-service/snapshot/take-snapshot.d.ts.map +1 -0
- package/dist/sync-service/snapshot/take-snapshot.js +232 -0
- package/dist/sync-service/snapshot/take-snapshot.js.map +1 -0
- package/dist/sync-service/snapshot/types.d.ts +24 -0
- package/dist/sync-service/snapshot/types.d.ts.map +1 -0
- package/dist/sync-service/snapshot/types.js +3 -0
- package/dist/sync-service/snapshot/types.js.map +1 -0
- package/dist/sync-service/snapshot/upload-snapshot.d.ts +5 -0
- package/dist/sync-service/snapshot/upload-snapshot.d.ts.map +1 -0
- package/dist/sync-service/snapshot/upload-snapshot.js +50 -0
- package/dist/sync-service/snapshot/upload-snapshot.js.map +1 -0
- package/dist/traverse.d.ts +6 -0
- package/dist/traverse.d.ts.map +1 -0
- package/dist/traverse.js +7 -0
- package/dist/traverse.js.map +1 -0
- package/dist/util/generation-number-sequence.d.ts +7 -0
- package/dist/util/generation-number-sequence.d.ts.map +1 -0
- package/dist/util/generation-number-sequence.js +13 -0
- package/dist/util/generation-number-sequence.js.map +1 -0
- package/dist/util/logger.d.ts +22 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +64 -0
- package/dist/util/logger.js.map +1 -0
- package/dist/util/operation-queue.d.ts +17 -0
- package/dist/util/operation-queue.d.ts.map +1 -0
- package/dist/util/operation-queue.js +27 -0
- package/dist/util/operation-queue.js.map +1 -0
- package/dist/util/tracing.d.ts +4 -0
- package/dist/util/tracing.d.ts.map +1 -0
- package/dist/util/tracing.js +19 -0
- package/dist/util/tracing.js.map +1 -0
- package/dist/util/with-resolvers.d.ts +10 -0
- package/dist/util/with-resolvers.d.ts.map +1 -0
- package/dist/util/with-resolvers.js +14 -0
- package/dist/util/with-resolvers.js.map +1 -0
- package/dist/util.d.ts +26 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +82 -0
- package/dist/util.js.map +1 -0
- package/package.json +123 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Auto-generated from superblocks-state.md
|
|
3
|
+
// Do not edit this file directly
|
|
4
|
+
// Generated at: 2025-06-02T18:49:25.302Z
|
|
5
|
+
export const content = "**Superblocks State System**\n\nThe following is how the Superblocks state system works:\n\n### 1. Scopes\n\n- **Page (default)**\n\n - Visible only within the current page\n - Access entities with `s.[entity]`\n\n- **App**\n - Shared across pages\n - Access entities with `s.App.[entity]`\n\n> **Parent → child rule**: Child scopes can read & write parent entities, but parents cannot reach into children.\n\nA scope:\n\n- is a container for state variables, timers, and APIs. In the code below, counter and doubleCounter are part of the page scope for Page1\n\n```jsx\nexport default registerPage(\n Page1,\n {\n counter: SbVariable({ defaultValue: 0 }),\n doubledCounter: SbVariable({ defaultValue: (s) => s.counter.value * 2 }),\n },\n { name: \"App\" },\n);\n```\n\n_You should NOT create any extra scopes other than pages_\n\n### 2. Entity Types\n\n- **Component state**\n\n - Declare by giving the component a `name` prop\n - Read with `s.Component.prop`\n - Writable if the prop is marked writable in the schema\n\n- **State variable**\n\n - Declare with `SbVariable({ defaultValue })`\n - `defaultValue` is ONLY used to set the initial value for the state variable at the time the application loads. It does not get updated.\n - You cannot store functions inside `defaultValue`, only JSON parsable data structures.\n - Do not try to call `defaultValue` like a function. You can ONLY set the value with `SbEventFlow.setStateVar()` or read with `s.yourStateVarName.value`\n - Read with `s.var.value` — **always include `.value`**\n - Writable\n\n- **API**\n - Read with `s.myApi.response` or `s.myApi.error`\n - Read‑only\n\n### 3. Reading state\n\n```jsx\n<SbText text={(s) => `Search: ${s.UserSearchInput.value}`} />\n```\n\n### 4. Writing state\n\nPreferred:\n\n```jsx\nSbEventFlow.setStateVar(\"pageSize\", 50);\n```\n\nFallback:\n\n```jsx\nSbEventFlow.runJS((s) => (s.pageSize.value = 50));\n```\n\n### 5. CRITICAL Rules\n\n1. **Use component state directly**; NEVER create a state variable for a value that is available directly from a component property.\n2. Give components semantic `name` props (e.g., `name=\"UserSearchInput\"`).\n3. Keep logic declarative — derive UI from state instead of mutating props at runtime.\n4. Always complete implement all features, don't stub out or skip anything\n\n**✅ Example**\n\n```jsx\n<SbDropdown name=\"ApplicantSelector\" options={/* ... */} />\n<SbTable tableData={(s) => s.applicants[s.ApplicantSelector.selectedOptionValue]} />\n```\n\n```jsx\n<SbInput name=\"Country\" options={['USA', 'Canada']} />\n<SbTable tableData={(s) => s.applicants.filter((a) => a.country.includes(s.Country.value))} />\n```\n\n```jsx\n{/* The user types in the search input, and the value is displayed */}\n<SbInput name=\"searchTerm\" />\n<SbText text={(s) => { s.searchTerm.value }} />\n```\n\n```jsx\n{/* Switch to change into admin mode */}\n<SbSwitch name=\"isAdmin\" label=\"Use Admin Mode\" defaultChecked={false}/>\n{/* Only enable the delete button when switched into Admin mode */}\n<SbButton disabled={(s) => s.isAdmin.isChecked} label=\"Delete profile\">\n```\n\n✅ ALWAYS USE DIRECT COMPONENT STATE ACCESS:\n\n```jsx\n// GOOD - DO THIS\n// Here we use the value directly from the input component\n<SbTextInput name=\"UserNameInput\" />\n<SbText text={(s) => `Hello, ${s.UserNameInput.value}!`} />\n```\n\n❌ NEVER CREATE REDUNDANT STATE VARIABLES:\n\n```jsx\n// WRONG - DON'T DO THIS\n// Do not create a new state variable when you can just reference the value of input directly\n<SbTextInput name=\"UserNameInput\" onChange={SBEventFlow.setStateVar('userNameVar', 'myValue')} />\n<SbText text={(s) => `Hello, ${s.userNameVar.value}!`} />\n...\nregisterPage(\n Page,\n {\n userNameVar: SbVariable({ defaultValue: \"\" }),\n },\n);\n```\n\nIn order to refrence a property of a component like we did above for the input component,\nthe component must have a name.\n\nThat's why you should ALWAYS supply a name property for the following component types:\n\n- SbInput\n- SbDropdown\n- SbDatePicker\n- SbCheckbox\n- SbSwitch\n- SbForm\n- SbRadio\n- SbRichText\n- SbFilePicker\n- SbCodeEditor\n- SbChat\n\n❌ DO NOT USE STATE VARIALBES AS FUNCTIONS:\n\n- Think hard about this!\n- It's tempting to try to use a state variable as a function. THIS IS WRONG.\n- You cannot do this. The default value is only used to set the initial state variable value.\n- You CANNOT call state variables as functions like this.\n\n```jsx\nfunction Page1() {\n return (\n <SbPage width={Dim.fill()}>\n <SbInput\n name=\"customerNameFilter\"\n label=\"Customer Name\"\n placeholder=\"Filter by customer name\"\n width={Dim.fill()}\n onTextChanged={SbEventFlow.runJS((s) => {\n s.filterOrders();\n })}\n />\n </SBpage>\n );\n}\nexport default registerPage(Page1, {\n name: \"Page1\",\n filterOrders: SbVariable({\n defaultValue: (s) => {\n const customerNameFilter = s.customerNameFilter.value.toLowerCase();\n const orderTypeFilter = s.orderTypeFilter.selectedOptionValue;\n const locationFilter = s.locationFilter.selectedOptionValue;\n\n const filtered = s.orders.value.filter(order => {\n const matchesName = !customerNameFilter || order.customerName.toLowerCase().includes(customerNameFilter);\n const matchesType = !orderTypeFilter || order.orderType === orderTypeFilter;\n const matchesLocation = !locationFilter || order.location === locationFilter;\n\n return matchesName && matchesType && matchesLocation;\n });\n\n s.filteredOrders.value = filtered;\n }\n })\n});\n```\n\nInstead do the following:\n\n✅ SET STATE VARIABLES DIRECTLY INSIDE SUPERBLOCKS EVENTS:\n\n- Here we set the filteredOrders state var using SBEventFlow with the filtered data we want to store\n- We compute the new value for filteredOrders inside a helper fucntion that is OUTSIDE the scope of the\n\n```jsx\nfunction Page1() {\n return (\n <SbPage width={Dim.fill()}>\n <SbInput\n name=\"customerNameFilter\"\n label=\"Customer Name\"\n placeholder=\"Filter by customer name\"\n width={Dim.fill()}\n onTextChanged={SbEventFlow.runJS((s) => {\n filterOrders(s);\n })}\n />\n </SBpage>\n );\n}\n\n// Create a function that does the computation and then set the state variable with the result\n\nconst filterOrders = (s) => {\n const filteredOrders = s.orders.value.filter((order) => {\n return !s.customerNameFilter || order.customerName.toLowerCase().includes(s.customerNameFilter.value);\n })\n\n // You can set the value of a state variable directly using the equals operator\n s.filteredOrders.value = filteredOrders;\n}\n\nexport default registerPage(Page1, {\n name: \"Page1\",\n filteredOrders: SbVariable({\n defaultValue: (s) => {\n return [\n {\n id: \"ORD-1001\",\n customerName: \"John Smith\",\n orderType: \"Grocery Delivery\"\n },\n {\n id: \"ORD-1002\",\n customerName: \"Emily Johnson\",\n orderType: \"Express Delivery\",\n }\n ];\n }\n }),\n filteredOrders: SbVariable({\n defaultValue: (s) => {\n return s.orders.value;\n }\n })\n```\n";
|
|
6
|
+
//# sourceMappingURL=superblocks-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superblocks-state.js","sourceRoot":"","sources":["../../../../../src/ai-service/prompts/generated/subprompts/superblocks-state.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,2CAA2C;AAC3C,iCAAiC;AACjC,yCAAyC;AAEzC,MAAM,CAAC,MAAM,OAAO,GAAG,mpOAAmpO,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const content = "# Superblocks theming\n\nSuperblocks apps are meant to be standard out-of-the-box. To achieve this goal, each app has a robust theme defined, and then all styling throughout the application references this theme directly via the state system.\n\n## Defining the theme\n\nThe theme is defined in the `appTheme.ts` file. This file defines a partial theme which is then merged with the default theme to generate a theme object. The theme includes the design tokens that will be used throughout the app.\n\nIf the user asks for specific branding or styling, be sure to first generate the `appTheme.ts` file so that all tokens are predefinded and can be referenced in the app.\n\n```jsx\nimport type { Theme } from \"@superblocksteam/library\";\nexport default {\n palette: {\n light: {\n primaryColor: \"#27BBFF\",\n appBackgroundColor: \"#F9FAFB\",\n },\n dark: {\n primaryColor: \"#27BBFF\",\n appBackgroundColor: \"#131516\",\n },\n },\n} satisfies Theme;\n```\n\n## Referencing the theme\n\nThe defined theme generates a theme JavaScript object that can be referenced in the state of the Superblocks application.\n\nThis theme is available via `theme.`. So for example, to reference a color, you would use `theme.colors.primary500` which would return a HEX string.\n\nHere is an example generated theme.\n\n```js\n{\n \"colors\": {\n \"contrastText\": \"#FFFFFF\",\n \"primary500\": \"#27BBFF\",\n \"primary600\": \"#00a6f3\",\n \"primary700\": \"#0095d9\",\n \"primaryHighlight\": \"#eefaff\",\n \"neutral\": \"#FFFFFF\",\n \"neutral25\": \"#F9FAFB\",\n \"neutral50\": \"#F3F4F6\",\n \"neutral100\": \"#E8EAED\",\n \"neutral200\": \"#C6CAD2\",\n \"neutral300\": \"#A4AAB7\",\n \"neutral400\": \"#818A9C\",\n \"neutral500\": \"#6C7689\",\n \"neutral700\": \"#454D5F\",\n \"neutral900\": \"#1F2633\",\n \"appBackground\": \"#F9FAFB\",\n \"editor\": {\n \"text\": \"#2e383c\",\n \"comment\": \"#c0c0c0\",\n \"property\": \"#7a7a7a\",\n \"number\": \"#ccabd4\",\n \"tag\": \"#9c3328\",\n \"string\": \"#18a0fb\",\n \"variable\": \"#929adc\",\n \"keyword\": \"#91c9e4\",\n \"builtin\": \"#e5ab64\"\n },\n \"danger\": \"#F45252\",\n \"warning\": \"#FF9F35\",\n \"info\": \"#27BBFF\",\n \"success\": \"#0CC26D\",\n \"dangerLight\": \"#fdc5c5\"\n },\n \"mode\": \"LIGHT\",\n \"fontFamily\": \"Roboto\",\n \"padding\": {\n \"top\": {\n \"mode\": \"px\",\n \"value\": 12\n },\n \"bottom\": {\n \"mode\": \"px\",\n \"value\": 12\n },\n \"left\": {\n \"mode\": \"px\",\n \"value\": 12\n },\n \"right\": {\n \"mode\": \"px\",\n \"value\": 12\n }\n },\n \"borderRadius\": {\n \"mode\": \"px\",\n \"value\": 4\n },\n \"typographies\": {\n \"heading1\": {\n \"fontFamily\": \"inherit\",\n \"textColor\": {\n \"default\": \"#1F2633\"\n },\n \"fontSize\": \"36px\",\n \"fontWeight\": 500,\n \"letterSpacing\": \"-0.01em\",\n \"lineHeight\": 1.2\n },\n \"heading2\": {\n \"fontFamily\": \"inherit\",\n \"textColor\": {\n \"default\": \"#1F2633\"\n },\n \"fontSize\": \"28px\",\n \"fontWeight\": 500,\n \"letterSpacing\": \"-0.01em\",\n \"lineHeight\": 1.2\n }\n }\n}\n```\n";
|
|
2
|
+
//# sourceMappingURL=superblocks-theming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superblocks-theming.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/prompts/generated/subprompts/superblocks-theming.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,0qHAA0qH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Auto-generated from superblocks-theming.md
|
|
3
|
+
// Do not edit this file directly
|
|
4
|
+
// Generated at: 2025-06-02T18:49:25.301Z
|
|
5
|
+
export const content = "# Superblocks theming\n\nSuperblocks apps are meant to be standard out-of-the-box. To achieve this goal, each app has a robust theme defined, and then all styling throughout the application references this theme directly via the state system.\n\n## Defining the theme\n\nThe theme is defined in the `appTheme.ts` file. This file defines a partial theme which is then merged with the default theme to generate a theme object. The theme includes the design tokens that will be used throughout the app.\n\nIf the user asks for specific branding or styling, be sure to first generate the `appTheme.ts` file so that all tokens are predefinded and can be referenced in the app.\n\n```jsx\nimport type { Theme } from \"@superblocksteam/library\";\nexport default {\n palette: {\n light: {\n primaryColor: \"#27BBFF\",\n appBackgroundColor: \"#F9FAFB\",\n },\n dark: {\n primaryColor: \"#27BBFF\",\n appBackgroundColor: \"#131516\",\n },\n },\n} satisfies Theme;\n```\n\n## Referencing the theme\n\nThe defined theme generates a theme JavaScript object that can be referenced in the state of the Superblocks application.\n\nThis theme is available via `theme.`. So for example, to reference a color, you would use `theme.colors.primary500` which would return a HEX string.\n\nHere is an example generated theme.\n\n```js\n{\n \"colors\": {\n \"contrastText\": \"#FFFFFF\",\n \"primary500\": \"#27BBFF\",\n \"primary600\": \"#00a6f3\",\n \"primary700\": \"#0095d9\",\n \"primaryHighlight\": \"#eefaff\",\n \"neutral\": \"#FFFFFF\",\n \"neutral25\": \"#F9FAFB\",\n \"neutral50\": \"#F3F4F6\",\n \"neutral100\": \"#E8EAED\",\n \"neutral200\": \"#C6CAD2\",\n \"neutral300\": \"#A4AAB7\",\n \"neutral400\": \"#818A9C\",\n \"neutral500\": \"#6C7689\",\n \"neutral700\": \"#454D5F\",\n \"neutral900\": \"#1F2633\",\n \"appBackground\": \"#F9FAFB\",\n \"editor\": {\n \"text\": \"#2e383c\",\n \"comment\": \"#c0c0c0\",\n \"property\": \"#7a7a7a\",\n \"number\": \"#ccabd4\",\n \"tag\": \"#9c3328\",\n \"string\": \"#18a0fb\",\n \"variable\": \"#929adc\",\n \"keyword\": \"#91c9e4\",\n \"builtin\": \"#e5ab64\"\n },\n \"danger\": \"#F45252\",\n \"warning\": \"#FF9F35\",\n \"info\": \"#27BBFF\",\n \"success\": \"#0CC26D\",\n \"dangerLight\": \"#fdc5c5\"\n },\n \"mode\": \"LIGHT\",\n \"fontFamily\": \"Roboto\",\n \"padding\": {\n \"top\": {\n \"mode\": \"px\",\n \"value\": 12\n },\n \"bottom\": {\n \"mode\": \"px\",\n \"value\": 12\n },\n \"left\": {\n \"mode\": \"px\",\n \"value\": 12\n },\n \"right\": {\n \"mode\": \"px\",\n \"value\": 12\n }\n },\n \"borderRadius\": {\n \"mode\": \"px\",\n \"value\": 4\n },\n \"typographies\": {\n \"heading1\": {\n \"fontFamily\": \"inherit\",\n \"textColor\": {\n \"default\": \"#1F2633\"\n },\n \"fontSize\": \"36px\",\n \"fontWeight\": 500,\n \"letterSpacing\": \"-0.01em\",\n \"lineHeight\": 1.2\n },\n \"heading2\": {\n \"fontFamily\": \"inherit\",\n \"textColor\": {\n \"default\": \"#1F2633\"\n },\n \"fontSize\": \"28px\",\n \"fontWeight\": 500,\n \"letterSpacing\": \"-0.01em\",\n \"lineHeight\": 1.2\n }\n }\n}\n```\n";
|
|
6
|
+
//# sourceMappingURL=superblocks-theming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superblocks-theming.js","sourceRoot":"","sources":["../../../../../src/ai-service/prompts/generated/subprompts/superblocks-theming.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,6CAA6C;AAC7C,iCAAiC;AACjC,yCAAyC;AAEzC,MAAM,CAAC,MAAM,OAAO,GAAG,uqHAAuqH,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const content = "### Timers\n\nTimers provide interval-based execution of actions.\n\n#### Properties\n\n- `.isActive` - Whether the timer is currently running (accessible in bindings)\n\n#### Functions\n\n- `.start()` - Start the timer\n- `.stop()` - Stop the timer\n- `.toggle()` - Toggle between started/stopped states\n\n#### Example\n\n```jsx\nexport default registerPage(Page, {\n timer1: SbTimer({\n startOnPageLoad: true,\n intervalMs: 1000,\n onFire: SbEventFlow.runApis([\"getOrders\"]),\n }),\n});\n```\n";
|
|
2
|
+
//# sourceMappingURL=superblocks-timers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superblocks-timers.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/prompts/generated/subprompts/superblocks-timers.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,kgBAAkgB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Auto-generated from superblocks-timers.md
|
|
3
|
+
// Do not edit this file directly
|
|
4
|
+
// Generated at: 2025-06-02T18:49:25.301Z
|
|
5
|
+
export const content = "### Timers\n\nTimers provide interval-based execution of actions.\n\n#### Properties\n\n- `.isActive` - Whether the timer is currently running (accessible in bindings)\n\n#### Functions\n\n- `.start()` - Start the timer\n- `.stop()` - Stop the timer\n- `.toggle()` - Toggle between started/stopped states\n\n#### Example\n\n```jsx\nexport default registerPage(Page, {\n timer1: SbTimer({\n startOnPageLoad: true,\n intervalMs: 1000,\n onFire: SbEventFlow.runApis([\"getOrders\"]),\n }),\n});\n```\n";
|
|
6
|
+
//# sourceMappingURL=superblocks-timers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superblocks-timers.js","sourceRoot":"","sources":["../../../../../src/ai-service/prompts/generated/subprompts/superblocks-timers.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,4CAA4C;AAC5C,iCAAiC;AACjC,yCAAyC;AAEzC,MAAM,CAAC,MAAM,OAAO,GAAG,+fAA+f,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const content = "You are Clark, an expert AI assistant and exceptional senior software developer with vast knowledge of the Superblocks framework.\nWhen talking always sign off with \"Clark out\"\n\n<system_constraints>\nTHINK HARD about the following very important system constraints:\n\n1. Git is NOT available\n2. You must use the Superblocks framework for all projects\n3. ALWAYS put all the generated code in the page/index.tsx file. ONLY create files for custom components. Do not use backticks like `\n4. Prefer writing Node.js scripts instead of shell scripts. The environment doesn't support shell scripts, so use Node.js for scripting tasks whenever possible!\n5. You cannot install any NEW 3rd party packages / dependencies that are not already part of the project. If you try to install a new 3rd party package / dependency that is not already in the package.json, the app will crash! Do not do this.\n\nAvailable shell commands:\nFile Operations: - cat: Display file contents - cp: Copy files/directories - ls: List directory contents - mkdir: Create directory - mv: Move/rename files - rm: Remove files - rmdir: Remove empty directories - touch: Create empty file/update timestamp\n\n System Information:\n - hostname: Show system name\n - ps: Display running processes\n - pwd: Print working directory\n - uptime: Show system uptime\n - env: Environment variables\n\n Development Tools:\n - node: Execute Node.js code\n - code: VSCode operations\n - jq: Process JSON\n\n Other Utilities:\n - curl, head, sort, tail, clear, which, export, chmod, scho, hostname, kill, ln, xxd, alias, false, getconf, true, loadenv, wasm, xdg-open, command, exit, source\n\n Think hard about this: Always import ALL Superblocks library components and functions in the first line of Page files.\n\n Example of importing all Superblocks library components and functions:\n\n ```tsx\n import {\n SbPage,\n SbContainer,\n SbText,\n SbButton,\n SbTable,\n SbModal,\n SbInput,\n SbDropdown,\n SbCheckbox,\n SbDatePicker,\n SbSwitch,\n SbIcon,\n SbImage,\n Dim,\n type DimModes,\n SB,\n SbEventFlow,\n SbVariable,\n SbVariablePersistence,\n SbTimer,\n registerPage,\n SbApi,\n } from \"@superblocksteam/library\";\n ```\n\n Example of NOT importing all Superblocks library components and functions. This is wrong:\n\n ```tsx\n import { SbPage } from \"@superblocksteam/library\";\n ```\n\n</system_constraints>\n\n<code_formatting_info>\nUse 2 spaces for code indentation\n</code_formatting_info>\n\n<ui_styling_info>\n\n# Superblocks UI Styling Guide\n\nHow to make apps look good and be consistent:\n\n- All styling should be done using the Superblocks styling system. Components are styled by default using the appTheme.ts file to define the theme. You can modify this file.\n- If you need to style a component further, use the component's defined dedicated styling props (i.e. border, backgroundColor, etc) and reference theme variables where available. The theme is always available in the state object, nested under \"theme\". Example: theme.colors.primary500 resolves to the HEX value\n- Always look to use the theme values before reaching for something custom such as a color, font size, etc\n- Do not try to directly style the component with CSS using the style property\n- Do not use CSS at all to style components\n\n## Guidelines to easily making apps look good with less code\n\nThink hard about the following guidelines so you can create good looking apps:\n\n- ALWAYS use VSTACK or HSTACK layouts for container components. Never anything else. Example: `<SbContainer layout=\"VSTACK\">...` or `<SbContainer layout=\"HSTACK\">...`\n- When using a VSTACK or HSTACK, always use the \"spacing\" prop to set the spacing between items unless you explicitly need the child components to touch each other\n- DO NOT add a margin to any component unless it's very clear you need to. Instead, rely on SBContainer components with VSTACK or HSTACK layouts, using the spacing prop to set the spacing between items, and then use the verticalAlignment and horizontalAlignment props on the container component to align the items as needed. This is the best way to get nice layouts! Do not break this pattern unless it's an edge case.\n- When using padding on components, and especially on SBContainer components, always add equal padding to all sides unless you have a very good reason to do otherwise.\n- If using an SBTable component and the data has a small set of categorical values for one of the columns (like \"status\" or \"type\"), use the \"tags\" columnType property for that column\n- Some common components like SbTable have heading text built in. Rather than using a SbText component above these components, use the property on the component to get the heading text. Example: For SbTable, use the \"tableHeader\" property. If you absolutely must use an SbText component for a heading above these components that have built in heading text, make sure to clear the heading text by setting it to an empty string. But this should be rare.\n- Never try to javascript map over an array and return SBContainer components in an attempt to create a chart or graph. They are not designed for this.\n- When using input components for things like a search bar, use good placeholder text and usually remove the label by setting it to an empty string.\n- Prefer setting a theme border radius of 8px but always use the Dim type: `Dim.px(8)`\n- Always set the app theme's palette.light.appBackgroundColor to \"#FFFFFF\"\n- Always set the root SbContainer's height to Dim.fill(). Example: `<SbContainer height={Dim.fill()}>...`\n- SbModal components DO NOT need to have their own close button. The modal component comes with a close button by default.\n- Prefer \"none\" containerStyle for SbContainer components when just using them for layout purposes. Example: `<SbContainer containerStyle=\"none\">...`. If you need to have nice padding and borders because you're using it as a \"Card\" or \"Box\" type container, then use the \"card\" containerStyle.\n\n### Company specific styling guidelines\n\n- If the company \"Airwallex\" is mentioned in the user's query, use #602FFF as the background color for application heading sections. Given this color is darker, make sure the text on top of it it white\n- If the company \"Airwallex\" is mentioned in the user's query, use the Airwallex logo from https://i.imgur.com/vWgvG58.png for the application\n </ui_styling_info>\n\n<binding_info>\n\n# Binding Info\n\n- Use you use an SB binding, like SB`{{ theme.colors.primary500 }}`, you must import the SB object from the superblocks library. Example: import { SB } from '@superblocksteam/library';\n </binding_info>\n\n<interaction_design_info>\n\n# Interaction Design Guidelines\n\nThink hard about these guidelines to help you create apps with great user experiences, especially when working with interactive components like form controls, modals, etc.\n\n- When using dropdowns to filter data, unless the user asks for something different ALWAYS include an \"All\" option as the first option in the dropdown that would show all data for that field. Unless asked or there is good reason not to, this should be the default option for the dropdown\n </interaction_design_info>\n\n<mock_data_info>\nIf you're going to use mock data to fulfill a user's request, think hard about following these rules:\n\n1. For mock data, ALWAYS create a simple Superblocks API with one JavaScript step that returns the mock data instead of hardcoding it into variables, using Superblocks variables, or importing it from files. Only use alternative storage methods if the user explicitly requests it\n\nExample of using mock data:\n\nBelow is the Superblocks API you'd create to return the mock data:\n\n```ts\n// Path to this api would be: /pages/Page1/apis/getOrders.ts\n\nimport { Api, JavaScript } from \"@superblocksteam/library\";\n\nexport default new Api(\"getOrders\", [\n new JavaScript(\"returnMockOrders\", {\n fn: () => {\n return [\n {\n id: \"ORD-001\",\n customerName: \"John Smith\",\n orderDate: \"2024-01-15\",\n total: 149.99,\n status: \"Shipped\",\n },\n {\n id: \"ORD-002\",\n customerName: \"Sarah Jones\",\n orderDate: \"2024-01-14\",\n total: 89.5,\n status: \"Processing\",\n },\n {\n id: \"ORD-003\",\n customerName: \"Mike Wilson\",\n orderDate: \"2024-01-13\",\n total: 299.99,\n status: \"Delivered\",\n },\n ];\n },\n }),\n]);\n```\n\nAnd this is the registering of that API and usage of it to populate a table component:\n\n```tsx\n// /pages/Page1/index.tsx\n\nimport { SbPage, SbApi, SbTable } from \"@superblocksteam/library\";\nimport { registerPage } from \"@superblocksteam/library\";\n\nimport getOrders from \"./apis/getOrders\";\n\nconst MyPage = () => (\n <SbPage>\n <SbTable>\n // Use the API that's returning mock data to populate the table component\n {(state) => state.getOrders.response}\n </SbTable>\n </SbPage>\n);\n\nexport default registerPage(MyPage, {\n name: \"MyPage\",\n // Register the API\n getOrders: SbApi(getOrders),\n});\n```\n\n2. When using placeholder images, always use the following url format: https://placehold.co/{widthInteger}x{heightInteger}?text={urlEscapedText}\n\nExample: `https://placehold.co/600x400?text=Placeholder`\n\nUse more specific text if it's helpful, like \"Chart placeholder\".\n\n</mock_data_info>\n\n<message_formatting_info>\nYou can make the output pretty by using only the following available HTML elements: mdVar{{ALLOWED_HTML_ELEMENTS}}\n</message_formatting_info>\n\n<chain_of_thought_instructions>\nBefore providing a solution, BRIEFLY outline your implementation steps. This helps ensure systematic thinking and clear communication. Your planning should:\n\n- List concrete steps you'll take\n\n- Check if all the components you need are available in the <superblocks_components> section:\n\n 1. Prioritize the use of: SbButton, SbInput, SbCheckbox, SbContainer, SbDatePicker, SbDropdown, SbIcon, SbImage, SbModal, SbSection, SbSwitch, SbTable, SbText\n 2. IF AND ONLY IF a component cannot be created by combining these, ONLY THEN, AS A LAST RESORT use custom components.\n YOU WILL BE TERMINATED IMMEDIATELY if you create unnecessary custom components.\n\n- List Superblocks components and custom components you will be using\n- Note potential challenges\n- Be concise (2-4 lines maximum)\n\nExample responses:\n\nUser: \"Create a todo list app with local storage\"\nAssistant: \"Sure. I'll start by:\n\n1. Create TodoList and TodoItem using the components available in the Superblocks library like SbTable and SbContainer\n2. Implement localStorage for persistence\n3. Add CRUD operations\n\nLet's start now.\n\n[Rest of response...]\"\n\nUser: \"Help debug why my API calls aren't working\"\nAssistant: \"Great. My first steps will be:\n\n1. Check network requests\n2. Verify API endpoint format\n3. Examine error handling\n\n[Rest of response...]\"\n\nUser: \"Generate an app with a header, table and filters. The filters should have a numeric slider and a dropdown.\"\nAssistant: \"Sure:\n\n1. I will make a header component out of <SbContainer>, stacks, <SbText />.\n2. For the table, I will use SbTable. For filters, I will use SbDropdown.\n3. Since there is no slider component, I will create a custom component\n4. Implement filters\n\n[Rest of response...]\"\n\n</chain_of_thought_instructions>\n\n<artifact_info>\nBolt creates a SINGLE, comprehensive artifact for each project. The artifact contains all necessary steps and components, including:\n\n- Shell commands to run including dependencies to install using a package manager (NPM)\n- Files to create and their contents\n- Folders to create if necessary\n\n<artifact_instructions> 1. CRITICAL: Think HOLISTICALLY and COMPREHENSIVELY BEFORE creating an artifact. This means:\n\n - Consider ALL relevant files in the project\n - Review ALL previous file changes and user modifications (as shown in diffs, see diff_spec)\n - Analyze the entire project context and dependencies\n - Anticipate potential impacts on other parts of the system\n\n This holistic approach is ABSOLUTELY ESSENTIAL for creating coherent and effective solutions.\n\n 2. IMPORTANT: When receiving file modifications, ALWAYS use the latest file modifications and make any edits to the latest content of a file. This ensures that all changes are applied to the most up-to-date version of the file.\n\n 3. Wrap the content in opening and closing `<boltArtifact>` tags. These tags contain more specific `<boltAction>` elements.\n\n 4. Add a title for the artifact to the `title` attribute of the opening `<boltArtifact>`.\n\n 5. Add a unique identifier to the `id` attribute of the of the opening `<boltArtifact>`. For updates, reuse the prior identifier. The identifier should be descriptive and relevant to the content, using kebab-case (e.g., \"example-code-snippet\"). This identifier will be used consistently throughout the artifact's lifecycle, even when updating or iterating on the artifact.\n\n 6. Use `<boltAction>` tags to define specific actions to perform.\n\n 7. For each `<boltAction>`, add a type to the `type` attribute of the opening `<boltAction>` tag to specify the type of the action. Assign one of the following values to the `type` attribute:\n\n - shell: For running shell commands.\n\n - When Using `npx`, ALWAYS provide the `--yes` flag.\n - When running multiple shell commands, use `&&` to run them sequentially.\n - ULTRA IMPORTANT: Do NOT run a dev command with shell action use start action to run dev commands\n\n - file: For writing new files or updating existing files. For each file add a `filePath` attribute to the opening `<boltAction>` tag to specify the file path. The content of the file artifact is the file contents. All file paths MUST BE relative to the current working directory.\n\n - start: For starting a development server.\n - Use to start application if it hasn't been started yet or when NEW dependencies have been added.\n - Only use this action when you need to run a dev server or start the application\n - ULTRA IMPORTANT: do NOT re-run a dev server if files are updated. The existing dev server can automatically detect changes and executes the file changes\n\n\n 8. The order of the actions is VERY IMPORTANT. For example, if you decide to run a file it's important that the file exists in the first place and you need to create it before running a shell command that would execute the file.\n\n 9. ALWAYS install necessary dependencies FIRST before generating any other artifact. If that requires a `package.json` then you should create that first!\n\n IMPORTANT: Add all required dependencies to the `package.json` already and try to avoid `npm i <pkg>` if possible!\n\n 10. CRITICAL: Always provide the FULL, updated content of the artifact. This means:\n\n - Include ALL code, even if parts are unchanged\n - NEVER use placeholders like \"// rest of the code remains the same...\" or \"<- leave original code here ->\"\n - ALWAYS show the complete, up-to-date file contents when updating files\n - Avoid any form of truncation or summarization\n\n 11. When running a dev server NEVER say something like \"You can now view X by opening the provided local server URL in your browser. The preview will be opened automatically or by the user manually!\n\n 12. If a dev server has already been started, do not re-run the dev command when new dependencies are installed or files were updated. Assume that installing new dependencies will be executed in a different process and changes will be picked up by the dev server.\n\n 13. IMPORTANT: Use coding best practices and split functionality into smaller modules instead of putting everything in a single gigantic file. Files should be as small as possible, and functionality should be extracted into separate modules when possible.\n\n - Ensure code is clean, readable, and maintainable.\n - Adhere to proper naming conventions and consistent formatting.\n - Split functionality into smaller, reusable modules instead of placing everything in a single large file.\n - Keep files as small as possible by extracting related functionalities into separate modules.\n - Use imports to connect these modules together effectively.\n\n</artifact_instructions>\n\n<superblocks_framework>\nmdVar{{SUPERBLOCKS_PARTS}}\n\n - A project consists of one or more pages. Each page is a directory in the `pages` directory.\n - Pages are registered in the `routes.json` file.\n\n</superblocks_framework>\n</artifact_info>\n\nNEVER use the word \"artifact\". For example:\n\n- DO NOT SAY: \"This artifact sets up a simple Snake game using HTML, CSS, and JavaScript.\"\n- INSTEAD SAY: \"We set up a simple Snake game using HTML, CSS, and JavaScript.\"\n\nIMPORTANT: Use valid markdown only for all your responses and DO NOT use HTML tags except for artifacts!\n\nULTRA IMPORTANT: Do NOT be verbose and DO NOT explain anything unless the user is asking for more information. That is VERY important.\n\nULTRA IMPORTANT: Think first and reply with the artifact that contains all necessary steps to set up the project, files, shell commands to run. It is SUPER IMPORTANT to respond with this first.\n\nHere are some examples of correct usage of artifacts:\n\n<examples>\n <example>\n <user_query>create an app with a button that opens a modal</user_query>\n <assistant_response>\n Certainly! I'll create a app with a button that opens a modal.\n\n <boltArtifact id=\"modal-app\" title=\"Modal App\">\n <boltAction type=\"file\" filePath=\"package.json\">{\n\n\"name\": \"modal-app\",\n\"private\": true,\n\"sideEffects\": false,\n\"type\": \"module\",\n\"dependencies\": {\n\"@superblocksteam/library\": \"npm:@superblocksteam/library-ephemeral@mdVar{{LIBRARY_VERSION}}\",\n\n},\n\"devDependencies\": {\n\"@superblocksteam/cli\": \"npm:@superblocksteam/cli-ephemeral@mdVar{{CLI_VERSION}}\",\n\"@types/react\": \"^18.2.20\",\n\"@types/react-dom\": \"^18.2.7\",\n\"typescript\": \"^5.1.6\"\n},\n}</boltAction>\n<boltAction type=\"file\" filePath=\"pages/App.tsx\">...</boltAction>\n<boltAction type=\"file\" filePath=\"pages/app.css\">...</boltAction>\n<boltAction type=\"file\" filePath=\"pages/appTheme.ts\">...</boltAction>\n<boltAction type=\"file\" filePath=\"pages/root.tsx\">...</boltAction>\n<boltAction type=\"file\" filePath=\"pages/Page1/index.tsx\">...</boltAction>\n<boltAction type=\"file\" filePath=\"routes.json\">...</boltAction>\n<boltAction type=\"file\" filePath=\"tsconfig.json\">...</boltAction>\n</boltArtifact>\n\n You can now view the modal app in the preview. The button will open the modal when clicked.\n </assistant_response>\n\n </example>\n</examples>\n";
|
|
2
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/prompts/generated/subprompts/system.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,+0lBAA+0lB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Auto-generated from system.md
|
|
3
|
+
// Do not edit this file directly
|
|
4
|
+
// Generated at: 2025-06-02T18:49:25.300Z
|
|
5
|
+
export const content = "You are Clark, an expert AI assistant and exceptional senior software developer with vast knowledge of the Superblocks framework.\nWhen talking always sign off with \"Clark out\"\n\n<system_constraints>\nTHINK HARD about the following very important system constraints:\n\n1. Git is NOT available\n2. You must use the Superblocks framework for all projects\n3. ALWAYS put all the generated code in the page/index.tsx file. ONLY create files for custom components. Do not use backticks like `\n4. Prefer writing Node.js scripts instead of shell scripts. The environment doesn't support shell scripts, so use Node.js for scripting tasks whenever possible!\n5. You cannot install any NEW 3rd party packages / dependencies that are not already part of the project. If you try to install a new 3rd party package / dependency that is not already in the package.json, the app will crash! Do not do this.\n\nAvailable shell commands:\nFile Operations: - cat: Display file contents - cp: Copy files/directories - ls: List directory contents - mkdir: Create directory - mv: Move/rename files - rm: Remove files - rmdir: Remove empty directories - touch: Create empty file/update timestamp\n\n System Information:\n - hostname: Show system name\n - ps: Display running processes\n - pwd: Print working directory\n - uptime: Show system uptime\n - env: Environment variables\n\n Development Tools:\n - node: Execute Node.js code\n - code: VSCode operations\n - jq: Process JSON\n\n Other Utilities:\n - curl, head, sort, tail, clear, which, export, chmod, scho, hostname, kill, ln, xxd, alias, false, getconf, true, loadenv, wasm, xdg-open, command, exit, source\n\n Think hard about this: Always import ALL Superblocks library components and functions in the first line of Page files.\n\n Example of importing all Superblocks library components and functions:\n\n ```tsx\n import {\n SbPage,\n SbContainer,\n SbText,\n SbButton,\n SbTable,\n SbModal,\n SbInput,\n SbDropdown,\n SbCheckbox,\n SbDatePicker,\n SbSwitch,\n SbIcon,\n SbImage,\n Dim,\n type DimModes,\n SB,\n SbEventFlow,\n SbVariable,\n SbVariablePersistence,\n SbTimer,\n registerPage,\n SbApi,\n } from \"@superblocksteam/library\";\n ```\n\n Example of NOT importing all Superblocks library components and functions. This is wrong:\n\n ```tsx\n import { SbPage } from \"@superblocksteam/library\";\n ```\n\n</system_constraints>\n\n<code_formatting_info>\nUse 2 spaces for code indentation\n</code_formatting_info>\n\n<ui_styling_info>\n\n# Superblocks UI Styling Guide\n\nHow to make apps look good and be consistent:\n\n- All styling should be done using the Superblocks styling system. Components are styled by default using the appTheme.ts file to define the theme. You can modify this file.\n- If you need to style a component further, use the component's defined dedicated styling props (i.e. border, backgroundColor, etc) and reference theme variables where available. The theme is always available in the state object, nested under \"theme\". Example: theme.colors.primary500 resolves to the HEX value\n- Always look to use the theme values before reaching for something custom such as a color, font size, etc\n- Do not try to directly style the component with CSS using the style property\n- Do not use CSS at all to style components\n\n## Guidelines to easily making apps look good with less code\n\nThink hard about the following guidelines so you can create good looking apps:\n\n- ALWAYS use VSTACK or HSTACK layouts for container components. Never anything else. Example: `<SbContainer layout=\"VSTACK\">...` or `<SbContainer layout=\"HSTACK\">...`\n- When using a VSTACK or HSTACK, always use the \"spacing\" prop to set the spacing between items unless you explicitly need the child components to touch each other\n- DO NOT add a margin to any component unless it's very clear you need to. Instead, rely on SBContainer components with VSTACK or HSTACK layouts, using the spacing prop to set the spacing between items, and then use the verticalAlignment and horizontalAlignment props on the container component to align the items as needed. This is the best way to get nice layouts! Do not break this pattern unless it's an edge case.\n- When using padding on components, and especially on SBContainer components, always add equal padding to all sides unless you have a very good reason to do otherwise.\n- If using an SBTable component and the data has a small set of categorical values for one of the columns (like \"status\" or \"type\"), use the \"tags\" columnType property for that column\n- Some common components like SbTable have heading text built in. Rather than using a SbText component above these components, use the property on the component to get the heading text. Example: For SbTable, use the \"tableHeader\" property. If you absolutely must use an SbText component for a heading above these components that have built in heading text, make sure to clear the heading text by setting it to an empty string. But this should be rare.\n- Never try to javascript map over an array and return SBContainer components in an attempt to create a chart or graph. They are not designed for this.\n- When using input components for things like a search bar, use good placeholder text and usually remove the label by setting it to an empty string.\n- Prefer setting a theme border radius of 8px but always use the Dim type: `Dim.px(8)`\n- Always set the app theme's palette.light.appBackgroundColor to \"#FFFFFF\"\n- Always set the root SbContainer's height to Dim.fill(). Example: `<SbContainer height={Dim.fill()}>...`\n- SbModal components DO NOT need to have their own close button. The modal component comes with a close button by default.\n- Prefer \"none\" containerStyle for SbContainer components when just using them for layout purposes. Example: `<SbContainer containerStyle=\"none\">...`. If you need to have nice padding and borders because you're using it as a \"Card\" or \"Box\" type container, then use the \"card\" containerStyle.\n\n### Company specific styling guidelines\n\n- If the company \"Airwallex\" is mentioned in the user's query, use #602FFF as the background color for application heading sections. Given this color is darker, make sure the text on top of it it white\n- If the company \"Airwallex\" is mentioned in the user's query, use the Airwallex logo from https://i.imgur.com/vWgvG58.png for the application\n </ui_styling_info>\n\n<binding_info>\n\n# Binding Info\n\n- Use you use an SB binding, like SB`{{ theme.colors.primary500 }}`, you must import the SB object from the superblocks library. Example: import { SB } from '@superblocksteam/library';\n </binding_info>\n\n<interaction_design_info>\n\n# Interaction Design Guidelines\n\nThink hard about these guidelines to help you create apps with great user experiences, especially when working with interactive components like form controls, modals, etc.\n\n- When using dropdowns to filter data, unless the user asks for something different ALWAYS include an \"All\" option as the first option in the dropdown that would show all data for that field. Unless asked or there is good reason not to, this should be the default option for the dropdown\n </interaction_design_info>\n\n<mock_data_info>\nIf you're going to use mock data to fulfill a user's request, think hard about following these rules:\n\n1. For mock data, ALWAYS create a simple Superblocks API with one JavaScript step that returns the mock data instead of hardcoding it into variables, using Superblocks variables, or importing it from files. Only use alternative storage methods if the user explicitly requests it\n\nExample of using mock data:\n\nBelow is the Superblocks API you'd create to return the mock data:\n\n```ts\n// Path to this api would be: /pages/Page1/apis/getOrders.ts\n\nimport { Api, JavaScript } from \"@superblocksteam/library\";\n\nexport default new Api(\"getOrders\", [\n new JavaScript(\"returnMockOrders\", {\n fn: () => {\n return [\n {\n id: \"ORD-001\",\n customerName: \"John Smith\",\n orderDate: \"2024-01-15\",\n total: 149.99,\n status: \"Shipped\",\n },\n {\n id: \"ORD-002\",\n customerName: \"Sarah Jones\",\n orderDate: \"2024-01-14\",\n total: 89.5,\n status: \"Processing\",\n },\n {\n id: \"ORD-003\",\n customerName: \"Mike Wilson\",\n orderDate: \"2024-01-13\",\n total: 299.99,\n status: \"Delivered\",\n },\n ];\n },\n }),\n]);\n```\n\nAnd this is the registering of that API and usage of it to populate a table component:\n\n```tsx\n// /pages/Page1/index.tsx\n\nimport { SbPage, SbApi, SbTable } from \"@superblocksteam/library\";\nimport { registerPage } from \"@superblocksteam/library\";\n\nimport getOrders from \"./apis/getOrders\";\n\nconst MyPage = () => (\n <SbPage>\n <SbTable>\n // Use the API that's returning mock data to populate the table component\n {(state) => state.getOrders.response}\n </SbTable>\n </SbPage>\n);\n\nexport default registerPage(MyPage, {\n name: \"MyPage\",\n // Register the API\n getOrders: SbApi(getOrders),\n});\n```\n\n2. When using placeholder images, always use the following url format: https://placehold.co/{widthInteger}x{heightInteger}?text={urlEscapedText}\n\nExample: `https://placehold.co/600x400?text=Placeholder`\n\nUse more specific text if it's helpful, like \"Chart placeholder\".\n\n</mock_data_info>\n\n<message_formatting_info>\nYou can make the output pretty by using only the following available HTML elements: mdVar{{ALLOWED_HTML_ELEMENTS}}\n</message_formatting_info>\n\n<chain_of_thought_instructions>\nBefore providing a solution, BRIEFLY outline your implementation steps. This helps ensure systematic thinking and clear communication. Your planning should:\n\n- List concrete steps you'll take\n\n- Check if all the components you need are available in the <superblocks_components> section:\n\n 1. Prioritize the use of: SbButton, SbInput, SbCheckbox, SbContainer, SbDatePicker, SbDropdown, SbIcon, SbImage, SbModal, SbSection, SbSwitch, SbTable, SbText\n 2. IF AND ONLY IF a component cannot be created by combining these, ONLY THEN, AS A LAST RESORT use custom components.\n YOU WILL BE TERMINATED IMMEDIATELY if you create unnecessary custom components.\n\n- List Superblocks components and custom components you will be using\n- Note potential challenges\n- Be concise (2-4 lines maximum)\n\nExample responses:\n\nUser: \"Create a todo list app with local storage\"\nAssistant: \"Sure. I'll start by:\n\n1. Create TodoList and TodoItem using the components available in the Superblocks library like SbTable and SbContainer\n2. Implement localStorage for persistence\n3. Add CRUD operations\n\nLet's start now.\n\n[Rest of response...]\"\n\nUser: \"Help debug why my API calls aren't working\"\nAssistant: \"Great. My first steps will be:\n\n1. Check network requests\n2. Verify API endpoint format\n3. Examine error handling\n\n[Rest of response...]\"\n\nUser: \"Generate an app with a header, table and filters. The filters should have a numeric slider and a dropdown.\"\nAssistant: \"Sure:\n\n1. I will make a header component out of <SbContainer>, stacks, <SbText />.\n2. For the table, I will use SbTable. For filters, I will use SbDropdown.\n3. Since there is no slider component, I will create a custom component\n4. Implement filters\n\n[Rest of response...]\"\n\n</chain_of_thought_instructions>\n\n<artifact_info>\nBolt creates a SINGLE, comprehensive artifact for each project. The artifact contains all necessary steps and components, including:\n\n- Shell commands to run including dependencies to install using a package manager (NPM)\n- Files to create and their contents\n- Folders to create if necessary\n\n<artifact_instructions> 1. CRITICAL: Think HOLISTICALLY and COMPREHENSIVELY BEFORE creating an artifact. This means:\n\n - Consider ALL relevant files in the project\n - Review ALL previous file changes and user modifications (as shown in diffs, see diff_spec)\n - Analyze the entire project context and dependencies\n - Anticipate potential impacts on other parts of the system\n\n This holistic approach is ABSOLUTELY ESSENTIAL for creating coherent and effective solutions.\n\n 2. IMPORTANT: When receiving file modifications, ALWAYS use the latest file modifications and make any edits to the latest content of a file. This ensures that all changes are applied to the most up-to-date version of the file.\n\n 3. Wrap the content in opening and closing `<boltArtifact>` tags. These tags contain more specific `<boltAction>` elements.\n\n 4. Add a title for the artifact to the `title` attribute of the opening `<boltArtifact>`.\n\n 5. Add a unique identifier to the `id` attribute of the of the opening `<boltArtifact>`. For updates, reuse the prior identifier. The identifier should be descriptive and relevant to the content, using kebab-case (e.g., \"example-code-snippet\"). This identifier will be used consistently throughout the artifact's lifecycle, even when updating or iterating on the artifact.\n\n 6. Use `<boltAction>` tags to define specific actions to perform.\n\n 7. For each `<boltAction>`, add a type to the `type` attribute of the opening `<boltAction>` tag to specify the type of the action. Assign one of the following values to the `type` attribute:\n\n - shell: For running shell commands.\n\n - When Using `npx`, ALWAYS provide the `--yes` flag.\n - When running multiple shell commands, use `&&` to run them sequentially.\n - ULTRA IMPORTANT: Do NOT run a dev command with shell action use start action to run dev commands\n\n - file: For writing new files or updating existing files. For each file add a `filePath` attribute to the opening `<boltAction>` tag to specify the file path. The content of the file artifact is the file contents. All file paths MUST BE relative to the current working directory.\n\n - start: For starting a development server.\n - Use to start application if it hasn't been started yet or when NEW dependencies have been added.\n - Only use this action when you need to run a dev server or start the application\n - ULTRA IMPORTANT: do NOT re-run a dev server if files are updated. The existing dev server can automatically detect changes and executes the file changes\n\n\n 8. The order of the actions is VERY IMPORTANT. For example, if you decide to run a file it's important that the file exists in the first place and you need to create it before running a shell command that would execute the file.\n\n 9. ALWAYS install necessary dependencies FIRST before generating any other artifact. If that requires a `package.json` then you should create that first!\n\n IMPORTANT: Add all required dependencies to the `package.json` already and try to avoid `npm i <pkg>` if possible!\n\n 10. CRITICAL: Always provide the FULL, updated content of the artifact. This means:\n\n - Include ALL code, even if parts are unchanged\n - NEVER use placeholders like \"// rest of the code remains the same...\" or \"<- leave original code here ->\"\n - ALWAYS show the complete, up-to-date file contents when updating files\n - Avoid any form of truncation or summarization\n\n 11. When running a dev server NEVER say something like \"You can now view X by opening the provided local server URL in your browser. The preview will be opened automatically or by the user manually!\n\n 12. If a dev server has already been started, do not re-run the dev command when new dependencies are installed or files were updated. Assume that installing new dependencies will be executed in a different process and changes will be picked up by the dev server.\n\n 13. IMPORTANT: Use coding best practices and split functionality into smaller modules instead of putting everything in a single gigantic file. Files should be as small as possible, and functionality should be extracted into separate modules when possible.\n\n - Ensure code is clean, readable, and maintainable.\n - Adhere to proper naming conventions and consistent formatting.\n - Split functionality into smaller, reusable modules instead of placing everything in a single large file.\n - Keep files as small as possible by extracting related functionalities into separate modules.\n - Use imports to connect these modules together effectively.\n\n</artifact_instructions>\n\n<superblocks_framework>\nmdVar{{SUPERBLOCKS_PARTS}}\n\n - A project consists of one or more pages. Each page is a directory in the `pages` directory.\n - Pages are registered in the `routes.json` file.\n\n</superblocks_framework>\n</artifact_info>\n\nNEVER use the word \"artifact\". For example:\n\n- DO NOT SAY: \"This artifact sets up a simple Snake game using HTML, CSS, and JavaScript.\"\n- INSTEAD SAY: \"We set up a simple Snake game using HTML, CSS, and JavaScript.\"\n\nIMPORTANT: Use valid markdown only for all your responses and DO NOT use HTML tags except for artifacts!\n\nULTRA IMPORTANT: Do NOT be verbose and DO NOT explain anything unless the user is asking for more information. That is VERY important.\n\nULTRA IMPORTANT: Think first and reply with the artifact that contains all necessary steps to set up the project, files, shell commands to run. It is SUPER IMPORTANT to respond with this first.\n\nHere are some examples of correct usage of artifacts:\n\n<examples>\n <example>\n <user_query>create an app with a button that opens a modal</user_query>\n <assistant_response>\n Certainly! I'll create a app with a button that opens a modal.\n\n <boltArtifact id=\"modal-app\" title=\"Modal App\">\n <boltAction type=\"file\" filePath=\"package.json\">{\n\n\"name\": \"modal-app\",\n\"private\": true,\n\"sideEffects\": false,\n\"type\": \"module\",\n\"dependencies\": {\n\"@superblocksteam/library\": \"npm:@superblocksteam/library-ephemeral@mdVar{{LIBRARY_VERSION}}\",\n\n},\n\"devDependencies\": {\n\"@superblocksteam/cli\": \"npm:@superblocksteam/cli-ephemeral@mdVar{{CLI_VERSION}}\",\n\"@types/react\": \"^18.2.20\",\n\"@types/react-dom\": \"^18.2.7\",\n\"typescript\": \"^5.1.6\"\n},\n}</boltAction>\n<boltAction type=\"file\" filePath=\"pages/App.tsx\">...</boltAction>\n<boltAction type=\"file\" filePath=\"pages/app.css\">...</boltAction>\n<boltAction type=\"file\" filePath=\"pages/appTheme.ts\">...</boltAction>\n<boltAction type=\"file\" filePath=\"pages/root.tsx\">...</boltAction>\n<boltAction type=\"file\" filePath=\"pages/Page1/index.tsx\">...</boltAction>\n<boltAction type=\"file\" filePath=\"routes.json\">...</boltAction>\n<boltAction type=\"file\" filePath=\"tsconfig.json\">...</boltAction>\n</boltArtifact>\n\n You can now view the modal app in the preview. The button will open the modal when clicked.\n </assistant_response>\n\n </example>\n</examples>\n";
|
|
6
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../../../../src/ai-service/prompts/generated/subprompts/system.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,gCAAgC;AAChC,iCAAiC;AACjC,yCAAyC;AAEzC,MAAM,CAAC,MAAM,OAAO,GAAG,40lBAA40lB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads a subprompt by name and replaces variables
|
|
3
|
+
*/
|
|
4
|
+
export declare function loadSubprompt(name: string, variables?: Record<string, string>): string;
|
|
5
|
+
/**
|
|
6
|
+
* Loads a library component documentation by name
|
|
7
|
+
*/
|
|
8
|
+
export declare function loadLibraryComponent(name: string): string;
|
|
9
|
+
//# sourceMappingURL=markdown-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-loader.d.ts","sourceRoot":"","sources":["../../../src/ai-service/prompts/markdown-loader.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACrC,MAAM,CAgCR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYzD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Import generated markdown modules
|
|
2
|
+
// Note: These imports will be available after running the generate script
|
|
3
|
+
let generated = {};
|
|
4
|
+
try {
|
|
5
|
+
// Dynamic import to handle cases where generated files don't exist yet
|
|
6
|
+
generated = await import("../prompts/generated/index.js");
|
|
7
|
+
}
|
|
8
|
+
catch (_error) {
|
|
9
|
+
console.warn("Generated markdown modules not found. Run `pnpm generate:markdown` first.");
|
|
10
|
+
}
|
|
11
|
+
// Cache for processed content to avoid repeated variable replacement
|
|
12
|
+
const processedCache = new Map();
|
|
13
|
+
/**
|
|
14
|
+
* Loads a subprompt by name and replaces variables
|
|
15
|
+
*/
|
|
16
|
+
export function loadSubprompt(name, variables = {}) {
|
|
17
|
+
const cacheKey = JSON.stringify(variables);
|
|
18
|
+
if (!processedCache.has(name)) {
|
|
19
|
+
processedCache.set(name, new Map());
|
|
20
|
+
}
|
|
21
|
+
const nameCache = processedCache.get(name);
|
|
22
|
+
if (nameCache.has(cacheKey)) {
|
|
23
|
+
return nameCache.get(cacheKey);
|
|
24
|
+
}
|
|
25
|
+
// Get content from generated modules
|
|
26
|
+
let content = "";
|
|
27
|
+
try {
|
|
28
|
+
content = generated.subprompts?.[name] || "";
|
|
29
|
+
}
|
|
30
|
+
catch (_error) {
|
|
31
|
+
console.warn(`Could not load subprompt: ${name}`);
|
|
32
|
+
}
|
|
33
|
+
// Replace variables in the content
|
|
34
|
+
let processedContent = content;
|
|
35
|
+
Object.entries(variables).forEach(([key, value]) => {
|
|
36
|
+
processedContent = processedContent.replace(new RegExp(`mdVar{{${key}}}`, "g"), value);
|
|
37
|
+
});
|
|
38
|
+
nameCache.set(cacheKey, processedContent);
|
|
39
|
+
return processedContent;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Loads a library component documentation by name
|
|
43
|
+
*/
|
|
44
|
+
export function loadLibraryComponent(name) {
|
|
45
|
+
// Convert component name to the actual file name pattern
|
|
46
|
+
const fileName = `Sb${name}PropsDocs`;
|
|
47
|
+
try {
|
|
48
|
+
return generated.library_components?.[fileName] || "";
|
|
49
|
+
}
|
|
50
|
+
catch (_error) {
|
|
51
|
+
console.warn(`Could not load library component: ${name}, using file name: ${fileName}`);
|
|
52
|
+
return "";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=markdown-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-loader.js","sourceRoot":"","sources":["../../../src/ai-service/prompts/markdown-loader.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,0EAA0E;AAC1E,IAAI,SAAS,GAAQ,EAAE,CAAC;AAExB,IAAI,CAAC;IACH,uEAAuE;IACvE,SAAS,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAC5D,CAAC;AAAC,OAAO,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,IAAI,CACV,2EAA2E,CAC5E,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,MAAM,cAAc,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE9D;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAY,EACZ,YAAoC,EAAE;IAEtC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAE3C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;IAE5C,IAAI,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,OAAO,SAAS,CAA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,cAe3B,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { loadSubprompt, loadLibraryComponent } from "./markdown-loader.js";
|
|
2
|
+
// List of components with their documentation
|
|
3
|
+
const components = [
|
|
4
|
+
{ name: "Button", content: loadLibraryComponent("Button") },
|
|
5
|
+
{ name: "Checkbox", content: loadLibraryComponent("Checkbox") },
|
|
6
|
+
{ name: "Container", content: loadLibraryComponent("Container") },
|
|
7
|
+
{ name: "Text", content: loadLibraryComponent("Text") },
|
|
8
|
+
{ name: "Dropdown", content: loadLibraryComponent("Dropdown") },
|
|
9
|
+
{ name: "Switch", content: loadLibraryComponent("Switch") },
|
|
10
|
+
{ name: "Input", content: loadLibraryComponent("Input") },
|
|
11
|
+
{ name: "Image", content: loadLibraryComponent("Image") },
|
|
12
|
+
{ name: "Icon", content: loadLibraryComponent("Icon") },
|
|
13
|
+
{ name: "DatePicker", content: loadLibraryComponent("DatePicker") },
|
|
14
|
+
{ name: "Page", content: loadLibraryComponent("Page") },
|
|
15
|
+
{ name: "Table", content: loadLibraryComponent("Table") },
|
|
16
|
+
{ name: "Modal", content: loadLibraryComponent("Modal") },
|
|
17
|
+
{ name: "KeyValue", content: loadLibraryComponent("KeyValue") },
|
|
18
|
+
{ name: "Slideout", content: loadLibraryComponent("Slideout") },
|
|
19
|
+
];
|
|
20
|
+
const superblocksParts = [
|
|
21
|
+
{ name: "superblocks_page", content: loadSubprompt("superblocks-page") },
|
|
22
|
+
{ name: "superblocks_routes", content: loadSubprompt("superblocks-routes") },
|
|
23
|
+
// Component rules and typedefs
|
|
24
|
+
{
|
|
25
|
+
name: "superblocks_components_rules",
|
|
26
|
+
content: loadSubprompt("superblocks-components-rules"),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "superblocks_event_flow_typedefs",
|
|
30
|
+
content: loadSubprompt("library-typedefs/SbEventFlow"),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "superblocks_dim_typedefs",
|
|
34
|
+
content: loadSubprompt("library-typedefs/Dim"),
|
|
35
|
+
},
|
|
36
|
+
// Map through component names to create entries
|
|
37
|
+
...components.map(({ name, content }) => ({
|
|
38
|
+
name: `superblocks_component_${name.toLowerCase()}`,
|
|
39
|
+
content,
|
|
40
|
+
})),
|
|
41
|
+
// Other parts
|
|
42
|
+
{
|
|
43
|
+
name: "superblocks_custom_components",
|
|
44
|
+
content: loadSubprompt("superblocks-custom-components"),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "superblocks_layouts",
|
|
48
|
+
content: loadSubprompt("superblocks-layouts"),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "superblocks_state",
|
|
52
|
+
content: loadSubprompt("superblocks-state"),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "superblocks_timers",
|
|
56
|
+
content: loadSubprompt("superblocks-timers"),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "superblocks_api",
|
|
60
|
+
content: loadSubprompt("superblocks-api"),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "superblocks_event_flow",
|
|
64
|
+
content: loadSubprompt("superblocks-event-flow"),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "superblocks_theming",
|
|
68
|
+
content: loadSubprompt("superblocks-theming"),
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
const wrapWithTags = (name, content, tab = 2) => {
|
|
72
|
+
return `
|
|
73
|
+
<${name}>
|
|
74
|
+
${" ".repeat(tab)}${content.replace(/\n/g, `\n${" ".repeat(tab)}`)}
|
|
75
|
+
</${name}>`.trim();
|
|
76
|
+
};
|
|
77
|
+
const LIBRARY_VERSION = "2.0.0-SNAPSHOT.1747073970";
|
|
78
|
+
const CLI_VERSION = LIBRARY_VERSION;
|
|
79
|
+
const allowedHTMLElements = [
|
|
80
|
+
"a",
|
|
81
|
+
"b",
|
|
82
|
+
"blockquote",
|
|
83
|
+
"br",
|
|
84
|
+
"code",
|
|
85
|
+
"dd",
|
|
86
|
+
"del",
|
|
87
|
+
"details",
|
|
88
|
+
"div",
|
|
89
|
+
"dl",
|
|
90
|
+
"dt",
|
|
91
|
+
"em",
|
|
92
|
+
"h1",
|
|
93
|
+
"h2",
|
|
94
|
+
"h3",
|
|
95
|
+
"h4",
|
|
96
|
+
"h5",
|
|
97
|
+
"h6",
|
|
98
|
+
"hr",
|
|
99
|
+
"i",
|
|
100
|
+
"ins",
|
|
101
|
+
"kbd",
|
|
102
|
+
"li",
|
|
103
|
+
"ol",
|
|
104
|
+
"p",
|
|
105
|
+
"pre",
|
|
106
|
+
"q",
|
|
107
|
+
"rp",
|
|
108
|
+
"rt",
|
|
109
|
+
"ruby",
|
|
110
|
+
"s",
|
|
111
|
+
"samp",
|
|
112
|
+
"source",
|
|
113
|
+
"span",
|
|
114
|
+
"strike",
|
|
115
|
+
"strong",
|
|
116
|
+
"sub",
|
|
117
|
+
"summary",
|
|
118
|
+
"sup",
|
|
119
|
+
"table",
|
|
120
|
+
"tbody",
|
|
121
|
+
"td",
|
|
122
|
+
"tfoot",
|
|
123
|
+
"th",
|
|
124
|
+
"thead",
|
|
125
|
+
"tr",
|
|
126
|
+
"ul",
|
|
127
|
+
"var",
|
|
128
|
+
"think",
|
|
129
|
+
];
|
|
130
|
+
export const getStaticPrompt = () => {
|
|
131
|
+
// Load the main system prompt from the markdown file in the subprompts folder
|
|
132
|
+
const systemPromptContent = loadSubprompt("system", {
|
|
133
|
+
LIBRARY_VERSION,
|
|
134
|
+
CLI_VERSION,
|
|
135
|
+
ALLOWED_HTML_ELEMENTS: allowedHTMLElements
|
|
136
|
+
.map((tagName) => `<${tagName}>`)
|
|
137
|
+
.join(", "),
|
|
138
|
+
SUPERBLOCKS_PARTS: superblocksParts
|
|
139
|
+
.map((part) => wrapWithTags(part.name, part.content))
|
|
140
|
+
.join("\n"),
|
|
141
|
+
});
|
|
142
|
+
// Return the system prompt content
|
|
143
|
+
return systemPromptContent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AAO;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,8EAA8E;IAC9E,MAAM,mBAAmB,GAAG,aAAa,CAAC,QAAQ,EAAE;QAClD,eAAe;QACf,WAAW;QACX,qBAAqB,EAAE,mBAAmB;aACvC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,OAAO,GAAG,CAAC;aAChC,IAAI,CAAC,IAAI,CAAC;QACb,iBAAiB,EAAE,gBAAgB;aAChC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;aACpD,IAAI,CAAC,IAAI,CAAC;KACd,CAAC,CAAC;IAEH,mCAAmC;IACnC,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ResultBuffer } from "./shared.js";
|
|
2
|
+
export declare enum BoltResultType {
|
|
3
|
+
Text = "text",
|
|
4
|
+
Artifact = "artifact",
|
|
5
|
+
Think = "think"
|
|
6
|
+
}
|
|
7
|
+
export declare class BoltResultBuffer extends ResultBuffer<BoltResultType> {
|
|
8
|
+
private buffer;
|
|
9
|
+
private currentType;
|
|
10
|
+
add(text: string): void;
|
|
11
|
+
maybeFlush(force?: boolean): void;
|
|
12
|
+
private removeTrailingTags;
|
|
13
|
+
private shouldFlush;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=bolt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bolt.d.ts","sourceRoot":"","sources":["../../../src/ai-service/result-buffer/bolt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB;AAED,qBAAa,gBAAiB,SAAQ,YAAY,CAAC,cAAc,CAAC;IAChE,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,WAAW,CAAuC;IAE1D,GAAG,CAAC,IAAI,EAAE,MAAM;IA0ChB,UAAU,CAAC,KAAK,UAAQ;IASxB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,WAAW;CAWpB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ResultBuffer } from "./shared.js";
|
|
2
|
+
export var BoltResultType;
|
|
3
|
+
(function (BoltResultType) {
|
|
4
|
+
BoltResultType["Text"] = "text";
|
|
5
|
+
BoltResultType["Artifact"] = "artifact";
|
|
6
|
+
BoltResultType["Think"] = "think";
|
|
7
|
+
})(BoltResultType || (BoltResultType = {}));
|
|
8
|
+
export class BoltResultBuffer extends ResultBuffer {
|
|
9
|
+
buffer = "";
|
|
10
|
+
currentType = BoltResultType.Text;
|
|
11
|
+
add(text) {
|
|
12
|
+
let type = this.currentType;
|
|
13
|
+
if (text.trimStart().startsWith("<boltArtifact")) {
|
|
14
|
+
type = BoltResultType.Artifact;
|
|
15
|
+
}
|
|
16
|
+
else if (text.trimStart().startsWith("<think>")) {
|
|
17
|
+
text = text.replace("<think>", "").trimStart();
|
|
18
|
+
type = BoltResultType.Think;
|
|
19
|
+
}
|
|
20
|
+
if (this.buffer && type !== this.currentType) {
|
|
21
|
+
this.maybeFlush(true);
|
|
22
|
+
this.currentType = type;
|
|
23
|
+
this.add(text);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (text.includes("</boltArtifact>")) {
|
|
27
|
+
const [lhs, rhs] = text.split("</boltArtifact>");
|
|
28
|
+
this.buffer += lhs + "</boltArtifact>";
|
|
29
|
+
this.maybeFlush(true);
|
|
30
|
+
if (rhs) {
|
|
31
|
+
this.add(rhs);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (text.includes("</think>")) {
|
|
36
|
+
const [lhs, rhs] = text.split("</think>");
|
|
37
|
+
this.buffer += lhs;
|
|
38
|
+
this.maybeFlush(true);
|
|
39
|
+
if (rhs) {
|
|
40
|
+
this.add(rhs);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (!this.buffer) {
|
|
45
|
+
this.params.onPending(type);
|
|
46
|
+
}
|
|
47
|
+
this.buffer += text;
|
|
48
|
+
this.currentType = type;
|
|
49
|
+
}
|
|
50
|
+
maybeFlush(force = false) {
|
|
51
|
+
if (this.buffer && (force || this.shouldFlush())) {
|
|
52
|
+
this.removeTrailingTags();
|
|
53
|
+
this.params.onFlush(this.currentType, this.buffer);
|
|
54
|
+
this.buffer = "";
|
|
55
|
+
this.currentType = BoltResultType.Text;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
removeTrailingTags() {
|
|
59
|
+
this.buffer = this.buffer.replace(/<\/think>$/, "");
|
|
60
|
+
}
|
|
61
|
+
shouldFlush() {
|
|
62
|
+
switch (this.currentType) {
|
|
63
|
+
case BoltResultType.Text:
|
|
64
|
+
// match sentence end-like punctuation
|
|
65
|
+
return /[a-zA-Z][.!?][\s\n]?$/.test(this.buffer);
|
|
66
|
+
case BoltResultType.Artifact:
|
|
67
|
+
return this.buffer.trimEnd().endsWith("</boltArtifact>");
|
|
68
|
+
case BoltResultType.Think:
|
|
69
|
+
return this.buffer.trimEnd().endsWith("</think>");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=bolt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bolt.js","sourceRoot":"","sources":["../../../src/ai-service/result-buffer/bolt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,iCAAe,CAAA;AACjB,CAAC,EAJW,cAAc,KAAd,cAA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AI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;YAC3D,KAAK,cAAc,CAAC,KAAK;gBACvB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare abstract class ResultBuffer<T> {
|
|
2
|
+
protected readonly params: {
|
|
3
|
+
onFlush: (type: T, text: string) => void;
|
|
4
|
+
onPending: (type: T) => void;
|
|
5
|
+
};
|
|
6
|
+
constructor(params: {
|
|
7
|
+
onFlush: (type: T, text: string) => void;
|
|
8
|
+
onPending: (type: T) => void;
|
|
9
|
+
});
|
|
10
|
+
abstract add(text: string): void;
|
|
11
|
+
abstract maybeFlush(force?: boolean): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/ai-service/result-buffer/shared.ts"],"names":[],"mappings":"AAAA,8BAAsB,YAAY,CAAC,CAAC;IAEhC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;QACzB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QACzC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;KAC9B;gBAHkB,MAAM,EAAE;QACzB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QACzC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;KAC9B;IAEH,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAChC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/ai-service/result-buffer/shared.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,YAAY;IAEX;IADrB,YACqB,MAGlB;QAHkB,WAAM,GAAN,MAAM,CAGxB;IACA,CAAC;CAGL"}
|