@origostudio/origo-design 0.0.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/.editorconfig +13 -0
- package/.gitattributes +22 -0
- package/.perf-baseline.json +12 -0
- package/.prettierignore +13 -0
- package/.prettierrc +10 -0
- package/.vscode/extensions.json +3 -0
- package/BRANCH-PROTECTION.md +25 -0
- package/CHANGELOG.md +292 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/commitlint.config.js +6 -0
- package/dist/packages/cli/CHANGELOG.md +92 -0
- package/dist/packages/cli/README.md +11 -0
- package/dist/packages/cli/package.json +16 -0
- package/dist/packages/cli/package.json.bak +16 -0
- package/dist/packages/cli/src/commands/generate/entity.d.ts +2 -0
- package/dist/packages/cli/src/commands/generate/entity.js +24 -0
- package/dist/packages/cli/src/commands/generate/entity.js.map +1 -0
- package/dist/packages/cli/src/commands/generate/index.d.ts +2 -0
- package/dist/packages/cli/src/commands/generate/index.js +30 -0
- package/dist/packages/cli/src/commands/generate/index.js.map +1 -0
- package/dist/packages/cli/src/commands/init.d.ts +5 -0
- package/dist/packages/cli/src/commands/init.js +27 -0
- package/dist/packages/cli/src/commands/init.js.map +1 -0
- package/dist/packages/cli/src/commands/new.d.ts +2 -0
- package/dist/packages/cli/src/commands/new.js +24 -0
- package/dist/packages/cli/src/commands/new.js.map +1 -0
- package/dist/packages/cli/src/commands/validate.d.ts +2 -0
- package/dist/packages/cli/src/commands/validate.js +50 -0
- package/dist/packages/cli/src/commands/validate.js.map +1 -0
- package/dist/packages/cli/src/index.d.ts +11 -0
- package/dist/packages/cli/src/index.js +15 -0
- package/dist/packages/cli/src/index.js.map +1 -0
- package/dist/packages/cli/src/lib/cli.d.ts +1 -0
- package/dist/packages/cli/src/lib/cli.js +7 -0
- package/dist/packages/cli/src/lib/cli.js.map +1 -0
- package/dist/packages/cli/src/lib/generator.d.ts +16 -0
- package/dist/packages/cli/src/lib/generator.js +165 -0
- package/dist/packages/cli/src/lib/generator.js.map +1 -0
- package/dist/packages/cli/src/lib/scaffolding.d.ts +5 -0
- package/dist/packages/cli/src/lib/scaffolding.js +87 -0
- package/dist/packages/cli/src/lib/scaffolding.js.map +1 -0
- package/dist/packages/cli/src/lib/validation.d.ts +4 -0
- package/dist/packages/cli/src/lib/validation.js +191 -0
- package/dist/packages/cli/src/lib/validation.js.map +1 -0
- package/dist/packages/cli/src/main.d.ts +4 -0
- package/dist/packages/cli/src/main.js +38 -0
- package/dist/packages/cli/src/main.js.map +1 -0
- package/dist/packages/cli/src/templates/entity.json +6 -0
- package/dist/packages/cli/src/templates/extension.json +8 -0
- package/dist/packages/cli/src/templates/index.d.ts +29 -0
- package/dist/packages/cli/src/templates/index.js +61 -0
- package/dist/packages/cli/src/templates/index.js.map +1 -0
- package/dist/packages/cli/src/templates/origo.json +16 -0
- package/dist/packages/cli/src/utils/errors.d.ts +15 -0
- package/dist/packages/cli/src/utils/errors.js +58 -0
- package/dist/packages/cli/src/utils/errors.js.map +1 -0
- package/dist/packages/core/CHANGELOG.md +275 -0
- package/dist/packages/core/README.md +11 -0
- package/dist/packages/core/package.json +21 -0
- package/dist/packages/core/package.json.bak +21 -0
- package/dist/packages/core/src/extension-api/extension-manager.d.ts +35 -0
- package/dist/packages/core/src/extension-api/extension-manager.js +300 -0
- package/dist/packages/core/src/extension-api/extension-manager.js.map +1 -0
- package/dist/packages/core/src/extension-api/index.d.ts +2 -0
- package/dist/packages/core/src/extension-api/index.js +6 -0
- package/dist/packages/core/src/extension-api/index.js.map +1 -0
- package/dist/packages/core/src/extension-api/types.d.ts +34 -0
- package/dist/packages/core/src/extension-api/types.js +3 -0
- package/dist/packages/core/src/extension-api/types.js.map +1 -0
- package/dist/packages/core/src/index.d.ts +3 -0
- package/dist/packages/core/src/index.js +7 -0
- package/dist/packages/core/src/index.js.map +1 -0
- package/dist/packages/core/src/schemas/capability.schema.json +104 -0
- package/dist/packages/core/src/schemas/contract.schema.json +52 -0
- package/dist/packages/core/src/schemas/domain.schema.json +47 -0
- package/dist/packages/core/src/schemas/entity.schema.json +72 -0
- package/dist/packages/core/src/schemas/extension.schema.json +39 -0
- package/dist/packages/core/src/schemas/permission.schema.json +21 -0
- package/dist/packages/core/src/types/ast.d.ts +17 -0
- package/dist/packages/core/src/types/ast.js +3 -0
- package/dist/packages/core/src/types/ast.js.map +1 -0
- package/dist/packages/core/src/types/domain.d.ts +101 -0
- package/dist/packages/core/src/types/domain.js +8 -0
- package/dist/packages/core/src/types/domain.js.map +1 -0
- package/dist/packages/core/src/types/validation.d.ts +12 -0
- package/dist/packages/core/src/types/validation.js +16 -0
- package/dist/packages/core/src/types/validation.js.map +1 -0
- package/dist/packages/core/src/validator/ast-validator.d.ts +11 -0
- package/dist/packages/core/src/validator/ast-validator.js +388 -0
- package/dist/packages/core/src/validator/ast-validator.js.map +1 -0
- package/dist/packages/core/src/validator/index.d.ts +23 -0
- package/dist/packages/core/src/validator/index.js +143 -0
- package/dist/packages/core/src/validator/index.js.map +1 -0
- package/dist/packages/core/src/validator/serializer.d.ts +11 -0
- package/dist/packages/core/src/validator/serializer.js +99 -0
- package/dist/packages/core/src/validator/serializer.js.map +1 -0
- package/eslint.config.js +114 -0
- package/generate_prompts.js +19 -0
- package/jest.config.ts +5 -0
- package/jest.preset.js +3 -0
- package/nx.json +169 -0
- package/package.json +115 -0
- package/packages/angular-renderer/CHANGELOG.md +274 -0
- package/packages/angular-renderer/README.md +11 -0
- package/packages/angular-renderer/package.json +20 -0
- package/packages/angular-renderer/playwright-ct.config.ts +23 -0
- package/packages/angular-renderer/src/adapters/web/adapter.ts +145 -0
- package/packages/angular-renderer/src/adapters/web/experience-adapter.service.ts +21 -0
- package/packages/angular-renderer/src/components/primitives/button/button.component.html +9 -0
- package/packages/angular-renderer/src/components/primitives/button/button.component.pw.ts +19 -0
- package/packages/angular-renderer/src/components/primitives/button/button.component.scss +31 -0
- package/packages/angular-renderer/src/components/primitives/button/button.component.ts +67 -0
- package/packages/angular-renderer/src/components/primitives/primitives.a11y.pw.ts +33 -0
- package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.html +10 -0
- package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.pw.ts +29 -0
- package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.scss +42 -0
- package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.ts +84 -0
- package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.html +2 -0
- package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.pw.ts +19 -0
- package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.scss +5 -0
- package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.ts +74 -0
- package/packages/angular-renderer/src/index.ts +7 -0
- package/packages/angular-renderer/src/lib/renderer.component.ts +118 -0
- package/packages/angular-renderer/src/lib/renderer.tokens.ts +9 -0
- package/packages/angular-renderer/src/lib/test-utils.ts +26 -0
- package/packages/angular-renderer/src/lib/theme.provider.ts +83 -0
- package/packages/angular-renderer/src/test-setup.ts +8 -0
- package/packages/cli/CHANGELOG.md +92 -0
- package/packages/cli/README.md +11 -0
- package/packages/cli/package.json +16 -0
- package/packages/cli/src/commands/generate/entity.ts +20 -0
- package/packages/cli/src/commands/generate/index.ts +28 -0
- package/packages/cli/src/commands/init.ts +28 -0
- package/packages/cli/src/commands/new.ts +22 -0
- package/packages/cli/src/commands/validate.ts +47 -0
- package/packages/cli/src/index.ts +11 -0
- package/packages/cli/src/lib/cli.ts +3 -0
- package/packages/cli/src/lib/generator.ts +181 -0
- package/packages/cli/src/lib/scaffolding.ts +104 -0
- package/packages/cli/src/lib/validation.ts +218 -0
- package/packages/cli/src/main.ts +38 -0
- package/packages/cli/src/templates/entity.json +6 -0
- package/packages/cli/src/templates/extension.json +8 -0
- package/packages/cli/src/templates/index.ts +94 -0
- package/packages/cli/src/templates/origo.json +16 -0
- package/packages/cli/src/utils/errors.ts +80 -0
- package/packages/core/CHANGELOG.md +275 -0
- package/packages/core/README.md +11 -0
- package/packages/core/package-lock.json +1035 -0
- package/packages/core/package.json +21 -0
- package/packages/core/scripts/generate-types.ts +23 -0
- package/packages/core/src/extension-api/extension-manager.ts +378 -0
- package/packages/core/src/extension-api/index.ts +2 -0
- package/packages/core/src/extension-api/types.ts +37 -0
- package/packages/core/src/index.ts +3 -0
- package/packages/core/src/schemas/__fixtures__/target-page.json +222 -0
- package/packages/core/src/schemas/capability.schema.json +104 -0
- package/packages/core/src/schemas/contract.schema.json +52 -0
- package/packages/core/src/schemas/domain.schema.json +47 -0
- package/packages/core/src/schemas/entity.schema.json +72 -0
- package/packages/core/src/schemas/extension.schema.json +39 -0
- package/packages/core/src/schemas/permission.schema.json +21 -0
- package/packages/core/src/types/ast.ts +20 -0
- package/packages/core/src/types/domain.ts +105 -0
- package/packages/core/src/types/validation.ts +29 -0
- package/packages/core/src/validator/ast-validator.ts +406 -0
- package/packages/core/src/validator/index.ts +207 -0
- package/packages/core/src/validator/serializer.ts +120 -0
- package/packages/core/test/fixtures/target-page.json +87 -0
- package/packages/design-tokens/CHANGELOG.md +273 -0
- package/packages/design-tokens/README.md +11 -0
- package/packages/design-tokens/package.json +25 -0
- package/packages/design-tokens/src/build.ts +97 -0
- package/packages/design-tokens/src/compile.ts +60 -0
- package/packages/design-tokens/src/index.ts +7 -0
- package/packages/design-tokens/src/runtime/index.ts +2 -0
- package/packages/design-tokens/src/runtime/theme-fetcher.ts +90 -0
- package/packages/design-tokens/src/runtime/theme-injector.ts +149 -0
- package/packages/design-tokens/src/schemas/base-tokens.schema.json +127 -0
- package/packages/design-tokens/src/schemas/semantic-tokens.schema.json +52 -0
- package/packages/design-tokens/src/tokens/base.json +46 -0
- package/packages/design-tokens/src/tokens/semantic.json +33 -0
- package/packages/playground/CHANGELOG.md +12 -0
- package/packages/playground/package.json +10 -0
- package/packages/playground/public/favicon.ico +0 -0
- package/packages/playground/src/app/app.component.html +1 -0
- package/packages/playground/src/app/app.component.scss +4 -0
- package/packages/playground/src/app/app.component.ts +13 -0
- package/packages/playground/src/app/app.config.ts +9 -0
- package/packages/playground/src/editor/badl-editor.component.html +1 -0
- package/packages/playground/src/editor/badl-editor.component.scss +10 -0
- package/packages/playground/src/editor/badl-editor.component.ts +57 -0
- package/packages/playground/src/editor/editor.worker.ts +1 -0
- package/packages/playground/src/editor/json.worker.ts +1 -0
- package/packages/playground/src/editor/monaco-environment.ts +11 -0
- package/packages/playground/src/editor/schema-registry.ts +30 -0
- package/packages/playground/src/index.html +13 -0
- package/packages/playground/src/main.ts +5 -0
- package/packages/playground/src/schemas/capability.schema.json +104 -0
- package/packages/playground/src/schemas/contract.schema.json +52 -0
- package/packages/playground/src/schemas/domain.schema.json +47 -0
- package/packages/playground/src/schemas/entity.schema.json +72 -0
- package/packages/playground/src/schemas/extension.schema.json +39 -0
- package/packages/playground/src/schemas/permission.schema.json +21 -0
- package/packages/playground/src/styles.scss +8 -0
- package/packages/playground/src/test-setup.ts +146 -0
- package/packages/playground/vite.config.ts +12 -0
- package/packages/playground/vitest.config.mjs +24 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
## 0.0.22 (2026-09-04)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- scaffold playground application and e2e testing suite with initial editor component and schema registry ([f097894](https://github.com/OrigoStudio/origo-design/commit/f097894))
|
|
6
|
+
- add GitHub Actions workflow to automate library releases using Nx Release ([3d6651f](https://github.com/OrigoStudio/origo-design/commit/3d6651f))
|
|
7
|
+
|
|
8
|
+
### ❤️ Thank You
|
|
9
|
+
|
|
10
|
+
- Hardik Patel @hardikpatelse
|
|
11
|
+
|
|
12
|
+
## 0.0.21 (2026-09-02)
|
|
13
|
+
|
|
14
|
+
### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- add centralized test registry tool with validation logic, CI integration, and documentation artifacts ([384c1c7](https://github.com/OrigoStudio/origo-design/commit/384c1c7))
|
|
17
|
+
- implement central test registry with validation tools and CI integration ([02cf656](https://github.com/OrigoStudio/origo-design/commit/02cf656))
|
|
18
|
+
- initialize negative testing story and update sprint status tracking ([bbe5fdc](https://github.com/OrigoStudio/origo-design/commit/bbe5fdc))
|
|
19
|
+
- implement CLI framework with validation, testing, and CI/CD workflows ([ff6ce55](https://github.com/OrigoStudio/origo-design/commit/ff6ce55))
|
|
20
|
+
- implement validate command and schema validation logic for BADL files ([4f9e41d](https://github.com/OrigoStudio/origo-design/commit/4f9e41d))
|
|
21
|
+
- implement path traversal guards, remove process termination from library logic, and enable error cause preservation in @origo/cli ([0854f78](https://github.com/OrigoStudio/origo-design/commit/0854f78))
|
|
22
|
+
- initialize web-based editor component and track security remediation tasks in implementation artifacts ([65716bd](https://github.com/OrigoStudio/origo-design/commit/65716bd))
|
|
23
|
+
- document e2e npm verification plan for cli package releases ([22dab4c](https://github.com/OrigoStudio/origo-design/commit/22dab4c))
|
|
24
|
+
- initialize sprint status tracking and retrospective verification story for npm packaging ([c326751](https://github.com/OrigoStudio/origo-design/commit/c326751))
|
|
25
|
+
- add generated bundle for epic7-worker-csp spike ([16ca492](https://github.com/OrigoStudio/origo-design/commit/16ca492))
|
|
26
|
+
- add web worker CSP spike and associated implementation documentation ([ebf5aa4](https://github.com/OrigoStudio/origo-design/commit/ebf5aa4))
|
|
27
|
+
- implement web worker CSP spike with supporting documentation and harness tools ([f57b1e5](https://github.com/OrigoStudio/origo-design/commit/f57b1e5))
|
|
28
|
+
- add technical spike story for Epic 7 web worker CSP validation and ADR planning ([c977487](https://github.com/OrigoStudio/origo-design/commit/c977487))
|
|
29
|
+
- initialize sprint status tracking and create Epic 7 discovery research story ([b37b967](https://github.com/OrigoStudio/origo-design/commit/b37b967))
|
|
30
|
+
- implement entity generator command with template customization and ejection support ([02a3193](https://github.com/OrigoStudio/origo-design/commit/02a3193))
|
|
31
|
+
- implement entity generator command and template ejection logic in CLI ([d7d519a](https://github.com/OrigoStudio/origo-design/commit/d7d519a))
|
|
32
|
+
- implementation of 6-2-local-schema-validation ([45e67f6](https://github.com/OrigoStudio/origo-design/commit/45e67f6))
|
|
33
|
+
|
|
34
|
+
### ❤️ Thank You
|
|
35
|
+
|
|
36
|
+
- Hardik Patel @hardikpatelse
|
|
37
|
+
|
|
38
|
+
## 0.0.20 (2026-08-25)
|
|
39
|
+
|
|
40
|
+
### 🚀 Features
|
|
41
|
+
|
|
42
|
+
- implementation of 6-1-cli-initialization-and-scaffolding ([f6aca9e](https://github.com/OrigoStudio/origo-design/commit/f6aca9e))
|
|
43
|
+
|
|
44
|
+
### ❤️ Thank You
|
|
45
|
+
|
|
46
|
+
- Hardik Patel @hardikpatelse
|
|
47
|
+
|
|
48
|
+
## 0.0.19 (2026-08-23)
|
|
49
|
+
|
|
50
|
+
### 🚀 Features
|
|
51
|
+
|
|
52
|
+
- 5.5-5-define-secure-by-default-boilerplate-templates ([0eb6dde](https://github.com/OrigoStudio/origo-design/commit/0eb6dde))
|
|
53
|
+
|
|
54
|
+
### ❤️ Thank You
|
|
55
|
+
|
|
56
|
+
- Hardik Patel @hardikpatelse
|
|
57
|
+
|
|
58
|
+
## 0.0.18 (2026-08-23)
|
|
59
|
+
|
|
60
|
+
### 🚀 Features
|
|
61
|
+
|
|
62
|
+
- 5.5-4-verify-core-compiler-source-map-preservation ([a3b0d9b](https://github.com/OrigoStudio/origo-design/commit/a3b0d9b))
|
|
63
|
+
|
|
64
|
+
### 🩹 Fixes
|
|
65
|
+
|
|
66
|
+
- pipeline issue ([c1bbe47](https://github.com/OrigoStudio/origo-design/commit/c1bbe47))
|
|
67
|
+
|
|
68
|
+
### ❤️ Thank You
|
|
69
|
+
|
|
70
|
+
- Hardik Patel @hardikpatelse
|
|
71
|
+
|
|
72
|
+
## 0.0.17 (2026-08-21)
|
|
73
|
+
|
|
74
|
+
### 🚀 Features
|
|
75
|
+
|
|
76
|
+
- 5.5-3-resolve-recursive-schema-resolution-tech-debt ([943e2e7](https://github.com/OrigoStudio/origo-design/commit/943e2e7))
|
|
77
|
+
- 5.5-2-establish-end-to-end-qa-protocols ([d8990ae](https://github.com/OrigoStudio/origo-design/commit/d8990ae))
|
|
78
|
+
- 5.5-2-establish-end-to-end-qa-protocols ([a31d97a](https://github.com/OrigoStudio/origo-design/commit/a31d97a))
|
|
79
|
+
|
|
80
|
+
### ❤️ Thank You
|
|
81
|
+
|
|
82
|
+
- Hardik Patel @hardikpatelse
|
|
83
|
+
|
|
84
|
+
## 0.0.16 (2026-08-21)
|
|
85
|
+
|
|
86
|
+
### 🚀 Features
|
|
87
|
+
|
|
88
|
+
- 5.5-1-create-usability-quickstart-guide ([e740a1a](https://github.com/OrigoStudio/origo-design/commit/e740a1a))
|
|
89
|
+
|
|
90
|
+
### ❤️ Thank You
|
|
91
|
+
|
|
92
|
+
- Hardik Patel @hardikpatelse
|
|
93
|
+
|
|
94
|
+
## 0.0.15 (2026-08-20)
|
|
95
|
+
|
|
96
|
+
### 🚀 Features
|
|
97
|
+
|
|
98
|
+
- code-review 5-5-reactive-state-event-binding ([b235951](https://github.com/OrigoStudio/origo-design/commit/b235951))
|
|
99
|
+
- implementation of 5-5-reactive-state-event-binding ([3a5948a](https://github.com/OrigoStudio/origo-design/commit/3a5948a))
|
|
100
|
+
- story creation 5-5-reactive-state-event-binding ([21104c6](https://github.com/OrigoStudio/origo-design/commit/21104c6))
|
|
101
|
+
|
|
102
|
+
### ❤️ Thank You
|
|
103
|
+
|
|
104
|
+
- Hardik Patel @hardikpatelse
|
|
105
|
+
|
|
106
|
+
## 0.0.14 (2026-08-19)
|
|
107
|
+
|
|
108
|
+
### 🚀 Features
|
|
109
|
+
|
|
110
|
+
- 5-4-design-token-consumption ([c1f64ed](https://github.com/OrigoStudio/origo-design/commit/c1f64ed))
|
|
111
|
+
- add sprint status update and design token consumption story documentation ([49aec07](https://github.com/OrigoStudio/origo-design/commit/49aec07))
|
|
112
|
+
|
|
113
|
+
### ❤️ Thank You
|
|
114
|
+
|
|
115
|
+
- Hardik Patel @hardikpatelse
|
|
116
|
+
|
|
117
|
+
## 0.0.13 (2026-08-18)
|
|
118
|
+
|
|
119
|
+
### 🚀 Features
|
|
120
|
+
|
|
121
|
+
- implement core primitives (Button, VBox, TextInput) with improved property coercion and accessibility support ([1be1def](https://github.com/OrigoStudio/origo-design/commit/1be1def))
|
|
122
|
+
- implement VBox, TextInput, and Button core primitives with accessibility testing and improved adapter coercion ([532417f](https://github.com/OrigoStudio/origo-design/commit/532417f))
|
|
123
|
+
|
|
124
|
+
### ❤️ Thank You
|
|
125
|
+
|
|
126
|
+
- Hardik Patel @hardikpatelse
|
|
127
|
+
|
|
128
|
+
## 0.0.12 (2026-08-17)
|
|
129
|
+
|
|
130
|
+
### 🚀 Features
|
|
131
|
+
|
|
132
|
+
- implement InteractionContract-based OrigoAdapter and transition angular-renderer architecture to web adapter pattern ([1a8ea32](https://github.com/OrigoStudio/origo-design/commit/1a8ea32))
|
|
133
|
+
|
|
134
|
+
### ❤️ Thank You
|
|
135
|
+
|
|
136
|
+
- Hardik Patel @hardikpatelse
|
|
137
|
+
|
|
138
|
+
## 0.0.11 (2026-08-14)
|
|
139
|
+
|
|
140
|
+
### 🚀 Features
|
|
141
|
+
|
|
142
|
+
- implement angular-renderer package with AST-based dynamic component instantiation and registry support ([500f396](https://github.com/OrigoStudio/origo-design/commit/500f396))
|
|
143
|
+
|
|
144
|
+
### ❤️ Thank You
|
|
145
|
+
|
|
146
|
+
- Hardik Patel @hardikpatelse
|
|
147
|
+
|
|
148
|
+
## 0.0.10 (2026-08-14)
|
|
149
|
+
|
|
150
|
+
### 🚀 Features
|
|
151
|
+
|
|
152
|
+
- implement extension API scaffolding, define Angular signals patterns, and add renderer test utilities ([d2adbed](https://github.com/OrigoStudio/origo-design/commit/d2adbed))
|
|
153
|
+
- mark Epic 4 as complete and record its retrospective action items in sprint status ([37c2caa](https://github.com/OrigoStudio/origo-design/commit/37c2caa))
|
|
154
|
+
|
|
155
|
+
### ❤️ Thank You
|
|
156
|
+
|
|
157
|
+
- Hardik Patel @hardikpatelse
|
|
158
|
+
|
|
159
|
+
## 0.0.9 (2026-08-14)
|
|
160
|
+
|
|
161
|
+
### 🚀 Features
|
|
162
|
+
|
|
163
|
+
- implement extension manager with manifest validation, permission security, and dependency resolution ([154b0d4](https://github.com/OrigoStudio/origo-design/commit/154b0d4))
|
|
164
|
+
|
|
165
|
+
### ❤️ Thank You
|
|
166
|
+
|
|
167
|
+
- Hardik Patel @hardikpatelse
|
|
168
|
+
|
|
169
|
+
## 0.0.8 (2026-08-14)
|
|
170
|
+
|
|
171
|
+
### 🚀 Features
|
|
172
|
+
|
|
173
|
+
- implement formal extension manifest, capability negotiation, and lifecycle management in core extension-api ([808f113](https://github.com/OrigoStudio/origo-design/commit/808f113))
|
|
174
|
+
|
|
175
|
+
### ❤️ Thank You
|
|
176
|
+
|
|
177
|
+
- Hardik Patel @hardikpatelse
|
|
178
|
+
|
|
179
|
+
## 0.0.7 (2026-08-14)
|
|
180
|
+
|
|
181
|
+
### 🚀 Features
|
|
182
|
+
|
|
183
|
+
- implement behavior validation test suite and expand AST validator test coverage ([d4c79ef](https://github.com/OrigoStudio/origo-design/commit/d4c79ef))
|
|
184
|
+
- register behavior validation suite story and update sprint status tracking ([798ec74](https://github.com/OrigoStudio/origo-design/commit/798ec74))
|
|
185
|
+
|
|
186
|
+
### ❤️ Thank You
|
|
187
|
+
|
|
188
|
+
- Hardik Patel @hardikpatelse
|
|
189
|
+
|
|
190
|
+
## 0.0.6 (2026-08-13)
|
|
191
|
+
|
|
192
|
+
### 🚀 Features
|
|
193
|
+
|
|
194
|
+
- initialize package.json for @origo/core with essential dependencies ([f819e96](https://github.com/OrigoStudio/origo-design/commit/f819e96))
|
|
195
|
+
- implement AST validation engine with support for circular dependency detection and reference integrity checks ([afd48c9](https://github.com/OrigoStudio/origo-design/commit/afd48c9))
|
|
196
|
+
- initialize sprint-status.yaml to track project development and retrospective action items ([66c6cdf](https://github.com/OrigoStudio/origo-design/commit/66c6cdf))
|
|
197
|
+
|
|
198
|
+
### ❤️ Thank You
|
|
199
|
+
|
|
200
|
+
- Hardik Patel @hardikpatelse
|
|
201
|
+
|
|
202
|
+
## 0.0.5 (2026-08-13)
|
|
203
|
+
|
|
204
|
+
### 🚀 Features
|
|
205
|
+
|
|
206
|
+
- **core:** implement security and permissions engine ([d066d90](https://github.com/OrigoStudio/origo-design/commit/d066d90))
|
|
207
|
+
- add story 4.3 for security and permissions engine and update sprint status ([3eb4aae](https://github.com/OrigoStudio/origo-design/commit/3eb4aae))
|
|
208
|
+
|
|
209
|
+
### ❤️ Thank You
|
|
210
|
+
|
|
211
|
+
- Hardik Patel @hardikpatelse
|
|
212
|
+
|
|
213
|
+
## 0.0.4 (2026-08-13)
|
|
214
|
+
|
|
215
|
+
### 🚀 Features
|
|
216
|
+
|
|
217
|
+
- add auto-generated Domain, Entity, Capability, and Contract TypeScript types for BADL definition ([10c337d](https://github.com/OrigoStudio/origo-design/commit/10c337d))
|
|
218
|
+
- implement semantic AST validator with domain, entity, and contract schema definitions ([e969466](https://github.com/OrigoStudio/origo-design/commit/e969466))
|
|
219
|
+
- update sprint status and initialize story 4-2 contracts and implementations documentation ([4b37c59](https://github.com/OrigoStudio/origo-design/commit/4b37c59))
|
|
220
|
+
|
|
221
|
+
### ❤️ Thank You
|
|
222
|
+
|
|
223
|
+
- Hardik Patel @hardikpatelse
|
|
224
|
+
|
|
225
|
+
## 0.0.3 (2026-08-13)
|
|
226
|
+
|
|
227
|
+
### 🚀 Features
|
|
228
|
+
|
|
229
|
+
- 4-1-capabilities-schema-parsing ([869c872](https://github.com/OrigoStudio/origo-design/commit/869c872))
|
|
230
|
+
|
|
231
|
+
### ❤️ Thank You
|
|
232
|
+
|
|
233
|
+
- Hardik Patel @hardikpatelse
|
|
234
|
+
|
|
235
|
+
## 0.0.2 (2026-08-12)
|
|
236
|
+
|
|
237
|
+
### 🚀 Features
|
|
238
|
+
|
|
239
|
+
- implement defensive AST validation with depth limiting, circular reference detection, and graceful error reporting ([d2f5f98](https://github.com/OrigoStudio/origo-design/commit/d2f5f98))
|
|
240
|
+
- initialize 3-5-3-defensive-ast-traversal story and update sprint status ([4f82702](https://github.com/OrigoStudio/origo-design/commit/4f82702))
|
|
241
|
+
- enforce JSON import standard and document AST validator ([162db09](https://github.com/OrigoStudio/origo-design/commit/162db09))
|
|
242
|
+
- implement automated semantic versioning with Nx release and commitlint enforcement ([5e7a25e](https://github.com/OrigoStudio/origo-design/commit/5e7a25e))
|
|
243
|
+
- implement AST validation engine and documentation for semantic versioning workflow ([838e472](https://github.com/OrigoStudio/origo-design/commit/838e472))
|
|
244
|
+
- implement AST validation engine and associated implementation artifacts ([49cbdf0](https://github.com/OrigoStudio/origo-design/commit/49cbdf0))
|
|
245
|
+
- implement deterministic canonical AST serialization and interfaces in @origo/core ([c35a2c9](https://github.com/OrigoStudio/origo-design/commit/c35a2c9))
|
|
246
|
+
- implement domain and entity schema parser with Ajv-based validation and circular dependency detection in new @origo/core package ([4165b5f](https://github.com/OrigoStudio/origo-design/commit/4165b5f))
|
|
247
|
+
- add design tokens documentation and update Starlight navigation configuration ([ba2404a](https://github.com/OrigoStudio/origo-design/commit/ba2404a))
|
|
248
|
+
- initialize Epic 3 planning and document Epic 2 retrospective findings ([4cc46f9](https://github.com/OrigoStudio/origo-design/commit/4cc46f9))
|
|
249
|
+
- implement runtime theme fetching, injection, and Angular renderer integration to complete the token resolution contract ([87f583e](https://github.com/OrigoStudio/origo-design/commit/87f583e))
|
|
250
|
+
- implement theme-fetcher runtime utility and create angular-renderer package with theme initialization provider ([1d5b7ab](https://github.com/OrigoStudio/origo-design/commit/1d5b7ab))
|
|
251
|
+
- implement secure theme injection with CSS token validation and scope management ([a708825](https://github.com/OrigoStudio/origo-design/commit/a708825))
|
|
252
|
+
- implement runtime theme injector for parsing and applying CSS variables ([969fed5](https://github.com/OrigoStudio/origo-design/commit/969fed5))
|
|
253
|
+
- add astro, @astrojs/starlight, and sharp dependencies to package.json ([1c40a92](https://github.com/OrigoStudio/origo-design/commit/1c40a92))
|
|
254
|
+
- implement design token compilation pipeline with CSS variable parsing and generation ([0ffe822](https://github.com/OrigoStudio/origo-design/commit/0ffe822))
|
|
255
|
+
- **nx-cloud:** setup nx cloud workspace ([ee09042](https://github.com/OrigoStudio/origo-design/commit/ee09042))
|
|
256
|
+
- **design-tokens:** implement css compilation pipeline ([7bd632d](https://github.com/OrigoStudio/origo-design/commit/7bd632d))
|
|
257
|
+
- add script to generate automated LLM review prompts from git diffs ([1ddbd39](https://github.com/OrigoStudio/origo-design/commit/1ddbd39))
|
|
258
|
+
- scaffold @origo/design-tokens package with JSON schema validation and Nx configuration ([ae61244](https://github.com/OrigoStudio/origo-design/commit/ae61244))
|
|
259
|
+
- scaffold @origo/design-tokens library with JSON schema validation and initial token definitions ([efbecc9](https://github.com/OrigoStudio/origo-design/commit/efbecc9))
|
|
260
|
+
- initialize Astro documentation site and relocate internal project scripts to the tools directory. ([1cd8e71](https://github.com/OrigoStudio/origo-design/commit/1cd8e71))
|
|
261
|
+
- add documentation story spec and update epic-1 status to done ([b612ea3](https://github.com/OrigoStudio/origo-design/commit/b612ea3))
|
|
262
|
+
- initialize and populate agent skill definitions, workflows, and technical knowledge resources ([8668c52](https://github.com/OrigoStudio/origo-design/commit/8668c52))
|
|
263
|
+
- initialize Starlight documentation site within the monorepo and add benchmark tools ([9a16b03](https://github.com/OrigoStudio/origo-design/commit/9a16b03))
|
|
264
|
+
- implement performance benchmark harness with regression and SLA gate logic ([350d472](https://github.com/OrigoStudio/origo-design/commit/350d472))
|
|
265
|
+
- implement performance benchmark harness with CI regression gating and SLA validation ([3230ac9](https://github.com/OrigoStudio/origo-design/commit/3230ac9))
|
|
266
|
+
- implement Husky pre-commit hooks and Nx-based lint-staged configuration ([9181885](https://github.com/OrigoStudio/origo-design/commit/9181885))
|
|
267
|
+
- add GitHub Actions CI workflow, Husky pre-commit hooks, and update package.json with necessary configuration ([95b8bf1](https://github.com/OrigoStudio/origo-design/commit/95b8bf1))
|
|
268
|
+
- configure Husky, lint-staged, and GitHub CI workflow for automated quality enforcement ([b6bf597](https://github.com/OrigoStudio/origo-design/commit/b6bf597))
|
|
269
|
+
- initialize Nx monorepo workspace with core configuration and tooling ([fd0665a](https://github.com/OrigoStudio/origo-design/commit/fd0665a))
|
|
270
|
+
- add sprint tracking artifacts and automation script for project bootstrapping ([ddc6149](https://github.com/OrigoStudio/origo-design/commit/ddc6149))
|
|
271
|
+
- document Origo Design functional requirements and architectural scope ([d1e0b7f](https://github.com/OrigoStudio/origo-design/commit/d1e0b7f))
|
|
272
|
+
|
|
273
|
+
### ❤️ Thank You
|
|
274
|
+
|
|
275
|
+
- Hardik Patel @hardikpatelse
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@origo/core",
|
|
3
|
+
"version": "0.0.22",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"ajv": "^8.17.1",
|
|
10
|
+
"ajv-errors": "^3.0.0",
|
|
11
|
+
"ajv-formats": "^3.0.1",
|
|
12
|
+
"json-schema-to-typescript": "^14.1.0",
|
|
13
|
+
"json-source-map": "^0.6.1",
|
|
14
|
+
"semver": "^7.7.4",
|
|
15
|
+
"tslib": "^2.3.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/json-source-map": "^0.6.0",
|
|
19
|
+
"@types/semver": "^7.8.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@origo/core",
|
|
3
|
+
"version": "0.0.22",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"ajv": "^8.17.1",
|
|
10
|
+
"ajv-errors": "^3.0.0",
|
|
11
|
+
"ajv-formats": "^3.0.1",
|
|
12
|
+
"json-schema-to-typescript": "^14.1.0",
|
|
13
|
+
"json-source-map": "^0.6.1",
|
|
14
|
+
"semver": "^7.7.4",
|
|
15
|
+
"tslib": "^2.3.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/json-source-map": "^0.6.0",
|
|
19
|
+
"@types/semver": "^7.8.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ExtensionManifest, ExtensionLifecycle, CorePermission, ExtensionContext } from './types';
|
|
2
|
+
export declare class ExtensionError extends Error {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
constructor(message: string, code: string);
|
|
5
|
+
}
|
|
6
|
+
export declare enum ExtensionState {
|
|
7
|
+
REGISTERED = "REGISTERED",
|
|
8
|
+
INITIALIZED = "INITIALIZED",
|
|
9
|
+
CONFIGURED = "CONFIGURED",
|
|
10
|
+
VALIDATED = "VALIDATED",
|
|
11
|
+
ACTIVATED = "ACTIVATED"
|
|
12
|
+
}
|
|
13
|
+
export declare class ExtensionManager {
|
|
14
|
+
private extensions;
|
|
15
|
+
private capabilities;
|
|
16
|
+
private grantedPermissions;
|
|
17
|
+
registerExtension(manifest: ExtensionManifest, lifecycle: ExtensionLifecycle): void;
|
|
18
|
+
registerCapability(capability: string): void;
|
|
19
|
+
private validateManifest;
|
|
20
|
+
private negotiateCapabilities;
|
|
21
|
+
grantPermission(id: string, permission: CorePermission): void;
|
|
22
|
+
getDeclaredPermissions(id: string): CorePermission[];
|
|
23
|
+
getGrantedPermissions(id: string): CorePermission[];
|
|
24
|
+
hasPermission(id: string, permission: CorePermission): boolean;
|
|
25
|
+
checkPermission(id: string, permission: CorePermission): void;
|
|
26
|
+
private createSandboxContext;
|
|
27
|
+
private enforcePermissionsBeforeExecution;
|
|
28
|
+
resolveDependencyGraph(): string[];
|
|
29
|
+
initializeExtension(id: string, context?: ExtensionContext): Promise<void>;
|
|
30
|
+
configureExtension(id: string, config?: unknown): Promise<void>;
|
|
31
|
+
validateExtension(id: string): Promise<void>;
|
|
32
|
+
activateExtension(id: string): Promise<void>;
|
|
33
|
+
loadAll(context?: ExtensionContext, config?: unknown): Promise<void>;
|
|
34
|
+
getExtensionState(id: string): ExtensionState | undefined;
|
|
35
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtensionManager = exports.ExtensionState = exports.ExtensionError = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
6
|
+
const semver = tslib_1.__importStar(require("semver"));
|
|
7
|
+
class ExtensionError extends Error {
|
|
8
|
+
code;
|
|
9
|
+
constructor(message, code) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.code = code;
|
|
12
|
+
this.name = 'ExtensionError';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ExtensionError = ExtensionError;
|
|
16
|
+
var ExtensionState;
|
|
17
|
+
(function (ExtensionState) {
|
|
18
|
+
ExtensionState["REGISTERED"] = "REGISTERED";
|
|
19
|
+
ExtensionState["INITIALIZED"] = "INITIALIZED";
|
|
20
|
+
ExtensionState["CONFIGURED"] = "CONFIGURED";
|
|
21
|
+
ExtensionState["VALIDATED"] = "VALIDATED";
|
|
22
|
+
ExtensionState["ACTIVATED"] = "ACTIVATED";
|
|
23
|
+
})(ExtensionState || (exports.ExtensionState = ExtensionState = {}));
|
|
24
|
+
class ExtensionManager {
|
|
25
|
+
extensions = new Map();
|
|
26
|
+
capabilities = new Set();
|
|
27
|
+
grantedPermissions = new Map();
|
|
28
|
+
registerExtension(manifest, lifecycle) {
|
|
29
|
+
if (!manifest)
|
|
30
|
+
throw new ExtensionError('Manifest is required', 'INVALID_MANIFEST');
|
|
31
|
+
if (!lifecycle)
|
|
32
|
+
throw new ExtensionError('Lifecycle is required', 'INVALID_LIFECYCLE');
|
|
33
|
+
if (this.extensions.has(manifest.id)) {
|
|
34
|
+
throw new ExtensionError(`Extension already registered: ${manifest.id}`, 'DUPLICATE_EXTENSION');
|
|
35
|
+
}
|
|
36
|
+
this.validateManifest(manifest);
|
|
37
|
+
this.grantedPermissions.set(manifest.id, new Set());
|
|
38
|
+
this.extensions.set(manifest.id, { manifest, lifecycle, state: ExtensionState.REGISTERED });
|
|
39
|
+
}
|
|
40
|
+
registerCapability(capability) {
|
|
41
|
+
if (!/^[a-z0-9-]+:[a-z0-9-]+$/i.test(capability)) {
|
|
42
|
+
throw new ExtensionError(`Invalid capability format: ${capability}. Must be namespace:name`, 'INVALID_CAPABILITY_NAMESPACE');
|
|
43
|
+
}
|
|
44
|
+
this.capabilities.add(capability);
|
|
45
|
+
}
|
|
46
|
+
validateManifest(manifest) {
|
|
47
|
+
if (!manifest.id || !manifest.name || !manifest.version || !manifest.type) {
|
|
48
|
+
throw new ExtensionError('Invalid manifest: missing required fields', 'INVALID_MANIFEST');
|
|
49
|
+
}
|
|
50
|
+
if (!semver.valid(manifest.version)) {
|
|
51
|
+
throw new ExtensionError(`Invalid semver version: ${manifest.version}`, 'INVALID_VERSION');
|
|
52
|
+
}
|
|
53
|
+
if (manifest.grammarRanges) {
|
|
54
|
+
if (typeof manifest.grammarRanges !== 'object' || Array.isArray(manifest.grammarRanges)) {
|
|
55
|
+
throw new ExtensionError('grammarRanges must be an object', 'INVALID_MANIFEST');
|
|
56
|
+
}
|
|
57
|
+
for (const [key, range] of Object.entries(manifest.grammarRanges)) {
|
|
58
|
+
if (typeof range !== 'string' || !semver.validRange(range)) {
|
|
59
|
+
throw new ExtensionError(`Invalid semver range for grammar ${key}: ${range}`, 'INVALID_GRAMMAR_RANGE');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (manifest.apiRanges) {
|
|
64
|
+
if (typeof manifest.apiRanges !== 'object' || Array.isArray(manifest.apiRanges)) {
|
|
65
|
+
throw new ExtensionError('apiRanges must be an object', 'INVALID_MANIFEST');
|
|
66
|
+
}
|
|
67
|
+
for (const [key, range] of Object.entries(manifest.apiRanges)) {
|
|
68
|
+
if (typeof range !== 'string' || !semver.validRange(range)) {
|
|
69
|
+
throw new ExtensionError(`Invalid semver range for API ${key}: ${range}`, 'INVALID_API_RANGE');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (manifest.dependencies) {
|
|
74
|
+
if (typeof manifest.dependencies !== 'object' || Array.isArray(manifest.dependencies)) {
|
|
75
|
+
throw new ExtensionError('dependencies must be an object', 'INVALID_MANIFEST');
|
|
76
|
+
}
|
|
77
|
+
for (const [key, range] of Object.entries(manifest.dependencies)) {
|
|
78
|
+
if (typeof range !== 'string' || !semver.validRange(range)) {
|
|
79
|
+
throw new ExtensionError(`Invalid dependency range for ${key}: ${range}`, 'INVALID_DEPENDENCY_RANGE');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (manifest.permissions !== undefined) {
|
|
84
|
+
if (!Array.isArray(manifest.permissions) ||
|
|
85
|
+
manifest.permissions.some(p => typeof p !== 'string' || !p.trim())) {
|
|
86
|
+
throw new ExtensionError('permissions must be an array of non-empty strings', 'INVALID_MANIFEST');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
negotiateCapabilities(manifest) {
|
|
91
|
+
if (manifest.capabilities) {
|
|
92
|
+
if (!Array.isArray(manifest.capabilities)) {
|
|
93
|
+
throw new ExtensionError('Capabilities must be an array', 'INVALID_MANIFEST');
|
|
94
|
+
}
|
|
95
|
+
for (const cap of manifest.capabilities) {
|
|
96
|
+
if (!this.capabilities.has(cap)) {
|
|
97
|
+
throw new ExtensionError(`Missing required capability: ${cap}`, 'MISSING_CAPABILITY');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
grantPermission(id, permission) {
|
|
103
|
+
const ext = this.extensions.get(id);
|
|
104
|
+
if (!ext)
|
|
105
|
+
throw new ExtensionError(`Extension not found: ${id}`, 'NOT_FOUND');
|
|
106
|
+
if (ext.state !== ExtensionState.REGISTERED) {
|
|
107
|
+
throw new ExtensionError(`Cannot grant permissions after extension initialization (current state: ${ext.state})`, 'INVALID_LIFECYCLE');
|
|
108
|
+
}
|
|
109
|
+
const declaredPermissions = ext.manifest.permissions || [];
|
|
110
|
+
if (!declaredPermissions.includes(permission)) {
|
|
111
|
+
throw new ExtensionError(`Permission not declared in manifest: ${permission}`, 'UNDECLARED_PERMISSION');
|
|
112
|
+
}
|
|
113
|
+
const granted = this.grantedPermissions.get(id);
|
|
114
|
+
granted.add(permission);
|
|
115
|
+
}
|
|
116
|
+
getDeclaredPermissions(id) {
|
|
117
|
+
const ext = this.extensions.get(id);
|
|
118
|
+
if (!ext)
|
|
119
|
+
throw new ExtensionError(`Extension not found: ${id}`, 'NOT_FOUND');
|
|
120
|
+
return ext.manifest.permissions || [];
|
|
121
|
+
}
|
|
122
|
+
getGrantedPermissions(id) {
|
|
123
|
+
const ext = this.extensions.get(id);
|
|
124
|
+
if (!ext)
|
|
125
|
+
throw new ExtensionError(`Extension not found: ${id}`, 'NOT_FOUND');
|
|
126
|
+
return Array.from(this.grantedPermissions.get(id));
|
|
127
|
+
}
|
|
128
|
+
hasPermission(id, permission) {
|
|
129
|
+
const ext = this.extensions.get(id);
|
|
130
|
+
if (!ext)
|
|
131
|
+
throw new ExtensionError(`Extension not found: ${id}`, 'NOT_FOUND');
|
|
132
|
+
return this.grantedPermissions.get(id).has(permission);
|
|
133
|
+
}
|
|
134
|
+
checkPermission(id, permission) {
|
|
135
|
+
if (!this.hasPermission(id, permission)) {
|
|
136
|
+
throw new ExtensionError(`Unauthorized access: Missing permission ${permission}`, 'UNAUTHORIZED_ACCESS');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
createSandboxContext(id, baseContext) {
|
|
140
|
+
const context = baseContext || {};
|
|
141
|
+
return {
|
|
142
|
+
getEnv: context.getEnv
|
|
143
|
+
? (key) => {
|
|
144
|
+
this.checkPermission(id, 'env:read');
|
|
145
|
+
return context.getEnv(key);
|
|
146
|
+
}
|
|
147
|
+
: undefined,
|
|
148
|
+
fetch: context.fetch
|
|
149
|
+
? ((...args) => {
|
|
150
|
+
this.checkPermission(id, 'network:fetch');
|
|
151
|
+
return context.fetch(...args);
|
|
152
|
+
})
|
|
153
|
+
: undefined,
|
|
154
|
+
readFile: context.readFile
|
|
155
|
+
? (path) => {
|
|
156
|
+
this.checkPermission(id, 'fs:read');
|
|
157
|
+
return context.readFile(path);
|
|
158
|
+
}
|
|
159
|
+
: undefined,
|
|
160
|
+
writeFile: context.writeFile
|
|
161
|
+
? (path, data) => {
|
|
162
|
+
this.checkPermission(id, 'fs:write');
|
|
163
|
+
return context.writeFile(path, data);
|
|
164
|
+
}
|
|
165
|
+
: undefined,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
enforcePermissionsBeforeExecution(manifest) {
|
|
169
|
+
const id = manifest.id;
|
|
170
|
+
const declared = manifest.permissions || [];
|
|
171
|
+
const granted = this.grantedPermissions.get(id);
|
|
172
|
+
for (const perm of declared) {
|
|
173
|
+
if (!granted.has(perm)) {
|
|
174
|
+
throw new ExtensionError(`Cannot execute extension ${id}: Missing required permission ${perm}`, 'UNAUTHORIZED_ACCESS');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
resolveDependencyGraph() {
|
|
179
|
+
const adjList = new Map();
|
|
180
|
+
for (const [id, { manifest }] of this.extensions.entries()) {
|
|
181
|
+
const deps = manifest.dependencies ? Object.keys(manifest.dependencies) : [];
|
|
182
|
+
for (const [depId, range] of Object.entries(manifest.dependencies || {})) {
|
|
183
|
+
const target = this.extensions.get(depId);
|
|
184
|
+
if (!target) {
|
|
185
|
+
throw new ExtensionError(`Missing required dependency: ${depId}`, 'MISSING_DEPENDENCY');
|
|
186
|
+
}
|
|
187
|
+
if (!semver.satisfies(target.manifest.version, range)) {
|
|
188
|
+
throw new ExtensionError(`Dependency version mismatch for ${depId}. Expected ${range}, got ${target.manifest.version}`, 'DEPENDENCY_VERSION_MISMATCH');
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
adjList.set(id, deps);
|
|
192
|
+
}
|
|
193
|
+
const visited = new Set();
|
|
194
|
+
const visiting = new Set();
|
|
195
|
+
const sorted = [];
|
|
196
|
+
const dfs = (node, path) => {
|
|
197
|
+
if (visiting.has(node)) {
|
|
198
|
+
const cycleStartIndex = path.indexOf(node);
|
|
199
|
+
const loop = cycleStartIndex >= 0 ? path.slice(cycleStartIndex) : path;
|
|
200
|
+
const cyclePath = [...loop, node].join(' -> ');
|
|
201
|
+
throw new ExtensionError(`Cyclic dependency detected: ${cyclePath}`, 'CYCLIC_DEPENDENCY');
|
|
202
|
+
}
|
|
203
|
+
if (visited.has(node))
|
|
204
|
+
return;
|
|
205
|
+
visiting.add(node);
|
|
206
|
+
path.push(node);
|
|
207
|
+
const deps = adjList.get(node) || [];
|
|
208
|
+
for (const dep of deps) {
|
|
209
|
+
dfs(dep, path);
|
|
210
|
+
}
|
|
211
|
+
path.pop();
|
|
212
|
+
visiting.delete(node);
|
|
213
|
+
visited.add(node);
|
|
214
|
+
sorted.push(node); // post-order (dependencies added before the node that depends on them)
|
|
215
|
+
};
|
|
216
|
+
for (const id of this.extensions.keys()) {
|
|
217
|
+
if (!visited.has(id)) {
|
|
218
|
+
dfs(id, []);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return sorted;
|
|
222
|
+
}
|
|
223
|
+
async initializeExtension(id, context) {
|
|
224
|
+
const ext = this.extensions.get(id);
|
|
225
|
+
if (!ext)
|
|
226
|
+
throw new ExtensionError(`Extension not found: ${id}`, 'NOT_FOUND');
|
|
227
|
+
if (ext.state !== ExtensionState.REGISTERED) {
|
|
228
|
+
throw new ExtensionError(`Cannot initialize extension in state ${ext.state}`, 'INVALID_LIFECYCLE');
|
|
229
|
+
}
|
|
230
|
+
this.enforcePermissionsBeforeExecution(ext.manifest);
|
|
231
|
+
this.negotiateCapabilities(ext.manifest);
|
|
232
|
+
const sandboxedContext = this.createSandboxContext(id, context);
|
|
233
|
+
await ext.lifecycle.initialize(sandboxedContext);
|
|
234
|
+
ext.state = ExtensionState.INITIALIZED;
|
|
235
|
+
}
|
|
236
|
+
async configureExtension(id, config) {
|
|
237
|
+
const ext = this.extensions.get(id);
|
|
238
|
+
if (!ext)
|
|
239
|
+
throw new ExtensionError(`Extension not found: ${id}`, 'NOT_FOUND');
|
|
240
|
+
if (ext.state !== ExtensionState.INITIALIZED) {
|
|
241
|
+
throw new ExtensionError(`Cannot configure extension in state ${ext.state}`, 'INVALID_LIFECYCLE');
|
|
242
|
+
}
|
|
243
|
+
this.enforcePermissionsBeforeExecution(ext.manifest);
|
|
244
|
+
await ext.lifecycle.configure(config);
|
|
245
|
+
ext.state = ExtensionState.CONFIGURED;
|
|
246
|
+
}
|
|
247
|
+
async validateExtension(id) {
|
|
248
|
+
const ext = this.extensions.get(id);
|
|
249
|
+
if (!ext)
|
|
250
|
+
throw new ExtensionError(`Extension not found: ${id}`, 'NOT_FOUND');
|
|
251
|
+
if (ext.state !== ExtensionState.CONFIGURED) {
|
|
252
|
+
throw new ExtensionError(`Cannot validate extension in state ${ext.state}`, 'INVALID_LIFECYCLE');
|
|
253
|
+
}
|
|
254
|
+
this.enforcePermissionsBeforeExecution(ext.manifest);
|
|
255
|
+
const isValid = await ext.lifecycle.validate();
|
|
256
|
+
if (!isValid) {
|
|
257
|
+
throw new ExtensionError(`Extension failed validation: ${id}`, 'VALIDATION_FAILED');
|
|
258
|
+
}
|
|
259
|
+
ext.state = ExtensionState.VALIDATED;
|
|
260
|
+
}
|
|
261
|
+
async activateExtension(id) {
|
|
262
|
+
const ext = this.extensions.get(id);
|
|
263
|
+
if (!ext)
|
|
264
|
+
throw new ExtensionError(`Extension not found: ${id}`, 'NOT_FOUND');
|
|
265
|
+
if (ext.state !== ExtensionState.VALIDATED) {
|
|
266
|
+
throw new ExtensionError(`Cannot activate extension in state ${ext.state}`, 'INVALID_LIFECYCLE');
|
|
267
|
+
}
|
|
268
|
+
this.enforcePermissionsBeforeExecution(ext.manifest);
|
|
269
|
+
await ext.lifecycle.activate();
|
|
270
|
+
ext.state = ExtensionState.ACTIVATED;
|
|
271
|
+
}
|
|
272
|
+
async loadAll(context, config) {
|
|
273
|
+
const sortedIds = this.resolveDependencyGraph();
|
|
274
|
+
for (const id of sortedIds) {
|
|
275
|
+
if (this.getExtensionState(id) === ExtensionState.REGISTERED) {
|
|
276
|
+
await this.initializeExtension(id, context);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
for (const id of sortedIds) {
|
|
280
|
+
if (this.getExtensionState(id) === ExtensionState.INITIALIZED) {
|
|
281
|
+
await this.configureExtension(id, config);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
for (const id of sortedIds) {
|
|
285
|
+
if (this.getExtensionState(id) === ExtensionState.CONFIGURED) {
|
|
286
|
+
await this.validateExtension(id);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
for (const id of sortedIds) {
|
|
290
|
+
if (this.getExtensionState(id) === ExtensionState.VALIDATED) {
|
|
291
|
+
await this.activateExtension(id);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
getExtensionState(id) {
|
|
296
|
+
return this.extensions.get(id)?.state;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
exports.ExtensionManager = ExtensionManager;
|
|
300
|
+
//# sourceMappingURL=extension-manager.js.map
|