@01.software/cli 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -309,106 +309,338 @@ var collectionSchemaResponseSchema = z.object({
309
309
  }).strict();
310
310
 
311
311
  // ../../packages/contracts/src/ecommerce/index.ts
312
+ import { z as z3 } from "zod";
313
+
314
+ // ../../packages/contracts/src/ecommerce/product-upsert.ts
312
315
  import { z as z2 } from "zod";
313
- var transactionStatusSchema = z2.enum([
316
+ var IdSchema = z2.union([z2.string(), z2.number()]).transform(String);
317
+ var RemovedLegacyMediaFieldSchema = z2.unknown().optional();
318
+ var productFieldShape = {
319
+ id: IdSchema.optional(),
320
+ title: z2.string().min(1).optional(),
321
+ subtitle: z2.string().optional().nullable(),
322
+ description: z2.string().optional().nullable(),
323
+ status: z2.string().optional(),
324
+ slug: z2.string().optional(),
325
+ primaryMediaItemId: IdSchema.optional().nullable(),
326
+ thumbnail: IdSchema.optional().nullable(),
327
+ images: z2.array(IdSchema).optional(),
328
+ mediaSets: RemovedLegacyMediaFieldSchema,
329
+ vendor: z2.string().optional().nullable(),
330
+ productType: z2.string().optional().nullable(),
331
+ brand: IdSchema.optional().nullable(),
332
+ shippingPolicy: IdSchema.optional().nullable(),
333
+ weight: z2.number().int().min(0).optional().nullable(),
334
+ minOrderQuantity: z2.number().int().min(1).optional().nullable(),
335
+ maxOrderQuantity: z2.number().int().min(1).optional().nullable(),
336
+ listingPrimaryOption: IdSchema.optional().nullable(),
337
+ isFeatured: z2.boolean().optional(),
338
+ publishedAt: z2.string().optional().nullable(),
339
+ categories: z2.array(IdSchema).optional(),
340
+ tags: z2.array(IdSchema).optional(),
341
+ metadata: z2.unknown().optional()
342
+ };
343
+ var PRODUCT_UPSERT_PRODUCT_FIELDS = Object.keys(
344
+ productFieldShape
345
+ );
346
+ var ProductFieldsSchema = z2.object(productFieldShape).passthrough();
347
+ var OptionValueInputSchema = z2.object({
348
+ id: IdSchema.optional(),
349
+ value: z2.string().min(1, "Option value `value` is required"),
350
+ slug: z2.string().optional(),
351
+ swatch: z2.object({
352
+ type: z2.enum(["color", "media"]).optional().nullable(),
353
+ color: z2.string().optional().nullable(),
354
+ mediaItemId: IdSchema.optional().nullable()
355
+ }).optional().nullable(),
356
+ thumbnail: RemovedLegacyMediaFieldSchema,
357
+ images: RemovedLegacyMediaFieldSchema,
358
+ metadata: z2.unknown().optional()
359
+ }).passthrough().superRefine((value, ctx) => {
360
+ if (Object.prototype.hasOwnProperty.call(value, "swatchColor")) {
361
+ ctx.addIssue({
362
+ code: "custom",
363
+ message: "Option value field `swatchColor` was removed. Use nested `swatch.color` instead.",
364
+ path: ["swatchColor"]
365
+ });
366
+ }
367
+ });
368
+ var OptionInputSchema = z2.object({
369
+ id: IdSchema.optional(),
370
+ title: z2.string().min(1, "Option `title` is required"),
371
+ slug: z2.string().optional(),
372
+ values: z2.array(OptionValueInputSchema).min(1, "Each option must have at least one value")
373
+ });
374
+ var VariantOptionValueObjectSchema = z2.object({
375
+ valueSlug: z2.string().optional(),
376
+ valueId: IdSchema.optional(),
377
+ value: z2.string().optional()
378
+ }).refine((data) => Boolean(data.valueSlug ?? data.valueId ?? data.value), {
379
+ message: "Variant option value object requires valueSlug, valueId, or value"
380
+ });
381
+ var VariantInputSchema = z2.object({
382
+ id: IdSchema.optional(),
383
+ optionValues: z2.union([
384
+ z2.record(
385
+ z2.string(),
386
+ z2.union([z2.string(), VariantOptionValueObjectSchema])
387
+ ),
388
+ z2.array(IdSchema)
389
+ ]).optional(),
390
+ sku: z2.string().optional().nullable(),
391
+ title: z2.string().optional().nullable(),
392
+ price: z2.number().min(0),
393
+ compareAtPrice: z2.number().min(0).optional().nullable(),
394
+ stock: z2.number().int().min(0).optional(),
395
+ isUnlimited: z2.boolean().optional(),
396
+ weight: z2.number().int().min(0).optional().nullable(),
397
+ requiresShipping: z2.boolean().optional(),
398
+ barcode: z2.string().optional().nullable(),
399
+ externalId: z2.string().optional().nullable(),
400
+ isActive: z2.boolean().optional(),
401
+ images: z2.array(IdSchema).optional(),
402
+ thumbnail: RemovedLegacyMediaFieldSchema,
403
+ featuredMediaItemId: RemovedLegacyMediaFieldSchema,
404
+ metadata: z2.unknown().optional()
405
+ });
406
+ var ProductUpsertObjectSchema = z2.object({
407
+ /** Required on graph edit when the server graph is non-empty (`productId` set); optional for first seed on an empty graph. */
408
+ graphRevision: z2.string().optional(),
409
+ productId: IdSchema.optional(),
410
+ product: ProductFieldsSchema.optional(),
411
+ options: z2.array(OptionInputSchema).max(10).optional().default([]),
412
+ variants: z2.array(VariantInputSchema).max(500).optional().default([])
413
+ });
414
+ var ProductUpsertSchema = ProductUpsertObjectSchema.superRefine(
415
+ (data, ctx) => {
416
+ const nestedProductId = data.product?.id;
417
+ if (data.productId != null && nestedProductId != null && String(data.productId) !== String(nestedProductId)) {
418
+ ctx.addIssue({
419
+ code: "custom",
420
+ message: "productId must match product.id when both are set on graph upsert.",
421
+ path: ["productId"]
422
+ });
423
+ }
424
+ const productId = data.productId ?? nestedProductId;
425
+ const isEdit = productId != null;
426
+ if (!isEdit && data.productId != null) {
427
+ ctx.addIssue({
428
+ code: "custom",
429
+ message: "productId is not allowed when creating a product.",
430
+ path: ["productId"]
431
+ });
432
+ }
433
+ if (!isEdit && !data.product?.title) {
434
+ ctx.addIssue({
435
+ code: "custom",
436
+ message: "Product `title` is required when creating a new product.",
437
+ path: ["product", "title"]
438
+ });
439
+ }
440
+ if (isEdit && data.product) {
441
+ for (const key of Object.keys(data.product)) {
442
+ if (key !== "id") {
443
+ ctx.addIssue({
444
+ code: "custom",
445
+ message: "Existing product graph upsert accepts only product identity. Save document fields through Payload.",
446
+ path: ["product", key]
447
+ });
448
+ }
449
+ }
450
+ }
451
+ }
452
+ );
453
+
454
+ // ../../packages/contracts/src/ecommerce/index.ts
455
+ var transactionStatusSchema = z3.enum([
314
456
  "pending",
315
457
  "paid",
316
458
  "failed",
317
459
  "canceled"
318
460
  ]);
319
- var entityIdSchema = z2.union([z2.string(), z2.number()]).transform(String);
320
- var createOrderItemSchema = z2.object({
461
+ var orderStatusSchema = z3.enum([
462
+ "pending",
463
+ "paid",
464
+ "failed",
465
+ "canceled",
466
+ "refunded",
467
+ "preparing",
468
+ "shipped",
469
+ "delivered",
470
+ "confirmed",
471
+ "return_requested",
472
+ "return_processing",
473
+ "returned"
474
+ ]);
475
+ var entityIdSchema = z3.union([z3.string(), z3.number()]).transform(String);
476
+ var createOrderItemSchema = z3.object({
321
477
  product: entityIdSchema,
322
478
  variant: entityIdSchema,
323
479
  option: entityIdSchema,
324
- quantity: z2.number().int().positive("quantity must be a positive integer"),
325
- unitPrice: z2.number().optional(),
326
- totalPrice: z2.number().optional()
480
+ quantity: z3.number().int().positive("quantity must be a positive integer"),
481
+ unitPrice: z3.number().optional(),
482
+ totalPrice: z3.number().optional()
327
483
  });
328
- var createOrderSchema = z2.object({
329
- pgPaymentId: z2.string().min(1).optional(),
330
- orderNumber: z2.string().min(1, "orderNumber is required"),
484
+ var createOrderSchema = z3.object({
485
+ pgPaymentId: z3.string().min(1).optional(),
486
+ orderNumber: z3.string().min(1, "orderNumber is required"),
331
487
  customer: entityIdSchema.optional(),
332
- customerSnapshot: z2.object({
333
- name: z2.string().optional(),
334
- email: z2.string().email("Invalid email format"),
335
- phone: z2.string().optional()
488
+ customerSnapshot: z3.object({
489
+ name: z3.string().optional(),
490
+ email: z3.string().email("Invalid email format"),
491
+ phone: z3.string().optional()
336
492
  }),
337
- shippingAddress: z2.object({
338
- postalCode: z2.string().optional(),
339
- address: z2.string().optional(),
340
- detailAddress: z2.string().optional(),
341
- deliveryMessage: z2.string().optional(),
342
- recipientName: z2.string().optional(),
343
- phone: z2.string().optional()
493
+ shippingAddress: z3.object({
494
+ postalCode: z3.string().optional(),
495
+ address: z3.string().optional(),
496
+ detailAddress: z3.string().optional(),
497
+ deliveryMessage: z3.string().optional(),
498
+ recipientName: z3.string().optional(),
499
+ phone: z3.string().optional()
344
500
  }),
345
- orderItems: z2.array(createOrderItemSchema).min(1, "At least one order item is required").max(100, "Maximum 100 items per order"),
346
- totalAmount: z2.number().nonnegative("totalAmount must be non-negative"),
347
- shippingAmount: z2.number().min(0).optional(),
348
- discountCode: z2.string().optional()
501
+ orderItems: z3.array(createOrderItemSchema).min(1, "At least one order item is required").max(100, "Maximum 100 items per order"),
502
+ totalAmount: z3.number().nonnegative("totalAmount must be non-negative"),
503
+ shippingAmount: z3.number().min(0).optional(),
504
+ discountCode: z3.string().optional()
349
505
  });
350
506
  var CreateOrderSchema = createOrderSchema;
351
- var updateTransactionSchema = z2.object({
352
- pgPaymentId: z2.string().min(1, "pgPaymentId is required").describe("PG payment ID (required)"),
507
+ var updateTransactionSchema = z3.object({
508
+ pgPaymentId: z3.string().min(1, "pgPaymentId is required").describe("PG payment ID (required)"),
353
509
  status: transactionStatusSchema.describe(
354
510
  "New transaction status (required)"
355
511
  ),
356
- paymentMethod: z2.string().optional().describe("Payment method (optional)"),
357
- receiptUrl: z2.string().optional().describe("Receipt URL (optional)"),
358
- paymentKey: z2.string().min(1).optional().describe("Provider payment key for verified paid confirmation"),
359
- amount: z2.number().int().positive().optional().describe("Provider-confirmed amount for verified paid confirmation")
512
+ paymentMethod: z3.string().optional().describe("Payment method (optional)"),
513
+ receiptUrl: z3.string().optional().describe("Receipt URL (optional)"),
514
+ paymentKey: z3.string().min(1).optional().describe("Provider payment key for verified paid confirmation"),
515
+ amount: z3.number().int().positive().optional().describe("Provider-confirmed amount for verified paid confirmation")
360
516
  }).strict();
361
517
  var UpdateTransactionSchema = updateTransactionSchema;
362
- var providerSlugSchema = z2.string().trim().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/, "pgProvider must be lowercase slug");
363
- var confirmPaymentSchema = z2.object({
364
- orderNumber: z2.string().min(1).optional(),
365
- pgPaymentId: z2.string().min(1, "pgPaymentId is required").describe("Provider payment identifier stored on the transaction"),
518
+ var providerSlugSchema = z3.string().trim().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/, "pgProvider must be lowercase slug");
519
+ var confirmPaymentSchema = z3.object({
520
+ orderNumber: z3.string().min(1).optional(),
521
+ pgPaymentId: z3.string().min(1, "pgPaymentId is required").describe("Provider payment identifier stored on the transaction"),
366
522
  pgProvider: providerSlugSchema.describe(
367
523
  "Payment provider slug, e.g. toss, portone, stripe"
368
524
  ),
369
- pgOrderId: z2.string().min(1).optional(),
370
- amount: z2.number().int().nonnegative("amount must be non-negative").describe("Provider-confirmed amount in minor units"),
371
- currency: z2.string().min(1).optional(),
372
- paymentMethod: z2.string().optional(),
373
- receiptUrl: z2.string().url().optional(),
374
- approvedAt: z2.string().optional(),
375
- providerStatus: z2.string().optional(),
376
- providerEventId: z2.string().min(1).optional(),
377
- confirmationSource: z2.enum([
525
+ pgOrderId: z3.string().min(1).optional(),
526
+ amount: z3.number().int().nonnegative("amount must be non-negative").describe("Provider-confirmed amount in minor units"),
527
+ currency: z3.string().min(1).optional(),
528
+ paymentMethod: z3.string().optional(),
529
+ receiptUrl: z3.string().url().optional(),
530
+ approvedAt: z3.string().optional(),
531
+ providerStatus: z3.string().optional(),
532
+ providerEventId: z3.string().min(1).optional(),
533
+ confirmationSource: z3.enum([
378
534
  "provider_webhook",
379
535
  "provider_lookup",
380
536
  "provider_api_confirm",
381
537
  "manual_server"
382
538
  ]).optional(),
383
- metadata: z2.record(z2.string(), z2.unknown()).optional()
539
+ metadata: z3.record(z3.string(), z3.unknown()).optional()
384
540
  }).strict();
385
541
  var ConfirmPaymentSchema = confirmPaymentSchema;
386
- var returnReasonSchema = z2.enum([
542
+ var returnReasonSchema = z3.enum([
387
543
  "change_of_mind",
388
544
  "defective",
389
545
  "wrong_delivery",
390
546
  "damaged",
391
547
  "other"
392
548
  ]);
393
- var restockActionSchema = z2.enum(["return_to_stock", "discard"]);
394
- var returnWithRefundItemSchema = z2.object({
395
- orderItem: z2.union([z2.string(), z2.number()]).transform(String),
396
- quantity: z2.number().int().positive("quantity must be a positive integer"),
549
+ var restockActionSchema = z3.enum(["return_to_stock", "discard"]);
550
+ var returnWithRefundItemSchema = z3.object({
551
+ orderItem: z3.union([z3.string(), z3.number()]).transform(String),
552
+ quantity: z3.number().int().positive("quantity must be a positive integer"),
397
553
  restockAction: restockActionSchema.default("return_to_stock"),
398
- restockingFee: z2.number().min(0, "restockingFee must be non-negative").optional().describe("Restocking fee charged for this line (ADR 0005 \xA7Gap 1)")
554
+ restockingFee: z3.number().min(0, "restockingFee must be non-negative").optional().describe("Restocking fee charged for this line (ADR 0005 \xA7Gap 1)")
399
555
  }).strict();
400
- var returnWithRefundSchema = z2.object({
401
- orderNumber: z2.string().min(1, "orderNumber is required").describe("Order number (required)"),
556
+ var returnWithRefundSchema = z3.object({
557
+ orderNumber: z3.string().min(1, "orderNumber is required").describe("Order number (required)"),
402
558
  reason: returnReasonSchema.optional().describe("Return reason (optional)"),
403
- reasonDetail: z2.string().optional().describe("Detailed reason text (optional)"),
404
- returnItems: z2.array(returnWithRefundItemSchema).min(1, "At least one return item is required").max(100, "Too many return items").describe("Array of products to return (required)"),
405
- refundAmount: z2.number().min(0, "refundAmount must be non-negative").describe("Refund amount (required, min 0)"),
406
- returnShippingFee: z2.number().min(0, "returnShippingFee must be non-negative").optional().describe("Return shipping fee charged to the customer (ADR 0005 \xA7Gap 1)"),
407
- pgPaymentId: z2.string().min(1, "pgPaymentId is required").describe("PG payment ID for refund (required)"),
408
- paymentKey: z2.string().min(1).optional().describe("Provider payment key for verified refund"),
409
- refundReceiptUrl: z2.string().optional().describe("Refund receipt URL (optional)")
559
+ reasonDetail: z3.string().optional().describe("Detailed reason text (optional)"),
560
+ returnItems: z3.array(returnWithRefundItemSchema).min(1, "At least one return item is required").max(100, "Too many return items").describe("Array of products to return (required)"),
561
+ refundAmount: z3.number().min(0, "refundAmount must be non-negative").describe("Refund amount (required, min 0)"),
562
+ returnShippingFee: z3.number().min(0, "returnShippingFee must be non-negative").optional().describe(
563
+ "Return shipping fee charged to the customer (ADR 0005 \xA7Gap 1)"
564
+ ),
565
+ pgPaymentId: z3.string().min(1, "pgPaymentId is required").describe("PG payment ID for refund (required)"),
566
+ paymentKey: z3.string().min(1).optional().describe("Provider payment key for verified refund"),
567
+ refundReceiptUrl: z3.string().optional().describe("Refund receipt URL (optional)")
410
568
  }).strict();
411
569
  var ReturnWithRefundSchema = returnWithRefundSchema;
570
+ var cancelReasonCodeSchema = z3.enum([
571
+ "customer",
572
+ "inventory",
573
+ "fraud",
574
+ "declined",
575
+ "staff",
576
+ "other"
577
+ ]);
578
+ var idempotencyKeySchema = z3.string().trim().min(1, "idempotencyKey is required").max(255, "idempotencyKey must be 255 characters or fewer").regex(
579
+ /^[\x21-\x7E]+$/,
580
+ "idempotencyKey must contain only printable header-safe characters"
581
+ );
582
+ var cancelOrderSchema = z3.object({
583
+ orderNumber: z3.string().min(1, "orderNumber is required").describe("Order number to cancel"),
584
+ reasonCode: cancelReasonCodeSchema.default("other").describe("Operator-selected cancel reason code"),
585
+ reasonDetail: z3.string().trim().max(2e3, "reasonDetail must be 2000 characters or fewer").optional().describe("Internal cancellation detail stored on the order")
586
+ }).strict();
587
+ var CancelOrderSchema = cancelOrderSchema;
588
+ var cancelOrderResponseBaseSchema = {
589
+ orderId: z3.string().min(1)
590
+ };
591
+ var unpaidCancelResponseFields = {
592
+ refundedAmount: z3.literal(0),
593
+ providerRefunded: z3.literal(false)
594
+ };
595
+ var alreadyCanceledResponseFields = {
596
+ refundedAmount: z3.number().int().nonnegative(),
597
+ providerRefunded: z3.literal(false)
598
+ };
599
+ var providerRefundResponseFields = {
600
+ transactionId: z3.string().min(1),
601
+ refundedAmount: z3.number().int().positive(),
602
+ refundSeq: z3.number().int().positive(),
603
+ providerRefunded: z3.literal(true)
604
+ };
605
+ var cancelOrderReconciliationStatusSchema = z3.enum([
606
+ "paid",
607
+ "preparing",
608
+ "shipped",
609
+ "delivered",
610
+ "confirmed",
611
+ "return_requested",
612
+ "return_processing",
613
+ "returned",
614
+ "refunded"
615
+ ]);
616
+ var cancelOrderResponseSchema = z3.union([
617
+ z3.object({
618
+ ...cancelOrderResponseBaseSchema,
619
+ ...unpaidCancelResponseFields,
620
+ status: z3.literal("canceled"),
621
+ cancelCommitted: z3.literal(true)
622
+ }).strict(),
623
+ z3.object({
624
+ ...cancelOrderResponseBaseSchema,
625
+ ...providerRefundResponseFields,
626
+ status: z3.literal("canceled"),
627
+ cancelCommitted: z3.literal(true)
628
+ }).strict(),
629
+ z3.object({
630
+ ...cancelOrderResponseBaseSchema,
631
+ ...alreadyCanceledResponseFields,
632
+ status: z3.literal("canceled"),
633
+ cancelCommitted: z3.literal(false),
634
+ alreadyCanceled: z3.literal(true)
635
+ }).strict(),
636
+ z3.object({
637
+ ...cancelOrderResponseBaseSchema,
638
+ ...providerRefundResponseFields,
639
+ status: cancelOrderReconciliationStatusSchema,
640
+ cancelCommitted: z3.literal(false),
641
+ reconciliationRequired: z3.literal(true)
642
+ }).strict()
643
+ ]);
412
644
 
413
645
  // ../../packages/contracts/src/mcp/index.ts
414
646
  var MCP_TOOL_CONTRACT = {
@@ -517,6 +749,11 @@ var MCP_TOOL_CONTRACT = {
517
749
  oauthScope: "mcp:write",
518
750
  readOnly: false
519
751
  },
752
+ "cancel-order": {
753
+ consoleRole: "tenant-admin",
754
+ oauthScope: "mcp:write",
755
+ readOnly: false
756
+ },
520
757
  "update-order": {
521
758
  consoleRole: "tenant-admin",
522
759
  oauthScope: "mcp:write",
@@ -775,6 +1012,14 @@ var TOOL_POLICY_MANIFEST = {
775
1012
  annotationPolicy: DESTRUCTIVE_IDEMPOTENT_MUTATION_ANNOTATION,
776
1013
  exemptionReason: REASON_IDEMPOTENT_DESTRUCTIVE_UPDATE
777
1014
  },
1015
+ "cancel-order": {
1016
+ category: "mutation-order",
1017
+ oauthScope: MCP_SCOPES.write,
1018
+ consoleRole: "tenant-admin",
1019
+ consoleSurface: "POST /api/orders/cancel",
1020
+ annotationPolicy: DESTRUCTIVE_IDEMPOTENT_MUTATION_ANNOTATION,
1021
+ exemptionReason: REASON_IDEMPOTENT_DESTRUCTIVE_UPDATE
1022
+ },
778
1023
  "update-order": {
779
1024
  category: "mutation-order",
780
1025
  oauthScope: MCP_SCOPES.write,
@@ -1230,7 +1475,7 @@ async function swallow(promise) {
1230
1475
  }
1231
1476
 
1232
1477
  // src/tools/query-collection.ts
1233
- import { z as z3 } from "zod";
1478
+ import { z as z4 } from "zod";
1234
1479
 
1235
1480
  // src/lib/client.ts
1236
1481
  import { createServerClient } from "@01.software/sdk/server";
@@ -1266,13 +1511,13 @@ function getClient() {
1266
1511
  // src/tools/query-collection.ts
1267
1512
  import { SERVER_COLLECTIONS } from "@01.software/sdk";
1268
1513
  var schema = {
1269
- collection: z3.enum(SERVER_COLLECTIONS).describe("Collection name (required)"),
1270
- where: z3.string().optional().describe(
1514
+ collection: z4.enum(SERVER_COLLECTIONS).describe("Collection name (required)"),
1515
+ where: z4.string().optional().describe(
1271
1516
  `Filter conditions (JSON string, optional). Pass the Payload query condition object as a JSON string. Example: '{"title":{"equals":"Product name"}}'`
1272
1517
  ),
1273
- limit: z3.number().min(1).max(100).default(10).describe("Maximum number of items to return (1-100, default: 10)."),
1274
- page: z3.number().optional().describe("Page number (optional). Starts from 1. Used for pagination."),
1275
- sort: z3.string().regex(
1518
+ limit: z4.number().min(1).max(100).default(10).describe("Maximum number of items to return (1-100, default: 10)."),
1519
+ page: z4.number().optional().describe("Page number (optional). Starts from 1. Used for pagination."),
1520
+ sort: z4.string().regex(
1276
1521
  /^-?[a-zA-Z0-9_.]+$/,
1277
1522
  'Sort must be a field name, optionally prefixed with "-" for descending'
1278
1523
  ).optional().describe(
@@ -1329,11 +1574,11 @@ async function queryCollection({
1329
1574
  }
1330
1575
 
1331
1576
  // src/tools/get-collection-by-id.ts
1332
- import { z as z4 } from "zod";
1577
+ import { z as z5 } from "zod";
1333
1578
  import { SERVER_COLLECTIONS as SERVER_COLLECTIONS2 } from "@01.software/sdk";
1334
1579
  var schema2 = {
1335
- collection: z4.enum(SERVER_COLLECTIONS2).describe("Collection name (required)"),
1336
- id: z4.string().min(1).describe("Item ID (required)")
1580
+ collection: z5.enum(SERVER_COLLECTIONS2).describe("Collection name (required)"),
1581
+ id: z5.string().min(1).describe("Item ID (required)")
1337
1582
  };
1338
1583
  var metadata2 = {
1339
1584
  name: "get-collection-by-id",
@@ -1359,9 +1604,9 @@ async function getCollectionById({
1359
1604
  }
1360
1605
 
1361
1606
  // src/tools/get-order.ts
1362
- import { z as z5 } from "zod";
1607
+ import { z as z6 } from "zod";
1363
1608
  var schema3 = {
1364
- orderNumber: z5.string().min(1).describe("Order number to look up (required)")
1609
+ orderNumber: z6.string().min(1).describe("Order number to look up (required)")
1365
1610
  };
1366
1611
  var metadata3 = {
1367
1612
  name: "get-order",
@@ -1414,10 +1659,10 @@ async function createOrder(params) {
1414
1659
  }
1415
1660
 
1416
1661
  // src/tools/update-order.ts
1417
- import { z as z6 } from "zod";
1662
+ import { z as z7 } from "zod";
1418
1663
  var schema5 = {
1419
- orderNumber: z6.string().min(1).describe("Order number (required)"),
1420
- status: z6.enum([
1664
+ orderNumber: z7.string().min(1).describe("Order number (required)"),
1665
+ status: z7.enum([
1421
1666
  "pending",
1422
1667
  "paid",
1423
1668
  "failed",
@@ -1454,15 +1699,15 @@ async function updateOrder({
1454
1699
  }
1455
1700
 
1456
1701
  // src/tools/checkout.ts
1457
- import { z as z7 } from "zod";
1702
+ import { z as z8 } from "zod";
1458
1703
  var schema6 = {
1459
- cartId: z7.string().min(1).describe("Cart ID to convert to order (required)"),
1460
- pgPaymentId: z7.string().optional().describe("PG payment ID (optional \u2014 omit for free orders)"),
1461
- orderNumber: z7.string().min(1).describe("Unique order number (required)"),
1462
- customerSnapshot: z7.record(z7.string(), z7.unknown()).describe(
1704
+ cartId: z8.string().min(1).describe("Cart ID to convert to order (required)"),
1705
+ pgPaymentId: z8.string().optional().describe("PG payment ID (optional \u2014 omit for free orders)"),
1706
+ orderNumber: z8.string().min(1).describe("Unique order number (required)"),
1707
+ customerSnapshot: z8.record(z8.string(), z8.unknown()).describe(
1463
1708
  "Customer snapshot object (required). Fields: { name?, email, phone? }"
1464
1709
  ),
1465
- discountCode: z7.string().optional().describe("Discount code to apply (optional)")
1710
+ discountCode: z8.string().optional().describe("Discount code to apply (optional)")
1466
1711
  };
1467
1712
  var metadata6 = {
1468
1713
  name: "checkout",
@@ -1487,17 +1732,17 @@ async function checkout(params) {
1487
1732
  }
1488
1733
 
1489
1734
  // src/tools/create-fulfillment.ts
1490
- import { z as z8 } from "zod";
1735
+ import { z as z9 } from "zod";
1491
1736
  var schema7 = {
1492
- orderNumber: z8.string().min(1).describe("Order number (required)"),
1493
- carrier: z8.string().optional().describe("Shipping carrier name (optional)"),
1494
- trackingNumber: z8.string().optional().describe(
1737
+ orderNumber: z9.string().min(1).describe("Order number (required)"),
1738
+ carrier: z9.string().optional().describe("Shipping carrier name (optional)"),
1739
+ trackingNumber: z9.string().optional().describe(
1495
1740
  'Tracking number (optional). Setting carrier + tracking triggers "shipped" status'
1496
1741
  ),
1497
- items: z8.array(
1498
- z8.object({
1499
- orderItem: z8.string().min(1).describe("Order item ID"),
1500
- quantity: z8.number().int().positive().describe("Quantity to fulfill")
1742
+ items: z9.array(
1743
+ z9.object({
1744
+ orderItem: z9.string().min(1).describe("Order item ID"),
1745
+ quantity: z9.number().int().positive().describe("Quantity to fulfill")
1501
1746
  })
1502
1747
  ).describe("Array of items to fulfill (required)")
1503
1748
  };
@@ -1532,16 +1777,16 @@ async function createFulfillment({
1532
1777
  }
1533
1778
 
1534
1779
  // src/tools/update-fulfillment.ts
1535
- import { z as z9 } from "zod";
1780
+ import { z as z10 } from "zod";
1536
1781
  var schema8 = {
1537
- fulfillmentId: z9.string().min(1).describe("Fulfillment ID (required)"),
1538
- status: z9.enum(["packed", "shipped", "delivered", "failed"]).describe(
1782
+ fulfillmentId: z10.string().min(1).describe("Fulfillment ID (required)"),
1783
+ status: z10.enum(["packed", "shipped", "delivered", "failed"]).describe(
1539
1784
  "New fulfillment status (required). FSM: pending\u2192packed/shipped/failed, packed\u2192shipped/failed, shipped\u2192delivered/failed"
1540
1785
  ),
1541
- carrier: z9.string().optional().describe(
1786
+ carrier: z10.string().optional().describe(
1542
1787
  "Shipping carrier (optional, changeable only in pending/packed status)"
1543
1788
  ),
1544
- trackingNumber: z9.string().optional().describe(
1789
+ trackingNumber: z10.string().optional().describe(
1545
1790
  "Tracking number (optional, changeable only in pending/packed status)"
1546
1791
  )
1547
1792
  };
@@ -1635,21 +1880,54 @@ async function confirmPayment(params) {
1635
1880
  }
1636
1881
  }
1637
1882
 
1883
+ // src/tools/cancel-order.ts
1884
+ var CancelOrderToolSchema = CancelOrderSchema.extend({
1885
+ idempotencyKey: idempotencyKeySchema.optional().describe(
1886
+ "Optional X-Idempotency-Key forwarded to the Console cancel endpoint"
1887
+ )
1888
+ }).strict();
1889
+ var schema11 = CancelOrderToolSchema.shape;
1890
+ var metadata11 = {
1891
+ name: "cancel-order",
1892
+ description: "Cancel an eligible pre-fulfillment order through the provider-verified cancellation flow. Paid captured orders are refunded before the local order moves to canceled; shipped, delivered, active-return, and fulfilled orders are rejected.",
1893
+ annotations: {
1894
+ title: "Cancel order",
1895
+ readOnlyHint: false,
1896
+ destructiveHint: true,
1897
+ idempotentHint: true
1898
+ }
1899
+ };
1900
+ async function cancelOrder(params) {
1901
+ try {
1902
+ const parsed = CancelOrderToolSchema.parse(params);
1903
+ const client = getClient();
1904
+ const result = await client.commerce.orders.cancelOrder({
1905
+ orderNumber: parsed.orderNumber,
1906
+ reasonCode: parsed.reasonCode,
1907
+ reasonDetail: parsed.reasonDetail,
1908
+ idempotencyKey: parsed.idempotencyKey
1909
+ });
1910
+ return toolSuccess({ data: result });
1911
+ } catch (error) {
1912
+ return toolError(error);
1913
+ }
1914
+ }
1915
+
1638
1916
  // src/tools/create-return.ts
1639
- import { z as z10 } from "zod";
1640
- var schema11 = {
1641
- orderNumber: z10.string().min(1).describe("Order number (required)"),
1642
- reason: z10.enum(["change_of_mind", "defective", "wrong_delivery", "damaged", "other"]).optional().describe("Return reason (optional)"),
1643
- reasonDetail: z10.string().optional().describe("Detailed reason text (optional)"),
1644
- returnItems: z10.array(
1645
- z10.object({
1646
- orderItem: z10.string().min(1).describe("Order item ID"),
1647
- quantity: z10.number().int().positive().describe("Quantity to return")
1917
+ import { z as z11 } from "zod";
1918
+ var schema12 = {
1919
+ orderNumber: z11.string().min(1).describe("Order number (required)"),
1920
+ reason: z11.enum(["change_of_mind", "defective", "wrong_delivery", "damaged", "other"]).optional().describe("Return reason (optional)"),
1921
+ reasonDetail: z11.string().optional().describe("Detailed reason text (optional)"),
1922
+ returnItems: z11.array(
1923
+ z11.object({
1924
+ orderItem: z11.string().min(1).describe("Order item ID"),
1925
+ quantity: z11.number().int().positive().describe("Quantity to return")
1648
1926
  })
1649
1927
  ).describe("Array of products to return (required)"),
1650
- refundAmount: z10.number().nonnegative().describe("Refund amount (required, min 0)")
1928
+ refundAmount: z11.number().nonnegative().describe("Refund amount (required, min 0)")
1651
1929
  };
1652
- var metadata11 = {
1930
+ var metadata12 = {
1653
1931
  name: "create-return",
1654
1932
  description: "Create a return request for an order. Only works for delivered/confirmed orders. Updates order status to return_requested.",
1655
1933
  annotations: {
@@ -1682,14 +1960,14 @@ async function createReturn({
1682
1960
  }
1683
1961
 
1684
1962
  // src/tools/update-return.ts
1685
- import { z as z11 } from "zod";
1686
- var schema12 = {
1687
- returnId: z11.string().min(1).describe("Return ID (required)"),
1688
- status: z11.enum(["processing", "approved", "rejected", "completed"]).describe(
1963
+ import { z as z12 } from "zod";
1964
+ var schema13 = {
1965
+ returnId: z12.string().min(1).describe("Return ID (required)"),
1966
+ status: z12.enum(["processing", "approved", "rejected", "completed"]).describe(
1689
1967
  "New operator-driven return status (required). The schema keeps SDK status values for compatibility, but Console accepts only requested\u2192processing/rejected and processing\u2192approved/rejected here; completed is server-derived and must be set by return-with-refund."
1690
1968
  )
1691
1969
  };
1692
- var metadata12 = {
1970
+ var metadata13 = {
1693
1971
  name: "update-return",
1694
1972
  description: "Update operator-driven return status with FSM validation. Rejection can restore the order flow; completion and inventory restoration are handled by return-with-refund after provider-verified refund, while the MCP schema keeps SDK status values for compatibility.",
1695
1973
  annotations: {
@@ -1716,8 +1994,8 @@ async function updateReturn({
1716
1994
  }
1717
1995
 
1718
1996
  // src/tools/return-with-refund.ts
1719
- var schema13 = ReturnWithRefundSchema.shape;
1720
- var metadata13 = {
1997
+ var schema14 = ReturnWithRefundSchema.shape;
1998
+ var metadata14 = {
1721
1999
  name: "return-with-refund",
1722
2000
  description: "Combined provider-verified return + refund operation. Creates a completed return, restores eligible stock, records the refund transaction, and advances the order to the returned state.",
1723
2001
  annotations: {
@@ -1759,15 +2037,15 @@ async function returnWithRefund({
1759
2037
  }
1760
2038
 
1761
2039
  // src/tools/add-cart-item.ts
1762
- import { z as z12 } from "zod";
1763
- var schema14 = {
1764
- cartId: z12.string().min(1).describe("Cart ID (required)"),
1765
- product: z12.string().min(1).describe("Product ID (required)"),
1766
- variant: z12.string().min(1).describe("Product variant ID (required)"),
1767
- option: z12.string().min(1).describe("Product option ID (required)"),
1768
- quantity: z12.number().int().positive().describe("Quantity to add (required, positive integer)")
2040
+ import { z as z13 } from "zod";
2041
+ var schema15 = {
2042
+ cartId: z13.string().min(1).describe("Cart ID (required)"),
2043
+ product: z13.string().min(1).describe("Product ID (required)"),
2044
+ variant: z13.string().min(1).describe("Product variant ID (required)"),
2045
+ option: z13.string().min(1).describe("Product option ID (required)"),
2046
+ quantity: z13.number().int().positive().describe("Quantity to add (required, positive integer)")
1769
2047
  };
1770
- var metadata14 = {
2048
+ var metadata15 = {
1771
2049
  name: "add-cart-item",
1772
2050
  description: "Add a product to cart. Validates stock, merges quantity if item already exists, recalculates totals.",
1773
2051
  annotations: {
@@ -1800,12 +2078,12 @@ async function addCartItem({
1800
2078
  }
1801
2079
 
1802
2080
  // src/tools/update-cart-item.ts
1803
- import { z as z13 } from "zod";
1804
- var schema15 = {
1805
- cartItemId: z13.string().min(1).describe("Cart item ID (required)"),
1806
- quantity: z13.number().int().positive().describe("New quantity (required, positive integer)")
2081
+ import { z as z14 } from "zod";
2082
+ var schema16 = {
2083
+ cartItemId: z14.string().min(1).describe("Cart item ID (required)"),
2084
+ quantity: z14.number().int().positive().describe("New quantity (required, positive integer)")
1807
2085
  };
1808
- var metadata15 = {
2086
+ var metadata16 = {
1809
2087
  name: "update-cart-item",
1810
2088
  description: "Update cart item quantity. Validates stock availability, recalculates cart totals.",
1811
2089
  annotations: {
@@ -1829,11 +2107,11 @@ async function updateCartItem({
1829
2107
  }
1830
2108
 
1831
2109
  // src/tools/remove-cart-item.ts
1832
- import { z as z14 } from "zod";
1833
- var schema16 = {
1834
- cartItemId: z14.string().min(1).describe("Cart item ID to remove (required)")
2110
+ import { z as z15 } from "zod";
2111
+ var schema17 = {
2112
+ cartItemId: z15.string().min(1).describe("Cart item ID to remove (required)")
1835
2113
  };
1836
- var metadata16 = {
2114
+ var metadata17 = {
1837
2115
  name: "remove-cart-item",
1838
2116
  description: "Remove an item from cart. Recalculates cart totals after removal.",
1839
2117
  annotations: {
@@ -1856,12 +2134,12 @@ async function removeCartItem({
1856
2134
  }
1857
2135
 
1858
2136
  // src/tools/apply-discount.ts
1859
- import { z as z15 } from "zod";
1860
- var schema17 = {
1861
- cartId: z15.string().min(1).describe("Cart ID (required)"),
1862
- discountCode: z15.string().describe("Discount code to apply (required)")
2137
+ import { z as z16 } from "zod";
2138
+ var schema18 = {
2139
+ cartId: z16.string().min(1).describe("Cart ID (required)"),
2140
+ discountCode: z16.string().describe("Discount code to apply (required)")
1863
2141
  };
1864
- var metadata17 = {
2142
+ var metadata18 = {
1865
2143
  name: "apply-discount",
1866
2144
  description: "Apply a discount code to a cart. Validates the code, updates cart totals, and sets free shipping if applicable.",
1867
2145
  annotations: {
@@ -1885,11 +2163,11 @@ async function applyDiscount({
1885
2163
  }
1886
2164
 
1887
2165
  // src/tools/remove-discount.ts
1888
- import { z as z16 } from "zod";
1889
- var schema18 = {
1890
- cartId: z16.string().min(1).describe("Cart ID (required)")
2166
+ import { z as z17 } from "zod";
2167
+ var schema19 = {
2168
+ cartId: z17.string().min(1).describe("Cart ID (required)")
1891
2169
  };
1892
- var metadata18 = {
2170
+ var metadata19 = {
1893
2171
  name: "remove-discount",
1894
2172
  description: "Remove the applied discount code from a cart and recalculate totals.",
1895
2173
  annotations: {
@@ -1912,11 +2190,11 @@ async function removeDiscount({
1912
2190
  }
1913
2191
 
1914
2192
  // src/tools/clear-cart.ts
1915
- import { z as z17 } from "zod";
1916
- var schema19 = {
1917
- cartId: z17.string().min(1).describe("Cart ID (required)")
2193
+ import { z as z18 } from "zod";
2194
+ var schema20 = {
2195
+ cartId: z18.string().min(1).describe("Cart ID (required)")
1918
2196
  };
1919
- var metadata19 = {
2197
+ var metadata20 = {
1920
2198
  name: "clear-cart",
1921
2199
  description: "Remove all items from a cart, reset discount and amounts. Shipping fee is preserved.",
1922
2200
  annotations: {
@@ -1939,12 +2217,12 @@ async function clearCart({
1939
2217
  }
1940
2218
 
1941
2219
  // src/tools/validate-discount.ts
1942
- import { z as z18 } from "zod";
1943
- var schema20 = {
1944
- code: z18.string().describe("Discount code to validate (required)"),
1945
- orderAmount: z18.number().describe("Order amount for validation (required)")
2220
+ import { z as z19 } from "zod";
2221
+ var schema21 = {
2222
+ code: z19.string().describe("Discount code to validate (required)"),
2223
+ orderAmount: z19.number().describe("Order amount for validation (required)")
1946
2224
  };
1947
- var metadata20 = {
2225
+ var metadata21 = {
1948
2226
  name: "validate-discount",
1949
2227
  description: "Validate a discount code. Checks active status, date range, usage limits, minimum order amount, and calculates discount.",
1950
2228
  annotations: {
@@ -1971,13 +2249,13 @@ async function validateDiscount({
1971
2249
  }
1972
2250
 
1973
2251
  // src/tools/calculate-shipping.ts
1974
- import { z as z19 } from "zod";
1975
- var schema21 = {
1976
- shippingPolicyId: z19.string().optional().describe("Shipping policy ID (uses default policy if omitted)"),
1977
- orderAmount: z19.number().describe("Order amount for fee calculation (required)"),
1978
- postalCode: z19.string().optional().describe("Postal code for Jeju surcharge detection (63000-63644)")
2252
+ import { z as z20 } from "zod";
2253
+ var schema22 = {
2254
+ shippingPolicyId: z20.string().optional().describe("Shipping policy ID (uses default policy if omitted)"),
2255
+ orderAmount: z20.number().describe("Order amount for fee calculation (required)"),
2256
+ postalCode: z20.string().optional().describe("Postal code for Jeju surcharge detection (63000-63644)")
1979
2257
  };
1980
- var metadata21 = {
2258
+ var metadata22 = {
1981
2259
  name: "calculate-shipping",
1982
2260
  description: "Calculate shipping fee based on order amount and postal code. Supports free shipping threshold and Jeju surcharge.",
1983
2261
  annotations: {
@@ -2006,18 +2284,18 @@ async function calculateShipping({
2006
2284
  }
2007
2285
 
2008
2286
  // src/tools/stock-check.ts
2009
- import { z as z20 } from "zod";
2010
- var schema22 = {
2011
- items: z20.array(
2012
- z20.object({
2013
- variantId: z20.string().describe("Product variant ID"),
2014
- quantity: z20.number().int().positive().describe("Requested quantity")
2287
+ import { z as z21 } from "zod";
2288
+ var schema23 = {
2289
+ items: z21.array(
2290
+ z21.object({
2291
+ variantId: z21.string().describe("Product variant ID"),
2292
+ quantity: z21.number().int().positive().describe("Requested quantity")
2015
2293
  })
2016
2294
  ).describe(
2017
2295
  "Array of items to check stock for (required, max 100). Each: { variantId, quantity }"
2018
2296
  )
2019
2297
  };
2020
- var metadata22 = {
2298
+ var metadata23 = {
2021
2299
  name: "stock-check",
2022
2300
  description: "Batch check product option stock availability. Returns per-item availability and an allAvailable flag.",
2023
2301
  annotations: {
@@ -2040,12 +2318,12 @@ async function stockCheck({
2040
2318
  }
2041
2319
 
2042
2320
  // src/tools/product-detail.ts
2043
- import { z as z21 } from "zod";
2044
- var schema23 = {
2045
- slug: z21.string().optional().describe("Product slug (one of slug or id required)"),
2046
- id: z21.string().optional().describe("Product id (one of slug or id required)")
2321
+ import { z as z22 } from "zod";
2322
+ var schema24 = {
2323
+ slug: z22.string().optional().describe("Product slug (one of slug or id required)"),
2324
+ id: z22.string().optional().describe("Product id (one of slug or id required)")
2047
2325
  };
2048
- var metadata23 = {
2326
+ var metadata24 = {
2049
2327
  name: "product-detail",
2050
2328
  description: "Fetch full product detail by slug or id. Returns one resolver-ready product with variants, option slugs, option value slugs/media, brand, categories, tags, images, videos, and listing rollup, or found:false with a reason if missing/unpublished/feature disabled. Permission/auth errors still throw.",
2051
2329
  annotations: {
@@ -2073,68 +2351,26 @@ async function productDetail({
2073
2351
  }
2074
2352
 
2075
2353
  // src/tools/product-upsert.ts
2076
- import { z as z22 } from "zod";
2077
- var optionValueSchema = z22.object({
2078
- id: z22.string().optional().describe("Stable existing option-value ID for rename-safe updates"),
2079
- value: z22.string().describe("Display label (e.g. Black, S)"),
2080
- slug: z22.string().optional().describe(
2081
- "Optional compatibility value token. The server generates one from value on create when omitted; not canonical identity."
2354
+ var schema25 = {
2355
+ productId: ProductUpsertObjectSchema.shape.productId.describe(
2356
+ "Existing product id for graph-only updates. Prefer this for an existing product on edit after loading GET /api/products/:id/composer-draft."
2082
2357
  ),
2083
- swatchColor: z22.string().nullable().optional(),
2084
- thumbnail: z22.string().nullable().optional(),
2085
- images: z22.array(z22.string()).optional(),
2086
- metadata: z22.unknown().optional()
2087
- });
2088
- var optionSchema = z22.object({
2089
- id: z22.string().optional().describe("Stable existing option ID for rename-safe updates"),
2090
- title: z22.string().describe("Option name (e.g. Color, Size)"),
2091
- slug: z22.string().optional().describe(
2092
- "Optional compatibility option token. The server generates one from title on create when omitted; not canonical identity."
2358
+ graphRevision: ProductUpsertObjectSchema.shape.graphRevision.describe(
2359
+ "Required when updating a product that already has options or variants on the server. Load from GET /api/products/:id/composer-draft."
2093
2360
  ),
2094
- values: z22.array(optionValueSchema).describe("Allowed option values")
2095
- });
2096
- var variantOptionValueSchema = z22.object({
2097
- valueSlug: z22.string().optional(),
2098
- valueId: z22.string().optional(),
2099
- value: z22.string().optional()
2100
- });
2101
- var variantSchema = z22.object({
2102
- id: z22.string().optional().describe("Existing variant ID for updates"),
2103
- optionValues: z22.union([
2104
- z22.record(z22.string(), z22.union([z22.string(), variantOptionValueSchema])),
2105
- z22.array(z22.string())
2106
- ]).optional().describe(
2107
- "Option-value selection. Prefer stable option-value IDs, either as an array or object values using { valueId }. Slug maps and exact { OptionTitle: ValueLabel } maps remain compatibility-only and fail when labels are ambiguous."
2108
- ),
2109
- sku: z22.string().nullable().optional(),
2110
- title: z22.string().nullable().optional(),
2111
- price: z22.number().nonnegative().describe("Selling price (KRW, min 0)"),
2112
- compareAtPrice: z22.number().nonnegative().nullable().optional(),
2113
- stock: z22.number().int().nonnegative().optional(),
2114
- isUnlimited: z22.boolean().optional(),
2115
- weight: z22.number().nonnegative().nullable().optional(),
2116
- requiresShipping: z22.boolean().optional(),
2117
- barcode: z22.string().nullable().optional(),
2118
- externalId: z22.string().nullable().optional(),
2119
- isActive: z22.boolean().optional(),
2120
- thumbnail: z22.string().nullable().optional(),
2121
- images: z22.array(z22.string()).optional(),
2122
- metadata: z22.unknown().optional()
2123
- });
2124
- var schema24 = {
2125
- product: z22.record(z22.string(), z22.unknown()).describe(
2126
- "Product fields. Include `id` to update an existing product; omit for create (then `title` is required)."
2361
+ product: ProductUpsertObjectSchema.shape.product.describe(
2362
+ "Product document fields for create (`title` required). For existing products, save document fields through Payload/Admin and send productId for graph upsert."
2127
2363
  ),
2128
- options: z22.array(optionSchema).optional().describe(
2129
- "Option definitions. Include stable option/value IDs when updating or renaming existing rows. Slugs are optional compatibility metadata generated from title/value on create when omitted; omitted options on an existing product are deleted (with their values)."
2364
+ options: ProductUpsertObjectSchema.shape.options.describe(
2365
+ "Full desired option graph. On edit, omitted options are deleted. Include stable option/value IDs for rename-safe updates."
2130
2366
  ),
2131
- variants: z22.array(variantSchema).optional().describe(
2132
- "Variant rows. Prefer stable option-value IDs in optionValues. Slug/title maps are compatibility inputs. Omitted variants on an existing product are deleted, unless referenced by an active cart or non-terminal order \u2014 those are soft-deactivated (isActive: false)."
2367
+ variants: ProductUpsertObjectSchema.shape.variants.describe(
2368
+ "Full desired variant graph. On edit, omitted variants are deleted or deactivated according to server references. Prefer stable option-value IDs."
2133
2369
  )
2134
2370
  };
2135
- var metadata24 = {
2371
+ var metadata25 = {
2136
2372
  name: "product-upsert",
2137
- description: "Atomically create or update a product together with its options, option-values, and variants in a single transaction. Mirrors Shopify productSet semantics. Any failure rolls back the entire write.",
2373
+ description: "Create a product or update an existing product graph. Existing products should load composer-draft first, send productId plus graphRevision, and include the full desired options/variants graph.",
2138
2374
  annotations: {
2139
2375
  title: "Upsert product (atomic)",
2140
2376
  readOnlyHint: false,
@@ -2145,9 +2381,13 @@ var metadata24 = {
2145
2381
  };
2146
2382
  async function productUpsert(params) {
2147
2383
  try {
2384
+ const parsed = ProductUpsertSchema.safeParse(params);
2385
+ if (!parsed.success) {
2386
+ return toolError(parsed.error);
2387
+ }
2148
2388
  const client = getClient();
2149
2389
  const result = await client.commerce.product.upsert(
2150
- params
2390
+ parsed.data
2151
2391
  );
2152
2392
  return toolSuccess({ data: result });
2153
2393
  } catch (error) {
@@ -2169,8 +2409,8 @@ async function getCollectionSchema(collection) {
2169
2409
  }
2170
2410
 
2171
2411
  // src/tools/get-collection-schema.ts
2172
- var schema25 = createCollectionSchemaToolInputSchema(SERVER_COLLECTIONS3).shape;
2173
- var metadata25 = {
2412
+ var schema26 = createCollectionSchemaToolInputSchema(SERVER_COLLECTIONS3).shape;
2413
+ var metadata26 = {
2174
2414
  name: "get-collection-schema",
2175
2415
  description: "Get the authoritative tenant-aware collection schema from console. Use this before create/update to understand writable fields, hidden fields, required metadata, and collection-level visibility.",
2176
2416
  annotations: {
@@ -2221,8 +2461,8 @@ async function getTenantFeatureProgress(feature, includeEvidence = false) {
2221
2461
  }
2222
2462
 
2223
2463
  // src/tools/get-tenant-context.ts
2224
- var schema26 = tenantContextToolInputSchema.shape;
2225
- var metadata26 = {
2464
+ var schema27 = tenantContextToolInputSchema.shape;
2465
+ var metadata27 = {
2226
2466
  name: "get-tenant-context",
2227
2467
  description: "Get current tenant features, active collections, and field visibility. Call this at the start of every session. Use includeCounts=true to also get per-collection document counts for setup diagnostics.",
2228
2468
  annotations: {
@@ -2299,8 +2539,8 @@ async function handler({
2299
2539
  }
2300
2540
 
2301
2541
  // src/tools/check-feature-progress.ts
2302
- var schema27 = tenantFeatureProgressInputSchema.shape;
2303
- var metadata27 = {
2542
+ var schema28 = tenantFeatureProgressInputSchema.shape;
2543
+ var metadata28 = {
2304
2544
  name: "check-feature-progress",
2305
2545
  description: "Check tenant implementation progress for a supported feature. Start with feature=ecommerce to inspect catalog, cart, checkout, payment result, webhook, and operations readiness without mutating tenant data.",
2306
2546
  annotations: {
@@ -2346,12 +2586,12 @@ function invalidateFieldConfigCache() {
2346
2586
  }
2347
2587
 
2348
2588
  // src/tools/list-configurable-fields.ts
2349
- var schema28 = {
2589
+ var schema29 = {
2350
2590
  collection: z23.string().optional().describe(
2351
2591
  "Filter by collection slug (optional \u2014 returns all if omitted). Use this filter to reduce response size when you know which collection to check."
2352
2592
  )
2353
2593
  };
2354
- var metadata28 = {
2594
+ var metadata29 = {
2355
2595
  name: "list-configurable-fields",
2356
2596
  description: "List all configurable fields for tenant collections with current visibility state. Shows which fields can be shown/hidden and their current status. Returns all collections including inactive features \u2014 cross-reference with get-tenant-context for active features. Response includes ~300 fields across 47 collections \u2014 use collection filter when possible.",
2357
2597
  annotations: {
@@ -2383,7 +2623,7 @@ async function listConfigurableFields(params) {
2383
2623
 
2384
2624
  // src/tools/update-field-config.ts
2385
2625
  import { z as z24 } from "zod";
2386
- var schema29 = {
2626
+ var schema30 = {
2387
2627
  collection: z24.string().min(1).describe("Collection slug (required)"),
2388
2628
  hiddenFields: z24.array(z24.string().min(1).max(200)).max(300).describe(
2389
2629
  "Fields to hide (required). This is a FULL REPLACE \u2014 fields NOT in this list will be shown. Pass [] to show all fields. Use list-configurable-fields first to see available field paths."
@@ -2392,7 +2632,7 @@ var schema29 = {
2392
2632
  "Hide the entire collection from Admin Panel (optional). When true, individual hiddenFields are irrelevant."
2393
2633
  )
2394
2634
  };
2395
- var metadata29 = {
2635
+ var metadata30 = {
2396
2636
  name: "update-field-config",
2397
2637
  description: "Update field visibility configuration for a tenant collection. Hidden fields are removed from the Admin Panel UI. IMPORTANT: hiddenFields is a full replace, not a merge. Always call list-configurable-fields first to see current state.",
2398
2638
  annotations: {
@@ -2861,7 +3101,7 @@ function getRecipe(goal, runtime = "both") {
2861
3101
  }
2862
3102
 
2863
3103
  // src/tools/sdk-get-recipe.ts
2864
- var schema30 = {
3104
+ var schema31 = {
2865
3105
  goal: z25.enum([
2866
3106
  "fetch-list",
2867
3107
  "fetch-by-id",
@@ -2878,7 +3118,7 @@ var schema30 = {
2878
3118
  collection: z25.string().optional().describe("Specific collection name if applicable"),
2879
3119
  includeExample: z25.boolean().default(true).describe("Whether to include a full code example")
2880
3120
  };
2881
- var metadata30 = {
3121
+ var metadata31 = {
2882
3122
  name: "sdk-get-recipe",
2883
3123
  description: "Get a complete SDK code recipe for a specific task. Returns recommended approach, code example, and related documentation links. Use this FIRST when the user asks how to do something with the SDK.",
2884
3124
  annotations: {
@@ -3107,11 +3347,11 @@ function searchDocs(query, limit = 5) {
3107
3347
  }
3108
3348
 
3109
3349
  // src/tools/sdk-search-docs.ts
3110
- var schema31 = {
3350
+ var schema32 = {
3111
3351
  query: z26.string().min(2).describe('Search keyword or phrase (e.g. "infinite scroll", "webhook", "customer login")'),
3112
3352
  limit: z26.number().min(1).max(10).default(5).describe("Maximum results to return (1-10, default: 5)")
3113
3353
  };
3114
- var metadata31 = {
3354
+ var metadata32 = {
3115
3355
  name: "sdk-search-docs",
3116
3356
  description: "Search SDK documentation by keyword. Returns matching topics with summaries and resource links. Use when looking for specific SDK features or patterns.",
3117
3357
  annotations: {
@@ -3147,7 +3387,7 @@ function handler4({
3147
3387
 
3148
3388
  // src/tools/sdk-get-auth-setup.ts
3149
3389
  import { z as z27 } from "zod";
3150
- var schema32 = {
3390
+ var schema33 = {
3151
3391
  scenario: z27.enum([
3152
3392
  "browser-client",
3153
3393
  "server-client",
@@ -3157,7 +3397,7 @@ var schema32 = {
3157
3397
  "webhook-verification"
3158
3398
  ]).describe("Authentication scenario")
3159
3399
  };
3160
- var metadata32 = {
3400
+ var metadata33 = {
3161
3401
  name: "sdk-get-auth-setup",
3162
3402
  description: "Get the current authentication setup for a specific scenario. Returns env var names, code snippets, and security notes.",
3163
3403
  annotations: {
@@ -3321,12 +3561,12 @@ function handler5({
3321
3561
  // src/tools/sdk-get-collection-pattern.ts
3322
3562
  import { z as z28 } from "zod";
3323
3563
  import { COLLECTIONS, SERVER_COLLECTIONS as SERVER_COLLECTIONS4 } from "@01.software/sdk";
3324
- var schema33 = {
3564
+ var schema34 = {
3325
3565
  collection: z28.enum(SERVER_COLLECTIONS4).describe("Collection name"),
3326
3566
  operation: z28.enum(["read", "write", "full-crud"]).default("read").describe("What operations are needed"),
3327
3567
  surface: z28.enum(["query-builder", "react-query", "server-api"]).default("query-builder").describe("Preferred API surface")
3328
3568
  };
3329
- var metadata33 = {
3569
+ var metadata34 = {
3330
3570
  name: "sdk-get-collection-pattern",
3331
3571
  description: "Get the recommended CRUD pattern for a specific collection. Returns code examples for the chosen API surface and operation type.",
3332
3572
  annotations: {
@@ -3523,13 +3763,13 @@ function handler6({
3523
3763
 
3524
3764
  // src/prompts/sdk-usage-guide.ts
3525
3765
  import { z as z29 } from "zod";
3526
- var schema34 = {
3766
+ var schema35 = {
3527
3767
  goal: z29.string().describe('What the user wants to accomplish (e.g., "query product list", "create order")'),
3528
3768
  runtime: z29.enum(["browser", "server"]).optional().describe("Target runtime: browser (React/Next.js client) or server (Node.js)"),
3529
3769
  surface: z29.enum(["query-builder", "react-query", "customer-api", "server-api"]).optional().describe("Preferred API surface"),
3530
3770
  collection: z29.string().optional().describe("Specific collection if relevant")
3531
3771
  };
3532
- var metadata34 = {
3772
+ var metadata35 = {
3533
3773
  name: "sdk-usage-guide",
3534
3774
  title: "SDK Usage Guide",
3535
3775
  description: "Provides guidance on how to perform a specific task using the 01.software SDK",
@@ -3703,12 +3943,12 @@ const { allAvailable } = await client.commerce.product.stockCheck({
3703
3943
  // src/prompts/collection-query-help.ts
3704
3944
  import { z as z30 } from "zod";
3705
3945
  import { COLLECTIONS as COLLECTIONS2, SERVER_COLLECTIONS as SERVER_COLLECTIONS5 } from "@01.software/sdk";
3706
- var schema35 = {
3946
+ var schema36 = {
3707
3947
  collection: z30.enum(SERVER_COLLECTIONS5).describe("Collection name"),
3708
3948
  operation: z30.enum(["find", "create", "update", "delete"]).describe("Operation to perform (find, create, update, delete)"),
3709
3949
  filters: z30.string().optional().describe("Filter conditions (JSON string, optional)")
3710
3950
  };
3711
- var metadata35 = {
3951
+ var metadata36 = {
3712
3952
  name: "collection-query-help",
3713
3953
  title: "Collection Query Help",
3714
3954
  description: "Provides guidance on how to write queries for a specific collection",
@@ -3806,15 +4046,16 @@ ${operation === "find" ? `- Use \`where\` option for filtering (Payload query sy
3806
4046
 
3807
4047
  // src/prompts/order-flow-guide.ts
3808
4048
  import { z as z31 } from "zod";
3809
- var schema36 = {
4049
+ var schema37 = {
3810
4050
  scenario: z31.enum([
3811
4051
  "simple-order",
3812
4052
  "cart-checkout",
3813
4053
  "return-refund",
4054
+ "order-cancel",
3814
4055
  "fulfillment-tracking"
3815
4056
  ]).describe("Order flow scenario")
3816
4057
  };
3817
- var metadata36 = {
4058
+ var metadata37 = {
3818
4059
  name: "order-flow-guide",
3819
4060
  title: "Order Flow Guide",
3820
4061
  description: "Provides step-by-step guidance for ecommerce order flows including creation, checkout, returns, and fulfillment.",
@@ -3944,6 +4185,35 @@ await client.commerce.orders.returnWithRefund({
3944
4185
  paymentKey: 'payment_key_xxx'
3945
4186
  })
3946
4187
  \`\`\``,
4188
+ "order-cancel": `## Provider-Verified Order Cancellation
4189
+
4190
+ ### Flow
4191
+
4192
+ 1. **Cancel Order** -> \`cancel-order\` tool
4193
+ - Pending or failed unpaid orders cancel without a provider call
4194
+ - Paid captured orders use the server-stored provider payment key from the captured transaction
4195
+ - Paid captured orders are refunded through the provider-verified path before local status changes
4196
+ - Successful paid cancellation releases reservedStock and moves the order to \`canceled\`
4197
+ - Duplicate local success returns \`alreadyCanceled: true\`; do not issue a second refund
4198
+ - Provider-refunded local blockers return \`reconciliationRequired: true\` on retry
4199
+
4200
+ ### V1 Rejections
4201
+ - Orders with non-failed fulfillments are rejected
4202
+ - \`shipped\`, \`delivered\`, \`confirmed\`, and return-axis orders are rejected
4203
+ - Active returns are rejected; use \`return-with-refund\` after delivery
4204
+ - Partial line-item cancellation and no-refund paid cancellation are not supported in v1
4205
+
4206
+ ### Code Example
4207
+ \`\`\`typescript
4208
+ await client.commerce.orders.cancelOrder({
4209
+ orderNumber: 'ORD-240101-001',
4210
+ reasonCode: 'customer',
4211
+ reasonDetail: 'Customer emailed before shipment',
4212
+ idempotencyKey: 'cancel-ORD-240101-001'
4213
+ })
4214
+ \`\`\`
4215
+
4216
+ If \`reconciliationRequired\` is true, stop provider retries and hand off to an operator to reconcile fulfillment, stock, and accounting manually.`,
3947
4217
  "fulfillment-tracking": `## Fulfillment & Tracking
3948
4218
 
3949
4219
  ### Creating Fulfillment
@@ -3999,13 +4269,13 @@ ${SCENARIOS[scenario] || "Unknown scenario."}
3999
4269
  - \`checkout\`
4000
4270
  - \`create-fulfillment\`, \`update-fulfillment\`
4001
4271
  - \`create-return\`, \`update-return\`, \`return-with-refund\`
4002
- - \`confirm-payment\`, \`update-transaction\`
4272
+ - \`confirm-payment\`, \`cancel-order\`, \`update-transaction\`
4003
4273
  - \`validate-discount\`, \`calculate-shipping\``;
4004
4274
  }
4005
4275
 
4006
4276
  // src/prompts/feature-setup-guide.ts
4007
4277
  import { z as z32 } from "zod";
4008
- var schema37 = {
4278
+ var schema38 = {
4009
4279
  feature: z32.enum([
4010
4280
  "ecommerce",
4011
4281
  "customers",
@@ -4021,7 +4291,7 @@ var schema37 = {
4021
4291
  "community"
4022
4292
  ]).describe("Feature to get setup guide for")
4023
4293
  };
4024
- var metadata37 = {
4294
+ var metadata38 = {
4025
4295
  name: "feature-setup-guide",
4026
4296
  title: "Feature Setup Guide",
4027
4297
  description: "Setup checklist and remediation guide for a tenant feature. Load with check-feature-progress and get-tenant-context to diagnose setup gaps.",
@@ -4229,7 +4499,7 @@ ${FEATURES[feature] || "Unknown feature."}
4229
4499
  }
4230
4500
 
4231
4501
  // src/resources/(config)/app.ts
4232
- var metadata38 = {
4502
+ var metadata39 = {
4233
4503
  name: "app-config",
4234
4504
  title: "Application Config",
4235
4505
  description: "01.software SDK and MCP server configuration information"
@@ -4295,7 +4565,7 @@ Rate limits depend on your tenant plan:
4295
4565
 
4296
4566
  // src/resources/(collections)/schema.ts
4297
4567
  import { COLLECTIONS as COLLECTIONS3 } from "@01.software/sdk";
4298
- var metadata39 = {
4568
+ var metadata40 = {
4299
4569
  name: "collections-schema",
4300
4570
  title: "Collection Schema Info",
4301
4571
  description: "Available collections and their schema information"
@@ -4432,7 +4702,7 @@ Total available collections: ${COLLECTIONS3.length}`;
4432
4702
  }
4433
4703
 
4434
4704
  // src/resources/(docs)/getting-started.ts
4435
- var metadata40 = {
4705
+ var metadata41 = {
4436
4706
  name: "docs-getting-started",
4437
4707
  title: "Getting Started",
4438
4708
  description: "01.software SDK getting started guide"
@@ -4493,7 +4763,7 @@ const result = await client.collections.from('products').find({
4493
4763
  }
4494
4764
 
4495
4765
  // src/resources/(docs)/guides.ts
4496
- var metadata41 = {
4766
+ var metadata42 = {
4497
4767
  name: "docs-guides",
4498
4768
  title: "Guides",
4499
4769
  description: "01.software SDK usage guides"
@@ -4706,7 +4976,7 @@ For more implementation guidance, see the [SDK Guide](/developers/sdk).`;
4706
4976
  }
4707
4977
 
4708
4978
  // src/resources/(docs)/api.ts
4709
- var metadata42 = {
4979
+ var metadata43 = {
4710
4980
  name: "docs-api",
4711
4981
  title: "API Reference",
4712
4982
  description: "01.software SDK API reference documentation"
@@ -4989,7 +5259,7 @@ For more details, see the [API documentation](/developers/api).`;
4989
5259
  }
4990
5260
 
4991
5261
  // src/resources/(docs)/query-builder.ts
4992
- var metadata43 = {
5262
+ var metadata44 = {
4993
5263
  name: "docs-query-builder",
4994
5264
  title: "Query Builder",
4995
5265
  description: "01.software SDK Query Builder API reference (client.collections.from)"
@@ -5183,7 +5453,7 @@ console.log(result.hasNextPage) // true
5183
5453
  }
5184
5454
 
5185
5455
  // src/resources/(docs)/react-query.ts
5186
- var metadata44 = {
5456
+ var metadata45 = {
5187
5457
  name: "docs-react-query",
5188
5458
  title: "React Query Hooks",
5189
5459
  description: "01.software SDK React Query hooks reference (@01.software/sdk/query)"
@@ -5415,7 +5685,7 @@ export function ProductList() {
5415
5685
  }
5416
5686
 
5417
5687
  // src/resources/(docs)/server-api.ts
5418
- var metadata45 = {
5688
+ var metadata46 = {
5419
5689
  name: "docs-server-api",
5420
5690
  title: "Server-side API",
5421
5691
  description: "01.software SDK server-side API reference (client.commerce) for orders, fulfillments, returns, carts, and validation"
@@ -5699,7 +5969,7 @@ const result = await client.commerce.shipping.calculate({
5699
5969
  }
5700
5970
 
5701
5971
  // src/resources/(docs)/customer-auth.ts
5702
- var metadata46 = {
5972
+ var metadata47 = {
5703
5973
  name: "docs-customer-auth",
5704
5974
  title: "Customer Auth API",
5705
5975
  description: "01.software SDK Customer Auth API reference (client.customer)"
@@ -5877,7 +6147,7 @@ async function loadProfile() {
5877
6147
  }
5878
6148
 
5879
6149
  // src/resources/(docs)/browser-vs-server.ts
5880
- var metadata47 = {
6150
+ var metadata48 = {
5881
6151
  name: "docs-browser-vs-server",
5882
6152
  title: "Client vs ServerClient",
5883
6153
  description: "When to use Client (createClient) vs ServerClient (createServerClient) in the 01.software SDK"
@@ -6043,7 +6313,7 @@ export function ProductList() {
6043
6313
  }
6044
6314
 
6045
6315
  // src/resources/(docs)/file-upload.ts
6046
- var metadata48 = {
6316
+ var metadata49 = {
6047
6317
  name: "docs-file-upload",
6048
6318
  title: "File Upload",
6049
6319
  description: "01.software SDK file upload patterns using the images collection"
@@ -6194,7 +6464,7 @@ The platform stores files in Cloudflare R2 and serves via CDN (\`cdn.01.software
6194
6464
  }
6195
6465
 
6196
6466
  // src/resources/(docs)/webhook.ts
6197
- var metadata49 = {
6467
+ var metadata50 = {
6198
6468
  name: "docs-webhook",
6199
6469
  title: "Webhooks",
6200
6470
  description: "01.software SDK webhook verification and event handling"
@@ -6458,7 +6728,7 @@ Configure webhook URLs in the 01.software console under Tenant Settings > Webhoo
6458
6728
  }
6459
6729
 
6460
6730
  // src/resources/(docs)/product-detail.ts
6461
- var metadata50 = {
6731
+ var metadata51 = {
6462
6732
  name: "docs-product-detail",
6463
6733
  title: "Product Detail Helper",
6464
6734
  description: "01.software SDK commerce.product.detail helper guide"
@@ -6568,7 +6838,7 @@ function runtimeAnnotationsFor(meta) {
6568
6838
  openWorldHint: policy.annotationPolicy.openWorld
6569
6839
  };
6570
6840
  }
6571
- function registerTool(server, schema38, meta, handler20) {
6841
+ function registerTool(server, schema39, meta, handler20) {
6572
6842
  let registered = REGISTERED_TOOLS_BY_SERVER.get(server);
6573
6843
  if (!registered) {
6574
6844
  registered = /* @__PURE__ */ new Set();
@@ -6579,7 +6849,7 @@ function registerTool(server, schema38, meta, handler20) {
6579
6849
  meta.name,
6580
6850
  {
6581
6851
  description: meta.description,
6582
- inputSchema: schema38,
6852
+ inputSchema: schema39,
6583
6853
  annotations: runtimeAnnotationsFor(meta)
6584
6854
  },
6585
6855
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -6629,13 +6899,13 @@ function registerTool(server, schema38, meta, handler20) {
6629
6899
  }
6630
6900
  );
6631
6901
  }
6632
- function registerPrompt(server, schema38, meta, handler20) {
6902
+ function registerPrompt(server, schema39, meta, handler20) {
6633
6903
  server.registerPrompt(
6634
6904
  meta.name,
6635
6905
  {
6636
6906
  title: meta.title,
6637
6907
  description: meta.description,
6638
- argsSchema: schema38
6908
+ argsSchema: schema39
6639
6909
  },
6640
6910
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6641
6911
  (params) => ({
@@ -6709,230 +6979,231 @@ function createServer(options = {}) {
6709
6979
  metadata10,
6710
6980
  confirmPayment
6711
6981
  );
6712
- registerTool(
6713
- server,
6714
- schema11,
6715
- metadata11,
6716
- createReturn
6717
- );
6982
+ registerTool(server, schema11, metadata11, cancelOrder);
6718
6983
  registerTool(
6719
6984
  server,
6720
6985
  schema12,
6721
6986
  metadata12,
6722
- updateReturn
6987
+ createReturn
6723
6988
  );
6724
6989
  registerTool(
6725
6990
  server,
6726
6991
  schema13,
6727
6992
  metadata13,
6728
- returnWithRefund
6993
+ updateReturn
6729
6994
  );
6730
- registerTool(server, schema14, metadata14, addCartItem);
6731
6995
  registerTool(
6732
6996
  server,
6733
- schema15,
6734
- metadata15,
6735
- updateCartItem
6997
+ schema14,
6998
+ metadata14,
6999
+ returnWithRefund
6736
7000
  );
7001
+ registerTool(server, schema15, metadata15, addCartItem);
6737
7002
  registerTool(
6738
7003
  server,
6739
7004
  schema16,
6740
7005
  metadata16,
6741
- removeCartItem
7006
+ updateCartItem
6742
7007
  );
6743
7008
  registerTool(
6744
7009
  server,
6745
7010
  schema17,
6746
7011
  metadata17,
6747
- applyDiscount
7012
+ removeCartItem
6748
7013
  );
6749
7014
  registerTool(
6750
7015
  server,
6751
7016
  schema18,
6752
7017
  metadata18,
6753
- removeDiscount
7018
+ applyDiscount
6754
7019
  );
6755
- registerTool(server, schema19, metadata19, clearCart);
6756
7020
  registerTool(
6757
7021
  server,
6758
- schema20,
6759
- metadata20,
6760
- validateDiscount
7022
+ schema19,
7023
+ metadata19,
7024
+ removeDiscount
6761
7025
  );
7026
+ registerTool(server, schema20, metadata20, clearCart);
6762
7027
  registerTool(
6763
7028
  server,
6764
7029
  schema21,
6765
7030
  metadata21,
6766
- calculateShipping
7031
+ validateDiscount
6767
7032
  );
6768
- registerTool(server, schema22, metadata22, stockCheck);
6769
7033
  registerTool(
6770
7034
  server,
6771
- schema23,
6772
- metadata23,
6773
- productDetail
7035
+ schema22,
7036
+ metadata22,
7037
+ calculateShipping
6774
7038
  );
7039
+ registerTool(server, schema23, metadata23, stockCheck);
6775
7040
  registerTool(
6776
7041
  server,
6777
7042
  schema24,
6778
7043
  metadata24,
7044
+ productDetail
7045
+ );
7046
+ registerTool(
7047
+ server,
7048
+ schema25,
7049
+ metadata25,
6779
7050
  productUpsert
6780
7051
  );
6781
7052
  }
6782
- registerTool(
6783
- server,
6784
- schema25,
6785
- metadata25,
6786
- getCollectionSchemaTool
6787
- );
6788
7053
  registerTool(
6789
7054
  server,
6790
7055
  schema26,
6791
7056
  metadata26,
6792
- handler
7057
+ getCollectionSchemaTool
6793
7058
  );
6794
7059
  registerTool(
6795
7060
  server,
6796
7061
  schema27,
6797
7062
  metadata27,
6798
- handler2
7063
+ handler
6799
7064
  );
6800
7065
  registerTool(
6801
7066
  server,
6802
7067
  schema28,
6803
7068
  metadata28,
6804
- listConfigurableFields
7069
+ handler2
6805
7070
  );
6806
7071
  registerTool(
6807
7072
  server,
6808
7073
  schema29,
6809
7074
  metadata29,
6810
- updateFieldConfig
7075
+ listConfigurableFields
6811
7076
  );
6812
7077
  registerTool(
6813
7078
  server,
6814
7079
  schema30,
6815
7080
  metadata30,
6816
- handler3
7081
+ updateFieldConfig
6817
7082
  );
6818
7083
  registerTool(
6819
7084
  server,
6820
7085
  schema31,
6821
7086
  metadata31,
6822
- handler4
7087
+ handler3
6823
7088
  );
6824
7089
  registerTool(
6825
7090
  server,
6826
7091
  schema32,
6827
7092
  metadata32,
6828
- handler5
7093
+ handler4
6829
7094
  );
6830
7095
  registerTool(
6831
7096
  server,
6832
7097
  schema33,
6833
7098
  metadata33,
6834
- handler6
7099
+ handler5
6835
7100
  );
6836
- registerPrompt(
7101
+ registerTool(
6837
7102
  server,
6838
7103
  schema34,
6839
7104
  metadata34,
6840
- sdkUsageGuide
7105
+ handler6
6841
7106
  );
6842
7107
  registerPrompt(
6843
7108
  server,
6844
7109
  schema35,
6845
7110
  metadata35,
6846
- collectionQueryHelp
7111
+ sdkUsageGuide
6847
7112
  );
6848
7113
  registerPrompt(
6849
7114
  server,
6850
7115
  schema36,
6851
7116
  metadata36,
6852
- orderFlowGuide
7117
+ collectionQueryHelp
6853
7118
  );
6854
7119
  registerPrompt(
6855
7120
  server,
6856
7121
  schema37,
6857
7122
  metadata37,
7123
+ orderFlowGuide
7124
+ );
7125
+ registerPrompt(
7126
+ server,
7127
+ schema38,
7128
+ metadata38,
6858
7129
  featureSetupGuide
6859
7130
  );
6860
7131
  registerStaticResource(
6861
7132
  server,
6862
7133
  mcpResourceUri("app-config"),
6863
- metadata38,
7134
+ metadata39,
6864
7135
  handler7
6865
7136
  );
6866
7137
  registerStaticResource(
6867
7138
  server,
6868
7139
  mcpResourceUri("collections-schema"),
6869
- metadata39,
7140
+ metadata40,
6870
7141
  handler8
6871
7142
  );
6872
7143
  registerStaticResource(
6873
7144
  server,
6874
7145
  mcpResourceUri("docs-getting-started"),
6875
- metadata40,
7146
+ metadata41,
6876
7147
  handler9
6877
7148
  );
6878
7149
  registerStaticResource(
6879
7150
  server,
6880
7151
  mcpResourceUri("docs-guides"),
6881
- metadata41,
7152
+ metadata42,
6882
7153
  handler10
6883
7154
  );
6884
7155
  registerStaticResource(
6885
7156
  server,
6886
7157
  mcpResourceUri("docs-api"),
6887
- metadata42,
7158
+ metadata43,
6888
7159
  handler11
6889
7160
  );
6890
7161
  registerStaticResource(
6891
7162
  server,
6892
7163
  mcpResourceUri("docs-query-builder"),
6893
- metadata43,
7164
+ metadata44,
6894
7165
  handler12
6895
7166
  );
6896
7167
  registerStaticResource(
6897
7168
  server,
6898
7169
  mcpResourceUri("docs-react-query"),
6899
- metadata44,
7170
+ metadata45,
6900
7171
  handler13
6901
7172
  );
6902
7173
  registerStaticResource(
6903
7174
  server,
6904
7175
  mcpResourceUri("docs-server-api"),
6905
- metadata45,
7176
+ metadata46,
6906
7177
  handler14
6907
7178
  );
6908
7179
  registerStaticResource(
6909
7180
  server,
6910
7181
  mcpResourceUri("docs-customer-auth"),
6911
- metadata46,
7182
+ metadata47,
6912
7183
  handler15
6913
7184
  );
6914
7185
  registerStaticResource(
6915
7186
  server,
6916
7187
  mcpResourceUri("docs-browser-vs-server"),
6917
- metadata47,
7188
+ metadata48,
6918
7189
  handler16
6919
7190
  );
6920
7191
  registerStaticResource(
6921
7192
  server,
6922
7193
  mcpResourceUri("docs-file-upload"),
6923
- metadata48,
7194
+ metadata49,
6924
7195
  handler17
6925
7196
  );
6926
7197
  registerStaticResource(
6927
7198
  server,
6928
7199
  mcpResourceUri("docs-webhook"),
6929
- metadata49,
7200
+ metadata50,
6930
7201
  handler18
6931
7202
  );
6932
7203
  registerStaticResource(
6933
7204
  server,
6934
7205
  mcpResourceUri("docs-product-detail"),
6935
- metadata50,
7206
+ metadata51,
6936
7207
  handler19
6937
7208
  );
6938
7209
  return server;
@@ -6953,4 +7224,4 @@ export {
6953
7224
  flushMcpTelemetrySummary,
6954
7225
  createServer
6955
7226
  };
6956
- //# sourceMappingURL=chunk-3TIDAOYP.js.map
7227
+ //# sourceMappingURL=chunk-VEFJZ6VK.js.map