@superblocksteam/vite-plugin-file-sync 2.0.17 → 2.0.18-next.0
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/dist/ai-service/evals/helpers/eval-scoring.d.ts.map +1 -1
- package/dist/ai-service/evals/helpers/eval-scoring.js +2 -3
- package/dist/ai-service/evals/helpers/eval-scoring.js.map +1 -1
- package/dist/ai-service/evals/helpers/index.d.ts +2 -0
- package/dist/ai-service/evals/helpers/index.d.ts.map +1 -1
- package/dist/ai-service/evals/helpers/index.js +47 -23
- package/dist/ai-service/evals/helpers/index.js.map +1 -1
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +6 -1
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ButtonPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/CheckboxPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ColumnPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ContainerPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/DatePickerPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/DropdownPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/IconPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ImagePropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/InputPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ModalPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/PagePropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SectionPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SlideoutPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SwitchPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/TablePropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/TextPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/Dim.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/EventFlow.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/TextStyleWithVariant.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/full-examples.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-api.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-components-rules.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-custom-components.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-data-filtering.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-event-flow.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-forms.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-layouts.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-page.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-rbac.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-routes.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-state.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-theming.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/system-base.js +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +1 -0
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.js +1 -0
- package/dist/ai-service/state-machine/handlers/idle.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +12 -18
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/test-utils/anthropic-service-mock.d.ts +2 -0
- package/dist/ai-service/test-utils/anthropic-service-mock.d.ts.map +1 -0
- package/dist/ai-service/test-utils/anthropic-service-mock.js +76 -0
- package/dist/ai-service/test-utils/anthropic-service-mock.js.map +1 -0
- package/dist/ai-service/test-utils/app-generation-mocks/orders-app.d.ts +1 -1
- package/dist/ai-service/test-utils/app-generation-mocks/orders-app.js +8 -8
- package/dist/ai-service/test-utils/app-generation-mocks/reprompt.d.ts +3 -0
- package/dist/ai-service/test-utils/app-generation-mocks/reprompt.d.ts.map +1 -0
- package/dist/ai-service/test-utils/app-generation-mocks/reprompt.js +70 -0
- package/dist/ai-service/test-utils/app-generation-mocks/reprompt.js.map +1 -0
- package/dist/ai-service/test-utils/mock-utils.d.ts +10 -20
- package/dist/ai-service/test-utils/mock-utils.d.ts.map +1 -1
- package/dist/ai-service/test-utils/mock-utils.js +58 -34
- package/dist/ai-service/test-utils/mock-utils.js.map +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +11 -5
- package/dist/codegen.js.map +1 -1
- package/dist/lock-service/index.js +1 -1
- package/dist/lock-service/index.js.map +1 -1
- package/dist/parsing/util.d.ts +1 -1
- package/dist/parsing/util.d.ts.map +1 -1
- package/dist/parsing/util.js +28 -15
- package/dist/parsing/util.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "BUILDING APPLICATION FROM MOCK RESPONSE: I'll create a comprehensive order management app with CRUD operations using the DemoOrders and DemoShipping databases.\n\n<boltArtifact id=\"order-management-app\" title=\"Order Management App\">\n<boltAction type=\"file\" filePath=\"routes.json\">\n{\n \"/\": {\n \"file\": \"Page1/index.tsx\"\n }\n}\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/scope.ts\">\nimport {\n createScope,\n SbApi,\n StateVar,\n StateVarPersistence,\n computed,\n} from \"@superblocksteam/library\";\n\nexport const Page1Scope = createScope<{\n OrdersTable: any;\n ProductFilterInput: any;\n CreateOrderModal: any;\n EditOrderModal: any;\n OrderDetailsModal: any;\n CreateOrderButton: any;\n NewOrderProductInput: any;\n NewOrderUserEmailInput: any;\n NewOrderPriceInput: any;\n NewOrderImageInput: any;\n EditOrderProductInput: any;\n EditOrderUserEmailInput: any;\n EditOrderPriceInput: any;\n EditOrderImageInput: any;\n}>(\n ({\n entities: {\n OrdersTable,\n ProductFilterInput,\n getMetricsApi,\n getOrdersApi,\n getOrderDetailsApi,\n getShippingInfoApi,\n createOrderApi,\n updateOrderApi,\n deleteOrderApi,\n NewOrderProductInput,\n NewOrderUserEmailInput,\n NewOrderPriceInput,\n NewOrderImageInput,\n EditOrderProductInput,\n EditOrderUserEmailInput,\n EditOrderPriceInput,\n EditOrderImageInput,\n },\n }) => ({\n getMetricsApi: SbApi({}),\n getOrdersApi: SbApi({}),\n getOrderDetailsApi: SbApi({}),\n getShippingInfoApi: SbApi({}),\n createOrderApi: SbApi({}),\n updateOrderApi: SbApi({}),\n deleteOrderApi: SbApi({}),\n \n filteredOrdersVar: StateVar({\n defaultValue: computed(() => {\n const orders = getOrdersApi.response || [];\n const filterText = ProductFilterInput.value?.toLowerCase() || '';\n \n if (!filterText) return orders;\n \n return orders.filter((order: any) =>\n order.product?.toLowerCase().includes(filterText)\n );\n }),\n persistence: StateVarPersistence.TEMPORARY,\n }),\n }),\n {\n name: \"Page1\",\n }\n);\n\nexport const Page1 = Page1Scope.entities;\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/index.tsx\">\nimport {\n Page,\n Dim,\n Section,\n Column,\n registerPage,\n Table,\n computed,\n Container,\n Input,\n Button,\n EventFlow,\n Modal,\n Text,\n Theme,\n} from \"@superblocksteam/library\";\nimport MetricCard from \"components/MetricCard/MetricCard\";\nimport AppHeader from \"components/AppHeader/AppHeader\";\nimport KeyValue from \"components/KeyValue\";\nimport { Page1, Page1Scope } from \"./scope\";\n\nfunction PageContent() {\n const {\n OrdersTable,\n ProductFilterInput,\n CreateOrderModal,\n EditOrderModal,\n CreateOrderButton,\n OrderDetailsModal,\n NewOrderProductInput,\n NewOrderUserEmailInput,\n NewOrderPriceInput,\n NewOrderImageInput,\n EditOrderProductInput,\n EditOrderUserEmailInput,\n EditOrderPriceInput,\n EditOrderImageInput,\n getMetricsApi,\n getOrdersApi,\n getOrderDetailsApi,\n getShippingInfoApi,\n createOrderApi,\n updateOrderApi,\n deleteOrderApi,\n filteredOrdersVar,\n } = Page1;\n\n return (\n <Page\n name=\"Page1\"\n height={Dim.fill()}\n width={Dim.fill()}\n onLoad={EventFlow.runApis([getMetricsApi, getOrdersApi])}\n >\n <Section height={Dim.fill()}>\n <Column width={Dim.fill()} spacing={Dim.px(0)}>\n <AppHeader\n title=\"Order Management\"\n avatarUrl=\"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=40&h=40&fit=crop&crop=face\"\n userEmail=\"admin@company.com\"\n height={Dim.fit()}\n />\n \n <Container\n layout=\"vertical\"\n spacing={Dim.px(24)}\n padding={{\n top: Dim.px(24),\n bottom: Dim.px(24),\n left: Dim.px(24),\n right: Dim.px(24),\n }}\n height={Dim.fill()}\n >\n {/* Metrics Cards */}\n <Container layout=\"horizontal\" spacing={Dim.px(16)}>\n <MetricCard\n title=\"Total Orders\"\n value={computed(() => getMetricsApi.response?.totalOrders?.toString() || \"0\")}\n icon=\"receipt_long\"\n width={Dim.fill()}\n />\n <MetricCard\n title=\"Total Revenue\"\n value={computed(() => `$${getMetricsApi.response?.totalRevenue?.toLocaleString() || \"0\"}`)}\n icon=\"attach_money\"\n width={Dim.fill()}\n />\n <MetricCard\n title=\"Orders This Month\"\n value={computed(() => getMetricsApi.response?.ordersThisMonth?.toString() || \"0\")}\n icon=\"calendar_today\"\n width={Dim.fill()}\n />\n <MetricCard\n title=\"Active Shipments\"\n value={computed(() => getMetricsApi.response?.activeShipments?.toString() || \"0\")}\n icon=\"local_shipping\"\n width={Dim.fill()}\n />\n </Container>\n\n {/* Orders Section */}\n <Container layout=\"vertical\" spacing={Dim.px(16)} variant=\"card\">\n <Container layout=\"horizontal\" spacing={Dim.px(12)} verticalAlign=\"bottom\">\n <Input\n bind={ProductFilterInput}\n label=\"Filter by Product\"\n placeholder=\"Search products...\"\n width={Dim.px(300)}\n />\n <Button\n bind={CreateOrderButton}\n label=\"Create Order\"\n variant=\"primary\"\n icon=\"add\"\n onClick={EventFlow.controlModal(CreateOrderModal, \"open\")}\n />\n </Container>\n\n <Table\n bind={OrdersTable}\n tableData={computed(() => filteredOrdersVar.value)}\n columns={{\n id: {\n label: \"Order ID\",\n columnType: \"text\",\n },\n product: {\n label: \"Product\",\n columnType: \"text\",\n },\n user_email: {\n label: \"Customer Email\",\n columnType: \"email\",\n },\n date_purchased: {\n label: \"Date Purchased\",\n columnType: \"date\",\n inputFormat: \"YYYY-MM-DD\",\n outputFormat: \"MM/DD/YYYY\",\n },\n price: {\n label: \"Price\",\n columnType: \"currency\",\n currency: \"USD\",\n },\n actions: {\n label: \"Actions\",\n columnType: \"button\",\n buttonLabel: \"View Details\",\n onClick: EventFlow.runJS(() => {\n getOrderDetailsApi.run();\n getShippingInfoApi.run();\n }).controlModal(OrderDetailsModal, \"open\"),\n },\n }}\n onRowClick={EventFlow.runJS(() => {\n EditOrderProductInput.text = OrdersTable.selectedRow?.product || \"\";\n EditOrderUserEmailInput.text = OrdersTable.selectedRow?.user_email || \"\";\n EditOrderPriceInput.text = OrdersTable.selectedRow?.price?.toString() || \"\";\n EditOrderImageInput.text = OrdersTable.selectedRow?.image || \"\";\n }).controlModal(EditOrderModal, \"open\")}\n height={Dim.px(400)}\n />\n </Container>\n </Container>\n </Column>\n </Section>\n\n {/* Create Order Modal */}\n <Modal bind={CreateOrderModal}>\n <Container layout=\"vertical\" spacing={Dim.px(24)} width={Dim.fill()}>\n <Text text=\"Create New Order\" textStyle={{ variant: \"heading3\" }} />\n \n <Container layout=\"vertical\" spacing={Dim.px(16)} width={Dim.fill()}>\n <Input\n bind={NewOrderProductInput}\n label=\"Product Name\"\n placeholder=\"Enter product name\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={NewOrderUserEmailInput}\n label=\"Customer Email\"\n placeholder=\"Enter customer email\"\n inputType=\"EMAIL\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={NewOrderPriceInput}\n label=\"Price\"\n placeholder=\"Enter price\"\n inputType=\"NUMBER\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={NewOrderImageInput}\n label=\"Product Image URL\"\n placeholder=\"Enter image URL (optional)\"\n width={Dim.fill()}\n />\n </Container>\n\n <Container layout=\"horizontal\" spacing={Dim.px(12)} horizontalAlign=\"right\" width={Dim.fill()}>\n <Button\n label=\"Cancel\"\n variant=\"secondary\"\n onClick={EventFlow.runJS(() => {\n NewOrderProductInput.text = \"\";\n NewOrderUserEmailInput.text = \"\";\n NewOrderPriceInput.text = \"\";\n NewOrderImageInput.text = \"\";\n }).controlModal(CreateOrderModal, \"close\")}\n />\n <Button\n label=\"Create Order\"\n variant=\"primary\"\n onClick={EventFlow.runApis([createOrderApi])\n .runApis([getMetricsApi, getOrdersApi])\n .runJS(() => {\n NewOrderProductInput.text = \"\";\n NewOrderUserEmailInput.text = \"\";\n NewOrderPriceInput.text = \"\";\n NewOrderImageInput.text = \"\";\n })\n .controlModal(CreateOrderModal, \"close\")}\n />\n </Container>\n </Container>\n </Modal>\n\n {/* Edit Order Modal */}\n <Modal bind={EditOrderModal}>\n <Container layout=\"vertical\" spacing={Dim.px(24)} width={Dim.fill()}>\n <Container layout=\"horizontal\" spacing={Dim.px(12)} horizontalAlign=\"space-between\" width={Dim.fill()}>\n <Text \n width={Dim.fit()}\n text={computed(() => `Edit Order #${OrdersTable.selectedRow?.id || \"\"}`)} \n textStyle={{ variant: \"heading3\" }} \n />\n </Container>\n \n <Container layout=\"vertical\" spacing={Dim.px(16)} width={Dim.fill()}>\n <Input\n bind={EditOrderProductInput}\n label=\"Product Name\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={EditOrderUserEmailInput}\n label=\"Customer Email\"\n inputType=\"EMAIL\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={EditOrderPriceInput}\n label=\"Price\"\n inputType=\"NUMBER\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={EditOrderImageInput}\n label=\"Product Image URL\"\n width={Dim.fill()}\n />\n </Container>\n\n <Container layout=\"horizontal\" spacing={Dim.px(12)} horizontalAlign=\"right\" width={Dim.fill()}>\n <Button\n label=\"Cancel\"\n variant=\"secondary\"\n onClick={EventFlow.controlModal(EditOrderModal, \"close\")}\n />\n <Button\n label=\"Update Order\"\n variant=\"primary\"\n onClick={EventFlow.runApis([updateOrderApi])\n .runApis([getMetricsApi, getOrdersApi])\n .controlModal(EditOrderModal, \"close\")}\n />\n </Container>\n </Container>\n </Modal>\n\n {/* Order Details Modal */}\n <Modal bind={OrderDetailsModal}>\n <Container layout=\"vertical\" spacing={Dim.px(24)} width={Dim.fill()}>\n <Text \n text={computed(() => `Order Details #${OrdersTable.selectedRow?.id || \"\"}`)} \n textStyle={{ variant: \"heading3\" }} \n />\n \n <Container layout=\"horizontal\" spacing={Dim.px(24)} width={Dim.fill()}>\n <Container layout=\"vertical\" spacing={Dim.px(16)} width={Dim.fill()}>\n <KeyValue\n label=\"Order Information\"\n data={computed(() => getOrderDetailsApi.response || {})}\n />\n </Container>\n \n <Container layout=\"vertical\" spacing={Dim.px(16)} width={Dim.fill()}>\n <KeyValue\n label=\"Shipping Information\"\n data={computed(() => getShippingInfoApi.response || {})}\n />\n </Container>\n </Container>\n\n <Container layout=\"horizontal\" spacing={Dim.px(12)} horizontalAlign=\"right\" width={Dim.fill()}>\n <Button\n label=\"Close\"\n variant=\"secondary\"\n onClick={EventFlow.controlModal(OrderDetailsModal, \"close\")}\n />\n </Container>\n </Container>\n </Modal>\n </Page>\n );\n}\n\nexport default registerPage(PageContent, Page1Scope);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/getMetricsApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"getMetricsApi\", [\n new JavaScript(\"getMetrics\", {\n fn: () => {\n return {\n totalOrders: 45,\n totalRevenue: 12489.50,\n ordersThisMonth: 8,\n activeShipments: 12,\n };\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/getOrdersApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"getOrdersApi\", [\n new JavaScript(\"getOrders\", {\n fn: () => {\n return [\n {\n id: 1,\n product: \"Wireless Headphones\",\n user_email: \"john.doe@example.com\",\n date_purchased: \"2024-01-15\",\n price: 199.99,\n image: \"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=200&h=200&fit=crop\",\n },\n {\n id: 2,\n product: \"Smart Watch\",\n user_email: \"jane.smith@example.com\",\n date_purchased: \"2024-01-14\",\n price: 299.99,\n image: \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=200&h=200&fit=crop\",\n },\n {\n id: 3,\n product: \"Laptop Stand\",\n user_email: \"mike.johnson@example.com\",\n date_purchased: \"2024-01-13\",\n price: 49.99,\n image: \"https://images.unsplash.com/photo-1527864550417-7fd91fc51a46?w=200&h=200&fit=crop\",\n },\n {\n id: 4,\n product: \"Bluetooth Speaker\",\n user_email: \"sarah.wilson@example.com\",\n date_purchased: \"2024-01-12\",\n price: 79.99,\n image: \"https://images.unsplash.com/photo-1608043152269-423dbba4e7e1?w=200&h=200&fit=crop\",\n },\n {\n id: 5,\n product: \"Gaming Mouse\",\n user_email: \"alex.brown@example.com\",\n date_purchased: \"2024-01-11\",\n price: 89.99,\n image: \"https://images.unsplash.com/photo-1527814050087-3793815479db?w=200&h=200&fit=crop\",\n },\n {\n id: 6,\n product: \"USB-C Hub\",\n user_email: \"emily.davis@example.com\",\n date_purchased: \"2024-01-10\",\n price: 39.99,\n image: \"https://images.unsplash.com/photo-1558618047-3c8c76ca7d13?w=200&h=200&fit=crop\",\n },\n {\n id: 7,\n product: \"Phone Case\",\n user_email: \"david.miller@example.com\",\n date_purchased: \"2024-01-09\",\n price: 24.99,\n image: \"https://images.unsplash.com/photo-1601944177325-f8867652837f?w=200&h=200&fit=crop\",\n },\n {\n id: 8,\n product: \"Tablet Stand\",\n user_email: \"lisa.garcia@example.com\",\n date_purchased: \"2024-01-08\",\n price: 34.99,\n image: \"https://images.unsplash.com/photo-1544244015-0df4b3ffc6b0?w=200&h=200&fit=crop\",\n },\n ];\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/getOrderDetailsApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"getOrderDetailsApi\", [\n new JavaScript(\"getOrderDetails\", {\n fn: ({ OrdersTable }) => {\n const order = OrdersTable.selectedRow;\n if (!order) return {};\n \n // Generate a user_id if not present (for display purposes)\n const userId = order.user_id || Math.floor(Math.random() * 10000) + 1000;\n \n return {\n \"Order ID\": order.id,\n \"Product\": order.product,\n \"Customer Email\": order.user_email,\n \"User ID\": userId,\n \"Date Purchased\": order.date_purchased,\n \"Price\": `$${order.price}`,\n \"Image URL\": order.image || \"N/A\",\n };\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/getShippingInfoApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"getShippingInfoApi\", [\n new JavaScript(\"getShippingInfo\", {\n fn: ({ OrdersTable }) => {\n const order = OrdersTable.selectedRow;\n if (!order) return { \"Shipping Status\": \"No shipping info\" };\n \n const orderId = order.id;\n \n // Generate shipping data based on order ID patterns\n const shippingStatuses = [\"Processing\", \"In Transit\", \"Delivered\", \"Out for Delivery\"];\n const locations = [\"Los Angeles, CA\", \"Phoenix, AZ\", \"Denver, CO\", \"Chicago, IL\", \"Miami, FL\"];\n const activities = [\"Order received\", \"Package shipped\", \"In transit\", \"Out for delivery\", \"Delivered\"];\n \n const statusIndex = orderId % shippingStatuses.length;\n const status = shippingStatuses[statusIndex];\n \n // Generate 2-3 shipping activities\n const numActivities = 2 + (orderId % 2);\n const history = [];\n \n for (let i = 0; i < numActivities; i++) {\n const date = new Date();\n date.setDate(date.getDate() - (numActivities - i));\n const timestamp = date.toISOString().replace('T', ' ').substring(0, 19);\n \n history.push({\n TIMESTAMP: timestamp,\n ACTIVITY: activities[i % activities.length],\n LOCATION: locations[i % locations.length],\n });\n }\n \n const result = {\n \"Shipping Status\": status,\n };\n \n history.forEach((item, index) => {\n result[`Activity ${index + 1}`] = `${item.ACTIVITY} - ${item.LOCATION} (${item.TIMESTAMP})`;\n });\n \n return result;\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/createOrderApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"createOrderApi\", [\n new Conditional(\"validateInputs\", {\n if: {\n when: ({ NewOrderProductInput, NewOrderUserEmailInput, NewOrderPriceInput }) =>\n !NewOrderProductInput.value || \n !NewOrderUserEmailInput.value || \n !NewOrderPriceInput.value,\n then: [\n new Throw(\"validation_error\", {\n error: \"Product name, customer email, and price are required\",\n }),\n ],\n },\n }),\n \n new JavaScript(\"createOrder\", {\n fn: ({ NewOrderProductInput, NewOrderUserEmailInput, NewOrderPriceInput, NewOrderImageInput }) => {\n // Generate a new order ID and user ID\n const orderId = Math.floor(Math.random() * 1000) + 100;\n const userId = Math.floor(Math.random() * 10000) + 1;\n const currentDate = new Date().toISOString().split('T')[0];\n \n // Simulate order creation\n console.log(\"Creating order:\", {\n id: orderId,\n user_id: userId,\n product: NewOrderProductInput.value,\n user_email: NewOrderUserEmailInput.value,\n price: NewOrderPriceInput.value,\n date_purchased: currentDate,\n image: NewOrderImageInput.value || \"\",\n });\n \n return {\n success: true,\n message: \"Order created successfully\",\n orderId: orderId,\n };\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/updateOrderApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"updateOrderApi\", [\n new Conditional(\"validateInputs\", {\n if: {\n when: ({ EditOrderProductInput, EditOrderUserEmailInput, EditOrderPriceInput }) =>\n !EditOrderProductInput.value || \n !EditOrderUserEmailInput.value || \n !EditOrderPriceInput.value,\n then: [\n new Throw(\"validation_error\", {\n error: \"Product name, customer email, and price are required\",\n }),\n ],\n },\n }),\n \n new JavaScript(\"updateOrder\", {\n fn: ({ OrdersTable, EditOrderProductInput, EditOrderUserEmailInput, EditOrderPriceInput, EditOrderImageInput }) => {\n const orderId = OrdersTable.selectedRow?.id;\n if (!orderId) {\n throw new Error(\"No order selected for update\");\n }\n \n // Simulate order update\n console.log(\"Updating order:\", {\n id: orderId,\n product: EditOrderProductInput.value,\n user_email: EditOrderUserEmailInput.value,\n price: EditOrderPriceInput.value,\n image: EditOrderImageInput.value || \"\",\n });\n \n return {\n success: true,\n message: \"Order updated successfully\",\n orderId: orderId,\n };\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/deleteOrderApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"deleteOrderApi\", [\n new JavaScript(\"deleteOrder\", {\n fn: ({ OrdersTable }) => {\n const orderId = OrdersTable.selectedRow?.id;\n if (!orderId) {\n throw new Error(\"No order selected for deletion\");\n }\n \n // Simulate order deletion\n console.log(\"Deleting order:\", {\n id: orderId,\n product: OrdersTable.selectedRow?.product,\n user_email: OrdersTable.selectedRow?.user_email,\n });\n \n return {\n success: true,\n message: \"Order deleted successfully\",\n deletedOrderId: orderId,\n };\n },\n }),\n]);\n</boltAction>\n</boltArtifact>\n\nThe order management app is now complete with all the requested features:\n\n## **Key Features:**\n\n### **Metrics Dashboard**\n- **Total Orders**: Count of all records from DemoOrders\n- **Total Revenue**: Sum of price field from DemoOrders \n- **Orders This Month**: Count of orders from current month\n- **Active Shipments**: Count of records in DemoShipping SHIPPING_STATUS table\n\n### **Orders Management**\n- **Orders Table**: Displays all orders with id, product, user_email, date_purchased, price\n- **Product Filter**: Real-time text filtering on product names\n- **CRUD Operations**:\n - **Create**: Add new orders with product, email, price, and optional image\n - **Update**: Edit existing orders (click row to edit)\n - **Delete**: Remove orders (delete button in edit modal)\n - **View Details**: See full order info plus shipping status (click \"View Details\" button)\n\n### **Shipping Integration**\n- **Order Details Modal**: Shows order information plus shipping status and recent activity from DemoShipping tables\n- **Real-time Data**: Fetches shipping status and history by ORDER_ID\n\n### **User Experience**\n- Clean, professional interface with metric cards\n- Intuitive modals for all CRUD operations\n- Real-time filtering and data updates\n- Proper validation and error handling\n- Responsive design with consistent spacing\n\nThe app automatically loads metrics and orders data on page load, and all operations refresh the data to keep everything in sync.";
|
|
1
|
+
declare const _default: "BUILDING APPLICATION FROM MOCK RESPONSE: I'll create a comprehensive order management app with CRUD operations using the DemoOrders and DemoShipping databases.\n\n<boltArtifact id=\"order-management-app\" title=\"Order Management App\">\n<boltAction type=\"file\" filePath=\"routes.json\">\n{\n \"/\": {\n \"file\": \"Page1/index.tsx\"\n }\n}\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/scope.ts\">\nimport {\n createScope,\n SbApi,\n StateVar,\n StateVarPersistence,\n computed,\n} from \"@superblocksteam/library\";\n\nexport const Page1Scope = createScope<{\n OrdersTable: any;\n ProductFilterInput: any;\n CreateOrderModal: any;\n EditOrderModal: any;\n OrderDetailsModal: any;\n CreateOrderButton: any;\n NewOrderProductInput: any;\n NewOrderUserEmailInput: any;\n NewOrderPriceInput: any;\n NewOrderImageInput: any;\n EditOrderProductInput: any;\n EditOrderUserEmailInput: any;\n EditOrderPriceInput: any;\n EditOrderImageInput: any;\n}>(\n ({\n entities: {\n OrdersTable,\n ProductFilterInput,\n getMetricsApi,\n getOrdersApi,\n getOrderDetailsApi,\n getShippingInfoApi,\n createOrderApi,\n updateOrderApi,\n deleteOrderApi,\n NewOrderProductInput,\n NewOrderUserEmailInput,\n NewOrderPriceInput,\n NewOrderImageInput,\n EditOrderProductInput,\n EditOrderUserEmailInput,\n EditOrderPriceInput,\n EditOrderImageInput,\n },\n }) => ({\n getMetricsApi: SbApi({}),\n getOrdersApi: SbApi({}),\n getOrderDetailsApi: SbApi({}),\n getShippingInfoApi: SbApi({}),\n createOrderApi: SbApi({}),\n updateOrderApi: SbApi({}),\n deleteOrderApi: SbApi({}),\n \n filteredOrdersVar: StateVar({\n defaultValue: computed(() => {\n const orders = getOrdersApi.response || [];\n const filterText = ProductFilterInput.value?.toLowerCase() || '';\n \n if (!filterText) return orders;\n \n return orders.filter((order: any) =>\n order.product?.toLowerCase().includes(filterText)\n );\n }),\n persistence: StateVarPersistence.TEMPORARY,\n }),\n }),\n {\n name: \"Page1\",\n }\n);\n\nexport const Page1 = Page1Scope.entities;\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/index.tsx\">\nimport {\n Page,\n Dim,\n Section,\n Column,\n registerPage,\n Table,\n computed,\n Container,\n Input,\n Button,\n EventFlow,\n Modal,\n Text,\n Theme,\n} from \"@superblocksteam/library\";\nimport MetricCard from \"components/MetricCard/MetricCard\";\nimport AppHeader from \"components/AppHeader/AppHeader\";\nimport KeyValue from \"components/KeyValue\";\nimport { Page1, Page1Scope } from \"./scope\";\n\nfunction PageContent() {\n const {\n OrdersTable,\n ProductFilterInput,\n CreateOrderModal,\n EditOrderModal,\n CreateOrderButton,\n OrderDetailsModal,\n NewOrderProductInput,\n NewOrderUserEmailInput,\n NewOrderPriceInput,\n NewOrderImageInput,\n EditOrderProductInput,\n EditOrderUserEmailInput,\n EditOrderPriceInput,\n EditOrderImageInput,\n getMetricsApi,\n getOrdersApi,\n getOrderDetailsApi,\n getShippingInfoApi,\n createOrderApi,\n updateOrderApi,\n deleteOrderApi,\n filteredOrdersVar,\n } = Page1;\n\n return (\n <Page\n name=\"Page1\"\n height={Dim.fill()}\n width={Dim.fill()}\n onLoad={EventFlow.runApis([getMetricsApi, getOrdersApi])}\n >\n <Section height={Dim.fill()}>\n <Column width={Dim.fill()} spacing={Dim.px(0)}>\n <AppHeader\n title=\"Order Management\"\n avatarUrl=\"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=40&h=40&fit=crop&crop=face\"\n userEmail=\"admin@company.com\"\n height={Dim.fit()}\n />\n \n <Container\n layout=\"vertical\"\n spacing={Dim.px(24)}\n padding={{\n top: Dim.px(24),\n bottom: Dim.px(24),\n left: Dim.px(24),\n right: Dim.px(24),\n }}\n height={Dim.fill()}\n >\n {/* Metrics Cards */}\n <Container layout=\"horizontal\" spacing={Dim.px(16)}>\n <MetricCard\n title=\"Total Orders\"\n value={computed(() => getMetricsApi.response?.totalOrders?.toString() || \"0\")}\n icon=\"receipt_long\"\n width={Dim.fill()}\n />\n <MetricCard\n title=\"Total Revenue\"\n value={computed(() => `$${getMetricsApi.response?.totalRevenue?.toLocaleString() || \"0\"}`)}\n icon=\"attach_money\"\n width={Dim.fill()}\n />\n <MetricCard\n title=\"Orders This Month\"\n value={computed(() => getMetricsApi.response?.ordersThisMonth?.toString() || \"0\")}\n icon=\"calendar_today\"\n width={Dim.fill()}\n />\n <MetricCard\n title=\"Active Shipments\"\n value={computed(() => getMetricsApi.response?.activeShipments?.toString() || \"0\")}\n icon=\"local_shipping\"\n width={Dim.fill()}\n />\n </Container>\n\n {/* Orders Section */}\n <Container layout=\"vertical\" spacing={Dim.px(16)} variant=\"card\">\n <Container layout=\"horizontal\" spacing={Dim.px(12)} verticalAlign=\"bottom\">\n <Input\n bind={ProductFilterInput}\n label=\"Filter by Product\"\n placeholder=\"Search products...\"\n width={Dim.px(300)}\n />\n <Button\n bind={CreateOrderButton}\n label=\"Create Order\"\n variant=\"primary\"\n icon=\"add\"\n onClick={EventFlow.controlModal(CreateOrderModal, { action: \"open\" })}\n />\n </Container>\n\n <Table\n bind={OrdersTable}\n tableData={computed(() => filteredOrdersVar.value)}\n columns={{\n id: {\n label: \"Order ID\",\n columnType: \"text\",\n },\n product: {\n label: \"Product\",\n columnType: \"text\",\n },\n user_email: {\n label: \"Customer Email\",\n columnType: \"email\",\n },\n date_purchased: {\n label: \"Date Purchased\",\n columnType: \"date\",\n inputFormat: \"YYYY-MM-DD\",\n outputFormat: \"MM/DD/YYYY\",\n },\n price: {\n label: \"Price\",\n columnType: \"currency\",\n currency: \"USD\",\n },\n actions: {\n label: \"Actions\",\n columnType: \"button\",\n buttonLabel: \"View Details\",\n onClick: EventFlow.runJS(() => {\n getOrderDetailsApi.run();\n getShippingInfoApi.run();\n }).controlModal(OrderDetailsModal, { action: \"open\" }),\n },\n }}\n onRowClick={EventFlow.runJS(() => {\n EditOrderProductInput.text = OrdersTable.selectedRow?.product || \"\";\n EditOrderUserEmailInput.text = OrdersTable.selectedRow?.user_email || \"\";\n EditOrderPriceInput.text = OrdersTable.selectedRow?.price?.toString() || \"\";\n EditOrderImageInput.text = OrdersTable.selectedRow?.image || \"\";\n }).controlModal(EditOrderModal, { action: \"open\" })}\n height={Dim.px(400)}\n />\n </Container>\n </Container>\n </Column>\n </Section>\n\n {/* Create Order Modal */}\n <Modal bind={CreateOrderModal}>\n <Container layout=\"vertical\" spacing={Dim.px(24)} width={Dim.fill()}>\n <Text text=\"Create New Order\" textStyle={{ variant: \"heading3\" }} />\n \n <Container layout=\"vertical\" spacing={Dim.px(16)} width={Dim.fill()}>\n <Input\n bind={NewOrderProductInput}\n label=\"Product Name\"\n placeholder=\"Enter product name\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={NewOrderUserEmailInput}\n label=\"Customer Email\"\n placeholder=\"Enter customer email\"\n inputType=\"EMAIL\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={NewOrderPriceInput}\n label=\"Price\"\n placeholder=\"Enter price\"\n inputType=\"NUMBER\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={NewOrderImageInput}\n label=\"Product Image URL\"\n placeholder=\"Enter image URL (optional)\"\n width={Dim.fill()}\n />\n </Container>\n\n <Container layout=\"horizontal\" spacing={Dim.px(12)} horizontalAlign=\"right\" width={Dim.fill()}>\n <Button\n label=\"Cancel\"\n variant=\"secondary\"\n onClick={EventFlow.runJS(() => {\n NewOrderProductInput.text = \"\";\n NewOrderUserEmailInput.text = \"\";\n NewOrderPriceInput.text = \"\";\n NewOrderImageInput.text = \"\";\n }).controlModal(CreateOrderModal, { action: \"close\" })}\n />\n <Button\n label=\"Create Order\"\n variant=\"primary\"\n onClick={EventFlow.runApis([createOrderApi])\n .runApis([getMetricsApi, getOrdersApi])\n .runJS(() => {\n NewOrderProductInput.text = \"\";\n NewOrderUserEmailInput.text = \"\";\n NewOrderPriceInput.text = \"\";\n NewOrderImageInput.text = \"\";\n })\n .controlModal(CreateOrderModal, { action: \"close\" })}\n />\n </Container>\n </Container>\n </Modal>\n\n {/* Edit Order Modal */}\n <Modal bind={EditOrderModal}>\n <Container layout=\"vertical\" spacing={Dim.px(24)} width={Dim.fill()}>\n <Container layout=\"horizontal\" spacing={Dim.px(12)} horizontalAlign=\"space-between\" width={Dim.fill()}>\n <Text \n width={Dim.fit()}\n text={computed(() => `Edit Order #${OrdersTable.selectedRow?.id || \"\"}`)} \n textStyle={{ variant: \"heading3\" }} \n />\n </Container>\n \n <Container layout=\"vertical\" spacing={Dim.px(16)} width={Dim.fill()}>\n <Input\n bind={EditOrderProductInput}\n label=\"Product Name\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={EditOrderUserEmailInput}\n label=\"Customer Email\"\n inputType=\"EMAIL\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={EditOrderPriceInput}\n label=\"Price\"\n inputType=\"NUMBER\"\n width={Dim.fill()}\n required={true}\n />\n <Input\n bind={EditOrderImageInput}\n label=\"Product Image URL\"\n width={Dim.fill()}\n />\n </Container>\n\n <Container layout=\"horizontal\" spacing={Dim.px(12)} horizontalAlign=\"right\" width={Dim.fill()}>\n <Button\n label=\"Cancel\"\n variant=\"secondary\"\n onClick={EventFlow.controlModal(EditOrderModal, { action: \"close\" })}\n />\n <Button\n label=\"Update Order\"\n variant=\"primary\"\n onClick={EventFlow.runApis([updateOrderApi])\n .runApis([getMetricsApi, getOrdersApi])\n .controlModal(EditOrderModal, { action: \"close\" })}\n />\n </Container>\n </Container>\n </Modal>\n\n {/* Order Details Modal */}\n <Modal bind={OrderDetailsModal}>\n <Container layout=\"vertical\" spacing={Dim.px(24)} width={Dim.fill()}>\n <Text \n text={computed(() => `Order Details #${OrdersTable.selectedRow?.id || \"\"}`)} \n textStyle={{ variant: \"heading3\" }} \n />\n \n <Container layout=\"horizontal\" spacing={Dim.px(24)} width={Dim.fill()}>\n <Container layout=\"vertical\" spacing={Dim.px(16)} width={Dim.fill()}>\n <KeyValue\n label=\"Order Information\"\n data={computed(() => getOrderDetailsApi.response || {})}\n />\n </Container>\n \n <Container layout=\"vertical\" spacing={Dim.px(16)} width={Dim.fill()}>\n <KeyValue\n label=\"Shipping Information\"\n data={computed(() => getShippingInfoApi.response || {})}\n />\n </Container>\n </Container>\n\n <Container layout=\"horizontal\" spacing={Dim.px(12)} horizontalAlign=\"right\" width={Dim.fill()}>\n <Button\n label=\"Close\"\n variant=\"secondary\"\n onClick={EventFlow.controlModal(OrderDetailsModal, { action: \"close\" })}\n />\n </Container>\n </Container>\n </Modal>\n </Page>\n );\n}\n\nexport default registerPage(PageContent, Page1Scope);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/getMetricsApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"getMetricsApi\", [\n new JavaScript(\"getMetrics\", {\n fn: () => {\n return {\n totalOrders: 45,\n totalRevenue: 12489.50,\n ordersThisMonth: 8,\n activeShipments: 12,\n };\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/getOrdersApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"getOrdersApi\", [\n new JavaScript(\"getOrders\", {\n fn: () => {\n return [\n {\n id: 1,\n product: \"Wireless Headphones\",\n user_email: \"john.doe@example.com\",\n date_purchased: \"2024-01-15\",\n price: 199.99,\n image: \"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=200&h=200&fit=crop\",\n },\n {\n id: 2,\n product: \"Smart Watch\",\n user_email: \"jane.smith@example.com\",\n date_purchased: \"2024-01-14\",\n price: 299.99,\n image: \"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=200&h=200&fit=crop\",\n },\n {\n id: 3,\n product: \"Laptop Stand\",\n user_email: \"mike.johnson@example.com\",\n date_purchased: \"2024-01-13\",\n price: 49.99,\n image: \"https://images.unsplash.com/photo-1527864550417-7fd91fc51a46?w=200&h=200&fit=crop\",\n },\n {\n id: 4,\n product: \"Bluetooth Speaker\",\n user_email: \"sarah.wilson@example.com\",\n date_purchased: \"2024-01-12\",\n price: 79.99,\n image: \"https://images.unsplash.com/photo-1608043152269-423dbba4e7e1?w=200&h=200&fit=crop\",\n },\n {\n id: 5,\n product: \"Gaming Mouse\",\n user_email: \"alex.brown@example.com\",\n date_purchased: \"2024-01-11\",\n price: 89.99,\n image: \"https://images.unsplash.com/photo-1527814050087-3793815479db?w=200&h=200&fit=crop\",\n },\n {\n id: 6,\n product: \"USB-C Hub\",\n user_email: \"emily.davis@example.com\",\n date_purchased: \"2024-01-10\",\n price: 39.99,\n image: \"https://images.unsplash.com/photo-1558618047-3c8c76ca7d13?w=200&h=200&fit=crop\",\n },\n {\n id: 7,\n product: \"Phone Case\",\n user_email: \"david.miller@example.com\",\n date_purchased: \"2024-01-09\",\n price: 24.99,\n image: \"https://images.unsplash.com/photo-1601944177325-f8867652837f?w=200&h=200&fit=crop\",\n },\n {\n id: 8,\n product: \"Tablet Stand\",\n user_email: \"lisa.garcia@example.com\",\n date_purchased: \"2024-01-08\",\n price: 34.99,\n image: \"https://images.unsplash.com/photo-1544244015-0df4b3ffc6b0?w=200&h=200&fit=crop\",\n },\n ];\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/getOrderDetailsApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"getOrderDetailsApi\", [\n new JavaScript(\"getOrderDetails\", {\n fn: ({ OrdersTable }) => {\n const order = OrdersTable.selectedRow;\n if (!order) return {};\n \n // Generate a user_id if not present (for display purposes)\n const userId = order.user_id || Math.floor(Math.random() * 10000) + 1000;\n \n return {\n \"Order ID\": order.id,\n \"Product\": order.product,\n \"Customer Email\": order.user_email,\n \"User ID\": userId,\n \"Date Purchased\": order.date_purchased,\n \"Price\": `$${order.price}`,\n \"Image URL\": order.image || \"N/A\",\n };\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/getShippingInfoApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"getShippingInfoApi\", [\n new JavaScript(\"getShippingInfo\", {\n fn: ({ OrdersTable }) => {\n const order = OrdersTable.selectedRow;\n if (!order) return { \"Shipping Status\": \"No shipping info\" };\n \n const orderId = order.id;\n \n // Generate shipping data based on order ID patterns\n const shippingStatuses = [\"Processing\", \"In Transit\", \"Delivered\", \"Out for Delivery\"];\n const locations = [\"Los Angeles, CA\", \"Phoenix, AZ\", \"Denver, CO\", \"Chicago, IL\", \"Miami, FL\"];\n const activities = [\"Order received\", \"Package shipped\", \"In transit\", \"Out for delivery\", \"Delivered\"];\n \n const statusIndex = orderId % shippingStatuses.length;\n const status = shippingStatuses[statusIndex];\n \n // Generate 2-3 shipping activities\n const numActivities = 2 + (orderId % 2);\n const history = [];\n \n for (let i = 0; i < numActivities; i++) {\n const date = new Date();\n date.setDate(date.getDate() - (numActivities - i));\n const timestamp = date.toISOString().replace('T', ' ').substring(0, 19);\n \n history.push({\n TIMESTAMP: timestamp,\n ACTIVITY: activities[i % activities.length],\n LOCATION: locations[i % locations.length],\n });\n }\n \n const result = {\n \"Shipping Status\": status,\n };\n \n history.forEach((item, index) => {\n result[`Activity ${index + 1}`] = `${item.ACTIVITY} - ${item.LOCATION} (${item.TIMESTAMP})`;\n });\n \n return result;\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/createOrderApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"createOrderApi\", [\n new Conditional(\"validateInputs\", {\n if: {\n when: ({ NewOrderProductInput, NewOrderUserEmailInput, NewOrderPriceInput }) =>\n !NewOrderProductInput.value || \n !NewOrderUserEmailInput.value || \n !NewOrderPriceInput.value,\n then: [\n new Throw(\"validation_error\", {\n error: \"Product name, customer email, and price are required\",\n }),\n ],\n },\n }),\n \n new JavaScript(\"createOrder\", {\n fn: ({ NewOrderProductInput, NewOrderUserEmailInput, NewOrderPriceInput, NewOrderImageInput }) => {\n // Generate a new order ID and user ID\n const orderId = Math.floor(Math.random() * 1000) + 100;\n const userId = Math.floor(Math.random() * 10000) + 1;\n const currentDate = new Date().toISOString().split('T')[0];\n \n // Simulate order creation\n console.log(\"Creating order:\", {\n id: orderId,\n user_id: userId,\n product: NewOrderProductInput.value,\n user_email: NewOrderUserEmailInput.value,\n price: NewOrderPriceInput.value,\n date_purchased: currentDate,\n image: NewOrderImageInput.value || \"\",\n });\n \n return {\n success: true,\n message: \"Order created successfully\",\n orderId: orderId,\n };\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/updateOrderApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"updateOrderApi\", [\n new Conditional(\"validateInputs\", {\n if: {\n when: ({ EditOrderProductInput, EditOrderUserEmailInput, EditOrderPriceInput }) =>\n !EditOrderProductInput.value || \n !EditOrderUserEmailInput.value || \n !EditOrderPriceInput.value,\n then: [\n new Throw(\"validation_error\", {\n error: \"Product name, customer email, and price are required\",\n }),\n ],\n },\n }),\n \n new JavaScript(\"updateOrder\", {\n fn: ({ OrdersTable, EditOrderProductInput, EditOrderUserEmailInput, EditOrderPriceInput, EditOrderImageInput }) => {\n const orderId = OrdersTable.selectedRow?.id;\n if (!orderId) {\n throw new Error(\"No order selected for update\");\n }\n \n // Simulate order update\n console.log(\"Updating order:\", {\n id: orderId,\n product: EditOrderProductInput.value,\n user_email: EditOrderUserEmailInput.value,\n price: EditOrderPriceInput.value,\n image: EditOrderImageInput.value || \"\",\n });\n \n return {\n success: true,\n message: \"Order updated successfully\",\n orderId: orderId,\n };\n },\n }),\n]);\n</boltAction>\n\n<boltAction type=\"file\" filePath=\"pages/Page1/apis/deleteOrderApi.ts\">\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n RestApi,\n Email,\n Conditional,\n TryCatch,\n Variables,\n Loop,\n Parallel,\n Throw,\n Return,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"deleteOrderApi\", [\n new JavaScript(\"deleteOrder\", {\n fn: ({ OrdersTable }) => {\n const orderId = OrdersTable.selectedRow?.id;\n if (!orderId) {\n throw new Error(\"No order selected for deletion\");\n }\n \n // Simulate order deletion\n console.log(\"Deleting order:\", {\n id: orderId,\n product: OrdersTable.selectedRow?.product,\n user_email: OrdersTable.selectedRow?.user_email,\n });\n \n return {\n success: true,\n message: \"Order deleted successfully\",\n deletedOrderId: orderId,\n };\n },\n }),\n]);\n</boltAction>\n</boltArtifact>\n\nThe order management app is now complete with all the requested features:\n\n## **Key Features:**\n\n### **Metrics Dashboard**\n- **Total Orders**: Count of all records from DemoOrders\n- **Total Revenue**: Sum of price field from DemoOrders \n- **Orders This Month**: Count of orders from current month\n- **Active Shipments**: Count of records in DemoShipping SHIPPING_STATUS table\n\n### **Orders Management**\n- **Orders Table**: Displays all orders with id, product, user_email, date_purchased, price\n- **Product Filter**: Real-time text filtering on product names\n- **CRUD Operations**:\n - **Create**: Add new orders with product, email, price, and optional image\n - **Update**: Edit existing orders (click row to edit)\n - **Delete**: Remove orders (delete button in edit modal)\n - **View Details**: See full order info plus shipping status (click \"View Details\" button)\n\n### **Shipping Integration**\n- **Order Details Modal**: Shows order information plus shipping status and recent activity from DemoShipping tables\n- **Real-time Data**: Fetches shipping status and history by ORDER_ID\n\n### **User Experience**\n- Clean, professional interface with metric cards\n- Intuitive modals for all CRUD operations\n- Real-time filtering and data updates\n- Proper validation and error handling\n- Responsive design with consistent spacing\n\nThe app automatically loads metrics and orders data on page load, and all operations refresh the data to keep everything in sync.";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=orders-app.d.ts.map
|
|
@@ -202,7 +202,7 @@ function PageContent() {
|
|
|
202
202
|
label="Create Order"
|
|
203
203
|
variant="primary"
|
|
204
204
|
icon="add"
|
|
205
|
-
onClick={EventFlow.controlModal(CreateOrderModal, "open")}
|
|
205
|
+
onClick={EventFlow.controlModal(CreateOrderModal, { action: "open" })}
|
|
206
206
|
/>
|
|
207
207
|
</Container>
|
|
208
208
|
|
|
@@ -240,7 +240,7 @@ function PageContent() {
|
|
|
240
240
|
onClick: EventFlow.runJS(() => {
|
|
241
241
|
getOrderDetailsApi.run();
|
|
242
242
|
getShippingInfoApi.run();
|
|
243
|
-
}).controlModal(OrderDetailsModal, "open"),
|
|
243
|
+
}).controlModal(OrderDetailsModal, { action: "open" }),
|
|
244
244
|
},
|
|
245
245
|
}}
|
|
246
246
|
onRowClick={EventFlow.runJS(() => {
|
|
@@ -248,7 +248,7 @@ function PageContent() {
|
|
|
248
248
|
EditOrderUserEmailInput.text = OrdersTable.selectedRow?.user_email || "";
|
|
249
249
|
EditOrderPriceInput.text = OrdersTable.selectedRow?.price?.toString() || "";
|
|
250
250
|
EditOrderImageInput.text = OrdersTable.selectedRow?.image || "";
|
|
251
|
-
}).controlModal(EditOrderModal, "open")}
|
|
251
|
+
}).controlModal(EditOrderModal, { action: "open" })}
|
|
252
252
|
height={Dim.px(400)}
|
|
253
253
|
/>
|
|
254
254
|
</Container>
|
|
@@ -302,7 +302,7 @@ function PageContent() {
|
|
|
302
302
|
NewOrderUserEmailInput.text = "";
|
|
303
303
|
NewOrderPriceInput.text = "";
|
|
304
304
|
NewOrderImageInput.text = "";
|
|
305
|
-
}).controlModal(CreateOrderModal, "close")}
|
|
305
|
+
}).controlModal(CreateOrderModal, { action: "close" })}
|
|
306
306
|
/>
|
|
307
307
|
<Button
|
|
308
308
|
label="Create Order"
|
|
@@ -315,7 +315,7 @@ function PageContent() {
|
|
|
315
315
|
NewOrderPriceInput.text = "";
|
|
316
316
|
NewOrderImageInput.text = "";
|
|
317
317
|
})
|
|
318
|
-
.controlModal(CreateOrderModal, "close")}
|
|
318
|
+
.controlModal(CreateOrderModal, { action: "close" })}
|
|
319
319
|
/>
|
|
320
320
|
</Container>
|
|
321
321
|
</Container>
|
|
@@ -364,14 +364,14 @@ function PageContent() {
|
|
|
364
364
|
<Button
|
|
365
365
|
label="Cancel"
|
|
366
366
|
variant="secondary"
|
|
367
|
-
onClick={EventFlow.controlModal(EditOrderModal, "close")}
|
|
367
|
+
onClick={EventFlow.controlModal(EditOrderModal, { action: "close" })}
|
|
368
368
|
/>
|
|
369
369
|
<Button
|
|
370
370
|
label="Update Order"
|
|
371
371
|
variant="primary"
|
|
372
372
|
onClick={EventFlow.runApis([updateOrderApi])
|
|
373
373
|
.runApis([getMetricsApi, getOrdersApi])
|
|
374
|
-
.controlModal(EditOrderModal, "close")}
|
|
374
|
+
.controlModal(EditOrderModal, { action: "close" })}
|
|
375
375
|
/>
|
|
376
376
|
</Container>
|
|
377
377
|
</Container>
|
|
@@ -405,7 +405,7 @@ function PageContent() {
|
|
|
405
405
|
<Button
|
|
406
406
|
label="Close"
|
|
407
407
|
variant="secondary"
|
|
408
|
-
onClick={EventFlow.controlModal(OrderDetailsModal, "close")}
|
|
408
|
+
onClick={EventFlow.controlModal(OrderDetailsModal, { action: "close" })}
|
|
409
409
|
/>
|
|
410
410
|
</Container>
|
|
411
411
|
</Container>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: "BUILDING APPLICATION FROM MOCK RESPONSE: I will add a title to the app.\n\n<boltArtifact id=\"hello-world-api-app\" title=\"Hello World API App With Title\">\n<boltAction type=\"file\" filePath=\"pages/Page1/scope.ts\">\nimport { createScope, SbApi } from \"@superblocksteam/library\";\n\nexport const Page1Scope = createScope<{\n HelloText: any;\n HelloTitle: any;\n}>(\n () => ({\n getHelloWorldApi: SbApi({}),\n }),\n {\n name: \"Page1\",\n }\n);\n\nexport const Page1 = Page1Scope.entities;\n</boltAction>\n<boltAction type=\"file\" filePath=\"pages/Page1/index.tsx\">\nimport {\n Page,\n Dim,\n Section,\n Column,\n Text,\n Button,\n EventFlow,\n computed,\n registerPage,\n} from \"@superblocksteam/library\";\nimport { Page1, Page1Scope } from \"./scope\";\n\nfunction PageContent() {\n const { HelloText, HelloTitle, getHelloWorldApi } = Page1;\n\n return (\n <Page \n name=\"Page1\" \n height={Dim.fill()} \n width={Dim.fill()}\n onLoad={EventFlow.runApis([getHelloWorldApi])}\n >\n <Section height={Dim.fill()}>\n <Column width={Dim.fill()} layout=\"vertical\" spacing={Dim.px(12)}>\n <Text bind={HelloTitle} text=\"This is my hello world app\" />\n <Button\n label=\"Fetch Hello World\"\n onClick={EventFlow.runApis([getHelloWorldApi])}\n />\n <Text\n width={Dim.fit()}\n height={Dim.fit()}\n text={computed(() => `${getHelloWorldApi.response || \"\"}`)}\n bind={HelloText}\n />\n </Column>\n </Section>\n </Page>\n );\n}\n\nexport default registerPage(PageContent, Page1Scope);\n</boltAction>\n\n</boltArtifact>\n\nThe app has now a `This is my hello world app` title;";
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=reprompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reprompt.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/test-utils/app-generation-mocks/reprompt.ts"],"names":[],"mappings":";AAAA,wBAoEyD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export default `BUILDING APPLICATION FROM MOCK RESPONSE: I will add a title to the app.
|
|
2
|
+
|
|
3
|
+
<boltArtifact id="hello-world-api-app" title="Hello World API App With Title">
|
|
4
|
+
<boltAction type="file" filePath="pages/Page1/scope.ts">
|
|
5
|
+
import { createScope, SbApi } from "@superblocksteam/library";
|
|
6
|
+
|
|
7
|
+
export const Page1Scope = createScope<{
|
|
8
|
+
HelloText: any;
|
|
9
|
+
HelloTitle: any;
|
|
10
|
+
}>(
|
|
11
|
+
() => ({
|
|
12
|
+
getHelloWorldApi: SbApi({}),
|
|
13
|
+
}),
|
|
14
|
+
{
|
|
15
|
+
name: "Page1",
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const Page1 = Page1Scope.entities;
|
|
20
|
+
</boltAction>
|
|
21
|
+
<boltAction type="file" filePath="pages/Page1/index.tsx">
|
|
22
|
+
import {
|
|
23
|
+
Page,
|
|
24
|
+
Dim,
|
|
25
|
+
Section,
|
|
26
|
+
Column,
|
|
27
|
+
Text,
|
|
28
|
+
Button,
|
|
29
|
+
EventFlow,
|
|
30
|
+
computed,
|
|
31
|
+
registerPage,
|
|
32
|
+
} from "@superblocksteam/library";
|
|
33
|
+
import { Page1, Page1Scope } from "./scope";
|
|
34
|
+
|
|
35
|
+
function PageContent() {
|
|
36
|
+
const { HelloText, HelloTitle, getHelloWorldApi } = Page1;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Page
|
|
40
|
+
name="Page1"
|
|
41
|
+
height={Dim.fill()}
|
|
42
|
+
width={Dim.fill()}
|
|
43
|
+
onLoad={EventFlow.runApis([getHelloWorldApi])}
|
|
44
|
+
>
|
|
45
|
+
<Section height={Dim.fill()}>
|
|
46
|
+
<Column width={Dim.fill()} layout="vertical" spacing={Dim.px(12)}>
|
|
47
|
+
<Text bind={HelloTitle} text="This is my hello world app" />
|
|
48
|
+
<Button
|
|
49
|
+
label="Fetch Hello World"
|
|
50
|
+
onClick={EventFlow.runApis([getHelloWorldApi])}
|
|
51
|
+
/>
|
|
52
|
+
<Text
|
|
53
|
+
width={Dim.fit()}
|
|
54
|
+
height={Dim.fit()}
|
|
55
|
+
text={computed(() => \`\${getHelloWorldApi.response || ""}\`)}
|
|
56
|
+
bind={HelloText}
|
|
57
|
+
/>
|
|
58
|
+
</Column>
|
|
59
|
+
</Section>
|
|
60
|
+
</Page>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default registerPage(PageContent, Page1Scope);
|
|
65
|
+
</boltAction>
|
|
66
|
+
|
|
67
|
+
</boltArtifact>
|
|
68
|
+
|
|
69
|
+
The app has now a \`This is my hello world app\` title;`;
|
|
70
|
+
//# sourceMappingURL=reprompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reprompt.js","sourceRoot":"","sources":["../../../../src/ai-service/test-utils/app-generation-mocks/reprompt.ts"],"names":[],"mappings":"AAAA,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAoEyC,CAAC"}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
declare const
|
|
3
|
-
export
|
|
4
|
-
type: "step-start";
|
|
5
|
-
messageId: string;
|
|
6
|
-
} | {
|
|
7
|
-
type: "text-delta";
|
|
8
|
-
textDelta: string;
|
|
9
|
-
} | {
|
|
10
|
-
type: "step-finish";
|
|
11
|
-
messageId: string;
|
|
12
|
-
} | {
|
|
13
|
-
type: "finish";
|
|
14
|
-
finishReason: FinishReason;
|
|
15
|
-
} | {
|
|
16
|
-
type: "error";
|
|
17
|
-
error: any;
|
|
18
|
-
};
|
|
19
|
-
export declare function createMockAppGenerationStream(mockName: keyof typeof APP_GEN_MOCKS): AsyncIterable<MockStreamChunk>;
|
|
1
|
+
export declare const APP_GEN_MOCKS: Record<string, string>;
|
|
2
|
+
export declare const getPromptFromRequest: (requestInit?: RequestInit) => any;
|
|
3
|
+
export declare const getMockContent: (prompt: string) => string;
|
|
20
4
|
export declare function extractMockNameFromPrompt(prompt: string): string | null;
|
|
21
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Splits a mock response into chunks where:
|
|
7
|
+
* - Simple text sections are kept as single chunks
|
|
8
|
+
* - Each boltAction (between <boltAction> tags) is kept as a separate, complete chunk
|
|
9
|
+
* - Preserves the exact content and structure of boltActions
|
|
10
|
+
*/
|
|
11
|
+
export declare function splitGenMockIntoChunks(generationMock: string): string[];
|
|
22
12
|
//# sourceMappingURL=mock-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-utils.d.ts","sourceRoot":"","sources":["../../../src/ai-service/test-utils/mock-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mock-utils.d.ts","sourceRoot":"","sources":["../../../src/ai-service/test-utils/mock-utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIhD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,cAAc,WAAW,QAc7D,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,MAS/C,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGvE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAqCvE"}
|
|
@@ -1,46 +1,70 @@
|
|
|
1
1
|
import ordersAppMockContent from "./app-generation-mocks/orders-app.js";
|
|
2
|
+
import repromptMockContent from "./app-generation-mocks/reprompt.js";
|
|
2
3
|
import smoketestMockContent from "./app-generation-mocks/smoketest.js";
|
|
3
|
-
const APP_GEN_MOCKS = {
|
|
4
|
+
export const APP_GEN_MOCKS = {
|
|
4
5
|
smoketest: smoketestMockContent,
|
|
5
6
|
orders_app: ordersAppMockContent,
|
|
7
|
+
reprompt: repromptMockContent,
|
|
6
8
|
};
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type: "step-start",
|
|
11
|
-
messageId: "mock-step-1",
|
|
12
|
-
},
|
|
13
|
-
];
|
|
14
|
-
if (!APP_GEN_MOCKS[mockName]) {
|
|
15
|
-
throw new Error(`Mock ${mockName} not found`);
|
|
9
|
+
export const getPromptFromRequest = (requestInit) => {
|
|
10
|
+
if (!requestInit) {
|
|
11
|
+
return "";
|
|
16
12
|
}
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
chunks.push({
|
|
23
|
-
type: "text-delta",
|
|
24
|
-
textDelta: chunk,
|
|
25
|
-
});
|
|
13
|
+
const body = JSON.parse(requestInit.body);
|
|
14
|
+
const userMessage = body.messages.filter((message) => message.role === "user")[0].content[0].text;
|
|
15
|
+
// filter out old prompts to only get the new one if its a reprompt
|
|
16
|
+
if (userMessage.includes("new prompt is:")) {
|
|
17
|
+
return userMessage.split("new prompt is:")[1].trim();
|
|
26
18
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
return (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
38
|
-
yield chunk;
|
|
39
|
-
}
|
|
40
|
-
})();
|
|
41
|
-
}
|
|
19
|
+
return userMessage;
|
|
20
|
+
};
|
|
21
|
+
export const getMockContent = (prompt) => {
|
|
22
|
+
const mockName = extractMockNameFromPrompt(prompt);
|
|
23
|
+
if (mockName && APP_GEN_MOCKS[mockName]) {
|
|
24
|
+
return APP_GEN_MOCKS[mockName];
|
|
25
|
+
}
|
|
26
|
+
return ("Could not find mock content for prompt. Please use a valid mock name with structure SB_MOCK_APP_<mock-name>. Currently available mocks are: " +
|
|
27
|
+
Object.keys(APP_GEN_MOCKS).join(", "));
|
|
28
|
+
};
|
|
42
29
|
export function extractMockNameFromPrompt(prompt) {
|
|
43
30
|
const mockMatch = prompt.match(/^SB_MOCK_APP_(\w+)$/);
|
|
44
31
|
return mockMatch?.[1] || null;
|
|
45
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Splits a mock response into chunks where:
|
|
35
|
+
* - Simple text sections are kept as single chunks
|
|
36
|
+
* - Each boltAction (between <boltAction> tags) is kept as a separate, complete chunk
|
|
37
|
+
* - Preserves the exact content and structure of boltActions
|
|
38
|
+
*/
|
|
39
|
+
export function splitGenMockIntoChunks(generationMock) {
|
|
40
|
+
const chunks = [];
|
|
41
|
+
let currentIndex = 0;
|
|
42
|
+
// Regular expression to match boltAction tags with their content
|
|
43
|
+
const boltActionRegex = /<boltAction[^>]*>[\s\S]*?<\/boltAction>/g;
|
|
44
|
+
let match;
|
|
45
|
+
while ((match = boltActionRegex.exec(generationMock)) !== null) {
|
|
46
|
+
const boltActionStart = match.index;
|
|
47
|
+
const boltActionEnd = boltActionStart + match[0].length;
|
|
48
|
+
// Add any text before this boltAction as a text chunk
|
|
49
|
+
if (boltActionStart > currentIndex) {
|
|
50
|
+
const textContent = generationMock
|
|
51
|
+
.slice(currentIndex, boltActionStart)
|
|
52
|
+
.trim();
|
|
53
|
+
if (textContent) {
|
|
54
|
+
chunks.push(textContent);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Add the boltAction as a separate chunk
|
|
58
|
+
chunks.push(match[0]);
|
|
59
|
+
currentIndex = boltActionEnd;
|
|
60
|
+
}
|
|
61
|
+
// Add any remaining text after the last boltAction
|
|
62
|
+
if (currentIndex < generationMock.length) {
|
|
63
|
+
const textContent = generationMock.slice(currentIndex).trim();
|
|
64
|
+
if (textContent) {
|
|
65
|
+
chunks.push(textContent);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return chunks;
|
|
69
|
+
}
|
|
46
70
|
//# sourceMappingURL=mock-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-utils.js","sourceRoot":"","sources":["../../../src/ai-service/test-utils/mock-utils.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,sCAAsC,CAAC;AACxE,OAAO,oBAAoB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"mock-utils.js","sourceRoot":"","sources":["../../../src/ai-service/test-utils/mock-utils.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,sCAAsC,CAAC;AACxE,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,oBAAoB,MAAM,qCAAqC,CAAC;AAEvE,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,SAAS,EAAE,oBAAoB;IAC/B,UAAU,EAAE,oBAAoB;IAChC,QAAQ,EAAE,mBAAmB;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAyB,EAAE,EAAE;IAChE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,W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AG;IACtB,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,EAAE,EACF,OAAO,EACP,UAAU,EACV,QAAQ,GACT,EAAE;IACD,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,GAAG,CAAC,CAAC,UAAU,CA8Bf;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,GACjB,CAAC,CAAC,YAAY,CAWhB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAgB,GACjB,EAAE;IACD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,QAgHA;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,EAClB,SAAS,SAAK,GACb,CAAC,CAAC,UAAU,CAkJd"}
|
package/dist/codegen.js
CHANGED
|
@@ -159,12 +159,18 @@ export function getPropertyExpression(info, fieldName = "") {
|
|
|
159
159
|
}
|
|
160
160
|
if (type === "EVENT") {
|
|
161
161
|
const code = parsingRegistry.EVENT.toCode(value, info);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
try {
|
|
163
|
+
const expression = parseExpression(code);
|
|
164
|
+
if (expression) {
|
|
165
|
+
return expression;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return t.stringLiteral(code);
|
|
169
|
+
}
|
|
165
170
|
}
|
|
166
|
-
|
|
167
|
-
|
|
171
|
+
catch (e) {
|
|
172
|
+
logger.error(`Error generating event code value: ${JSON.stringify(value)} ${type}`, getErrorMeta(e));
|
|
173
|
+
// do nothing to keep the original code
|
|
168
174
|
}
|
|
169
175
|
}
|
|
170
176
|
if (type === "EXPRESSION" && typeof value === "string") {
|
package/dist/codegen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAiB3D,MAAM,UAAU,kBAAkB,CAAC,EACjC,EAAE,EACF,OAAO,EACP,UAAU,EACV,QAAQ,GAMT;IACC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAClE,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAClC,CAAC;IAEF,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC;IAE1C,MAAM,cAAc,GAAG,CAAC,CAAC,iBAAiB,CACxC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,EACxB,UAA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C,CAAC,CAChB,CAAC;QACF,OAAO,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { applyErrorHandling, } from "../errors/error-handler.js";
|
|
|
4
4
|
import { unwrapResponseDto } from "../server-rpc/client.js";
|
|
5
5
|
import { getErrorMeta, getLogger } from "../util/logger.js";
|
|
6
6
|
const LOCK_HEARTBEAT_INTERVAL_MS = 30 * 1000; // 30 seconds
|
|
7
|
-
const SHUTDOWN_TIMEOUT_MS =
|
|
7
|
+
const SHUTDOWN_TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes TODO(David): Make this be called from launchdarkly
|
|
8
8
|
export var LockServiceStatus;
|
|
9
9
|
(function (LockServiceStatus) {
|
|
10
10
|
/** The lock service is not currently active */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lock-service/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAK5D,MAAM,0BAA0B,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAC3D,MAAM,mBAAmB,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lock-service/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AACpC,OAA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G,SAAS,CAAC;YAClC,MAAM,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,4GAA4G;IACrG,KAAK,CAAC,eAAe;QAC1B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/parsing/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { NodePath } from "@babel/traverse";
|
|
1
2
|
import t from "@babel/types";
|
|
2
3
|
import type { ParseResult } from "@babel/parser";
|
|
3
|
-
import type { NodePath } from "@babel/traverse";
|
|
4
4
|
import type { ObjectExpression, ObjectProperty, File, ArrowFunctionExpression, FunctionExpression } from "@babel/types";
|
|
5
5
|
export declare function objectToObjectExpression(obj: Record<string, unknown>): t.ObjectExpression;
|
|
6
6
|
export declare function objectExpressionToObject<T extends Record<string, unknown> = Record<string, unknown>>(obj: t.ObjectExpression, context?: Record<string, unknown>): T;
|