@solidxai/core 0.1.11-beta.4 → 0.1.11-beta.6

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 (104) hide show
  1. package/dist/commands/migrate-removed-fields.command.d.ts +19 -0
  2. package/dist/commands/migrate-removed-fields.command.d.ts.map +1 -0
  3. package/dist/commands/migrate-removed-fields.command.js +77 -0
  4. package/dist/commands/migrate-removed-fields.command.js.map +1 -0
  5. package/dist/dtos/datasource-introspection-mapping.dto.d.ts +1 -0
  6. package/dist/dtos/datasource-introspection-mapping.dto.d.ts.map +1 -1
  7. package/dist/dtos/datasource-introspection-mapping.dto.js +7 -1
  8. package/dist/dtos/datasource-introspection-mapping.dto.js.map +1 -1
  9. package/dist/helpers/command.service.d.ts +2 -0
  10. package/dist/helpers/command.service.d.ts.map +1 -1
  11. package/dist/helpers/command.service.js +6 -2
  12. package/dist/helpers/command.service.js.map +1 -1
  13. package/dist/helpers/nodemon-heartbeat.d.ts +5 -0
  14. package/dist/helpers/nodemon-heartbeat.d.ts.map +1 -0
  15. package/dist/helpers/nodemon-heartbeat.js +67 -0
  16. package/dist/helpers/nodemon-heartbeat.js.map +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/seeders/module-metadata-seeder.service.d.ts +7 -1
  22. package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
  23. package/dist/seeders/module-metadata-seeder.service.js +102 -1
  24. package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
  25. package/dist/seeders/seed-data/solid-core-metadata.json +109 -31
  26. package/dist/services/api-key.service.d.ts.map +1 -1
  27. package/dist/services/api-key.service.js.map +1 -1
  28. package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.d.ts +4 -0
  29. package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.d.ts.map +1 -1
  30. package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.js +18 -1
  31. package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.js.map +1 -1
  32. package/dist/services/crud.service.d.ts +1 -0
  33. package/dist/services/crud.service.d.ts.map +1 -1
  34. package/dist/services/crud.service.js +27 -0
  35. package/dist/services/crud.service.js.map +1 -1
  36. package/dist/services/datasource-introspection.service.d.ts +1 -0
  37. package/dist/services/datasource-introspection.service.d.ts.map +1 -1
  38. package/dist/services/datasource-introspection.service.js +27 -16
  39. package/dist/services/datasource-introspection.service.js.map +1 -1
  40. package/dist/services/import-transaction.service.d.ts.map +1 -1
  41. package/dist/services/import-transaction.service.js +3 -0
  42. package/dist/services/import-transaction.service.js.map +1 -1
  43. package/dist/services/model-metadata.service.d.ts +1 -0
  44. package/dist/services/model-metadata.service.d.ts.map +1 -1
  45. package/dist/services/model-metadata.service.js +28 -0
  46. package/dist/services/model-metadata.service.js.map +1 -1
  47. package/dist/services/module-metadata.service.d.ts.map +1 -1
  48. package/dist/services/module-metadata.service.js +27 -0
  49. package/dist/services/module-metadata.service.js.map +1 -1
  50. package/dist/services/removed-field-migration.service.d.ts +30 -0
  51. package/dist/services/removed-field-migration.service.d.ts.map +1 -0
  52. package/dist/services/removed-field-migration.service.js +319 -0
  53. package/dist/services/removed-field-migration.service.js.map +1 -0
  54. package/dist/solid-core.module.d.ts.map +1 -1
  55. package/dist/solid-core.module.js +4 -0
  56. package/dist/solid-core.module.js.map +1 -1
  57. package/dist/subscribers/audit.subscriber.d.ts +4 -1
  58. package/dist/subscribers/audit.subscriber.d.ts.map +1 -1
  59. package/dist/subscribers/audit.subscriber.js +54 -6
  60. package/dist/subscribers/audit.subscriber.js.map +1 -1
  61. package/dist-tests/api/authenticate.spec.js +119 -0
  62. package/dist-tests/api/authenticate.spec.js.map +1 -0
  63. package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +97 -0
  64. package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +1 -0
  65. package/dist-tests/api/ping.spec.js +21 -0
  66. package/dist-tests/api/ping.spec.js.map +1 -0
  67. package/dist-tests/helpers/auth.js +41 -0
  68. package/dist-tests/helpers/auth.js.map +1 -0
  69. package/dist-tests/helpers/env.js +11 -0
  70. package/dist-tests/helpers/env.js.map +1 -0
  71. package/docs/agent-hub-grooming.md +301 -0
  72. package/docs/dashboards/AGENTIC_DASHBOARD_IMPLEMENTATION_PLAN.md +438 -0
  73. package/docs/dashboards/dashboard-curl-smoke-tests.txt +146 -0
  74. package/docs/dashboards/delete-legacy-dashboard-metadata.sql +172 -0
  75. package/docs/datasource-introspection-ddl-analysis.md +326 -0
  76. package/docs/datasource-introspection-implementation-plan.md +306 -0
  77. package/docs/grouping-enhancements.md +89 -0
  78. package/docs/java-spring/README.md +3 -0
  79. package/docs/java-spring/solid-core-module-deep-dive-report.md +1317 -0
  80. package/docs/module-package-import-handoff.md +691 -0
  81. package/docs/seed-changes.md +65 -0
  82. package/docs/test-data-workflow.md +200 -0
  83. package/docs/type-declaration-import-issue.md +24 -0
  84. package/package.json +1 -1
  85. package/src/commands/migrate-removed-fields.command.ts +81 -0
  86. package/src/dtos/datasource-introspection-mapping.dto.ts +5 -0
  87. package/src/helpers/command.service.ts +10 -2
  88. package/src/helpers/nodemon-heartbeat.ts +59 -0
  89. package/src/index.ts +1 -0
  90. package/src/seeders/module-metadata-seeder.service.ts +119 -0
  91. package/src/seeders/seed-data/solid-core-metadata.json +109 -31
  92. package/src/services/api-key.service.ts +36 -36
  93. package/src/services/computed-fields/entity/concat-entity-computed-field-provider.service.ts +15 -1
  94. package/src/services/crud.service.ts +36 -11
  95. package/src/services/datasource-introspection.service.ts +29 -16
  96. package/src/services/import-transaction.service.ts +5 -0
  97. package/src/services/model-metadata.service.ts +45 -1
  98. package/src/services/module-metadata.service.ts +35 -0
  99. package/src/services/removed-field-migration.service.ts +334 -0
  100. package/src/solid-core.module.ts +4 -0
  101. package/src/subscribers/audit.subscriber.ts +70 -5
  102. package/.claude/settings.local.json +0 -16
  103. package/CLAUDE.md +0 -26
  104. package/src/services/1.js +0 -6
