diff --git a/core/src/browser/extension.ts b/core/src/browser/extension.ts index 78f90ba166..d562bb9ea7 100644 --- a/core/src/browser/extension.ts +++ b/core/src/browser/extension.ts @@ -11,6 +11,8 @@ export enum ExtensionTypeEnum { HuggingFace = 'huggingFace', Engine = 'engine', Hardware = 'hardware', + RAG = 'rag', + VectorDB = 'vectorDB', } export interface ExtensionType { diff --git a/core/src/browser/extensions/engines/AIEngine.ts b/core/src/browser/extensions/engines/AIEngine.ts index a4f98e71ca..1be9770342 100644 --- a/core/src/browser/extensions/engines/AIEngine.ts +++ b/core/src/browser/extensions/engines/AIEngine.ts @@ -182,6 +182,7 @@ export interface SessionInfo { port: number // llama-server output port (corrected from portid) model_id: string //name of the model model_path: string // path of the loaded model + is_embedding: boolean api_key: string mmproj_path?: string } diff --git a/core/src/browser/extensions/index.ts b/core/src/browser/extensions/index.ts index 30c7de2162..6284ad7196 100644 --- a/core/src/browser/extensions/index.ts +++ b/core/src/browser/extensions/index.ts @@ -23,3 +23,8 @@ export { MCPExtension } from './mcp' * Base AI Engines. */ export * from './engines' + +export { RAGExtension, RAG_INTERNAL_SERVER } from './rag' +export type { AttachmentInput, IngestAttachmentsResult } from './rag' +export { VectorDBExtension } from './vector-db' +export type { SearchMode, VectorDBStatus, VectorChunkInput, VectorSearchResult, AttachmentFileInfo, VectorDBFileInput, VectorDBIngestOptions } from './vector-db' diff --git a/core/src/browser/extensions/rag.ts b/core/src/browser/extensions/rag.ts new file mode 100644 index 0000000000..251d0fcadf --- /dev/null +++ b/core/src/browser/extensions/rag.ts @@ -0,0 +1,36 @@ +import { BaseExtension, ExtensionTypeEnum } from '../extension' +import type { MCPTool, MCPToolCallResult } from '../../types' +import type { AttachmentFileInfo } from './vector-db' + +export interface AttachmentInput { + path: string + name?: string + type?: string + size?: number +} + +export interface IngestAttachmentsResult { + filesProcessed: number + chunksInserted: number + files: AttachmentFileInfo[] +} + +export const RAG_INTERNAL_SERVER = 'rag-internal' + +/** + * RAG extension base: exposes RAG tools and orchestration API. + */ +export abstract class RAGExtension extends BaseExtension { + type(): ExtensionTypeEnum | undefined { + return ExtensionTypeEnum.RAG + } + + abstract getTools(): Promise + /** + * Lightweight list of tool names for quick routing/lookup. + */ + abstract getToolNames(): Promise + abstract callTool(toolName: string, args: Record): Promise + + abstract ingestAttachments(threadId: string, files: AttachmentInput[]): Promise +} diff --git a/core/src/browser/extensions/vector-db.ts b/core/src/browser/extensions/vector-db.ts new file mode 100644 index 0000000000..27dec0367d --- /dev/null +++ b/core/src/browser/extensions/vector-db.ts @@ -0,0 +1,82 @@ +import { BaseExtension, ExtensionTypeEnum } from '../extension' + +export type SearchMode = 'auto' | 'ann' | 'linear' + +export interface VectorDBStatus { + ann_available: boolean +} + +export interface VectorChunkInput { + text: string + embedding: number[] +} + +export interface VectorSearchResult { + id: string + text: string + score?: number + file_id: string + chunk_file_order: number +} + +export interface AttachmentFileInfo { + id: string + name?: string + path?: string + type?: string + size?: number + chunk_count: number +} + +// High-level input types for file ingestion +export interface VectorDBFileInput { + path: string + name?: string + type?: string + size?: number +} + +export interface VectorDBIngestOptions { + chunkSize: number + chunkOverlap: number +} + +/** + * Vector DB extension base: abstraction over local vector storage and search. + */ +export abstract class VectorDBExtension extends BaseExtension { + type(): ExtensionTypeEnum | undefined { + return ExtensionTypeEnum.VectorDB + } + + abstract getStatus(): Promise + abstract createCollection(threadId: string, dimension: number): Promise + abstract insertChunks( + threadId: string, + fileId: string, + chunks: VectorChunkInput[] + ): Promise + abstract ingestFile( + threadId: string, + file: VectorDBFileInput, + opts: VectorDBIngestOptions + ): Promise + abstract searchCollection( + threadId: string, + query_embedding: number[], + limit: number, + threshold: number, + mode?: SearchMode, + fileIds?: string[] + ): Promise + abstract deleteChunks(threadId: string, ids: string[]): Promise + abstract deleteFile(threadId: string, fileId: string): Promise + abstract deleteCollection(threadId: string): Promise + abstract listAttachments(threadId: string, limit?: number): Promise + abstract getChunks( + threadId: string, + fileId: string, + startOrder: number, + endOrder: number + ): Promise +} diff --git a/core/src/types/setting/settingComponent.ts b/core/src/types/setting/settingComponent.ts index 9dfd9b5975..57b222d870 100644 --- a/core/src/types/setting/settingComponent.ts +++ b/core/src/types/setting/settingComponent.ts @@ -12,6 +12,8 @@ export type SettingComponentProps = { extensionName?: string requireModelReload?: boolean configType?: ConfigType + titleKey?: string + descriptionKey?: string } export type ConfigType = 'runtime' | 'setting' diff --git a/extensions-web/src/jan-provider-web/provider.ts b/extensions-web/src/jan-provider-web/provider.ts index 3375fd3517..67e513c3f1 100644 --- a/extensions-web/src/jan-provider-web/provider.ts +++ b/extensions-web/src/jan-provider-web/provider.ts @@ -45,7 +45,7 @@ export default class JanProviderWeb extends AIEngine { // Verify Jan models capabilities in localStorage private validateJanModelsLocalStorage() { try { - console.log("Validating Jan models in localStorage...") + console.log('Validating Jan models in localStorage...') const storageKey = 'model-provider' const data = localStorage.getItem(storageKey) if (!data) return @@ -60,9 +60,14 @@ export default class JanProviderWeb extends AIEngine { if (provider.provider === 'jan' && provider.models) { for (const model of provider.models) { console.log(`Checking Jan model: ${model.id}`, model.capabilities) - if (JSON.stringify(model.capabilities) !== JSON.stringify(JAN_MODEL_CAPABILITIES)) { + if ( + JSON.stringify(model.capabilities) !== + JSON.stringify(JAN_MODEL_CAPABILITIES) + ) { hasInvalidModel = true - console.log(`Found invalid Jan model: ${model.id}, clearing localStorage`) + console.log( + `Found invalid Jan model: ${model.id}, clearing localStorage` + ) break } } @@ -79,9 +84,17 @@ export default class JanProviderWeb extends AIEngine { // If still present, try setting to empty state if (afterRemoval) { // Try alternative clearing method - localStorage.setItem(storageKey, JSON.stringify({ state: { providers: [] }, version: parsed.version || 3 })) + localStorage.setItem( + storageKey, + JSON.stringify({ + state: { providers: [] }, + version: parsed.version || 3, + }) + ) } - console.log('Cleared model-provider from localStorage due to invalid Jan capabilities') + console.log( + 'Cleared model-provider from localStorage due to invalid Jan capabilities' + ) // Force a page reload to ensure clean state window.location.reload() } @@ -159,6 +172,7 @@ export default class JanProviderWeb extends AIEngine { port: 443, // HTTPS port model_id: modelId, model_path: `remote:${modelId}`, // Indicate this is a remote model + is_embedding: false, // assume false here, TODO: might need further implementation api_key: '', // API key handled by auth service } @@ -193,8 +207,12 @@ export default class JanProviderWeb extends AIEngine { console.error(`Failed to unload Jan session ${sessionId}:`, error) return { success: false, - error: error instanceof ApiError ? error.message : - error instanceof Error ? error.message : 'Unknown error', + error: + error instanceof ApiError + ? error.message + : error instanceof Error + ? error.message + : 'Unknown error', } } } diff --git a/extensions/llamacpp-extension/src/index.ts b/extensions/llamacpp-extension/src/index.ts index d5d13804fa..8d4f277b69 100644 --- a/extensions/llamacpp-extension/src/index.ts +++ b/extensions/llamacpp-extension/src/index.ts @@ -333,14 +333,12 @@ export default class llamacpp_extension extends AIEngine { ) // Clear the invalid stored preference this.clearStoredBackendType() - bestAvailableBackendString = await this.determineBestBackend( - version_backends - ) + bestAvailableBackendString = + await this.determineBestBackend(version_backends) } } else { - bestAvailableBackendString = await this.determineBestBackend( - version_backends - ) + bestAvailableBackendString = + await this.determineBestBackend(version_backends) } let settings = structuredClone(SETTINGS) @@ -1530,6 +1528,7 @@ export default class llamacpp_extension extends AIEngine { if ( this.autoUnload && + !isEmbedding && (loadedModels.length > 0 || otherLoadingPromises.length > 0) ) { // Wait for OTHER loading models to finish, then unload everything @@ -1537,10 +1536,33 @@ export default class llamacpp_extension extends AIEngine { await Promise.all(otherLoadingPromises) } - // Now unload all loaded models + // Now unload all loaded Text models excluding embedding models const allLoadedModels = await this.getLoadedModels() if (allLoadedModels.length > 0) { - await Promise.all(allLoadedModels.map((model) => this.unload(model))) + const sessionInfos: (SessionInfo | null)[] = await Promise.all( + allLoadedModels.map(async (modelId) => { + try { + return await this.findSessionByModel(modelId) + } catch (e) { + logger.warn(`Unable to find session for model "${modelId}": ${e}`) + return null // treat as “not‑eligible for unload” + } + }) + ) + + logger.info(JSON.stringify(sessionInfos)) + + const nonEmbeddingModels: string[] = sessionInfos + .filter( + (s): s is SessionInfo => s !== null && s.is_embedding === false + ) + .map((s) => s.model_id) + + if (nonEmbeddingModels.length > 0) { + await Promise.all( + nonEmbeddingModels.map((modelId) => this.unload(modelId)) + ) + } } } const args: string[] = [] @@ -1638,7 +1660,7 @@ export default class llamacpp_extension extends AIEngine { if (cfg.no_kv_offload) args.push('--no-kv-offload') if (isEmbedding) { args.push('--embedding') - args.push('--pooling mean') + args.push('--pooling', 'mean') } else { if (cfg.ctx_size > 0) args.push('--ctx-size', String(cfg.ctx_size)) if (cfg.n_predict > 0) args.push('--n-predict', String(cfg.n_predict)) @@ -1677,6 +1699,7 @@ export default class llamacpp_extension extends AIEngine { libraryPath, args, envs, + isEmbedding, } ) return sInfo @@ -2083,6 +2106,7 @@ export default class llamacpp_extension extends AIEngine { } async embed(text: string[]): Promise { + // Ensure the sentence-transformer model is present let sInfo = await this.findSessionByModel('sentence-transformer-mini') if (!sInfo) { const downloadedModelList = await this.list() @@ -2096,30 +2120,45 @@ export default class llamacpp_extension extends AIEngine { 'https://huggingface.co/second-state/All-MiniLM-L6-v2-Embedding-GGUF/resolve/main/all-MiniLM-L6-v2-ggml-model-f16.gguf?download=true', }) } - sInfo = await this.load('sentence-transformer-mini') + // Load specifically in embedding mode + sInfo = await this.load('sentence-transformer-mini', undefined, true) } - const baseUrl = `http://localhost:${sInfo.port}/v1/embeddings` - const headers = { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${sInfo.api_key}`, + + const attemptRequest = async (session: SessionInfo) => { + const baseUrl = `http://localhost:${session.port}/v1/embeddings` + const headers = { + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${session.api_key}`, + } + const body = JSON.stringify({ + input: text, + model: session.model_id, + encoding_format: 'float', + }) + const response = await fetch(baseUrl, { + method: 'POST', + headers, + body, + }) + return response + } + + // First try with the existing session (may have been started without --embedding previously) + let response = await attemptRequest(sInfo) + + // If embeddings endpoint is not available (501), reload with embedding mode and retry once + if (response.status === 501) { + try { + await this.unload('sentence-transformer-mini') + } catch {} + sInfo = await this.load('sentence-transformer-mini', undefined, true) + response = await attemptRequest(sInfo) } - const body = JSON.stringify({ - input: text, - model: sInfo.model_id, - encoding_format: 'float', - }) - const response = await fetch(baseUrl, { - method: 'POST', - headers, - body, - }) if (!response.ok) { const errorData = await response.json().catch(() => null) throw new Error( - `API request failed with status ${response.status}: ${JSON.stringify( - errorData - )}` + `API request failed with status ${response.status}: ${JSON.stringify(errorData)}` ) } const responseData = await response.json() diff --git a/extensions/rag-extension/package.json b/extensions/rag-extension/package.json new file mode 100644 index 0000000000..5634d54161 --- /dev/null +++ b/extensions/rag-extension/package.json @@ -0,0 +1,33 @@ +{ + "name": "@janhq/rag-extension", + "productName": "RAG Tools", + "version": "0.1.0", + "description": "Registers RAG tools and orchestrates retrieval across parser, embeddings, and vector DB", + "main": "dist/index.js", + "module": "dist/module.js", + "author": "Jan ", + "license": "AGPL-3.0", + "scripts": { + "build": "rolldown -c rolldown.config.mjs", + "build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install" + }, + "devDependencies": { + "cpx": "1.5.0", + "rimraf": "6.0.1", + "rolldown": "1.0.0-beta.1", + "typescript": "5.9.2" + }, + "dependencies": { + "@janhq/core": "../../core/package.tgz", + "@janhq/tauri-plugin-rag-api": "link:../../src-tauri/plugins/tauri-plugin-rag", + "@janhq/tauri-plugin-vector-db-api": "link:../../src-tauri/plugins/tauri-plugin-vector-db" + }, + "files": [ + "dist/*", + "package.json" + ], + "installConfig": { + "hoistingLimits": "workspaces" + }, + "packageManager": "yarn@4.5.3" +} diff --git a/extensions/rag-extension/rolldown.config.mjs b/extensions/rag-extension/rolldown.config.mjs new file mode 100644 index 0000000000..e9b1905469 --- /dev/null +++ b/extensions/rag-extension/rolldown.config.mjs @@ -0,0 +1,14 @@ +import { defineConfig } from 'rolldown' +import settingJson from './settings.json' with { type: 'json' } + +export default defineConfig({ + input: 'src/index.ts', + output: { + format: 'esm', + file: 'dist/index.js', + }, + platform: 'browser', + define: { + SETTINGS: JSON.stringify(settingJson), + }, +}) diff --git a/extensions/rag-extension/settings.json b/extensions/rag-extension/settings.json new file mode 100644 index 0000000000..1462db7711 --- /dev/null +++ b/extensions/rag-extension/settings.json @@ -0,0 +1,58 @@ +[ + { + "key": "enabled", + "titleKey": "settings:attachments.enable", + "descriptionKey": "settings:attachments.enableDesc", + "controllerType": "checkbox", + "controllerProps": { "value": true } + }, + { + "key": "max_file_size_mb", + "titleKey": "settings:attachments.maxFile", + "descriptionKey": "settings:attachments.maxFileDesc", + "controllerType": "input", + "controllerProps": { "value": 20, "type": "number", "min": 1, "max": 200, "step": 1, "textAlign": "right" } + }, + { + "key": "retrieval_limit", + "titleKey": "settings:attachments.topK", + "descriptionKey": "settings:attachments.topKDesc", + "controllerType": "input", + "controllerProps": { "value": 3, "type": "number", "min": 1, "max": 20, "step": 1, "textAlign": "right" } + }, + { + "key": "retrieval_threshold", + "titleKey": "settings:attachments.threshold", + "descriptionKey": "settings:attachments.thresholdDesc", + "controllerType": "input", + "controllerProps": { "value": 0.3, "type": "number", "min": 0, "max": 1, "step": 0.01, "textAlign": "right" } + }, + { + "key": "chunk_size_tokens", + "titleKey": "settings:attachments.chunkSize", + "descriptionKey": "settings:attachments.chunkSizeDesc", + "controllerType": "input", + "controllerProps": { "value": 512, "type": "number", "min": 64, "max": 8192, "step": 64, "textAlign": "right" } + }, + { + "key": "overlap_tokens", + "titleKey": "settings:attachments.chunkOverlap", + "descriptionKey": "settings:attachments.chunkOverlapDesc", + "controllerType": "input", + "controllerProps": { "value": 64, "type": "number", "min": 0, "max": 1024, "step": 16, "textAlign": "right" } + }, + { + "key": "search_mode", + "titleKey": "settings:attachments.searchMode", + "descriptionKey": "settings:attachments.searchModeDesc", + "controllerType": "dropdown", + "controllerProps": { + "value": "auto", + "options": [ + { "name": "Auto (recommended)", "value": "auto" }, + { "name": "ANN (sqlite-vec)", "value": "ann" }, + { "name": "Linear", "value": "linear" } + ] + } + } +] diff --git a/extensions/rag-extension/src/env.d.ts b/extensions/rag-extension/src/env.d.ts new file mode 100644 index 0000000000..512ce05052 --- /dev/null +++ b/extensions/rag-extension/src/env.d.ts @@ -0,0 +1,5 @@ +import type { SettingComponentProps } from '@janhq/core' +declare global { + const SETTINGS: SettingComponentProps[] +} +export {} diff --git a/extensions/rag-extension/src/global.d.ts b/extensions/rag-extension/src/global.d.ts new file mode 100644 index 0000000000..f6fa6968e1 --- /dev/null +++ b/extensions/rag-extension/src/global.d.ts @@ -0,0 +1,14 @@ +import type { BaseExtension, ExtensionTypeEnum } from '@janhq/core' + +declare global { + interface Window { + core?: { + extensionManager: { + get(type: ExtensionTypeEnum): T | undefined + getByName(name: string): BaseExtension | undefined + } + } + } +} + +export {} diff --git a/extensions/rag-extension/src/index.ts b/extensions/rag-extension/src/index.ts new file mode 100644 index 0000000000..4a2edc2eab --- /dev/null +++ b/extensions/rag-extension/src/index.ts @@ -0,0 +1,305 @@ +import { RAGExtension, MCPTool, MCPToolCallResult, ExtensionTypeEnum, VectorDBExtension, type AttachmentInput, type SettingComponentProps, AIEngine, type AttachmentFileInfo } from '@janhq/core' +import './env.d' +import { getRAGTools, RETRIEVE, LIST_ATTACHMENTS, GET_CHUNKS } from './tools' + +export default class RagExtension extends RAGExtension { + private config = { + enabled: true, + retrievalLimit: 3, + retrievalThreshold: 0.3, + chunkSizeTokens: 512, + overlapTokens: 64, + searchMode: 'auto' as 'auto' | 'ann' | 'linear', + maxFileSizeMB: 20, + } + + async onLoad(): Promise { + const settings = structuredClone(SETTINGS) as SettingComponentProps[] + await this.registerSettings(settings) + this.config.enabled = await this.getSetting('enabled', this.config.enabled) + this.config.maxFileSizeMB = await this.getSetting('max_file_size_mb', this.config.maxFileSizeMB) + this.config.retrievalLimit = await this.getSetting('retrieval_limit', this.config.retrievalLimit) + this.config.retrievalThreshold = await this.getSetting('retrieval_threshold', this.config.retrievalThreshold) + this.config.chunkSizeTokens = await this.getSetting('chunk_size_tokens', this.config.chunkSizeTokens) + this.config.overlapTokens = await this.getSetting('overlap_tokens', this.config.overlapTokens) + this.config.searchMode = await this.getSetting('search_mode', this.config.searchMode) + + // Check ANN availability on load + try { + const vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB) as unknown as VectorDBExtension + if (vec?.getStatus) { + const status = await vec.getStatus() + console.log('[RAG] Vector DB ANN support:', status.ann_available ? '✓ AVAILABLE' : '✗ NOT AVAILABLE') + if (!status.ann_available) { + console.warn('[RAG] Warning: sqlite-vec not loaded. Collections will use slower linear search.') + } + } + } catch (e) { + console.error('[RAG] Failed to check ANN status:', e) + } + } + + onUnload(): void {} + + async getTools(): Promise { + return getRAGTools(this.config.retrievalLimit) + } + + async getToolNames(): Promise { + // Keep this in sync with getTools() but without building full schemas + return [LIST_ATTACHMENTS, RETRIEVE, GET_CHUNKS] + } + + async callTool(toolName: string, args: Record): Promise { + switch (toolName) { + case LIST_ATTACHMENTS: + return this.listAttachments(args) + case RETRIEVE: + return this.retrieve(args) + case GET_CHUNKS: + return this.getChunks(args) + default: + return { + error: `Unknown tool: ${toolName}`, + content: [{ type: 'text', text: `Unknown tool: ${toolName}` }], + } + } + } + + private async listAttachments(args: Record): Promise { + const threadId = String(args['thread_id'] || '') + if (!threadId) { + return { error: 'Missing thread_id', content: [{ type: 'text', text: 'Missing thread_id' }] } + } + try { + const vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB) as unknown as VectorDBExtension + if (!vec?.listAttachments) { + return { error: 'Vector DB extension missing listAttachments', content: [{ type: 'text', text: 'Vector DB extension missing listAttachments' }] } + } + const files = await vec.listAttachments(threadId) + return { + error: '', + content: [ + { + type: 'text', + text: JSON.stringify({ thread_id: threadId, attachments: files || [] }), + }, + ], + } + } catch (e) { + const msg = e instanceof Error ? e.message : String(e) + return { error: msg, content: [{ type: 'text', text: `List attachments failed: ${msg}` }] } + } + } + + private async retrieve(args: Record): Promise { + const threadId = String(args['thread_id'] || '') + const query = String(args['query'] || '') + const fileIds = args['file_ids'] as string[] | undefined + + const s = this.config + const topK = (args['top_k'] as number) || s.retrievalLimit || 3 + const threshold = s.retrievalThreshold ?? 0.3 + const mode: 'auto' | 'ann' | 'linear' = s.searchMode || 'auto' + + if (s.enabled === false) { + return { + error: 'Attachments feature disabled', + content: [ + { + type: 'text', + text: 'Attachments are disabled in Settings. Enable them to use retrieval.', + }, + ], + } + } + if (!threadId || !query) { + return { + error: 'Missing thread_id or query', + content: [{ type: 'text', text: 'Missing required parameters' }], + } + } + + try { + // Resolve extensions + const vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB) as unknown as VectorDBExtension + if (!vec?.searchCollection) { + return { + error: 'RAG dependencies not available', + content: [ + { type: 'text', text: 'Vector DB extension not available' }, + ], + } + } + + const queryEmb = (await this.embedTexts([query]))?.[0] + if (!queryEmb) { + return { + error: 'Failed to compute embeddings', + content: [{ type: 'text', text: 'Failed to compute embeddings' }], + } + } + + const results = await vec.searchCollection( + threadId, + queryEmb, + topK, + threshold, + mode, + fileIds + ) + + const payload = { + thread_id: threadId, + query, + citations: results?.map((r: any) => ({ + id: r.id, + text: r.text, + score: r.score, + file_id: r.file_id, + chunk_file_order: r.chunk_file_order + })) ?? [], + mode, + } + return { error: '', content: [{ type: 'text', text: JSON.stringify(payload) }] } + } catch (e) { + console.error('[RAG] Retrieve error:', e) + let msg = 'Unknown error' + if (e instanceof Error) { + msg = e.message + } else if (typeof e === 'string') { + msg = e + } else if (e && typeof e === 'object') { + msg = JSON.stringify(e) + } + return { error: msg, content: [{ type: 'text', text: `Retrieve failed: ${msg}` }] } + } + } + + private async getChunks(args: Record): Promise { + const threadId = String(args['thread_id'] || '') + const fileId = String(args['file_id'] || '') + const startOrder = args['start_order'] as number | undefined + const endOrder = args['end_order'] as number | undefined + + if (!threadId || !fileId || startOrder === undefined || endOrder === undefined) { + return { + error: 'Missing thread_id, file_id, start_order, or end_order', + content: [{ type: 'text', text: 'Missing required parameters' }], + } + } + + try { + const vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB) as unknown as VectorDBExtension + if (!vec?.getChunks) { + return { + error: 'Vector DB extension not available', + content: [{ type: 'text', text: 'Vector DB extension not available' }], + } + } + + const chunks = await vec.getChunks(threadId, fileId, startOrder, endOrder) + + const payload = { + thread_id: threadId, + file_id: fileId, + chunks: chunks || [], + } + return { error: '', content: [{ type: 'text', text: JSON.stringify(payload) }] } + } catch (e) { + const msg = e instanceof Error ? e.message : String(e) + return { error: msg, content: [{ type: 'text', text: `Get chunks failed: ${msg}` }] } + } + } + + // Desktop-only ingestion by file paths + async ingestAttachments( + threadId: string, + files: AttachmentInput[] + ): Promise<{ filesProcessed: number; chunksInserted: number; files: AttachmentFileInfo[] }> { + if (!threadId || !Array.isArray(files) || files.length === 0) { + return { filesProcessed: 0, chunksInserted: 0, files: [] } + } + + // Respect feature flag: do nothing when disabled + if (this.config.enabled === false) { + return { filesProcessed: 0, chunksInserted: 0, files: [] } + } + + const vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB) as unknown as VectorDBExtension + if (!vec?.createCollection || !vec?.insertChunks) { + throw new Error('Vector DB extension not available') + } + + // Load settings + const s = this.config + const maxSize = (s?.enabled === false ? 0 : s?.maxFileSizeMB) || undefined + const chunkSize = s?.chunkSizeTokens as number | undefined + const chunkOverlap = s?.overlapTokens as number | undefined + + let totalChunks = 0 + const processedFiles: AttachmentFileInfo[] = [] + + for (const f of files) { + if (!f?.path) continue + if (maxSize && f.size && f.size > maxSize * 1024 * 1024) { + throw new Error(`File '${f.name}' exceeds size limit (${f.size} bytes > ${maxSize} MB).`) + } + + const fileName = f.name || f.path.split(/[\\/]/).pop() + // Preferred/required path: let Vector DB extension handle full file ingestion + const canIngestFile = typeof (vec as any)?.ingestFile === 'function' + if (!canIngestFile) { + console.error('[RAG] Vector DB extension missing ingestFile; cannot ingest document') + continue + } + const info = await (vec as VectorDBExtension).ingestFile( + threadId, + { path: f.path, name: fileName, type: f.type, size: f.size }, + { chunkSize: chunkSize ?? 512, chunkOverlap: chunkOverlap ?? 64 } + ) + totalChunks += Number(info?.chunk_count || 0) + processedFiles.push(info) + } + + // Return files we ingested with real IDs directly from ingestFile + return { filesProcessed: processedFiles.length, chunksInserted: totalChunks, files: processedFiles } + } + + onSettingUpdate(key: string, value: T): void { + switch (key) { + case 'enabled': + this.config.enabled = Boolean(value) + break + case 'max_file_size_mb': + this.config.maxFileSizeMB = Number(value) + break + case 'retrieval_limit': + this.config.retrievalLimit = Number(value) + break + case 'retrieval_threshold': + this.config.retrievalThreshold = Number(value) + break + case 'chunk_size_tokens': + this.config.chunkSizeTokens = Number(value) + break + case 'overlap_tokens': + this.config.overlapTokens = Number(value) + break + case 'search_mode': + this.config.searchMode = String(value) as 'auto' | 'ann' | 'linear' + break + } + } + + // Locally implement embedding logic (previously in embeddings-extension) + private async embedTexts(texts: string[]): Promise { + const llm = window.core?.extensionManager.getByName('@janhq/llamacpp-extension') as AIEngine & { embed?: (texts: string[]) => Promise<{ data: Array<{ embedding: number[]; index: number }> }> } + if (!llm?.embed) throw new Error('llamacpp extension not available') + const res = await llm.embed(texts) + const data: Array<{ embedding: number[]; index: number }> = res?.data || [] + const out: number[][] = new Array(texts.length) + for (const item of data) out[item.index] = item.embedding + return out + } +} diff --git a/extensions/rag-extension/src/tools.ts b/extensions/rag-extension/src/tools.ts new file mode 100644 index 0000000000..a881891b4e --- /dev/null +++ b/extensions/rag-extension/src/tools.ts @@ -0,0 +1,58 @@ +import { MCPTool, RAG_INTERNAL_SERVER } from '@janhq/core' + +// Tool names +export const RETRIEVE = 'retrieve' +export const LIST_ATTACHMENTS = 'list_attachments' +export const GET_CHUNKS = 'get_chunks' + +export function getRAGTools(retrievalLimit: number): MCPTool[] { + const maxTopK = Math.max(1, Number(retrievalLimit ?? 3)) + + return [ + { + name: LIST_ATTACHMENTS, + description: + 'List files attached to the current thread. Thread is inferred automatically; you may optionally provide {"scope":"thread"}. Returns basic file info (name/path).', + inputSchema: { + type: 'object', + properties: { + scope: { type: 'string', enum: ['thread'], description: 'Retrieval scope; currently only thread is supported' }, + }, + required: ['scope'], + }, + server: RAG_INTERNAL_SERVER, + }, + { + name: RETRIEVE, + description: + 'Retrieve relevant snippets from locally attached, indexed documents. Use query only; do not pass raw document content. Thread context is inferred automatically; you may optionally provide {"scope":"thread"}. Use file_ids to search within specific files only.', + inputSchema: { + type: 'object', + properties: { + query: { type: 'string', description: 'User query to search for' }, + top_k: { type: 'number', description: 'Optional: Max citations to return. Adjust as needed.', minimum: 1, maximum: maxTopK, default: retrievalLimit ?? 3 }, + scope: { type: 'string', enum: ['thread'], description: 'Retrieval scope; currently only thread is supported' }, + file_ids: { type: 'array', items: { type: 'string' }, description: 'Optional: Filter search to specific file IDs from list_attachments' }, + }, + required: ['query', 'scope'], + }, + server: RAG_INTERNAL_SERVER, + }, + { + name: GET_CHUNKS, + description: + 'Retrieve chunks from a file by their order range. For a single chunk, use start_order = end_order. Thread context is inferred automatically; you may optionally provide {"scope":"thread"}. Use sparingly; intended for advanced usage. Prefer using retrieve instead for relevance-based fetching.', + inputSchema: { + type: 'object', + properties: { + file_id: { type: 'string', description: 'File ID from list_attachments' }, + start_order: { type: 'number', description: 'Start of chunk range (inclusive, 0-indexed)' }, + end_order: { type: 'number', description: 'End of chunk range (inclusive, 0-indexed). For single chunk, use start_order = end_order.' }, + scope: { type: 'string', enum: ['thread'], description: 'Retrieval scope; currently only thread is supported' }, + }, + required: ['file_id', 'start_order', 'end_order', 'scope'], + }, + server: RAG_INTERNAL_SERVER, + }, + ] +} diff --git a/extensions/vector-db-extension/package.json b/extensions/vector-db-extension/package.json new file mode 100644 index 0000000000..ba3a8d439e --- /dev/null +++ b/extensions/vector-db-extension/package.json @@ -0,0 +1,33 @@ +{ + "name": "@janhq/vector-db-extension", + "productName": "Vector DB", + "version": "0.1.0", + "description": "Vector DB integration using sqlite-vec if available with linear fallback", + "main": "dist/index.js", + "module": "dist/module.js", + "author": "Jan ", + "license": "AGPL-3.0", + "scripts": { + "build": "rolldown -c rolldown.config.mjs", + "build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install" + }, + "devDependencies": { + "cpx": "1.5.0", + "rimraf": "6.0.1", + "rolldown": "1.0.0-beta.1", + "typescript": "5.9.2" + }, + "dependencies": { + "@janhq/core": "../../core/package.tgz", + "@janhq/tauri-plugin-rag-api": "link:../../src-tauri/plugins/tauri-plugin-rag", + "@janhq/tauri-plugin-vector-db-api": "link:../../src-tauri/plugins/tauri-plugin-vector-db" + }, + "files": [ + "dist/*", + "package.json" + ], + "installConfig": { + "hoistingLimits": "workspaces" + }, + "packageManager": "yarn@4.5.3" +} diff --git a/extensions/vector-db-extension/rolldown.config.mjs b/extensions/vector-db-extension/rolldown.config.mjs new file mode 100644 index 0000000000..7c4b940176 --- /dev/null +++ b/extensions/vector-db-extension/rolldown.config.mjs @@ -0,0 +1,11 @@ +import { defineConfig } from 'rolldown' + +export default defineConfig({ + input: 'src/index.ts', + output: { + format: 'esm', + file: 'dist/index.js', + }, + platform: 'browser', + define: {}, +}) diff --git a/extensions/vector-db-extension/src/index.ts b/extensions/vector-db-extension/src/index.ts new file mode 100644 index 0000000000..f55710f07e --- /dev/null +++ b/extensions/vector-db-extension/src/index.ts @@ -0,0 +1,107 @@ +import { VectorDBExtension, type SearchMode, type VectorDBStatus, type VectorChunkInput, type VectorSearchResult, type AttachmentFileInfo, type VectorDBFileInput, type VectorDBIngestOptions, AIEngine } from '@janhq/core' +import * as vecdb from '@janhq/tauri-plugin-vector-db-api' +import * as ragApi from '@janhq/tauri-plugin-rag-api' + +export default class VectorDBExt extends VectorDBExtension { + async onLoad(): Promise { + // no-op + } + + onUnload(): void {} + + async getStatus(): Promise { + return await vecdb.getStatus() as VectorDBStatus + } + + private collectionForThread(threadId: string): string { + return `attachments_${threadId}` + } + + async createCollection(threadId: string, dimension: number): Promise { + return await vecdb.createCollection(this.collectionForThread(threadId), dimension) + } + + async insertChunks(threadId: string, fileId: string, chunks: VectorChunkInput[]): Promise { + return await vecdb.insertChunks(this.collectionForThread(threadId), fileId, chunks) + } + + async searchCollection( + threadId: string, + query_embedding: number[], + limit: number, + threshold: number, + mode?: SearchMode, + fileIds?: string[] + ): Promise { + return await vecdb.searchCollection(this.collectionForThread(threadId), query_embedding, limit, threshold, mode, fileIds) as VectorSearchResult[] + } + + async deleteChunks(threadId: string, ids: string[]): Promise { + return await vecdb.deleteChunks(this.collectionForThread(threadId), ids) + } + + async deleteCollection(threadId: string): Promise { + return await vecdb.deleteCollection(this.collectionForThread(threadId)) + } + + // Optional helper for chunking + private async chunkText(text: string, chunkSize: number, chunkOverlap: number): Promise { + return await vecdb.chunkText(text, chunkSize, chunkOverlap) + } + + private async embedTexts(texts: string[]): Promise { + const llm = window.core?.extensionManager.getByName('@janhq/llamacpp-extension') as AIEngine & { embed?: (texts: string[]) => Promise<{ data: Array<{ embedding: number[]; index: number }> }> } + if (!llm?.embed) throw new Error('llamacpp extension not available') + const res = await llm.embed(texts) + const data: Array<{ embedding: number[]; index: number }> = res?.data || [] + const out: number[][] = new Array(texts.length) + for (const item of data) out[item.index] = item.embedding + return out + } + + async ingestFile(threadId: string, file: VectorDBFileInput, opts: VectorDBIngestOptions): Promise { + // Check for duplicate file (same name + path) + const existingFiles = await vecdb.listAttachments(this.collectionForThread(threadId)).catch(() => []) + const duplicate = existingFiles.find((f: any) => f.name === file.name && f.path === file.path) + if (duplicate) { + throw new Error(`File '${file.name}' has already been attached to this thread`) + } + + const text = await ragApi.parseDocument(file.path, file.type || 'application/octet-stream') + const chunks = await this.chunkText(text, opts.chunkSize, opts.chunkOverlap) + if (!chunks.length) { + const fi = await vecdb.createFile(this.collectionForThread(threadId), file) + return fi + } + const embeddings = await this.embedTexts(chunks) + const dimension = embeddings[0]?.length || 0 + if (dimension <= 0) throw new Error('Embedding dimension not available') + await this.createCollection(threadId, dimension) + const fi = await vecdb.createFile(this.collectionForThread(threadId), file) + await vecdb.insertChunks( + this.collectionForThread(threadId), + fi.id, + chunks.map((t, i) => ({ text: t, embedding: embeddings[i] })) + ) + const infos = await vecdb.listAttachments(this.collectionForThread(threadId)) + const updated = infos.find((e) => e.id === fi.id) + return updated || { ...fi, chunk_count: chunks.length } + } + + async listAttachments(threadId: string, limit?: number): Promise { + return await vecdb.listAttachments(this.collectionForThread(threadId), limit) as AttachmentFileInfo[] + } + + async getChunks( + threadId: string, + fileId: string, + startOrder: number, + endOrder: number + ): Promise { + return await vecdb.getChunks(this.collectionForThread(threadId), fileId, startOrder, endOrder) as VectorSearchResult[] + } + + async deleteFile(threadId: string, fileId: string): Promise { + return await vecdb.deleteFile(this.collectionForThread(threadId), fileId) + } +} diff --git a/scripts/download-bin.mjs b/scripts/download-bin.mjs index 68f09bf5fa..b6ef81bb28 100644 --- a/scripts/download-bin.mjs +++ b/scripts/download-bin.mjs @@ -56,6 +56,75 @@ async function decompress(filePath, targetDir) { } } +async function getJson(url, headers = {}) { + return new Promise((resolve, reject) => { + const opts = new URL(url) + opts.headers = { + 'User-Agent': 'jan-app', + 'Accept': 'application/vnd.github+json', + ...headers, + } + https + .get(opts, (res) => { + if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { + return getJson(res.headers.location, headers).then(resolve, reject) + } + if (res.statusCode !== 200) { + reject(new Error(`GET ${url} failed with status ${res.statusCode}`)) + return + } + let data = '' + res.on('data', (chunk) => (data += chunk)) + res.on('end', () => { + try { + resolve(JSON.parse(data)) + } catch (e) { + reject(e) + } + }) + }) + .on('error', reject) + }) +} + +function matchSqliteVecAsset(assets, platform, arch) { + const osHints = + platform === 'darwin' + ? ['darwin', 'macos', 'apple-darwin'] + : platform === 'win32' + ? ['windows', 'win', 'msvc'] + : ['linux'] + + const archHints = arch === 'arm64' ? ['arm64', 'aarch64'] : ['x86_64', 'x64', 'amd64'] + const extHints = ['zip', 'tar.gz'] + + const lc = (s) => s.toLowerCase() + const candidates = assets + .filter((a) => a && a.browser_download_url && a.name) + .map((a) => ({ name: lc(a.name), url: a.browser_download_url })) + + // Prefer exact OS + arch matches + let matches = candidates.filter((c) => osHints.some((o) => c.name.includes(o)) && archHints.some((h) => c.name.includes(h)) && extHints.some((e) => c.name.endsWith(e))) + if (matches.length) return matches[0].url + // Fallback: OS only + matches = candidates.filter((c) => osHints.some((o) => c.name.includes(o)) && extHints.some((e) => c.name.endsWith(e))) + if (matches.length) return matches[0].url + // Last resort: any asset with shared library extension inside is unknown here, so pick any zip/tar.gz + matches = candidates.filter((c) => extHints.some((e) => c.name.endsWith(e))) + return matches.length ? matches[0].url : null +} + +async function fetchLatestSqliteVecUrl(platform, arch) { + try { + const rel = await getJson('https://api.github.com/repos/asg017/sqlite-vec/releases/latest') + const url = matchSqliteVecAsset(rel.assets || [], platform, arch) + return url + } catch (e) { + console.log('Failed to query sqlite-vec latest release:', e.message) + return null + } +} + function getPlatformArch() { const platform = os.platform() // 'darwin', 'linux', 'win32' const arch = os.arch() // 'x64', 'arm64', etc. @@ -266,6 +335,64 @@ async function main() { } console.log('UV downloaded.') + // ----- sqlite-vec (optional, ANN acceleration) ----- + try { + const binDir = 'src-tauri/resources/bin' + const platform = os.platform() + const ext = platform === 'darwin' ? 'dylib' : platform === 'win32' ? 'dll' : 'so' + const targetLibPath = path.join(binDir, `sqlite-vec.${ext}`) + + if (fs.existsSync(targetLibPath)) { + console.log(`sqlite-vec already present at ${targetLibPath}`) + } else { + let sqlvecUrl = await fetchLatestSqliteVecUrl(platform, os.arch()) + // Allow override via env if needed + if ((process.env.SQLVEC_URL || process.env.JAN_SQLITE_VEC_URL) && !sqlvecUrl) { + sqlvecUrl = process.env.SQLVEC_URL || process.env.JAN_SQLITE_VEC_URL + } + if (!sqlvecUrl) { + console.log('Could not determine sqlite-vec download URL; skipping (linear fallback will be used).') + } else { + console.log(`Downloading sqlite-vec from ${sqlvecUrl}...`) + const sqlvecArchive = path.join(tempBinDir, `sqlite-vec-download`) + const guessedExt = sqlvecUrl.endsWith('.zip') ? '.zip' : sqlvecUrl.endsWith('.tar.gz') ? '.tar.gz' : '' + const archivePath = sqlvecArchive + guessedExt + await download(sqlvecUrl, archivePath) + if (!guessedExt) { + console.log('Unknown archive type for sqlite-vec; expecting .zip or .tar.gz') + } else { + await decompress(archivePath, tempBinDir) + // Try to find a shared library in the extracted files + const candidates = [] + function walk(dir) { + for (const entry of fs.readdirSync(dir)) { + const full = path.join(dir, entry) + const stat = fs.statSync(full) + if (stat.isDirectory()) walk(full) + else if (full.endsWith(`.${ext}`)) candidates.push(full) + } + } + walk(tempBinDir) + if (candidates.length === 0) { + console.log('No sqlite-vec shared library found in archive; skipping copy.') + } else { + // Pick the first match and copy/rename to sqlite-vec. + const libSrc = candidates[0] + // Ensure we copy the FILE, not a directory (fs-extra copySync can copy dirs) + if (fs.statSync(libSrc).isFile()) { + fs.copyFileSync(libSrc, targetLibPath) + console.log(`sqlite-vec installed at ${targetLibPath}`) + } else { + console.log(`Found non-file at ${libSrc}; skipping.`) + } + } + } + } + } + } catch (err) { + console.log('sqlite-vec download step failed (non-fatal):', err) + } + console.log('Downloads completed.') } diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ae5dadfcae..1f2850c2f2 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -14,7 +14,7 @@ dependencies = [ "hyper 0.14.32", "jan-utils", "libc", - "libloading 0.8.8", + "libloading 0.8.9", "log", "nix", "once_cell", @@ -35,12 +35,14 @@ dependencies = [ "tauri-plugin-log", "tauri-plugin-opener", "tauri-plugin-os", + "tauri-plugin-rag", "tauri-plugin-shell", "tauri-plugin-single-instance", "tauri-plugin-store", "tauri-plugin-updater", + "tauri-plugin-vector-db", "tempfile", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", "tokio-util", "url", @@ -51,9 +53,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ "gimli", ] @@ -64,6 +66,15 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" +[[package]] +name = "adobe-cmap-parser" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8abfa9a4688de8fc9f42b3f013b6fffec18ed8a554f5f113577e0b9b3212a3" +dependencies = [ + "pom", +] + [[package]] name = "aes" version = "0.8.4" @@ -114,12 +125,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_log-sys" version = "0.3.2" @@ -148,15 +153,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.98" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "arbitrary" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" dependencies = [ "derive_arbitrary", ] @@ -223,9 +228,9 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.13.2" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa" +checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8" dependencies = [ "async-task", "concurrent-queue", @@ -237,11 +242,11 @@ dependencies = [ [[package]] name = "async-io" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19634d6336019ef220f09fd31168ce5c184b295cbf80345437cc36094ef223ca" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" dependencies = [ - "async-lock", + "autocfg", "cfg-if", "concurrent-queue", "futures-io", @@ -250,7 +255,7 @@ dependencies = [ "polling", "rustix", "slab", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -266,9 +271,9 @@ dependencies = [ [[package]] name = "async-process" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65daa13722ad51e6ab1a1b9c01299142bc75135b337923cfa10e79bbbd669f00" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" dependencies = [ "async-channel", "async-io", @@ -290,14 +295,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "async-signal" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f567af260ef69e1d52c2b560ce0ea230763e6fbb9214a85d768760a920e3e3c1" +checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c" dependencies = [ "async-io", "async-lock", @@ -308,7 +313,7 @@ dependencies = [ "rustix", "signal-hook-registry", "slab", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -319,13 +324,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.88" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -374,9 +379,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" -version = "0.3.75" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" dependencies = [ "addr2line", "cfg-if", @@ -384,7 +389,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-link 0.2.1", ] [[package]] @@ -413,9 +418,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" dependencies = [ "serde", ] @@ -452,11 +457,11 @@ dependencies = [ [[package]] name = "block2" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "340d2f0bdb2a43c1d3cd40513185b2bd7def0aa1052f956455114bc98f82dcf2" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" dependencies = [ - "objc2 0.6.1", + "objc2 0.6.3", ] [[package]] @@ -489,10 +494,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" dependencies = [ "once_cell", - "proc-macro-crate 3.3.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -536,22 +541,22 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.23.1" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.10.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f154e572231cb6ba2bd1176980827e3d5dc04cc183a75dea38109fbdd672d29" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -595,7 +600,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "cairo-sys-rs", "glib", "libc", @@ -615,12 +620,27 @@ dependencies = [ ] [[package]] -name = "camino" -version = "1.1.10" +name = "calamine" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" +checksum = "47a4d6ea525ea187df1e3a1c4b23469b1cbe60c5bafc1c0ef14b2b8738a8303d" dependencies = [ + "byteorder", + "codepage", + "encoding_rs", + "log", + "quick-xml 0.31.0", "serde", + "zip 0.6.6", +] + +[[package]] +name = "camino" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" +dependencies = [ + "serde_core", ] [[package]] @@ -643,7 +663,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror 2.0.12", + "thiserror 2.0.17", ] [[package]] @@ -653,15 +673,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" dependencies = [ "serde", - "toml 0.9.5", + "toml 0.9.7", ] [[package]] name = "cc" -version = "1.2.31" +version = "1.2.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a42d84bb6b69d3a8b3eaacf0d88f179e1929695e1ad012b6cf64d9caaa5fd2" +checksum = "e1d05d92f4b1fd76aad469d46cdd858ca761576082cd37df81416691e50199fb" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -696,9 +717,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "cfg_aliases" @@ -706,19 +727,29 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chardetng" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b8f0b65b7b08ae3c8187e8d77174de20cb6777864c6b832d8ad365999cf1ea" +dependencies = [ + "cfg-if", + "encoding_rs", + "memchr", +] + [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", "wasm-bindgen", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -731,6 +762,15 @@ dependencies = [ "inout", ] +[[package]] +name = "codepage" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f68d061bc2828ae826206326e61251aca94c1e4a5305cf52d9138639c918b4" +dependencies = [ + "encoding_rs", +] + [[package]] name = "combine" version = "4.6.7" @@ -849,7 +889,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "core-foundation 0.10.1", "core-graphics-types 0.2.0", "foreign-types 0.5.0", @@ -873,7 +913,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "core-foundation 0.10.1", "libc", ] @@ -975,7 +1015,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.104", + "syn 2.0.106", +] + +[[package]] +name = "csv" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" +dependencies = [ + "memchr", ] [[package]] @@ -985,7 +1046,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1000,12 +1061,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08440b3dd222c3d0433e63e097463969485f112baff337dfdaca043a0d760570" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" dependencies = [ - "darling_core 0.21.2", - "darling_macro 0.21.2", + "darling_core 0.21.3", + "darling_macro 0.21.3", ] [[package]] @@ -1019,21 +1080,21 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "darling_core" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25b7912bc28a04ab1b7715a68ea03aaa15662b43a1a4b2c480531fd19f8bf7e" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1044,25 +1105,38 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core 0.20.11", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "darling_macro" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce154b9bea7fb0c8e8326e62d00354000c36e79770ff21b8c84e3aa267d9d531" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ - "darling_core 0.21.2", + "darling_core 0.21.3", "quote", - "syn 2.0.104", + "syn 2.0.106", +] + +[[package]] +name = "dashmap" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +dependencies = [ + "cfg-if", + "hashbrown 0.12.3", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "data-url" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" +checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" [[package]] name = "der" @@ -1077,23 +1151,23 @@ dependencies = [ [[package]] name = "deranged" -version = "0.4.0" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071" dependencies = [ "powerfmt", - "serde", + "serde_core", ] [[package]] name = "derive_arbitrary" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1106,7 +1180,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1139,7 +1213,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1154,10 +1228,10 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" dependencies = [ - "bitflags 2.9.1", - "block2 0.6.1", + "bitflags 2.9.4", + "block2 0.6.2", "libc", - "objc2 0.6.1", + "objc2 0.6.3", ] [[package]] @@ -1168,7 +1242,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1177,7 +1251,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.8", + "libloading 0.8.9", ] [[package]] @@ -1200,7 +1274,7 @@ checksum = "788160fb30de9cdd857af31c6a2675904b16ece8fc2737b2c7127ba368c9d0f4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1280,14 +1354,14 @@ dependencies = [ [[package]] name = "embed-resource" -version = "3.0.5" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6d81016d6c977deefb2ef8d8290da019e27cc26167e102185da528e6c0ab38" +checksum = "55a075fc573c64510038d7ee9abc7990635863992f83ebc52c8b433b8411a02e" dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.9.5", + "toml 0.9.7", "vswhom", "winreg 0.55.0", ] @@ -1331,7 +1405,7 @@ checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1361,22 +1435,23 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "erased-serde" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +checksum = "259d404d09818dec19332e31d94558aeb442fea04c817006456c24b5460bbd4b" dependencies = [ "serde", + "serde_core", "typeid", ] [[package]] name = "errno" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1390,6 +1465,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "euclid" +version = "0.20.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb7ef65b3777a325d1eeefefab5b6d4959da54747e33bd6258e789640f307ad" +dependencies = [ + "num-traits", +] + [[package]] name = "event-listener" version = "5.4.1" @@ -1411,6 +1495,18 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + [[package]] name = "fastrand" version = "2.3.0" @@ -1447,20 +1543,26 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.25" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3" + [[package]] name = "fix-path-env" version = "0.0.0" -source = "git+https://github.com/tauri-apps/fix-path-env-rs#0e479e2804edc1a7e5f15ece2b48ee30858c2838" +source = "git+https://github.com/tauri-apps/fix-path-env-rs#c4c45d503ea115a839aae718d02f79e7c7f0f673" dependencies = [ "home", "strip-ansi-escapes", @@ -1469,9 +1571,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9" dependencies = [ "crc32fast", "miniz_oxide", @@ -1527,7 +1629,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1544,9 +1646,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -1647,7 +1749,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1842,15 +1944,15 @@ dependencies = [ "js-sys", "libc", "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "wasi 0.14.7+wasi-0.2.4", "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.31.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" [[package]] name = "gio" @@ -1890,7 +1992,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "futures-channel", "futures-core", "futures-executor", @@ -1914,11 +2016,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", - "proc-macro-crate 2.0.0", + "proc-macro-crate 2.0.2", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1933,9 +2035,9 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "gobject-sys" @@ -1997,7 +2099,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -2012,7 +2114,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.10.0", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", @@ -2031,7 +2133,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.3.1", - "indexmap 2.10.0", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", @@ -2063,25 +2165,43 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash 0.8.12", +] [[package]] name = "hashbrown" -version = "0.15.4" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", "foldhash", ] +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "hashlink" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.15.4", + "hashbrown 0.15.5", ] [[package]] @@ -2135,6 +2255,35 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "html2text" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d21a727ee791bce84d364a69b0f84a5d99f06278adfe4dbd431d475ea28e338" +dependencies = [ + "dashmap", + "html5ever 0.26.0", + "markup5ever 0.11.0", + "tendril", + "thiserror 1.0.69", + "unicode-width", + "xml5ever", +] + +[[package]] +name = "html5ever" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" +dependencies = [ + "log", + "mac", + "markup5ever 0.11.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "html5ever" version = "0.29.1" @@ -2143,7 +2292,7 @@ checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c" dependencies = [ "log", "mac", - "markup5ever", + "markup5ever 0.14.1", "match_token", ] @@ -2247,19 +2396,21 @@ dependencies = [ [[package]] name = "hyper" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "h2 0.4.12", "http 1.3.1", "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -2286,14 +2437,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ "http 1.3.1", - "hyper 1.6.0", + "hyper 1.7.0", "hyper-util", - "rustls 0.23.31", + "rustls 0.23.32", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.2", + "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", ] [[package]] @@ -2311,9 +2462,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" dependencies = [ "base64 0.22.1", "bytes", @@ -2322,7 +2473,7 @@ dependencies = [ "futures-util", "http 1.3.1", "http-body 1.0.1", - "hyper 1.6.0", + "hyper 1.7.0", "ipnet", "libc", "percent-encoding", @@ -2337,9 +2488,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.63" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2347,7 +2498,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.61.2", + "windows-core 0.62.2", ] [[package]] @@ -2463,9 +2614,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -2495,13 +2646,23 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.10.0" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", - "hashbrown 0.15.4", + "hashbrown 0.16.0", "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" +dependencies = [ + "cfb", ] [[package]] @@ -2524,11 +2685,11 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "cfg-if", "libc", ] @@ -2648,9 +2809,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" dependencies = [ "once_cell", "wasm-bindgen", @@ -2684,7 +2845,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "serde", "unicode-segmentation", ] @@ -2696,8 +2857,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" dependencies = [ "cssparser", - "html5ever", - "indexmap 2.10.0", + "html5ever 0.29.1", + "indexmap 2.11.4", "selectors", ] @@ -2736,9 +2897,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.174" +version = "0.2.176" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" [[package]] name = "libloading" @@ -2752,12 +2913,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-targets 0.53.3", + "windows-link 0.2.1", ] [[package]] @@ -2768,11 +2929,11 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "libc", "redox_syscall", ] @@ -2790,9 +2951,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.9.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" @@ -2808,23 +2969,40 @@ checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed" [[package]] name = "lock_api" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" dependencies = [ "value-bag", ] +[[package]] +name = "lopdf" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5c8ecfc6c72051981c0459f75ccc585e7ff67c70829560cda8e647882a9abff" +dependencies = [ + "encoding_rs", + "flate2", + "indexmap 2.11.4", + "itoa", + "log", + "md-5", + "nom", + "rangemap", + "time", + "weezl", +] + [[package]] name = "lru-slab" version = "0.1.2" @@ -2846,6 +3024,20 @@ dependencies = [ "libc", ] +[[package]] +name = "markup5ever" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" +dependencies = [ + "log", + "phf 0.10.1", + "phf_codegen 0.10.0", + "string_cache", + "string_cache_codegen", + "tendril", +] + [[package]] name = "markup5ever" version = "0.14.1" @@ -2868,7 +3060,7 @@ checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -2889,9 +3081,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "memoffset" @@ -2908,6 +3100,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "minisign-verify" version = "0.2.4" @@ -2945,14 +3143,14 @@ dependencies = [ "dpi", "gtk", "keyboard-types", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "once_cell", "png", "serde", - "thiserror 2.0.12", + "thiserror 2.0.17", "windows-sys 0.60.2", ] @@ -2979,7 +3177,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "jni-sys", "log", "ndk-sys", @@ -3015,7 +3213,7 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "cfg-if", "cfg_aliases", "libc", @@ -3028,6 +3226,16 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "ntapi" version = "0.4.1" @@ -3106,10 +3314,10 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -3127,8 +3335,8 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c9bff0aa1d48904a1385ea2a8b97576fbdcbc9a3cfccd0d31fe978e1c4038c5" dependencies = [ - "bitflags 2.9.1", - "libloading 0.8.8", + "bitflags 2.9.4", + "libloading 0.8.9", "nvml-wrapper-sys", "static_assertions", "thiserror 1.0.69", @@ -3141,7 +3349,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "698d45156f28781a4e79652b6ebe2eaa0589057d588d3aec1333f6466f13fcb5" dependencies = [ - "libloading 0.8.8", + "libloading 0.8.9", ] [[package]] @@ -3171,9 +3379,9 @@ dependencies = [ [[package]] name = "objc2" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c6597e14493ab2e44ce58f2fdecf095a51f12ca57bec060a11c57332520551" +checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05" dependencies = [ "objc2-encode", "objc2-exception-helper", @@ -3181,77 +3389,104 @@ dependencies = [ [[package]] name = "objc2-app-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f29f568bec459b0ddff777cec4fe3fd8666d82d5a40ebd0ff7e66134f89bcc" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ - "bitflags 2.9.1", - "block2 0.6.1", + "bitflags 2.9.4", + "block2 0.6.2", "libc", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-cloud-kit", "objc2-core-data", "objc2-core-foundation", "objc2-core-graphics", "objc2-core-image", - "objc2-foundation 0.3.1", - "objc2-quartz-core 0.3.1", + "objc2-core-text", + "objc2-core-video", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", ] [[package]] name = "objc2-cloud-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17614fdcd9b411e6ff1117dfb1d0150f908ba83a7df81b1f118005fe0a8ea15d" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", - "objc2-foundation 0.3.1", + "bitflags 2.9.4", + "objc2 0.6.3", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-core-data" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291fbbf7d29287518e8686417cf7239c74700fd4b607623140a7d4a3c834329d" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", - "objc2-foundation 0.3.1", + "bitflags 2.9.4", + "objc2 0.6.3", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-core-foundation" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "dispatch2", - "objc2 0.6.1", + "objc2 0.6.3", ] [[package]] name = "objc2-core-graphics" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989c6c68c13021b5c2d6b71456ebb0f9dc78d752e86a98da7c716f4f9470f5a4" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "dispatch2", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-core-foundation", "objc2-io-surface", ] [[package]] name = "objc2-core-image" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b3dc0cc4386b6ccf21c157591b34a7f44c8e75b064f85502901ab2188c007e" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" dependencies = [ - "objc2 0.6.1", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.9.4", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-core-video" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" +dependencies = [ + "bitflags 2.9.4", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-io-surface", ] [[package]] @@ -3275,7 +3510,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -3283,35 +3518,35 @@ dependencies = [ [[package]] name = "objc2-foundation" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900831247d2fe1a09a683278e5384cfb8c80c79fe6b166f9d14bfdde0ea1b03c" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ - "bitflags 2.9.1", - "block2 0.6.1", + "bitflags 2.9.4", + "block2 0.6.2", "libc", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-core-foundation", ] [[package]] name = "objc2-io-surface" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7282e9ac92529fa3457ce90ebb15f4ecbc383e8338060960760fa2cf75420c3c" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", + "bitflags 2.9.4", + "objc2 0.6.3", "objc2-core-foundation", ] [[package]] name = "objc2-javascript-core" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9052cb1bb50a4c161d934befcf879526fb87ae9a68858f241e693ca46225cf5a" +checksum = "2a1e6550c4caed348956ce3370c9ffeca70bb1dbed4fa96112e7c6170e074586" dependencies = [ - "objc2 0.6.1", + "objc2 0.6.3", "objc2-core-foundation", ] @@ -3321,7 +3556,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -3329,14 +3564,14 @@ dependencies = [ [[package]] name = "objc2-osa-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26bb88504b5a050dbba515d2414607bf5e57dd56b107bc5f0351197a3e7bdc5d" +checksum = "f112d1746737b0da274ef79a23aac283376f335f4095a083a267a082f21db0c0" dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", + "bitflags 2.9.4", + "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", ] [[package]] @@ -3345,7 +3580,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -3354,59 +3589,59 @@ dependencies = [ [[package]] name = "objc2-quartz-core" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ffb6a0cd5f182dc964334388560b12a57f7b74b3e2dec5e2722aa2dfb2ccd5" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", - "objc2-foundation 0.3.1", + "bitflags 2.9.4", + "objc2 0.6.3", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-security" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1f8e0ef3ab66b08c42644dcb34dba6ec0a574bbd8adbb8bdbdc7a2779731a44" +checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a" dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", + "bitflags 2.9.4", + "objc2 0.6.3", "objc2-core-foundation", ] [[package]] name = "objc2-ui-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b1312ad7bc8a0e92adae17aa10f90aae1fb618832f9b993b022b591027daed" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", + "bitflags 2.9.4", + "objc2 0.6.3", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-web-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91672909de8b1ce1c2252e95bbee8c1649c9ad9d14b9248b3d7b4c47903c47ad" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" dependencies = [ - "bitflags 2.9.1", - "block2 0.6.1", - "objc2 0.6.1", + "bitflags 2.9.4", + "block2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "objc2-javascript-core", "objc2-security", ] [[package]] name = "object" -version = "0.36.7" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "memchr", ] @@ -3435,7 +3670,7 @@ version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "cfg-if", "foreign-types 0.3.2", "libc", @@ -3452,7 +3687,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -3463,9 +3698,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.5.2+3.5.2" +version = "300.5.3+3.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d270b79e2926f5150189d475bc7e9d2c69f9c4697b185fa917d5a32b792d21b4" +checksum = "dc6bad8cd0233b63971e232cc9c5e83039375b8586d2312f31fda85db8f888c2" dependencies = [ "cc", ] @@ -3537,12 +3772,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b" dependencies = [ - "objc2 0.6.1", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", "objc2-osa-kit", "serde", "serde_json", - "thiserror 2.0.12", + "thiserror 2.0.17", ] [[package]] @@ -3578,9 +3813,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -3588,15 +3823,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.11" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-link 0.2.1", ] [[package]] @@ -3634,6 +3869,21 @@ dependencies = [ "sha2", ] +[[package]] +name = "pdf-extract" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbb3a5387b94b9053c1e69d8abfd4dd6dae7afda65a5c5279bc1f42ab39df575" +dependencies = [ + "adobe-cmap-parser", + "encoding_rs", + "euclid", + "lopdf", + "postscript", + "type1-encoding-parser", + "unicode-normalization", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -3645,9 +3895,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "phf" @@ -3689,6 +3939,16 @@ dependencies = [ "phf_shared 0.8.0", ] +[[package]] +name = "phf_codegen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", +] + [[package]] name = "phf_codegen" version = "0.11.3" @@ -3753,7 +4013,7 @@ dependencies = [ "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -3835,13 +4095,13 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plist" -version = "1.7.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3af6b589e163c5a788fab00ce0c0366f6efbb9959c2f9874b224936af7fce7e1" +checksum = "740ebea15c5d1428f910cd1a5f52cebf8d25006245ed8ade92702f4943d91e07" dependencies = [ "base64 0.22.1", - "indexmap 2.10.0", - "quick-xml 0.38.1", + "indexmap 2.11.4", + "quick-xml 0.38.3", "serde", "time", ] @@ -3861,23 +4121,35 @@ dependencies = [ [[package]] name = "polling" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5bd19146350fe804f7cb2669c851c03d69da628803dab0d98018142aaa5d829" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi", "pin-project-lite", "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] +[[package]] +name = "pom" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6ce597ecdcc9a098e7fddacb1065093a3d66446fa16c675e7e71d1b5c28e6" + +[[package]] +name = "postscript" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78451badbdaebaf17f053fd9152b3ffb33b516104eacb45e7864aaa9c712f306" + [[package]] name = "potential_utf" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" dependencies = [ "zerovec", ] @@ -3915,20 +4187,21 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ - "toml_edit 0.20.7", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", ] [[package]] name = "proc-macro-crate" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.22.27", + "toml_edit 0.23.6", ] [[package]] @@ -3963,9 +4236,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] @@ -3977,7 +4250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3ef4f2f0422f23a82ec9f628ea2acd12871c81a9362b02c43c1aa86acfc3ba1" dependencies = [ "futures", - "indexmap 2.10.0", + "indexmap 2.11.4", "nix", "tokio", "tracing", @@ -4020,6 +4293,17 @@ dependencies = [ "psl-types", ] +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "encoding_rs", + "memchr", + "serde", +] + [[package]] name = "quick-xml" version = "0.37.5" @@ -4031,18 +4315,18 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9845d9dccf565065824e69f9f235fafba1587031eda353c1f1561cd6a6be78f4" +checksum = "42a232e7487fc2ef313d96dde7948e7a3c05101870d8985e4fd8d26aedd27b89" dependencies = [ "memchr", ] [[package]] name = "quinn" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", "cfg_aliases", @@ -4050,9 +4334,9 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.31", - "socket2 0.5.10", - "thiserror 2.0.12", + "rustls 0.23.32", + "socket2 0.6.0", + "thiserror 2.0.17", "tokio", "tracing", "web-time", @@ -4060,9 +4344,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.12" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "bytes", "getrandom 0.3.3", @@ -4070,10 +4354,10 @@ dependencies = [ "rand 0.9.2", "ring", "rustc-hash", - "rustls 0.23.31", + "rustls 0.23.32", "rustls-pki-types", "slab", - "thiserror 2.0.12", + "thiserror 2.0.17", "tinyvec", "tracing", "web-time", @@ -4081,23 +4365,23 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.10", + "socket2 0.6.0", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" dependencies = [ "proc-macro2", ] @@ -4224,6 +4508,12 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rangemap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7e49bb0bf967717f7bd674458b3d6b0c5f48ec7e3038166026a69fc22223" + [[package]] name = "raw-window-handle" version = "0.5.2" @@ -4238,11 +4528,11 @@ checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "redox_syscall" -version = "0.5.17" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", ] [[package]] @@ -4253,34 +4543,34 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.16", "libredox", - "thiserror 2.0.12", + "thiserror 2.0.17", ] [[package]] name = "ref-cast" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c" dependencies = [ "aho-corasick", "memchr", @@ -4290,9 +4580,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "833eb9ce86d40ef33cb1306d8accf7bc8ec2bfea4355cbdebb3df68b40925cad" dependencies = [ "aho-corasick", "memchr", @@ -4301,9 +4591,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] name = "rend" @@ -4362,9 +4652,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.22" +version = "0.12.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" +checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" dependencies = [ "base64 0.22.1", "bytes", @@ -4377,7 +4667,7 @@ dependencies = [ "http 1.3.1", "http-body 1.0.1", "http-body-util", - "hyper 1.6.0", + "hyper 1.7.0", "hyper-rustls 0.27.7", "hyper-util", "js-sys", @@ -4386,14 +4676,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.31", + "rustls 0.23.32", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 1.0.2", "tokio", - "tokio-rustls 0.26.2", + "tokio-rustls 0.26.4", "tokio-util", "tower", "tower-http", @@ -4403,7 +4693,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 1.0.2", + "webpki-roots 1.0.3", ] [[package]] @@ -4413,17 +4703,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" dependencies = [ "ashpd", - "block2 0.6.1", + "block2 0.6.2", "dispatch2", "glib-sys", "gobject-sys", "gtk-sys", "js-sys", "log", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "raw-window-handle 0.6.2", "wasm-bindgen", "wasm-bindgen-futures", @@ -4476,9 +4766,9 @@ dependencies = [ [[package]] name = "rmcp" -version = "0.6.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb21cd3555f1059f27e4813827338dec44429a08ecd0011acc41d9907b160c00" +checksum = "41ab0892f4938752b34ae47cb53910b1b0921e55e77ddb6e44df666cab17939f" dependencies = [ "base64 0.22.1", "chrono", @@ -4487,13 +4777,13 @@ dependencies = [ "paste", "pin-project-lite", "process-wrap", - "reqwest 0.12.22", + "reqwest 0.12.23", "rmcp-macros", "schemars 1.0.4", "serde", "serde_json", "sse-stream", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", "tokio-stream", "tokio-util", @@ -4503,15 +4793,15 @@ dependencies = [ [[package]] name = "rmcp-macros" -version = "0.6.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5d16ae1ff3ce2c5fd86c37047b2869b75bec795d53a4b1d8257b15415a2354" +checksum = "1827cd98dab34cade0513243c6fe0351f0f0b2c9d6825460bcf45b42804bdda0" dependencies = [ - "darling 0.21.2", + "darling 0.21.3", "proc-macro2", "quote", "serde_json", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4534,11 +4824,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rusqlite" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" +dependencies = [ + "bitflags 2.9.4", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink 0.9.1", + "libsqlite3-sys", + "smallvec", +] + [[package]] name = "rust-ini" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7295b7ce3bf4806b419dc3420745998b447178b7005e2011947b38fc5aa6791" +checksum = "796e8d2b6696392a43bea58116b667fb4c29727dc5abd27d6acf338bb4f688c7" dependencies = [ "cfg-if", "ordered-multimap", @@ -4546,9 +4850,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.37.2" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b203a6425500a03e0919c42d3c47caca51e79f1132046626d2c8871c5092035d" +checksum = "c8975fc98059f365204d635119cf9c5a60ae67b841ed49b5422a9a7e56cdfac0" dependencies = [ "arrayvec", "borsh", @@ -4583,15 +4887,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.8" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4608,14 +4912,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.31" +version = "0.23.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" +checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.103.4", + "rustls-webpki 0.103.7", "subtle", "zeroize", ] @@ -4651,9 +4955,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.4" +version = "0.103.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" dependencies = [ "ring", "rustls-pki-types", @@ -4662,9 +4966,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" @@ -4683,11 +4987,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -4740,7 +5044,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4752,7 +5056,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4789,7 +5093,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -4798,9 +5102,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -4826,42 +5130,54 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" dependencies = [ "serde", + "serde_core", ] [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] [[package]] name = "serde-untagged" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "299d9c19d7d466db4ab10addd5703e4c615dec2a5a16dbbafe191045e87ee66e" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" dependencies = [ "erased-serde", "serde", + "serde_core", "typeid", ] +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4872,19 +5188,20 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "serde_json" -version = "1.0.142" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] @@ -4895,7 +5212,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4909,11 +5226,11 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" +checksum = "5417783452c2be558477e104686f7de5dae53dba813c28435e0e70f82d9b04ee" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -4930,19 +5247,18 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +checksum = "6093cd8c01b25262b84927e0f7151692158fab02d961e04c979d3903eba7ecc5" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.10.0", + "indexmap 2.11.4", "schemars 0.9.0", "schemars 1.0.4", - "serde", - "serde_derive", + "serde_core", "serde_json", "serde_with_macros", "time", @@ -4950,14 +5266,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +checksum = "a7e6c180db0816026a61afa1cff5344fb7ebded7e4d3062772179f2501481c27" dependencies = [ - "darling 0.20.11", + "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4966,7 +5282,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "itoa", "ryu", "serde", @@ -4992,7 +5308,7 @@ checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -5110,9 +5426,9 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "smallvec" @@ -5239,9 +5555,9 @@ dependencies = [ "futures-intrusive", "futures-io", "futures-util", - "hashbrown 0.15.4", - "hashlink", - "indexmap 2.10.0", + "hashbrown 0.15.5", + "hashlink 0.10.0", + "indexmap 2.11.4", "log", "memchr", "once_cell", @@ -5250,7 +5566,7 @@ dependencies = [ "serde_json", "sha2", "smallvec", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", "tokio-stream", "tracing", @@ -5267,7 +5583,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -5290,7 +5606,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.104", + "syn 2.0.106", "tokio", "url", ] @@ -5303,7 +5619,7 @@ checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.9.1", + "bitflags 2.9.4", "byteorder", "bytes", "crc", @@ -5332,7 +5648,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.12", + "thiserror 2.0.17", "tracing", "whoami", ] @@ -5345,7 +5661,7 @@ checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.9.1", + "bitflags 2.9.4", "byteorder", "crc", "dotenvy", @@ -5369,7 +5685,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.12", + "thiserror 2.0.17", "tracing", "whoami", ] @@ -5393,7 +5709,7 @@ dependencies = [ "serde", "serde_urlencoded", "sqlx-core", - "thiserror 2.0.12", + "thiserror 2.0.17", "tracing", "url", ] @@ -5504,9 +5820,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.104" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -5536,7 +5852,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -5578,7 +5894,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "core-foundation 0.9.4", "system-configuration-sys 0.6.0", ] @@ -5612,7 +5928,7 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml 0.8.23", + "toml 0.8.2", "version-compare", ] @@ -5622,8 +5938,8 @@ version = "0.34.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "959469667dbcea91e5485fc48ba7dd6023face91bb0f1a14681a70f99847c3f7" dependencies = [ - "bitflags 2.9.1", - "block2 0.6.1", + "bitflags 2.9.4", + "block2 0.6.2", "core-foundation 0.10.1", "core-graphics", "crossbeam-channel", @@ -5640,9 +5956,9 @@ dependencies = [ "ndk", "ndk-context", "ndk-sys", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "once_cell", "parking_lot", "raw-window-handle 0.6.2", @@ -5664,7 +5980,7 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -5713,15 +6029,15 @@ dependencies = [ "log", "mime", "muda", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "objc2-ui-kit", "objc2-web-kit", "percent-encoding", "plist", "raw-window-handle 0.6.2", - "reqwest 0.12.22", + "reqwest 0.12.23", "serde", "serde_json", "serde_repr", @@ -5732,7 +6048,7 @@ dependencies = [ "tauri-runtime", "tauri-runtime-wry", "tauri-utils", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", "tray-icon", "url", @@ -5761,7 +6077,7 @@ dependencies = [ "serde_json", "tauri-utils", "tauri-winres", - "toml 0.9.5", + "toml 0.9.7", "walkdir", ] @@ -5782,9 +6098,9 @@ dependencies = [ "serde", "serde_json", "sha2", - "syn 2.0.104", + "syn 2.0.106", "tauri-utils", - "thiserror 2.0.12", + "thiserror 2.0.17", "time", "url", "uuid", @@ -5800,7 +6116,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "tauri-codegen", "tauri-utils", ] @@ -5818,7 +6134,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml 0.9.5", + "toml 0.9.7", "walkdir", ] @@ -5836,7 +6152,7 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-utils", - "thiserror 2.0.12", + "thiserror 2.0.17", "tracing", "url", "windows-registry", @@ -5845,9 +6161,9 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e5858cc7b455a73ab4ea2ebc08b5be33682c00ff1bf4cad5537d4fb62499d9" +checksum = "0beee42a4002bc695550599b011728d9dfabf82f767f134754ed6655e434824e" dependencies = [ "log", "raw-window-handle 0.6.2", @@ -5857,15 +6173,15 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-fs", - "thiserror 2.0.12", + "thiserror 2.0.17", "url", ] [[package]] name = "tauri-plugin-fs" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6ef84ee2f2094ce093e55106d90d763ba343fad57566992962e8f76d113f99" +checksum = "315784ec4be45e90a987687bae7235e6be3d6e9e350d2b75c16b8a4bf22c1db7" dependencies = [ "anyhow", "dunce", @@ -5878,8 +6194,8 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-utils", - "thiserror 2.0.12", - "toml 0.8.23", + "thiserror 2.0.17", + "toml 0.9.7", "url", ] @@ -5889,7 +6205,7 @@ version = "0.6.599" dependencies = [ "ash", "libc", - "libloading 0.8.8", + "libloading 0.8.9", "log", "nvml-wrapper", "serde", @@ -5902,23 +6218,23 @@ dependencies = [ [[package]] name = "tauri-plugin-http" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcde333d97e565a7765aad82f32d8672458f7bd77b6ee653830d5dded9d7b5c2" +checksum = "938a3d7051c9a82b431e3a0f3468f85715b3442b3c3a3913095e9fa509e2652c" dependencies = [ "bytes", "cookie_store", "data-url", "http 1.3.1", "regex", - "reqwest 0.12.22", + "reqwest 0.12.23", "schemars 0.8.22", "serde", "serde_json", "tauri", "tauri-plugin", "tauri-plugin-fs", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", "url", "urlpattern", @@ -5942,49 +6258,49 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-hardware", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", ] [[package]] name = "tauri-plugin-log" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a59139183e0907cec1499dddee4e085f5a801dc659efa0848ee224f461371426" +checksum = "61c1438bc7662acd16d508c919b3c087efd63669a4c75625dff829b1c75975ec" dependencies = [ "android_logger", "byte-unit", "fern", "log", - "objc2 0.6.1", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", "serde", "serde_json", "serde_repr", "swift-rs", "tauri", "tauri-plugin", - "thiserror 2.0.12", + "thiserror 2.0.17", "time", ] [[package]] name = "tauri-plugin-opener" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecee219f11cdac713ab32959db5d0cceec4810ba4f4458da992292ecf9660321" +checksum = "786156aa8e89e03d271fbd3fe642207da8e65f3c961baa9e2930f332bf80a1f5" dependencies = [ "dunce", "glob", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "open", "schemars 0.8.22", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.12", + "thiserror 2.0.17", "url", "windows 0.61.3", "zbus", @@ -6005,14 +6321,36 @@ dependencies = [ "sys-locale", "tauri", "tauri-plugin", - "thiserror 2.0.12", + "thiserror 2.0.17", +] + +[[package]] +name = "tauri-plugin-rag" +version = "0.1.0" +dependencies = [ + "calamine", + "chardetng", + "csv", + "encoding_rs", + "html2text", + "infer 0.15.0", + "log", + "pdf-extract", + "quick-xml 0.31.0", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.17", + "tokio", + "zip 0.6.6", ] [[package]] name = "tauri-plugin-shell" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b9ffadec5c3523f11e8273465cacb3d86ea7652a28e6e2a2e9b5c182f791d25" +checksum = "54777d0c0d8add34eea3ced84378619ef5b97996bd967d3038c668feefd21071" dependencies = [ "encoding_rs", "log", @@ -6025,7 +6363,7 @@ dependencies = [ "shared_child", "tauri", "tauri-plugin", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", ] @@ -6039,7 +6377,7 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin-deep-link", - "thiserror 2.0.12", + "thiserror 2.0.17", "tracing", "windows-sys 0.60.2", "zbus", @@ -6047,16 +6385,16 @@ dependencies = [ [[package]] name = "tauri-plugin-store" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916c609664a56c82aeaefffca9851fd072d4d41f73d63f22ee3ee451508194f" +checksum = "d85dd80d60a76ee2c2fdce09e9ef30877b239c2a6bb76e6d7d03708aa5f13a19" dependencies = [ "dunce", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.12", + "thiserror 2.0.17", "tokio", "tracing", ] @@ -6072,12 +6410,12 @@ dependencies = [ "flate2", "futures-util", "http 1.3.1", - "infer", + "infer 0.19.0", "log", "minisign-verify", "osakit", "percent-encoding", - "reqwest 0.12.22", + "reqwest 0.12.23", "semver", "serde", "serde_json", @@ -6085,12 +6423,28 @@ dependencies = [ "tauri", "tauri-plugin", "tempfile", - "thiserror 2.0.12", + "thiserror 2.0.17", "time", "tokio", "url", "windows-sys 0.60.2", - "zip 4.3.0", + "zip 4.6.1", +] + +[[package]] +name = "tauri-plugin-vector-db" +version = "0.1.0" +dependencies = [ + "dirs", + "log", + "rusqlite", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.17", + "tokio", + "uuid", ] [[package]] @@ -6104,14 +6458,14 @@ dependencies = [ "gtk", "http 1.3.1", "jni", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-ui-kit", "objc2-web-kit", "raw-window-handle 0.6.2", "serde", "serde_json", "tauri-utils", - "thiserror 2.0.12", + "thiserror 2.0.17", "url", "webkit2gtk", "webview2-com", @@ -6128,9 +6482,9 @@ dependencies = [ "http 1.3.1", "jni", "log", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "once_cell", "percent-encoding", "raw-window-handle 0.6.2", @@ -6156,9 +6510,9 @@ dependencies = [ "ctor", "dunce", "glob", - "html5ever", + "html5ever 0.29.1", "http 1.3.1", - "infer", + "infer 0.19.0", "json-patch", "kuchikiki", "log", @@ -6174,8 +6528,8 @@ dependencies = [ "serde_json", "serde_with", "swift-rs", - "thiserror 2.0.12", - "toml 0.9.5", + "thiserror 2.0.17", + "toml 0.9.7", "url", "urlpattern", "uuid", @@ -6184,26 +6538,25 @@ dependencies = [ [[package]] name = "tauri-winres" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c6d9028d41d4de835e3c482c677a8cb88137ac435d6ff9a71f392d4421576c9" +checksum = "fd21509dd1fa9bd355dc29894a6ff10635880732396aa38c0066c1e6c1ab8074" dependencies = [ "embed-resource", - "indexmap 2.10.0", - "toml 0.9.5", + "toml 0.9.7", ] [[package]] name = "tempfile" -version = "3.20.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -6228,11 +6581,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.12" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.12", + "thiserror-impl 2.0.17", ] [[package]] @@ -6243,18 +6596,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -6268,9 +6621,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.41" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", "itoa", @@ -6285,15 +6638,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" [[package]] name = "time-macros" -version = "0.2.22" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" dependencies = [ "num-conv", "time-core", @@ -6320,9 +6673,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -6362,7 +6715,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -6387,11 +6740,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.31", + "rustls 0.23.32", "tokio", ] @@ -6421,47 +6774,47 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.23" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned 0.6.9", - "toml_datetime 0.6.11", - "toml_edit 0.22.27", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", ] [[package]] name = "toml" -version = "0.9.5" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" +checksum = "00e5e5d9bf2475ac9d4f0d9edab68cc573dc2fd644b0dba36b0c30a92dd9eaa0" dependencies = [ - "indexmap 2.10.0", - "serde", - "serde_spanned 1.0.0", - "toml_datetime 0.7.0", + "indexmap 2.11.4", + "serde_core", + "serde_spanned 1.0.2", + "toml_datetime 0.7.2", "toml_parser", "toml_writer", - "winnow 0.7.12", + "winnow 0.7.13", ] [[package]] name = "toml_datetime" -version = "0.6.11" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_datetime" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +checksum = "32f1085dec27c2b6632b04c80b3bb1b4300d6495d1e129693bdda7d91e72eec1" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -6470,56 +6823,50 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.10.0", - "toml_datetime 0.6.11", + "indexmap 2.11.4", + "toml_datetime 0.6.3", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.20.7" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.10.0", - "toml_datetime 0.6.11", + "indexmap 2.11.4", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.27" +version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +checksum = "f3effe7c0e86fdff4f69cdd2ccc1b96f933e24811c5441d44904e8683e27184b" dependencies = [ - "indexmap 2.10.0", - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.11", - "toml_write", - "winnow 0.7.12", + "indexmap 2.11.4", + "toml_datetime 0.7.2", + "toml_parser", + "winnow 0.7.13", ] [[package]] name = "toml_parser" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" +checksum = "4cf893c33be71572e0e9aa6dd15e6677937abd686b066eac3f8cd3531688a627" dependencies = [ - "winnow 0.7.12", + "winnow 0.7.13", ] -[[package]] -name = "toml_write" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" - [[package]] name = "toml_writer" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" +checksum = "d163a63c116ce562a22cda521fcc4d79152e7aba014456fb5eb442f6d6a10109" [[package]] name = "tower" @@ -6542,7 +6889,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "bytes", "futures-util", "http 1.3.1", @@ -6586,7 +6933,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -6608,15 +6955,15 @@ dependencies = [ "dirs", "libappindicator", "muda", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", "objc2-core-graphics", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "once_cell", "png", "serde", - "thiserror 2.0.12", + "thiserror 2.0.17", "windows-sys 0.59.0", ] @@ -6626,6 +6973,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "type1-encoding-parser" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d6cc09e1a99c7e01f2afe4953789311a1c50baebbdac5b477ecf78e2e92a5b" +dependencies = [ + "pom", +] + [[package]] name = "typeid" version = "1.0.3" @@ -6634,9 +6990,9 @@ checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "uds_windows" @@ -6698,9 +7054,9 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-normalization" @@ -6723,6 +7079,12 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -6737,9 +7099,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", @@ -6779,9 +7141,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.17.0" +version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ "getrandom 0.3.3", "js-sys", @@ -6864,8 +7226,8 @@ dependencies = [ "crossbeam-queue", "half", "heck 0.4.1", - "indexmap 2.10.0", - "libloading 0.8.8", + "indexmap 2.11.4", + "libloading 0.8.9", "objc", "once_cell", "parking_lot", @@ -6926,11 +7288,20 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.14.2+wasi-0.2.4" +version = "0.14.7+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" dependencies = [ - "wit-bindgen-rt", + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", ] [[package]] @@ -6941,35 +7312,36 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" dependencies = [ "cfg-if", "js-sys", @@ -6980,9 +7352,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6990,22 +7362,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" dependencies = [ "unicode-ident", ] @@ -7043,7 +7415,7 @@ version = "0.31.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c66a47e840dc20793f2264eb4b3e4ecb4b75d91c0dd4af04b456128e0bdd449d" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "rustix", "wayland-backend", "wayland-scanner", @@ -7055,7 +7427,7 @@ version = "0.32.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efa790ed75fbfd71283bd2521a1cfdc022aabcc28bdcff00851f9e4ae88d9901" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.9.4", "wayland-backend", "wayland-client", "wayland-scanner", @@ -7085,9 +7457,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" dependencies = [ "js-sys", "wasm-bindgen", @@ -7155,9 +7527,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2" +checksum = "32b130c0d2d49f8b6889abc456e795e82525204f27c42cf767cf0d7734e089b8" dependencies = [ "rustls-pki-types", ] @@ -7172,8 +7544,8 @@ dependencies = [ "webview2-com-sys", "windows 0.61.3", "windows-core 0.61.2", - "windows-implement 0.60.0", - "windows-interface 0.59.1", + "windows-implement 0.60.2", + "windows-interface 0.59.3", ] [[package]] @@ -7184,7 +7556,7 @@ checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -7193,11 +7565,17 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36695906a1b53a3bf5c4289621efedac12b73eeb0b89e7e1a89b517302d5d75c" dependencies = [ - "thiserror 2.0.12", + "thiserror 2.0.17", "windows 0.61.3", "windows-core 0.61.2", ] +[[package]] +name = "weezl" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" + [[package]] name = "whoami" version = "1.6.1" @@ -7226,11 +7604,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -7245,10 +7623,10 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" dependencies = [ - "objc2 0.6.1", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "raw-window-handle 0.6.2", "windows-sys 0.59.0", "windows-version", @@ -7273,7 +7651,7 @@ dependencies = [ "windows-collections", "windows-core 0.61.2", "windows-future", - "windows-link", + "windows-link 0.1.3", "windows-numerics", ] @@ -7304,11 +7682,24 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.60.0", - "windows-interface 0.59.1", - "windows-link", + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.1.3", "windows-result 0.3.4", - "windows-strings", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", ] [[package]] @@ -7318,7 +7709,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ "windows-core 0.61.2", - "windows-link", + "windows-link 0.1.3", "windows-threading", ] @@ -7330,18 +7721,18 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "windows-implement" -version = "0.60.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -7352,18 +7743,18 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "windows-interface" -version = "0.59.1" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -7372,6 +7763,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-numerics" version = "0.2.0" @@ -7379,7 +7776,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ "windows-core 0.61.2", - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -7388,9 +7785,9 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ - "windows-link", + "windows-link 0.1.3", "windows-result 0.3.4", - "windows-strings", + "windows-strings 0.4.2", ] [[package]] @@ -7408,7 +7805,16 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", ] [[package]] @@ -7417,7 +7823,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", ] [[package]] @@ -7462,7 +7877,16 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.3", + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", ] [[package]] @@ -7513,19 +7937,19 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.3" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -7534,16 +7958,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] name = "windows-version" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04a5c6627e310a23ad2358483286c7df260c964eb2d003d8efd6d0f4e79265c" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -7566,9 +7990,9 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -7590,9 +8014,9 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -7614,9 +8038,9 @@ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[package]] name = "windows_i686_gnullvm" @@ -7626,9 +8050,9 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -7650,9 +8074,9 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -7674,9 +8098,9 @@ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -7698,9 +8122,9 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -7722,9 +8146,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" @@ -7737,9 +8161,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" dependencies = [ "memchr", ] @@ -7765,13 +8189,10 @@ dependencies = [ ] [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags 2.9.1", -] +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "wrapcenum-derive" @@ -7782,7 +8203,7 @@ dependencies = [ "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -7793,12 +8214,12 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wry" -version = "0.53.3" +version = "0.53.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f0e9642a0d061f6236c54ccae64c2722a7879ad4ec7dff59bd376d446d8e90" +checksum = "6d78ec082b80fa088569a970d043bb3050abaabf4454101d44514ee8d9a8c9f6" dependencies = [ "base64 0.22.1", - "block2 0.6.1", + "block2 0.6.2", "cookie", "crossbeam-channel", "dirs", @@ -7806,17 +8227,17 @@ dependencies = [ "dunce", "gdkx11", "gtk", - "html5ever", + "html5ever 0.29.1", "http 1.3.1", "javascriptcore-rs", "jni", "kuchikiki", "libc", "ndk", - "objc2 0.6.1", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "objc2-ui-kit", "objc2-web-kit", "once_cell", @@ -7825,7 +8246,7 @@ dependencies = [ "sha2", "soup3", "tao-macros", - "thiserror 2.0.12", + "thiserror 2.0.17", "url", "webkit2gtk", "webkit2gtk-sys", @@ -7868,9 +8289,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3a19837351dc82ba89f8a125e22a3c475f05aba604acc023d62b2739ae2909" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", "rustix", @@ -7882,6 +8303,17 @@ version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7" +[[package]] +name = "xml5ever" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4034e1d05af98b51ad7214527730626f019682d797ba38b51689212118d8e650" +dependencies = [ + "log", + "mac", + "markup5ever 0.11.0", +] + [[package]] name = "yoke" version = "0.8.0" @@ -7902,15 +8334,15 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "synstructure", ] [[package]] name = "zbus" -version = "5.9.0" +version = "5.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb4f9a464286d42851d18a605f7193b8febaf5b0919d71c6399b7b26e5b0aad" +checksum = "2d07e46d035fb8e375b2ce63ba4e4ff90a7f73cf2ffb0138b29e1158d2eaadf7" dependencies = [ "async-broadcast", "async-executor", @@ -7933,8 +8365,8 @@ dependencies = [ "tokio", "tracing", "uds_windows", - "windows-sys 0.59.0", - "winnow 0.7.12", + "windows-sys 0.60.2", + "winnow 0.7.13", "zbus_macros", "zbus_names", "zvariant", @@ -7942,14 +8374,14 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "5.9.0" +version = "5.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9859f68ee0c4ee2e8cde84737c78e3f4c54f946f2a38645d0d4c7a95327659" +checksum = "57e797a9c847ed3ccc5b6254e8bcce056494b375b511b3d6edcec0aeb4defaca" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "zbus_names", "zvariant", "zvariant_utils", @@ -7963,28 +8395,28 @@ checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", - "winnow 0.7.12", + "winnow 0.7.13", "zvariant", ] [[package]] name = "zerocopy" -version = "0.8.26" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.26" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -8004,15 +8436,15 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "synstructure", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zerotrie" @@ -8044,7 +8476,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -8069,13 +8501,13 @@ dependencies = [ [[package]] name = "zip" -version = "4.3.0" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aed4ac33e8eb078c89e6cbb1d5c4c7703ec6d299fc3e7c3695af8f8b423468b" +checksum = "caa8cd6af31c3b31c6631b8f483848b91589021b28fffe50adada48d4f4d2ed1" dependencies = [ "arbitrary", "crc32fast", - "indexmap 2.10.0", + "indexmap 2.11.4", "memchr", ] @@ -8110,42 +8542,41 @@ dependencies = [ [[package]] name = "zvariant" -version = "5.6.0" +version = "5.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91b3680bb339216abd84714172b5138a4edac677e641ef17e1d8cb1b3ca6e6f" +checksum = "999dd3be73c52b1fccd109a4a81e4fcd20fab1d3599c8121b38d04e1419498db" dependencies = [ "endi", "enumflags2", "serde", "url", - "winnow 0.7.12", + "winnow 0.7.13", "zvariant_derive", "zvariant_utils", ] [[package]] name = "zvariant_derive" -version = "5.6.0" +version = "5.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8c68501be459a8dbfffbe5d792acdd23b4959940fc87785fb013b32edbc208" +checksum = "6643fd0b26a46d226bd90d3f07c1b5321fe9bb7f04673cb37ac6d6883885b68e" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "zvariant_utils", ] [[package]] name = "zvariant_utils" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16edfee43e5d7b553b77872d99bc36afdda75c223ca7ad5e3fbecd82ca5fc34" +checksum = "c6949d142f89f6916deca2232cf26a8afacf2b9fdc35ce766105e104478be599" dependencies = [ "proc-macro2", "quote", "serde", - "static_assertions", - "syn 2.0.104", - "winnow 0.7.12", + "syn 2.0.106", + "winnow 0.7.13", ] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 79d6d1a4c4..7407bfa87e 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -63,7 +63,9 @@ log = "0.4" rmcp = { version = "0.6.0", features = [ "client", "transport-sse-client", + "transport-sse-client-reqwest", "transport-streamable-http-client", + "transport-streamable-http-client-reqwest", "transport-child-process", "tower", "reqwest", @@ -77,6 +79,8 @@ tauri-plugin-dialog = "2.2.1" tauri-plugin-deep-link = { version = "2", optional = true } tauri-plugin-hardware = { path = "./plugins/tauri-plugin-hardware", optional = true } tauri-plugin-llamacpp = { path = "./plugins/tauri-plugin-llamacpp" } +tauri-plugin-vector-db = { path = "./plugins/tauri-plugin-vector-db" } +tauri-plugin-rag = { path = "./plugins/tauri-plugin-rag" } tauri-plugin-http = { version = "2", features = ["unsafe-headers"] } tauri-plugin-log = "2.0.0-rc" tauri-plugin-opener = "2.2.7" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 5c5e7d48d2..8d054b0c1a 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -22,6 +22,8 @@ "core:webview:allow-create-webview-window", "opener:allow-open-url", "store:default", + "vector-db:default", + "rag:default", { "identifier": "http:default", "allow": [ diff --git a/src-tauri/capabilities/desktop.json b/src-tauri/capabilities/desktop.json index 2182b9c039..2e2eaa1091 100644 --- a/src-tauri/capabilities/desktop.json +++ b/src-tauri/capabilities/desktop.json @@ -25,6 +25,8 @@ "core:webview:allow-create-webview-window", "opener:allow-open-url", "store:default", + "vector-db:default", + "rag:default", "llamacpp:default", "deep-link:default", "hardware:default", @@ -62,4 +64,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/index.ts b/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/index.ts index 957839a632..7c0e3e4be2 100644 --- a/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/index.ts +++ b/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/index.ts @@ -30,12 +30,14 @@ export async function cleanupLlamaProcesses(): Promise { export async function loadLlamaModel( backendPath: string, libraryPath?: string, - args: string[] = [] + args: string[] = [], + isEmbedding: boolean = false ): Promise { return await invoke('plugin:llamacpp|load_llama_model', { backendPath, libraryPath, args, + isEmbedding, }) } diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/src/commands.rs b/src-tauri/plugins/tauri-plugin-llamacpp/src/commands.rs index 96ecb36bce..1d898b4d97 100644 --- a/src-tauri/plugins/tauri-plugin-llamacpp/src/commands.rs +++ b/src-tauri/plugins/tauri-plugin-llamacpp/src/commands.rs @@ -44,6 +44,7 @@ pub async fn load_llama_model( library_path: Option<&str>, mut args: Vec, envs: HashMap, + is_embedding: bool, ) -> ServerResult { let state: State = app_handle.state(); let mut process_map = state.llama_server_process.lock().await; @@ -223,6 +224,7 @@ pub async fn load_llama_model( port: port, model_id: model_id, model_path: model_path_pb.display().to_string(), + is_embedding: is_embedding, api_key: api_key, mmproj_path: mmproj_path_string, }; diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/src/state.rs b/src-tauri/plugins/tauri-plugin-llamacpp/src/state.rs index 2aad02ecfc..a299ec9c55 100644 --- a/src-tauri/plugins/tauri-plugin-llamacpp/src/state.rs +++ b/src-tauri/plugins/tauri-plugin-llamacpp/src/state.rs @@ -10,6 +10,7 @@ pub struct SessionInfo { pub port: i32, // llama-server output port pub model_id: String, pub model_path: String, // path of the loaded model + pub is_embedding: bool, pub api_key: String, #[serde(default)] pub mmproj_path: Option, diff --git a/src-tauri/plugins/tauri-plugin-rag/.gitignore b/src-tauri/plugins/tauri-plugin-rag/.gitignore new file mode 100644 index 0000000000..50d8e32e89 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/.gitignore @@ -0,0 +1,17 @@ +/.vs +.DS_Store +.Thumbs.db +*.sublime* +.idea/ +debug.log +package-lock.json +.vscode/settings.json +yarn.lock + +/.tauri +/target +Cargo.lock +node_modules/ + +dist-js +dist diff --git a/src-tauri/plugins/tauri-plugin-rag/Cargo.toml b/src-tauri/plugins/tauri-plugin-rag/Cargo.toml new file mode 100644 index 0000000000..3408735511 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "tauri-plugin-rag" +version = "0.1.0" +authors = ["Jan "] +description = "Tauri plugin for RAG utilities (document parsing, types)" +license = "MIT" +repository = "https://github.com/menloresearch/jan" +edition = "2021" +rust-version = "1.77.2" +exclude = ["/examples", "/dist-js", "/guest-js", "/node_modules"] +links = "tauri-plugin-rag" + +[dependencies] +tauri = { version = "2.8.5", default-features = false } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +thiserror = "2.0" +tokio = { version = "1", features = ["full"] } +log = "0.4" +pdf-extract = "0.7" +zip = "0.6" +quick-xml = { version = "0.31", features = ["serialize"] } +csv = "1.3" +calamine = "0.23" +html2text = "0.11" +chardetng = "0.1" +encoding_rs = "0.8" +infer = "0.15" + +[build-dependencies] +tauri-plugin = { version = "2.3.1", features = ["build"] } diff --git a/src-tauri/plugins/tauri-plugin-rag/build.rs b/src-tauri/plugins/tauri-plugin-rag/build.rs new file mode 100644 index 0000000000..30c58872d2 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/build.rs @@ -0,0 +1,7 @@ +fn main() { + tauri_plugin::Builder::new(&[ + "parse_document", + ]) + .build(); +} + diff --git a/src-tauri/plugins/tauri-plugin-rag/guest-js/index.ts b/src-tauri/plugins/tauri-plugin-rag/guest-js/index.ts new file mode 100644 index 0000000000..9f79651590 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/guest-js/index.ts @@ -0,0 +1,6 @@ +import { invoke } from '@tauri-apps/api/core' + +export async function parseDocument(filePath: string, fileType: string): Promise { + // Send both snake_case and camelCase for compatibility across runtimes/builds + return await invoke('plugin:rag|parse_document', { filePath, fileType }) +} diff --git a/src-tauri/plugins/tauri-plugin-rag/package.json b/src-tauri/plugins/tauri-plugin-rag/package.json new file mode 100644 index 0000000000..bac28917d5 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/package.json @@ -0,0 +1,33 @@ +{ + "name": "@janhq/tauri-plugin-rag-api", + "version": "0.1.0", + "private": true, + "description": "Guest JS API for Jan RAG plugin", + "type": "module", + "types": "./dist-js/index.d.ts", + "main": "./dist-js/index.cjs", + "module": "./dist-js/index.js", + "exports": { + "types": "./dist-js/index.d.ts", + "import": "./dist-js/index.js", + "require": "./dist-js/index.cjs" + }, + "files": [ + "dist-js", + "README.md" + ], + "scripts": { + "build": "rollup -c", + "prepublishOnly": "yarn build", + "pretest": "yarn build" + }, + "dependencies": { + "@tauri-apps/api": ">=2.0.0-beta.6" + }, + "devDependencies": { + "@rollup/plugin-typescript": "^12.0.0", + "rollup": "^4.9.6", + "tslib": "^2.6.2", + "typescript": "^5.3.3" + } +} diff --git a/src-tauri/plugins/tauri-plugin-rag/permissions/autogenerated/commands/parse_document.toml b/src-tauri/plugins/tauri-plugin-rag/permissions/autogenerated/commands/parse_document.toml new file mode 100644 index 0000000000..5cb5da40fd --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/permissions/autogenerated/commands/parse_document.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-parse-document" +description = "Enables the parse_document command without any pre-configured scope." +commands.allow = ["parse_document"] + +[[permission]] +identifier = "deny-parse-document" +description = "Denies the parse_document command without any pre-configured scope." +commands.deny = ["parse_document"] diff --git a/src-tauri/plugins/tauri-plugin-rag/permissions/autogenerated/reference.md b/src-tauri/plugins/tauri-plugin-rag/permissions/autogenerated/reference.md new file mode 100644 index 0000000000..148c91dfa2 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/permissions/autogenerated/reference.md @@ -0,0 +1,43 @@ +## Default Permission + +Default permissions for the rag plugin + +#### This default permission set includes the following: + +- `allow-parse-document` + +## Permission Table + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`rag:allow-parse-document` + + + +Enables the parse_document command without any pre-configured scope. + +
+ +`rag:deny-parse-document` + + + +Denies the parse_document command without any pre-configured scope. + +
diff --git a/src-tauri/plugins/tauri-plugin-rag/permissions/default.toml b/src-tauri/plugins/tauri-plugin-rag/permissions/default.toml new file mode 100644 index 0000000000..3c8dd7537a --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/permissions/default.toml @@ -0,0 +1,6 @@ +[default] +description = "Default permissions for the rag plugin" +permissions = [ + "allow-parse-document", +] + diff --git a/src-tauri/plugins/tauri-plugin-rag/permissions/schemas/schema.json b/src-tauri/plugins/tauri-plugin-rag/permissions/schemas/schema.json new file mode 100644 index 0000000000..a4b5488ac8 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/permissions/schemas/schema.json @@ -0,0 +1,318 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri convention is to use `

` headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri internal convention is to use `

` headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Target": { + "description": "Platform target.", + "oneOf": [ + { + "description": "MacOS.", + "type": "string", + "enum": [ + "macOS" + ] + }, + { + "description": "Windows.", + "type": "string", + "enum": [ + "windows" + ] + }, + { + "description": "Linux.", + "type": "string", + "enum": [ + "linux" + ] + }, + { + "description": "Android.", + "type": "string", + "enum": [ + "android" + ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the parse_document command without any pre-configured scope.", + "type": "string", + "const": "allow-parse-document", + "markdownDescription": "Enables the parse_document command without any pre-configured scope." + }, + { + "description": "Denies the parse_document command without any pre-configured scope.", + "type": "string", + "const": "deny-parse-document", + "markdownDescription": "Denies the parse_document command without any pre-configured scope." + }, + { + "description": "Default permissions for the rag plugin\n#### This default permission set includes:\n\n- `allow-parse-document`", + "type": "string", + "const": "default", + "markdownDescription": "Default permissions for the rag plugin\n#### This default permission set includes:\n\n- `allow-parse-document`" + } + ] + } + } +} \ No newline at end of file diff --git a/src-tauri/plugins/tauri-plugin-rag/rollup.config.js b/src-tauri/plugins/tauri-plugin-rag/rollup.config.js new file mode 100644 index 0000000000..5047bf72d8 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/rollup.config.js @@ -0,0 +1,32 @@ +import { readFileSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { cwd } from 'node:process' +import typescript from '@rollup/plugin-typescript' + +const pkg = JSON.parse(readFileSync(join(cwd(), 'package.json'), 'utf8')) + +export default { + input: 'guest-js/index.ts', + output: [ + { + file: pkg.exports.import, + format: 'esm' + }, + { + file: pkg.exports.require, + format: 'cjs' + } + ], + plugins: [ + typescript({ + declaration: true, + declarationDir: dirname(pkg.exports.import) + }) + ], + external: [ + /^@tauri-apps\/api/, + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.peerDependencies || {}) + ] +} + diff --git a/src-tauri/plugins/tauri-plugin-rag/src/commands.rs b/src-tauri/plugins/tauri-plugin-rag/src/commands.rs new file mode 100644 index 0000000000..6f2a0f1128 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/src/commands.rs @@ -0,0 +1,12 @@ +use crate::{RagError, parser}; + +#[tauri::command] +pub async fn parse_document( + _app: tauri::AppHandle, + file_path: String, + file_type: String, +) -> Result { + log::info!("Parsing document: {} (type: {})", file_path, file_type); + let res = parser::parse_document(&file_path, &file_type); + res +} diff --git a/src-tauri/plugins/tauri-plugin-rag/src/error.rs b/src-tauri/plugins/tauri-plugin-rag/src/error.rs new file mode 100644 index 0000000000..fe693130b8 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/src/error.rs @@ -0,0 +1,20 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, thiserror::Error, Serialize, Deserialize)] +pub enum RagError { + #[error("Failed to parse document: {0}")] + ParseError(String), + + #[error("Unsupported file type: {0}")] + UnsupportedFileType(String), + + #[error("IO error: {0}")] + IoError(String), +} + +impl From for RagError { + fn from(err: std::io::Error) -> Self { + RagError::IoError(err.to_string()) + } +} + diff --git a/src-tauri/plugins/tauri-plugin-rag/src/lib.rs b/src-tauri/plugins/tauri-plugin-rag/src/lib.rs new file mode 100644 index 0000000000..1c66e33885 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/src/lib.rs @@ -0,0 +1,20 @@ +use tauri::{ + plugin::{Builder, TauriPlugin}, + Runtime, +}; + +mod parser; +mod error; +mod commands; + +pub use error::RagError; + +pub fn init() -> TauriPlugin { + Builder::new("rag") + .invoke_handler(tauri::generate_handler![ + commands::parse_document, + ]) + .setup(|_app, _api| Ok(())) + .build() +} + diff --git a/src-tauri/plugins/tauri-plugin-rag/src/parser.rs b/src-tauri/plugins/tauri-plugin-rag/src/parser.rs new file mode 100644 index 0000000000..d21c1de5d6 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/src/parser.rs @@ -0,0 +1,274 @@ +use crate::RagError; +use std::fs; +use std::io::{Read, Cursor}; +use zip::read::ZipArchive; +use quick_xml::events::Event; +use quick_xml::Reader; +use csv as csv_crate; +use calamine::{Reader as _, open_workbook_auto, DataType}; +use html2text; +use chardetng::EncodingDetector; +use infer; +use std::borrow::Cow; + +pub fn parse_pdf(file_path: &str) -> Result { + let bytes = fs::read(file_path)?; + let text = pdf_extract::extract_text_from_mem(&bytes) + .map_err(|e| RagError::ParseError(format!("PDF parse error: {}", e)))?; + + // Validate that the PDF has extractable text (not image-based/scanned) + // Count meaningful characters (excluding whitespace) + let meaningful_chars = text.chars() + .filter(|c| !c.is_whitespace()) + .count(); + + // Require at least 50 non-whitespace characters to consider it a text PDF + // This threshold filters out PDFs that are purely images or scanned documents + if meaningful_chars < 50 { + return Err(RagError::ParseError( + "PDF appears to be image-based or scanned. OCR is not supported yet. Please use a text-based PDF.".to_string() + )); + } + + Ok(text) +} + +pub fn parse_text(file_path: &str) -> Result { + read_text_auto(file_path) +} + +pub fn parse_document(file_path: &str, file_type: &str) -> Result { + match file_type.to_lowercase().as_str() { + "pdf" | "application/pdf" => parse_pdf(file_path), + "txt" | "text/plain" | "md" | "text/markdown" => parse_text(file_path), + "csv" | "text/csv" => parse_csv(file_path), + // Excel family via calamine + "xlsx" + | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + | "xls" + | "application/vnd.ms-excel" + | "ods" + | "application/vnd.oasis.opendocument.spreadsheet" => parse_spreadsheet(file_path), + // PowerPoint + "pptx" + | "application/vnd.openxmlformats-officedocument.presentationml.presentation" => parse_pptx(file_path), + // HTML + "html" | "htm" | "text/html" => parse_html(file_path), + "docx" + | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" => { + parse_docx(file_path) + } + other => { + // Try MIME sniffing when extension or MIME is unknown + if let Ok(Some(k)) = infer::get_from_path(file_path) { + let mime = k.mime_type(); + return parse_document(file_path, mime); + } + Err(RagError::UnsupportedFileType(other.to_string())) + } + } +} + +fn parse_docx(file_path: &str) -> Result { + let file = std::fs::File::open(file_path)?; + let mut zip = ZipArchive::new(file).map_err(|e| RagError::ParseError(e.to_string()))?; + + // Standard DOCX stores document text at word/document.xml + let mut doc_xml = match zip.by_name("word/document.xml") { + Ok(f) => f, + Err(_) => return Err(RagError::ParseError("document.xml not found".into())), + }; + let mut xml_content = String::new(); + doc_xml + .read_to_string(&mut xml_content) + .map_err(|e| RagError::ParseError(e.to_string()))?; + + // Parse XML and extract text from w:t nodes; add newlines on w:p boundaries + let mut reader = Reader::from_str(&xml_content); + reader.trim_text(true); + let mut buf = Vec::new(); + let mut result = String::new(); + let mut in_text = false; + + loop { + match reader.read_event_into(&mut buf) { + Ok(Event::Start(e)) => { + let name: String = reader + .decoder() + .decode(e.name().as_ref()) + .unwrap_or(Cow::Borrowed("")) + .into_owned(); + if name.ends_with(":t") || name == "w:t" || name == "t" { + in_text = true; + } + } + Ok(Event::End(e)) => { + let name: String = reader + .decoder() + .decode(e.name().as_ref()) + .unwrap_or(Cow::Borrowed("")) + .into_owned(); + if name.ends_with(":t") || name == "w:t" || name == "t" { + in_text = false; + result.push(' '); + } + if name.ends_with(":p") || name == "w:p" || name == "p" { + // Paragraph end – add newline + result.push_str("\n\n"); + } + } + Ok(Event::Text(t)) => { + if in_text { + let text = t.unescape().unwrap_or_default(); + result.push_str(&text); + } + } + Ok(Event::Eof) => break, + Err(e) => return Err(RagError::ParseError(e.to_string())), + _ => {} + } + } + + // Normalize whitespace + let normalized = result + .lines() + .map(|l| l.trim()) + .filter(|l| !l.is_empty()) + .collect::>() + .join("\n"); + Ok(normalized) +} + +fn parse_csv(file_path: &str) -> Result { + let mut rdr = csv_crate::ReaderBuilder::new() + .has_headers(false) + .flexible(true) + .from_path(file_path) + .map_err(|e| RagError::ParseError(e.to_string()))?; + let mut out = String::new(); + for rec in rdr.records() { + let rec = rec.map_err(|e| RagError::ParseError(e.to_string()))?; + out.push_str(&rec.iter().collect::>().join(", ")); + out.push('\n'); + } + Ok(out) +} + +fn parse_spreadsheet(file_path: &str) -> Result { + let mut workbook = open_workbook_auto(file_path) + .map_err(|e| RagError::ParseError(e.to_string()))?; + let mut out = String::new(); + for sheet_name in workbook.sheet_names().to_owned() { + if let Ok(range) = workbook.worksheet_range(&sheet_name) { + out.push_str(&format!("# Sheet: {}\n", sheet_name)); + for row in range.rows() { + let cells = row + .iter() + .map(|c| match c { + DataType::Empty => "".to_string(), + DataType::String(s) => s.to_string(), + DataType::Float(f) => format!("{}", f), + DataType::Int(i) => i.to_string(), + DataType::Bool(b) => b.to_string(), + DataType::DateTime(f) => format!("{}", f), + other => other.to_string(), + }) + .collect::>() + .join("\t"); + out.push_str(&cells); + out.push('\n'); + } + out.push_str("\n"); + } + } + Ok(out) +} + +fn parse_pptx(file_path: &str) -> Result { + let file = std::fs::File::open(file_path)?; + let mut zip = ZipArchive::new(file).map_err(|e| RagError::ParseError(e.to_string()))?; + + // Collect slide files: ppt/slides/slide*.xml + let mut slides = Vec::new(); + for i in 0..zip.len() { + let name = zip.by_index(i).map(|f| f.name().to_string()).unwrap_or_default(); + if name.starts_with("ppt/slides/") && name.ends_with(".xml") { + slides.push(name); + } + } + slides.sort(); + + let mut output = String::new(); + for slide_name in slides { + let mut file = zip.by_name(&slide_name).map_err(|e| RagError::ParseError(e.to_string()))?; + let mut xml = String::new(); + file.read_to_string(&mut xml).map_err(|e| RagError::ParseError(e.to_string()))?; + output.push_str(&extract_pptx_text(&xml)); + output.push_str("\n\n"); + } + Ok(output) +} + +fn extract_pptx_text(xml: &str) -> String { + let mut reader = Reader::from_str(xml); + reader.trim_text(true); + let mut buf = Vec::new(); + let mut result = String::new(); + let mut in_text = false; + loop { + match reader.read_event_into(&mut buf) { + Ok(Event::Start(e)) => { + let name: String = reader + .decoder() + .decode(e.name().as_ref()) + .unwrap_or(Cow::Borrowed("")) + .into_owned(); + if name.ends_with(":t") || name == "a:t" || name == "t" { + in_text = true; + } + } + Ok(Event::End(e)) => { + let name: String = reader + .decoder() + .decode(e.name().as_ref()) + .unwrap_or(Cow::Borrowed("")) + .into_owned(); + if name.ends_with(":t") || name == "a:t" || name == "t" { + in_text = false; + result.push(' '); + } + } + Ok(Event::Text(t)) => { + if in_text { + let text = t.unescape().unwrap_or_default(); + result.push_str(&text); + } + } + Ok(Event::Eof) => break, + Err(_) => break, + _ => {} + } + } + result +} + +fn parse_html(file_path: &str) -> Result { + let html = read_text_auto(file_path)?; + // 80-column wrap default + Ok(html2text::from_read(Cursor::new(html), 80)) +} + +fn read_text_auto(file_path: &str) -> Result { + let bytes = fs::read(file_path)?; + // Detect encoding + let mut detector = EncodingDetector::new(); + detector.feed(&bytes, true); + let enc = detector.guess(None, true); + let (decoded, _, had_errors) = enc.decode(&bytes); + if had_errors { + // fallback to UTF-8 lossy + Ok(String::from_utf8_lossy(&bytes).to_string()) + } else { + Ok(decoded.to_string()) + } +} diff --git a/src-tauri/plugins/tauri-plugin-rag/tsconfig.json b/src-tauri/plugins/tauri-plugin-rag/tsconfig.json new file mode 100644 index 0000000000..60bc6a8eb2 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-rag/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es2021", + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "strict": true, + "noUnusedLocals": true, + "noImplicitAny": true, + "noEmit": true + }, + "include": ["guest-js/*.ts"], + "exclude": ["dist-js", "node_modules"] +} + diff --git a/src-tauri/plugins/tauri-plugin-vector-db/.gitignore b/src-tauri/plugins/tauri-plugin-vector-db/.gitignore new file mode 100644 index 0000000000..50d8e32e89 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/.gitignore @@ -0,0 +1,17 @@ +/.vs +.DS_Store +.Thumbs.db +*.sublime* +.idea/ +debug.log +package-lock.json +.vscode/settings.json +yarn.lock + +/.tauri +/target +Cargo.lock +node_modules/ + +dist-js +dist diff --git a/src-tauri/plugins/tauri-plugin-vector-db/Cargo.toml b/src-tauri/plugins/tauri-plugin-vector-db/Cargo.toml new file mode 100644 index 0000000000..eb377c1573 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "tauri-plugin-vector-db" +version = "0.1.0" +authors = ["Jan "] +description = "Tauri plugin for vector storage and similarity search" +license = "MIT" +repository = "https://github.com/menloresearch/jan" +edition = "2021" +rust-version = "1.77.2" +exclude = ["/examples", "/dist-js", "/guest-js", "/node_modules"] +links = "tauri-plugin-vector-db" + +[dependencies] +tauri = { version = "2.8.5", default-features = false } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +thiserror = "2.0" +tokio = { version = "1", features = ["full"] } +log = "0.4" +rusqlite = { version = "0.32", features = ["bundled", "load_extension"] } +uuid = { version = "1.7", features = ["v4", "serde"] } +dirs = "6.0.0" + +[build-dependencies] +tauri-plugin = { version = "2.3.1", features = ["build"] } diff --git a/src-tauri/plugins/tauri-plugin-vector-db/build.rs b/src-tauri/plugins/tauri-plugin-vector-db/build.rs new file mode 100644 index 0000000000..0f2f3f4fd9 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/build.rs @@ -0,0 +1,16 @@ +fn main() { + tauri_plugin::Builder::new(&[ + "create_collection", + "create_file", + "insert_chunks", + "search_collection", + "delete_chunks", + "delete_file", + "delete_collection", + "chunk_text", + "get_status", + "list_attachments", + "get_chunks", + ]) + .build(); +} diff --git a/src-tauri/plugins/tauri-plugin-vector-db/guest-js/index.ts b/src-tauri/plugins/tauri-plugin-vector-db/guest-js/index.ts new file mode 100644 index 0000000000..d66af5cb41 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/guest-js/index.ts @@ -0,0 +1,114 @@ +import { invoke } from '@tauri-apps/api/core' + +export type SearchMode = 'auto' | 'ann' | 'linear' + +export interface SearchResult { + id: string + text: string + score?: number + file_id: string + chunk_file_order: number +} + +export interface Status { + ann_available: boolean +} + +export interface AttachmentFileInfo { + id: string + name?: string + path?: string + type?: string + size?: number + chunk_count: number +} + +// Events +// Events are not exported in guest-js to keep API minimal + +export async function getStatus(): Promise { + return await invoke('plugin:vector-db|get_status') +} + +export async function createCollection(name: string, dimension: number): Promise { + // Use camelCase param name `dimension` to match Tauri v2 argument keys + return await invoke('plugin:vector-db|create_collection', { name, dimension }) +} + +export async function createFile( + collection: string, + file: { path: string; name?: string; type?: string; size?: number } +): Promise { + return await invoke('plugin:vector-db|create_file', { collection, file }) +} + +export async function insertChunks( + collection: string, + fileId: string, + chunks: Array<{ text: string; embedding: number[] }> +): Promise { + return await invoke('plugin:vector-db|insert_chunks', { collection, fileId, chunks }) +} + +export async function deleteFile( + collection: string, + fileId: string +): Promise { + return await invoke('plugin:vector-db|delete_file', { collection, fileId }) +} + +export async function searchCollection( + collection: string, + queryEmbedding: number[], + limit: number, + threshold: number, + mode?: SearchMode, + fileIds?: string[] +): Promise { + return await invoke('plugin:vector-db|search_collection', { + collection, + queryEmbedding, + limit, + threshold, + mode, + fileIds, + }) +} + +export async function deleteChunks(collection: string, ids: string[]): Promise { + return await invoke('plugin:vector-db|delete_chunks', { collection, ids }) +} + +export async function deleteCollection(collection: string): Promise { + return await invoke('plugin:vector-db|delete_collection', { collection }) +} + +export async function chunkText( + text: string, + chunkSize: number, + chunkOverlap: number +): Promise { + // Use snake_case to match Rust command parameter names + return await invoke('plugin:vector-db|chunk_text', { text, chunkSize, chunkOverlap }) +} + +export async function listAttachments( + collection: string, + limit?: number +): Promise { + return await invoke('plugin:vector-db|list_attachments', { collection, limit }) +} + +export async function getChunks( + collection: string, + fileId: string, + startOrder: number, + endOrder: number +): Promise { + return await invoke('plugin:vector-db|get_chunks', { + collection, + fileId, + startOrder, + endOrder, + }) +} diff --git a/src-tauri/plugins/tauri-plugin-vector-db/package.json b/src-tauri/plugins/tauri-plugin-vector-db/package.json new file mode 100644 index 0000000000..d2db2bbbeb --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/package.json @@ -0,0 +1,33 @@ +{ + "name": "@janhq/tauri-plugin-vector-db-api", + "version": "0.1.0", + "private": true, + "description": "Guest JS API for Jan vector DB plugin", + "type": "module", + "types": "./dist-js/index.d.ts", + "main": "./dist-js/index.cjs", + "module": "./dist-js/index.js", + "exports": { + "types": "./dist-js/index.d.ts", + "import": "./dist-js/index.js", + "require": "./dist-js/index.cjs" + }, + "files": [ + "dist-js", + "README.md" + ], + "scripts": { + "build": "rollup -c", + "prepublishOnly": "yarn build", + "pretest": "yarn build" + }, + "dependencies": { + "@tauri-apps/api": ">=2.0.0-beta.6" + }, + "devDependencies": { + "@rollup/plugin-typescript": "^12.0.0", + "rollup": "^4.9.6", + "tslib": "^2.6.2", + "typescript": "^5.3.3" + } +} diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/chunk_text.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/chunk_text.toml new file mode 100644 index 0000000000..341a0a1947 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/chunk_text.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-chunk-text" +description = "Enables the chunk_text command without any pre-configured scope." +commands.allow = ["chunk_text"] + +[[permission]] +identifier = "deny-chunk-text" +description = "Denies the chunk_text command without any pre-configured scope." +commands.deny = ["chunk_text"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/create_collection.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/create_collection.toml new file mode 100644 index 0000000000..4026444975 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/create_collection.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-create-collection" +description = "Enables the create_collection command without any pre-configured scope." +commands.allow = ["create_collection"] + +[[permission]] +identifier = "deny-create-collection" +description = "Denies the create_collection command without any pre-configured scope." +commands.deny = ["create_collection"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/create_file.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/create_file.toml new file mode 100644 index 0000000000..7fc6c3ff8b --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/create_file.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-create-file" +description = "Enables the create_file command without any pre-configured scope." +commands.allow = ["create_file"] + +[[permission]] +identifier = "deny-create-file" +description = "Denies the create_file command without any pre-configured scope." +commands.deny = ["create_file"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_chunks.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_chunks.toml new file mode 100644 index 0000000000..ecf2055a81 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_chunks.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-delete-chunks" +description = "Enables the delete_chunks command without any pre-configured scope." +commands.allow = ["delete_chunks"] + +[[permission]] +identifier = "deny-delete-chunks" +description = "Denies the delete_chunks command without any pre-configured scope." +commands.deny = ["delete_chunks"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_collection.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_collection.toml new file mode 100644 index 0000000000..5a24329cbf --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_collection.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-delete-collection" +description = "Enables the delete_collection command without any pre-configured scope." +commands.allow = ["delete_collection"] + +[[permission]] +identifier = "deny-delete-collection" +description = "Denies the delete_collection command without any pre-configured scope." +commands.deny = ["delete_collection"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_file.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_file.toml new file mode 100644 index 0000000000..aafe069a64 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/delete_file.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-delete-file" +description = "Enables the delete_file command without any pre-configured scope." +commands.allow = ["delete_file"] + +[[permission]] +identifier = "deny-delete-file" +description = "Denies the delete_file command without any pre-configured scope." +commands.deny = ["delete_file"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/get_chunks.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/get_chunks.toml new file mode 100644 index 0000000000..6dc03e3114 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/get_chunks.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-get-chunks" +description = "Enables the get_chunks command without any pre-configured scope." +commands.allow = ["get_chunks"] + +[[permission]] +identifier = "deny-get-chunks" +description = "Denies the get_chunks command without any pre-configured scope." +commands.deny = ["get_chunks"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/get_status.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/get_status.toml new file mode 100644 index 0000000000..ff573a743e --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/get_status.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-get-status" +description = "Enables the get_status command without any pre-configured scope." +commands.allow = ["get_status"] + +[[permission]] +identifier = "deny-get-status" +description = "Denies the get_status command without any pre-configured scope." +commands.deny = ["get_status"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/insert_chunks.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/insert_chunks.toml new file mode 100644 index 0000000000..c83e268d2e --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/insert_chunks.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-insert-chunks" +description = "Enables the insert_chunks command without any pre-configured scope." +commands.allow = ["insert_chunks"] + +[[permission]] +identifier = "deny-insert-chunks" +description = "Denies the insert_chunks command without any pre-configured scope." +commands.deny = ["insert_chunks"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/list_attachments.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/list_attachments.toml new file mode 100644 index 0000000000..bbf2d996f8 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/list_attachments.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-list-attachments" +description = "Enables the list_attachments command without any pre-configured scope." +commands.allow = ["list_attachments"] + +[[permission]] +identifier = "deny-list-attachments" +description = "Denies the list_attachments command without any pre-configured scope." +commands.deny = ["list_attachments"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/search_collection.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/search_collection.toml new file mode 100644 index 0000000000..e408b935c8 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/commands/search_collection.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-search-collection" +description = "Enables the search_collection command without any pre-configured scope." +commands.allow = ["search_collection"] + +[[permission]] +identifier = "deny-search-collection" +description = "Denies the search_collection command without any pre-configured scope." +commands.deny = ["search_collection"] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/reference.md b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/reference.md new file mode 100644 index 0000000000..b859ecb87e --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/autogenerated/reference.md @@ -0,0 +1,313 @@ +## Default Permission + +Default permissions for the vector-db plugin + +#### This default permission set includes the following: + +- `allow-get-status` +- `allow-create-collection` +- `allow-insert-chunks` +- `allow-create-file` +- `allow-search-collection` +- `allow-delete-chunks` +- `allow-delete-file` +- `allow-delete-collection` +- `allow-chunk-text` +- `allow-list-attachments` +- `allow-get-chunks` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`vector-db:allow-chunk-text` + + + +Enables the chunk_text command without any pre-configured scope. + +
+ +`vector-db:deny-chunk-text` + + + +Denies the chunk_text command without any pre-configured scope. + +
+ +`vector-db:allow-create-collection` + + + +Enables the create_collection command without any pre-configured scope. + +
+ +`vector-db:deny-create-collection` + + + +Denies the create_collection command without any pre-configured scope. + +
+ +`vector-db:allow-create-file` + + + +Enables the create_file command without any pre-configured scope. + +
+ +`vector-db:deny-create-file` + + + +Denies the create_file command without any pre-configured scope. + +
+ +`vector-db:allow-delete-chunks` + + + +Enables the delete_chunks command without any pre-configured scope. + +
+ +`vector-db:deny-delete-chunks` + + + +Denies the delete_chunks command without any pre-configured scope. + +
+ +`vector-db:allow-delete-collection` + + + +Enables the delete_collection command without any pre-configured scope. + +
+ +`vector-db:deny-delete-collection` + + + +Denies the delete_collection command without any pre-configured scope. + +
+ +`vector-db:allow-delete-file` + + + +Enables the delete_file command without any pre-configured scope. + +
+ +`vector-db:deny-delete-file` + + + +Denies the delete_file command without any pre-configured scope. + +
+ +`vector-db:allow-get-chunks` + + + +Enables the get_chunks command without any pre-configured scope. + +
+ +`vector-db:deny-get-chunks` + + + +Denies the get_chunks command without any pre-configured scope. + +
+ +`vector-db:allow-get-status` + + + +Enables the get_status command without any pre-configured scope. + +
+ +`vector-db:deny-get-status` + + + +Denies the get_status command without any pre-configured scope. + +
+ +`vector-db:allow-insert-chunks` + + + +Enables the insert_chunks command without any pre-configured scope. + +
+ +`vector-db:deny-insert-chunks` + + + +Denies the insert_chunks command without any pre-configured scope. + +
+ +`vector-db:allow-list-attachments` + + + +Enables the list_attachments command without any pre-configured scope. + +
+ +`vector-db:deny-list-attachments` + + + +Denies the list_attachments command without any pre-configured scope. + +
+ +`vector-db:allow-search-collection` + + + +Enables the search_collection command without any pre-configured scope. + +
+ +`vector-db:deny-search-collection` + + + +Denies the search_collection command without any pre-configured scope. + +
diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/default.toml b/src-tauri/plugins/tauri-plugin-vector-db/permissions/default.toml new file mode 100644 index 0000000000..a299986402 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/default.toml @@ -0,0 +1,15 @@ +[default] +description = "Default permissions for the vector-db plugin" +permissions = [ + "allow-get-status", + "allow-create-collection", + "allow-insert-chunks", + "allow-create-file", + "allow-search-collection", + "allow-delete-chunks", + "allow-delete-file", + "allow-delete-collection", + "allow-chunk-text", + "allow-list-attachments", + "allow-get-chunks", +] diff --git a/src-tauri/plugins/tauri-plugin-vector-db/permissions/schemas/schema.json b/src-tauri/plugins/tauri-plugin-vector-db/permissions/schemas/schema.json new file mode 100644 index 0000000000..6410337c53 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/permissions/schemas/schema.json @@ -0,0 +1,438 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri convention is to use `

` headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri internal convention is to use `

` headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Target": { + "description": "Platform target.", + "oneOf": [ + { + "description": "MacOS.", + "type": "string", + "enum": [ + "macOS" + ] + }, + { + "description": "Windows.", + "type": "string", + "enum": [ + "windows" + ] + }, + { + "description": "Linux.", + "type": "string", + "enum": [ + "linux" + ] + }, + { + "description": "Android.", + "type": "string", + "enum": [ + "android" + ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the chunk_text command without any pre-configured scope.", + "type": "string", + "const": "allow-chunk-text", + "markdownDescription": "Enables the chunk_text command without any pre-configured scope." + }, + { + "description": "Denies the chunk_text command without any pre-configured scope.", + "type": "string", + "const": "deny-chunk-text", + "markdownDescription": "Denies the chunk_text command without any pre-configured scope." + }, + { + "description": "Enables the create_collection command without any pre-configured scope.", + "type": "string", + "const": "allow-create-collection", + "markdownDescription": "Enables the create_collection command without any pre-configured scope." + }, + { + "description": "Denies the create_collection command without any pre-configured scope.", + "type": "string", + "const": "deny-create-collection", + "markdownDescription": "Denies the create_collection command without any pre-configured scope." + }, + { + "description": "Enables the create_file command without any pre-configured scope.", + "type": "string", + "const": "allow-create-file", + "markdownDescription": "Enables the create_file command without any pre-configured scope." + }, + { + "description": "Denies the create_file command without any pre-configured scope.", + "type": "string", + "const": "deny-create-file", + "markdownDescription": "Denies the create_file command without any pre-configured scope." + }, + { + "description": "Enables the delete_chunks command without any pre-configured scope.", + "type": "string", + "const": "allow-delete-chunks", + "markdownDescription": "Enables the delete_chunks command without any pre-configured scope." + }, + { + "description": "Denies the delete_chunks command without any pre-configured scope.", + "type": "string", + "const": "deny-delete-chunks", + "markdownDescription": "Denies the delete_chunks command without any pre-configured scope." + }, + { + "description": "Enables the delete_collection command without any pre-configured scope.", + "type": "string", + "const": "allow-delete-collection", + "markdownDescription": "Enables the delete_collection command without any pre-configured scope." + }, + { + "description": "Denies the delete_collection command without any pre-configured scope.", + "type": "string", + "const": "deny-delete-collection", + "markdownDescription": "Denies the delete_collection command without any pre-configured scope." + }, + { + "description": "Enables the delete_file command without any pre-configured scope.", + "type": "string", + "const": "allow-delete-file", + "markdownDescription": "Enables the delete_file command without any pre-configured scope." + }, + { + "description": "Denies the delete_file command without any pre-configured scope.", + "type": "string", + "const": "deny-delete-file", + "markdownDescription": "Denies the delete_file command without any pre-configured scope." + }, + { + "description": "Enables the get_chunks command without any pre-configured scope.", + "type": "string", + "const": "allow-get-chunks", + "markdownDescription": "Enables the get_chunks command without any pre-configured scope." + }, + { + "description": "Denies the get_chunks command without any pre-configured scope.", + "type": "string", + "const": "deny-get-chunks", + "markdownDescription": "Denies the get_chunks command without any pre-configured scope." + }, + { + "description": "Enables the get_status command without any pre-configured scope.", + "type": "string", + "const": "allow-get-status", + "markdownDescription": "Enables the get_status command without any pre-configured scope." + }, + { + "description": "Denies the get_status command without any pre-configured scope.", + "type": "string", + "const": "deny-get-status", + "markdownDescription": "Denies the get_status command without any pre-configured scope." + }, + { + "description": "Enables the insert_chunks command without any pre-configured scope.", + "type": "string", + "const": "allow-insert-chunks", + "markdownDescription": "Enables the insert_chunks command without any pre-configured scope." + }, + { + "description": "Denies the insert_chunks command without any pre-configured scope.", + "type": "string", + "const": "deny-insert-chunks", + "markdownDescription": "Denies the insert_chunks command without any pre-configured scope." + }, + { + "description": "Enables the list_attachments command without any pre-configured scope.", + "type": "string", + "const": "allow-list-attachments", + "markdownDescription": "Enables the list_attachments command without any pre-configured scope." + }, + { + "description": "Denies the list_attachments command without any pre-configured scope.", + "type": "string", + "const": "deny-list-attachments", + "markdownDescription": "Denies the list_attachments command without any pre-configured scope." + }, + { + "description": "Enables the search_collection command without any pre-configured scope.", + "type": "string", + "const": "allow-search-collection", + "markdownDescription": "Enables the search_collection command without any pre-configured scope." + }, + { + "description": "Denies the search_collection command without any pre-configured scope.", + "type": "string", + "const": "deny-search-collection", + "markdownDescription": "Denies the search_collection command without any pre-configured scope." + }, + { + "description": "Default permissions for the vector-db plugin\n#### This default permission set includes:\n\n- `allow-get-status`\n- `allow-create-collection`\n- `allow-insert-chunks`\n- `allow-create-file`\n- `allow-search-collection`\n- `allow-delete-chunks`\n- `allow-delete-file`\n- `allow-delete-collection`\n- `allow-chunk-text`\n- `allow-list-attachments`\n- `allow-get-chunks`", + "type": "string", + "const": "default", + "markdownDescription": "Default permissions for the vector-db plugin\n#### This default permission set includes:\n\n- `allow-get-status`\n- `allow-create-collection`\n- `allow-insert-chunks`\n- `allow-create-file`\n- `allow-search-collection`\n- `allow-delete-chunks`\n- `allow-delete-file`\n- `allow-delete-collection`\n- `allow-chunk-text`\n- `allow-list-attachments`\n- `allow-get-chunks`" + } + ] + } + } +} \ No newline at end of file diff --git a/src-tauri/plugins/tauri-plugin-vector-db/rollup.config.js b/src-tauri/plugins/tauri-plugin-vector-db/rollup.config.js new file mode 100644 index 0000000000..5047bf72d8 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/rollup.config.js @@ -0,0 +1,32 @@ +import { readFileSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { cwd } from 'node:process' +import typescript from '@rollup/plugin-typescript' + +const pkg = JSON.parse(readFileSync(join(cwd(), 'package.json'), 'utf8')) + +export default { + input: 'guest-js/index.ts', + output: [ + { + file: pkg.exports.import, + format: 'esm' + }, + { + file: pkg.exports.require, + format: 'cjs' + } + ], + plugins: [ + typescript({ + declaration: true, + declarationDir: dirname(pkg.exports.import) + }) + ], + external: [ + /^@tauri-apps\/api/, + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.peerDependencies || {}) + ] +} + diff --git a/src-tauri/plugins/tauri-plugin-vector-db/src/commands.rs b/src-tauri/plugins/tauri-plugin-vector-db/src/commands.rs new file mode 100644 index 0000000000..9996a90836 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/src/commands.rs @@ -0,0 +1,206 @@ +use crate::{VectorDBError, VectorDBState}; +use crate::db::{ + self, AttachmentFileInfo, SearchResult, MinimalChunkInput, +}; +use serde::{Deserialize, Serialize}; +use tauri::State; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Status { + pub ann_available: bool, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FileInput { + pub path: String, + pub name: Option, + #[serde(rename = "type")] + pub file_type: Option, + pub size: Option, +} + +// ============================================================================ +// Tauri Command Handlers +// ============================================================================ + +#[tauri::command] +pub async fn get_status(state: State<'_, VectorDBState>) -> Result { + println!("[VectorDB] Checking ANN availability..."); + let temp = db::collection_path(&state.base_dir, "__status__"); + let conn = db::open_or_init_conn(&temp)?; + + // Verbose version for startup diagnostics + let ann = { + if conn.execute("CREATE VIRTUAL TABLE IF NOT EXISTS temp.temp_vec USING vec0(embedding float[1])", []).is_ok() { + let _ = conn.execute("DROP TABLE IF EXISTS temp.temp_vec", []); + println!("[VectorDB] ✓ sqlite-vec already loaded"); + true + } else { + unsafe { let _ = conn.load_extension_enable(); } + let paths = db::possible_sqlite_vec_paths(); + println!("[VectorDB] Trying {} bundled paths...", paths.len()); + let mut found = false; + for p in paths { + println!("[VectorDB] Trying: {}", p); + unsafe { + if let Ok(_) = conn.load_extension(&p, Some("sqlite3_vec_init")) { + if conn.execute("CREATE VIRTUAL TABLE IF NOT EXISTS temp.temp_vec USING vec0(embedding float[1])", []).is_ok() { + let _ = conn.execute("DROP TABLE IF EXISTS temp.temp_vec", []); + println!("[VectorDB] ✓ sqlite-vec loaded from: {}", p); + found = true; + break; + } + } + } + } + if !found { + println!("[VectorDB] ✗ Failed to load sqlite-vec from all paths"); + } + found + } + }; + + println!("[VectorDB] ANN status: {}", if ann { "AVAILABLE ✓" } else { "NOT AVAILABLE ✗" }); + Ok(Status { ann_available: ann }) +} + +#[tauri::command] +pub async fn create_collection( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + name: String, + dimension: usize, +) -> Result<(), VectorDBError> { + let path = db::collection_path(&state.base_dir, &name); + let conn = db::open_or_init_conn(&path)?; + + let has_ann = db::create_schema(&conn, dimension)?; + if has_ann { + println!("[VectorDB] ✓ Collection '{}' created with ANN support", name); + } else { + println!("[VectorDB] ⚠ Collection '{}' created WITHOUT ANN support (will use linear search)", name); + } + Ok(()) +} + +#[tauri::command] +pub async fn create_file( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + collection: String, + file: FileInput, +) -> Result { + let path = db::collection_path(&state.base_dir, &collection); + let conn = db::open_or_init_conn(&path)?; + db::create_file( + &conn, + &file.path, + file.name.as_deref(), + file.file_type.as_deref(), + file.size, + ) +} + +#[tauri::command] +pub async fn insert_chunks( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + collection: String, + file_id: String, + chunks: Vec, +) -> Result<(), VectorDBError> { + let path = db::collection_path(&state.base_dir, &collection); + let conn = db::open_or_init_conn(&path)?; + let vec_loaded = db::try_load_sqlite_vec(&conn); + db::insert_chunks(&conn, &file_id, chunks, vec_loaded) +} + +#[tauri::command] +pub async fn delete_file( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + collection: String, + file_id: String, +) -> Result<(), VectorDBError> { + let path = db::collection_path(&state.base_dir, &collection); + let conn = db::open_or_init_conn(&path)?; + db::delete_file(&conn, &file_id) +} + +#[tauri::command] +pub async fn search_collection( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + collection: String, + query_embedding: Vec, + limit: usize, + threshold: f32, + mode: Option, + file_ids: Option>, +) -> Result, VectorDBError> { + let path = db::collection_path(&state.base_dir, &collection); + let conn = db::open_or_init_conn(&path)?; + let vec_loaded = db::try_load_sqlite_vec(&conn); + db::search_collection(&conn, &query_embedding, limit, threshold, mode, vec_loaded, file_ids) +} + +#[tauri::command] +pub async fn list_attachments( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + collection: String, + limit: Option, +) -> Result, VectorDBError> { + let path = db::collection_path(&state.base_dir, &collection); + let conn = db::open_or_init_conn(&path)?; + db::list_attachments(&conn, limit) +} + +#[tauri::command] +pub async fn delete_chunks( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + collection: String, + ids: Vec, +) -> Result<(), VectorDBError> { + let path = db::collection_path(&state.base_dir, &collection); + let conn = db::open_or_init_conn(&path)?; + db::delete_chunks(&conn, ids) +} + +#[tauri::command] +pub async fn delete_collection( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + collection: String, +) -> Result<(), VectorDBError> { + let path = db::collection_path(&state.base_dir, &collection); + if path.exists() { + std::fs::remove_file(path).ok(); + } + Ok(()) +} + +#[tauri::command] +pub async fn chunk_text( + _app: tauri::AppHandle, + text: String, + chunk_size: usize, + chunk_overlap: usize, +) -> Result, VectorDBError> { + Ok(db::chunk_text(text, chunk_size, chunk_overlap)) +} + +#[tauri::command] +pub async fn get_chunks( + _app: tauri::AppHandle, + state: State<'_, VectorDBState>, + collection: String, + file_id: String, + start_order: i64, + end_order: i64, +) -> Result, VectorDBError> { + let path = db::collection_path(&state.base_dir, &collection); + let conn = db::open_or_init_conn(&path)?; + db::get_chunks(&conn, file_id, start_order, end_order) +} diff --git a/src-tauri/plugins/tauri-plugin-vector-db/src/db.rs b/src-tauri/plugins/tauri-plugin-vector-db/src/db.rs new file mode 100644 index 0000000000..c050a82ae7 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/src/db.rs @@ -0,0 +1,630 @@ +use crate::VectorDBError; +use crate::utils::{cosine_similarity, from_le_bytes_vec, to_le_bytes_vec}; +use rusqlite::{params, Connection, OptionalExtension}; +use serde::{Deserialize, Serialize}; +use std::fs; +use std::path::PathBuf; +use uuid::Uuid; + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct FileMetadata { + pub name: Option, + pub path: String, + #[serde(rename = "type")] + pub file_type: Option, + pub size: Option, +} + + +#[derive(Debug, Serialize, Deserialize)] +pub struct SearchResult { + pub id: String, + pub text: String, + pub score: Option, + pub file_id: String, + pub chunk_file_order: i64, +} + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct AttachmentFileInfo { + pub id: String, + pub name: Option, + pub path: Option, + #[serde(rename = "type")] + pub file_type: Option, + pub size: Option, + pub chunk_count: i64, +} + +// New minimal chunk input (no id/metadata) for file-scoped insertion +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct MinimalChunkInput { + pub text: String, + pub embedding: Vec, +} + +// ============================================================================ +// Connection & Path Management +// ============================================================================ + +pub fn collection_path(base: &PathBuf, name: &str) -> PathBuf { + let mut p = base.clone(); + let clean = name.replace(['/', '\\'], "_"); + let filename = format!("{}.db", clean); + p.push(&filename); + p +} + +pub fn open_or_init_conn(path: &PathBuf) -> Result { + if let Some(parent) = path.parent() { + fs::create_dir_all(parent).ok(); + } + let conn = Connection::open(path)?; + Ok(conn) +} + +// ============================================================================ +// SQLite-vec Extension Loading +// ============================================================================ + +pub fn try_load_sqlite_vec(conn: &Connection) -> bool { + // Check if vec0 module is already available + if conn.execute("CREATE VIRTUAL TABLE IF NOT EXISTS temp.temp_vec USING vec0(embedding float[1])", []).is_ok() { + let _ = conn.execute("DROP TABLE IF EXISTS temp.temp_vec", []); + return true; + } + + unsafe { + let _ = conn.load_extension_enable(); + } + + let paths = possible_sqlite_vec_paths(); + for p in paths { + unsafe { + if let Ok(_) = conn.load_extension(&p, Some("sqlite3_vec_init")) { + if conn.execute("CREATE VIRTUAL TABLE IF NOT EXISTS temp.temp_vec USING vec0(embedding float[1])", []).is_ok() { + let _ = conn.execute("DROP TABLE IF EXISTS temp.temp_vec", []); + return true; + } + } + } + } + + false +} + +pub fn possible_sqlite_vec_paths() -> Vec { + let mut paths = Vec::new(); + + // Dev paths + paths.push("./src-tauri/resources/bin/sqlite-vec".to_string()); + paths.push("./resources/bin/sqlite-vec".to_string()); + + // Exe-relative paths + if let Ok(exe) = std::env::current_exe() { + if let Some(dir) = exe.parent() { + let mut d = dir.to_path_buf(); + d.push("resources"); + d.push("bin"); + d.push("sqlite-vec"); + paths.push(d.to_string_lossy().to_string()); + } + + #[cfg(target_os = "macos")] + { + if let Some(mac_dir) = exe.parent().and_then(|p| p.parent()) { + let mut r = mac_dir.to_path_buf(); + r.push("Resources"); + r.push("bin"); + r.push("sqlite-vec"); + paths.push(r.to_string_lossy().to_string()); + } + } + } + paths +} + +pub fn ensure_vec_table(conn: &Connection, dimension: usize) -> bool { + if try_load_sqlite_vec(conn) { + let create = format!( + "CREATE VIRTUAL TABLE IF NOT EXISTS chunks_vec USING vec0(embedding float[{}])", + dimension + ); + match conn.execute(&create, []) { + Ok(_) => return true, + Err(e) => { + println!("[VectorDB] ✗ Failed to create chunks_vec: {}", e); + } + } + } + false +} + +// ============================================================================ +// Schema Creation +// ============================================================================ + +pub fn create_schema(conn: &Connection, dimension: usize) -> Result { + // Files table + conn.execute( + "CREATE TABLE IF NOT EXISTS files ( + id TEXT PRIMARY KEY, + path TEXT UNIQUE NOT NULL, + name TEXT, + type TEXT, + size INTEGER, + chunk_count INTEGER DEFAULT 0 + )", + [], + )?; + + // Chunks table + conn.execute( + "CREATE TABLE IF NOT EXISTS chunks ( + id TEXT PRIMARY KEY, + text TEXT NOT NULL, + embedding BLOB NOT NULL, + file_id TEXT, + chunk_file_order INTEGER, + FOREIGN KEY (file_id) REFERENCES files(id) + )", + [], + )?; + + conn.execute("CREATE INDEX IF NOT EXISTS idx_chunks_id ON chunks(id)", [])?; + conn.execute("CREATE INDEX IF NOT EXISTS idx_chunks_file_id ON chunks(file_id)", [])?; + conn.execute("CREATE INDEX IF NOT EXISTS idx_chunks_file_order ON chunks(file_id, chunk_file_order)", [])?; + + // Try to create vec virtual table + let has_ann = ensure_vec_table(conn, dimension); + Ok(has_ann) +} + +// ============================================================================ +// Insert Operations +// ============================================================================ + +pub fn create_file( + conn: &Connection, + path: &str, + name: Option<&str>, + file_type: Option<&str>, + size: Option, +) -> Result { + let tx = conn.unchecked_transaction()?; + + // Try get existing by path + if let Ok(Some(id)) = tx + .prepare("SELECT id FROM files WHERE path = ?1") + .and_then(|mut s| s.query_row(params![path], |r| r.get::<_, String>(0)).optional()) + { + let row: AttachmentFileInfo = { + let mut stmt = tx.prepare( + "SELECT id, path, name, type, size, chunk_count FROM files WHERE id = ?1", + )?; + stmt.query_row(params![id.as_str()], |r| { + Ok(AttachmentFileInfo { + id: r.get(0)?, + path: r.get(1)?, + name: r.get(2)?, + file_type: r.get(3)?, + size: r.get(4)?, + chunk_count: r.get(5)?, + }) + })? + }; + tx.commit()?; + return Ok(row); + } + + let new_id = Uuid::new_v4().to_string(); + // Determine file size if not provided + let computed_size: Option = match size { + Some(s) if s > 0 => Some(s), + _ => { + match std::fs::metadata(path) { + Ok(meta) => Some(meta.len() as i64), + Err(_) => None, + } + } + }; + tx.execute( + "INSERT INTO files (id, path, name, type, size, chunk_count) VALUES (?1, ?2, ?3, ?4, ?5, 0)", + params![new_id, path, name, file_type, computed_size], + )?; + + let row: AttachmentFileInfo = { + let mut stmt = tx.prepare( + "SELECT id, path, name, type, size, chunk_count FROM files WHERE path = ?1", + )?; + stmt.query_row(params![path], |r| { + Ok(AttachmentFileInfo { + id: r.get(0)?, + path: r.get(1)?, + name: r.get(2)?, + file_type: r.get(3)?, + size: r.get(4)?, + chunk_count: r.get(5)?, + }) + })? + }; + + tx.commit()?; + Ok(row) +} + +pub fn insert_chunks( + conn: &Connection, + file_id: &str, + chunks: Vec, + vec_loaded: bool, +) -> Result<(), VectorDBError> { + let tx = conn.unchecked_transaction()?; + + // Check if vec table exists + let has_vec = if vec_loaded { + conn + .prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='chunks_vec'") + .and_then(|mut s| s.query_row([], |r| r.get::<_, String>(0)).optional()) + .ok() + .flatten() + .is_some() + } else { + false + }; + + // Determine current max order + let mut current_order: i64 = tx + .query_row( + "SELECT COALESCE(MAX(chunk_file_order), -1) FROM chunks WHERE file_id = ?1", + params![file_id], + |row| row.get::<_, i64>(0), + ) + .unwrap_or(-1); + + for ch in chunks.into_iter() { + current_order += 1; + let emb = to_le_bytes_vec(&ch.embedding); + let chunk_id = Uuid::new_v4().to_string(); + tx.execute( + "INSERT OR REPLACE INTO chunks (id, text, embedding, file_id, chunk_file_order) VALUES (?1, ?2, ?3, ?4, ?5)", + params![chunk_id, ch.text, emb, file_id, current_order], + )?; + + if has_vec { + let rowid: i64 = tx + .prepare("SELECT rowid FROM chunks WHERE id=?1")? + .query_row(params![chunk_id], |r| r.get(0))?; + let json_vec = serde_json::to_string(&ch.embedding).unwrap_or("[]".to_string()); + let _ = tx.execute( + "INSERT OR REPLACE INTO chunks_vec(rowid, embedding) VALUES (?1, ?2)", + params![rowid, json_vec], + ); + } + } + + // Update chunk_count + let count: i64 = tx.query_row( + "SELECT COUNT(*) FROM chunks WHERE file_id = ?1", + params![file_id], + |row| row.get(0), + )?; + tx.execute( + "UPDATE files SET chunk_count = ?1 WHERE id = ?2", + params![count, file_id], + )?; + + tx.commit()?; + Ok(()) +} + +pub fn delete_file(conn: &Connection, file_id: &str) -> Result<(), VectorDBError> { + let tx = conn.unchecked_transaction()?; + tx.execute("DELETE FROM chunks WHERE file_id = ?1", params![file_id])?; + tx.execute("DELETE FROM files WHERE id = ?1", params![file_id])?; + tx.commit()?; + Ok(()) +} + +// ============================================================================ +// Search Operations +// ============================================================================ + +pub fn search_collection( + conn: &Connection, + query_embedding: &[f32], + limit: usize, + threshold: f32, + mode: Option, + vec_loaded: bool, + file_ids: Option>, +) -> Result, VectorDBError> { + let has_vec = if vec_loaded { + conn + .prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='chunks_vec'") + .and_then(|mut s| s.query_row([], |r| r.get::<_, String>(0)).optional()) + .ok() + .flatten() + .is_some() + } else { + false + }; + + let prefer_ann = match mode.as_deref() { + Some("ann") => true, + Some("linear") => false, + _ => true, // auto prefers ANN when available + }; + + if has_vec && prefer_ann { + search_ann(conn, query_embedding, limit, file_ids) + } else { + search_linear(conn, query_embedding, limit, threshold, file_ids) + } +} + +fn search_ann( + conn: &Connection, + query_embedding: &[f32], + limit: usize, + file_ids: Option>, +) -> Result, VectorDBError> { + let json_vec = serde_json::to_string(&query_embedding).unwrap_or("[]".to_string()); + + // Build query with optional file_id filtering + let query = if let Some(ref ids) = file_ids { + let placeholders = ids.iter().map(|_| "?").collect::>().join(","); + format!( + "SELECT c.id, c.text, c.file_id, c.chunk_file_order, v.distance + FROM chunks_vec v + JOIN chunks c ON c.rowid = v.rowid + WHERE v.embedding MATCH ?1 AND k = ?2 AND c.file_id IN ({}) + ORDER BY v.distance", + placeholders + ) + } else { + "SELECT c.id, c.text, c.file_id, c.chunk_file_order, v.distance + FROM chunks_vec v + JOIN chunks c ON c.rowid = v.rowid + WHERE v.embedding MATCH ?1 AND k = ?2 + ORDER BY v.distance".to_string() + }; + + let mut stmt = match conn.prepare(&query) { + Ok(s) => s, + Err(e) => { + println!("[VectorDB] ✗ Failed to prepare ANN query: {}", e); + return Err(e.into()); + } + }; + + let mut rows = if let Some(ids) = file_ids { + let mut params: Vec> = vec![ + Box::new(json_vec), + Box::new(limit as i64), + ]; + for id in ids { + params.push(Box::new(id)); + } + let param_refs: Vec<&dyn rusqlite::ToSql> = params.iter().map(|p| p.as_ref()).collect(); + match stmt.query(&*param_refs) { + Ok(r) => r, + Err(e) => { + println!("[VectorDB] ✗ Failed to execute ANN query: {}", e); + return Err(e.into()); + } + } + } else { + match stmt.query(params![json_vec, limit as i64]) { + Ok(r) => r, + Err(e) => { + println!("[VectorDB] ✗ Failed to execute ANN query: {}", e); + return Err(e.into()); + } + } + }; + + let mut results = Vec::new(); + while let Some(row) = rows.next()? { + let id: String = row.get(0)?; + let text: String = row.get(1)?; + let file_id: String = row.get(2)?; + let chunk_file_order: i64 = row.get(3)?; + let distance: f32 = row.get(4)?; + + results.push(SearchResult { + id, + text, + score: Some(distance), + file_id, + chunk_file_order, + }); + } + + println!("[VectorDB] ANN search returned {} results", results.len()); + Ok(results) +} + +fn search_linear( + conn: &Connection, + query_embedding: &[f32], + limit: usize, + threshold: f32, + file_ids: Option>, +) -> Result, VectorDBError> { + let (query, params_vec): (String, Vec>) = if let Some(ids) = file_ids { + let placeholders = ids.iter().map(|_| "?").collect::>().join(","); + let query_str = format!( + "SELECT c.id, c.text, c.embedding, c.file_id, c.chunk_file_order + FROM chunks c + WHERE c.file_id IN ({})", + placeholders + ); + let mut params: Vec> = Vec::new(); + for id in ids { + params.push(Box::new(id)); + } + (query_str, params) + } else { + ( + "SELECT c.id, c.text, c.embedding, c.file_id, c.chunk_file_order + FROM chunks c".to_string(), + Vec::new() + ) + }; + + let mut stmt = conn.prepare(&query)?; + let param_refs: Vec<&dyn rusqlite::ToSql> = params_vec.iter().map(|p| p.as_ref()).collect(); + let mut rows = if param_refs.is_empty() { + stmt.query([])? + } else { + stmt.query(&*param_refs)? + }; + let mut results: Vec = Vec::new(); + + while let Some(row) = rows.next()? { + let id: String = row.get(0)?; + let text: String = row.get(1)?; + let embedding_bytes: Vec = row.get(2)?; + let file_id: String = row.get(3)?; + let chunk_file_order: i64 = row.get(4)?; + + let emb = from_le_bytes_vec(&embedding_bytes); + let score = cosine_similarity(query_embedding, &emb)?; + + if score >= threshold { + results.push(SearchResult { + id, + text, + score: Some(score), + file_id, + chunk_file_order, + }); + } + } + + results.sort_by(|a, b| { + match (b.score, a.score) { + (Some(b_score), Some(a_score)) => b_score.partial_cmp(&a_score).unwrap_or(std::cmp::Ordering::Equal), + (Some(_), None) => std::cmp::Ordering::Less, + (None, Some(_)) => std::cmp::Ordering::Greater, + (None, None) => std::cmp::Ordering::Equal, + } + }); + let take: Vec = results.into_iter().take(limit).collect(); + println!("[VectorDB] Linear search returned {} results", take.len()); + Ok(take) +} + +// ============================================================================ +// List Operations +// ============================================================================ + +pub fn list_attachments( + conn: &Connection, + limit: Option, +) -> Result, VectorDBError> { + let query = if let Some(lim) = limit { + format!("SELECT id, path, name, type, size, chunk_count FROM files LIMIT {}", lim) + } else { + "SELECT id, path, name, type, size, chunk_count FROM files".to_string() + }; + + let mut stmt = conn.prepare(&query)?; + let mut rows = stmt.query([])?; + let mut out = Vec::new(); + + while let Some(row) = rows.next()? { + let id: String = row.get(0)?; + let path: Option = row.get(1)?; + let name: Option = row.get(2)?; + let file_type: Option = row.get(3)?; + let size: Option = row.get(4)?; + let chunk_count: i64 = row.get(5)?; + out.push(AttachmentFileInfo { + id, + name, + path, + file_type, + size, + chunk_count, + }); + } + + Ok(out) +} + +// ============================================================================ +// Delete Operations +// ============================================================================ + +pub fn delete_chunks(conn: &Connection, ids: Vec) -> Result<(), VectorDBError> { + let tx = conn.unchecked_transaction()?; + for id in ids { + tx.execute("DELETE FROM chunks WHERE id = ?1", params![id])?; + } + tx.commit()?; + Ok(()) +} + +// ============================================================================ +// Get Chunks by Order +// ============================================================================ + +pub fn get_chunks( + conn: &Connection, + file_id: String, + start_order: i64, + end_order: i64, +) -> Result, VectorDBError> { + let mut stmt = conn.prepare( + "SELECT id, text, chunk_file_order FROM chunks + WHERE file_id = ?1 AND chunk_file_order >= ?2 AND chunk_file_order <= ?3 + ORDER BY chunk_file_order" + )?; + let mut rows = stmt.query(params![&file_id, start_order, end_order])?; + + let mut results = Vec::new(); + while let Some(row) = rows.next()? { + results.push(SearchResult { + id: row.get(0)?, + text: row.get(1)?, + score: None, + file_id: file_id.clone(), + chunk_file_order: row.get(2)?, + }); + } + + Ok(results) +} + +// ============================================================================ +// Utility Operations +// ============================================================================ + +pub fn chunk_text(text: String, chunk_size: usize, chunk_overlap: usize) -> Vec { + if chunk_size == 0 { + return vec![]; + } + + let mut chunks = Vec::new(); + let chars: Vec = text.chars().collect(); + let mut start = 0usize; + + while start < chars.len() { + let end = (start + chunk_size).min(chars.len()); + let ch: String = chars[start..end].iter().collect(); + chunks.push(ch); + if end >= chars.len() { + break; + } + let advance = if chunk_overlap >= chunk_size { + 1 + } else { + chunk_size - chunk_overlap + }; + start += advance; + } + + chunks +} diff --git a/src-tauri/plugins/tauri-plugin-vector-db/src/error.rs b/src-tauri/plugins/tauri-plugin-vector-db/src/error.rs new file mode 100644 index 0000000000..6c2fdcb3af --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/src/error.rs @@ -0,0 +1,23 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, thiserror::Error, Serialize, Deserialize)] +pub enum VectorDBError { + #[error("Database error: {0}")] + DatabaseError(String), + + #[error("Invalid input: {0}")] + InvalidInput(String), +} + +impl From for VectorDBError { + fn from(err: rusqlite::Error) -> Self { + VectorDBError::DatabaseError(err.to_string()) + } +} + +impl From for VectorDBError { + fn from(err: serde_json::Error) -> Self { + VectorDBError::DatabaseError(err.to_string()) + } +} + diff --git a/src-tauri/plugins/tauri-plugin-vector-db/src/lib.rs b/src-tauri/plugins/tauri-plugin-vector-db/src/lib.rs new file mode 100644 index 0000000000..9c5d72c02d --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/src/lib.rs @@ -0,0 +1,36 @@ +use tauri::{ + plugin::{Builder, TauriPlugin}, + Runtime, + Manager, +}; + +mod commands; +mod db; +mod error; +mod state; +mod utils; + +pub use error::VectorDBError; +pub use state::VectorDBState; + +pub fn init() -> TauriPlugin { + Builder::new("vector-db") + .invoke_handler(tauri::generate_handler![ + commands::create_collection, + commands::insert_chunks, + commands::create_file, + commands::search_collection, + commands::delete_chunks, + commands::delete_file, + commands::delete_collection, + commands::chunk_text, + commands::get_status, + commands::list_attachments, + commands::get_chunks, + ]) + .setup(|app, _api| { + app.manage(state::VectorDBState::new()); + Ok(()) + }) + .build() +} diff --git a/src-tauri/plugins/tauri-plugin-vector-db/src/state.rs b/src-tauri/plugins/tauri-plugin-vector-db/src/state.rs new file mode 100644 index 0000000000..8813625e26 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/src/state.rs @@ -0,0 +1,17 @@ +use std::path::PathBuf; + +pub struct VectorDBState { + pub base_dir: PathBuf, +} + +impl VectorDBState { + pub fn new() -> Self { + // Default vector db path: /Jan/data/db + let mut base = dirs::data_dir().unwrap_or_else(|| PathBuf::from(".")); + base.push("Jan"); + base.push("data"); + base.push("db"); + std::fs::create_dir_all(&base).ok(); + Self { base_dir: base } + } +} diff --git a/src-tauri/plugins/tauri-plugin-vector-db/src/utils.rs b/src-tauri/plugins/tauri-plugin-vector-db/src/utils.rs new file mode 100644 index 0000000000..be0b547966 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/src/utils.rs @@ -0,0 +1,27 @@ +use crate::VectorDBError; + +pub fn cosine_similarity(a: &[f32], b: &[f32]) -> Result { + if a.len() != b.len() { + return Err(VectorDBError::InvalidInput( + "Vector dimensions don't match".to_string(), + )); + } + + let dot: f32 = a.iter().zip(b.iter()).map(|(x, y)| x * y).sum(); + let mag_a: f32 = a.iter().map(|x| x * x).sum::().sqrt(); + let mag_b: f32 = b.iter().map(|x| x * x).sum::().sqrt(); + if mag_a == 0.0 || mag_b == 0.0 { return Ok(0.0); } + Ok(dot / (mag_a * mag_b)) +} + +pub fn to_le_bytes_vec(v: &[f32]) -> Vec { + v.iter().flat_map(|f| f.to_le_bytes()).collect::>() +} + +pub fn from_le_bytes_vec(bytes: &[u8]) -> Vec { + bytes + .chunks_exact(4) + .map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])) + .collect::>() +} + diff --git a/src-tauri/plugins/tauri-plugin-vector-db/tsconfig.json b/src-tauri/plugins/tauri-plugin-vector-db/tsconfig.json new file mode 100644 index 0000000000..60bc6a8eb2 --- /dev/null +++ b/src-tauri/plugins/tauri-plugin-vector-db/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es2021", + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "strict": true, + "noUnusedLocals": true, + "noImplicitAny": true, + "noEmit": true + }, + "include": ["guest-js/*.ts"], + "exclude": ["dist-js", "node_modules"] +} + diff --git a/src-tauri/src/core/mcp/helpers.rs b/src-tauri/src/core/mcp/helpers.rs index 4e226a055c..fe914c79a3 100644 --- a/src-tauri/src/core/mcp/helpers.rs +++ b/src-tauri/src/core/mcp/helpers.rs @@ -496,6 +496,9 @@ async fn schedule_mcp_start_task( client_info: Implementation { name: "Jan Streamable Client".to_string(), version: "0.0.1".to_string(), + title: None, + website_url: None, + icons: None, }, }; let client = client_info.serve(transport).await.inspect_err(|e| { @@ -567,6 +570,9 @@ async fn schedule_mcp_start_task( client_info: Implementation { name: "Jan SSE Client".to_string(), version: "0.0.1".to_string(), + title: None, + website_url: None, + icons: None, }, }; let client = client_info.serve(transport).await.map_err(|e| { diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 8ca44d9a99..24da0e8074 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -31,7 +31,9 @@ pub fn run() { .plugin(tauri_plugin_http::init()) .plugin(tauri_plugin_store::Builder::new().build()) .plugin(tauri_plugin_shell::init()) - .plugin(tauri_plugin_llamacpp::init()); + .plugin(tauri_plugin_llamacpp::init()) + .plugin(tauri_plugin_vector_db::init()) + .plugin(tauri_plugin_rag::init()); #[cfg(feature = "deep-link")] { diff --git a/web-app/src/constants/routes.ts b/web-app/src/constants/routes.ts index f1f870dd57..16fea5120f 100644 --- a/web-app/src/constants/routes.ts +++ b/web-app/src/constants/routes.ts @@ -10,6 +10,7 @@ export const route = { model_providers: '/settings/providers', providers: '/settings/providers/$providerName', general: '/settings/general', + attachments: '/settings/attachments', appearance: '/settings/appearance', privacy: '/settings/privacy', shortcuts: '/settings/shortcuts', diff --git a/web-app/src/containers/ChatInput.tsx b/web-app/src/containers/ChatInput.tsx index 2ba52c2e9d..744ff5babe 100644 --- a/web-app/src/containers/ChatInput.tsx +++ b/web-app/src/containers/ChatInput.tsx @@ -21,6 +21,9 @@ import { IconCodeCircle2, IconPlayerStopFilled, IconX, + IconPaperclip, + IconLoader2, + IconCheck, } from '@tabler/icons-react' import { useTranslation } from '@/i18n/react-i18next-compat' import { useGeneralSetting } from '@/hooks/useGeneralSetting' @@ -38,8 +41,19 @@ import { TokenCounter } from '@/components/TokenCounter' import { useMessages } from '@/hooks/useMessages' import { useShallow } from 'zustand/react/shallow' import { McpExtensionToolLoader } from './McpExtensionToolLoader' -import { ExtensionTypeEnum, MCPExtension } from '@janhq/core' +import { ExtensionTypeEnum, MCPExtension, fs, RAGExtension } from '@janhq/core' import { ExtensionManager } from '@/lib/extension' +import { useAttachments } from '@/hooks/useAttachments' +import { open } from '@tauri-apps/plugin-dialog' +import { toast } from 'sonner' +import { PlatformFeatures } from '@/lib/platform/const' +import { PlatformFeature } from '@/lib/platform/types' + +import { + Attachment, + createImageAttachment, + createDocumentAttachment, +} from '@/types/attachment' type ChatInputProps = { className?: string @@ -91,29 +105,39 @@ const ChatInput = ({ const [message, setMessage] = useState('') const [dropdownToolsAvailable, setDropdownToolsAvailable] = useState(false) const [tooltipToolsAvailable, setTooltipToolsAvailable] = useState(false) - const [uploadedFiles, setUploadedFiles] = useState< - Array<{ - name: string - type: string - size: number - base64: string - dataUrl: string - }> - >([]) + const [attachments, setAttachments] = useState([]) const [connectedServers, setConnectedServers] = useState([]) const [isDragOver, setIsDragOver] = useState(false) const [hasMmproj, setHasMmproj] = useState(false) const [hasActiveModels, setHasActiveModels] = useState(false) + const attachmentsEnabled = useAttachments((s) => s.enabled) + // Determine whether to show the Attach documents button (simple gating) + const showAttachmentButton = + attachmentsEnabled && PlatformFeatures[PlatformFeature.ATTACHMENTS] + // Derived: any document currently processing (ingestion in progress) + const ingestingDocs = attachments.some( + (a) => a.type === 'document' && a.processing + ) + const ingestingAny = attachments.some((a) => a.processing) // Check for connected MCP servers useEffect(() => { const checkConnectedServers = async () => { try { const servers = await serviceHub.mcp().getConnectedServers() - setConnectedServers(servers) + // Only update state if the servers list has actually changed + setConnectedServers((prev) => { + if (JSON.stringify(prev) === JSON.stringify(servers)) { + return prev + } + return servers + }) } catch (error) { console.error('Failed to get connected servers:', error) - setConnectedServers([]) + setConnectedServers((prev) => { + if (prev.length === 0) return prev + return [] + }) } } @@ -135,10 +159,22 @@ const ChatInput = ({ const hasMatchingActiveModel = activeModels.some( (model) => String(model) === selectedModel?.id ) - setHasActiveModels(activeModels.length > 0 && hasMatchingActiveModel) + const newHasActiveModels = + activeModels.length > 0 && hasMatchingActiveModel + + // Only update state if the value has actually changed + setHasActiveModels((prev) => { + if (prev === newHasActiveModels) { + return prev + } + return newHasActiveModels + }) } catch (error) { console.error('Failed to get active models:', error) - setHasActiveModels(false) + setHasActiveModels((prev) => { + if (prev === false) return prev + return false + }) } } @@ -184,18 +220,45 @@ const ChatInput = ({ setMessage('Please select a model to start chatting.') return } - if (!prompt.trim() && uploadedFiles.length === 0) { + if (!prompt.trim()) { return } + setMessage('') + // Callback to update attachment processing state + const updateAttachmentProcessing = ( + fileName: string, + status: 'processing' | 'done' | 'error' | 'clear_docs' | 'clear_all' + ) => { + if (status === 'clear_docs') { + setAttachments((prev) => prev.filter((a) => a.type !== 'document')) + return + } + if (status === 'clear_all') { + setAttachments([]) + return + } + setAttachments((prev) => + prev.map((att) => + att.name === fileName + ? { + ...att, + processing: status === 'processing', + processed: status === 'done' ? true : att.processed, + } + : att + ) + ) + } + sendMessage( prompt, true, - uploadedFiles.length > 0 ? uploadedFiles : undefined, - projectId + attachments.length > 0 ? attachments : undefined, + projectId, + updateAttachmentProcessing ) - setUploadedFiles([]) } useEffect(() => { @@ -264,10 +327,160 @@ const ChatInput = ({ fileInputRef.current?.click() } - const handleRemoveFile = (indexToRemove: number) => { - setUploadedFiles((prev) => - prev.filter((_, index) => index !== indexToRemove) - ) + const handleAttachDocsIngest = async () => { + try { + if (!attachmentsEnabled) { + toast.info('Attachments are disabled in Settings') + return + } + const selection = await open({ + multiple: true, + filters: [ + { + name: 'Documents', + extensions: [ + 'pdf', + 'docx', + 'txt', + 'md', + 'csv', + 'xlsx', + 'xls', + 'ods', + 'pptx', + 'html', + 'htm', + ], + }, + ], + }) + if (!selection) return + const paths = Array.isArray(selection) ? selection : [selection] + if (!paths.length) return + + // Check for duplicates and fetch file sizes + const existingPaths = new Set( + attachments + .filter((a) => a.type === 'document' && a.path) + .map((a) => a.path) + ) + + const duplicates: string[] = [] + const newDocAttachments: Attachment[] = [] + + for (const p of paths) { + if (existingPaths.has(p)) { + duplicates.push(p.split(/[\\/]/).pop() || p) + continue + } + + const name = p.split(/[\\/]/).pop() || p + const fileType = name.split('.').pop()?.toLowerCase() + let size: number | undefined = undefined + try { + const stat = await fs.fileStat(p) + size = stat?.size ? Number(stat.size) : undefined + } catch (e) { + console.warn('Failed to read file size for', p, e) + } + newDocAttachments.push( + createDocumentAttachment({ + name, + path: p, + fileType, + size, + }) + ) + } + + if (duplicates.length > 0) { + toast.warning('Files already attached', { + description: `${duplicates.join(', ')} ${duplicates.length === 1 ? 'is' : 'are'} already in the list`, + }) + } + + if (newDocAttachments.length > 0) { + // Add to state first with processing flag + setAttachments((prev) => [...prev, ...newDocAttachments]) + + // If thread exists, ingest immediately + if (currentThreadId) { + const ragExtension = ExtensionManager.getInstance().get( + ExtensionTypeEnum.RAG + ) as RAGExtension | undefined + if (!ragExtension) { + toast.error('RAG extension not available') + return + } + + // Ingest each document + for (const doc of newDocAttachments) { + try { + // Mark as processing + setAttachments((prev) => + prev.map((a) => + a.path === doc.path && a.type === 'document' + ? { ...a, processing: true } + : a + ) + ) + + const result = await ragExtension.ingestAttachments( + currentThreadId, + [ + { + path: doc.path!, + name: doc.name, + type: doc.fileType, + size: doc.size, + }, + ] + ) + + const fileInfo = result.files?.[0] + if (fileInfo?.id) { + // Mark as processed with ID + setAttachments((prev) => + prev.map((a) => + a.path === doc.path && a.type === 'document' + ? { + ...a, + processing: false, + processed: true, + id: fileInfo.id, + chunkCount: fileInfo.chunk_count, + } + : a + ) + ) + } else { + throw new Error('No file ID returned from ingestion') + } + } catch (error) { + console.error('Failed to ingest document:', error) + // Remove failed document + setAttachments((prev) => + prev.filter( + (a) => !(a.path === doc.path && a.type === 'document') + ) + ) + toast.error(`Failed to ingest ${doc.name}`, { + description: + error instanceof Error ? error.message : String(error), + }) + } + } + } + } + } catch (e) { + console.error('Failed to attach documents:', e) + const desc = e instanceof Error ? e.message : String(e) + toast.error('Failed to attach documents', { description: desc }) + } + } + + const handleRemoveAttachment = (indexToRemove: number) => { + setAttachments((prev) => prev.filter((_, index) => index !== indexToRemove)) } const getFileTypeFromExtension = (fileName: string): string => { @@ -283,20 +496,36 @@ const ChatInput = ({ } } + const formatBytes = (bytes?: number): string => { + if (!bytes || bytes <= 0) return '' + const units = ['B', 'KB', 'MB', 'GB'] + let i = 0 + let val = bytes + while (val >= 1024 && i < units.length - 1) { + val /= 1024 + i++ + } + return `${val.toFixed(i === 0 ? 0 : 1)} ${units[i]}` + } + const handleFileChange = (e: React.ChangeEvent) => { const files = e.target.files if (files && files.length > 0) { const maxSize = 10 * 1024 * 1024 // 10MB in bytes - const newFiles: Array<{ - name: string - type: string - size: number - base64: string - dataUrl: string - }> = [] + const newFiles: Attachment[] = [] + const duplicates: string[] = [] + const existingImageNames = new Set( + attachments.filter((a) => a.type === 'image').map((a) => a.name) + ) Array.from(files).forEach((file) => { + // Check for duplicate image names + if (existingImageNames.has(file.name)) { + duplicates.push(file.name) + return + } + // Check file size if (file.size > maxSize) { setMessage(`File is too large. Maximum size is 10MB.`) @@ -330,26 +559,93 @@ const ChatInput = ({ const result = reader.result if (typeof result === 'string') { const base64String = result.split(',')[1] - const fileData = { + const att = createImageAttachment({ name: file.name, size: file.size, - type: actualType, + mimeType: actualType, base64: base64String, dataUrl: result, - } - newFiles.push(fileData) + }) + newFiles.push(att) // Update state if ( newFiles.length === Array.from(files).filter((f) => { const fType = getFileTypeFromExtension(f.name) || f.type - return f.size <= maxSize && allowedTypes.includes(fType) + return ( + f.size <= maxSize && + allowedTypes.includes(fType) && + !existingImageNames.has(f.name) + ) }).length ) { - setUploadedFiles((prev) => { - const updated = [...prev, ...newFiles] - return updated - }) + if (newFiles.length > 0) { + setAttachments((prev) => { + const updated = [...prev, ...newFiles] + return updated + }) + + // If thread exists, ingest images immediately + if (currentThreadId) { + void (async () => { + for (const img of newFiles) { + try { + // Mark as processing + setAttachments((prev) => + prev.map((a) => + a.name === img.name && a.type === 'image' + ? { ...a, processing: true } + : a + ) + ) + + const result = await serviceHub + .uploads() + .ingestImage(currentThreadId, img) + + if (result?.id) { + // Mark as processed with ID + setAttachments((prev) => + prev.map((a) => + a.name === img.name && a.type === 'image' + ? { + ...a, + processing: false, + processed: true, + id: result.id, + } + : a + ) + ) + } else { + throw new Error('No ID returned from image ingestion') + } + } catch (error) { + console.error('Failed to ingest image:', error) + // Remove failed image + setAttachments((prev) => + prev.filter( + (a) => !(a.name === img.name && a.type === 'image') + ) + ) + toast.error(`Failed to ingest ${img.name}`, { + description: + error instanceof Error + ? error.message + : String(error), + }) + } + } + })() + } + } + + if (duplicates.length > 0) { + toast.warning('Some images already attached', { + description: `${duplicates.join(', ')} ${duplicates.length === 1 ? 'is' : 'are'} already in the list`, + }) + } + // Reset the file input value to allow re-uploading the same file if (fileInputRef.current) { fileInputRef.current.value = '' @@ -563,33 +859,103 @@ const ChatInput = ({ onDragOver={hasMmproj ? handleDragOver : undefined} onDrop={hasMmproj ? handleDrop : undefined} > - {uploadedFiles.length > 0 && ( + {attachments.length > 0 && (
- {uploadedFiles.map((file, index) => { - return ( -
- {file.type.startsWith('image/') && ( - {`${file.name} - )} + {attachments + .map((att, idx) => ({ att, idx })) + .map(({ att, idx }) => { + const isImage = att.type === 'image' + const ext = att.fileType || att.mimeType?.split('/')[1] + return (
handleRemoveFile(index)} + key={`${att.type}-${idx}-${att.name}`} + className="relative" > - + + + +
+ {/* Inner content by state */} + {isImage && att.dataUrl ? ( + {`${att.name}`} + ) : ( +
+ + {ext && ( + + .{ext} + + )} +
+ )} + + {/* Overlay spinner when processing */} + {att.processing && ( +
+ +
+ )} + + {/* Overlay success check when processed */} + {att.processed && !att.processing && ( +
+
+ +
+
+ )} +
+
+ +
+
+ {att.name} +
+
+ {isImage + ? att.mimeType || 'image' + : ext + ? `.${ext}` + : 'document'} + {att.size + ? ` · ${formatBytes(att.size)}` + : ''} +
+
+
+
+
+ + {/* Remove button disabled while processing - outside overflow-hidden container */} + {!att.processing && ( +
handleRemoveAttachment(idx)} + > + +
+ )}
-
- ) - })} + ) + })}
)} )} - {/* File attachment - show only for models with mmproj */} + {/* Vision image attachment - show only for models with mmproj */} {hasMmproj && ( @@ -682,6 +1048,39 @@ const ChatInput = ({ )} + {/* RAG document attachments - desktop-only via dialog; shown when feature enabled */} + {selectedModel?.capabilities?.includes('tools') && + showAttachmentButton && ( + + + +
+ {ingestingDocs ? ( + + ) : ( + + )} +
+
+ +

+ {ingestingDocs + ? 'Indexing documents…' + : 'Attach documents'} +

+
+
+
+ )} {/* Microphone - always available - Temp Hide */} {/*
@@ -821,7 +1220,15 @@ const ChatInput = ({ a.type === 'image' && a.dataUrl) + .map((a) => ({ + name: a.name, + type: a.mimeType || getFileTypeFromExtension(a.name), + size: a.size || 0, + base64: a.base64 || '', + dataUrl: a.dataUrl!, + }))} />
)} @@ -838,17 +1245,13 @@ const ChatInput = ({ ) : (