iris-chatbot 0.2.4

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.
Files changed (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/bin/iris.mjs +267 -0
  4. package/package.json +61 -0
  5. package/template/LICENSE +21 -0
  6. package/template/README.md +49 -0
  7. package/template/eslint.config.mjs +18 -0
  8. package/template/next.config.ts +7 -0
  9. package/template/package-lock.json +9193 -0
  10. package/template/package.json +46 -0
  11. package/template/postcss.config.mjs +7 -0
  12. package/template/public/file.svg +1 -0
  13. package/template/public/globe.svg +1 -0
  14. package/template/public/next.svg +1 -0
  15. package/template/public/vercel.svg +1 -0
  16. package/template/public/window.svg +1 -0
  17. package/template/src/app/api/chat/route.ts +2445 -0
  18. package/template/src/app/api/connections/models/route.ts +255 -0
  19. package/template/src/app/api/connections/test/route.ts +124 -0
  20. package/template/src/app/api/local-sync/route.ts +74 -0
  21. package/template/src/app/api/tool-approval/route.ts +47 -0
  22. package/template/src/app/favicon.ico +0 -0
  23. package/template/src/app/globals.css +808 -0
  24. package/template/src/app/layout.tsx +74 -0
  25. package/template/src/app/page.tsx +444 -0
  26. package/template/src/components/ChatView.tsx +1537 -0
  27. package/template/src/components/Composer.tsx +160 -0
  28. package/template/src/components/MapView.tsx +244 -0
  29. package/template/src/components/MessageCard.tsx +955 -0
  30. package/template/src/components/SearchModal.tsx +72 -0
  31. package/template/src/components/SettingsModal.tsx +1257 -0
  32. package/template/src/components/Sidebar.tsx +153 -0
  33. package/template/src/components/TopBar.tsx +164 -0
  34. package/template/src/lib/connections.ts +275 -0
  35. package/template/src/lib/data.ts +324 -0
  36. package/template/src/lib/db.ts +49 -0
  37. package/template/src/lib/hooks.ts +76 -0
  38. package/template/src/lib/local-sync.ts +192 -0
  39. package/template/src/lib/memory.ts +695 -0
  40. package/template/src/lib/model-presets.ts +251 -0
  41. package/template/src/lib/store.ts +36 -0
  42. package/template/src/lib/tooling/approvals.ts +78 -0
  43. package/template/src/lib/tooling/providers/anthropic.ts +155 -0
  44. package/template/src/lib/tooling/providers/ollama.ts +73 -0
  45. package/template/src/lib/tooling/providers/openai.ts +267 -0
  46. package/template/src/lib/tooling/providers/openai_compatible.ts +16 -0
  47. package/template/src/lib/tooling/providers/types.ts +44 -0
  48. package/template/src/lib/tooling/registry.ts +103 -0
  49. package/template/src/lib/tooling/runtime.ts +189 -0
  50. package/template/src/lib/tooling/safety.ts +165 -0
  51. package/template/src/lib/tooling/tools/apps.ts +108 -0
  52. package/template/src/lib/tooling/tools/apps_plus.ts +153 -0
  53. package/template/src/lib/tooling/tools/communication.ts +883 -0
  54. package/template/src/lib/tooling/tools/files.ts +395 -0
  55. package/template/src/lib/tooling/tools/music.ts +988 -0
  56. package/template/src/lib/tooling/tools/notes.ts +461 -0
  57. package/template/src/lib/tooling/tools/notes_plus.ts +294 -0
  58. package/template/src/lib/tooling/tools/numbers.ts +175 -0
  59. package/template/src/lib/tooling/tools/schedule.ts +579 -0
  60. package/template/src/lib/tooling/tools/system.ts +142 -0
  61. package/template/src/lib/tooling/tools/web.ts +212 -0
  62. package/template/src/lib/tooling/tools/workflow.ts +218 -0
  63. package/template/src/lib/tooling/types.ts +27 -0
  64. package/template/src/lib/types.ts +309 -0
  65. package/template/src/lib/utils.ts +108 -0
  66. package/template/tsconfig.json +34 -0
@@ -0,0 +1,72 @@
1
+ "use client";
2
+
3
+ import { useMemo, useState } from "react";
4
+ import { Search, X } from "lucide-react";
5
+ import type { Thread } from "../lib/types";
6
+
7
+ export default function SearchModal({
8
+ threads,
9
+ onClose,
10
+ onSelect,
11
+ }: {
12
+ threads: Thread[];
13
+ onClose: () => void;
14
+ onSelect: (id: string) => void;
15
+ }) {
16
+ const [query, setQuery] = useState("");
17
+
18
+ const results = useMemo(() => {
19
+ const q = query.trim().toLowerCase();
20
+ if (!q) return threads;
21
+ return threads.filter((thread) => thread.title.toLowerCase().includes(q));
22
+ }, [query, threads]);
23
+
24
+ return (
25
+ <div
26
+ className="fixed inset-0 z-50 flex items-start justify-center bg-black/60 px-4 pt-24"
27
+ onClick={onClose}
28
+ >
29
+ <div
30
+ className="w-full max-w-2xl rounded-2xl border border-[var(--border)] bg-[var(--panel)] shadow-[var(--shadow)]"
31
+ onClick={(event) => event.stopPropagation()}
32
+ >
33
+ <div className="flex items-center gap-3 border-b border-[var(--border)] px-4 py-3">
34
+ <Search className="h-4 w-4 text-[var(--text-muted)]" />
35
+ <input
36
+ className="flex-1 bg-transparent text-sm text-[var(--text-primary)] outline-none"
37
+ placeholder="Search chats..."
38
+ value={query}
39
+ onChange={(event) => setQuery(event.target.value)}
40
+ autoFocus
41
+ />
42
+ <button
43
+ className="rounded-full border border-[var(--border)] bg-[var(--panel-2)] p-1 text-[var(--text-muted)]"
44
+ onClick={onClose}
45
+ >
46
+ <X className="h-4 w-4" />
47
+ </button>
48
+ </div>
49
+ <div className="max-h-[420px] overflow-y-auto px-2 py-2">
50
+ {results.length === 0 ? (
51
+ <div className="px-4 py-6 text-sm text-[var(--text-muted)]">
52
+ No chats found.
53
+ </div>
54
+ ) : (
55
+ results.map((thread) => (
56
+ <button
57
+ key={thread.id}
58
+ onClick={() => onSelect(thread.id)}
59
+ className="flex w-full items-center justify-between rounded-lg px-4 py-3 text-left text-sm text-[var(--text-secondary)] hover:bg-[var(--panel-2)]"
60
+ >
61
+ <span className="line-clamp-1">{thread.title}</span>
62
+ <span className="text-xs text-[var(--text-muted)]">
63
+ {new Date(thread.updatedAt).toLocaleDateString()}
64
+ </span>
65
+ </button>
66
+ ))
67
+ )}
68
+ </div>
69
+ </div>
70
+ </div>
71
+ );
72
+ }