Опубликовано через кнопку

This commit is contained in:
dauren 2026-07-14 11:10:29 +00:00
parent 1f88a8a004
commit 4cf03fc03d
3 changed files with 45 additions and 70 deletions

View File

@ -509,3 +509,19 @@ data: {"id": "1784023698885_p6wj", "type": "tool_result", "content": "", "role":
**Предложенный вариант:**
- Код: **100079763**
Запрос: "стол"
--- Сырой SSE (112496 байт) ---
data: {"id": "1784023794765_eoet", "role": "user", "type": "text", "content": "Найди код ОКТРУ для товара: стол. Ответь кратко — только код и название позиции.", "detail": {}, "timestamp": 1784023794789, "session_id": "5574c8ee9bfe4c04"}
data: {"id": "1784023796346_yrro", "type": "text", "content": "\n\n", "role": "assistant", "detail": {"streaming": true, "run_id": "019f601a-c874-77c1-8a19-c102cae9063c"}, "timestamp": 1784023796346, "session_id": "5574c8ee9bfe4c04", "task_id": "5574c8ee9bfe4c04_795682", "field_name": null}
data: {"id": "1784023796740_d923", "type": "message_result", "content": "", "role": "assistant", "detail": {"run_id": "019f601a-c874-77c1-8a19-c102cae9063c", "full_content": "", "tool_calls": [{"name": "read_file", "args": {"path": "/workspace/.claude/skills/ff31e6aafcf74f3b/SKILL.md"}, "id": "call_0eebb7c9bb544448a3ac4f38", "type": "tool_call"}]}, "timestamp": 1784023796740, "session_id": "5574c8ee9bfe4c04", "task_id": "5574c8ee9bfe4c04_795682", "field_name": null}
data: {"id": "1784023802822_7ur3", "type": "tool_call", "content": "", "role": "assistant", "detail": {"run_id": "019f601a-e3c5-7b31-ac44-a8998d776b02", "tool": "read_file", "status": "pending", "param": {"path": "/workspace/.claude/skills/ff31e6aafcf74f3b/SKILL.md"}, "action": "Reading file", "action_content": "/workspace/.claude/skills/ff31e6aafcf74f3b/SKILL.m..."}, "timestamp": 1784023802822, "session_id": "5574c8ee9bfe4c04", "task_id": "5574c8ee9bfe4c04_795682", "field_name": null}
data: {"id": "1784023802887_tv2v", "type": "tool_result", "content": "", "role": "assistant", "detail": {"run_id": "019f601a-e3c5-7b31-ac44-a8998d776b02", "tool": "read_file", "result": {"content": "---\nname: oktru-code-enrichment\ndescription: \u041e\u0431\u043e\u0433\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043b\u0430\u043d\u0430 \u0437\u0430\u043a\u0443\u043f\u043e\u043a \u043a\u043e\u0434\u043e\u043c \u041e\u041a\u0422\u0420\u0423 \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u041d\u041a\u0422, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.\n---\n\n# OKTRU Code Enrichment\n\n\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u044d\u0442\u043e\u0442 \u043d\u0430\u0432\u044b\u043a, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0437\u0430\u043a\u0443\u043f\u043e\u043a \u043d\u0435\u0442 \u043a\u043e\u0434\u0430 \u041e\u041a\u0422\u0420\u0423 \u0438\u043b\u0438 \u043a\u043e\u0434 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044e \u0422\u0420\u0423 \u0438 \u0445\u0
Ответ: **Статус:** needs_review (требуется проверка)
**Причина:** Наименование "стол" слишком общее. Справочник НКТ вернул несколько вариантов с низкой уверенностью (0.74), в основном медицинские столы.
**

View File

@ -1,4 +1,4 @@
<!-- vibe42-agents-version: v24-alem-open-api-2026-07-14 -->
<!-- vibe42-agents-version: v25-backend-static-warning-2026-07-14 -->
# Vibe42 — учебная песочница: сайты, боты и первые приложения
Workspace юзера `dauren`. Это **учебная среда**, где обычные люди (не разработчики) делают свой первый настоящий проект: сайт, telegram-бота или простое приложение.
@ -278,6 +278,13 @@ git push origin HEAD:pages
## 🔧 Когда что-то идёт не так
- **Pages 404** → запушь ветку `pages` снова: `git push origin HEAD:pages -f`
### ⚠️ Проекты с бэкендом (server.js / run) и статика — НЕ путай юзера
Вкладка **Превью** и публикация в Pages показывают ТОЛЬКО статические файлы — server.js там НЕ работает: формы method=POST и запросы к твоему серверу будут мертвы. Поэтому:
- Прежде чем переделывать работающий статический index.html на серверный рендер (форма POST, шаблоны из server.js) — ПРЕДУПРЕДИ юзера: «после этого Превью и Опубликовать перестанут показывать живую версию, рабочая ссылка будет только через run». Меняй только после его согласия.
- Если проект уже с бэкендом: держи index.html статическим фронтом (разметка + fetch к API бэкенда), а не серверным шаблоном — тогда Превью хотя бы показывает актуальную вёрстку. Юзеру давай run-ссылку как основную и прямо говори, что «Опубликовать» выложит только статическую часть.
- run-контейнер засыпает после ~20 минут простоя — ссылка перестанет открываться, это нормально: пусть юзер попросит тебя снова сделать `run`.
- После существенных правок уже опубликованного сайта НАПОМНИ юзеру нажать «Опубликовать» ещё раз — иначе на сайте останется старая версия.
- **Не дёргай Gitea API типа `/repos/.../pages`, `/settings/pages`, `/deploy_keys`** — их нет
- **Не пытайся «настроить Pages через UI Gitea»** — Pages у нас работают только через push в ветку `pages`
- Запуталось — сделай новый чистый проект через `./new-project NAME-v2`, перенеси туда работающий index.html

View File

@ -5,80 +5,32 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Поиск кода ОКТРУ</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f172a; color: #e2e8f0; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.card { background: #1e293b; border-radius: 16px; padding: 40px; width: 100%; max-width: 520px; box-shadow: 0 25px 50px rgba(0,0,0,.4); }
h1 { font-size: 22px; margin-bottom: 8px; color: #f8fafc; }
.subtitle { font-size: 14px; color: #94a3b8; margin-bottom: 28px; }
label { display: block; font-size: 14px; color: #cbd5e1; margin-bottom: 8px; }
input[type="text"] { width: 100%; padding: 14px 16px; border-radius: 10px; border: 2px solid #334155; background: #0f172a; color: #f1f5f9; font-size: 15px; outline: none; transition: border-color .2s; }
input[type="text"]:focus { border-color: #3b82f6; }
button { width: 100%; padding: 14px; border: none; border-radius: 10px; background: #2563eb; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 16px; transition: background .2s; }
button:hover { background: #1d4ed8; }
button:disabled { background: #475569; cursor: not-allowed; }
.result { margin-top: 20px; padding: 18px; border-radius: 10px; display: none; line-height: 1.6; font-size: 14px; white-space: pre-wrap; }
.result.ok { display: block; background: #064e3b; border: 1px solid #059669; color: #d1fae5; }
.result.err { display: block; background: #450a0a; border: 1px solid #dc2626; color: #fecaca; }
.loading { text-align: center; margin-top: 16px; color: #94a3b8; font-size: 13px; display: none; }
.loading.show { display: block; }
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#0f172a;color:#e2e8f0;min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.card{background:#1e293b;border-radius:16px;padding:40px;width:100%;max-width:520px;box-shadow:0 25px 50px rgba(0,0,0,.4)}
h1{font-size:22px;margin-bottom:8px;color:#f8fafc}
.sub{font-size:14px;color:#94a3b8;margin-bottom:28px}
label{display:block;font-size:14px;color:#cbd5e1;margin-bottom:8px}
input[type=text]{width:100%;padding:14px 16px;border-radius:10px;border:2px solid #334155;background:#0f172a;color:#f1f5f9;font-size:15px;outline:none;transition:border-color .2s}
input[type=text]:focus{border-color:#3b82f6}
button{width:100%;padding:14px;border:none;border-radius:10px;background:#2563eb;color:#fff;font-size:15px;font-weight:600;cursor:pointer;margin-top:16px;transition:background .2s}
button:hover{background:#1d4ed8}
.log{margin-top:16px;padding:12px;border-radius:8px;font-size:12px;color:#94a3b8;background:#0f172a;font-family:monospace;white-space:pre-wrap;line-height:1.5;max-height:200px;overflow-y:auto;display:none}
.log.show{display:block}
.res{margin-top:20px;padding:18px;border-radius:10px;line-height:1.6;font-size:14px;white-space:pre-wrap}
.ok{background:#064e3b;border:1px solid #059669;color:#d1fae5}
.err{background:#450a0a;border:1px solid #dc2626;color:#fecaca}
</style>
</head>
<body>
<div class="card">
<h1>🔍 Поиск кода ОКТРУ</h1>
<p class="subtitle">Введите название товара — агент найдёт подходящий код</p>
<label for="q">Название товара</label>
<input type="text" id="q" placeholder='Например: ноутбук Dell' autocomplete="off">
<button id="btn" onclick="check()">Проверить</button>
<div id="loading" class="loading">⏱ Агент думает…</div>
<div id="res" class="result"></div>
<p class="sub">Введите название товара — агент найдёт подходящий код</p>
<form method="POST">
<label>Название товара</label>
<input type="text" name="q" placeholder='Например: ноутбук Dell' value="" autocomplete="off">
<button type="submit">Проверить</button>
</form>
</div>
<script>
function check() {
const q = document.getElementById('q').value.trim();
if (!q) return;
const btn = document.getElementById('btn');
const res = document.getElementById('res');
const loading = document.getElementById('loading');
btn.disabled = true;
loading.className = 'loading show';
res.className = 'result';
res.textContent = '';
const xhr = new XMLHttpRequest();
xhr.open('GET', '/api/check?q=' + encodeURIComponent(q), true);
xhr.onload = function() {
btn.disabled = false;
loading.className = 'loading';
try {
const data = JSON.parse(xhr.responseText);
if (data.ok) {
res.className = 'result ok';
res.textContent = data.answer;
} else {
res.className = 'result err';
res.textContent = data.error || 'Ошибка';
}
} catch {
res.className = 'result err';
res.textContent = 'Ошибка ответа сервера';
}
};
xhr.onerror = function() {
btn.disabled = false;
loading.className = 'loading';
res.className = 'result err';
res.textContent = 'Сетевая ошибка — попробуйте ещё раз';
};
xhr.send();
document.getElementById('q').addEventListener('keydown', e => { if (e.key === 'Enter') check(); });
</script>
</body>
</html>