// Force strict mode and setup for ESM
"use strict";
import {
  humanReadableCron
} from "./chunk-TW522KN6.js";
import {
  BaseDeclarativeTool,
  BaseToolInvocation,
  ToolDisplayNames,
  ToolNames
} from "./chunk-PVVL5Q3W.js";
import "./chunk-XP27SJMH.js";
import "./chunk-QWSRH265.js";
import {
  init_esbuild_shims
} from "./chunk-A4BMJM77.js";
import {
  __name
} from "./chunk-J2S4EL5Y.js";

// packages/core/src/tools/cron-list.ts
init_esbuild_shims();
var CronListInvocation = class extends BaseToolInvocation {
  constructor(config, params) {
    super(params);
    this.config = config;
  }
  static {
    __name(this, "CronListInvocation");
  }
  getDescription() {
    return "";
  }
  async execute() {
    const scheduler = this.config.getCronScheduler();
    const jobs = scheduler.list();
    if (jobs.length === 0) {
      const result = "No active cron jobs.";
      return { llmContent: result, returnDisplay: result };
    }
    const llmLines = jobs.map((job) => {
      const type = job.recurring ? "recurring" : "one-shot";
      return `${job.id} \u2014 ${job.cronExpr} (${type}) [session-only]: ${job.prompt}`;
    });
    const llmContent = llmLines.join("\n");
    const displayLines = jobs.map(
      (job) => `${job.id} ${humanReadableCron(job.cronExpr)}`
    );
    const returnDisplay = displayLines.join("\n");
    return { llmContent, returnDisplay };
  }
};
var CronListTool = class _CronListTool extends BaseDeclarativeTool {
  constructor(config) {
    super(
      _CronListTool.Name,
      ToolDisplayNames.CRON_LIST,
      "List all cron jobs scheduled via CronCreate in this session.",
      "other" /* Other */,
      {
        type: "object",
        properties: {},
        additionalProperties: false
      },
      true,
      // isOutputMarkdown
      false,
      // canUpdateOutput
      true,
      // shouldDefer — low-frequency inspection tool
      false,
      // alwaysLoad
      "cron list scheduled jobs"
    );
    this.config = config;
  }
  static {
    __name(this, "CronListTool");
  }
  static Name = ToolNames.CRON_LIST;
  createInvocation(params) {
    return new CronListInvocation(this.config, params);
  }
};
export {
  CronListTool
};
