@jini-ai/vibecoding 0.7.2 → 0.7.3-next.2
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/CHANGELOG.md +2 -2
- package/dist/core/history.js +111 -103
- package/dist/core/session.js +175 -143
- package/dist/html/node/parse5-region-parser.d.ts +1 -1
- package/dist/html/node/parse5-region-parser.js +1 -1
- package/dist/html/regions.js +67 -64
- package/dist/node/project.js +191 -166
- package/dist/node/store.d.ts +11 -11
- package/dist/node/store.js +290 -262
- package/dist/react/components/VibecodingWorkbench.d.ts +4 -1
- package/dist/react/components/VibecodingWorkbench.js +2 -2
- package/dist/tools.js +75 -60
- package/package.json +5 -5
package/dist/tools.js
CHANGED
|
@@ -131,71 +131,86 @@ function requireProposedEdits(record, toolId) {
|
|
|
131
131
|
*/
|
|
132
132
|
function buildVibecodingToolDefinitions(session) {
|
|
133
133
|
return [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
134
|
+
buildListPartsDefinition(session),
|
|
135
|
+
buildReadPartDefinition(session),
|
|
136
|
+
buildProposeEditsDefinition(session),
|
|
137
|
+
buildUndoDefinition(session),
|
|
138
|
+
buildRedoDefinition(session),
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
function buildListPartsDefinition(session) {
|
|
142
|
+
return {
|
|
143
|
+
descriptor: {
|
|
144
|
+
id: VIBECODING_TOOL_IDS.LIST_PARTS,
|
|
145
|
+
description: 'List every editable part of the artifact currently being authored.',
|
|
146
|
+
inputSchema: EMPTY_INPUT_SCHEMA,
|
|
147
|
+
readOnly: true,
|
|
148
|
+
timeoutMs: 10_000,
|
|
146
149
|
},
|
|
147
|
-
{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
description: "Read one part's current content by id.",
|
|
151
|
-
inputSchema: READ_PART_INPUT_SCHEMA,
|
|
152
|
-
readOnly: true,
|
|
153
|
-
timeoutMs: 10_000,
|
|
154
|
-
},
|
|
155
|
-
handler: async (input) => {
|
|
156
|
-
const record = requireInputRecord(input, VIBECODING_TOOL_IDS.READ_PART);
|
|
157
|
-
const id = requireString(record, 'id', VIBECODING_TOOL_IDS.READ_PART);
|
|
158
|
-
return { id, content: await session.readPart({ id }) };
|
|
159
|
-
},
|
|
150
|
+
handler: async () => {
|
|
151
|
+
await session.refresh();
|
|
152
|
+
return session.getSnapshot().parts;
|
|
160
153
|
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
handler: async (input) => {
|
|
172
|
-
const record = requireInputRecord(input, VIBECODING_TOOL_IDS.PROPOSE_EDITS);
|
|
173
|
-
const edits = requireProposedEdits(record, VIBECODING_TOOL_IDS.PROPOSE_EDITS);
|
|
174
|
-
const label = record.label === undefined ? undefined : requireString(record, 'label', VIBECODING_TOOL_IDS.PROPOSE_EDITS);
|
|
175
|
-
return session.applyEdits({ edits }, label === undefined ? {} : { label });
|
|
176
|
-
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function buildReadPartDefinition(session) {
|
|
157
|
+
return {
|
|
158
|
+
descriptor: {
|
|
159
|
+
id: VIBECODING_TOOL_IDS.READ_PART,
|
|
160
|
+
description: "Read one part's current content by id.",
|
|
161
|
+
inputSchema: READ_PART_INPUT_SCHEMA,
|
|
162
|
+
readOnly: true,
|
|
163
|
+
timeoutMs: 10_000,
|
|
177
164
|
},
|
|
178
|
-
{
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
inputSchema: EMPTY_INPUT_SCHEMA,
|
|
183
|
-
readOnly: false,
|
|
184
|
-
timeoutMs: 10_000,
|
|
185
|
-
},
|
|
186
|
-
handler: async () => ({ entry: await session.undo() }),
|
|
165
|
+
handler: async (input) => {
|
|
166
|
+
const record = requireInputRecord(input, VIBECODING_TOOL_IDS.READ_PART);
|
|
167
|
+
const id = requireString(record, 'id', VIBECODING_TOOL_IDS.READ_PART);
|
|
168
|
+
return { id, content: await session.readPart({ id }) };
|
|
187
169
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function buildProposeEditsDefinition(session) {
|
|
173
|
+
return {
|
|
174
|
+
descriptor: {
|
|
175
|
+
id: VIBECODING_TOOL_IDS.PROPOSE_EDITS,
|
|
176
|
+
description: 'Propose replacement content for one or more parts, as a single undoable turn. Each edit ' +
|
|
177
|
+
'is validated before anything is written; a rejected edit leaves the artifact untouched ' +
|
|
178
|
+
'and its reason is returned for the next turn.',
|
|
179
|
+
inputSchema: PROPOSE_EDITS_INPUT_SCHEMA,
|
|
180
|
+
readOnly: false,
|
|
181
|
+
timeoutMs: 15_000,
|
|
197
182
|
},
|
|
198
|
-
|
|
183
|
+
handler: async (input) => {
|
|
184
|
+
const record = requireInputRecord(input, VIBECODING_TOOL_IDS.PROPOSE_EDITS);
|
|
185
|
+
const edits = requireProposedEdits(record, VIBECODING_TOOL_IDS.PROPOSE_EDITS);
|
|
186
|
+
const label = record.label === undefined ? undefined : requireString(record, 'label', VIBECODING_TOOL_IDS.PROPOSE_EDITS);
|
|
187
|
+
return session.applyEdits({ edits }, label === undefined ? {} : { label });
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function buildUndoDefinition(session) {
|
|
192
|
+
return {
|
|
193
|
+
descriptor: {
|
|
194
|
+
id: VIBECODING_TOOL_IDS.UNDO,
|
|
195
|
+
description: 'Revert the most recent proposed-edits turn.',
|
|
196
|
+
inputSchema: EMPTY_INPUT_SCHEMA,
|
|
197
|
+
readOnly: false,
|
|
198
|
+
timeoutMs: 10_000,
|
|
199
|
+
},
|
|
200
|
+
handler: async () => ({ entry: await session.undo() }),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function buildRedoDefinition(session) {
|
|
204
|
+
return {
|
|
205
|
+
descriptor: {
|
|
206
|
+
id: VIBECODING_TOOL_IDS.REDO,
|
|
207
|
+
description: 'Re-apply the most recently undone turn.',
|
|
208
|
+
inputSchema: EMPTY_INPUT_SCHEMA,
|
|
209
|
+
readOnly: false,
|
|
210
|
+
timeoutMs: 10_000,
|
|
211
|
+
},
|
|
212
|
+
handler: async () => ({ entry: await session.redo() }),
|
|
213
|
+
};
|
|
199
214
|
}
|
|
200
215
|
/** Grants every call — see this module's doc for why tool-level authorization has nothing to add
|
|
201
216
|
* beyond `EditTarget.validate`'s own allowlist check for a session with no principal concept of
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/vibecoding",
|
|
3
|
-
"version": "0.7.2",
|
|
3
|
+
"version": "0.7.3-next.2",
|
|
4
4
|
"description": "Conversational artifact authoring: a target-agnostic edit loop — addressable parts, validated replace, operation-level undo/redo, and per-turn snapshot/rewind. Framework-free in `/core`; tagged-region HTML documents behind ./html; filesystem targets behind ./node and the chat/preview surface behind ./react.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -89,13 +89,13 @@
|
|
|
89
89
|
"react": "^19.2.7",
|
|
90
90
|
"react-dom": "^19.2.7",
|
|
91
91
|
"typescript": "^5.9.2",
|
|
92
|
-
"vitest": "^3.2.
|
|
92
|
+
"vitest": "^3.2.6",
|
|
93
93
|
"parse5": "^8.0.1",
|
|
94
|
-
"@jini-ai/
|
|
95
|
-
"@jini-ai/
|
|
94
|
+
"@jini-ai/platform": "^0.7.3-next.2",
|
|
95
|
+
"@jini-ai/core": "0.7.3-next.2"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@jini-ai/core": "^0.7.2"
|
|
98
|
+
"@jini-ai/core": "^0.7.3-next.2"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
101
|
"react": "^18.3.0 || ^19.0.0",
|