multimodel-dev-os 3.0.1 → 3.2.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/README.md +4 -0
- package/bin/multimodel-dev-os.js +3419 -3573
- package/docs/.vitepress/config.js +2 -2
- package/docs/index.md +5 -5
- package/docs/npm-publishing.md +5 -5
- package/docs/package-safety.md +24 -0
- package/docs/public/llms-full.txt +1 -1
- package/docs/public/llms.txt +1 -1
- package/docs/public/sitemap.xml +10 -0
- package/docs/registry-policy.md +4 -0
- package/docs/registry-security.md +7 -0
- package/docs/registry-sync.md +6 -0
- package/docs/release-policy.md +6 -5
- package/docs/testing.md +133 -0
- package/docs/trusted-registries.md +4 -0
- package/docs/v3-roadmap.md +20 -2
- package/package.json +10 -3
- package/scripts/build-cli.js +59 -0
- package/scripts/check-build-fresh.js +52 -0
- package/scripts/install.ps1 +1 -1
- package/scripts/install.sh +1 -1
- package/scripts/verify.js +221 -14
- package/scripts/verify.sh +11 -1
- package/src/catalog/loader.js +117 -0
- package/src/cli/args.js +118 -0
- package/src/cli/help.js +60 -0
- package/src/cli/main.js +5718 -0
- package/src/core/globals.js +52 -0
- package/src/core/hashes.js +15 -0
- package/src/core/policy.js +36 -0
- package/src/core/security.js +61 -0
- package/src/core/yaml.js +136 -0
- package/src/plugin/manifest.js +95 -0
- package/src/registry/sources.js +40 -0
- package/src/registry/validation.js +45 -0
- package/tests/README.md +37 -0
- package/tests/fixtures/README.md +22 -0
- package/tests/fixtures/custom-template-example/README.md +10 -0
- package/tests/fixtures/proposals/approved-append-line.md +28 -0
- package/tests/fixtures/proposals/approved-create-file.md +29 -0
- package/tests/fixtures/proposals/approved-replace-text.md +30 -0
- package/tests/fixtures/proposals/existing-create-file-no-overwrite.md +29 -0
- package/tests/fixtures/proposals/no-operations.md +18 -0
- package/tests/fixtures/proposals/path-traversal.md +29 -0
- package/tests/fixtures/proposals/pending-proposal.md +29 -0
- package/tests/fixtures/proposals/protected-path.md +29 -0
- package/tests/fixtures/proposals/replace-multiple-without-allow.md +30 -0
- package/tests/fixtures/registry-overrides/README.md +20 -0
- package/tests/smoke/README.md +37 -0
- package/tests/smoke/cli-smoke.md +49 -0
- package/tests/unit/build-output.test.js +40 -0
- package/tests/unit/catalog-loader.test.js +44 -0
- package/tests/unit/path-safety.test.js +62 -0
- package/tests/unit/plugin-manifest.test.js +94 -0
- package/tests/unit/prepublish-guard.test.js +35 -0
- package/tests/unit/registry-policy.test.js +46 -0
- package/tests/unit/registry-url-validation.test.js +64 -0
- package/tests/unit/yaml.test.js +92 -0
- package/docs/testing-v0.2.md +0 -73
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { parseYaml, parseFlowArray } from '../../src/core/yaml.js';
|
|
3
|
+
|
|
4
|
+
describe('YAML Parser', () => {
|
|
5
|
+
describe('parseFlowArray', () => {
|
|
6
|
+
it('should parse standard flow arrays', () => {
|
|
7
|
+
expect(parseFlowArray('[a, b, c]')).toEqual(['a', 'b', 'c']);
|
|
8
|
+
expect(parseFlowArray('["a", \'b\', c]')).toEqual(['a', 'b', 'c']);
|
|
9
|
+
expect(parseFlowArray('[true, false, null, 123, -45]')).toEqual([true, false, null, 123, -45]);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should handle empty flow array', () => {
|
|
13
|
+
expect(parseFlowArray('[]')).toEqual([]);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('parseYaml', () => {
|
|
18
|
+
it('should parse basic key-value pairs', () => {
|
|
19
|
+
const yaml = `
|
|
20
|
+
name: test-plugin
|
|
21
|
+
version: "1.0.0"
|
|
22
|
+
enabled: true
|
|
23
|
+
count: 42
|
|
24
|
+
`;
|
|
25
|
+
const result = parseYaml(yaml);
|
|
26
|
+
expect(result).toEqual({
|
|
27
|
+
name: 'test-plugin',
|
|
28
|
+
version: '1.0.0',
|
|
29
|
+
enabled: true,
|
|
30
|
+
count: 42
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should ignore comments', () => {
|
|
35
|
+
const yaml = `
|
|
36
|
+
# This is a comment
|
|
37
|
+
name: test-plugin # trailing comment
|
|
38
|
+
version: '1.0.0'
|
|
39
|
+
`;
|
|
40
|
+
const result = parseYaml(yaml);
|
|
41
|
+
expect(result).toEqual({
|
|
42
|
+
name: 'test-plugin',
|
|
43
|
+
version: '1.0.0'
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should not treat comments inside quoted strings as comments', () => {
|
|
48
|
+
const yaml = `
|
|
49
|
+
name: "test # plugin"
|
|
50
|
+
description: 'simple # description'
|
|
51
|
+
`;
|
|
52
|
+
const result = parseYaml(yaml);
|
|
53
|
+
expect(result).toEqual({
|
|
54
|
+
name: 'test # plugin',
|
|
55
|
+
description: 'simple # description'
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should parse nested objects', () => {
|
|
60
|
+
const yaml = `
|
|
61
|
+
meta:
|
|
62
|
+
name: test
|
|
63
|
+
slug: test-slug
|
|
64
|
+
`;
|
|
65
|
+
const result = parseYaml(yaml);
|
|
66
|
+
expect(result).toEqual({
|
|
67
|
+
meta: {
|
|
68
|
+
name: 'test',
|
|
69
|
+
slug: 'test-slug'
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should parse list arrays', () => {
|
|
75
|
+
const yaml = `
|
|
76
|
+
items:
|
|
77
|
+
- one
|
|
78
|
+
- "two"
|
|
79
|
+
- three
|
|
80
|
+
`;
|
|
81
|
+
const result = parseYaml(yaml);
|
|
82
|
+
expect(result).toEqual({
|
|
83
|
+
items: ['one', 'two', 'three']
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should return empty object on malformed YAML', () => {
|
|
88
|
+
const result = parseYaml(null);
|
|
89
|
+
expect(result).toEqual({});
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
package/docs/testing-v0.2.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# multimodel-dev-os v0.2.0 Testing Documentation
|
|
2
|
-
|
|
3
|
-
This document describes how to execute local test cases to verify the `bin/multimodel-dev-os.js` CLI tool and installer scripts.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 1. Platform Requirements
|
|
8
|
-
* **Node.js:** v18.0.0 or higher.
|
|
9
|
-
* **Unix-like Shell (Git Bash, macOS Terminal, Linux Bash):** Required for executing `.sh` scripts.
|
|
10
|
-
* **Windows PowerShell:** Required for executing `.ps1` scripts.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 2. CLI Validation Tests
|
|
15
|
-
|
|
16
|
-
### Test Case A: Help Command
|
|
17
|
-
Ensures the argument parser and help outputs render correctly.
|
|
18
|
-
```bash
|
|
19
|
-
# Git Bash / macOS / Linux / PowerShell
|
|
20
|
-
node bin/multimodel-dev-os.js --help
|
|
21
|
-
```
|
|
22
|
-
* **Expected Output:** Displays correct option flags, commands (`init`, `verify`), and versions.
|
|
23
|
-
|
|
24
|
-
### Test Case B: Structural Verification Check
|
|
25
|
-
Verifies structural presence of 20 critical files inside the repository.
|
|
26
|
-
```bash
|
|
27
|
-
# Git Bash / macOS / Linux / PowerShell
|
|
28
|
-
node bin/multimodel-dev-os.js verify
|
|
29
|
-
```
|
|
30
|
-
* **Expected Output:** Outputs `✓` indicators for each file and returns a `PASSED` status with exit code `0`.
|
|
31
|
-
|
|
32
|
-
### Test Case C: Dry-Run Scaffolding Check
|
|
33
|
-
Validates loading of custom templates (e.g. `nextjs-saas`) and adapter boundaries without actual writes.
|
|
34
|
-
```bash
|
|
35
|
-
# Git Bash / macOS / Linux / PowerShell
|
|
36
|
-
node bin/multimodel-dev-os.js init --target ./test-project --template nextjs-saas --adapter cursor --dry-run
|
|
37
|
-
```
|
|
38
|
-
* **Expected Output:** Outputs 61 `[DRY-RUN] WOULD CREATE` operation logs and a final `Project initialized successfully!` success message.
|
|
39
|
-
|
|
40
|
-
### Test Case D: Conflict Prevention Check
|
|
41
|
-
Verifies that the CLI protects existing files from overwrites.
|
|
42
|
-
```bash
|
|
43
|
-
# 1. Create a dummy file
|
|
44
|
-
mkdir -p test-conflict && touch test-conflict/AGENTS.md
|
|
45
|
-
|
|
46
|
-
# 2. Run init without force
|
|
47
|
-
node bin/multimodel-dev-os.js init --target ./test-conflict
|
|
48
|
-
```
|
|
49
|
-
* **Expected Output:** Safely aborts, prints a red `CONFLICT` warning, and exits with code `1`.
|
|
50
|
-
|
|
51
|
-
### Test Case E: Overwrite Override Check
|
|
52
|
-
Verifies that `--force` successfully bypasses conflict protection.
|
|
53
|
-
```bash
|
|
54
|
-
# Run init with force
|
|
55
|
-
node bin/multimodel-dev-os.js init --target ./test-conflict --force
|
|
56
|
-
```
|
|
57
|
-
* **Expected Output:** Overwrites conflicting files and completes successfully.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## 3. Script Installer Validation Tests
|
|
62
|
-
|
|
63
|
-
### macOS / Linux / WSL (bash):
|
|
64
|
-
```bash
|
|
65
|
-
# Run dry-run installation
|
|
66
|
-
bash scripts/install.sh --dry-run
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Windows (PowerShell):
|
|
70
|
-
```powershell
|
|
71
|
-
# Run dry-run installation
|
|
72
|
-
.\scripts\install.ps1 -DryRun
|
|
73
|
-
```
|