@enactprotocol/shared 1.2.13 → 2.0.1

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 (207) hide show
  1. package/README.md +44 -0
  2. package/dist/config.d.ts +164 -0
  3. package/dist/config.d.ts.map +1 -0
  4. package/dist/config.js +386 -0
  5. package/dist/config.js.map +1 -0
  6. package/dist/constants.d.ts +15 -5
  7. package/dist/constants.d.ts.map +1 -0
  8. package/dist/constants.js +24 -8
  9. package/dist/constants.js.map +1 -0
  10. package/dist/execution/command.d.ts +102 -0
  11. package/dist/execution/command.d.ts.map +1 -0
  12. package/dist/execution/command.js +262 -0
  13. package/dist/execution/command.js.map +1 -0
  14. package/dist/execution/index.d.ts +12 -0
  15. package/dist/execution/index.d.ts.map +1 -0
  16. package/dist/execution/index.js +17 -0
  17. package/dist/execution/index.js.map +1 -0
  18. package/dist/execution/runtime.d.ts +82 -0
  19. package/dist/execution/runtime.d.ts.map +1 -0
  20. package/dist/execution/runtime.js +273 -0
  21. package/dist/execution/runtime.js.map +1 -0
  22. package/dist/execution/types.d.ts +306 -0
  23. package/dist/execution/types.d.ts.map +1 -0
  24. package/dist/execution/types.js +14 -0
  25. package/dist/execution/types.js.map +1 -0
  26. package/dist/execution/validation.d.ts +43 -0
  27. package/dist/execution/validation.d.ts.map +1 -0
  28. package/dist/execution/validation.js +430 -0
  29. package/dist/execution/validation.js.map +1 -0
  30. package/dist/index.d.ts +21 -21
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +49 -25
  33. package/dist/index.js.map +1 -0
  34. package/dist/manifest/index.d.ts +7 -0
  35. package/dist/manifest/index.d.ts.map +1 -0
  36. package/dist/manifest/index.js +10 -0
  37. package/dist/manifest/index.js.map +1 -0
  38. package/dist/manifest/loader.d.ts +76 -0
  39. package/dist/manifest/loader.d.ts.map +1 -0
  40. package/dist/manifest/loader.js +146 -0
  41. package/dist/manifest/loader.js.map +1 -0
  42. package/dist/manifest/parser.d.ts +64 -0
  43. package/dist/manifest/parser.d.ts.map +1 -0
  44. package/dist/manifest/parser.js +135 -0
  45. package/dist/manifest/parser.js.map +1 -0
  46. package/dist/manifest/validator.d.ts +95 -0
  47. package/dist/manifest/validator.d.ts.map +1 -0
  48. package/dist/manifest/validator.js +258 -0
  49. package/dist/manifest/validator.js.map +1 -0
  50. package/dist/paths.d.ts +57 -0
  51. package/dist/paths.d.ts.map +1 -0
  52. package/dist/paths.js +93 -0
  53. package/dist/paths.js.map +1 -0
  54. package/dist/registry.d.ts +73 -0
  55. package/dist/registry.d.ts.map +1 -0
  56. package/dist/registry.js +147 -0
  57. package/dist/registry.js.map +1 -0
  58. package/dist/resolver.d.ts +89 -0
  59. package/dist/resolver.d.ts.map +1 -0
  60. package/dist/resolver.js +282 -0
  61. package/dist/resolver.js.map +1 -0
  62. package/dist/types/index.d.ts +6 -0
  63. package/dist/types/index.d.ts.map +1 -0
  64. package/dist/types/index.js +5 -0
  65. package/dist/types/index.js.map +1 -0
  66. package/dist/types/manifest.d.ts +201 -0
  67. package/dist/types/manifest.d.ts.map +1 -0
  68. package/dist/types/manifest.js +13 -0
  69. package/dist/types/manifest.js.map +1 -0
  70. package/dist/types.d.ts +5 -132
  71. package/dist/types.d.ts.map +1 -0
  72. package/dist/types.js +5 -3
  73. package/dist/types.js.map +1 -0
  74. package/dist/utils/fs.d.ts +105 -0
  75. package/dist/utils/fs.d.ts.map +1 -0
  76. package/dist/utils/fs.js +233 -0
  77. package/dist/utils/fs.js.map +1 -0
  78. package/dist/utils/logger.d.ts +102 -25
  79. package/dist/utils/logger.d.ts.map +1 -0
  80. package/dist/utils/logger.js +214 -57
  81. package/dist/utils/logger.js.map +1 -0
  82. package/dist/utils/version.d.ts +60 -2
  83. package/dist/utils/version.d.ts.map +1 -0
  84. package/dist/utils/version.js +255 -31
  85. package/dist/utils/version.js.map +1 -0
  86. package/package.json +16 -58
  87. package/src/config.ts +510 -0
  88. package/src/constants.ts +36 -0
  89. package/src/execution/command.ts +314 -0
  90. package/src/execution/index.ts +73 -0
  91. package/src/execution/runtime.ts +308 -0
  92. package/src/execution/types.ts +379 -0
  93. package/src/execution/validation.ts +508 -0
  94. package/src/index.ts +238 -30
  95. package/src/manifest/index.ts +36 -0
  96. package/src/manifest/loader.ts +187 -0
  97. package/src/manifest/parser.ts +173 -0
  98. package/src/manifest/validator.ts +309 -0
  99. package/src/paths.ts +108 -0
  100. package/src/registry.ts +219 -0
  101. package/src/resolver.ts +345 -0
  102. package/src/types/index.ts +30 -0
  103. package/src/types/manifest.ts +255 -0
  104. package/src/types.ts +5 -188
  105. package/src/utils/fs.ts +281 -0
  106. package/src/utils/logger.ts +270 -59
  107. package/src/utils/version.ts +304 -36
  108. package/tests/config.test.ts +515 -0
  109. package/tests/execution/command.test.ts +317 -0
  110. package/tests/execution/validation.test.ts +384 -0
  111. package/tests/fixtures/invalid-tool.yaml +4 -0
  112. package/tests/fixtures/valid-tool.md +62 -0
  113. package/tests/fixtures/valid-tool.yaml +40 -0
  114. package/tests/index.test.ts +8 -0
  115. package/tests/manifest/loader.test.ts +291 -0
  116. package/tests/manifest/parser.test.ts +345 -0
  117. package/tests/manifest/validator.test.ts +394 -0
  118. package/tests/manifest-types.test.ts +358 -0
  119. package/tests/paths.test.ts +153 -0
  120. package/tests/registry.test.ts +231 -0
  121. package/tests/resolver.test.ts +272 -0
  122. package/tests/utils/fs.test.ts +388 -0
  123. package/tests/utils/logger.test.ts +480 -0
  124. package/tests/utils/version.test.ts +390 -0
  125. package/tsconfig.json +12 -0
  126. package/dist/LocalToolResolver.d.ts +0 -84
  127. package/dist/LocalToolResolver.js +0 -353
  128. package/dist/api/enact-api.d.ts +0 -130
  129. package/dist/api/enact-api.js +0 -428
  130. package/dist/api/index.d.ts +0 -2
  131. package/dist/api/index.js +0 -2
  132. package/dist/api/types.d.ts +0 -103
  133. package/dist/api/types.js +0 -1
  134. package/dist/core/DaggerExecutionProvider.d.ts +0 -169
  135. package/dist/core/DaggerExecutionProvider.js +0 -1029
  136. package/dist/core/DirectExecutionProvider.d.ts +0 -23
  137. package/dist/core/DirectExecutionProvider.js +0 -406
  138. package/dist/core/EnactCore.d.ts +0 -162
  139. package/dist/core/EnactCore.js +0 -597
  140. package/dist/core/NativeExecutionProvider.d.ts +0 -9
  141. package/dist/core/NativeExecutionProvider.js +0 -16
  142. package/dist/core/index.d.ts +0 -3
  143. package/dist/core/index.js +0 -3
  144. package/dist/exec/index.d.ts +0 -3
  145. package/dist/exec/index.js +0 -3
  146. package/dist/exec/logger.d.ts +0 -11
  147. package/dist/exec/logger.js +0 -57
  148. package/dist/exec/validate.d.ts +0 -5
  149. package/dist/exec/validate.js +0 -167
  150. package/dist/lib/enact-direct.d.ts +0 -150
  151. package/dist/lib/enact-direct.js +0 -159
  152. package/dist/lib/index.d.ts +0 -1
  153. package/dist/lib/index.js +0 -1
  154. package/dist/security/index.d.ts +0 -3
  155. package/dist/security/index.js +0 -3
  156. package/dist/security/security.d.ts +0 -23
  157. package/dist/security/security.js +0 -137
  158. package/dist/security/sign.d.ts +0 -103
  159. package/dist/security/sign.js +0 -666
  160. package/dist/security/verification-enforcer.d.ts +0 -53
  161. package/dist/security/verification-enforcer.js +0 -204
  162. package/dist/services/McpCoreService.d.ts +0 -98
  163. package/dist/services/McpCoreService.js +0 -124
  164. package/dist/services/index.d.ts +0 -1
  165. package/dist/services/index.js +0 -1
  166. package/dist/utils/config.d.ts +0 -111
  167. package/dist/utils/config.js +0 -342
  168. package/dist/utils/env-loader.d.ts +0 -54
  169. package/dist/utils/env-loader.js +0 -270
  170. package/dist/utils/help.d.ts +0 -36
  171. package/dist/utils/help.js +0 -248
  172. package/dist/utils/index.d.ts +0 -7
  173. package/dist/utils/index.js +0 -7
  174. package/dist/utils/silent-monitor.d.ts +0 -67
  175. package/dist/utils/silent-monitor.js +0 -242
  176. package/dist/utils/timeout.d.ts +0 -5
  177. package/dist/utils/timeout.js +0 -23
  178. package/dist/web/env-manager-server.d.ts +0 -29
  179. package/dist/web/env-manager-server.js +0 -367
  180. package/dist/web/index.d.ts +0 -1
  181. package/dist/web/index.js +0 -1
  182. package/src/LocalToolResolver.ts +0 -424
  183. package/src/api/enact-api.ts +0 -604
  184. package/src/api/index.ts +0 -2
  185. package/src/api/types.ts +0 -114
  186. package/src/core/DaggerExecutionProvider.ts +0 -1357
  187. package/src/core/DirectExecutionProvider.ts +0 -484
  188. package/src/core/EnactCore.ts +0 -847
  189. package/src/core/index.ts +0 -3
  190. package/src/exec/index.ts +0 -3
  191. package/src/exec/logger.ts +0 -63
  192. package/src/exec/validate.ts +0 -238
  193. package/src/lib/enact-direct.ts +0 -254
  194. package/src/lib/index.ts +0 -1
  195. package/src/services/McpCoreService.ts +0 -201
  196. package/src/services/index.ts +0 -1
  197. package/src/utils/config.ts +0 -438
  198. package/src/utils/env-loader.ts +0 -370
  199. package/src/utils/help.ts +0 -257
  200. package/src/utils/index.ts +0 -7
  201. package/src/utils/silent-monitor.ts +0 -328
  202. package/src/utils/timeout.ts +0 -26
  203. package/src/web/env-manager-server.ts +0 -465
  204. package/src/web/index.ts +0 -1
  205. package/src/web/static/app.js +0 -663
  206. package/src/web/static/index.html +0 -117
  207. package/src/web/static/style.css +0 -291
