@xemahq/ui-kernel 0.1.7 → 0.1.8
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.
- package/dist/lib/biome-host/agent-validation.d.ts +22 -0
- package/dist/lib/biome-host/agent-validation.d.ts.map +1 -0
- package/dist/lib/biome-host/agent-validation.js +127 -0
- package/dist/lib/biome-host/agent-validation.js.map +1 -0
- package/dist/lib/biome-host/frontend-biome.d.ts +3 -1
- package/dist/lib/biome-host/frontend-biome.d.ts.map +1 -1
- package/dist/lib/biome-host/index.d.ts +1 -1
- package/dist/lib/biome-host/index.d.ts.map +1 -1
- package/dist/lib/biome-host/index.js +1 -1
- package/dist/lib/biome-host/index.js.map +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/lib/agent-validation-host.d.ts +3 -0
- package/dist/registry/lib/agent-validation-host.d.ts.map +1 -0
- package/dist/registry/lib/agent-validation-host.js +10 -0
- package/dist/registry/lib/agent-validation-host.js.map +1 -0
- package/package.json +2 -2
- package/src/lib/biome-host/frontend-biome.ts +22 -2
- package/src/lib/biome-host/index.ts +1 -1
- package/src/registry/index.ts +1 -1
- package/src/registry/lib/extension-points.ts +1 -1
- /package/src/lib/biome-host/{composition-validation.ts → agent-validation.ts} +0 -0
- /package/src/registry/lib/{composition-validation-host.ts → agent-validation-host.ts} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FrontendBiome } from './frontend-biome';
|
|
2
|
+
export declare enum CompositionDiagnosticSeverity {
|
|
3
|
+
Error = "error",
|
|
4
|
+
Warning = "warning"
|
|
5
|
+
}
|
|
6
|
+
export declare enum CompositionDiagnosticCode {
|
|
7
|
+
DuplicateRoutePath = "duplicate_route_path",
|
|
8
|
+
DuplicateNavId = "duplicate_nav_id",
|
|
9
|
+
UnknownSlot = "unknown_slot",
|
|
10
|
+
OrphanedPanelSlot = "orphaned_panel_slot"
|
|
11
|
+
}
|
|
12
|
+
export interface CompositionDiagnostic {
|
|
13
|
+
readonly code: CompositionDiagnosticCode;
|
|
14
|
+
readonly severity: CompositionDiagnosticSeverity;
|
|
15
|
+
readonly biomeIds: readonly string[];
|
|
16
|
+
readonly message: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ValidateBiomeCompositionOptions {
|
|
19
|
+
readonly knownSlots: ReadonlySet<string>;
|
|
20
|
+
}
|
|
21
|
+
export declare function validateBiomeComposition(biomes: readonly FrontendBiome[], options: ValidateBiomeCompositionOptions): readonly CompositionDiagnostic[];
|
|
22
|
+
//# sourceMappingURL=agent-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-validation.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/agent-validation.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,oBAAY,6BAA6B;IAMvC,KAAK,UAAU;IAOf,OAAO,YAAY;CACpB;AAGD,oBAAY,yBAAyB;IAEnC,kBAAkB,yBAAyB;IAE3C,cAAc,qBAAqB;IAKnC,WAAW,iBAAiB;IAK5B,iBAAiB,wBAAwB;CAC1C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,6BAA6B,CAAC;IAEjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAErC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,+BAA+B;IAM9C,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC1C;AAwBD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,OAAO,EAAE,+BAA+B,GACvC,SAAS,qBAAqB,EAAE,CA6FlC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompositionDiagnosticCode = exports.CompositionDiagnosticSeverity = void 0;
|
|
4
|
+
exports.validateBiomeComposition = validateBiomeComposition;
|
|
5
|
+
var CompositionDiagnosticSeverity;
|
|
6
|
+
(function (CompositionDiagnosticSeverity) {
|
|
7
|
+
CompositionDiagnosticSeverity["Error"] = "error";
|
|
8
|
+
CompositionDiagnosticSeverity["Warning"] = "warning";
|
|
9
|
+
})(CompositionDiagnosticSeverity || (exports.CompositionDiagnosticSeverity = CompositionDiagnosticSeverity = {}));
|
|
10
|
+
var CompositionDiagnosticCode;
|
|
11
|
+
(function (CompositionDiagnosticCode) {
|
|
12
|
+
CompositionDiagnosticCode["DuplicateRoutePath"] = "duplicate_route_path";
|
|
13
|
+
CompositionDiagnosticCode["DuplicateNavId"] = "duplicate_nav_id";
|
|
14
|
+
CompositionDiagnosticCode["UnknownSlot"] = "unknown_slot";
|
|
15
|
+
CompositionDiagnosticCode["OrphanedPanelSlot"] = "orphaned_panel_slot";
|
|
16
|
+
})(CompositionDiagnosticCode || (exports.CompositionDiagnosticCode = CompositionDiagnosticCode = {}));
|
|
17
|
+
function biomeOwnedSlotOwner(slot) {
|
|
18
|
+
const slashIndex = slot.indexOf('/');
|
|
19
|
+
if (slashIndex <= 0)
|
|
20
|
+
return null;
|
|
21
|
+
if (slot.indexOf('/', slashIndex + 1) !== -1)
|
|
22
|
+
return null;
|
|
23
|
+
const owner = slot.slice(0, slashIndex);
|
|
24
|
+
const name = slot.slice(slashIndex + 1);
|
|
25
|
+
if (owner.length === 0 || name.length === 0)
|
|
26
|
+
return null;
|
|
27
|
+
return owner;
|
|
28
|
+
}
|
|
29
|
+
function validateBiomeComposition(biomes, options) {
|
|
30
|
+
const diagnostics = [];
|
|
31
|
+
const biomeIds = new Set(biomes.map((b) => b.id));
|
|
32
|
+
const routeOwners = new Map();
|
|
33
|
+
for (const biome of biomes) {
|
|
34
|
+
for (const route of biome.routes ?? []) {
|
|
35
|
+
const scope = route.projectScoped ? 'project' : 'root';
|
|
36
|
+
const key = `${scope}:${route.path}`;
|
|
37
|
+
const owners = routeOwners.get(key);
|
|
38
|
+
if (owners)
|
|
39
|
+
owners.push(biome.id);
|
|
40
|
+
else
|
|
41
|
+
routeOwners.set(key, [biome.id]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
for (const [key, owners] of routeOwners) {
|
|
45
|
+
if (owners.length < 2)
|
|
46
|
+
continue;
|
|
47
|
+
const [scope, path] = splitFirst(key, ':');
|
|
48
|
+
diagnostics.push({
|
|
49
|
+
code: CompositionDiagnosticCode.DuplicateRoutePath,
|
|
50
|
+
severity: CompositionDiagnosticSeverity.Error,
|
|
51
|
+
biomeIds: owners,
|
|
52
|
+
message: `Route path '${path}' (${scope}-scoped) is contributed by multiple biomes: ` +
|
|
53
|
+
`${owners.join(', ')}. Each route must be unique within its scope — ` +
|
|
54
|
+
`only one would mount and the others would be unreachable.`,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const navOwners = new Map();
|
|
58
|
+
for (const biome of biomes) {
|
|
59
|
+
for (const navItem of biome.navItems ?? []) {
|
|
60
|
+
const owners = navOwners.get(navItem.id);
|
|
61
|
+
if (owners)
|
|
62
|
+
owners.push(biome.id);
|
|
63
|
+
else
|
|
64
|
+
navOwners.set(navItem.id, [biome.id]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
for (const [navId, owners] of navOwners) {
|
|
68
|
+
if (owners.length < 2)
|
|
69
|
+
continue;
|
|
70
|
+
diagnostics.push({
|
|
71
|
+
code: CompositionDiagnosticCode.DuplicateNavId,
|
|
72
|
+
severity: CompositionDiagnosticSeverity.Error,
|
|
73
|
+
biomeIds: owners,
|
|
74
|
+
message: `Nav id '${navId}' is contributed by multiple biomes: ${owners.join(', ')}. ` +
|
|
75
|
+
`Nav ids must be unique — a duplicate silently overwrites the ` +
|
|
76
|
+
`feature-route mapping and collides as a render key.`,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
for (const biome of biomes) {
|
|
80
|
+
for (const panel of biome.panels ?? []) {
|
|
81
|
+
if (options.knownSlots.has(panel.slot))
|
|
82
|
+
continue;
|
|
83
|
+
const owner = biomeOwnedSlotOwner(panel.slot);
|
|
84
|
+
if (owner === null) {
|
|
85
|
+
diagnostics.push({
|
|
86
|
+
code: CompositionDiagnosticCode.UnknownSlot,
|
|
87
|
+
severity: CompositionDiagnosticSeverity.Warning,
|
|
88
|
+
biomeIds: [biome.id],
|
|
89
|
+
message: `Biome '${biome.id}' panel '${panel.id}' targets slot '${panel.slot}', ` +
|
|
90
|
+
`which is neither a known host slot nor a well-formed ` +
|
|
91
|
+
`'<owner>/<name>' biome-owned slot. It will never render — ` +
|
|
92
|
+
`check for a typo against the host slot catalog.`,
|
|
93
|
+
});
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (!biomeIds.has(owner)) {
|
|
97
|
+
diagnostics.push({
|
|
98
|
+
code: CompositionDiagnosticCode.OrphanedPanelSlot,
|
|
99
|
+
severity: CompositionDiagnosticSeverity.Warning,
|
|
100
|
+
biomeIds: [biome.id],
|
|
101
|
+
message: `Biome '${biome.id}' panel '${panel.id}' targets biome-owned slot ` +
|
|
102
|
+
`'${panel.slot}', but its owner biome '${owner}' is not registered. ` +
|
|
103
|
+
`The panel will never render until '${owner}' is enabled.`,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return sortDiagnostics(diagnostics);
|
|
109
|
+
}
|
|
110
|
+
function splitFirst(value, sep) {
|
|
111
|
+
const idx = value.indexOf(sep);
|
|
112
|
+
if (idx === -1)
|
|
113
|
+
return [value, ''];
|
|
114
|
+
return [value.slice(0, idx), value.slice(idx + sep.length)];
|
|
115
|
+
}
|
|
116
|
+
function sortDiagnostics(diagnostics) {
|
|
117
|
+
return diagnostics.slice().sort((a, b) => {
|
|
118
|
+
if (a.code !== b.code)
|
|
119
|
+
return a.code.localeCompare(b.code);
|
|
120
|
+
const ai = a.biomeIds.join(',');
|
|
121
|
+
const bi = b.biomeIds.join(',');
|
|
122
|
+
if (ai !== bi)
|
|
123
|
+
return ai.localeCompare(bi);
|
|
124
|
+
return a.message.localeCompare(b.message);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=agent-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-validation.js","sourceRoot":"","sources":["../../../src/lib/biome-host/agent-validation.ts"],"names":[],"mappings":";;;AAkGA,4DAgGC;AA1KD,IAAY,6BAcX;AAdD,WAAY,6BAA6B;IAMvC,gDAAe,CAAA;IAOf,oDAAmB,CAAA;AACrB,CAAC,EAdW,6BAA6B,6CAA7B,6BAA6B,QAcxC;AAGD,IAAY,yBAeX;AAfD,WAAY,yBAAyB;IAEnC,wEAA2C,CAAA;IAE3C,gEAAmC,CAAA;IAKnC,yDAA4B,CAAA;IAK5B,sEAAyC,CAAA;AAC3C,CAAC,EAfW,yBAAyB,yCAAzB,yBAAyB,QAepC;AA0BD,SAAS,mBAAmB,CAAC,IAAY;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,C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AK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9D,CAAC;AAGD,SAAS,eAAe,CACtB,WAAoC;IAEpC,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3D,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,EAAE,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -11,10 +11,12 @@ export interface NavItemContribution {
|
|
|
11
11
|
readonly section?: string;
|
|
12
12
|
readonly weight?: number;
|
|
13
13
|
}
|
|
14
|
+
export type RouteAccess = 'member' | 'org-admin' | 'platform-admin';
|
|
14
15
|
export interface RouteContribution {
|
|
15
16
|
readonly path: string;
|
|
16
17
|
readonly element: () => ReactNode;
|
|
17
|
-
readonly projectScoped
|
|
18
|
+
readonly projectScoped: boolean;
|
|
19
|
+
readonly access?: RouteAccess;
|
|
18
20
|
}
|
|
19
21
|
export interface PanelContribution {
|
|
20
22
|
readonly slot: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-biome.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/frontend-biome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,E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AAW,0BAA0B;IAOzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAQ5B,QAAQ,CAAC,MAAM,EAAE,MAAM,aAAa,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACpE;AAaD,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/index.ts"],"names":[],"mappings":"AAcA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/index.ts"],"names":[],"mappings":"AAcA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
|
@@ -23,5 +23,5 @@ __exportStar(require("./session-profiles"), exports);
|
|
|
23
23
|
__exportStar(require("./host-sources"), exports);
|
|
24
24
|
__exportStar(require("./nav"), exports);
|
|
25
25
|
__exportStar(require("./biome-mode"), exports);
|
|
26
|
-
__exportStar(require("./
|
|
26
|
+
__exportStar(require("./agent-validation"), exports);
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/biome-host/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAcA,mDAAiC;AACjC,gDAA8B;AAC9B,8DAA4C;AAC5C,mDAAiC;AACjC,0DAAwC;AACxC,qDAAmC;AACnC,iDAA+B;AAC/B,wCAAsB;AACtB,+CAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/biome-host/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAcA,mDAAiC;AACjC,gDAA8B;AAC9B,8DAA4C;AAC5C,mDAAiC;AACjC,0DAAwC;AACxC,qDAAmC;AACnC,iDAA+B;AAC/B,wCAAsB;AACtB,+CAA6B;AAC7B,qDAAmC"}
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC"}
|
package/dist/registry/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./lib/extension-points"), exports);
|
|
18
|
-
__exportStar(require("./lib/
|
|
18
|
+
__exportStar(require("./lib/agent-validation-host"), exports);
|
|
19
19
|
__exportStar(require("./lib/biome-slot"), exports);
|
|
20
20
|
__exportStar(require("./lib/biomes-enabled-context"), exports);
|
|
21
21
|
__exportStar(require("./lib/session-selectors"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,8DAA4C;AAC5C,mDAAiC;AACjC,+DAA6C;AAC7C,0DAAwC;AACxC,gEAA8C;AAC9C,iEAA+C;AAC/C,mDAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-validation-host.d.ts","sourceRoot":"","sources":["../../../src/registry/lib/agent-validation-host.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AAkBrB,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,SAAS,aAAa,EAAE,GAC/B,SAAS,qBAAqB,EAAE,CAElC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateHostBiomeComposition = validateHostBiomeComposition;
|
|
4
|
+
const index_1 = require("../../index");
|
|
5
|
+
const extension_points_1 = require("./extension-points");
|
|
6
|
+
const HOST_SLOT_IDS = new Set(Object.values(extension_points_1.HostExtensionSlots));
|
|
7
|
+
function validateHostBiomeComposition(biomes) {
|
|
8
|
+
return (0, index_1.validateBiomeComposition)(biomes, { knownSlots: HOST_SLOT_IDS });
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=agent-validation-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-validation-host.js","sourceRoot":"","sources":["../../../src/registry/lib/agent-validation-host.ts"],"names":[],"mappings":";;AAgCA,oEAIC;AA1BD,uCAIqB;AAErB,yDAAwD;AAOxD,MAAM,aAAa,GAAwB,IAAI,GAAG,CAChD,MAAM,CAAC,MAAM,CAAC,qCAAkB,CAAC,CAClC,CAAC;AAOF,SAAgB,4BAA4B,CAC1C,MAAgC;IAEhC,OAAO,IAAA,gCAAwB,EAAC,MAAM,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,CAAC;AACzE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/ui-kernel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Host-framework-agnostic UI kernel for the Xema OS. Defines the SystemBus orchestration contract (capability.invoke, cross-biome intents, command palette, xema:// deeplinks, window manager) AND the biome-host contract surface (FrontendBiome/FrontendBiomeFactory, HostBridge, the singleton biomeRegistry, session contributions) that every frontend biome composes against. No Vite, Next.js, or React-Router — React itself IS allowed as the shared component model (the contracts traffic in ReactNode/ComponentType and a React context). Concrete host adapters (router/auth/toast wiring) live in separate packages that consume this kernel. The SystemBus is pure orchestration: it never authorizes, the backend capability-router enforces all policy.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xema",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@xemahq/kernel-contracts": "^0.
|
|
38
|
+
"@xemahq/kernel-contracts": "^0.8.0",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"tailwind-merge": "^2.5.4",
|
|
41
41
|
"@xemahq/registry": "0.1.3"
|
|
@@ -33,13 +33,33 @@ export interface NavItemContribution {
|
|
|
33
33
|
readonly weight?: number;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Access tier required to render a route. The host resolver enforces it
|
|
38
|
+
* declaratively — nav-hide is NOT a security boundary, a deeplink bypasses it.
|
|
39
|
+
* Precedence (least → most privileged): `member` < `org-admin` <
|
|
40
|
+
* `platform-admin`. Defaults to `member` when a route omits the field.
|
|
41
|
+
*/
|
|
42
|
+
export type RouteAccess = 'member' | 'org-admin' | 'platform-admin';
|
|
43
|
+
|
|
36
44
|
export interface RouteContribution {
|
|
37
45
|
/** React-router path. May include params. */
|
|
38
46
|
readonly path: string;
|
|
39
47
|
/** Element factory — host calls it inside the route tree. */
|
|
40
48
|
readonly element: () => ReactNode;
|
|
41
|
-
/**
|
|
42
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Whether the route is project-scoped (mounted under /projects/:projectId)
|
|
51
|
+
* or org-scoped (mounted at the org root). REQUIRED — the host nav resolver
|
|
52
|
+
* partitions the rail strictly by this flag and drops any nav item whose
|
|
53
|
+
* route can't be matched (fail-loud). A silent default would re-introduce the
|
|
54
|
+
* "project pages showing at org level" class of bug, so every route MUST
|
|
55
|
+
* declare its scope explicitly.
|
|
56
|
+
*/
|
|
57
|
+
readonly projectScoped: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Access tier required to render this route. The host resolver enforces it
|
|
60
|
+
* declaratively. Defaults to `'member'` when omitted.
|
|
61
|
+
*/
|
|
62
|
+
readonly access?: RouteAccess;
|
|
43
63
|
}
|
|
44
64
|
|
|
45
65
|
/**
|
package/src/registry/index.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* readable via the host bridge's location").
|
|
19
19
|
* 2. Mount `<BiomeSlot name={HostExtensionSlots.X} />` in the host
|
|
20
20
|
* page.
|
|
21
|
-
* 3. Document the slot in `
|
|
21
|
+
* 3. Document the slot in the xema-docs repo (`content/biomes/04-frontend-extensions.md`).
|
|
22
22
|
*
|
|
23
23
|
* Removing a host slot is a breaking change — bump the kernel package
|
|
24
24
|
* major version.
|
|
File without changes
|
|
File without changes
|