ltcai 2.2.1 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +183 -140
  2. package/codex_telegram_bot.py +6 -2
  3. package/docs/CHANGELOG.md +100 -23
  4. package/docs/EDITION_STRATEGY.md +8 -8
  5. package/docs/ENTERPRISE.md +5 -5
  6. package/docs/PLUGIN_SDK.md +4 -4
  7. package/docs/V2_ARCHITECTURE.md +9 -9
  8. package/docs/architecture.md +18 -17
  9. package/docs/images/admin-dashboard.png +0 -0
  10. package/docs/images/knowledge-graph.png +0 -0
  11. package/docs/images/lattice-ai-demo.gif +0 -0
  12. package/docs/images/lattice-ai-hero.png +0 -0
  13. package/docs/images/mobile-responsive.png +0 -0
  14. package/docs/images/pipeline.png +0 -0
  15. package/docs/images/workspace-dark.png +0 -0
  16. package/docs/images/workspace-light.png +0 -0
  17. package/latticeai/__init__.py +1 -1
  18. package/latticeai/api/static_routes.py +10 -0
  19. package/latticeai/core/logging_safety.py +62 -0
  20. package/latticeai/core/workspace_os.py +1 -1
  21. package/package.json +10 -5
  22. package/static/account.html +9 -4
  23. package/static/activity.html +4 -4
  24. package/static/admin.html +8 -3
  25. package/static/agents.html +4 -4
  26. package/static/chat.html +15 -10
  27. package/static/css/reference/account.css +303 -0
  28. package/static/css/reference/admin.css +610 -0
  29. package/static/css/reference/base.css +1658 -0
  30. package/static/{lattice-reference.css → css/reference/chat.css} +243 -3599
  31. package/static/css/reference/graph.css +1016 -0
  32. package/static/css/responsive.css +226 -4
  33. package/static/css/tokens.css +16 -5
  34. package/static/favicon.ico +0 -0
  35. package/static/graph.html +9 -4
  36. package/static/platform.css +1 -1
  37. package/static/plugins.html +4 -4
  38. package/static/scripts/chat.js +187 -69
  39. package/static/scripts/ux.js +1 -1
  40. package/static/sw.js +5 -3
  41. package/static/workflows.html +4 -4
  42. package/static/workspace.css +75 -14
  43. package/static/workspace.html +5 -5
  44. package/telegram_bot.py +18 -14
package/README.md CHANGED
@@ -3,122 +3,59 @@
3
3
 
4
4
  # Lattice AI
5
5
 
6
- **A local-first AI workspace** Plan Execute Review with multiple LLMs,
7
- on top of a durable Knowledge Graph.
6
+ **Local-first AI workspace for knowledge graphs, AI pipelines, and multi-agent coding workflows.**
8
7
 
9
- Apple Silicon (MLX) local model management · Personal & Organization workspaces ·
10
- Multi-agent workflows · SSO for teams
8
+ Plan, execute, review, and remember work across local models, cloud models,
9
+ files, and team workflows.
11
10
  </div>
12
11
 
