morpheus-cli 0.6.7 → 0.6.8

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.
@@ -16,6 +16,27 @@ const casualChrono = new chrono.Chrono({
16
16
  ...chrono.es.casual.refiners,
17
17
  ],
18
18
  });
19
+ /**
20
+ * Formats a Date as ISO string with timezone offset (not UTC).
21
+ * Example: "2026-02-25T17:25:00-03:00" instead of "2026-02-25T17:25:00.000Z"
22
+ */
23
+ function formatDateWithTimezone(date, timezone) {
24
+ // Get the offset for the given timezone
25
+ const offsetMinutes = -new Date(date.toLocaleString('en-US', { timeZone: timezone, timeZoneName: 'longOffset' })).getTimezoneOffset();
26
+ // Format date without timezone
27
+ const year = date.getFullYear();
28
+ const month = String(date.getMonth() + 1).padStart(2, '0');
29
+ const day = String(date.getDate()).padStart(2, '0');
30
+ const hours = String(date.getHours()).padStart(2, '0');
31
+ const minutes = String(date.getMinutes()).padStart(2, '0');
32
+ const seconds = String(date.getSeconds()).padStart(2, '0');
33
+ // Calculate offset string
34
+ const offsetHours = Math.floor(Math.abs(offsetMinutes) / 60);
35
+ const offsetMins = Math.abs(offsetMinutes) % 60;
36
+ const offsetSign = offsetMinutes >= 0 ? '+' : '-';
37
+ const offsetStr = `${offsetSign}${String(offsetHours).padStart(2, '0')}:${String(offsetMins).padStart(2, '0')}`;
38
+ return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}${offsetStr}`;
39
+ }
19
40
  export const timeVerifierTool = tool(async ({ text, timezone }) => {
20
41
  // If a timezone is provided, use it for parsing context.
21
42
  // Otherwise, use the configured system timezone from Chronos.
@@ -36,12 +57,17 @@ export const timeVerifierTool = tool(async ({ text, timezone }) => {
36
57
  const parsed = results.map((result) => {
37
58
  const startDate = result.start.date();
38
59
  const endDate = result.end?.date();
60
+ // Format the date in the user's timezone for clarity
61
+ const formatted = startDate.toLocaleString('pt-BR', { timeZone: effectiveTimezone, timeZoneName: 'short' });
62
+ // Convert to ISO string WITH timezone offset (not UTC)
63
+ // This ensures Chronos schedules at the correct local time
64
+ const isoStart = formatDateWithTimezone(startDate, effectiveTimezone);
65
+ const isoEnd = endDate ? formatDateWithTimezone(endDate, effectiveTimezone) : null;
39
66
  return {
40
67
  expression: result.text,
41
- isoStart: startDate.toISOString(),
42
- isoEnd: endDate ? endDate.toISOString() : null,
43
- // Format the date in the user's timezone for clarity
44
- formatted: startDate.toLocaleString('pt-BR', { timeZone: effectiveTimezone, timeZoneName: 'short' }),
68
+ isoStart,
69
+ isoEnd,
70
+ formatted,
45
71
  isRange: !!endDate,
46
72
  };
47
73
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morpheus-cli",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "Morpheus is a local AI agent for developers, running as a CLI daemon that connects to LLMs, local tools, and MCPs, enabling interaction via Terminal, Telegram, and Discord. Inspired by the character Morpheus from *The Matrix*, the project acts as an intelligent orchestrator, bridging the gap between the developer and complex systems.",
5
5
  "bin": {
6
6
  "morpheus": "./bin/morpheus.js"