// modules/time.ts
var TIME_OPERATORS = {
  "time/now": {
    module: "time",
    category: "std-time",
    minArity: 0,
    maxArity: 0,
    description: "Current timestamp",
    hasSideEffects: false,
    returnType: "number",
    params: [],
    example: '["time/now"] // => 1705593600000'
  },
  "time/today": {
    module: "time",
    category: "std-time",
    minArity: 0,
    maxArity: 0,
    description: "Today at midnight (local time)",
    hasSideEffects: false,
    returnType: "number",
    params: [],
    example: '["time/today"]'
  },
  "time/parse": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 2,
    description: "Parse string to timestamp",
    hasSideEffects: false,
    returnType: "number",
    params: [
      { name: "str", type: "string", description: "Date string" },
      { name: "format", type: "string", description: "Format pattern", optional: true }
    ],
    example: '["time/parse", "2024-01-18", "YYYY-MM-DD"]'
  },
  "time/format": {
    module: "time",
    category: "std-time",
    minArity: 2,
    maxArity: 2,
    description: "Format timestamp to string",
    hasSideEffects: false,
    returnType: "string",
    params: [
      { name: "date", type: "number", description: "Timestamp" },
      { name: "format", type: "string", description: "Format pattern" }
    ],
    example: '["time/format", "@entity.createdAt", "MMM DD, YYYY"]'
  },
  "time/year": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Get year from timestamp",
    hasSideEffects: false,
    returnType: "number",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/year", "@entity.createdAt"] // => 2024'
  },
  "time/month": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Get month from timestamp (1-12)",
    hasSideEffects: false,
    returnType: "number",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/month", "@entity.createdAt"] // => 1'
  },
  "time/day": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Get day of month from timestamp (1-31)",
    hasSideEffects: false,
    returnType: "number",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/day", "@entity.createdAt"] // => 18'
  },
  "time/weekday": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Get day of week (0=Sunday, 6=Saturday)",
    hasSideEffects: false,
    returnType: "number",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/weekday", "@entity.createdAt"] // => 4 (Thursday)'
  },
  "time/hour": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Get hour from timestamp (0-23)",
    hasSideEffects: false,
    returnType: "number",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/hour", "@entity.createdAt"] // => 14'
  },
  "time/minute": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Get minute from timestamp (0-59)",
    hasSideEffects: false,
    returnType: "number",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/minute", "@entity.createdAt"] // => 30'
  },
  "time/second": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Get second from timestamp (0-59)",
    hasSideEffects: false,
    returnType: "number",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/second", "@entity.createdAt"] // => 45'
  },
  "time/add": {
    module: "time",
    category: "std-time",
    minArity: 3,
    maxArity: 3,
    description: "Add time to timestamp",
    hasSideEffects: false,
    returnType: "number",
    params: [
      { name: "date", type: "number", description: "Timestamp" },
      { name: "amount", type: "number", description: "Amount to add" },
      { name: "unit", type: "string", description: "Time unit (year/month/week/day/hour/minute/second/ms)" }
    ],
    example: '["time/add", ["time/now"], 7, "day"]'
  },
  "time/subtract": {
    module: "time",
    category: "std-time",
    minArity: 3,
    maxArity: 3,
    description: "Subtract time from timestamp",
    hasSideEffects: false,
    returnType: "number",
    params: [
      { name: "date", type: "number", description: "Timestamp" },
      { name: "amount", type: "number", description: "Amount to subtract" },
      { name: "unit", type: "string", description: "Time unit" }
    ],
    example: '["time/subtract", ["time/now"], 1, "hour"]'
  },
  "time/diff": {
    module: "time",
    category: "std-time",
    minArity: 2,
    maxArity: 3,
    description: "Difference between timestamps",
    hasSideEffects: false,
    returnType: "number",
    params: [
      { name: "a", type: "number", description: "First timestamp" },
      { name: "b", type: "number", description: "Second timestamp" },
      { name: "unit", type: "string", description: "Result unit", optional: true, defaultValue: "ms" }
    ],
    example: '["time/diff", "@entity.birthDate", ["time/now"], "year"]'
  },
  "time/startOf": {
    module: "time",
    category: "std-time",
    minArity: 2,
    maxArity: 2,
    description: "Get start of time period",
    hasSideEffects: false,
    returnType: "number",
    params: [
      { name: "date", type: "number", description: "Timestamp" },
      { name: "unit", type: "string", description: "Time unit (year/month/week/day/hour/minute)" }
    ],
    example: '["time/startOf", ["time/now"], "month"]'
  },
  "time/endOf": {
    module: "time",
    category: "std-time",
    minArity: 2,
    maxArity: 2,
    description: "Get end of time period",
    hasSideEffects: false,
    returnType: "number",
    params: [
      { name: "date", type: "number", description: "Timestamp" },
      { name: "unit", type: "string", description: "Time unit" }
    ],
    example: '["time/endOf", ["time/now"], "month"]'
  },
  "time/isBefore": {
    module: "time",
    category: "std-time",
    minArity: 2,
    maxArity: 2,
    description: "Check if a is before b",
    hasSideEffects: false,
    returnType: "boolean",
    params: [
      { name: "a", type: "number", description: "First timestamp" },
      { name: "b", type: "number", description: "Second timestamp" }
    ],
    example: '["time/isBefore", "@entity.startDate", "@entity.endDate"]'
  },
  "time/isAfter": {
    module: "time",
    category: "std-time",
    minArity: 2,
    maxArity: 2,
    description: "Check if a is after b",
    hasSideEffects: false,
    returnType: "boolean",
    params: [
      { name: "a", type: "number", description: "First timestamp" },
      { name: "b", type: "number", description: "Second timestamp" }
    ],
    example: '["time/isAfter", ["time/now"], "@entity.deadline"]'
  },
  "time/isBetween": {
    module: "time",
    category: "std-time",
    minArity: 3,
    maxArity: 3,
    description: "Check if date is between start and end",
    hasSideEffects: false,
    returnType: "boolean",
    params: [
      { name: "date", type: "number", description: "Timestamp to check" },
      { name: "start", type: "number", description: "Range start" },
      { name: "end", type: "number", description: "Range end" }
    ],
    example: '["time/isBetween", ["time/now"], "@entity.startDate", "@entity.endDate"]'
  },
  "time/isSame": {
    module: "time",
    category: "std-time",
    minArity: 2,
    maxArity: 3,
    description: "Check if timestamps are same (optionally by unit)",
    hasSideEffects: false,
    returnType: "boolean",
    params: [
      { name: "a", type: "number", description: "First timestamp" },
      { name: "b", type: "number", description: "Second timestamp" },
      { name: "unit", type: "string", description: "Comparison unit", optional: true }
    ],
    example: '["time/isSame", "@a", "@b", "day"]'
  },
  "time/isPast": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Check if timestamp is in the past",
    hasSideEffects: false,
    returnType: "boolean",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/isPast", "@entity.expiresAt"]'
  },
  "time/isFuture": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Check if timestamp is in the future",
    hasSideEffects: false,
    returnType: "boolean",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/isFuture", "@entity.scheduledAt"]'
  },
  "time/isToday": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: "Check if timestamp is today",
    hasSideEffects: false,
    returnType: "boolean",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/isToday", "@entity.createdAt"]'
  },
  "time/relative": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: 'Format as relative time ("2 hours ago", "in 3 days")',
    hasSideEffects: false,
    returnType: "string",
    params: [{ name: "date", type: "number", description: "Timestamp" }],
    example: '["time/relative", "@entity.lastActivityAt"] // => "2 hours ago"'
  },
  "time/duration": {
    module: "time",
    category: "std-time",
    minArity: 1,
    maxArity: 1,
    description: 'Format milliseconds as duration ("2h 30m")',
    hasSideEffects: false,
    returnType: "string",
    params: [{ name: "ms", type: "number", description: "Duration in milliseconds" }],
    example: '["time/duration", 9000000] // => "2h 30m"'
  }
};
function getTimeOperators() {
  return Object.keys(TIME_OPERATORS);
}

export { TIME_OPERATORS, getTimeOperators };
//# sourceMappingURL=time.js.map
//# sourceMappingURL=time.js.map