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.
Files changed (59) hide show
  1. package/README.md +4 -0
  2. package/bin/multimodel-dev-os.js +3419 -3573
  3. package/docs/.vitepress/config.js +2 -2
  4. package/docs/index.md +5 -5
  5. package/docs/npm-publishing.md +5 -5
  6. package/docs/package-safety.md +24 -0
  7. package/docs/public/llms-full.txt +1 -1
  8. package/docs/public/llms.txt +1 -1
  9. package/docs/public/sitemap.xml +10 -0
  10. package/docs/registry-policy.md +4 -0
  11. package/docs/registry-security.md +7 -0
  12. package/docs/registry-sync.md +6 -0
  13. package/docs/release-policy.md +6 -5
  14. package/docs/testing.md +133 -0
  15. package/docs/trusted-registries.md +4 -0
  16. package/docs/v3-roadmap.md +20 -2
  17. package/package.json +10 -3
  18. package/scripts/build-cli.js +59 -0
  19. package/scripts/check-build-fresh.js +52 -0
  20. package/scripts/install.ps1 +1 -1
  21. package/scripts/install.sh +1 -1
  22. package/scripts/verify.js +221 -14
  23. package/scripts/verify.sh +11 -1
  24. package/src/catalog/loader.js +117 -0
  25. package/src/cli/args.js +118 -0
  26. package/src/cli/help.js +60 -0
  27. package/src/cli/main.js +5718 -0
  28. package/src/core/globals.js +52 -0
  29. package/src/core/hashes.js +15 -0
  30. package/src/core/policy.js +36 -0
  31. package/src/core/security.js +61 -0
  32. package/src/core/yaml.js +136 -0
  33. package/src/plugin/manifest.js +95 -0
  34. package/src/registry/sources.js +40 -0
  35. package/src/registry/validation.js +45 -0
  36. package/tests/README.md +37 -0
  37. package/tests/fixtures/README.md +22 -0
  38. package/tests/fixtures/custom-template-example/README.md +10 -0
  39. package/tests/fixtures/proposals/approved-append-line.md +28 -0
  40. package/tests/fixtures/proposals/approved-create-file.md +29 -0
  41. package/tests/fixtures/proposals/approved-replace-text.md +30 -0
  42. package/tests/fixtures/proposals/existing-create-file-no-overwrite.md +29 -0
  43. package/tests/fixtures/proposals/no-operations.md +18 -0
  44. package/tests/fixtures/proposals/path-traversal.md +29 -0
  45. package/tests/fixtures/proposals/pending-proposal.md +29 -0
  46. package/tests/fixtures/proposals/protected-path.md +29 -0
  47. package/tests/fixtures/proposals/replace-multiple-without-allow.md +30 -0
  48. package/tests/fixtures/registry-overrides/README.md +20 -0
  49. package/tests/smoke/README.md +37 -0
  50. package/tests/smoke/cli-smoke.md +49 -0
  51. package/tests/unit/build-output.test.js +40 -0
  52. package/tests/unit/catalog-loader.test.js +44 -0
  53. package/tests/unit/path-safety.test.js +62 -0
  54. package/tests/unit/plugin-manifest.test.js +94 -0
  55. package/tests/unit/prepublish-guard.test.js +35 -0
  56. package/tests/unit/registry-policy.test.js +46 -0
  57. package/tests/unit/registry-url-validation.test.js +64 -0
  58. package/tests/unit/yaml.test.js +92 -0
  59. 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
+ });
@@ -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
- ```