@goodandready/dsh-cron 0.2.26 → 0.2.27

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/chat-start.js CHANGED
@@ -44,7 +44,16 @@ export async function chatStartHandler(ctx, req, res, parseJsonBody, sendJson, r
44
44
  const model = body.model || defaultSel?.model;
45
45
 
46
46
  const cwd = process.cwd();
47
- const presets = ctx.agentPresets || ctx.get?.('agentPresets');
47
+ let presets = null;
48
+ try {
49
+ if (typeof ctx.get === 'function') {
50
+ presets = ctx.get('agentPresets');
51
+ } else {
52
+ presets = ctx.agentPresets;
53
+ }
54
+ } catch {
55
+ presets = null;
56
+ }
48
57
  let preset = null;
49
58
  if (presets && typeof presets.resolve === 'function') {
50
59
  try {
package/lib/runner.js CHANGED
@@ -329,9 +329,18 @@ export class SessionRunner {
329
329
  let handle = null;
330
330
  let isResumed = false;
331
331
  try {
332
- // Resolve agent preset (#GH-1): scheduled llm sessions must join an agent preset
332
+ // Resolve agent preset (#GH-1, #GH-2): scheduled llm sessions must join an agent preset
333
333
  // (default or task-configured), otherwise tools resolve against the empty global layer.
334
- const presets = this.ctx.agentPresets || (this.ctx.get && this.ctx.get('agentPresets'));
334
+ let presets = null;
335
+ try {
336
+ if (typeof this.ctx.get === 'function') {
337
+ presets = this.ctx.get('agentPresets');
338
+ } else {
339
+ presets = this.ctx.agentPresets;
340
+ }
341
+ } catch {
342
+ presets = null;
343
+ }
335
344
  let preset = null;
336
345
  if (presets && typeof presets.resolve === 'function') {
337
346
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-cron",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "description": "Scheduled cron tasks, background automation and agent execution for DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",