@elizaos/plugin-capacitor-bridge 2.0.0-beta.1 → 2.0.3-beta.3

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/dist/index.d.ts CHANGED
@@ -1,85 +1,9 @@
1
- import { Server } from 'node:http';
2
- import { AgentRuntime } from '@elizaos/core';
1
+ export { MobileDeviceBridgeStatus, attachMobileDeviceBridgeToServer, ensureMobileDeviceBridgeInferenceHandlers, getMobileDeviceBridgeStatus, loadMobileDeviceBridgeModel, mobileDeviceBridge, unloadMobileDeviceBridgeModel } from './mobile-device-bridge-bootstrap.js';
2
+ export { getMobileWorkspaceRoot, installMobileFsShim, isMobileFsShimInstalled, sandboxedPath } from './shared/fs-shim.js';
3
+ import 'node:http';
4
+ import '@elizaos/core';
3
5
 
4
- /**
5
- * Stock Capacitor mobile local-inference bridge.
6
- *
7
- * AOSP builds run llama.cpp inside the agent process via bun:ffi. Stock
8
- * Capacitor Android/iOS builds cannot do that: llama.cpp is exposed to the
9
- * WebView through the native Capacitor plugin. This module is the agent-side
10
- * half of that path. It accepts a loopback WebSocket from the WebView,
11
- * forwards TEXT_SMALL / TEXT_LARGE requests to the device, and lets the
12
- * normal conversation routes keep using runtime model handlers.
13
- */
6
+ declare function runAndroidBridgeCli(): Promise<void>;
7
+ declare function runIosBridgeCli(argv?: string[]): Promise<void>;
14
8
 
15
- interface LocalInferenceLoadArgs {
16
- modelPath: string;
17
- contextSize?: number;
18
- useGpu?: boolean;
19
- maxThreads?: number;
20
- draftModelPath?: string;
21
- draftContextSize?: number;
22
- draftMin?: number;
23
- draftMax?: number;
24
- speculativeSamples?: number;
25
- mobileSpeculative?: boolean;
26
- cacheTypeK?: string;
27
- cacheTypeV?: string;
28
- disableThinking?: boolean;
29
- }
30
- interface DeviceCapabilities {
31
- platform: "ios" | "android" | "web";
32
- deviceModel: string;
33
- totalRamGb: number;
34
- cpuCores: number;
35
- gpu: {
36
- backend: "metal" | "vulkan" | "gpu-delegate";
37
- available: boolean;
38
- } | null;
39
- }
40
- interface MobileDeviceBridgeStatus {
41
- enabled: boolean;
42
- connected: boolean;
43
- devices: Array<{
44
- deviceId: string;
45
- capabilities: DeviceCapabilities;
46
- loadedPath: string | null;
47
- connectedSince: string;
48
- }>;
49
- primaryDeviceId: string | null;
50
- pendingRequests: number;
51
- modelPath: string | null;
52
- }
53
- declare class MobileDeviceBridge {
54
- private wss;
55
- private readonly devices;
56
- private readonly pendingLoads;
57
- private readonly pendingUnloads;
58
- private readonly pendingGenerates;
59
- private readonly pendingEmbeds;
60
- status(): MobileDeviceBridgeStatus;
61
- attachToHttpServer(server: Server): Promise<void>;
62
- private handleConnection;
63
- private handleDeviceMessage;
64
- private primaryDevice;
65
- private sendToPrimary;
66
- loadModel(args: LocalInferenceLoadArgs): Promise<void>;
67
- unloadModel(): Promise<void>;
68
- generate(args: {
69
- prompt: string;
70
- stopSequences?: string[];
71
- maxTokens?: number;
72
- temperature?: number;
73
- }): Promise<string>;
74
- embed(args: {
75
- input: string;
76
- }): Promise<number[]>;
77
- }
78
- declare const mobileDeviceBridge: MobileDeviceBridge;
79
- declare function getMobileDeviceBridgeStatus(): MobileDeviceBridgeStatus;
80
- declare function loadMobileDeviceBridgeModel(modelPath: string, modelId?: string): Promise<void>;
81
- declare function unloadMobileDeviceBridgeModel(): Promise<void>;
82
- declare function attachMobileDeviceBridgeToServer(server: Server): Promise<void>;
83
- declare function ensureMobileDeviceBridgeInferenceHandlers(runtime: AgentRuntime): Promise<boolean>;
84
-
85
- export { type MobileDeviceBridgeStatus, attachMobileDeviceBridgeToServer, ensureMobileDeviceBridgeInferenceHandlers, getMobileDeviceBridgeStatus, loadMobileDeviceBridgeModel, mobileDeviceBridge, unloadMobileDeviceBridgeModel };
9
+ export { runAndroidBridgeCli, runIosBridgeCli };