@fortrip/agent-contract 5.3.0 → 6.0.0-rc.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.
- package/README.md +14 -10
- package/dist/index.d.ts +774 -2005
- package/dist/index.js +1642 -1044
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ apart.
|
|
|
8
8
|
|
|
9
9
|
It has one peer dependency, `zod` (`^4.4.0`), and runs anywhere
|
|
10
10
|
ES2023 does. Its major version changes when the contract breaks, not with
|
|
11
|
-
the API: `
|
|
11
|
+
the API: `6.x` serves Fortrip API v1.
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
14
|
import { API, LIMITS, PUBLIC_ORIGINS, containsCardNumber } from "@fortrip/agent-contract";
|
|
@@ -25,22 +25,26 @@ It exports:
|
|
|
25
25
|
- `searchHotelsInput`, `getHotelInput`, `hotelOffersInput`,
|
|
26
26
|
`createOrderInput`, `getOrderInput`, `listOrdersInput`,
|
|
27
27
|
`cancelOrderInput` and `payOrderInput`, the zod schemas of the requests,
|
|
28
|
-
with `
|
|
29
|
-
|
|
28
|
+
with `offersPerHotel(limitPerHotel, hotelsWithOffers)`, the offers each
|
|
29
|
+
hotel of an offers call gets, and `misplacedKeys(schema, issues, sent)`,
|
|
30
|
+
where a key sent at the wrong depth belongs, with `misplacedKeyHint(key)`,
|
|
31
|
+
what to tell the caller about it, and `searchResult`, `hotel`,
|
|
32
|
+
`hotelOffersResult`, `order`,
|
|
30
33
|
`orderList`, `paymentHandler` and `errorEnvelope`, the open schemas of the
|
|
31
34
|
responses, with `ERROR_DETAILS`, each error code's `details`, and
|
|
32
35
|
`parseOpen`, a parser that keeps unknown fields and values;
|
|
33
36
|
- `COMMANDS`, `COMMAND_GROUPS` and `GLOBAL_FLAGS`, the CLI's commands, the
|
|
34
37
|
groups they are typed after and its flags, `commandInvocation(spec)`, a
|
|
35
|
-
command as it is typed (`fortrip hotels search`),
|
|
36
|
-
tools,
|
|
37
|
-
`PAY_NEXT_STEP` and `WALLET_NEXT_STEP` (`cancelNextStep(surface)`,
|
|
38
|
-
`payNextStep(surface)` and `walletNextStep(surface)` word the last three for
|
|
39
|
-
`"mcp"` or `"cli"`);
|
|
38
|
+
command as it is typed (`fortrip hotels search`), `TOOLS`, the MCP
|
|
39
|
+
tools, and `SERVER_INFO`, what an MCP server for Fortrip says of itself;
|
|
40
40
|
- `renderToolResult(tool, data, surface?)` and
|
|
41
|
-
`renderError(envelope, status?, surface?)`, the
|
|
41
|
+
`renderError(envelope, status?, surface?)`, the whole text of a result or
|
|
42
42
|
an error, naming tools (`"mcp"`, the default) or commands and flags
|
|
43
|
-
(`"cli"`)
|
|
43
|
+
(`"cli"`): an MCP result is this one text block, with nothing added. The
|
|
44
|
+
rules a result ends with are exported too (`ORDER_NEXT_STEP`,
|
|
45
|
+
`CANCEL_NEXT_STEP`, `PAY_NEXT_STEP`, `PRESENTATION_HINT`, and
|
|
46
|
+
`cancelNextStep(surface)` and `payNextStep(surface)`, which word two of
|
|
47
|
+
them for `"mcp"` or `"cli"`), and `renderGuide(surface, topic)`, the agent
|
|
44
48
|
guide as Markdown for `"mcp"`, `"claude-skill"` or `"cli"`;
|
|
45
49
|
- field rules such as `containsCardNumber`, the guest-name rule and the date
|
|
46
50
|
helpers, and `CONTRACT_VERSION`.
|