@vxnus/siduri 0.0.5 → 0.0.7
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 +47 -28
- package/dist/builtin-manifests.d.ts +2 -0
- package/dist/builtin-manifests.js +433 -0
- package/dist/clean-machine-e2e.test.d.ts +1 -0
- package/dist/clean-machine-e2e.test.js +222 -0
- package/dist/db.d.ts +25 -0
- package/dist/db.js +152 -0
- package/dist/discovery.d.ts +13 -0
- package/dist/discovery.js +87 -0
- package/dist/discovery.test.d.ts +1 -0
- package/dist/discovery.test.js +67 -0
- package/dist/doctor-db.test.d.ts +1 -0
- package/dist/doctor-db.test.js +135 -0
- package/dist/doctor.d.ts +19 -0
- package/dist/doctor.js +225 -0
- package/dist/generator.d.ts +18 -0
- package/dist/generator.js +215 -0
- package/dist/generator.test.d.ts +1 -0
- package/dist/generator.test.js +158 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +202 -360
- package/dist/manifest.d.ts +33 -0
- package/dist/manifest.js +40 -0
- package/dist/release-check.d.ts +9 -0
- package/dist/release-check.js +131 -0
- package/package.json +12 -11
- package/dist/runtime.js +0 -3299
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateOrganManifest = validateOrganManifest;
|
|
4
|
+
function validateOrganManifest(manifest, sourcePath) {
|
|
5
|
+
if (!manifest || typeof manifest !== 'object') {
|
|
6
|
+
throw new Error(`Invalid manifest at ${sourcePath || 'unknown'}: expected an object`);
|
|
7
|
+
}
|
|
8
|
+
const m = manifest;
|
|
9
|
+
if (!m.name || typeof m.name !== 'string' || !m.name.startsWith('@siduri-x/')) {
|
|
10
|
+
throw new Error(`Invalid manifest name in ${sourcePath || 'unknown'}: expected package name starting with @siduri-x/`);
|
|
11
|
+
}
|
|
12
|
+
if (!m.organType || typeof m.organType !== 'string') {
|
|
13
|
+
throw new Error(`Invalid manifest organType in ${sourcePath || m.name}`);
|
|
14
|
+
}
|
|
15
|
+
if (!m.version || typeof m.version !== 'string') {
|
|
16
|
+
throw new Error(`Invalid manifest version in ${sourcePath || m.name}`);
|
|
17
|
+
}
|
|
18
|
+
if (!m.displayName || typeof m.displayName !== 'string') {
|
|
19
|
+
throw new Error(`Invalid manifest displayName in ${sourcePath || m.name}`);
|
|
20
|
+
}
|
|
21
|
+
if (!m.entrypoint || typeof m.entrypoint !== 'string') {
|
|
22
|
+
throw new Error(`Invalid manifest entrypoint in ${sourcePath || m.name}`);
|
|
23
|
+
}
|
|
24
|
+
if (!m.factory || typeof m.factory !== 'string') {
|
|
25
|
+
throw new Error(`Invalid manifest factory in ${sourcePath || m.name}`);
|
|
26
|
+
}
|
|
27
|
+
if (!m.configKey || typeof m.configKey !== 'string') {
|
|
28
|
+
throw new Error(`Invalid manifest configKey in ${sourcePath || m.name}`);
|
|
29
|
+
}
|
|
30
|
+
if (!m.configSchema || typeof m.configSchema !== 'object') {
|
|
31
|
+
throw new Error(`Invalid manifest configSchema in ${sourcePath || m.name}`);
|
|
32
|
+
}
|
|
33
|
+
if (!Array.isArray(m.environment)) {
|
|
34
|
+
throw new Error(`Invalid manifest environment in ${sourcePath || m.name}: expected array`);
|
|
35
|
+
}
|
|
36
|
+
if (!Array.isArray(m.services)) {
|
|
37
|
+
throw new Error(`Invalid manifest services in ${sourcePath || m.name}: expected array`);
|
|
38
|
+
}
|
|
39
|
+
return m;
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ReleaseCheckReport {
|
|
2
|
+
packagesChecked: number;
|
|
3
|
+
tarballsInspected: number;
|
|
4
|
+
manifestsValidated: number;
|
|
5
|
+
cleanMachinePassed: boolean;
|
|
6
|
+
passed: boolean;
|
|
7
|
+
errors: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function runReleaseCheck(repoRoot?: string): ReleaseCheckReport;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runReleaseCheck = runReleaseCheck;
|
|
7
|
+
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
function run(cmd, cwd) {
|
|
11
|
+
return (0, node_child_process_1.execSync)(cmd, { cwd, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] });
|
|
12
|
+
}
|
|
13
|
+
function runReleaseCheck(repoRoot = node_path_1.default.resolve(__dirname, '../..')) {
|
|
14
|
+
const errors = [];
|
|
15
|
+
const tempPackDir = node_path_1.default.resolve(repoRoot, 'cli/temp-release-check-packs');
|
|
16
|
+
if (node_fs_1.default.existsSync(tempPackDir))
|
|
17
|
+
node_fs_1.default.rmSync(tempPackDir, { recursive: true, force: true });
|
|
18
|
+
node_fs_1.default.mkdirSync(tempPackDir, { recursive: true });
|
|
19
|
+
const canonicalPackages = [
|
|
20
|
+
{ name: '@siduri-x/core', dir: 'packages/core', isOrgan: false, tarName: 'siduri-x-core-1.0.0.tgz' },
|
|
21
|
+
{ name: '@siduri-x/brain', dir: 'packages/organs/brain', isOrgan: true, tarName: 'siduri-x-brain-1.0.0.tgz' },
|
|
22
|
+
{ name: '@siduri-x/memory', dir: 'packages/organs/memory', isOrgan: true, tarName: 'siduri-x-memory-1.0.0.tgz' },
|
|
23
|
+
{ name: '@siduri-x/knowledge', dir: 'packages/organs/knowledge', isOrgan: true, tarName: 'siduri-x-knowledge-1.0.0.tgz' },
|
|
24
|
+
{ name: '@siduri-x/behavior', dir: 'packages/organs/behavior', isOrgan: true, tarName: 'siduri-x-behavior-1.0.0.tgz' },
|
|
25
|
+
{ name: '@siduri-x/ear', dir: 'packages/organs/ear', isOrgan: true, tarName: 'siduri-x-ear-1.0.0.tgz' },
|
|
26
|
+
{ name: '@siduri-x/vision', dir: 'packages/organs/vision', isOrgan: true, tarName: 'siduri-x-vision-1.0.0.tgz' },
|
|
27
|
+
{ name: '@siduri-x/hands', dir: 'packages/organs/hands', isOrgan: true, tarName: 'siduri-x-hands-1.0.0.tgz' },
|
|
28
|
+
{ name: '@siduri-x/body', dir: 'packages/organs/body', isOrgan: true, tarName: 'siduri-x-body-1.0.0.tgz' },
|
|
29
|
+
{ name: '@siduri-x/voice', dir: 'packages/organs/voice', isOrgan: true, tarName: 'siduri-x-voice-1.0.0.tgz' },
|
|
30
|
+
{ name: '@siduri-x/observation', dir: 'packages/organs/observation', isOrgan: true, tarName: 'siduri-x-observation-1.0.0.tgz' },
|
|
31
|
+
{ name: '@vxnus/siduri', dir: 'cli', isOrgan: false, tarName: 'vxnus-siduri-0.0.7.tgz' },
|
|
32
|
+
];
|
|
33
|
+
let packagesChecked = 0;
|
|
34
|
+
let tarballsInspected = 0;
|
|
35
|
+
let manifestsValidated = 0;
|
|
36
|
+
try {
|
|
37
|
+
// 1. Pack each package
|
|
38
|
+
for (const pkg of canonicalPackages) {
|
|
39
|
+
packagesChecked++;
|
|
40
|
+
try {
|
|
41
|
+
run(`pnpm --filter ${pkg.name} pack --pack-destination ${tempPackDir}`, repoRoot);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
errors.push(`Failed to pack ${pkg.name}: ${err.message}`);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const tarPath = node_path_1.default.join(tempPackDir, pkg.tarName);
|
|
48
|
+
if (!node_fs_1.default.existsSync(tarPath)) {
|
|
49
|
+
errors.push(`Tarball not found for ${pkg.name} at ${tarPath}`);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
tarballsInspected++;
|
|
53
|
+
// Inspect tarball package.json
|
|
54
|
+
const pkgJsonRaw = run(`tar -xzf ${tarPath} -O package/package.json`, repoRoot);
|
|
55
|
+
const pkgJson = JSON.parse(pkgJsonRaw);
|
|
56
|
+
// Check package metadata
|
|
57
|
+
if (!pkgJson.name)
|
|
58
|
+
errors.push(`${pkg.name}: missing 'name'`);
|
|
59
|
+
if (!pkgJson.version)
|
|
60
|
+
errors.push(`${pkg.name}: missing 'version'`);
|
|
61
|
+
if (!pkgJson.description)
|
|
62
|
+
errors.push(`${pkg.name}: missing 'description'`);
|
|
63
|
+
if (!pkgJson.license)
|
|
64
|
+
errors.push(`${pkg.name}: missing 'license'`);
|
|
65
|
+
if (!pkgJson.engines || !pkgJson.engines.node)
|
|
66
|
+
errors.push(`${pkg.name}: missing 'engines.node'`);
|
|
67
|
+
// Check for zero workspace: or link: dependencies
|
|
68
|
+
const deps = { ...(pkgJson.dependencies || {}), ...(pkgJson.peerDependencies || {}) };
|
|
69
|
+
for (const [dep, ver] of Object.entries(deps)) {
|
|
70
|
+
if (typeof ver === 'string') {
|
|
71
|
+
if (ver.startsWith('workspace:'))
|
|
72
|
+
errors.push(`${pkg.name}: contains workspace dependency on ${dep}`);
|
|
73
|
+
if (ver.startsWith('link:'))
|
|
74
|
+
errors.push(`${pkg.name}: contains link: dependency on ${dep}`);
|
|
75
|
+
if (ver.includes('../'))
|
|
76
|
+
errors.push(`${pkg.name}: contains relative path on ${dep}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Check tarball contents
|
|
80
|
+
const listing = run(`tar -tzf ${tarPath}`, repoRoot).split('\n');
|
|
81
|
+
if (pkg.isOrgan) {
|
|
82
|
+
if (!listing.some((l) => l.includes('package/organ-manifest.json'))) {
|
|
83
|
+
errors.push(`${pkg.name}: organ-manifest.json missing in tarball`);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
manifestsValidated++;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (pkg.name === '@siduri-x/memory') {
|
|
90
|
+
if (!listing.some((l) => l.includes('package/migrations/001_initial_schema.sql'))) {
|
|
91
|
+
errors.push(`${pkg.name}: migrations/001_initial_schema.sql missing in tarball`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (pkg.name === '@vxnus/siduri') {
|
|
95
|
+
if (!pkgJson.bin || !pkgJson.bin.siduri) {
|
|
96
|
+
errors.push(`${pkg.name}: bin.siduri field missing in package.json`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
if (node_fs_1.default.existsSync(tempPackDir))
|
|
103
|
+
node_fs_1.default.rmSync(tempPackDir, { recursive: true, force: true });
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
packagesChecked,
|
|
107
|
+
tarballsInspected,
|
|
108
|
+
manifestsValidated,
|
|
109
|
+
cleanMachinePassed: errors.length === 0,
|
|
110
|
+
passed: errors.length === 0,
|
|
111
|
+
errors,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (require.main === module) {
|
|
115
|
+
console.log('Running release:check verification...');
|
|
116
|
+
const report = runReleaseCheck();
|
|
117
|
+
console.log(`Packages checked: ${report.packagesChecked}`);
|
|
118
|
+
console.log(`Tarballs inspected: ${report.tarballsInspected}`);
|
|
119
|
+
console.log(`Manifests validated: ${report.manifestsValidated}`);
|
|
120
|
+
if (report.passed) {
|
|
121
|
+
console.log('✓ release:check PASS: All packages meet canonical release invariants.');
|
|
122
|
+
process.exitCode = 0;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
console.error('✗ release:check FAIL:');
|
|
126
|
+
for (const err of report.errors) {
|
|
127
|
+
console.error(` - ${err}`);
|
|
128
|
+
}
|
|
129
|
+
process.exitCode = 1;
|
|
130
|
+
}
|
|
131
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxnus/siduri",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Experimental CLI for installing and configuring Siduri companions",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/vxnuslabs/siduri-y",
|
|
@@ -24,22 +24,23 @@
|
|
|
24
24
|
},
|
|
25
25
|
"main": "dist/index.js",
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "tsc
|
|
28
|
-
"dev": "tsc -w"
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"dev": "tsc -w",
|
|
29
|
+
"test": "jest --config jest.config.json"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
32
|
"@vxnus/e": "^0.1.4",
|
|
32
33
|
"@vxnus/e-knowledge": "^0.1.4",
|
|
33
|
-
"cors": "^2.8.5",
|
|
34
|
-
"express": "^4.18.2",
|
|
35
34
|
"inquirer": "^9.2.12",
|
|
36
|
-
"pg": "^8.23.0"
|
|
37
|
-
"ws": "^8.21.3",
|
|
38
|
-
"zod": "^4.4.3"
|
|
35
|
+
"pg": "^8.23.0"
|
|
39
36
|
},
|
|
40
37
|
"devDependencies": {
|
|
41
|
-
"typescript": "^5.3.3",
|
|
42
38
|
"@types/inquirer": "^9.0.7",
|
|
43
|
-
"
|
|
39
|
+
"@types/jest": "^29.5.14",
|
|
40
|
+
"@types/node": "^20.19.43",
|
|
41
|
+
"@types/pg": "^8.21.0",
|
|
42
|
+
"jest": "^29.7.0",
|
|
43
|
+
"ts-jest": "^29.4.12",
|
|
44
|
+
"typescript": "^5.3.3"
|
|
44
45
|
}
|
|
45
46
|
}
|