@fortrip/agent-contract 6.4.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,8 @@ The contract of Fortrip API v1 (`https://api.fortrip.ai/v1`) and its MCP
4
4
  server (`https://mcp.fortrip.ai/`): the limits, paths, request and response
5
5
  schemas, error codes and field rules that the Fortrip CLI (`fortrip`), the
6
6
  hosted MCP server and the store listings all share, so they cannot drift
7
- apart.
7
+ apart. The API it describes is documented at
8
+ [docs.fortrip.ai](https://docs.fortrip.ai).
8
9
 
9
10
  It has one peer dependency, `zod` (`^4.4.0`), and runs anywhere
10
11
  ES2023 does. Its major version changes when the contract breaks, not with
package/dist/index.d.ts CHANGED
@@ -24,7 +24,7 @@ declare const CARD_NUMBER_MESSAGE = "This looks like a payment card number. Paym
24
24
  */
25
25
  declare function containsCardNumber(text: string, minDigits?: number): boolean;
26
26
 
27
- type ToolName = "search_hotels" | "get_hotel" | "get_hotel_offers" | "create_order" | "get_order" | "list_orders" | "cancel_order" | "pay_order";
27
+ type ToolName = "search_hotels" | "get_hotel" | "get_hotel_offers" | "request_price_match" | "get_price_match" | "create_order" | "get_order" | "list_orders" | "cancel_order" | "pay_order";
28
28
  interface ToolSpec {
29
29
  name: ToolName;
30
30
  title: string;
@@ -198,7 +198,7 @@ interface CommandSpec {
198
198
  /** The group it is typed after; `null` for a command typed on its own. */
199
199
  group: CommandGroupSpec["name"] | null;
200
200
  /** Unique within its group. */
201
- name: "search" | "get" | "offers" | "create" | "list" | "cancel" | "pay" | "login" | "logout" | "whoami" | "mcp";
201
+ name: "search" | "get" | "offers" | "price-match" | "price-match-status" | "create" | "list" | "cancel" | "pay" | "login" | "logout" | "whoami" | "mcp";
202
202
  summary: string;
203
203
  /** The MCP tool the command mirrors; `null` for one that is the CLI's own. */
204
204
  tool: ToolName | null;
@@ -220,6 +220,8 @@ declare const GLOBAL_FLAGS: readonly OptionSpec[];
220
220
  declare const hotelId: z.ZodString;
221
221
  declare const offerId: z.ZodString;
222
222
  declare const orderId: z.ZodString;
223
+ /** A price-match check, from the moment it starts. */
224
+ declare const claimId: z.ZodString;
223
225
  /** `plc_` plus the GeoNames id in decimal (1 to 12 digits). */
224
226
  declare const placeId: z.ZodString;
225
227
 
@@ -236,6 +238,12 @@ declare const money: z.ZodType<Money>;
236
238
  * advice.
237
239
  */
238
240
  declare function requestMoney(name: string, currencies?: readonly [string, ...string[]], otherCurrency?: string): z.ZodType<Money, Money>;
241
+ /**
242
+ * A Money a caller states from elsewhere, such as a price the user saw on
243
+ * another site: no unknown fields, in any currency, its code upper case.
244
+ * `name` is the field it is the value of, which the refusal names.
245
+ */
246
+ declare function statedMoney(name: string): z.ZodType<Money, Money>;
239
247
  declare function formatMoney(m: Money): string;
240
248
 
241
249
  /** An object that keeps fields it does not know. */
@@ -619,6 +627,25 @@ declare const payOrderInput: z.ZodObject<{
619
627
  total: z.ZodType<Money, Money, z.core.$ZodTypeInternals<Money, Money>>;
620
628
  }, z.core.$strict>;
621
629
  type PayOrderInput = z.input<typeof payOrderInput>;
630
+ /** `POST /v1/price-matches` and the MCP `request_price_match` arguments:
631
+ * the offer, the other site as the user named it, and what else the user
632
+ * gave of what they saw there. */
633
+ declare const requestPriceMatchInput: z.ZodObject<{
634
+ offerId: z.ZodString;
635
+ site: z.ZodString;
636
+ link: z.ZodOptional<z.ZodString>;
637
+ seenTotal: z.ZodOptional<z.ZodType<Money, Money, z.core.$ZodTypeInternals<Money, Money>>>;
638
+ locale: z.ZodOptional<z.ZodEnum<{
639
+ en: "en";
640
+ zh: "zh";
641
+ }>>;
642
+ }, z.core.$strict>;
643
+ type RequestPriceMatchInput = z.input<typeof requestPriceMatchInput>;
644
+ /** `GET /v1/price-matches/{claimId}` and the MCP `get_price_match` arguments. */
645
+ declare const getPriceMatchInput: z.ZodObject<{
646
+ claimId: z.ZodString;
647
+ }, z.core.$strict>;
648
+ type GetPriceMatchInput = z.input<typeof getPriceMatchInput>;
622
649
 
623
650
  /** The ceilings and floors every agent surface enforces and documents (spec §15). */
624
651
  declare const LIMITS: {
@@ -1233,7 +1260,7 @@ declare const ERROR_DETAILS: {
1233
1260
  currency: z.ZodString;
1234
1261
  }, z.core.$strip>;
1235
1262
  rate_limited: z.ZodObject<{
1236
- rateLimit: z.ZodType<"search" | "hotel" | (string & {}) | "offers" | "orders_read" | "orders_create" | "orders_cancel" | "orders_pay", unknown, z.core.$ZodTypeInternals<"search" | "hotel" | (string & {}) | "offers" | "orders_read" | "orders_create" | "orders_cancel" | "orders_pay", unknown>>;
1263
+ rateLimit: z.ZodType<"search" | "hotel" | (string & {}) | "offers" | "orders_read" | "orders_create" | "orders_cancel" | "orders_pay" | "price_match", unknown, z.core.$ZodTypeInternals<"search" | "hotel" | (string & {}) | "offers" | "orders_read" | "orders_create" | "orders_cancel" | "orders_pay" | "price_match", unknown>>;
1237
1264
  }, z.core.$strip>;
1238
1265
  ordering_paused: null;
1239
1266
  service_unavailable: null;
@@ -2274,6 +2301,63 @@ declare const offerChange: z.ZodType<OpenUnionOutput<"field", readonly [z.ZodObj
2274
2301
  }, z.core.$strip>]>, unknown>>;
2275
2302
  type OfferChange = z.infer<typeof offerChange>;
2276
2303
 
2304
+ /** `checking`: the other site is being checked. `matched`: a new offer
2305
+ * whose total, with Fortrip's own fees paid at the hotel, is the other
2306
+ * site's total. `partial`: a new offer below ours that stops short of the
2307
+ * other site's total. `declined`: no new offer, and why. */
2308
+ declare const PRICE_MATCH_STATES: readonly ["checking", "matched", "partial", "declined"];
2309
+ type PriceMatchState = (typeof PRICE_MATCH_STATES)[number];
2310
+ /** Why a price match gave no new offer. */
2311
+ declare const PRICE_MATCH_REASONS: readonly ["not_lower", "not_offered", "site_unreadable", "site_not_credible", "unsupported", "daily_limit", "monthly_limit", "unfinished", "unavailable"];
2312
+ type PriceMatchReason = (typeof PRICE_MATCH_REASONS)[number];
2313
+ /** Where a price seen was read: the site's own page, or price data for
2314
+ * that site when its page could not be read. */
2315
+ declare const PRICE_SOURCES: readonly ["site", "data"];
2316
+ /** A price the check saw on the other site. */
2317
+ declare const priceSeen: z.ZodObject<{
2318
+ site: z.ZodString;
2319
+ total: z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>;
2320
+ via: z.ZodType<"site" | (string & {}) | "data", unknown, z.core.$ZodTypeInternals<"site" | (string & {}) | "data", unknown>>;
2321
+ room: z.ZodOptional<z.ZodString>;
2322
+ terms: z.ZodOptional<z.ZodString>;
2323
+ }, z.core.$strip>;
2324
+ /** The new offer a match gives: the original offer at a lower total. */
2325
+ declare const matchedOffer: z.ZodObject<{
2326
+ offerId: z.ZodString;
2327
+ total: z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>;
2328
+ expiresAt: z.ZodString;
2329
+ saved: z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>;
2330
+ }, z.core.$strip>;
2331
+ declare const priceMatch: z.ZodObject<{
2332
+ state: z.ZodType<(string & {}) | "matched" | "partial" | "checking" | "declined", unknown, z.core.$ZodTypeInternals<(string & {}) | "matched" | "partial" | "checking" | "declined", unknown>>;
2333
+ offerId: z.ZodString;
2334
+ site: z.ZodString;
2335
+ ourTotal: z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>;
2336
+ claimId: z.ZodOptional<z.ZodString>;
2337
+ progressUrl: z.ZodOptional<z.ZodString>;
2338
+ checkAgainAfterSeconds: z.ZodOptional<z.ZodNumber>;
2339
+ step: z.ZodOptional<z.ZodString>;
2340
+ seen: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
2341
+ site: z.ZodString;
2342
+ total: z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>;
2343
+ via: z.ZodType<"site" | (string & {}) | "data", unknown, z.core.$ZodTypeInternals<"site" | (string & {}) | "data", unknown>>;
2344
+ room: z.ZodOptional<z.ZodString>;
2345
+ terms: z.ZodOptional<z.ZodString>;
2346
+ }, z.core.$strip>>>>;
2347
+ matchedOffer: z.ZodOptional<z.ZodObject<{
2348
+ offerId: z.ZodString;
2349
+ total: z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>;
2350
+ expiresAt: z.ZodString;
2351
+ saved: z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>;
2352
+ }, z.core.$strip>>;
2353
+ otherTotal: z.ZodOptional<z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>>;
2354
+ ourFeesAtProperty: z.ZodOptional<z.ZodType<Money, unknown, z.core.$ZodTypeInternals<Money, unknown>>>;
2355
+ reason: z.ZodOptional<z.ZodType<(string & {}) | "unavailable" | "not_lower" | "not_offered" | "site_unreadable" | "site_not_credible" | "unsupported" | "daily_limit" | "monthly_limit" | "unfinished", unknown, z.core.$ZodTypeInternals<(string & {}) | "unavailable" | "not_lower" | "not_offered" | "site_unreadable" | "site_not_credible" | "unsupported" | "daily_limit" | "monthly_limit" | "unfinished", unknown>>>;
2356
+ note: z.ZodOptional<z.ZodString>;
2357
+ propertyFeeLeftOut: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
2358
+ }, z.core.$strip>;
2359
+ type PriceMatch = z.infer<typeof priceMatch>;
2360
+
2277
2361
  declare const PLACE_KINDS: readonly ["country", "region", "district", "settlement", "neighbourhood", "island"];
2278
2362
  /** A place named in passing: its id and names. */
2279
2363
  declare const placeRef: z.ZodObject<{
@@ -2746,9 +2830,12 @@ declare const RATE_LIMITS: Record<RateLimitName, {
2746
2830
  /** The error envelope as text; `status` is the HTTP status, when known.
2747
2831
  * `surface` names the next calls: tools (`mcp`, the default) or commands
2748
2832
  * (`cli`). `options.tokenPay: false`, for a client not offered payment by
2749
- * token: no line names one. */
2833
+ * token: no line names one. `options.tool`, the tool that answered the
2834
+ * error, when known: a code some tools answer for another reason is then
2835
+ * worded for that tool. */
2750
2836
  declare function renderError(envelope: unknown, status?: number, surface?: RenderSurface, options?: {
2751
2837
  tokenPay?: boolean;
2838
+ tool?: ToolName;
2752
2839
  }): string;
2753
2840
 
2754
2841
  type RenderedTool = ToolName;
@@ -2823,4 +2910,4 @@ declare const ME_SCOPES: {
2823
2910
  /** The contract's version, from package.json, the one place a release bumps it. */
2824
2911
  declare const CONTRACT_VERSION: string;
2825
2912
 
2826
- export { ACCOUNT_ROUTES, AMENITY_CODES, API, type AmenityCode, type AuthConfig, CANCEL_ACTIONS, CANCEL_BLOCKERS, CANCEL_NEXT_STEP, CARD_NUMBER_MESSAGE, CENTER_BASES, COMMANDS, COMMAND_GROUPS, CONTRACT_VERSION, CREDENTIAL_INVALID_REASONS, CURRENCIES, type CancelAction, type CancelBlocker, type CancelOrderInput, type Center, type CommandGroupSpec, type CommandSpec, type CreateOrderInput, type CredentialInvalidReason, type Currency, DOCS_ORIGIN, type Destination, ERROR_CODES, ERROR_DETAILS, type ErrorBody, type ErrorCode, type ErrorEnvelope, FAILURE_REASONS, FEE_KINDS, FILTERABLE_AMENITIES, type FailureReason, type FeeKind, type FilterableAmenity, type FlagSpec, GLOBAL_FLAGS, type GetHotelInput, type GetOrderInput, type GuideOptions, type GuideSurface, type GuideTopic, HTTP_ROUTES, type Hotel, type HotelOffersInput, type HotelOffersResult, type HotelSummary, type HttpRoute, type HttpToolName, type IndicativePrice, type KnownErrorBody, LIMITS, type ListOrdersInput, MCP_PATH, MCP_SERVER_URL, META_KEYS, ME_SCOPES, type MeResult, type MisplacedKey, type Money, ORDER_HTTP, ORDER_NEXT_STEP, ORDER_STATUSES, type Offer, type OfferChange, type Omitted, type OptionSpec, type Order, type OrderCancel, type OrderList, type OrderStatus, PAYMENT_METHOD_UNAVAILABLE_REASONS, PAYMENT_STATUSES, PAY_NEXT_STEP, PAY_WAYS, PLACE_KINDS, POLICY_TOPICS, PRESENTATION_HINT, PUBLIC_ORIGINS, type PayOrderInput, type PayWay, type PaymentHandler, type PaymentMethodUnavailableReason, type PaymentStatus, type Place, type PlaceRef, type PolicyTopic, type PositionalSpec, RATE_LIMITS, REPOSITORY_URL, type RateLimitName, type RenderSurface, type RenderedTool, type RoomType, SEARCH_NOTE_CODES, SEARCH_NOTE_DETAILS, SEARCH_RULES, SEARCH_SORTS, SERVER_INFO, SKILL_INSTALL_COMMAND, SUPPLIER_OUTCOME_STATUS, SUPPORT_EMAIL, type SearchHotelsInput, type SearchNote, type SearchNoteCode, type SearchResult, type Stay, TOOLS, type TokenUsageLimits, type ToolName, type ToolSpec, UNAVAILABLE_REASONS, UNKNOWN_IS_NOT_NO_EXEMPTIONS, addIsoDateDays, authConfig, cancelNextStep, cancelOrderInput, cancellation, center, commandInvocation, confirmation, containsCardNumber, countIsoDateDays, createOrderInput, createSearchHotelsInput, destination, errorEnvelope, flag, formatMoney, getHotelInput, getOrderInput, hotel, hotelId, hotelOffersInput, hotelOffersResult, hotelSummary, indicativePrice, instant, isIsoDate, knownLocaleText, latLng, listOrdersInput, localDate, localTime, localities, localizedText, meResult, meals, misplacedKeyHint, misplacedKeys, money, names, nonEmpty, offer, offerChange, offerId, offersPerHotel, omitted, oneOf, openEnum, openObject, openUnion, order, orderCancel, orderId, orderList, orderReference, parseOpen, payAtProperty, payNextStep, payOrderInput, paymentHandler, photo, place, placeId, placeRef, protocolObject, renderError, renderGuide, renderToolResult, requestMoney, roomType, routePath, searchHotelsInput, searchNote, searchResult, stay, stayEcho, strictInput, strictOutput, text, timeZone, tokenUsageLimits, toolsFor, unknownFieldsMessage, wholeNumber };
2913
+ export { ACCOUNT_ROUTES, AMENITY_CODES, API, type AmenityCode, type AuthConfig, CANCEL_ACTIONS, CANCEL_BLOCKERS, CANCEL_NEXT_STEP, CARD_NUMBER_MESSAGE, CENTER_BASES, COMMANDS, COMMAND_GROUPS, CONTRACT_VERSION, CREDENTIAL_INVALID_REASONS, CURRENCIES, type CancelAction, type CancelBlocker, type CancelOrderInput, type Center, type CommandGroupSpec, type CommandSpec, type CreateOrderInput, type CredentialInvalidReason, type Currency, DOCS_ORIGIN, type Destination, ERROR_CODES, ERROR_DETAILS, type ErrorBody, type ErrorCode, type ErrorEnvelope, FAILURE_REASONS, FEE_KINDS, FILTERABLE_AMENITIES, type FailureReason, type FeeKind, type FilterableAmenity, type FlagSpec, GLOBAL_FLAGS, type GetHotelInput, type GetOrderInput, type GetPriceMatchInput, type GuideOptions, type GuideSurface, type GuideTopic, HTTP_ROUTES, type Hotel, type HotelOffersInput, type HotelOffersResult, type HotelSummary, type HttpRoute, type HttpToolName, type IndicativePrice, type KnownErrorBody, LIMITS, type ListOrdersInput, MCP_PATH, MCP_SERVER_URL, META_KEYS, ME_SCOPES, type MeResult, type MisplacedKey, type Money, ORDER_HTTP, ORDER_NEXT_STEP, ORDER_STATUSES, type Offer, type OfferChange, type Omitted, type OptionSpec, type Order, type OrderCancel, type OrderList, type OrderStatus, PAYMENT_METHOD_UNAVAILABLE_REASONS, PAYMENT_STATUSES, PAY_NEXT_STEP, PAY_WAYS, PLACE_KINDS, POLICY_TOPICS, PRESENTATION_HINT, PRICE_MATCH_REASONS, PRICE_MATCH_STATES, PRICE_SOURCES, PUBLIC_ORIGINS, type PayOrderInput, type PayWay, type PaymentHandler, type PaymentMethodUnavailableReason, type PaymentStatus, type Place, type PlaceRef, type PolicyTopic, type PositionalSpec, type PriceMatch, type PriceMatchReason, type PriceMatchState, RATE_LIMITS, REPOSITORY_URL, type RateLimitName, type RenderSurface, type RenderedTool, type RequestPriceMatchInput, type RoomType, SEARCH_NOTE_CODES, SEARCH_NOTE_DETAILS, SEARCH_RULES, SEARCH_SORTS, SERVER_INFO, SKILL_INSTALL_COMMAND, SUPPLIER_OUTCOME_STATUS, SUPPORT_EMAIL, type SearchHotelsInput, type SearchNote, type SearchNoteCode, type SearchResult, type Stay, TOOLS, type TokenUsageLimits, type ToolName, type ToolSpec, UNAVAILABLE_REASONS, UNKNOWN_IS_NOT_NO_EXEMPTIONS, addIsoDateDays, authConfig, cancelNextStep, cancelOrderInput, cancellation, center, claimId, commandInvocation, confirmation, containsCardNumber, countIsoDateDays, createOrderInput, createSearchHotelsInput, destination, errorEnvelope, flag, formatMoney, getHotelInput, getOrderInput, getPriceMatchInput, hotel, hotelId, hotelOffersInput, hotelOffersResult, hotelSummary, indicativePrice, instant, isIsoDate, knownLocaleText, latLng, listOrdersInput, localDate, localTime, localities, localizedText, matchedOffer, meResult, meals, misplacedKeyHint, misplacedKeys, money, names, nonEmpty, offer, offerChange, offerId, offersPerHotel, omitted, oneOf, openEnum, openObject, openUnion, order, orderCancel, orderId, orderList, orderReference, parseOpen, payAtProperty, payNextStep, payOrderInput, paymentHandler, photo, place, placeId, placeRef, priceMatch, priceSeen, protocolObject, renderError, renderGuide, renderToolResult, requestMoney, requestPriceMatchInput, roomType, routePath, searchHotelsInput, searchNote, searchResult, statedMoney, stay, stayEcho, strictInput, strictOutput, text, timeZone, tokenUsageLimits, toolsFor, unknownFieldsMessage, wholeNumber };
package/dist/index.js CHANGED
@@ -88,6 +88,7 @@ function prefixed(prefix, name) {
88
88
  var hotelId = prefixed("htl", "hotelId");
89
89
  var offerId = prefixed("off", "offerId");
90
90
  var orderId = prefixed("ord", "orderId");
91
+ var claimId = prefixed("clm", "claimId");
91
92
  var placeId = z.string({ error: "placeId must be plc_ followed by 1 to 12 digits" }).regex(/^plc_\d{1,12}$/, {
92
93
  error: "placeId must be plc_ followed by 1 to 12 digits"
93
94
  });
@@ -198,6 +199,19 @@ function requestMoney(name, currencies = CURRENCIES, otherCurrency) {
198
199
  }
199
200
  );
200
201
  }
202
+ var STATED_AMOUNT_MAX = 16;
203
+ var statedAmountError = `amount must be a decimal string such as 132.40, of at most ${STATED_AMOUNT_MAX} characters`;
204
+ function statedMoney(name) {
205
+ return z3.strictObject(
206
+ {
207
+ amount: z3.string({ error: statedAmountError }).max(STATED_AMOUNT_MAX, { error: statedAmountError }).regex(/^\d+(\.\d+)?$/, { error: statedAmountError }).describe(`Decimal string such as 132.40, never a number; at most ${STATED_AMOUNT_MAX} characters.`),
208
+ currency: z3.string({ error: currencyError }).regex(/^[A-Z]{3}$/, { error: currencyError }).describe("3-letter uppercase ISO 4217 code, such as USD or EUR.")
209
+ },
210
+ {
211
+ error: (issue) => issue.code === "unrecognized_keys" ? unknownFieldsMessage(issue.keys) : `${name} must be Money: { amount: "132.40", currency: "EUR" }`
212
+ }
213
+ );
214
+ }
201
215
  function echoedMoney(name) {
202
216
  return z3.looseObject(
203
217
  {
@@ -643,6 +657,36 @@ var payOrderInput = strictInput({
643
657
  "The total the user approved: the order's total, amount and currency, exactly as the order gives it (total). In USD: a token pays a USD order only, and any other order is paid by its payment link."
644
658
  )
645
659
  });
660
+ var SITE_MAX = 64;
661
+ var LINK_MAX = 2048;
662
+ var linkError = `link must be an https URL of at most ${LINK_MAX} characters`;
663
+ var siteError = `site must be text of 1 to ${SITE_MAX} characters`;
664
+ var site = z5.string({ error: siteError }).trim().min(1, { error: siteError }).max(SITE_MAX, { error: siteError }).refine((value) => !containsCardNumber(value), { error: CARD_NUMBER_MESSAGE, abort: true });
665
+ function isHttpsUrl(value) {
666
+ try {
667
+ return new URL(value).protocol === "https:";
668
+ } catch {
669
+ return false;
670
+ }
671
+ }
672
+ var requestPriceMatchInput = strictInput({
673
+ offerId: offerId.describe(
674
+ "The offerId of the offer the user saw cheaper on another site, as an offers answer gave it."
675
+ ),
676
+ site: site.describe(
677
+ `The other site's name as the user gave it, such as a booking site or the hotel's own website; 1 to ${SITE_MAX} characters.`
678
+ ),
679
+ link: cardFreeText("link", 1, LINK_MAX).refine(isHttpsUrl, { error: linkError }).optional().describe(
680
+ `The link to the page where the user saw the price: on that site, or on a comparison site that leads to it. Ask the user for it; the check starts from that page. An https URL of at most ${LINK_MAX} characters.`
681
+ ),
682
+ seenTotal: statedMoney("seenTotal").optional().describe(
683
+ "The total the user says they saw on that site for the same stay, if they gave one, in the currency they saw it in."
684
+ ),
685
+ locale: locale.optional()
686
+ });
687
+ var getPriceMatchInput = strictInput({
688
+ claimId: claimId.describe("The claimId the price-match request answered with.")
689
+ });
646
690
 
647
691
  // src/commands.ts
648
692
  function fieldDescription(json, field, sets = {}) {
@@ -847,6 +891,25 @@ var offersFlags = flagsOf(hotelOffersInput, [
847
891
  localeFlag,
848
892
  currencyFlag
849
893
  ]);
894
+ var priceMatchFlags = flagsOf(requestPriceMatchInput, [
895
+ { flag: "site", field: "site", type: "string", placeholder: "<name>", required: "always" },
896
+ { flag: "link", field: "link", type: "string", placeholder: "<url>" },
897
+ {
898
+ flag: "seen-total",
899
+ field: "seenTotal",
900
+ type: "string",
901
+ placeholder: "<amount>",
902
+ description: "The total the user says they saw on that site for the same stay, if they gave one, as an amount in `--seen-currency`, e.g. `320.00`."
903
+ },
904
+ {
905
+ flag: "seen-currency",
906
+ field: "seenTotal.currency",
907
+ type: "string",
908
+ placeholder: "<code>",
909
+ description: "The currency of `--seen-total`, a 3-letter code such as EUR. Default USD."
910
+ },
911
+ localeFlag
912
+ ]);
850
913
  var createFlags = flagsOf(createOrderInput, [
851
914
  {
852
915
  flag: "offer",
@@ -921,7 +984,7 @@ var BODY_OPTION = {
921
984
  description: "The raw request body as a JSON object, or `@file.json` to read it from a file. Flags override its fields."
922
985
  };
923
986
  var COMMAND_GROUPS = [
924
- { name: "hotels", summary: "Search hotels, read one's details and get live offers" },
987
+ { name: "hotels", summary: "Search hotels, read one's details, get live offers and ask for a price match" },
925
988
  { name: "orders", summary: "Create an order from an offer; your orders, their status, paying and cancelling one" }
926
989
  ];
927
990
  var COMMANDS = [
@@ -949,6 +1012,22 @@ var COMMANDS = [
949
1012
  flags: offersFlags,
950
1013
  options: [BODY_OPTION]
951
1014
  },
1015
+ {
1016
+ group: "hotels",
1017
+ name: "price-match",
1018
+ summary: "Ask Fortrip to match a lower price the user saw for an offer on another site",
1019
+ tool: "request_price_match",
1020
+ flags: priceMatchFlags,
1021
+ positionals: [positional(requestPriceMatchInput, "offerId")]
1022
+ },
1023
+ {
1024
+ group: "hotels",
1025
+ name: "price-match-status",
1026
+ summary: "Show how a price match is going, and its new offer once matched",
1027
+ tool: "get_price_match",
1028
+ flags: [],
1029
+ positionals: [positional(getPriceMatchInput, "claimId")]
1030
+ },
952
1031
  {
953
1032
  group: "orders",
954
1033
  name: "create",
@@ -2234,7 +2313,8 @@ var ERROR_DETAILS = {
2234
2313
  "orders_read",
2235
2314
  "orders_create",
2236
2315
  "orders_cancel",
2237
- "orders_pay"
2316
+ "orders_pay",
2317
+ "price_match"
2238
2318
  ]).describe("Which rate limit was hit, by the kind of call it counts.")
2239
2319
  }),
2240
2320
  ordering_paused: null,
@@ -2263,6 +2343,62 @@ var errorEnvelope = openObject({
2263
2343
  )
2264
2344
  });
2265
2345
 
2346
+ // src/outputs/price-match.ts
2347
+ import { z as z17 } from "zod";
2348
+ var PRICE_MATCH_STATES = ["checking", "matched", "partial", "declined"];
2349
+ var PRICE_MATCH_REASONS = [
2350
+ "not_lower",
2351
+ "not_offered",
2352
+ "site_unreadable",
2353
+ "site_not_credible",
2354
+ "unsupported",
2355
+ "daily_limit",
2356
+ "monthly_limit",
2357
+ "unfinished",
2358
+ "unavailable"
2359
+ ];
2360
+ var PRICE_SOURCES = ["site", "data"];
2361
+ var priceSeen = openObject({
2362
+ site: z17.string().describe("The site the price was seen on."),
2363
+ total: money.describe("The total seen there for the stay."),
2364
+ via: openEnum(PRICE_SOURCES).describe(
2365
+ "site: read from the site's own page. data: from price data for that site, when its page could not be read."
2366
+ ),
2367
+ room: z17.string().optional().describe("The room the price was for, as the site named it."),
2368
+ terms: z17.string().optional().describe("The terms that price came with, as the site gave them.")
2369
+ });
2370
+ var matchedOffer = openObject({
2371
+ offerId: offerId.describe("The new offer's offerId, to order as any offer."),
2372
+ total: money.describe("The new offer's total."),
2373
+ expiresAt: instant.describe("When the new offer can no longer be ordered."),
2374
+ saved: money.describe("How much less than the original offer's total it is.")
2375
+ });
2376
+ var priceMatch = openObject({
2377
+ state: openEnum(PRICE_MATCH_STATES).describe(
2378
+ "checking: the other site is being checked. matched: a new offer whose total, with ourFeesAtProperty when present, is the other site's total. partial: a new offer below the original, short of the other site's total. declined: no new offer; reason says why."
2379
+ ),
2380
+ offerId: offerId.describe("The offer the price match is about."),
2381
+ site: z17.string().describe("The other site, as the request named it."),
2382
+ ourTotal: money.describe("That offer's total."),
2383
+ claimId: claimId.optional().describe("The price match's id, to read it again; absent only when it was declined before any check started."),
2384
+ progressUrl: z17.string().optional().describe("A page the user can follow the check on; present with claimId."),
2385
+ checkAgainAfterSeconds: z17.number().int().nonnegative().optional().describe("While checking: how many seconds to wait before reading the price match again."),
2386
+ step: z17.string().optional().describe("While checking: the latest step of the check."),
2387
+ seen: z17.array(priceSeen).nullable().optional().describe("The prices the check saw on the other site; null or absent when none is on record."),
2388
+ matchedOffer: matchedOffer.optional().describe("When matched or partial: the new offer."),
2389
+ otherTotal: money.optional().describe("When matched or partial: what the other site charges for the stay, with its taxes and fees."),
2390
+ ourFeesAtProperty: money.optional().describe(
2391
+ "Fortrip's own fees for this stay paid at the hotel, known and counted in the comparison; absent when there are none or they can't all be counted (propertyFeeLeftOut says so on a matched or partial answer)."
2392
+ ),
2393
+ reason: openEnum(PRICE_MATCH_REASONS).optional().describe(
2394
+ "When declined: not_lower, the site was not lower. not_offered: the site does not sell this room for these dates. site_unreadable: this stay's price could not be seen on the site. site_not_credible: not a site price match covers. unsupported: an offer price match does not cover. daily_limit: no more checks for now. monthly_limit: price match is not available for now. unfinished: the check could not finish in time; the same request again starts a new check. unavailable: price match is not available now."
2395
+ ),
2396
+ note: z17.string().optional().describe("One sentence about the check."),
2397
+ propertyFeeLeftOut: z17.boolean().nullable().optional().describe(
2398
+ "When matched or partial: true when Fortrip's own fees paid at the hotel for this stay can't all be counted (one is not known, or is not in the offer's currency), so the comparison leaves them out; false when they are counted or there are none. Null or absent otherwise."
2399
+ )
2400
+ });
2401
+
2266
2402
  // src/paths.ts
2267
2403
  var PUBLIC_ORIGINS = {
2268
2404
  api: "https://api.fortrip.ai",
@@ -2307,6 +2443,8 @@ var HTTP_ROUTES = {
2307
2443
  search_hotels: route("POST", "/v1/hotels/search"),
2308
2444
  get_hotel: route("GET", "/v1/hotels/{hotelId}", ["include", "locale"]),
2309
2445
  get_hotel_offers: route("POST", "/v1/hotels/offers"),
2446
+ request_price_match: route("POST", "/v1/price-matches"),
2447
+ get_price_match: route("GET", "/v1/price-matches/{claimId}"),
2310
2448
  create_order: route("POST", "/v1/orders"),
2311
2449
  get_order: route("GET", "/v1/orders/{orderId}", ["locale"]),
2312
2450
  list_orders: route("GET", "/v1/orders", ["cursor", "limit", "locale"]),
@@ -2338,11 +2476,12 @@ var RATE_LIMITS = {
2338
2476
  orders_create: { limit: 20, windowSeconds: 60 },
2339
2477
  orders_read: { limit: 60, windowSeconds: 60 },
2340
2478
  orders_cancel: { limit: 10, windowSeconds: 60 },
2341
- orders_pay: { limit: 10, windowSeconds: 60 }
2479
+ orders_pay: { limit: 10, windowSeconds: 60 },
2480
+ price_match: { limit: 60, windowSeconds: 60 }
2342
2481
  };
2343
2482
 
2344
2483
  // src/render/index.ts
2345
- import { z as z18 } from "zod";
2484
+ import { z as z19 } from "zod";
2346
2485
 
2347
2486
  // src/tools.ts
2348
2487
  import "zod";
@@ -2422,6 +2561,34 @@ var SPECS = [
2422
2561
  input: hotelOffersInput,
2423
2562
  output: hotelOffersResult
2424
2563
  },
2564
+ {
2565
+ name: "request_price_match",
2566
+ title: "Request price match",
2567
+ description: "Use this when the user says they saw this stay cheaper on another site. Give the offer's offerId and the site's name as they said it. Ask the user for the link to the page where they saw it and send it; a comparison site's link that leads to the booking site counts. Send the total they saw if given. It answers at once: with a claimId and a progress link to show the user while Fortrip checks that site (up to ten minutes), or declined with the reason when no check starts. While checking, call get_price_match with the claimId after the seconds the answer states, not sooner; if you cannot wait, ask the user to ask again in a few minutes. Say nothing to the user about a match until the state is matched (or partial: lower, but short of the other site's price). A matched or partial answer carries a new offerId: order it with create_order, with the same consent before paying. The same call again answers the same price match while its check runs or its result stands; a new link or an unfinished check starts a new one.",
2568
+ // A write that destroys nothing: it starts a check and answers a claim,
2569
+ // and orders, pays for and cancels nothing. Not idempotent: the same
2570
+ // call answers the same claim while its check runs, while its matched
2571
+ // offer is valid, and after a decline that judged the site. After any
2572
+ // other decline (a check that ended unfinished, a limit, price match not
2573
+ // available) the same call can start another check, which counts
2574
+ // against the account's checks.
2575
+ annotations: {
2576
+ readOnlyHint: false,
2577
+ idempotentHint: false,
2578
+ openWorldHint: true,
2579
+ destructiveHint: false
2580
+ },
2581
+ input: requestPriceMatchInput,
2582
+ output: priceMatch
2583
+ },
2584
+ {
2585
+ name: "get_price_match",
2586
+ title: "Get price match",
2587
+ description: "Use this when the user asks how a price-match check is going, or once the wait a check stated has passed. Give the claimId request_price_match answered with. It returns the state: checking (with the latest step and when to look again), matched, partial or declined. While it is checking, look again only after the wait the answer states; if you cannot wait, ask the user to ask again in a few minutes. Only matched or partial carries a new offer, with its offerId, total, saving and expiry, to order with create_order. Declined says what was seen and why there is no new price.",
2588
+ annotations: READ_OWN,
2589
+ input: getPriceMatchInput,
2590
+ output: priceMatch
2591
+ },
2425
2592
  {
2426
2593
  name: "create_order",
2427
2594
  title: "Create order",
@@ -3206,6 +3373,138 @@ function renderOrderList(list, surface = "mcp") {
3206
3373
  return lines.join("\n");
3207
3374
  }
3208
3375
 
3376
+ // src/render/price-match.ts
3377
+ var STATE_WORDS = {
3378
+ checking: "checking",
3379
+ matched: "matched",
3380
+ partial: "partly matched",
3381
+ declined: "declined"
3382
+ };
3383
+ var VIA_WORDS = {
3384
+ site: "read from the site's own page",
3385
+ data: "from price data for that site"
3386
+ };
3387
+ var REASON_WORDS = {
3388
+ not_lower: "the site was not lower than Fortrip's price.",
3389
+ not_offered: "that site does not sell this room for these dates, so there is no price to match.",
3390
+ site_unreadable: "Fortrip could not see this stay's price on that site, so it could not check it.",
3391
+ site_not_credible: "Fortrip only matches well-known booking sites and the hotel's own site.",
3392
+ unsupported: "price match is not available for this offer: for now it covers USD offers of one room, and not a price already matched.",
3393
+ daily_limit: "no more checks for now; try again later.",
3394
+ monthly_limit: "price match is not available for now.",
3395
+ unfinished: "the check could not finish in time; the same request again starts a new check.",
3396
+ unavailable: "price match is not available right now."
3397
+ };
3398
+ function lookCall(r, surface) {
3399
+ if (r.claimId === void 0) {
3400
+ return surface === "cli" ? ours`run the same \`fortrip hotels price-match\` command again` : ours`call request_price_match again with the same arguments`;
3401
+ }
3402
+ return surface === "cli" ? ours`run \`fortrip hotels price-match-status ${token("id", r.claimId)}\`` : ours`call get_price_match { claimId: ${theirs(r.claimId)} }`;
3403
+ }
3404
+ function orderCall(offerId2, surface) {
3405
+ return surface === "cli" ? ours`run \`fortrip orders create --offer ${token("id", offerId2)}\` with the guests and the contact` : ours`call create_order with offer ${token("id", offerId2)}`;
3406
+ }
3407
+ function headLine(r) {
3408
+ return joined(
3409
+ [
3410
+ r.claimId === void 0 ? ours`Price match` : ours`Price match ${token("id", r.claimId)}`,
3411
+ label(STATE_WORDS, r.state, ours`state not recognized`),
3412
+ ours`site ${theirs(r.site)}`,
3413
+ ours`offer ${token("id", r.offerId)}, Fortrip's total ${money2(r.ourTotal)}`
3414
+ ],
3415
+ " \xB7 "
3416
+ );
3417
+ }
3418
+ function seenLines(r) {
3419
+ return (r.seen ?? []).map(
3420
+ (s) => joined(
3421
+ [
3422
+ ours`Seen on ${theirs(s.site)}: ${money2(s.total)}, ${label(VIA_WORDS, s.via, ours`from a source not recognized`)}`,
3423
+ s.room !== void 0 && ours`room ${theirs(s.room)}`,
3424
+ s.terms !== void 0 && ours`terms ${theirs(s.terms)}`
3425
+ ],
3426
+ " \xB7 "
3427
+ )
3428
+ );
3429
+ }
3430
+ var progressLine = (r) => r.progressUrl === void 0 ? [] : [ours`Progress page, to share with the user: ${token("url", r.progressUrl)}`];
3431
+ var noteLine = (r) => r.note === void 0 ? [] : [ours`Note from the check: ${theirs(r.note)}`];
3432
+ var aboutLines = (r) => [...progressLine(r), ...noteLine(r)];
3433
+ function ourFeesLine(r) {
3434
+ const fees = r.ourFeesAtProperty;
3435
+ if (fees === void 0 || /^0+(?:\.0+)?$/.test(fees.amount)) return [];
3436
+ const due = ours`The comparison counts what is paid at the hotel: this offer also has ${money2(fees)} due at the property`;
3437
+ return [
3438
+ r.state === "matched" ? ours`${due}, so the new total can be below the other site's total by that amount.` : ours`${due}.`
3439
+ ];
3440
+ }
3441
+ var feeLine = (r) => r.propertyFeeLeftOut === true ? [ours`Fortrip's own fees paid at the hotel for this stay can't all be counted (one is not known, or is not in the offer's currency), so this comparison leaves them out.`] : [];
3442
+ function checkingLines(r, surface) {
3443
+ const wait = r.checkAgainAfterSeconds === void 0 ? ours`shortly` : ours`in ${plural(r.checkAgainAfterSeconds, "second")}`;
3444
+ const instead = r.progressUrl === void 0 ? ours`ask the user to ask again in a few minutes` : ours`give the user the progress page and ask them to ask again in a few minutes`;
3445
+ const sooner = r.checkAgainAfterSeconds === void 0 ? ours`If you cannot wait` : ours`Do not look sooner: if you cannot wait`;
3446
+ return [
3447
+ ...progressLine(r),
3448
+ ...r.step === void 0 ? [] : [ours`Latest step: ${theirs(r.step)}`],
3449
+ ...noteLine(r),
3450
+ ours`Look again ${wait}: ${lookCall(r, surface)}. ${sooner}, ${instead}. The check can take up to ten minutes. Until the state is matched or partial, say nothing to the user about a match or a lower price.`
3451
+ ];
3452
+ }
3453
+ function matchLines(r, surface) {
3454
+ const m = r.matchedOffer;
3455
+ if (m === void 0) {
3456
+ return [
3457
+ ...seenLines(r),
3458
+ ...aboutLines(r),
3459
+ ours`New offer: none in this answer; say nothing to the user about a match yet, and look again: ${lookCall(r, surface)}.`
3460
+ ];
3461
+ }
3462
+ const other = r.state === "partial" ? [
3463
+ ours`Other site's total: ${r.otherTotal === void 0 ? ours`not stated` : money2(r.otherTotal)}. Fortrip's limit on a price match stopped short of it: the new offer is the lowest this price match can give.`
3464
+ ] : [];
3465
+ return [
3466
+ ours`New offer: ${token("id", m.offerId)} · total ${money2(m.total)} · saves ${money2(m.saved)} · expires ${when(m.expiresAt, null)}`,
3467
+ ...other,
3468
+ ...ourFeesLine(r),
3469
+ ...seenLines(r),
3470
+ ours`Every other term of the new offer is as in offer ${token("id", r.offerId)}: the room, meals, cancellation and fees payable at the property.`,
3471
+ ...feeLine(r),
3472
+ ...aboutLines(r),
3473
+ ours`To book at this price: ${orderCall(m.offerId, surface)}, as for any offer, before it expires.`
3474
+ ];
3475
+ }
3476
+ function declinedLines(r) {
3477
+ const why = r.reason === void 0 ? ours`not stated.` : label(REASON_WORDS, r.reason, ours`a reason not recognized.`);
3478
+ return [
3479
+ ...seenLines(r),
3480
+ ours`Why: ${why}`,
3481
+ ...feeLine(r),
3482
+ ...aboutLines(r),
3483
+ ours`No new offer: offer ${token("id", r.offerId)} stays as it was.`
3484
+ ];
3485
+ }
3486
+ function renderPriceMatch(r, surface = "mcp") {
3487
+ let lines;
3488
+ switch (r.state) {
3489
+ case "checking":
3490
+ lines = checkingLines(r, surface);
3491
+ break;
3492
+ case "matched":
3493
+ case "partial":
3494
+ lines = matchLines(r, surface);
3495
+ break;
3496
+ case "declined":
3497
+ lines = declinedLines(r);
3498
+ break;
3499
+ default:
3500
+ lines = [
3501
+ ...aboutLines(r),
3502
+ ours`State ${code(r.state, ours`not recognized`)}: say nothing to the user about a match, and look again: ${lookCall(r, surface)}.`
3503
+ ];
3504
+ }
3505
+ return [headLine(r), ...lines].join("\n");
3506
+ }
3507
+
3209
3508
  // src/render/search.ts
3210
3509
  var SORTS = {
3211
3510
  distance: "nearest first",
@@ -3544,6 +3843,15 @@ var HAPPENED = {
3544
3843
  supplier_unavailable: "the hotel's side couldn't be reached this time.",
3545
3844
  internal: "something went wrong on Fortrip's side."
3546
3845
  };
3846
+ var HAPPENED_BY_TOOL = {
3847
+ request_price_match: {
3848
+ not_found: "no such offer.",
3849
+ offer_expired: "the offer expired, or Fortrip's own price for its room changed since the offer was made; no check was started."
3850
+ },
3851
+ get_price_match: {
3852
+ not_found: "no such price match for this user."
3853
+ }
3854
+ };
3547
3855
  var CURSOR_WORDS = {
3548
3856
  expired: "has expired",
3549
3857
  mismatch: "is not this user's, or was changed",
@@ -3556,7 +3864,8 @@ var RATE_LIMIT_WORDS = {
3556
3864
  orders_read: "reads of orders",
3557
3865
  orders_create: "orders created",
3558
3866
  orders_cancel: "cancellations",
3559
- orders_pay: "payments"
3867
+ orders_pay: "payments",
3868
+ price_match: "price-match requests and reads"
3560
3869
  };
3561
3870
  var isObject3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3562
3871
  function changeLine(c) {
@@ -3670,7 +3979,7 @@ function notCancellable(d, surface) {
3670
3979
  ours`This order can be neither cancelled nor closed now: ${blockerText(c)}.`
3671
3980
  ];
3672
3981
  }
3673
- function detailLines(e, surface, tokenPay) {
3982
+ function detailLines(e, surface, tokenPay, tool) {
3674
3983
  const getOrder = (id) => surface === "cli" ? ours`\`fortrip orders get ${id}\`` : ours`get_order`;
3675
3984
  switch (e.code) {
3676
3985
  case "invalid_request": {
@@ -3690,6 +3999,12 @@ function detailLines(e, surface, tokenPay) {
3690
3999
  case "not_found":
3691
4000
  return [ours`Use an id an earlier answer showed, exactly as shown.`];
3692
4001
  case "offer_expired":
4002
+ if (tool === "request_price_match") {
4003
+ const again = surface === "cli" ? ours`run \`fortrip hotels price-match\` again` : ours`call request_price_match again`;
4004
+ return [
4005
+ ours`Offer ${token("id", e.details.offerId)} can't be price-matched: get offers again, let the user choose again, then ${again} with the new offer.`
4006
+ ];
4007
+ }
3693
4008
  return [
3694
4009
  ours`Offer ${token("id", e.details.offerId)} expired at ${when(e.details.expiredAt, null)}: get offers again and let the user choose again.`
3695
4010
  ];
@@ -3815,13 +4130,14 @@ function renderError(envelope, status, surface = "mcp", options = {}) {
3815
4130
  }
3816
4131
  const name = typeof body.code === "string" ? code(body.code, ours`unknown`) : ours`unknown`;
3817
4132
  const head = status === void 0 ? ours`Error ${name}` : ours`Error ${name} (HTTP ${status})`;
3818
- const happened = typeof body.code === "string" && Object.hasOwn(HAPPENED, body.code) ? own(HAPPENED[body.code]) : typeof body.message === "string" ? theirs(body.message) : null;
4133
+ const forTool = options.tool === void 0 ? void 0 : HAPPENED_BY_TOOL[options.tool]?.[body.code];
4134
+ const happened = typeof body.code === "string" && Object.hasOwn(HAPPENED, body.code) ? own(forTool ?? HAPPENED[body.code]) : typeof body.message === "string" ? theirs(body.message) : null;
3819
4135
  const lines = [
3820
4136
  happened === null ? head : ours`${head}: ${happened}`,
3821
4137
  retryLine(body.retryable, body.retryAfterSeconds)
3822
4138
  ];
3823
4139
  if (typeof body.pointer === "string") lines.push(ours`Field: ${token("pointer", body.pointer)}`);
3824
- if (known) lines.push(...detailLines(known, surface, options.tokenPay !== false));
4140
+ if (known) lines.push(...detailLines(known, surface, options.tokenPay !== false, options.tool));
3825
4141
  else if (body.details !== void 0) lines.push(ours`Details: ${raw(body.details)}`);
3826
4142
  if (typeof body.requestId === "string" && (surface === "cli" || body.code === "internal")) {
3827
4143
  lines.push(ours`Request id: ${token("id", body.requestId)}`);
@@ -3846,7 +4162,7 @@ function withoutTokenRequest(value) {
3846
4162
  }
3847
4163
  return out;
3848
4164
  }
3849
- var orderPage = openObject({ data: z18.array(z18.unknown()), nextCursor: z18.string().nullable() });
4165
+ var orderPage = openObject({ data: z19.array(z19.unknown()), nextCursor: z19.string().nullable() });
3850
4166
  function resultText(tool, data, surface) {
3851
4167
  const schema = tool === "list_orders" ? orderPage : TOOLS.find((t) => t.name === tool)?.output;
3852
4168
  let parsed;
@@ -3871,6 +4187,9 @@ function resultText(tool, data, surface) {
3871
4187
  return renderHotel(parsed);
3872
4188
  case "get_hotel_offers":
3873
4189
  return renderOffers(parsed, surface);
4190
+ case "request_price_match":
4191
+ case "get_price_match":
4192
+ return renderPriceMatch(parsed, surface);
3874
4193
  case "create_order":
3875
4194
  case "get_order":
3876
4195
  case "cancel_order":
@@ -3989,10 +4308,11 @@ var ME_SCOPES = { email: "email", name: "profile" };
3989
4308
  // package.json
3990
4309
  var package_default = {
3991
4310
  name: "@fortrip/agent-contract",
3992
- version: "6.4.0",
4311
+ version: "6.5.0",
3993
4312
  license: "Apache-2.0",
3994
4313
  description: "The contract of Fortrip's agent API (https://api.fortrip.ai/v1) and its MCP server: limits, paths, request and response schemas, error codes and field rules.",
3995
4314
  type: "module",
4315
+ homepage: "https://docs.fortrip.ai",
3996
4316
  repository: {
3997
4317
  type: "git",
3998
4318
  url: "git+https://github.com/FortripEngineering/fortrip.git",
@@ -4084,6 +4404,9 @@ export {
4084
4404
  PLACE_KINDS,
4085
4405
  POLICY_TOPICS,
4086
4406
  PRESENTATION_HINT,
4407
+ PRICE_MATCH_REASONS,
4408
+ PRICE_MATCH_STATES,
4409
+ PRICE_SOURCES,
4087
4410
  PUBLIC_ORIGINS,
4088
4411
  RATE_LIMITS,
4089
4412
  REPOSITORY_URL,
@@ -4104,6 +4427,7 @@ export {
4104
4427
  cancelOrderInput,
4105
4428
  cancellation,
4106
4429
  center,
4430
+ claimId,
4107
4431
  commandInvocation,
4108
4432
  confirmation,
4109
4433
  containsCardNumber,
@@ -4116,6 +4440,7 @@ export {
4116
4440
  formatMoney,
4117
4441
  getHotelInput,
4118
4442
  getOrderInput,
4443
+ getPriceMatchInput,
4119
4444
  guestNameRe,
4120
4445
  hotel,
4121
4446
  hotelId,
@@ -4132,6 +4457,7 @@ export {
4132
4457
  localTime,
4133
4458
  localities,
4134
4459
  localizedText,
4460
+ matchedOffer,
4135
4461
  meResult,
4136
4462
  meals,
4137
4463
  misplacedKeyHint,
@@ -4163,16 +4489,20 @@ export {
4163
4489
  place,
4164
4490
  placeId,
4165
4491
  placeRef,
4492
+ priceMatch,
4493
+ priceSeen,
4166
4494
  protocolObject,
4167
4495
  renderError,
4168
4496
  renderGuide,
4169
4497
  renderToolResult,
4170
4498
  requestMoney,
4499
+ requestPriceMatchInput,
4171
4500
  roomType,
4172
4501
  routePath,
4173
4502
  searchHotelsInput,
4174
4503
  searchNote,
4175
4504
  searchResult,
4505
+ statedMoney,
4176
4506
  stay,
4177
4507
  stayEcho,
4178
4508
  strictInput,
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@fortrip/agent-contract",
3
- "version": "6.4.0",
3
+ "version": "6.5.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The contract of Fortrip's agent API (https://api.fortrip.ai/v1) and its MCP server: limits, paths, request and response schemas, error codes and field rules.",
6
6
  "type": "module",
7
+ "homepage": "https://docs.fortrip.ai",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "git+https://github.com/FortripEngineering/fortrip.git",