feat: bootstrap OpenChamber native Android client

Add a Go client for OpenChamber built with Asuka's native widgets.

- internal/ocapi: health, password-to-device-token auth, session and
  message paging, prompt/interrupt/model/agent, permissions, SSE events,
  HTTP/SOCKS5 proxies and certificate pinning
- internal/storage: connection settings plus a device token in the
  platform keystore, with a per-install id for server-side dedupe
- internal/appui: connect, session list and chat screens with streaming
  Markdown, reasoning/tool folding, permission cards and session actions
- netcfg: native module that enables cleartext HTTP in release builds
- cmd/ocprobe: terminal probe for the API
- headless UI tests (uitest) and the research/plan document
This commit is contained in:
blumia committed 2026-11-16 09:09:09 +08:00
commit 254d08b1bd
35 files changed
+4922

No files matched your search

@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- OpenChamber servers are often self-hosted on a LAN over plain HTTP.
Asuka's own debug manifest enables cleartext, but a release build
would block it, so this library module merges the flag into every
variant. Remove this module to require HTTPS everywhere. -->
<application android:usesCleartextTraffic="true" />
</manifest>
@@ -0,0 +1,72 @@
// Code generated by asuka native. DO NOT EDIT.
// asuka:native f84252246ecd432c
// What the package's Go declares (package netcfg), as its Kotlin implements
// it. The Kotlin (in this package) writes the functions that make each:
//
// fun makeNetcfg(): Netcfg
@file:Suppress("unused", "RedundantVisibilityModifier")
package com.github.openchamber.openchamber_native.netcfg
import dev.asuka.AsukaModuleProvider
import dev.asuka.AsukaModules
import dev.asuka.AsukaNativeContext
import dev.asuka.AsukaNativeReader
import dev.asuka.AsukaNativeView
import dev.asuka.AsukaNativeWriter
import dev.asuka.AsukaDeclaredError
import dev.asuka.AsukaUnsupportedException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
/**
* Netcfg greets in each platform's own code.
*/
public interface Netcfg {
/**
* Hello greets name.
*/
fun hello(name: String): String
}
/** The package's native code as the host finds it (by its class's name): what makes, calls and shows what the package declares. */
public object AsukaModule : AsukaModuleProvider {
override fun make(iface: Int): Any = when (iface) {
0 -> makeNetcfg()
else -> throw AsukaUnsupportedException("no interface $iface")
}
override fun call(obj: Any, iface: Int, method: Int, r: AsukaNativeReader, w: AsukaNativeWriter) {
when (iface) {
0 -> {
val o = obj as Netcfg
when (method) {
1 -> { // Hello
val name = r.string()
r.check()
val v = o.hello(name)
w.string(v)
}
else -> throw AsukaUnsupportedException("no method $iface.$method")
}
}
else -> throw AsukaUnsupportedException("no interface $iface")
}
}
override fun start(obj: Any, iface: Int, method: Int, r: AsukaNativeReader, done: (Result<AsukaNativeWriter>) -> kotlin.Unit): Job? {
when (iface) {
}
throw AsukaUnsupportedException("no method $iface.$method")
}
override fun makeView(name: String, ctx: AsukaNativeContext): AsukaNativeView? = when (name) {
else -> null
}
}
/** The package's values on the wire (package native's format). */
private object Wire {
}
@@ -0,0 +1,9 @@
// The netcfg package's Kotlin: what its Go declares, implemented on
// Android (Netcfg.asuka.kt, beside it, is what asuka native generates).
package com.github.openchamber.openchamber_native.netcfg
private class KotlinNetcfg : Netcfg {
override fun hello(name: String) = "Hello, $name, from Kotlin"
}
fun makeNetcfg(): Netcfg = KotlinNetcfg()