@ouro.bot/cli 0.1.0-alpha.1306 → 0.1.0-alpha.1308

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.
@@ -6,7 +6,7 @@
6
6
  <meta name="color-scheme" content="dark" />
7
7
  <title>Ouro Mailbox</title>
8
8
  <meta name="description" content="The daemon-hosted shared orientation surface for agents alive on this machine." />
9
- <script type="module" crossorigin src="/assets/index-Cu8GV60v.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-DEsikqKt.js"></script>
10
10
  <link rel="modulepreload" crossorigin href="/assets/vendor-C-KA_woR.js">
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-CXVi-0hq.css">
12
12
  </head>
@@ -73,6 +73,8 @@ const DISPATCH_EXEMPT_PATTERNS = [
73
73
  "heart/mail-import-discovery",
74
74
  "repertoire/api-client",
75
75
  "repertoire/github-client",
76
+ // The suffix that ends a tool's coded error; each tool module that uses it owns its own observability.
77
+ "repertoire/tool-error-code",
76
78
  "mind/embedding-provider",
77
79
  // Commerce utility module: error classes and pure helpers (no independent side effects).
78
80
  "repertoire/commerce-errors",
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withCode = withCode;
4
+ /**
5
+ * An error text a tool or the dispatcher returns, ending with the code its Ouro AX card names, so a model can look up
6
+ * the card's fix. The message stays first and unchanged; the code is a suffix. Pass the code as a literal: the AX
7
+ * census counts a card's code as raised only where it appears in the handler's file.
8
+ *
9
+ * It lives apart from tools-base so a tool module can use it without importing tools-base, which imports every tool
10
+ * module and so can't be loaded from one.
11
+ */
12
+ function withCode(message, code) {
13
+ return `${message} (code: ${code})`;
14
+ }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tools = exports.baseToolDefinitions = exports.editFileReadTracker = exports.SELF_FRIEND_ID = exports.routineActionRequester = exports.renderInnerProgressStatus = exports.speakTool = exports.restTool = exports.settleTool = exports.observeTool = exports.ponderTool = void 0;
4
- exports.withCode = withCode;
3
+ exports.tools = exports.baseToolDefinitions = exports.editFileReadTracker = exports.withCode = exports.SELF_FRIEND_ID = exports.routineActionRequester = exports.renderInnerProgressStatus = exports.speakTool = exports.restTool = exports.settleTool = exports.observeTool = exports.ponderTool = void 0;
5
4
  exports.routineActionDenied = routineActionDenied;
6
5
  const runtime_1 = require("../nerves/runtime");
7
6
  const tools_files_1 = require("./tools-files");
@@ -48,14 +47,8 @@ var relationship_authorization_1 = require("./relationship-authorization");
48
47
  Object.defineProperty(exports, "routineActionRequester", { enumerable: true, get: function () { return relationship_authorization_1.routineActionRequester; } });
49
48
  /** The friend id of the agent talking to itself: every private-runtime turn (awaits and its own reflection) runs with this friend. */
50
49
  exports.SELF_FRIEND_ID = "self";
51
- /**
52
- * An error text a tool or the dispatcher returns, ending with the code its Ouro AX card names, so a model can look up
53
- * the card's fix. The message stays first and unchanged; the code is a suffix. Pass the code as a literal: the AX
54
- * census counts a card's code as raised only where it appears in the handler's file.
55
- */
56
- function withCode(message, code) {
57
- return `${message} (code: ${code})`;
58
- }
50
+ var tool_error_code_1 = require("./tool-error-code");
51
+ Object.defineProperty(exports, "withCode", { enumerable: true, get: function () { return tool_error_code_1.withCode; } });
59
52
  function routineActionDenied(reason) {
60
53
  const message = reason.slice(0, 500);
61
54
  (0, runtime_1.emitNervesEvent)({ component: "repertoire", event: "repertoire.routine_action_denied", message: "routine action denied", meta: { reason: message } });
@@ -42,6 +42,7 @@ const path = __importStar(require("path"));
42
42
  const shell_sessions_1 = require("./shell-sessions");
43
43
  const identity_1 = require("../heart/identity");
44
44
  const runtime_1 = require("../nerves/runtime");
45
+ const tool_error_code_1 = require("./tool-error-code");
45
46
  const tool_arguments_1 = require("./tool-arguments");
46
47
  const tool_limits_1 = require("./tool-limits");
47
48
  const MAX_BUFFER = 16 * 1024 * 1024;
@@ -60,9 +61,10 @@ function shellHome(ctx) {
60
61
  */
61
62
  /** A failed command as one result: how it ended, then stdout and stderr, each only when it printed something. */
62
63
  function shellFailureText(error, timeout, stdout, stderr) {
64
+ // The code goes on the first line, so it survives when a long failure is cut to fit.
63
65
  const ended = error.killed && error.signal
64
- ? `the command was stopped after ${timeout} ms (${String(error.signal)}); pass a larger timeout_ms or background: true for long work`
65
- : typeof error.code === "number" ? `the command exited with code ${error.code}` : `the command could not start: ${String(error.code ?? "unknown error")}`;
66
+ ? (0, tool_error_code_1.withCode)(`the command was stopped after ${timeout} ms (${String(error.signal)}); pass a larger timeout_ms or background: true for long work`, "command-timed-out")
67
+ : typeof error.code === "number" ? (0, tool_error_code_1.withCode)(`the command exited with code ${error.code}`, "command-failed") : (0, tool_error_code_1.withCode)(`the command could not start: ${String(error.code ?? "unknown error")}`, "command-not-started");
66
68
  const parts = [ended];
67
69
  if (stdout.trim())
68
70
  parts.push(`stdout:\n${stdout.trimEnd()}`);
@@ -193,6 +195,13 @@ exports.shellToolDefinitions = [
193
195
  return output;
194
196
  },
195
197
  summaryKeys: ["command"],
198
+ ax: { id: "tool:shell", group: "turn-shell", when: "Pick this to run a program or script in your home; for plain file reads and searches, read_file, grep and glob are safer.", effect: "consequential", confirm: "Approve shell with exact arguments <the call's arguments as JSON>?", errors: [
199
+ { code: "command-failed", means: "The command ran and exited non-zero; its stdout and stderr follow the first line.", fix: "Read stderr, fix the command or its input, and run it again." },
200
+ { code: "command-timed-out", means: "The command ran past its timeout and was stopped; whatever it printed follows.", fix: "Run it again with a larger timeout_ms, at most 600000, or with background: true and watch it with shell_status." },
201
+ { code: "command-not-started", means: "The shell couldn't start the command at all, so nothing ran.", fix: "Check the program's name and that it is installed, then run it again." },
202
+ { code: "guardrail-blocked", means: "The line writes to a protected path, names the sync key's folder, or runs a command this person isn't trusted for.", fix: "Change the command so it stays off protected paths, or run it from a chat with your owner." },
203
+ { code: "orientation-hold", means: "This turn is on a correction hold and the command changes things, so it waits.", fix: "Call orientation_get, settle what the person meant, then run the command if it is still right." },
204
+ ] },
196
205
  },
197
206
  {
198
207
  tool: {
@@ -214,10 +223,15 @@ exports.shellToolDefinitions = [
214
223
  }
215
224
  const session = (0, shell_sessions_1.getShellSession)(a.id, shellOwner(ctx));
216
225
  if (!session)
217
- return `process not found: ${a.id}`;
226
+ return (0, tool_error_code_1.withCode)(`process not found: ${a.id}`, "process-not-found");
218
227
  return JSON.stringify(session);
219
228
  },
220
229
  summaryKeys: ["id"],
230
+ riskProfile: { mutates: "none", risk: "low" },
231
+ ax: { id: "tool:shell_status", group: "turn-shell", when: "Pick this to learn whether a background shell you started is still running or how it ended; shell_tail shows its output.", effect: "read", idempotent: true, errors: [
232
+ { code: "process-not-found", means: "No background shell with that id belongs to you; a runtime restart forgets them all.", fix: "Call shell_status with no id to list yours, or start the command again." },
233
+ { code: "invalid-arguments", means: "id isn't text.", fix: "Call shell_status again with the id shell returned, or with no id to list them." },
234
+ ] },
221
235
  },
222
236
  {
223
237
  tool: {
@@ -240,9 +254,14 @@ exports.shellToolDefinitions = [
240
254
  return "id is required";
241
255
  const output = (0, shell_sessions_1.tailShellSession)(a.id, shellOwner(ctx));
242
256
  if (output === undefined)
243
- return `process not found: ${a.id}`;
257
+ return (0, tool_error_code_1.withCode)(`process not found: ${a.id}`, "process-not-found");
244
258
  return output || "(no output yet)";
245
259
  },
246
260
  summaryKeys: ["id"],
261
+ riskProfile: { mutates: "none", risk: "low" },
262
+ ax: { id: "tool:shell_tail", group: "turn-shell", when: "Pick this to read the latest lines a background shell you started has printed; shell_status says only whether it still runs.", effect: "read", idempotent: true, errors: [
263
+ { code: "process-not-found", means: "That id names no background shell of yours, often because the runtime restarted since it began.", fix: "List yours with shell_status, or run the command in the background again." },
264
+ { code: "invalid-arguments", means: "id is missing or isn't text.", fix: "Call shell_tail again with the id shell returned." },
265
+ ] },
247
266
  },
248
267
  ];
@@ -56,7 +56,7 @@ exports.travelToolDefinitions = [
56
56
  properties: {
57
57
  country_code: {
58
58
  type: "string",
59
- description: "ISO 3166 alpha-2 country code (e.g. 'US', 'GB', 'AF')",
59
+ description: "ISO 3166 alpha-2 country code (e.g. 'US', 'FR', 'AF')",
60
60
  },
61
61
  },
62
62
  required: ["country_code"],
@@ -42,6 +42,7 @@ const https = __importStar(require("node:https"));
42
42
  const node_net_1 = require("node:net");
43
43
  const runtime_1 = require("../nerves/runtime");
44
44
  const tool_limits_1 = require("./tool-limits");
45
+ const tool_error_code_1 = require("./tool-error-code");
45
46
  const MAX_REDIRECTS = 5;
46
47
  /** Test hook: the request deadline. */
47
48
  exports.webTestHooks = { timeoutMs: 20_000 };
@@ -150,22 +151,22 @@ async function fetchPage(rawUrl, offset, exempt) {
150
151
  url = new URL(rawUrl);
151
152
  }
152
153
  catch {
153
- return `error: not a valid URL: ${rawUrl}`;
154
+ return (0, tool_error_code_1.withCode)(`error: not a valid URL: ${rawUrl}`, "invalid-url");
154
155
  }
155
156
  const signal = AbortSignal.timeout(exports.webTestHooks.timeoutMs);
156
157
  for (let hop = 0;; hop++) {
157
158
  if (url.protocol !== "http:" && url.protocol !== "https:")
158
- return `error: only http and https URLs can be fetched, not ${url.protocol}`;
159
+ return (0, tool_error_code_1.withCode)(`error: only http and https URLs can be fetched, not ${url.protocol}`, "invalid-url");
159
160
  const literal = url.hostname.replace(/^\[|\]$/g, "");
160
161
  if (!exempt && (0, node_net_1.isIP)(literal) && isPrivateAddress(literal))
161
- return `error: ${new RefusedError(url.hostname, literal).message}`;
162
+ return (0, tool_error_code_1.withCode)(`error: ${new RefusedError(url.hostname, literal).message}`, "private-address");
162
163
  const response = await get(url, exempt, signal);
163
164
  const status = response.statusCode;
164
165
  const location = response.headers.location;
165
166
  if (status >= 300 && status < 400 && location) {
166
167
  response.destroy();
167
168
  if (hop >= MAX_REDIRECTS)
168
- return `error: more than ${MAX_REDIRECTS} redirects fetching ${rawUrl}`;
169
+ return (0, tool_error_code_1.withCode)(`error: more than ${MAX_REDIRECTS} redirects fetching ${rawUrl}`, "fetch-failed");
169
170
  url = new URL(location, url);
170
171
  continue;
171
172
  }
@@ -175,7 +176,7 @@ async function fetchPage(rawUrl, offset, exempt) {
175
176
  }
176
177
  if (status < 200 || status >= 300) {
177
178
  response.destroy();
178
- return `error: HTTP ${status} fetching ${url.href}`;
179
+ return (0, tool_error_code_1.withCode)(`error: HTTP ${status} fetching ${url.href}`, "http-error");
179
180
  }
180
181
  const type = (response.headers["content-type"] ?? "text/plain").split(";")[0].trim().toLowerCase();
181
182
  const isHtml = type === "text/html" || type === "application/xhtml+xml";
@@ -220,11 +221,18 @@ exports.webToolDefinitions = [
220
221
  }
221
222
  catch (error) {
222
223
  if (error instanceof RefusedError)
223
- return `error: ${error.message}`;
224
+ return (0, tool_error_code_1.withCode)(`error: ${error.message}`, "private-address");
224
225
  const timedOut = error instanceof Error && (error.name === "TimeoutError" || error.name === "AbortError");
225
- return timedOut ? `error: timed out after ${exports.webTestHooks.timeoutMs / 1000} seconds fetching ${a.url}` : `error: could not fetch ${a.url}: ${error instanceof Error ? error.message : String(error)}`;
226
+ return (0, tool_error_code_1.withCode)(timedOut ? `error: timed out after ${exports.webTestHooks.timeoutMs / 1000} seconds fetching ${a.url}` : `error: could not fetch ${a.url}: ${error instanceof Error ? error.message : String(error)}`, "fetch-failed");
226
227
  }
227
228
  },
228
229
  summaryKeys: ["url"],
230
+ riskProfile: { mutates: "none", risk: "low" },
231
+ ax: { id: "tool:fetch_url", group: "turn-web", when: "Pick this to read one web page whose address you already have; to find pages about a subject first, use web_search.", effect: "read", idempotent: true, errors: [
232
+ { code: "invalid-url", means: "url isn't a full http or https address.", fix: "Send the whole address, starting with https://; read a local file with read_file instead." },
233
+ { code: "private-address", means: "The address leads to this machine or a private network, which only a family member may have fetched.", fix: "Fetch a public address, or ask a family member to have you fetch this one." },
234
+ { code: "http-error", means: "The site answered with an error status such as 404 or 403, shown in the message.", fix: "Check the address; for a 404, search for where the page moved." },
235
+ { code: "fetch-failed", means: "The page didn't arrive: the connection failed, it took over 20 seconds, or it redirected more than 5 times.", fix: "Try again once; if it fails again, use another source for the same facts." },
236
+ ] },
229
237
  },
230
238
  ];
@@ -135,61 +135,162 @@ exports.TRAVEL_ADVISORY_RSS_URL = "https://travel.state.gov/_res/rss/TAsTWs.xml"
135
135
  *
136
136
  * The RSS feed Country-Tag uses FIPS codes. Callers typically pass ISO codes.
137
137
  * When the codes match (e.g. AF for Afghanistan), no lookup is needed.
138
- * This table handles the ~30 codes where they diverge.
138
+ * A code that diverges must be listed even when its country has no advisory, because the
139
+ * bare tag then belongs to another country (ISO GB is the UK, but the feed's GB is Gabon;
140
+ * the UK's tag is UK). Values are the country names as the feed titles spell them, and a
141
+ * country with no advisory is listed so that it is reported as not found rather than
142
+ * answered with another country's advisory.
139
143
  */
140
144
  const ISO_FIPS_DIVERGENCE = {
141
- AG: "Antigua and Barbuda", // FIPS: AC
142
- AT: "Austria", // FIPS: AU
143
- AU: "Australia", // FIPS: AS
144
- BD: "Bangladesh", // FIPS: BG
145
- BH: "Bahrain", // FIPS: BA
146
- BN: "Brunei", // FIPS: BX
147
- BO: "Bolivia", // FIPS: BL
148
- BS: "Bahamas", // FIPS: BF
149
- BW: "Botswana", // FIPS: BC
150
- CD: "Congo (Kinshasa)", // FIPS: CG
151
- CH: "Switzerland", // FIPS: SZ
152
- CI: "Cote d'Ivoire", // FIPS: IV
153
- CL: "Chile", // FIPS: CI
154
- CN: "China", // FIPS: CH
155
- CZ: "Czechia", // FIPS: EZ
156
- DE: "Germany", // FIPS: GM
157
- DK: "Denmark", // FIPS: DA
158
- DO: "Dominican Republic", // FIPS: DR
159
- DZ: "Algeria", // FIPS: AG
160
- ES: "Spain", // FIPS: SP
161
- FI: "Finland", // FIPS: FI → same, but title might say "Finland"
162
- GQ: "Equatorial Guinea", // FIPS: EK
163
- HR: "Croatia", // FIPS: HR → same
164
- IE: "Ireland", // FIPS: EI
165
- IL: "Israel", // FIPS: IS
166
- JP: "Japan", // FIPS: JA
167
- KP: "North Korea", // FIPS: KN
168
- KR: "South Korea", // FIPS: KS
169
- LT: "Lithuania", // FIPS: LH
170
- MA: "Morocco", // FIPS: MO
171
- MM: "Burma", // FIPS: BM (State Dept uses "Burma (Myanmar)")
172
- NG: "Nigeria", // FIPS: NI
173
- NO: "Norway", // FIPS: NO → same
174
- PH: "Philippines", // FIPS: RP
175
- PT: "Portugal", // FIPS: PO
176
- RO: "Romania", // FIPS: RO → same
177
- SE: "Sweden", // FIPS: SW
178
- SG: "Singapore", // FIPS: SN
179
- TL: "Timor-Leste", // FIPS: TT
180
- TR: "Turkey", // FIPS: TU
181
- TW: "Taiwan", // FIPS: TW → same
182
- UA: "Ukraine", // FIPS: UP
183
- VA: "Holy See", // FIPS: VT
184
- VN: "Vietnam", // FIPS: VM
185
- YE: "Yemen", // FIPS: YM
186
- ZA: "South Africa", // FIPS: SF
145
+ AD: "Andorra",
146
+ AG: "Antigua and Barbuda",
147
+ AI: "Anguilla",
148
+ AQ: "Antarctica",
149
+ AS: "American Samoa",
150
+ AT: "Austria",
151
+ AU: "Australia",
152
+ AW: "Aruba",
153
+ AZ: "Azerbaijan",
154
+ BA: "Bosnia and Herzegovina",
155
+ BD: "Bangladesh",
156
+ BF: "Burkina Faso",
157
+ BG: "Bulgaria",
158
+ BH: "Bahrain",
159
+ BI: "Burundi",
160
+ BJ: "Benin",
161
+ BL: "Saint Barthelemy",
162
+ BM: "Bermuda",
163
+ BN: "Brunei",
164
+ BO: "Bolivia",
165
+ BS: "The Bahamas",
166
+ BW: "Botswana",
167
+ BY: "Belarus",
168
+ BZ: "Belize",
169
+ CD: "Democratic Republic of the Congo",
170
+ CF: "Central African Republic",
171
+ CG: "Republic of Congo",
172
+ CH: "Switzerland",
173
+ CI: "Côte d’Ivoire",
174
+ CL: "Chile",
175
+ CN: "China",
176
+ CR: "Costa Rica",
177
+ CW: "Curaçao",
178
+ CZ: "Czechia",
179
+ DE: "Germany",
180
+ DK: "Denmark",
181
+ DM: "Dominica",
182
+ DO: "Dominican Republic",
183
+ DZ: "Algeria",
184
+ EE: "Estonia",
185
+ ES: "Spain",
186
+ GA: "Gabon",
187
+ GB: "United Kingdom",
188
+ GD: "Grenada",
189
+ GE: "Georgia",
190
+ GF: "French Guiana",
191
+ GG: "Guernsey",
192
+ GM: "The Gambia",
193
+ GN: "Guinea",
194
+ GQ: "Equatorial Guinea",
195
+ HN: "Honduras",
196
+ HT: "Haiti",
197
+ IE: "Ireland",
198
+ IL: "Israel",
199
+ IQ: "Iraq",
200
+ IS: "Iceland",
201
+ JP: "Japan",
202
+ KH: "Cambodia",
203
+ KI: "Kiribati",
204
+ KM: "Comoros",
205
+ KN: "Saint Kitts and Nevis",
206
+ KP: "North Korea",
207
+ KR: "South Korea",
208
+ KW: "Kuwait",
209
+ KY: "Cayman Islands",
210
+ LB: "Lebanon",
211
+ LC: "Saint Lucia",
212
+ LI: "Liechtenstein",
213
+ LK: "Sri Lanka",
214
+ LR: "Liberia",
215
+ LS: "Lesotho",
216
+ LT: "Lithuania",
217
+ LV: "Latvia",
218
+ MA: "Morocco",
219
+ MC: "Monaco",
220
+ ME: "Montenegro",
221
+ MG: "Madagascar",
222
+ MH: "Marshall Islands",
223
+ MM: "Burma",
224
+ MN: "Mongolia",
225
+ MO: "Macau",
226
+ MP: "Northern Mariana Islands",
227
+ MS: "Montserrat",
228
+ MU: "Mauritius",
229
+ MW: "Malawi",
230
+ NA: "Namibia",
231
+ NE: "Niger",
232
+ NG: "Nigeria",
233
+ NI: "Nicaragua",
234
+ NU: "Niue",
235
+ OM: "Oman",
236
+ PA: "Panama",
237
+ PF: "French Polynesia",
238
+ PG: "Papua New Guinea",
239
+ PH: "Philippines",
240
+ PM: "Saint Pierre and Miquelon",
241
+ PS: "Palestinian Territories",
242
+ PT: "Portugal",
243
+ PW: "Palau",
244
+ PY: "Paraguay",
245
+ RS: "Serbia",
246
+ RU: "Russia",
247
+ SB: "Solomon Islands",
248
+ SC: "Seychelles",
249
+ SD: "Sudan",
250
+ SE: "Sweden",
251
+ SG: "Singapore",
252
+ SK: "Slovakia",
253
+ SN: "Senegal",
254
+ SR: "Suriname",
255
+ SS: "South Sudan",
256
+ ST: "São Tomé and Príncipe",
257
+ SV: "El Salvador",
258
+ SX: "Sint Maarten",
259
+ SZ: "Eswatini",
260
+ TC: "Turks and Caicos Islands",
261
+ TD: "Chad",
262
+ TG: "Togo",
263
+ TJ: "Tajikistan",
264
+ TK: "Tokelau",
265
+ TL: "Timor-Leste",
266
+ TM: "Turkmenistan",
267
+ TN: "Tunisia",
268
+ TO: "Tonga",
269
+ TR: "Turkey",
270
+ TT: "Trinidad and Tobago",
271
+ UA: "Ukraine",
272
+ VA: "Holy See",
273
+ VG: "British Virgin Islands",
274
+ VI: "U.S. Virgin Islands",
275
+ VN: "Vietnam",
276
+ VU: "Vanuatu",
277
+ XK: "Kosovo",
278
+ YE: "Yemen",
279
+ ZA: "South Africa",
280
+ ZM: "Zambia",
281
+ ZW: "Zimbabwe",
187
282
  };
188
283
  /**
189
284
  * Look up the expected country name for an ISO alpha-2 code,
190
285
  * but ONLY when that code diverges from the FIPS code used in the RSS feed.
191
286
  * Returns undefined for codes where ISO == FIPS (no title fallback needed).
192
287
  */
288
+ const normalizeCountryName = (name) => name.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[’']/g, "'").toLowerCase().replace(/^the\s+/, "").trim();
289
+ function titleMatchesCountry(titleCountry, expected) {
290
+ const title = normalizeCountryName(titleCountry);
291
+ const name = normalizeCountryName(expected);
292
+ return title === name || title.startsWith(`${name} (`);
293
+ }
193
294
  function isoToCountryName(isoCode) {
194
295
  return ISO_FIPS_DIVERGENCE[isoCode.toUpperCase()];
195
296
  }
@@ -258,10 +359,12 @@ async function getTravelAdvisory(countryCode) {
258
359
  };
259
360
  }
260
361
  // Title-based match: when ISO differs from FIPS, match by country name.
261
- // Uses startsWith to handle names like "Burma (Myanmar)" matching "Burma".
362
+ // Names match whole, ignoring case, accents, apostrophe style and a leading "The", or with a
363
+ // parenthetical like "Burma (Myanmar)" after them; a prefix alone is not enough
364
+ // ("Niger" is not "Nigeria", "Guinea" is not "Guinea-Bissau").
262
365
  if (expectedCountryName && !titleFallbackMatch) {
263
366
  const titleCountry = parseCountryName(title);
264
- if (titleCountry.toLowerCase().startsWith(expectedCountryName.toLowerCase())) {
367
+ if (titleMatchesCountry(titleCountry, expectedCountryName)) {
265
368
  titleFallbackMatch = {
266
369
  countryCode,
267
370
  countryName: titleCountry,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1306",
3
+ "version": "0.1.0-alpha.1308",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.1306",
9
+ "version": "0.1.0-alpha.1308",
10
10
  "bundleDependencies": [
11
11
  "@ouro.bot/friends"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1306",
3
+ "version": "0.1.0-alpha.1308",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },