teleton 0.7.3 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -35
- package/dist/{chunk-RBU6JXD3.js → chunk-2GLHOJ5C.js} +268 -59
- package/dist/chunk-5UVXJMOX.js +292 -0
- package/dist/{chunk-DAMCNMYL.js → chunk-AVDWXYQ7.js} +73 -28
- package/dist/{chunk-RMLQS3X6.js → chunk-CB2Y45HA.js} +106 -1
- package/dist/{chunk-5PLZ3KSO.js → chunk-DMXTIRUW.js} +5 -6
- package/dist/{chunk-A4GCOHCE.js → chunk-G2LLMJXJ.js} +1751 -116
- package/dist/{chunk-FNV5FF35.js → chunk-LCCVZ4D2.js} +32 -16
- package/dist/{chunk-BU453WX4.js → chunk-OGMVWDVU.js} +4172 -3792
- package/dist/chunk-QOQWUUA4.js +158 -0
- package/dist/{chunk-4DU3C27M.js → chunk-R4YSJ4EY.js} +5 -1
- package/dist/{chunk-XBKSS6DM.js → chunk-VFA7QMCZ.js} +5 -3
- package/dist/{chunk-VAUJSSD3.js → chunk-XQUHC3JZ.js} +1 -1
- package/dist/{chunk-RO62LO6Z.js → chunk-YP25WTQK.js} +2 -0
- package/dist/cli/index.js +234 -289
- package/dist/{client-RTNALK7W.js → client-O37XDCJB.js} +4 -5
- package/dist/index.js +12 -13
- package/dist/{memory-5SS3Q5EA.js → memory-KQALFUV3.js} +6 -7
- package/dist/{migrate-M7SJMDOL.js → migrate-UV3WEL5D.js} +6 -7
- package/dist/{server-FOC5P7U6.js → server-BHHJGUDF.js} +324 -16
- package/dist/{setup-server-BVVD2PR6.js → setup-server-G7UG2DI3.js} +26 -118
- package/dist/store-H4XPNGC2.js +34 -0
- package/dist/{task-dependency-resolver-WKZWJLLM.js → task-dependency-resolver-VMEVJRPO.js} +2 -2
- package/dist/{task-executor-PD3H4MLO.js → task-executor-WWSPBJ4V.js} +1 -1
- package/dist/{tool-index-MIVK3D7H.js → tool-index-2KH3OB6X.js} +5 -5
- package/dist/web/assets/index-BrVqauzj.css +1 -0
- package/dist/web/assets/index-Bx8JW3gV.js +72 -0
- package/dist/web/assets/{index.es-7MTSV5SL.js → index.es-Pet5-M13.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +3 -3
- package/dist/chunk-JQDLW7IE.js +0 -107
- package/dist/chunk-UCN6TI25.js +0 -143
- package/dist/web/assets/index-By_fs4Jl.js +0 -72
- package/dist/web/assets/index-CRDIf07k.css +0 -1
- package/scripts/patch-gramjs.sh +0 -46
- package/scripts/postinstall.mjs +0 -16
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VOYAGE_API_URL
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VFA7QMCZ.js";
|
|
4
4
|
import {
|
|
5
5
|
EMBEDDING_CACHE_EVICTION_INTERVAL,
|
|
6
6
|
EMBEDDING_CACHE_EVICTION_RATIO,
|
|
7
7
|
EMBEDDING_CACHE_MAX_ENTRIES,
|
|
8
8
|
EMBEDDING_CACHE_TTL_DAYS,
|
|
9
9
|
VOYAGE_BATCH_SIZE
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YP25WTQK.js";
|
|
11
11
|
import {
|
|
12
12
|
fetchWithTimeout
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XQUHC3JZ.js";
|
|
14
14
|
import {
|
|
15
15
|
TELETON_ROOT
|
|
16
16
|
} from "./chunk-EYWNOHMJ.js";
|
|
@@ -91,14 +91,22 @@ var AnthropicEmbeddingProvider = class {
|
|
|
91
91
|
// src/memory/embeddings/local.ts
|
|
92
92
|
import { pipeline, env } from "@huggingface/transformers";
|
|
93
93
|
import { join } from "path";
|
|
94
|
+
import { mkdirSync } from "fs";
|
|
94
95
|
var log = createLogger("Memory");
|
|
95
|
-
|
|
96
|
+
var modelCacheDir = join(TELETON_ROOT, "models");
|
|
97
|
+
try {
|
|
98
|
+
mkdirSync(modelCacheDir, { recursive: true });
|
|
99
|
+
} catch {
|
|
100
|
+
}
|
|
101
|
+
env.cacheDir = modelCacheDir;
|
|
96
102
|
var extractorPromise = null;
|
|
97
103
|
function getExtractor(model) {
|
|
98
104
|
if (!extractorPromise) {
|
|
99
|
-
log.info(`Loading local embedding model: ${model} (cache: ${
|
|
105
|
+
log.info(`Loading local embedding model: ${model} (cache: ${modelCacheDir})`);
|
|
100
106
|
extractorPromise = pipeline("feature-extraction", model, {
|
|
101
|
-
dtype: "fp32"
|
|
107
|
+
dtype: "fp32",
|
|
108
|
+
// Explicit cache_dir to avoid any env race condition
|
|
109
|
+
cache_dir: modelCacheDir
|
|
102
110
|
}).then((ext) => {
|
|
103
111
|
log.info(`Local embedding model ready`);
|
|
104
112
|
return ext;
|
|
@@ -121,21 +129,29 @@ var LocalEmbeddingProvider = class {
|
|
|
121
129
|
}
|
|
122
130
|
/**
|
|
123
131
|
* Pre-download and load the model at startup.
|
|
124
|
-
* If loading fails, marks
|
|
132
|
+
* If loading fails, retries once then marks provider as disabled (FTS5-only).
|
|
125
133
|
* Call this once during app init — avoids retry spam on every message.
|
|
126
134
|
* @returns true if model loaded successfully, false if fallback to noop
|
|
127
135
|
*/
|
|
128
136
|
async warmup() {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
for (let attempt = 1; attempt <= 2; attempt++) {
|
|
138
|
+
try {
|
|
139
|
+
await getExtractor(this.model);
|
|
140
|
+
return true;
|
|
141
|
+
} catch (err) {
|
|
142
|
+
if (attempt === 1) {
|
|
143
|
+
log.warn(`Embedding model load failed (attempt 1), retrying...`);
|
|
144
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
145
|
+
} else {
|
|
146
|
+
log.warn(
|
|
147
|
+
`Local embedding model unavailable \u2014 falling back to FTS5-only search (no vector embeddings)`
|
|
148
|
+
);
|
|
149
|
+
this._disabled = true;
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
138
153
|
}
|
|
154
|
+
return false;
|
|
139
155
|
}
|
|
140
156
|
async embedQuery(text) {
|
|
141
157
|
if (this._disabled) return [];
|