@wix/ditto-codegen-public 1.0.161 → 1.0.163
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/docs-output/api-docs/bookings-bookings-onBookingCanceled-doc.txt +169 -0
- package/dist/docs-output/api-docs/bookings-bookings-onBookingCreated-doc.txt +154 -0
- package/dist/docs-output/api-docs/crm-contacts-onContactCreated-doc.txt +87 -171
- package/dist/docs-output/api-docs/crm-contacts-onContactDeleted-doc.txt +58 -0
- package/dist/docs-output/api-docs/crm-contacts-onContactUpdated-doc.txt +99 -0
- package/dist/docs-output/api-docs/data-items-get-doc.txt +95 -54
- package/dist/docs-output/api-docs/data-items-insert-doc.txt +235 -43
- package/dist/docs-output/api-docs/data-items-onDataItemCreated-doc.txt +61 -0
- package/dist/docs-output/api-docs/data-items-onDataItemDeleted-doc.txt +58 -0
- package/dist/docs-output/api-docs/data-items-onDataItemUpdated-doc.txt +61 -0
- package/dist/docs-output/api-docs/data-items-query-doc.txt +507 -302
- package/dist/docs-output/api-docs/data-items-remove-doc.txt +120 -40
- package/dist/docs-output/api-docs/data-items-update-doc.txt +425 -46
- package/dist/docs-output/api-docs/ecom-cart-addToCart-doc.txt +488 -0
- package/dist/docs-output/api-docs/ecom-cart-createCart-doc.txt +518 -0
- package/dist/docs-output/api-docs/ecom-cart-createCheckout-doc.txt +155 -0
- package/dist/docs-output/api-docs/ecom-cart-deleteCart-doc.txt +92 -0
- package/dist/docs-output/api-docs/ecom-cart-getCart-doc.txt +376 -0
- package/dist/docs-output/api-docs/ecom-cart-onCartCreated-doc.txt +89 -80
- package/dist/docs-output/api-docs/ecom-cart-onCartUpdated-doc.txt +91 -81
- package/dist/docs-output/api-docs/ecom-cart-removeLineItemsFromCart-doc.txt +321 -0
- package/dist/docs-output/api-docs/ecom-cart-updateCart-doc.txt +539 -0
- package/dist/docs-output/api-docs/ecom-checkout-addToCheckout-doc.txt +1005 -0
- package/dist/docs-output/api-docs/ecom-checkout-createCheckout-doc.txt +1641 -0
- package/dist/docs-output/api-docs/ecom-checkout-getCheckout-doc.txt +1027 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutCompleted-doc.txt +151 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutCreated-doc.txt +150 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutUpdated-doc.txt +150 -0
- package/dist/docs-output/api-docs/ecom-checkout-removeLineItemsFromCheckout-doc.txt +879 -0
- package/dist/docs-output/api-docs/ecom-checkout-updateCheckout-doc.txt +1011 -0
- package/dist/docs-output/api-docs/ecom-currentCart-getCurrentCart-doc.txt +368 -322
- package/dist/docs-output/api-docs/ecom-currentCart-updateCurrentCart-doc.txt +506 -321
- package/dist/docs-output/api-docs/ecom-orders-bulkUpdateOrders-doc.txt +1040 -0
- package/dist/docs-output/api-docs/ecom-orders-cancelOrder-doc.txt +608 -0
- package/dist/docs-output/api-docs/ecom-orders-getOrder-doc.txt +926 -0
- package/dist/docs-output/api-docs/ecom-orders-onOrderCreated-doc.txt +245 -0
- package/dist/docs-output/api-docs/ecom-orders-onOrderUpdated-doc.txt +244 -0
- package/dist/docs-output/api-docs/ecom-orders-searchOrders-doc.txt +670 -0
- package/dist/docs-output/api-docs/ecom-orders-updateOrder-doc.txt +818 -0
- package/dist/docs-output/api-docs/search-wixSiteSearch-search-doc.txt +162 -0
- package/dist/docs-output/api-docs/stores-collections-addProductsToCollection-doc.txt +86 -0
- package/dist/docs-output/api-docs/stores-collections-createCollection-doc.txt +108 -0
- package/dist/docs-output/api-docs/stores-collections-getCollection-doc.txt +102 -0
- package/dist/docs-output/api-docs/stores-collections-queryCollections-doc.txt +209 -0
- package/dist/docs-output/api-docs/stores-collections-removeProductsFromCollection-doc.txt +86 -0
- package/dist/docs-output/api-docs/stores-collections-updateCollection-doc.txt +110 -0
- package/dist/docs-output/api-docs/stores-inventory-queryInventory-doc.txt +98 -0
- package/dist/docs-output/api-docs/stores-inventory-updateInventoryVariants-doc.txt +249 -0
- package/dist/docs-output/api-docs/stores-inventoryItemsV3-queryInventoryItems-doc.txt +236 -0
- package/dist/docs-output/api-docs/stores-inventoryItemsV3-updateInventoryItem-doc.txt +139 -0
- package/dist/docs-output/api-docs/stores-productsV3-createProduct-doc.txt +1697 -0
- package/dist/docs-output/api-docs/stores-productsV3-deleteProduct-doc.txt +73 -0
- package/dist/docs-output/api-docs/stores-productsV3-getProduct-doc.txt +933 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductCreated-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductDeleted-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductUpdated-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-queryProducts-doc.txt +1051 -0
- package/dist/docs-output/api-docs/stores-productsV3-searchProducts-doc.txt +1144 -0
- package/dist/docs-output/api-docs/stores-productsV3-updateProduct-doc.txt +1730 -1600
- package/dist/docs-output/api-docs/stores-readOnlyVariantsV3-queryVariants-doc.txt +290 -0
- package/dist/docs-output/api-docs/stores-readOnlyVariantsV3-searchVariants-doc.txt +353 -0
- package/dist/out.js +929 -79
- package/package.json +2 -2
- package/dist/docs-output/api-docs/data-items-onDataItemCreated.txt +0 -103
- package/dist/docs-output/api-docs/stores-product-onProductCreated-doc.txt +0 -118
- package/dist/docs-output/api-docs/stores-productV3-onProductCreated-doc.txt +0 -184
package/dist/out.js
CHANGED
|
@@ -112150,6 +112150,7 @@ var require_SystemPromptBuilder = __commonJS({
|
|
|
112150
112150
|
GeneralAgentType2["EXTENSION_SELECTOR"] = "EXTENSION_SELECTOR";
|
|
112151
112151
|
GeneralAgentType2["ITERATION_AGENT"] = "ITERATION_AGENT";
|
|
112152
112152
|
GeneralAgentType2["AUTO_PATTERN_DECISION"] = "AUTO_PATTERN_DECISION";
|
|
112153
|
+
GeneralAgentType2["SDK_PICKER"] = "SDK_PICKER";
|
|
112153
112154
|
})(GeneralAgentType || (exports2.GeneralAgentType = GeneralAgentType = {}));
|
|
112154
112155
|
var toPromptTag = (fromPromptType) => {
|
|
112155
112156
|
return `${fromPromptType}_PROMPT`;
|
|
@@ -116416,9 +116417,392 @@ var require_load_examples = __commonJS({
|
|
|
116416
116417
|
}
|
|
116417
116418
|
});
|
|
116418
116419
|
|
|
116419
|
-
// dist/system-prompts/
|
|
116420
|
-
var
|
|
116421
|
-
"dist/system-prompts/
|
|
116420
|
+
// dist/system-prompts/sdk/sdkConfig.js
|
|
116421
|
+
var require_sdkConfig = __commonJS({
|
|
116422
|
+
"dist/system-prompts/sdk/sdkConfig.js"(exports2) {
|
|
116423
|
+
"use strict";
|
|
116424
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116425
|
+
exports2.SDK_METHODS_CONFIG = exports2.getTag = void 0;
|
|
116426
|
+
var getTag = ({ apiName }) => {
|
|
116427
|
+
return apiName.replace(/\./g, "_");
|
|
116428
|
+
};
|
|
116429
|
+
exports2.getTag = getTag;
|
|
116430
|
+
exports2.SDK_METHODS_CONFIG = {
|
|
116431
|
+
// Products V3
|
|
116432
|
+
"stores.productsV3.queryProducts": {
|
|
116433
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/query-products",
|
|
116434
|
+
fileName: "stores-productsV3-queryProducts-doc.txt"
|
|
116435
|
+
},
|
|
116436
|
+
"stores.productsV3.searchProducts": {
|
|
116437
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/search-products",
|
|
116438
|
+
fileName: "stores-productsV3-searchProducts-doc.txt"
|
|
116439
|
+
},
|
|
116440
|
+
"stores.productsV3.getProduct": {
|
|
116441
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/get-product",
|
|
116442
|
+
fileName: "stores-productsV3-getProduct-doc.txt"
|
|
116443
|
+
},
|
|
116444
|
+
"stores.productsV3.createProduct": {
|
|
116445
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/create-product",
|
|
116446
|
+
fileName: "stores-productsV3-createProduct-doc.txt"
|
|
116447
|
+
},
|
|
116448
|
+
"stores.productsV3.updateProduct": {
|
|
116449
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/update-product",
|
|
116450
|
+
fileName: "stores-productsV3-updateProduct-doc.txt"
|
|
116451
|
+
},
|
|
116452
|
+
"stores.productsV3.deleteProduct": {
|
|
116453
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/delete-product",
|
|
116454
|
+
fileName: "stores-productsV3-deleteProduct-doc.txt"
|
|
116455
|
+
},
|
|
116456
|
+
// Product Variants
|
|
116457
|
+
"stores.readOnlyVariantsV3.queryVariants": {
|
|
116458
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/read-only-variants-v3/query-variants",
|
|
116459
|
+
fileName: "stores-readOnlyVariantsV3-queryVariants-doc.txt"
|
|
116460
|
+
},
|
|
116461
|
+
"stores.readOnlyVariantsV3.searchVariants": {
|
|
116462
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/read-only-variants-v3/search-variants",
|
|
116463
|
+
fileName: "stores-readOnlyVariantsV3-searchVariants-doc.txt"
|
|
116464
|
+
},
|
|
116465
|
+
// Inventory
|
|
116466
|
+
"stores.inventory.queryInventory": {
|
|
116467
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/inventory/query-inventory",
|
|
116468
|
+
fileName: "stores-inventory-queryInventory-doc.txt"
|
|
116469
|
+
},
|
|
116470
|
+
"stores.inventory.updateInventoryVariants": {
|
|
116471
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/inventory/update-inventory-variants",
|
|
116472
|
+
fileName: "stores-inventory-updateInventoryVariants-doc.txt"
|
|
116473
|
+
},
|
|
116474
|
+
"stores.inventoryItemsV3.queryInventoryItems": {
|
|
116475
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/inventory-items-v3/query-inventory-items",
|
|
116476
|
+
fileName: "stores-inventoryItemsV3-queryInventoryItems-doc.txt"
|
|
116477
|
+
},
|
|
116478
|
+
"stores.inventoryItemsV3.updateInventoryItem": {
|
|
116479
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/inventory-items-v3/update-inventory-item",
|
|
116480
|
+
fileName: "stores-inventoryItemsV3-updateInventoryItem-doc.txt"
|
|
116481
|
+
},
|
|
116482
|
+
// Cart Operations
|
|
116483
|
+
"ecom.cart.createCart": {
|
|
116484
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/create-cart",
|
|
116485
|
+
fileName: "ecom-cart-createCart-doc.txt"
|
|
116486
|
+
},
|
|
116487
|
+
"ecom.cart.updateCart": {
|
|
116488
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/update-cart",
|
|
116489
|
+
fileName: "ecom-cart-updateCart-doc.txt"
|
|
116490
|
+
},
|
|
116491
|
+
"ecom.cart.getCart": {
|
|
116492
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/get-cart",
|
|
116493
|
+
fileName: "ecom-cart-getCart-doc.txt"
|
|
116494
|
+
},
|
|
116495
|
+
"ecom.cart.deleteCart": {
|
|
116496
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/delete-cart",
|
|
116497
|
+
fileName: "ecom-cart-deleteCart-doc.txt"
|
|
116498
|
+
},
|
|
116499
|
+
"ecom.cart.addToCart": {
|
|
116500
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/add-to-cart",
|
|
116501
|
+
fileName: "ecom-cart-addToCart-doc.txt"
|
|
116502
|
+
},
|
|
116503
|
+
"ecom.cart.removeLineItemsFromCart": {
|
|
116504
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/remove-line-items",
|
|
116505
|
+
fileName: "ecom-cart-removeLineItemsFromCart-doc.txt"
|
|
116506
|
+
},
|
|
116507
|
+
"ecom.cart.createCheckout": {
|
|
116508
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/create-checkout",
|
|
116509
|
+
fileName: "ecom-cart-createCheckout-doc.txt"
|
|
116510
|
+
},
|
|
116511
|
+
"ecom.currentCart.getCurrentCart": {
|
|
116512
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/current-cart/get-current-cart",
|
|
116513
|
+
fileName: "ecom-currentCart-getCurrentCart-doc.txt"
|
|
116514
|
+
},
|
|
116515
|
+
"ecom.currentCart.updateCurrentCart": {
|
|
116516
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/current-cart/update-current-cart",
|
|
116517
|
+
fileName: "ecom-currentCart-updateCurrentCart-doc.txt"
|
|
116518
|
+
},
|
|
116519
|
+
// Checkout
|
|
116520
|
+
"ecom.checkout.createCheckout": {
|
|
116521
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/create-checkout",
|
|
116522
|
+
fileName: "ecom-checkout-createCheckout-doc.txt"
|
|
116523
|
+
},
|
|
116524
|
+
"ecom.checkout.getCheckout": {
|
|
116525
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/get-checkout",
|
|
116526
|
+
fileName: "ecom-checkout-getCheckout-doc.txt"
|
|
116527
|
+
},
|
|
116528
|
+
"ecom.checkout.updateCheckout": {
|
|
116529
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/update-checkout",
|
|
116530
|
+
fileName: "ecom-checkout-updateCheckout-doc.txt"
|
|
116531
|
+
},
|
|
116532
|
+
"ecom.checkout.addToCheckout": {
|
|
116533
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/add-to-checkout",
|
|
116534
|
+
fileName: "ecom-checkout-addToCheckout-doc.txt"
|
|
116535
|
+
},
|
|
116536
|
+
"ecom.checkout.removeLineItemsFromCheckout": {
|
|
116537
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/remove-line-items",
|
|
116538
|
+
fileName: "ecom-checkout-removeLineItemsFromCheckout-doc.txt"
|
|
116539
|
+
},
|
|
116540
|
+
// Orders
|
|
116541
|
+
"ecom.orders.getOrder": {
|
|
116542
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/get-order",
|
|
116543
|
+
fileName: "ecom-orders-getOrder-doc.txt"
|
|
116544
|
+
},
|
|
116545
|
+
"ecom.orders.searchOrders": {
|
|
116546
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/search-orders",
|
|
116547
|
+
fileName: "ecom-orders-searchOrders-doc.txt"
|
|
116548
|
+
},
|
|
116549
|
+
"ecom.orders.updateOrder": {
|
|
116550
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/update-order",
|
|
116551
|
+
fileName: "ecom-orders-updateOrder-doc.txt"
|
|
116552
|
+
},
|
|
116553
|
+
"ecom.orders.bulkUpdateOrders": {
|
|
116554
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/bulk-update-orders",
|
|
116555
|
+
fileName: "ecom-orders-bulkUpdateOrders-doc.txt"
|
|
116556
|
+
},
|
|
116557
|
+
"ecom.orders.cancelOrder": {
|
|
116558
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/cancel-order",
|
|
116559
|
+
fileName: "ecom-orders-cancelOrder-doc.txt"
|
|
116560
|
+
},
|
|
116561
|
+
// Collections
|
|
116562
|
+
"stores.collections.queryCollections": {
|
|
116563
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/collections/query-collections",
|
|
116564
|
+
fileName: "stores-collections-queryCollections-doc.txt"
|
|
116565
|
+
},
|
|
116566
|
+
"stores.collections.getCollection": {
|
|
116567
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/collections/get-collection",
|
|
116568
|
+
fileName: "stores-collections-getCollection-doc.txt"
|
|
116569
|
+
},
|
|
116570
|
+
"stores.collections.createCollection": {
|
|
116571
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/products/create-collection",
|
|
116572
|
+
fileName: "stores-collections-createCollection-doc.txt"
|
|
116573
|
+
},
|
|
116574
|
+
"stores.collections.updateCollection": {
|
|
116575
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/products/update-collection",
|
|
116576
|
+
fileName: "stores-collections-updateCollection-doc.txt"
|
|
116577
|
+
},
|
|
116578
|
+
"stores.collections.addProductsToCollection": {
|
|
116579
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/products/add-products-to-collection",
|
|
116580
|
+
fileName: "stores-collections-addProductsToCollection-doc.txt"
|
|
116581
|
+
},
|
|
116582
|
+
"stores.collections.removeProductsFromCollection": {
|
|
116583
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/products/remove-products-from-collection",
|
|
116584
|
+
fileName: "stores-collections-removeProductsFromCollection-doc.txt"
|
|
116585
|
+
},
|
|
116586
|
+
// Search
|
|
116587
|
+
"search.wixSiteSearch.search": {
|
|
116588
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/search/wix-site-search/search",
|
|
116589
|
+
fileName: "search-wixSiteSearch-search-doc.txt"
|
|
116590
|
+
},
|
|
116591
|
+
// Data Management
|
|
116592
|
+
"data.items.query": {
|
|
116593
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/data/items/query",
|
|
116594
|
+
fileName: "data-items-query-doc.txt"
|
|
116595
|
+
},
|
|
116596
|
+
"data.items.insert": {
|
|
116597
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/data/items/insert",
|
|
116598
|
+
fileName: "data-items-insert-doc.txt"
|
|
116599
|
+
},
|
|
116600
|
+
"data.items.update": {
|
|
116601
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/data/items/update",
|
|
116602
|
+
fileName: "data-items-update-doc.txt"
|
|
116603
|
+
},
|
|
116604
|
+
"data.items.remove": {
|
|
116605
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/data/items/remove",
|
|
116606
|
+
fileName: "data-items-remove-doc.txt"
|
|
116607
|
+
},
|
|
116608
|
+
"data.items.get": {
|
|
116609
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/data/items/get",
|
|
116610
|
+
fileName: "data-items-get-doc.txt"
|
|
116611
|
+
},
|
|
116612
|
+
// Webhooks - Cart
|
|
116613
|
+
"ecom.cart.onCartCreated": {
|
|
116614
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/on-cart-created",
|
|
116615
|
+
fileName: "ecom-cart-onCartCreated-doc.txt",
|
|
116616
|
+
example: `import { cart } from "@wix/ecom";
|
|
116617
|
+
|
|
116618
|
+
cart.onCartCreated((event) => {
|
|
116619
|
+
// handle your event here
|
|
116620
|
+
});
|
|
116621
|
+
`
|
|
116622
|
+
},
|
|
116623
|
+
"ecom.cart.onCartUpdated": {
|
|
116624
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/cart/on-cart-updated",
|
|
116625
|
+
fileName: "ecom-cart-onCartUpdated-doc.txt",
|
|
116626
|
+
example: `import { cart } from "@wix/ecom";
|
|
116627
|
+
|
|
116628
|
+
cart.onCartUpdated((event) => {
|
|
116629
|
+
// handle your event here
|
|
116630
|
+
});
|
|
116631
|
+
`
|
|
116632
|
+
},
|
|
116633
|
+
// Webhooks - Checkout
|
|
116634
|
+
"ecom.checkout.onCheckoutCreated": {
|
|
116635
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/on-checkout-created",
|
|
116636
|
+
fileName: "ecom-checkout-onCheckoutCreated-doc.txt",
|
|
116637
|
+
example: `import { checkout } from "@wix/ecom";
|
|
116638
|
+
|
|
116639
|
+
checkout.onCheckoutCreated((event) => {
|
|
116640
|
+
// handle your event here
|
|
116641
|
+
});
|
|
116642
|
+
`
|
|
116643
|
+
},
|
|
116644
|
+
"ecom.checkout.onCheckoutUpdated": {
|
|
116645
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/on-checkout-updated",
|
|
116646
|
+
fileName: "ecom-checkout-onCheckoutUpdated-doc.txt",
|
|
116647
|
+
example: `import { checkout } from "@wix/ecom";
|
|
116648
|
+
|
|
116649
|
+
checkout.onCheckoutUpdated((event) => {
|
|
116650
|
+
// handle your event here
|
|
116651
|
+
});
|
|
116652
|
+
`
|
|
116653
|
+
},
|
|
116654
|
+
"ecom.checkout.onCheckoutCompleted": {
|
|
116655
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/on-checkout-completed",
|
|
116656
|
+
fileName: "ecom-checkout-onCheckoutCompleted-doc.txt",
|
|
116657
|
+
example: `import { checkout } from "@wix/ecom";
|
|
116658
|
+
|
|
116659
|
+
checkout.onCheckoutCompleted((event) => {
|
|
116660
|
+
// handle your event here
|
|
116661
|
+
});
|
|
116662
|
+
`
|
|
116663
|
+
},
|
|
116664
|
+
// Webhooks - Orders
|
|
116665
|
+
"ecom.orders.onOrderCreated": {
|
|
116666
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/on-order-created",
|
|
116667
|
+
fileName: "ecom-orders-onOrderCreated-doc.txt",
|
|
116668
|
+
example: `import { orders } from "@wix/pricing-plans";
|
|
116669
|
+
|
|
116670
|
+
orders.onOrderCreated((event) => {
|
|
116671
|
+
// handle your event here
|
|
116672
|
+
});
|
|
116673
|
+
`
|
|
116674
|
+
},
|
|
116675
|
+
"ecom.orders.onOrderUpdated": {
|
|
116676
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/on-order-updated",
|
|
116677
|
+
fileName: "ecom-orders-onOrderUpdated-doc.txt",
|
|
116678
|
+
example: `import { orders } from "@wix/pricing-plans";
|
|
116679
|
+
|
|
116680
|
+
orders.onOrderUpdated((event) => {
|
|
116681
|
+
// handle your event here
|
|
116682
|
+
});
|
|
116683
|
+
`
|
|
116684
|
+
},
|
|
116685
|
+
// Webhooks - Products
|
|
116686
|
+
"stores.productsV3.onProductCreated": {
|
|
116687
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/on-product-created",
|
|
116688
|
+
fileName: "stores-productsV3-onProductCreated-doc.txt",
|
|
116689
|
+
example: `import { productsV3 } from "@wix/stores";
|
|
116690
|
+
|
|
116691
|
+
productsV3.onProductCreated((event) => {
|
|
116692
|
+
// handle your event here
|
|
116693
|
+
});
|
|
116694
|
+
`
|
|
116695
|
+
},
|
|
116696
|
+
"stores.productsV3.onProductDeleted": {
|
|
116697
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/on-product-deleted",
|
|
116698
|
+
fileName: "stores-productsV3-onProductDeleted-doc.txt",
|
|
116699
|
+
example: `import { productsV3 } from "@wix/stores";
|
|
116700
|
+
|
|
116701
|
+
productsV3.onProductDeleted((event) => {
|
|
116702
|
+
// handle your event here
|
|
116703
|
+
});
|
|
116704
|
+
`
|
|
116705
|
+
},
|
|
116706
|
+
"stores.productsV3.onProductUpdated": {
|
|
116707
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/on-product-updated",
|
|
116708
|
+
fileName: "stores-productsV3-onProductUpdated-doc.txt",
|
|
116709
|
+
example: `import { productsV3 } from "@wix/stores";
|
|
116710
|
+
|
|
116711
|
+
productsV3.onProductUpdated((event) => {
|
|
116712
|
+
// handle your event here
|
|
116713
|
+
});
|
|
116714
|
+
`
|
|
116715
|
+
},
|
|
116716
|
+
// Webhooks - CRM
|
|
116717
|
+
"crm.contacts.onContactCreated": {
|
|
116718
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/crm/contacts/on-contact-created",
|
|
116719
|
+
fileName: "crm-contacts-onContactCreated-doc.txt",
|
|
116720
|
+
example: `import { contacts } from "@wix/crm";
|
|
116721
|
+
|
|
116722
|
+
contacts.onContactCreated((event) => {
|
|
116723
|
+
// handle your event here
|
|
116724
|
+
});
|
|
116725
|
+
`
|
|
116726
|
+
},
|
|
116727
|
+
"crm.contacts.onContactUpdated": {
|
|
116728
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/crm/contacts/on-contact-updated",
|
|
116729
|
+
fileName: "crm-contacts-onContactUpdated-doc.txt",
|
|
116730
|
+
example: `import { contacts } from "@wix/crm";
|
|
116731
|
+
|
|
116732
|
+
contacts.onContactUpdated((event) => {
|
|
116733
|
+
// handle your event here
|
|
116734
|
+
});
|
|
116735
|
+
`
|
|
116736
|
+
},
|
|
116737
|
+
"crm.contacts.onContactDeleted": {
|
|
116738
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/crm/contacts/on-contact-deleted",
|
|
116739
|
+
fileName: "crm-contacts-onContactDeleted-doc.txt",
|
|
116740
|
+
example: `import { contacts } from "@wix/crm";
|
|
116741
|
+
|
|
116742
|
+
contacts.onContactDeleted((event) => {
|
|
116743
|
+
// handle your event here
|
|
116744
|
+
});
|
|
116745
|
+
`
|
|
116746
|
+
},
|
|
116747
|
+
// Webhooks - Data
|
|
116748
|
+
"data.items.onDataItemCreated": {
|
|
116749
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/data/items/on-data-item-created",
|
|
116750
|
+
fileName: "data-items-onDataItemCreated-doc.txt",
|
|
116751
|
+
example: `import { items } from "@wix/data";
|
|
116752
|
+
|
|
116753
|
+
items.onDataItemCreated((event) => {
|
|
116754
|
+
// handle your event here
|
|
116755
|
+
});
|
|
116756
|
+
`
|
|
116757
|
+
},
|
|
116758
|
+
"data.items.onDataItemUpdated": {
|
|
116759
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/data/items/on-data-item-updated",
|
|
116760
|
+
fileName: "data-items-onDataItemUpdated-doc.txt",
|
|
116761
|
+
example: `import { items } from "@wix/data";
|
|
116762
|
+
|
|
116763
|
+
items.onDataItemUpdated((event) => {
|
|
116764
|
+
// handle your event here
|
|
116765
|
+
});
|
|
116766
|
+
`
|
|
116767
|
+
},
|
|
116768
|
+
"data.items.onDataItemDeleted": {
|
|
116769
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/data/items/on-data-item-deleted",
|
|
116770
|
+
fileName: "data-items-onDataItemDeleted-doc.txt",
|
|
116771
|
+
example: `import { items } from "@wix/data";
|
|
116772
|
+
|
|
116773
|
+
items.onDataItemDeleted((event) => {
|
|
116774
|
+
// handle your event here
|
|
116775
|
+
});
|
|
116776
|
+
`
|
|
116777
|
+
},
|
|
116778
|
+
// Webhooks - Bookings
|
|
116779
|
+
"bookings.bookings.onBookingCreated": {
|
|
116780
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/on-booking-created",
|
|
116781
|
+
fileName: "bookings-bookings-onBookingCreated-doc.txt",
|
|
116782
|
+
example: `import { bookings } from "@wix/bookings";
|
|
116783
|
+
|
|
116784
|
+
bookings.onBookingCreated((event) => {
|
|
116785
|
+
// handle your event here
|
|
116786
|
+
});
|
|
116787
|
+
`
|
|
116788
|
+
},
|
|
116789
|
+
"bookings.bookings.onBookingCanceled": {
|
|
116790
|
+
url: "https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/on-booking-canceled",
|
|
116791
|
+
fileName: "bookings-bookings-onBookingCanceled-doc.txt",
|
|
116792
|
+
example: `import { bookings } from "@wix/bookings";
|
|
116793
|
+
|
|
116794
|
+
bookings.onBookingCanceled((event) => {
|
|
116795
|
+
// handle your event here
|
|
116796
|
+
});
|
|
116797
|
+
`
|
|
116798
|
+
}
|
|
116799
|
+
};
|
|
116800
|
+
}
|
|
116801
|
+
});
|
|
116802
|
+
|
|
116803
|
+
// dist/system-prompts/sdk/apiDocLoader.js
|
|
116804
|
+
var require_apiDocLoader = __commonJS({
|
|
116805
|
+
"dist/system-prompts/sdk/apiDocLoader.js"(exports2) {
|
|
116422
116806
|
"use strict";
|
|
116423
116807
|
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
116424
116808
|
if (k2 === void 0) k2 = k;
|
|
@@ -116461,86 +116845,51 @@ var require_docLoader = __commonJS({
|
|
|
116461
116845
|
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
116462
116846
|
};
|
|
116463
116847
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116464
|
-
exports2.
|
|
116465
|
-
|
|
116848
|
+
exports2.loadApiDocumentation = void 0;
|
|
116849
|
+
var sdkConfig_1 = require_sdkConfig();
|
|
116466
116850
|
var path_1 = __importDefault2(require("path"));
|
|
116467
116851
|
var fs4 = __importStar2(require("fs"));
|
|
116468
|
-
var
|
|
116469
|
-
|
|
116470
|
-
|
|
116471
|
-
|
|
116472
|
-
|
|
116473
|
-
|
|
116474
|
-
|
|
116852
|
+
var DATA_API_NAMES = [
|
|
116853
|
+
"data.items.query",
|
|
116854
|
+
"data.items.insert",
|
|
116855
|
+
"data.items.remove",
|
|
116856
|
+
"data.items.update",
|
|
116857
|
+
"data.items.get"
|
|
116858
|
+
];
|
|
116859
|
+
var loadApiDocumentation = ({ apiNames, useData }) => {
|
|
116860
|
+
const apisToLoad = useData ? Array.from(/* @__PURE__ */ new Set([...apiNames, ...DATA_API_NAMES])) : apiNames;
|
|
116861
|
+
return loadDocumentation({
|
|
116862
|
+
apiNames: apisToLoad,
|
|
116863
|
+
apiMethods: sdkConfig_1.SDK_METHODS_CONFIG
|
|
116864
|
+
});
|
|
116865
|
+
};
|
|
116866
|
+
exports2.loadApiDocumentation = loadApiDocumentation;
|
|
116867
|
+
var loadDocumentation = ({ apiNames, apiMethods }) => {
|
|
116868
|
+
if (!apiNames || apiNames.length === 0) {
|
|
116475
116869
|
return "";
|
|
116476
116870
|
}
|
|
116477
116871
|
const loadedDocs = /* @__PURE__ */ new Set();
|
|
116478
116872
|
let combinedContent = "";
|
|
116479
|
-
for (const
|
|
116480
|
-
const
|
|
116481
|
-
if (
|
|
116873
|
+
for (const apiName of apiNames) {
|
|
116874
|
+
const config = apiMethods[apiName];
|
|
116875
|
+
if (config && !loadedDocs.has(config.fileName)) {
|
|
116482
116876
|
try {
|
|
116483
|
-
const
|
|
116484
|
-
const docPath = path_1.default.join(__dirname, "docs-output", docsSubDir, docFileName);
|
|
116877
|
+
const docPath = path_1.default.join(__dirname, "docs-output", "api-docs", config.fileName);
|
|
116485
116878
|
if (fs4.existsSync(docPath)) {
|
|
116486
116879
|
const docContent = fs4.readFileSync(docPath, "utf8");
|
|
116487
116880
|
combinedContent += docContent + "\n";
|
|
116488
|
-
loadedDocs.add(
|
|
116489
|
-
console.log(`\u2713 Loaded
|
|
116881
|
+
loadedDocs.add(config.fileName);
|
|
116882
|
+
console.log(`\u2713 Loaded API documentation: ${config.fileName}`);
|
|
116490
116883
|
} else {
|
|
116491
|
-
console.warn(`\u26A0
|
|
116884
|
+
console.warn(`\u26A0 API documentation not found: ${docPath}`);
|
|
116492
116885
|
}
|
|
116493
116886
|
} catch (error) {
|
|
116494
|
-
console.error(`\u2717 Failed to load
|
|
116887
|
+
console.error(`\u2717 Failed to load API documentation for ${apiName}:`, error);
|
|
116495
116888
|
}
|
|
116496
116889
|
}
|
|
116497
116890
|
}
|
|
116498
116891
|
return combinedContent.trim();
|
|
116499
|
-
}
|
|
116500
|
-
}
|
|
116501
|
-
});
|
|
116502
|
-
|
|
116503
|
-
// dist/system-prompts/common/apiDocLoader.js
|
|
116504
|
-
var require_apiDocLoader = __commonJS({
|
|
116505
|
-
"dist/system-prompts/common/apiDocLoader.js"(exports2) {
|
|
116506
|
-
"use strict";
|
|
116507
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116508
|
-
exports2.loadApiDocumentation = loadApiDocumentation;
|
|
116509
|
-
var docLoader_1 = require_docLoader();
|
|
116510
|
-
var API_TO_DOC_MAPPING = {
|
|
116511
|
-
"stores.productsV3.updateProduct": "stores-productsV3-updateProduct-doc.txt",
|
|
116512
|
-
"stores.productsV3.onProductCreated": "stores-productV3-onProductCreated-doc.txt",
|
|
116513
|
-
"data.items.onDataItemCreated": "data-items-onDataItemCreated.txt",
|
|
116514
|
-
"data.items.query": "data-items-query-doc.txt",
|
|
116515
|
-
"data.items.insert": "data-items-insert-doc.txt",
|
|
116516
|
-
"data.items.remove": "data-items-remove-doc.txt",
|
|
116517
|
-
"data.items.update": "data-items-update-doc.txt",
|
|
116518
|
-
"data.items.get": "data-items-get-doc.txt",
|
|
116519
|
-
"crm.contacts.onContactCreated": "crm-contacts-onContactCreated-doc.txt",
|
|
116520
|
-
"ecom.cart.onCartCreated": "ecom-cart-onCartCreated-doc.txt",
|
|
116521
|
-
"ecom.cart.onCartUpdated": "ecom-cart-onCartUpdated-doc.txt",
|
|
116522
|
-
"ecom.currentCart.getCurrentCart": "ecom-currentCart-getCurrentCart-doc.txt",
|
|
116523
|
-
"ecom.currentCart.updateCurrentCart": "ecom-currentCart-updateCurrentCart-doc.txt"
|
|
116524
116892
|
};
|
|
116525
|
-
var DATA_API_NAMES = [
|
|
116526
|
-
"data.items.query",
|
|
116527
|
-
"data.items.insert",
|
|
116528
|
-
"data.items.remove",
|
|
116529
|
-
"data.items.update",
|
|
116530
|
-
"data.items.get"
|
|
116531
|
-
];
|
|
116532
|
-
function loadApiDocumentation(apiNames, useData, loadAllApiDocs) {
|
|
116533
|
-
let apisToLoad = [];
|
|
116534
|
-
if (loadAllApiDocs) {
|
|
116535
|
-
apisToLoad = Object.keys(API_TO_DOC_MAPPING);
|
|
116536
|
-
} else if (useData) {
|
|
116537
|
-
apisToLoad = Array.from(/* @__PURE__ */ new Set([...apiNames, ...DATA_API_NAMES]));
|
|
116538
|
-
} else {
|
|
116539
|
-
apisToLoad = apiNames;
|
|
116540
|
-
}
|
|
116541
|
-
const apiDocs = (0, docLoader_1.loadDocumentation)(apisToLoad, API_TO_DOC_MAPPING, docLoader_1.DocType.API);
|
|
116542
|
-
return apiDocs || "";
|
|
116543
|
-
}
|
|
116544
116893
|
}
|
|
116545
116894
|
});
|
|
116546
116895
|
|
|
@@ -116646,7 +116995,10 @@ ${(0, error_handling_1.errorHandling)()}`;
|
|
|
116646
116995
|
if (this.apiNames.length === 0 && !this.useData && !this.useIteration) {
|
|
116647
116996
|
return this;
|
|
116648
116997
|
}
|
|
116649
|
-
const apiDocs = (0, apiDocLoader_1.loadApiDocumentation)(
|
|
116998
|
+
const apiDocs = (0, apiDocLoader_1.loadApiDocumentation)({
|
|
116999
|
+
apiNames: this.apiNames,
|
|
117000
|
+
useData: this.useData
|
|
117001
|
+
});
|
|
116650
117002
|
if (apiDocs) {
|
|
116651
117003
|
this.withSection(SystemPromptBuilder_1.CommonSections.API_DOCS, apiDocs);
|
|
116652
117004
|
}
|
|
@@ -117275,6 +117627,83 @@ var require_CustomElementAgent2 = __commonJS({
|
|
|
117275
117627
|
}
|
|
117276
117628
|
});
|
|
117277
117629
|
|
|
117630
|
+
// dist/system-prompts/common/docLoader.js
|
|
117631
|
+
var require_docLoader = __commonJS({
|
|
117632
|
+
"dist/system-prompts/common/docLoader.js"(exports2) {
|
|
117633
|
+
"use strict";
|
|
117634
|
+
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
117635
|
+
if (k2 === void 0) k2 = k;
|
|
117636
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
117637
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
117638
|
+
desc = { enumerable: true, get: function() {
|
|
117639
|
+
return m[k];
|
|
117640
|
+
} };
|
|
117641
|
+
}
|
|
117642
|
+
Object.defineProperty(o, k2, desc);
|
|
117643
|
+
}) : (function(o, m, k, k2) {
|
|
117644
|
+
if (k2 === void 0) k2 = k;
|
|
117645
|
+
o[k2] = m[k];
|
|
117646
|
+
}));
|
|
117647
|
+
var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
117648
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
117649
|
+
}) : function(o, v) {
|
|
117650
|
+
o["default"] = v;
|
|
117651
|
+
});
|
|
117652
|
+
var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
117653
|
+
var ownKeys2 = function(o) {
|
|
117654
|
+
ownKeys2 = Object.getOwnPropertyNames || function(o2) {
|
|
117655
|
+
var ar = [];
|
|
117656
|
+
for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
|
|
117657
|
+
return ar;
|
|
117658
|
+
};
|
|
117659
|
+
return ownKeys2(o);
|
|
117660
|
+
};
|
|
117661
|
+
return function(mod2) {
|
|
117662
|
+
if (mod2 && mod2.__esModule) return mod2;
|
|
117663
|
+
var result = {};
|
|
117664
|
+
if (mod2 != null) {
|
|
117665
|
+
for (var k = ownKeys2(mod2), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod2, k[i]);
|
|
117666
|
+
}
|
|
117667
|
+
__setModuleDefault2(result, mod2);
|
|
117668
|
+
return result;
|
|
117669
|
+
};
|
|
117670
|
+
})();
|
|
117671
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
117672
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
117673
|
+
};
|
|
117674
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117675
|
+
exports2.loadDocumentation = loadDocumentation;
|
|
117676
|
+
var path_1 = __importDefault2(require("path"));
|
|
117677
|
+
var fs4 = __importStar2(require("fs"));
|
|
117678
|
+
function loadDocumentation(items, mapping) {
|
|
117679
|
+
if (!items || items.length === 0) {
|
|
117680
|
+
return "";
|
|
117681
|
+
}
|
|
117682
|
+
const loadedDocs = /* @__PURE__ */ new Set();
|
|
117683
|
+
let combinedContent = "";
|
|
117684
|
+
for (const item of items) {
|
|
117685
|
+
const docFileName = mapping[item];
|
|
117686
|
+
if (docFileName && !loadedDocs.has(docFileName)) {
|
|
117687
|
+
try {
|
|
117688
|
+
const docPath = path_1.default.join(__dirname, "docs-output", "service-plugins", docFileName);
|
|
117689
|
+
if (fs4.existsSync(docPath)) {
|
|
117690
|
+
const docContent = fs4.readFileSync(docPath, "utf8");
|
|
117691
|
+
combinedContent += docContent + "\n";
|
|
117692
|
+
loadedDocs.add(docFileName);
|
|
117693
|
+
console.log(`\u2713 Loaded service plugin documentation: ${docFileName}`);
|
|
117694
|
+
} else {
|
|
117695
|
+
console.warn(`\u26A0 service plugin documentation not found: ${docPath}`);
|
|
117696
|
+
}
|
|
117697
|
+
} catch (error) {
|
|
117698
|
+
console.error(`\u2717 Failed to load service plugin documentation for ${item}:`, error);
|
|
117699
|
+
}
|
|
117700
|
+
}
|
|
117701
|
+
}
|
|
117702
|
+
return combinedContent.trim();
|
|
117703
|
+
}
|
|
117704
|
+
}
|
|
117705
|
+
});
|
|
117706
|
+
|
|
117278
117707
|
// dist/system-prompts/servicePlugin/servicePluginDocLoader.js
|
|
117279
117708
|
var require_servicePluginDocLoader = __commonJS({
|
|
117280
117709
|
"dist/system-prompts/servicePlugin/servicePluginDocLoader.js"(exports2) {
|
|
@@ -117297,7 +117726,7 @@ var require_servicePluginDocLoader = __commonJS({
|
|
|
117297
117726
|
"ecom.catalog.getCatalogItems": "ecom-catalog-doc.txt"
|
|
117298
117727
|
};
|
|
117299
117728
|
function loadServicePluginDocumentation(spiNames) {
|
|
117300
|
-
return (0, docLoader_1.loadDocumentation)(spiNames, SPI_TO_DOC_MAPPING
|
|
117729
|
+
return (0, docLoader_1.loadDocumentation)(spiNames, SPI_TO_DOC_MAPPING);
|
|
117301
117730
|
}
|
|
117302
117731
|
}
|
|
117303
117732
|
});
|
|
@@ -118172,15 +118601,15 @@ var require_utils11 = __commonJS({
|
|
|
118172
118601
|
}
|
|
118173
118602
|
});
|
|
118174
118603
|
|
|
118175
|
-
// dist/agents/Iteration/
|
|
118176
|
-
var
|
|
118177
|
-
"dist/agents/Iteration/
|
|
118604
|
+
// dist/agents/Iteration/utils/extensionFormatters.js
|
|
118605
|
+
var require_extensionFormatters = __commonJS({
|
|
118606
|
+
"dist/agents/Iteration/utils/extensionFormatters.js"(exports2) {
|
|
118178
118607
|
"use strict";
|
|
118179
118608
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
118609
|
+
exports2.formatIterationPlanExtension = void 0;
|
|
118180
118610
|
exports2.formatEvaluationResultsExtensions = formatEvaluationResultsExtensions;
|
|
118181
118611
|
exports2.formatContextExtensions = formatContextExtensions;
|
|
118182
118612
|
exports2.formatScannedExtensions = formatScannedExtensions;
|
|
118183
|
-
exports2.buildContextSections = buildContextSections;
|
|
118184
118613
|
var utils_1 = require_utils11();
|
|
118185
118614
|
function formatEvaluationResultsExtensions(extensions) {
|
|
118186
118615
|
if (!extensions || extensions.length === 0)
|
|
@@ -118197,6 +118626,25 @@ var require_iterationAgentsTools = __commonJS({
|
|
|
118197
118626
|
return lines.join("\n");
|
|
118198
118627
|
}).join("\n\n");
|
|
118199
118628
|
}
|
|
118629
|
+
var formatIterationPlanExtension = ({ ext, id, outputPath }) => {
|
|
118630
|
+
const lines = [
|
|
118631
|
+
`**ID: ${id}**`,
|
|
118632
|
+
`- Name: ${ext.extension.name}`,
|
|
118633
|
+
`- Type: ${ext.extension.type}`,
|
|
118634
|
+
`- Description: ${ext.extension.description}`
|
|
118635
|
+
];
|
|
118636
|
+
const relevantFilesContent = (0, utils_1.loadRelevantFilesAsString)(ext.paths || [], outputPath);
|
|
118637
|
+
if (relevantFilesContent && relevantFilesContent !== "None") {
|
|
118638
|
+
lines.push(`- Relevant Files Content:
|
|
118639
|
+
${relevantFilesContent}`);
|
|
118640
|
+
}
|
|
118641
|
+
if (ext.extension.relatedSpis && ext.extension.relatedSpis.length > 0) {
|
|
118642
|
+
lines.push(`- Current SPIs: ${ext.extension.relatedSpis.map((spi) => spi.name).join(", ")}`);
|
|
118643
|
+
}
|
|
118644
|
+
lines.push("");
|
|
118645
|
+
return lines;
|
|
118646
|
+
};
|
|
118647
|
+
exports2.formatIterationPlanExtension = formatIterationPlanExtension;
|
|
118200
118648
|
function formatContextExtensions(extensions) {
|
|
118201
118649
|
if (!extensions || extensions.length === 0)
|
|
118202
118650
|
return "None";
|
|
@@ -118221,6 +118669,15 @@ var require_iterationAgentsTools = __commonJS({
|
|
|
118221
118669
|
return lines.join("\n");
|
|
118222
118670
|
}).join("\n\n");
|
|
118223
118671
|
}
|
|
118672
|
+
}
|
|
118673
|
+
});
|
|
118674
|
+
|
|
118675
|
+
// dist/agents/Iteration/utils/contextBuilders.js
|
|
118676
|
+
var require_contextBuilders = __commonJS({
|
|
118677
|
+
"dist/agents/Iteration/utils/contextBuilders.js"(exports2) {
|
|
118678
|
+
"use strict";
|
|
118679
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
118680
|
+
exports2.buildContextSections = buildContextSections;
|
|
118224
118681
|
function formatChatHistory(chatHistory) {
|
|
118225
118682
|
return (chatHistory || []).map((message) => `${message.role.toUpperCase()}: ${message.text}`).join("\n\n");
|
|
118226
118683
|
}
|
|
@@ -118261,7 +118718,8 @@ var require_IterationAgent = __commonJS({
|
|
|
118261
118718
|
var ditto_codegen_types_12 = require_dist();
|
|
118262
118719
|
var constants_1 = require_constants4();
|
|
118263
118720
|
var codeGenerationService_12 = require_codeGenerationService();
|
|
118264
|
-
var
|
|
118721
|
+
var extensionFormatters_1 = require_extensionFormatters();
|
|
118722
|
+
var contextBuilders_1 = require_contextBuilders();
|
|
118265
118723
|
var CurrentExtensionSchema = zod_1.z.object({
|
|
118266
118724
|
extensionType: zod_1.z.enum(codegen_common_logic_1.codeGenerationExtensionTypes).describe("The extension kind to trigger"),
|
|
118267
118725
|
name: zod_1.z.string().describe("A descriptive name for this extension"),
|
|
@@ -118310,13 +118768,13 @@ var require_IterationAgent = __commonJS({
|
|
|
118310
118768
|
};
|
|
118311
118769
|
}
|
|
118312
118770
|
buildUserPrompt({ chatHistory, currentUserRequest, previousResources, extensionSelectorResult }) {
|
|
118313
|
-
const sections = (0,
|
|
118771
|
+
const sections = (0, contextBuilders_1.buildContextSections)(chatHistory, currentUserRequest, previousResources);
|
|
118314
118772
|
sections.push(`
|
|
118315
118773
|
Relevant Existing Extensions:
|
|
118316
|
-
${(0,
|
|
118774
|
+
${(0, extensionFormatters_1.formatEvaluationResultsExtensions)(extensionSelectorResult.extensionsToModify)}`);
|
|
118317
118775
|
sections.push(`
|
|
118318
118776
|
Context Extensions (already exist, don't need changes):
|
|
118319
|
-
${(0,
|
|
118777
|
+
${(0, extensionFormatters_1.formatContextExtensions)(extensionSelectorResult.contextExtensions)}`);
|
|
118320
118778
|
return sections.join("\n\n");
|
|
118321
118779
|
}
|
|
118322
118780
|
async generate({ currentUserRequest, chatHistory, extensionSelectorResult, previousResources }) {
|
|
@@ -119672,7 +120130,8 @@ var require_ExtensionSelectorAgent = __commonJS({
|
|
|
119672
120130
|
var ditto_codegen_types_12 = require_dist();
|
|
119673
120131
|
var extension_selector_prompt_1 = require_extension_selector_prompt();
|
|
119674
120132
|
var ditto_codegen_types_2 = require_dist();
|
|
119675
|
-
var
|
|
120133
|
+
var contextBuilders_1 = require_contextBuilders();
|
|
120134
|
+
var extensionFormatters_1 = require_extensionFormatters();
|
|
119676
120135
|
var dedent_1 = __importDefault2(require_dedent());
|
|
119677
120136
|
var customAnthropicProvider_1 = require_customAnthropicProvider();
|
|
119678
120137
|
var constants_1 = require_constants4();
|
|
@@ -119767,10 +120226,10 @@ var require_ExtensionSelectorAgent = __commonJS({
|
|
|
119767
120226
|
return submitCall.input;
|
|
119768
120227
|
}
|
|
119769
120228
|
buildUserPrompt({ chatHistory, currentUserRequest, previousResources, extensions, outputPath }) {
|
|
119770
|
-
const sections = (0,
|
|
120229
|
+
const sections = (0, contextBuilders_1.buildContextSections)(chatHistory, currentUserRequest, previousResources);
|
|
119771
120230
|
sections.push(`
|
|
119772
120231
|
Extensions to Evaluate:
|
|
119773
|
-
${(0,
|
|
120232
|
+
${(0, extensionFormatters_1.formatScannedExtensions)(extensions, outputPath)}`);
|
|
119774
120233
|
return sections.join("\n\n");
|
|
119775
120234
|
}
|
|
119776
120235
|
async generate({ outputPath, extensions, chatHistory, currentUserRequest, previousResources }) {
|
|
@@ -119831,6 +120290,388 @@ ${(0, iterationAgentsTools_1.formatScannedExtensions)(extensions, outputPath)}`)
|
|
|
119831
120290
|
}
|
|
119832
120291
|
});
|
|
119833
120292
|
|
|
120293
|
+
// dist/system-prompts/sdkPickerAgent/sdk-picker-agent-instructions.js
|
|
120294
|
+
var require_sdk_picker_agent_instructions = __commonJS({
|
|
120295
|
+
"dist/system-prompts/sdkPickerAgent/sdk-picker-agent-instructions.js"(exports2) {
|
|
120296
|
+
"use strict";
|
|
120297
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120298
|
+
exports2.sdkPickerAgentApiDocsStructure = exports2.sdkPickerAgentConstraints = exports2.sdkPickerAgentRole = void 0;
|
|
120299
|
+
exports2.sdkPickerAgentRole = `You are an SDK Picker Agent for a Wix app code generation system.
|
|
120300
|
+
Your job is to analyze an iteration plan and determine which Wix SDK APIs each extension needs to use.
|
|
120301
|
+
|
|
120302
|
+
Given an iteration plan with current and additional extensions (each with a unique ID):
|
|
120303
|
+
1. **Review pre-loaded source code** to understand current implementation (for modifications)
|
|
120304
|
+
2. **Read relevant API documentation** using the read_api_doc tool to understand available Wix SDK methods
|
|
120305
|
+
3. **Analyze each extension's purpose** (from relevantUserRequest/description) to determine what APIs it needs
|
|
120306
|
+
4. **Score each API** based on its relevance and importance (0-100)
|
|
120307
|
+
5. **Return extension IDs with their related APIs, reasons, and scores**
|
|
120308
|
+
|
|
120309
|
+
**CRITICAL GUIDELINES:**
|
|
120310
|
+
|
|
120311
|
+
**When to Add relatedApis:**
|
|
120312
|
+
- **Only add relatedApis when the extension needs to interact with Wix platform data/services**
|
|
120313
|
+
- Extensions that need to query/modify Wix data (products, orders, collections, members, etc.) NEED relatedApis
|
|
120314
|
+
- Configuration/settings pages that only modify app settings DO NOT need relatedApis
|
|
120315
|
+
|
|
120316
|
+
**How to Determine Needed APIs:**
|
|
120317
|
+
1. Read the extension's relevantUserRequest/description carefully
|
|
120318
|
+
2. If modifying existing code (currentExtensions), review the pre-loaded source files first
|
|
120319
|
+
3. Identify what Wix data/services the extension needs to interact with
|
|
120320
|
+
4. Use read_api_doc to explore available APIs for that domain
|
|
120321
|
+
5. Select the specific API methods needed (e.g., 'ecom.orders.getOrder', 'stores.productsV3.queryProducts')
|
|
120322
|
+
|
|
120323
|
+
**IMPORTANT - Webhook Methods:**
|
|
120324
|
+
- **Webhook methods (e.g., data.items.onDataItemUpdated, ecom.orders.onOrderCreated) should ONLY be used for BACKEND_EVENT extensions**
|
|
120325
|
+
- Webhooks are event listeners that trigger when something happens in Wix (data updated, order created, etc.)
|
|
120326
|
+
- Common webhook patterns: \`on[Entity][Action]\` (e.g., onDataItemUpdated, onOrderCreated, onProductUpdated)
|
|
120327
|
+
- Only suggest webhooks when the extension type is specifically BACKEND_EVENT and needs to react to events in real-time
|
|
120328
|
+
|
|
120329
|
+
**How to Score APIs (0-100):**
|
|
120330
|
+
- **90-100**: Critical/Core - Absolutely required for the extension to function
|
|
120331
|
+
- **70-89**: Important - Significantly enhances functionality, hard to work without
|
|
120332
|
+
- **50-69**: Useful - Adds value but alternatives exist
|
|
120333
|
+
- **30-49**: Optional - Nice to have, provides additional features
|
|
120334
|
+
- **0-29**: Low priority - Edge cases or rarely used
|
|
120335
|
+
|
|
120336
|
+
**Scoring Considerations:**
|
|
120337
|
+
- Is it required or optional for the core functionality?
|
|
120338
|
+
- How frequently will it be called?
|
|
120339
|
+
- Are there alternative approaches without this API?
|
|
120340
|
+
- Does it directly fulfill the user's request?
|
|
120341
|
+
- Is it the primary data source or supplementary?
|
|
120342
|
+
|
|
120343
|
+
**API Documentation Structure:**
|
|
120344
|
+
- API docs are organized by domain (ecom, stores, data, members, etc.)
|
|
120345
|
+
- Each file contains documentation for a specific API method
|
|
120346
|
+
- File naming pattern: {domain}-{method}-doc.txt (e.g., 'ecom-orders-getOrder-doc.txt')
|
|
120347
|
+
- Always read the full documentation before deciding to use an API
|
|
120348
|
+
|
|
120349
|
+
**Source Code Analysis:**
|
|
120350
|
+
- Relevant source files are pre-loaded in the system prompt for your review
|
|
120351
|
+
- Look for existing API imports and usage patterns
|
|
120352
|
+
- Understand data flow and dependencies
|
|
120353
|
+
- Identify gaps where new APIs are needed
|
|
120354
|
+
|
|
120355
|
+
**Output Format:**
|
|
120356
|
+
- Return an array of objects with 'id' and 'relatedApis' fields
|
|
120357
|
+
- Each relatedApi must include: api (name), reason (why it's needed), and score (0-100)
|
|
120358
|
+
- Use the exact IDs provided in the input (e.g., 'current-0', 'current-1', 'additional-0')
|
|
120359
|
+
- Only include extensions that need APIs
|
|
120360
|
+
- Be precise and intentional with API selections
|
|
120361
|
+
- **The system will automatically select the top 5 highest-scoring APIs per extension**`;
|
|
120362
|
+
exports2.sdkPickerAgentConstraints = `- **REVIEW PRE-LOADED CODE**: Relevant source files are already loaded in the system prompt - review them first
|
|
120363
|
+
- **READ BEFORE DECIDING**: Always read API documentation before adding relatedApis to an extension
|
|
120364
|
+
- **BE SPECIFIC**: Use exact API method names from the documentation (e.g., 'ecom.orders.getOrder', not just 'orders')
|
|
120365
|
+
- **SCORE ACCURATELY**: Give honest scores - don't inflate scores, be realistic about importance
|
|
120366
|
+
- **BE MINIMAL BUT THOROUGH**: List all relevant APIs, but the system will keep only top 5 per extension
|
|
120367
|
+
- **EXPLAIN CLEARLY**: Each API must have a clear reason explaining its specific purpose
|
|
120368
|
+
- **UNDERSTAND CONTEXT**: Read the extension's description/relevantUserRequest to understand what it needs to do
|
|
120369
|
+
- **NO GUESSING**: If you're unsure about an API, read its documentation first
|
|
120370
|
+
- **CHECK EXISTING**: For modifications, check what APIs are already being used in the pre-loaded source files
|
|
120371
|
+
- **AVAILABLE APIS ONLY**: Only use APIs from the available documentation - don't invent API names`;
|
|
120372
|
+
var sdkPickerAgentApiDocsStructure = ({ apiDocsStructure }) => `**Available API Documentation Files:**
|
|
120373
|
+
|
|
120374
|
+
${apiDocsStructure}
|
|
120375
|
+
|
|
120376
|
+
Use the read_api_doc tool with the file name to read any of these documentation files.`;
|
|
120377
|
+
exports2.sdkPickerAgentApiDocsStructure = sdkPickerAgentApiDocsStructure;
|
|
120378
|
+
}
|
|
120379
|
+
});
|
|
120380
|
+
|
|
120381
|
+
// dist/system-prompts/sdkPickerAgent/sdk-picker-agent-prompt.js
|
|
120382
|
+
var require_sdk_picker_agent_prompt = __commonJS({
|
|
120383
|
+
"dist/system-prompts/sdkPickerAgent/sdk-picker-agent-prompt.js"(exports2) {
|
|
120384
|
+
"use strict";
|
|
120385
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120386
|
+
exports2.sdkPickerAgentPrompt = void 0;
|
|
120387
|
+
var SystemPromptBuilder_1 = require_SystemPromptBuilder();
|
|
120388
|
+
var sdk_picker_agent_instructions_1 = require_sdk_picker_agent_instructions();
|
|
120389
|
+
var sdkPickerAgentPrompt = ({ apiDocsStructure }) => {
|
|
120390
|
+
const systemPrompt = new SystemPromptBuilder_1.SystemPromptBuilder({
|
|
120391
|
+
agentType: SystemPromptBuilder_1.GeneralAgentType.SDK_PICKER
|
|
120392
|
+
}).withRole(sdk_picker_agent_instructions_1.sdkPickerAgentRole).withSection("constraints", sdk_picker_agent_instructions_1.sdkPickerAgentConstraints).withSection("api_docs_structure", (0, sdk_picker_agent_instructions_1.sdkPickerAgentApiDocsStructure)({ apiDocsStructure }));
|
|
120393
|
+
return systemPrompt.compose();
|
|
120394
|
+
};
|
|
120395
|
+
exports2.sdkPickerAgentPrompt = sdkPickerAgentPrompt;
|
|
120396
|
+
}
|
|
120397
|
+
});
|
|
120398
|
+
|
|
120399
|
+
// dist/agents/Iteration/utils/apiHelpers.js
|
|
120400
|
+
var require_apiHelpers = __commonJS({
|
|
120401
|
+
"dist/agents/Iteration/utils/apiHelpers.js"(exports2) {
|
|
120402
|
+
"use strict";
|
|
120403
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120404
|
+
exports2.createApiMap = exports2.getValidExtensionIds = void 0;
|
|
120405
|
+
var getValidExtensionIds = ({ iterationPlan }) => {
|
|
120406
|
+
const validIds = /* @__PURE__ */ new Set();
|
|
120407
|
+
iterationPlan.currentExtensions.forEach((_, idx) => {
|
|
120408
|
+
validIds.add(`current-${idx}`);
|
|
120409
|
+
});
|
|
120410
|
+
iterationPlan.additionalExtensions.forEach((_, idx) => {
|
|
120411
|
+
validIds.add(`additional-${idx}`);
|
|
120412
|
+
});
|
|
120413
|
+
return validIds;
|
|
120414
|
+
};
|
|
120415
|
+
exports2.getValidExtensionIds = getValidExtensionIds;
|
|
120416
|
+
var createApiMap = ({ apiResult }) => {
|
|
120417
|
+
const apiMap = /* @__PURE__ */ new Map();
|
|
120418
|
+
apiResult.extensions.forEach((ext) => {
|
|
120419
|
+
if (ext.relatedApis && ext.relatedApis.length > 0) {
|
|
120420
|
+
const topApis = ext.relatedApis.sort((a, b) => b.score - a.score).slice(0, 5);
|
|
120421
|
+
apiMap.set(ext.id, topApis);
|
|
120422
|
+
}
|
|
120423
|
+
});
|
|
120424
|
+
return apiMap;
|
|
120425
|
+
};
|
|
120426
|
+
exports2.createApiMap = createApiMap;
|
|
120427
|
+
}
|
|
120428
|
+
});
|
|
120429
|
+
|
|
120430
|
+
// dist/agents/Iteration/SDKPickerAgent.js
|
|
120431
|
+
var require_SDKPickerAgent = __commonJS({
|
|
120432
|
+
"dist/agents/Iteration/SDKPickerAgent.js"(exports2) {
|
|
120433
|
+
"use strict";
|
|
120434
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
120435
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
120436
|
+
};
|
|
120437
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120438
|
+
exports2.SDKPickerAgent = void 0;
|
|
120439
|
+
var zod_1 = require_zod();
|
|
120440
|
+
var sdk_picker_agent_prompt_1 = require_sdk_picker_agent_prompt();
|
|
120441
|
+
var ditto_codegen_types_12 = require_dist();
|
|
120442
|
+
var constants_1 = require_constants4();
|
|
120443
|
+
var ai_1 = require_dist8();
|
|
120444
|
+
var customAnthropicProvider_1 = require_customAnthropicProvider();
|
|
120445
|
+
var path_1 = __importDefault2(require("path"));
|
|
120446
|
+
var fs_1 = __importDefault2(require("fs"));
|
|
120447
|
+
var tree_node_cli_1 = __importDefault2(require_src32());
|
|
120448
|
+
var sdkConfig_1 = require_sdkConfig();
|
|
120449
|
+
var extensionFormatters_1 = require_extensionFormatters();
|
|
120450
|
+
var apiHelpers_1 = require_apiHelpers();
|
|
120451
|
+
var apiHelpers_2 = require_apiHelpers();
|
|
120452
|
+
var TOOL_NAMES = {
|
|
120453
|
+
READ_API_DOC: "read_api_doc",
|
|
120454
|
+
SUBMIT_PLAN: "submit_plan"
|
|
120455
|
+
};
|
|
120456
|
+
var API_NAMES = Object.keys(sdkConfig_1.SDK_METHODS_CONFIG);
|
|
120457
|
+
var apiWithScoreSchema = zod_1.z.object({
|
|
120458
|
+
api: zod_1.z.enum(API_NAMES).describe("The Wix API method name"),
|
|
120459
|
+
reason: zod_1.z.string().describe("Clear explanation of why this API is needed for this extension and how it will be used"),
|
|
120460
|
+
score: zod_1.z.number().min(0).max(100).describe("Relevance score from 0-100. Higher scores indicate more critical/relevant APIs. Consider: necessity (is it required?), frequency of use, impact on functionality, and whether there are alternatives.")
|
|
120461
|
+
});
|
|
120462
|
+
var extensionApiResultSchema = zod_1.z.object({
|
|
120463
|
+
id: zod_1.z.string().describe("Unique identifier for this extension (use index-based ID like 'current-0', 'current-1', 'additional-0', etc.)"),
|
|
120464
|
+
relatedApis: zod_1.z.array(apiWithScoreSchema).optional().describe("Optional array of Wix APIs with reasoning and scores. Read the API docs using read_api_doc tool to understand the APIs before specifying them. Leave empty if no APIs are needed.")
|
|
120465
|
+
});
|
|
120466
|
+
var sdkPickerResultSchema = zod_1.z.object({
|
|
120467
|
+
extensions: zod_1.z.array(extensionApiResultSchema).describe("Array of extensions with their IDs and related APIs")
|
|
120468
|
+
});
|
|
120469
|
+
var readApiDocSchema = zod_1.z.object({
|
|
120470
|
+
fileName: zod_1.z.string().describe("Name of the API documentation file to read (e.g., 'ecom-orders-getOrder-doc.txt')")
|
|
120471
|
+
});
|
|
120472
|
+
var validateExtensionIds = ({ result, validIds }) => {
|
|
120473
|
+
return result.extensions.filter((ext) => !validIds.has(ext.id)).map((ext) => ext.id);
|
|
120474
|
+
};
|
|
120475
|
+
var SDKPickerAgent = class {
|
|
120476
|
+
constructor(apiKey) {
|
|
120477
|
+
this.apiKey = apiKey;
|
|
120478
|
+
this.name = "SDKPickerAgent";
|
|
120479
|
+
}
|
|
120480
|
+
async generate({ iterationPlan, outputPath }) {
|
|
120481
|
+
if (iterationPlan.currentExtensions.length === 0 && iterationPlan.additionalExtensions.length === 0) {
|
|
120482
|
+
return iterationPlan;
|
|
120483
|
+
}
|
|
120484
|
+
const apiDocsStructure = this.generateApiDocsFolderStructure();
|
|
120485
|
+
const userMessage = this.buildUserPrompt({ iterationPlan, outputPath });
|
|
120486
|
+
const systemPrompt = this.buildSystemPrompt({ apiDocsStructure });
|
|
120487
|
+
try {
|
|
120488
|
+
const model = (0, customAnthropicProvider_1.createCustomText)()(constants_1.LLM_MODELS.CLAUDE_3_5_HAIKU_LATEST, {
|
|
120489
|
+
agentName: this.name
|
|
120490
|
+
});
|
|
120491
|
+
const result = await (0, ai_1.generateText)({
|
|
120492
|
+
model,
|
|
120493
|
+
tools: {
|
|
120494
|
+
[TOOL_NAMES.READ_API_DOC]: this.createReadApiDocTool(),
|
|
120495
|
+
[TOOL_NAMES.SUBMIT_PLAN]: this.createSubmitPlanTool({
|
|
120496
|
+
iterationPlan
|
|
120497
|
+
})
|
|
120498
|
+
},
|
|
120499
|
+
stopWhen: this.createStopCondition(),
|
|
120500
|
+
messages: [
|
|
120501
|
+
{
|
|
120502
|
+
role: "system",
|
|
120503
|
+
content: systemPrompt,
|
|
120504
|
+
providerOptions: (0, ditto_codegen_types_12.withCaching)("1h")
|
|
120505
|
+
},
|
|
120506
|
+
{ role: "user", content: userMessage }
|
|
120507
|
+
],
|
|
120508
|
+
maxRetries: 3,
|
|
120509
|
+
temperature: 0,
|
|
120510
|
+
experimental_telemetry: { isEnabled: true, functionId: this.name }
|
|
120511
|
+
});
|
|
120512
|
+
const apiResult = this.extractSDKPickerResult({
|
|
120513
|
+
toolCalls: result.toolCalls
|
|
120514
|
+
});
|
|
120515
|
+
if (!apiResult) {
|
|
120516
|
+
throw new Error("Failed to extract SDK picker result from tool calls");
|
|
120517
|
+
}
|
|
120518
|
+
return this.mergeApisIntoIterationPlan({ iterationPlan, apiResult });
|
|
120519
|
+
} catch (error) {
|
|
120520
|
+
throw (0, ditto_codegen_types_12.toCodegenError)(error);
|
|
120521
|
+
}
|
|
120522
|
+
}
|
|
120523
|
+
buildSystemPrompt({ apiDocsStructure }) {
|
|
120524
|
+
return (0, sdk_picker_agent_prompt_1.sdkPickerAgentPrompt)({ apiDocsStructure });
|
|
120525
|
+
}
|
|
120526
|
+
buildUserPrompt({ iterationPlan, outputPath }) {
|
|
120527
|
+
const sections = [
|
|
120528
|
+
"## Iteration Plan to Enrich with Related APIs\n"
|
|
120529
|
+
];
|
|
120530
|
+
if (iterationPlan.currentExtensions.length > 0) {
|
|
120531
|
+
sections.push("### Current Extensions (to be modified):\n");
|
|
120532
|
+
iterationPlan.currentExtensions.forEach((ext, idx) => {
|
|
120533
|
+
sections.push(...(0, extensionFormatters_1.formatIterationPlanExtension)({
|
|
120534
|
+
ext,
|
|
120535
|
+
id: `current-${idx}`,
|
|
120536
|
+
outputPath
|
|
120537
|
+
}));
|
|
120538
|
+
});
|
|
120539
|
+
}
|
|
120540
|
+
if (iterationPlan.additionalExtensions.length > 0) {
|
|
120541
|
+
sections.push("### Additional Extensions (to be created):\n");
|
|
120542
|
+
iterationPlan.additionalExtensions.forEach((ext, idx) => {
|
|
120543
|
+
sections.push(...(0, extensionFormatters_1.formatIterationPlanExtension)({
|
|
120544
|
+
ext,
|
|
120545
|
+
id: `additional-${idx}`,
|
|
120546
|
+
outputPath
|
|
120547
|
+
}));
|
|
120548
|
+
});
|
|
120549
|
+
}
|
|
120550
|
+
sections.push(`### Summary:
|
|
120551
|
+
${iterationPlan.summary}
|
|
120552
|
+
`);
|
|
120553
|
+
return sections.join("\n");
|
|
120554
|
+
}
|
|
120555
|
+
getApiDocsDirectory() {
|
|
120556
|
+
return path_1.default.join(__dirname, "docs-output", "api-docs");
|
|
120557
|
+
}
|
|
120558
|
+
generateApiDocsFolderStructure() {
|
|
120559
|
+
const apiDocsPath = this.getApiDocsDirectory();
|
|
120560
|
+
try {
|
|
120561
|
+
return (0, tree_node_cli_1.default)(apiDocsPath, {
|
|
120562
|
+
allFiles: true,
|
|
120563
|
+
maxDepth: 3
|
|
120564
|
+
});
|
|
120565
|
+
} catch (error) {
|
|
120566
|
+
console.error("Error generating api-docs folder structure:", error);
|
|
120567
|
+
return "";
|
|
120568
|
+
}
|
|
120569
|
+
}
|
|
120570
|
+
readApiDoc({ fileName }) {
|
|
120571
|
+
try {
|
|
120572
|
+
const apiDocsDir = this.getApiDocsDirectory();
|
|
120573
|
+
const fullPath = path_1.default.join(apiDocsDir, fileName);
|
|
120574
|
+
const normalizedFullPath = path_1.default.resolve(fullPath);
|
|
120575
|
+
const normalizedApiDocsDir = path_1.default.resolve(apiDocsDir);
|
|
120576
|
+
if (!normalizedFullPath.startsWith(normalizedApiDocsDir)) {
|
|
120577
|
+
return {
|
|
120578
|
+
error: `Access denied: Files outside api-docs folder are not allowed`
|
|
120579
|
+
};
|
|
120580
|
+
}
|
|
120581
|
+
if (!fs_1.default.existsSync(fullPath)) {
|
|
120582
|
+
return { error: `API documentation not found: ${fileName}` };
|
|
120583
|
+
}
|
|
120584
|
+
const content = fs_1.default.readFileSync(fullPath, "utf8");
|
|
120585
|
+
return { fileName, content };
|
|
120586
|
+
} catch (error) {
|
|
120587
|
+
return {
|
|
120588
|
+
error: `Failed to read API documentation: ${JSON.stringify(error)}`
|
|
120589
|
+
};
|
|
120590
|
+
}
|
|
120591
|
+
}
|
|
120592
|
+
createReadApiDocTool() {
|
|
120593
|
+
return {
|
|
120594
|
+
description: "Read Wix API documentation to understand available SDK methods, parameters, and return types. Use this when you need to know how to work with specific Wix APIs.",
|
|
120595
|
+
inputSchema: readApiDocSchema,
|
|
120596
|
+
execute: async ({ fileName }) => this.readApiDoc({ fileName })
|
|
120597
|
+
};
|
|
120598
|
+
}
|
|
120599
|
+
createSubmitPlanTool({ iterationPlan }) {
|
|
120600
|
+
return {
|
|
120601
|
+
description: "Submit your final SDK picker results with extension IDs and their related APIs.",
|
|
120602
|
+
inputSchema: sdkPickerResultSchema,
|
|
120603
|
+
execute: async (params) => {
|
|
120604
|
+
const validIds = (0, apiHelpers_1.getValidExtensionIds)({ iterationPlan });
|
|
120605
|
+
const invalidIds = validateExtensionIds({ result: params, validIds });
|
|
120606
|
+
if (invalidIds.length > 0) {
|
|
120607
|
+
return {
|
|
120608
|
+
error: `Invalid extension IDs found: ${invalidIds.join(", ")}. Valid IDs are: ${Array.from(validIds).join(", ")}`
|
|
120609
|
+
};
|
|
120610
|
+
}
|
|
120611
|
+
return params;
|
|
120612
|
+
}
|
|
120613
|
+
};
|
|
120614
|
+
}
|
|
120615
|
+
createStopCondition() {
|
|
120616
|
+
return ({ steps }) => {
|
|
120617
|
+
const lastStep = steps[steps.length - 1];
|
|
120618
|
+
const hasSuccessfulSubmit = lastStep?.toolCalls.some((toolCall) => toolCall.toolName === TOOL_NAMES.SUBMIT_PLAN && !("invalid" in toolCall) && !("error" in toolCall)) ?? false;
|
|
120619
|
+
return hasSuccessfulSubmit;
|
|
120620
|
+
};
|
|
120621
|
+
}
|
|
120622
|
+
extractSDKPickerResult({ toolCalls }) {
|
|
120623
|
+
const submitCall = toolCalls.find((call) => call.toolName === TOOL_NAMES.SUBMIT_PLAN);
|
|
120624
|
+
if (!submitCall) {
|
|
120625
|
+
console.error("No submit_plan tool call found");
|
|
120626
|
+
return null;
|
|
120627
|
+
}
|
|
120628
|
+
return submitCall.input;
|
|
120629
|
+
}
|
|
120630
|
+
mergeApisIntoIterationPlan({ iterationPlan, apiResult }) {
|
|
120631
|
+
const apiMap = (0, apiHelpers_2.createApiMap)({ apiResult });
|
|
120632
|
+
const enrichedCurrentExtensions = iterationPlan.currentExtensions.map((currentExtension, idx) => {
|
|
120633
|
+
const relatedApis = apiMap.get(`current-${idx}`);
|
|
120634
|
+
return {
|
|
120635
|
+
...currentExtension,
|
|
120636
|
+
extension: this.enrichExtensionWithApis({
|
|
120637
|
+
extension: currentExtension.extension,
|
|
120638
|
+
relatedApis
|
|
120639
|
+
})
|
|
120640
|
+
};
|
|
120641
|
+
});
|
|
120642
|
+
const enrichedAdditionalExtensions = iterationPlan.additionalExtensions.map((additionalExtension, idx) => {
|
|
120643
|
+
const relatedApis = apiMap.get(`additional-${idx}`);
|
|
120644
|
+
return {
|
|
120645
|
+
...additionalExtension,
|
|
120646
|
+
extension: this.enrichExtensionWithApis({
|
|
120647
|
+
extension: additionalExtension.extension,
|
|
120648
|
+
relatedApis
|
|
120649
|
+
})
|
|
120650
|
+
};
|
|
120651
|
+
});
|
|
120652
|
+
return {
|
|
120653
|
+
currentExtensions: enrichedCurrentExtensions,
|
|
120654
|
+
additionalExtensions: enrichedAdditionalExtensions,
|
|
120655
|
+
summary: iterationPlan.summary
|
|
120656
|
+
};
|
|
120657
|
+
}
|
|
120658
|
+
enrichExtensionWithApis({ extension, relatedApis }) {
|
|
120659
|
+
if (!relatedApis || relatedApis.length === 0) {
|
|
120660
|
+
return extension;
|
|
120661
|
+
}
|
|
120662
|
+
return {
|
|
120663
|
+
...extension,
|
|
120664
|
+
relatedApis: relatedApis.map((apiWithScore) => ({
|
|
120665
|
+
name: apiWithScore.api,
|
|
120666
|
+
purpose: apiWithScore.reason
|
|
120667
|
+
}))
|
|
120668
|
+
};
|
|
120669
|
+
}
|
|
120670
|
+
};
|
|
120671
|
+
exports2.SDKPickerAgent = SDKPickerAgent;
|
|
120672
|
+
}
|
|
120673
|
+
});
|
|
120674
|
+
|
|
119834
120675
|
// dist/agents/AgentsFactory.js
|
|
119835
120676
|
var require_AgentsFactory = __commonJS({
|
|
119836
120677
|
"dist/agents/AgentsFactory.js"(exports2) {
|
|
@@ -119845,6 +120686,7 @@ var require_AgentsFactory = __commonJS({
|
|
|
119845
120686
|
var ExtensionSelectorAgent_1 = require_ExtensionSelectorAgent();
|
|
119846
120687
|
var AgentsRegistry_1 = require_AgentsRegistry();
|
|
119847
120688
|
var ditto_codegen_types_12 = require_dist();
|
|
120689
|
+
var SDKPickerAgent_1 = require_SDKPickerAgent();
|
|
119848
120690
|
var AgentsFactory = class {
|
|
119849
120691
|
constructor(apiKey, useIteration = false) {
|
|
119850
120692
|
this.apiKey = apiKey;
|
|
@@ -119877,6 +120719,8 @@ var require_AgentsFactory = __commonJS({
|
|
|
119877
120719
|
return new AutoPatternsGenerator_1.AutoPatternsGenerator();
|
|
119878
120720
|
case "EXTENSION_SELECTOR":
|
|
119879
120721
|
return new ExtensionSelectorAgent_1.ExtensionSelectorAgent(this.apiKey);
|
|
120722
|
+
case "SDK_PICKER":
|
|
120723
|
+
return new SDKPickerAgent_1.SDKPickerAgent(this.apiKey);
|
|
119880
120724
|
default:
|
|
119881
120725
|
throw new ditto_codegen_types_12.AgentConfigurationError(`Unsupported extension type for AI customization: ${extension.type}`, { extensionType: extension.type });
|
|
119882
120726
|
}
|
|
@@ -349629,7 +350473,13 @@ var require_IterationOrchestrator = __commonJS({
|
|
|
349629
350473
|
previousResources
|
|
349630
350474
|
});
|
|
349631
350475
|
this.validateEmbeddedScriptConstraint(extensions, iterationPlan);
|
|
349632
|
-
|
|
350476
|
+
const sdkPickerAgent = this.agentsFactory.getAgent({ type: "SDK_PICKER" });
|
|
350477
|
+
const enrichedIterationPlan = await sdkPickerAgent.generate({
|
|
350478
|
+
iterationPlan,
|
|
350479
|
+
outputPath
|
|
350480
|
+
});
|
|
350481
|
+
console.log("Final iteration plan:", JSON.stringify(enrichedIterationPlan, null, 2));
|
|
350482
|
+
return enrichedIterationPlan;
|
|
349633
350483
|
}
|
|
349634
350484
|
validateEmbeddedScriptConstraint(extensions, iterationPlan) {
|
|
349635
350485
|
const hasExistingEmbeddedScript = extensions.some((ext) => ext.type === types_1.ExtensionType.EMBEDDED_SCRIPT);
|