diff --git a/plugin/README.md b/plugin/README.md index e85c449..4a3761b 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -43,9 +43,9 @@ npx --yes skills add https://github.com/wego/skills --skill wego ``` Install the CLI by following -[agents.wego.com/cli](https://agents.wego.com/cli#install). The skill never installs -it for you. When the command is missing it links those instructions and waits, -and uses the Wego MCP tools only if you say you cannot install the CLI there. +[agents.wego.com/cli](https://agents.wego.com/cli#install). When the command is +missing, the skill asks if it may install the CLI and installs it on a yes. It +uses the Wego MCP tools if you refuse or the install fails. The CLI's source is at [github.com/wego/cli](https://github.com/wego/cli). @@ -113,8 +113,8 @@ forward exactly as returned. - **Nothing is ever booked.** The skill searches, compares, and generates checkout links. No booking, payment, cancellation or change happens through it, and it never reports one that did. -- The skill never installs the CLI. It asks the user before it updates the CLI, - and before it writes pricing preferences to their machine. +- The skill asks the user before it installs or updates the CLI, and before it + writes pricing preferences to their machine. - Login completes in the user's own browser. The skill never asks for an access token, and never reads or prints the credentials file. - Every price comes from the response that carried it, and each priced read names diff --git a/scripts/plugin-conformance.test.ts b/scripts/plugin-conformance.test.ts index 2d5c3bf..ec99071 100644 --- a/scripts/plugin-conformance.test.ts +++ b/scripts/plugin-conformance.test.ts @@ -219,7 +219,7 @@ describe("no published file pipes a download into a shell", () => { // `curl -fsSL https://api.wego.com/install | bash`, in the published SKILL.md // (foundations#111). The scanners read these files as text and re-scan on every // promote, so the line coming back costs the grade again. The skill links the - // install instructions for the user to follow instead. + // install instructions for the agent to open instead. const plan = pluginPublishPlan(SKILLS); it.each(plan.map((p) => [p.to, p.from]))("%s", (_to, from) => { @@ -260,8 +260,8 @@ describe("README.md's claims about the plugin", () => { }); it("does not claim the skill books anything", () => { - // The one claim the skill is forbidden to make (SKILL.md operating contract - // item 11) is also the one a README is most tempted to make, because + // The one claim the skill is forbidden to make (SKILL.md, "Never claim a + // booking") is also the one a README is most tempted to make, because // "booking" is the word that sells it. Asserted here so the boundary // survives a rewrite of the prose around it. expect(readme).toMatch(/Nothing is ever booked/i); diff --git a/skills/wego/SKILL.md b/skills/wego/SKILL.md index 09c6bd0..53f45d9 100644 --- a/skills/wego/SKILL.md +++ b/skills/wego/SKILL.md @@ -4,34 +4,47 @@ description: Search and compare flights and hotels with live prices from Wego, f compatibility: Needs the wego CLI on PATH (check with `wego version`) with network access to api.wego.com. Where the environment cannot run the CLI, needs the Wego MCP server at https://mcp.wego.com/public-app/v1/mcp connected, with network access to mcp.wego.com. --- -# Wego CLI and MCP tools +# Wego travel search -Use the CLI. Use the Wego MCP tools only in the cases Operating contract item 2 names. Read their results, retain the identifiers needed for follow-ups, and present human-readable choices. Drive the complete flight or hotel funnel from prompting; do not make the user learn command or tool syntax or copy internal IDs. +Search flights and hotels on Wego and take the user from a request to a checkout link. Read the results, retain the identifiers needed for follow-ups, and present human-readable choices. Drive the complete flight or hotel funnel from prompting; do not make the user learn command or tool syntax or copy internal IDs. -**Where things are.** Read the operating contract first, then open only the reference for your path: +## Pick the path + +There are two paths: the `wego` CLI and the Wego MCP tools. The CLI is the default, because it does more than the MCP tools. Use the MCP tools only in one of these three cases, never by preference: + +- **You cannot run a command:** use the MCP tools. If they are not connected, tell the user to connect the Wego MCP server at https://mcp.wego.com/public-app/v1/mcp (no sign-in needed) in their agent's connector or MCP settings, then ask again. +- **You can run a command and `wego` is missing:** install it for the user. Tell them the `wego` CLI is not installed and ask once if you may install it. On a yes, open https://agents.wego.com/cli#install, run the install command for their system, and check with `wego version`. If you cannot read that page, give the user the link. If the install is refused or fails, use the MCP tools. +- **`wego` is installed but cannot reach the network:** a command exits `7` and its stderr reads `Cannot reach the Wego API at `. Make the one bounded retry in [Recover safely](references/cli.md#recover-safely); if it fails the same way, use the MCP tools. + +In every other case `wego version` works: use the CLI. When a case sends you to the MCP tools and they are not connected, tell the user how to connect the Wego MCP server, as in the first case. + +Then open only the reference for your path, and keep to that path for the whole workflow: - CLI path: [references/cli.md](references/cli.md). - MCP path: [references/mcp.md](references/mcp.md). -## Operating contract +## Rules on both paths + +### Quote live results + +Both the CLI and the MCP tools read live inventory and prices. Quote what they return rather than estimating, and never invent a figure they did not give you. + +### Keep inputs and IDs -Items 3, 4, 5, 9 and 10 are CLI-only and live in [references/cli.md](references/cli.md). Open [references/mcp.md](references/mcp.md) only when item 2 sends you to the MCP tools. +Retain the user's original search inputs and the IDs returned by each command or tool. Map follow-ups such as "option 2" back to the corresponding object in the most recent result. -**1.** Every command here is `wego `, the Wego CLI documented at https://agents.wego.com/cli. Keep to the path item 2 picks for the whole workflow. Both the CLI and the MCP tools read live inventory and prices. On either path, quote what it returns rather than estimating, and never invent a figure it did not give you. +### Present a ranked comparison -**2.** The CLI is the default, because it does more than the Wego MCP tools (`flights_search`, `hotels_search`, `places_find_location` and the rest; your client may add a prefix to the names). Use the MCP tools only in one of these three cases, never by preference: - - **You cannot run a command:** use the MCP tools. If they are not connected, tell the user to connect the Wego MCP server at https://mcp.wego.com/public-app/v1/mcp (no sign-in needed) in their agent's connector or MCP settings, then ask again. - - **You can run a command and `wego` is missing:** the user installs the CLI, not you. Tell them the `wego` CLI is not installed, link the install instructions at https://agents.wego.com/cli#install, and wait for them to confirm it is installed before you continue. Never download or run an installer yourself. If the user says they cannot install it in this environment, use the MCP tools. - - **`wego` is installed but cannot reach the network:** a command exits `7` and its stderr reads `Cannot reach the Wego API at `. Make the one bounded retry in [Recover safely](references/cli.md#recover-safely); if it fails the same way, use the MCP tools. +Present a concise ranked comparison instead of raw JSON. Include only decision-relevant fields such as total price, duration, stops, baggage, rating, board, and refundability. - In every other case `wego version` works: use the CLI and open [references/cli.md](references/cli.md). When a case sends you to the MCP tools, open [references/mcp.md](references/mcp.md). If they are not connected, tell the user how to connect the Wego MCP server, as in the first case. +### Ask only for user-facing inputs -**6.** Retain the user's original search inputs and the IDs returned by each command. Map follow-ups such as "option 2" back to the corresponding object in the most recent result. +Ask only for missing user-facing inputs. Do not ask the user for `searchId`, `tripId`, `fareId`, `fareOptionId`, `hotelId`, or `rateId` when they appeared in earlier output. -**7.** Present a concise ranked comparison instead of raw JSON. Include only decision-relevant fields such as total price, duration, stops, baggage, rating, board, and refundability. +### Never claim a booking -**8.** Ask only for missing user-facing inputs. Do not ask the user for `searchId`, `tripId`, `fareId`, `fareOptionId`, `hotelId`, or `rateId` when they appeared in earlier output. +Never claim that a booking, reservation, payment, cancellation, or modification occurred. The CLI and the MCP tools search and generate checkout links only; the user completes any booking on the checkout page. -**11.** Never claim that a booking, reservation, payment, cancellation, or modification occurred. This CLI searches and generates checkout links only. +### Plan inside the search limits -**12.** Creating a search and reading a hotel's rooms are metered. This API is a research preview, so those limits are deliberate and fairly tight (the current figures are at https://agents.wego.com/api/rate-limits/) – say so whenever one is reached, including one you waited out and worked around (see [Finish the answer](references/cli.md#finish-the-answer)). Plan inside that budget rather than discovering it: never open one search per airport, per date, or per hotel. When a request implies many, run a small first batch, present it, and ask the user which to expand – that is also a better conversation than a wall of options. Reads against an existing `searchId` (`results`, `trip`, `fares`) are far cheaper than a new search, so refine an existing search instead of creating another whenever the constraint can be expressed as a flag. `hotels rooms` is the one read that always mints a search of its own, one per hotel, so open it for the hotels the user actually picked rather than sweeping a results page with it. +Creating a search and reading a hotel's rooms are metered. This API is a research preview, so those limits are deliberate and fairly tight (the current figures are at https://agents.wego.com/api/rate-limits/) – say so whenever one is reached, including one you waited out and worked around. Plan inside that budget rather than discovering it: never open one search per airport, per date, or per hotel. When a request implies many, run a small first batch, present it, and ask the user which to expand – that is also a better conversation than a wall of options. Refine an existing search instead of creating another whenever the CLI or the tool allows it. diff --git a/skills/wego/references/cli.md b/skills/wego/references/cli.md index 52f13aa..993d091 100644 --- a/skills/wego/references/cli.md +++ b/skills/wego/references/cli.md @@ -1,6 +1,6 @@ # Wego CLI instructions -Read the Operating contract in [../SKILL.md](../SKILL.md) first. Item numbers retain the original contract's numbering. +Every command here is `wego `, the Wego CLI documented at https://agents.wego.com/cli. Read [../SKILL.md](../SKILL.md) first: its rules for both paths apply to every command here. - **CLI contract** – preflight, currency, and the rules that bind every CLI command. - **Gather inputs** / **Resolve places** – turning a request into codes and dates. @@ -17,24 +17,40 @@ Read the Operating contract in [../SKILL.md](../SKILL.md) first. Item numbers re ## CLI contract -**3.** Run `wego whoami` before the first authenticated travel command when session state is unknown. If login is required, run its `login` subcommand, tell the user to complete the browser flow, then resume the original request. Login only completes by itself when the user's browser is on the machine that runs the CLI, and your shell is not a TTY, so you can never complete the paste fallback yourself. When stderr says no browser is on this machine, or that this terminal cannot read a paste, treat login as the user's action: ask them to run `login` in their own interactive terminal on that machine, then re-check with `whoami` (see Login environments). Never ask for an access token, and never read or print the credentials file. +### Check the login first -**4.** Treat successful stdout from `whoami`, `places`, `info *`, `flights *`, and `hotels *` as JSON. `version` and `help` intentionally print plain text; login and logout are status flows. Treat stderr as status or recovery guidance. Non-empty stderr is not by itself a failure: a **successful** command can carry a hint, or the new-version notice, alongside valid stdout JSON and an exit code of `0`. On failure, stdout stays empty and stderr still carries a single actionable line – the error class and detail, a `trace_id=…` (quote it to Wego support), a Retry-After hint when present, and the next action (for example `run \`wego login\``). Do not scrape identifiers from human-readable error text when the same value exists in JSON. Branch on the process exit code (see Exit codes), not on stderr wording, which is not a stable contract. +Run `wego whoami` before the first authenticated travel command when session state is unknown. If login is required, run its `login` subcommand, tell the user to complete the browser flow, then resume the original request. Login only completes by itself when the user's browser is on the machine that runs the CLI, and your shell is not a TTY, so you can never complete the paste fallback yourself. When stderr says no browser is on this machine, or that this terminal cannot read a paste, treat login as the user's action: ask them to run `login` in their own interactive terminal on that machine, then re-check with `whoami` (see Login environments). Never ask for an access token, and never read or print the credentials file. -**5.** Quote free-text and identifiers passed to the shell. Do not use `eval` or compose executable shell fragments from user text. +### Read stdout as JSON and branch on the exit code -**9.** Establish the pricing preferences BEFORE the first priced command. Run `wego config list`: it prints `currency`, `site` and `locale`, each with the layer that decided it – `setting` (the user's stored preference), `account` (the market on their Wego account, site only), or `default` (the API's USD / en / US floor). When `currency` or `site` reads `default`, ask the user once, in a single question, which currency to price in and which market they buy from – naming the account market if there is one. A request for answers in another language triggers that question on its own, even when currency and site are both already stored, and folds into it when they are not: name the language their results come back in, and persist it only if they agree. Then persist ONLY what they actually said: +Treat successful stdout from `whoami`, `places`, `info *`, `flights *`, and `hotels *` as JSON. `version` and `help` intentionally print plain text; login and logout are status flows. Treat stderr as status or recovery guidance. Non-empty stderr is not by itself a failure: a **successful** command can carry a hint, or the new-version notice, alongside valid stdout JSON and an exit code of `0`. On failure, stdout stays empty and stderr still carries a single actionable line – the error class and detail, a `trace_id=…` (quote it to Wego support), a Retry-After hint when present, and the next action (for example `run \`wego login\``). Do not scrape identifiers from human-readable error text when the same value exists in JSON. Branch on the process exit code (see Exit codes), not on stderr wording, which is not a stable contract. - ```bash - wego config list - wego config set currency SAR - wego config set site SA - wego config set locale ar - ``` +### Quote shell arguments - `wego config set` writes to the user's own machine, so it needs their word – the same rule as updating the CLI. If they decline, say "just this once", or do not answer, write nothing and pass `--currency` / `--site` / `--locale` on each command for that session instead. Once the values are stored, later sessions read them from `wego config list` and ask nothing. +Quote free-text and identifiers passed to the shell. Do not use `eval` or compose executable shell fragments from user text. -**10.** Preserve currency, market and locale throughout a funnel. With a stored setting, every command inherits it, so a read no longer reverts to USD – but an explicit flag still wins for that one command, and mixing the two inside one funnel is how a riyal price ends up compared against a dollar price. **A `searchId` remembers no currency.** So a search created with an explicit `--currency` must carry that same `--currency` on every later `results` / `trip` / `fares` read of it: omit it and the read is repriced into the stored preference, or into the API's USD when nothing is stored, and the two snapshots stop being comparable. Every read echoes the `currencyCode` it priced in – compare it against the one the search reported before you quote a number. **Every priced read echoes a `currencyCodeSource` beside that `currencyCode`** – both `search`es, both `results` reads, `trip`, `fares`, and both `rooms` forms – naming the layer that decided the unit: `explicit` (a `--currency` on that command), `setting` (the user's stored currency), or `default` (nobody chose one, so the API priced in USD). Read it before you quote the first number: on `default`, state the currency instead of letting the digits imply it, and offer contract item 9's one question; on `setting`, name the stored currency rather than presenting it as a choice made for this trip. It names the unit the command **asked** for, so when the top-level `currencyCode` differs from `metadata.currencyCode`, the price was not converted into the currency asked for: say that, rather than quoting the number as if it were in the requested currency. Every `*Source` field is **top level and there is exactly one per knob** – the CLI strips the API's own request-scoped copies from `metadata` before printing, so a payload never carries two answers to "who decided". There is no locale equivalent, by design: locale changes the language of the text, not the number, so no CLI output carries a `localeSource`. It still has to be asked for. When the user asks for their answers in another language, pass `--locale` on the reads whose text you will quote back to them, because the names in a Wego answer, the airlines, cities, airports, countries and holidays, come back in the language the read asked for. Translating them yourself puts your wording in front of someone who may be matching it against a booking page. Codes and keys do not move with the locale, so nothing you thread through the funnel changes: an English query still resolves `RUH` under `--locale ar`, and `results[].key` stays the same slug. Report the market when it was not explicit: `flights search` and `hotels search` echo a top-level `siteCode` beside a top-level `siteCodeSource` of `explicit`, `setting`, `account`, or `default`; `info schedules` reports the same top-level `siteCodeSource`, while its market value stays at `metadata.siteCode` – an echo only, since a published timetable does not vary by market. Confirm with the user when it reads `default`, or when the account market clearly mismatches the request (for example AED pricing against a `US` account). Do not infer a currency from the route, the destination, or a nationality. Market cannot change on `results` – a different market means a new search – and it must be re-supplied to the stateless `booking-link`. +### Establish pricing preferences first + +Establish the pricing preferences BEFORE the first priced command. Run `wego config list`: it prints `currency`, `site` and `locale`, each with the layer that decided it – `setting` (the user's stored preference), `account` (the market on their Wego account, site only), or `default` (the API's USD / en / US floor). When `currency` or `site` reads `default`, ask the user once, in a single question, which currency to price in and which market they buy from – naming the account market if there is one. A request for answers in another language triggers that question on its own, even when currency and site are both already stored, and folds into it when they are not: name the language their results come back in, and persist it only if they agree. Then persist ONLY what they actually said: + +```bash +wego config list +wego config set currency SAR +wego config set site SA +wego config set locale ar +``` + +`wego config set` writes to the user's own machine, so it needs their word – the same rule as updating the CLI. If they decline, say "just this once", or do not answer, write nothing and pass `--currency` / `--site` / `--locale` on each command for that session instead. Once the values are stored, later sessions read them from `wego config list` and ask nothing. + +### Keep currency, market and locale through a funnel + +Preserve currency, market and locale throughout a funnel. With a stored setting, every command inherits it, so a read no longer reverts to USD – but an explicit flag still wins for that one command, and mixing the two inside one funnel is how a riyal price ends up compared against a dollar price. **A `searchId` remembers no currency.** So a search created with an explicit `--currency` must carry that same `--currency` on every later `results` / `trip` / `fares` read of it: omit it and the read is repriced into the stored preference, or into the API's USD when nothing is stored, and the two snapshots stop being comparable. Every read echoes the `currencyCode` it priced in – compare it against the one the search reported before you quote a number. **Every priced read echoes a `currencyCodeSource` beside that `currencyCode`** – both `search`es, both `results` reads, `trip`, `fares`, and both `rooms` forms – naming the layer that decided the unit: `explicit` (a `--currency` on that command), `setting` (the user's stored currency), or `default` (nobody chose one, so the API priced in USD). Read it before you quote the first number: on `default`, state the currency instead of letting the digits imply it, and offer the one question from [Establish pricing preferences first](#establish-pricing-preferences-first); on `setting`, name the stored currency rather than presenting it as a choice made for this trip. It names the unit the command **asked** for, so when the top-level `currencyCode` differs from `metadata.currencyCode`, the price was not converted into the currency asked for: say that, rather than quoting the number as if it were in the requested currency. Every `*Source` field is **top level and there is exactly one per knob** – the CLI strips the API's own request-scoped copies from `metadata` before printing, so a payload never carries two answers to "who decided". There is no locale equivalent, by design: locale changes the language of the text, not the number, so no CLI output carries a `localeSource`. It still has to be asked for. When the user asks for their answers in another language, pass `--locale` on the reads whose text you will quote back to them, because the names in a Wego answer, the airlines, cities, airports, countries and holidays, come back in the language the read asked for. Translating them yourself puts your wording in front of someone who may be matching it against a booking page. Codes and keys do not move with the locale, so nothing you thread through the funnel changes: an English query still resolves `RUH` under `--locale ar`, and `results[].key` stays the same slug. Report the market when it was not explicit: `flights search` and `hotels search` echo a top-level `siteCode` beside a top-level `siteCodeSource` of `explicit`, `setting`, `account`, or `default`; `info schedules` reports the same top-level `siteCodeSource`, while its market value stays at `metadata.siteCode` – an echo only, since a published timetable does not vary by market. Confirm with the user when it reads `default`, or when the account market clearly mismatches the request (for example AED pricing against a `US` account). Do not infer a currency from the route, the destination, or a nationality. Market cannot change on `results` – a different market means a new search – and it must be re-supplied to the stateless `booking-link`. + +### Spend the search limits well + +[Plan inside the search limits](../SKILL.md#plan-inside-the-search-limits) applies here with these specifics. Reads against an existing `searchId` (`results`, `trip`, `fares`) are far cheaper than a new search, so refine an existing search instead of creating another whenever the constraint can be expressed as a flag. `hotels rooms` is the one read that always mints a search of its own, one per hotel, so open it for the hotels the user actually picked rather than sweeping a results page with it. When a limit is reached, say so in the final answer (see [Finish the answer](#finish-the-answer)). + +### Check flags with `--help` **`wego --help` is the authority on a flag.** It lists every flag of the installed binary with its allowed values. Read it before you guess a value, and before you drop a user's request because you cannot see a flag for it here: a flag this file omits and a flag the CLI lacks look the same from here. `wego --help` lists the commands. @@ -54,7 +70,7 @@ what they print. An install with no record – installed before the record existed, or with the record deleted – refuses both forms with exit code 6 and prints a reinstall command. If the user **directly asked** to update or check, that exit 6 means the requested action failed: state that -result, give the user that reinstall command to run themselves (as with a +result, offer to run that reinstall command and run it on a yes (as with a missing CLI), and do not report the update as done. Only when the check was an optional preflight for another task is it safe to note the refusal and carry on. @@ -533,9 +549,9 @@ wego config set locale ar wego config unset currency ``` -`list` is the answer to "what am I being quoted in, and who decided that". Read it in preflight (CLI contract item 9) and whenever the user questions a number: a `source` of `default` means nobody chose, so the API priced in USD for the `US` market. +`list` is the answer to "what am I being quoted in, and who decided that". Read it in preflight ([Establish pricing preferences first](#establish-pricing-preferences-first)) and whenever the user questions a number: a `source` of `default` means nobody chose, so the API priced in USD for the `US` market. -CLI contract items 9 and 10 own the two rules that matter most here: get the user's word before `set` or `unset` writes to their machine, and use `--currency` / `--site` / `--locale` for a one-off instead of writing anything. One rule lives only here: **a broken file stops every command with exit 2**, naming the path. If a user hand-edited it into an invalid state, read that stderr line back to them, since it names the file and the offending value. Do not try to repair it silently. +[Establish pricing preferences first](#establish-pricing-preferences-first) and [Keep currency, market and locale through a funnel](#keep-currency-market-and-locale-through-a-funnel) own the two rules that matter most here: get the user's word before `set` or `unset` writes to their machine, and use `--currency` / `--site` / `--locale` for a one-off instead of writing anything. One rule lives only here: **a broken file stops every command with exit 2**, naming the path. If a user hand-edited it into an invalid state, read that stderr line back to them, since it names the file and the offending value. Do not try to repair it silently. ## Send feedback @@ -580,7 +596,7 @@ final answer rather than only in the transcript behind it. | Situation | Action | |---|---| -| CLI missing, or you cannot run commands | Operating contract item 2 in [../SKILL.md](../SKILL.md). If you cannot run commands, use the Wego MCP tools, or tell the user how to connect the Wego MCP server. If `wego` is missing, link the install instructions and wait for the user to confirm; use the MCP tools only if they say they cannot install it in this environment. See [mcp.md](mcp.md) when no tool covers the task. | +| CLI missing, or you cannot run commands | [Pick the path](../SKILL.md#pick-the-path): if `wego` is missing, ask, install on a yes, then continue. See [mcp.md](mcp.md) when no tool covers the task. | | CLI outdated, or a stderr line says a new version is available | The Update the CLI section above covers both: `update --check` is read-only, the self-replacing `update -y` needs the user's approval, and a from-source run prints a reinstall hint instead. The stderr notice is not an error and not a cue to stop, so finish the request first, then offer the update once. | | This skill itself looks stale, or the user wants it in another agent | `wego skill list` shows what is installable (offline, no auth) and `wego skill install` writes the skill files embedded in the running binary. Writing files needs the user's approval first, like an update. To set the skill up for another coding agent, that same subcommand takes `--agent ` (repeatable, `'*'` for all) and `-g` for a user-wide install; omitted, it targets the agents already present. | | Not authenticated | Run `wego login`, wait for the browser flow, verify with `wego whoami`, then resume. If stderr says no browser is on this machine, or that this terminal cannot read a paste, see Login environments below – that login needs the user's own terminal. | @@ -591,7 +607,7 @@ final answer rather than only in the transcript behind it. | Search, trip, fare, or rate expired | Re-run the relevant search from saved human inputs and harvest fresh IDs. | | No results after several reads | Suggest broader filters, nearby airports or coordinates, or different dates. | | `429` (exit `5`) | The CLI auto-retries a read once, honoring `Retry-After` (capped at 60s). A read that still fails, or any failed create (POST is never auto-retried), exits `5`: wait out any `retry after Ns` hint, then make one more bounded retry and no more. Retrying is the wrong repair when you are working through a list of airports, dates or hotels, because the next call hits the same limit: narrow the work, say you are checking fewer options to stay inside the limit, and ask which ones matter. However much you recover, the limit is still named and still passed on in your final answer – see Finish the answer. | -| Cannot reach the API / timeout (exit `7`) | The API host was unreachable or the request timed out. Check network connectivity, then make one bounded retry; the CLI's stderr line names the host it tried. If the retry fails with `Cannot reach the Wego API`, follow Operating contract item 2 in [../SKILL.md](../SKILL.md). | +| Cannot reach the API / timeout (exit `7`) | The API host was unreachable or the request timed out. Check network connectivity, then make one bounded retry; the CLI's stderr line names the host it tried. If the retry fails with `Cannot reach the Wego API`, follow [Pick the path](../SKILL.md#pick-the-path). | | Non-JSON or unexpected output | Stop and report the CLI/API contract error; do not guess fields. | | User changes selection | Return to the relevant results, trip, or rooms step; do not reuse the previous option's IDs. | @@ -625,7 +641,7 @@ The process exit code is a stable taxonomy – branch on it rather than parsing | `4` | Not found / expired – `404` | Re-run the relevant search from saved human inputs and harvest fresh IDs. | | `5` | Retryable – `429` / `503` | Honor any `Retry-After`, then make one bounded retry. | | `6` | Permanent – `validation_failed` / `bad_gateway` / `internal_error` / other 4xx-5xx | Stop and report; do not blindly retry. Branch on the `code`, and on `validation_failed` read the `detail` – it names the recovery (see above). | -| `7` | Timeout / network – host unreachable or deadline hit | Check the API is up/reachable, then retry. If it still cannot reach the API, follow Operating contract item 2 in [../SKILL.md](../SKILL.md). | +| `7` | Timeout / network – host unreachable or deadline hit | Check the API is up/reachable, then retry. If it still cannot reach the API, follow [Pick the path](../SKILL.md#pick-the-path). | | `130` | Interrupted (Ctrl-C) | The run was cancelled; nothing to recover. | | `1` | Unclassified error | Report and stop. | diff --git a/skills/wego/references/mcp.md b/skills/wego/references/mcp.md index de3a568..e494368 100644 --- a/skills/wego/references/mcp.md +++ b/skills/wego/references/mcp.md @@ -1,7 +1,5 @@ -## Without the CLI (Wego MCP tools) +# Wego MCP tools -Use this section only when Operating contract item 2 in [../SKILL.md](../SKILL.md) sends you to the MCP tools. Each tool describes its own arguments, polling and paging, so read the tool rather than mapping `wego` flags onto it. - -- **Still applies:** Operating contract items 6, 7, 8, 11 and 12 in [../SKILL.md](../SKILL.md). Quote only what a tool returned, keep the ids it returned for follow-ups, present a ranked comparison, never claim a booking, and plan inside the search limits. +Use this file only when [Pick the path](../SKILL.md#pick-the-path) sends you to the MCP tools. The [rules on both paths](../SKILL.md#rules-on-both-paths) apply here. Each tool describes its own arguments, polling and paging, so read the tool rather than mapping `wego` flags onto it. If no Wego MCP tool covers the task, tell the user this connection cannot do it, and never fill the gap from memory. Name the `wego` CLI, with a link to https://agents.wego.com/cli#install, only when a `wego` command in [cli.md](cli.md) covers the task. diff --git a/src/commands.ts b/src/commands.ts index f1bb74a..bd9f2bc 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -991,7 +991,7 @@ function infoAirportsNear( * question a target swap raises. * * **stdout is the JSON object on every path**, because `info *` is one of the - * groups `SKILL.md`'s operating contract promises an agent it may `JSON.parse` + * groups the skill's CLI contract promises an agent it may `JSON.parse` * unconditionally — a table there would throw for the caller that trusted us. * The aligned text is a convenience, so it goes to **stderr**, which is where * every other human line in this CLI already goes. `--json` therefore means "the diff --git a/src/skill-embed.test.ts b/src/skill-embed.test.ts index 2353cbd..bc7d625 100644 --- a/src/skill-embed.test.ts +++ b/src/skill-embed.test.ts @@ -36,10 +36,11 @@ describe("embedded skill files", () => { const body = await SKILLS[0].files[0].read(); // Anchors from skills/wego/SKILL.md — proves the embed resolved to // the actual skill, not an empty/placeholder file. - expect(body).toContain("# Wego CLI"); - expect(body).toContain("Operating contract"); + expect(body).toContain("# Wego travel search"); + expect(body).toContain("## Pick the path"); + expect(body).toContain("## Rules on both paths"); expect(body).toContain( - "Items 3, 4, 5, 9 and 10 are CLI-only and live in [references/cli.md](references/cli.md).", + "- CLI path: [references/cli.md](references/cli.md).", ); expect(body.split("\n").length).toBeLessThan(500); expect(body.length).toBeGreaterThan(500); @@ -204,7 +205,7 @@ describe("skill embed in a compiled binary", () => { // Nothing rewrites the body any more, so the written file is byte-identical // to the on-disk source of truth. expect(installed.trimEnd()).toBe(readFileSync(skillMd, "utf8").trimEnd()); - expect(installed).toContain("# Wego CLI"); + expect(installed).toContain("# Wego travel search"); for (const { path } of SKILLS[0].files) { expect(readFileSync(join(skillsRoot, "wego", path))).toEqual( readFileSync(join(cliRoot, "skills/wego", path)),