@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.
@@ -312,106 +312,338 @@ var collectionSchemaResponseSchema = z.object({
312
312
  }).strict();
313
313
 
314
314
  // ../../packages/contracts/src/ecommerce/index.ts
315
+ import { z as z3 } from "zod";
316
+
317
+ // ../../packages/contracts/src/ecommerce/product-upsert.ts
315
318
  import { z as z2 } from "zod";
316
- var transactionStatusSchema = z2.enum([
319
+ var IdSchema = z2.union([z2.string(), z2.number()]).transform(String);
320
+ var RemovedLegacyMediaFieldSchema = z2.unknown().optional();
321
+ var productFieldShape = {
322
+ id: IdSchema.optional(),
323
+ title: z2.string().min(1).optional(),
324
+ subtitle: z2.string().optional().nullable(),
325
+ description: z2.string().optional().nullable(),
326
+ status: z2.string().optional(),
327
+ slug: z2.string().optional(),
328
+ primaryMediaItemId: IdSchema.optional().nullable(),
329
+ thumbnail: IdSchema.optional().nullable(),
330
+ images: z2.array(IdSchema).optional(),
331
+ mediaSets: RemovedLegacyMediaFieldSchema,
332
+ vendor: z2.string().optional().nullable(),
333
+ productType: z2.string().optional().nullable(),
334
+ brand: IdSchema.optional().nullable(),
335
+ shippingPolicy: IdSchema.optional().nullable(),
336
+ weight: z2.number().int().min(0).optional().nullable(),
337
+ minOrderQuantity: z2.number().int().min(1).optional().nullable(),
338
+ maxOrderQuantity: z2.number().int().min(1).optional().nullable(),
339
+ listingPrimaryOption: IdSchema.optional().nullable(),
340
+ isFeatured: z2.boolean().optional(),
341
+ publishedAt: z2.string().optional().nullable(),
342
+ categories: z2.array(IdSchema).optional(),
343
+ tags: z2.array(IdSchema).optional(),
344
+ metadata: z2.unknown().optional()
345
+ };
346
+ var PRODUCT_UPSERT_PRODUCT_FIELDS = Object.keys(
347
+ productFieldShape
348
+ );
349
+ var ProductFieldsSchema = z2.object(productFieldShape).passthrough();
350
+ var OptionValueInputSchema = z2.object({
351
+ id: IdSchema.optional(),
352
+ value: z2.string().min(1, "Option value `value` is required"),
353
+ slug: z2.string().optional(),
354
+ swatch: z2.object({
355
+ type: z2.enum(["color", "media"]).optional().nullable(),
356
+ color: z2.string().optional().nullable(),
357
+ mediaItemId: IdSchema.optional().nullable()
358
+ }).optional().nullable(),
359
+ thumbnail: RemovedLegacyMediaFieldSchema,
360
+ images: RemovedLegacyMediaFieldSchema,
361
+ metadata: z2.unknown().optional()
362
+ }).passthrough().superRefine((value, ctx) => {
363
+ if (Object.prototype.hasOwnProperty.call(value, "swatchColor")) {
364
+ ctx.addIssue({
365
+ code: "custom",
366
+ message: "Option value field `swatchColor` was removed. Use nested `swatch.color` instead.",
367
+ path: ["swatchColor"]
368
+ });
369
+ }
370
+ });
371
+ var OptionInputSchema = z2.object({
372
+ id: IdSchema.optional(),
373
+ title: z2.string().min(1, "Option `title` is required"),
374
+ slug: z2.string().optional(),
375
+ values: z2.array(OptionValueInputSchema).min(1, "Each option must have at least one value")
376
+ });
377
+ var VariantOptionValueObjectSchema = z2.object({
378
+ valueSlug: z2.string().optional(),
379
+ valueId: IdSchema.optional(),
380
+ value: z2.string().optional()
381
+ }).refine((data) => Boolean(data.valueSlug ?? data.valueId ?? data.value), {
382
+ message: "Variant option value object requires valueSlug, valueId, or value"
383
+ });
384
+ var VariantInputSchema = z2.object({
385
+ id: IdSchema.optional(),
386
+ optionValues: z2.union([
387
+ z2.record(
388
+ z2.string(),
389
+ z2.union([z2.string(), VariantOptionValueObjectSchema])
390
+ ),
391
+ z2.array(IdSchema)
392
+ ]).optional(),
393
+ sku: z2.string().optional().nullable(),
394
+ title: z2.string().optional().nullable(),
395
+ price: z2.number().min(0),
396
+ compareAtPrice: z2.number().min(0).optional().nullable(),
397
+ stock: z2.number().int().min(0).optional(),
398
+ isUnlimited: z2.boolean().optional(),
399
+ weight: z2.number().int().min(0).optional().nullable(),
400
+ requiresShipping: z2.boolean().optional(),
401
+ barcode: z2.string().optional().nullable(),
402
+ externalId: z2.string().optional().nullable(),
403
+ isActive: z2.boolean().optional(),
404
+ images: z2.array(IdSchema).optional(),
405
+ thumbnail: RemovedLegacyMediaFieldSchema,
406
+ featuredMediaItemId: RemovedLegacyMediaFieldSchema,
407
+ metadata: z2.unknown().optional()
408
+ });
409
+ var ProductUpsertObjectSchema = z2.object({
410
+ /** Required on graph edit when the server graph is non-empty (`productId` set); optional for first seed on an empty graph. */
411
+ graphRevision: z2.string().optional(),
412
+ productId: IdSchema.optional(),
413
+ product: ProductFieldsSchema.optional(),
414
+ options: z2.array(OptionInputSchema).max(10).optional().default([]),
415
+ variants: z2.array(VariantInputSchema).max(500).optional().default([])
416
+ });
417
+ var ProductUpsertSchema = ProductUpsertObjectSchema.superRefine(
418
+ (data, ctx) => {
419
+ const nestedProductId = data.product?.id;
420
+ if (data.productId != null && nestedProductId != null && String(data.productId) !== String(nestedProductId)) {
421
+ ctx.addIssue({
422
+ code: "custom",
423
+ message: "productId must match product.id when both are set on graph upsert.",
424
+ path: ["productId"]
425
+ });
426
+ }
427
+ const productId = data.productId ?? nestedProductId;
428
+ const isEdit = productId != null;
429
+ if (!isEdit && data.productId != null) {
430
+ ctx.addIssue({
431
+ code: "custom",
432
+ message: "productId is not allowed when creating a product.",
433
+ path: ["productId"]
434
+ });
435
+ }
436
+ if (!isEdit && !data.product?.title) {
437
+ ctx.addIssue({
438
+ code: "custom",
439
+ message: "Product `title` is required when creating a new product.",
440
+ path: ["product", "title"]
441
+ });
442
+ }
443
+ if (isEdit && data.product) {
444
+ for (const key of Object.keys(data.product)) {
445
+ if (key !== "id") {
446
+ ctx.addIssue({
447
+ code: "custom",
448
+ message: "Existing product graph upsert accepts only product identity. Save document fields through Payload.",
449
+ path: ["product", key]
450
+ });
451
+ }
452
+ }
453
+ }
454
+ }
455
+ );
456
+
457
+ // ../../packages/contracts/src/ecommerce/index.ts
458
+ var transactionStatusSchema = z3.enum([
317
459
  "pending",
318
460
  "paid",
319
461
  "failed",
320
462
  "canceled"
321
463
  ]);
322
- var entityIdSchema = z2.union([z2.string(), z2.number()]).transform(String);
323
- var createOrderItemSchema = z2.object({
464
+ var orderStatusSchema = z3.enum([
465
+ "pending",
466
+ "paid",
467
+ "failed",
468
+ "canceled",
469
+ "refunded",
470
+ "preparing",
471
+ "shipped",
472
+ "delivered",
473
+ "confirmed",
474
+ "return_requested",
475
+ "return_processing",
476
+ "returned"
477
+ ]);
478
+ var entityIdSchema = z3.union([z3.string(), z3.number()]).transform(String);
479
+ var createOrderItemSchema = z3.object({
324
480
  product: entityIdSchema,
325
481
  variant: entityIdSchema,
326
482
  option: entityIdSchema,
327
- quantity: z2.number().int().positive("quantity must be a positive integer"),
328
- unitPrice: z2.number().optional(),
329
- totalPrice: z2.number().optional()
483
+ quantity: z3.number().int().positive("quantity must be a positive integer"),
484
+ unitPrice: z3.number().optional(),
485
+ totalPrice: z3.number().optional()
330
486
  });
331
- var createOrderSchema = z2.object({
332
- pgPaymentId: z2.string().min(1).optional(),
333
- orderNumber: z2.string().min(1, "orderNumber is required"),
487
+ var createOrderSchema = z3.object({
488
+ pgPaymentId: z3.string().min(1).optional(),
489
+ orderNumber: z3.string().min(1, "orderNumber is required"),
334
490
  customer: entityIdSchema.optional(),
335
- customerSnapshot: z2.object({
336
- name: z2.string().optional(),
337
- email: z2.string().email("Invalid email format"),
338
- phone: z2.string().optional()
491
+ customerSnapshot: z3.object({
492
+ name: z3.string().optional(),
493
+ email: z3.string().email("Invalid email format"),
494
+ phone: z3.string().optional()
339
495
  }),
340
- shippingAddress: z2.object({
341
- postalCode: z2.string().optional(),
342
- address: z2.string().optional(),
343
- detailAddress: z2.string().optional(),
344
- deliveryMessage: z2.string().optional(),
345
- recipientName: z2.string().optional(),
346
- phone: z2.string().optional()
496
+ shippingAddress: z3.object({
497
+ postalCode: z3.string().optional(),
498
+ address: z3.string().optional(),
499
+ detailAddress: z3.string().optional(),
500
+ deliveryMessage: z3.string().optional(),
501
+ recipientName: z3.string().optional(),
502
+ phone: z3.string().optional()
347
503
  }),
348
- orderItems: z2.array(createOrderItemSchema).min(1, "At least one order item is required").max(100, "Maximum 100 items per order"),
349
- totalAmount: z2.number().nonnegative("totalAmount must be non-negative"),
350
- shippingAmount: z2.number().min(0).optional(),
351
- discountCode: z2.string().optional()
504
+ orderItems: z3.array(createOrderItemSchema).min(1, "At least one order item is required").max(100, "Maximum 100 items per order"),
505
+ totalAmount: z3.number().nonnegative("totalAmount must be non-negative"),
506
+ shippingAmount: z3.number().min(0).optional(),
507
+ discountCode: z3.string().optional()
352
508
  });
353
509
  var CreateOrderSchema = createOrderSchema;
354
- var updateTransactionSchema = z2.object({
355
- pgPaymentId: z2.string().min(1, "pgPaymentId is required").describe("PG payment ID (required)"),
510
+ var updateTransactionSchema = z3.object({
511
+ pgPaymentId: z3.string().min(1, "pgPaymentId is required").describe("PG payment ID (required)"),
356
512
  status: transactionStatusSchema.describe(
357
513
  "New transaction status (required)"
358
514
  ),
359
- paymentMethod: z2.string().optional().describe("Payment method (optional)"),
360
- receiptUrl: z2.string().optional().describe("Receipt URL (optional)"),
361
- paymentKey: z2.string().min(1).optional().describe("Provider payment key for verified paid confirmation"),
362
- amount: z2.number().int().positive().optional().describe("Provider-confirmed amount for verified paid confirmation")
515
+ paymentMethod: z3.string().optional().describe("Payment method (optional)"),
516
+ receiptUrl: z3.string().optional().describe("Receipt URL (optional)"),
517
+ paymentKey: z3.string().min(1).optional().describe("Provider payment key for verified paid confirmation"),
518
+ amount: z3.number().int().positive().optional().describe("Provider-confirmed amount for verified paid confirmation")
363
519
  }).strict();
364
520
  var UpdateTransactionSchema = updateTransactionSchema;
365
- var providerSlugSchema = z2.string().trim().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/, "pgProvider must be lowercase slug");
366
- var confirmPaymentSchema = z2.object({
367
- orderNumber: z2.string().min(1).optional(),
368
- pgPaymentId: z2.string().min(1, "pgPaymentId is required").describe("Provider payment identifier stored on the transaction"),
521
+ var providerSlugSchema = z3.string().trim().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/, "pgProvider must be lowercase slug");
522
+ var confirmPaymentSchema = z3.object({
523
+ orderNumber: z3.string().min(1).optional(),
524
+ pgPaymentId: z3.string().min(1, "pgPaymentId is required").describe("Provider payment identifier stored on the transaction"),
369
525
  pgProvider: providerSlugSchema.describe(
370
526
  "Payment provider slug, e.g. toss, portone, stripe"
371
527
  ),
372
- pgOrderId: z2.string().min(1).optional(),
373
- amount: z2.number().int().nonnegative("amount must be non-negative").describe("Provider-confirmed amount in minor units"),
374
- currency: z2.string().min(1).optional(),
375
- paymentMethod: z2.string().optional(),
376
- receiptUrl: z2.string().url().optional(),
377
- approvedAt: z2.string().optional(),
378
- providerStatus: z2.string().optional(),
379
- providerEventId: z2.string().min(1).optional(),
380
- confirmationSource: z2.enum([
528
+ pgOrderId: z3.string().min(1).optional(),
529
+ amount: z3.number().int().nonnegative("amount must be non-negative").describe("Provider-confirmed amount in minor units"),
530
+ currency: z3.string().min(1).optional(),
531
+ paymentMethod: z3.string().optional(),
532
+ receiptUrl: z3.string().url().optional(),
533
+ approvedAt: z3.string().optional(),
534
+ providerStatus: z3.string().optional(),
535
+ providerEventId: z3.string().min(1).optional(),
536
+ confirmationSource: z3.enum([
381
537
  "provider_webhook",
382
538
  "provider_lookup",
383
539
  "provider_api_confirm",
384
540
  "manual_server"
385
541
  ]).optional(),
386
- metadata: z2.record(z2.string(), z2.unknown()).optional()
542
+ metadata: z3.record(z3.string(), z3.unknown()).optional()
387
543
  }).strict();
388
544
  var ConfirmPaymentSchema = confirmPaymentSchema;
389
- var returnReasonSchema = z2.enum([
545
+ var returnReasonSchema = z3.enum([
390
546
  "change_of_mind",
391
547
  "defective",
392
548
  "wrong_delivery",
393
549
  "damaged",
394
550
  "other"
395
551
  ]);
396
- var restockActionSchema = z2.enum(["return_to_stock", "discard"]);
397
- var returnWithRefundItemSchema = z2.object({
398
- orderItem: z2.union([z2.string(), z2.number()]).transform(String),
399
- quantity: z2.number().int().positive("quantity must be a positive integer"),
552
+ var restockActionSchema = z3.enum(["return_to_stock", "discard"]);
553
+ var returnWithRefundItemSchema = z3.object({
554
+ orderItem: z3.union([z3.string(), z3.number()]).transform(String),
555
+ quantity: z3.number().int().positive("quantity must be a positive integer"),
400
556
  restockAction: restockActionSchema.default("return_to_stock"),
401
- restockingFee: z2.number().min(0, "restockingFee must be non-negative").optional().describe("Restocking fee charged for this line (ADR 0005 \xA7Gap 1)")
557
+ restockingFee: z3.number().min(0, "restockingFee must be non-negative").optional().describe("Restocking fee charged for this line (ADR 0005 \xA7Gap 1)")
402
558
  }).strict();
403
- var returnWithRefundSchema = z2.object({
404
- orderNumber: z2.string().min(1, "orderNumber is required").describe("Order number (required)"),
559
+ var returnWithRefundSchema = z3.object({
560
+ orderNumber: z3.string().min(1, "orderNumber is required").describe("Order number (required)"),
405
561
  reason: returnReasonSchema.optional().describe("Return reason (optional)"),
406
- reasonDetail: z2.string().optional().describe("Detailed reason text (optional)"),
407
- 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)"),
408
- refundAmount: z2.number().min(0, "refundAmount must be non-negative").describe("Refund amount (required, min 0)"),
409
- returnShippingFee: z2.number().min(0, "returnShippingFee must be non-negative").optional().describe("Return shipping fee charged to the customer (ADR 0005 \xA7Gap 1)"),
410
- pgPaymentId: z2.string().min(1, "pgPaymentId is required").describe("PG payment ID for refund (required)"),
411
- paymentKey: z2.string().min(1).optional().describe("Provider payment key for verified refund"),
412
- refundReceiptUrl: z2.string().optional().describe("Refund receipt URL (optional)")
562
+ reasonDetail: z3.string().optional().describe("Detailed reason text (optional)"),
563
+ 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)"),
564
+ refundAmount: z3.number().min(0, "refundAmount must be non-negative").describe("Refund amount (required, min 0)"),
565
+ returnShippingFee: z3.number().min(0, "returnShippingFee must be non-negative").optional().describe(
566
+ "Return shipping fee charged to the customer (ADR 0005 \xA7Gap 1)"
567
+ ),
568
+ pgPaymentId: z3.string().min(1, "pgPaymentId is required").describe("PG payment ID for refund (required)"),
569
+ paymentKey: z3.string().min(1).optional().describe("Provider payment key for verified refund"),
570
+ refundReceiptUrl: z3.string().optional().describe("Refund receipt URL (optional)")
413
571
  }).strict();
414
572
  var ReturnWithRefundSchema = returnWithRefundSchema;
573
+ var cancelReasonCodeSchema = z3.enum([
574
+ "customer",
575
+ "inventory",
576
+ "fraud",
577
+ "declined",
578
+ "staff",
579
+ "other"
580
+ ]);
581
+ var idempotencyKeySchema = z3.string().trim().min(1, "idempotencyKey is required").max(255, "idempotencyKey must be 255 characters or fewer").regex(
582
+ /^[\x21-\x7E]+$/,
583
+ "idempotencyKey must contain only printable header-safe characters"
584
+ );
585
+ var cancelOrderSchema = z3.object({
586
+ orderNumber: z3.string().min(1, "orderNumber is required").describe("Order number to cancel"),
587
+ reasonCode: cancelReasonCodeSchema.default("other").describe("Operator-selected cancel reason code"),
588
+ reasonDetail: z3.string().trim().max(2e3, "reasonDetail must be 2000 characters or fewer").optional().describe("Internal cancellation detail stored on the order")
589
+ }).strict();
590
+ var CancelOrderSchema = cancelOrderSchema;
591
+ var cancelOrderResponseBaseSchema = {
592
+ orderId: z3.string().min(1)
593
+ };
594
+ var unpaidCancelResponseFields = {
595
+ refundedAmount: z3.literal(0),
596
+ providerRefunded: z3.literal(false)
597
+ };
598
+ var alreadyCanceledResponseFields = {
599
+ refundedAmount: z3.number().int().nonnegative(),
600
+ providerRefunded: z3.literal(false)
601
+ };
602
+ var providerRefundResponseFields = {
603
+ transactionId: z3.string().min(1),
604
+ refundedAmount: z3.number().int().positive(),
605
+ refundSeq: z3.number().int().positive(),
606
+ providerRefunded: z3.literal(true)
607
+ };
608
+ var cancelOrderReconciliationStatusSchema = z3.enum([
609
+ "paid",
610
+ "preparing",
611
+ "shipped",
612
+ "delivered",
613
+ "confirmed",
614
+ "return_requested",
615
+ "return_processing",
616
+ "returned",
617
+ "refunded"
618
+ ]);
619
+ var cancelOrderResponseSchema = z3.union([
620
+ z3.object({
621
+ ...cancelOrderResponseBaseSchema,
622
+ ...unpaidCancelResponseFields,
623
+ status: z3.literal("canceled"),
624
+ cancelCommitted: z3.literal(true)
625
+ }).strict(),
626
+ z3.object({
627
+ ...cancelOrderResponseBaseSchema,
628
+ ...providerRefundResponseFields,
629
+ status: z3.literal("canceled"),
630
+ cancelCommitted: z3.literal(true)
631
+ }).strict(),
632
+ z3.object({
633
+ ...cancelOrderResponseBaseSchema,
634
+ ...alreadyCanceledResponseFields,
635
+ status: z3.literal("canceled"),
636
+ cancelCommitted: z3.literal(false),
637
+ alreadyCanceled: z3.literal(true)
638
+ }).strict(),
639
+ z3.object({
640
+ ...cancelOrderResponseBaseSchema,
641
+ ...providerRefundResponseFields,
642
+ status: cancelOrderReconciliationStatusSchema,
643
+ cancelCommitted: z3.literal(false),
644
+ reconciliationRequired: z3.literal(true)
645
+ }).strict()
646
+ ]);
415
647
 
416
648
  // ../../packages/contracts/src/mcp/index.ts
417
649
  var MCP_TOOL_CONTRACT = {
@@ -520,6 +752,11 @@ var MCP_TOOL_CONTRACT = {
520
752
  oauthScope: "mcp:write",
521
753
  readOnly: false
522
754
  },
755
+ "cancel-order": {
756
+ consoleRole: "tenant-admin",
757
+ oauthScope: "mcp:write",
758
+ readOnly: false
759
+ },
523
760
  "update-order": {
524
761
  consoleRole: "tenant-admin",
525
762
  oauthScope: "mcp:write",
@@ -778,6 +1015,14 @@ var TOOL_POLICY_MANIFEST = {
778
1015
  annotationPolicy: DESTRUCTIVE_IDEMPOTENT_MUTATION_ANNOTATION,
779
1016
  exemptionReason: REASON_IDEMPOTENT_DESTRUCTIVE_UPDATE
780
1017
  },
1018
+ "cancel-order": {
1019
+ category: "mutation-order",
1020
+ oauthScope: MCP_SCOPES.write,
1021
+ consoleRole: "tenant-admin",
1022
+ consoleSurface: "POST /api/orders/cancel",
1023
+ annotationPolicy: DESTRUCTIVE_IDEMPOTENT_MUTATION_ANNOTATION,
1024
+ exemptionReason: REASON_IDEMPOTENT_DESTRUCTIVE_UPDATE
1025
+ },
781
1026
  "update-order": {
782
1027
  category: "mutation-order",
783
1028
  oauthScope: MCP_SCOPES.write,
@@ -1233,7 +1478,7 @@ async function swallow(promise) {
1233
1478
  }
1234
1479
 
1235
1480
  // src/tools/query-collection.ts
1236
- import { z as z3 } from "zod";
1481
+ import { z as z4 } from "zod";
1237
1482
 
1238
1483
  // src/lib/client.ts
1239
1484
  import { createServerClient } from "@01.software/sdk/server";
@@ -1269,13 +1514,13 @@ function getClient() {
1269
1514
  // src/tools/query-collection.ts
1270
1515
  import { SERVER_COLLECTIONS } from "@01.software/sdk";
1271
1516
  var schema = {
1272
- collection: z3.enum(SERVER_COLLECTIONS).describe("Collection name (required)"),
1273
- where: z3.string().optional().describe(
1517
+ collection: z4.enum(SERVER_COLLECTIONS).describe("Collection name (required)"),
1518
+ where: z4.string().optional().describe(
1274
1519
  `Filter conditions (JSON string, optional). Pass the Payload query condition object as a JSON string. Example: '{"title":{"equals":"Product name"}}'`
1275
1520
  ),
1276
- limit: z3.number().min(1).max(100).default(10).describe("Maximum number of items to return (1-100, default: 10)."),
1277
- page: z3.number().optional().describe("Page number (optional). Starts from 1. Used for pagination."),
1278
- sort: z3.string().regex(
1521
+ limit: z4.number().min(1).max(100).default(10).describe("Maximum number of items to return (1-100, default: 10)."),
1522
+ page: z4.number().optional().describe("Page number (optional). Starts from 1. Used for pagination."),
1523
+ sort: z4.string().regex(
1279
1524
  /^-?[a-zA-Z0-9_.]+$/,
1280
1525
  'Sort must be a field name, optionally prefixed with "-" for descending'
1281
1526
  ).optional().describe(
@@ -1332,11 +1577,11 @@ async function queryCollection({
1332
1577
  }
1333
1578
 
1334
1579
  // src/tools/get-collection-by-id.ts
1335
- import { z as z4 } from "zod";
1580
+ import { z as z5 } from "zod";
1336
1581
  import { SERVER_COLLECTIONS as SERVER_COLLECTIONS2 } from "@01.software/sdk";
1337
1582
  var schema2 = {
1338
- collection: z4.enum(SERVER_COLLECTIONS2).describe("Collection name (required)"),
1339
- id: z4.string().min(1).describe("Item ID (required)")
1583
+ collection: z5.enum(SERVER_COLLECTIONS2).describe("Collection name (required)"),
1584
+ id: z5.string().min(1).describe("Item ID (required)")
1340
1585
  };
1341
1586
  var metadata2 = {
1342
1587
  name: "get-collection-by-id",
@@ -1362,9 +1607,9 @@ async function getCollectionById({
1362
1607
  }
1363
1608
 
1364
1609
  // src/tools/get-order.ts
1365
- import { z as z5 } from "zod";
1610
+ import { z as z6 } from "zod";
1366
1611
  var schema3 = {
1367
- orderNumber: z5.string().min(1).describe("Order number to look up (required)")
1612
+ orderNumber: z6.string().min(1).describe("Order number to look up (required)")
1368
1613
  };
1369
1614
  var metadata3 = {
1370
1615
  name: "get-order",
@@ -1417,10 +1662,10 @@ async function createOrder(params) {
1417
1662
  }
1418
1663
 
1419
1664
  // src/tools/update-order.ts
1420
- import { z as z6 } from "zod";
1665
+ import { z as z7 } from "zod";
1421
1666
  var schema5 = {
1422
- orderNumber: z6.string().min(1).describe("Order number (required)"),
1423
- status: z6.enum([
1667
+ orderNumber: z7.string().min(1).describe("Order number (required)"),
1668
+ status: z7.enum([
1424
1669
  "pending",
1425
1670
  "paid",
1426
1671
  "failed",
@@ -1457,15 +1702,15 @@ async function updateOrder({
1457
1702
  }
1458
1703
 
1459
1704
  // src/tools/checkout.ts
1460
- import { z as z7 } from "zod";
1705
+ import { z as z8 } from "zod";
1461
1706
  var schema6 = {
1462
- cartId: z7.string().min(1).describe("Cart ID to convert to order (required)"),
1463
- pgPaymentId: z7.string().optional().describe("PG payment ID (optional \u2014 omit for free orders)"),
1464
- orderNumber: z7.string().min(1).describe("Unique order number (required)"),
1465
- customerSnapshot: z7.record(z7.string(), z7.unknown()).describe(
1707
+ cartId: z8.string().min(1).describe("Cart ID to convert to order (required)"),
1708
+ pgPaymentId: z8.string().optional().describe("PG payment ID (optional \u2014 omit for free orders)"),
1709
+ orderNumber: z8.string().min(1).describe("Unique order number (required)"),
1710
+ customerSnapshot: z8.record(z8.string(), z8.unknown()).describe(
1466
1711
  "Customer snapshot object (required). Fields: { name?, email, phone? }"
1467
1712
  ),
1468
- discountCode: z7.string().optional().describe("Discount code to apply (optional)")
1713
+ discountCode: z8.string().optional().describe("Discount code to apply (optional)")
1469
1714
  };
1470
1715
  var metadata6 = {
1471
1716
  name: "checkout",
@@ -1490,17 +1735,17 @@ async function checkout(params) {
1490
1735
  }
1491
1736
 
1492
1737
  // src/tools/create-fulfillment.ts
1493
- import { z as z8 } from "zod";
1738
+ import { z as z9 } from "zod";
1494
1739
  var schema7 = {
1495
- orderNumber: z8.string().min(1).describe("Order number (required)"),
1496
- carrier: z8.string().optional().describe("Shipping carrier name (optional)"),
1497
- trackingNumber: z8.string().optional().describe(
1740
+ orderNumber: z9.string().min(1).describe("Order number (required)"),
1741
+ carrier: z9.string().optional().describe("Shipping carrier name (optional)"),
1742
+ trackingNumber: z9.string().optional().describe(
1498
1743
  'Tracking number (optional). Setting carrier + tracking triggers "shipped" status'
1499
1744
  ),
1500
- items: z8.array(
1501
- z8.object({
1502
- orderItem: z8.string().min(1).describe("Order item ID"),
1503
- quantity: z8.number().int().positive().describe("Quantity to fulfill")
1745
+ items: z9.array(
1746
+ z9.object({
1747
+ orderItem: z9.string().min(1).describe("Order item ID"),
1748
+ quantity: z9.number().int().positive().describe("Quantity to fulfill")
1504
1749
  })
1505
1750
  ).describe("Array of items to fulfill (required)")
1506
1751
  };
@@ -1535,16 +1780,16 @@ async function createFulfillment({
1535
1780
  }
1536
1781
 
1537
1782
  // src/tools/update-fulfillment.ts
1538
- import { z as z9 } from "zod";
1783
+ import { z as z10 } from "zod";
1539
1784
  var schema8 = {
1540
- fulfillmentId: z9.string().min(1).describe("Fulfillment ID (required)"),
1541
- status: z9.enum(["packed", "shipped", "delivered", "failed"]).describe(
1785
+ fulfillmentId: z10.string().min(1).describe("Fulfillment ID (required)"),
1786
+ status: z10.enum(["packed", "shipped", "delivered", "failed"]).describe(
1542
1787
  "New fulfillment status (required). FSM: pending\u2192packed/shipped/failed, packed\u2192shipped/failed, shipped\u2192delivered/failed"
1543
1788
  ),
1544
- carrier: z9.string().optional().describe(
1789
+ carrier: z10.string().optional().describe(
1545
1790
  "Shipping carrier (optional, changeable only in pending/packed status)"
1546
1791
  ),
1547
- trackingNumber: z9.string().optional().describe(
1792
+ trackingNumber: z10.string().optional().describe(
1548
1793
  "Tracking number (optional, changeable only in pending/packed status)"
1549
1794
  )
1550
1795
  };
@@ -1638,21 +1883,54 @@ async function confirmPayment(params) {
1638
1883
  }
1639
1884
  }
1640
1885
 
1886
+ // src/tools/cancel-order.ts
1887
+ var CancelOrderToolSchema = CancelOrderSchema.extend({
1888
+ idempotencyKey: idempotencyKeySchema.optional().describe(
1889
+ "Optional X-Idempotency-Key forwarded to the Console cancel endpoint"
1890
+ )
1891
+ }).strict();
1892
+ var schema11 = CancelOrderToolSchema.shape;
1893
+ var metadata11 = {
1894
+ name: "cancel-order",
1895
+ 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.",
1896
+ annotations: {
1897
+ title: "Cancel order",
1898
+ readOnlyHint: false,
1899
+ destructiveHint: true,
1900
+ idempotentHint: true
1901
+ }
1902
+ };
1903
+ async function cancelOrder(params) {
1904
+ try {
1905
+ const parsed = CancelOrderToolSchema.parse(params);
1906
+ const client = getClient();
1907
+ const result = await client.commerce.orders.cancelOrder({
1908
+ orderNumber: parsed.orderNumber,
1909
+ reasonCode: parsed.reasonCode,
1910
+ reasonDetail: parsed.reasonDetail,
1911
+ idempotencyKey: parsed.idempotencyKey
1912
+ });
1913
+ return toolSuccess({ data: result });
1914
+ } catch (error) {
1915
+ return toolError(error);
1916
+ }
1917
+ }
1918
+
1641
1919
  // src/tools/create-return.ts
1642
- import { z as z10 } from "zod";
1643
- var schema11 = {
1644
- orderNumber: z10.string().min(1).describe("Order number (required)"),
1645
- reason: z10.enum(["change_of_mind", "defective", "wrong_delivery", "damaged", "other"]).optional().describe("Return reason (optional)"),
1646
- reasonDetail: z10.string().optional().describe("Detailed reason text (optional)"),
1647
- returnItems: z10.array(
1648
- z10.object({
1649
- orderItem: z10.string().min(1).describe("Order item ID"),
1650
- quantity: z10.number().int().positive().describe("Quantity to return")
1920
+ import { z as z11 } from "zod";
1921
+ var schema12 = {
1922
+ orderNumber: z11.string().min(1).describe("Order number (required)"),
1923
+ reason: z11.enum(["change_of_mind", "defective", "wrong_delivery", "damaged", "other"]).optional().describe("Return reason (optional)"),
1924
+ reasonDetail: z11.string().optional().describe("Detailed reason text (optional)"),
1925
+ returnItems: z11.array(
1926
+ z11.object({
1927
+ orderItem: z11.string().min(1).describe("Order item ID"),
1928
+ quantity: z11.number().int().positive().describe("Quantity to return")
1651
1929
  })
1652
1930
  ).describe("Array of products to return (required)"),
1653
- refundAmount: z10.number().nonnegative().describe("Refund amount (required, min 0)")
1931
+ refundAmount: z11.number().nonnegative().describe("Refund amount (required, min 0)")
1654
1932
  };
1655
- var metadata11 = {
1933
+ var metadata12 = {
1656
1934
  name: "create-return",
1657
1935
  description: "Create a return request for an order. Only works for delivered/confirmed orders. Updates order status to return_requested.",
1658
1936
  annotations: {
@@ -1685,14 +1963,14 @@ async function createReturn({
1685
1963
  }
1686
1964
 
1687
1965
  // src/tools/update-return.ts
1688
- import { z as z11 } from "zod";
1689
- var schema12 = {
1690
- returnId: z11.string().min(1).describe("Return ID (required)"),
1691
- status: z11.enum(["processing", "approved", "rejected", "completed"]).describe(
1966
+ import { z as z12 } from "zod";
1967
+ var schema13 = {
1968
+ returnId: z12.string().min(1).describe("Return ID (required)"),
1969
+ status: z12.enum(["processing", "approved", "rejected", "completed"]).describe(
1692
1970
  "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."
1693
1971
  )
1694
1972
  };
1695
- var metadata12 = {
1973
+ var metadata13 = {
1696
1974
  name: "update-return",
1697
1975
  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.",
1698
1976
  annotations: {
@@ -1719,8 +1997,8 @@ async function updateReturn({
1719
1997
  }
1720
1998
 
1721
1999
  // src/tools/return-with-refund.ts
1722
- var schema13 = ReturnWithRefundSchema.shape;
1723
- var metadata13 = {
2000
+ var schema14 = ReturnWithRefundSchema.shape;
2001
+ var metadata14 = {
1724
2002
  name: "return-with-refund",
1725
2003
  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.",
1726
2004
  annotations: {
@@ -1762,15 +2040,15 @@ async function returnWithRefund({
1762
2040
  }
1763
2041
 
1764
2042
  // src/tools/add-cart-item.ts
1765
- import { z as z12 } from "zod";
1766
- var schema14 = {
1767
- cartId: z12.string().min(1).describe("Cart ID (required)"),
1768
- product: z12.string().min(1).describe("Product ID (required)"),
1769
- variant: z12.string().min(1).describe("Product variant ID (required)"),
1770
- option: z12.string().min(1).describe("Product option ID (required)"),
1771
- quantity: z12.number().int().positive().describe("Quantity to add (required, positive integer)")
2043
+ import { z as z13 } from "zod";
2044
+ var schema15 = {
2045
+ cartId: z13.string().min(1).describe("Cart ID (required)"),
2046
+ product: z13.string().min(1).describe("Product ID (required)"),
2047
+ variant: z13.string().min(1).describe("Product variant ID (required)"),
2048
+ option: z13.string().min(1).describe("Product option ID (required)"),
2049
+ quantity: z13.number().int().positive().describe("Quantity to add (required, positive integer)")
1772
2050
  };
1773
- var metadata14 = {
2051
+ var metadata15 = {
1774
2052
  name: "add-cart-item",
1775
2053
  description: "Add a product to cart. Validates stock, merges quantity if item already exists, recalculates totals.",
1776
2054
  annotations: {
@@ -1803,12 +2081,12 @@ async function addCartItem({
1803
2081
  }
1804
2082
 
1805
2083
  // src/tools/update-cart-item.ts
1806
- import { z as z13 } from "zod";
1807
- var schema15 = {
1808
- cartItemId: z13.string().min(1).describe("Cart item ID (required)"),
1809
- quantity: z13.number().int().positive().describe("New quantity (required, positive integer)")
2084
+ import { z as z14 } from "zod";
2085
+ var schema16 = {
2086
+ cartItemId: z14.string().min(1).describe("Cart item ID (required)"),
2087
+ quantity: z14.number().int().positive().describe("New quantity (required, positive integer)")
1810
2088
  };
1811
- var metadata15 = {
2089
+ var metadata16 = {
1812
2090
  name: "update-cart-item",
1813
2091
  description: "Update cart item quantity. Validates stock availability, recalculates cart totals.",
1814
2092
  annotations: {
@@ -1832,11 +2110,11 @@ async function updateCartItem({
1832
2110
  }
1833
2111
 
1834
2112
  // src/tools/remove-cart-item.ts
1835
- import { z as z14 } from "zod";
1836
- var schema16 = {
1837
- cartItemId: z14.string().min(1).describe("Cart item ID to remove (required)")
2113
+ import { z as z15 } from "zod";
2114
+ var schema17 = {
2115
+ cartItemId: z15.string().min(1).describe("Cart item ID to remove (required)")
1838
2116
  };
1839
- var metadata16 = {
2117
+ var metadata17 = {
1840
2118
  name: "remove-cart-item",
1841
2119
  description: "Remove an item from cart. Recalculates cart totals after removal.",
1842
2120
  annotations: {
@@ -1859,12 +2137,12 @@ async function removeCartItem({
1859
2137
  }
1860
2138
 
1861
2139
  // src/tools/apply-discount.ts
1862
- import { z as z15 } from "zod";
1863
- var schema17 = {
1864
- cartId: z15.string().min(1).describe("Cart ID (required)"),
1865
- discountCode: z15.string().describe("Discount code to apply (required)")
2140
+ import { z as z16 } from "zod";
2141
+ var schema18 = {
2142
+ cartId: z16.string().min(1).describe("Cart ID (required)"),
2143
+ discountCode: z16.string().describe("Discount code to apply (required)")
1866
2144
  };
1867
- var metadata17 = {
2145
+ var metadata18 = {
1868
2146
  name: "apply-discount",
1869
2147
  description: "Apply a discount code to a cart. Validates the code, updates cart totals, and sets free shipping if applicable.",
1870
2148
  annotations: {
@@ -1888,11 +2166,11 @@ async function applyDiscount({
1888
2166
  }
1889
2167
 
1890
2168
  // src/tools/remove-discount.ts
1891
- import { z as z16 } from "zod";
1892
- var schema18 = {
1893
- cartId: z16.string().min(1).describe("Cart ID (required)")
2169
+ import { z as z17 } from "zod";
2170
+ var schema19 = {
2171
+ cartId: z17.string().min(1).describe("Cart ID (required)")
1894
2172
  };
1895
- var metadata18 = {
2173
+ var metadata19 = {
1896
2174
  name: "remove-discount",
1897
2175
  description: "Remove the applied discount code from a cart and recalculate totals.",
1898
2176
  annotations: {
@@ -1915,11 +2193,11 @@ async function removeDiscount({
1915
2193
  }
1916
2194
 
1917
2195
  // src/tools/clear-cart.ts
1918
- import { z as z17 } from "zod";
1919
- var schema19 = {
1920
- cartId: z17.string().min(1).describe("Cart ID (required)")
2196
+ import { z as z18 } from "zod";
2197
+ var schema20 = {
2198
+ cartId: z18.string().min(1).describe("Cart ID (required)")
1921
2199
  };
1922
- var metadata19 = {
2200
+ var metadata20 = {
1923
2201
  name: "clear-cart",
1924
2202
  description: "Remove all items from a cart, reset discount and amounts. Shipping fee is preserved.",
1925
2203
  annotations: {
@@ -1942,12 +2220,12 @@ async function clearCart({
1942
2220
  }
1943
2221
 
1944
2222
  // src/tools/validate-discount.ts
1945
- import { z as z18 } from "zod";
1946
- var schema20 = {
1947
- code: z18.string().describe("Discount code to validate (required)"),
1948
- orderAmount: z18.number().describe("Order amount for validation (required)")
2223
+ import { z as z19 } from "zod";
2224
+ var schema21 = {
2225
+ code: z19.string().describe("Discount code to validate (required)"),
2226
+ orderAmount: z19.number().describe("Order amount for validation (required)")
1949
2227
  };
1950
- var metadata20 = {
2228
+ var metadata21 = {
1951
2229
  name: "validate-discount",
1952
2230
  description: "Validate a discount code. Checks active status, date range, usage limits, minimum order amount, and calculates discount.",
1953
2231
  annotations: {
@@ -1974,13 +2252,13 @@ async function validateDiscount({
1974
2252
  }
1975
2253
 
1976
2254
  // src/tools/calculate-shipping.ts
1977
- import { z as z19 } from "zod";
1978
- var schema21 = {
1979
- shippingPolicyId: z19.string().optional().describe("Shipping policy ID (uses default policy if omitted)"),
1980
- orderAmount: z19.number().describe("Order amount for fee calculation (required)"),
1981
- postalCode: z19.string().optional().describe("Postal code for Jeju surcharge detection (63000-63644)")
2255
+ import { z as z20 } from "zod";
2256
+ var schema22 = {
2257
+ shippingPolicyId: z20.string().optional().describe("Shipping policy ID (uses default policy if omitted)"),
2258
+ orderAmount: z20.number().describe("Order amount for fee calculation (required)"),
2259
+ postalCode: z20.string().optional().describe("Postal code for Jeju surcharge detection (63000-63644)")
1982
2260
  };
1983
- var metadata21 = {
2261
+ var metadata22 = {
1984
2262
  name: "calculate-shipping",
1985
2263
  description: "Calculate shipping fee based on order amount and postal code. Supports free shipping threshold and Jeju surcharge.",
1986
2264
  annotations: {
@@ -2009,18 +2287,18 @@ async function calculateShipping({
2009
2287
  }
2010
2288
 
2011
2289
  // src/tools/stock-check.ts
2012
- import { z as z20 } from "zod";
2013
- var schema22 = {
2014
- items: z20.array(
2015
- z20.object({
2016
- variantId: z20.string().describe("Product variant ID"),
2017
- quantity: z20.number().int().positive().describe("Requested quantity")
2290
+ import { z as z21 } from "zod";
2291
+ var schema23 = {
2292
+ items: z21.array(
2293
+ z21.object({
2294
+ variantId: z21.string().describe("Product variant ID"),
2295
+ quantity: z21.number().int().positive().describe("Requested quantity")
2018
2296
  })
2019
2297
  ).describe(
2020
2298
  "Array of items to check stock for (required, max 100). Each: { variantId, quantity }"
2021
2299
  )
2022
2300
  };
2023
- var metadata22 = {
2301
+ var metadata23 = {
2024
2302
  name: "stock-check",
2025
2303
  description: "Batch check product option stock availability. Returns per-item availability and an allAvailable flag.",
2026
2304
  annotations: {
@@ -2043,12 +2321,12 @@ async function stockCheck({
2043
2321
  }
2044
2322
 
2045
2323
  // src/tools/product-detail.ts
2046
- import { z as z21 } from "zod";
2047
- var schema23 = {
2048
- slug: z21.string().optional().describe("Product slug (one of slug or id required)"),
2049
- id: z21.string().optional().describe("Product id (one of slug or id required)")
2324
+ import { z as z22 } from "zod";
2325
+ var schema24 = {
2326
+ slug: z22.string().optional().describe("Product slug (one of slug or id required)"),
2327
+ id: z22.string().optional().describe("Product id (one of slug or id required)")
2050
2328
  };
2051
- var metadata23 = {
2329
+ var metadata24 = {
2052
2330
  name: "product-detail",
2053
2331
  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.",
2054
2332
  annotations: {
@@ -2076,68 +2354,26 @@ async function productDetail({
2076
2354
  }
2077
2355
 
2078
2356
  // src/tools/product-upsert.ts
2079
- import { z as z22 } from "zod";
2080
- var optionValueSchema = z22.object({
2081
- id: z22.string().optional().describe("Stable existing option-value ID for rename-safe updates"),
2082
- value: z22.string().describe("Display label (e.g. Black, S)"),
2083
- slug: z22.string().optional().describe(
2084
- "Optional compatibility value token. The server generates one from value on create when omitted; not canonical identity."
2357
+ var schema25 = {
2358
+ productId: ProductUpsertObjectSchema.shape.productId.describe(
2359
+ "Existing product id for graph-only updates. Prefer this for an existing product on edit after loading GET /api/products/:id/composer-draft."
2085
2360
  ),
2086
- swatchColor: z22.string().nullable().optional(),
2087
- thumbnail: z22.string().nullable().optional(),
2088
- images: z22.array(z22.string()).optional(),
2089
- metadata: z22.unknown().optional()
2090
- });
2091
- var optionSchema = z22.object({
2092
- id: z22.string().optional().describe("Stable existing option ID for rename-safe updates"),
2093
- title: z22.string().describe("Option name (e.g. Color, Size)"),
2094
- slug: z22.string().optional().describe(
2095
- "Optional compatibility option token. The server generates one from title on create when omitted; not canonical identity."
2361
+ graphRevision: ProductUpsertObjectSchema.shape.graphRevision.describe(
2362
+ "Required when updating a product that already has options or variants on the server. Load from GET /api/products/:id/composer-draft."
2096
2363
  ),
2097
- values: z22.array(optionValueSchema).describe("Allowed option values")
2098
- });
2099
- var variantOptionValueSchema = z22.object({
2100
- valueSlug: z22.string().optional(),
2101
- valueId: z22.string().optional(),
2102
- value: z22.string().optional()
2103
- });
2104
- var variantSchema = z22.object({
2105
- id: z22.string().optional().describe("Existing variant ID for updates"),
2106
- optionValues: z22.union([
2107
- z22.record(z22.string(), z22.union([z22.string(), variantOptionValueSchema])),
2108
- z22.array(z22.string())
2109
- ]).optional().describe(
2110
- "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."
2111
- ),
2112
- sku: z22.string().nullable().optional(),
2113
- title: z22.string().nullable().optional(),
2114
- price: z22.number().nonnegative().describe("Selling price (KRW, min 0)"),
2115
- compareAtPrice: z22.number().nonnegative().nullable().optional(),
2116
- stock: z22.number().int().nonnegative().optional(),
2117
- isUnlimited: z22.boolean().optional(),
2118
- weight: z22.number().nonnegative().nullable().optional(),
2119
- requiresShipping: z22.boolean().optional(),
2120
- barcode: z22.string().nullable().optional(),
2121
- externalId: z22.string().nullable().optional(),
2122
- isActive: z22.boolean().optional(),
2123
- thumbnail: z22.string().nullable().optional(),
2124
- images: z22.array(z22.string()).optional(),
2125
- metadata: z22.unknown().optional()
2126
- });
2127
- var schema24 = {
2128
- product: z22.record(z22.string(), z22.unknown()).describe(
2129
- "Product fields. Include `id` to update an existing product; omit for create (then `title` is required)."
2364
+ product: ProductUpsertObjectSchema.shape.product.describe(
2365
+ "Product document fields for create (`title` required). For existing products, save document fields through Payload/Admin and send productId for graph upsert."
2130
2366
  ),
2131
- options: z22.array(optionSchema).optional().describe(
2132
- "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)."
2367
+ options: ProductUpsertObjectSchema.shape.options.describe(
2368
+ "Full desired option graph. On edit, omitted options are deleted. Include stable option/value IDs for rename-safe updates."
2133
2369
  ),
2134
- variants: z22.array(variantSchema).optional().describe(
2135
- "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)."
2370
+ variants: ProductUpsertObjectSchema.shape.variants.describe(
2371
+ "Full desired variant graph. On edit, omitted variants are deleted or deactivated according to server references. Prefer stable option-value IDs."
2136
2372
  )
2137
2373
  };
2138
- var metadata24 = {
2374
+ var metadata25 = {
2139
2375
  name: "product-upsert",
2140
- 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.",
2376
+ 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.",
2141
2377
  annotations: {
2142
2378
  title: "Upsert product (atomic)",
2143
2379
  readOnlyHint: false,
@@ -2148,9 +2384,13 @@ var metadata24 = {
2148
2384
  };
2149
2385
  async function productUpsert(params) {
2150
2386
  try {
2387
+ const parsed = ProductUpsertSchema.safeParse(params);
2388
+ if (!parsed.success) {
2389
+ return toolError(parsed.error);
2390
+ }
2151
2391
  const client = getClient();
2152
2392
  const result = await client.commerce.product.upsert(
2153
- params
2393
+ parsed.data
2154
2394
  );
2155
2395
  return toolSuccess({ data: result });
2156
2396
  } catch (error) {
@@ -2172,8 +2412,8 @@ async function getCollectionSchema(collection) {
2172
2412
  }
2173
2413
 
2174
2414
  // src/tools/get-collection-schema.ts
2175
- var schema25 = createCollectionSchemaToolInputSchema(SERVER_COLLECTIONS3).shape;
2176
- var metadata25 = {
2415
+ var schema26 = createCollectionSchemaToolInputSchema(SERVER_COLLECTIONS3).shape;
2416
+ var metadata26 = {
2177
2417
  name: "get-collection-schema",
2178
2418
  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.",
2179
2419
  annotations: {
@@ -2224,8 +2464,8 @@ async function getTenantFeatureProgress(feature, includeEvidence = false) {
2224
2464
  }
2225
2465
 
2226
2466
  // src/tools/get-tenant-context.ts
2227
- var schema26 = tenantContextToolInputSchema.shape;
2228
- var metadata26 = {
2467
+ var schema27 = tenantContextToolInputSchema.shape;
2468
+ var metadata27 = {
2229
2469
  name: "get-tenant-context",
2230
2470
  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.",
2231
2471
  annotations: {
@@ -2302,8 +2542,8 @@ async function handler({
2302
2542
  }
2303
2543
 
2304
2544
  // src/tools/check-feature-progress.ts
2305
- var schema27 = tenantFeatureProgressInputSchema.shape;
2306
- var metadata27 = {
2545
+ var schema28 = tenantFeatureProgressInputSchema.shape;
2546
+ var metadata28 = {
2307
2547
  name: "check-feature-progress",
2308
2548
  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.",
2309
2549
  annotations: {
@@ -2349,12 +2589,12 @@ function invalidateFieldConfigCache() {
2349
2589
  }
2350
2590
 
2351
2591
  // src/tools/list-configurable-fields.ts
2352
- var schema28 = {
2592
+ var schema29 = {
2353
2593
  collection: z23.string().optional().describe(
2354
2594
  "Filter by collection slug (optional \u2014 returns all if omitted). Use this filter to reduce response size when you know which collection to check."
2355
2595
  )
2356
2596
  };
2357
- var metadata28 = {
2597
+ var metadata29 = {
2358
2598
  name: "list-configurable-fields",
2359
2599
  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.",
2360
2600
  annotations: {
@@ -2386,7 +2626,7 @@ async function listConfigurableFields(params) {
2386
2626
 
2387
2627
  // src/tools/update-field-config.ts
2388
2628
  import { z as z24 } from "zod";
2389
- var schema29 = {
2629
+ var schema30 = {
2390
2630
  collection: z24.string().min(1).describe("Collection slug (required)"),
2391
2631
  hiddenFields: z24.array(z24.string().min(1).max(200)).max(300).describe(
2392
2632
  "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."
@@ -2395,7 +2635,7 @@ var schema29 = {
2395
2635
  "Hide the entire collection from Admin Panel (optional). When true, individual hiddenFields are irrelevant."
2396
2636
  )
2397
2637
  };
2398
- var metadata29 = {
2638
+ var metadata30 = {
2399
2639
  name: "update-field-config",
2400
2640
  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.",
2401
2641
  annotations: {
@@ -2864,7 +3104,7 @@ function getRecipe(goal, runtime = "both") {
2864
3104
  }
2865
3105
 
2866
3106
  // src/tools/sdk-get-recipe.ts
2867
- var schema30 = {
3107
+ var schema31 = {
2868
3108
  goal: z25.enum([
2869
3109
  "fetch-list",
2870
3110
  "fetch-by-id",
@@ -2881,7 +3121,7 @@ var schema30 = {
2881
3121
  collection: z25.string().optional().describe("Specific collection name if applicable"),
2882
3122
  includeExample: z25.boolean().default(true).describe("Whether to include a full code example")
2883
3123
  };
2884
- var metadata30 = {
3124
+ var metadata31 = {
2885
3125
  name: "sdk-get-recipe",
2886
3126
  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.",
2887
3127
  annotations: {
@@ -3110,11 +3350,11 @@ function searchDocs(query, limit = 5) {
3110
3350
  }
3111
3351
 
3112
3352
  // src/tools/sdk-search-docs.ts
3113
- var schema31 = {
3353
+ var schema32 = {
3114
3354
  query: z26.string().min(2).describe('Search keyword or phrase (e.g. "infinite scroll", "webhook", "customer login")'),
3115
3355
  limit: z26.number().min(1).max(10).default(5).describe("Maximum results to return (1-10, default: 5)")
3116
3356
  };
3117
- var metadata31 = {
3357
+ var metadata32 = {
3118
3358
  name: "sdk-search-docs",
3119
3359
  description: "Search SDK documentation by keyword. Returns matching topics with summaries and resource links. Use when looking for specific SDK features or patterns.",
3120
3360
  annotations: {
@@ -3150,7 +3390,7 @@ function handler4({
3150
3390
 
3151
3391
  // src/tools/sdk-get-auth-setup.ts
3152
3392
  import { z as z27 } from "zod";
3153
- var schema32 = {
3393
+ var schema33 = {
3154
3394
  scenario: z27.enum([
3155
3395
  "browser-client",
3156
3396
  "server-client",
@@ -3160,7 +3400,7 @@ var schema32 = {
3160
3400
  "webhook-verification"
3161
3401
  ]).describe("Authentication scenario")
3162
3402
  };
3163
- var metadata32 = {
3403
+ var metadata33 = {
3164
3404
  name: "sdk-get-auth-setup",
3165
3405
  description: "Get the current authentication setup for a specific scenario. Returns env var names, code snippets, and security notes.",
3166
3406
  annotations: {
@@ -3324,12 +3564,12 @@ function handler5({
3324
3564
  // src/tools/sdk-get-collection-pattern.ts
3325
3565
  import { z as z28 } from "zod";
3326
3566
  import { COLLECTIONS, SERVER_COLLECTIONS as SERVER_COLLECTIONS4 } from "@01.software/sdk";
3327
- var schema33 = {
3567
+ var schema34 = {
3328
3568
  collection: z28.enum(SERVER_COLLECTIONS4).describe("Collection name"),
3329
3569
  operation: z28.enum(["read", "write", "full-crud"]).default("read").describe("What operations are needed"),
3330
3570
  surface: z28.enum(["query-builder", "react-query", "server-api"]).default("query-builder").describe("Preferred API surface")
3331
3571
  };
3332
- var metadata33 = {
3572
+ var metadata34 = {
3333
3573
  name: "sdk-get-collection-pattern",
3334
3574
  description: "Get the recommended CRUD pattern for a specific collection. Returns code examples for the chosen API surface and operation type.",
3335
3575
  annotations: {
@@ -3526,13 +3766,13 @@ function handler6({
3526
3766
 
3527
3767
  // src/prompts/sdk-usage-guide.ts
3528
3768
  import { z as z29 } from "zod";
3529
- var schema34 = {
3769
+ var schema35 = {
3530
3770
  goal: z29.string().describe('What the user wants to accomplish (e.g., "query product list", "create order")'),
3531
3771
  runtime: z29.enum(["browser", "server"]).optional().describe("Target runtime: browser (React/Next.js client) or server (Node.js)"),
3532
3772
  surface: z29.enum(["query-builder", "react-query", "customer-api", "server-api"]).optional().describe("Preferred API surface"),
3533
3773
  collection: z29.string().optional().describe("Specific collection if relevant")
3534
3774
  };
3535
- var metadata34 = {
3775
+ var metadata35 = {
3536
3776
  name: "sdk-usage-guide",
3537
3777
  title: "SDK Usage Guide",
3538
3778
  description: "Provides guidance on how to perform a specific task using the 01.software SDK",
@@ -3706,12 +3946,12 @@ const { allAvailable } = await client.commerce.product.stockCheck({
3706
3946
  // src/prompts/collection-query-help.ts
3707
3947
  import { z as z30 } from "zod";
3708
3948
  import { COLLECTIONS as COLLECTIONS2, SERVER_COLLECTIONS as SERVER_COLLECTIONS5 } from "@01.software/sdk";
3709
- var schema35 = {
3949
+ var schema36 = {
3710
3950
  collection: z30.enum(SERVER_COLLECTIONS5).describe("Collection name"),
3711
3951
  operation: z30.enum(["find", "create", "update", "delete"]).describe("Operation to perform (find, create, update, delete)"),
3712
3952
  filters: z30.string().optional().describe("Filter conditions (JSON string, optional)")
3713
3953
  };
3714
- var metadata35 = {
3954
+ var metadata36 = {
3715
3955
  name: "collection-query-help",
3716
3956
  title: "Collection Query Help",
3717
3957
  description: "Provides guidance on how to write queries for a specific collection",
@@ -3809,15 +4049,16 @@ ${operation === "find" ? `- Use \`where\` option for filtering (Payload query sy
3809
4049
 
3810
4050
  // src/prompts/order-flow-guide.ts
3811
4051
  import { z as z31 } from "zod";
3812
- var schema36 = {
4052
+ var schema37 = {
3813
4053
  scenario: z31.enum([
3814
4054
  "simple-order",
3815
4055
  "cart-checkout",
3816
4056
  "return-refund",
4057
+ "order-cancel",
3817
4058
  "fulfillment-tracking"
3818
4059
  ]).describe("Order flow scenario")
3819
4060
  };
3820
- var metadata36 = {
4061
+ var metadata37 = {
3821
4062
  name: "order-flow-guide",
3822
4063
  title: "Order Flow Guide",
3823
4064
  description: "Provides step-by-step guidance for ecommerce order flows including creation, checkout, returns, and fulfillment.",
@@ -3947,6 +4188,35 @@ await client.commerce.orders.returnWithRefund({
3947
4188
  paymentKey: 'payment_key_xxx'
3948
4189
  })
3949
4190
  \`\`\``,
4191
+ "order-cancel": `## Provider-Verified Order Cancellation
4192
+
4193
+ ### Flow
4194
+
4195
+ 1. **Cancel Order** -> \`cancel-order\` tool
4196
+ - Pending or failed unpaid orders cancel without a provider call
4197
+ - Paid captured orders use the server-stored provider payment key from the captured transaction
4198
+ - Paid captured orders are refunded through the provider-verified path before local status changes
4199
+ - Successful paid cancellation releases reservedStock and moves the order to \`canceled\`
4200
+ - Duplicate local success returns \`alreadyCanceled: true\`; do not issue a second refund
4201
+ - Provider-refunded local blockers return \`reconciliationRequired: true\` on retry
4202
+
4203
+ ### V1 Rejections
4204
+ - Orders with non-failed fulfillments are rejected
4205
+ - \`shipped\`, \`delivered\`, \`confirmed\`, and return-axis orders are rejected
4206
+ - Active returns are rejected; use \`return-with-refund\` after delivery
4207
+ - Partial line-item cancellation and no-refund paid cancellation are not supported in v1
4208
+
4209
+ ### Code Example
4210
+ \`\`\`typescript
4211
+ await client.commerce.orders.cancelOrder({
4212
+ orderNumber: 'ORD-240101-001',
4213
+ reasonCode: 'customer',
4214
+ reasonDetail: 'Customer emailed before shipment',
4215
+ idempotencyKey: 'cancel-ORD-240101-001'
4216
+ })
4217
+ \`\`\`
4218
+
4219
+ If \`reconciliationRequired\` is true, stop provider retries and hand off to an operator to reconcile fulfillment, stock, and accounting manually.`,
3950
4220
  "fulfillment-tracking": `## Fulfillment & Tracking
3951
4221
 
3952
4222
  ### Creating Fulfillment
@@ -4002,13 +4272,13 @@ ${SCENARIOS[scenario] || "Unknown scenario."}
4002
4272
  - \`checkout\`
4003
4273
  - \`create-fulfillment\`, \`update-fulfillment\`
4004
4274
  - \`create-return\`, \`update-return\`, \`return-with-refund\`
4005
- - \`confirm-payment\`, \`update-transaction\`
4275
+ - \`confirm-payment\`, \`cancel-order\`, \`update-transaction\`
4006
4276
  - \`validate-discount\`, \`calculate-shipping\``;
4007
4277
  }
4008
4278
 
4009
4279
  // src/prompts/feature-setup-guide.ts
4010
4280
  import { z as z32 } from "zod";
4011
- var schema37 = {
4281
+ var schema38 = {
4012
4282
  feature: z32.enum([
4013
4283
  "ecommerce",
4014
4284
  "customers",
@@ -4024,7 +4294,7 @@ var schema37 = {
4024
4294
  "community"
4025
4295
  ]).describe("Feature to get setup guide for")
4026
4296
  };
4027
- var metadata37 = {
4297
+ var metadata38 = {
4028
4298
  name: "feature-setup-guide",
4029
4299
  title: "Feature Setup Guide",
4030
4300
  description: "Setup checklist and remediation guide for a tenant feature. Load with check-feature-progress and get-tenant-context to diagnose setup gaps.",
@@ -4232,7 +4502,7 @@ ${FEATURES[feature] || "Unknown feature."}
4232
4502
  }
4233
4503
 
4234
4504
  // src/resources/(config)/app.ts
4235
- var metadata38 = {
4505
+ var metadata39 = {
4236
4506
  name: "app-config",
4237
4507
  title: "Application Config",
4238
4508
  description: "01.software SDK and MCP server configuration information"
@@ -4298,7 +4568,7 @@ Rate limits depend on your tenant plan:
4298
4568
 
4299
4569
  // src/resources/(collections)/schema.ts
4300
4570
  import { COLLECTIONS as COLLECTIONS3 } from "@01.software/sdk";
4301
- var metadata39 = {
4571
+ var metadata40 = {
4302
4572
  name: "collections-schema",
4303
4573
  title: "Collection Schema Info",
4304
4574
  description: "Available collections and their schema information"
@@ -4435,7 +4705,7 @@ Total available collections: ${COLLECTIONS3.length}`;
4435
4705
  }
4436
4706
 
4437
4707
  // src/resources/(docs)/getting-started.ts
4438
- var metadata40 = {
4708
+ var metadata41 = {
4439
4709
  name: "docs-getting-started",
4440
4710
  title: "Getting Started",
4441
4711
  description: "01.software SDK getting started guide"
@@ -4496,7 +4766,7 @@ const result = await client.collections.from('products').find({
4496
4766
  }
4497
4767
 
4498
4768
  // src/resources/(docs)/guides.ts
4499
- var metadata41 = {
4769
+ var metadata42 = {
4500
4770
  name: "docs-guides",
4501
4771
  title: "Guides",
4502
4772
  description: "01.software SDK usage guides"
@@ -4709,7 +4979,7 @@ For more implementation guidance, see the [SDK Guide](/developers/sdk).`;
4709
4979
  }
4710
4980
 
4711
4981
  // src/resources/(docs)/api.ts
4712
- var metadata42 = {
4982
+ var metadata43 = {
4713
4983
  name: "docs-api",
4714
4984
  title: "API Reference",
4715
4985
  description: "01.software SDK API reference documentation"
@@ -4992,7 +5262,7 @@ For more details, see the [API documentation](/developers/api).`;
4992
5262
  }
4993
5263
 
4994
5264
  // src/resources/(docs)/query-builder.ts
4995
- var metadata43 = {
5265
+ var metadata44 = {
4996
5266
  name: "docs-query-builder",
4997
5267
  title: "Query Builder",
4998
5268
  description: "01.software SDK Query Builder API reference (client.collections.from)"
@@ -5186,7 +5456,7 @@ console.log(result.hasNextPage) // true
5186
5456
  }
5187
5457
 
5188
5458
  // src/resources/(docs)/react-query.ts
5189
- var metadata44 = {
5459
+ var metadata45 = {
5190
5460
  name: "docs-react-query",
5191
5461
  title: "React Query Hooks",
5192
5462
  description: "01.software SDK React Query hooks reference (@01.software/sdk/query)"
@@ -5418,7 +5688,7 @@ export function ProductList() {
5418
5688
  }
5419
5689
 
5420
5690
  // src/resources/(docs)/server-api.ts
5421
- var metadata45 = {
5691
+ var metadata46 = {
5422
5692
  name: "docs-server-api",
5423
5693
  title: "Server-side API",
5424
5694
  description: "01.software SDK server-side API reference (client.commerce) for orders, fulfillments, returns, carts, and validation"
@@ -5702,7 +5972,7 @@ const result = await client.commerce.shipping.calculate({
5702
5972
  }
5703
5973
 
5704
5974
  // src/resources/(docs)/customer-auth.ts
5705
- var metadata46 = {
5975
+ var metadata47 = {
5706
5976
  name: "docs-customer-auth",
5707
5977
  title: "Customer Auth API",
5708
5978
  description: "01.software SDK Customer Auth API reference (client.customer)"
@@ -5880,7 +6150,7 @@ async function loadProfile() {
5880
6150
  }
5881
6151
 
5882
6152
  // src/resources/(docs)/browser-vs-server.ts
5883
- var metadata47 = {
6153
+ var metadata48 = {
5884
6154
  name: "docs-browser-vs-server",
5885
6155
  title: "Client vs ServerClient",
5886
6156
  description: "When to use Client (createClient) vs ServerClient (createServerClient) in the 01.software SDK"
@@ -6046,7 +6316,7 @@ export function ProductList() {
6046
6316
  }
6047
6317
 
6048
6318
  // src/resources/(docs)/file-upload.ts
6049
- var metadata48 = {
6319
+ var metadata49 = {
6050
6320
  name: "docs-file-upload",
6051
6321
  title: "File Upload",
6052
6322
  description: "01.software SDK file upload patterns using the images collection"
@@ -6197,7 +6467,7 @@ The platform stores files in Cloudflare R2 and serves via CDN (\`cdn.01.software
6197
6467
  }
6198
6468
 
6199
6469
  // src/resources/(docs)/webhook.ts
6200
- var metadata49 = {
6470
+ var metadata50 = {
6201
6471
  name: "docs-webhook",
6202
6472
  title: "Webhooks",
6203
6473
  description: "01.software SDK webhook verification and event handling"
@@ -6461,7 +6731,7 @@ Configure webhook URLs in the 01.software console under Tenant Settings > Webhoo
6461
6731
  }
6462
6732
 
6463
6733
  // src/resources/(docs)/product-detail.ts
6464
- var metadata50 = {
6734
+ var metadata51 = {
6465
6735
  name: "docs-product-detail",
6466
6736
  title: "Product Detail Helper",
6467
6737
  description: "01.software SDK commerce.product.detail helper guide"
@@ -6571,7 +6841,7 @@ function runtimeAnnotationsFor(meta) {
6571
6841
  openWorldHint: policy.annotationPolicy.openWorld
6572
6842
  };
6573
6843
  }
6574
- function registerTool(server, schema38, meta, handler21) {
6844
+ function registerTool(server, schema39, meta, handler21) {
6575
6845
  let registered = REGISTERED_TOOLS_BY_SERVER.get(server);
6576
6846
  if (!registered) {
6577
6847
  registered = /* @__PURE__ */ new Set();
@@ -6582,7 +6852,7 @@ function registerTool(server, schema38, meta, handler21) {
6582
6852
  meta.name,
6583
6853
  {
6584
6854
  description: meta.description,
6585
- inputSchema: schema38,
6855
+ inputSchema: schema39,
6586
6856
  annotations: runtimeAnnotationsFor(meta)
6587
6857
  },
6588
6858
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -6632,13 +6902,13 @@ function registerTool(server, schema38, meta, handler21) {
6632
6902
  }
6633
6903
  );
6634
6904
  }
6635
- function registerPrompt(server, schema38, meta, handler21) {
6905
+ function registerPrompt(server, schema39, meta, handler21) {
6636
6906
  server.registerPrompt(
6637
6907
  meta.name,
6638
6908
  {
6639
6909
  title: meta.title,
6640
6910
  description: meta.description,
6641
- argsSchema: schema38
6911
+ argsSchema: schema39
6642
6912
  },
6643
6913
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6644
6914
  (params) => ({
@@ -6712,230 +6982,231 @@ function createServer(options = {}) {
6712
6982
  metadata10,
6713
6983
  confirmPayment
6714
6984
  );
6715
- registerTool(
6716
- server,
6717
- schema11,
6718
- metadata11,
6719
- createReturn
6720
- );
6985
+ registerTool(server, schema11, metadata11, cancelOrder);
6721
6986
  registerTool(
6722
6987
  server,
6723
6988
  schema12,
6724
6989
  metadata12,
6725
- updateReturn
6990
+ createReturn
6726
6991
  );
6727
6992
  registerTool(
6728
6993
  server,
6729
6994
  schema13,
6730
6995
  metadata13,
6731
- returnWithRefund
6996
+ updateReturn
6732
6997
  );
6733
- registerTool(server, schema14, metadata14, addCartItem);
6734
6998
  registerTool(
6735
6999
  server,
6736
- schema15,
6737
- metadata15,
6738
- updateCartItem
7000
+ schema14,
7001
+ metadata14,
7002
+ returnWithRefund
6739
7003
  );
7004
+ registerTool(server, schema15, metadata15, addCartItem);
6740
7005
  registerTool(
6741
7006
  server,
6742
7007
  schema16,
6743
7008
  metadata16,
6744
- removeCartItem
7009
+ updateCartItem
6745
7010
  );
6746
7011
  registerTool(
6747
7012
  server,
6748
7013
  schema17,
6749
7014
  metadata17,
6750
- applyDiscount
7015
+ removeCartItem
6751
7016
  );
6752
7017
  registerTool(
6753
7018
  server,
6754
7019
  schema18,
6755
7020
  metadata18,
6756
- removeDiscount
7021
+ applyDiscount
6757
7022
  );
6758
- registerTool(server, schema19, metadata19, clearCart);
6759
7023
  registerTool(
6760
7024
  server,
6761
- schema20,
6762
- metadata20,
6763
- validateDiscount
7025
+ schema19,
7026
+ metadata19,
7027
+ removeDiscount
6764
7028
  );
7029
+ registerTool(server, schema20, metadata20, clearCart);
6765
7030
  registerTool(
6766
7031
  server,
6767
7032
  schema21,
6768
7033
  metadata21,
6769
- calculateShipping
7034
+ validateDiscount
6770
7035
  );
6771
- registerTool(server, schema22, metadata22, stockCheck);
6772
7036
  registerTool(
6773
7037
  server,
6774
- schema23,
6775
- metadata23,
6776
- productDetail
7038
+ schema22,
7039
+ metadata22,
7040
+ calculateShipping
6777
7041
  );
7042
+ registerTool(server, schema23, metadata23, stockCheck);
6778
7043
  registerTool(
6779
7044
  server,
6780
7045
  schema24,
6781
7046
  metadata24,
7047
+ productDetail
7048
+ );
7049
+ registerTool(
7050
+ server,
7051
+ schema25,
7052
+ metadata25,
6782
7053
  productUpsert
6783
7054
  );
6784
7055
  }
6785
- registerTool(
6786
- server,
6787
- schema25,
6788
- metadata25,
6789
- getCollectionSchemaTool
6790
- );
6791
7056
  registerTool(
6792
7057
  server,
6793
7058
  schema26,
6794
7059
  metadata26,
6795
- handler
7060
+ getCollectionSchemaTool
6796
7061
  );
6797
7062
  registerTool(
6798
7063
  server,
6799
7064
  schema27,
6800
7065
  metadata27,
6801
- handler2
7066
+ handler
6802
7067
  );
6803
7068
  registerTool(
6804
7069
  server,
6805
7070
  schema28,
6806
7071
  metadata28,
6807
- listConfigurableFields
7072
+ handler2
6808
7073
  );
6809
7074
  registerTool(
6810
7075
  server,
6811
7076
  schema29,
6812
7077
  metadata29,
6813
- updateFieldConfig
7078
+ listConfigurableFields
6814
7079
  );
6815
7080
  registerTool(
6816
7081
  server,
6817
7082
  schema30,
6818
7083
  metadata30,
6819
- handler3
7084
+ updateFieldConfig
6820
7085
  );
6821
7086
  registerTool(
6822
7087
  server,
6823
7088
  schema31,
6824
7089
  metadata31,
6825
- handler4
7090
+ handler3
6826
7091
  );
6827
7092
  registerTool(
6828
7093
  server,
6829
7094
  schema32,
6830
7095
  metadata32,
6831
- handler5
7096
+ handler4
6832
7097
  );
6833
7098
  registerTool(
6834
7099
  server,
6835
7100
  schema33,
6836
7101
  metadata33,
6837
- handler6
7102
+ handler5
6838
7103
  );
6839
- registerPrompt(
7104
+ registerTool(
6840
7105
  server,
6841
7106
  schema34,
6842
7107
  metadata34,
6843
- sdkUsageGuide
7108
+ handler6
6844
7109
  );
6845
7110
  registerPrompt(
6846
7111
  server,
6847
7112
  schema35,
6848
7113
  metadata35,
6849
- collectionQueryHelp
7114
+ sdkUsageGuide
6850
7115
  );
6851
7116
  registerPrompt(
6852
7117
  server,
6853
7118
  schema36,
6854
7119
  metadata36,
6855
- orderFlowGuide
7120
+ collectionQueryHelp
6856
7121
  );
6857
7122
  registerPrompt(
6858
7123
  server,
6859
7124
  schema37,
6860
7125
  metadata37,
7126
+ orderFlowGuide
7127
+ );
7128
+ registerPrompt(
7129
+ server,
7130
+ schema38,
7131
+ metadata38,
6861
7132
  featureSetupGuide
6862
7133
  );
6863
7134
  registerStaticResource(
6864
7135
  server,
6865
7136
  mcpResourceUri("app-config"),
6866
- metadata38,
7137
+ metadata39,
6867
7138
  handler7
6868
7139
  );
6869
7140
  registerStaticResource(
6870
7141
  server,
6871
7142
  mcpResourceUri("collections-schema"),
6872
- metadata39,
7143
+ metadata40,
6873
7144
  handler8
6874
7145
  );
6875
7146
  registerStaticResource(
6876
7147
  server,
6877
7148
  mcpResourceUri("docs-getting-started"),
6878
- metadata40,
7149
+ metadata41,
6879
7150
  handler9
6880
7151
  );
6881
7152
  registerStaticResource(
6882
7153
  server,
6883
7154
  mcpResourceUri("docs-guides"),
6884
- metadata41,
7155
+ metadata42,
6885
7156
  handler10
6886
7157
  );
6887
7158
  registerStaticResource(
6888
7159
  server,
6889
7160
  mcpResourceUri("docs-api"),
6890
- metadata42,
7161
+ metadata43,
6891
7162
  handler11
6892
7163
  );
6893
7164
  registerStaticResource(
6894
7165
  server,
6895
7166
  mcpResourceUri("docs-query-builder"),
6896
- metadata43,
7167
+ metadata44,
6897
7168
  handler12
6898
7169
  );
6899
7170
  registerStaticResource(
6900
7171
  server,
6901
7172
  mcpResourceUri("docs-react-query"),
6902
- metadata44,
7173
+ metadata45,
6903
7174
  handler13
6904
7175
  );
6905
7176
  registerStaticResource(
6906
7177
  server,
6907
7178
  mcpResourceUri("docs-server-api"),
6908
- metadata45,
7179
+ metadata46,
6909
7180
  handler14
6910
7181
  );
6911
7182
  registerStaticResource(
6912
7183
  server,
6913
7184
  mcpResourceUri("docs-customer-auth"),
6914
- metadata46,
7185
+ metadata47,
6915
7186
  handler15
6916
7187
  );
6917
7188
  registerStaticResource(
6918
7189
  server,
6919
7190
  mcpResourceUri("docs-browser-vs-server"),
6920
- metadata47,
7191
+ metadata48,
6921
7192
  handler16
6922
7193
  );
6923
7194
  registerStaticResource(
6924
7195
  server,
6925
7196
  mcpResourceUri("docs-file-upload"),
6926
- metadata48,
7197
+ metadata49,
6927
7198
  handler17
6928
7199
  );
6929
7200
  registerStaticResource(
6930
7201
  server,
6931
7202
  mcpResourceUri("docs-webhook"),
6932
- metadata49,
7203
+ metadata50,
6933
7204
  handler18
6934
7205
  );
6935
7206
  registerStaticResource(
6936
7207
  server,
6937
7208
  mcpResourceUri("docs-product-detail"),
6938
- metadata50,
7209
+ metadata51,
6939
7210
  handler19
6940
7211
  );
6941
7212
  return server;