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:
commit
254d08b1bd
35 files changed
+4922
No files matched your search
@@ -0,0 +1,55 @@
|
||||
// Code generated by asuka native. DO NOT EDIT.
|
||||
// asuka:native f84252246ecd432c
|
||||
|
||||
// What the package's Go declares (package netcfg), as its JavaScript
|
||||
// implements it. netcfg.js exports the functions that make each:
|
||||
//
|
||||
// export function makeNetcfg() // returns its methods (lowerCamelCase)
|
||||
//
|
||||
// A method that takes a context in Go is async, and gets an AbortSignal
|
||||
// first. int64 and uint64 are BigInts; a time is a Date; a duration is
|
||||
// milliseconds; a []byte is a Uint8Array.
|
||||
|
||||
import * as impl from "./netcfg.js";
|
||||
|
||||
const { NativeWriter, NativeReader, DeclaredError, UnsupportedError, registerModule, retain, object } = globalThis.asuka.native;
|
||||
|
||||
const provider = {
|
||||
make(iface) {
|
||||
switch (iface) {
|
||||
case 0: return impl.makeNetcfg();
|
||||
}
|
||||
throw new UnsupportedError(`no interface ${iface}`);
|
||||
},
|
||||
|
||||
call(o, iface, method, r, w) {
|
||||
switch (iface * 65536 + method) {
|
||||
case 1: { // Netcfg.Hello
|
||||
const name = r.string();
|
||||
r.check();
|
||||
const v = o.hello(name);
|
||||
w.string(v);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new UnsupportedError(`no method ${iface}.${method}`);
|
||||
},
|
||||
|
||||
start(o, iface, method, r, signal) {
|
||||
switch (iface * 65536 + method) {
|
||||
}
|
||||
throw new UnsupportedError(`no method ${iface}.${method}`);
|
||||
},
|
||||
|
||||
makeView(name, ctx) {
|
||||
switch (name) {
|
||||
}
|
||||
return null;
|
||||
},
|
||||
};
|
||||
|
||||
registerModule("github.com/openchamber/openchamber-native/netcfg", provider);
|
||||
|
||||
// The package's values on the wire (package native's format).
|
||||
const Wire = {
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
// The netcfg package's JavaScript: what its Go declares, implemented on
|
||||
// the web (netcfg.asuka.js, beside it, is what asuka native generates).
|
||||
|
||||
export function makeNetcfg() {
|
||||
return {
|
||||
hello: (name) => `Hello, ${name}, from the web`,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user