zames_pro 2.39.0 → 2.40.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/dist/i18n.js CHANGED
@@ -237,6 +237,10 @@ const CATALOG = {
237
237
  ru: 'Использование: /cron "<мин> <час> <день> <мес> <день недели>" <задача>',
238
238
  en: 'Usage: /cron "<min> <hour> <dom> <month> <dow>" <task>',
239
239
  },
240
+ 'sched.loop_too_short': {
241
+ ru: 'Слишком часто: минимум {min} (троттлинг отправок 15с).',
242
+ en: 'Too frequent: minimum {min} (the send throttle is 15s).',
243
+ },
240
244
  'sched.added': {
241
245
  ru: '⏰ Задача #{id} добавлена ({when}): {task}',
242
246
  en: '⏰ Job #{id} added ({when}): {task}',
package/dist/index.js CHANGED
@@ -24,6 +24,10 @@ import { closeWeb } from './web.js';
24
24
  import { saveSession, loadLastSession, listSessions, sessionsDir, } from './sessions.js';
25
25
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
26
26
  const NL = String.fromCharCode(10);
27
+ // Floor for a /loop interval. A loop faster than the send throttle (15s)
28
+ // cannot do anything useful and would just hammer the rate limit, so we refuse
29
+ // it. It does NOT touch the throttle itself.
30
+ const MIN_LOOP_MS = 15_000;
27
31
  // True when a DeepSeek session/credentials were stored earlier (auth.json).
28
32
  // Used by /doctor to report that auto re-login is ready.
29
33
  function authMarkerExists() {
@@ -2387,6 +2391,15 @@ async function main() {
2387
2391
  console.error(theme.error(t('sched.loop_usage')));
2388
2392
  continue;
2389
2393
  }
2394
+ // A very short loop (e.g. "/loop 1s ...") would keep the agent sending
2395
+ // back-to-back and hit the rate limit. Enforce a floor; the send throttle
2396
+ // is 15s, so anything faster is pointless anyway.
2397
+ if (ms < MIN_LOOP_MS) {
2398
+ console.error(theme.error(t('sched.loop_too_short', {
2399
+ min: formatInterval(MIN_LOOP_MS),
2400
+ })));
2401
+ continue;
2402
+ }
2390
2403
  const job = scheduler.addLoop(ms, taskStr, Date.now());
2391
2404
  startScheduleTicker();
2392
2405
  console.log(theme.system(t('sched.added', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.39.0",
3
+ "version": "2.40.0",
4
4
  "description": "Terminal coding agent over chat.deepseek.com via Playwright",
5
5
  "type": "module",
6
6
  "bin": {