latentcode 0.1.0-alpha.0 → 0.1.0-alpha.1

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/README.md +24 -9
  2. package/dist/latentcode.mjs +5533 -3270
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Terminal coding agent that pays you for its idle time.
4
4
 
5
- - **Bring your own model access.** API keys or a provider subscription where the provider allows third-party clients. Connect them with `latentcode auth login`.
5
+ - **Bring your own model access.** API keys or a provider subscription where the provider allows third-party clients. Connect them inside the app with `/connect`.
6
6
  - **Earn mode.** While the agent works, one clearly labelled sponsored line sits in the working bar. You earn USDC from it on your Latent wallet, the same wallet the other Latent surfaces use.
7
7
  - **The model is never for sale.** Ads never enter the model's context or output, and the agent never recommends sponsored tools. The only targeting signal that leaves your machine is a coarse category slug (for example `backend`), classified locally.
8
8
  - **Real attention.** An impression is billed once, and only after the ad has been on screen for 2 s while the terminal is focused (xterm focus events, DEC 1004).
@@ -16,25 +16,37 @@ npx latentcode # or: npm i -g latentcode && latentcode
16
16
  latentcode [project-dir] [--model provider/id] [--no-ads] [--auto]
17
17
  ```
18
18
 
19
- Connect a model provider (API key or a subscription):
19
+ The start card shows what you are running before you type anything: the engine, the connected providers, the model, whether it asks before acting, and whether you are earning.
20
20
 
21
- ```bash
22
- latentcode auth login
23
- latentcode auth list
24
- ```
21
+ ### Inside the app
22
+
23
+ Type `/` for the command palette.
24
+
25
+ | Command | What it does |
26
+ | --- | --- |
27
+ | `/model [name]` | Model picker: search across every provider, `tab` to filter by provider, `←` `→` to set the effort level, `ctrl+t` to test a model with your account. `✓` marks models proven to work with your account. |
28
+ | `/providers` | Connected providers, how each is connected (account sign-in, API key, env var, built in) and how many models it offers. |
29
+ | `/connect [provider]` | Connect a provider without leaving the app: paste an API key or sign in through the browser. Credentials are stored by the local engine. |
30
+ | `/login` | Connect the wallet Earn mode pays into: browser sign-in, or an address you control. |
31
+ | `/earn`, `/ads on\|off` | Earnings so far; Earn mode on or off. |
32
+ | `/new`, `/compact`, `/status`, `/help`, `/exit` | Session and app. |
25
33
 
26
- Connect a wallet once:
34
+ The agent's own commands (`/init`, `/review`, `/goal`) are in the palette too.
35
+
36
+ Keys: `esc` interrupts, `↑` `↓` recall earlier prompts, `ctrl+a` / `ctrl+e` and `alt+←` / `alt+→` move in the line, `ctrl+o` opens the sponsored link, `ctrl+c` twice quits. Pasted text keeps its line breaks.
37
+
38
+ ### From the shell
27
39
 
28
40
  ```bash
29
41
  latentcode login # auth link → sign in in the browser → your Latent wallet
30
42
  latentcode login --wallet 0x… # or an address you already control
31
43
  latentcode status # wallet, Earn mode, balance, engine
44
+ latentcode auth login # connect a provider (same as /connect)
45
+ latentcode auth list
32
46
  ```
33
47
 
34
48
  The wallet lives in `~/.latent-protocol/config.json`, shared with the other Latent surfaces. A wallet set up with `npx latent-protocol init` works as is.
35
49
 
36
- Inside the app: `/help`, `/model`, `/ads on|off`, `/earn`, `/new`, `/exit`. Press `esc` to interrupt and `ctrl+o` to open the sponsored link.
37
-
38
50
  ### Develop
39
51
 
40
52
  ```bash
@@ -62,6 +74,9 @@ latentcode (this repo) opencode serve (child process, 127.0.0.1, rand
62
74
 
63
75
  - `src/engine/server.ts` starts a private `opencode serve` for each run. It is never the user's background service.
64
76
  - `src/engine/session.ts` is a pure reducer from engine events to UI state. Tests replay a recorded opencode 2.2.0 turn.
77
+ - `src/engine/catalog.ts` turns the engine's flat provider and model lists into what the picker shows: providers with a plain connection label, models with size, price and effort levels.
78
+ - `src/boot.ts` runs start-up as named steps (engine, providers, model, safety, Earn) that the start card displays.
79
+ - `src/ui/` is the Ink TUI: `App.tsx` (transcript, prompt, palette, status line), `panels/` (model picker, providers and connect, wallet), and the pure helpers `editor.ts`, `markdown.ts`, `commands.ts`, `stdin.ts`.
65
80
  - `src/ads/controller.ts` holds the ad lifecycle: fetch when work starts, accrue focused visible time, bill once, rotate after 30 s, hide when idle.
66
81
  - `src/ads/{sanitize,classify,killswitch}.ts` are ported from `latent-market/cli/src`. Keep them in sync.
67
82