ltcai 9.3.0 → 9.5.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 +57 -42
- package/docs/CHANGELOG.md +48 -0
- package/docs/COMMUNITY_AND_PLUGINS.md +4 -3
- package/docs/DEVELOPMENT.md +8 -8
- package/docs/LEGACY_COMPATIBILITY.md +1 -1
- package/docs/ONBOARDING.md +2 -2
- package/docs/OPERATIONS.md +1 -1
- package/docs/TRUST_MODEL.md +1 -1
- package/docs/WHY_LATTICE.md +1 -1
- package/docs/kg-schema.md +1 -1
- package/docs/mcp-tools.md +1 -1
- package/lattice_brain/__init__.py +1 -1
- package/lattice_brain/runtime/multi_agent.py +1 -1
- package/latticeai/__init__.py +1 -1
- package/latticeai/api/automation_intelligence.py +129 -0
- package/latticeai/api/command_center.py +51 -0
- package/latticeai/app_factory.py +32 -0
- package/latticeai/core/legacy_compatibility.py +1 -1
- package/latticeai/core/marketplace.py +1 -1
- package/latticeai/core/workspace_os.py +1 -1
- package/latticeai/runtime/persistence_runtime.py +8 -0
- package/latticeai/services/architecture_readiness.py +1 -1
- package/latticeai/services/automation_intelligence.py +450 -0
- package/latticeai/services/command_center.py +433 -0
- package/latticeai/services/product_readiness.py +1 -1
- package/package.json +1 -1
- package/scripts/check_current_release_docs.mjs +1 -1
- package/src-tauri/Cargo.lock +1 -1
- package/src-tauri/Cargo.toml +1 -1
- package/src-tauri/tauri.conf.json +1 -1
- package/static/app/asset-manifest.json +11 -11
- package/static/app/assets/Act-Cdfqx4wN.js +1 -0
- package/static/app/assets/{Brain-Jd3V4Obm.js → Brain-w_tAuyg6.js} +1 -1
- package/static/app/assets/{Capture-DLj9Uzed.js → Capture-iJwi9LmS.js} +1 -1
- package/static/app/assets/{Library-dPbez7Tc.js → Library-Do-jjhzi.js} +1 -1
- package/static/app/assets/{System-CkROWBuq.js → System-DFg_q3E6.js} +1 -1
- package/static/app/assets/index-BN6HIWVC.css +2 -0
- package/static/app/assets/index-aJuRi-Xo.js +17 -0
- package/static/app/assets/{primitives-DrwaJ7dy.js → primitives-ZTUlU7pR.js} +1 -1
- package/static/app/assets/{textarea-DNvCwmmK.js → textarea-CMfhqPhE.js} +1 -1
- package/static/app/index.html +2 -2
- package/static/sw.js +1 -1
- package/static/app/assets/Act-ls57ctKH.js +0 -1
- package/static/app/assets/index-BRUqy2zk.css +0 -2
- package/static/app/assets/index-CAlo2Lm-.js +0 -17
package/README.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# Lattice AI
|
|
2
2
|
|
|
3
|
-
**Lattice AI 9.
|
|
3
|
+
**Lattice AI 9.5.0 is the local-first Digital Brain platform. The Command Center puts everything one keystroke away: a Cmd+K palette that searches knowledge, past conversations, automations, and app pages in one query, and a daily briefing that condenses recent knowledge, automation state, pending reviews, Brain health, and suggested next steps into one glance with one-click quick actions.**
|
|
4
4
|
|
|
5
5
|
**Lattice AI는 모델이 바뀌어도 내 지식과 맥락을 보존하는 로컬 우선 AI 브레인입니다.**
|
|
6
6
|
|
|
7
|
-
> The 9.
|
|
7
|
+
> The 9.5.0 release adds the Command Center: a deterministic, local
|
|
8
|
+
> `/api/command` surface serving a daily briefing (recent knowledge,
|
|
9
|
+
> conversation activity, automation state, pending reviews, health snapshot,
|
|
10
|
+
> top suggestions, state-derived quick actions) and a universal search across
|
|
11
|
+
> knowledge nodes, the user's own conversations, and installed automations —
|
|
12
|
+
> surfaced in the app as a Cmd+K command palette and a Today's Briefing panel.
|
|
13
|
+
> The 9.4.0 release adds question-driven automation: a deterministic local
|
|
14
|
+
> pattern miner clusters your recurring questions (the evidence shown is your
|
|
15
|
+
> own words, no model call), an /api/automation surface turns patterns and
|
|
16
|
+
> connected folders into one-click suggestions, and every accepted suggestion
|
|
17
|
+
> becomes a disabled, review-gated draft workflow you enable deliberately.
|
|
18
|
+
> The 9.3.0 release wired the previously dormant Brain quality layer into
|
|
8
19
|
> the product: /api/brain health diagnosis with recommended care actions, a
|
|
9
20
|
> proactive insights digest, contradiction surfacing across memories and the
|
|
10
21
|
> graph, dry-run-first duplicate consolidation, and hybrid recall that blends
|
|
@@ -97,11 +108,11 @@ You need Lattice AI when:
|
|
|
97
108
|
The screenshots below are the latest checked-in visual evidence captures. They
|
|
98
109
|
keep the first-run Brain flow, memory graph, source capture, model library,
|
|
99
110
|
system view, admin console, and review center visible as release gates while
|
|
100
|
-
9.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
captures below are the checked-in 9.
|
|
104
|
-
product flow.
|
|
111
|
+
9.5.0 puts the whole Brain one keystroke away: the Cmd+K Command Palette
|
|
112
|
+
searches knowledge, conversations, automations, and pages in one query, and
|
|
113
|
+
Today's Briefing condenses the Brain's state into one glance with one-click
|
|
114
|
+
next steps. The captures below are the checked-in 9.5.0 visual release
|
|
115
|
+
evidence for that product flow.
|
|
105
116
|
|
|
106
117
|
### 1. Wake Brain
|
|
107
118
|
|
|
@@ -113,21 +124,21 @@ confirm owner, check the computer, choose the Brain voice.
|
|
|
113
124
|
Choose the owner of the Brain. The profile is not a SaaS account by default; it
|
|
114
125
|
is the local identity for the knowledge you keep.
|
|
115
126
|
|
|
116
|
-

