zames_pro 2.82.140 → 2.82.142

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 (56) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +68 -42
  3. package/SECURITY.md +6 -3
  4. package/dist/attachments.js +4 -7
  5. package/dist/backlog.js +2 -2
  6. package/dist/browser-pure.js +2 -2
  7. package/dist/browser.js +8 -2
  8. package/dist/commands.js +7 -3
  9. package/dist/compact.js +7 -2
  10. package/dist/config.js +1 -1
  11. package/dist/context.js +27 -9
  12. package/dist/glm-browser.js +1 -1
  13. package/dist/glm-net-capture.js +1 -1
  14. package/dist/glm-ui.js +0 -20
  15. package/dist/hooks.js +1 -1
  16. package/dist/i18n/common.js +16 -11
  17. package/dist/i18n/config.js +2 -2
  18. package/dist/i18n/deepseek.js +2 -2
  19. package/dist/i18n/doctor.js +9 -5
  20. package/dist/i18n/glm.js +2 -2
  21. package/dist/i18n/help.js +126 -117
  22. package/dist/i18n/mcp.js +11 -5
  23. package/dist/i18n/prompt.js +9 -3
  24. package/dist/i18n/qwen.js +2 -2
  25. package/dist/i18n/self-review.js +4 -0
  26. package/dist/i18n/spinner.js +13 -8
  27. package/dist/index.js +8 -5
  28. package/dist/mcp.js +6 -3
  29. package/dist/prompt.js +16 -1
  30. package/dist/qwen-browser.js +1 -1
  31. package/dist/qwen-ui.js +0 -2
  32. package/dist/run-task.js +1 -1
  33. package/dist/scheduler.js +1 -1
  34. package/dist/sessions.js +1 -1
  35. package/dist/spinner.js +1 -1
  36. package/dist/status-command.js +6 -2
  37. package/dist/statusline.js +2 -2
  38. package/dist/subagent.js +3 -3
  39. package/dist/system-prompt.js +9 -1
  40. package/dist/tui/AskQuestion.js +1 -1
  41. package/dist/tui/FullScreenApp.js +4 -15
  42. package/dist/tui/LogView.js +1 -1
  43. package/dist/tui/TuiEditor.js +7 -0
  44. package/dist/tui/edit.js +1 -1
  45. package/dist/tui/layout.js +1 -1
  46. package/dist/tui/widgets.js +1 -25
  47. package/dist/web.js +1 -1
  48. package/dist/width.js +1 -1
  49. package/llms-full.txt +35 -22
  50. package/llms.txt +4 -2
  51. package/package.json +2 -2
  52. package/skills/systematic-debugging/SKILL.md +7 -0
  53. package/skills/test-driven-development/SKILL.md +5 -0
  54. package/skills/verification-before-completion/SKILL.md +5 -0
  55. package/skills/writing-plans/SKILL.md +12 -0
  56. package/dist/code-blocks.js +0 -54
@@ -224,7 +224,7 @@ export function extractTokenUsage(body) {
224
224
  return null;
225
225
  }
226
226
  /** True when a chunk marks the end of the stream (`done: true`). */
