@warpgogol/werkstatt-shared 0.13.0 → 0.14.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 (178) hide show
  1. package/README.md +26 -16
  2. package/README.uk.md +24 -14
  3. package/package.json +27 -69
  4. package/src/checks/result-helpers.ts +21 -4
  5. package/src/checks/tests/remediation-auto-populate.test.ts +83 -0
  6. package/src/integration/funnel.ts +78 -1
  7. package/src/integration/index.ts +19 -2
  8. package/src/integration/lagebild-ingress.ts +169 -0
  9. package/src/integration/orchestration.ts +7 -13
  10. package/src/integration/port-barrel.ts +9 -28
  11. package/src/integration/tests/funnel-bridge.test.ts +7 -7
  12. package/src/integration/tests/lagebild-ingress.test.ts +118 -0
  13. package/src/integration/vitest.config.ts +7 -0
  14. package/src/observability/typed-refs.ts +1 -1
  15. package/src/ontology/analytics/matomo-fleet.registry.yaml +1 -1
  16. package/src/ontology/archetypes/index.json +12 -9
  17. package/src/ontology/archetypes/index.yaml +26 -10
  18. package/src/ontology/blueprints/website-local.yaml +11 -11
  19. package/src/ontology/blueprints/website-service.yaml +20 -20
  20. package/src/ontology/capabilities/lead.submit.yaml +2 -2
  21. package/src/ontology/enums.ts +2 -2
  22. package/src/ontology/external-surfaces/jsonld-types.yaml +14 -14
  23. package/src/ontology/external-surfaces/url-schema.yaml +1 -1
  24. package/src/ontology/index.ts +2 -0
  25. package/src/ontology/manifest.ts +19 -0
  26. package/src/ontology/schemas/index.ts +7 -2
  27. package/src/ontology/schemas/system/integrations.ts +1 -1
  28. package/src/ontology/schemas/system/manifest.ts +38 -1
  29. package/src/ontology/schemas/system/tests/growth.test.ts +22 -0
  30. package/src/ontology/schemas/system/tests/integrations.test.ts +12 -0
  31. package/src/ontology/schemas/system/tests/manifest.test.ts +22 -0
  32. package/src/ontology/schemas/system/tests/page-output.test.ts +13 -0
  33. package/src/ontology/schemas/system/tests/release.test.ts +22 -0
  34. package/src/ontology/schemas/system/tests/text.test.ts +18 -0
  35. package/src/ontology/schemas/system/tests/verification.test.ts +12 -0
  36. package/src/ontology/schemas/system.ts +7 -2
  37. package/src/ontology/schemas/tests/biome.test.ts +19 -0
  38. package/src/ontology/schemas/tests/capability.test.ts +22 -0
  39. package/src/ontology/schemas/tests/constellation.test.ts +22 -0
  40. package/src/ontology/schemas/tests/dns-records.test.ts +13 -0
  41. package/src/ontology/schemas/tests/manifest-resolver.test.ts +13 -0
  42. package/src/ontology/schemas/tests/page-entry.test.ts +22 -0
  43. package/src/ontology/schemas/tests/section-archetype.test.ts +12 -0
  44. package/src/ontology/schemas/tests/site-family.test.ts +18 -0
  45. package/src/ontology/schemas/tests/system.test.ts +20 -0
  46. package/src/ontology/shared-section-props/common.ts +11 -0
  47. package/src/ontology/shared-section-props/visual-header.ts +1 -1
  48. package/src/share/agent/api-catalog.ts +5 -0
  49. package/src/share/agent/ard-catalog.ts +14 -0
  50. package/src/share/agent/index.ts +2 -0
  51. package/src/share/agent/manifest.ts +25 -2
  52. package/src/share/agent/mcp-card.ts +4 -0
  53. package/src/share/agent/openapi.ts +78 -0
  54. package/src/share/agent/search.test.ts +188 -0
  55. package/src/share/agent/search.ts +164 -0
  56. package/src/share/agent/tests/api-catalog.test.ts +8 -0
  57. package/src/share/agent/tests/ard-catalog.test.ts +8 -0
  58. package/src/share/agent/tests/capability.test.ts +14 -0
  59. package/src/share/agent/tests/fleet-catalog.test.ts +15 -0
  60. package/src/share/agent/tests/knowledge.test.ts +20 -0
  61. package/src/share/agent/tests/manifest.test.ts +9 -0
  62. package/src/share/agent/tests/mcp-card.test.ts +8 -0
  63. package/src/share/agent/tests/omit-empty.test.ts +33 -0
  64. package/src/share/agent/tests/openapi.test.ts +8 -0
  65. package/src/share/agent/tests/proof.test.ts +15 -0
  66. package/src/share/env.d.ts +0 -4
  67. package/src/share/knowledge/tests/claim.test.ts +11 -0
  68. package/src/share/knowledge/tests/derivation.test.ts +30 -0
  69. package/src/share/knowledge/tests/freshness.test.ts +18 -0
  70. package/src/share/knowledge/tests/ledger.test.ts +35 -0
  71. package/src/share/knowledge/tests/plan.test.ts +19 -0
  72. package/src/share/knowledge/tests/source.test.ts +19 -0
  73. package/src/share/remediation/remediation-catalog.ts +196 -0
  74. package/src/share/schemas/effects.ts +16 -0
  75. package/src/share/schemas/media.ts +4 -0
  76. package/src/share/schemas/section-shell.ts +2 -1
  77. package/src/share/schemas/tests/claim-records.test.ts +52 -0
  78. package/src/share/schemas/tests/claims.test.ts +23 -0
  79. package/src/share/schemas/tests/effects.test.ts +116 -0
  80. package/src/share/schemas/tests/features.test.ts +61 -0
  81. package/src/share/schemas/tests/horizontal-align.test.ts +16 -0
  82. package/src/share/schemas/tests/icon-color.test.ts +16 -0
  83. package/src/share/schemas/tests/live-photo.test.ts +40 -0
  84. package/src/share/schemas/tests/material-credit.test.ts +51 -0
  85. package/src/share/schemas/tests/media.test.ts +26 -0
  86. package/src/share/schemas/tests/navigation.test.ts +58 -0
  87. package/src/share/schemas/tests/page-base.test.ts +19 -0
  88. package/src/share/schemas/tests/participant.test.ts +26 -0
  89. package/src/share/schemas/tests/person.test.ts +12 -0
  90. package/src/share/schemas/tests/print.test.ts +30 -0
  91. package/src/share/schemas/tests/section-background.test.ts +31 -0
  92. package/src/share/schemas/tests/section-body.test.ts +16 -0
  93. package/src/share/schemas/tests/section-cards.test.ts +17 -0
  94. package/src/share/schemas/tests/section-cta.test.ts +41 -0
  95. package/src/share/schemas/tests/section-header.test.ts +31 -0
  96. package/src/share/schemas/tests/section-image.test.ts +24 -0
  97. package/src/share/schemas/tests/section-motion.test.ts +29 -0
  98. package/src/share/schemas/tests/section-shell.test.ts +42 -0
  99. package/src/share/schemas/tests/section-stats.test.ts +17 -0
  100. package/src/share/schemas/tests/site-background.test.ts +33 -0
  101. package/src/share/schemas/tests/standard-list-item.test.ts +16 -0
  102. package/src/share/scripts/external-link-qr.ts +9 -1
  103. package/src/share/scripts/gsap-counter.ts +2 -0
  104. package/src/share/scripts/inline-number-animation.ts +2 -0
  105. package/src/share/scripts/live-photos.ts +2 -0
  106. package/src/share/scripts/tests/external-link-qr.test.ts +8 -0
  107. package/src/share/scripts/tests/external-links.test.ts +25 -0
  108. package/src/share/scripts/tests/gsap-counter.test.ts +8 -0
  109. package/src/share/scripts/tests/gsap-mountain-journey.test.ts +8 -0
  110. package/src/share/scripts/tests/gsap-parallax.test.ts +8 -0
  111. package/src/share/scripts/tests/gsap-reveal.test.ts +8 -0
  112. package/src/share/scripts/tests/gsap-stagger.test.ts +8 -0
  113. package/src/share/scripts/tests/inline-number-animation.test.ts +8 -0
  114. package/src/share/scripts/tests/lenis.test.ts +8 -0
  115. package/src/share/scripts/tests/live-photos.test.ts +8 -0
  116. package/src/share/scripts/tests/lordicon.test.ts +8 -0
  117. package/src/share/scripts/tests/orchestrator.test.ts +8 -0
  118. package/src/share/scripts/tests/scheduler.test.ts +23 -0
  119. package/src/share/scripts/video-player.test.ts +210 -0
  120. package/src/share/scripts/video-player.ts +73 -13
  121. package/src/share/semantic/extract.ts +25 -1
  122. package/src/share/semantic/jsonld/tests/article.test.ts +89 -0
  123. package/src/share/semantic/jsonld/tests/breadcrumb.test.ts +62 -0
  124. package/src/share/semantic/jsonld/tests/collection-list.test.ts +39 -0
  125. package/src/share/semantic/jsonld/tests/faq.test.ts +60 -0
  126. package/src/share/semantic/jsonld/tests/initiative.test.ts +56 -0
  127. package/src/share/semantic/jsonld/tests/organization.test.ts +123 -0
  128. package/src/share/semantic/jsonld/tests/person.test.ts +89 -0
  129. package/src/share/semantic/jsonld/tests/service.test.ts +65 -0
  130. package/src/share/semantic/jsonld/tests/shared.test.ts +41 -0
  131. package/src/share/semantic/jsonld/tests/video.test.ts +84 -0
  132. package/src/share/semantic/jsonld/tests/webpage.test.ts +93 -0
  133. package/src/share/semantic/jsonld/tests/website.test.ts +27 -0
  134. package/src/share/semantic/jsonld/types.ts +1 -0
  135. package/src/share/semantic/models.ts +1 -0
  136. package/src/share/semantic/tests/ai.test.ts +55 -0
  137. package/src/share/semantic/tests/block-extraction.test.ts +34 -0
  138. package/src/share/semantic/tests/breadcrumbs.test.ts +127 -0
  139. package/src/share/semantic/tests/build-page.test.ts +122 -0
  140. package/src/share/semantic/tests/business-projection.test.ts +188 -0
  141. package/src/share/semantic/tests/derived-prices-loader.test.ts +46 -0
  142. package/src/share/semantic/tests/extract.test.ts +126 -0
  143. package/src/share/semantic/tests/feed.test.ts +113 -0
  144. package/src/share/semantic/tests/helpers.ts +32 -0
  145. package/src/share/semantic/tests/ids.test.ts +118 -0
  146. package/src/share/semantic/tests/image-sitemap.test.ts +109 -0
  147. package/src/share/semantic/tests/jsonld.test.ts +61 -0
  148. package/src/share/semantic/tests/llms-policy.test.ts +60 -0
  149. package/src/share/semantic/tests/llms.test.ts +118 -0
  150. package/src/share/semantic/tests/markdown-hygiene.test.ts +72 -0
  151. package/src/share/semantic/tests/markdown-page.test.ts +97 -0
  152. package/src/share/semantic/tests/markdown-twin-provenance.test.ts +152 -0
  153. package/src/share/semantic/tests/organization-profile.test.ts +107 -0
  154. package/src/share/semantic/tests/output-projection.test.ts +77 -0
  155. package/src/share/semantic/tests/page-markdown.test.ts +98 -0
  156. package/src/share/semantic/tests/page-utils.test.ts +88 -0
  157. package/src/share/semantic/tests/price-marker-resolver.test.ts +88 -0
  158. package/src/share/semantic/tests/robots.test.ts +70 -0
  159. package/src/share/semantic/tests/split-sentences.test.ts +57 -0
  160. package/src/share/semantic/tests/update-stamp.test.ts +102 -0
  161. package/src/share/tests/manifest.test.ts +51 -0
  162. package/src/share/tests/openapi.test.ts +30 -0
  163. package/src/share/types/qrcode-browser.d.ts +18 -0
  164. package/src/share/utility-registry.yaml +16 -2
  165. package/src/integration/crm-buffer.ts +0 -491
  166. package/src/integration-adapter-supabase-crm/adapter.ts +0 -437
  167. package/src/integration-adapter-supabase-crm/client.ts +0 -605
  168. package/src/integration-adapter-supabase-crm/index.ts +0 -28
  169. package/src/integration-adapter-supabase-crm/pipedrive-sync-target.ts +0 -482
  170. package/src/integration-adapter-supabase-crm/supabase-rest.ts +0 -89
  171. package/src/integration-adapter-supabase-crm/tenant-registry.ts +0 -334
  172. package/src/integration-adapter-supabase-crm/tests/change-balance.pbt.test.ts +0 -83
  173. package/src/integration-adapter-supabase-crm/tests/funnel-persistence.test.ts +0 -409
  174. package/src/integration-adapter-supabase-crm/tests/lifecycle-sync.test.ts +0 -288
  175. package/src/integration-adapter-supabase-crm/tests/stage-map.test.ts +0 -80
  176. package/src/integration-adapter-supabase-crm/vitest.config.ts +0 -8
  177. package/src/integration-adapter-supabase-crm/worker.ts +0 -223
  178. package/src/ontology/archetypes/components/currency-selector.yaml +0 -19
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  Stack-agnostic shared infrastructure extracted from `werkstatt-site` (RFC-0868). Owns checks, integration, ontology, passport, share, and surface domains consumed by both the Werkstatt engine and the site plugin.
6
6
 
