diff --git a/ops/combine/PRODUCT-NAME.md b/ops/combine/PRODUCT-NAME.md new file mode 100644 index 0000000..ee16e0c --- /dev/null +++ b/ops/combine/PRODUCT-NAME.md @@ -0,0 +1,44 @@ +# Имя продукта + +Дата: 18.11.2026 + +## Рекомендация + +# Buryan Prism + +**Позиционирование:** vendor-agnostic AV solution studio. + +Почему: +- **Prism** — один запрос/решение раскладывается на вендоров, роли, совместимость и аналоги; +- короткое, произносится на русском и английском; +- не привязано к Yealink — важно, раз ветки равноправны; +- не выглядит как «внутренняя тулза» (в отличие от `BuryansTool`); +- хорошо сочетается с логотипом/иконкой-призмой и метафорой «увидеть решение с другой стороны». + +Тэглайн: +> **Buryan Prism — собери решение, а не бренд.** + +Альтернативы: + +| Имя | Смысл | Минус | +|---|---|---| +| **Buryan Forge** | сборка/BOM | меньше про аналоги | +| **Buryan Atlas** | карта каталога | статичнее | +| **Buryan Relay** | связи/коммутация | занято в телекоме | +| **Buryan Loom** | плетение вендоров | конфликт с видеосервисом Loom | +| **Buryan Axis** | ось/координация | слишком абстрактно | +| **Buryan Vantage** | точка обзора | конфликт с Vantage (Legrand) | + +`BuryansTool` — рабочее, но не продуктовое: звучит как утилита, не как платформа. +Если нужен максимально нейтральный вариант — **Buryan Studio**, но он слабее +по смыслу, чем Prism. + +## Что уже в UI + +- Бренд **Buryan Prism** в новом shell (`/`). +- Старый интерфейс доступен как `/classic`. + +## Решение + +Использовать **Buryan Prism** как рабочее имя до юридической проверки. +Логотип: призма/спектр; цвета — тёмный фон + голубой акцент. diff --git a/ops/work/web/app.py b/ops/work/web/app.py index f1714b0..ad9e1b2 100644 --- a/ops/work/web/app.py +++ b/ops/work/web/app.py @@ -977,11 +977,23 @@ def analog_search(query, domain="vcs"): if d.get("sales_scope") == "alternative": s += 5 why.append("alternative vendor") + gaps = [] + if target is not None: + tp = {str(x).upper() for x in (target.get("protocols") or [])} + cp = prot + if tp - cp: + gaps.append("нет протоколов: " + ", ".join(sorted(tp - cp))) + tf = {str(x).lower() for x in _features(target)} + cf = feats + if tf - cf: + gaps.append("нет функций: " + ", ".join(sorted(tf - cf))[:120]) + if target.get("form_factor") and d.get("form_factor") != target.get("form_factor"): + gaps.append("другой форм-фактор") cand.append({"name": _dev_name(d), "vendor": d.get("vendor"), "domain": d.get("domain"), "solution_class": d.get("solution_class"), "sales_scope": d.get("sales_scope"), "protocols": d.get("protocols") or [], - "score": s, "why": why}) + "score": s, "why": why, "gaps": gaps}) cand.sort(key=lambda x: (-x["score"], x["vendor"] or "", x["name"])) # если фильтр по протоколу/фиче дал 0 — не врём, а сообщаем о нехватке данных if parsed["protocols"] and not any("protocol match" in x["why"] for x in cand): @@ -999,6 +1011,183 @@ def analog_search(query, domain="vcs"): +def _key(d): + return d.get("id") or norm(_dev_name(d)) + + +def _features(d): + """features из записи + глобального индекса (для Yealink).""" + fs = set(str(x) for x in (d.get("features") or [])) + fs.update(D.feats.get(norm(_dev_name(d)), set())) + return sorted(fs) + + +def search_catalog(params): + q = (params.get("q", [""])[0] or "").strip() + vendor = (params.get("vendor", [""])[0] or "all").lower() + domain = (params.get("domain", [""])[0] or "all").lower() + cls = (params.get("class", [""])[0] or "").strip() + role = (params.get("role", [""])[0] or "").strip() + protocol = (params.get("protocol", [""])[0] or "").strip().upper() + feature = (params.get("feature", [""])[0] or "").strip() + low = q.lower() + interpreted = [] + if not cls: + if "бар" in low or "bar" in low: + cls = "vcs.bar.room" if "компакт" not in low else "vcs.bar.compact" + interpreted.append("класс: бар") + elif "камер" in low: + cls = "vcs.camera.usb" + interpreted.append("класс: камера") + elif "терминал" in low or "кодек" in low: + cls = "vcs.terminal.room" + interpreted.append("класс: терминал") + elif "byod" in low: + interpreted.append("контекст: BYOD") + if not protocol and "sip" in low: + protocol = "SIP" + interpreted.append("протокол: SIP") + if "h.323" in low or "h323" in low: + protocol = "H.323" + interpreted.append("протокол: H.323") + if not feature and "4k" in low: + feature = "4K" + interpreted.append("4K") + + items = [] + target_hit = find_device(q) if q else None + apply_text = bool(low) and (target_hit is not None or not interpreted) + for d in D.analog_devices: + if vendor not in ("", "all") and d.get("vendor") != vendor: + continue + if domain not in ("", "all") and d.get("domain") != domain: + continue + if cls and d.get("solution_class") != cls: + continue + if role and d.get("role") != role: + continue + prot = [str(x).upper() for x in (d.get("protocols") or [])] + fs = _features(d) + text = " ".join([_dev_name(d), str(d.get("vendor")), str(d.get("solution_class")), + str(d.get("role")), " ".join(prot), " ".join(fs), + " ".join(str(x) for x in (d.get("aliases") or []))]).lower() + if apply_text and low not in text: + continue + items.append(d) + + note = "" + # протокол/4K — мягкие фильтры: если подтверждённых данных нет, + # не обнуляем выдачу, а показываем кандидатов и предупреждение + if protocol: + strict = [d for d in items if protocol in [str(x).upper() for x in (d.get("protocols") or [])]] + if strict: + items = strict + else: + note = "нет подтверждённых %s — фильтр не применён" % protocol + if feature: + strict = [d for d in items if any(feature.lower() in str(x).lower() for x in _features(d))] + if strict: + items = strict + else: + note = (note + "; " if note else "") + "нет подтверждённых %s — фильтр не применён" % feature + + fv, fd, fc, fp = {}, {}, {}, {} + for d in items: + fv[d.get("vendor")] = fv.get(d.get("vendor"), 0) + 1 + fd[d.get("domain")] = fd.get(d.get("domain"), 0) + 1 + fc[d.get("solution_class")] = fc.get(d.get("solution_class"), 0) + 1 + for p in (d.get("protocols") or []): + fp[str(p).upper()] = fp.get(str(p).upper(), 0) + 1 + + items.sort(key=lambda d: ((d.get("vendor") or ""), (d.get("solution_class") or ""), _dev_name(d))) + out = [{"key": _key(d), "name": _dev_name(d), "vendor": d.get("vendor"), + "domain": d.get("domain"), "solution_class": d.get("solution_class"), + "role": d.get("role"), "form_factor": d.get("form_factor"), + "protocols": d.get("protocols") or [], "sales_scope": d.get("sales_scope"), + "deployment": d.get("deployment"), "features": _features(d)[:8]} + for d in items[:100]] + return {"query": q, "vendor": vendor, "domain": domain, + "interpreted": interpreted, "total": len(items), "items": out, + "facets": {"vendors": fv, "domains": fd, "classes": fc, "protocols": fp}, + "note": note} + + +def find_device(key): + k = (key or "").strip().lower() + for d in D.analog_devices: + if k in (_dev_name(d).lower(), str(d.get("id") or "").lower()): + return d + if any(k == str(a).lower() for a in (d.get("aliases") or [])): + return d + for d in D.analog_devices: + if k and k in _dev_name(d).lower(): + return d + return None + + +def product_info(key): + d = find_device(key) + if not d: + return {"error": "not_found", "key": key} + return {"product": {"key": _key(d), "name": _dev_name(d), "vendor": d.get("vendor"), + "domain": d.get("domain"), "solution_class": d.get("solution_class"), + "role": d.get("role"), "form_factor": d.get("form_factor"), + "protocols": d.get("protocols") or [], "sales_scope": d.get("sales_scope"), + "deployment": d.get("deployment"), "components": d.get("components") or [], + "features": _features(d), + "attributes": D.attrs.get(norm(_dev_name(d)), {})}, + "analogs": analog_search(_dev_name(d), d.get("domain") or "vcs")} + + +def room_roles(): + return {"roles": [ + {"id": "terminal", "name": "Терминал / ПК", "roles": ["codec", "pc", "kit"], "required": True}, + {"id": "camera", "name": "Камера", "roles": ["camera"], "required": False}, + {"id": "audio", "name": "Аудио", "roles": ["audio", "speaker"], "required": False}, + {"id": "touch", "name": "Панель", "roles": ["touch"], "required": False}, + {"id": "display", "name": "Дисплей", "roles": ["display"], "required": False}, + {"id": "mount", "name": "Крепление", "roles": ["mount"], "required": False}, + ]} + + +def compose_room(payload): + seats = int(payload.get("seats") or 8) + roles = payload.get("roles") or {} + expected = {"terminal": ("codec", "pc", "kit"), "camera": ("camera",), + "audio": ("audio", "speaker"), "touch": ("touch",), + "display": ("display",), "mount": ("mount",)} + items, warnings, seen = [], [], set() + for rid, model in roles.items(): + if not model: + continue + d = find_device(model) + if not d: + warnings.append({"level": "warning", "text": "не найдено: %s" % model}) + continue + if d.get("domain") != "vcs": + warnings.append({"level": "blocker", "text": "%s не из VCS — нельзя в комнату" % _dev_name(d)}) + continue + if rid in expected and d.get("role") not in expected[rid]: + warnings.append({"level": "warning", "text": "%s не подходит на роль %s" % (_dev_name(d), rid)}) + k = _key(d) + if k in seen: + continue + seen.add(k) + items.append({"role": rid, "key": k, "name": _dev_name(d), "vendor": d.get("vendor"), + "solution_class": d.get("solution_class"), "form_factor": d.get("form_factor")}) + terminal = next((x for x in items if x["role"] == "terminal"), None) + if not terminal: + warnings.append({"level": "blocker", "text": "нет терминала/ПК"}) + deployment = "native_vcs" + if terminal: + d = find_device(terminal["key"]) + if d and (d.get("role") == "pc" or d.get("solution_class") == "vcs.byod.kit" or d.get("deployment") == "byod"): + deployment = "byod" + return {"seats": seats, "deployment": deployment, "items": items, + "warnings": warnings, "ready": not any(w["level"] == "blocker" for w in warnings), + "note": "Это компоновка и проверка ролей; совместимость портов проверяется в классическом конструкторе."} + + def _ensure_dir(): os.makedirs(PROJECTS_DIR, exist_ok=True) @@ -1058,7 +1247,12 @@ class H(BaseHTTPRequestHandler): u = urllib.parse.urlparse(self.path) q = urllib.parse.parse_qs(u.query) p = u.path - if p == "/": + if p in ("/", "/studio"): + f = os.path.join(os.path.dirname(__file__), "studio.html") + if not os.path.exists(f): + f = os.path.join(os.path.dirname(__file__), "index.html") + return self._out(open(f, encoding="utf-8").read().encode(), ctype="text/html; charset=utf-8") + if p == "/classic": f = os.path.join(os.path.dirname(__file__), "index.html") return self._out(open(f, encoding="utf-8").read().encode(), ctype="text/html; charset=utf-8") if p in ("/health", "/api/health"): @@ -1080,6 +1274,12 @@ class H(BaseHTTPRequestHandler): if v == "yealink": return self._out(D.cat) return self._out(load_yaml("catalog-%s.yaml" % v)) + if p == "/api/search": + return self._out(search_catalog(q)) + if p == "/api/product": + return self._out(product_info(q.get("key", [""])[0])) + if p == "/api/room-roles": + return self._out(room_roles()) if p == "/api/hosts": return self._out(D.hosts()) if p == "/api/requirements": @@ -1146,6 +1346,13 @@ class H(BaseHTTPRequestHandler): def do_POST(self): u = urllib.parse.urlparse(self.path) + if u.path == "/api/room": + try: + n = int(self.headers.get("Content-Length") or 0) + payload = json.loads(self.rfile.read(n).decode() or "{}") + except Exception as e: + return self._out({"error": "bad json: %s" % e}, 400) + return self._out(compose_room(payload)) if u.path == "/api/save": try: n = int(self.headers.get("Content-Length") or 0) diff --git a/ops/work/web/studio.html b/ops/work/web/studio.html new file mode 100644 index 0000000..ef5a6a8 --- /dev/null +++ b/ops/work/web/studio.html @@ -0,0 +1,204 @@ + + + + + +Buryan Prism — AV solution studio + + + +
+
◈ Buryan Prismvendor-agnostic AV solution studio
+ +
+ + +
+
+ + +
+
+

Сборка комнаты

+
Роли, а не SKU. Выберите терминал/ПК и периферию; проверка домена и ролей.
+
+
+
BYOD: ПК + камера. Native: кодеки/бары с интегрированным терминалом. Порты проверяются в классическом конструкторе.
+
+
+
+ +
+

Ветки вендоров

Равноправные ветки. Выбор открывает поиск с фильтром вендора.
+
+
+ + +