mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-25 00:16:29 +02:00
commit
c5e984e4c4
2 changed files with 57 additions and 5 deletions
|
|
@ -30,13 +30,13 @@ export function useAnalyticsIdentity() {
|
|||
|
||||
// Count notes for total_notes property
|
||||
try {
|
||||
const entries = await window.ipc.invoke('workspace:readdir', { path: '/' })
|
||||
const entries = await window.ipc.invoke('workspace:readdir', { path: '' })
|
||||
let totalNotes = 0
|
||||
if (entries) {
|
||||
for (const entry of entries) {
|
||||
if (entry.kind === 'dir') {
|
||||
try {
|
||||
const sub = await window.ipc.invoke('workspace:readdir', { path: `/${entry.name}` })
|
||||
const sub = await window.ipc.invoke('workspace:readdir', { path: `${entry.name}` })
|
||||
totalNotes += sub?.length ?? 0
|
||||
} catch {
|
||||
// skip inaccessible dirs
|
||||
|
|
|
|||
|
|
@ -6,12 +6,66 @@ import { WorkDir } from "../config/config.js";
|
|||
const CACHE_PATH = path.join(WorkDir, "config", "models.dev.json");
|
||||
const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
/*
|
||||
"claude-opus-4-6": {
|
||||
"id": "claude-opus-4-6",
|
||||
"name": "Claude Opus 4.6",
|
||||
"family": "claude-opus",
|
||||
"attachment": true,
|
||||
"reasoning": true,
|
||||
"tool_call": true,
|
||||
"temperature": true,
|
||||
"knowledge": "2025-05",
|
||||
"release_date": "2026-02-05",
|
||||
"last_updated": "2026-03-13",
|
||||
"modalities": {
|
||||
"input": [
|
||||
"text",
|
||||
"image",
|
||||
"pdf"
|
||||
],
|
||||
"output": [
|
||||
"text"
|
||||
]
|
||||
},
|
||||
"open_weights": false,
|
||||
"cost": {
|
||||
"input": 5,
|
||||
"output": 25,
|
||||
"cache_read": 0.5,
|
||||
"cache_write": 6.25
|
||||
},
|
||||
"limit": {
|
||||
"context": 1000000,
|
||||
"output": 128000
|
||||
},
|
||||
"experimental": {
|
||||
"modes": {
|
||||
"fast": {
|
||||
"cost": {
|
||||
"input": 30,
|
||||
"output": 150,
|
||||
"cache_read": 3,
|
||||
"cache_write": 37.5
|
||||
},
|
||||
"provider": {
|
||||
"body": {
|
||||
"speed": "fast"
|
||||
},
|
||||
"headers": {
|
||||
"anthropic-beta": "fast-mode-2026-02-01"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
const ModelsDevModel = z.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
release_date: z.string().optional(),
|
||||
tool_call: z.boolean().optional(),
|
||||
experimental: z.boolean().optional(),
|
||||
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
|
||||
}).passthrough();
|
||||
|
||||
|
|
@ -125,7 +179,6 @@ function pickProvider(
|
|||
}
|
||||
|
||||
function isStableModel(model: z.infer<typeof ModelsDevModel>): boolean {
|
||||
if (model.experimental) return false;
|
||||
if (model.status && ["alpha", "beta", "deprecated"].includes(model.status)) return false;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -141,7 +194,6 @@ function normalizeModels(models: Record<string, z.infer<typeof ModelsDevModel>>)
|
|||
name: model.name,
|
||||
release_date: model.release_date,
|
||||
tool_call: model.tool_call,
|
||||
experimental: model.experimental,
|
||||
status: model.status,
|
||||
}))
|
||||
.filter((model) => isStableModel(model) && supportsToolCall(model))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue