@elizaos/capacitor-llama 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -0
- package/dist/esm/capacitor-llama-adapter.d.ts +5 -0
- package/dist/esm/capacitor-llama-adapter.js +262 -0
- package/dist/esm/definitions.d.ts +92 -0
- package/dist/esm/definitions.js +10 -0
- package/dist/esm/device-bridge-client.d.ts +48 -0
- package/dist/esm/device-bridge-client.js +221 -0
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.test.d.ts +1 -0
- package/dist/esm/index.test.js +264 -0
- package/dist/esm/load-capacitor-llama.d.ts +2 -0
- package/dist/esm/load-capacitor-llama.js +9 -0
- package/dist/esm/web.d.ts +11 -0
- package/dist/esm/web.js +10 -0
- package/dist/plugin.cjs.js +500 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +505 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const CONTEXT_ID = 1;
|
|
4
|
+
function isObject(value) {
|
|
5
|
+
return typeof value === "object" && value !== null;
|
|
6
|
+
}
|
|
7
|
+
function isLlamaCppPluginLike(value) {
|
|
8
|
+
return (isObject(value) &&
|
|
9
|
+
typeof value.initContext === "function" &&
|
|
10
|
+
typeof value.releaseContext === "function" &&
|
|
11
|
+
typeof value.releaseAllContexts === "function" &&
|
|
12
|
+
typeof value.generateText === "function" &&
|
|
13
|
+
typeof value.stopCompletion === "function" &&
|
|
14
|
+
typeof value.addListener === "function");
|
|
15
|
+
}
|
|
16
|
+
function resolveLlamaCppPlugin(mod) {
|
|
17
|
+
if (!isObject(mod))
|
|
18
|
+
return null;
|
|
19
|
+
if (isLlamaCppPluginLike(mod.LlamaCpp))
|
|
20
|
+
return mod.LlamaCpp;
|
|
21
|
+
if (isLlamaCppPluginLike(mod.default))
|
|
22
|
+
return mod.default;
|
|
23
|
+
if (isObject(mod.default) && isLlamaCppPluginLike(mod.default.LlamaCpp)) {
|
|
24
|
+
return mod.default.LlamaCpp;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
function isCapacitorNative() {
|
|
29
|
+
var _a;
|
|
30
|
+
const cap = globalThis.Capacitor;
|
|
31
|
+
return Boolean((_a = cap === null || cap === void 0 ? void 0 : cap.isNativePlatform) === null || _a === void 0 ? void 0 : _a.call(cap));
|
|
32
|
+
}
|
|
33
|
+
function detectPlatform() {
|
|
34
|
+
var _a;
|
|
35
|
+
const cap = globalThis.Capacitor;
|
|
36
|
+
const platform = (_a = cap === null || cap === void 0 ? void 0 : cap.getPlatform) === null || _a === void 0 ? void 0 : _a.call(cap);
|
|
37
|
+
if (platform === "ios")
|
|
38
|
+
return "ios";
|
|
39
|
+
if (platform === "android")
|
|
40
|
+
return "android";
|
|
41
|
+
return "web";
|
|
42
|
+
}
|
|
43
|
+
class CapacitorLlamaAdapter {
|
|
44
|
+
constructor() {
|
|
45
|
+
this.plugin = null;
|
|
46
|
+
/** Cached loader promise so concurrent `load()` calls don't race to register duplicate listeners. */
|
|
47
|
+
this.pluginLoadPromise = null;
|
|
48
|
+
this.loadedPath = null;
|
|
49
|
+
this.tokenIndex = 0;
|
|
50
|
+
this.tokenListeners = new Set();
|
|
51
|
+
this.pluginListenerHandle = null;
|
|
52
|
+
}
|
|
53
|
+
async loadPlugin() {
|
|
54
|
+
if (this.plugin)
|
|
55
|
+
return this.plugin;
|
|
56
|
+
if (this.pluginLoadPromise)
|
|
57
|
+
return this.pluginLoadPromise;
|
|
58
|
+
this.pluginLoadPromise = (async () => {
|
|
59
|
+
const plugin = resolveLlamaCppPlugin(await import('llama-cpp-capacitor'));
|
|
60
|
+
if (!plugin) {
|
|
61
|
+
throw new Error("llama-cpp-capacitor did not expose an initContext method");
|
|
62
|
+
}
|
|
63
|
+
const tokenListenerHandle = await plugin.addListener("@LlamaCpp_onToken", (data) => {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
const token = (_b = (_a = data.tokenResult) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : data.token;
|
|
66
|
+
if (!token)
|
|
67
|
+
return;
|
|
68
|
+
this.tokenIndex += 1;
|
|
69
|
+
for (const listener of this.tokenListeners) {
|
|
70
|
+
try {
|
|
71
|
+
listener(token, this.tokenIndex);
|
|
72
|
+
}
|
|
73
|
+
catch (_c) {
|
|
74
|
+
this.tokenListeners.delete(listener);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
this.pluginListenerHandle = tokenListenerHandle !== null && tokenListenerHandle !== void 0 ? tokenListenerHandle : null;
|
|
79
|
+
this.plugin = plugin;
|
|
80
|
+
return plugin;
|
|
81
|
+
})();
|
|
82
|
+
try {
|
|
83
|
+
return await this.pluginLoadPromise;
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
this.pluginLoadPromise = null;
|
|
87
|
+
throw err;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async getHardwareInfo() {
|
|
91
|
+
var _a;
|
|
92
|
+
const platform = detectPlatform();
|
|
93
|
+
const nav = globalThis
|
|
94
|
+
.navigator;
|
|
95
|
+
return {
|
|
96
|
+
platform,
|
|
97
|
+
deviceModel: platform,
|
|
98
|
+
totalRamGb: 0,
|
|
99
|
+
availableRamGb: null,
|
|
100
|
+
cpuCores: (_a = nav === null || nav === void 0 ? void 0 : nav.hardwareConcurrency) !== null && _a !== void 0 ? _a : 0,
|
|
101
|
+
gpu: null,
|
|
102
|
+
gpuSupported: platform !== "web",
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
async isLoaded() {
|
|
106
|
+
return {
|
|
107
|
+
loaded: this.loadedPath !== null,
|
|
108
|
+
modelPath: this.loadedPath,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
currentModelPath() {
|
|
112
|
+
return this.loadedPath;
|
|
113
|
+
}
|
|
114
|
+
async load(options) {
|
|
115
|
+
var _a, _b;
|
|
116
|
+
if (!isCapacitorNative()) {
|
|
117
|
+
throw new Error("capacitor-llama is only available on iOS and Android builds");
|
|
118
|
+
}
|
|
119
|
+
const plugin = await this.loadPlugin();
|
|
120
|
+
if (this.loadedPath && this.loadedPath !== options.modelPath) {
|
|
121
|
+
await plugin.releaseAllContexts();
|
|
122
|
+
this.loadedPath = null;
|
|
123
|
+
}
|
|
124
|
+
await plugin.initContext({
|
|
125
|
+
contextId: CONTEXT_ID,
|
|
126
|
+
params: {
|
|
127
|
+
model: options.modelPath,
|
|
128
|
+
n_ctx: (_a = options.contextSize) !== null && _a !== void 0 ? _a : 4096,
|
|
129
|
+
n_gpu_layers: options.useGpu === false ? 0 : 99,
|
|
130
|
+
n_threads: (_b = options.maxThreads) !== null && _b !== void 0 ? _b : 0,
|
|
131
|
+
use_mmap: true,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
this.loadedPath = options.modelPath;
|
|
135
|
+
}
|
|
136
|
+
async unload() {
|
|
137
|
+
if (!this.plugin || !this.loadedPath)
|
|
138
|
+
return;
|
|
139
|
+
try {
|
|
140
|
+
await this.plugin.releaseContext({ contextId: CONTEXT_ID });
|
|
141
|
+
}
|
|
142
|
+
catch (_a) {
|
|
143
|
+
await this.plugin.releaseAllContexts();
|
|
144
|
+
}
|
|
145
|
+
this.loadedPath = null;
|
|
146
|
+
}
|
|
147
|
+
async generate(options) {
|
|
148
|
+
var _a, _b, _c, _d;
|
|
149
|
+
if (!this.plugin || !this.loadedPath) {
|
|
150
|
+
throw new Error("No model loaded. Call load() first.");
|
|
151
|
+
}
|
|
152
|
+
this.tokenIndex = 0;
|
|
153
|
+
const params = {
|
|
154
|
+
n_predict: (_a = options.maxTokens) !== null && _a !== void 0 ? _a : 2048,
|
|
155
|
+
temperature: (_b = options.temperature) !== null && _b !== void 0 ? _b : 0.7,
|
|
156
|
+
top_p: (_c = options.topP) !== null && _c !== void 0 ? _c : 0.9,
|
|
157
|
+
};
|
|
158
|
+
if (options.stopSequences && options.stopSequences.length > 0) {
|
|
159
|
+
params.stop = options.stopSequences;
|
|
160
|
+
}
|
|
161
|
+
if (options.stream) {
|
|
162
|
+
params.emit_partial_completion = true;
|
|
163
|
+
}
|
|
164
|
+
const started = Date.now();
|
|
165
|
+
const result = await this.plugin.generateText({
|
|
166
|
+
contextId: CONTEXT_ID,
|
|
167
|
+
prompt: options.prompt,
|
|
168
|
+
params,
|
|
169
|
+
});
|
|
170
|
+
const duration = ((_d = result.timings) === null || _d === void 0 ? void 0 : _d.predicted_ms) != null
|
|
171
|
+
? Math.round(result.timings.predicted_ms)
|
|
172
|
+
: Date.now() - started;
|
|
173
|
+
return {
|
|
174
|
+
text: result.text,
|
|
175
|
+
promptTokens: result.tokens_evaluated,
|
|
176
|
+
outputTokens: result.tokens_predicted,
|
|
177
|
+
durationMs: duration,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
async cancelGenerate() {
|
|
181
|
+
if (!this.plugin)
|
|
182
|
+
return;
|
|
183
|
+
await this.plugin.stopCompletion({ contextId: CONTEXT_ID });
|
|
184
|
+
}
|
|
185
|
+
async embed(options) {
|
|
186
|
+
var _a;
|
|
187
|
+
if (!this.plugin || !this.loadedPath) {
|
|
188
|
+
throw new Error("No model loaded. Call load() first.");
|
|
189
|
+
}
|
|
190
|
+
if (typeof this.plugin.embedding !== "function") {
|
|
191
|
+
throw new Error("llama-cpp-capacitor does not expose embedding() on this build; upgrade or use a cloud embedding provider");
|
|
192
|
+
}
|
|
193
|
+
const params = {
|
|
194
|
+
embd_normalize: (_a = options.embdNormalize) !== null && _a !== void 0 ? _a : 0,
|
|
195
|
+
};
|
|
196
|
+
const result = await this.plugin.embedding({
|
|
197
|
+
contextId: CONTEXT_ID,
|
|
198
|
+
text: options.input,
|
|
199
|
+
params,
|
|
200
|
+
});
|
|
201
|
+
let tokenCount = 0;
|
|
202
|
+
if (typeof this.plugin.tokenize === "function") {
|
|
203
|
+
try {
|
|
204
|
+
const tokenized = await this.plugin.tokenize({
|
|
205
|
+
contextId: CONTEXT_ID,
|
|
206
|
+
text: options.input,
|
|
207
|
+
});
|
|
208
|
+
tokenCount = tokenized.tokens.length;
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
212
|
+
console.debug("[capacitor-llama] tokenize fallback", {
|
|
213
|
+
error: message,
|
|
214
|
+
});
|
|
215
|
+
tokenCount = 0;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return { embedding: result.embedding, tokens: tokenCount };
|
|
219
|
+
}
|
|
220
|
+
onToken(listener) {
|
|
221
|
+
this.tokenListeners.add(listener);
|
|
222
|
+
return () => {
|
|
223
|
+
this.tokenListeners.delete(listener);
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
async dispose() {
|
|
227
|
+
this.tokenListeners.clear();
|
|
228
|
+
if (this.pluginListenerHandle) {
|
|
229
|
+
await this.pluginListenerHandle.remove();
|
|
230
|
+
this.pluginListenerHandle = null;
|
|
231
|
+
}
|
|
232
|
+
await this.unload();
|
|
233
|
+
this.plugin = null;
|
|
234
|
+
this.pluginLoadPromise = null;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const capacitorLlama = new CapacitorLlamaAdapter();
|
|
238
|
+
function registerCapacitorLlamaLoader(runtime) {
|
|
239
|
+
if (typeof runtime.registerService !== "function")
|
|
240
|
+
return;
|
|
241
|
+
runtime.registerService("localInferenceLoader", {
|
|
242
|
+
async loadModel(args) {
|
|
243
|
+
await capacitorLlama.load({ modelPath: args.modelPath });
|
|
244
|
+
},
|
|
245
|
+
async unloadModel() {
|
|
246
|
+
await capacitorLlama.unload();
|
|
247
|
+
},
|
|
248
|
+
currentModelPath() {
|
|
249
|
+
return capacitorLlama.currentModelPath();
|
|
250
|
+
},
|
|
251
|
+
async generate(args) {
|
|
252
|
+
const result = await capacitorLlama.generate({
|
|
253
|
+
prompt: args.prompt,
|
|
254
|
+
stopSequences: args.stopSequences,
|
|
255
|
+
maxTokens: args.maxTokens,
|
|
256
|
+
temperature: args.temperature,
|
|
257
|
+
});
|
|
258
|
+
return result.text;
|
|
259
|
+
},
|
|
260
|
+
async embed(args) {
|
|
261
|
+
return capacitorLlama.embed({ input: args.input });
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
let cachedAdapter = null;
|
|
267
|
+
async function loadCapacitorLlama() {
|
|
268
|
+
if (cachedAdapter) {
|
|
269
|
+
return cachedAdapter;
|
|
270
|
+
}
|
|
271
|
+
cachedAdapter = capacitorLlama;
|
|
272
|
+
return cachedAdapter;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Device-side half of the agent↔device inference bridge.
|
|
277
|
+
*
|
|
278
|
+
* Runs inside the mobile app (Capacitor iOS / Android) and dials out to
|
|
279
|
+
* the agent container over WebSocket. Receives `generate` requests,
|
|
280
|
+
* forwards to `capacitorLlama`, returns results. Auto-reconnects with
|
|
281
|
+
* exponential backoff when the link drops.
|
|
282
|
+
*
|
|
283
|
+
* Mirrors the message envelope defined in
|
|
284
|
+
* `@elizaos/app-core/src/services/local-inference/device-bridge.ts`.
|
|
285
|
+
* Keep the two in sync by hand — the message shape is the bridge
|
|
286
|
+
* contract.
|
|
287
|
+
*/
|
|
288
|
+
const INITIAL_BACKOFF_MS = 1000;
|
|
289
|
+
const MAX_BACKOFF_MS = 30000;
|
|
290
|
+
class DeviceBridgeClient {
|
|
291
|
+
constructor(config) {
|
|
292
|
+
this.socket = null;
|
|
293
|
+
this.reconnectAttempt = 0;
|
|
294
|
+
this.stopped = false;
|
|
295
|
+
this.config = config;
|
|
296
|
+
}
|
|
297
|
+
start() {
|
|
298
|
+
this.stopped = false;
|
|
299
|
+
this.connect();
|
|
300
|
+
}
|
|
301
|
+
stop() {
|
|
302
|
+
this.stopped = true;
|
|
303
|
+
if (this.socket) {
|
|
304
|
+
try {
|
|
305
|
+
this.socket.close(1000, "client-stop");
|
|
306
|
+
}
|
|
307
|
+
catch (_a) {
|
|
308
|
+
/* best effort */
|
|
309
|
+
}
|
|
310
|
+
this.socket = null;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
computeBackoffMs() {
|
|
314
|
+
const exp = Math.min(MAX_BACKOFF_MS, INITIAL_BACKOFF_MS * 2 ** Math.min(this.reconnectAttempt, 6));
|
|
315
|
+
// Full jitter: uniform random in [0, exp).
|
|
316
|
+
return Math.floor(Math.random() * exp);
|
|
317
|
+
}
|
|
318
|
+
connect() {
|
|
319
|
+
var _a, _b, _c, _d;
|
|
320
|
+
if (this.stopped)
|
|
321
|
+
return;
|
|
322
|
+
(_b = (_a = this.config).onStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, "connecting");
|
|
323
|
+
const url = this.buildUrl();
|
|
324
|
+
let ws;
|
|
325
|
+
try {
|
|
326
|
+
ws = new WebSocket(url);
|
|
327
|
+
}
|
|
328
|
+
catch (err) {
|
|
329
|
+
(_d = (_c = this.config).onStateChange) === null || _d === void 0 ? void 0 : _d.call(_c, "error", err instanceof Error ? err.message : String(err));
|
|
330
|
+
this.scheduleReconnect();
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
this.socket = ws;
|
|
334
|
+
ws.onopen = () => {
|
|
335
|
+
this.reconnectAttempt = 0;
|
|
336
|
+
void this.sendRegister(ws);
|
|
337
|
+
};
|
|
338
|
+
ws.onmessage = (event) => {
|
|
339
|
+
let msg;
|
|
340
|
+
try {
|
|
341
|
+
msg = JSON.parse(String(event.data));
|
|
342
|
+
}
|
|
343
|
+
catch (_a) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
void this.handleAgentMessage(ws, msg);
|
|
347
|
+
};
|
|
348
|
+
ws.onerror = () => {
|
|
349
|
+
var _a, _b;
|
|
350
|
+
(_b = (_a = this.config).onStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, "error", "websocket error");
|
|
351
|
+
};
|
|
352
|
+
ws.onclose = () => {
|
|
353
|
+
var _a, _b;
|
|
354
|
+
this.socket = null;
|
|
355
|
+
(_b = (_a = this.config).onStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, "disconnected");
|
|
356
|
+
this.scheduleReconnect();
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
buildUrl() {
|
|
360
|
+
if (!this.config.pairingToken)
|
|
361
|
+
return this.config.agentUrl;
|
|
362
|
+
const hasQuery = this.config.agentUrl.includes("?");
|
|
363
|
+
const sep = hasQuery ? "&" : "?";
|
|
364
|
+
return `${this.config.agentUrl}${sep}token=${encodeURIComponent(this.config.pairingToken)}`;
|
|
365
|
+
}
|
|
366
|
+
scheduleReconnect() {
|
|
367
|
+
if (this.stopped)
|
|
368
|
+
return;
|
|
369
|
+
const delay = this.computeBackoffMs();
|
|
370
|
+
this.reconnectAttempt += 1;
|
|
371
|
+
setTimeout(() => this.connect(), delay);
|
|
372
|
+
}
|
|
373
|
+
async sendRegister(ws) {
|
|
374
|
+
var _a, _b;
|
|
375
|
+
const capacitorLlama = await loadCapacitorLlama();
|
|
376
|
+
const hardware = await capacitorLlama.getHardwareInfo();
|
|
377
|
+
const loaded = await capacitorLlama.isLoaded();
|
|
378
|
+
const msg = {
|
|
379
|
+
type: "register",
|
|
380
|
+
payload: {
|
|
381
|
+
deviceId: this.config.deviceId,
|
|
382
|
+
pairingToken: this.config.pairingToken,
|
|
383
|
+
capabilities: {
|
|
384
|
+
platform: hardware.platform,
|
|
385
|
+
deviceModel: hardware.deviceModel,
|
|
386
|
+
totalRamGb: hardware.totalRamGb,
|
|
387
|
+
cpuCores: hardware.cpuCores,
|
|
388
|
+
gpu: hardware.gpu,
|
|
389
|
+
},
|
|
390
|
+
loadedPath: loaded.modelPath,
|
|
391
|
+
},
|
|
392
|
+
};
|
|
393
|
+
this.send(ws, msg);
|
|
394
|
+
(_b = (_a = this.config).onStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, "connected");
|
|
395
|
+
}
|
|
396
|
+
send(ws, msg) {
|
|
397
|
+
if (ws.readyState !== WebSocket.OPEN)
|
|
398
|
+
return;
|
|
399
|
+
ws.send(JSON.stringify(msg));
|
|
400
|
+
}
|
|
401
|
+
async handleAgentMessage(ws, msg) {
|
|
402
|
+
if (msg.type === "ping") {
|
|
403
|
+
this.send(ws, { type: "pong", at: Date.now() });
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
if (msg.type === "load") {
|
|
407
|
+
try {
|
|
408
|
+
const capacitorLlama = await loadCapacitorLlama();
|
|
409
|
+
await capacitorLlama.load({
|
|
410
|
+
modelPath: msg.modelPath,
|
|
411
|
+
contextSize: msg.contextSize,
|
|
412
|
+
useGpu: msg.useGpu,
|
|
413
|
+
});
|
|
414
|
+
this.send(ws, {
|
|
415
|
+
type: "loadResult",
|
|
416
|
+
correlationId: msg.correlationId,
|
|
417
|
+
ok: true,
|
|
418
|
+
loadedPath: msg.modelPath,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
catch (err) {
|
|
422
|
+
this.send(ws, {
|
|
423
|
+
type: "loadResult",
|
|
424
|
+
correlationId: msg.correlationId,
|
|
425
|
+
ok: false,
|
|
426
|
+
error: err instanceof Error ? err.message : String(err),
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
if (msg.type === "unload") {
|
|
432
|
+
try {
|
|
433
|
+
const capacitorLlama = await loadCapacitorLlama();
|
|
434
|
+
await capacitorLlama.unload();
|
|
435
|
+
this.send(ws, {
|
|
436
|
+
type: "unloadResult",
|
|
437
|
+
correlationId: msg.correlationId,
|
|
438
|
+
ok: true,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
catch (err) {
|
|
442
|
+
this.send(ws, {
|
|
443
|
+
type: "unloadResult",
|
|
444
|
+
correlationId: msg.correlationId,
|
|
445
|
+
ok: false,
|
|
446
|
+
error: err instanceof Error ? err.message : String(err),
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (msg.type === "generate") {
|
|
452
|
+
try {
|
|
453
|
+
const capacitorLlama = await loadCapacitorLlama();
|
|
454
|
+
const result = await capacitorLlama.generate({
|
|
455
|
+
prompt: msg.prompt,
|
|
456
|
+
stopSequences: msg.stopSequences,
|
|
457
|
+
maxTokens: msg.maxTokens,
|
|
458
|
+
temperature: msg.temperature,
|
|
459
|
+
});
|
|
460
|
+
this.send(ws, {
|
|
461
|
+
type: "generateResult",
|
|
462
|
+
correlationId: msg.correlationId,
|
|
463
|
+
ok: true,
|
|
464
|
+
text: result.text,
|
|
465
|
+
promptTokens: result.promptTokens,
|
|
466
|
+
outputTokens: result.outputTokens,
|
|
467
|
+
durationMs: result.durationMs,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
catch (err) {
|
|
471
|
+
this.send(ws, {
|
|
472
|
+
type: "generateResult",
|
|
473
|
+
correlationId: msg.correlationId,
|
|
474
|
+
ok: false,
|
|
475
|
+
error: err instanceof Error ? err.message : String(err),
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Convenience helper for the mobile bootstrap: starts a bridge client
|
|
484
|
+
* using values from the Eliza config or hardcoded env.
|
|
485
|
+
*
|
|
486
|
+
* The host app is expected to call this once during Capacitor bootstrap.
|
|
487
|
+
* `agentUrl` and `pairingToken` come from the user's pairing flow and
|
|
488
|
+
* should be persisted across launches.
|
|
489
|
+
*/
|
|
490
|
+
function startDeviceBridgeClient(config) {
|
|
491
|
+
const client = new DeviceBridgeClient(config);
|
|
492
|
+
client.start();
|
|
493
|
+
return client;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
exports.DeviceBridgeClient = DeviceBridgeClient;
|
|
497
|
+
exports.capacitorLlama = capacitorLlama;
|
|
498
|
+
exports.registerCapacitorLlamaLoader = registerCapacitorLlamaLoader;
|
|
499
|
+
exports.startDeviceBridgeClient = startDeviceBridgeClient;
|
|
500
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/capacitor-llama-adapter.js","esm/load-capacitor-llama.js","esm/device-bridge-client.js"],"sourcesContent":["const CONTEXT_ID = 1;\nfunction isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\nfunction isLlamaCppPluginLike(value) {\n return (isObject(value) &&\n typeof value.initContext === \"function\" &&\n typeof value.releaseContext === \"function\" &&\n typeof value.releaseAllContexts === \"function\" &&\n typeof value.generateText === \"function\" &&\n typeof value.stopCompletion === \"function\" &&\n typeof value.addListener === \"function\");\n}\nfunction resolveLlamaCppPlugin(mod) {\n if (!isObject(mod))\n return null;\n if (isLlamaCppPluginLike(mod.LlamaCpp))\n return mod.LlamaCpp;\n if (isLlamaCppPluginLike(mod.default))\n return mod.default;\n if (isObject(mod.default) && isLlamaCppPluginLike(mod.default.LlamaCpp)) {\n return mod.default.LlamaCpp;\n }\n return null;\n}\nfunction isCapacitorNative() {\n var _a;\n const cap = globalThis.Capacitor;\n return Boolean((_a = cap === null || cap === void 0 ? void 0 : cap.isNativePlatform) === null || _a === void 0 ? void 0 : _a.call(cap));\n}\nfunction detectPlatform() {\n var _a;\n const cap = globalThis.Capacitor;\n const platform = (_a = cap === null || cap === void 0 ? void 0 : cap.getPlatform) === null || _a === void 0 ? void 0 : _a.call(cap);\n if (platform === \"ios\")\n return \"ios\";\n if (platform === \"android\")\n return \"android\";\n return \"web\";\n}\nclass CapacitorLlamaAdapter {\n constructor() {\n this.plugin = null;\n /** Cached loader promise so concurrent `load()` calls don't race to register duplicate listeners. */\n this.pluginLoadPromise = null;\n this.loadedPath = null;\n this.tokenIndex = 0;\n this.tokenListeners = new Set();\n this.pluginListenerHandle = null;\n }\n async loadPlugin() {\n if (this.plugin)\n return this.plugin;\n if (this.pluginLoadPromise)\n return this.pluginLoadPromise;\n this.pluginLoadPromise = (async () => {\n const plugin = resolveLlamaCppPlugin(await import(\"llama-cpp-capacitor\"));\n if (!plugin) {\n throw new Error(\"llama-cpp-capacitor did not expose an initContext method\");\n }\n const tokenListenerHandle = await plugin.addListener(\"@LlamaCpp_onToken\", (data) => {\n var _a, _b;\n const token = (_b = (_a = data.tokenResult) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : data.token;\n if (!token)\n return;\n this.tokenIndex += 1;\n for (const listener of this.tokenListeners) {\n try {\n listener(token, this.tokenIndex);\n }\n catch (_c) {\n this.tokenListeners.delete(listener);\n }\n }\n });\n this.pluginListenerHandle = tokenListenerHandle !== null && tokenListenerHandle !== void 0 ? tokenListenerHandle : null;\n this.plugin = plugin;\n return plugin;\n })();\n try {\n return await this.pluginLoadPromise;\n }\n catch (err) {\n this.pluginLoadPromise = null;\n throw err;\n }\n }\n async getHardwareInfo() {\n var _a;\n const platform = detectPlatform();\n const nav = globalThis\n .navigator;\n return {\n platform,\n deviceModel: platform,\n totalRamGb: 0,\n availableRamGb: null,\n cpuCores: (_a = nav === null || nav === void 0 ? void 0 : nav.hardwareConcurrency) !== null && _a !== void 0 ? _a : 0,\n gpu: null,\n gpuSupported: platform !== \"web\",\n };\n }\n async isLoaded() {\n return {\n loaded: this.loadedPath !== null,\n modelPath: this.loadedPath,\n };\n }\n currentModelPath() {\n return this.loadedPath;\n }\n async load(options) {\n var _a, _b;\n if (!isCapacitorNative()) {\n throw new Error(\"capacitor-llama is only available on iOS and Android builds\");\n }\n const plugin = await this.loadPlugin();\n if (this.loadedPath && this.loadedPath !== options.modelPath) {\n await plugin.releaseAllContexts();\n this.loadedPath = null;\n }\n await plugin.initContext({\n contextId: CONTEXT_ID,\n params: {\n model: options.modelPath,\n n_ctx: (_a = options.contextSize) !== null && _a !== void 0 ? _a : 4096,\n n_gpu_layers: options.useGpu === false ? 0 : 99,\n n_threads: (_b = options.maxThreads) !== null && _b !== void 0 ? _b : 0,\n use_mmap: true,\n },\n });\n this.loadedPath = options.modelPath;\n }\n async unload() {\n if (!this.plugin || !this.loadedPath)\n return;\n try {\n await this.plugin.releaseContext({ contextId: CONTEXT_ID });\n }\n catch (_a) {\n await this.plugin.releaseAllContexts();\n }\n this.loadedPath = null;\n }\n async generate(options) {\n var _a, _b, _c, _d;\n if (!this.plugin || !this.loadedPath) {\n throw new Error(\"No model loaded. Call load() first.\");\n }\n this.tokenIndex = 0;\n const params = {\n n_predict: (_a = options.maxTokens) !== null && _a !== void 0 ? _a : 2048,\n temperature: (_b = options.temperature) !== null && _b !== void 0 ? _b : 0.7,\n top_p: (_c = options.topP) !== null && _c !== void 0 ? _c : 0.9,\n };\n if (options.stopSequences && options.stopSequences.length > 0) {\n params.stop = options.stopSequences;\n }\n if (options.stream) {\n params.emit_partial_completion = true;\n }\n const started = Date.now();\n const result = await this.plugin.generateText({\n contextId: CONTEXT_ID,\n prompt: options.prompt,\n params,\n });\n const duration = ((_d = result.timings) === null || _d === void 0 ? void 0 : _d.predicted_ms) != null\n ? Math.round(result.timings.predicted_ms)\n : Date.now() - started;\n return {\n text: result.text,\n promptTokens: result.tokens_evaluated,\n outputTokens: result.tokens_predicted,\n durationMs: duration,\n };\n }\n async cancelGenerate() {\n if (!this.plugin)\n return;\n await this.plugin.stopCompletion({ contextId: CONTEXT_ID });\n }\n async embed(options) {\n var _a;\n if (!this.plugin || !this.loadedPath) {\n throw new Error(\"No model loaded. Call load() first.\");\n }\n if (typeof this.plugin.embedding !== \"function\") {\n throw new Error(\"llama-cpp-capacitor does not expose embedding() on this build; upgrade or use a cloud embedding provider\");\n }\n const params = {\n embd_normalize: (_a = options.embdNormalize) !== null && _a !== void 0 ? _a : 0,\n };\n const result = await this.plugin.embedding({\n contextId: CONTEXT_ID,\n text: options.input,\n params,\n });\n let tokenCount = 0;\n if (typeof this.plugin.tokenize === \"function\") {\n try {\n const tokenized = await this.plugin.tokenize({\n contextId: CONTEXT_ID,\n text: options.input,\n });\n tokenCount = tokenized.tokens.length;\n }\n catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.debug(\"[capacitor-llama] tokenize fallback\", {\n error: message,\n });\n tokenCount = 0;\n }\n }\n return { embedding: result.embedding, tokens: tokenCount };\n }\n onToken(listener) {\n this.tokenListeners.add(listener);\n return () => {\n this.tokenListeners.delete(listener);\n };\n }\n async dispose() {\n this.tokenListeners.clear();\n if (this.pluginListenerHandle) {\n await this.pluginListenerHandle.remove();\n this.pluginListenerHandle = null;\n }\n await this.unload();\n this.plugin = null;\n this.pluginLoadPromise = null;\n }\n}\nexport const capacitorLlama = new CapacitorLlamaAdapter();\nexport function registerCapacitorLlamaLoader(runtime) {\n if (typeof runtime.registerService !== \"function\")\n return;\n runtime.registerService(\"localInferenceLoader\", {\n async loadModel(args) {\n await capacitorLlama.load({ modelPath: args.modelPath });\n },\n async unloadModel() {\n await capacitorLlama.unload();\n },\n currentModelPath() {\n return capacitorLlama.currentModelPath();\n },\n async generate(args) {\n const result = await capacitorLlama.generate({\n prompt: args.prompt,\n stopSequences: args.stopSequences,\n maxTokens: args.maxTokens,\n temperature: args.temperature,\n });\n return result.text;\n },\n async embed(args) {\n return capacitorLlama.embed({ input: args.input });\n },\n });\n}\n","import { capacitorLlama } from \"./capacitor-llama-adapter\";\nlet cachedAdapter = null;\nexport async function loadCapacitorLlama() {\n if (cachedAdapter) {\n return cachedAdapter;\n }\n cachedAdapter = capacitorLlama;\n return cachedAdapter;\n}\n","/**\n * Device-side half of the agent↔device inference bridge.\n *\n * Runs inside the mobile app (Capacitor iOS / Android) and dials out to\n * the agent container over WebSocket. Receives `generate` requests,\n * forwards to `capacitorLlama`, returns results. Auto-reconnects with\n * exponential backoff when the link drops.\n *\n * Mirrors the message envelope defined in\n * `@elizaos/app-core/src/services/local-inference/device-bridge.ts`.\n * Keep the two in sync by hand — the message shape is the bridge\n * contract.\n */\nimport { loadCapacitorLlama } from \"./load-capacitor-llama\";\nconst INITIAL_BACKOFF_MS = 1000;\nconst MAX_BACKOFF_MS = 30000;\nexport class DeviceBridgeClient {\n constructor(config) {\n this.socket = null;\n this.reconnectAttempt = 0;\n this.stopped = false;\n this.config = config;\n }\n start() {\n this.stopped = false;\n this.connect();\n }\n stop() {\n this.stopped = true;\n if (this.socket) {\n try {\n this.socket.close(1000, \"client-stop\");\n }\n catch (_a) {\n /* best effort */\n }\n this.socket = null;\n }\n }\n computeBackoffMs() {\n const exp = Math.min(MAX_BACKOFF_MS, INITIAL_BACKOFF_MS * 2 ** Math.min(this.reconnectAttempt, 6));\n // Full jitter: uniform random in [0, exp).\n return Math.floor(Math.random() * exp);\n }\n connect() {\n var _a, _b, _c, _d;\n if (this.stopped)\n return;\n (_b = (_a = this.config).onStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, \"connecting\");\n const url = this.buildUrl();\n let ws;\n try {\n ws = new WebSocket(url);\n }\n catch (err) {\n (_d = (_c = this.config).onStateChange) === null || _d === void 0 ? void 0 : _d.call(_c, \"error\", err instanceof Error ? err.message : String(err));\n this.scheduleReconnect();\n return;\n }\n this.socket = ws;\n ws.onopen = () => {\n this.reconnectAttempt = 0;\n void this.sendRegister(ws);\n };\n ws.onmessage = (event) => {\n let msg;\n try {\n msg = JSON.parse(String(event.data));\n }\n catch (_a) {\n return;\n }\n void this.handleAgentMessage(ws, msg);\n };\n ws.onerror = () => {\n var _a, _b;\n (_b = (_a = this.config).onStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, \"error\", \"websocket error\");\n };\n ws.onclose = () => {\n var _a, _b;\n this.socket = null;\n (_b = (_a = this.config).onStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, \"disconnected\");\n this.scheduleReconnect();\n };\n }\n buildUrl() {\n if (!this.config.pairingToken)\n return this.config.agentUrl;\n const hasQuery = this.config.agentUrl.includes(\"?\");\n const sep = hasQuery ? \"&\" : \"?\";\n return `${this.config.agentUrl}${sep}token=${encodeURIComponent(this.config.pairingToken)}`;\n }\n scheduleReconnect() {\n if (this.stopped)\n return;\n const delay = this.computeBackoffMs();\n this.reconnectAttempt += 1;\n setTimeout(() => this.connect(), delay);\n }\n async sendRegister(ws) {\n var _a, _b;\n const capacitorLlama = await loadCapacitorLlama();\n const hardware = await capacitorLlama.getHardwareInfo();\n const loaded = await capacitorLlama.isLoaded();\n const msg = {\n type: \"register\",\n payload: {\n deviceId: this.config.deviceId,\n pairingToken: this.config.pairingToken,\n capabilities: {\n platform: hardware.platform,\n deviceModel: hardware.deviceModel,\n totalRamGb: hardware.totalRamGb,\n cpuCores: hardware.cpuCores,\n gpu: hardware.gpu,\n },\n loadedPath: loaded.modelPath,\n },\n };\n this.send(ws, msg);\n (_b = (_a = this.config).onStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, \"connected\");\n }\n send(ws, msg) {\n if (ws.readyState !== WebSocket.OPEN)\n return;\n ws.send(JSON.stringify(msg));\n }\n async handleAgentMessage(ws, msg) {\n if (msg.type === \"ping\") {\n this.send(ws, { type: \"pong\", at: Date.now() });\n return;\n }\n if (msg.type === \"load\") {\n try {\n const capacitorLlama = await loadCapacitorLlama();\n await capacitorLlama.load({\n modelPath: msg.modelPath,\n contextSize: msg.contextSize,\n useGpu: msg.useGpu,\n });\n this.send(ws, {\n type: \"loadResult\",\n correlationId: msg.correlationId,\n ok: true,\n loadedPath: msg.modelPath,\n });\n }\n catch (err) {\n this.send(ws, {\n type: \"loadResult\",\n correlationId: msg.correlationId,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n });\n }\n return;\n }\n if (msg.type === \"unload\") {\n try {\n const capacitorLlama = await loadCapacitorLlama();\n await capacitorLlama.unload();\n this.send(ws, {\n type: \"unloadResult\",\n correlationId: msg.correlationId,\n ok: true,\n });\n }\n catch (err) {\n this.send(ws, {\n type: \"unloadResult\",\n correlationId: msg.correlationId,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n });\n }\n return;\n }\n if (msg.type === \"generate\") {\n try {\n const capacitorLlama = await loadCapacitorLlama();\n const result = await capacitorLlama.generate({\n prompt: msg.prompt,\n stopSequences: msg.stopSequences,\n maxTokens: msg.maxTokens,\n temperature: msg.temperature,\n });\n this.send(ws, {\n type: \"generateResult\",\n correlationId: msg.correlationId,\n ok: true,\n text: result.text,\n promptTokens: result.promptTokens,\n outputTokens: result.outputTokens,\n durationMs: result.durationMs,\n });\n }\n catch (err) {\n this.send(ws, {\n type: \"generateResult\",\n correlationId: msg.correlationId,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n });\n }\n return;\n }\n }\n}\n/**\n * Convenience helper for the mobile bootstrap: starts a bridge client\n * using values from the Eliza config or hardcoded env.\n *\n * The host app is expected to call this once during Capacitor bootstrap.\n * `agentUrl` and `pairingToken` come from the user's pairing flow and\n * should be persisted across launches.\n */\nexport function startDeviceBridgeClient(config) {\n const client = new DeviceBridgeClient(config);\n client.start();\n return client;\n}\n"],"names":[],"mappings":";;AAAA,MAAM,UAAU,GAAG,CAAC;AACpB,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,IAAI,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;AACtD;AACA,SAAS,oBAAoB,CAAC,KAAK,EAAE;AACrC,IAAI,QAAQ,QAAQ,CAAC,KAAK,CAAC;AAC3B,QAAQ,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU;AAC/C,QAAQ,OAAO,KAAK,CAAC,cAAc,KAAK,UAAU;AAClD,QAAQ,OAAO,KAAK,CAAC,kBAAkB,KAAK,UAAU;AACtD,QAAQ,OAAO,KAAK,CAAC,YAAY,KAAK,UAAU;AAChD,QAAQ,OAAO,KAAK,CAAC,cAAc,KAAK,UAAU;AAClD,QAAQ,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU;AAC/C;AACA,SAAS,qBAAqB,CAAC,GAAG,EAAE;AACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,GA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