iris-chatbot 0.2.4 → 1.0.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.
@@ -12,16 +12,16 @@ type ApprovalStore = {
12
12
  };
13
13
 
14
14
  declare global {
15
- var __zenithApprovalStore: ApprovalStore | undefined;
15
+ var __irisApprovalStore: ApprovalStore | undefined;
16
16
  }
17
17
 
18
18
  function getApprovalStore(): ApprovalStore {
19
- if (!globalThis.__zenithApprovalStore) {
20
- globalThis.__zenithApprovalStore = {
19
+ if (!globalThis.__irisApprovalStore) {
20
+ globalThis.__irisApprovalStore = {
21
21
  pendingApprovals: new Map<string, PendingApproval>(),
22
22
  };
23
23
  }
24
- return globalThis.__zenithApprovalStore;
24
+ return globalThis.__irisApprovalStore;
25
25
  }
26
26
 
27
27
  export function createApprovalRequest(params?: { timeoutMs?: number }) {
@@ -247,7 +247,7 @@ function rankPlaylistCandidates(params: {
247
247
  const rawScore = textMatchScore(candidate.name, cleanedRaw);
248
248
  const exactBonus =
249
249
  normalizeLoose(candidate.name) === normalizeLoose(cleanedQuery) ||
250
- normalizeLoose(candidate.name) === normalizeLoose(cleanedRaw)
250
+ normalizeLoose(candidate.name) === normalizeLoose(cleanedRaw)
251
251
  ? 30
252
252
  : 0;
253
253
  const playlistBonus = params.playlistRequested ? 20 : 0;
@@ -668,7 +668,9 @@ async function runMusicPlay(input: unknown, context: ToolExecutionContext) {
668
668
  title,
669
669
  artist,
670
670
  });
671
+ console.log("[music_play] Search queries:", searchQueries, "title:", title, "artist:", artist, "query:", query);
671
672
  const primaryLibraryCandidates = await searchLibraryTracks(searchQueries, context.signal);
673
+ console.log("[music_play] Primary candidates found:", primaryLibraryCandidates.length);
672
674
  let libraryCandidates = primaryLibraryCandidates;
673
675
  if (libraryCandidates.length === 0 || enforceTitleMatch || enforceArtistMatch) {
674
676
  try {
@@ -928,13 +930,22 @@ async function runMusicNowPlaying(_: unknown, context: ToolExecutionContext) {
928
930
  export const musicTools: ToolDefinition[] = [
929
931
  {
930
932
  name: "music_play",
931
- description: "Play Apple Music or resume playback.",
933
+ description: "Play a song, album, or playlist from Apple Music. Use 'query' for general searches like song names, artist names, or any combination.",
932
934
  inputSchema: {
933
935
  type: "object",
934
936
  properties: {
935
- query: { type: "string" },
936
- title: { type: "string" },
937
- artist: { type: "string" },
937
+ query: {
938
+ type: "string",
939
+ description: "The search query - can be a song name, artist name, album, or combination like 'song by artist'. This is the primary search parameter."
940
+ },
941
+ title: {
942
+ type: "string",
943
+ description: "Optional: specific track name if known exactly"
944
+ },
945
+ artist: {
946
+ type: "string",
947
+ description: "Optional: artist name to filter results"
948
+ },
938
949
  source: { type: "string", enum: ["apple_music", "local_library"] },
939
950
  },
940
951
  additionalProperties: false,