13
- ---
14
-
15
- Lattice AI turns your files, documents, images, screenshots, conversations,
16
- decisions, notes, and work history into linked knowledge. AI then works on top of
17
- that Knowledge Graph to advise, analyze, generate documents, and automate work.
18
-
19
- It is built around a simple product rule:
20
-
21
- > Do not control the user in the name of protection. Explain clearly, disclose
22
- > sources and risks, then let the user decide.
23
-
24
- ## What Lattice AI is
25
-
26
- Lattice AI is four things working together, not an operating system and not a
27
- simple chat front-end:
28
-
29
- - **Local-first AI Workspace** — runs on your machine first; your data and graph
30
- stay local by default.
31
- - **AI Pipeline Platform** — a Plan → Execute → Review loop that can route across
32
- multiple LLMs for each stage.
33
- - **Knowledge Graph Platform** — multimodal inputs become entities,
34
- relationships, evidence, and artifacts that outlive any single model.
35
- - **Workspace Platform** — Personal and Organization workspaces, role-based
36
- access, and SSO for teams.
37
-
38
- ## Highlights
39
-
40
- - **Multimodal ingestion** — accepts PDFs, Word, spreadsheets, slide decks,
41
- images, screenshots, notes, code, web content, conversations, and work logs
42
- without asking you to pre-convert them.
43
- - **Knowledge Graph core** — extracts entities, relationships, evidence,
44
- decisions, and artifacts so your work memory survives model changes.
45
- - **Multi-agent workflow** — agents hand off work with structured context
46
- packets, review/retry loops, and replayable timelines.
47
- - **Local model management** — MLX-VLM on Apple Silicon, with current-generation
48
- multimodal model recommendations based on your CPU, GPU, RAM, storage, and OS.
49
- - **Source disclosure** — every recommended model shows its facts in plain
50
- language before use: maker country, maker company, run mode (local/cloud),
51
- internet requirement, and model name.
52
- - **Basic / Advanced / Admin modes** — the same features everywhere; the modes
53
- differ only in how much is explained. Admin mode adds authority
54
- (user management, permissions, audit logs, org/security policy, model approval).
55
-
56
- ## v2.2.1 — Frontend & UX overhaul
57
-
58
- v2.2.1 is a UX-focused release. No features were removed; the interface was
59
- re-laid out and re-themed.
60
-
61
- - **Responsive, mobile-first UI** — phone, tablet, laptop, desktop, ultrawide,
62
- and 4K. Content is re-laid out for each size, never hidden.
63
- - **Light / Dark themes via design tokens** — a single source of truth in
64
- [`static/css/tokens.css`](static/css/tokens.css). `:root` holds light values,
65
- `[data-lt-theme="dark"]` holds dark values. The theme toggle, OS preference
66
- detection, and persistence live in
67
- [`static/scripts/ux.js`](static/scripts/ux.js).
68
- - **Accessibility** — 44px touch targets, `:focus-visible` rings, a
69
- keyboard-safe chat composer (uses `visualViewport` insets), iOS no-zoom inputs,
70
- and reduced-motion support.
71
- - **Knowledge Graph UX** — responsive canvas that re-fits on resize, zoom
72
- buttons, fullscreen, minimap, relationship filtering, a mobile graph↔card
73
- view, and a theme-aware palette.
74
- - **Admin UX** — wide tables reflow to cards on mobile, with larger touch targets
75
- and full dark/light support.
76
- - **File UX** — drag & drop and screenshot paste to attach. Model cards explain
77
- country, company, run mode, and internet use in plain language.
78
-
79
- ## Knowledge Graph flow
12
+ <div align="center">
80
13
 
