cortex-editor 0.2.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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -0
  3. package/dist/browser/index.js +16919 -0
  4. package/dist/chunk-MTPBP2I7.js +357 -0
  5. package/dist/cli/chunk-DDAWRJKB.js +8 -0
  6. package/dist/cli/demo-AVO56BY4.js +425 -0
  7. package/dist/cli/index.js +82 -0
  8. package/dist/cli/init-4THVM67R.js +904 -0
  9. package/dist/cli/mcp-4662LVDL.js +774 -0
  10. package/dist/edit-pipeline-CSKRjRlj.d.cts +1530 -0
  11. package/dist/edit-pipeline-CSKRjRlj.d.ts +1530 -0
  12. package/dist/index.cjs +6144 -0
  13. package/dist/index.d.cts +185 -0
  14. package/dist/index.d.ts +185 -0
  15. package/dist/index.js +5678 -0
  16. package/dist/next/next-source-loader.cjs +1421 -0
  17. package/dist/next/next-source-loader.d.cts +1 -0
  18. package/dist/next/next-source-loader.d.ts +1 -0
  19. package/dist/next/next.cjs +83 -0
  20. package/dist/next/next.d.cts +31 -0
  21. package/dist/next/next.d.ts +31 -0
  22. package/dist/next/next.js +47 -0
  23. package/dist/tailwind-v4-parser-K4ORCER6.js +14 -0
  24. package/dist/text-components-W2PN72Z5.js +38 -0
  25. package/dist/vite/tailwind-v4-parser-GFFOYWKN.js +355 -0
  26. package/dist/vite/text-components-W2PN72Z5.js +38 -0
  27. package/dist/vite/vite.cjs +8726 -0
  28. package/dist/vite/vite.d.cts +267 -0
  29. package/dist/vite/vite.d.ts +267 -0
  30. package/dist/vite/vite.js +8261 -0
  31. package/dist/webpack/source-loader.cjs +1421 -0
  32. package/dist/webpack/source-loader.d.cts +25 -0
  33. package/dist/webpack/source-loader.d.ts +25 -0
  34. package/dist/webpack/tailwind-v4-parser-GFFOYWKN.js +355 -0
  35. package/dist/webpack/text-components-W2PN72Z5.js +38 -0
  36. package/dist/webpack/webpack.cjs +7250 -0
  37. package/dist/webpack/webpack.d.cts +103 -0
  38. package/dist/webpack/webpack.d.ts +103 -0
  39. package/dist/webpack/webpack.js +6794 -0
  40. package/package.json +146 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zerofog, Inc. and Cortex contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # cortex-editor
2
+
3
+ **Claude Code's visual editor.**
4
+
5
+ Cortex is a dev-time visual editor for web apps. Select an element in the browser, adjust design tokens visually, see the change immediately — then hand the staged edits to Claude Code, which applies them back to your source files.
6
+
7
+ ## What you'll do
8
+
9
+ Install Cortex into your app, activate it from Claude Code with `/cortex`, click elements in the browser to edit them, and apply your changes when you're ready. Source files only change when you say so.
10
+
11
+ ## Quick start
12
+
13
+ ### 1. Install
14
+
15
+ Run from your app's folder (the one with `package.json`):
16
+
17
+ ```bash
18
+ npm install -D cortex-editor
19
+ npx cortex init
20
+ ```
21
+
22
+ ### 2. Start your app
23
+
24
+ ```bash
25
+ npm run dev
26
+ ```
27
+
28
+ Leave this terminal running. Note the URL it prints (e.g. `http://localhost:5173`) and open it in a browser.
29
+
30
+ ### 3. Open Claude Code
31
+
32
+ Start Claude Code in the **same folder** as your app. If it was already open, restart it from this folder so it picks up the new MCP server.
33
+
34
+ ### 4. Activate
35
+
36
+ In Claude Code, type `/cortex`. Reload your browser tab — the Cortex panel appears on the side.
37
+
38
+ ### 5. Edit + Apply
39
+
40
+ - Click any element to edit it.
41
+ - Adjust spacing, color, typography, etc. in the panel.
42
+ - Click **Apply** (or run `/cortex apply` in Claude Code) when you're ready. Claude Code writes the changes to your source files.
43
+
44
+ > **Staging, not saving.** Your edits live in the browser until you Apply. Reload without applying and they're gone — on purpose. Experiment freely; commit when ready.
45
+
46
+ ## Why Cortex?
47
+
48
+ Designers usually bounce between Figma (where the change is visual) and Claude Code (where the change becomes code) — a round-trip that loses fidelity at every step.
49
+
50
+ Cortex puts the editing surface on the live app itself. You adjust spacing, color, and typography directly on real content, with real responsive behavior, then Apply hands the intent to Claude Code. No spec to write, no screenshot to annotate, no translation step.
51
+
52
+ ## Supported stacks
53
+
54
+ - **Vite** — fully supported. `cortex init` auto-configures the plugin.
55
+ - **Webpack 5** — supported (HtmlWebpackPlugin or manual snippet).
56
+ - **Next.js** — experimental. `cortex init` instruments source; full Apply flow not yet end-to-end.
57
+
58
+ Works with **React, Vue, or Svelte**, styled with **Tailwind CSS** or **CSS Modules**.
59
+
60
+ ## Requirements
61
+
62
+ - Node.js 20 or newer.
63
+ - Claude Code for the Apply step ([code.claude.com](https://code.claude.com/)).
64
+
65
+ ## MCP auto-discovery
66
+
67
+ `cortex init` writes a project-scoped Claude Code MCP server to `.mcp.json` (`npx cortex mcp`). No separate MCP package to install. After init, restart Claude Code or run `/mcp` and approve the `cortex` server.
68
+
69
+ ## No embedded API keys
70
+
71
+ AI-assisted edits route through your existing Claude Code session over MCP. Cortex does not embed, require, or transmit any API keys of its own.
72
+
73
+ ## Full documentation
74
+
75
+ Step-by-step setup walkthrough, Webpack/Next specifics, annotation persistence, and troubleshooting live in the project repository:
76
+
77
+ https://github.com/zerofog/cortex#getting-started
78
+
79
+ ## License
80
+
81
+ MIT — see [LICENSE](./LICENSE).