capacitor-native-agent 0.8.0 → 0.9.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 CHANGED
@@ -20,6 +20,16 @@ npm install capacitor-native-agent
20
20
  npx cap sync
21
21
  ```
22
22
 
23
+ ## Cloning this repository
24
+
25
+ The Rust FFI crate lives in a separate GitLab repository and is pulled in as a git submodule. After cloning:
26
+
27
+ ```bash
28
+ git submodule update --init --recursive
29
+ ```
30
+
31
+ Upstream URL: https://gitlab.k8s.t6x.io/rruiz/native-agent-ffi
32
+
23
33
  ## Android Setup
24
34
 
25
35
  The npm package includes the Kotlin plugin source and UniFFI bindings, but **not** the compiled Rust shared library. You must build and place it yourself:
@@ -27,10 +37,11 @@ The npm package includes the Kotlin plugin source and UniFFI bindings, but **not
27
37
  ### 1. Build the Rust .so
28
38
 
29
39
  ```bash
30
- cd rust/native-agent-ffi
31
- cargo ndk -t arm64-v8a build --release
40
+ scripts/build-android.sh
32
41
  ```
33
42
 
43
+ This runs `cargo ndk -t arm64-v8a build --release` on the submodule and copies the result into `android/src/main/jniLibs/arm64-v8a/`.
44
+
34
45
  ### 2. Place the .so in your app
35
46
 
36
47
  Copy the built library to your Android app's jniLibs:
@@ -154,13 +165,40 @@ Events are emitted via `addListener('nativeAgentEvent', handler)`:
154
165
  - `heartbeat.*` — Heartbeat lifecycle
155
166
  - `scheduler.status` — Scheduler state updates
156
167
 
168
+ ## Supported LLM providers
169
+
170
+ The `provider` argument is a free string. The Rust agent loop currently accepts:
171
+
172
+ | Provider string | Default model | Endpoint |
173
+ |---|---|---|
174
+ | `anthropic` | `claude-sonnet-4-20250514` | Anthropic Messages API |
175
+ | `openai` | `gpt-4o` | OpenAI Chat Completions |
176
+ | `openrouter` | `anthropic/claude-sonnet-4.5` | OpenRouter |
177
+ | `kimi` (aliases `kimi-coding`, `kimi-code`) | `kimi-for-coding` | Kimi Coding (Anthropic-messages-compatible, https://api.kimi.com/coding) |
178
+
179
+ > **Note (0.9.0 — iOS):** Kimi is fully wired in the Android `.so` shipped with this version. The iOS `xcframework` in this release is the pre-existing `0.8.x` build and has **not** been rebuilt against `native-agent-ffi 9946e0f`. iOS callers using `provider: 'kimi'` will receive `Unsupported provider`. Track [#TODO-ios-0.9.1](#known-limitations) for the 0.9.1 iOS rebuild.
180
+
157
181
  ## Platform Support
158
182
 
159
- | Platform | Status |
160
- |----------|--------|
161
- | Android | Supported |
162
- | iOS | Not yet implemented |
163
- | Web | N/A (throws unavailable error) |
183
+ | Platform | Status (this release: **0.9.0**) |
184
+ |----------|-----------------------------------|
185
+ | Android | Supported. Rust pinned to `native-agent-ffi@9946e0f` (Kimi, SSE no-space fix, session-context fix, AgentStore refactor, runtime-drop fix). |
186
+ | iOS | Stale binary `xcframework` is pre-`0.9.0` and will be refreshed in `0.9.1`. See *Known limitations* below. |
187
+ | Web | N/A (throws unavailable error). |
188
+
189
+ ## Known limitations
190
+
191
+ ### 0.9.0 — iOS xcframework not rebuilt
192
+
193
+ The Mac build host was unreachable when `0.9.0` was cut, so `ios/Frameworks/NativeAgentFFI.xcframework/` was **not** rebuilt against `native-agent-ffi@9946e0f`. iOS users on `0.9.0` are missing the following upstream changes (Android users have them):
194
+
195
+ - `ba8c97e` `feat(llm): add kimi (Kimi Code) provider` — `provider: 'kimi'` will fail on iOS until `0.9.1`.
196
+ - `2cb34be` `fix(llm): tolerate "data:" SSE without space` — Anthropic-compatible streaming endpoints that omit the space after `data:` will return empty messages on iOS.
197
+ - `9735f4d` `ffi: keep session context across send_message` — after a cold-boot resume, the next `sendMessage` may start without prior history on iOS.
198
+ - `02b1955` `feat(store): extract AgentStore trait` — internal refactor only; mobile `SqliteStore` default behavior unchanged, so no user-visible iOS impact.
199
+ - `9946e0f` `ffi: detach inner runtime on drop` — server-side concern only (handle dropped from inside another tokio runtime); does not affect Capacitor.
200
+
201
+ Action plan: rebuild `xcframework` on the Mac under `~/choreruiz/` via `scripts/build-ios.sh`, rsync `ios/Frameworks/` and `ios/Sources/NativeAgentPlugin/Generated/` back, bump to `0.9.1`, republish.
164
202
 
165
203
  ## License
166
204
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-native-agent",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Native AI agent loop for Capacitor — runs LLM completions, tool execution, and cron jobs in native Rust, enabling background execution.",
5
5
  "main": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",