|
|
117
128
|
|
|
118
129
|
### 3. Recommended Models
|
|
119
130
|
|
|
120
131
|
Start with a short list: safest recommendation, faster model, stronger model.
|
|
121
132
|
Advanced details stay available without overwhelming first-time users.
|
|
122
133
|
|
|
123
|
-

|
|
124
135
|
|
|
125
136
|
### 4. Install And Load
|
|
126
137
|
|
|
127
138
|
Download and load only after consent. Lattice explains model size, local
|
|
128
139
|
execution, and network use before work starts.
|
|
129
140
|
|
|
130
|
-

|
|
131
142
|
|
|
132
143
|
### 5. Brain Chat
|
|
133
144
|
|
|
@@ -139,14 +150,14 @@ and its visible life signal follow real listening, recall, synthesis, and action
|
|
|
139
150
|
state. Detailed memory rings, provenance, conversation history, and
|
|
140
151
|
model/runtime proof open as overlays only when requested.
|
|
141
152
|
|
|
142
|
-

|
|
143
154
|
|
|
144
155
|
### 6. Review Center
|
|
145
156
|
|
|
146
157
|
Automation results are staged for review before they become durable decisions.
|
|
147
158
|
Snooze, unsnooze, run now, approve, and dismiss actions stay explicit.
|
|
148
159
|
|
|
149
|
-

|
|
150
161
|
|
|
151
162
|
## Brain Depths
|
|
152
163
|
|
|
@@ -162,10 +173,10 @@ The user travels inward from everyday memory to deeper structure:
|
|
|
162
173
|
|
|
163
174
|
Walkthrough:
|
|
164
175
|
|
|
165
|
-

