mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 07:21:37 +08:00
fix: follow-up fixes for google-workspace gws migration
- Fix npm package name: @anthropic -> @googleworkspace/cli - Add Homebrew install option - Fix calendar_list to respect --start/--end args (uses raw Calendar API for date ranges, +agenda helper for default 7-day view) - Improve check_auth partial scope output (list missing scopes) - Add output format documentation with key JSON shapes - Use npm install in troubleshooting (no Rust toolchain needed) Follow-up to cherry-picked PR #6713
This commit is contained in:
@@ -80,15 +80,30 @@ def gmail_modify(args):
|
||||
# -- Calendar --
|
||||
|
||||
def calendar_list(args):
|
||||
cmd = ["calendar", "+agenda", "--format", "json"]
|
||||
if args.start and args.end:
|
||||
# Calculate days between start and end for --days flag
|
||||
cmd += ["--days", "7"]
|
||||
if args.start or args.end:
|
||||
# Specific date range — use raw Calendar API for precise timeMin/timeMax
|
||||
from datetime import datetime, timedelta, timezone as tz
|
||||
now = datetime.now(tz.utc)
|
||||
time_min = args.start or now.isoformat()
|
||||
time_max = args.end or (now + timedelta(days=7)).isoformat()
|
||||
gws(
|
||||
"calendar", "events", "list",
|
||||
"--params", json.dumps({
|
||||
"calendarId": args.calendar,
|
||||
"timeMin": time_min,
|
||||
"timeMax": time_max,
|
||||
"maxResults": args.max,
|
||||
"singleEvents": True,
|
||||
"orderBy": "startTime",
|
||||
}),
|
||||
"--format", "json",
|
||||
)
|
||||
else:
|
||||
cmd += ["--days", "7"]
|
||||
if args.calendar != "primary":
|
||||
cmd += ["--calendar", args.calendar]
|
||||
gws(*cmd)
|
||||
# No date range — use +agenda helper (defaults to 7 days)
|
||||
cmd = ["calendar", "+agenda", "--days", "7", "--format", "json"]
|
||||
if args.calendar != "primary":
|
||||
cmd += ["--calendar", args.calendar]
|
||||
gws(*cmd)
|
||||
|
||||
def calendar_create(args):
|
||||
cmd = [
|
||||
|
||||
Reference in New Issue
Block a user