@kb-labs/studio-app 0.6.0 → 2.8.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 (175) hide show
  1. package/dist/index.html +1 -0
  2. package/dist/main.1d68e922.js +522 -0
  3. package/dist/main.1d68e922.js.map +1 -0
  4. package/dist/main.80b70197.css +2 -0
  5. package/dist/main.80b70197.css.map +1 -0
  6. package/dist/mf-manifest.json +241 -0
  7. package/dist/mf-stats.json +271 -0
  8. package/package.json +56 -39
  9. package/server.js +68 -0
  10. package/.env.example +0 -10
  11. package/UI-KIT-COMPONENTS.md +0 -783
  12. package/UI-KIT-PLAN.md +0 -326
  13. package/eslint-rules/no-direct-antd-import.js +0 -151
  14. package/eslint.config.ts +0 -27
  15. package/index.html +0 -17
  16. package/postcss.config.js +0 -7
  17. package/public/favicon.ico +0 -0
  18. package/rspack.config.mjs +0 -118
  19. package/src/App.tsx +0 -46
  20. package/src/components/devtools/devtools-log-feed.module.css +0 -165
  21. package/src/components/devtools/devtools-log-feed.tsx +0 -300
  22. package/src/components/devtools/devtools-panel.module.css +0 -121
  23. package/src/components/devtools/devtools-panel.tsx +0 -115
  24. package/src/components/empty-state.tsx +0 -28
  25. package/src/components/error-boundary.tsx +0 -210
  26. package/src/components/health-banner.module.css +0 -103
  27. package/src/components/health-banner.tsx +0 -134
  28. package/src/components/health-indicator.tsx +0 -12
  29. package/src/components/page-header.tsx +0 -49
  30. package/src/components/page-transition.tsx +0 -24
  31. package/src/components/role-switcher.tsx +0 -148
  32. package/src/components/run-badge.tsx +0 -13
  33. package/src/components/ui/icons.tsx +0 -509
  34. package/src/components/ui/index.ts +0 -25
  35. package/src/components/ui/kb-config-provider.tsx +0 -130
  36. package/src/components/ui/kb-header.module.css +0 -51
  37. package/src/components/ui/kb-header.tsx +0 -112
  38. package/src/components/ui/kb-notification-bell.module.css +0 -103
  39. package/src/components/ui/kb-notification-bell.tsx +0 -199
  40. package/src/components/ui/kb-page-layout.tsx +0 -66
  41. package/src/components/ui/kb-quick-search.module.css +0 -86
  42. package/src/components/ui/kb-quick-search.tsx +0 -196
  43. package/src/components/ui/kb-sidebar.module.css +0 -47
  44. package/src/components/ui/kb-sidebar.tsx +0 -196
  45. package/src/components/ui/kb-stat-card.module.css +0 -21
  46. package/src/components/ui/kb-stat-card.tsx +0 -22
  47. package/src/components/ui/kb-stat-grid.tsx +0 -22
  48. package/src/components/ui/kb-status-bar.module.css +0 -49
  49. package/src/components/ui/kb-status-bar.tsx +0 -145
  50. package/src/components/ui/kb-system-health-indicator.tsx +0 -229
  51. package/src/components/ui/kb-theme-toggle.tsx +0 -42
  52. package/src/components/ui/theme-adapter.ts +0 -812
  53. package/src/components/ui/theme-transition-overlay.tsx +0 -70
  54. package/src/components/ui/utils.ts +0 -6
  55. package/src/components/widget-error-boundary.tsx +0 -172
  56. package/src/config/env.ts +0 -5
  57. package/src/config/feature-flags.ts +0 -482
  58. package/src/config/studio.config.schema.ts +0 -88
  59. package/src/config/studio.config.ts +0 -84
  60. package/src/env.d.ts +0 -23
  61. package/src/hooks/use-command-palette.ts +0 -6
  62. package/src/hooks/use-devtools-store.ts +0 -25
  63. package/src/hooks/use-feature-flags.ts +0 -101
  64. package/src/index.css +0 -10
  65. package/src/layouts/dashboard-grid.tsx +0 -122
  66. package/src/layouts/index.ts +0 -12
  67. package/src/layouts/two-pane.tsx +0 -134
  68. package/src/main.tsx +0 -15
  69. package/src/modules/analytics/components/analytics-daily-stats-chart.tsx +0 -257
  70. package/src/modules/analytics/components/analytics-date-range-picker.tsx +0 -121
  71. package/src/modules/analytics/pages/analytics-cache-page.tsx +0 -285
  72. package/src/modules/analytics/pages/analytics-embeddings-page.tsx +0 -274
  73. package/src/modules/analytics/pages/analytics-events-page.tsx +0 -425
  74. package/src/modules/analytics/pages/analytics-llm-page.tsx +0 -434
  75. package/src/modules/analytics/pages/analytics-overview-page.tsx +0 -336
  76. package/src/modules/analytics/pages/analytics-page.tsx +0 -20
  77. package/src/modules/analytics/pages/analytics-storage-page.tsx +0 -344
  78. package/src/modules/analytics/pages/analytics-vectorstore-page.tsx +0 -279
  79. package/src/modules/analytics/routes/index.tsx +0 -133
  80. package/src/modules/analytics/utils/formatters.test.ts +0 -148
  81. package/src/modules/analytics/utils/formatters.ts +0 -100
  82. package/src/modules/auth/pages/login-page.module.css +0 -113
  83. package/src/modules/auth/pages/login-page.tsx +0 -80
  84. package/src/modules/auth/routes/index.tsx +0 -24
  85. package/src/modules/dashboard/components/ActivityTimelineWidget.tsx +0 -199
  86. package/src/modules/dashboard/components/AiInsightsWidget.tsx +0 -358
  87. package/src/modules/dashboard/components/AnimatedMetricCard.css +0 -88
  88. package/src/modules/dashboard/components/AnimatedMetricCard.tsx +0 -125
  89. package/src/modules/dashboard/components/HeroMetricCard.css +0 -114
  90. package/src/modules/dashboard/components/HeroMetricCard.tsx +0 -152
  91. package/src/modules/dashboard/components/HeroMetricsWidget.tsx +0 -146
  92. package/src/modules/dashboard/components/SystemResourcesWidget.tsx +0 -197
  93. package/src/modules/dashboard/components/dashboard-empty.tsx +0 -22
  94. package/src/modules/dashboard/components/dashboard-kpis-widget.tsx +0 -59
  95. package/src/modules/dashboard/components/dashboard-kpis.tsx +0 -13
  96. package/src/modules/dashboard/components/dashboard-latency-percentiles-widget.tsx +0 -85
  97. package/src/modules/dashboard/components/dashboard-metrics-widget.tsx +0 -78
  98. package/src/modules/dashboard/components/dashboard-plugins-widget.tsx +0 -67
  99. package/src/modules/dashboard/components/dashboard-requests-widget.tsx +0 -62
  100. package/src/modules/dashboard/layouts/dashboard-layout.tsx +0 -16
  101. package/src/modules/dashboard/pages/ai-insights-page.tsx +0 -563
  102. package/src/modules/dashboard/pages/dashboard-animations.css +0 -317
  103. package/src/modules/dashboard/pages/dashboard-page.tsx +0 -13
  104. package/src/modules/dashboard/routes/index.tsx +0 -70
  105. package/src/modules/observability/pages/devkit-page.tsx +0 -263
  106. package/src/modules/observability/pages/incident-detail-page.tsx +0 -571
  107. package/src/modules/observability/pages/incidents-page.tsx +0 -370
  108. package/src/modules/observability/pages/log-detail-page.tsx +0 -508
  109. package/src/modules/observability/pages/logs-page.tsx +0 -1129
  110. package/src/modules/observability/pages/prometheus-metrics-page.tsx +0 -486
  111. package/src/modules/observability/pages/state-broker-page.tsx +0 -229
  112. package/src/modules/observability/pages/system-events-page.tsx +0 -255
  113. package/src/modules/observability/routes/index.tsx +0 -133
  114. package/src/modules/plugins/components/marketplace-card.tsx +0 -153
  115. package/src/modules/plugins/components/plugin-ai-assistant-modal.tsx +0 -374
  116. package/src/modules/plugins/components/plugin-card.tsx +0 -136
  117. package/src/modules/plugins/components/plugin-detail/capabilities-summary.tsx +0 -101
  118. package/src/modules/plugins/components/plugin-detail/cli-commands-table.tsx +0 -101
  119. package/src/modules/plugins/components/plugin-detail/index.ts +0 -7
  120. package/src/modules/plugins/components/plugin-detail/jobs-table.tsx +0 -64
  121. package/src/modules/plugins/components/plugin-detail/permissions/env-permissions.tsx +0 -30
  122. package/src/modules/plugins/components/plugin-detail/permissions/filesystem-permissions.tsx +0 -68
  123. package/src/modules/plugins/components/plugin-detail/permissions/index.ts +0 -6
  124. package/src/modules/plugins/components/plugin-detail/permissions/network-permissions.tsx +0 -43
  125. package/src/modules/plugins/components/plugin-detail/permissions/platform-services.tsx +0 -242
  126. package/src/modules/plugins/components/plugin-detail/permissions/resource-quotas.tsx +0 -96
  127. package/src/modules/plugins/components/plugin-detail/permissions/shell-permissions.tsx +0 -55
  128. package/src/modules/plugins/components/plugin-detail/permissions-view.tsx +0 -47
  129. package/src/modules/plugins/components/plugin-detail/plugin-header.tsx +0 -169
  130. package/src/modules/plugins/components/plugin-detail/rest-routes-table.tsx +0 -159
  131. package/src/modules/plugins/components/plugin-detail/workflows-table.tsx +0 -40
  132. package/src/modules/plugins/components/plugin-grid.tsx +0 -20
  133. package/src/modules/plugins/components/plugin-table.tsx +0 -178
  134. package/src/modules/plugins/pages/marketplace-page.tsx +0 -200
  135. package/src/modules/plugins/pages/plugin-detail-page.tsx +0 -1145
  136. package/src/modules/plugins/routes/index.tsx +0 -48
  137. package/src/modules/plugins/utils/index.ts +0 -1
  138. package/src/modules/plugins/utils/schema-helpers.ts +0 -21
  139. package/src/modules/settings/components/api-routes-viewer.tsx +0 -415
  140. package/src/modules/settings/components/appearance-settings.tsx +0 -200
  141. package/src/modules/settings/components/configuration-settings.tsx +0 -321
  142. package/src/modules/settings/components/data-privacy-settings.tsx +0 -111
  143. package/src/modules/settings/components/experimental-settings.tsx +0 -243
  144. package/src/modules/settings/components/navigation-settings.tsx +0 -198
  145. package/src/modules/settings/components/notifications-settings.tsx +0 -40
  146. package/src/modules/settings/pages/settings-page.tsx +0 -298
  147. package/src/modules/settings/routes/index.tsx +0 -47
  148. package/src/pages/README-assistant.md +0 -91
  149. package/src/pages/login-page.tsx +0 -177
  150. package/src/pages/not-found-page.tsx +0 -85
  151. package/src/providers/auth-provider.tsx +0 -40
  152. package/src/providers/command-palette-provider.tsx +0 -193
  153. package/src/providers/data-sources-provider.tsx +0 -27
  154. package/src/providers/devtools-provider.tsx +0 -72
  155. package/src/providers/navigation-items-provider.tsx +0 -38
  156. package/src/providers/registry-v2-provider.tsx +0 -93
  157. package/src/providers/settings-provider.tsx +0 -158
  158. package/src/router.tsx +0 -302
  159. package/src/routes/helpers.tsx +0 -25
  160. package/src/routes/plugin-page-v2.tsx +0 -52
  161. package/src/routes/types.ts +0 -18
  162. package/src/styles/antd-overrides.css +0 -211
  163. package/src/styles/base.css +0 -190
  164. package/src/styles/settings.css +0 -75
  165. package/src/styles/variables.css +0 -94
  166. package/src/utils/analytics.ts +0 -183
  167. package/src/utils/apply-navigation-categories.ts +0 -83
  168. package/src/utils/commands.ts +0 -252
  169. package/src/utils/export.ts +0 -174
  170. package/src/utils/format-date.ts +0 -166
  171. package/src/utils/logger.ts +0 -110
  172. package/tailwind.config.ts +0 -13
  173. package/tsconfig.json +0 -13
  174. package/vitest-setup.ts +0 -1
  175. /package/{public → dist}/favicon.svg +0 -0
