// Force strict mode and setup for ESM
"use strict";
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-delete.ts
init_esbuild_shims();
var CronDeleteInvocation = class extends BaseToolInvocation {
  constructor(config, params) {
    super(params);
    this.config = config;
  }
  static {
    __name(this, "CronDeleteInvocation");
  }
  getDescription() {
    return this.params.id;
  }
  async execute() {
    const scheduler = this.config.getCronScheduler();
    const deleted = scheduler.delete(this.params.id);
    if (deleted) {
      const llmContent = `Cancelled job ${this.params.id}.`;
      const returnDisplay = `Cancelled ${this.params.id}`;
      return { llmContent, returnDisplay };
    } else {
      const result = `Job ${this.params.id} not found.`;
      return {
        llmContent: result,
        returnDisplay: result,
        error: { message: result }
      };
    }
  }
};
var CronDeleteTool = class _CronDeleteTool extends BaseDeclarativeTool {
  constructor(config) {
    super(
      _CronDeleteTool.Name,
      ToolDisplayNames.CRON_DELETE,
      "Cancel a cron job previously scheduled with CronCreate. Removes it from the in-memory session store.",
      "other" /* Other */,
      {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "Job ID returned by CronCreate."
          }
        },
        required: ["id"],
        additionalProperties: false
      },
      true,
      // isOutputMarkdown
      false,
      // canUpdateOutput
      true,
      // shouldDefer — only needed after CronCreate/CronList
      false,
      // alwaysLoad
      "cron delete cancel remove"
    );
    this.config = config;
  }
  static {
    __name(this, "CronDeleteTool");
  }
  static Name = ToolNames.CRON_DELETE;
  createInvocation(params) {
    return new CronDeleteInvocation(this.config, params);
  }
};
export {
  CronDeleteTool
};