@@ -1,117 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Enact Environment Manager</title>
7
- <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🌐</text></svg>">
8
- <link rel="stylesheet" href="/style.css">
9
- </head>
10
- <body>
11
- <header>
12
- <h1>Enact Environment Manager</h1>
13
- <p class="subtitle">Manage environment variables by package namespace (~/.enact/env/)</p>
14
- </header>
15
-
16
- <div id="notification" class="notification"></div>
17
-
18
- <!-- Bulk Variables Modal -->
19
- <div id="bulk-modal" class="modal">
20
- <div class="modal-content">
21
- <div class="modal-header">
22
- <h2>Add Multiple Environment Variables</h2>
23
- <span class="close-modal" id="close-modal">&times;</span>
24
- </div>
25
-
26
- <form id="bulk-form" class="modal-form">
27
- <div id="bulk-variables-container">
28
- <!-- Dynamically populated fields will go here -->
29
- </div>
30
-
31
- <div class="modal-actions">
32
- <button type="button" id="cancel-bulk">Cancel</button>
33
- <button type="submit" id="save-bulk">Save All</button>
34
- </div>
35
- </form>
36
- </div>
37
- </div>
38
-
39
- <div class="path-display">
40
- Environment Directory: <span id="env-path">~/.enact/env/</span>
41
- </div>
42
-
43
- <div class="packages-container">
44
- <div class="package-list">
45
- <h2>Package Namespaces</h2>
46
- <div id="package-list-content">
47
- <div class="loading">Loading packages...</div>
48
- </div>
49
-
50
- <div class="new-package-form">
51
- <h3>Create New Package</h3>
52
- <div class="form-group">
53
- <label for="new-package-namespace">Package Namespace</label>
54
- <input type="text" id="new-package-namespace" placeholder="e.g., org/package/subpackage">
55
- </div>
56
- <button id="create-package-btn">Create Package</button>
57
- </div>
58
-
59
- <div class="new-package-form">
60
- <h3>Generate Configuration Link</h3>
61
- <p>Create a shareable link with multiple configuration variables to be filled in. The recipient can either select an existing package or create a new one.</p>
62
-
63
- <div class="form-group">
64
- <label for="vars-input">Variable Keys (one per line or comma-separated)</label>
65
- <textarea id="vars-input" style="width: 100%; height: 80px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; resize: vertical;" placeholder="API_KEY&#10;DATABASE_URL&#10;PASSWORD"></textarea>
66
- </div>
67
-
68
- <div class="form-group">
69
- <label for="package-input">Target Package (optional)</label>
70
- <input type="text" id="package-input" placeholder="org/package/subpackage">
71
- <small style="color: #666; font-size: 0.9em;">If specified, variables will be pre-assigned to this package. If not, recipient can choose.</small>
72
- </div>
73
-
74
- <button id="generate-link-btn">Generate Link</button>
75
-
76
- <div id="link-output-container" style="display: none; margin-top: 15px;">
77
- <div style="background-color: #f1f1f1; padding: 10px; border-radius: 4px; font-family: monospace; word-break: break-all; margin-bottom: 10px;" id="link-output"></div>
78
- <button id="copy-link-btn">Copy Link</button>
79
- <div style="margin-top: 10px; font-size: 0.9em; color: #666;">
80
- <strong>Usage:</strong> Send this link to someone who needs to configure these environment variables. They can paste values and either select an existing package or create a new one.
81
- </div>
82
- </div>
83
- </div>
84
- </div>
85
-
86
- <div class="package-detail">
87
- <div class="package-header">
88
- <h2 id="selected-package-title">Select a Package</h2>
89
- </div>
90
-
91
- <div id="package-detail-content">
92
- <div class="empty-state">
93
- <p>Select a package from the list to view and manage its environment variables</p>
94
- </div>
95
- </div>
96
-
97
- <div id="add-var-form" style="display: none;">
98
- <h3>Add/Update Environment Variable</h3>
99
- <form id="env-var-form">
100
- <div class="form-group">
101
- <label for="var-key">Variable Name</label>
102
- <input type="text" id="var-key" name="key" required>
103
- </div>
104
- <div class="form-group">
105
- <label for="var-value">Variable Value</label>
106
- <input type="text" id="var-value" name="value" required>
107
- </div>
108
- <button type="submit">Save Variable</button>
109
- <button type="button" id="clear-form-btn">Clear</button>
110
- </form>
111
- </div>
112
- </div>
113
- </div>
114
-
115
- <script src="/app.js"></script>
116
- </body>
117
- </html>
@@ -1,291 +0,0 @@
1
- /* Enact Environment Manager Styles */
2
- body {
3
- font-family:
4
- -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
5
- Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
6
- line-height: 1.6;
7
- color: #333;
8
- max-width: 1400px;
9
- margin: 0 auto;
10
- padding: 20px;
11
- background-color: #f7f9fc;
12
- }
13
-
14
- header {
15
- margin-bottom: 30px;
16
- border-bottom: 1px solid #e1e4e8;
17
- padding-bottom: 10px;
18
- }
19
-
20
- h1 {
21
- color: #2c3e50;
22
- margin-bottom: 5px;
23
- }
24
-
25
- .subtitle {
26
- color: #7f8c8d;
27
- font-size: 1rem;
28
- margin-top: 0;
29
- }
30
-
31
- .path-display {
32
- background-color: #f1f1f1;
33
- padding: 10px;
34
- border-radius: 4px;
35
- margin-bottom: 20px;
36
- font-family: monospace;
37
- }
38
-
39
- .packages-container {
40
- display: grid;
41
- grid-template-columns: 1fr 2fr;
42
- gap: 20px;
43
- margin-bottom: 30px;
44
- }
45
-
46
- .package-list {
47
- background-color: white;
48
- border-radius: 8px;
49
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
50
- padding: 20px;
51
- }
52
-
53
- .package-detail {
54
- background-color: white;
55
- border-radius: 8px;
56
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
57
- padding: 20px;
58
- }
59
-
60
- .package-item {
61
- padding: 10px;
62
- margin: 5px 0;
63
- border-radius: 4px;
64
- cursor: pointer;
65
- border-left: 4px solid transparent;
66
- transition: all 0.2s ease;
67
- }
68
-
69
- .package-item:hover {
70
- background-color: #f6f8fa;
71
- border-left-color: #3498db;
72
- }
73
-
74
- .package-item.active {
75
- background-color: #e3f2fd;
76
- border-left-color: #2196f3;
77
- }
78
-
79
- .package-name {
80
- font-weight: 500;
81
- color: #2c3e50;
82
- }
83
-
84
- .package-path {
85
- font-size: 0.85em;
86
- color: #7f8c8d;
87
- font-family: monospace;
88
- }
89
-
90
- .package-var-count {
91
- font-size: 0.8em;
92
- color: #666;
93
- }
94
-
95
- .form-group {
96
- margin-bottom: 15px;
97
- }
98
-
99
- label {
100
- display: block;
101
- margin-bottom: 5px;
102
- font-weight: 500;
103
- }
104
-
105
- input[type="text"],
106
- select {
107
- width: 100%;
108
- padding: 8px 10px;
109
- border: 1px solid #ddd;
110
- border-radius: 4px;
111
- font-size: 1rem;
112
- box-sizing: border-box;
113
- }
114
-
115
- button {
116
- background-color: #3498db;
117
- color: white;
118
- border: none;
119
- padding: 10px 15px;
120
- border-radius: 4px;
121
- cursor: pointer;
122
- font-size: 1rem;
123
- margin-right: 10px;
124
- }
125
-
126
- button:hover {
127
- background-color: #2980b9;
128
- }
129
-
130
- button.delete {
131
- background-color: #e74c3c;
132
- }
133
-
134
- button.delete:hover {
135
- background-color: #c0392b;
136
- }
137
-
138
- button.view {
139
- background-color: #2ecc71;
140
- }
141
-
142
- button.view:hover {
143
- background-color: #27ae60;
144
- }
145
-
146
- button.hide {
147
- background-color: #f39c12;
148
- }
149
-
150
- button.hide:hover {
151
- background-color: #d35400;
152
- }
153
-
154
- table {
155
- width: 100%;
156
- border-collapse: collapse;
157
- }
158
-
159
- th,
160
- td {
161
- text-align: left;
162
- padding: 12px;
163
- border-bottom: 1px solid #e1e4e8;
164
- }
165
-
166
- th {
167
- background-color: #f6f8fa;
168
- font-weight: 600;
169
- }
170
-
171
- tr:hover {
172
- background-color: #f6f8fa;
173
- }
174
-
175
- .actions {
176
- display: flex;
177
- gap: 10px;
178
- white-space: nowrap;
179
- }
180
-
181
- .notification {
182
- padding: 10px 15px;
183
- margin-bottom: 20px;
184
- border-radius: 4px;
185
- color: white;
186
- opacity: 0;
187
- transition: opacity 0.3s ease;
188
- position: fixed;
189
- top: 20px;
190
- right: 20px;
191
- z-index: 1000;
192
- min-width: 300px;
193
- }
194
-
195
- .notification.success {
196
- background-color: #2ecc71;
197
- opacity: 1;
198
- }
199
-
200
- .notification.error {
201
- background-color: #e74c3c;
202
- opacity: 1;
203
- }
204
-
205
- .empty-state {
206
- text-align: center;
207
- color: #7f8c8d;
208
- padding: 40px 0;
209
- }
210
-
211
- .value-cell {
212
- position: relative;
213
- }
214
-
215
- .masked-value {
216
- font-family: monospace;
217
- letter-spacing: 1px;
218
- }
219
-
220
- .new-package-form {
221
- border-top: 1px solid #e1e4e8;
222
- padding-top: 20px;
223
- margin-top: 20px;
224
- }
225
-
226
- .package-header {
227
- display: flex;
228
- justify-content: space-between;
229
- align-items: center;
230
- margin-bottom: 20px;
231
- }
232
-
233
- .loading {
234
- text-align: center;
235
- padding: 20px;
236
- color: #7f8c8d;
237
- }
238
-
239
- .modal {
240
- display: none;
241
- position: fixed;
242
- z-index: 1000;
243
- left: 0;
244
- top: 0;
245
- width: 100%;
246
- height: 100%;
247
- background-color: rgba(0, 0, 0, 0.5);
248
- }
249
-
250
- .modal-content {
251
- background-color: white;
252
- margin: 5% auto;
253
- padding: 0;
254
- border-radius: 8px;
255
- width: 90%;
256
- max-width: 600px;
257
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
258
- }
259
-
260
- .modal-header {
261
- padding: 20px;
262
- border-bottom: 1px solid #e1e4e8;
263
- display: flex;
264
- justify-content: space-between;
265
- align-items: center;
266
- }
267
-
268
- .modal-header h2 {
269
- margin: 0;
270
- color: #2c3e50;
271
- }
272
-
273
- .close-modal {
274
- font-size: 28px;
275
- font-weight: bold;
276
- cursor: pointer;
277
- color: #7f8c8d;
278
- }
279
-
280
- .close-modal:hover {
281
- color: #2c3e50;
282
- }
283
-
284
- .modal-form {
285
- padding: 20px;
286
- }
287
-
288
- .modal-actions {
289
- margin-top: 20px;
290
- text-align: right;
291
- }