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.
- package/package.json +1 -1
- package/template/= +0 -0
- package/template/next-env.d.ts +6 -0
- package/template/package-lock.json +2 -2
- package/template/package.json +1 -1
- package/template/src/app/api/chat/route.ts +4 -3
- package/template/src/app/api/local-sync/route.ts +37 -10
- package/template/src/app/globals.css +32 -32
- package/template/src/app/layout.tsx +1 -1
- package/template/src/app/page.tsx +7 -7
- package/template/src/components/ChatView.tsx +16 -2
- package/template/src/components/Composer.tsx +13 -4
- package/template/src/components/MessageCard.tsx +15 -7
- package/template/src/components/SettingsModal.tsx +1 -1
- package/template/src/lib/db.ts +2 -2
- package/template/src/lib/memory.ts +133 -2
- package/template/src/lib/tooling/approvals.ts +4 -4
- package/template/src/lib/tooling/tools/music.ts +16 -5
- package/template/src/lib/tooling/tools/schedule.ts +813 -43
- package/template/src/lib/types.ts +1 -1
- package/template/src/lib/utils.ts +1 -1
|
@@ -12,16 +12,16 @@ type ApprovalStore = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
declare global {
|
|
15
|
-
var
|
|
15
|
+
var __irisApprovalStore: ApprovalStore | undefined;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function getApprovalStore(): ApprovalStore {
|
|
19
|
-
if (!globalThis.
|
|
20
|
-
globalThis.
|
|
19
|
+
if (!globalThis.__irisApprovalStore) {
|
|
20
|
+
globalThis.__irisApprovalStore = {
|
|
21
21
|
pendingApprovals: new Map<string, PendingApproval>(),
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
return globalThis.
|
|
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
|
-
|
|
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
|
|
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: {
|
|
936
|
-
|
|
937
|
-
|
|
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,
|