open-multi-agent-kit 0.78.6 → 0.78.7

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 (169) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +26 -0
  3. package/MATURITY.md +2 -2
  4. package/README.md +19 -4
  5. package/dist/brand/night-city.theme.json +80 -0
  6. package/dist/brand/palette.d.ts +73 -177
  7. package/dist/brand/palette.js +115 -39
  8. package/dist/brand/rust-forge.theme.json +216 -0
  9. package/dist/brand/theme-compiled.d.ts +61 -0
  10. package/dist/brand/theme-compiled.js +241 -0
  11. package/dist/brand/theme.js +50 -37
  12. package/dist/cli/release-promotion-gate.d.ts +8 -1
  13. package/dist/cli/release-promotion-gate.js +20 -9
  14. package/dist/cli/root.d.ts +1 -0
  15. package/dist/cli/root.js +2 -1
  16. package/dist/cli/theme/index.d.ts +11 -2
  17. package/dist/cli/theme/index.js +6 -1
  18. package/dist/cli/theme/oklab-quantize.d.ts +29 -0
  19. package/dist/cli/theme/oklab-quantize.js +105 -0
  20. package/dist/cli/theme/render-table.d.ts +59 -0
  21. package/dist/cli/theme/render-table.js +112 -0
  22. package/dist/cli/theme/status-frame.d.ts +10 -0
  23. package/dist/cli/theme/status-frame.js +22 -0
  24. package/dist/cli/theme/terminal-capability.d.ts +6 -1
  25. package/dist/cli/theme/terminal-capability.js +20 -4
  26. package/dist/cli/theme/theme-doc.d.ts +22 -0
  27. package/dist/cli/theme/theme-doc.js +97 -0
  28. package/dist/cli/theme/theme-registry.js +39 -18
  29. package/dist/cli/theme/tier-explain.d.ts +21 -0
  30. package/dist/cli/theme/tier-explain.js +60 -0
  31. package/dist/cli/ui/green-rain-renderer.js +3 -2
  32. package/dist/cli/ui/neon-grid-renderer.js +4 -3
  33. package/dist/cli/ui/rust-forge-renderer.js +17 -3
  34. package/dist/cli/ui/system24-renderer.d.ts +18 -1
  35. package/dist/cli/ui/system24-renderer.js +39 -16
  36. package/dist/cli/v2/chat-repl.js +3 -1
  37. package/dist/cli/v2/cli-v2-skeleton.d.ts +6 -0
  38. package/dist/cli/v2/cli-v2-skeleton.js +121 -9
  39. package/dist/cli/v2/interactive-prompt.d.ts +1 -0
  40. package/dist/cli/v2/interactive-prompt.js +6 -2
  41. package/dist/commands/chat/core.js +2 -2
  42. package/dist/commands/chat/runtime.js +2 -0
  43. package/dist/commands/chat/utils.js +12 -4
  44. package/dist/commands/cockpit/render.js +102 -64
  45. package/dist/commands/cockpit/utils.d.ts +2 -0
  46. package/dist/commands/design.js +18 -16
  47. package/dist/commands/doctor/checks.d.ts +0 -1
  48. package/dist/commands/doctor/checks.js +1 -36
  49. package/dist/commands/doctor/report.js +0 -11
  50. package/dist/commands/init/content.d.ts +1 -1
  51. package/dist/commands/init/content.js +3 -11
  52. package/dist/commands/init.js +2 -2
  53. package/dist/commands/mcp/config.d.ts +32 -0
  54. package/dist/commands/mcp/config.js +264 -0
  55. package/dist/commands/mcp/doctor-fix.d.ts +12 -0
  56. package/dist/commands/mcp/doctor-fix.js +261 -0
  57. package/dist/commands/mcp/doctor.d.ts +55 -0
  58. package/dist/commands/mcp/doctor.js +401 -0
  59. package/dist/commands/mcp/list.d.ts +1 -0
  60. package/dist/commands/mcp/list.js +56 -0
  61. package/dist/commands/mcp/shared.d.ts +47 -0
  62. package/dist/commands/mcp/shared.js +192 -0
  63. package/dist/commands/mcp/test.d.ts +5 -0
  64. package/dist/commands/mcp/test.js +457 -0
  65. package/dist/commands/mcp.d.ts +8 -104
  66. package/dist/commands/mcp.js +5 -1603
  67. package/dist/contracts/proof.d.ts +1 -1
  68. package/dist/goal/control-loop.d.ts +15 -0
  69. package/dist/goal/control-loop.js +39 -5
  70. package/dist/hud/render.d.ts +2 -0
  71. package/dist/hud/render.js +7 -1
  72. package/dist/mcp/secret-scanner.d.ts +6 -0
  73. package/dist/mcp/secret-scanner.js +44 -11
  74. package/dist/memory/graph-delta-log.d.ts +137 -0
  75. package/dist/memory/graph-delta-log.js +650 -0
  76. package/dist/memory/graph-viewer.js +13 -32
  77. package/dist/memory/local-graph-memory-store.d.ts +36 -3
  78. package/dist/memory/local-graph-memory-store.js +255 -10
  79. package/dist/orchestration/log-streamer.js +13 -8
  80. package/dist/orchestration/routing.d.ts +4 -0
  81. package/dist/orchestration/routing.js +28 -3
  82. package/dist/orchestration/state-persister.js +8 -1
  83. package/dist/providers/anthropic-messages-runner.d.ts +17 -0
  84. package/dist/providers/anthropic-messages-runner.js +197 -0
  85. package/dist/providers/model-registry.d.ts +1 -1
  86. package/dist/providers/model-registry.js +37 -3
  87. package/dist/providers/provider-runtime.js +27 -11
  88. package/dist/providers/thinking-levels.js +4 -1
  89. package/dist/providers/types.d.ts +3 -3
  90. package/dist/runtime/contracts/weakness-remediation.d.ts +9 -1
  91. package/dist/runtime/contracts/weakness-remediation.js +9 -1
  92. package/dist/runtime/router-v2-scoring.d.ts +8 -3
  93. package/dist/runtime/router-v2-scoring.js +27 -22
  94. package/dist/runtime/runtime-router.d.ts +5 -0
  95. package/dist/runtime/runtime-router.js +40 -8
  96. package/dist/runtime/sandbox-profile.d.ts +29 -0
  97. package/dist/runtime/sandbox-profile.js +101 -0
  98. package/dist/runtime/slash-commands.js +300 -2
  99. package/dist/runtime/tool-dispatch-contracts.d.ts +15 -0
  100. package/dist/runtime/tool-dispatch-contracts.js +12 -0
  101. package/dist/runtime/weights-config.d.ts +90 -0
  102. package/dist/runtime/weights-config.js +249 -0
  103. package/dist/schema/envelope.schema.d.ts +18 -18
  104. package/dist/schema/evidence.schema.d.ts +2 -2
  105. package/dist/schema/proof-bundle.schema.d.ts +6 -6
  106. package/dist/schema/proof-bundle.schema.js +0 -1
  107. package/dist/schema/provider.schema.d.ts +2 -2
  108. package/dist/schema/run-manifest.schema.d.ts +16 -16
  109. package/dist/theme/ansi.js +9 -2
  110. package/dist/theme/extended-palette.d.ts +85 -0
  111. package/dist/theme/extended-palette.js +108 -0
  112. package/dist/theme/layout.js +29 -8
  113. package/dist/theme/metrics.js +5 -5
  114. package/dist/theme/parallel.js +25 -15
  115. package/dist/ui/omk-sigil.js +5 -14
  116. package/dist/ui/omk-working-sweep.js +5 -15
  117. package/dist/util/chat-agent-mode.d.ts +11 -0
  118. package/dist/util/chat-agent-mode.js +41 -8
  119. package/dist/util/chat-cockpit.d.ts +9 -0
  120. package/dist/util/chat-cockpit.js +77 -20
  121. package/dist/util/fs/core.d.ts +5 -0
  122. package/dist/util/fs/core.js +35 -0
  123. package/dist/util/fs/internal.d.ts +14 -0
  124. package/dist/util/fs/internal.js +169 -0
  125. package/dist/util/fs/kimi-sync.d.ts +41 -0
  126. package/dist/util/fs/kimi-sync.js +495 -0
  127. package/dist/util/fs/logo.d.ts +2 -0
  128. package/dist/util/fs/logo.js +78 -0
  129. package/dist/util/fs/manifest.d.ts +6 -0
  130. package/dist/util/fs/manifest.js +40 -0
  131. package/dist/util/fs/mcp-diagnose.d.ts +15 -0
  132. package/dist/util/fs/mcp-diagnose.js +204 -0
  133. package/dist/util/fs/mcp-runtime-config.d.ts +23 -0
  134. package/dist/util/fs/mcp-runtime-config.js +412 -0
  135. package/dist/util/fs/paths.d.ts +13 -0
  136. package/dist/util/fs/paths.js +82 -0
  137. package/dist/util/fs/preflight.d.ts +27 -0
  138. package/dist/util/fs/preflight.js +271 -0
  139. package/dist/util/fs.d.ts +8 -128
  140. package/dist/util/fs.js +8 -1757
  141. package/dist/util/terminal-layout.js +5 -1
  142. package/dist/util/version.js +2 -1
  143. package/docs/2026-06-11/critical-issues.md +20 -0
  144. package/docs/2026-06-11/improvements.md +14 -0
  145. package/docs/2026-06-11/init-checklist.md +25 -0
  146. package/docs/2026-06-11/plan.md +20 -0
  147. package/docs/ARCHITECTURE_ANALYSIS_CODEGRAPH.md +223 -0
  148. package/docs/adr/0001-no-native-rust-lane.md +52 -0
  149. package/docs/codex-oauth-setup.md +14 -0
  150. package/docs/decisions/2026-06-10-git-history-bloat.md +61 -0
  151. package/docs/decisions/ADR-theme-dark-only-assets.md +43 -0
  152. package/docs/getting-started.md +1 -1
  153. package/docs/headroom-omk-final-summary.md +188 -0
  154. package/docs/headroom-omk-integration.md +394 -0
  155. package/docs/headroom-omk-setup-guide.md +422 -0
  156. package/docs/headroom-omk-usage-examples.md +371 -0
  157. package/docs/provider-maturity.md +1 -1
  158. package/docs/versioning.md +3 -3
  159. package/package.json +10 -10
  160. package/readmeasset/.npmignore +2 -0
  161. package/readmeasset/ASSET_INDEX.md +7 -5
  162. package/readmeasset/ASSET_PROVENANCE.md +21 -5
  163. package/readmeasset/omk-control-surfaces.svg +55 -0
  164. package/readmeasset/omk-core-loop.svg +1 -0
  165. package/readmeasset/omk-logo-mark.svg +1 -0
  166. package/readmeasset/omk-release-assertions.svg +51 -0
  167. package/dist/native/linux-x64/omk-safety +0 -0
  168. package/dist/util/native-safety.d.ts +0 -28
  169. package/dist/util/native-safety.js +0 -118
