ltcai 4.0.0 → 4.1.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.
Files changed (195) hide show
  1. package/README.md +42 -33
  2. package/desktop/electron/main.cjs +44 -0
  3. package/docs/CHANGELOG.md +106 -0
  4. package/docs/REALTIME_COLLABORATION.md +3 -3
  5. package/docs/V3_FRONTEND.md +9 -8
  6. package/docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md +65 -0
  7. package/docs/V4_1_FRONTEND_MIGRATION_REPORT.md +70 -0
  8. package/docs/V4_1_VALIDATION_REPORT.md +47 -0
  9. package/docs/V4_DIGITAL_BRAIN_RECOVERY.md +95 -45
  10. package/docs/kg-schema.md +6 -2
  11. package/docs/spec-vs-impl.md +10 -10
  12. package/frontend/index.html +24 -0
  13. package/frontend/openapi.json +14190 -0
  14. package/frontend/src/App.tsx +184 -0
  15. package/frontend/src/api/client.ts +317 -0
  16. package/frontend/src/api/openapi.ts +16637 -0
  17. package/frontend/src/components/primitives.tsx +204 -0
  18. package/frontend/src/components/ui/badge.tsx +27 -0
  19. package/frontend/src/components/ui/button.tsx +37 -0
  20. package/frontend/src/components/ui/card.tsx +22 -0
  21. package/frontend/src/components/ui/input.tsx +16 -0
  22. package/frontend/src/components/ui/textarea.tsx +16 -0
  23. package/frontend/src/lib/utils.ts +33 -0
  24. package/frontend/src/main.tsx +23 -0
  25. package/frontend/src/pages/Act.tsx +245 -0
  26. package/frontend/src/pages/Ask.tsx +200 -0
  27. package/frontend/src/pages/Brain.tsx +267 -0
  28. package/frontend/src/pages/Capture.tsx +158 -0
  29. package/frontend/src/pages/Library.tsx +187 -0
  30. package/frontend/src/pages/System.tsx +344 -0
  31. package/frontend/src/routes.ts +85 -0
  32. package/frontend/src/store/appStore.ts +54 -0
  33. package/frontend/src/styles.css +107 -0
  34. package/kg_schema.py +2 -603
  35. package/knowledge_graph.py +37 -4958
  36. package/latticeai/__init__.py +1 -1
  37. package/latticeai/api/admin.py +15 -16
  38. package/latticeai/api/agents.py +13 -6
  39. package/latticeai/api/auth.py +19 -11
  40. package/latticeai/api/invitations.py +100 -0
  41. package/latticeai/api/knowledge_graph.py +4 -11
  42. package/latticeai/api/plugins.py +3 -6
  43. package/latticeai/api/realtime.py +4 -7
  44. package/latticeai/api/setup.py +5 -4
  45. package/latticeai/api/static_routes.py +13 -16
  46. package/latticeai/api/ui_redirects.py +26 -0
  47. package/latticeai/api/workflow_designer.py +39 -6
  48. package/latticeai/api/workspace.py +24 -10
  49. package/latticeai/app_factory.py +88 -17
  50. package/latticeai/brain/_kg_common.py +1123 -0
  51. package/latticeai/brain/discovery.py +1455 -0
  52. package/latticeai/brain/documents.py +218 -0
  53. package/latticeai/brain/ingest.py +644 -0
  54. package/latticeai/brain/projection.py +561 -0
  55. package/latticeai/brain/provenance.py +401 -0
  56. package/latticeai/brain/retrieval.py +1316 -0
  57. package/latticeai/brain/schema.py +640 -0
  58. package/latticeai/brain/store.py +216 -0
  59. package/latticeai/brain/write_master.py +225 -0
  60. package/latticeai/core/invitations.py +131 -0
  61. package/latticeai/core/marketplace.py +1 -1
  62. package/latticeai/core/multi_agent.py +1 -1
  63. package/latticeai/core/policy.py +54 -0
  64. package/latticeai/core/realtime.py +65 -44
  65. package/latticeai/core/sessions.py +31 -5
  66. package/latticeai/core/users.py +147 -0
  67. package/latticeai/core/workspace_os.py +420 -20
  68. package/latticeai/services/agent_runtime.py +242 -4
  69. package/latticeai/services/run_executor.py +328 -0
  70. package/latticeai/services/workspace_service.py +27 -19
  71. package/package.json +54 -27
  72. package/scripts/build_frontend_assets.mjs +38 -0
  73. package/scripts/bump_version.py +1 -1
  74. package/scripts/export_openapi.py +31 -0
  75. package/scripts/lint_frontend.mjs +86 -0
  76. package/scripts/run_python.mjs +47 -0
  77. package/src-tauri/Cargo.lock +4833 -0
  78. package/src-tauri/Cargo.toml +19 -0
  79. package/src-tauri/build.rs +3 -0
  80. package/src-tauri/capabilities/default.json +7 -0
  81. package/src-tauri/src/main.rs +78 -0
  82. package/src-tauri/tauri.conf.json +36 -0
  83. package/static/app/asset-manifest.json +32 -0
  84. package/static/app/assets/core-CwxXejkd.js +2 -0
  85. package/static/app/assets/core-CwxXejkd.js.map +1 -0
  86. package/static/app/assets/index-CJRAzNnf.js +333 -0
  87. package/static/app/assets/index-CJRAzNnf.js.map +1 -0
  88. package/static/app/assets/index-CSwBBgf4.css +2 -0
  89. package/static/app/index.html +25 -0
  90. package/static/manifest.json +2 -2
  91. package/static/sw.js +4 -4
  92. package/scripts/build_v3_assets.mjs +0 -170
  93. package/scripts/lint_v3.mjs +0 -97
  94. package/static/account.html +0 -113
  95. package/static/activity.html +0 -73
  96. package/static/admin.html +0 -486
  97. package/static/agents.html +0 -139
  98. package/static/chat.html +0 -841
  99. package/static/css/reference/account.css +0 -439
  100. package/static/css/reference/admin.css +0 -610
  101. package/static/css/reference/base.css +0 -1661
  102. package/static/css/reference/chat.css +0 -4623
  103. package/static/css/reference/graph.css +0 -1016
  104. package/static/css/responsive.css +0 -861
  105. package/static/graph.html +0 -122
  106. package/static/platform.css +0 -104
  107. package/static/plugins.html +0 -136
  108. package/static/scripts/account.js +0 -238
  109. package/static/scripts/admin.js +0 -1614
  110. package/static/scripts/chat.js +0 -5081
  111. package/static/scripts/graph.js +0 -1804
  112. package/static/scripts/platform.js +0 -64
  113. package/static/scripts/ux.js +0 -167
  114. package/static/scripts/workspace.js +0 -948
  115. package/static/v3/asset-manifest.json +0 -56
  116. package/static/v3/css/lattice.base.49deefb5.css +0 -128
  117. package/static/v3/css/lattice.base.css +0 -128
  118. package/static/v3/css/lattice.components.cde18231.css +0 -472
  119. package/static/v3/css/lattice.components.css +0 -472
  120. package/static/v3/css/lattice.shell.29d36d85.css +0 -452
  121. package/static/v3/css/lattice.shell.css +0 -452
  122. package/static/v3/css/lattice.tokens.304cbc40.css +0 -135
  123. package/static/v3/css/lattice.tokens.css +0 -135
  124. package/static/v3/css/lattice.views.0a18b6c5.css +0 -360
  125. package/static/v3/css/lattice.views.css +0 -360
  126. package/static/v3/index.html +0 -68
  127. package/static/v3/js/app.356e6452.js +0 -26
  128. package/static/v3/js/app.js +0 -26
  129. package/static/v3/js/core/api.7a308b89.js +0 -568
  130. package/static/v3/js/core/api.js +0 -568
  131. package/static/v3/js/core/components.f25b3b93.js +0 -230
  132. package/static/v3/js/core/components.js +0 -230
  133. package/static/v3/js/core/dom.a2773eb0.js +0 -148
  134. package/static/v3/js/core/dom.js +0 -148
  135. package/static/v3/js/core/router.584570f2.js +0 -37
  136. package/static/v3/js/core/router.js +0 -37
  137. package/static/v3/js/core/routes.7222343d.js +0 -93
  138. package/static/v3/js/core/routes.js +0 -93
  139. package/static/v3/js/core/shell.a1657f20.js +0 -391
  140. package/static/v3/js/core/shell.js +0 -391
  141. package/static/v3/js/core/store.204a08b2.js +0 -113
  142. package/static/v3/js/core/store.js +0 -113
  143. package/static/v3/js/views/admin-audit.660a1fb1.js +0 -185
  144. package/static/v3/js/views/admin-audit.js +0 -185
  145. package/static/v3/js/views/admin-permissions.a7ae5f09.js +0 -177
  146. package/static/v3/js/views/admin-permissions.js +0 -177
  147. package/static/v3/js/views/admin-policies.3658fd86.js +0 -102
  148. package/static/v3/js/views/admin-policies.js +0 -102
  149. package/static/v3/js/views/admin-private-vpc.7d342d36.js +0 -135
  150. package/static/v3/js/views/admin-private-vpc.js +0 -135
  151. package/static/v3/js/views/admin-security.07c66b72.js +0 -180
  152. package/static/v3/js/views/admin-security.js +0 -180
  153. package/static/v3/js/views/admin-users.03bac88c.js +0 -168
  154. package/static/v3/js/views/admin-users.js +0 -168
  155. package/static/v3/js/views/agents.014d0b74.js +0 -541
  156. package/static/v3/js/views/agents.js +0 -541
  157. package/static/v3/js/views/chat.e6dd7dd0.js +0 -601
  158. package/static/v3/js/views/chat.js +0 -601
  159. package/static/v3/js/views/files.adad14c1.js +0 -365
  160. package/static/v3/js/views/files.js +0 -365
  161. package/static/v3/js/views/graph-canvas.17c15d65.js +0 -509
  162. package/static/v3/js/views/graph-canvas.js +0 -509
  163. package/static/v3/js/views/home.24f8b8ae.js +0 -200
  164. package/static/v3/js/views/home.js +0 -200
  165. package/static/v3/js/views/hooks.37895880.js +0 -220
  166. package/static/v3/js/views/hooks.js +0 -220
  167. package/static/v3/js/views/hybrid-search.2fb63ed9.js +0 -194
  168. package/static/v3/js/views/hybrid-search.js +0 -194
  169. package/static/v3/js/views/knowledge-graph.5e40cbeb.js +0 -509
  170. package/static/v3/js/views/knowledge-graph.js +0 -509
  171. package/static/v3/js/views/marketplace.ab0583d4.js +0 -141
  172. package/static/v3/js/views/marketplace.js +0 -141
  173. package/static/v3/js/views/mcp.99b5c6a7.js +0 -114
  174. package/static/v3/js/views/mcp.js +0 -114
  175. package/static/v3/js/views/memory.4ebdf474.js +0 -147
  176. package/static/v3/js/views/memory.js +0 -147
  177. package/static/v3/js/views/models.a1ffa147.js +0 -256
  178. package/static/v3/js/views/models.js +0 -256
  179. package/static/v3/js/views/my-computer.d9d9ae1c.js +0 -463
  180. package/static/v3/js/views/my-computer.js +0 -463
  181. package/static/v3/js/views/pipeline.c522f1ce.js +0 -157
  182. package/static/v3/js/views/pipeline.js +0 -157
  183. package/static/v3/js/views/planning.9ac3e313.js +0 -153
  184. package/static/v3/js/views/planning.js +0 -153
  185. package/static/v3/js/views/settings.8631fa5e.js +0 -318
  186. package/static/v3/js/views/settings.js +0 -318
  187. package/static/v3/js/views/skills.c6c2f965.js +0 -109
  188. package/static/v3/js/views/skills.js +0 -109
  189. package/static/v3/js/views/tools.e4f11276.js +0 -108
  190. package/static/v3/js/views/tools.js +0 -108
  191. package/static/v3/js/views/workflows.26c57290.js +0 -128
  192. package/static/v3/js/views/workflows.js +0 -128
  193. package/static/workflows.html +0 -146
  194. package/static/workspace.css +0 -1121
  195. package/static/workspace.html +0 -357
@@ -1,148 +0,0 @@
1
- /* ============================================================================
2
- * Lattice AI v3 — DOM helpers
3
- * A tiny, dependency-free hyperscript. Builds real DOM nodes (no innerHTML for
4
- * dynamic content → no injection surface). Ergonomic enough to author views.
5
- * ========================================================================== */
6
-
7
- /**
8
- * h("div.card#id", { props }, ...children)
9
- * - tag selector supports .class (many) and #id
10
- * - props: class | className, id, on:{event:fn}, dataset:{k:v},
11
- * style:{k:v} or string, html (trusted innerHTML), attrs (any other)
12
- * - children: Node | string | number | falsy (skipped) | array (flattened)
13
- */
14
- export function h(selector, props, ...children) {
15
- const { tag, id, classes } = parseSelector(selector);
16
- const el = document.createElement(tag);
17
- if (id) el.id = id;
18
- if (classes.length) el.classList.add(...classes);
19
-
20
- if (props && (props.nodeType || typeof props === "string" || Array.isArray(props))) {
21
- children.unshift(props);
22
- props = null;
23
- }
24
-
25
- if (props) {
26
- for (const [key, val] of Object.entries(props)) {
27
- if (val == null || val === false) continue;
28
- if (key === "class" || key === "className") {
29
- for (const c of String(val).split(/\s+/).filter(Boolean)) el.classList.add(c);
30
- } else if (key === "on" && typeof val === "object") {
31
- for (const [ev, fn] of Object.entries(val)) el.addEventListener(ev, fn);
32
- } else if (key === "dataset" && typeof val === "object") {
33
- for (const [k, v] of Object.entries(val)) { if (v != null) el.dataset[k] = v; }
34
- } else if (key === "style" && typeof val === "object") {
35
- for (const [k, v] of Object.entries(val)) el.style.setProperty(k, v);
36
- } else if (key === "style") {
37
- el.setAttribute("style", val);
38
- } else if (key === "html") {
39
- el.innerHTML = val;
40
- } else if (key === "ref" && typeof val === "function") {
41
- val(el);
42
- } else if (key in el && key !== "list" && typeof val !== "object") {
43
- try { el[key] = val; } catch { el.setAttribute(key, val); }
44
- } else {
45
- el.setAttribute(key, val === true ? "" : val);
46
- }
47
- }
48
- }
49
-
50
- appendChildren(el, children);
51
- return el;
52
- }
53
-
54
- function parseSelector(sel) {
55
- if (typeof sel !== "string") return { tag: "div", id: "", classes: [] };
56
- const idMatch = sel.match(/#([\w-]+)/);
57
- const id = idMatch ? idMatch[1] : "";
58
- const classes = (sel.match(/\.([\w-]+)/g) || []).map((c) => c.slice(1));
59
- const tag = (sel.match(/^([\w-]+)/) || [, "div"])[1];
60
- return { tag, id, classes };
61
- }
62
-
63
- function appendChildren(el, children) {
64
- for (const child of children.flat(Infinity)) {
65
- if (child == null || child === false || child === true) continue;
66
- el.append(child.nodeType ? child : document.createTextNode(String(child)));
67
- }
68
- }
69
-
70
- /** Fragment of many children. */
71
- export function frag(...children) {
72
- const f = document.createDocumentFragment();
73
- appendChildren(f, children);
74
- return f;
75
- }
76
-
77
- /** Replace the contents of a node. */
78
- export function render(host, ...children) {
79
- host.replaceChildren();
80
- appendChildren(host, children);
81
- return host;
82
- }
83
-
84
- export function clear(host) { host.replaceChildren(); return host; }
85
-
86
- export function escapeHtml(s) {
87
- return String(s == null ? "" : s).replace(/[&<>"']/g, (c) =>
88
- ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }[c]));
89
- }
90
-
91
- export const $ = (sel, root = document) => root.querySelector(sel);
92
- export const $$ = (sel, root = document) => Array.from(root.querySelectorAll(sel));
93
-
94
- /** Tabler icon element: icon("home") → <i class="ti ti-home"> */
95
- export function icon(name, extra = "") {
96
- const i = document.createElement("i");
97
- i.className = `ti ti-${name}${extra ? " " + extra : ""}`;
98
- i.setAttribute("aria-hidden", "true");
99
- i.setAttribute("data-fallback", iconFallback(name));
100
- return i;
101
- }
102
-
103
- function iconFallback(name) {
104
- const map = {
105
- home: "H", search: "?", menu: "=", x: "x", refresh: "R",
106
- "arrow-up": "^", "arrow-up-right": ">", "arrows-join": "H",
107
- "chart-dots-3": "G", "grid-dots": "V", message: "C", "message-2": "C",
108
- "message-plus": "+", "message-off": "C", user: "U", users: "U",
109
- settings: "S", files: "F", cpu: "M", "cpu-off": "M", "player-play": ">",
110
- "player-stop": "s", "layout-sidebar": "<", "layout-sidebar-right": ">",
111
- "external-link": "o", trash: "x", sparkles: "*", "alert-triangle": "!",
112
- "alert-circle": "!", "info-circle": "i", "circle-check": "v",
113
- "circle-filled": "*", "stack-2": "S", "ruler-2": "R", binary: "B",
114
- category: "T", abc: "K", "search-off": "?"
115
- };
116
- if (map[name]) return map[name];
117
- return String(name || "?").split("-").map((part) => part[0] || "").join("").slice(0, 2).toUpperCase() || "?";
118
- }
119
-
120
- /** Compact relative-time formatter. */
121
- export function timeAgo(value) {
122
- if (!value) return "";
123
- const then = new Date(value).getTime();
124
- if (Number.isNaN(then)) return String(value);
125
- const diff = Math.max(0, Date.now() - then);
126
- const mins = Math.floor(diff / 60000);
127
- if (mins < 1) return "just now";
128
- if (mins < 60) return `${mins}m ago`;
129
- const hrs = Math.floor(mins / 60);
130
- if (hrs < 24) return `${hrs}h ago`;
131
- const days = Math.floor(hrs / 24);
132
- if (days < 30) return `${days}d ago`;
133
- return new Date(then).toLocaleDateString();
134
- }
135
-
136
- /** Format a number with thousands separators / compact suffix. */
137
- export function fmtNum(n) {
138
- if (n == null || Number.isNaN(Number(n))) return "—";
139
- const v = Number(n);
140
- if (Math.abs(v) >= 1_000_000) return (v / 1_000_000).toFixed(1).replace(/\.0$/, "") + "M";
141
- if (Math.abs(v) >= 1_000) return (v / 1_000).toFixed(1).replace(/\.0$/, "") + "k";
142
- return v.toLocaleString();
143
- }
144
-
145
- export function debounce(fn, ms = 220) {
146
- let t;
147
- return (...args) => { clearTimeout(t); t = setTimeout(() => fn(...args), ms); };
148
- }
@@ -1,37 +0,0 @@
1
- /* ============================================================================
2
- * Lattice AI v3 — Hash router
3
- * Maps location.hash → { key, params }. Hash routing keeps the SPA shell
4
- * served by a single static route (/app) with no server-side rewrites.
5
- * #/home → { key: "home" }
6
- * #/admin/users → { key: "admin/users" }
7
- * #/chat?new=1 → { key: "chat", params: { new: "1" } }
8
- * ========================================================================== */
9
-
10
- export function createRouter({ onRoute, fallback = "home" }) {
11
- function parse() {
12
- let hash = location.hash.replace(/^#\/?/, "");
13
- let query = "";
14
- const qi = hash.indexOf("?");
15
- if (qi >= 0) { query = hash.slice(qi + 1); hash = hash.slice(0, qi); }
16
- const key = hash.replace(/\/+$/, "") || fallback;
17
- const params = {};
18
- if (query) new URLSearchParams(query).forEach((v, k) => { params[k] = v; });
19
- return { key, params };
20
- }
21
-
22
- function handle() { onRoute(parse()); }
23
-
24
- return {
25
- start() {
26
- window.addEventListener("hashchange", handle);
27
- if (!location.hash) { location.replace("#/" + fallback); }
28
- else { handle(); }
29
- },
30
- current: parse,
31
- navigate(key, params) {
32
- const qs = params && Object.keys(params).length ? "?" + new URLSearchParams(params).toString() : "";
33
- const next = "#/" + String(key).replace(/^#?\/?/, "") + qs;
34
- if (location.hash === next) handle(); else location.hash = next;
35
- },
36
- };
37
- }
@@ -1,37 +0,0 @@
1
- /* ============================================================================
2
- * Lattice AI v3 — Hash router
3
- * Maps location.hash → { key, params }. Hash routing keeps the SPA shell
4
- * served by a single static route (/app) with no server-side rewrites.
5
- * #/home → { key: "home" }
6
- * #/admin/users → { key: "admin/users" }
7
- * #/chat?new=1 → { key: "chat", params: { new: "1" } }
8
- * ========================================================================== */
9
-
10
- export function createRouter({ onRoute, fallback = "home" }) {
11
- function parse() {
12
- let hash = location.hash.replace(/^#\/?/, "");
13
- let query = "";
14
- const qi = hash.indexOf("?");
15
- if (qi >= 0) { query = hash.slice(qi + 1); hash = hash.slice(0, qi); }
16
- const key = hash.replace(/\/+$/, "") || fallback;
17
- const params = {};
18
- if (query) new URLSearchParams(query).forEach((v, k) => { params[k] = v; });
19
- return { key, params };
20
- }
21
-
22
- function handle() { onRoute(parse()); }
23
-
24
- return {
25
- start() {
26
- window.addEventListener("hashchange", handle);
27
- if (!location.hash) { location.replace("#/" + fallback); }
28
- else { handle(); }
29
- },
30
- current: parse,
31
- navigate(key, params) {
32
- const qs = params && Object.keys(params).length ? "?" + new URLSearchParams(params).toString() : "";
33
- const next = "#/" + String(key).replace(/^#?\/?/, "") + qs;
34
- if (location.hash === next) handle(); else location.hash = next;
35
- },
36
- };
37
- }
@@ -1,93 +0,0 @@
1
- /* ============================================================================
2
- * Lattice AI v3 — Information architecture (single source of truth)
3
- *
4
- * One declarative table drives the nav rail, the command palette, the router,
5
- * breadcrumbs, and lazy view loading. Mode gating (Basic < Advanced < Admin)
6
- * and the Admin section live here so the whole shell stays consistent.
7
- * ========================================================================== */
8
-
9
- export const MODE_RANK = { basic: 0, advanced: 1, admin: 2 };
10
-
11
- /** Nav groups in display order. */
12
- export const GROUPS = [
13
- { id: "brain", label: "Brain" },
14
- { id: "ask", label: "Ask" },
15
- { id: "capture", label: "Capture" },
16
- { id: "act", label: "Act" },
17
- { id: "library", label: "Library" },
18
- { id: "system", label: "System" },
19
- { id: "admin", label: "Administration", adminOnly: true },
20
- ];
21
-
22
- /**
23
- * Route table. `minMode` = lowest mode in which the item appears in the rail
24
- * (deep-links still resolve). `view` = module basename under js/views/.
25
- */
26
- export const ROUTES = [
27
- // Workspace
28
- { key: "home", label: "Overview", icon: "layout-dashboard", group: "system", minMode: "basic", view: "home", title: "Overview", desc: "Your digital brain at a glance." },
29
- { key: "chat", label: "Chat", icon: "message-2", group: "ask", minMode: "basic", view: "chat", title: "Chat", desc: "Grounded conversation over your brain — memories, knowledge, and notes assembled with provenance." },
30
-
31
- // Data
32
- { key: "files", label: "Files", icon: "folders", group: "capture", minMode: "basic", view: "files", title: "Files", desc: "Connected sources and indexed documents." },
33
-
34
- // Retrieval (the product identity)
35
- { key: "hybrid-search", label: "Search", icon: "arrows-join", group: "brain", minMode: "basic", view: "hybrid-search", title: "Hybrid Search", desc: "Graph structure fused with vector similarity." },
36
- { key: "knowledge-graph", label: "Knowledge Graph", icon: "chart-dots-3", group: "brain", minMode: "basic", view: "knowledge-graph", title: "Knowledge Graph", desc: "Your digital brain — every source converges here. Explore, ingest, and export." },
37
- { key: "memory", label: "Memory", icon: "brain", group: "brain", minMode: "basic", view: "memory", title: "Memory", desc: "Long-term workspace, project, agent, and conversation memory." },
38
-
39
- // Compute
40
- { key: "models", label: "Models", icon: "cpu", group: "library", minMode: "basic", view: "models", title: "Models", desc: "Local MLX models and embeddings." },
41
- { key: "agents", label: "Agents", icon: "robot", group: "act", minMode: "advanced", view: "agents", title: "Agents", desc: "Multi-agent roles, runs, and handoffs." },
42
- { key: "workflows", label: "Workflows", icon: "sitemap", group: "act", minMode: "advanced", view: "workflows", title: "Workflow Agents", desc: "Trigger → agent chain → tools → memory → result." },
43
-
44
- // Platform (the agent ecosystem)
45
- { key: "skills", label: "Skills", icon: "puzzle", group: "library", minMode: "advanced", view: "skills", title: "Skills", desc: "Install, enable, and manage skills." },
46
- { key: "hooks", label: "Hooks", icon: "webhook", group: "act", minMode: "advanced", view: "hooks", title: "Hooks", desc: "Lifecycle hooks across runs, tools, and workflows." },
47
- { key: "mcp", label: "MCP", icon: "plug-connected", group: "library", minMode: "advanced", view: "mcp", title: "MCP Manager", desc: "Connected MCP servers, available tools, and health." },
48
-
49
- // System
50
- { key: "settings", label: "Settings", icon: "settings", group: "system", minMode: "basic", view: "settings", title: "Settings", desc: "Appearance, workspace, and integrations." },
51
-
52
- // Deep-linkable legacy/experimental surfaces. They remain renderable for
53
- // compatibility, but are not promoted in the production navigation.
54
- { key: "pipeline", label: "Pipeline", icon: "git-branch", group: "capture", minMode: "advanced", view: "pipeline", title: "Pipeline", desc: "Ingest, embed, and graph-build flows.", hidden: true },
55
- { key: "planning", label: "Planning", icon: "target-arrow", group: "act", minMode: "advanced", view: "planning", title: "Autonomous Planning", desc: "Goal → plan → execute → review → replan.", hidden: true },
56
- { key: "my-computer", label: "My Computer", icon: "device-desktop-analytics", group: "system", minMode: "advanced", view: "my-computer", title: "My Computer", desc: "Local hardware, memory, and runtime.", hidden: true },
57
- { key: "marketplace", label: "Marketplace", icon: "building-store", group: "library", minMode: "advanced", view: "marketplace", title: "Marketplace", desc: "Agent templates, agents, plugins, and skills.", hidden: true },
58
- { key: "tools", label: "Tools", icon: "tools", group: "act", minMode: "advanced", view: "tools", title: "Tool Registry", desc: "Local, workspace, and MCP tools with governance.", hidden: true },
59
-
60
- // Admin
61
- { key: "admin/users", label: "Users", icon: "users", group: "admin", minMode: "admin", view: "admin-users", title: "Users", desc: "Workspace members and access.", admin: true },
62
- { key: "admin/permissions", label: "Permissions", icon: "key", group: "admin", minMode: "admin", view: "admin-permissions", title: "Permissions", desc: "Roles and capability mapping.", admin: true },
63
- { key: "admin/audit", label: "Audit Logs", icon: "report-search", group: "admin", minMode: "admin", view: "admin-audit", title: "Audit Logs", desc: "Activity and access trail.", admin: true },
64
- { key: "admin/security", label: "Security", icon: "shield-check", group: "admin", minMode: "admin", view: "admin-security", title: "Security", desc: "Sensitive-data signals and DLP.", admin: true },
65
- { key: "admin/policies", label: "Policies", icon: "file-certificate", group: "admin", minMode: "admin", view: "admin-policies", title: "Policies", desc: "Governance and enforcement.", admin: true },
66
- { key: "admin/private-vpc", label: "Private VPC", icon: "cloud-lock", group: "admin", minMode: "admin", view: "admin-private-vpc", title: "Private VPC", desc: "Network isolation and peering.", admin: true },
67
- ];
68
-
69
- export const ROUTE_BY_KEY = Object.fromEntries(ROUTES.map((r) => [r.key, r]));
70
-
71
- /** Routes visible in the rail for a given mode. */
72
- export function visibleRoutes(mode) {
73
- const rank = MODE_RANK[mode] ?? 0;
74
- return ROUTES.filter((r) => {
75
- if (r.hidden) return false;
76
- if (r.admin) return mode === "admin";
77
- return (MODE_RANK[r.minMode] ?? 0) <= rank;
78
- });
79
- }
80
-
81
- /** Lazy-load a view module by basename. Cached. */
82
- const cache = new Map();
83
- function assetUrl(key, fallback) {
84
- const manifest = window.__LT_ASSET_MANIFEST__;
85
- return (manifest && manifest.assets && manifest.assets[key]) || fallback;
86
- }
87
-
88
- export async function loadView(view) {
89
- if (cache.has(view)) return cache.get(view);
90
- const mod = await import(assetUrl(`static/v3/js/views/${view}.js`, `../views/${view}.js`));
91
- cache.set(view, mod);
92
- return mod;
93
- }
@@ -1,93 +0,0 @@
1
- /* ============================================================================
2
- * Lattice AI v3 — Information architecture (single source of truth)
3
- *
4
- * One declarative table drives the nav rail, the command palette, the router,
5
- * breadcrumbs, and lazy view loading. Mode gating (Basic < Advanced < Admin)
6
- * and the Admin section live here so the whole shell stays consistent.
7
- * ========================================================================== */
8
-
9
- export const MODE_RANK = { basic: 0, advanced: 1, admin: 2 };
10
-
11
- /** Nav groups in display order. */
12
- export const GROUPS = [
13
- { id: "brain", label: "Brain" },
14
- { id: "ask", label: "Ask" },
15
- { id: "capture", label: "Capture" },
16
- { id: "act", label: "Act" },
17
- { id: "library", label: "Library" },
18
- { id: "system", label: "System" },
19
- { id: "admin", label: "Administration", adminOnly: true },
20
- ];
21
-
22
- /**
23
- * Route table. `minMode` = lowest mode in which the item appears in the rail
24
- * (deep-links still resolve). `view` = module basename under js/views/.
25
- */
26
- export const ROUTES = [
27
- // Workspace
28
- { key: "home", label: "Overview", icon: "layout-dashboard", group: "system", minMode: "basic", view: "home", title: "Overview", desc: "Your digital brain at a glance." },
29
- { key: "chat", label: "Chat", icon: "message-2", group: "ask", minMode: "basic", view: "chat", title: "Chat", desc: "Grounded conversation over your brain — memories, knowledge, and notes assembled with provenance." },
30
-
31
- // Data
32
- { key: "files", label: "Files", icon: "folders", group: "capture", minMode: "basic", view: "files", title: "Files", desc: "Connected sources and indexed documents." },
33
-
34
- // Retrieval (the product identity)
35
- { key: "hybrid-search", label: "Search", icon: "arrows-join", group: "brain", minMode: "basic", view: "hybrid-search", title: "Hybrid Search", desc: "Graph structure fused with vector similarity." },
36
- { key: "knowledge-graph", label: "Knowledge Graph", icon: "chart-dots-3", group: "brain", minMode: "basic", view: "knowledge-graph", title: "Knowledge Graph", desc: "Your digital brain — every source converges here. Explore, ingest, and export." },
37
- { key: "memory", label: "Memory", icon: "brain", group: "brain", minMode: "basic", view: "memory", title: "Memory", desc: "Long-term workspace, project, agent, and conversation memory." },
38
-
39
- // Compute
40
- { key: "models", label: "Models", icon: "cpu", group: "library", minMode: "basic", view: "models", title: "Models", desc: "Local MLX models and embeddings." },
41
- { key: "agents", label: "Agents", icon: "robot", group: "act", minMode: "advanced", view: "agents", title: "Agents", desc: "Multi-agent roles, runs, and handoffs." },
42
- { key: "workflows", label: "Workflows", icon: "sitemap", group: "act", minMode: "advanced", view: "workflows", title: "Workflow Agents", desc: "Trigger → agent chain → tools → memory → result." },
43
-
44
- // Platform (the agent ecosystem)
45
- { key: "skills", label: "Skills", icon: "puzzle", group: "library", minMode: "advanced", view: "skills", title: "Skills", desc: "Install, enable, and manage skills." },
46
- { key: "hooks", label: "Hooks", icon: "webhook", group: "act", minMode: "advanced", view: "hooks", title: "Hooks", desc: "Lifecycle hooks across runs, tools, and workflows." },
47
- { key: "mcp", label: "MCP", icon: "plug-connected", group: "library", minMode: "advanced", view: "mcp", title: "MCP Manager", desc: "Connected MCP servers, available tools, and health." },
48
-
49
- // System
50
- { key: "settings", label: "Settings", icon: "settings", group: "system", minMode: "basic", view: "settings", title: "Settings", desc: "Appearance, workspace, and integrations." },
51
-
52
- // Deep-linkable legacy/experimental surfaces. They remain renderable for
53
- // compatibility, but are not promoted in the production navigation.
54
- { key: "pipeline", label: "Pipeline", icon: "git-branch", group: "capture", minMode: "advanced", view: "pipeline", title: "Pipeline", desc: "Ingest, embed, and graph-build flows.", hidden: true },
55
- { key: "planning", label: "Planning", icon: "target-arrow", group: "act", minMode: "advanced", view: "planning", title: "Autonomous Planning", desc: "Goal → plan → execute → review → replan.", hidden: true },
56
- { key: "my-computer", label: "My Computer", icon: "device-desktop-analytics", group: "system", minMode: "advanced", view: "my-computer", title: "My Computer", desc: "Local hardware, memory, and runtime.", hidden: true },
57
- { key: "marketplace", label: "Marketplace", icon: "building-store", group: "library", minMode: "advanced", view: "marketplace", title: "Marketplace", desc: "Agent templates, agents, plugins, and skills.", hidden: true },
58
- { key: "tools", label: "Tools", icon: "tools", group: "act", minMode: "advanced", view: "tools", title: "Tool Registry", desc: "Local, workspace, and MCP tools with governance.", hidden: true },
59
-
60
- // Admin
61
- { key: "admin/users", label: "Users", icon: "users", group: "admin", minMode: "admin", view: "admin-users", title: "Users", desc: "Workspace members and access.", admin: true },
62
- { key: "admin/permissions", label: "Permissions", icon: "key", group: "admin", minMode: "admin", view: "admin-permissions", title: "Permissions", desc: "Roles and capability mapping.", admin: true },
63
- { key: "admin/audit", label: "Audit Logs", icon: "report-search", group: "admin", minMode: "admin", view: "admin-audit", title: "Audit Logs", desc: "Activity and access trail.", admin: true },
64
- { key: "admin/security", label: "Security", icon: "shield-check", group: "admin", minMode: "admin", view: "admin-security", title: "Security", desc: "Sensitive-data signals and DLP.", admin: true },
65
- { key: "admin/policies", label: "Policies", icon: "file-certificate", group: "admin", minMode: "admin", view: "admin-policies", title: "Policies", desc: "Governance and enforcement.", admin: true },
66
- { key: "admin/private-vpc", label: "Private VPC", icon: "cloud-lock", group: "admin", minMode: "admin", view: "admin-private-vpc", title: "Private VPC", desc: "Network isolation and peering.", admin: true },
67
- ];
68
-
69
- export const ROUTE_BY_KEY = Object.fromEntries(ROUTES.map((r) => [r.key, r]));
70
-
71
- /** Routes visible in the rail for a given mode. */
72
- export function visibleRoutes(mode) {
73
- const rank = MODE_RANK[mode] ?? 0;
74
- return ROUTES.filter((r) => {
75
- if (r.hidden) return false;
76
- if (r.admin) return mode === "admin";
77
- return (MODE_RANK[r.minMode] ?? 0) <= rank;
78
- });
79
- }
80
-
81
- /** Lazy-load a view module by basename. Cached. */
82
- const cache = new Map();
83
- function assetUrl(key, fallback) {
84
- const manifest = window.__LT_ASSET_MANIFEST__;
85
- return (manifest && manifest.assets && manifest.assets[key]) || fallback;
86
- }
87
-
88
- export async function loadView(view) {
89
- if (cache.has(view)) return cache.get(view);
90
- const mod = await import(assetUrl(`static/v3/js/views/${view}.js`, `../views/${view}.js`));
91
- cache.set(view, mod);
92
- return mod;
93
- }