@cloudcart/dev-mcp 0.1.3 → 0.1.5
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/data/admin.json +140 -0
- package/dist/prompts/admin.d.ts +1 -1
- package/dist/prompts/admin.d.ts.map +1 -1
- package/dist/prompts/admin.js +35 -0
- package/dist/prompts/admin.js.map +1 -1
- package/dist/tools/introspect-schema.d.ts.map +1 -1
- package/dist/tools/introspect-schema.js +137 -106
- package/dist/tools/introspect-schema.js.map +1 -1
- package/dist/tools/validate-graphql.d.ts.map +1 -1
- package/dist/tools/validate-graphql.js +183 -3
- package/dist/tools/validate-graphql.js.map +1 -1
- package/package.json +1 -1
package/data/admin.json
CHANGED
|
@@ -13289,6 +13289,26 @@
|
|
|
13289
13289
|
},
|
|
13290
13290
|
"defaultValue": null
|
|
13291
13291
|
},
|
|
13292
|
+
{
|
|
13293
|
+
"name": "products_count",
|
|
13294
|
+
"description": "Filter by number of distinct product lines on the order (with operator: lt, lte, gt, gte, between).",
|
|
13295
|
+
"type": {
|
|
13296
|
+
"kind": "INPUT_OBJECT",
|
|
13297
|
+
"name": "NumericFilter",
|
|
13298
|
+
"ofType": null
|
|
13299
|
+
},
|
|
13300
|
+
"defaultValue": null
|
|
13301
|
+
},
|
|
13302
|
+
{
|
|
13303
|
+
"name": "quantity",
|
|
13304
|
+
"description": "Filter by total item quantity on the order (with operator: lt, lte, gt, gte, between).",
|
|
13305
|
+
"type": {
|
|
13306
|
+
"kind": "INPUT_OBJECT",
|
|
13307
|
+
"name": "NumericFilter",
|
|
13308
|
+
"ofType": null
|
|
13309
|
+
},
|
|
13310
|
+
"defaultValue": null
|
|
13311
|
+
},
|
|
13292
13312
|
{
|
|
13293
13313
|
"name": "order_by",
|
|
13294
13314
|
"description": "Sort column (id or date_added).",
|
|
@@ -13702,6 +13722,66 @@
|
|
|
13702
13722
|
},
|
|
13703
13723
|
"defaultValue": null
|
|
13704
13724
|
},
|
|
13725
|
+
{
|
|
13726
|
+
"name": "stock",
|
|
13727
|
+
"description": "Filter by variant stock level (with operator: lt, lte, gt, gte, eq). Matches products where ANY variant has qty satisfying the condition.",
|
|
13728
|
+
"type": {
|
|
13729
|
+
"kind": "INPUT_OBJECT",
|
|
13730
|
+
"name": "NumericFilter",
|
|
13731
|
+
"ofType": null
|
|
13732
|
+
},
|
|
13733
|
+
"defaultValue": null
|
|
13734
|
+
},
|
|
13735
|
+
{
|
|
13736
|
+
"name": "tracking",
|
|
13737
|
+
"description": "Filter by tracking mode (yes = inventory-tracked, no = not tracked).",
|
|
13738
|
+
"type": {
|
|
13739
|
+
"kind": "ENUM",
|
|
13740
|
+
"name": "YesNo",
|
|
13741
|
+
"ofType": null
|
|
13742
|
+
},
|
|
13743
|
+
"defaultValue": null
|
|
13744
|
+
},
|
|
13745
|
+
{
|
|
13746
|
+
"name": "hidden",
|
|
13747
|
+
"description": "Filter by hidden-from-storefront flag (yes = hidden, no = visible).",
|
|
13748
|
+
"type": {
|
|
13749
|
+
"kind": "ENUM",
|
|
13750
|
+
"name": "YesNo",
|
|
13751
|
+
"ofType": null
|
|
13752
|
+
},
|
|
13753
|
+
"defaultValue": null
|
|
13754
|
+
},
|
|
13755
|
+
{
|
|
13756
|
+
"name": "has_image",
|
|
13757
|
+
"description": "Filter by presence of a featured image (true = has image, false = no image).",
|
|
13758
|
+
"type": {
|
|
13759
|
+
"kind": "SCALAR",
|
|
13760
|
+
"name": "Boolean",
|
|
13761
|
+
"ofType": null
|
|
13762
|
+
},
|
|
13763
|
+
"defaultValue": null
|
|
13764
|
+
},
|
|
13765
|
+
{
|
|
13766
|
+
"name": "date_modified",
|
|
13767
|
+
"description": "Filter by last-modified date range (with operator: is, lt, lte, gt, gte, between).",
|
|
13768
|
+
"type": {
|
|
13769
|
+
"kind": "INPUT_OBJECT",
|
|
13770
|
+
"name": "DateFilter",
|
|
13771
|
+
"ofType": null
|
|
13772
|
+
},
|
|
13773
|
+
"defaultValue": null
|
|
13774
|
+
},
|
|
13775
|
+
{
|
|
13776
|
+
"name": "date_added",
|
|
13777
|
+
"description": "Filter by date added / creation date range (with operator: is, lt, lte, gt, gte, between).",
|
|
13778
|
+
"type": {
|
|
13779
|
+
"kind": "INPUT_OBJECT",
|
|
13780
|
+
"name": "DateFilter",
|
|
13781
|
+
"ofType": null
|
|
13782
|
+
},
|
|
13783
|
+
"defaultValue": null
|
|
13784
|
+
},
|
|
13705
13785
|
{
|
|
13706
13786
|
"name": "order_by",
|
|
13707
13787
|
"description": "Sort field (id, name, price_from, date_added, updated_at, sort_order, views).",
|
|
@@ -14023,6 +14103,46 @@
|
|
|
14023
14103
|
},
|
|
14024
14104
|
"defaultValue": null
|
|
14025
14105
|
},
|
|
14106
|
+
{
|
|
14107
|
+
"name": "segment",
|
|
14108
|
+
"description": "Filter customers that belong to a given segment (segment ID).",
|
|
14109
|
+
"type": {
|
|
14110
|
+
"kind": "SCALAR",
|
|
14111
|
+
"name": "ID",
|
|
14112
|
+
"ofType": null
|
|
14113
|
+
},
|
|
14114
|
+
"defaultValue": null
|
|
14115
|
+
},
|
|
14116
|
+
{
|
|
14117
|
+
"name": "date_added",
|
|
14118
|
+
"description": "Filter by registration / date-added range (with operator: is, lt, lte, gt, gte, between).",
|
|
14119
|
+
"type": {
|
|
14120
|
+
"kind": "INPUT_OBJECT",
|
|
14121
|
+
"name": "DateFilter",
|
|
14122
|
+
"ofType": null
|
|
14123
|
+
},
|
|
14124
|
+
"defaultValue": null
|
|
14125
|
+
},
|
|
14126
|
+
{
|
|
14127
|
+
"name": "orders_count",
|
|
14128
|
+
"description": "Filter by number of completed orders (with operator: lt, lte, gt, gte, between).",
|
|
14129
|
+
"type": {
|
|
14130
|
+
"kind": "INPUT_OBJECT",
|
|
14131
|
+
"name": "NumericFilter",
|
|
14132
|
+
"ofType": null
|
|
14133
|
+
},
|
|
14134
|
+
"defaultValue": null
|
|
14135
|
+
},
|
|
14136
|
+
{
|
|
14137
|
+
"name": "total_spent",
|
|
14138
|
+
"description": "Filter by lifetime customer spend in store currency cents (with operator: lt, lte, gt, gte, between).",
|
|
14139
|
+
"type": {
|
|
14140
|
+
"kind": "INPUT_OBJECT",
|
|
14141
|
+
"name": "NumericFilter",
|
|
14142
|
+
"ofType": null
|
|
14143
|
+
},
|
|
14144
|
+
"defaultValue": null
|
|
14145
|
+
},
|
|
14026
14146
|
{
|
|
14027
14147
|
"name": "orderBy",
|
|
14028
14148
|
"description": "Sort field (id, name, email, date_added, updated_at, orders_completed, orders_completed_price).",
|
|
@@ -75653,6 +75773,16 @@
|
|
|
75653
75773
|
}
|
|
75654
75774
|
},
|
|
75655
75775
|
"defaultValue": null
|
|
75776
|
+
},
|
|
75777
|
+
{
|
|
75778
|
+
"name": "name",
|
|
75779
|
+
"description": "Optional custom name. If omitted, the name is auto-generated from the conditions (e.g. 'Subscriber more than 2 orders').",
|
|
75780
|
+
"type": {
|
|
75781
|
+
"kind": "SCALAR",
|
|
75782
|
+
"name": "String",
|
|
75783
|
+
"ofType": null
|
|
75784
|
+
},
|
|
75785
|
+
"defaultValue": null
|
|
75656
75786
|
}
|
|
75657
75787
|
],
|
|
75658
75788
|
"interfaces": null,
|
|
@@ -75686,6 +75816,16 @@
|
|
|
75686
75816
|
}
|
|
75687
75817
|
},
|
|
75688
75818
|
"defaultValue": null
|
|
75819
|
+
},
|
|
75820
|
+
{
|
|
75821
|
+
"name": "name",
|
|
75822
|
+
"description": "Optional custom name. If omitted, the name is re-generated from the updated conditions.",
|
|
75823
|
+
"type": {
|
|
75824
|
+
"kind": "SCALAR",
|
|
75825
|
+
"name": "String",
|
|
75826
|
+
"ofType": null
|
|
75827
|
+
},
|
|
75828
|
+
"defaultValue": null
|
|
75689
75829
|
}
|
|
75690
75830
|
],
|
|
75691
75831
|
"interfaces": null,
|
package/dist/prompts/admin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ADMIN_API_PROMPT = "You are an assistant that helps CloudCart developers write GraphQL queries or mutations to interact with the latest CloudCart Admin GraphQL API.\n\nYou should find all operations that can help the developer achieve their goal, provide valid GraphQL operations along with helpful explanations.\nWhen returning a GraphQL operation always wrap it in triple backticks and use the graphql file type.\nTHIS IS IMPORTANT: GraphQL operations you generate should ALWAYS be validated with the `validate_graphql_codeblocks` MCP tool. This tool will parse the operation with the GQL schema and give you feedback of errors if any were detected. If errors are detected from this validation tool, make the necessary changes and then call this tool again.\n\nThink about all the steps required to generate a GraphQL query or mutation for the Admin API:\n\n First think about what the developer is trying to do\n Then use introspect_graphql_schema to find relevant types, queries, and mutations\n For queries think about which fields you need to fetch and for mutations think about which arguments you need to pass as input\n Then think about which fields to select from the return type. In general, don't select more than 5 fields\n If there are nested objects think about which fields you need to fetch for those objects\n\nIMPORTANT \u2014 APPLICATION-PROVIDED RESOURCES:\nMany CloudCart features are provided by Applications from the CloudCart marketplace, not by the core platform.\nCloudCart has 19 application groups with 250+ apps. The main groups are:\n\n- **Shipping** (group: \"shipping\", 24 apps) \u2014 Speedy, Econt, ACS Courier, DHL, DHL Express, Sameday, FanCourier, Cargus, DPD, GLS, BoxNow, Sendcloud, Glovo, Speedex, etc.\n- **Payment** (group: \"payment\", 46 apps) \u2014 Stripe, PayPal, Mollie, Borica, MyPOS, ePay, CloudCart Pay, Klarna, Adyen, DSK, Fibank, Raiffeisen, Monri, etc.\n- **ERP / POS** (group: \"global\") \u2014 Barsy, Rkeeper, Facturis, SmartBill, Oblio, Lexoffice, Xentral, Sevdesk, etc.\n- **Import** (group: \"import\", 17 apps) \u2014 CSV Import, XML Import, Shopify, WooCommerce, Magento, Google Sheets, JSON Import, etc.\n- **Feed** (group: \"feed\", 19 apps) \u2014 Google Shopping Feed, Facebook Feed, Skroutz, Glami, eMAG, Criteo, Pazaruvaj, etc.\n- **Google** (group: \"global\") \u2014 Google Shopping, Google Sheets, Google Analytics, Google Tags, Google Workspace.\n- **OLX** (group: \"other\") \u2014 OLX marketplace integration with product sync, category mapping, and advert management.\n- **Fulfillment** (group: \"global\") \u2014 Frisbo fulfillment with warehouse and order management.\n- **Marketing** (group: \"marketing\") \u2014 Campaigns (email, SMS marketing automation).\n- **Mailchimp** (group: \"global\") \u2014 Mailchimp email marketing integration.\n- **SEO** (group: \"seo\") \u2014 SEO Spinner for automated meta title/description generation.\n- **Chat** (group: \"chat\") \u2014 Live Chat widget.\n- **Social Login** (group: \"connect\") \u2014 Facebook Connect, Google Connect.\n- **Reviews** (group: \"comment\") \u2014 Facebook Comments, Yotpo.\n- **Mail** (group: \"mail\") \u2014 Custom SMTP configuration.\n- **Search** (group: \"search\") \u2014 Algolia search integration.\n- **Product Description** (group: \"product_description\") \u2014 Flix Facts, Load Bee for rich product content.\n- **Other** (group: \"other\") \u2014 Advanced Search, Listing Engine, Up/Cross-sell, etc.\n\nWhen a developer asks about any application-provided feature, ALWAYS inform them that:\n1. These features require an Application to be installed, active, and configured on their site.\n2. Most operations require a `key` parameter \u2014 this is the application key (e.g., \"speedy\", \"econt\", \"barsy\", \"stripe\").\n3. They can check app status with `application(key: \"...\")` or list available apps with `applications(filter: { group: \"shipping\" })`.\n4. The introspect_graphql_schema tool will flag application-provided resources automatically with a notice.\n\nUSAGE TIPS for introspect_graphql_schema:\n- Search by resource name: \"product\", \"order\", \"customer\", \"discount\"\n- Search by action: \"create\", \"update\", \"delete\"\n- If no results, try shorter/broader terms\n- The search matches on type/query/mutation names (substring match)\n- Results for application-provided resources will include a notice with setup requirements\n\nSCHEMA CONVENTIONS (current as of 2026-04-21):\n\n1. **Output fields are camelCase** \u2014 `urlHandle`, `seoTitle`, `priceFrom`, `dateAdded`, `firstName`, `customerEmail`, etc. If you write `url_handle` on an OUTPUT selection, the query fails.\n\n2. **Input fields and query/mutation arguments stay snake_case** \u2014 `CreateProductInput.url_handle`, `CreateCustomerInput.first_name`, `deleteSmartCollections(ids:)`, `productVariants(product_id:)`. Do NOT camelCase these in mutations.\n\n3. **Connection types expose TWO shapes** \u2014 most `XxxConnection` types have both the Relay cursor form and a flat alternative:\n```graphql\n# Preferred for most queries (half the payload, no cursor wrapper):\ncategories(first: 10) { nodes { id name } totalCount }\n\n# Use only when you need cursor pagination:\ncategories(first: 10) { edges { node { id name } cursor } pageInfo { hasNextPage endCursor } totalCount }\n```\nNOTE: auto-generated connections from `@paginate(type: CONNECTION)` (e.g. `ProductConnection`) only expose `edges`/`pageInfo` \u2014 use the cursor form there.\n\n4. **Grouped sub-types** \u2014 the big root types are split into purpose-scoped sub-objects. Flat fields like `Product.price_from` or `Order.customer_email` DO NOT EXIST anymore. Use:\n- `Product`: `pricing { from to type }`, `seo { title description }`, `flags { active digital hidden draft featured sale new shipping continueSelling }`, `inventory { tracking threshold variantsCount defaultVariantId }`, `parameters { p1 p1Id ... }`, `timestamps { added modified publishAt activeTo }`\n- `Order`: `buyer { email firstName lastName }`, `amounts { subtotal total vatIncluded }`, `statuses { status fulfillment }`, `documents { invoiceNumber ... }`, `notes { customer administrator }`, `flags { manual abandoned notifyCustomer emailSent allowRecalculate }`, `timestamps { added archived locking shippingDate ... }`\n- `Customer`: `contact { firstName lastName phone }`, `verification { emailConfirmed }`, `marketingPrefs { marketing newsletter }`, `status { active isActivated banned }`, `defaults { shippingAddressId billingAddressId }`, `timestamps { added updatedAt }`\n- `CartSettings`: `registration`, `limits`, `defaults`, `checkoutFields`, `maps`, `orders`, `abandoned`, `legal` (see introspect_graphql_schema for sub-type fields)\n\n5. **Scalars** \u2014 `DateTime` is `Y-m-d H:i:s` (not ISO 8601). `Date` is `Y-m-d`. `YesNo` is an enum (`yes`/`no`), not a native Boolean.\n\n6. **Error payloads** are lean \u2014 validation errors return just `message`, `path`, `locations`. No PHP stack traces by default.\n\nBe sure to pass the code into the `validate_graphql_codeblocks` tool and make any necessary corrections that tool indicates are needed. This removes LLM hallucinations from GQL operations.";
|
|
1
|
+
export declare const ADMIN_API_PROMPT = "You are an assistant that helps CloudCart developers write GraphQL queries or mutations to interact with the latest CloudCart Admin GraphQL API.\n\nYou should find all operations that can help the developer achieve their goal, provide valid GraphQL operations along with helpful explanations.\nWhen returning a GraphQL operation always wrap it in triple backticks and use the graphql file type.\nTHIS IS IMPORTANT: GraphQL operations you generate should ALWAYS be validated with the `validate_graphql_codeblocks` MCP tool. This tool will parse the operation with the GQL schema and give you feedback of errors if any were detected. If errors are detected from this validation tool, make the necessary changes and then call this tool again.\n\nThink about all the steps required to generate a GraphQL query or mutation for the Admin API:\n\n First think about what the developer is trying to do\n Then use introspect_graphql_schema to find relevant types, queries, and mutations\n For queries think about which fields you need to fetch and for mutations think about which arguments you need to pass as input\n Then think about which fields to select from the return type. In general, don't select more than 5 fields\n If there are nested objects think about which fields you need to fetch for those objects\n\nIMPORTANT \u2014 APPLICATION-PROVIDED RESOURCES:\nMany CloudCart features are provided by Applications from the CloudCart marketplace, not by the core platform.\nCloudCart has 19 application groups with 250+ apps. The main groups are:\n\n- **Shipping** (group: \"shipping\", 24 apps) \u2014 Speedy, Econt, ACS Courier, DHL, DHL Express, Sameday, FanCourier, Cargus, DPD, GLS, BoxNow, Sendcloud, Glovo, Speedex, etc.\n- **Payment** (group: \"payment\", 46 apps) \u2014 Stripe, PayPal, Mollie, Borica, MyPOS, ePay, CloudCart Pay, Klarna, Adyen, DSK, Fibank, Raiffeisen, Monri, etc.\n- **ERP / POS** (group: \"global\") \u2014 Barsy, Rkeeper, Facturis, SmartBill, Oblio, Lexoffice, Xentral, Sevdesk, etc.\n- **Import** (group: \"import\", 17 apps) \u2014 CSV Import, XML Import, Shopify, WooCommerce, Magento, Google Sheets, JSON Import, etc.\n- **Feed** (group: \"feed\", 19 apps) \u2014 Google Shopping Feed, Facebook Feed, Skroutz, Glami, eMAG, Criteo, Pazaruvaj, etc.\n- **Google** (group: \"global\") \u2014 Google Shopping, Google Sheets, Google Analytics, Google Tags, Google Workspace.\n- **OLX** (group: \"other\") \u2014 OLX marketplace integration with product sync, category mapping, and advert management.\n- **Fulfillment** (group: \"global\") \u2014 Frisbo fulfillment with warehouse and order management.\n- **Marketing** (group: \"marketing\") \u2014 Campaigns (email, SMS marketing automation).\n- **Mailchimp** (group: \"global\") \u2014 Mailchimp email marketing integration.\n- **SEO** (group: \"seo\") \u2014 SEO Spinner for automated meta title/description generation.\n- **Chat** (group: \"chat\") \u2014 Live Chat widget.\n- **Social Login** (group: \"connect\") \u2014 Facebook Connect, Google Connect.\n- **Reviews** (group: \"comment\") \u2014 Facebook Comments, Yotpo.\n- **Mail** (group: \"mail\") \u2014 Custom SMTP configuration.\n- **Search** (group: \"search\") \u2014 Algolia search integration.\n- **Product Description** (group: \"product_description\") \u2014 Flix Facts, Load Bee for rich product content.\n- **Other** (group: \"other\") \u2014 Advanced Search, Listing Engine, Up/Cross-sell, etc.\n\nWhen a developer asks about any application-provided feature, ALWAYS inform them that:\n1. These features require an Application to be installed, active, and configured on their site.\n2. Most operations require a `key` parameter \u2014 this is the application key (e.g., \"speedy\", \"econt\", \"barsy\", \"stripe\").\n3. They can check app status with `application(key: \"...\")` or list available apps with `applications(filter: { group: \"shipping\" })`.\n4. The introspect_graphql_schema tool will flag application-provided resources automatically with a notice.\n\nUSAGE TIPS for introspect_graphql_schema:\n- Search by resource name: \"product\", \"order\", \"customer\", \"discount\"\n- Search by action: \"create\", \"update\", \"delete\"\n- If no results, try shorter/broader terms\n- The search matches on type/query/mutation names (substring match)\n- Results for application-provided resources will include a notice with setup requirements\n\nSCHEMA CONVENTIONS (current as of 2026-04-21):\n\n1. **Output fields are camelCase** \u2014 `urlHandle`, `seoTitle`, `priceFrom`, `dateAdded`, `firstName`, `customerEmail`, etc. If you write `url_handle` on an OUTPUT selection, the query fails.\n\n2. **Input fields and query/mutation arguments stay snake_case** \u2014 `CreateProductInput.url_handle`, `CreateCustomerInput.first_name`, `deleteSmartCollections(ids:)`, `productVariants(product_id:)`. Do NOT camelCase these in mutations.\n\n3. **Connection types expose TWO shapes** \u2014 most `XxxConnection` types have both the Relay cursor form and a flat alternative:\n```graphql\n# Preferred for most queries (half the payload, no cursor wrapper):\ncategories(first: 10) { nodes { id name } totalCount }\n\n# Use only when you need cursor pagination:\ncategories(first: 10) { edges { node { id name } cursor } pageInfo { hasNextPage endCursor } totalCount }\n```\nNOTE: auto-generated connections from `@paginate(type: CONNECTION)` (e.g. `ProductConnection`) only expose `edges`/`pageInfo` \u2014 use the cursor form there.\n\n4. **Grouped sub-types** \u2014 the big root types are split into purpose-scoped sub-objects. Flat fields like `Product.price_from` or `Order.customer_email` DO NOT EXIST anymore. Use:\n- `Product`: `pricing { from to type }`, `seo { title description }`, `flags { active digital hidden draft featured sale new shipping continueSelling }`, `inventory { tracking threshold variantsCount defaultVariantId }`, `parameters { p1 p1Id ... }`, `timestamps { added modified publishAt activeTo }`\n- `Order`: `buyer { email firstName lastName }`, `amounts { subtotal total vatIncluded }`, `statuses { status fulfillment }`, `documents { invoiceNumber ... }`, `notes { customer administrator }`, `flags { manual abandoned notifyCustomer emailSent allowRecalculate }`, `timestamps { added archived locking shippingDate ... }`\n- `Customer`: `contact { firstName lastName phone }`, `verification { emailConfirmed }`, `marketingPrefs { marketing newsletter }`, `status { active isActivated banned }`, `defaults { shippingAddressId billingAddressId }`, `timestamps { added updatedAt }`\n- `CartSettings`: `registration`, `limits`, `defaults`, `checkoutFields`, `maps`, `orders`, `abandoned`, `legal` (see introspect_graphql_schema for sub-type fields)\n\n5. **Scalars** \u2014 `DateTime` is `Y-m-d H:i:s` (not ISO 8601). `Date` is `Y-m-d`. `YesNo` is an enum (`yes`/`no`), not a native Boolean.\n\n6. **Error payloads** are lean \u2014 validation errors return just `message`, `path`, `locations`. No PHP stack traces by default.\n\n7. **Pre-built filter args on list queries \u2014 use them instead of fetching everything and filtering client-side.** Before you loop over orders / products / customers, introspect the list query and check its args. Concrete filter shapes you likely want:\n\n```graphql\n# \"How many orders have more than 1 product?\"\norders(products_count: { operator: gt, value: 1 }) { pageInfo { total } }\n\n# \"Orders with > 5 items total\"\norders(quantity: { operator: gt, value: 5 }) { pageInfo { total } }\n\n# \"Customers with >= 2 completed orders\"\ncustomers(orders_count: { operator: gte, value: 2 }) { pageInfo { total } edges { node { email } } }\n\n# \"VIP customers with lifetime spend > 500 (store-currency cents)\"\ncustomers(total_spent: { operator: gt, value: 50000 }) { pageInfo { total } }\n\n# \"Customers in a given segment\"\ncustomers(segment: 115) { edges { node { id email } } }\n\n# \"Products out of stock / low stock\"\nproducts(stock: { operator: lte, value: 0 }) { pageInfo { total } }\n\n# \"Products without images\"\nproducts(has_image: false) { pageInfo { total } }\n\n# \"Recently modified products\"\nproducts(date_modified: { operator: gte, value: \"2026-04-01\" }) { pageInfo { total } }\n```\n\nNumericFilter operators: `lt`, `lte`, `gt`, `gte`, `eq` / `is`. DateFilter adds `between` with pipe-separated value `\"YYYY-MM-DD|YYYY-MM-DD\"`. StringFilter supports `is`, `is_not`, `in`.\n\n8. **Segments vs filters.** A segment is a PERSISTED marketing collection for reuse in campaigns. A filter is an AD-HOC narrowing of a list query. For one-off counts / exports use the filter args above; for reusable customer groupings build a segment:\n - Call `segmentConditions` FIRST to discover the condition tree. Every returned entry has a full `key` like `marketing.segments.conditions.order` \u2014 pass THAT `key` (not the short `id`) into `SegmentConditionInput`.\n - `createSegment(input: { type: regular, name: \"\u2026\", conditions: [...] })`. Name auto-generated from conditions if omitted; supply `name` for a specific label.\n - After the segment is created, filter its members with `customers(segment: <id>)`.\n\nBe sure to pass the code into the `validate_graphql_codeblocks` tool and make any necessary corrections that tool indicates are needed. This removes LLM hallucinations from GQL operations.";
|
|
2
2
|
//# sourceMappingURL=admin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/prompts/admin.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/prompts/admin.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,4oSA+GkK,CAAC"}
|
package/dist/prompts/admin.js
CHANGED
|
@@ -74,5 +74,40 @@ NOTE: auto-generated connections from \`@paginate(type: CONNECTION)\` (e.g. \`Pr
|
|
|
74
74
|
|
|
75
75
|
6. **Error payloads** are lean — validation errors return just \`message\`, \`path\`, \`locations\`. No PHP stack traces by default.
|
|
76
76
|
|
|
77
|
+
7. **Pre-built filter args on list queries — use them instead of fetching everything and filtering client-side.** Before you loop over orders / products / customers, introspect the list query and check its args. Concrete filter shapes you likely want:
|
|
78
|
+
|
|
79
|
+
\`\`\`graphql
|
|
80
|
+
# "How many orders have more than 1 product?"
|
|
81
|
+
orders(products_count: { operator: gt, value: 1 }) { pageInfo { total } }
|
|
82
|
+
|
|
83
|
+
# "Orders with > 5 items total"
|
|
84
|
+
orders(quantity: { operator: gt, value: 5 }) { pageInfo { total } }
|
|
85
|
+
|
|
86
|
+
# "Customers with >= 2 completed orders"
|
|
87
|
+
customers(orders_count: { operator: gte, value: 2 }) { pageInfo { total } edges { node { email } } }
|
|
88
|
+
|
|
89
|
+
# "VIP customers with lifetime spend > 500 (store-currency cents)"
|
|
90
|
+
customers(total_spent: { operator: gt, value: 50000 }) { pageInfo { total } }
|
|
91
|
+
|
|
92
|
+
# "Customers in a given segment"
|
|
93
|
+
customers(segment: 115) { edges { node { id email } } }
|
|
94
|
+
|
|
95
|
+
# "Products out of stock / low stock"
|
|
96
|
+
products(stock: { operator: lte, value: 0 }) { pageInfo { total } }
|
|
97
|
+
|
|
98
|
+
# "Products without images"
|
|
99
|
+
products(has_image: false) { pageInfo { total } }
|
|
100
|
+
|
|
101
|
+
# "Recently modified products"
|
|
102
|
+
products(date_modified: { operator: gte, value: "2026-04-01" }) { pageInfo { total } }
|
|
103
|
+
\`\`\`
|
|
104
|
+
|
|
105
|
+
NumericFilter operators: \`lt\`, \`lte\`, \`gt\`, \`gte\`, \`eq\` / \`is\`. DateFilter adds \`between\` with pipe-separated value \`"YYYY-MM-DD|YYYY-MM-DD"\`. StringFilter supports \`is\`, \`is_not\`, \`in\`.
|
|
106
|
+
|
|
107
|
+
8. **Segments vs filters.** A segment is a PERSISTED marketing collection for reuse in campaigns. A filter is an AD-HOC narrowing of a list query. For one-off counts / exports use the filter args above; for reusable customer groupings build a segment:
|
|
108
|
+
- Call \`segmentConditions\` FIRST to discover the condition tree. Every returned entry has a full \`key\` like \`marketing.segments.conditions.order\` — pass THAT \`key\` (not the short \`id\`) into \`SegmentConditionInput\`.
|
|
109
|
+
- \`createSegment(input: { type: regular, name: "…", conditions: [...] })\`. Name auto-generated from conditions if omitted; supply \`name\` for a specific label.
|
|
110
|
+
- After the segment is created, filter its members with \`customers(segment: <id>)\`.
|
|
111
|
+
|
|
77
112
|
Be sure to pass the code into the \`validate_graphql_codeblocks\` tool and make any necessary corrections that tool indicates are needed. This removes LLM hallucinations from GQL operations.`;
|
|
78
113
|
//# sourceMappingURL=admin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/prompts/admin.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/prompts/admin.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+LA+G+J,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspect-schema.d.ts","sourceRoot":"","sources":["../../src/tools/introspect-schema.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;
|
|
1
|
+
{"version":3,"file":"introspect-schema.d.ts","sourceRoot":"","sources":["../../src/tools/introspect-schema.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAgID,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe;;;;;EAqHtD"}
|
|
@@ -9,9 +9,8 @@ function resolveTypeRef(typeRef) {
|
|
|
9
9
|
}
|
|
10
10
|
return typeRef.name ?? "Unknown";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
let signature = field.name;
|
|
12
|
+
function signatureFor(field) {
|
|
13
|
+
let sig = field.name;
|
|
15
14
|
if (field.args && field.args.length > 0) {
|
|
16
15
|
const argStr = field.args
|
|
17
16
|
.map((a) => {
|
|
@@ -21,89 +20,106 @@ function formatField(field) {
|
|
|
21
20
|
return s;
|
|
22
21
|
})
|
|
23
22
|
.join(", ");
|
|
24
|
-
|
|
23
|
+
sig += `(${argStr})`;
|
|
24
|
+
}
|
|
25
|
+
sig += `: ${resolveTypeRef(field.type)}`;
|
|
26
|
+
return sig;
|
|
27
|
+
}
|
|
28
|
+
/** Compact one-line field: `name: Type # description` (or just signature if no desc). */
|
|
29
|
+
function formatField(field) {
|
|
30
|
+
const sig = signatureFor(field);
|
|
31
|
+
return field.description ? `${sig} # ${field.description}` : sig;
|
|
32
|
+
}
|
|
33
|
+
const MAX_FIELDS_PER_TYPE = 20;
|
|
34
|
+
/** Root types known to have been consolidated into grouped sub-types. */
|
|
35
|
+
const GROUPED_PARENT_HINTS = {
|
|
36
|
+
Product: "pricing/seo/flags/inventory/parameters/timestamps",
|
|
37
|
+
Order: "buyer/amounts/statuses/documents/notes/flags/timestamps",
|
|
38
|
+
Customer: "contact/verification/marketingPrefs/status/defaults/timestamps",
|
|
39
|
+
CartSettings: "registration/limits/defaults/checkoutFields/maps/orders/abandoned/legal",
|
|
40
|
+
};
|
|
41
|
+
/** True if a type looks like a Relay connection that exposes the flat `nodes` + `totalCount` alternative. */
|
|
42
|
+
function hasFlatNodesShape(type) {
|
|
43
|
+
if (!type.name.endsWith("Connection"))
|
|
44
|
+
return false;
|
|
45
|
+
const fieldNames = new Set((type.fields ?? []).map((f) => f.name));
|
|
46
|
+
return fieldNames.has("nodes") && fieldNames.has("totalCount");
|
|
47
|
+
}
|
|
48
|
+
/** Collect contextual hints specific to this type (nodes preference, grouped sub-types). */
|
|
49
|
+
function hintsForType(type) {
|
|
50
|
+
const hints = [];
|
|
51
|
+
if (hasFlatNodesShape(type)) {
|
|
52
|
+
hints.push("> TIP: prefer `{ nodes { ... } totalCount }` unless you need cursor pagination (~2× smaller payload).");
|
|
25
53
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
parts.push(` # ${field.description}`);
|
|
54
|
+
const grouped = GROUPED_PARENT_HINTS[type.name];
|
|
55
|
+
if (grouped) {
|
|
56
|
+
hints.push(`> TIP: ${type.name} fields live in grouped sub-types — ${grouped}.`);
|
|
30
57
|
}
|
|
31
|
-
return
|
|
58
|
+
return hints;
|
|
59
|
+
}
|
|
60
|
+
/** One-line type summary: `KIND Name # Description`. No field body. */
|
|
61
|
+
function formatTypeSummary(type) {
|
|
62
|
+
return type.description ? `${type.kind} ${type.name} # ${type.description}` : `${type.kind} ${type.name}`;
|
|
32
63
|
}
|
|
33
64
|
function formatType(type) {
|
|
34
|
-
const lines = [];
|
|
35
|
-
// Header with kind and name
|
|
36
|
-
let header = `${type.kind} ${type.name}`;
|
|
37
|
-
lines.push(header);
|
|
38
|
-
if (type.description) {
|
|
39
|
-
lines.push(` Description: ${type.description}`);
|
|
40
|
-
}
|
|
41
|
-
// Show implements (interfaces)
|
|
65
|
+
const lines = [formatTypeSummary(type)];
|
|
42
66
|
if (type.interfaces && type.interfaces.length > 0) {
|
|
43
67
|
const ifaceNames = type.interfaces.map((i) => i.name ?? resolveTypeRef(i)).filter(Boolean);
|
|
44
|
-
if (ifaceNames.length > 0)
|
|
45
|
-
lines.push(`
|
|
46
|
-
}
|
|
68
|
+
if (ifaceNames.length > 0)
|
|
69
|
+
lines.push(` implements ${ifaceNames.join(", ")}`);
|
|
47
70
|
}
|
|
48
71
|
if (type.fields && type.fields.length > 0) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
for (const f of type.fields.slice(0, 20)) {
|
|
53
|
-
lines.push(` ${formatField(f)}`);
|
|
54
|
-
lines.push("");
|
|
72
|
+
const shown = type.fields.slice(0, MAX_FIELDS_PER_TYPE);
|
|
73
|
+
for (const f of shown) {
|
|
74
|
+
lines.push(` ${formatField(f)}`);
|
|
55
75
|
}
|
|
56
|
-
if (type.fields.length >
|
|
57
|
-
|
|
76
|
+
if (type.fields.length > MAX_FIELDS_PER_TYPE) {
|
|
77
|
+
// Expose the remaining field names + types (no descriptions) — critical
|
|
78
|
+
// fields like `Order.productsCount` must stay discoverable rather than
|
|
79
|
+
// being hidden behind a "... +N more fields" truncation.
|
|
80
|
+
const rest = type.fields.slice(MAX_FIELDS_PER_TYPE);
|
|
81
|
+
const sigs = rest.map((f) => signatureFor(f));
|
|
82
|
+
lines.push(` # +${rest.length} more: ${sigs.join(", ")}`);
|
|
58
83
|
}
|
|
59
84
|
}
|
|
60
85
|
if (type.inputFields && type.inputFields.length > 0) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
lines.push(` ${f.name}: ${resolveTypeRef(f.type)}`);
|
|
66
|
-
if (f.description) {
|
|
67
|
-
lines.push(` # ${f.description}`);
|
|
68
|
-
}
|
|
69
|
-
lines.push("");
|
|
86
|
+
const shown = type.inputFields.slice(0, MAX_FIELDS_PER_TYPE);
|
|
87
|
+
for (const f of shown) {
|
|
88
|
+
const sig = `${f.name}: ${resolveTypeRef(f.type)}`;
|
|
89
|
+
lines.push(` ${f.description ? `${sig} # ${f.description}` : sig}`);
|
|
70
90
|
}
|
|
71
|
-
if (type.inputFields.length >
|
|
72
|
-
|
|
91
|
+
if (type.inputFields.length > MAX_FIELDS_PER_TYPE) {
|
|
92
|
+
const rest = type.inputFields.slice(MAX_FIELDS_PER_TYPE);
|
|
93
|
+
const sigs = rest.map((f) => `${f.name}: ${resolveTypeRef(f.type)}`);
|
|
94
|
+
lines.push(` # +${rest.length} more: ${sigs.join(", ")}`);
|
|
73
95
|
}
|
|
74
96
|
}
|
|
75
97
|
if (type.enumValues && type.enumValues.length > 0) {
|
|
76
|
-
lines.push("");
|
|
77
98
|
for (const v of type.enumValues) {
|
|
78
|
-
lines.push(` ${v.name}${v.description ? `
|
|
99
|
+
lines.push(` ${v.name}${v.description ? ` # ${v.description}` : ""}`);
|
|
79
100
|
}
|
|
80
101
|
}
|
|
81
102
|
return lines.join("\n");
|
|
82
103
|
}
|
|
83
104
|
const RESULTS_LIMIT = 10;
|
|
84
105
|
function formatAppNotice(group) {
|
|
85
|
-
return `> ⚠️
|
|
86
|
-
}
|
|
87
|
-
function formatTypeWithAppNotice(type) {
|
|
88
|
-
const formatted = formatType(type);
|
|
89
|
-
const appGroup = matchAppResourceGroup(type.name);
|
|
90
|
-
if (appGroup) {
|
|
91
|
-
return `${formatAppNotice(appGroup)}\n\n${formatted}`;
|
|
92
|
-
}
|
|
93
|
-
return formatted;
|
|
94
|
-
}
|
|
95
|
-
function formatFieldWithAppNotice(field) {
|
|
96
|
-
const formatted = formatField(field);
|
|
97
|
-
const appGroup = matchAppResourceGroup(field.name);
|
|
98
|
-
if (appGroup) {
|
|
99
|
-
return `${formatAppNotice(appGroup)}\n\n${formatted}`;
|
|
100
|
-
}
|
|
101
|
-
return formatted;
|
|
106
|
+
return `> ⚠️ ${group.label} (Application-Provided) — ${group.notice}`;
|
|
102
107
|
}
|
|
103
108
|
export function introspectSchema(input) {
|
|
104
109
|
const api = input.api ?? "admin";
|
|
105
110
|
const filters = input.filter ?? ["all"];
|
|
106
111
|
const includeAll = filters.includes("all");
|
|
112
|
+
// Reject empty/whitespace-only queries — returning a random top-10 slice
|
|
113
|
+
// (1 500+ tokens) helps nobody. Nudge the caller to provide a term.
|
|
114
|
+
const rawQuery = input.query?.trim() ?? "";
|
|
115
|
+
if (rawQuery === "") {
|
|
116
|
+
return {
|
|
117
|
+
content: [{
|
|
118
|
+
type: "text",
|
|
119
|
+
text: `Provide a search term (e.g. "product", "createOrder", "discount"). Empty queries are rejected to avoid flooding your context with arbitrary results.`,
|
|
120
|
+
}],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
107
123
|
let schema;
|
|
108
124
|
try {
|
|
109
125
|
schema = loadSchema(api);
|
|
@@ -113,73 +129,88 @@ export function introspectSchema(input) {
|
|
|
113
129
|
content: [{ type: "text", text: `Failed to load schema for "${api}": ${e.message}` }],
|
|
114
130
|
};
|
|
115
131
|
}
|
|
116
|
-
// Normalize query:
|
|
117
|
-
|
|
132
|
+
// Normalize query: lowercase, strip whitespace, drop trailing 's' so
|
|
133
|
+
// "categories" and "category" both match CategoryConnection / Category.
|
|
134
|
+
let normalized = rawQuery.toLowerCase().replace(/\s+/g, "");
|
|
118
135
|
if (normalized.endsWith("s") && normalized.length > 1) {
|
|
119
136
|
normalized = normalized.slice(0, -1);
|
|
120
137
|
}
|
|
121
138
|
const sections = [];
|
|
122
|
-
//
|
|
139
|
+
// Dedup app notices across the whole response — a grouped speedy hit in
|
|
140
|
+
// Types + Queries + Mutations should only emit one banner.
|
|
123
141
|
const shownAppNotices = new Set();
|
|
142
|
+
let anyTruncated = false;
|
|
143
|
+
const renderAppPrefix = (name) => {
|
|
144
|
+
const appGroup = matchAppResourceGroup(name);
|
|
145
|
+
if (!appGroup || shownAppNotices.has(appGroup.group))
|
|
146
|
+
return "";
|
|
147
|
+
shownAppNotices.add(appGroup.group);
|
|
148
|
+
return formatAppNotice(appGroup) + "\n";
|
|
149
|
+
};
|
|
124
150
|
if (includeAll || filters.includes("types")) {
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
151
|
+
const all = schema.types.filter((t) => t.name.toLowerCase().includes(normalized));
|
|
152
|
+
const matched = all.sort((a, b) => a.name.length - b.name.length).slice(0, RESULTS_LIMIT);
|
|
153
|
+
if (all.length > RESULTS_LIMIT)
|
|
154
|
+
anyTruncated = true;
|
|
129
155
|
if (matched.length > 0) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
156
|
+
// When multiple types match, only expand the top hit with full fields.
|
|
157
|
+
// The rest are 1-line summaries — the agent can follow up with a
|
|
158
|
+
// specific introspect(query: "ExactName") if they need details.
|
|
159
|
+
// Exact-name hits always get full detail regardless of result count.
|
|
160
|
+
const lines = ["## Types"];
|
|
161
|
+
const emittedHints = [];
|
|
162
|
+
matched.forEach((t, i) => {
|
|
163
|
+
const exactHit = t.name.toLowerCase() === normalized || t.name.toLowerCase() === rawQuery.toLowerCase();
|
|
164
|
+
const expand = i === 0 || exactHit || matched.length === 1;
|
|
165
|
+
const body = expand ? formatType(t) : formatTypeSummary(t);
|
|
166
|
+
lines.push(renderAppPrefix(t.name) + body);
|
|
167
|
+
if (expand)
|
|
168
|
+
emittedHints.push(...hintsForType(t));
|
|
137
169
|
});
|
|
138
|
-
|
|
139
|
-
|
|
170
|
+
// Per-type hints (nodes/totalCount, grouped sub-types) — dedup.
|
|
171
|
+
const uniqueHints = Array.from(new Set(emittedHints));
|
|
172
|
+
uniqueHints.forEach((h) => lines.push(h));
|
|
173
|
+
if (matched.length > 1 && !matched.every((t, i) => i === 0 || t.name.toLowerCase() === rawQuery.toLowerCase())) {
|
|
174
|
+
lines.push(`> Only the top match is expanded. For full fields on others, re-run with the exact type name.`);
|
|
175
|
+
}
|
|
176
|
+
sections.push(lines.join("\n\n"));
|
|
140
177
|
}
|
|
141
178
|
}
|
|
142
179
|
if (includeAll || filters.includes("queries")) {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
180
|
+
const all = schema.queries.filter((q) => q.name.toLowerCase().includes(normalized));
|
|
181
|
+
const matched = all.sort((a, b) => a.name.length - b.name.length).slice(0, RESULTS_LIMIT);
|
|
182
|
+
if (all.length > RESULTS_LIMIT)
|
|
183
|
+
anyTruncated = true;
|
|
147
184
|
if (matched.length > 0) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
if (appGroup && !shownAppNotices.has(appGroup.group)) {
|
|
151
|
-
shownAppNotices.add(appGroup.group);
|
|
152
|
-
return `${formatAppNotice(appGroup)}\n\n${formatField(f)}`;
|
|
153
|
-
}
|
|
154
|
-
return formatField(f);
|
|
155
|
-
});
|
|
156
|
-
sections.push(`## Matching GraphQL Queries:\n(Results limited to ${RESULTS_LIMIT} items. Refine your search for more specific results.)\n\n` +
|
|
157
|
-
formattedQueries.join("\n\n"));
|
|
185
|
+
sections.push(`## Queries\n` +
|
|
186
|
+
matched.map((f) => renderAppPrefix(f.name) + formatField(f)).join("\n"));
|
|
158
187
|
}
|
|
159
188
|
}
|
|
160
189
|
if (includeAll || filters.includes("mutations")) {
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
190
|
+
const all = schema.mutations.filter((m) => m.name.toLowerCase().includes(normalized));
|
|
191
|
+
const matched = all.sort((a, b) => a.name.length - b.name.length).slice(0, RESULTS_LIMIT);
|
|
192
|
+
if (all.length > RESULTS_LIMIT)
|
|
193
|
+
anyTruncated = true;
|
|
165
194
|
if (matched.length > 0) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
shownAppNotices.add(appGroup.group);
|
|
170
|
-
return `${formatAppNotice(appGroup)}\n\n${formatField(f)}`;
|
|
171
|
-
}
|
|
172
|
-
return formatField(f);
|
|
173
|
-
});
|
|
174
|
-
sections.push(`## Matching GraphQL Mutations:\n(Results limited to ${RESULTS_LIMIT} items. Refine your search for more specific results.)\n\n` +
|
|
175
|
-
formattedMutations.join("\n\n"));
|
|
195
|
+
sections.push(`## Mutations\n` +
|
|
196
|
+
matched.map((f) => renderAppPrefix(f.name) + formatField(f)).join("\n") +
|
|
197
|
+
`\n> TIP: mutation inputs are snake_case — use url_handle, first_name, price_from, etc. (outputs are camelCase).`);
|
|
176
198
|
}
|
|
177
199
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
200
|
+
if (sections.length === 0) {
|
|
201
|
+
return {
|
|
202
|
+
content: [{
|
|
203
|
+
type: "text",
|
|
204
|
+
text: `No results for "${input.query}" in the ${api} API. Try a broader term or a different word stem.`,
|
|
205
|
+
}],
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const header = anyTruncated
|
|
209
|
+
? `> Some sections hit the ${RESULTS_LIMIT}-item cap; refine your term for more specific results.\n\n`
|
|
210
|
+
: "";
|
|
211
|
+
const footer = `\n\n> NEXT: pass your drafted query to validate_graphql_codeblocks before executing — it catches typos, wrong types, and deprecated fields.`;
|
|
181
212
|
return {
|
|
182
|
-
content: [{ type: "text", text }],
|
|
213
|
+
content: [{ type: "text", text: header + sections.join("\n\n") + footer }],
|
|
183
214
|
};
|
|
184
215
|
}
|
|
185
216
|
//# sourceMappingURL=introspect-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspect-schema.js","sourceRoot":"","sources":["../../src/tools/introspect-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAyB,MAAM,qBAAqB,CAAC;AAWnF,SAAS,cAAc,CAAC,OAA6D;IACnF,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAChC,OA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AAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,mBAAmB,KAAK,CAAC,KAAK,YAAY,GAAG,oDAAoD;iBACxG,CAAC;SACH,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,YAAY;QACzB,CAAC,CAAC,2BAA2B,aAAa,4DAA4D;QACtG,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,MAAM,GAAG,6IAA6I,CAAC;IAE7J,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC;KACpF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-graphql.d.ts","sourceRoot":"","sources":["../../src/tools/validate-graphql.ts"],"names":[],"mappings":"AAcA,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"validate-graphql.d.ts","sourceRoot":"","sources":["../../src/tools/validate-graphql.ts"],"names":[],"mappings":"AAcA,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB;AA2OD,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa;;;;;EAiGnD"}
|
|
@@ -4,6 +4,179 @@ import { loadSchema } from "../schema/loader.js";
|
|
|
4
4
|
function formatGraphQLError(error) {
|
|
5
5
|
return error.message;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Fields that existed at a root type before the Phase 3 consolidation
|
|
9
|
+
* and now live under a grouped sub-type. Keyed by "Parent.oldField".
|
|
10
|
+
*/
|
|
11
|
+
const MOVED_FIELDS = {
|
|
12
|
+
"Order.quantity": "amounts.quantity",
|
|
13
|
+
"Order.priceTotal": "amounts.total",
|
|
14
|
+
"Order.priceSubtotal": "amounts.subtotal",
|
|
15
|
+
"Order.priceProductsSubtotal": "amounts.productsSubtotal",
|
|
16
|
+
"Order.vatIncluded": "amounts.vatIncluded",
|
|
17
|
+
"Order.weight": "amounts.weight",
|
|
18
|
+
"Order.customerEmail": "buyer.email",
|
|
19
|
+
"Order.customerFirstName": "buyer.firstName",
|
|
20
|
+
"Order.customerLastName": "buyer.lastName",
|
|
21
|
+
"Order.customerId": "buyer.customerId",
|
|
22
|
+
"Order.status": "statuses.status",
|
|
23
|
+
"Order.statusFulfillment": "statuses.fulfillment",
|
|
24
|
+
"Order.noteCustomer": "notes.customer",
|
|
25
|
+
"Order.noteAdministrator": "notes.administrator",
|
|
26
|
+
"Order.invoiceNumber": "documents.invoiceNumber",
|
|
27
|
+
"Order.invoiceDate": "documents.invoiceDate",
|
|
28
|
+
"Order.dateAdded": "timestamps.added",
|
|
29
|
+
"Order.dateArchived": "timestamps.archived",
|
|
30
|
+
"Product.priceFrom": "pricing.from",
|
|
31
|
+
"Product.priceTo": "pricing.to",
|
|
32
|
+
"Product.priceType": "pricing.type",
|
|
33
|
+
"Product.seoTitle": "seo.title",
|
|
34
|
+
"Product.seoDescription": "seo.description",
|
|
35
|
+
"Product.active": "flags.active",
|
|
36
|
+
"Product.digital": "flags.digital",
|
|
37
|
+
"Product.hidden": "flags.hidden",
|
|
38
|
+
"Product.draft": "flags.draft",
|
|
39
|
+
"Product.featured": "flags.featured",
|
|
40
|
+
"Product.sale": "flags.sale",
|
|
41
|
+
"Product.new": "flags.new",
|
|
42
|
+
"Product.tracking": "inventory.tracking",
|
|
43
|
+
"Product.threshold": "inventory.threshold",
|
|
44
|
+
"Product.variantsCount": "inventory.variantsCount",
|
|
45
|
+
"Product.dateAdded": "timestamps.added",
|
|
46
|
+
"Product.dateModified": "timestamps.modified",
|
|
47
|
+
"Product.publishDate": "timestamps.publishAt",
|
|
48
|
+
"Customer.firstName": "contact.firstName",
|
|
49
|
+
"Customer.lastName": "contact.lastName",
|
|
50
|
+
"Customer.phone": "contact.phone",
|
|
51
|
+
"Customer.active": "status.active",
|
|
52
|
+
"Customer.banned": "status.banned",
|
|
53
|
+
"Customer.marketing": "marketingPrefs.marketing",
|
|
54
|
+
"Customer.newsletter": "marketingPrefs.newsletter",
|
|
55
|
+
"Customer.emailConfirmed": "verification.emailConfirmed",
|
|
56
|
+
"Customer.dateAdded": "timestamps.added",
|
|
57
|
+
};
|
|
58
|
+
/** Common ORM-style field names AI agents reach for that don't exist on CloudCart types. */
|
|
59
|
+
const COMMON_ALIASES = {
|
|
60
|
+
"Order.items": "products",
|
|
61
|
+
"Order.lineItems": "products",
|
|
62
|
+
"Order.orderProducts": "products",
|
|
63
|
+
"Cart.items": "products",
|
|
64
|
+
"Cart.lineItems": "products",
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Produce a short remediation hint for a validation error message, so the
|
|
68
|
+
* agent can fix the query without a second introspect round-trip.
|
|
69
|
+
*
|
|
70
|
+
* Each hint is <= 1 line. Returns null if the message is not one we
|
|
71
|
+
* recognise — we stay silent instead of handwaving.
|
|
72
|
+
*/
|
|
73
|
+
function hintForErrorMessage(msg) {
|
|
74
|
+
// Moved-field check (Phase 3 consolidation): was at root, now in sub-type.
|
|
75
|
+
const unknownField = msg.match(/Cannot query field "([A-Za-z_][A-Za-z0-9_]*)" on type "([A-Z][A-Za-z_]+)"/);
|
|
76
|
+
if (unknownField) {
|
|
77
|
+
const [, field, parent] = unknownField;
|
|
78
|
+
const moved = MOVED_FIELDS[`${parent}.${field}`];
|
|
79
|
+
if (moved) {
|
|
80
|
+
return `\`${parent}.${field}\` was consolidated into a sub-type — use \`${parent} { ${moved.split(".")[0]} { ${moved.split(".")[1]} } }\`.`;
|
|
81
|
+
}
|
|
82
|
+
const alias = COMMON_ALIASES[`${parent}.${field}`];
|
|
83
|
+
if (alias) {
|
|
84
|
+
return `\`${parent}\` uses \`${alias}\` for this relation, not \`${field}\`. Example: \`{ ${parent.toLowerCase()} { ${alias} { id } } }\`.`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// "Cannot query field "snake_case" on type "X"."
|
|
88
|
+
const unknownSnake = msg.match(/Cannot query field "([a-z][a-z0-9_]*_[a-z0-9_]+)" on type "([A-Za-z_]+)"/);
|
|
89
|
+
if (unknownSnake) {
|
|
90
|
+
const snake = unknownSnake[1];
|
|
91
|
+
const camel = snake.replace(/_([a-z0-9])/g, (_, c) => c.toUpperCase());
|
|
92
|
+
const parent = unknownSnake[2];
|
|
93
|
+
const grouped = {
|
|
94
|
+
Product: "pricing { from to }, seo { title description }, flags { active digital }, inventory { ... }",
|
|
95
|
+
Order: "buyer { email firstName }, amounts { total subtotal }, statuses { status }, notes { customer administrator }",
|
|
96
|
+
Customer: "contact { firstName lastName phone }, status { active banned }, marketingPrefs { marketing newsletter }",
|
|
97
|
+
};
|
|
98
|
+
const groupHint = grouped[parent] ? ` Or check grouped sub-types on ${parent}: ${grouped[parent]}.` : "";
|
|
99
|
+
return `Output fields are camelCase — try \`${camel}\`.${groupHint}`;
|
|
100
|
+
}
|
|
101
|
+
// "Cannot query field "title" on type "Product". Did you mean ...?"
|
|
102
|
+
if (/Cannot query field "title" on type "Product"/.test(msg)) {
|
|
103
|
+
return `Product uses \`name\`, not \`title\`. The \`title\` field does not exist on Product.`;
|
|
104
|
+
}
|
|
105
|
+
// "Cannot query field "nodes" on type "ProductConnection". Did you mean "edges"?"
|
|
106
|
+
const autoConn = msg.match(/Cannot query field "(nodes|totalCount)" on type "([A-Za-z]+Connection)"/);
|
|
107
|
+
if (autoConn) {
|
|
108
|
+
return `${autoConn[2]} is auto-generated by @paginate — only \`edges { node cursor }\` + \`pageInfo\` are available. Use the cursor form on this connection.`;
|
|
109
|
+
}
|
|
110
|
+
// "Field \"X\" of required type \"Y!\" was not provided."
|
|
111
|
+
const missingInput = msg.match(/Field "([a-zA-Z_]+)\.([a-zA-Z_]+)" of required type/);
|
|
112
|
+
if (missingInput) {
|
|
113
|
+
return `Input field \`${missingInput[2]}\` is required on \`${missingInput[1]}\`. Check with introspect_graphql_schema for the full input shape.`;
|
|
114
|
+
}
|
|
115
|
+
// "Unknown argument "camelCase" on field "X" of type "Y"."
|
|
116
|
+
const argCamel = msg.match(/Unknown argument "([a-z]+[A-Z][a-zA-Z]*)" on field/);
|
|
117
|
+
if (argCamel) {
|
|
118
|
+
const camel = argCamel[1];
|
|
119
|
+
const snake = camel.replace(/[A-Z]/g, (c) => "_" + c.toLowerCase());
|
|
120
|
+
return `Arguments are snake_case on this API — try \`${snake}\`.`;
|
|
121
|
+
}
|
|
122
|
+
// Missing / unknown argument on known list queries — nudge towards the
|
|
123
|
+
// pre-built filter args the agent is almost certainly looking for.
|
|
124
|
+
const argHints = {
|
|
125
|
+
"orders.products_count": "orders has a server-side `products_count: NumericFilter` arg for \"orders with N products\". No need to fetch all and count client-side.",
|
|
126
|
+
"orders.quantity": "orders has a `quantity: NumericFilter` arg for total-item filtering.",
|
|
127
|
+
"customers.orders_count": "customers has a server-side `orders_count: NumericFilter` arg for \"customers with >= N completed orders\".",
|
|
128
|
+
"customers.total_spent": "customers has a `total_spent: NumericFilter` arg (store-currency cents).",
|
|
129
|
+
"customers.segment": "customers has a `segment: ID` arg — pass a segment id created via createSegment.",
|
|
130
|
+
"products.stock": "products has a `stock: NumericFilter` arg matching any variant's quantity. Use it instead of scanning variants client-side.",
|
|
131
|
+
"products.has_image": "products has a `has_image: Boolean` arg — use it instead of null-checking featuredImage in a loop.",
|
|
132
|
+
"products.hidden": "products has a `hidden: YesNo` arg.",
|
|
133
|
+
"products.tracking": "products has a `tracking: YesNo` arg.",
|
|
134
|
+
"products.date_modified": "products has a `date_modified: DateFilter` arg.",
|
|
135
|
+
"products.date_added": "products has a `date_added: DateFilter` arg.",
|
|
136
|
+
};
|
|
137
|
+
const unknownArg = msg.match(/Unknown argument "([a-z_]+)" on field "(?:Query\.)?([a-z]+)"/);
|
|
138
|
+
if (unknownArg) {
|
|
139
|
+
const [, arg, field] = unknownArg;
|
|
140
|
+
const key = `${field}.${arg}`;
|
|
141
|
+
if (argHints[key])
|
|
142
|
+
return argHints[key];
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Static checks that GraphQL's own validator can't do: things the schema
|
|
148
|
+
* declares with a permissive type (e.g. `key: String!`) but whose value has
|
|
149
|
+
* a known-constrained shape (e.g. must be a full module ID). Runs on the
|
|
150
|
+
* raw query text AFTER schema validation passes, so we catch known
|
|
151
|
+
* runtime-only mistakes before the agent hits the server.
|
|
152
|
+
*/
|
|
153
|
+
function staticPostValidationHints(queryText) {
|
|
154
|
+
const hints = [];
|
|
155
|
+
// `createSegment` / `updateSegment`: condition `key:` values must be full
|
|
156
|
+
// module IDs like "marketing.segments.conditions.…". Agents routinely
|
|
157
|
+
// guess "order.times" (short form) or "order" (just the group) and get an
|
|
158
|
+
// opaque runtime failure.
|
|
159
|
+
if (/\b(create|update)Segment\s*\(/.test(queryText)) {
|
|
160
|
+
const keyMatches = Array.from(queryText.matchAll(/\bkey\s*:\s*"([^"]+)"/g));
|
|
161
|
+
for (const m of keyMatches) {
|
|
162
|
+
const k = m[1];
|
|
163
|
+
if (!k.startsWith("marketing.segments.conditions.")) {
|
|
164
|
+
hints.push(`Segment condition key "${k}" looks wrong — keys must be full module IDs like "marketing.segments.conditions.order" / "marketing.segments.conditions.times". Call the \`segmentConditions\` query first and copy the \`key\` field exactly.`);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return hints;
|
|
170
|
+
}
|
|
171
|
+
function remediationHintsFor(errors) {
|
|
172
|
+
const hints = new Set();
|
|
173
|
+
for (const err of errors) {
|
|
174
|
+
const hint = hintForErrorMessage(err);
|
|
175
|
+
if (hint)
|
|
176
|
+
hints.add(hint);
|
|
177
|
+
}
|
|
178
|
+
return Array.from(hints);
|
|
179
|
+
}
|
|
7
180
|
function detectOperationType(document) {
|
|
8
181
|
for (const def of document.definitions) {
|
|
9
182
|
if (def.kind === Kind.OPERATION_DEFINITION) {
|
|
@@ -60,9 +233,11 @@ export function validateGraphql(input) {
|
|
|
60
233
|
if (errors.length === 0) {
|
|
61
234
|
// Check for deprecated field/enum usage
|
|
62
235
|
const deprecationWarnings = findDeprecatedUsages(schema.schema, document);
|
|
63
|
-
|
|
236
|
+
// Post-validation static checks — schema-valid but runtime-known wrong.
|
|
237
|
+
const postHints = staticPostValidationHints(block.content);
|
|
238
|
+
if (deprecationWarnings.length > 0 || postHints.length > 0) {
|
|
64
239
|
result.status = "inform";
|
|
65
|
-
result.warnings = deprecationWarnings;
|
|
240
|
+
result.warnings = [...deprecationWarnings, ...postHints];
|
|
66
241
|
}
|
|
67
242
|
else {
|
|
68
243
|
result.status = "success";
|
|
@@ -103,7 +278,12 @@ export function validateGraphql(input) {
|
|
|
103
278
|
}
|
|
104
279
|
else {
|
|
105
280
|
lines.push(`**Status:** ❌ FAILED`);
|
|
106
|
-
lines.push(`**Details:** GraphQL validation errors: ${r.errors.join("; ")}
|
|
281
|
+
lines.push(`**Details:** GraphQL validation errors: ${r.errors.join("; ")}`);
|
|
282
|
+
const hints = remediationHintsFor(r.errors);
|
|
283
|
+
for (const h of hints) {
|
|
284
|
+
lines.push(`> HINT: ${h}`);
|
|
285
|
+
}
|
|
286
|
+
lines.push("");
|
|
107
287
|
}
|
|
108
288
|
}
|
|
109
289
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-graphql.js","sourceRoot":"","sources":["../../src/tools/validate-graphql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,iBAAiB,GAIlB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAyBjD,SAAS,kBAAkB,CAAC,KAAmB;IAC7C,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAsB;IACjD,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC3C,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,sCAAsC;QAC9D,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAqB,EAAE,QAAsB;IACzE,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEtC,KAAK,CACH,QAAQ,EACR,iBAAiB,CAAC,QAAQ,EAAE;QAC1B,KAAK;YACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;YACxC,IAAI,QAAQ,IAAI,QAAQ,CAAC,iBAAiB,EAAE,CAAC;gBAC3C,QAAQ,CAAC,IAAI,CACX,aAAa,QAAQ,CAAC,aAAa,EAAE,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,mBAAmB,QAA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