@@ -0,0 +1,271 @@
1
+ {
2
+ "id": "studioHost",
3
+ "name": "studioHost",
4
+ "metaData": {
5
+ "name": "studioHost",
6
+ "type": "app",
7
+ "buildInfo": {
8
+ "buildVersion": "0.7.0",
9
+ "buildName": "@kb-labs/studio-app"
10
+ },
11
+ "remoteEntry": {
12
+ "name": "",
13
+ "path": "",
14
+ "type": "global"
15
+ },
16
+ "types": {
17
+ "path": "",
18
+ "name": "",
19
+ "zip": ".",
20
+ "api": "."
21
+ },
22
+ "globalName": "studioHost",
23
+ "pluginVersion": "0.8.12",
24
+ "prefetchInterface": false,
25
+ "publicPath": "auto"
26
+ },
27
+ "shared": [
28
+ {
29
+ "singleton": true,
30
+ "requiredVersion": "^5.4.0",
31
+ "shareScope": "default",
32
+ "eager": true,
33
+ "name": "@ant-design/icons",
34
+ "version": "5.6.1",
35
+ "id": "studioHost:@ant-design/icons",
36
+ "assets": {
37
+ "js": {
38
+ "async": [],
39
+ "sync": [
40
+ "main.1d68e922.js"
41
+ ]
42
+ },
43
+ "css": {
44
+ "async": [],
45
+ "sync": [
46
+ "main.80b70197.css"
47
+ ]
48
+ }
49
+ },
50
+ "usedIn": []
51
+ },
52
+ {
53
+ "singleton": true,
54
+ "requiredVersion": "^0.1.0",
55
+ "shareScope": "default",
56
+ "eager": true,
57
+ "name": "@kb-labs/studio-event-bus",
58
+ "version": "2.6.0",
59
+ "id": "studioHost:@kb-labs/studio-event-bus",
60
+ "assets": {
61
+ "js": {
62
+ "async": [],
63
+ "sync": [
64
+ "main.1d68e922.js"
65
+ ]
66
+ },
67
+ "css": {
68
+ "async": [],
69
+ "sync": [
70
+ "main.80b70197.css"
71
+ ]
72
+ }
73
+ },
74
+ "usedIn": []
75
+ },
76
+ {
77
+ "singleton": true,
78
+ "requiredVersion": "^0.1.0",
79
+ "shareScope": "default",
80
+ "eager": true,
81
+ "name": "@kb-labs/studio-hooks",
82
+ "version": "2.6.0",
83
+ "id": "studioHost:@kb-labs/studio-hooks",
84
+ "assets": {
85
+ "js": {
86
+ "async": [],
87
+ "sync": [
88
+ "main.1d68e922.js"
89
+ ]
90
+ },
91
+ "css": {
92
+ "async": [],
93
+ "sync": [
94
+ "main.80b70197.css"
95
+ ]
96
+ }
97
+ },
98
+ "usedIn": []
99
+ },
100
+ {
101
+ "singleton": true,
102
+ "requiredVersion": "^0.1.0",
103
+ "shareScope": "default",
104
+ "eager": true,
105
+ "name": "@kb-labs/studio-ui-core",
106
+ "version": "2.6.0",
107
+ "id": "studioHost:@kb-labs/studio-ui-core",
108
+ "assets": {
109
+ "js": {
110
+ "async": [],
111
+ "sync": [
112
+ "main.1d68e922.js"
113
+ ]
114
+ },
115
+ "css": {
116
+ "async": [],
117
+ "sync": [
118
+ "main.80b70197.css"
119
+ ]
120
+ }
121
+ },
122
+ "usedIn": []
123
+ },
124
+ {
125
+ "singleton": true,
126
+ "requiredVersion": "^0.1.0",
127
+ "shareScope": "default",
128
+ "eager": true,
129
+ "name": "@kb-labs/studio-ui-kit",
130
+ "version": "2.6.0",
131
+ "id": "studioHost:@kb-labs/studio-ui-kit",
132
+ "assets": {
133
+ "js": {
134
+ "async": [],
135
+ "sync": [
136
+ "main.1d68e922.js"
137
+ ]
138
+ },
139
+ "css": {
140
+ "async": [],
141
+ "sync": [
142
+ "main.80b70197.css"
143
+ ]
144
+ }
145
+ },
146
+ "usedIn": []
147
+ },
148
+ {
149
+ "singleton": true,
150
+ "requiredVersion": "^5.0.0",
151
+ "shareScope": "default",
152
+ "eager": true,
153
+ "name": "@tanstack/react-query",
154
+ "version": "5.97.0",
155
+ "id": "studioHost:@tanstack/react-query",
156
+ "assets": {
157
+ "js": {
158
+ "async": [],
159
+ "sync": [
160
+ "main.1d68e922.js"
161
+ ]
162
+ },
163
+ "css": {
164
+ "async": [],
165
+ "sync": [
166
+ "main.80b70197.css"
167
+ ]
168
+ }
169
+ },
170
+ "usedIn": []
171
+ },
172
+ {
173
+ "singleton": true,
174
+ "requiredVersion": "^5.21.0",
175
+ "shareScope": "default",
176
+ "eager": true,
177
+ "name": "antd",
178
+ "version": "5.29.3",
179
+ "id": "studioHost:antd",
180
+ "assets": {
181
+ "js": {
182
+ "async": [],
183
+ "sync": [
184
+ "main.1d68e922.js"
185
+ ]
186
+ },
187
+ "css": {
188
+ "async": [],
189
+ "sync": [
190
+ "main.80b70197.css"
191
+ ]
192
+ }
193
+ },
194
+ "usedIn": []
195
+ },
196
+ {
197
+ "singleton": true,
198
+ "requiredVersion": "^18.3.0",
199
+ "shareScope": "default",
200
+ "eager": true,
201
+ "name": "react-dom",
202
+ "version": "18.3.1",
203
+ "id": "studioHost:react-dom",
204
+ "assets": {
205
+ "js": {
206
+ "async": [],
207
+ "sync": [
208
+ "main.1d68e922.js"
209
+ ]
210
+ },
211
+ "css": {
212
+ "async": [],
213
+ "sync": [
214
+ "main.80b70197.css"
215
+ ]
216
+ }
217
+ },
218
+ "usedIn": []
219
+ },
220
+ {
221
+ "singleton": true,
222
+ "requiredVersion": "^7.0.0",
223
+ "shareScope": "default",
224
+ "eager": true,
225
+ "name": "react-router-dom",
226
+ "version": "7.14.0",
227
+ "id": "studioHost:react-router-dom",
228
+ "assets": {
229
+ "js": {
230
+ "async": [],
231
+ "sync": [
232
+ "main.1d68e922.js"
233
+ ]
234
+ },
235
+ "css": {
236
+ "async": [],
237
+ "sync": [
238
+ "main.80b70197.css"
239
+ ]
240
+ }
241
+ },
242
+ "usedIn": []
243
+ },
244
+ {
245
+ "singleton": true,
246
+ "requiredVersion": "^18.3.0",
247
+ "shareScope": "default",
248
+ "eager": true,
249
+ "name": "react",
250
+ "version": "18.3.1",
251
+ "id": "studioHost:react",
252
+ "assets": {
253
+ "js": {
254
+ "async": [],
255
+ "sync": [
256
+ "main.1d68e922.js"
257
+ ]
258
+ },
259
+ "css": {
260
+ "async": [],
261
+ "sync": [
262
+ "main.80b70197.css"
263
+ ]
264
+ }
265
+ },
266
+ "usedIn": []
267
+ }
268
+ ],
269
+ "remotes": [],
270
+ "exposes": []
271
+ }
package/package.json CHANGED
@@ -1,41 +1,13 @@
1
1
  {
2
- "name": "@kb-labs/studio-app",
3
- "version": "0.6.0",
4
- "description": "KB Labs Studio application",
5
- "type": "module",
6
- "scripts": {
7
- "dev": "rspack serve",
8
- "build": "rspack build",
9
- "preview": "rspack serve --mode production",
10
- "clean": "rimraf dist",
11
- "type-check": "tsc --noEmit",
12
- "lint": "eslint . --max-warnings=0",
13
- "test": "vitest run --passWithNoTests",
14
- "test:watch": "vitest --passWithNoTests"
15
- },
16
2
  "dependencies": {
3
+ "@ant-design/charts": "^2.6.6",
17
4
  "@ant-design/icons": "^5.4.0",
18
5
  "@ant-design/plots": "^2.6.6",
19
- "@kb-labs/agent-contracts": "^0.1.0",
20
- "@kb-labs/qa-contracts": "^0.1.0",
21
- "@kb-labs/quality-contracts": "^0.1.0",
22
- "@kb-labs/release-manager-contracts": "^0.1.0",
23
- "@kb-labs/rest-api-contracts": "^1.3.0",
24
- "@kb-labs/studio-data-client": "^0.6.0",
25
- "@kb-labs/studio-devtools": "^0.6.0",
26
- "@kb-labs/studio-federation": "^0.6.0",
27
- "@kb-labs/studio-hooks": "^0.6.0",
28
- "@kb-labs/studio-event-bus": "^0.6.0",
29
- "@kb-labs/studio-ui-core": "^0.6.0",
30
- "@kb-labs/studio-plugin-tools": "^0.6.0",
31
- "@kb-labs/studio-ui-kit": "^0.6.0",
32
- "@kb-labs/workflow-contracts": "^1.4.0",
33
- "@ant-design/charts": "^2.6.6",
34
- "clsx": "^2.1.1",
35
6
  "@tanstack/react-query": "^5.62.23",
36
7
  "@tanstack/react-query-devtools": "^5.62.23",
37
8
  "@types/react-grid-layout": "^1.3.6",
38
9
  "antd": "^5.21.0",
10
+ "clsx": "^2.1.1",
39
11
  "dayjs": "^1.11.19",
40
12
  "dompurify": "^3.3.1",
41
13
  "lucide-react": "^0.468.0",
@@ -47,26 +19,71 @@
47
19
  "react-router-dom": "^7.1.4",
48
20
  "reactflow": "^11.11.4",
49
21
  "zod": "^3.23.8",
50
- "zustand": "^5.0.2"
22
+ "zustand": "^5.0.2",
23
+ "@kb-labs/qa-contracts": "2.6.0",
24
+ "@kb-labs/studio-data-client": "2.6.0",
25
+ "@kb-labs/release-manager-contracts": "2.7.0",
26
+ "@kb-labs/quality-contracts": "2.6.0",
27
+ "@kb-labs/studio-devtools": "2.6.0",
28
+ "@kb-labs/studio-event-bus": "2.6.0",
29
+ "@kb-labs/studio-federation": "2.6.0",
30
+ "@kb-labs/studio-hooks": "2.6.0",
31
+ "@kb-labs/studio-ui-core": "2.6.0",
32
+ "@kb-labs/studio-ui-kit": "2.6.0",
33
+ "@kb-labs/agent-contracts": "2.6.0",
34
+ "@kb-labs/studio-plugin-tools": "2.6.0",
35
+ "@kb-labs/rest-api-contracts": "2.6.0",
36
+ "@kb-labs/workflow-contracts": "2.6.0"
51
37
  },
38
+ "description": "KB Labs Studio application",
52
39
  "devDependencies": {
53
- "@kb-labs/devkit": "link:../../../../infra/kb-labs-devkit",
40
+ "@module-federation/enhanced": "^0.8.0",
41
+ "@rspack/cli": "^1.7.0",
42
+ "@rspack/core": "^1.7.0",
43
+ "@rspack/plugin-react-refresh": "^1.6.0",
54
44
  "@types/dompurify": "^3.2.0",
55
45
  "@types/node": "^22.10.0",
56
46
  "@types/react": "^18.3.18",
57
47
  "@types/react-dom": "^18.3.5",
58
- "@rspack/cli": "^1.7.0",
59
- "@rspack/core": "^1.7.0",
60
- "@rspack/plugin-react-refresh": "^1.6.0",
61
- "@module-federation/enhanced": "^0.8.0",
62
48
  "autoprefixer": "^10.4.21",
63
49
  "eslint": "^9",
64
50
  "jiti": "^2.6.1",
65
51
  "postcss": "^8.4.49",
52
+ "postcss-loader": "^8.1.0",
66
53
  "rimraf": "^6",
67
54
  "tailwindcss": "^3.4.17",
55
+ "tsup": "^8",
68
56
  "typescript": "^5",
69
- "postcss-loader": "^8.1.0",
70
- "vitest": "^3.2.4"
57
+ "vitest": "^3.2.4",
58
+ "@kb-labs/devkit": "2.6.0"
59
+ },
60
+ "engines": {
61
+ "node": ">=20.0.0",
62
+ "pnpm": ">=9.0.0"
63
+ },
64
+ "name": "@kb-labs/studio-app",
65
+ "main": "./server.js",
66
+ "files": [
67
+ "dist",
68
+ "server.js"
69
+ ],
70
+ "kb": {
71
+ "manifest": "./src/manifest.ts"
72
+ },
73
+ "type": "module",
74
+ "version": "2.8.0",
75
+ "publishConfig": {
76
+ "access": "public"
77
+ },
78
+ "scripts": {
79
+ "build": "rspack build",
80
+ "clean": "rimraf dist",
81
+ "dev": "rspack serve",
82
+ "start": "node server.js",
83
+ "lint": "eslint . --max-warnings=0",
84
+ "preview": "rspack serve --mode production",
85
+ "test": "vitest run --passWithNoTests",
86
+ "test:watch": "vitest --passWithNoTests",
87
+ "type-check": "tsc --noEmit"
71
88
  }
72
- }
89
+ }
package/server.js ADDED
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Studio static server — serves built SPA from dist/
4
+ * All routes fall back to index.html (SPA routing).
5
+ */
6
+ import { createServer } from 'node:http';
7
+ import { readFile, stat } from 'node:fs/promises';
8
+ import { join, extname, resolve } from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+
11
+ const __dirname = fileURLToPath(new URL('.', import.meta.url));
12
+ const DIST = resolve(__dirname, 'dist');
13
+ const PORT = Number(process.env.PORT ?? 3000);
14
+
15
+ const MIME = {
16
+ '.html': 'text/html; charset=utf-8',
17
+ '.js': 'application/javascript; charset=utf-8',
18
+ '.css': 'text/css; charset=utf-8',
19
+ '.json': 'application/json',
20
+ '.svg': 'image/svg+xml',
21
+ '.png': 'image/png',
22
+ '.ico': 'image/x-icon',
23
+ '.woff2':'font/woff2',
24
+ '.woff': 'font/woff',
25
+ '.ttf': 'font/ttf',
26
+ };
27
+
28
+ const server = createServer(async (req, res) => {
29
+ // Strip query string
30
+ const url = req.url.split('?')[0];
31
+
32
+ // Prevent path traversal
33
+ const safePath = resolve(DIST, '.' + url);
34
+ if (!safePath.startsWith(DIST)) {
35
+ res.writeHead(403); res.end('Forbidden'); return;
36
+ }
37
+
38
+ let filePath = safePath;
39
+
40
+ try {
41
+ const s = await stat(filePath);
42
+ if (s.isDirectory()) filePath = join(filePath, 'index.html');
43
+ } catch {
44
+ // File not found → SPA fallback
45
+ filePath = join(DIST, 'index.html');
46
+ }
47
+
48
+ try {
49
+ const data = await readFile(filePath);
50
+ const ext = extname(filePath);
51
+ const mime = MIME[ext] ?? 'application/octet-stream';
52
+
53
+ // index.html: no cache; assets with hash: immutable
54
+ const isHtml = ext === '.html';
55
+ const cache = isHtml
56
+ ? 'no-cache'
57
+ : 'public, max-age=31536000, immutable';
58
+
59
+ res.writeHead(200, { 'Content-Type': mime, 'Cache-Control': cache });
60
+ res.end(data);
61
+ } catch {
62
+ res.writeHead(404); res.end('Not found');
63
+ }
64
+ });
65
+
66
+ server.listen(PORT, () => {
67
+ console.log(`Studio running at http://localhost:${PORT}`);
68
+ });
package/.env.example DELETED
@@ -1,10 +0,0 @@
1
- # API Configuration
2
- # All traffic goes through Gateway — auth, namespacing, host dispatch
3
- KB_API_BASE_URL=http://localhost:4000/api/v1
4
-
5
- # Gateway auth token (staticTokens in .kb/kb.config.json → gateway.staticTokens)
6
- KB_GATEWAY_TOKEN=dev-studio-token
7
-
8
- # Data Source Mode
9
- # Options: 'mock' | 'http'
10
- KB_DATA_SOURCE_MODE=http