@@ -0,0 +1,691 @@
1
+ # Module Package Import Handoff
2
+
3
+ ## Purpose
4
+
5
+ This document captures the custom SolidX module import/export work completed across `solid-core-module` and `solid-core-ui`, plus the sample `contact-management` module created for end-to-end testing.
6
+
7
+ The goal of this feature set is:
8
+
9
+ - allow a user to import a SolidX module package from the module metadata list view
10
+ - preview and validate the archive before copying files into `solid-api` and `solid-ui`
11
+ - run a guided post-import flow for restart check, build, and seed
12
+ - support packaging/exporting an existing module into a `.sldx` archive
13
+
14
+ This is a custom implementation and intentionally does not reuse the older import/export controllers or UI flows.
15
+
16
+ ---
17
+
18
+ ## Scope Summary
19
+
20
+ Implemented areas:
21
+
22
+ - backend import/export endpoints in `solid-core-module`
23
+ - backend archive parsing, validation, extraction, placement, build, and seed orchestration
24
+ - frontend import dialog and multi-step progress UI in `solid-core-ui`
25
+ - stock `SolidListView` header button wiring for module metadata list view
26
+ - global error handling change from redirect to toast for `/admin` and `/auth`
27
+ - sample `contact-management` module with matching metadata, API, and UI structure
28
+ - archive validation support for macOS Finder zip artifacts and top-level wrapper folders
29
+ - fix for imported archive staging polluting Nest build input
30
+
31
+ Partially complete / still rough:
32
+
33
+ - backend restart detection UX is fragile because importing into `solid-ui/src` can trigger Vite restart and disrupt the in-flight UI
34
+ - the ping/restart step needs a more resilient experience
35
+ - consuming projects still need to refresh their installed `@solidxai/core` / `@solidxai/core-ui` package builds after source changes if they are not linked live
36
+
37
+ ---
38
+
39
+ ## Archive Format
40
+
41
+ ### Extension
42
+
43
+ - `.sldx`
44
+
45
+ ### Expected logical structure
46
+
47
+ At minimum the archive must contain:
48
+
49
+ - `manifest.json`
50
+ - `solid-api/src/<module-name>/<module-name>.module.ts`
51
+ - `solid-api/src/<module-name>/metadata/<module-name>-metadata.json`
52
+ - `solid-ui/src/<module-name>/<module-name>.ui-module.ts`
53
+
54
+ Example:
55
+
56
+ ```text
57
+ manifest.json
58
+ solid-api/
59
+ src/
60
+ contact-management/
61
+ contact-management.module.ts
62
+ metadata/
63
+ contact-management-metadata.json
64
+ solid-ui/
65
+ src/
66
+ contact-management/
67
+ contact-management.ui-module.ts
68
+ ```
69
+
70
+ ### Supported archive variations
71
+
72
+ The validator/importer now supports:
73
+
74
+ - a flat archive with `manifest.json`, `solid-api`, and `solid-ui` at the root
75
+ - an archive wrapped in a single top-level folder, for example `contact-management/...`
76
+ - macOS Finder zip metadata like `__MACOSX/...` and `._*`, which are ignored during validation
77
+
78
+ ### Manifest expectations
79
+
80
+ The manifest format currently expects:
81
+
82
+ ```json
83
+ {
84
+ "schemaVersion": "1.0",
85
+ "packageType": "solidx-module",
86
+ "module": {
87
+ "name": "contact-management",
88
+ "displayName": "Contact Management",
89
+ "description": "..."
90
+ },
91
+ "contents": {
92
+ "metadataPath": "solid-api/src/contact-management/metadata/contact-management-metadata.json",
93
+ "apiModulePath": "solid-api/src/contact-management/contact-management.module.ts",
94
+ "uiModulePath": "solid-ui/src/contact-management/contact-management.ui-module.ts"
95
+ },
96
+ "postImport": {
97
+ "recommendedSteps": ["restart", "build", "seed"]
98
+ },
99
+ "checksums": {
100
+ "...": "sha256..."
101
+ }
102
+ }
103
+ ```
104
+
105
+ ### Current validation markers
106
+
107
+ Blocking validations:
108
+
109
+ - archive extension must be `.sldx`
110
+ - `manifest.json` must exist
111
+ - `manifest.json` must be valid JSON
112
+ - `manifest.packageType` must be `solidx-module`
113
+ - `manifest.schemaVersion` must be `1.0`
114
+ - `manifest.module.name` must be present
115
+ - `manifest.contents.*` must exactly match the expected conventional paths
116
+ - required files from `solid-api` and `solid-ui` must be physically present in the archive
117
+ - metadata JSON must be valid JSON
118
+ - metadata `moduleMetadata.name` must match `manifest.module.name` when present
119
+ - archive paths must be safe, no absolute paths or traversal (`..`)
120
+
121
+ Non-blocking warnings:
122
+
123
+ - missing checksums
124
+ - local conflicts where the target module already exists
125
+
126
+ ---
127
+
128
+ ## Backend Changes In `solid-core-module`
129
+
130
+ ### New files
131
+
132
+ - `src/controllers/module-package.controller.ts`
133
+ - `src/services/module-package.service.ts`
134
+ - `src/dtos/confirm-module-package-import.dto.ts`
135
+ - `src/dtos/run-module-package-build.dto.ts`
136
+ - `src/dtos/run-module-package-seed.dto.ts`
137
+
138
+ ### Registration changes
139
+
140
+ Registered into:
141
+
142
+ - `src/solid-core.module.ts`
143
+ - `src/index.ts`
144
+
145
+ ### New endpoints
146
+
147
+ Defined in `src/controllers/module-package.controller.ts`:
148
+
149
+ - `POST /module-packages/import/validate`
150
+ - `GET /module-packages/export/:moduleName`
151
+ - `POST /module-packages/import/:id/confirm`
152
+ - `GET /module-packages/import/:id/status`
153
+ - `POST /module-packages/import/:id/build`
154
+ - `POST /module-packages/import/:id/seed`
155
+
156
+ ### Runtime behavior
157
+
158
+ #### `validate`
159
+
160
+ `validateUpload()` in `src/services/module-package.service.ts`:
161
+
162
+ - accepts uploaded `.sldx` archive via Multer
163
+ - creates a transaction working directory
164
+ - moves uploaded file into the working directory
165
+ - reads archive entries using `unzip -Z1`
166
+ - extracts the archive
167
+ - normalizes root folder handling
168
+ - ignores macOS zip metadata entries
169
+ - validates manifest and required marker files
170
+ - computes preview payload for frontend
171
+ - writes transaction status JSON
172
+
173
+ #### `confirm`
174
+
175
+ `confirmImport()`:
176
+
177
+ - checks validation state and conflict state
178
+ - resolves extracted archive root
179
+ - copies `solid-api/src/<module>` into consuming app `solid-api/src/<module>`
180
+ - copies `solid-ui/src/<module>` into consuming app `solid-ui/src/<module>`
181
+ - updates status to `awaiting_restart`
182
+ - records step output
183
+
184
+ Important later fix:
185
+
186
+ - after successful copy, `extractDirPath` is deleted and nulled so extracted temp contents do not linger
187
+
188
+ #### `build`
189
+
190
+ `runBuild()`:
191
+
192
+ - can build `solid-api`
193
+ - can build `solid-ui`
194
+ - records combined command output into transaction status
195
+ - sets status to `build_succeeded` or `build_failed`
196
+ - does not throw away partial results
197
+
198
+ #### `seed`
199
+
200
+ `runSeed()`:
201
+
202
+ - resolves `ModuleMetadataSeederService` from the registered seeders in `SolidRegistry`
203
+ - seeds only the imported module name
204
+ - can optionally seed global metadata
205
+ - stores success/failure output in transaction status
206
+
207
+ ### Export behavior
208
+
209
+ `exportModulePackage()`:
210
+
211
+ - validates that existing module paths exist locally
212
+ - stages a package under temporary export working directory
213
+ - copies module folders from both `solid-api` and `solid-ui`
214
+ - generates `manifest.json`
215
+ - adds checksums for the required marker files
216
+ - zips the staged folder into `.sldx`
217
+
218
+ ### Archive handling improvements added during debugging
219
+
220
+ Added logic in `src/services/module-package.service.ts`:
221
+
222
+ - `detectArchiveRootPrefix()`
223
+ - `normalizeArchiveEntries()`
224
+ - `toArchiveEntryPath()`
225
+ - `isMacOsMetadataEntry()`
226
+
227
+ These were added because Finder-created archives often looked like:
228
+
229
+ - `contact-management/...`
230
+ - `__MACOSX/...`
231
+
232
+ Without this normalization the validator incorrectly reported a missing root manifest.
233
+
234
+ ### Latest build-scope fix
235
+
236
+ Original issue:
237
+
238
+ - module package working directories were stored under `solid-api/media-uploads/module-package-imports/...`
239
+ - the extracted tree contained `solid-ui/src/...` TypeScript files
240
+ - Nest build picked those files up and tried to compile them while building `solid-api`
241
+
242
+ User-observed example:
243
+
244
+ - `nest build` tried compiling extracted `contact-management.ui-module.ts` and `ContactRosterPage.tsx`
245
+
246
+ Source-level fix now in `src/services/module-package.service.ts`:
247
+
248
+ - module package runtime data no longer stages under `solid-api/media-uploads`
249
+ - new runtime root:
250
+ - `../.solidx-runtime/module-package-imports`
251
+ - `../.solidx-runtime/module-package-exports`
252
+ - optional override:
253
+ - `SOLIDX_MODULE_PACKAGE_RUNTIME_DIR`
254
+
255
+ This is implemented via:
256
+
257
+ - `getModulePackageRuntimeRoot()`
258
+ - `getModulePackageImportsRoot()`
259
+ - `getModulePackageExportsRoot()`
260
+
261
+ This prevents future archive staging from contaminating app source trees or TypeScript build inputs.
262
+
263
+ ---
264
+
265
+ ## Frontend Changes In `solid-core-ui`
266
+
267
+ ### Module package dialog
268
+
269
+ Main UI file:
270
+
271
+ - `src/components/core/module/ModulePackageDialog.tsx`
272
+
273
+ Styles:
274
+
275
+ - `src/components/core/module/ModulePackageDialog.css`
276
+
277
+ The dialog provides:
278
+
279
+ - `.sldx` upload via `react-dropzone`
280
+ - preview step before import
281
+ - archive summary and file tree
282
+ - conflict awareness and overwrite checkbox
283
+ - guided multi-step progress UX
284
+ - spinner, warning, success, and error states for each step
285
+ - final summary text after flow completion
286
+
287
+ ### Step flow in UI
288
+
289
+ The UI models four steps:
290
+
291
+ 1. Upload and place files
292
+ 2. Wait for service restart
293
+ 3. Build solid-api and solid-ui
294
+ 4. Seed module metadata
295
+
296
+ `pingBackendWithRetry()`:
297
+
298
+ - polls `/api/ping`
299
+ - currently retries `40` times with `1500ms` delay
300
+
301
+ Visual state types:
302
+
303
+ - `pending`
304
+ - `running`
305
+ - `success`
306
+ - `warning`
307
+ - `error`
308
+
309
+ ### RTK Query API additions
310
+
311
+ Added to `src/redux/api/moduleApi.ts`:
312
+
313
+ - `validateModulePackageImport`
314
+ - `confirmModulePackageImport`
315
+ - `getModulePackageImportStatus`
316
+ - `runModulePackageBuild`
317
+ - `runModulePackageSeed`
318
+ - `exportModulePackage`
319
+
320
+ Important frontend bug fix:
321
+
322
+ The backend responses are wrapped in `{ data: ... }`.
323
+
324
+ The module-package endpoints needed:
325
+
326
+ - `transformResponse: (response) => response?.data ?? response`
327
+
328
+ Without this, the preview dialog appeared empty even though backend validation was successful.
329
+
330
+ This was the root cause of the earlier state where:
331
+
332
+ - network response looked valid in DevTools
333
+ - `validation.valid` was `true`
334
+ - but the preview UI still showed attention state / empty sections
335
+
336
+ ### Stock list header button wiring
337
+
338
+ The final intended entry point is not the earlier custom `ModuleListViewData` toolbar.
339
+
340
+ The actual live route the user uses is:
341
+
342
+ - `/admin/core/solid-core/module-metadata/list`
343
+
344
+ That route resolves into stock list view behavior and uses seeded metadata.
345
+
346
+ Final wiring:
347
+
348
+ - `solid-core-module/src/seeders/seed-data/solid-core-metadata.json`
349
+ - `solid-core-ui/src/helpers/registry.ts`
350
+ - `solid-core-ui/src/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx`
351
+
352
+ Seeded `headerButtons` config for `moduleMetadata-list-view`:
353
+
354
+ - label: `Import Module`
355
+ - action: `ModuleImportListHeaderAction`
356
+ - openInPopup: `true`
357
+ - icon: `si-upload`
358
+ - closable: `false`
359
+ - popupWidth: `min(1180px, calc(100vw - 32px))`
360
+ - customComponentIsSystem: `true`
361
+
362
+ Extension registration:
363
+
364
+ - `registerExtensionComponent("ModuleImportListHeaderAction", ModuleImportListHeaderAction, ExtensionComponentTypes.listHeaderAction)`
365
+
366
+ Extension component behavior:
367
+
368
+ - renders `ModulePackageImportContent`
369
+ - closes the popup via `closePopup`
370
+ - refreshes registered list views via `listViewRegistry` after successful import
371
+
372
+ ### Note about older custom path still present
373
+
374
+ There is older custom import/export wiring still present in:
375
+
376
+ - `src/components/core/module/ModuleListViewData.tsx`
377
+
378
+ That was an earlier attempt before the user clarified the stock list view route. It is not the authoritative final entry point for the module metadata list view.
379
+
380
+ It still contains:
381
+
382
+ - direct dialog state
383
+ - export action handling
384
+ - extra button logic
385
+
386
+ Future cleanup decision:
387
+
388
+ - either delete this path if unused
389
+ - or keep it intentionally if another page still consumes `ModuleListViewData`
390
+
391
+ ### Global error behavior change
392
+
393
+ Changed in:
394
+
395
+ - `src/routes/AppEventListener.tsx`
396
+
397
+ Previous behavior:
398
+
399
+ - `AppEvents.GlobalError` redirected to dedicated error pages for 500/network failures
400
+
401
+ Current behavior:
402
+
403
+ - no redirect
404
+ - show toast only
405
+ - only active when current layout path starts with `/admin` or `/auth`
406
+
407
+ Dev-mode enhancement:
408
+
409
+ - checks `VITE_SOLIDX_ENV`
410
+ - if dev/development, toast includes detailed error payload
411
+ - can include status, message, response body, and stack
412
+ - dev toasts are sticky and longer-lived
413
+
414
+ Production-style behavior:
415
+
416
+ - only summary toast
417
+
418
+ This uses the existing toast SOP via:
419
+
420
+ - `src/redux/features/toastSlice.ts`
421
+
422
+ ---
423
+
424
+ ## Seed Metadata Changes In `solid-core-module`
425
+
426
+ The module metadata list view was updated in:
427
+
428
+ - `src/seeders/seed-data/solid-core-metadata.json`
429
+
430
+ Relevant change:
431
+
432
+ - `moduleMetadata-list-view` now has a `headerButtons` entry for the import action
433
+
434
+ This is what makes the standard list route surface the new header action without custom route-level UI replacement.
435
+
436
+ ---
437
+
438
+ ## Sample Module: `contact-management`
439
+
440
+ Created at:
441
+
442
+ - `contact-management/`
443
+
444
+ Purpose:
445
+
446
+ - provide a realistic module package to manually zip into `.sldx`
447
+ - exercise both API and UI module conventions
448
+ - include custom layout support rather than only CRUD defaults
449
+
450
+ ### Included structure
451
+
452
+ At minimum:
453
+
454
+ - `contact-management/manifest.json`
455
+ - `contact-management/solid-api/src/contact-management/contact-management.module.ts`
456
+ - `contact-management/solid-api/src/contact-management/metadata/contact-management-metadata.json`
457
+ - `contact-management/solid-ui/src/contact-management/contact-management.ui-module.ts`
458
+
459
+ Also created:
460
+
461
+ - API entities, DTOs, repositories, controller, service
462
+ - UI custom roster page and CSS
463
+ - multiple contact-book related models
464
+
465
+ The module models are centered around:
466
+
467
+ - contacts
468
+ - contact companies
469
+ - contact activities / interactions
470
+
471
+ ### Metadata alignment work
472
+
473
+ The sample files were tightened so metadata and generated code conventions match more closely:
474
+
475
+ - DTO validators aligned to field definitions
476
+ - date-like fields moved to `Date` with date validators where needed
477
+ - inverse relation DTO shapes added for consistency
478
+ - removed over-strict assumptions like `IsEmail` or `IsUrl` where not dictated by metadata
479
+ - manifest checksums added for required marker files
480
+
481
+ ### Archive file
482
+
483
+ Current generated archive for testing:
484
+
485
+ - `contact-management/contact-management.sldx`
486
+
487
+ It was rebuilt after earlier manifest and macOS zip issues.
488
+
489
+ ---
490
+
491
+ ## Debugging Timeline And Fixes
492
+
493
+ ### 1. Header action not visible
494
+
495
+ Initial issue:
496
+
497
+ - import button was added in custom module list view logic
498
+ - user was actually testing the stock list route from seeded metadata
499
+
500
+ Fix:
501
+
502
+ - moved to `headerButtons` metadata + extension component pattern
503
+
504
+ ### 2. Finder zip reported missing root manifest
505
+
506
+ Initial issue:
507
+
508
+ - macOS archive added top-level folder and `__MACOSX`
509
+ - validator looked only for strict root `manifest.json`
510
+
511
+ Fix:
512
+
513
+ - support root prefix normalization
514
+ - ignore `__MACOSX` and `._*`
515
+
516
+ ### 3. Preview showed empty state even when backend validation was valid
517
+
518
+ Initial issue:
519
+
520
+ - RTK Query endpoints returned wrapper response instead of `.data`
521
+
522
+ Fix:
523
+
524
+ - added `transformResponse` unwrapping for module package endpoints
525
+
526
+ ### 4. Consuming app appeared stale
527
+
528
+ Observed issue:
529
+
530
+ - code changes existed in package source and installed package tree
531
+ - browser still showed stale behavior
532
+
533
+ Likely reason:
534
+
535
+ - running Vite dev server had not restarted after package updates
536
+
537
+ Recommended action:
538
+
539
+ - restart consuming app dev server
540
+ - hard refresh browser
541
+
542
+ ### 5. Imported archive staging broke Nest build
543
+
544
+ Observed issue:
545
+
546
+ - extracted archive inside `solid-api/media-uploads/module-package-imports/...`
547
+ - `nest build` traversed extracted `solid-ui` TS/TSX files
548
+
549
+ Fixes:
550
+
551
+ - source-level fix in `solid-core-module` to move runtime staging to `../.solidx-runtime`
552
+ - defensive app-side fix in consuming app `solid-library-management/solid-api/tsconfig.build.json` to exclude `media-uploads`
553
+
554
+ The defensive app-side fix was added because earlier imported archives already existed there and would continue breaking builds until excluded or removed.
555
+
556
+ ---
557
+
558
+ ## Current Known Limitations
559
+
560
+ ### Restart / ping step UX
561
+
562
+ The import itself works and places files correctly.
563
+
564
+ However:
565
+
566
+ - when files are copied into `solid-ui/src`, Vite may restart
567
+ - the browser UI can reload
568
+ - the restart check/ping flow can be interrupted
569
+
570
+ This is why the user saw:
571
+
572
+ - import worked
573
+ - files/folders were created
574
+ - ping flow did not feel reliable
575
+
576
+ This is a UX/product gap, not primarily an archive validation issue.
577
+
578
+ Potential future improvements:
579
+
580
+ - persist transaction key in query param or local storage and resume status polling after reload
581
+ - use backend status endpoint more aggressively after UI restart
582
+ - decouple frontend app restart from post-import orchestration
583
+ - run build/seed from backend asynchronously and let UI reconnect
584
+
585
+ ### Package refresh in consuming projects
586
+
587
+ Source changes in `solid-core-module` and `solid-core-ui` do not automatically become active in consuming apps if those apps depend on local tarballs instead of live workspace links.
588
+
589
+ Another agent should verify, per consuming app:
590
+
591
+ - which `@solidxai/core` tarball is installed
592
+ - which `@solidxai/core-ui` tarball is installed
593
+ - whether a consuming app restart is still needed
594
+
595
+ ### Older `ModuleListViewData` implementation
596
+
597
+ This still exists and may confuse future agents if they search for import UI code first.
598
+
599
+ The final authoritative stock-list integration is:
600
+
601
+ - metadata `headerButtons`
602
+ - `ModuleImportListHeaderAction`
603
+
604
+ Not:
605
+
606
+ - the earlier button inside `ModuleListViewData`
607
+
608
+ ---
609
+
610
+ ## Files Most Important For Continuation
611
+
612
+ ### Backend
613
+
614
+ - `solid-core-module/src/services/module-package.service.ts`
615
+ - `solid-core-module/src/controllers/module-package.controller.ts`
616
+ - `solid-core-module/src/dtos/confirm-module-package-import.dto.ts`
617
+ - `solid-core-module/src/dtos/run-module-package-build.dto.ts`
618
+ - `solid-core-module/src/dtos/run-module-package-seed.dto.ts`
619
+ - `solid-core-module/src/seeders/seed-data/solid-core-metadata.json`
620
+ - `solid-core-module/src/solid-core.module.ts`
621
+ - `solid-core-module/src/index.ts`
622
+
623
+ ### Frontend
624
+
625
+ - `solid-core-ui/src/components/core/module/ModulePackageDialog.tsx`
626
+ - `solid-core-ui/src/components/core/module/ModulePackageDialog.css`
627
+ - `solid-core-ui/src/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx`
628
+ - `solid-core-ui/src/redux/api/moduleApi.ts`
629
+ - `solid-core-ui/src/helpers/registry.ts`
630
+ - `solid-core-ui/src/routes/AppEventListener.tsx`
631
+ - `solid-core-ui/src/redux/features/toastSlice.ts`
632
+
633
+ ### Sample/test assets
634
+
635
+ - `contact-management/manifest.json`
636
+ - `contact-management/contact-management.sldx`
637
+ - `contact-management/solid-api/src/contact-management/...`
638
+ - `contact-management/solid-ui/src/contact-management/...`
639
+
640
+ ### Consuming app defensive build fix
641
+
642
+ - `solid-library-management/solid-api/tsconfig.build.json`
643
+
644
+ ---
645
+
646
+ ## Suggested Next Steps For The Next Agent
647
+
648
+ 1. Stabilize the restart experience.
649
+
650
+ Possible direction:
651
+
652
+ - on successful confirm/import, persist transaction key
653
+ - if Vite reloads, reopen import progress view and call status endpoint
654
+ - continue with build/seed after reconnect
655
+
656
+ 2. Decide whether build and seed should be:
657
+
658
+ - UI-driven sequential calls after restart
659
+ - or backend-queued follow-up steps with resumable status polling
660
+
661
+ 3. Decide whether `ModuleListViewData.tsx` import/export code should be removed or retained.
662
+
663
+ 4. Verify consuming apps are actually using the latest local `@solidxai/core` and `@solidxai/core-ui` builds.
664
+
665
+ 5. Consider adding richer validation markers later:
666
+
667
+ - checksum verification instead of warning-only presence
668
+ - optional version compatibility checks
669
+ - optional manifest-declared dependencies
670
+
671
+ 6. If the experience should survive browser reloads, add transaction restoration support in the UI.
672
+
673
+ ---
674
+
675
+ ## Current Truth Snapshot
676
+
677
+ At the point this handoff note was written:
678
+
679
+ - custom backend controller/service for module package flow exists
680
+ - custom frontend dialog exists
681
+ - module metadata stock list view header button exists
682
+ - preview-before-import exists
683
+ - archive root wrapper and macOS zip handling exists
684
+ - import works and copies files correctly
685
+ - build and seed endpoints exist
686
+ - global error redirects were replaced with toasts for `/admin` and `/auth`
687
+ - sample `contact-management` module and `.sldx` archive exist
688
+ - the `solid-api/media-uploads` build contamination bug has been fixed at source level in `solid-core-module`
689
+ - a defensive `media-uploads` exclusion was also added in `solid-library-management/solid-api/tsconfig.build.json`
690
+
691
+ The biggest remaining problem is not archive structure anymore. It is the restart/resume UX once `solid-ui` changes trigger frontend/dev-server churn.