227
- export function isDoneChunk(obj) {
227
+ function isDoneChunk(obj) {
228
228
  const d = completionData(obj);
229
229
  if (!d)
230
230
  return false;
package/dist/glm-ui.js CHANGED
@@ -49,8 +49,6 @@ export function chatHistoryUrl(chatId) {
49
49
  }
50
50
  /** GET - the current user (or guest) record. */
51
51
  export const AUTH_URL = 'https://chat.z.ai/api/v1/auths/';
52
- /** POST - creates a chat and returns { id }. */
53
- export const NEW_CHAT_URL = 'https://chat.z.ai/api/v1/chats/new';
54
52
  /** POST - the SSE completion endpoint (the answer stream). */
55
53
  export const ANSWER_URL_RE = /\/api\/v2\/chat\/completions/i;
56
54
  // ---------- input ----------
@@ -142,30 +140,12 @@ export function glmContextWindow(model) {
142
140
  return null;
143
141
  }
144
142
  // ---------- service statuses / errors ----------
145
- // A placeholder that must never be taken for an answer.
146
- export const STATUS_RE = /^(thinking|generating|thinking\s+process|thought\s+process)[\s.…]*$/i;
147
- // z.ai's captcha gate (an Aliyun slider). Visible text on the modal.
148
- export const CAPTCHA_RE = /security verification|drag the slider/i;
149
- export const CAPTCHA_SELECTORS = [
150
- '.aliyun-captcha',
151
- '[class*="aliyunCaptcha"]',
152
- '[id*="aliyunCaptcha"]',
153
- ];
154
143
  // Rate limit / busy notices. Kept NARROW: the classifier additionally requires
155
144
  // an error payload or an answer-less body (same rule as qwen-net-capture.ts),
156
145
  // so a normal answer that merely mentions "try again" is not mistaken for a
157
146
  // limit.
158
147
  export const RATE_LIMIT_RE = /too many requests|rate limit|too frequent|please try again later|слишком часто/i;
159
148
  export const SERVER_BUSY_RE = /server is busy|service unavailable|try again later|high demand/i;
160
- export const GUEST_LIMIT_RE = /guest.*limit|log ?in to continue|sign ?in to continue|гостевой лимит/i;
161
- // ---------- mode flags ----------
162
- // The completion body carries the mode flags. `preview_mode` and the
163
- // `general_agent` flag change the ANSWER FORMAT (they enable z.ai's own agent
164
- // runtime, which emits its own tool calls), and that would break the zames
165
- // tool-call protocol. The request body is rewritten before the send and then
166
- // verified (glm-browser's _installRuntimeRewrite/_verifyModes + glm-flags).
167
- export const SAFE_PREVIEW_MODE = false;
168
- export const SAFE_ENABLE_THINKING = true;
169
149
  // ---------- attachments ----------
170
150
  // The observed upload control (a real filechooser on click).
171
151
  export const UPLOAD_BUTTON_SELECTOR = '#upload-file-button, button[class*="upload"]';
package/dist/hooks.js CHANGED
@@ -31,7 +31,7 @@ function cutHookText(s, max) {
31
31
  cut--;
32
32
  return s.slice(0, cut);
33
33
  }
34
- export function hooksConfigPath(workdir) {
34
+ function hooksConfigPath(workdir) {
35
35
  return path.join(workdir, '.zames', 'hooks.json');
36
36
  }
37
37
  /**
@@ -15,7 +15,6 @@ export const commonMessages = {
15
15
  en: 'Working directory: {v}',
16
16
  },
17
17
  'status.review_mode': { ru: 'Режим ревью: {v}', en: 'Review mode: {v}' },
18
- 'status.review_none': { ru: 'нет', en: 'no' },
19
18
  'status.orig_dir': {
20
19
  ru: 'Исходная директория: {v}',
21
20
  en: 'Original directory: {v}',
@@ -29,19 +28,19 @@ export const commonMessages = {
29
28
  ru: 'System prompt на след. задаче: {v}',
30
29
  en: 'System prompt next task: {v}',
31
30
  },
32
- 'status.last_chat': { ru: 'Last chat: {v}', en: 'Last chat: {v}' },
31
+ 'status.last_chat': { ru: 'Последний чат: {v}', en: 'Last chat: {v}' },
33
32
  'status.sessions': { ru: 'Сессии: {v}', en: 'Sessions: {v}' },
34
33
  'status.dev': {
35
- ru: 'Dev mode (auto-reload): {v}',
34
+ ru: 'Режим разработки (авто-перечитывание): {v}',
36
35
  en: 'Dev mode (auto-reload): {v}',
37
36
  },
38
37
  'status.max_iter': {
39
38
  ru: 'Лимит итераций: {v} (0 = без лимита)',
40
39
  en: 'Iteration limit: {v} (0 = unlimited)',
41
40
  },
42
- 'status.headless': { ru: 'Headless: {v}', en: 'Headless: {v}' },
43
- 'status.debug': { ru: 'Debug: {v}', en: 'Debug: {v}' },
44
- 'status.undo': { ru: 'Undo: {v}', en: 'Undo: {v}' },
41
+ 'status.headless': { ru: 'Без окна (headless): {v}', en: 'Headless: {v}' },
42
+ 'status.debug': { ru: 'Отладка: {v}', en: 'Debug: {v}' },
43
+ 'status.undo': { ru: 'Откат (undo): {v}', en: 'Undo: {v}' },
45
44
  'status.checkpoint': { ru: 'Чекпойнты: {v}', en: 'Checkpoints: {v}' },
46
45
  'status.transcript': { ru: 'Транскрипт: {v}', en: 'Transcript: {v}' },
47
46
  'status.locale': { ru: 'Язык: {v}', en: 'Language: {v}' },
@@ -109,8 +108,8 @@ export const commonMessages = {
109
108
  en: 'The sign-in did not carry over to headless — staying in the visible window (it can be minimised).',
110
109
  },
111
110
  'msg.first_hint': {
112
- ru: 'Подсказка: «/» — список команд, Ctrl+R — поиск по истории, картинку можно вставить через Ctrl+Shift+V.',
113
- en: 'Hint: "/" lists commands, Ctrl+R searches history, paste an image with Ctrl+Shift+V.',
111
+ ru: 'Подсказка: «/» — список команд, Ctrl+R — поиск по истории, картинку можно вставить через Ctrl+V (пустая вставка).',
112
+ en: 'Hint: "/" lists commands, Ctrl+R searches history, paste an image with Ctrl+V (or an empty paste).',
114
113
  },
115
114
  'msg.queue_hint': {
116
115
  ru: 'Пока агент работает, можно печатать следующее сообщение — оно уйдёт в очередь (Enter — отправить, Esc — прервать).',
@@ -143,9 +142,15 @@ export const commonMessages = {
143
142
  'askuser.your_answer': { ru: 'Ваш ответ:', en: 'Your answer:' },
144
143
  'askuser.hint_select': { ru: 'выбор', en: 'select' },
145
144
  'askuser.hint_ok': { ru: 'ок', en: 'ok' },
146
- 'askuser.hint_dismiss': { ru: 'закрыть', en: 'dismiss' },
145
+ // Not 'dismiss': Esc in the option list returns NOTHING, so the model gets
146
+ // no answer at all -- the same outcome as Esc while typing the own answer.
147
+ 'askuser.hint_dismiss': { ru: 'без ответа', en: 'no answer' },
147
148
  'askuser.hint_send': { ru: 'отправить', en: 'send' },
148
149
  'askuser.hint_cancel': { ru: 'отмена', en: 'cancel' },
150
+ 'askuser.enter_send': {
151
+ ru: 'Enter — отправить ответ (многострочный — через вставку)',
152
+ en: 'Enter sends the answer (multi-line: paste it)',
153
+ },
149
154
  'confirm.yes': { ru: 'Да', en: 'Yes' },
150
155
  'confirm.no': { ru: 'Нет', en: 'No' },
151
156
  'perm.ask_sub': {
@@ -209,8 +214,8 @@ export const commonMessages = {
209
214
  en: '⚠ No image found in the clipboard (tried: {via}).',
210
215
  },
211
216
  'msg.clip_hint': {
212
- ru: ' Проще всего: вставьте путь к файлу (например tmp/pic.png) — файл приложится к сообщению. Для клипборда нужна утилита (Linux/X11 — xclip или xsel, Wayland — wl-clipboard; Windows — PowerShell, macOS — pngpaste).',
213
- en: ' Easiest: paste a path to a file (e.g. tmp/pic.png) — it will be attached to the message. Clipboard paste needs a tool (Linux/X11 — xclip or xsel, Wayland — wl-clipboard; Windows — PowerShell, macOS — pngpaste).',
217
+ ru: ' Проще всего: вставьте путь к файлу (например tmp/pic.png) — файл приложится к сообщению. Для клипборда нужна утилита: Linux/X11 — xclip или xsel, Wayland — wl-paste (пакет wl-clipboard), Windows — powershell.exe, macOS — pngpaste.',
218
+ en: ' Easiest: paste a path to a file (e.g. tmp/pic.png) — it will be attached to the message. Clipboard paste needs a tool: Linux/X11 — xclip or xsel, Wayland — wl-paste (the wl-clipboard package), Windows — powershell.exe, macOS — pngpaste.',
214
219
  },
215
220
  'msg.clip_container': {
216
221
  ru: ' Похоже, вы в контейнере/Dev Container: клипборд Windows отсюда недоступен. Вставьте путь к файлу (например tmp/pic.png) — он приложится к сообщению.',
@@ -68,8 +68,8 @@ export const configMessages = {
68
68
  en: 'Full-screen TUI mode (alternate screen)',
69
69
  },
70
70
  'cfg.f.ui_mouseScroll': {
71
- ru: 'Колесо: лог или терминал (выкл = выделение без Shift)',
72
- en: 'Wheel: log or terminal (off = select without Shift)',
71
+ ru: 'Колесо мыши: вкл (по умолчанию) — скроллит диалог, выделение через Shift; выкл — мышью владеет терминал (обычное выделение, колесо инертно)',
72
+ en: 'Mouse wheel: on (default) — scrolls the dialog, select with Shift; off — the terminal owns the mouse (normal selection, wheel inert)',
73
73
  },
74
74
  'cfg.f.maxIterations': {
75
75
  ru: 'Лимит итераций на задачу',
@@ -77,8 +77,8 @@ export const deepseekMessages = {
77
77
  en: '✖ Could not paste the whole text into the input ({got} of {want} chars). The message was not sent to avoid sending a truncated text. Retry or split the message.',
78
78
  },
79
79
  'ds.send_no_start': {
80
- ru: '✖ Ответ не начал генерироваться за 35с даже после повторной отправки. Проверь чат {provider} вручную (возможно, кнопка отправки не нажимается или сессия разлогинилась).',
81
- en: '✖ The answer did not start generating within 35s even after resending. Check the {provider} chat manually (the send button may not be clickable or the session may have expired).',
80
+ ru: '✖ Ответ не начал генерироваться примерно за 50с (30с + 20с после повторного Enter). Проверь чат {provider} вручную (возможно, кнопка отправки не нажимается или сессия разлогинилась).',
81
+ en: '✖ The answer did not start generating within about 50s (30s + 20s after a second Enter). Check the {provider} chat manually (the send button may not be clickable or the session may have expired).',
82
82
  },
83
83
  'ds.send_no_new_answer': {
84
84
  ru: '✖ Новый ответ не получен — на странице остался прежний текст. Возможно, сообщение не отправилось. Проверь чат {provider} вручную.',
@@ -6,13 +6,18 @@ export const doctorMessages = {
6
6
  'doctor.not_repo': { ru: 'не репозиторий', en: 'not a repository' },
7
7
  'doctor.loaded': { ru: 'загружен', en: 'loaded' },
8
8
  'doctor.error': { ru: 'ошибка: {v}', en: 'error: {v}' },
9
- 'doctor.unknown': { ru: 'неизвестно', en: 'unknown' },
10
9
  'doctor.bundled': { ru: 'встроенный chromium', en: 'bundled chromium' },
11
10
  'doctor.auth_saved': {
12
- ru: 'сессия сохранена (авто-вход готов)',
13
- en: 'session saved (auto re-login ready)',
11
+ ru: 'сессия сохранена — авто-вход готов',
12
+ en: 'session saved — auto re-login ready',
13
+ },
14
+ // Says what the row checks: the per-provider marker written AFTER a sign-in.
15
+ // A profile with a live cookie but no marker also lands here, so "no saved
16
+ // session" would be wrong (and the fix is to open the chat, not to sign in).
17
+ 'doctor.auth_none': {
18
+ ru: 'нет отметки о входе (отметка пишется после входа этого провайдера)',
19
+ en: 'no sign-in marker (written after this provider signs in)',
14
20
  },
15
- 'doctor.auth_none': { ru: 'нет сохранённой сессии', en: 'no saved session' },
16
21
  'doctor.clipboard_none': {
17
22
  ru: 'инструмент не найден (вставка картинок отключена)',
18
23
  en: 'no tool found (image paste disabled)',
@@ -110,7 +115,6 @@ export const doctorMessages = {
110
115
  ru: 'Перезагружено модулей: {n}. Браузер и чат не тронуты.',
111
116
  en: 'Modules reloaded: {n}. Browser and chat untouched.',
112
117
  },
113
- 'msg.not_dir': { ru: 'Не директория: {v}', en: 'Not a directory: {v}' },
114
118
  'prompt.review': { ru: 'REVIEW', en: 'REVIEW' },
115
119
  'msg.workdir_error': {
116
120
  ru: 'Не удалось определить рабочую директорию:',
package/dist/i18n/glm.js CHANGED
@@ -4,8 +4,8 @@
4
4
  // `model.*` / `provider.*` keys live in i18n/help.ts and i18n/qwen.ts.
5
5
  export const glmMessages = {
6
6
  'glm.guest_mode': {
7
- ru: 'GLM: вход не выполнен, работаю гостем (сообщения может блокировать капча). Войдите через /provider login или запустите с --headed.',
8
- en: 'GLM: not signed in, running as a guest (a captcha may block messages). Log in via /provider login or launch with --headed.',
7
+ ru: '✖ GLM: гостевой лимит z.ai исчерпан (без входа доступно лишь несколько сообщений), сообщение не отправлено. Войдите через /provider login или запустите с --headed.',
8
+ en: '✖ GLM: the z.ai guest limit is exhausted (a signed-out visitor gets only a few messages), the message was not sent. Log in via /provider login or launch with --headed.',
9
9
  },
10
10
  'glm.login_ok': {
11
11
  ru: 'GLM: вход выполнен.',