iris-chatbot 1.0.0 → 2.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/package-lock.json +2 -2
- package/template/package.json +1 -1
- package/template/src/app/api/local-sync/route.ts +4 -20
- package/template/src/app/page.tsx +3 -2
- package/template/src/components/SettingsModal.tsx +11 -8
- package/template/src/components/Sidebar.tsx +0 -4
- package/template/src/components/TopBar.tsx +20 -16
- package/template/src/lib/db.ts +1 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iris",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "iris",
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "2.0.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.72.1",
|
|
12
12
|
"clsx": "^2.1.1",
|
package/template/package.json
CHANGED
|
@@ -6,15 +6,14 @@ export const runtime = "nodejs";
|
|
|
6
6
|
export const dynamic = "force-dynamic";
|
|
7
7
|
|
|
8
8
|
const STATE_FILE = "state.json";
|
|
9
|
-
const
|
|
10
|
-
const DATA_DIR_LEGACY = ".zenith-data";
|
|
9
|
+
const DATA_DIR = ".iris-data";
|
|
11
10
|
|
|
12
11
|
function getStatePath(dir: string): string {
|
|
13
12
|
return path.join(process.cwd(), dir, STATE_FILE);
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
function getDataDir(): string {
|
|
17
|
-
return path.join(process.cwd(),
|
|
16
|
+
return path.join(process.cwd(), DATA_DIR);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
const EMPTY_PAYLOAD = {
|
|
@@ -41,22 +40,7 @@ export async function GET() {
|
|
|
41
40
|
return JSON.parse(raw) as Record<string, unknown>;
|
|
42
41
|
};
|
|
43
42
|
try {
|
|
44
|
-
const data = await tryRead(
|
|
45
|
-
Object.assign(payload, {
|
|
46
|
-
threads: Array.isArray(data.threads) ? data.threads : EMPTY_PAYLOAD.threads,
|
|
47
|
-
messages: Array.isArray(data.messages) ? data.messages : EMPTY_PAYLOAD.messages,
|
|
48
|
-
settings: Array.isArray(data.settings) ? data.settings : EMPTY_PAYLOAD.settings,
|
|
49
|
-
toolEvents: Array.isArray(data.toolEvents) ? data.toolEvents : EMPTY_PAYLOAD.toolEvents,
|
|
50
|
-
toolApprovals: Array.isArray(data.toolApprovals) ? data.toolApprovals : EMPTY_PAYLOAD.toolApprovals,
|
|
51
|
-
memories: Array.isArray(data.memories) ? data.memories : EMPTY_PAYLOAD.memories,
|
|
52
|
-
});
|
|
53
|
-
return Response.json(payload);
|
|
54
|
-
} catch (err) {
|
|
55
|
-
const code = err && typeof err === "object" && "code" in err ? (err as NodeJS.ErrnoException).code : null;
|
|
56
|
-
if (code !== "ENOENT") throw err;
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
const data = await tryRead(DATA_DIR_LEGACY);
|
|
43
|
+
const data = await tryRead(DATA_DIR);
|
|
60
44
|
Object.assign(payload, {
|
|
61
45
|
threads: Array.isArray(data.threads) ? data.threads : EMPTY_PAYLOAD.threads,
|
|
62
46
|
messages: Array.isArray(data.messages) ? data.messages : EMPTY_PAYLOAD.messages,
|
|
@@ -76,7 +60,7 @@ export async function GET() {
|
|
|
76
60
|
}
|
|
77
61
|
|
|
78
62
|
export async function POST(request: NextRequest) {
|
|
79
|
-
const statePath = getStatePath(
|
|
63
|
+
const statePath = getStatePath(DATA_DIR);
|
|
80
64
|
const dir = getDataDir();
|
|
81
65
|
let body: unknown;
|
|
82
66
|
try {
|
|
@@ -380,8 +380,6 @@ export default function Home() {
|
|
|
380
380
|
localToolsEnabled={Boolean(settings?.localTools?.enabled)}
|
|
381
381
|
modelPresets={modelPresets}
|
|
382
382
|
viewMode={viewMode}
|
|
383
|
-
onConnectionChange={handleConnectionChange}
|
|
384
|
-
onModelChange={handleModelChange}
|
|
385
383
|
onToggleView={() => {
|
|
386
384
|
const nextViewMode = viewMode === "chat" ? "map" : "chat";
|
|
387
385
|
if (nextViewMode === "chat") {
|
|
@@ -389,6 +387,9 @@ export default function Home() {
|
|
|
389
387
|
}
|
|
390
388
|
setViewMode(nextViewMode);
|
|
391
389
|
}}
|
|
390
|
+
showMapButton={Boolean(conversationMessages?.length)}
|
|
391
|
+
onConnectionChange={handleConnectionChange}
|
|
392
|
+
onModelChange={handleModelChange}
|
|
392
393
|
onEnableLocalTools={handleEnableLocalTools}
|
|
393
394
|
onOpenSettings={() => setSettingsOpen(true)}
|
|
394
395
|
/>
|
|
@@ -559,14 +559,6 @@ export default function SettingsModal({
|
|
|
559
559
|
<div className="mt-5 max-h-[68vh] overflow-y-auto pr-1 text-sm">
|
|
560
560
|
{activeTab === "models" ? (
|
|
561
561
|
<div className="space-y-4">
|
|
562
|
-
<label className="flex items-center gap-2 rounded-xl border border-[var(--border)] bg-[var(--panel-2)] p-3 text-sm text-[var(--text-secondary)]">
|
|
563
|
-
<input
|
|
564
|
-
type="checkbox"
|
|
565
|
-
checked={showExtendedOpenAIModels}
|
|
566
|
-
onChange={(event) => setShowExtendedOpenAIModels(event.target.checked)}
|
|
567
|
-
/>
|
|
568
|
-
Show extended OpenAI model list (non-frontier models)
|
|
569
|
-
</label>
|
|
570
562
|
<div>
|
|
571
563
|
<label className="mb-2 block text-xs uppercase tracking-[0.2em] text-[var(--text-muted)]">
|
|
572
564
|
Default Connection
|
|
@@ -624,6 +616,17 @@ export default function SettingsModal({
|
|
|
624
616
|
</div>
|
|
625
617
|
) : null}
|
|
626
618
|
</div>
|
|
619
|
+
{selectedDefaultConnection?.kind === "builtin" &&
|
|
620
|
+
selectedDefaultConnection?.provider === "openai" ? (
|
|
621
|
+
<label className="mt-3 flex items-center gap-2 text-sm text-[var(--text-secondary)]">
|
|
622
|
+
<input
|
|
623
|
+
type="checkbox"
|
|
624
|
+
checked={showExtendedOpenAIModels}
|
|
625
|
+
onChange={(event) => setShowExtendedOpenAIModels(event.target.checked)}
|
|
626
|
+
/>
|
|
627
|
+
Show extended OpenAI model list (non-frontier models)
|
|
628
|
+
</label>
|
|
629
|
+
) : null}
|
|
627
630
|
</div>
|
|
628
631
|
) : null}
|
|
629
632
|
</div>
|
|
@@ -116,10 +116,6 @@ export default function Sidebar({
|
|
|
116
116
|
))}
|
|
117
117
|
</div>
|
|
118
118
|
</div>
|
|
119
|
-
|
|
120
|
-
<div className="border-t border-[var(--border)] px-4 py-4 text-xs text-[var(--text-muted)]">
|
|
121
|
-
<span className="sidebar-text">Local mode</span>
|
|
122
|
-
</div>
|
|
123
119
|
</>
|
|
124
120
|
) : (
|
|
125
121
|
<div className="flex-1 px-2 pb-4 pt-4">
|
|
@@ -16,6 +16,7 @@ export default function TopBar({
|
|
|
16
16
|
onModelChange,
|
|
17
17
|
viewMode,
|
|
18
18
|
onToggleView,
|
|
19
|
+
showMapButton,
|
|
19
20
|
onEnableLocalTools,
|
|
20
21
|
onOpenSettings,
|
|
21
22
|
modelPresets,
|
|
@@ -30,6 +31,7 @@ export default function TopBar({
|
|
|
30
31
|
onModelChange: (model: string) => void;
|
|
31
32
|
viewMode: "chat" | "map";
|
|
32
33
|
onToggleView: () => void;
|
|
34
|
+
showMapButton: boolean;
|
|
33
35
|
onEnableLocalTools: () => void | Promise<void>;
|
|
34
36
|
onOpenSettings: () => void;
|
|
35
37
|
modelPresets: string[];
|
|
@@ -136,22 +138,24 @@ export default function TopBar({
|
|
|
136
138
|
Enable Local Tools
|
|
137
139
|
</button>
|
|
138
140
|
) : null}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
141
|
+
{showMapButton ? (
|
|
142
|
+
<button
|
|
143
|
+
className="flex items-center gap-1.5 rounded-full border border-[var(--border)] bg-[var(--bg)] px-3 py-2 text-xs text-[var(--text-secondary)] hover:border-[var(--border-strong)] sm:gap-2 sm:px-4 sm:text-sm"
|
|
144
|
+
onClick={onToggleView}
|
|
145
|
+
>
|
|
146
|
+
{viewMode === "chat" ? (
|
|
147
|
+
<>
|
|
148
|
+
<Waypoints className="h-5 w-5" />
|
|
149
|
+
<span className="hidden sm:inline">Map</span>
|
|
150
|
+
</>
|
|
151
|
+
) : (
|
|
152
|
+
<>
|
|
153
|
+
<MessageSquare className="h-5 w-5" />
|
|
154
|
+
<span className="hidden sm:inline">Chat</span>
|
|
155
|
+
</>
|
|
156
|
+
)}
|
|
157
|
+
</button>
|
|
158
|
+
) : null}
|
|
155
159
|
<button
|
|
156
160
|
className="rounded-full border border-[var(--border)] bg-[var(--bg)] p-2.5 text-[var(--text-secondary)] hover:border-[var(--border-strong)]"
|
|
157
161
|
onClick={onOpenSettings}
|
package/template/src/lib/db.ts
CHANGED
|
@@ -10,7 +10,7 @@ class IrisDB extends Dexie {
|
|
|
10
10
|
memories!: Table<MemoryEntry, string>;
|
|
11
11
|
|
|
12
12
|
constructor() {
|
|
13
|
-
super("
|
|
13
|
+
super("iris-chat");
|
|
14
14
|
this.version(1).stores({
|
|
15
15
|
messages: "id, conversationId, parentId, createdAt",
|
|
16
16
|
threads: "id, conversationId, headMessageId, updatedAt",
|