7
+ > Engineered at [Warpgogol](https://warpgogol.com) · Released as open source.
8
+
7
9
  ---
8
10
 
9
11
  ## What this package does
@@ -62,36 +64,36 @@ const url = slugUrl("Über uns", "de"); // "ueber-uns"
62
64
 
63
65
  ### Semantic extraction (RFC-0901)
64
66
 
65
- | Export | Purpose |
66
- | --- | --- |
67
+ | Export | Purpose |
68
+ | ------------------------------- | ----------------------------------------------------------- |
67
69
  | `splitSentences(text, locale?)` | Locale-aware sentence boundary detection (`de`, `uk`, `en`) |
68
70
 
69
71
  ### Canonical entity URL (RFC-0910)
70
72
 
71
- | Export | Purpose |
72
- | --- | --- |
73
+ | Export | Purpose |
74
+ | --------------------------- | ----------------------------------------------- |
73
75
  | `canonicalRootUrl(baseUrl)` | Unprefixed root URL for JSON-LD entity identity |
74
76
 
75
77
  ### Placeholder route filtering (RFC-0917)
76
78
 
77
- | Export | Purpose |
78
- | --- | --- |
79
+ | Export | Purpose |
80
+ | ------------------------------ | ------------------------------------------------------------ |
79
81
  | `hasPlaceholderRoutes(routes)` | Detect Astro dynamic route templates (`[slug]`, `[version]`) |
80
82
 
81
83
  ---
82
84
 
83
85
  ## Architecture
84
86
 
85
- | Directory | Purpose |
86
- | --- | --- |
87
- | `src/index.ts` | Main barrel export |
88
- | `src/checks/` | Content validators, SEO validators, surface expand/bake |
89
- | `src/integration/` | CRM, funnel, hub, sharding, QStash adapters |
90
- | `src/ontology/` | Catalogs, enums, Sternsystem owner types |
91
- | `src/passport/` | DHT signing, identity signing, schema validation |
92
- | `src/share/` | Slug, semantic, URL canonicalization, routes, middleware, access protection |
93
- | `src/surface/` | Surface expand/bake helpers and labels |
94
- | `src/content/` | SystemManifest types and content schema |
87
+ | Directory | Purpose |
88
+ | ------------------ | --------------------------------------------------------------------------- |
89
+ | `src/index.ts` | Main barrel export |
90
+ | `src/checks/` | Content validators, SEO validators, surface expand/bake |
91
+ | `src/integration/` | CRM, funnel, hub, sharding, QStash adapters |
92
+ | `src/ontology/` | Catalogs, enums, Sternsystem owner types |
93
+ | `src/passport/` | DHT signing, identity signing, schema validation |
94
+ | `src/share/` | Slug, semantic, URL canonicalization, routes, middleware, access protection |
95
+ | `src/surface/` | Surface expand/bake helpers and labels |
96
+ | `src/content/` | SystemManifest types and content schema |
95
97
 
96
98
  ---
97
99
 
@@ -133,3 +135,11 @@ After CI completes, verify the new version on [npmjs.com/package/@warpgogol/werk
133
135
  ## License
134
136
 
135
137
  Apache-2.0
138
+
139
+ ## Open Engineering
140
+
141
+ This package originated from production engineering work at [Warpgogol](https://warpgogol.com), an engineering studio in Germany.
142
+
143
+ We publish reusable parts of our infrastructure when they can be useful beyond our own projects. It is published independently of any Warpgogol commercial service. Using this package does not create any dependency on Warpgogol.
144
+
145
+ Built for real systems. Shared openly.
package/README.uk.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  Спільна інфраструктура, незалежна від стеку, витягнута з `werkstatt-site` (RFC-0868). Володіє доменами checks, integration, ontology, passport, share та surface, які споживають рушій Werkstatt та site-плагін.
6
6
 
7
+ > Розроблено в [Warpgogol](https://warpgogol.com) · Опубліковано як open source.
8
+
7
9
  ---
8
10
 
9
11
  ## Що робить цей пакет
@@ -62,14 +64,14 @@ const url = slugUrl("Über uns", "de"); // "ueber-uns"
62
64
 
63
65
  ### Семантична екстракція (RFC-0901)
64
66
 
65
- | Експорт | Призначення |
66
- | --- | --- |
67
+ | Експорт | Призначення |
68
+ | ------------------------------- | ---------------------------------------------------- |
67
69
  | `splitSentences(text, locale?)` | Локалізоване виявлення меж речень (`de`, `uk`, `en`) |
68
70
 
69
71
  ### Канонічний URL сутності (RFC-0910)
70
72
 
71
- | Експорт | Призначення |
72
- | --- | --- |
73
+ | Експорт | Призначення |
74
+ | --------------------------- | --------------------------------------------------------------- |
73
75
  | `canonicalRootUrl(baseUrl)` | Непрефіксований кореневий URL для JSON-LD ідентичності сутності |
74
76
 
75
77
  ### Фільтрація плейсхолдер-маршрутів (RFC-0917)
@@ -82,16 +84,16 @@ const url = slugUrl("Über uns", "de"); // "ueber-uns"
82
84
 
83
85
  ## Архітектура
84
86
 
85
- | Директорія | Призначення |
86
- | --- | --- |
87
- | `src/index.ts` | Головний barrel-експорт |
88
- | `src/checks/` | Валідатори контенту, SEO-валідатори, surface expand/bake |
89
- | `src/integration/` | Адаптери CRM, funnel, hub, sharding, QStash |
90
- | `src/ontology/` | Каталоги, enum-и, типи Sternsystem owner |
91
- | `src/passport/` | DHT-підписування, підписування ідентичності, валідація схем |
92
- | `src/share/` | Slug, семантика, канонізація URL, маршрути, middleware, захист доступу |
93
- | `src/surface/` | Хелпери surface expand/bake та мітки |
94
- | `src/content/` | Типи SystemManifest та схема контенту |
87
+ | Директорія | Призначення |
88
+ | ------------------ | ---------------------------------------------------------------------- |
89
+ | `src/index.ts` | Головний barrel-експорт |
90
+ | `src/checks/` | Валідатори контенту, SEO-валідатори, surface expand/bake |
91
+ | `src/integration/` | Адаптери CRM, funnel, hub, sharding, QStash |
92
+ | `src/ontology/` | Каталоги, enum-и, типи Sternsystem owner |
93
+ | `src/passport/` | DHT-підписування, підписування ідентичності, валідація схем |
94
+ | `src/share/` | Slug, семантика, канонізація URL, маршрути, middleware, захист доступу |
95
+ | `src/surface/` | Хелпери surface expand/bake та мітки |
96
+ | `src/content/` | Типи SystemManifest та схема контенту |
95
97
 
96
98
  ---
97
99
 
@@ -133,3 +135,11 @@ pnpm exec repo-extract --config packages/werkstatt-shared/extract.config.yaml --
133
135
  ## Ліцензія
134
136
 
135
137
  Apache-2.0
138
+
139
+ ## Відкрита інженерія
140
+
141
+ Цей пакет походить із виробничої інженерної роботи в [Warpgogol](https://warpgogol.com), інженерній студії в Німеччині.
142
+
143
+ Ми публікуємо багаторазові частини нашої інфраструктури, коли вони можуть бути корисними поза нашими власними проєктами. Він публікується незалежно від будь-якого комерційного сервісу Warpgogol. Використання цього пакету не створює жодної залежності від Warpgogol.
144
+
145
+ Створено для реальних систем. Поширюється відкрито.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warpgogol/werkstatt-shared",
3
- "version": "0.13.0",
3
+ "version": "0.14.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -66,22 +66,6 @@
66
66
  "types": "./src/integration/index.ts",
67
67
  "default": "./src/integration/index.ts"
68
68
  },
69
- "./integration-adapter-supabase-crm": {
70
- "types": "./src/integration-adapter-supabase-crm/index.ts",
71
- "default": "./src/integration-adapter-supabase-crm/index.ts"
72
- },
73
- "./integration-adapter-supabase-crm/tenant-registry": {
74
- "types": "./src/integration-adapter-supabase-crm/tenant-registry.ts",
75
- "default": "./src/integration-adapter-supabase-crm/tenant-registry.ts"
76
- },
77
- "./integration-adapter-supabase-crm/worker": {
78
- "types": "./src/integration-adapter-supabase-crm/worker.ts",
79
- "default": "./src/integration-adapter-supabase-crm/worker.ts"
80
- },
81
- "./integration/crm-buffer": {
82
- "types": "./src/integration/crm-buffer.ts",
83
- "default": "./src/integration/crm-buffer.ts"
84
- },
85
69
  "./integration/port": {
86
70
  "types": "./src/integration/port.ts",
87
71
  "default": "./src/integration/port.ts"
@@ -278,6 +262,10 @@
278
262
  "types": "./src/share/redirects.ts",
279
263
  "default": "./src/share/redirects.ts"
280
264
  },
265
+ "./share/remediation": {
266
+ "types": "./src/share/remediation/remediation-catalog.ts",
267
+ "default": "./src/share/remediation/remediation-catalog.ts"
268
+ },
281
269
  "./share/rfc0042-utils": {
282
270
  "types": "./src/share/rfc0042-utils.ts",
283
271
  "default": "./src/share/rfc0042-utils.ts"
@@ -414,30 +402,6 @@
414
402
  "types": "./src/integration/vitest.config.ts",
415
403
  "default": "./src/integration/vitest.config.ts"
416
404
  },
417
- "./integration-adapter-supabase-crm/adapter": {
418
- "types": "./src/integration-adapter-supabase-crm/adapter.ts",
419
- "default": "./src/integration-adapter-supabase-crm/adapter.ts"
420
- },
421
- "./integration-adapter-supabase-crm/client": {
422
- "types": "./src/integration-adapter-supabase-crm/client.ts",
423
- "default": "./src/integration-adapter-supabase-crm/client.ts"
424
- },
425
- "./integration-adapter-supabase-crm/index": {
426
- "types": "./src/integration-adapter-supabase-crm/index.ts",
427
- "default": "./src/integration-adapter-supabase-crm/index.ts"
428
- },
429
- "./integration-adapter-supabase-crm/pipedrive-sync-target": {
430
- "types": "./src/integration-adapter-supabase-crm/pipedrive-sync-target.ts",
431
- "default": "./src/integration-adapter-supabase-crm/pipedrive-sync-target.ts"
432
- },
433
- "./integration-adapter-supabase-crm/supabase-rest": {
434
- "types": "./src/integration-adapter-supabase-crm/supabase-rest.ts",
435
- "default": "./src/integration-adapter-supabase-crm/supabase-rest.ts"
436
- },
437
- "./integration-adapter-supabase-crm/vitest.config": {
438
- "types": "./src/integration-adapter-supabase-crm/vitest.config.ts",
439
- "default": "./src/integration-adapter-supabase-crm/vitest.config.ts"
440
- },
441
405
  "./observability/conventions": {
442
406
  "types": "./src/observability/conventions.ts",
443
407
  "default": "./src/observability/conventions.ts"
@@ -670,6 +634,10 @@
670
634
  "types": "./src/share/agent/proof.ts",
671
635
  "default": "./src/share/agent/proof.ts"
672
636
  },
637
+ "./share/agent/search": {
638
+ "types": "./src/share/agent/search.ts",
639
+ "default": "./src/share/agent/search.ts"
640
+ },
673
641
  "./share/content/entity-id": {
674
642
  "types": "./src/share/content/entity-id.ts",
675
643
  "default": "./src/share/content/entity-id.ts"
@@ -1126,22 +1094,6 @@
1126
1094
  "types": "./src/integration/tests/sharding.test.ts",
1127
1095
  "default": "./src/integration/tests/sharding.test.ts"
1128
1096
  },
1129
- "./integration-adapter-supabase-crm/tests/change-balance.pbt.test": {
1130
- "types": "./src/integration-adapter-supabase-crm/tests/change-balance.pbt.test.ts",
1131
- "default": "./src/integration-adapter-supabase-crm/tests/change-balance.pbt.test.ts"
1132
- },
1133
- "./integration-adapter-supabase-crm/tests/funnel-persistence.test": {
1134
- "types": "./src/integration-adapter-supabase-crm/tests/funnel-persistence.test.ts",
1135
- "default": "./src/integration-adapter-supabase-crm/tests/funnel-persistence.test.ts"
1136
- },
1137
- "./integration-adapter-supabase-crm/tests/lifecycle-sync.test": {
1138
- "types": "./src/integration-adapter-supabase-crm/tests/lifecycle-sync.test.ts",
1139
- "default": "./src/integration-adapter-supabase-crm/tests/lifecycle-sync.test.ts"
1140
- },
1141
- "./integration-adapter-supabase-crm/tests/stage-map.test": {
1142
- "types": "./src/integration-adapter-supabase-crm/tests/stage-map.test.ts",
1143
- "default": "./src/integration-adapter-supabase-crm/tests/stage-map.test.ts"
1144
- },
1145
1097
  "./observability/tests/conventions.test": {
1146
1098
  "types": "./src/observability/tests/conventions.test.ts",
1147
1099
  "default": "./src/observability/tests/conventions.test.ts"
@@ -1349,6 +1301,10 @@
1349
1301
  "./share/scripts": {
1350
1302
  "types": "./src/share/scripts/index.ts",
1351
1303
  "default": "./src/share/scripts/index.ts"
1304
+ },
1305
+ "./integration/lagebild-ingress": {
1306
+ "types": "./src/integration/lagebild-ingress.ts",
1307
+ "default": "./src/integration/lagebild-ingress.ts"
1352
1308
  }
1353
1309
  },
1354
1310
  "scripts": {
@@ -1357,6 +1313,7 @@
1357
1313
  "build": "pnpm exec tsc -p tsconfig.json --noEmit",
1358
1314
  "build:check": "pnpm exec tsc -p tsconfig.json --noEmit",
1359
1315
  "test": "vitest run",
1316
+ "test:coverage": "vitest run --coverage",
1360
1317
  "test:watch": "vitest"
1361
1318
  },
1362
1319
  "publishConfig": {
@@ -1368,18 +1325,18 @@
1368
1325
  ],
1369
1326
  "dependencies": {
1370
1327
  "@lordicon/element": "^2.3.1",
1328
+ "@sindresorhus/slugify": "^3.0.0",
1371
1329
  "@warpgogol/werkstatt-engine": "*",
1372
1330
  "ajv": "^8.20.0",
1373
1331
  "bs58": "^6.0.0",
1374
- "@sindresorhus/slugify": "^3.0.0",
1375
1332
  "cyrillic-to-translit-js": "^3.2.1",
1376
1333
  "expr-eval": "^2.0.2",
1377
1334
  "github-slugger": "^2.0.0",
1378
- "hls.js": "^1.6.16",
1379
- "lenis": "^1.3.25",
1335
+ "gray-matter": "^4.0.3",
1336
+ "hls.js": "^1.7.1",
1337
+ "lenis": "^1.3.26",
1380
1338
  "plyr": "^3.8.4",
1381
1339
  "qrcode": "^1.5.4",
1382
- "gray-matter": "^4.0.3",
1383
1340
  "yaml": "^2.9.0",
1384
1341
  "zod": "^4.4.3"
1385
1342
  },
@@ -1387,18 +1344,19 @@
1387
1344
  "@syrokomskyi/axiom-study": "link:../../../pipelines/packages/axiom/axiom-study"
1388
1345
  },
1389
1346
  "devDependencies": {
1390
- "@astrojs/markdown-remark": "^7.0.0",
1391
- "@cloudflare/workers-types": "^5.20260801.1",
1392
- "@types/node": "^24.0.0",
1347
+ "@astrojs/markdown-remark": "^7.2.4",
1348
+ "@cloudflare/workers-types": "^5.20260823.1",
1349
+ "@types/node": "^26.2.0",
1350
+ "@types/qrcode": "^1.5.6",
1393
1351
  "@warpgogol/werkstatt-engine": "*",
1394
- "astro": "^7.2.0",
1395
- "eslint": "^10.8.0",
1352
+ "astro": "^7.2.4",
1353
+ "eslint": "^10.9.0",
1396
1354
  "fast-check": "^4.9.0",
1397
1355
  "gsap": "^3.15.0",
1398
- "@types/qrcode": "^1.5.5",
1399
1356
  "typescript": "^6.0.3",
1400
- "typescript-eslint": "8.65.0",
1401
- "vitest": "^4.1.10"
1357
+ "typescript-eslint": "8.68.0",
1358
+ "@vitest/coverage-v8": "^4.1.11",
1359
+ "vitest": "^4.1.11"
1402
1360
  },
1403
1361
  "packageManager": "pnpm@11.10.0"
1404
1362
  }
@@ -13,6 +13,7 @@ ruleId = command; diagnosticsResult takes rich Diagnostic[] with registered ids.
13
13
  </MODULE_CONTRACT>
14
14
  <CHANGE_SUMMARY>
15
15
  <item>RFC-0029 review: Initial creation to fix systemic exit-code bug across check files.</item>
16
+ <item>RFC-1027: Auto-populate Diagnostic.remediation from REMEDIATION_CATALOG in diagnosticsResult().</item>
16
17
  </CHANGE_SUMMARY>
17
18
  */
18
19
 
@@ -22,6 +23,7 @@ import type {
22
23
  KernelCommandResult,
23
24
  KernelNextStep,
24
25
  } from "@warpgogol/werkstatt-engine/kernel";
26
+ import { lookupRemediation } from "../share/remediation/remediation-catalog.ts";
25
27
 
26
28
  function defaultFailNextSteps(command: string): KernelNextStep[] {
27
29
  return [
@@ -66,10 +68,25 @@ export function diagnosticsResult(
66
68
  diagnostics: Diagnostic[],
67
69
  nextSteps?: KernelNextStep[],
68
70
  ): KernelCommandResult<CheckResult> {
71
+ const enrichedDiagnostics = diagnostics.map((d) => {
72
+ if (d.remediation) return d;
73
+ const pattern = lookupRemediation(d.ruleId);
74
+ if (!pattern) return d;
75
+ return {
76
+ ...d,
77
+ remediation: {
78
+ ruleId: pattern.ruleId,
79
+ action: pattern.action,
80
+ ...(pattern.template !== undefined && { template: pattern.template }),
81
+ ...(pattern.docRef !== undefined && { docRef: pattern.docRef }),
82
+ ...(pattern.targetFiles !== undefined && { targetFiles: pattern.targetFiles }),
83
+ },
84
+ };
85
+ });
69
86
  const summary = {
70
- error: diagnostics.filter((d) => d.severity === "error").length,
71
- warning: diagnostics.filter((d) => d.severity === "warning").length,
72
- info: diagnostics.filter((d) => d.severity === "info").length,
87
+ error: enrichedDiagnostics.filter((d) => d.severity === "error").length,
88
+ warning: enrichedDiagnostics.filter((d) => d.severity === "warning").length,
89
+ info: enrichedDiagnostics.filter((d) => d.severity === "info").length,
73
90
  };
74
91
  const status: CheckResult["status"] =
75
92
  summary.error > 0 ? "fail" : summary.warning > 0 ? "warn" : "pass";
@@ -77,7 +94,7 @@ export function diagnosticsResult(
77
94
  nextSteps ?? (summary.error > 0 ? defaultFailNextSteps(command) : undefined);
78
95
  const counts = formatCounts(summary.error, summary.warning);
79
96
  return {
80
- data: { command, status, diagnostics, summary },
97
+ data: { command, status, diagnostics: enrichedDiagnostics, summary },
81
98
  exitCode: summary.error > 0 ? 1 : 0,
82
99
  summary: counts ? `[${command}] ${counts}` : `[${command}]`,
83
100
  nextSteps: resolvedNextSteps,
@@ -0,0 +1,83 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>RFC-1027: unit tests for diagnosticsResult() remediation auto-population.</purpose>
4
+ </MODULE_CONTRACT>
5
+ <CHANGE_SUMMARY>
6
+ <item>RFC-1027: initial tests for remediation auto-population from REMEDIATION_CATALOG.</item>
7
+ </CHANGE_SUMMARY>
8
+ */
9
+
10
+ import { test, expect } from "vitest";
11
+ import { diagnosticsResult } from "../result-helpers.ts";
12
+ import type { Diagnostic } from "@warpgogol/werkstatt-engine/kernel";
13
+
14
+ test("diagnosticsResult: auto-populates remediation from catalog for known ruleId", () => {
15
+ const diagnostics: Diagnostic[] = [
16
+ {
17
+ ruleId: "GEN-FILES-01",
18
+ severity: "error",
19
+ message: "Generated file is stale",
20
+ },
21
+ ];
22
+ const result = diagnosticsResult("test.command", diagnostics);
23
+ expect(result.data!.diagnostics[0].remediation).toBeDefined();
24
+ expect(result.data!.diagnostics[0].remediation?.ruleId).toBe("GEN-FILES-01");
25
+ expect(result.data!.diagnostics[0].remediation?.action).toContain("Regenerate");
26
+ expect(result.data!.diagnostics[0].remediation?.docRef).toBe(
27
+ "docs/authoring/generated-files-and-templates.md",
28
+ );
29
+ });
30
+
31
+ test("diagnosticsResult: does not overwrite existing remediation field", () => {
32
+ const diagnostics: Diagnostic[] = [
33
+ {
34
+ ruleId: "GEN-FILES-01",
35
+ severity: "error",
36
+ message: "Stale file",
37
+ remediation: {
38
+ ruleId: "GEN-FILES-01",
39
+ action: "Custom action — do not overwrite",
40
+ },
41
+ },
42
+ ];
43
+ const result = diagnosticsResult("test.command", diagnostics);
44
+ expect(result.data!.diagnostics[0].remediation?.action).toBe("Custom action — do not overwrite");
45
+ });
46
+
47
+ test("diagnosticsResult: no remediation for unknown ruleId", () => {
48
+ const diagnostics: Diagnostic[] = [
49
+ {
50
+ ruleId: "UNKNOWN-RULE-999",
51
+ severity: "warning",
52
+ message: "Some warning",
53
+ },
54
+ ];
55
+ const result = diagnosticsResult("test.command", diagnostics);
56
+ expect(result.data!.diagnostics[0].remediation).toBeUndefined();
57
+ });
58
+
59
+ test("diagnosticsResult: preserves fixHint alongside remediation", () => {
60
+ const diagnostics: Diagnostic[] = [
61
+ {
62
+ ruleId: "GEN-FILES-01",
63
+ severity: "error",
64
+ message: "Stale",
65
+ fixHint: "Run the generator",
66
+ },
67
+ ];
68
+ const result = diagnosticsResult("test.command", diagnostics);
69
+ expect(result.data!.diagnostics[0].fixHint).toBe("Run the generator");
70
+ expect(result.data!.diagnostics[0].remediation).toBeDefined();
71
+ });
72
+
73
+ test("diagnosticsResult: multiple diagnostics get independent remediation", () => {
74
+ const diagnostics: Diagnostic[] = [
75
+ { ruleId: "GEN-FILES-01", severity: "error", message: "err 1" },
76
+ { ruleId: "PARITY-SECTION-COUNT", severity: "error", message: "err 2" },
77
+ { ruleId: "UNKNOWN", severity: "info", message: "info 1" },
78
+ ];
79
+ const result = diagnosticsResult("test.command", diagnostics);
80
+ expect(result.data!.diagnostics[0].remediation?.ruleId).toBe("GEN-FILES-01");
81
+ expect(result.data!.diagnostics[1].remediation?.ruleId).toBe("PARITY-SECTION-COUNT");
82
+ expect(result.data!.diagnostics[2].remediation).toBeUndefined();
83
+ });
@@ -8,12 +8,13 @@ types + constants + pure helpers — no I/O, no astro:env, no vendor SDK.</purpo
8
8
  <non-goals>
9
9
  <item>Do not let a chat vendor own the graph — UChat requests transitions; this module is the authority.</item>
10
10
  <item>Do not reference Make.com or carry any legacy UChat goto/stage string as architecture.</item>
11
- <item>Do not import astro:env, a Supabase SDK, or a vendor SDK — callers inject persistence.</item>
11
+ <item>Do not import astro:env or a vendor SDK — callers inject persistence.</item>
12
12
  </non-goals>
13
13
  </MODULE_CONTRACT>
14
14
  <CHANGE_SUMMARY>
15
15
  <item>RFC-0188 Phase 2 (contract): initial funnel stage/event/transition contracts.</item>
16
16
  <item>RFC-0219: add FUNNEL_SYSTEM_TRIGGERS, FunnelTransitionTrigger, FUNNEL_TRANSITION_TRIGGERS — trigger overlay for the state-chart generator.</item>
17
+ <item>Cleanup: move BUFFER_DEAL_STAGES, FUNNEL_STAGE_TO_BUFFER_STAGE, bridgeFunnelStage, SYNC_OUTBOX_STATUSES, SYNC_OUTBOX_OPS from deleted crm-buffer.ts into this module.</item>
17
18
  </CHANGE_SUMMARY>
18
19
  */
19
20
 
@@ -377,3 +378,79 @@ export function scanForMakeComReferences(text: string): Array<{ line: number; ma
377
378
  });
378
379
  return hits;
379
380
  }
381
+
382
+ // ---------------------------------------------------------------------------
383
+ // Generic deal stage bridge (formerly in crm-buffer.ts — RFC-0188 Phase 3)
384
+ // ---------------------------------------------------------------------------
385
+
386
+ /**
387
+ * Closed catalog of deal funnel stages. Order matters — later stages come after
388
+ * earlier ones. Mirrors the standard Pipedrive pipeline stages.
389
+ */
390
+ export const BUFFER_DEAL_STAGES = [
391
+ "new",
392
+ "contacted",
393
+ "qualified",
394
+ "proposal",
395
+ "negotiation",
396
+ "won",
397
+ "lost",
398
+ ] as const;
399
+
400
+ export type BufferDealStage = (typeof BUFFER_DEAL_STAGES)[number];
401
+
402
+ /**
403
+ * RFC-0188 keeps the precise, platform-owned VisitorFunnelStage on the deal
404
+ * (`funnel_stage`) while bridging it down to the generic BufferDealStage the
405
+ * Pipedrive sync worker already understands. Exhaustive by construction.
406
+ */
407
+ export const FUNNEL_STAGE_TO_BUFFER_STAGE: Record<VisitorFunnelStage, BufferDealStage> = {
408
+ new_session: "new",
409
+ privacy_acknowledged: "new",
410
+ intent_selected: "contacted",
411
+ organization_selected: "contacted",
412
+ qualification_priority: "qualified",
413
+ qualification_company: "qualified",
414
+ qualification_service: "qualified",
415
+ qualification_region: "qualified",
416
+ offer_presented: "proposal",
417
+ payment_pending: "proposal",
418
+ payment_confirmed: "negotiation",
419
+ start_choice_pending: "negotiation",
420
+ start_deferred: "negotiation",
421
+ buyer_type_pending: "negotiation",
422
+ b2b_start_consent_pending: "negotiation",
423
+ b2c_withdrawal_consent_pending: "negotiation",
424
+ start_approved: "negotiation",
425
+ legal_data_requested: "negotiation",
426
+ materials_requested: "negotiation",
427
+ production_ready: "negotiation",
428
+ change_balance_checked: "contacted",
429
+ change_payment_pending: "proposal",
430
+ change_description_requested: "negotiation",
431
+ operator_review: "negotiation",
432
+ won: "won",
433
+ lost: "lost",
434
+ };
435
+
436
+ /** Bridge a canonical funnel stage down to the generic stage the sync worker maps. */
437
+ export function bridgeFunnelStage(stage: VisitorFunnelStage): BufferDealStage {
438
+ return FUNNEL_STAGE_TO_BUFFER_STAGE[stage];
439
+ }
440
+
441
+ // ---------------------------------------------------------------------------
442
+ // Sync outbox statuses (formerly in crm-buffer.ts)
443
+ // ---------------------------------------------------------------------------
444
+
445
+ export const SYNC_OUTBOX_STATUSES = ["pending", "processing", "done", "failed", "dead"] as const;
446
+ export type SyncOutboxStatus = (typeof SYNC_OUTBOX_STATUSES)[number];
447
+
448
+ export const SYNC_OUTBOX_OPS = [
449
+ "upsert_contact",
450
+ "upsert_deal",
451
+ "update_deal_stage",
452
+ "upsert_organization",
453
+ "upsert_subscription",
454
+ "upsert_invoice",
455
+ ] as const;
456
+ export type SyncOutboxOp = (typeof SYNC_OUTBOX_OPS)[number];
@@ -1,10 +1,10 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
3
  <purpose>
4
- RFC-0168: Integration Port barrel. Re-exports types from port.ts, crm-buffer.ts,
4
+ RFC-0168: Integration Port barrel. Re-exports types from port.ts,
5
5
  funnel.ts, lifecycle.ts, sharding.ts, dispatch.ts, qstash.ts, and runtime
6
6
  orchestration (registries + fan-out) from orchestration.ts. Type-only consumers
7
- (agent-gate, supabase-crm tests) import from `./port-barrel.ts` (`@warpgogol/werkstatt-shared/share/integration/port`)
7
+ import from `./port-barrel.ts` (`@warpgogol/werkstatt-shared/share/integration/port`)
8
8
  to avoid transitively pulling in adapter implementations; consumers needing
9
9
  runtime logic import from here — the orchestration module is re-exported transparently.
10
10
  </purpose>
@@ -54,3 +54,20 @@ export {
54
54
  consumeIntegrationBatch,
55
55
  upsertLead,
56
56
  } from "./orchestration.ts";
57
+
58
+ // Lagebild ingress client (POST /v1/ingress — WebsiteIngress contract v1)
59
+ export {
60
+ submitIngress,
61
+ buildIdempotencyKey,
62
+ LAGEBILD_INGRESS_CONTRACT_VERSION,
63
+ type LagebildIngressConfig,
64
+ type IngressSubmitInput,
65
+ type WebsiteIngressPayload,
66
+ type IngressResult,
67
+ type IngressInteractionKind,
68
+ type IdentityClaimType,
69
+ type IdentityClaim,
70
+ type IngressOrigin,
71
+ type ExplicitPolicyAssertion,
72
+ type PolicyAssertionKind,
73
+ } from "./lagebild-ingress.ts";