ltcai 4.0.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -24
- package/desktop/electron/main.cjs +44 -0
- package/docs/CHANGELOG.md +84 -0
- package/docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md +65 -0
- package/docs/V4_1_FRONTEND_MIGRATION_REPORT.md +70 -0
- package/docs/V4_1_VALIDATION_REPORT.md +47 -0
- package/docs/V4_2_BRAIN_CORE_ARCHITECTURE.md +97 -0
- package/docs/V4_2_STORAGE_MIGRATION_REPORT.md +91 -0
- package/docs/V4_2_VALIDATION_REPORT.md +89 -0
- package/docs/V4_DIGITAL_BRAIN_RECOVERY.md +31 -26
- package/frontend/index.html +24 -0
- package/frontend/openapi.json +14436 -0
- package/frontend/src/App.tsx +184 -0
- package/frontend/src/api/client.ts +320 -0
- package/frontend/src/api/openapi.ts +16921 -0
- package/frontend/src/components/primitives.tsx +204 -0
- package/frontend/src/components/ui/badge.tsx +27 -0
- package/frontend/src/components/ui/button.tsx +37 -0
- package/frontend/src/components/ui/card.tsx +22 -0
- package/frontend/src/components/ui/input.tsx +16 -0
- package/frontend/src/components/ui/textarea.tsx +16 -0
- package/frontend/src/lib/utils.ts +33 -0
- package/frontend/src/main.tsx +23 -0
- package/frontend/src/pages/Act.tsx +245 -0
- package/frontend/src/pages/Ask.tsx +200 -0
- package/frontend/src/pages/Brain.tsx +267 -0
- package/frontend/src/pages/Capture.tsx +158 -0
- package/frontend/src/pages/Library.tsx +187 -0
- package/frontend/src/pages/System.tsx +378 -0
- package/frontend/src/routes.ts +85 -0
- package/frontend/src/store/appStore.ts +54 -0
- package/frontend/src/styles.css +107 -0
- package/kg_schema.py +1 -1
- package/knowledge_graph.py +4 -4
- package/lattice_brain/__init__.py +70 -0
- package/lattice_brain/_kg_common.py +1 -0
- package/lattice_brain/archive.py +133 -0
- package/lattice_brain/context.py +3 -0
- package/lattice_brain/conversations.py +3 -0
- package/lattice_brain/core.py +82 -0
- package/lattice_brain/discovery.py +1 -0
- package/lattice_brain/documents.py +1 -0
- package/lattice_brain/embeddings.py +82 -0
- package/lattice_brain/identity.py +13 -0
- package/lattice_brain/ingest.py +1 -0
- package/lattice_brain/memory.py +3 -0
- package/lattice_brain/network.py +1 -0
- package/lattice_brain/projection.py +1 -0
- package/lattice_brain/provenance.py +1 -0
- package/lattice_brain/retrieval.py +1 -0
- package/lattice_brain/schema.py +1 -0
- package/lattice_brain/storage/__init__.py +22 -0
- package/lattice_brain/storage/base.py +72 -0
- package/lattice_brain/storage/docker.py +105 -0
- package/lattice_brain/storage/factory.py +31 -0
- package/lattice_brain/storage/migration.py +190 -0
- package/lattice_brain/storage/postgres.py +123 -0
- package/lattice_brain/storage/sqlite.py +128 -0
- package/lattice_brain/store.py +3 -0
- package/lattice_brain/write_master.py +1 -0
- package/latticeai/__init__.py +1 -1
- package/latticeai/api/portability.py +69 -0
- package/latticeai/api/setup.py +5 -4
- package/latticeai/api/static_routes.py +4 -4
- package/latticeai/app_factory.py +17 -10
- package/latticeai/brain/__init__.py +6 -6
- package/latticeai/brain/_kg_common.py +1 -1
- package/latticeai/brain/network.py +1 -1
- package/latticeai/brain/retrieval.py +15 -0
- package/latticeai/brain/store.py +22 -6
- package/latticeai/core/config.py +8 -0
- package/latticeai/core/marketplace.py +1 -1
- package/latticeai/core/multi_agent.py +1 -1
- package/latticeai/core/workspace_os.py +1 -1
- package/latticeai/services/kg_portability.py +82 -1
- package/package.json +55 -15
- package/scripts/build_frontend_assets.mjs +38 -0
- package/scripts/bump_version.py +4 -1
- package/scripts/export_openapi.py +31 -0
- package/scripts/lint_frontend.mjs +91 -0
- package/scripts/migrate_brain_storage.py +53 -0
- package/scripts/run_python.mjs +47 -0
- package/scripts/wheel_smoke.py +3 -0
- package/src-tauri/Cargo.lock +4833 -0
- package/src-tauri/Cargo.toml +19 -0
- package/src-tauri/build.rs +3 -0
- package/src-tauri/capabilities/default.json +7 -0
- package/src-tauri/src/main.rs +78 -0
- package/src-tauri/tauri.conf.json +39 -0
- package/static/app/asset-manifest.json +32 -0
- package/static/app/assets/core-CwxXejkd.js +2 -0
- package/static/app/assets/core-CwxXejkd.js.map +1 -0
- package/static/app/assets/index-CDjiH_se.css +2 -0
- package/static/app/assets/index-C_HAkbAg.js +333 -0
- package/static/app/assets/index-C_HAkbAg.js.map +1 -0
- package/static/app/index.html +25 -0
- package/static/manifest.json +2 -2
- package/static/sw.js +4 -4
- package/scripts/build_v3_assets.mjs +0 -170
- package/scripts/lint_v3.mjs +0 -120
- package/static/v3/asset-manifest.json +0 -63
- package/static/v3/css/lattice.base.49deefb5.css +0 -128
- package/static/v3/css/lattice.base.css +0 -128
- package/static/v3/css/lattice.components.cde18231.css +0 -472
- package/static/v3/css/lattice.components.css +0 -472
- package/static/v3/css/lattice.shell.29d36d85.css +0 -452
- package/static/v3/css/lattice.shell.css +0 -452
- package/static/v3/css/lattice.tokens.304cbc40.css +0 -135
- package/static/v3/css/lattice.tokens.css +0 -135
- package/static/v3/css/lattice.views.0a18b6c5.css +0 -360
- package/static/v3/css/lattice.views.css +0 -360
- package/static/v3/index.html +0 -68
- package/static/v3/js/app.c5c80c46.js +0 -26
- package/static/v3/js/app.js +0 -26
- package/static/v3/js/core/api.ba0fbf14.js +0 -625
- package/static/v3/js/core/api.js +0 -625
- package/static/v3/js/core/components.f25b3b93.js +0 -230
- package/static/v3/js/core/components.js +0 -230
- package/static/v3/js/core/dom.a2773eb0.js +0 -148
- package/static/v3/js/core/dom.js +0 -148
- package/static/v3/js/core/i18n.880e1fec.js +0 -575
- package/static/v3/js/core/i18n.js +0 -575
- package/static/v3/js/core/router.584570f2.js +0 -37
- package/static/v3/js/core/router.js +0 -37
- package/static/v3/js/core/routes.37522821.js +0 -101
- package/static/v3/js/core/routes.js +0 -101
- package/static/v3/js/core/shell.e3f6bbfa.js +0 -420
- package/static/v3/js/core/shell.js +0 -420
- package/static/v3/js/core/store.7b2aa044.js +0 -123
- package/static/v3/js/core/store.js +0 -123
- package/static/v3/js/views/account.eff40715.js +0 -143
- package/static/v3/js/views/account.js +0 -143
- package/static/v3/js/views/activity.0d271ef9.js +0 -67
- package/static/v3/js/views/activity.js +0 -67
- package/static/v3/js/views/admin-audit.660a1fb1.js +0 -185
- package/static/v3/js/views/admin-audit.js +0 -185
- package/static/v3/js/views/admin-permissions.a7ae5f09.js +0 -177
- package/static/v3/js/views/admin-permissions.js +0 -177
- package/static/v3/js/views/admin-policies.3658fd86.js +0 -102
- package/static/v3/js/views/admin-policies.js +0 -102
- package/static/v3/js/views/admin-private-vpc.7d342d36.js +0 -135
- package/static/v3/js/views/admin-private-vpc.js +0 -135
- package/static/v3/js/views/admin-security.07c66b72.js +0 -180
- package/static/v3/js/views/admin-security.js +0 -180
- package/static/v3/js/views/admin-users.f7ac7b43.js +0 -166
- package/static/v3/js/views/admin-users.js +0 -166
- package/static/v3/js/views/agents.17c5288d.js +0 -564
- package/static/v3/js/views/agents.js +0 -564
- package/static/v3/js/views/chat.e250e2cc.js +0 -624
- package/static/v3/js/views/chat.js +0 -624
- package/static/v3/js/views/files.adad14c1.js +0 -365
- package/static/v3/js/views/files.js +0 -365
- package/static/v3/js/views/graph-canvas.17c15d65.js +0 -509
- package/static/v3/js/views/graph-canvas.js +0 -509
- package/static/v3/js/views/home.24f8b8ae.js +0 -200
- package/static/v3/js/views/home.js +0 -200
- package/static/v3/js/views/hooks.37895880.js +0 -220
- package/static/v3/js/views/hooks.js +0 -220
- package/static/v3/js/views/hybrid-search.2fb63ed9.js +0 -194
- package/static/v3/js/views/hybrid-search.js +0 -194
- package/static/v3/js/views/knowledge-graph.4d09c537.js +0 -529
- package/static/v3/js/views/knowledge-graph.js +0 -529
- package/static/v3/js/views/marketplace.ab0583d4.js +0 -141
- package/static/v3/js/views/marketplace.js +0 -141
- package/static/v3/js/views/mcp.99b5c6a7.js +0 -114
- package/static/v3/js/views/mcp.js +0 -114
- package/static/v3/js/views/memory.4ebdf474.js +0 -147
- package/static/v3/js/views/memory.js +0 -147
- package/static/v3/js/views/models.a1ffa147.js +0 -256
- package/static/v3/js/views/models.js +0 -256
- package/static/v3/js/views/my-computer.d9d9ae1c.js +0 -463
- package/static/v3/js/views/my-computer.js +0 -463
- package/static/v3/js/views/network.52a4f181.js +0 -97
- package/static/v3/js/views/network.js +0 -97
- package/static/v3/js/views/pipeline.c522f1ce.js +0 -157
- package/static/v3/js/views/pipeline.js +0 -157
- package/static/v3/js/views/planning.4876fd77.js +0 -174
- package/static/v3/js/views/planning.js +0 -174
- package/static/v3/js/views/runs.b63b2afa.js +0 -144
- package/static/v3/js/views/runs.js +0 -144
- package/static/v3/js/views/settings.b7140634.js +0 -317
- package/static/v3/js/views/settings.js +0 -317
- package/static/v3/js/views/skills.c6c2f965.js +0 -109
- package/static/v3/js/views/skills.js +0 -109
- package/static/v3/js/views/snapshots.6f5db095.js +0 -135
- package/static/v3/js/views/snapshots.js +0 -135
- package/static/v3/js/views/tools.e4f11276.js +0 -108
- package/static/v3/js/views/tools.js +0 -108
- package/static/v3/js/views/workflows.7752225a.js +0 -213
- package/static/v3/js/views/workflows.js +0 -213
- package/static/v3/js/views/workspace-admin.c466029b.js +0 -156
- package/static/v3/js/views/workspace-admin.js +0 -156
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/* ============================================================================
|
|
2
|
-
* View: Audit Logs — Administration · activity and access trail.
|
|
3
|
-
* Reads /admin/audit (live) and renders unavailable state when it cannot load.
|
|
4
|
-
* Severity filter narrows the rendered events; a compact stat row summarizes
|
|
5
|
-
* actors, volume and risk at a glance.
|
|
6
|
-
* ========================================================================== */
|
|
7
|
-
|
|
8
|
-
import { timeAgo } from "../core/dom.js";
|
|
9
|
-
|
|
10
|
-
const SEVERITY = {
|
|
11
|
-
warning: { variant: "warn", label: "Warning", icon: "alert-triangle" },
|
|
12
|
-
notice: { variant: "info", label: "Notice", icon: "info-circle" },
|
|
13
|
-
informational: { variant: "", label: "Informational", icon: "point" },
|
|
14
|
-
};
|
|
15
|
-
function severityMeta(s) {
|
|
16
|
-
return SEVERITY[String(s || "").toLowerCase()] || { variant: "", label: titleCase(s) || "Event", icon: "point" };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const FILTERS = [
|
|
20
|
-
{ key: "all", label: "All" },
|
|
21
|
-
{ key: "informational", label: "Informational" },
|
|
22
|
-
{ key: "notice", label: "Notice" },
|
|
23
|
-
{ key: "warning", label: "Warning" },
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
export async function render(ctx) {
|
|
27
|
-
const { h, icon, api, c } = ctx;
|
|
28
|
-
|
|
29
|
-
const state = { events: [], source: "pending", filter: "all", loaded: false };
|
|
30
|
-
|
|
31
|
-
const srcSlot = h("span", c.sourceBadge("pending"));
|
|
32
|
-
const filterHost = h("div", buildTabs());
|
|
33
|
-
const statHost = h("div.lt3-statrow", c.loading({ lines: 1 }));
|
|
34
|
-
const tableHost = h("div", c.loading({ lines: 6 }));
|
|
35
|
-
|
|
36
|
-
const root = h("div.lt3-stack-6",
|
|
37
|
-
c.viewHeader({
|
|
38
|
-
eyebrow: "Administration",
|
|
39
|
-
title: "Audit Logs",
|
|
40
|
-
sub: "Activity and access trail",
|
|
41
|
-
actions: [
|
|
42
|
-
srcSlot,
|
|
43
|
-
h("button.lt3-btn.lt3-btn--ghost", {
|
|
44
|
-
on: { click: () => ctx.toast("Audit export is not available in this build (SIEM export is an Enterprise feature).", "warn") },
|
|
45
|
-
}, icon("download"), "Export"),
|
|
46
|
-
],
|
|
47
|
-
}),
|
|
48
|
-
statHost,
|
|
49
|
-
c.panel({
|
|
50
|
-
eyebrow: "Trail",
|
|
51
|
-
title: "Recent events",
|
|
52
|
-
head: h("div.lt3-row", { style: { "justify-content": "space-between", flex: "1 1 auto", gap: "var(--lt3-space-3)" } },
|
|
53
|
-
h("div", h("div.lt3-eyebrow", "Trail"), h("h3.lt3-panel__title", "Recent events")),
|
|
54
|
-
filterHost,
|
|
55
|
-
),
|
|
56
|
-
children: tableHost,
|
|
57
|
-
}),
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
function buildTabs() {
|
|
61
|
-
return c.tabs(FILTERS, state.filter, (key) => {
|
|
62
|
-
state.filter = key;
|
|
63
|
-
filterHost.replaceChildren(buildTabs());
|
|
64
|
-
renderTable();
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function visibleEvents() {
|
|
69
|
-
if (state.filter === "all") return state.events;
|
|
70
|
-
return state.events.filter((e) => String(e.severity || "").toLowerCase() === state.filter);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function renderStats() {
|
|
74
|
-
const events = state.events;
|
|
75
|
-
const actors = new Set(events.map((e) => e.actor).filter(Boolean)).size;
|
|
76
|
-
const startOfDay = new Date(); startOfDay.setHours(0, 0, 0, 0);
|
|
77
|
-
const today = events.filter((e) => {
|
|
78
|
-
const t = e.ts ? new Date(e.ts).getTime() : NaN;
|
|
79
|
-
return !Number.isNaN(t) && t >= startOfDay.getTime();
|
|
80
|
-
}).length;
|
|
81
|
-
const high = events.filter((e) => ["warning", "high", "critical"].includes(String(e.severity || "").toLowerCase())).length;
|
|
82
|
-
statHost.replaceChildren(
|
|
83
|
-
c.stat({ label: "Total events", value: c.fmtNum(events.length), icon: "list-details" }),
|
|
84
|
-
c.stat({ label: "Actors", value: c.fmtNum(actors), icon: "users" }),
|
|
85
|
-
c.stat({ label: "Today", value: c.fmtNum(today), icon: "calendar-event" }),
|
|
86
|
-
c.stat({ label: "High-severity", value: c.fmtNum(high), icon: "shield-exclamation" }),
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function renderTable() {
|
|
91
|
-
const rows = visibleEvents();
|
|
92
|
-
if (!rows.length) {
|
|
93
|
-
tableHost.replaceChildren(state.loaded
|
|
94
|
-
? c.emptyState({
|
|
95
|
-
icon: "history-off",
|
|
96
|
-
title: state.filter === "all" ? "No audit events" : "No matching events",
|
|
97
|
-
body: state.filter === "all"
|
|
98
|
-
? "Activity will appear here as users act in the workspace."
|
|
99
|
-
: "No events match this severity. Try a broader filter.",
|
|
100
|
-
action: state.filter === "all" ? null : h("button.lt3-btn.lt3-btn--subtle.lt3-btn--sm", {
|
|
101
|
-
on: { click: () => { state.filter = "all"; filterHost.replaceChildren(buildTabs()); renderTable(); } },
|
|
102
|
-
}, icon("filter-off"), "Clear filter"),
|
|
103
|
-
})
|
|
104
|
-
: c.loading({ lines: 6 }));
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
tableHost.replaceChildren(c.table(columns(ctx), rows));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
async function load() {
|
|
111
|
-
const res = await api.adminAudit();
|
|
112
|
-
state.events = normalize(res.data);
|
|
113
|
-
state.source = res.source;
|
|
114
|
-
state.loaded = true;
|
|
115
|
-
srcSlot.replaceChildren(c.sourceBadge(res.source));
|
|
116
|
-
renderStats();
|
|
117
|
-
renderTable();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
load();
|
|
121
|
-
return root;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/* ── table ───────────────────────────────────────────────────────────────── */
|
|
125
|
-
function columns({ h, icon, c }) {
|
|
126
|
-
return [
|
|
127
|
-
{
|
|
128
|
-
key: "ts", label: "Time", width: "1%",
|
|
129
|
-
render: (e) => h("span.lt3-mono.lt3-faint", { style: { "white-space": "nowrap", "font-size": "var(--lt3-text-2xs)" } },
|
|
130
|
-
e.ts ? timeAgo(e.ts) : "—"),
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
key: "actor", label: "Actor",
|
|
134
|
-
render: (e) => h("div.lt3-row-2",
|
|
135
|
-
h("span.lt3-avatar", { style: { width: "26px", height: "26px" } }, initials(e.actor)),
|
|
136
|
-
h("span", { style: { "font-size": "var(--lt3-text-sm)", "white-space": "nowrap" } }, e.actor || "system"),
|
|
137
|
-
),
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
key: "action", label: "Action", width: "1%",
|
|
141
|
-
render: (e) => h("span.lt3-pill.lt3-mono", { style: { "white-space": "nowrap" } }, e.action || "event"),
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
key: "target", label: "Target",
|
|
145
|
-
render: (e) => h("span.lt3-faint", { style: { "font-size": "var(--lt3-text-sm)" } }, e.target || "—"),
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
key: "severity", label: "Severity", width: "1%",
|
|
149
|
-
render: (e) => {
|
|
150
|
-
const m = severityMeta(e.severity);
|
|
151
|
-
return c.pill(m.label, m.variant, { dot: true });
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/* ── helpers ─────────────────────────────────────────────────────────────── */
|
|
158
|
-
function normalize(data) {
|
|
159
|
-
const list = Array.isArray(data) ? data
|
|
160
|
-
: Array.isArray(data && data.recent_events) ? data.recent_events
|
|
161
|
-
: Array.isArray(data && data.events) ? data.events
|
|
162
|
-
: [];
|
|
163
|
-
return list.map((e) => ({
|
|
164
|
-
ts: e.ts || e.timestamp || e.time || null,
|
|
165
|
-
actor: e.actor || e.user || e.email || "system",
|
|
166
|
-
action: e.action || e.event || "event",
|
|
167
|
-
target: e.target || e.resource || "",
|
|
168
|
-
severity: e.severity || e.level || "informational",
|
|
169
|
-
}));
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function initials(name) {
|
|
173
|
-
const s = String(name || "·").trim();
|
|
174
|
-
if (!s || s === "system") return "SY";
|
|
175
|
-
const at = s.indexOf("@");
|
|
176
|
-
const base = at > 0 ? s.slice(0, at) : s;
|
|
177
|
-
const parts = base.split(/[\s._-]+/).filter(Boolean);
|
|
178
|
-
if (parts.length >= 2) return (parts[0][0] + parts[1][0]).toUpperCase();
|
|
179
|
-
return base.slice(0, 2).toUpperCase();
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function titleCase(s) {
|
|
183
|
-
s = String(s || "").trim();
|
|
184
|
-
return s ? s[0].toUpperCase() + s.slice(1).toLowerCase() : "";
|
|
185
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/* ============================================================================
|
|
2
|
-
* View: Permissions — Administration · roles and capability mapping (RBAC).
|
|
3
|
-
* Renders the role → capability matrix and per-role summaries from the admin
|
|
4
|
-
* roles endpoint. Capabilities map to product areas; "all" grants everything.
|
|
5
|
-
* Role editing is read-only unless a backend mutation route is added.
|
|
6
|
-
*
|
|
7
|
-
* View contract (shared by all views):
|
|
8
|
-
* export async function render(ctx) -> single DOM node
|
|
9
|
-
* ctx = { h, icon, api, store, c, route, params, navigate, toast }
|
|
10
|
-
* ========================================================================== */
|
|
11
|
-
|
|
12
|
-
/* Capability columns, in product-area order. Each maps to a routable surface
|
|
13
|
-
* and a Tabler icon so the matrix reads at a glance. */
|
|
14
|
-
const CAPS = [
|
|
15
|
-
{ key: "chat", label: "Chat", icon: "message-2", route: "chat" },
|
|
16
|
-
{ key: "search", label: "Search", icon: "arrows-join", route: "hybrid-search" },
|
|
17
|
-
{ key: "files", label: "Files", icon: "folders", route: "files" },
|
|
18
|
-
{ key: "pipeline", label: "Pipeline", icon: "git-branch", route: "pipeline" },
|
|
19
|
-
{ key: "users", label: "Users", icon: "users", route: "admin/users" },
|
|
20
|
-
{ key: "policies", label: "Policies", icon: "shield-lock", route: "admin/policies" },
|
|
21
|
-
{ key: "audit", label: "Audit", icon: "history", route: "admin/audit" },
|
|
22
|
-
{ key: "security", label: "Security", icon: "shield-check", route: "admin/security" },
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
const ROLE_META = {
|
|
26
|
-
owner: { icon: "crown", variant: "ok" },
|
|
27
|
-
admin: { icon: "shield-check", variant: "info" },
|
|
28
|
-
member: { icon: "user-check", variant: "" },
|
|
29
|
-
viewer: { icon: "eye", variant: "warn" },
|
|
30
|
-
};
|
|
31
|
-
const metaFor = (role) => ROLE_META[String(role).toLowerCase()] || { icon: "user", variant: "" };
|
|
32
|
-
|
|
33
|
-
/** A role grants a capability when it holds "all" or that specific cap. */
|
|
34
|
-
const grants = (caps, key) => Array.isArray(caps) && (caps.includes("all") || caps.includes(key));
|
|
35
|
-
const capLabel = (key) => (CAPS.find((cc) => cc.key === key)?.label) || key;
|
|
36
|
-
|
|
37
|
-
export async function render(ctx) {
|
|
38
|
-
const { h, icon, c, navigate, toast } = ctx;
|
|
39
|
-
|
|
40
|
-
// Live RBAC roles from /admin/roles.
|
|
41
|
-
const res = await ctx.api.adminRoles();
|
|
42
|
-
const roles = Array.isArray(res.data && res.data.roles) ? res.data.roles
|
|
43
|
-
: (Array.isArray(res.data) ? res.data : []);
|
|
44
|
-
const source = res.source;
|
|
45
|
-
const totalMembers = roles.reduce((sum, r) => sum + (r.members || 0), 0);
|
|
46
|
-
|
|
47
|
-
const root = h("div.lt3-stack-6",
|
|
48
|
-
c.viewHeader({
|
|
49
|
-
eyebrow: "Administration",
|
|
50
|
-
title: "Permissions",
|
|
51
|
-
sub: "Roles and capability mapping.",
|
|
52
|
-
actions: [
|
|
53
|
-
c.sourceBadge(source),
|
|
54
|
-
h("button.lt3-btn.lt3-btn--ghost", { on: { click: () => navigate("admin/users") } }, icon("users"), "Members"),
|
|
55
|
-
h("button.lt3-btn.lt3-btn--primary", { on: { click: () => pendingToast(toast, "Creating a role") } }, icon("plus"), "New role"),
|
|
56
|
-
],
|
|
57
|
-
}),
|
|
58
|
-
|
|
59
|
-
c.banner(
|
|
60
|
-
"Access is role-based (RBAC): every member holds exactly one role, and each role grants a set of capabilities that map to product areas. The owner role grants all capabilities.",
|
|
61
|
-
"info",
|
|
62
|
-
"shield-lock",
|
|
63
|
-
),
|
|
64
|
-
|
|
65
|
-
h("div.lt3-statrow",
|
|
66
|
-
c.stat({ label: "Roles", value: roles.length, icon: "id-badge-2" }),
|
|
67
|
-
c.stat({ label: "Members", value: c.fmtNum(totalMembers), icon: "users" }),
|
|
68
|
-
c.stat({ label: "Capabilities", value: CAPS.length, icon: "key" }),
|
|
69
|
-
c.stat({ label: "Full-access roles", value: roles.filter((r) => (r.caps || []).includes("all")).length, icon: "crown" }),
|
|
70
|
-
),
|
|
71
|
-
|
|
72
|
-
c.panel({
|
|
73
|
-
eyebrow: "RBAC",
|
|
74
|
-
title: "Capability matrix",
|
|
75
|
-
sub: "Which product areas each role can reach. Scroll horizontally to see every capability.",
|
|
76
|
-
children: buildMatrix(ctx, roles),
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
h("section",
|
|
80
|
-
c.sectionHead("Roles", c.sourceBadge(source)),
|
|
81
|
-
buildRoleGrid(ctx, roles),
|
|
82
|
-
),
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
return root;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* ── Capability matrix ──────────────────────────────────────────────────── */
|
|
89
|
-
function buildMatrix(ctx, roles) {
|
|
90
|
-
const { h, icon, c } = ctx;
|
|
91
|
-
|
|
92
|
-
if (!roles.length) {
|
|
93
|
-
return c.emptyState({ icon: "lock-off", title: "No roles defined", body: "Define a role to start mapping capabilities." });
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const columns = [
|
|
97
|
-
{
|
|
98
|
-
key: "role",
|
|
99
|
-
label: "Role",
|
|
100
|
-
width: "180px",
|
|
101
|
-
render: (r) => {
|
|
102
|
-
const m = metaFor(r.role);
|
|
103
|
-
return h("div.lt3-row-2", { style: { "align-items": "center" } },
|
|
104
|
-
h("span.lt3-result__rank", { style: { color: "var(--accent)" } }, icon(m.icon)),
|
|
105
|
-
h("div.lt3-stack",
|
|
106
|
-
h("b", { style: { "font-size": "var(--lt3-text-sm)", "text-transform": "capitalize" } }, r.role),
|
|
107
|
-
c.pill(`${c.fmtNum(r.members || 0)} ${(r.members === 1) ? "member" : "members"}`, m.variant || "", { dot: true }),
|
|
108
|
-
),
|
|
109
|
-
);
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
...CAPS.map((cap) => ({
|
|
113
|
-
key: cap.key,
|
|
114
|
-
label: cap.label,
|
|
115
|
-
render: (r) => cell(ctx, grants(r.caps, cap.key)),
|
|
116
|
-
})),
|
|
117
|
-
];
|
|
118
|
-
|
|
119
|
-
return c.table(columns, roles);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/** A matrix cell: accent check when granted, muted dash when not. */
|
|
123
|
-
function cell({ h, icon }, granted) {
|
|
124
|
-
return h("div", { style: { display: "grid", "place-items": "center" }, "aria-label": granted ? "granted" : "not granted" },
|
|
125
|
-
granted
|
|
126
|
-
? h("span", { style: { color: "var(--accent)", "font-size": "var(--lt3-text-lg)", "line-height": "1" } }, icon("check"))
|
|
127
|
-
: h("span.lt3-faint", { style: { "font-size": "var(--lt3-text-lg)", "line-height": "1" }, "aria-hidden": "true" }, "–"),
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* ── Per-role summary cards ─────────────────────────────────────────────── */
|
|
132
|
-
function buildRoleGrid(ctx, roles) {
|
|
133
|
-
const { h } = ctx;
|
|
134
|
-
if (!roles.length) {
|
|
135
|
-
return ctx.c.emptyState({ icon: "lock-off", title: "No roles defined", body: "Define a role to map capabilities." });
|
|
136
|
-
}
|
|
137
|
-
return h("div.lt3-grid-auto", roles.map((r) => roleCard(ctx, r)));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function roleCard(ctx, r) {
|
|
141
|
-
const { h, icon, c, toast } = ctx;
|
|
142
|
-
const m = metaFor(r.role);
|
|
143
|
-
const isAll = (r.caps || []).includes("all");
|
|
144
|
-
const grantedKeys = isAll ? CAPS.map((cc) => cc.key) : CAPS.filter((cc) => (r.caps || []).includes(cc.key)).map((cc) => cc.key);
|
|
145
|
-
|
|
146
|
-
return c.card(
|
|
147
|
-
h("div.lt3-stack-3",
|
|
148
|
-
h("div.lt3-row", { style: { "justify-content": "space-between", "align-items": "flex-start" } },
|
|
149
|
-
h("div.lt3-row-2", { style: { "align-items": "center" } },
|
|
150
|
-
h("span.lt3-quick__icon", icon(m.icon)),
|
|
151
|
-
h("div.lt3-stack",
|
|
152
|
-
h("b", { style: { "font-size": "var(--lt3-text-md)", "text-transform": "capitalize" } }, r.role),
|
|
153
|
-
h("div.lt3-faint", { style: { "font-size": "var(--lt3-text-2xs)" } }, `${c.fmtNum(r.members || 0)} ${(r.members === 1) ? "member" : "members"}`),
|
|
154
|
-
),
|
|
155
|
-
),
|
|
156
|
-
c.pill(isAll ? "Full access" : `${grantedKeys.length}/${CAPS.length}`, m.variant || "info"),
|
|
157
|
-
),
|
|
158
|
-
|
|
159
|
-
h("div.lt3-cluster", { "aria-label": `${r.role} capabilities` },
|
|
160
|
-
isAll
|
|
161
|
-
? h("span.lt3-chip", { dataset: { active: "true" } }, icon("infinity"), "All capabilities")
|
|
162
|
-
: (grantedKeys.length
|
|
163
|
-
? grantedKeys.map((k) => h("span.lt3-chip", { dataset: { active: "true" } }, icon(CAPS.find((cc) => cc.key === k).icon), capLabel(k)))
|
|
164
|
-
: h("span.lt3-faint", { style: { "font-size": "var(--lt3-text-xs)" } }, "No capabilities")),
|
|
165
|
-
),
|
|
166
|
-
|
|
167
|
-
h("button.lt3-btn.lt3-btn--subtle.lt3-btn--sm", { style: { "align-self": "flex-start" }, on: { click: () => pendingToast(toast, `Editing the ${r.role} role`) } },
|
|
168
|
-
icon("edit"), "Edit role"),
|
|
169
|
-
),
|
|
170
|
-
{ attrs: { "data-role": r.role } },
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/* ── Read-only affordance ───────────────────────────────────────────────── */
|
|
175
|
-
function pendingToast(toast, what) {
|
|
176
|
-
toast(`${what} is not available in this build — roles are a fixed RBAC model (owner · admin · member · viewer).`, "warn");
|
|
177
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/* ============================================================================
|
|
2
|
-
* View: Permissions — Administration · roles and capability mapping (RBAC).
|
|
3
|
-
* Renders the role → capability matrix and per-role summaries from the admin
|
|
4
|
-
* roles endpoint. Capabilities map to product areas; "all" grants everything.
|
|
5
|
-
* Role editing is read-only unless a backend mutation route is added.
|
|
6
|
-
*
|
|
7
|
-
* View contract (shared by all views):
|
|
8
|
-
* export async function render(ctx) -> single DOM node
|
|
9
|
-
* ctx = { h, icon, api, store, c, route, params, navigate, toast }
|
|
10
|
-
* ========================================================================== */
|
|
11
|
-
|
|
12
|
-
/* Capability columns, in product-area order. Each maps to a routable surface
|
|
13
|
-
* and a Tabler icon so the matrix reads at a glance. */
|
|
14
|
-
const CAPS = [
|
|
15
|
-
{ key: "chat", label: "Chat", icon: "message-2", route: "chat" },
|
|
16
|
-
{ key: "search", label: "Search", icon: "arrows-join", route: "hybrid-search" },
|
|
17
|
-
{ key: "files", label: "Files", icon: "folders", route: "files" },
|
|
18
|
-
{ key: "pipeline", label: "Pipeline", icon: "git-branch", route: "pipeline" },
|
|
19
|
-
{ key: "users", label: "Users", icon: "users", route: "admin/users" },
|
|
20
|
-
{ key: "policies", label: "Policies", icon: "shield-lock", route: "admin/policies" },
|
|
21
|
-
{ key: "audit", label: "Audit", icon: "history", route: "admin/audit" },
|
|
22
|
-
{ key: "security", label: "Security", icon: "shield-check", route: "admin/security" },
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
const ROLE_META = {
|
|
26
|
-
owner: { icon: "crown", variant: "ok" },
|
|
27
|
-
admin: { icon: "shield-check", variant: "info" },
|
|
28
|
-
member: { icon: "user-check", variant: "" },
|
|
29
|
-
viewer: { icon: "eye", variant: "warn" },
|
|
30
|
-
};
|
|
31
|
-
const metaFor = (role) => ROLE_META[String(role).toLowerCase()] || { icon: "user", variant: "" };
|
|
32
|
-
|
|
33
|
-
/** A role grants a capability when it holds "all" or that specific cap. */
|
|
34
|
-
const grants = (caps, key) => Array.isArray(caps) && (caps.includes("all") || caps.includes(key));
|
|
35
|
-
const capLabel = (key) => (CAPS.find((cc) => cc.key === key)?.label) || key;
|
|
36
|
-
|
|
37
|
-
export async function render(ctx) {
|
|
38
|
-
const { h, icon, c, navigate, toast } = ctx;
|
|
39
|
-
|
|
40
|
-
// Live RBAC roles from /admin/roles.
|
|
41
|
-
const res = await ctx.api.adminRoles();
|
|
42
|
-
const roles = Array.isArray(res.data && res.data.roles) ? res.data.roles
|
|
43
|
-
: (Array.isArray(res.data) ? res.data : []);
|
|
44
|
-
const source = res.source;
|
|
45
|
-
const totalMembers = roles.reduce((sum, r) => sum + (r.members || 0), 0);
|
|
46
|
-
|
|
47
|
-
const root = h("div.lt3-stack-6",
|
|
48
|
-
c.viewHeader({
|
|
49
|
-
eyebrow: "Administration",
|
|
50
|
-
title: "Permissions",
|
|
51
|
-
sub: "Roles and capability mapping.",
|
|
52
|
-
actions: [
|
|
53
|
-
c.sourceBadge(source),
|
|
54
|
-
h("button.lt3-btn.lt3-btn--ghost", { on: { click: () => navigate("admin/users") } }, icon("users"), "Members"),
|
|
55
|
-
h("button.lt3-btn.lt3-btn--primary", { on: { click: () => pendingToast(toast, "Creating a role") } }, icon("plus"), "New role"),
|
|
56
|
-
],
|
|
57
|
-
}),
|
|
58
|
-
|
|
59
|
-
c.banner(
|
|
60
|
-
"Access is role-based (RBAC): every member holds exactly one role, and each role grants a set of capabilities that map to product areas. The owner role grants all capabilities.",
|
|
61
|
-
"info",
|
|
62
|
-
"shield-lock",
|
|
63
|
-
),
|
|
64
|
-
|
|
65
|
-
h("div.lt3-statrow",
|
|
66
|
-
c.stat({ label: "Roles", value: roles.length, icon: "id-badge-2" }),
|
|
67
|
-
c.stat({ label: "Members", value: c.fmtNum(totalMembers), icon: "users" }),
|
|
68
|
-
c.stat({ label: "Capabilities", value: CAPS.length, icon: "key" }),
|
|
69
|
-
c.stat({ label: "Full-access roles", value: roles.filter((r) => (r.caps || []).includes("all")).length, icon: "crown" }),
|
|
70
|
-
),
|
|
71
|
-
|
|
72
|
-
c.panel({
|
|
73
|
-
eyebrow: "RBAC",
|
|
74
|
-
title: "Capability matrix",
|
|
75
|
-
sub: "Which product areas each role can reach. Scroll horizontally to see every capability.",
|
|
76
|
-
children: buildMatrix(ctx, roles),
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
h("section",
|
|
80
|
-
c.sectionHead("Roles", c.sourceBadge(source)),
|
|
81
|
-
buildRoleGrid(ctx, roles),
|
|
82
|
-
),
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
return root;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* ── Capability matrix ──────────────────────────────────────────────────── */
|
|
89
|
-
function buildMatrix(ctx, roles) {
|
|
90
|
-
const { h, icon, c } = ctx;
|
|
91
|
-
|
|
92
|
-
if (!roles.length) {
|
|
93
|
-
return c.emptyState({ icon: "lock-off", title: "No roles defined", body: "Define a role to start mapping capabilities." });
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const columns = [
|
|
97
|
-
{
|
|
98
|
-
key: "role",
|
|
99
|
-
label: "Role",
|
|
100
|
-
width: "180px",
|
|
101
|
-
render: (r) => {
|
|
102
|
-
const m = metaFor(r.role);
|
|
103
|
-
return h("div.lt3-row-2", { style: { "align-items": "center" } },
|
|
104
|
-
h("span.lt3-result__rank", { style: { color: "var(--accent)" } }, icon(m.icon)),
|
|
105
|
-
h("div.lt3-stack",
|
|
106
|
-
h("b", { style: { "font-size": "var(--lt3-text-sm)", "text-transform": "capitalize" } }, r.role),
|
|
107
|
-
c.pill(`${c.fmtNum(r.members || 0)} ${(r.members === 1) ? "member" : "members"}`, m.variant || "", { dot: true }),
|
|
108
|
-
),
|
|
109
|
-
);
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
...CAPS.map((cap) => ({
|
|
113
|
-
key: cap.key,
|
|
114
|
-
label: cap.label,
|
|
115
|
-
render: (r) => cell(ctx, grants(r.caps, cap.key)),
|
|
116
|
-
})),
|
|
117
|
-
];
|
|
118
|
-
|
|
119
|
-
return c.table(columns, roles);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/** A matrix cell: accent check when granted, muted dash when not. */
|
|
123
|
-
function cell({ h, icon }, granted) {
|
|
124
|
-
return h("div", { style: { display: "grid", "place-items": "center" }, "aria-label": granted ? "granted" : "not granted" },
|
|
125
|
-
granted
|
|
126
|
-
? h("span", { style: { color: "var(--accent)", "font-size": "var(--lt3-text-lg)", "line-height": "1" } }, icon("check"))
|
|
127
|
-
: h("span.lt3-faint", { style: { "font-size": "var(--lt3-text-lg)", "line-height": "1" }, "aria-hidden": "true" }, "–"),
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* ── Per-role summary cards ─────────────────────────────────────────────── */
|
|
132
|
-
function buildRoleGrid(ctx, roles) {
|
|
133
|
-
const { h } = ctx;
|
|
134
|
-
if (!roles.length) {
|
|
135
|
-
return ctx.c.emptyState({ icon: "lock-off", title: "No roles defined", body: "Define a role to map capabilities." });
|
|
136
|
-
}
|
|
137
|
-
return h("div.lt3-grid-auto", roles.map((r) => roleCard(ctx, r)));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function roleCard(ctx, r) {
|
|
141
|
-
const { h, icon, c, toast } = ctx;
|
|
142
|
-
const m = metaFor(r.role);
|
|
143
|
-
const isAll = (r.caps || []).includes("all");
|
|
144
|
-
const grantedKeys = isAll ? CAPS.map((cc) => cc.key) : CAPS.filter((cc) => (r.caps || []).includes(cc.key)).map((cc) => cc.key);
|
|
145
|
-
|
|
146
|
-
return c.card(
|
|
147
|
-
h("div.lt3-stack-3",
|
|
148
|
-
h("div.lt3-row", { style: { "justify-content": "space-between", "align-items": "flex-start" } },
|
|
149
|
-
h("div.lt3-row-2", { style: { "align-items": "center" } },
|
|
150
|
-
h("span.lt3-quick__icon", icon(m.icon)),
|
|
151
|
-
h("div.lt3-stack",
|
|
152
|
-
h("b", { style: { "font-size": "var(--lt3-text-md)", "text-transform": "capitalize" } }, r.role),
|
|
153
|
-
h("div.lt3-faint", { style: { "font-size": "var(--lt3-text-2xs)" } }, `${c.fmtNum(r.members || 0)} ${(r.members === 1) ? "member" : "members"}`),
|
|
154
|
-
),
|
|
155
|
-
),
|
|
156
|
-
c.pill(isAll ? "Full access" : `${grantedKeys.length}/${CAPS.length}`, m.variant || "info"),
|
|
157
|
-
),
|
|
158
|
-
|
|
159
|
-
h("div.lt3-cluster", { "aria-label": `${r.role} capabilities` },
|
|
160
|
-
isAll
|
|
161
|
-
? h("span.lt3-chip", { dataset: { active: "true" } }, icon("infinity"), "All capabilities")
|
|
162
|
-
: (grantedKeys.length
|
|
163
|
-
? grantedKeys.map((k) => h("span.lt3-chip", { dataset: { active: "true" } }, icon(CAPS.find((cc) => cc.key === k).icon), capLabel(k)))
|
|
164
|
-
: h("span.lt3-faint", { style: { "font-size": "var(--lt3-text-xs)" } }, "No capabilities")),
|
|
165
|
-
),
|
|
166
|
-
|
|
167
|
-
h("button.lt3-btn.lt3-btn--subtle.lt3-btn--sm", { style: { "align-self": "flex-start" }, on: { click: () => pendingToast(toast, `Editing the ${r.role} role`) } },
|
|
168
|
-
icon("edit"), "Edit role"),
|
|
169
|
-
),
|
|
170
|
-
{ attrs: { "data-role": r.role } },
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/* ── Read-only affordance ───────────────────────────────────────────────── */
|
|
175
|
-
function pendingToast(toast, what) {
|
|
176
|
-
toast(`${what} is not available in this build — roles are a fixed RBAC model (owner · admin · member · viewer).`, "warn");
|
|
177
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/* ============================================================================
|
|
2
|
-
* View: Policies — administration · governance and enforcement.
|
|
3
|
-
* Surfaces the local-first guardrails the workspace enforces and the open-core
|
|
4
|
-
* seam where Enterprise governance packs extend them. Policy state reflects the
|
|
5
|
-
* live /admin/policies contract; missing backend data renders unavailable.
|
|
6
|
-
* ========================================================================== */
|
|
7
|
-
|
|
8
|
-
// Governance capabilities that live behind the open-core Enterprise seam. These
|
|
9
|
-
// are extension points, not implemented backend logic.
|
|
10
|
-
const PACKS = [
|
|
11
|
-
{ id: "siem", icon: "broadcast", title: "SIEM export", desc: "Stream the audit trail to an external SIEM (Splunk, Elastic, Sentinel)." },
|
|
12
|
-
{ id: "retention", icon: "archive", title: "Compliance retention", desc: "Configurable retention windows and legal-hold for messages and traces." },
|
|
13
|
-
{ id: "isolation", icon: "wall", title: "Tenant isolation", desc: "Hard multi-tenant boundaries with per-tenant keys and storage." },
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
export async function render(ctx) {
|
|
17
|
-
const { h, icon, c, toast } = ctx;
|
|
18
|
-
|
|
19
|
-
// Live governance posture from /admin/policies.
|
|
20
|
-
const res = await ctx.api.adminPolicies();
|
|
21
|
-
const policies = Array.isArray(res.data && res.data.policies) ? res.data.policies
|
|
22
|
-
: (Array.isArray(res.data) ? res.data : []);
|
|
23
|
-
const source = res.source;
|
|
24
|
-
|
|
25
|
-
const root = h("div.lt3-stack-6",
|
|
26
|
-
c.viewHeader({
|
|
27
|
-
eyebrow: "Administration",
|
|
28
|
-
title: "Policies",
|
|
29
|
-
sub: "Governance and enforcement.",
|
|
30
|
-
actions: [c.sourceBadge(source)],
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
c.banner(
|
|
34
|
-
"Policies enforce Lattice's local-first guardrails. Enterprise packs extend them with org-wide governance.",
|
|
35
|
-
"info",
|
|
36
|
-
"shield-lock",
|
|
37
|
-
),
|
|
38
|
-
|
|
39
|
-
h("section.lt3-stack-3",
|
|
40
|
-
c.sectionHead(
|
|
41
|
-
"Active guardrails",
|
|
42
|
-
c.sourceBadge(source),
|
|
43
|
-
),
|
|
44
|
-
policies.length
|
|
45
|
-
? h("div.lt3-stack-3", policies.map((p) => policyRow(ctx, p)))
|
|
46
|
-
: c.emptyState({ icon: "shield-off", title: "No policies defined", body: "Policies appear once the governance backend is connected." }),
|
|
47
|
-
),
|
|
48
|
-
|
|
49
|
-
packsPanel(ctx),
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return root;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/* ── One policy row: description and its real, runtime-enforced state ─────── */
|
|
56
|
-
// Policies are enforced by the runtime (approval gating, local-only egress,
|
|
57
|
-
// local storage). They are reported read-only — not user-toggleable — so the UI
|
|
58
|
-
// never implies a guardrail can be relaxed from the browser.
|
|
59
|
-
function policyRow({ h, icon, c }, p) {
|
|
60
|
-
return c.card(
|
|
61
|
-
h("div.lt3-row", { style: { "justify-content": "space-between", "align-items": "flex-start", "gap": "var(--lt3-space-4)", "flex-wrap": "wrap" } },
|
|
62
|
-
h("div.lt3-stack-2", { style: { "min-width": "0", "flex": "1 1 320px" } },
|
|
63
|
-
h("div.lt3-row-2",
|
|
64
|
-
h("span.lt3-card__icon", { style: { color: "var(--accent)" } }, icon("shield-check")),
|
|
65
|
-
h("h3", { style: { "font-size": "var(--lt3-text-base)", "font-weight": "var(--lt3-weight-semibold)", "margin": "0" } }, p.label),
|
|
66
|
-
),
|
|
67
|
-
h("p.lt3-muted", { style: { "font-size": "var(--lt3-text-sm)", "margin": "0" } }, p.value),
|
|
68
|
-
),
|
|
69
|
-
h("div.lt3-row-2", { style: { "flex": "none", "align-items": "center" } },
|
|
70
|
-
c.statePill(p.enforced ? "active" : "idle"),
|
|
71
|
-
h("span.lt3-faint", { style: { "font-size": "var(--lt3-text-2xs)" } }, p.enforced ? "Enforced" : "Not enforced"),
|
|
72
|
-
),
|
|
73
|
-
),
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/* ── Enterprise governance packs (open-core extension points) ────────────── */
|
|
78
|
-
function packsPanel({ h, icon, c }) {
|
|
79
|
-
return c.panel({
|
|
80
|
-
eyebrow: "Open core",
|
|
81
|
-
title: "Policy packs",
|
|
82
|
-
sub: "Governance capabilities available as Enterprise extension points on top of the local-first core.",
|
|
83
|
-
actions: c.sourceBadge("unavailable"),
|
|
84
|
-
children: h("div.lt3-stack-2",
|
|
85
|
-
PACKS.map((pk) => h("div.lt3-card.lt3-card--flat",
|
|
86
|
-
h("div.lt3-row", { style: { "justify-content": "space-between", "align-items": "center", "gap": "var(--lt3-space-4)", "flex-wrap": "wrap" } },
|
|
87
|
-
h("div.lt3-row-2", { style: { "min-width": "0", "flex": "1 1 320px" } },
|
|
88
|
-
h("span.lt3-card__icon", { style: { color: "var(--muted)" } }, icon(pk.icon)),
|
|
89
|
-
h("div.lt3-stack-2", { style: { "min-width": "0" } },
|
|
90
|
-
h("div", { style: { "font-weight": "var(--lt3-weight-medium)" } }, pk.title),
|
|
91
|
-
h("div.lt3-faint", { style: { "font-size": "var(--lt3-text-xs)" } }, pk.desc),
|
|
92
|
-
),
|
|
93
|
-
),
|
|
94
|
-
h("div.lt3-row-2", { style: { "flex": "none" } },
|
|
95
|
-
c.pill("Enterprise", "info"),
|
|
96
|
-
h("span.lt3-faint", { style: { "font-size": "var(--lt3-text-2xs)" } }, "Available as an extension point"),
|
|
97
|
-
),
|
|
98
|
-
),
|
|
99
|
-
)),
|
|
100
|
-
),
|
|
101
|
-
});
|
|
102
|
-
}
|