tweaklocal 0.1.0

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 ADDED
@@ -0,0 +1,37 @@
1
+ # TweakLocal
2
+
3
+ Tweak your UI live in the browser — the changes are written straight to your source files.
4
+
5
+ - **Copy**: click any text, edit in place, Enter. Written to the JSX literal. 0 tokens.
6
+ - **Style**: padding/margin per side, font sizes and colors from *your* design system tokens. Deterministic Tailwind class edits. 0 tokens.
7
+ - **Anything else**: describe it — routed to a fast model for style/copy or a reasoning model for functionality (headless `claude -p`), scoped to the exact file your selection maps to.
8
+
9
+ ## Quickstart (Next.js)
10
+
11
+ ```sh
12
+ npm i -D tweaklocal @tweaklocal/react
13
+ ```
14
+
15
+ 1. `jsconfig.json` / `tsconfig.json`:
16
+ ```json
17
+ { "compilerOptions": { "jsxImportSource": "@tweaklocal/react" } }
18
+ ```
19
+ 2. Root layout:
20
+ ```jsx
21
+ import { TweakLocalOverlay } from '@tweaklocal/react';
22
+ // inside <body>: {children}<TweakLocalOverlay />
23
+ ```
24
+ 3. Run the daemon next to your dev server, from the project root:
25
+ ```sh
26
+ npx tweaklocal
27
+ ```
28
+ 4. Open your app, press `⌘.`, click anything.
29
+
30
+ Works with Turbopack, webpack, and Vite — stamping happens in React's dev JSX runtime, not the bundler. Server components included. Production builds are untouched (the prod runtime is a passthrough).
31
+
32
+ ## Options
33
+
34
+ - `npx tweaklocal --port 4101` (+ `<TweakLocalOverlay origin="http://localhost:4101" />`)
35
+ - `TWEAKLOCAL_FAST_MODEL` / `TWEAKLOCAL_SMART_MODEL` — model aliases for the router (default `haiku` / `sonnet`)
36
+ - `TWEAKLOCAL_BASELINE_COST` / `TWEAKLOCAL_BASELINE_MS` — baseline for the savings counter
37
+ - Natural-language tweaks require the [Claude Code CLI](https://claude.com/claude-code) (`claude`) on your PATH; copy/style lanes work without it.
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { startServer } from '../src/server.js';
3
+
4
+ const args = process.argv.slice(2);
5
+ function flag(name, fallback) {
6
+ const i = args.indexOf(`--${name}`);
7
+ return i >= 0 ? args[i + 1] : fallback;
8
+ }
9
+
10
+ startServer({
11
+ root: flag('root', process.cwd()),
12
+ port: Number(flag('port', 4100)),
13
+ });