81
- ```text
82
- files / documents / images / conversations / work history
83
- -> multimodal understanding
84
- -> entity extraction
85
- -> relationship extraction
86
- -> evidence storage
87
- -> Knowledge Graph update
88
- -> advice / analysis / document generation / automation
89
- ```
14
+ [![PyPI version](https://img.shields.io/pypi/v/ltcai?label=PyPI)](https://pypi.org/project/ltcai/)
15
+ [![npm version](https://img.shields.io/npm/v/ltcai?label=npm)](https://www.npmjs.com/package/ltcai)
16
+ [![VS Code Marketplace](https://vsmarketplacebadges.dev/version-short/parktaesoo.ltcai.svg)](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai)
17
+ [![Open VSX](https://img.shields.io/open-vsx/v/parktaesoo/ltcai?label=Open%20VSX)](https://open-vsx.org/extension/parktaesoo/ltcai)
18
+ [![GitHub release](https://img.shields.io/github/v/release/TaeSooPark-PTS/LatticeAI?label=GitHub%20release)](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/v2.2.7)
19
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
20
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/)
21
+ [![VS Code extension](https://img.shields.io/badge/VS%20Code-extension-blue?logo=visualstudiocode)](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai)
90
22
 
91
- The graph preserves your work memory even when the model changes.
23
+ </div>
92
24
 
93
- ## Local model policy
25
+ ![Lattice AI demo](docs/images/lattice-ai-demo.gif)
94
26
 
95
- Lattice AI recommends current-generation **multimodal** models for local use and
96
- keeps text-only recommendation paths out of the product:
27
+ ## Install
97
28
 
98
- | Family | Default role | Example current recommendation |
99
- | --- | --- | --- |
100
- | Gemma 4 | Default Google multimodal family | `mlx-community/gemma-4-12b-it-4bit` |
101
- | Gemma 4 large | Higher-quality local multimodal work | `mlx-community/gemma-4-31b-it-4bit` |
102
- | Qwen3-VL | Smaller, balanced multimodal options | `mlx-community/Qwen3-VL-4B-Instruct-4bit` |
103
- | Llama 4 | Meta multimodal option | `mlx-community/Llama-4-Scout-17B-16E-Instruct-4bit` |
29
+ Install the local workspace:
104
30
 
105
- Low-spec machines use smaller or quantized multimodal models rather than older
106
- text-only models. See [MODEL_POLICY.md](MODEL_POLICY.md) for the full policy.
31
+ ```bash
32
+ pip install ltcai
33
+ ```
107
34
 
108
- ## Requirements
35
+ Add Apple Silicon local model support:
109
36
 
110
- - Python **3.11+**
111
- - macOS, Windows, or Linux for the workspace server
112
- - Apple Silicon for local MLX-VLM model execution (optional; cloud models work
113
- without it)
37
+ ```bash
38
+ pip install "ltcai[local]"
39
+ ```
114
40
 
115
- ## Quick start
41
+ Install the npm CLI:
116
42
 
117
- Lattice AI is a Python + FastAPI app. The CLI entry point is `ltcai_cli.py`.
43
+ ```bash
44
+ npm install -g ltcai
45
+ ```
46
+
47
+ Install the coding extension:
48
+
49
+ - [VS Code Marketplace: parktaesoo.ltcai](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai)
50
+ - [Open VSX: parktaesoo.ltcai](https://open-vsx.org/extension/parktaesoo/ltcai)
51
+ - [GitHub Release v2.2.7](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/v2.2.7)
52
+
53
+ ## Quick Start
54
+
55
+ Start the workspace:
118
56
 
119
57
  ```bash
120
- npm install # installs the npm package and dev tooling
121
- npm run dev # runs: python3 ltcai_cli.py --reload
58
+ LTCAI
122
59
  ```
123
60
 
124
61
  Then open:
@@ -127,76 +64,182 @@ Then open:
127
64
  http://127.0.0.1:4825
128
65
  ```
129
66
 
130
- Prefer Python directly?
67
+ Development checkout:
131
68
 
132
69
  ```bash
133
- python3 ltcai_cli.py
134
- # host/port: --host 127.0.0.1 --port 4825
70
+ npm install
71
+ npm run dev
135
72
  ```
136
73
 
137
- For local model execution on Apple Silicon, install the optional extra:
74
+ Useful validation commands:
138
75
 
139
76
  ```bash
140
- pip install "ltcai[local]" # adds mlx-vlm
77
+ npm run check:python
78
+ npm run test:unit
79
+ npm run build
141
80
  ```
142
81
 
143
- Useful commands:
82
+ ## What Is Lattice AI?
144
83
 
145
- ```bash
146
- npm test # python3 -m pytest tests/ -v
147
- npm run check:python # py_compile across core modules
148
- npm run build # python3 -m build
149
- ```
84
+ Lattice AI is a local-first AI workspace for people and teams who want their
85
+ files, models, graph context, and agent workflows in one place.
150
86
 
151
- ## VS Code extension
87
+ - **Local-first AI Workspace**: work starts on your machine, with local data and
88
+ workspace state by default.
89
+ - **AI Pipeline Platform**: plan, execute, review, retry, and replay work across
90
+ local models, cloud models, tools, files, and generated artifacts.
91
+ - **Knowledge Graph Platform**: documents, images, screenshots, notes,
92
+ conversations, and decisions become linked entities, relationships, evidence,
93
+ and reusable context.
94
+ - **Multi-Agent Workflow Platform**: agents hand off structured context, review
95
+ work, retry with reasons, and keep timelines inspectable.
96
+ - **Personal / Organization Workspace**: move between personal work and team
97
+ workspaces with role-aware views.
98
+ - **Local Model Management**: choose current multimodal local models with source
99
+ disclosure, hardware-aware recommendations, and cloud fallback options.
100
+ - **SSO for teams**: organization workspaces can be paired with Okta or
101
+ Microsoft Entra ID patterns for team access.
152
102
 
153
- A companion VS Code extension lives in [`vscode-extension/`](vscode-extension).
103
+ ## Why Lattice AI?
154
104
 
155
- ```bash
156
- cd vscode-extension
157
- npm install
158
- npm run build
159
- npm run package:vsix
105
+ Most AI tools split your work across a chat window, a model picker, loose files,
106
+ and disconnected automations. Lattice AI keeps those parts together:
107
+
108
+ - files and conversations become graph context;
109
+ - graph context feeds pipelines and coding actions;
110
+ - model cards disclose country, company, run mode, internet usage, and model
111
+ identity;
112
+ - personal and organization workspaces keep team workflows separate from local
113
+ work;
114
+ - multi-agent workflows leave behind replayable plans, reviews, retries, and
115
+ outcomes.
116
+
117
+ ## v2.2.7 Visual Stabilization Highlights
118
+
119
+ Lattice AI v2.2.7 is a visual stabilization release driven by rendered browser
120
+ screens, not stylesheet cleanup alone. It keeps the existing design-token
121
+ structure while making the app feel like one cohesive product.
122
+
123
+ - The dark chat composer is now an intentional dark surface with a crisp outer
124
+ focus state, no white haze, and no legacy inner textarea box.
125
+ - Knowledge Graph canvas and Workspace OS panels no longer fall back to
126
+ washed-out light surfaces in dark mode.
127
+ - Workspace select, onboarding, recommendation, auto setup, mode select,
128
+ pipeline, My Computer, profile, settings, VPC, and model-state surfaces use a
129
+ shared modal/panel language.
130
+ - Static frontend asset cache-busting is normalized to `?v=2.2.7`, including
131
+ `/static/scripts/chat.js?v=2.2.7`.
132
+ - Playwright visual coverage now locks the v2.2.7 composer, graph canvas,
133
+ Workspace OS dark inputs/cards, and mobile composer behavior.
134
+
135
+ Carried forward from v2.2.x: mobile-first responsive layout, design-token
136
+ light/dark themes, keyboard-safe chat composer, Knowledge Graph responsive UX,
137
+ Admin mobile card layout, drag-and-drop file attachment, and model-card source
138
+ disclosure.
139
+
140
+ ## Screenshots
141
+
142
+ ### Workspace
143
+
144
+ ![Workspace light theme](docs/images/workspace-light.png)
145
+
146
+ ![Workspace dark theme](docs/images/workspace-dark.png)
147
+
148
+ ### Knowledge Graph
149
+
150
+ ![Knowledge Graph](docs/images/knowledge-graph.png)
151
+
152
+ ### AI Pipeline
153
+
154
+ ![AI Pipeline designer](docs/images/pipeline.png)
155
+
156
+ ### Admin Dashboard
157
+
158
+ ![Admin dashboard](docs/images/admin-dashboard.png)
159
+
160
+ ### Mobile Responsive
161
+
162
+ ![Mobile responsive layout](docs/images/mobile-responsive.png)
163
+
164
+ ## Knowledge Graph Flow
165
+
166
+ ```text
167
+ files / documents / images / screenshots / conversations / decisions
168
+ -> multimodal understanding
169
+ -> entity and relationship extraction
170
+ -> evidence and artifact storage
171
+ -> Knowledge Graph update
172
+ -> AI pipeline context
173
+ -> coding actions / analysis / documents / team workflows
160
174
  ```
161
175
 
162
- ## Build & packaging
176
+ The graph keeps useful workspace context available even when you change models.
163
177
 
164
- Lattice AI ships as a Python package (`ltcai`), an npm package (`ltcai`), and a
165
- VS Code extension.
178
+ ## Local Model Policy
166
179
 
167
- ```bash
168
- python3 -m build # Python wheel + sdist
169
- npm pack # npm tarball
180
+ Lattice AI recommends current-generation multimodal models for local use and
181
+ keeps local model choices explicit.
182
+
183
+ | Family | Default role | Example recommendation |
184
+ | --- | --- | --- |
185
+ | Gemma 4 | Default Google multimodal family | `mlx-community/gemma-4-12b-it-4bit` |
186
+ | Gemma 4 large | Higher-quality local multimodal work | `mlx-community/gemma-4-31b-it-4bit` |
187
+ | Qwen3-VL | Smaller, balanced multimodal options | `mlx-community/Qwen3-VL-4B-Instruct-4bit` |
188
+ | Llama 4 | Meta multimodal option | `mlx-community/Llama-4-Scout-17B-16E-Instruct-4bit` |
189
+
190
+ Every recommended model card shows maker country, maker company, run mode,
191
+ internet requirement, and model name. See [MODEL_POLICY.md](MODEL_POLICY.md).
192
+
193
+ ## Architecture
194
+
195
+ ```text
196
+ Personal / Organization Workspace
197
+ -> files, chats, screenshots, model choices, workflow events
198
+ -> Knowledge Graph
199
+ -> AI Pipeline
200
+ -> Multi-Agent Workflow
201
+ -> coding actions, documents, analysis, team handoffs
170
202
  ```
171
203
 
172
- Publishing is intentionally manual — no glob uploads. See [RELEASE.md](RELEASE.md)
173
- for the exact, version-scoped publish steps for PyPI, npm, the VS Code
174
- Marketplace, and Open VSX.
204
+ Core areas:
205
+
206
+ - FastAPI local workspace app
207
+ - Knowledge Graph storage and graph APIs
208
+ - AI pipeline and workflow designer
209
+ - Multi-agent handoff, review, retry, and replay records
210
+ - Local model management and model recommendation catalog
211
+ - VS Code / Cursor / VSCodium extension surface
212
+ - Personal and organization workspace boundaries
175
213
 
176
214
  ## Documentation
177
215
 
178
- - [ARCHITECTURE.md](ARCHITECTURE.md) — system shape and runtime policy
216
+ - [ARCHITECTURE.md](ARCHITECTURE.md) — workspace, graph, pipeline, and model-management overview
179
217
  - [docs/architecture.md](docs/architecture.md) — full architecture reference
180
218
  - [PROJECT_PRINCIPLES.md](PROJECT_PRINCIPLES.md) — product principles
181
- - [AI_PHILOSOPHY.md](AI_PHILOSOPHY.md) — how AI is used here
219
+ - [AI_PHILOSOPHY.md](AI_PHILOSOPHY.md) — how AI is used in the workspace
182
220
  - [MODEL_POLICY.md](MODEL_POLICY.md) — local model recommendation policy
183
221
  - [KNOWLEDGE_GRAPH.md](KNOWLEDGE_GRAPH.md) — graph model and behavior
184
- - [docs/MULTI_AGENT_RUNTIME.md](docs/MULTI_AGENT_RUNTIME.md) — multi-agent runtime
185
- - [docs/WORKFLOW_DESIGNER.md](docs/WORKFLOW_DESIGNER.md) — workflow designer
186
- - [docs/REALTIME_COLLABORATION.md](docs/REALTIME_COLLABORATION.md) — realtime collaboration
187
- - [docs/ENTERPRISE.md](docs/ENTERPRISE.md) — Organization workspaces & SSO (Okta / Microsoft Entra ID)
188
- - [docs/security-model.md](docs/security-model.md) — security model
222
+ - [docs/MULTI_AGENT_RUNTIME.md](docs/MULTI_AGENT_RUNTIME.md) — multi-agent workflow runtime
223
+ - [docs/WORKFLOW_DESIGNER.md](docs/WORKFLOW_DESIGNER.md) — AI pipeline designer
224
+ - [docs/REALTIME_COLLABORATION.md](docs/REALTIME_COLLABORATION.md) — realtime workspace events
225
+ - [docs/ENTERPRISE.md](docs/ENTERPRISE.md) — organization workspaces and SSO
189
226
  - [docs/PLUGIN_SDK.md](docs/PLUGIN_SDK.md) — plugin SDK
190
- - [RELEASE_NOTES.md](RELEASE_NOTES.md) · [docs/CHANGELOG.md](docs/CHANGELOG.md)
227
+ - [RELEASE_NOTES.md](RELEASE_NOTES.md) and [docs/CHANGELOG.md](docs/CHANGELOG.md)
191
228
 
192
229
  ## Release history
193
230
 
194
231
  | Version | Theme |
195
232
  | --- | --- |
196
- | **2.2.1** | Frontend & UX overhaul responsive, design-token theming, accessibility, graph/admin UX |
197
- | 2.2.0 | Multimodal-first Knowledge Graph, source disclosure, Gemma-4 recommendation policy |
198
- | 2.1.0 | Agent platform maturity |
199
- | 2.0.0 | Agentic workspace platform |
233
+ | **2.2.7** | Visual system stabilizationcohesive dark/light screens, crisp chat composer, dark graph canvas, Workspace OS polish |
234
+ | 2.2.6 | Token-native CSS foundation |
235
+ | 2.2.5 | Release hygiene hotfix — dark overlays, modal stack, cache-busting, favicon, and Telegram log masking |
236
+ | 2.2.4 | Chat dark-mode completion |
237
+ | 2.2.3 | Frontend stability and UX fixes |
238
+ | 2.2.2 | Frontend QA stabilization — mobile nav, admin actions, overflow fixes, and expanded visual tests |
239
+ | 2.2.1 | Frontend and UX overhaul for responsive workspace, themes, graph UX, admin reflow, and file attachment |
240
+ | 2.2.0 | Multimodal-first Knowledge Graph and local model source disclosure |
241
+ | 2.1.0 | Multi-agent workflow maturity |
242
+ | 2.0.0 | AI pipeline, workflow, and plugin platform foundation |
200
243
  | 1.7.0 | Graph and collaboration |
201
244
  | 1.6.0 | Product experience deepening |
202
245
 
@@ -7,6 +7,10 @@ from pathlib import Path
7
7
  import httpx
8
8
  from openai import AsyncOpenAI
9
9
 
10
+ from latticeai.core.logging_safety import install_sensitive_log_filter, safe_log_text
11
+
12
+ install_sensitive_log_filter()
13
+
10
14
 
11
15
  def load_env_file(path=".env"):
12
16
  env_path = Path(path)
@@ -72,7 +76,7 @@ async def get_updates(client, offset=None):
72
76
  res = await client.get(f"{TELEGRAM_API_URL}/getUpdates", params=params, timeout=35)
73
77
  return res.json()
74
78
  except Exception as exc:
75
- logger.error("Telegram update failed: %s", exc)
79
+ logger.error("Telegram update failed: %s", safe_log_text(exc))
76
80
  return None
77
81
 
78
82
 
@@ -161,7 +165,7 @@ async def handle_message(client, chat_id, text):
161
165
  answer = await ask_codex(chat_id, text)
162
166
  except Exception as exc:
163
167
  logger.exception("OpenAI request failed")
164
- answer = f"OpenAI 요청 실패: {exc}"
168
+ answer = f"OpenAI 요청 실패: {safe_log_text(exc)}"
165
169
  await send_message(client, chat_id, answer)
166
170
 
167
171