@independo/capacitor-inderun 1.1.0-dev.1 → 1.1.0-dev.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.
Files changed (3) hide show
  1. package/Package.swift +1 -1
  2. package/README.md +28 -14
  3. package/package.json +16 -4
package/Package.swift CHANGED
@@ -9,7 +9,7 @@ import PackageDescription
9
9
  let package = Package(
10
10
  name: "IndeRunCapacitor",
11
11
  platforms: [
12
- .iOS(.v15),
12
+ .iOS(.v16),
13
13
  .macOS(.v14)
14
14
  ],
15
15
  products: [
package/README.md CHANGED
@@ -14,10 +14,15 @@
14
14
 
15
15
  <p align="center">Built and maintained by <a href="https://www.independo.app/">Independo</a>.</p>
16
16
 
17
- Thin Capacitor bridge for IndeRun Mode 1 `run()` and Mode 2 `stream()` execution.
17
+ **On-device AI with cloud fallback, for Capacitor apps.**
18
18
 
19
- The package delegates to the released [IndeRun](https://github.com/independo-gmbh/inderun)
20
- platform SDKs instead of re-implementing routing, provider logic, or normalized error handling:
19
+ Runs a prompt on the device when the device can — Apple Foundation Models on iOS, ML Kit GenAI
20
+ (Gemini Nano) on Android — and falls back to an OpenAI-compatible cloud endpoint when it cannot.
21
+ One API across iOS, Android and the web, with streaming and cancellation. MIT.
22
+
23
+ It is a thin bridge, not a second engine. The package delegates to the released
24
+ [IndeRun](https://github.com/independo-gmbh/inderun) platform SDKs instead of re-implementing
25
+ routing, provider logic, or normalized error handling:
21
26
 
22
27
  - web: [`@independo/inderun-web`](https://www.npmjs.com/package/@independo/inderun-web) (npm)
23
28
  - iOS: `IndeRun` Swift package (`github.com/independo-gmbh/inderun`, SwiftPM)
@@ -38,10 +43,15 @@ Then sync native projects with your normal Capacitor workflow.
38
43
 
39
44
  | Platform | Minimum version |
40
45
  |----------|------------------------|
41
- | iOS | 15.0 |
46
+ | iOS | 16.0 |
42
47
  | Android | API 26 (Android 8.0) |
43
48
  | Web | Any modern browser |
44
49
 
50
+ The iOS floor comes from the IndeRun Swift package this bridge depends on, not from the bridge
51
+ itself. On-device execution needs more than the floor: Apple Foundation Models requires an Apple
52
+ Intelligence–capable device on iOS 26+, and ML Kit GenAI requires AICore / Gemini Nano support.
53
+ Availability is checked at runtime and the cloud provider serves the request when it is missing.
54
+
45
55
  ## Usage
46
56
 
47
57
  ```ts
@@ -96,16 +106,16 @@ for await (const event of run.events) {
96
106
  run.cancel("user navigated away"); // idempotent; a no-op after the terminal
97
107
  ```
98
108
 
99
- Three things worth knowing before you build on it:
109
+ Event semantics, ordering, the terminal guarantees, cancellation and fallback are the engines'
110
+ contract, identical on every platform, and documented once in
111
+ [Streaming (Mode 2)](https://github.com/independo-gmbh/inderun/blob/dev/docs/streaming.md). Two
112
+ things are specific to reaching them through a bridge:
100
113
 
101
- - **Order by `sequence`, not arrival.** The bridge hop is not order-preserving, which is
102
- why `sequence` is the contract's ordering authority. `events` already yields strictly by
103
- it; if you attach your own listener instead, you must order them yourself.
104
- - **A failed run is not a rejected promise.** See [Error Handling](#error-handling).
105
- - **Handle `content_snapshot` even from a token-streaming provider.** A snapshot replaces
106
- the cumulative text rather than appending to it, and an empty one is how a provider
107
- retracts content it already delivered — for example when an on-device safety check
108
- rejects a half-generated response.
114
+ - **The bridge hop is not order-preserving.** That is why `sequence` rather than arrival is the
115
+ contract's ordering authority. `events` already yields strictly by it; if you attach your own
116
+ listener to `STREAM_EVENT_NAME` instead, ordering is yours to enforce.
117
+ - **A failed run is not a rejected promise**, and a bridge transport fault is a third thing again.
118
+ See [Error Handling](#error-handling).
109
119
 
110
120
  ## API
111
121
 
@@ -131,7 +141,11 @@ also carries the bridge-local correlation id. `stream()` hides this.
131
141
  - Web requires `openAI` registration because the current web SDK only has the OpenAI-compatible provider.
132
142
  - iOS always registers the Apple on-device provider and optionally registers OpenAI when configured.
133
143
  - Android always registers the ML Kit on-device provider and optionally registers OpenAI when configured.
134
- - Keep credentials behind `authContextRef`. For browser apps, prefer a proxy endpoint with `auth: "none"`.
144
+ - Keep credentials behind `authContextRef`. That keeps a secret out of the request payload and out
145
+ of source; it does not make a key safe to ship, since anything an installed app or a browser can
146
+ read, someone with that app or browser can read. For a key you own, put it behind a backend you
147
+ control and point `endpointUrl` at that — for browser apps, a same-origin proxy with
148
+ `auth: "none"`.
135
149
 
136
150
  ## Current Limitations
137
151
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@independo/capacitor-inderun",
3
- "version": "1.1.0-dev.1",
4
- "description": "Thin Capacitor bridge for IndeRun across web, iOS, and Android.",
3
+ "version": "1.1.0-dev.3",
4
+ "description": "On-device AI with cloud fallback for Capacitor apps. Apple Foundation Models on iOS, ML Kit GenAI (Gemini Nano) on Android, an OpenAI-compatible endpoint as fallback — one API, with streaming and cancellation.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/independo-gmbh/capacitor-inderun#readme",
7
7
  "repository": {
@@ -13,9 +13,21 @@
13
13
  },
14
14
  "keywords": [
15
15
  "capacitor",
16
- "plugin",
16
+ "capacitor-plugin",
17
+ "ionic",
17
18
  "inderun",
18
- "ai"
19
+ "ai",
20
+ "llm",
21
+ "on-device",
22
+ "on-device-ai",
23
+ "local-llm",
24
+ "offline",
25
+ "cloud-fallback",
26
+ "streaming",
27
+ "openai",
28
+ "gemini-nano",
29
+ "ml-kit",
30
+ "foundation-models"
19
31
  ],
20
32
  "engines": {
21
33
  "node": ">=24"