@vizualmodel/vmblu-cli 0.3.5 → 0.4.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/commands/init/init-project.js +41 -28
- package/commands/profile/profile.bundle.js +2611 -1307
- package/package.json +4 -3
- package/templates/0.9.1/blueprint.annex.md +268 -0
- package/templates/0.9.1/blueprint.schema.json +372 -0
- package/templates/0.9.1/profile.schema.json +74 -0
- package/templates/0.9.1/system-prompt.md +72 -0
- package/templates/0.9.1/vizual.schema.json +169 -0
|
@@ -100,7 +100,16 @@ This is a minimal scaffold. Replace with the official annex matching your pinned
|
|
|
100
100
|
function fallbackSchema() {
|
|
101
101
|
return `{
|
|
102
102
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
103
|
-
"title": "vmblu.schema (placeholder)",
|
|
103
|
+
"title": "vmblu.schema.json (placeholder)",
|
|
104
|
+
"type": "object",
|
|
105
|
+
"description": "Placeholder schema. Replace with official version."
|
|
106
|
+
}`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function fallbackVizual() {
|
|
110
|
+
return `{
|
|
111
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
112
|
+
"title": "vizual.schema.json (placeholder)",
|
|
104
113
|
"type": "object",
|
|
105
114
|
"description": "Placeholder schema. Replace with official version."
|
|
106
115
|
}`;
|
|
@@ -109,7 +118,7 @@ function fallbackSchema() {
|
|
|
109
118
|
function fallbackProfileSchema() {
|
|
110
119
|
return `{
|
|
111
120
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
112
|
-
"title": "profile.schema (placeholder)",
|
|
121
|
+
"title": "profile.schema.json (placeholder)",
|
|
113
122
|
"type": "object",
|
|
114
123
|
"description": "Placeholder schema. Replace with official version."
|
|
115
124
|
}`;
|
|
@@ -166,25 +175,23 @@ async function initProject(opts) {
|
|
|
166
175
|
if (!targetDir) throw new Error("initProject: targetDir is required");
|
|
167
176
|
|
|
168
177
|
const absTarget = path.resolve(targetDir);
|
|
169
|
-
const modelFile = path.join(absTarget, `${projectName}.
|
|
170
|
-
const docFile = path.join(absTarget, `${projectName}.prf.json`);
|
|
178
|
+
const modelFile = path.join(absTarget, `${projectName}.blu.json`);
|
|
179
|
+
// const docFile = path.join(absTarget, `${projectName}.prf.json`);
|
|
171
180
|
|
|
172
181
|
const llmDir = path.join(absTarget, 'llm');
|
|
173
|
-
const sessionDir = path.join(llmDir, 'session');
|
|
182
|
+
//const sessionDir = path.join(llmDir, 'session');
|
|
174
183
|
const nodesDir = path.join(absTarget, 'nodes');
|
|
175
184
|
|
|
176
185
|
// Template sources
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
// Template sources
|
|
181
|
-
const schemaSrc = path.join(templatesDir, schemaVersion, 'vmblu.schema.json');
|
|
182
|
-
const annexSrc = path.join(templatesDir, schemaVersion, 'vmblu.annex.md');
|
|
186
|
+
const schemaSrc = path.join(templatesDir, schemaVersion, 'blueprint.schema.json');
|
|
187
|
+
const annexSrc = path.join(templatesDir, schemaVersion, 'blueprint.annex.md');
|
|
188
|
+
const vizualSrc = path.join(templatesDir, schemaVersion, 'vizual.schema.json');
|
|
183
189
|
const profileSchemaSrc = path.join(templatesDir, schemaVersion, 'profile.schema.json');
|
|
184
|
-
const
|
|
190
|
+
const promptSrc = path.join(templatesDir, schemaVersion, 'system-prompt.md');
|
|
185
191
|
|
|
186
192
|
// 1) Create folders
|
|
187
|
-
for (const dir of [absTarget, llmDir, sessionDir, nodesDir]) {
|
|
193
|
+
//for (const dir of [absTarget, llmDir, sessionDir, nodesDir]) {
|
|
194
|
+
for (const dir of [absTarget, llmDir, nodesDir]) {
|
|
188
195
|
ui.info(`mkdir -p ${dir}`);
|
|
189
196
|
await ensureDir(dir, dryRun);
|
|
190
197
|
}
|
|
@@ -193,14 +200,15 @@ async function initProject(opts) {
|
|
|
193
200
|
ui.info(`create ${modelFile}${force ? ' (force)' : ''}`);
|
|
194
201
|
await writeFileSafe(modelFile, defaultModel(projectName), { force, dry: dryRun });
|
|
195
202
|
|
|
196
|
-
ui.info(`create ${docFile}${force ? ' (force)' : ''}`);
|
|
197
|
-
await writeFileSafe(docFile, defaultDoc(projectName), { force, dry: dryRun });
|
|
203
|
+
//ui.info(`create ${docFile}${force ? ' (force)' : ''}`);
|
|
204
|
+
//await writeFileSafe(docFile, defaultDoc(projectName), { force, dry: dryRun });
|
|
198
205
|
|
|
199
206
|
// 3) Copy schema + annex into llm/
|
|
200
|
-
const schemaDst = path.join(llmDir, '
|
|
201
|
-
const annexDst = path.join(llmDir, '
|
|
207
|
+
const schemaDst = path.join(llmDir, 'blueprint.schema.json');
|
|
208
|
+
const annexDst = path.join(llmDir, 'blueprint.annex.md');
|
|
209
|
+
const vizualDst = path.join(llmDir, 'vizual.schema.json');
|
|
202
210
|
const profileSchemaDst = path.join(llmDir, 'profile.schema.json');
|
|
203
|
-
const
|
|
211
|
+
const promptDst = path.join(llmDir, 'system-prompt.md');
|
|
204
212
|
|
|
205
213
|
|
|
206
214
|
ui.info(`copy ${schemaSrc} -> ${schemaDst}${force ? ' (force)' : ''}`);
|
|
@@ -209,11 +217,16 @@ async function initProject(opts) {
|
|
|
209
217
|
ui.info(`copy ${annexSrc} -> ${annexDst}${force ? ' (force)' : ''}`);
|
|
210
218
|
await copyOrWriteFallback(annexSrc, annexDst, fallbackAnnex(), { force, dry: dryRun });
|
|
211
219
|
|
|
220
|
+
ui.info(`copy ${vizualSrc} -> ${vizualDst}${force ? ' (force)' : ''}`);
|
|
221
|
+
await copyOrWriteFallback(vizualSrc, vizualDst, fallbackVizual(), { force, dry: dryRun });
|
|
222
|
+
|
|
212
223
|
ui.info(`copy ${profileSchemaSrc} -> ${profileSchemaDst}${force ? ' (force)' : ''}`);
|
|
213
224
|
await copyOrWriteFallback(profileSchemaSrc, profileSchemaDst, fallbackProfileSchema(), { force, dry: dryRun });
|
|
214
225
|
|
|
215
|
-
ui.info(`copy ${
|
|
216
|
-
await copyOrWriteFallback(
|
|
226
|
+
ui.info(`copy ${promptSrc} -> ${promptDst}${force ? ' (force)' : ''}`);
|
|
227
|
+
await copyOrWriteFallback(promptSrc, promptDst, fallbackSeed(), { force, dry: dryRun });
|
|
228
|
+
|
|
229
|
+
/*
|
|
217
230
|
|
|
218
231
|
// 4) Build manifest with hashes
|
|
219
232
|
const willWriteManifest = !(await exists(path.join(llmDir, 'manifest.json'))) || force;
|
|
@@ -251,6 +264,8 @@ async function initProject(opts) {
|
|
|
251
264
|
ui.warn(`manifest.json exists and --force not set. Skipped.`);
|
|
252
265
|
}
|
|
253
266
|
}
|
|
267
|
+
|
|
268
|
+
*/
|
|
254
269
|
|
|
255
270
|
// 5) Make the package file
|
|
256
271
|
makePackageJson({ absTarget, projectName, force, dryRun, addCliDep: true, cliVersion: "^" + CLI_VERSION }, ui);
|
|
@@ -259,15 +274,13 @@ async function initProject(opts) {
|
|
|
259
274
|
ui.info(`\nScaffold complete${dryRun ? ' (dry run)' : ''}:\n` +
|
|
260
275
|
` ${absTarget}/
|
|
261
276
|
${path.basename(modelFile)}
|
|
262
|
-
${path.basename(docFile)}
|
|
263
277
|
package.json
|
|
264
278
|
llm/
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
279
|
+
system-prompt.md
|
|
280
|
+
blueprint.schema.json
|
|
281
|
+
blueprint.annex.md
|
|
282
|
+
vizual.schema.json
|
|
269
283
|
profile.schema.json
|
|
270
|
-
session/
|
|
271
284
|
nodes/\n`);
|
|
272
285
|
|
|
273
286
|
return {
|
|
@@ -280,10 +293,10 @@ async function initProject(opts) {
|
|
|
280
293
|
schema: schemaDst,
|
|
281
294
|
annex: annexDst,
|
|
282
295
|
profileSchema: profileSchemaDst,
|
|
283
|
-
manifest: path.join(llmDir, 'manifest.json')
|
|
296
|
+
// manifest: path.join(llmDir, 'manifest.json')
|
|
284
297
|
},
|
|
285
298
|
dryRun,
|
|
286
|
-
manifest
|
|
299
|
+
//manifest
|
|
287
300
|
};
|
|
288
301
|
}
|
|
289
302
|
|