|
|
166
177
|
|
|
167
178
|
Screenshot index and capture notes:
|
|
168
|
-
[output/release/v9.
|
|
179
|
+
[output/release/v9.5.0/SCREENSHOT_INDEX.md](output/release/v9.5.0/SCREENSHOT_INDEX.md)
|
|
169
180
|
|
|
170
181
|
## Install
|
|
171
182
|
|
|
@@ -250,43 +261,45 @@ See [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for developer workflow details.
|
|
|
250
261
|
|
|
251
262
|
## Current Release
|
|
252
263
|
|
|
253
|
-
The current release is **9.
|
|
254
|
-
|
|
255
|
-
- A new `
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
-
|
|
262
|
-
"
|
|
263
|
-
|
|
264
|
-
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
- `ltcai-9.
|
|
277
|
-
- `dist/ltcai-9.
|
|
278
|
-
- `
|
|
264
|
+
The current release is **9.5.0 — Command Center**:
|
|
265
|
+
|
|
266
|
+
- A new `CommandCenterService` (`/api/command/briefing`, `/api/command/search`)
|
|
267
|
+
aggregates every Brain surface read-only and deterministically: recent
|
|
268
|
+
knowledge from the scoped graph, conversation activity, automation
|
|
269
|
+
enable/draft counts, pending review items, a Brain-health snapshot, and the
|
|
270
|
+
top automation suggestions — each section degrades independently when a
|
|
271
|
+
backend is unavailable.
|
|
272
|
+
- State-derived quick actions with stable ids ("N items waiting for review",
|
|
273
|
+
"enable your draft automations", "connect a knowledge folder") give the UI
|
|
274
|
+
one-click jumps that always reflect the actual product state.
|
|
275
|
+
- Universal search groups results across knowledge nodes (scoped keyword
|
|
276
|
+
search), the user's own conversations (deduped per conversation, newest
|
|
277
|
+
first), and installed automations — all scoped to the requesting user and
|
|
278
|
+
workspace.
|
|
279
|
+
- The frontend gains a Cmd+K Command Palette (grouped results, keyboard
|
|
280
|
+
navigation, page jumps, fully ko/en localized) and a Today's Briefing panel
|
|
281
|
+
on the Brain home with stat chips, recent knowledge, and quick actions.
|
|
282
|
+
- Everything is read-only, local, and model-free: no model calls, no writes,
|
|
283
|
+
no external actions.
|
|
284
|
+
|
|
285
|
+
Expected artifacts for 9.5.0 release must use exact filenames:
|
|
286
|
+
|
|
287
|
+
- `dist/ltcai-9.5.0-py3-none-any.whl`
|
|
288
|
+
- `dist/ltcai-9.5.0.tar.gz`
|
|
289
|
+
- `ltcai-9.5.0.tgz`
|
|
290
|
+
- `dist/ltcai-9.5.0.vsix`
|
|
291
|
+
- `src-tauri/target/release/bundle/dmg/Lattice AI_9.5.0_aarch64.dmg`
|
|
279
292
|
|
|
280
293
|
Do not use wildcard artifact uploads. Package registry publishing remains owner-run.
|
|
281
294
|
|
|
282
295
|
See [docs/ROADMAP_RECOMMENDATIONS.md](docs/ROADMAP_RECOMMENDATIONS.md) for the
|
|
283
|
-
strategic roadmap slices applied through 9.
|
|
296
|
+
strategic roadmap slices applied through 9.5.0 and the follow-up tracks.
|
|
284
297
|
|
|
285
298
|
## Known Limitations
|
|
286
299
|
|
|
287
300
|
- External package registries are owner-published and can lag behind GitHub.
|
|
288
301
|
- PostgreSQL/pgvector is optional scale/migration tooling. SQLite remains the
|
|
289
|
-
live local Brain store in 9.
|
|
302
|
+
live local Brain store in 9.5.0.
|
|
290
303
|
- Docker, model downloads, cloud model calls, Telegram, Brain Network, and update
|
|
291
304
|
checks require explicit user action.
|
|
292
305
|
- Conversation does not fabricate answers when no model is loaded.
|
|
@@ -298,6 +311,8 @@ strategic roadmap slices applied through 9.3.0 and the follow-up tracks.
|
|
|
298
311
|
|
|
299
312
|
| Version | Theme |
|
|
300
313
|
| --- | --- |
|
|
314
|
+
| 9.5.0 | Command Center: a Cmd+K palette searching knowledge, conversations, automations, and pages in one query, plus a daily briefing with Brain state at a glance and state-derived one-click quick actions |
|
|
315
|
+
| 9.4.0 | Question-Driven Everyday Automation: the Brain mines recurring user questions and connected knowledge folders into one-click, consent-first automation suggestions installed as review-gated drafts |
|
|
301
316
|
| 9.3.0 | Proactive Brain Intelligence: the Brain diagnoses its own health, surfaces contradictions and stale knowledge, proposes consent-first duplicate consolidation, and recalls with hybrid lexical+semantic evidence behind an honest quality gate |
|
|
302
317
|
| 9.2.0 | Model-Agnostic File Generation: chat file requests always produce structurally valid files with any LLM via extraction, per-type validation, corrective retry, deterministic repair, inferred file targets, and a fault-tolerant agent JSON loop |
|
|
303
318
|
| 9.1.0 | Code Review Completion & Fail-Closed Runtime: all July 11 review findings closed across fail-closed security, typed runtime/model/chat boundaries, honest frontend failures and tests, and repository hygiene |
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,54 @@ The top entry is either the current unreleased main-branch work or the current
|
|
|
4
4
|
release line. Older entries are historical and may describe behavior as it
|
|
5
5
|
existed at that release.
|
|
6
6
|
|
|
7
|
+
## [9.5.0] - 2026-07-20
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Added `latticeai/services/command_center.py` and the `/api/command/*`
|
|
11
|
+
router: a daily briefing aggregating recent knowledge, conversation
|
|
12
|
+
activity, automation state, pending reviews, a Brain-health snapshot, top
|
|
13
|
+
automation suggestions, and state-derived quick actions with stable ids;
|
|
14
|
+
and a universal search grouping knowledge nodes, the user's own
|
|
15
|
+
conversations (deduped per conversation), and installed automations.
|
|
16
|
+
- Added the Cmd+K Command Palette (grouped results, keyboard navigation,
|
|
17
|
+
debounced universal search, static page jumps) and the collapsible
|
|
18
|
+
"오늘의 브리핑 / Today's briefing" panel on the Brain home, fully ko/en
|
|
19
|
+
localized.
|
|
20
|
+
- Added `tests/unit/test_command_center.py` (11 tests) and
|
|
21
|
+
`frontend/src/features/command/CommandPalette.test.tsx` (3 tests).
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- Cmd+K now opens the Command Palette instead of only focusing the chat
|
|
25
|
+
composer; the palette includes a direct jump to the Brain conversation.
|
|
26
|
+
|
|
27
|
+
### Security
|
|
28
|
+
- Both Command Center endpoints are read-only and scoped to the requesting
|
|
29
|
+
user and workspace; scoped reads exclude legacy-global rows, and every
|
|
30
|
+
briefing section degrades independently without leaking errors.
|
|
31
|
+
|
|
32
|
+
## [9.4.0] - 2026-07-20
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
- Added `latticeai/services/automation_intelligence.py` and the
|
|
36
|
+
`/api/automation/*` router: recurring-question pattern mining
|
|
37
|
+
(deterministic local token-signature clustering with literal-question
|
|
38
|
+
evidence), automation suggestions from question patterns and connected
|
|
39
|
+
knowledge folders, idempotent consent-first install (disabled draft,
|
|
40
|
+
review-queue gated, local-only), and a combined overview payload.
|
|
41
|
+
- Added the "Automation suggestions for you" panel to the Act page with
|
|
42
|
+
evidence chips and one-click creation, fully ko/en localized.
|
|
43
|
+
- Added `tests/unit/test_automation_intelligence.py` (10 tests).
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- Recurring question intents that match a starter recipe (daily digest,
|
|
47
|
+
weekly project review, follow-up radar) suggest that recipe; other
|
|
48
|
+
repeated questions become parameterized "scheduled answer" workflows.
|
|
49
|
+
|
|
50
|
+
### Security
|
|
51
|
+
- History mining respects user/workspace scoping and excludes legacy-global
|
|
52
|
+
rows for scoped reads; suggestion installs carry provenance metadata and
|
|
53
|
+
never enable themselves.
|
|
54
|
+
|
|
7
55
|
## [9.3.0] - 2026-07-20
|
|
8
56
|
|
|
9
57
|
### Added
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# Community And Plugins
|
|
2
2
|
|
|
3
|
-
Current release: **9.
|
|
3
|
+
Current release: **9.5.0 — Command Center**.
|
|
4
4
|
|
|
5
5
|
LatticeAI defines the path from a strong local-first framework (8.4.0
|
|
6
6
|
action-aware baseline, 8.5.0 registry+DI hardening, 8.6.0 capture/navigation
|
|
7
7
|
reliability, 8.7.0 runtime-state hygiene, 8.8.0 Brain Core extraction
|
|
8
8
|
readiness, 8.9.0 scoped Tool API hardening, 9.0.0 cleanup closure, 9.1.0
|
|
9
|
-
fail-closed review completion, 9.2.0 model-agnostic file generation,
|
|
10
|
-
9.
|
|
9
|
+
fail-closed review completion, 9.2.0 model-agnostic file generation, 9.3.0
|
|
10
|
+
proactive Brain intelligence, 9.4.0 question-driven everyday automation, and 9.5.0 Command Center)
|
|
11
|
+
to a product ecosystem. The
|
|
11
12
|
immediate goal is small and practical: make it clear how
|
|
12
13
|
contributors can extend the Brain without weakening local-first trust,
|
|
13
14
|
workspace scoping, or release quality.
|
package/docs/DEVELOPMENT.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Lattice AI Development
|
|
2
2
|
|
|
3
|
-
Current release: **9.
|
|
3
|
+
Current release: **9.5.0 — Command Center**.
|
|
4
4
|
|
|
5
5
|
This document is for contributors working on the local-first Digital Brain
|
|
6
6
|
codebase. Product positioning and quick start stay in `README.md`; release
|
|
7
|
-
history is intentionally limited to 8.0.0-9.
|
|
7
|
+
history is intentionally limited to 8.0.0-9.5.0 in `docs/CHANGELOG.md` and
|
|
8
8
|
`RELEASE.md`.
|
|
9
9
|
|
|
10
10
|
## Product Contract
|
|
@@ -153,10 +153,10 @@ For user-facing, API, runtime, release, or packaging changes, check:
|
|
|
153
153
|
Release/publish examples must use exact target-version filenames. Do not
|
|
154
154
|
document wildcard artifact upload commands.
|
|
155
155
|
|
|
156
|
-
For 9.
|
|
156
|
+
For 9.5.0 release work, exact artifacts are:
|
|
157
157
|
|
|
158
|
-
- `dist/ltcai-9.
|
|
159
|
-
- `dist/ltcai-9.
|
|
160
|
-
- `ltcai-9.
|
|
161
|
-
- `dist/ltcai-9.
|
|
162
|
-
- `src-tauri/target/release/bundle/dmg/Lattice AI_9.
|
|
158
|
+
- `dist/ltcai-9.5.0-py3-none-any.whl`
|
|
159
|
+
- `dist/ltcai-9.5.0.tar.gz`
|
|
160
|
+
- `ltcai-9.5.0.tgz`
|
|
161
|
+
- `dist/ltcai-9.5.0.vsix`
|
|
162
|
+
- `src-tauri/target/release/bundle/dmg/Lattice AI_9.5.0_aarch64.dmg`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Legacy Compatibility Map
|
|
2
2
|
|
|
3
|
-
Current target: **9.
|
|
3
|
+
Current target: **9.5.0 — Command Center**.
|
|
4
4
|
|
|
5
5
|
Lattice AI is moving toward a smaller, modular architecture centered on
|
|
6
6
|
`lattice_brain`, `latticeai.services`, `latticeai.api`, and `latticeai.runtime`.
|
package/docs/ONBOARDING.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Lattice AI Onboarding
|
|
2
2
|
|
|
3
|
-
Current release: **9.
|
|
3
|
+
Current release: **9.5.0 — Command Center**.
|
|
4
4
|
|
|
5
5
|
The first-run goal is a five-minute path from "I opened the app" to "my Brain
|
|
6
6
|
has a source, a question, and proof." This page is the product contract behind
|
|
@@ -40,7 +40,7 @@ read the docs first.
|
|
|
40
40
|
|
|
41
41
|
## Release Gate
|
|
42
42
|
|
|
43
|
-
9.
|
|
43
|
+
9.5.0 treats onboarding as a release gate, not marketing copy. The current
|
|
44
44
|
machine-checkable product readiness report requires this five-minute contract,
|
|
45
45
|
the Brain Home surface, setup helpers, graph ingestion tests, and exact release
|
|
46
46
|
artifact documentation before the release can be called complete.
|
package/docs/OPERATIONS.md
CHANGED
package/docs/TRUST_MODEL.md
CHANGED
package/docs/WHY_LATTICE.md
CHANGED
package/docs/kg-schema.md
CHANGED
package/docs/mcp-tools.md
CHANGED
|
@@ -21,7 +21,7 @@ from .contracts import multi_agent_contract
|
|
|
21
21
|
from ..utils import now_iso as _now
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
MULTI_AGENT_VERSION = "9.
|
|
24
|
+
MULTI_AGENT_VERSION = "9.5.0"
|
|
25
25
|
|
|
26
26
|
AGENT_ROLES = ("researcher", "planner", "executor", "reviewer", "release")
|
|
27
27
|
CORE_PIPELINE = ("planner", "executor", "reviewer")
|
package/latticeai/__init__.py
CHANGED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""Question-driven everyday automation API router (v9.4.0).
|
|
2
|
+
|
|
3
|
+
Exposes :class:`~latticeai.services.automation_intelligence.AutomationIntelligenceService`:
|
|
4
|
+
recurring-question patterns with evidence, automation suggestions (from the
|
|
5
|
+
user's own questions and connected knowledge folders), one-click consent-first
|
|
6
|
+
install, and a combined overview for the automation surface.
|
|
7
|
+
|
|
8
|
+
Installs follow the same consent contract as the starter recipes: the
|
|
9
|
+
workflow is created as a disabled draft (unless the user explicitly asks to
|
|
10
|
+
enable), review-queue gated, local-only, and idempotent per suggestion.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from typing import Any, Callable, Optional
|
|
16
|
+
|
|
17
|
+
from fastapi import APIRouter, HTTPException, Request
|
|
18
|
+
from pydantic import BaseModel
|
|
19
|
+
|
|
20
|
+
from latticeai.services.automation_intelligence import AutomationIntelligenceService
|
|
21
|
+
from latticeai.services.brain_automation import find_installed_recipe_workflow
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class SuggestionInstallRequest(BaseModel):
|
|
25
|
+
suggestion_id: str
|
|
26
|
+
enabled: bool = False
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def create_automation_intelligence_router(
|
|
30
|
+
*,
|
|
31
|
+
service: AutomationIntelligenceService,
|
|
32
|
+
store: Any,
|
|
33
|
+
require_user: Callable[[Request], str],
|
|
34
|
+
gate_read: Callable[[Request], Optional[str]],
|
|
35
|
+
gate_write: Callable[[Request], Optional[str]],
|
|
36
|
+
append_audit_event: Callable[..., None],
|
|
37
|
+
workspace_graph: Callable[[], Any],
|
|
38
|
+
) -> APIRouter:
|
|
39
|
+
from lattice_brain.workflow import legacy_steps_from_nodes, validate_definition
|
|
40
|
+
|
|
41
|
+
router = APIRouter()
|
|
42
|
+
|
|
43
|
+
@router.get("/api/automation/patterns")
|
|
44
|
+
async def automation_patterns(request: Request):
|
|
45
|
+
user = require_user(request)
|
|
46
|
+
scope = gate_read(request)
|
|
47
|
+
return service.question_patterns(user_email=user, workspace_id=scope)
|
|
48
|
+
|
|
49
|
+
@router.get("/api/automation/suggestions")
|
|
50
|
+
async def automation_suggestions(request: Request):
|
|
51
|
+
user = require_user(request)
|
|
52
|
+
scope = gate_read(request)
|
|
53
|
+
return service.suggestions(user_email=user, workspace_id=scope)
|
|
54
|
+
|
|
55
|
+
@router.get("/api/automation/overview")
|
|
56
|
+
async def automation_overview(request: Request):
|
|
57
|
+
user = require_user(request)
|
|
58
|
+
scope = gate_read(request)
|
|
59
|
+
return service.overview(user_email=user, workspace_id=scope)
|
|
60
|
+
|
|
61
|
+
@router.post("/api/automation/install")
|
|
62
|
+
async def automation_install(req: SuggestionInstallRequest, request: Request):
|
|
63
|
+
user = require_user(request)
|
|
64
|
+
scope = gate_write(request)
|
|
65
|
+
suggestion = service.find_suggestion(
|
|
66
|
+
req.suggestion_id, user_email=user, workspace_id=scope
|
|
67
|
+
)
|
|
68
|
+
if suggestion is None:
|
|
69
|
+
raise HTTPException(
|
|
70
|
+
status_code=404,
|
|
71
|
+
detail=f"Automation suggestion not found: {req.suggestion_id}",
|
|
72
|
+
)
|
|
73
|
+
definition = service.build_suggestion_workflow(suggestion, enabled=req.enabled)
|
|
74
|
+
|
|
75
|
+
# Idempotent per suggestion: reuse the workflow provenance match used
|
|
76
|
+
# for recipes, keyed on suggestion_id instead of recipe_id.
|
|
77
|
+
existing = None
|
|
78
|
+
for workflow in store.list_workflows(workspace_id=scope).get("workflows") or []:
|
|
79
|
+
metadata = (workflow or {}).get("metadata") or {}
|
|
80
|
+
if (
|
|
81
|
+
metadata.get("created_from") == "automation_suggestion"
|
|
82
|
+
and metadata.get("suggestion_id") == req.suggestion_id
|
|
83
|
+
):
|
|
84
|
+
existing = workflow
|
|
85
|
+
break
|
|
86
|
+
if existing is None and suggestion.get("recipe_id"):
|
|
87
|
+
existing = find_installed_recipe_workflow(
|
|
88
|
+
store.list_workflows(workspace_id=scope).get("workflows"),
|
|
89
|
+
suggestion["recipe_id"],
|
|
90
|
+
)
|
|
91
|
+
if existing is not None:
|
|
92
|
+
return {
|
|
93
|
+
"workflow": existing,
|
|
94
|
+
"suggestion": suggestion,
|
|
95
|
+
"enabled": bool((existing.get("metadata") or {}).get("automation_state") == "enabled"),
|
|
96
|
+
"already_installed": True,
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
errors = validate_definition({"name": definition["name"], "nodes": definition["nodes"]})
|
|
100
|
+
if errors:
|
|
101
|
+
raise HTTPException(status_code=400, detail={"validation_errors": errors})
|
|
102
|
+
workflow = store.create_workflow(
|
|
103
|
+
name=definition["name"],
|
|
104
|
+
steps=legacy_steps_from_nodes(definition["nodes"]),
|
|
105
|
+
nodes=definition["nodes"],
|
|
106
|
+
metadata=definition["metadata"],
|
|
107
|
+
user_email=user or None,
|
|
108
|
+
graph=workspace_graph(),
|
|
109
|
+
workspace_id=scope,
|
|
110
|
+
)
|
|
111
|
+
append_audit_event(
|
|
112
|
+
"automation_suggestion_installed",
|
|
113
|
+
user_email=user,
|
|
114
|
+
workflow_id=workflow.get("id"),
|
|
115
|
+
suggestion_id=req.suggestion_id,
|
|
116
|
+
suggestion_kind=suggestion.get("kind"),
|
|
117
|
+
enabled=bool(req.enabled),
|
|
118
|
+
)
|
|
119
|
+
return {
|
|
120
|
+
"workflow": workflow,
|
|
121
|
+
"suggestion": suggestion,
|
|
122
|
+
"enabled": bool(req.enabled),
|
|
123
|
+
"already_installed": False,
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return router
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
__all__ = ["create_automation_intelligence_router"]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Command Center API router (v9.5.0).
|
|
2
|
+
|
|
3
|
+
Read-only surface over :class:`~latticeai.services.command_center.CommandCenterService`:
|
|
4
|
+
|
|
5
|
+
* ``GET /api/command/briefing`` — the daily briefing: recent knowledge,
|
|
6
|
+
conversation activity, automation state, pending reviews, health snapshot,
|
|
7
|
+
top suggestions, and state-derived quick actions.
|
|
8
|
+
* ``GET /api/command/search?q=…`` — universal search across knowledge nodes,
|
|
9
|
+
the user's conversations, and installed automations. Powers Cmd+K.
|
|
10
|
+
|
|
11
|
+
Both endpoints are scoped to the requesting user and workspace via the same
|
|
12
|
+
require_user/gate_read contract as the rest of the platform.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
from typing import Callable, Optional
|
|
18
|
+
|
|
19
|
+
from fastapi import APIRouter, Query, Request
|
|
20
|
+
|
|
21
|
+
from latticeai.services.command_center import CommandCenterService
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def create_command_center_router(
|
|
25
|
+
*,
|
|
26
|
+
service: CommandCenterService,
|
|
27
|
+
require_user: Callable[[Request], str],
|
|
28
|
+
gate_read: Callable[[Request], Optional[str]],
|
|
29
|
+
) -> APIRouter:
|
|
30
|
+
router = APIRouter()
|
|
31
|
+
|
|
32
|
+
@router.get("/api/command/briefing")
|
|
33
|
+
async def command_briefing(request: Request):
|
|
34
|
+
user = require_user(request)
|
|
35
|
+
scope = gate_read(request)
|
|
36
|
+
return service.briefing(user_email=user, workspace_id=scope)
|
|
37
|
+
|
|
38
|
+
@router.get("/api/command/search")
|
|
39
|
+
async def command_search(
|
|
40
|
+
request: Request,
|
|
41
|
+
q: str = Query("", max_length=300),
|
|
42
|
+
limit: int = Query(8, ge=1, le=20),
|
|
43
|
+
):
|
|
44
|
+
user = require_user(request)
|
|
45
|
+
scope = gate_read(request)
|
|
46
|
+
return service.search(q, user_email=user, workspace_id=scope, limit=limit)
|
|
47
|
+
|
|
48
|
+
return router
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
__all__ = ["create_command_center_router"]
|
package/latticeai/app_factory.py
CHANGED
|
@@ -165,7 +165,10 @@ def _build(config: "Optional[Config]" = None) -> Dict[str, Any]:
|
|
|
165
165
|
from latticeai.api.hooks import create_hooks_router
|
|
166
166
|
from latticeai.core.product_hardening import build_product_hardening_status
|
|
167
167
|
from latticeai.api.agent_registry import create_agent_registry_router
|
|
168
|
+
from latticeai.api.automation_intelligence import create_automation_intelligence_router
|
|
168
169
|
from latticeai.api.brain_intelligence import create_brain_intelligence_router
|
|
170
|
+
from latticeai.api.command_center import create_command_center_router
|
|
171
|
+
from latticeai.services.command_center import CommandCenterService
|
|
169
172
|
from latticeai.api.memory import create_memory_router
|
|
170
173
|
from latticeai.api.browser import create_browser_router
|
|
171
174
|
from latticeai.api.portability import create_portability_router
|
|
@@ -385,6 +388,7 @@ def _build(config: "Optional[Config]" = None) -> Dict[str, Any]:
|
|
|
385
388
|
AGENT_REGISTRY = _persistence_runtime["AGENT_REGISTRY"]
|
|
386
389
|
MEMORY_SERVICE = _persistence_runtime["MEMORY_SERVICE"]
|
|
387
390
|
BRAIN_INTELLIGENCE = _persistence_runtime["BRAIN_INTELLIGENCE"]
|
|
391
|
+
AUTOMATION_INTELLIGENCE = _persistence_runtime["AUTOMATION_INTELLIGENCE"]
|
|
388
392
|
INGESTION_PIPELINE = _persistence_runtime["INGESTION_PIPELINE"]
|
|
389
393
|
DEVICE_IDENTITY = _persistence_runtime["DEVICE_IDENTITY"]
|
|
390
394
|
KG_PORTABILITY = _persistence_runtime["KG_PORTABILITY"]
|
|
@@ -1019,6 +1023,34 @@ def _build(config: "Optional[Config]" = None) -> Dict[str, Any]:
|
|
|
1019
1023
|
create_realtime_router=create_realtime_router,
|
|
1020
1024
|
realtime_bus=REALTIME_BUS,
|
|
1021
1025
|
)
|
|
1026
|
+
app.include_router(
|
|
1027
|
+
create_automation_intelligence_router(
|
|
1028
|
+
service=AUTOMATION_INTELLIGENCE,
|
|
1029
|
+
store=WORKSPACE_OS,
|
|
1030
|
+
require_user=require_user,
|
|
1031
|
+
gate_read=PLATFORM.gate_read,
|
|
1032
|
+
gate_write=PLATFORM.gate_write,
|
|
1033
|
+
append_audit_event=append_audit_event,
|
|
1034
|
+
workspace_graph=_workspace_graph,
|
|
1035
|
+
)
|
|
1036
|
+
)
|
|
1037
|
+
COMMAND_CENTER = CommandCenterService(
|
|
1038
|
+
conversation_store=CONVERSATIONS,
|
|
1039
|
+
knowledge_graph=KNOWLEDGE_GRAPH,
|
|
1040
|
+
store=WORKSPACE_OS,
|
|
1041
|
+
search_service=SEARCH_SERVICE,
|
|
1042
|
+
brain_intelligence=BRAIN_INTELLIGENCE,
|
|
1043
|
+
automation_intelligence=AUTOMATION_INTELLIGENCE,
|
|
1044
|
+
review_queue=REVIEW_QUEUE,
|
|
1045
|
+
enable_graph=ENABLE_GRAPH,
|
|
1046
|
+
)
|
|
1047
|
+
app.include_router(
|
|
1048
|
+
create_command_center_router(
|
|
1049
|
+
service=COMMAND_CENTER,
|
|
1050
|
+
require_user=require_user,
|
|
1051
|
+
gate_read=PLATFORM.gate_read,
|
|
1052
|
+
)
|
|
1053
|
+
)
|
|
1022
1054
|
|
|
1023
1055
|
|
|
1024
1056
|
# ── Health & Info ──────────────────────────────────────────────────────────────
|
|
@@ -49,7 +49,7 @@ __all__ = [
|
|
|
49
49
|
"remove_skill_directory",
|
|
50
50
|
]
|
|
51
51
|
|
|
52
|
-
WORKSPACE_OS_VERSION = "9.
|
|
52
|
+
WORKSPACE_OS_VERSION = "9.5.0"
|
|
53
53
|
|
|
54
54
|
# Workspace types separate single-user Personal workspaces from shared
|
|
55
55
|
# Organization workspaces. Both keep the same local-first JSON store; the type
|