@ouro.bot/cli 0.1.0-alpha.1219 → 0.1.0-alpha.1220

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/changelog.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1220",
6
+ "changes": [
7
+ "The Butler finds a tracked film by what it is about, not only by its title: asking for the new Holmes documentary now finds You Can See Everything, labelled as a subject match to confirm."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1219",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1219",
2
+ "runtimeVersion": "0.1.0-alpha.1220",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -222,7 +222,32 @@ function rankCandidates(term, items) {
222
222
  }
223
223
 
224
224
  const libraryCandidate = (kind, i) => ({ kind, source: kind === "series" ? "sonarr" : "radarr", service_id: i.id, title: i.title,
225
- year: i.year ?? null, tmdb_id: i.tmdbId ?? null, tvdb_id: i.tvdbId ?? null, in_library: true })
225
+ year: i.year ?? null, tmdb_id: i.tmdbId ?? null, tvdb_id: i.tvdbId ?? null, in_library: true,
226
+ overview: typeof i.overview === "string" ? i.overview : null })
227
+
228
+ // Subject matching. People name a film by what it is about as often as by its title: on 2026-11-19 Ari asked for
229
+ // "that new holmes documentary", which was Radarr 1061, You Can See Everything, and a title-only search said it had
230
+ // never been requested. So after the title matches come tracked items whose overview contains every distinctive
231
+ // word of the query. They are labelled match "subject" with the overview text, and nothing acts on one by itself.
232
+ const SUBJECT_STOP = new Set(["new", "newest", "latest", "recent", "old", "documentary", "documentaries", "doc", "docu",
233
+ "docuseries", "film", "films", "movie", "movies", "show", "shows", "series", "season", "episode", "that", "this",
234
+ "about", "with", "from", "asked", "wanted", "requested", "thing", "your", "mine"])
235
+
236
+ function subjectTokens(term) {
237
+ return normalizeTitle(term).split(" ").filter((t) => t.length >= 4 && !SUBJECT_STOP.has(t))
238
+ }
239
+
240
+ const candidateKey = (c) => `${c.kind}:${c.service_id ?? c.jellyfin_id ?? c.title}`
241
+
242
+ function subjectMatches(term, items, titled) {
243
+ const tokens = subjectTokens(term)
244
+ if (!tokens.length) return []
245
+ const taken = new Set(titled.map(candidateKey))
246
+ return items
247
+ .filter((i) => i.overview && !taken.has(candidateKey(i)))
248
+ .filter((i) => { const words = new Set(normalizeTitle(i.overview).split(" ")); return tokens.every((t) => words.has(t)) })
249
+ .map((i) => ({ ...i, match: "subject", matched_overview: i.overview.slice(0, 240) }))
250
+ }
226
251
 
227
252
  // Every library item whose title matches, best first. Sonarr and Radarr are the
228
253
  // source of truth for what is tracked; Jellyfin (when configured) adds what is
@@ -253,7 +278,8 @@ export async function findLibraryCandidates(term, kind = "any") {
253
278
  notes.push(`jellyfin_unavailable: ${e.message}`)
254
279
  }
255
280
  }
256
- const ranked = rankCandidates(term, items)
281
+ const titled = rankCandidates(term, items)
282
+ const ranked = [...titled, ...subjectMatches(term, items, titled)].map(({ overview, ...c }) => c)
257
283
  if (notes.length) Object.defineProperty(ranked, "notes", { value: notes, enumerable: false })
258
284
  return ranked
259
285
  }
@@ -348,7 +374,7 @@ export async function mediaSearch(a) {
348
374
  ...(resolution ? { library_matches: resolution.library_matches.slice(0, 10), lookup_candidates: resolution.lookup_candidates, notes: resolution.notes } : {}),
349
375
  applied_filters: { kind, year_range: a.year_range ?? null, genres: a.genres ?? [], keywords: a.keywords ?? [], on_shelf: onShelf ?? "any" },
350
376
  // So the agent never claims something is missing when the filter caused it:
351
- note: resolution?.library_matches.length ? "library_matches lists items already tracked in Sonarr/Radarr (or on the Jellyfin shelf) whose titles match, best first. Offer these before anything else."
377
+ note: resolution?.library_matches.length ? "library_matches lists items already tracked in Sonarr/Radarr (or on the Jellyfin shelf) whose titles match, best first, then any whose overview names what was asked (match: subject, with matched_overview). Offer these before anything else; a subject match is a guess to confirm with the person, not a certainty."
352
378
  : items.length === 0 && resolution?.lookup_candidates.length ? "Nothing in the library matches; lookup_candidates are TVDB/TMDB titles that are not in the library."
353
379
  : items.length === 0 ? "No matches for these filters. Loosen year_range/genres/keywords before concluding the shelf lacks it." : null,
354
380
  }
@@ -906,7 +932,7 @@ async function resolveLibraryItem(a) {
906
932
  let candidates
907
933
  if ((a.service_id !== undefined && a.service_id !== null) || a.tmdb_id) {
908
934
  const list = await arrFor(a.kind)(a.kind === "series" ? "/series" : "/movie")
909
- const items = (Array.isArray(list) ? list : []).map((i) => libraryCandidate(a.kind, i))
935
+ const items = (Array.isArray(list) ? list : []).map((i) => { const { overview, ...c } = libraryCandidate(a.kind, i); return c })
910
936
  const hit = items.filter((i) => (a.service_id !== undefined && a.service_id !== null ? i.service_id === Number(a.service_id) : i.tmdb_id === Number(a.tmdb_id)))
911
937
  if (hit.length === 1) return { item: { id: hit[0].service_id, title: hit[0].title } }
912
938
  candidates = hit
@@ -915,7 +941,7 @@ async function resolveLibraryItem(a) {
915
941
  // Act only when the best tier holds exactly one item and it is not merely a
916
942
  // typo-distance match; otherwise name the candidates and let the caller pick.
917
943
  const bestTier = ranked.filter((c) => c.match === ranked[0]?.match)
918
- if (bestTier.length === 1 && bestTier[0].match !== "fuzzy") return { item: { id: bestTier[0].service_id, title: bestTier[0].title } }
944
+ if (bestTier.length === 1 && bestTier[0].match !== "fuzzy" && bestTier[0].match !== "subject") return { item: { id: bestTier[0].service_id, title: bestTier[0].title } }
919
945
  if (!ranked.length) {
920
946
  const lookup = (await lookupCandidates(a.title, a.kind)).filter((c) => !c.in_library).map((c) => ({ ...c, not_in_library: true }))
921
947
  return { result: "not_found", candidates: lookup }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1219</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1220</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1219",
3
+ "version": "0.1.0-alpha.1220",
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.1219",
9
+ "version": "0.1.0-alpha.1220",
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.1219",
3
+ "version": "0.1.0-alpha.1220",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },