ltcai 1.3.0 → 1.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 +105 -79
- package/docs/CHANGELOG.md +109 -0
- package/docs/images/architecture.png +0 -0
- package/docs/images/graph.png +0 -0
- package/docs/images/hero.gif +0 -0
- package/docs/images/model-recommendation.png +0 -0
- package/docs/images/onboarding.png +0 -0
- package/docs/images/organization.png +0 -0
- package/docs/images/skills.png +0 -0
- package/docs/images/tmp_frames/frame_00.png +0 -0
- package/docs/images/tmp_frames/frame_01.png +0 -0
- package/docs/images/tmp_frames/frame_02.png +0 -0
- package/docs/images/tmp_frames/frame_03.png +0 -0
- package/docs/images/workspace.png +0 -0
- package/latticeai/__init__.py +1 -1
- package/latticeai/api/admin.py +17 -0
- package/latticeai/api/chat.py +786 -0
- package/latticeai/api/computer_use.py +294 -0
- package/latticeai/api/deps.py +15 -0
- package/latticeai/api/garden.py +34 -0
- package/latticeai/api/local_files.py +125 -0
- package/latticeai/api/models.py +16 -0
- package/latticeai/api/permissions.py +331 -0
- package/latticeai/api/setup.py +158 -0
- package/latticeai/api/static_routes.py +166 -0
- package/latticeai/api/tools.py +579 -0
- package/latticeai/api/workspace.py +11 -0
- package/latticeai/core/enterprise_admin.py +158 -0
- package/latticeai/core/workspace_os.py +1 -1
- package/latticeai/server_app.py +223 -4301
- package/latticeai/services/app_context.py +27 -0
- package/latticeai/services/model_catalog.py +289 -0
- package/latticeai/services/model_recommendation.py +183 -0
- package/latticeai/services/model_runtime.py +1721 -0
- package/latticeai/services/tool_dispatch.py +135 -0
- package/latticeai/services/upload_service.py +99 -0
- package/package.json +3 -3
- package/skills/SKILL_TEMPLATE.md +1 -1
- package/skills/code_review/SKILL.md +1 -1
- package/skills/data_analysis/SKILL.md +1 -1
- package/skills/file_edit/SKILL.md +1 -1
- package/skills/summarize_document/SKILL.md +1 -1
- package/skills/web_search/SKILL.md +1 -1
- package/static/scripts/chat.js +45 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"""Enterprise PoC surfaces (admin policies, audit export, SIEM stub, org settings).
|
|
2
|
+
|
|
3
|
+
This module is **structure only** — it prepares concrete, discoverable shapes for
|
|
4
|
+
Enterprise governance features while keeping the open-source Community edition
|
|
5
|
+
fully functional and ungated. Every capability here is consulted through
|
|
6
|
+
:data:`latticeai.core.enterprise.capability_registry`; in the Community build
|
|
7
|
+
each is reported ``enabled=False`` and the Community behaviour (local audit
|
|
8
|
+
export, the four base roles, single-tenant local storage) is always available.
|
|
9
|
+
|
|
10
|
+
Nothing in this module restricts a Community feature. It answers "what *would*
|
|
11
|
+
an Enterprise provider light up, and is it active?" so the admin UI can show an
|
|
12
|
+
honest edition/capability matrix and a SIEM export *preview envelope* without
|
|
13
|
+
shipping any Enterprise implementation.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from typing import Any, Dict, List, Optional
|
|
19
|
+
|
|
20
|
+
from latticeai.core.enterprise import (
|
|
21
|
+
EnterpriseCapability,
|
|
22
|
+
capability_registry,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
COMMUNITY_NOTICE = (
|
|
26
|
+
"Community edition: this is an Enterprise extension point and is not "
|
|
27
|
+
"enforced. Local-first behaviour is always available. See "
|
|
28
|
+
"docs/ENTERPRISE.md and docs/EDITION_STRATEGY.md."
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _cap(capability: EnterpriseCapability) -> bool:
|
|
33
|
+
return capability_registry.is_capability_enabled(capability)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def admin_policies() -> Dict[str, Any]:
|
|
37
|
+
"""Admin policy-pack status + the effective (open) Community policy."""
|
|
38
|
+
enabled = _cap(EnterpriseCapability.ADMIN_POLICY_PACKS)
|
|
39
|
+
return {
|
|
40
|
+
"capability": EnterpriseCapability.ADMIN_POLICY_PACKS.value,
|
|
41
|
+
"enabled": enabled,
|
|
42
|
+
"enforced": enabled,
|
|
43
|
+
"effective_policy": {
|
|
44
|
+
# Community defaults — descriptive, not enforced by a policy engine.
|
|
45
|
+
"base_roles": ["owner", "admin", "member", "viewer"],
|
|
46
|
+
"local_file_access": "approval-token gated (per path/user/action)",
|
|
47
|
+
"package_install": "admin-only with audit trail",
|
|
48
|
+
"network_binding": "127.0.0.1 by default",
|
|
49
|
+
"managed_policy_packs": [] if not enabled else "provided-by-enterprise",
|
|
50
|
+
},
|
|
51
|
+
"note": COMMUNITY_NOTICE,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def audit_export_descriptor() -> Dict[str, Any]:
|
|
56
|
+
"""What audit export is available locally vs. via Enterprise SIEM streaming."""
|
|
57
|
+
siem_enabled = _cap(EnterpriseCapability.SIEM_EXPORT)
|
|
58
|
+
retention_enabled = _cap(EnterpriseCapability.COMPLIANCE_RETENTION)
|
|
59
|
+
return {
|
|
60
|
+
"local_export": {
|
|
61
|
+
"available": True,
|
|
62
|
+
"endpoint": "/admin/security/export",
|
|
63
|
+
"formats": ["json", "csv", "xlsx", "txt", "pdf"],
|
|
64
|
+
"note": "Community local audit export is always available to admins.",
|
|
65
|
+
},
|
|
66
|
+
"siem_streaming": {
|
|
67
|
+
"capability": EnterpriseCapability.SIEM_EXPORT.value,
|
|
68
|
+
"enabled": siem_enabled,
|
|
69
|
+
"note": COMMUNITY_NOTICE,
|
|
70
|
+
},
|
|
71
|
+
"compliance_retention": {
|
|
72
|
+
"capability": EnterpriseCapability.COMPLIANCE_RETENTION.value,
|
|
73
|
+
"enabled": retention_enabled,
|
|
74
|
+
"note": COMMUNITY_NOTICE,
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def siem_export_stub(events: Optional[List[Dict[str, Any]]] = None) -> Dict[str, Any]:
|
|
80
|
+
"""A preview of the envelope an Enterprise SIEM exporter would emit.
|
|
81
|
+
|
|
82
|
+
In the Community build this is a *stub*: it returns the envelope *shape*
|
|
83
|
+
(so integrators can see the contract) but ``streamed=False`` and no events
|
|
84
|
+
are actually pushed to an external SIEM.
|
|
85
|
+
"""
|
|
86
|
+
enabled = _cap(EnterpriseCapability.SIEM_EXPORT)
|
|
87
|
+
sample = events or [
|
|
88
|
+
{
|
|
89
|
+
"id": "evt_sample",
|
|
90
|
+
"type": "audit_event",
|
|
91
|
+
"timestamp": "1970-01-01T00:00:00Z",
|
|
92
|
+
"actor": "admin@example.com",
|
|
93
|
+
"action": "model_load",
|
|
94
|
+
"severity": "informational",
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
envelope = {
|
|
98
|
+
"format": "ltcai.siem.v1",
|
|
99
|
+
"encoding": "ndjson",
|
|
100
|
+
"vendor": "LatticeAI",
|
|
101
|
+
"product": "Workspace OS",
|
|
102
|
+
"records": [
|
|
103
|
+
{
|
|
104
|
+
"ts": e.get("timestamp"),
|
|
105
|
+
"actor": e.get("actor"),
|
|
106
|
+
"act": e.get("action"),
|
|
107
|
+
"sev": e.get("severity", "informational"),
|
|
108
|
+
"kind": e.get("type"),
|
|
109
|
+
"id": e.get("id"),
|
|
110
|
+
}
|
|
111
|
+
for e in sample
|
|
112
|
+
],
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
"capability": EnterpriseCapability.SIEM_EXPORT.value,
|
|
116
|
+
"enabled": enabled,
|
|
117
|
+
"streamed": False if not enabled else True,
|
|
118
|
+
"destination": None if not enabled else "configured-by-enterprise",
|
|
119
|
+
"preview_envelope": envelope,
|
|
120
|
+
"note": COMMUNITY_NOTICE,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def organization_settings() -> Dict[str, Any]:
|
|
125
|
+
"""Org-scale governance capabilities and their (Community=off) state."""
|
|
126
|
+
governance_caps = [
|
|
127
|
+
EnterpriseCapability.TENANT_ISOLATION,
|
|
128
|
+
EnterpriseCapability.RBAC_ABAC_ADVANCED,
|
|
129
|
+
EnterpriseCapability.SCIM,
|
|
130
|
+
EnterpriseCapability.IDP_PROVISIONING,
|
|
131
|
+
EnterpriseCapability.SSO_ADVANCED,
|
|
132
|
+
EnterpriseCapability.DLP_POLICY,
|
|
133
|
+
EnterpriseCapability.EDISCOVERY,
|
|
134
|
+
EnterpriseCapability.PRIVATE_VPC,
|
|
135
|
+
EnterpriseCapability.AIR_GAPPED_DEPLOYMENT,
|
|
136
|
+
]
|
|
137
|
+
return {
|
|
138
|
+
"community_baseline": {
|
|
139
|
+
"workspaces": ["personal", "organization"],
|
|
140
|
+
"roles": ["owner", "admin", "member", "viewer"],
|
|
141
|
+
"data_isolation": "single-tenant local storage (~/.ltcai)",
|
|
142
|
+
},
|
|
143
|
+
"governance_capabilities": {
|
|
144
|
+
cap.value: _cap(cap) for cap in governance_caps
|
|
145
|
+
},
|
|
146
|
+
"note": COMMUNITY_NOTICE,
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def poc_overview() -> Dict[str, Any]:
|
|
151
|
+
"""Combined Enterprise PoC surface for the admin dashboard."""
|
|
152
|
+
return {
|
|
153
|
+
"edition": capability_registry.describe(),
|
|
154
|
+
"admin_policies": admin_policies(),
|
|
155
|
+
"audit_export": audit_export_descriptor(),
|
|
156
|
+
"siem_export": siem_export_stub(),
|
|
157
|
+
"organization_settings": organization_settings(),
|
|
158
|
+
}
|
|
@@ -18,7 +18,7 @@ from pathlib import Path
|
|
|
18
18
|
from typing import Any, Callable, Dict, Iterable, List, Optional
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
WORKSPACE_OS_VERSION = "1.
|
|
21
|
+
WORKSPACE_OS_VERSION = "1.5.0"
|
|
22
22
|
|
|
23
23
|
# Workspace types separate single-user Personal workspaces from shared
|
|
24
24
|
# Organization workspaces. Both keep the same local-first JSON store; the type
|