kodorun-cli 0.0.0-stage → 0.1.124

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
@@ -1,3 +1,100 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
+ <h1>kodorun-cli</h1>
3
+ <p>
4
+ Encrypted Host Bridge CLI for <strong>KodoRun</strong> — pair any local repository with the KodoRun mobile IDE over X25519 + XChaCha20-Poly1305 E2EE.
5
+ </p>
6
+ <p>
7
+ <a href="https://kodorun.vercel.app">Website</a> ·
8
+ <a href="https://github.com/codewithevilxd/kodorun">GitHub</a> ·
9
+ <a href="https://kodorun.vercel.app/#apk-download">Download Android APK</a>
10
+ </p>
11
+ </div>
2
12
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
13
+ ---
14
+
15
+ ## Overview
16
+
17
+ `kodorun-cli` runs inside your project directory and bridges:
18
+
19
+ - **AI Coding Agents:** Claude Code, Codex CLI, OpenCode, Cursor Agent, Gemini CLI, and Antigravity
20
+ - **24fps Rust PTY Terminal (`kodorun-pty`):** Hardware-smooth shell streaming powered by `wezterm` internals
21
+ - **Sandboxed Filesystem & CodeMirror Sync:** File tree, search, read, write, and uploads scoped cleanly to `process.cwd()`
22
+ - **Git Integration & Diffs:** Status, stage, commit, pull, push, and branches
23
+ - **Localhost Port Forwarding:** Tunnel local web apps directly to the mobile preview & API inspector
24
+
25
+ All traffic between your phone and host CLI is end-to-end encrypted (`X25519` + `XChaCha20-Poly1305` via libsodium).
26
+
27
+ ---
28
+
29
+ ## Requirements
30
+
31
+ - **Node.js** `>= 18`
32
+ - **npm** / **npx**
33
+ - **KodoRun mobile app** ([Download APK](https://kodorun.vercel.app/#apk-download))
34
+
35
+ ---
36
+
37
+ ## Quickstart
38
+
39
+ Run inside any project directory you want to code on:
40
+
41
+ ```bash
42
+ cd your-project
43
+ npx kodorun-cli
44
+ ```
45
+
46
+ Scan the printed QR code (or type the pairing session code) inside the KodoRun app.
47
+
48
+ ### Common Flags
49
+
50
+ ```bash
51
+ npx kodorun-cli --help
52
+ npx kodorun-cli --new # Force a fresh session code instead of reusing cached session
53
+ npx kodorun-cli --debug # Verbose CLI + AI backend logging
54
+ npx kodorun-cli --extra-ports 3000,5173
55
+ ```
56
+
57
+ | Option | Description |
58
+ | --- | --- |
59
+ | `-h`, `--help` | Show CLI usage and flags |
60
+ | `-n`, `--new` | Issue a brand-new pairing code & QR |
61
+ | `-d`, `--debug` | Enable verbose bridge & AI provider logs |
62
+ | `--extra-ports` | Comma-separated localhost ports exposed for preview |
63
+
64
+ ---
65
+
66
+ ## Environment Variables (Optional)
67
+
68
+ Default endpoints connect to the public KodoRun cloud relay (`imaginative-communication-production-1235543a.up.railway.app` / `kodorun-production.up.railway.app`). Override cleanly when running a self-hosted Bun relay:
69
+
70
+ | Variable | Purpose |
71
+ | --- | --- |
72
+ | `KODORUN_PROXY_URL` | Custom WebSocket proxy relay URL (e.g. `http://127.0.0.1:3000`) |
73
+ | `KODORUN_MANAGER_URL` | Custom Manager control plane URL (e.g. `http://127.0.0.1:8899`) |
74
+ | `KODORUN_PTY_BIN` | Path override for a local compiled `kodorun-pty` binary |
75
+ | `KODORUN_SHELL` | Custom shell binary override (defaults to `$SHELL` or `$COMSPEC`) |
76
+ | `KODORUN_DEBUG` | Set `1` for debug logs |
77
+ | `KODORUN_DEBUG_AI` | Set `1` for verbose AI provider logs |
78
+
79
+ Session credentials are stored per workspace root under:
80
+
81
+ - **macOS:** `~/Library/Application Support/kodorun/config.json`
82
+ - **Windows:** `%APPDATA%\kodorun\config.json`
83
+ - **Linux:** `$XDG_CONFIG_HOME/kodorun/config.json` or `~/.config/kodorun/config.json`
84
+
85
+ ---
86
+
87
+ ## Local Build & Tests
88
+
89
+ ```bash
90
+ npm install
91
+ npm run typecheck
92
+ npm test
93
+ npm run build
94
+ ```
95
+
96
+ ---
97
+
98
+ ## License
99
+
100
+ MIT — **[codewithevilxd](https://github.com/codewithevilxd/kodorun)**
@@ -0,0 +1,95 @@
1
+ import type { AIProvider, AiBackend, AiEventEmitter, CodexPromptOptions, FileAttachment, MessageInfo, ModelSelector, ProviderInfo, SessionInfo, ShareInfo } from "./interface.js";
2
+ export interface AcpModelSeed {
3
+ id: string;
4
+ name: string;
5
+ isDefault?: boolean;
6
+ reasoning?: boolean;
7
+ attachment?: boolean;
8
+ }
9
+ export interface AcpProviderConfig {
10
+ backend: AiBackend;
11
+ displayName: string;
12
+ binaryCandidates: string[];
13
+ extraBinaryPaths?: string[];
14
+ acpArgs: string[];
15
+ authEnvKey: string;
16
+ authMethodId?: string;
17
+ defaultModels: AcpModelSeed[];
18
+ permissionModeFlag?: {
19
+ plan: string[];
20
+ build: string[];
21
+ };
22
+ }
23
+ export declare class AcpProvider implements AIProvider {
24
+ private readonly config;
25
+ private readonly store;
26
+ private executablePath;
27
+ private proc;
28
+ private initPromise;
29
+ private shuttingDown;
30
+ private emitter;
31
+ private nextId;
32
+ private pending;
33
+ private loadedRemoteSessions;
34
+ private discoveredModels;
35
+ private discoveredDefaultModel;
36
+ private availableModes;
37
+ private activeTurnBySession;
38
+ private activeStatusBySession;
39
+ private pendingPermissions;
40
+ private apiKeyOverride;
41
+ constructor(config: AcpProviderConfig);
42
+ private debugLog;
43
+ init(): Promise<void>;
44
+ destroy(): Promise<void>;
45
+ subscribe(emitter: AiEventEmitter): () => void;
46
+ private ensureProcessReady;
47
+ private sendJson;
48
+ private call;
49
+ private notify;
50
+ private handleLine;
51
+ private handleServerRequest;
52
+ private resolveLocalSessionId;
53
+ private handleNotification;
54
+ private emitPart;
55
+ private ingestSessionMetadata;
56
+ createSession(title?: string): Promise<{
57
+ session: SessionInfo;
58
+ }>;
59
+ listSessions(): Promise<{
60
+ sessions: unknown;
61
+ }>;
62
+ getSession(id: string): Promise<{
63
+ session: SessionInfo;
64
+ }>;
65
+ deleteSession(id: string): Promise<{
66
+ deleted: boolean;
67
+ }>;
68
+ renameSession(id: string, title: string): Promise<{
69
+ session: SessionInfo;
70
+ }>;
71
+ getMessages(sessionId: string): Promise<{
72
+ messages: MessageInfo[];
73
+ }>;
74
+ statuses(): Promise<{
75
+ statuses: Record<string, unknown>;
76
+ }>;
77
+ prompt(sessionId: string, text: string, model?: ModelSelector, agent?: string, files?: FileAttachment[], _codexOptions?: CodexPromptOptions): Promise<{
78
+ ack: true;
79
+ }>;
80
+ abort(sessionId: string): Promise<Record<string, never>>;
81
+ agents(): Promise<{
82
+ agents: unknown;
83
+ }>;
84
+ providers(): Promise<ProviderInfo>;
85
+ setAuth(_providerId: string, key: string): Promise<Record<string, never>>;
86
+ command(): Promise<{
87
+ result: unknown;
88
+ }>;
89
+ revert(): Promise<Record<string, never>>;
90
+ unrevert(): Promise<Record<string, never>>;
91
+ share(): Promise<{
92
+ share: ShareInfo;
93
+ }>;
94
+ permissionReply(sessionId: string, permissionId: string, response: "once" | "always" | "reject"): Promise<Record<string, never>>;
95
+ }