@@ -0,0 +1,216 @@
1
+ {
2
+ "$schema": "../schemas/omk.theme.v1.schema.json",
3
+ "schemaVersion": "omk.theme.v1",
4
+ "name": "rust-forge",
5
+ "displayName": "OMK Rust Forge — Standalone Oxidized Forge Console",
6
+ "mode": "dark",
7
+ "primitives": {
8
+ "iron": "#0E0B09",
9
+ "coal": "#080605",
10
+ "forge": "#1A1310",
11
+ "anvil": "#241914",
12
+ "rust": "#FF6A3D",
13
+ "molten": "#FF7A4A",
14
+ "copper": "#E08A4B",
15
+ "ember": "#FFB454",
16
+ "oxide": "#4FB39B",
17
+ "quench": "#78E4C9",
18
+ "verdigris": "#6FD7B8",
19
+ "crimson": "#FF5468",
20
+ "steel": "#9FB0BD",
21
+ "scale": "#BFA08A",
22
+ "ash": "#C9B8A8",
23
+ "slag": "#8F7B6D",
24
+ "bone": "#F2E4D6"
25
+ },
26
+ "backgrounds": [
27
+ "iron",
28
+ "forge"
29
+ ],
30
+ "semantics": {
31
+ "route.active": {
32
+ "color": "rust",
33
+ "glyph": "▸",
34
+ "usage": "text"
35
+ },
36
+ "route.fallback": {
37
+ "color": "copper",
38
+ "glyph": "↻",
39
+ "usage": "text"
40
+ },
41
+ "route.dead": {
42
+ "color": "crimson",
43
+ "glyph": "✕",
44
+ "usage": "text"
45
+ },
46
+ "evidence.pass": {
47
+ "color": "oxide",
48
+ "glyph": "✓",
49
+ "usage": "text"
50
+ },
51
+ "evidence.fail": {
52
+ "color": "crimson",
53
+ "glyph": "✗",
54
+ "usage": "text"
55
+ },
56
+ "evidence.pending": {
57
+ "color": "ember",
58
+ "glyph": "◐",
59
+ "usage": "text"
60
+ },
61
+ "dag.lane.running": {
62
+ "color": "rust",
63
+ "glyph": "▶",
64
+ "usage": "text"
65
+ },
66
+ "dag.lane.blocked": {
67
+ "color": "copper",
68
+ "glyph": "⏸",
69
+ "usage": "text"
70
+ },
71
+ "dag.lane.done": {
72
+ "color": "verdigris",
73
+ "glyph": "●",
74
+ "usage": "text"
75
+ },
76
+ "dag.lane.queued": {
77
+ "color": "slag",
78
+ "glyph": "◌",
79
+ "usage": "text",
80
+ "adjusted": {
81
+ "original": "#6E5B4E",
82
+ "crBefore": 2.86,
83
+ "crAfter": 4.56
84
+ }
85
+ },
86
+ "telemetry.info": {
87
+ "color": "bone",
88
+ "glyph": "·",
89
+ "usage": "text"
90
+ },
91
+ "telemetry.warn": {
92
+ "color": "ember",
93
+ "glyph": "▲",
94
+ "usage": "text"
95
+ },
96
+ "telemetry.error": {
97
+ "color": "crimson",
98
+ "glyph": "✖",
99
+ "usage": "text"
100
+ },
101
+ "control.accent": {
102
+ "color": "rust",
103
+ "glyph": "◆",
104
+ "kind": "chrome",
105
+ "usage": "indicator"
106
+ },
107
+ "control.dim": {
108
+ "color": "steel",
109
+ "glyph": "┊",
110
+ "kind": "chrome",
111
+ "usage": "text"
112
+ },
113
+ "control.fg": {
114
+ "color": "bone",
115
+ "kind": "chrome",
116
+ "usage": "text"
117
+ },
118
+ "control.bg": {
119
+ "color": "iron",
120
+ "kind": "background",
121
+ "usage": "background"
122
+ },
123
+ "forge.heat": {
124
+ "color": "molten",
125
+ "glyph": "▰",
126
+ "usage": "text"
127
+ },
128
+ "forge.anvil": {
129
+ "color": "scale",
130
+ "glyph": "▣",
131
+ "usage": "text"
132
+ },
133
+ "forge.quench": {
134
+ "color": "quench",
135
+ "glyph": "◈",
136
+ "usage": "text"
137
+ },
138
+ "forge.slag": {
139
+ "color": "slag",
140
+ "glyph": "◌",
141
+ "usage": "text",
142
+ "adjusted": {
143
+ "original": "#6E5B4E",
144
+ "crBefore": 2.86,
145
+ "crAfter": 4.56
146
+ }
147
+ }
148
+ },
149
+ "components": {
150
+ "statusCard": {
151
+ "border": "control.accent",
152
+ "title": "control.fg",
153
+ "body": "telemetry.info",
154
+ "meta": "control.dim"
155
+ },
156
+ "routerTable": {
157
+ "active": "route.active",
158
+ "fallback": "route.fallback",
159
+ "dead": "route.dead",
160
+ "header": "control.accent"
161
+ },
162
+ "evidenceGate": {
163
+ "pass": "evidence.pass",
164
+ "fail": "evidence.fail",
165
+ "pending": "evidence.pending"
166
+ },
167
+ "dagLanes": {
168
+ "running": "dag.lane.running",
169
+ "blocked": "dag.lane.blocked",
170
+ "done": "dag.lane.done",
171
+ "queued": "dag.lane.queued"
172
+ },
173
+ "logStream": {
174
+ "info": "telemetry.info",
175
+ "warn": "telemetry.warn",
176
+ "error": "telemetry.error",
177
+ "dim": "control.dim"
178
+ },
179
+ "forgeConsole": {
180
+ "heat": "forge.heat",
181
+ "anvil": "forge.anvil",
182
+ "quench": "forge.quench",
183
+ "slag": "forge.slag",
184
+ "title": "control.fg"
185
+ }
186
+ },
187
+ "fallback16": {
188
+ "route.active": "brightRed",
189
+ "route.fallback": "brightYellow",
190
+ "route.dead": "brightRed",
191
+ "evidence.pass": "brightGreen",
192
+ "evidence.fail": "brightRed",
193
+ "evidence.pending": "brightYellow",
194
+ "dag.lane.running": "brightRed",
195
+ "dag.lane.blocked": "brightYellow",
196
+ "dag.lane.done": "brightGreen",
197
+ "dag.lane.queued": "white",
198
+ "telemetry.info": "brightWhite",
199
+ "telemetry.warn": "brightYellow",
200
+ "telemetry.error": "brightRed",
201
+ "control.accent": "brightRed",
202
+ "control.dim": "white",
203
+ "control.fg": "brightWhite",
204
+ "control.bg": "black",
205
+ "forge.heat": "brightRed",
206
+ "forge.anvil": "white",
207
+ "forge.quench": "brightGreen",
208
+ "forge.slag": "white"
209
+ },
210
+ "meta": {
211
+ "provenance": "Standalone oxidized rust-forge palette for the OMK orchestration console. Warm coal/iron/anvil backgrounds, rust-orange + molten + copper + ember heat accents, oxide/quench/verdigris patina greens for pass/done, crimson for fail/dead, steel/scale/ash grays, and bone foreground. Forge-specific heat/anvil/quench semantics make OMK control surfaces distinct from provider branding while preserving NO_COLOR glyph safety.",
212
+ "tierAssumptions": "16-color tier gated against stock VGA/xterm ANSI values; terminals with remapped ANSI-16 palettes are outside the contract — glyphs are the safety net. NO_COLOR note: control.dim uses ┊ so logStream info (telemetry.info ·) and dim rows stay distinguishable without color.",
213
+ "omkVersion": "0.78.6",
214
+ "independence": "OMK is the control plane; providers and models are adapter lanes, never the product identity or final authority."
215
+ }
216
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * OMK brand -- theme-compiled color source (theme contract T5b).
3
+ *
4
+ * Single bridge between canonical omk.theme.v1 documents and the brand
5
+ * palette/UI layers. Brand chrome defaults to night-city for byte parity, and
6
+ * can be switched at process edges to rust-forge without changing import shapes.
7
+ *
8
+ * Imports target the concrete src/cli/theme modules (render-table,
9
+ * terminal-capability, oklab-quantize) rather than the barrel to avoid a
10
+ * module cycle through theme-registry -> theme/colors -> brand/palette.
11
+ */
12
+ import type { CompiledTheme, OmkThemeV1 } from "../cli/theme/render-table.js";
13
+ import type { ColorTier } from "../cli/theme/terminal-capability.js";
14
+ /** Plain 0-255 RGB triple used across the brand palette public API. */
15
+ export interface BrandRgb {
16
+ readonly r: number;
17
+ readonly g: number;
18
+ readonly b: number;
19
+ }
20
+ /** Primitive names the legacy brand palette requires from night-city. */
21
+ export type NightCityPrimitive = "dark" | "surface" | "cyan" | "mint" | "magenta" | "purple" | "amber" | "red" | "cream" | "muted" | "gray";
22
+ export type RustForgePrimitive = "iron" | "coal" | "forge" | "anvil" | "rust" | "molten" | "copper" | "ember" | "oxide" | "quench" | "verdigris" | "crimson" | "steel" | "scale" | "ash" | "slag" | "bone";
23
+ export type BrandThemeName = "night-city" | "rust-forge";
24
+ /** Validated night-city theme document (build-time snapshot of themes/). */
25
+ export declare const NIGHT_CITY_THEME: OmkThemeV1;
26
+ /** Validated rust-forge theme document (build-time snapshot of themes/). */
27
+ export declare const RUST_FORGE_THEME: OmkThemeV1;
28
+ export declare function resolveBrandThemeName(name: string | undefined): BrandThemeName;
29
+ export declare function setActiveBrandTheme(name: string | undefined): BrandThemeName;
30
+ export declare function getActiveBrandThemeName(): BrandThemeName;
31
+ export declare function getActiveBrandTheme(): OmkThemeV1;
32
+ export declare function activeThemeHexByRole(role: string): string;
33
+ export declare function brandThemeHexByRole(name: BrandThemeName, role: string): string;
34
+ export declare function brandThemeRgbByRole(name: BrandThemeName, role: string): BrandRgb;
35
+ export declare function activeThemeRgbByRole(role: string): BrandRgb;
36
+ export declare function activeThemeHexByPrimitive(primitive: string): string;
37
+ /** Canonical normalized uppercase hex string for a night-city primitive. */
38
+ export declare function nightCityHex(primitive: NightCityPrimitive): string;
39
+ /** 0-255 RGB triple for a night-city primitive. */
40
+ export declare function nightCityRgb(primitive: NightCityPrimitive): BrandRgb;
41
+ /** Convert an RGB triple to canonical uppercase hex (no literal hex in source). */
42
+ export declare function rgbToHex(color: BrandRgb): string;
43
+ /**
44
+ * Compiled active brand render table for the requested (default: detected)
45
+ * degradation tier. The cache key includes both theme name and tier.
46
+ */
47
+ export declare function getCompiledBrandTheme(tier?: ColorTier): CompiledTheme;
48
+ /** Paint text with an active-brand semantic token at the detected color tier. */
49
+ export declare function brandPaint(role: string, text: string): string;
50
+ export declare function getActiveBrandChromeLabel(): string;
51
+ export declare function getActiveBrandCockpitSubtitle(): string;
52
+ export declare function getActiveBrandCockpitDetail(): string;
53
+ export declare function getActiveBrandHudStatus(): string;
54
+ export declare function getActiveBrandConsoleLine(): string;
55
+ /**
56
+ * Unconditional truecolor SGR open sequence for a brand RGB value, produced
57
+ * through the theme compiler (single SGR factory -- no escape literals here).
58
+ * Brand theme constants intentionally stay truecolor for byte parity with the
59
+ * legacy palette; tier-aware rendering should use `getCompiledBrandTheme()`.
60
+ */
61
+ export declare function brandTruecolorSgr(color: BrandRgb): string;
@@ -0,0 +1,241 @@
1
+ /**
2
+ * OMK brand -- theme-compiled color source (theme contract T5b).
3
+ *
4
+ * Single bridge between canonical omk.theme.v1 documents and the brand
5
+ * palette/UI layers. Brand chrome defaults to night-city for byte parity, and
6
+ * can be switched at process edges to rust-forge without changing import shapes.
7
+ *
8
+ * Imports target the concrete src/cli/theme modules (render-table,
9
+ * terminal-capability, oklab-quantize) rather than the barrel to avoid a
10
+ * module cycle through theme-registry -> theme/colors -> brand/palette.
11
+ */
12
+ import { compileTheme } from "../cli/theme/render-table.js";
13
+ import { detectColorTier } from "../cli/theme/terminal-capability.js";
14
+ import { hexToRgb255, normalizeHex } from "../cli/theme/oklab-quantize.js";
15
+ import nightCityThemeJson from "./night-city.theme.json" with { type: "json" };
16
+ import rustForgeThemeJson from "./rust-forge.theme.json" with { type: "json" };
17
+ const REQUIRED_NIGHT_CITY_PRIMITIVES = [
18
+ "dark",
19
+ "surface",
20
+ "cyan",
21
+ "mint",
22
+ "magenta",
23
+ "purple",
24
+ "amber",
25
+ "red",
26
+ "cream",
27
+ "muted",
28
+ "gray",
29
+ ];
30
+ const REQUIRED_RUST_FORGE_PRIMITIVES = [
31
+ "iron",
32
+ "coal",
33
+ "forge",
34
+ "anvil",
35
+ "rust",
36
+ "molten",
37
+ "copper",
38
+ "ember",
39
+ "oxide",
40
+ "quench",
41
+ "verdigris",
42
+ "crimson",
43
+ "steel",
44
+ "scale",
45
+ "ash",
46
+ "slag",
47
+ "bone",
48
+ ];
49
+ function assertThemeDocument(doc, expectedName, requiredPrimitives) {
50
+ if (typeof doc !== "object" || doc === null) {
51
+ throw new Error(`brand theme-compiled: ${expectedName} theme snapshot is not an object`);
52
+ }
53
+ const candidate = doc;
54
+ if (candidate.schemaVersion !== "omk.theme.v1") {
55
+ throw new Error(`brand theme-compiled: expected schemaVersion "omk.theme.v1", got "${String(candidate.schemaVersion)}"`);
56
+ }
57
+ if (candidate.name !== expectedName) {
58
+ throw new Error(`brand theme-compiled: expected theme name "${expectedName}", got "${String(candidate.name)}"`);
59
+ }
60
+ if (typeof candidate.primitives !== "object" || candidate.primitives === null) {
61
+ throw new Error(`brand theme-compiled: ${expectedName} theme snapshot has no primitives map`);
62
+ }
63
+ if (typeof candidate.semantics !== "object" || candidate.semantics === null) {
64
+ throw new Error(`brand theme-compiled: ${expectedName} theme snapshot has no semantics map`);
65
+ }
66
+ if (typeof candidate.fallback16 !== "object" || candidate.fallback16 === null) {
67
+ throw new Error(`brand theme-compiled: ${expectedName} theme snapshot has no fallback16 map`);
68
+ }
69
+ const primitives = candidate.primitives;
70
+ for (const name of requiredPrimitives) {
71
+ if (typeof primitives[name] !== "string") {
72
+ throw new Error(`brand theme-compiled: ${expectedName} theme snapshot is missing primitive "${name}"`);
73
+ }
74
+ }
75
+ return doc;
76
+ }
77
+ /** Validated night-city theme document (build-time snapshot of themes/). */
78
+ export const NIGHT_CITY_THEME = assertThemeDocument(nightCityThemeJson, "night-city", REQUIRED_NIGHT_CITY_PRIMITIVES);
79
+ /** Validated rust-forge theme document (build-time snapshot of themes/). */
80
+ export const RUST_FORGE_THEME = assertThemeDocument(rustForgeThemeJson, "rust-forge", REQUIRED_RUST_FORGE_PRIMITIVES);
81
+ const BRAND_THEME_BY_NAME = {
82
+ "night-city": NIGHT_CITY_THEME,
83
+ "rust-forge": RUST_FORGE_THEME,
84
+ };
85
+ let activeBrandThemeName = "night-city";
86
+ export function resolveBrandThemeName(name) {
87
+ const normalized = name?.trim().toLowerCase();
88
+ if (normalized === "rust-forge" ||
89
+ normalized === "rust" ||
90
+ normalized === "cargo" ||
91
+ normalized === "oxide" ||
92
+ normalized === "forge" ||
93
+ normalized === "oxidized-forge" ||
94
+ normalized === "oxidized" ||
95
+ normalized === "rust-native") {
96
+ return "rust-forge";
97
+ }
98
+ return "night-city";
99
+ }
100
+ export function setActiveBrandTheme(name) {
101
+ activeBrandThemeName = resolveBrandThemeName(name);
102
+ return activeBrandThemeName;
103
+ }
104
+ export function getActiveBrandThemeName() {
105
+ return activeBrandThemeName;
106
+ }
107
+ export function getActiveBrandTheme() {
108
+ return BRAND_THEME_BY_NAME[activeBrandThemeName];
109
+ }
110
+ function hexByRole(theme, role) {
111
+ const semantic = theme.semantics[role];
112
+ if (semantic === undefined) {
113
+ throw new Error(`brand theme-compiled: theme "${theme.name}" has no semantic role "${role}"`);
114
+ }
115
+ const raw = theme.primitives[semantic.color];
116
+ if (raw === undefined) {
117
+ throw new Error(`brand theme-compiled: theme "${theme.name}" semantic "${role}" references missing primitive "${semantic.color}"`);
118
+ }
119
+ return normalizeHex(raw);
120
+ }
121
+ export function activeThemeHexByRole(role) {
122
+ return hexByRole(getActiveBrandTheme(), role);
123
+ }
124
+ export function brandThemeHexByRole(name, role) {
125
+ return hexByRole(BRAND_THEME_BY_NAME[name], role);
126
+ }
127
+ export function brandThemeRgbByRole(name, role) {
128
+ const [r, g, b] = hexToRgb255(brandThemeHexByRole(name, role));
129
+ return { r, g, b };
130
+ }
131
+ export function activeThemeRgbByRole(role) {
132
+ const [r, g, b] = hexToRgb255(activeThemeHexByRole(role));
133
+ return { r, g, b };
134
+ }
135
+ const PRIMITIVE_ROLE_ALIASES = {
136
+ cyan: "route.active",
137
+ mint: "evidence.pass",
138
+ magenta: "control.accent",
139
+ purple: "control.accent",
140
+ amber: "route.fallback",
141
+ red: "telemetry.error",
142
+ cream: "control.fg",
143
+ muted: "dag.lane.queued",
144
+ gray: "control.dim",
145
+ dark: "control.bg",
146
+ };
147
+ export function activeThemeHexByPrimitive(primitive) {
148
+ const theme = getActiveBrandTheme();
149
+ const raw = theme.primitives[primitive];
150
+ if (raw !== undefined)
151
+ return normalizeHex(raw);
152
+ if (primitive === "surface") {
153
+ const surfacePrimitive = theme.backgrounds[1] ?? theme.backgrounds[0];
154
+ const surface = surfacePrimitive ? theme.primitives[surfacePrimitive] : undefined;
155
+ return surface === undefined ? activeThemeHexByRole("control.bg") : normalizeHex(surface);
156
+ }
157
+ const role = PRIMITIVE_ROLE_ALIASES[primitive];
158
+ if (role !== undefined)
159
+ return activeThemeHexByRole(role);
160
+ throw new Error(`brand theme-compiled: theme "${theme.name}" has no primitive "${primitive}"`);
161
+ }
162
+ /** Canonical normalized uppercase hex string for a night-city primitive. */
163
+ export function nightCityHex(primitive) {
164
+ const raw = NIGHT_CITY_THEME.primitives[primitive];
165
+ if (raw === undefined) {
166
+ throw new Error(`brand theme-compiled: unknown night-city primitive "${primitive}"`);
167
+ }
168
+ return normalizeHex(raw);
169
+ }
170
+ /** 0-255 RGB triple for a night-city primitive. */
171
+ export function nightCityRgb(primitive) {
172
+ const [r, g, b] = hexToRgb255(nightCityHex(primitive));
173
+ return { r, g, b };
174
+ }
175
+ function channelHex(value) {
176
+ const clamped = Math.max(0, Math.min(255, Math.round(value)));
177
+ return clamped.toString(16).padStart(2, "0").toUpperCase();
178
+ }
179
+ /** Convert an RGB triple to canonical uppercase hex (no literal hex in source). */
180
+ export function rgbToHex(color) {
181
+ return `#${channelHex(color.r)}${channelHex(color.g)}${channelHex(color.b)}`;
182
+ }
183
+ const compiledByThemeAndTier = new Map();
184
+ /**
185
+ * Compiled active brand render table for the requested (default: detected)
186
+ * degradation tier. The cache key includes both theme name and tier.
187
+ */
188
+ export function getCompiledBrandTheme(tier = detectColorTier()) {
189
+ const theme = getActiveBrandTheme();
190
+ const cacheKey = `${theme.name}:${tier}`;
191
+ const cached = compiledByThemeAndTier.get(cacheKey);
192
+ if (cached !== undefined)
193
+ return cached;
194
+ const compiled = compileTheme(theme, tier);
195
+ compiledByThemeAndTier.set(cacheKey, compiled);
196
+ return compiled;
197
+ }
198
+ /** Paint text with an active-brand semantic token at the detected color tier. */
199
+ export function brandPaint(role, text) {
200
+ return getCompiledBrandTheme().paint(role, text);
201
+ }
202
+ export function getActiveBrandChromeLabel() {
203
+ return activeBrandThemeName === "rust-forge" ? "Oxidized Forge" : "Night City";
204
+ }
205
+ export function getActiveBrandCockpitSubtitle() {
206
+ return activeBrandThemeName === "rust-forge"
207
+ ? "OXIDIZED FORGE · ROUTE · VERIFY · CONTROL"
208
+ : "NEON GRID · GREEN RAIN · METRICS WALL";
209
+ }
210
+ export function getActiveBrandCockpitDetail() {
211
+ return activeBrandThemeName === "rust-forge"
212
+ ? "forge heat · anvil evidence · quench safety · OMK control"
213
+ : "route · verify · loop · control · evidence gated";
214
+ }
215
+ export function getActiveBrandHudStatus() {
216
+ return activeBrandThemeName === "rust-forge" ? "OXIDIZED FORGE ONLINE" : "NEON GRID ONLINE";
217
+ }
218
+ export function getActiveBrandConsoleLine() {
219
+ return activeBrandThemeName === "rust-forge"
220
+ ? "Oxidized Forge Console // OMK independent control // heat anvil quench"
221
+ : "Night City Ops Console // cyberpunk metrics wall";
222
+ }
223
+ /**
224
+ * Unconditional truecolor SGR open sequence for a brand RGB value, produced
225
+ * through the theme compiler (single SGR factory -- no escape literals here).
226
+ * Brand theme constants intentionally stay truecolor for byte parity with the
227
+ * legacy palette; tier-aware rendering should use `getCompiledBrandTheme()`.
228
+ */
229
+ export function brandTruecolorSgr(color) {
230
+ const inlineTheme = {
231
+ schemaVersion: "omk.theme.v1",
232
+ name: "omk-brand-inline",
233
+ mode: "dark",
234
+ primitives: { brand: rgbToHex(color) },
235
+ backgrounds: [],
236
+ semantics: { "brand.tone": { color: "brand", usage: "text" } },
237
+ components: {},
238
+ fallback16: { "brand.tone": "white" },
239
+ };
240
+ return compileTheme(inlineTheme, "truecolor").tokens["brand.tone"].sgr;
241
+ }
@@ -1,6 +1,19 @@
1
- const ESC = "\x1b[";
1
+ import { P } from "./palette.js";
2
+ import { brandThemeRgbByRole, brandTruecolorSgr } from "./theme-compiled.js";
3
+ /**
4
+ * Truecolor SGR open sequence for a brand color, produced via the theme
5
+ * compiler (compileTheme) — no raw escape literals in this file. Brand theme
6
+ * constants stay truecolor on purpose for byte parity; tier-aware rendering
7
+ * lives in src/brand/theme-compiled.ts (getCompiledBrandTheme).
8
+ */
9
+ function fg(color) {
10
+ return brandTruecolorSgr(color);
11
+ }
2
12
  function rgb(r, g, b) {
3
- return `${ESC}38;2;${r};${g};${b}m`;
13
+ return fg({ r, g, b });
14
+ }
15
+ function rustFg(role) {
16
+ return brandTruecolorSgr(brandThemeRgbByRole("rust-forge", role));
4
17
  }
5
18
  export const SYSTEM24_THEME = {
6
19
  name: "system24",
@@ -45,15 +58,15 @@ export const GREEN_RAIN_THEME = {
45
58
  signal: "◆",
46
59
  },
47
60
  colors: {
48
- border: rgb(8, 39, 31),
49
- borderHot: rgb(0, 255, 194),
50
- text: rgb(232, 248, 255),
51
- muted: rgb(117, 143, 168),
52
- primary: rgb(0, 255, 194),
53
- success: rgb(0, 255, 194),
54
- warning: rgb(255, 176, 0),
55
- danger: rgb(255, 88, 116),
56
- info: rgb(0, 214, 255),
61
+ border: fg(P.matrixDark),
62
+ borderHot: fg(P.mint),
63
+ text: fg(P.cream),
64
+ muted: fg(P.gray),
65
+ primary: fg(P.mint),
66
+ success: fg(P.mint),
67
+ warning: fg(P.orange),
68
+ danger: fg(P.red),
69
+ info: fg(P.blue),
57
70
  },
58
71
  motion: {
59
72
  rain: true,
@@ -74,15 +87,15 @@ export const NEON_GRID_THEME = {
74
87
  signal: "◇",
75
88
  },
76
89
  colors: {
77
- border: rgb(34, 50, 74),
78
- borderHot: rgb(0, 214, 255),
79
- text: rgb(232, 248, 255),
80
- muted: rgb(117, 143, 168),
81
- primary: rgb(0, 214, 255),
82
- success: rgb(0, 255, 194),
83
- warning: rgb(255, 176, 0),
84
- danger: rgb(255, 88, 116),
85
- info: rgb(0, 214, 255),
90
+ border: fg(P.gridLine),
91
+ borderHot: fg(P.blue),
92
+ text: fg(P.cream),
93
+ muted: fg(P.gray),
94
+ primary: fg(P.blue),
95
+ success: fg(P.mint),
96
+ warning: fg(P.orange),
97
+ danger: fg(P.red),
98
+ info: fg(P.blue),
86
99
  },
87
100
  motion: {
88
101
  rain: false,
@@ -92,8 +105,8 @@ export const NEON_GRID_THEME = {
92
105
  export const RUST_FORGE_THEME = {
93
106
  name: "rust-forge",
94
107
  label: "OMK Rust Forge",
95
- tagline: "Rust-native safety console for OMK orchestration.",
96
- motto: "Forge native checks. Verify the evidence. Control the loop.",
108
+ tagline: "Oxidized forge console for standalone OMK control.",
109
+ motto: "Forge the route. Verify the evidence. OMK controls the loop.",
97
110
  symbols: {
98
111
  prompt: "›",
99
112
  active: "◉",
@@ -103,15 +116,15 @@ export const RUST_FORGE_THEME = {
103
116
  signal: "▣",
104
117
  },
105
118
  colors: {
106
- border: rgb(124, 45, 18),
107
- borderHot: rgb(249, 115, 22),
108
- text: rgb(232, 248, 255),
109
- muted: rgb(117, 143, 168),
110
- primary: rgb(249, 115, 22),
111
- success: rgb(0, 255, 194),
112
- warning: rgb(255, 176, 0),
113
- danger: rgb(255, 88, 116),
114
- info: rgb(0, 214, 255),
119
+ border: rustFg("route.fallback"),
120
+ borderHot: rustFg("control.accent"),
121
+ text: rustFg("control.fg"),
122
+ muted: rustFg("control.dim"),
123
+ primary: rustFg("control.accent"),
124
+ success: rustFg("evidence.pass"),
125
+ warning: rustFg("telemetry.warn"),
126
+ danger: rustFg("telemetry.error"),
127
+ info: rustFg("route.active"),
115
128
  },
116
129
  motion: {
117
130
  rain: false,
@@ -133,13 +146,13 @@ export const MATRIX_THEME = {
133
146
  },
134
147
  colors: {
135
148
  border: rgb(0, 20, 0),
136
- borderHot: rgb(0, 255, 65),
149
+ borderHot: fg(P.matrixRainGreen),
137
150
  text: rgb(200, 255, 200),
138
- muted: rgb(0, 95, 25),
139
- primary: rgb(0, 255, 65),
140
- success: rgb(0, 255, 65),
141
- warning: rgb(255, 176, 0),
142
- danger: rgb(255, 50, 50),
151
+ muted: fg(P.matrixRainDim),
152
+ primary: fg(P.matrixRainGreen),
153
+ success: fg(P.matrixRainGreen),
154
+ warning: fg(P.matrixWarningAmber),
155
+ danger: fg(P.matrixErrorRed),
143
156
  info: rgb(0, 200, 50),
144
157
  },
145
158
  motion: {
@@ -3,8 +3,15 @@
3
3
  *
4
4
  * Computes a release viability score R_v from ten normalized input
5
5
  * dimensions and derives a verdict: block, pre-release, or stable.
6
+ *
7
+ * Weights are sourced from the omk.weights.v1 contract (releaseGate vector,
8
+ * normalize:true). The historical raw weights summed to 1.05; normalization
9
+ * divides weights, the regression penalty, and the verdict thresholds by the
10
+ * SAME factor (1/1.05), a pure uniform scaling — verdicts are mathematically
11
+ * identical for every input. Effective thresholds: preRelease ≈ 0.714286,
12
+ * stable ≈ 0.857143 (printed dynamically in reason strings).
6
13
  */
7
- import { type ReleasePromotionInputs, type ReleasePromotionResult } from "../runtime/contracts/weakness-remediation.js";
14
+ import type { ReleasePromotionInputs, ReleasePromotionResult } from "../runtime/contracts/weakness-remediation.js";
8
15
  /** Gate engine contract. */
9
16
  export interface ReleasePromotionGate {
10
17
  /** Evaluate inputs and return scored result with verdict. */