vini-ds 0.1.0-alpha.4 → 0.1.0-alpha.5
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 +4 -4
- package/cli.mjs +21 -7
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# VINi CLI
|
|
2
2
|
|
|
3
|
-
Connect with `npx vini-ds init`. This is a public alpha, 0.1.0-alpha.
|
|
3
|
+
Connect with `npx vini-ds init`. This is a public alpha, 0.1.0-alpha.5; it supports the bounded setup described below. For a reproducible installation, use the exact version.
|
|
4
4
|
|
|
5
|
-
Preview: `npx vini-ds@0.1.0-alpha.
|
|
5
|
+
Preview: `npx vini-ds@0.1.0-alpha.5 init --plan`. Connect: `npx vini-ds@0.1.0-alpha.5 init`.
|
|
6
6
|
|
|
7
7
|
Requires an existing React 18/Vite project and Node 20+. Detects npm or pnpm; configures CSS, ThemeBrandProvider and project-local Codex MCP/Skill. Does not change global Codex settings or project trust. This alpha supports the direct createRoot(...).render(JSX) entry form; use --entry for an explicit supported entry. New desktop Codex session discovery is a separate check.
|
|
8
8
|
|
|
9
|
-
Check an existing project with `npx vini-ds@latest status` (or `status --json`). A registry error means the available version is unknown. Review the suggested exact version with `npx vini-ds@0.1.0-alpha.
|
|
9
|
+
Check an existing project with `npx vini-ds@latest status` (or `status --json`). A registry error means the available version is unknown. A package status of current does not verify the open application page or the MCP connection in the current client. Review the suggested exact version with `npx vini-ds@0.1.0-alpha.5 update --plan`. For the name migration, complete the manual review below and use --imports-migrated; other updates use the same command without --plan. Identify the dev or preview server serving the original application URL. If it still serves old assets, update or restart only that server when its ownership and authorization are clear; otherwise ask its owner. Reload the same URL and exercise the affected component; never terminate an unidentified process. Reconnect the project-local VINi MCP in the current client. If a reconnect control is unavailable or reconnect was already attempted and the context remains stale, fully quit and reopen that client. In the same project and client read `vini://system/current`, the affected component contract, and `check_updates`; compare their versions with the target, installed packages and receipt. If the context is stale, follow the reconnect or fallback steps and repeat the checks instead of reinstalling packages just to refresh it. A separate STDIO process does not verify the current client. Treat package installation, the application page, and the current MCP client as separate results; if a check cannot be performed, report it as not verified. Update creates a recovery backup; if installation fails, inspect the reported recovery path before retrying. Previously installed private-GitHub Kits need an explicit migration and are not overwritten.
|
|
10
10
|
|
|
11
11
|
## Migrating existing projects to @vini-ds
|
|
12
12
|
|
|
13
|
-
Confirm the exact new CLI and all three packages are actually published before migrating. For a CLI-managed installation, run `npx vini-ds@0.1.0-alpha.
|
|
13
|
+
Confirm the exact new CLI and all three packages are actually published before migrating. For a CLI-managed installation, run `npx vini-ds@0.1.0-alpha.5 update --plan` and review the existing receipt and planned dependency changes. Save the project state and manually review and replace every old `@vini/*` or `@timelex/vini-*` import, CSS path, configuration and other reference with the appropriate `@vini-ds/*` name. The CLI does not rewrite arbitrary project sources. Once that review is complete, run `npx vini-ds@0.1.0-alpha.5 update --imports-migrated`; the flag records your review, not proof of it. The CLI validates the entry, avoids an extra provider and replaces the managed dependencies without aliases. Check the build, lockfile and affected application scenario, then reconnect and verify the actual MCP client.
|
|
14
14
|
|
|
15
15
|
Older CLI or MCP instances may report the changed release as unknown after a future latest change; unknown is not proof that no update exists. Use the exact new CLI and reconnect the existing client. Direct unmanaged dependencies require a separate reviewed manual migration: remove old declarations after reviewing the project, then inspect `init --plan` before installing. No automatic edits to arbitrary project files are performed.
|
package/cli.mjs
CHANGED
|
@@ -18,6 +18,8 @@ const packageKeys=['ui','tokens','agent'];
|
|
|
18
18
|
const isNativeDs=distribution=>!!distribution&&packageKeys.every(key=>distribution[key]===nativeDsPackages[key]);
|
|
19
19
|
const localNames=distribution=>Object.fromEntries(packageKeys.map(key=>[key,isNativeDs(distribution)?nativeDsPackages[key]:`@vini/${key}`]));
|
|
20
20
|
const packageSpec=(distribution,key)=>distribution[key]===localNames(distribution)[key]?distribution.version:`npm:${distribution[key]}@${distribution.version}`;
|
|
21
|
+
const pageCheck='Identify the dev or preview server serving the original application URL. If it still serves old assets, update or restart only that server when its ownership and authorization are clear; otherwise ask its owner. Reload the same URL and exercise the affected component. Do not terminate an unidentified process.';
|
|
22
|
+
const clientCheck='Reconnect the project-local VINi MCP in the current client. If a reconnect control is unavailable or reconnect was already attempted and the context remains stale, fully quit and reopen that client. In the same project and client, read vini://system/current, the affected component contract and check_updates; compare their versions with the target and installed packages. If the context is stale, do not reinstall packages just to refresh it; follow these reconnect or fallback steps and repeat the client checks. A separate STDIO process does not verify the current client. If these checks cannot be performed, report the client MCP as not verified.';
|
|
21
23
|
function validateNativeManifest(info,key,distribution){
|
|
22
24
|
if(!isNativeDs(distribution))return;
|
|
23
25
|
if(['dependencies','devDependencies','peerDependencies','optionalDependencies'].some(section=>Object.values(info[section]??{}).some(value=>typeof value==='string'&&/^npm:/u.test(value.trim()))))throw new Error(`${key} native package metadata contains an npm alias`);
|
|
@@ -199,6 +201,18 @@ async function readInstallation(root,requestedApp,expected) {
|
|
|
199
201
|
if(installedAgent){const file=path.join(installedAgent.root,'context/current.json');const bytes=await fileBytes(file,true);if(bytes){const current=json(bytes,file);agentContext={version:current.version??null,baseline:current.baseline??null,release:current.viniRelease??null};}}
|
|
200
202
|
return {projectRoot:root,appRoot:app,appRootMatchesReceipt,receipt:receipt?{distribution:receipt.distribution,appRoot:receipt.appRoot}:null,launcher:{status:launcher,expected:receipt?.distribution??null},installed,lockfiles,agentContext};
|
|
201
203
|
}
|
|
204
|
+
// These observations are returned with the command, not persisted as a new receipt.
|
|
205
|
+
// A package/launcher check cannot establish what a running application or MCP client sees.
|
|
206
|
+
function verificationState(target,state) {
|
|
207
|
+
const receipt=state.receipt?.distribution??null;
|
|
208
|
+
const matched=!!receipt&&state.appRootMatchesReceipt===true&&state.launcher.status==='matches-receipt'&&packageKeys.every(key=>state.installed[key].matchesReceipt);
|
|
209
|
+
const matchesTarget=matched&&receipt.version===target.version&&packageKeys.every(key=>receipt[key]===target[key]&&state.installed[key].actual?.name===target[key]&&state.installed[key].actual?.version===target.version);
|
|
210
|
+
return {target:{version:target.version,packages:Object.fromEntries(packageKeys.map(key=>[key,target[key]]))},
|
|
211
|
+
installation:{status:!receipt?'not-installed':matched?'matched':'mismatch',matchesTarget,receipt,packages:state.installed},
|
|
212
|
+
applicationPage:{status:'not-verified',nextStep:pageCheck},
|
|
213
|
+
clientMcp:{status:'not-verified',nextStep:clientCheck},
|
|
214
|
+
completion:{status:'not-verified',reason:'Installation, the application page and the current client MCP are separate checks; the CLI cannot verify the running page or client session.'}};
|
|
215
|
+
}
|
|
202
216
|
const validIntegrity=value=>{if(typeof value!=='string'||!/^sha512-[A-Za-z0-9+/]+={0,2}$/u.test(value))return false;const encoded=value.slice(7),bytes=Buffer.from(encoded,'base64');return bytes.length===64&&bytes.toString('base64')===encoded;};
|
|
203
217
|
function validRelease(value) {
|
|
204
218
|
const safe=x=>typeof x==='string'&&x.length>0&&x.length<=2000&&!/[\u0000-\u001f\u007f]/u.test(x);
|
|
@@ -263,7 +277,7 @@ export async function status(options={},suppliedDistribution,{request=requestMet
|
|
|
263
277
|
const ordering=aligned&&latest?compareVersions(installedVersion,latest):null;
|
|
264
278
|
const relation=!state.receipt?'not-installed':!aligned?'mismatch':published.status!=='available'||family==='unsupported'?'unknown':ordering===0?'current':ordering<0?'update-available':'ahead-of-latest';
|
|
265
279
|
const next=relation==='not-installed'?`npx ${cli.name}@${expected.version} init --plan`:relation==='mismatch'?(state.appRootMatchesReceipt===false?'Selected app root differs from the recorded npm setup; review the receipt before updating.':'Installed packages or launcher differ from the receipt; resolve the mismatch before updating.'):relation==='unknown'?(family==='unsupported'?'Installed and available package families do not have a supported automatic transition; review the distribution before migration.':'Registry unavailable; retry status before deciding about updates.'):relation==='update-available'?`npx ${cli.name}@${latest} update --plan`:relation==='ahead-of-latest'?'Installed release is newer than the registry latest tag; no downgrade is selected.':'Installed package versions match the latest available release.';
|
|
266
|
-
return {status:relation,...state,launcherVersion:expected.version,launcherMatchesInstalled:installedToLauncher,available:published,familyTransition:family,changes:published.status==='available'&&family!=='unsupported'?transition(published.release,installedVersion,latest):{status:'unknown'},nextStep:next,mutated:false};
|
|
280
|
+
return {status:relation,statusScope:'package-installation-and-registry',...state,launcherVersion:expected.version,launcherMatchesInstalled:installedToLauncher,available:published,familyTransition:family,changes:published.status==='available'&&family!=='unsupported'?transition(published.release,installedVersion,latest):{status:'unknown'},nextStep:next,verification:verificationState(expected,state),mutated:false};
|
|
267
281
|
}
|
|
268
282
|
export function formatStatus(result) {
|
|
269
283
|
const installed=['ui','tokens','agent'].map(key=>{const p=result.installed[key];return `${key}: ${p.actual?`${p.actual.name}@${p.actual.version}`:'not installed'}${p.error?` (${p.error})`:''}`;}).join('\n');
|
|
@@ -271,7 +285,7 @@ export function formatStatus(result) {
|
|
|
271
285
|
const changes=result.changes.status==='available'?`\nChanges: ${result.changes.summary}\nComponents: ${result.changes.components.join(', ')||'none listed'}`:'';
|
|
272
286
|
const release=result.available.release;
|
|
273
287
|
const site=release?`\nAtlas: ${release.atlas.url} (${release.atlas.siteRelease}, commit ${release.atlas.commit})\nAtlas archive: ${release.atlas.archiveSha256}\nDelivery: ${release.delivery.id}; package manifest: ${release.delivery.packageManifestSha256}; gateway manifest: ${release.delivery.manifestSha256}`:'';
|
|
274
|
-
return `VINi status: ${result.status}\n${installed}\nLauncher expects: ${result.launcherVersion}\nReceipt: ${result.receipt?.distribution.version??'not installed'}; launcher: ${result.launcher.status}\nAvailable published release: ${available}${site}${changes}\n${result.nextStep}`;
|
|
288
|
+
return `VINi package status: ${result.status}\nSelected CLI target: ${result.verification.target.version}\n${installed}\nLauncher expects: ${result.launcherVersion}\nReceipt: ${result.receipt?.distribution.version??'not installed'}; launcher: ${result.launcher.status}\nAvailable published release: ${available}${site}${changes}\n${result.nextStep}\nUpdate completion: not verified\nApplication page: not verified\n${result.verification.applicationPage.nextStep}\nCurrent client MCP: not verified\n${result.verification.clientMcp.nextStep}`;
|
|
275
289
|
}
|
|
276
290
|
function launcher(distribution,appRelative) {
|
|
277
291
|
return `// Generated by VINi npm CLI; resolves persistent project packages, never npx cache.\nimport { createRequire } from 'node:module';\nimport { readFileSync, existsSync } from 'node:fs';\nimport { spawn } from 'node:child_process';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nconst project=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');\nconst req=createRequire(path.join(project,${JSON.stringify(appRelative)},'package.json'));\nconst expected=${JSON.stringify(distribution)};\nconst local=${JSON.stringify(localNames(distribution))};\nlet server;\nfor(const key of ['tokens','ui','agent']) { const entry=req.resolve(local[key]+(key==='agent'?'/mcp':'')); let dir=path.dirname(entry), meta; while(true){const file=path.join(dir,'package.json');if(existsSync(file)){meta=JSON.parse(readFileSync(file,'utf8'));if(meta.name&&meta.version)break;} const parent=path.dirname(dir);if(parent===dir)throw Error('VINi package metadata missing');dir=parent;} if(meta.name!==expected[key]||meta.version!==expected.version)throw Error('VINi installed package/agent versions differ; run matching VINi CLI update');if(key==='agent')server=entry;}\nconst child=spawn(process.execPath,[server],{stdio:'inherit',cwd:project});\nfor(const sig of ['SIGINT','SIGTERM'])process.on(sig,()=>child.kill(sig));\nchild.on('error',error=>{console.error(error.message);process.exitCode=1;});\nchild.on('exit',(code,signal)=>{process.exitCode=code??1;});\n`;
|
|
@@ -357,10 +371,7 @@ export async function init(options={},suppliedDistribution,{runner=run,releaseMe
|
|
|
357
371
|
const current=await readInstallation(root,path.relative(root,app)||'.',distribution);
|
|
358
372
|
const installedAligned=!!previous&¤t.launcher.status==='matches-receipt'&&['ui','tokens','agent'].every(key=>current.installed[key].matchesReceipt);
|
|
359
373
|
const migration=!!previous&&familyTransition(previous.distribution,distribution)==='manual-import-migration';
|
|
360
|
-
const plan={status:'plan-only',command:options.command??'init',projectRoot:root,appRoot:app,entry:path.relative(app,entry),entryPreparation,packageManager:manager,installed:current.installed,installedStatus:previous?(installedAligned?'matches-receipt':'mismatch'):'not-installed',from:previous?.distribution??null,to:distribution,distribution,changes:transition(release,installedAligned?previous.distribution.version:null,distribution.version),release:release??null,restart:'
|
|
361
|
-
'Identify the dev or preview server serving the original application URL. If it still serves old assets, update or restart only that server when its ownership and authorization are clear; otherwise ask its owner. Reload the same URL and exercise the affected component. Do not terminate an unidentified process.',
|
|
362
|
-
'Reconnect the project-local VINi MCP in the current client and read vini://system/current, the affected component contract and check_updates there. A separate STDIO process does not verify the current client.'
|
|
363
|
-
],globalConfig:'unchanged',supported:'React 18, Vite direct createRoot(...).render(JSX), standalone npm/pnpm app'};
|
|
374
|
+
const plan={status:'plan-only',command:options.command??'init',projectRoot:root,appRoot:app,entry:path.relative(app,entry),entryPreparation,packageManager:manager,installed:current.installed,installedStatus:previous?(installedAligned?'matches-receipt':'mismatch'):'not-installed',from:previous?.distribution??null,to:distribution,distribution,changes:transition(release,installedAligned?previous.distribution.version:null,distribution.version),release:release??null,restart:'Reconnect the project-local VINi MCP in the current client. Restart the client only if reconnect is unavailable or was already attempted and the context remains stale; then read vini://system/current, the affected component contract and check_updates in that client.',dependencies:{[targetLocal.ui]:alias('ui'),[targetLocal.tokens]:alias('tokens')},devDependencies:{[targetLocal.agent]:alias('agent')},...(migration?{removeDependencies:Object.values(priorLocal),manualMigration:'Review and replace all old imports and configuration in the project before update; pass --imports-migrated only after review. The CLI checks the entry and build but cannot verify every source file.'}:{}),agent:'project-local Codex MCP + Skill',applicationPage:'not-verified',nativeClient:'not-verified',verification:verificationState(distribution,current),postUpdateSteps:[pageCheck,clientCheck],globalConfig:'unchanged',supported:'React 18, Vite direct createRoot(...).render(JSX), standalone npm/pnpm app'};
|
|
364
375
|
if(options.plan)return plan;
|
|
365
376
|
if(migration&&!options.importsMigrated)fail('review and migrate all project imports and configuration before update; then pass --imports-migrated');
|
|
366
377
|
if(previous&&!installedAligned)fail('installed packages or launcher differ from the receipt; resolve the mismatch before updating');
|
|
@@ -404,7 +415,10 @@ export async function init(options={},suppliedDistribution,{runner=run,releaseMe
|
|
|
404
415
|
for(const [file,bytes]of [[launchFile,launch],[setupFile,setup],[configFile,config],[skillFile,skill],[agentsFile,agents]])await write(file,bytes);
|
|
405
416
|
const receipt={installer:'vini-npm',distribution,appRoot:path.relative(root,app)||'.',entry:path.relative(app,entry),configTable,skillSha256:digest(skill),launcherSha256:digest(launch)};
|
|
406
417
|
await write(receiptPath,Buffer.from(JSON.stringify(receipt,null,2)+'\n'));
|
|
407
|
-
|
|
418
|
+
const finalState=await readInstallation(root,path.relative(root,app)||'.',distribution);
|
|
419
|
+
const verification=verificationState(distribution,finalState);
|
|
420
|
+
if(!verification.installation.matchesTarget)fail('installed packages or launcher do not match the newly written receipt');
|
|
421
|
+
return {...plan,status:'installed',installed:finalState.installed,installedStatus:'matches-receipt',verification,build:buildAttempted?'passed':'not-configured',recovery:backup};
|
|
408
422
|
} catch(error) {
|
|
409
423
|
if(error.uncertainChildren){uncertain=true;throw new Error(`${error.message}; retained lock and recovery: ${backup}`);}
|
|
410
424
|
if(!projectMutationStarted&&!modulesMoved)throw new Error(`${error.message}; no project files or dependencies changed; recovery retained: ${backup}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vini-ds",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "VINi React project and local agent setup",
|
|
6
6
|
"bin": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"typescript": "5.5.4"
|
|
21
21
|
},
|
|
22
22
|
"viniDistribution": {
|
|
23
|
-
"version": "0.1.0-alpha.
|
|
23
|
+
"version": "0.1.0-alpha.5",
|
|
24
24
|
"ui": "@vini-ds/ui",
|
|
25
25
|
"tokens": "@vini-ds/tokens",
|
|
26
26
|
"agent": "@vini-ds/agent"
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"packageManifestSha256": "sha256:44fc4d1f985ebe9d66344ec2cdb45640023eab886028dc7bb8e0be07f8c989e7"
|
|
39
39
|
},
|
|
40
40
|
"changes": {
|
|
41
|
-
"fromVersion": "0.1.0-alpha.
|
|
42
|
-
"summary": "
|
|
41
|
+
"fromVersion": "0.1.0-alpha.4",
|
|
42
|
+
"summary": "Проверка выбранной версии, установленной связки и устаревшего MCP; отдельные результаты страницы и клиента.",
|
|
43
43
|
"components": []
|
|
44
44
|
}
|
|
45
45
|
}
|