@bitovi/vybit 0.4.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Bitovi
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,155 @@
1
+ # VyBit
2
+
3
+ Change designs, draw mockups, and provide suggestions in your browser and send them to your favorite coding agent (Claude, Cursor, Copilot, etc) to be implemented. VyBit works with React apps built with Tailwind v3 or v4.
4
+
5
+ <img width="1546" height="860" alt="image" src="https://github.com/user-attachments/assets/de3450be-abcf-4612-93a5-ae2dd324d583" />
6
+
7
+ ## Installation
8
+
9
+ To use VyBit:
10
+
11
+ 1. Add its MCP tools to your agent
12
+ 2. Start the MCP connection
13
+ 3. Have your app or website load the VyBit Editor script
14
+
15
+ ### Add MCP tools to your agent
16
+
17
+ VyBit uses MCP to tell your agent to implement the changes you commit.
18
+
19
+ Add VyBit to your Agent's MCP configuration. Below we've listed what these configurations might look like for different agents. The most important things to know are:
20
+
21
+ - VyBit is a Node project. So you will need [NodeJS](https://nodejs.org/en) `>= 18`.
22
+ - VyBit runs using STDIO (not HTTP), so you will often need some sort of `command` or `stdio` configuration.
23
+ - VyBit needs to run where your React app's `package.json` is.
24
+
25
+ __Copilot__ in `.vscode/mcp.json`
26
+
27
+ ```json
28
+ {
29
+ "servers": {
30
+ "vybit": {
31
+ "type": "stdio",
32
+ "command": "npx",
33
+ "args": ["@bitovi/vybit"],
34
+ "cwd": "${workspaceFolder}/packages/client"
35
+ }
36
+ },
37
+ "inputs": []
38
+ }
39
+ ```
40
+
41
+ __Claude Code__ in `.mcp.json`
42
+
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "vybit": {
47
+ "command": "npx",
48
+ "args": ["@bitovi/vybit"],
49
+ "cwd": "/path/to/your/project"
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### Start the MCP connection
56
+
57
+ Different agents connect to an MCP service in different ways:
58
+
59
+ __Copilot__
60
+
61
+ Click start
62
+
63
+ <img width="586" height="341" alt="image" src="https://github.com/user-attachments/assets/1658c2e6-f9f0-4749-8f26-f3c4bc02100b" />
64
+
65
+
66
+ ### Add the Editor script
67
+
68
+ The Editor script adds the VyBit editor panel. The script needs to be added to any pages you want to edit.
69
+
70
+ The best way to add the editor script is to have your agent do it! Paste the following into your agent:
71
+
72
+ ```markdown
73
+ I would like to use [VyBit](https://github.com/bitovi/vybit) on every page of this application.
74
+ Please make sure we can load the overlay script at `http://localhost:3333/overlay.js` in a non-blocking way.
75
+ Here's some suggested code to add in the `<head>` of every page in development mode:
76
+
77
+ \```html
78
+ <script>
79
+ if (location.hostname === 'localhost') {
80
+ const s = document.createElement('script');
81
+ s.src = 'http://localhost:3333/overlay.js';
82
+ document.head.appendChild(s);
83
+ }
84
+ </script>
85
+ \```
86
+ ```
87
+
88
+ ## Use
89
+
90
+ To start a session, you need to:
91
+
92
+ 1. Tell your agent to start pulling changes and implementing features
93
+ 2. Use the Editor to make changes
94
+ 3. Commit those changes to send them to the agent
95
+
96
+ ### Telling your agent to start making features
97
+
98
+ In your agent, run the following prompt:
99
+
100
+ ```
101
+ Please implement the next change and continue implementing changes with VyBit.
102
+ ```
103
+
104
+ This will have your agent start a loop where it waits for changes, implements them, and then waits for new ones.
105
+
106
+ ### Use the Editor to make changes
107
+
108
+ You should see an editor icon like this:
109
+
110
+ <img width="78" height="61" alt="image" src="https://github.com/user-attachments/assets/973e707b-d143-44a5-b062-0e607e3e950f" />
111
+
112
+ Click it. It will open the Editor Panel.
113
+
114
+ ### Using the Editor to make changes
115
+
116
+ More on this later. But in short, click an element, then you can adjust the desig of it, or insert a panel to draw out changes. You can also add contextual messages. These are all draft changes until you commit.
117
+
118
+ ### Commiting changes
119
+
120
+ Once you have the changes you want to make, you can click the drafts button. This will show you a list of changes. Click `Commit All` to send them to the agent to be implemented:
121
+
122
+ <img width="386" height="157" alt="image" src="https://github.com/user-attachments/assets/7795205b-6e70-43db-bf61-2beec2840231" />
123
+
124
+
125
+
126
+
127
+
128
+
129
+ ## MCP Tools
130
+
131
+ There are other MCP tools you can use if you don't want to work in the implement loop:
132
+
133
+ | Tool | Description |
134
+ |------|-------------|
135
+ | `implement_next_change` | **Start here.** Waits for the next committed change, returns implementation instructions, and requires the agent to apply it, mark it done, then call this tool again in an endless loop. |
136
+ | `get_next_change` | Returns the next committed change as raw patch data (no workflow instructions). Use this for custom agent workflows. |
137
+ | `mark_change_implemented` | Marks one or more changes as implemented by ID. Returns a directive to call `implement_next_change` again. |
138
+ | `list_changes` | Lists all changes grouped by status (`staged`, `committed`, `implementing`, `implemented`). |
139
+ | `discard_all_changes` | Clears the entire change queue. |
140
+
141
+ ## Port Configuration
142
+
143
+ Use the `PORT` environment variable to change the server port (default: `3333`):
144
+
145
+ ```bash
146
+ PORT=4000 npx @bitovi/vybit
147
+ ```
148
+
149
+ ## Contributing
150
+
151
+ Issues and PRs welcome at [github.com/bitovi/vybit](https://github.com/bitovi/vybit).
152
+
153
+ ## License
154
+
155
+ MIT © [Bitovi](https://www.bitovi.com)
package/loader.mjs ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ // Entry point — runs the TypeScript server directly via tsx (no build step needed)
3
+ import { register } from "tsx/esm/api";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
+
9
+ register();
10
+
11
+ await import(path.join(__dirname, "server", "index.ts"));
File without changes