@goodandready/dsh-cron 0.1.18 → 0.1.19

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/lib/client.js CHANGED
@@ -1201,8 +1201,12 @@ const React = window.React || require('react');
1201
1201
  container.setAttribute(VIEW_ATTR, '');
1202
1202
  container.setAttribute('data-dsh-plugin', 'cron');
1203
1203
  column.appendChild(container);
1204
- root = ReactDOM.createRoot(container);
1205
- root.render(React.createElement(CronScreen, { ctx, toggle, onClose: () => toggle.set(false) }));
1204
+ if (ReactDOM && typeof ReactDOM.createRoot === 'function') {
1205
+ root = ReactDOM.createRoot(container);
1206
+ root.render(React.createElement(CronScreen, { ctx, toggle, onClose: () => toggle.set(false) }));
1207
+ } else if (ReactDOM && typeof ReactDOM.render === 'function') {
1208
+ ReactDOM.render(React.createElement(CronScreen, { ctx, toggle, onClose: () => toggle.set(false) }), container);
1209
+ }
1206
1210
  };
1207
1211
 
1208
1212
  const applyActive = () => {
package/lib/index.js CHANGED
@@ -319,22 +319,30 @@ export function apply(ctx, config) {
319
319
  name: 'cron_create_task',
320
320
  description: 'Создать новую запланированную задачу cron (запуск по расписанию или разово через "at: ISO" или "in 20m")',
321
321
  parameters: {
322
- type: 'object',
323
- properties: {
324
- title: { type: 'string', description: 'Краткое название задачи' },
325
- schedule: { type: 'string', description: 'Расписание: cron ("0 9 * * *"), интервал ("every 2h") или разово ("in 30m", "at: 2026-09-05T15:00:00Z")' },
326
- prompt: { type: 'string', description: 'Промпт/инструкция для агента при запуске' },
327
- type: { type: 'string', enum: ['prompt', 'script'], description: 'Тип задачи' },
328
- delivery: { type: 'string', enum: ['current', 'isolated'], description: 'Режим запуска: current (в текущем чате) или isolated (изолированная сессия)' },
329
- provider: { type: 'string', description: 'Провайдер модели (опционально)' },
330
- model: { type: 'string', description: 'Модель (опционально)' },
331
- notifyTelegram: { type: 'boolean', description: 'Отправлять отчет в Telegram' },
332
- onlyOnFailure: { type: 'boolean', description: 'Отправлять отчет только при сбоях' },
333
- timeoutSeconds: { type: 'number', description: 'Лимит времени выполнения в секундах' },
334
- overlapPolicy: { type: 'string', enum: ['skip', 'queue', 'replace'], description: 'Политика перекрытия' },
335
- kanbanMode: { type: 'string', enum: ['none', 'on_failure', 'always'], description: 'Создавать карточку в Kanban' },
322
+ title: { type: 'string', description: 'Краткое название задачи', required: true },
323
+ schedule: { type: 'string', description: 'Расписание: cron ("0 9 * * *"), интервал ("every 2h") или разово ("in 30m", "at: 2026-09-05T15:00:00Z")', required: true },
324
+ prompt: { type: 'string', description: 'Промпт/инструкция для агента при запуске', required: true },
325
+ type: { type: 'string', enum: ['prompt', 'script'], description: 'Тип задачи' },
326
+ delivery: { type: 'string', enum: ['current', 'isolated'], description: 'Режим запуска: current (в текущем чате) или isolated (изолированная сессия)' },
327
+ provider: { type: 'string', description: 'Провайдер модели (опционально)' },
328
+ model: { type: 'string', description: 'Модель (опционально)' },
329
+ notifyTelegram: { type: 'boolean', description: 'Отправлять отчет в Telegram' },
330
+ onlyOnFailure: { type: 'boolean', description: 'Отправлять отчет только при сбоях' },
331
+ timeoutSeconds: { type: 'number', description: 'Лимит времени выполнения в секундах' },
332
+ overlapPolicy: { type: 'string', enum: ['skip', 'queue', 'replace'], description: 'Политика перекрытия' },
333
+ kanbanMode: { type: 'string', enum: ['none', 'on_failure', 'always'], description: 'Создавать карточку в Kanban' },
334
+ },
335
+ output: {
336
+ schema: {
337
+ type: 'object',
338
+ additionalProperties: true,
339
+ properties: {
340
+ success: { type: 'boolean' },
341
+ message: { type: 'string' },
342
+ task: { type: 'object', additionalProperties: true }
343
+ }
336
344
  },
337
- required: ['title', 'schedule', 'prompt']
345
+ render: (_args, val) => [{ type: 'text', text: val.message || JSON.stringify(val) }]
338
346
  },
339
347
  execute: async (args) => {
340
348
  const parsed = parseScheduleExpression(args.schedule);
@@ -368,10 +376,18 @@ export function apply(ctx, config) {
368
376
  name: 'cron_list_tasks',
369
377
  description: 'Получить список всех запланированных задач cron',
370
378
  parameters: {
371
- type: 'object',
372
- properties: {
373
- status: { type: 'string', enum: ['all', 'active', 'paused', 'completed'], description: 'Фильтр по статусу' }
374
- }
379
+ status: { type: 'string', enum: ['all', 'active', 'paused', 'completed'], description: 'Фильтр по статусу' }
380
+ },
381
+ output: {
382
+ schema: {
383
+ type: 'object',
384
+ additionalProperties: true,
385
+ properties: {
386
+ count: { type: 'number' },
387
+ tasks: { type: 'array', items: { type: 'object', additionalProperties: true } }
388
+ }
389
+ },
390
+ render: (_args, val) => [{ type: 'text', text: `Всего задач: ${val.count}` }]
375
391
  },
376
392
  execute: async (args) => {
377
393
  const tasks = store.list({ status: args.status || 'all' });
@@ -396,11 +412,18 @@ export function apply(ctx, config) {
396
412
  name: 'cron_pause_task',
397
413
  description: 'Приостановить выполнение задачи по её ID',
398
414
  parameters: {
399
- type: 'object',
400
- properties: {
401
- id: { type: 'string', description: 'Идентификатор задачи' }
415
+ id: { type: 'string', description: 'Идентификатор задачи', required: true }
416
+ },
417
+ output: {
418
+ schema: {
419
+ type: 'object',
420
+ additionalProperties: true,
421
+ properties: {
422
+ success: { type: 'boolean' },
423
+ message: { type: 'string' }
424
+ }
402
425
  },
403
- required: ['id']
426
+ render: (_args, val) => [{ type: 'text', text: val.message }]
404
427
  },
405
428
  execute: async (args) => {
406
429
  const task = scheduler.pauseTask(args.id);
@@ -413,11 +436,18 @@ export function apply(ctx, config) {
413
436
  name: 'cron_resume_task',
414
437
  description: 'Возобновить выполнение приостановленной задачи',
415
438
  parameters: {
416
- type: 'object',
417
- properties: {
418
- id: { type: 'string', description: 'Идентификатор задачи' }
439
+ id: { type: 'string', description: 'Идентификатор задачи', required: true }
440
+ },
441
+ output: {
442
+ schema: {
443
+ type: 'object',
444
+ additionalProperties: true,
445
+ properties: {
446
+ success: { type: 'boolean' },
447
+ message: { type: 'string' }
448
+ }
419
449
  },
420
- required: ['id']
450
+ render: (_args, val) => [{ type: 'text', text: val.message }]
421
451
  },
422
452
  execute: async (args) => {
423
453
  const task = scheduler.resumeTask(args.id);
@@ -430,11 +460,18 @@ export function apply(ctx, config) {
430
460
  name: 'cron_delete_task',
431
461
  description: 'Удалить задачу по её ID',
432
462
  parameters: {
433
- type: 'object',
434
- properties: {
435
- id: { type: 'string', description: 'Идентификатор задачи' }
463
+ id: { type: 'string', description: 'Идентификатор задачи', required: true }
464
+ },
465
+ output: {
466
+ schema: {
467
+ type: 'object',
468
+ additionalProperties: true,
469
+ properties: {
470
+ success: { type: 'boolean' },
471
+ message: { type: 'string' }
472
+ }
436
473
  },
437
- required: ['id']
474
+ render: (_args, val) => [{ type: 'text', text: val.message }]
438
475
  },
439
476
  execute: async (args) => {
440
477
  scheduler.pauseTask(args.id);
@@ -447,11 +484,18 @@ export function apply(ctx, config) {
447
484
  name: 'cron_run_task',
448
485
  description: 'Запустить задачу немедленно вне очереди',
449
486
  parameters: {
450
- type: 'object',
451
- properties: {
452
- id: { type: 'string', description: 'Идентификатор задачи' }
487
+ id: { type: 'string', description: 'Идентификатор задачи', required: true }
488
+ },
489
+ output: {
490
+ schema: {
491
+ type: 'object',
492
+ additionalProperties: true,
493
+ properties: {
494
+ success: { type: 'boolean' },
495
+ message: { type: 'string' }
496
+ }
453
497
  },
454
- required: ['id']
498
+ render: (_args, val) => [{ type: 'text', text: val.message }]
455
499
  },
456
500
  execute: async (args) => {
457
501
  const task = store.get(args.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-cron",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "Scheduled cron tasks, background automation and agent execution for DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",