Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
fix(routines): optimize overlap query, surface delete errors, and preserve hourly compatibility
shoudi zheng7db0f865da06
diff --git a/AGENTS.md b/AGENTS.mdindex e5d0c9bb..00f72901 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -67,12 +67,13 @@ Memory, and Voice services.fast checks in the same pull request, not only the one being fixed.- A feature is done when no code it made unnecessary and no abstraction therequest does not require is left behind.-- When retiring or reshaping a feature, delete its code and drop its tables,- columns, rows, and stored files in a forward migration. Data that must- survive is converted once inside the migration; do not keep dual-read or- fallback paths for old shapes. This covers persisted state, config, and- caches written by the Daemon or CLI on users' machines, but not- compatibility with third-party tool versions such as Codex CLI.+- Prefer forward and backward compatibility across upgrades, rolling deploys,+ and mixed client/server versions (including Desktop, Daemon, CLI, and Web+ talking to newer or older TeamHub releases, as well as persisted state,+ config, and caches on users' machines). Accept previous request, config, and+ flag shapes where feasible instead of hard-cutting them. Only introduce a+ breaking change when compatibility is impractical, and explain the reason and+ rollout impact explicitly in the pull request.- During local development, run the focused tests for the changed behavior andthe affected fast checks. Focused Vitest or Go unit tests do notreplace those checks. Do not run complete integration, E2E, container, ordiff --git a/apps/teamhub-cli/src/__snapshots__/cli.help-snapshot.test.ts.snap b/apps/teamhub-cli/src/__snapshots__/cli.help-snapshot.test.ts.snapindex ced0894b..0da789dc 100644--- a/apps/teamhub-cli/src/__snapshots__/cli.help-snapshot.test.ts.snap+++ b/apps/teamhub-cli/src/__snapshots__/cli.help-snapshot.test.ts.snap@@ -2659,6 +2659,7 @@ Options:--weekday <value> Selected weekday; repeat unique days.--timezone <value> Explicit IANA timezone for daily or weekly.--every-minutes <value> Repeat every 10-10080 minutes (multiples of 10).+ --every-hours <value> Repeat every 1-168 hours (compatibility alias for --every-minutes).--at <value> Fire once at this RFC 3339 time (with offset); done afterwards.--tracking-item <value> Tracking Item ID this Routine serves; requires --purpose.--purpose <value> What this Routine checks or reminds for its Tracking Item.@@ -2669,7 +2670,7 @@ Options:--operation-id <value> Stable operation identity for recovery.","schema": "exit 0-{"command":["routine","create"],"description":"Create a Routine in the configured Room.","read_only":false,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Short name shown in the room Routine list."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"The message posted in this room when the Routine fires."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes repeats from now. once posts a single time at run_at."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"tracking_item_id":{"description":"Tracking Item of your Human this Routine serves; deleting the item deletes the Routine.","type":"string","pattern":"^ti_[a-f0-9]{32}$"},"tracking_purpose":{"description":"What this Routine checks or reminds for its Tracking Item.","type":"string","minLength":1,"maxLength":500}},"required":["name","instruction","schedule"],"additionalProperties":false,"description":"Name, message, schedule, and optional mention for a new Routine."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"cli":{"usage":["teamhub routine create [flags]"],"arguments":[],"options":{"--name":{"description":"Routine name."},"--content":{"description":"Inline Markdown body; outside code, \\\\n, \\\\t and \\\\\\\\ are decoded."},"--file":{"description":"Read UTF-8 body from a file or - for stdin."},"--mention-actor-id":{"description":"Current Room Agent Actor ID, or self."},"--schedule":{"description":"Complete daily, weekly, every_n_minutes or once schedule JSON."},"--schedule-file":{"description":"Read schedule JSON from a file or - for stdin."},"--daily":{"description":"Daily local time as HH:MM."},"--weekly":{"description":"Weekly local time as HH:MM."},"--weekday":{"description":"Selected weekday; repeat unique days.","repeatable":true},"--timezone":{"description":"Explicit IANA timezone for daily or weekly."},"--every-minutes":{"description":"Repeat every 10-10080 minutes (multiples of 10)."},"--at":{"description":"Fire once at this RFC 3339 time (with offset); done afterwards."},"--tracking-item":{"description":"Tracking Item ID this Routine serves; requires --purpose."},"--purpose":{"description":"What this Routine checks or reminds for its Tracking Item."},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":[]}}+{"command":["routine","create"],"description":"Create a Routine in the configured Room.","read_only":false,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Short name shown in the room Routine list."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"The message posted in this room when the Routine fires."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_hours","description":"Repeat a fixed number of whole hours on a fixed grid."},"interval_hours":{"type":"integer","minimum":1,"maximum":168,"description":"How many whole hours between posts, from 1 to 168 (compatibility alias for every_n_minutes)."}},"required":["kind","interval_hours"],"additionalProperties":false,"description":"Repeat every N hours, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes (or compatibility alias every_n_hours) repeats from now. once posts a single time at run_at."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"tracking_item_id":{"description":"Tracking Item of your Human this Routine serves; deleting the item deletes the Routine.","type":"string","pattern":"^ti_[a-f0-9]{32}$"},"tracking_purpose":{"description":"What this Routine checks or reminds for its Tracking Item.","type":"string","minLength":1,"maxLength":500}},"required":["name","instruction","schedule"],"additionalProperties":false,"description":"Name, message, schedule, and optional mention for a new Routine."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_hours","description":"Repeat a fixed number of whole hours on a fixed grid."},"interval_hours":{"type":"integer","minimum":1,"maximum":168,"description":"How many whole hours between posts, from 1 to 168 (compatibility alias for every_n_minutes)."}},"required":["kind","interval_hours"],"additionalProperties":false,"description":"Repeat every N hours, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes (or compatibility alias every_n_hours) repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"cli":{"usage":["teamhub routine create [flags]"],"arguments":[],"options":{"--name":{"description":"Routine name."},"--content":{"description":"Inline Markdown body; outside code, \\\\n, \\\\t and \\\\\\\\ are decoded."},"--file":{"description":"Read UTF-8 body from a file or - for stdin."},"--mention-actor-id":{"description":"Current Room Agent Actor ID, or self."},"--schedule":{"description":"Complete daily, weekly, every_n_minutes or once schedule JSON."},"--schedule-file":{"description":"Read schedule JSON from a file or - for stdin."},"--daily":{"description":"Daily local time as HH:MM."},"--weekly":{"description":"Weekly local time as HH:MM."},"--weekday":{"description":"Selected weekday; repeat unique days.","repeatable":true},"--timezone":{"description":"Explicit IANA timezone for daily or weekly."},"--every-minutes":{"description":"Repeat every 10-10080 minutes (multiples of 10)."},"--every-hours":{"description":"Repeat every 1-168 hours (compatibility alias for --every-minutes)."},"--at":{"description":"Fire once at this RFC 3339 time (with offset); done afterwards."},"--tracking-item":{"description":"Tracking Item ID this Routine serves; requires --purpose."},"--purpose":{"description":"What this Routine checks or reminds for its Tracking Item."},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":[]}}",},"routine delete": {@@ -2707,7 +2708,7 @@ Options:--operation-id <value> Stable operation identity for recovery.","schema": "exit 0-{"command":["routine","enable"],"description":"Enable a Routine in the configured Room.","read_only":false,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"routine_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Id of a Routine in this room, from list_routines or create_routine."}},"required":["routine_id"],"additionalProperties":false,"description":"The Routine to change."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"cli":{"usage":["teamhub routine enable [flags]"],"arguments":["<routine-id>"],"options":{"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":[]}}+{"command":["routine","enable"],"description":"Enable a Routine in the configured Room.","read_only":false,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"routine_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Id of a Routine in this room, from list_routines or create_routine."}},"required":["routine_id"],"additionalProperties":false,"description":"The Routine to change."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_hours","description":"Repeat a fixed number of whole hours on a fixed grid."},"interval_hours":{"type":"integer","minimum":1,"maximum":168,"description":"How many whole hours between posts, from 1 to 168 (compatibility alias for every_n_minutes)."}},"required":["kind","interval_hours"],"additionalProperties":false,"description":"Repeat every N hours, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes (or compatibility alias every_n_hours) repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"cli":{"usage":["teamhub routine enable [flags]"],"arguments":["<routine-id>"],"options":{"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":[]}}",},"routine list": {@@ -2722,7 +2723,7 @@ Options:--schema Show offline input and output schemas.","schema": "exit 0-{"command":["routine","list"],"description":"List a Routine in the configured Room.","read_only":true,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{},"additionalProperties":false,"description":"Lists every Routine in the current room. No arguments."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"routines":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"description":"Every Routine in this room."}},"required":["routines"],"additionalProperties":false,"description":"The current room's Routines."},"cli":{"usage":["teamhub routine list [flags]"],"arguments":[],"options":{"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true}},"notes":[]}}+{"command":["routine","list"],"description":"List a Routine in the configured Room.","read_only":true,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{},"additionalProperties":false,"description":"Lists every Routine in the current room. No arguments."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"routines":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_hours","description":"Repeat a fixed number of whole hours on a fixed grid."},"interval_hours":{"type":"integer","minimum":1,"maximum":168,"description":"How many whole hours between posts, from 1 to 168 (compatibility alias for every_n_minutes)."}},"required":["kind","interval_hours"],"additionalProperties":false,"description":"Repeat every N hours, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes (or compatibility alias every_n_hours) repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"description":"Every Routine in this room."}},"required":["routines"],"additionalProperties":false,"description":"The current room's Routines."},"cli":{"usage":["teamhub routine list [flags]"],"arguments":[],"options":{"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true}},"notes":[]}}",},"routine pause": {@@ -2741,7 +2742,7 @@ Options:--operation-id <value> Stable operation identity for recovery.","schema": "exit 0-{"command":["routine","pause"],"description":"Pause a Routine in the configured Room.","read_only":false,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"routine_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Id of a Routine in this room, from list_routines or create_routine."}},"required":["routine_id"],"additionalProperties":false,"description":"The Routine to change."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"cli":{"usage":["teamhub routine pause [flags]"],"arguments":["<routine-id>"],"options":{"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":[]}}+{"command":["routine","pause"],"description":"Pause a Routine in the configured Room.","read_only":false,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"routine_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Id of a Routine in this room, from list_routines or create_routine."}},"required":["routine_id"],"additionalProperties":false,"description":"The Routine to change."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_hours","description":"Repeat a fixed number of whole hours on a fixed grid."},"interval_hours":{"type":"integer","minimum":1,"maximum":168,"description":"How many whole hours between posts, from 1 to 168 (compatibility alias for every_n_minutes)."}},"required":["kind","interval_hours"],"additionalProperties":false,"description":"Repeat every N hours, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes (or compatibility alias every_n_hours) repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"cli":{"usage":["teamhub routine pause [flags]"],"arguments":["<routine-id>"],"options":{"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":[]}}",},"routine run": {@@ -2760,7 +2761,7 @@ Options:--operation-id <value> Stable operation identity for recovery.","schema": "exit 0-{"command":["routine","run"],"description":"Publish a Routine instruction once; this does not prove Agent work completed.","read_only":false,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"routine_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Id of a Routine in this room, from list_routines or create_routine."}},"required":["routine_id"],"additionalProperties":false,"description":"The Routine to change."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"cli":{"usage":["teamhub routine run [flags]"],"arguments":["<routine-id>"],"options":{"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":[]}}+{"command":["routine","run"],"description":"Publish a Routine instruction once; this does not prove Agent work completed.","read_only":false,"input_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"routine_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Id of a Routine in this room, from list_routines or create_routine."}},"required":["routine_id"],"additionalProperties":false,"description":"The Routine to change."},"output_schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Stable Routine id."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Routine name."},"instruction":{"type":"string","minLength":1,"maxLength":50000,"description":"Message posted when the Routine fires."},"mention_actor_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","description":"Omit to post plain text. Use \\"self\\" to wake yourself. Otherwise pass the actor id of an Agent still in this room."},"schedule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily","description":"Post once every day."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","time","timezone"],"additionalProperties":false,"description":"Post once a day at a local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"weekly","description":"Post on selected weekdays each week."},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"One selected local weekday."},"uniqueItems":true,"description":"Selected local weekdays. Use one Routine for multiple days at the same time, e.g. Monday through Friday."},"time":{"type":"string","pattern":"^(?:[01]\\\\d|2[0-3]):[0-5]\\\\d$","description":"Local 24-hour time as HH:MM, for example 09:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","weekdays","time","timezone"],"additionalProperties":false,"description":"Post on one or more selected weekdays at the same local clock time."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_minutes","description":"Repeat a fixed number of minutes on a fixed grid."},"interval_minutes":{"type":"integer","minimum":10,"maximum":10080,"multipleOf":10,"description":"How many minutes between posts, from 10 to 10080 in 10-minute increments."}},"required":["kind","interval_minutes"],"additionalProperties":false,"description":"Repeat every N minutes, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"every_n_hours","description":"Repeat a fixed number of whole hours on a fixed grid."},"interval_hours":{"type":"integer","minimum":1,"maximum":168,"description":"How many whole hours between posts, from 1 to 168 (compatibility alias for every_n_minutes)."}},"required":["kind","interval_hours"],"additionalProperties":false,"description":"Repeat every N hours, starting from now."},{"type":"object","properties":{"kind":{"type":"string","const":"once","description":"Post a single time, then stop."},"run_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$","description":"The future moment to post, RFC 3339 with offset, for example 2026-10-22T14:30:00-04:00."},"timezone":{"type":"string","minLength":1,"maxLength":255,"description":"IANA timezone for the clock time, such as America/New_York. Use the timezone the user stated."}},"required":["kind","run_at"],"additionalProperties":false,"description":"Post once at a set time, for example a check before a meeting; the Routine is done afterwards."}],"description":"When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes (or compatibility alias every_n_hours) repeats from now. once posts a single time at run_at."},"listener":{"description":"Present instead of schedule on an app listener. It can only be paused and enabled, and goes away when the Human revokes your access to the app.","type":"object","properties":{"app":{"type":"string","enum":["gmail","outlook","google_calendar","slack"],"description":"Connected app whose new events the Routine hands to proactive judgement."}},"required":["app"],"additionalProperties":false},"enabled":{"type":"boolean","description":"Whether the Routine will post on schedule."},"next_run_at":{"description":"UTC time of the next scheduled post. Absent while paused.","type":"string","minLength":1},"tracking_item_id":{"description":"Tracking Item this Routine serves, when it serves one.","type":"string"}},"required":["id","name","instruction","enabled"],"additionalProperties":false,"description":"One Routine in the current room."},"cli":{"usage":["teamhub routine run [flags]"],"arguments":["<routine-id>"],"options":{"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":[]}}",},"slack channels": {@@ -4118,6 +4119,7 @@ Options:--weekday <value> Selected weekday; repeat unique days.--timezone <value> Explicit IANA timezone for daily or weekly.--every-minutes <value> Repeat every 10-10080 minutes (multiples of 10).+ --every-hours <value> Repeat every 1-168 hours (compatibility alias for --every-minutes).--at <value> Fire once at this RFC 3339 time (with offset); done afterwards.--tracking-item <value> Tracking Item ID this Routine serves; requires --purpose.--purpose <value> What this Routine checks or reminds for its Tracking Item.diff --git a/apps/teamhub-cli/src/business-commands.test.ts b/apps/teamhub-cli/src/business-commands.test.tsindex 69532a05..401a5534 100644--- a/apps/teamhub-cli/src/business-commands.test.ts+++ b/apps/teamhub-cli/src/business-commands.test.ts@@ -346,12 +346,31 @@ describe("business command normalization", () => {kind: "every_n_minutes",interval_minutes: 60,});+ expect(+ (+ await definition.normalize(+ args({+ "--name": "Legacy hourly",+ "--content": "Check pipeline",+ "--every-hours": "2",+ }),+ reader,+ )+ ).input.schedule,+ ).toEqual({+ kind: "every_n_hours",+ interval_hours: 2,+ });const invalidSchedules: Record<string, string | string[]>[] = [{ "--daily": "09:00" },{ "--every-minutes": "20", "--timezone": "UTC" },{ "--every-minutes": "5" },{ "--every-minutes": "15" },{ "--every-minutes": "10090" },+ { "--every-hours": "0" },+ { "--every-hours": "169" },+ { "--every-hours": "2", "--timezone": "UTC" },+ { "--every-minutes": "60", "--every-hours": "1" },{"--weekly": "09:00","--timezone": "UTC",diff --git a/apps/teamhub-cli/src/business-commands.ts b/apps/teamhub-cli/src/business-commands.tsindex 7f11c63a..6fcf0f7a 100644--- a/apps/teamhub-cli/src/business-commands.ts+++ b/apps/teamhub-cli/src/business-commands.ts@@ -953,11 +953,12 @@ async function schedule();const daily = option(args, "--daily"),weekly = option(args, "--weekly"),- every = option(args, "--every-minutes"),+ everyMinutes = option(args, "--every-minutes"),+ everyHours = option(args, "--every-hours"),at = option(args, "--at"),timezone = option(args, "--timezone"),weekdays = values(args, "--weekday");- const simple = [daily, weekly, every, at].filter(+ const simple = [daily, weekly, everyMinutes, everyHours, at].filter((value) => value !== undefined,).length;if (jsonProvided) {@@ -969,7 +970,7 @@ async function schedule(}if (simple !== 1)invalid(- "Choose --daily, --weekly, --every-minutes, --at or complete schedule JSON.",+ "Choose --daily, --weekly, --every-minutes, --every-hours, --at or complete schedule JSON.",);if (at !== undefined) {if (weekdays.length) invalid("--at cannot include weekday.");@@ -979,10 +980,10 @@ async function schedule();return { kind: "once", run_at: at, ...optional("timezone", timezone) };}- if (every !== undefined) {+ if (everyMinutes !== undefined) {if (timezone !== undefined || weekdays.length)invalid("--every-minutes cannot include timezone or weekday.");- const minutes = integer(every, "--every-minutes", 10, 10_080)!;+ const minutes = integer(everyMinutes, "--every-minutes", 10, 10_080)!;if (minutes % 10 !== 0)invalid("--every-minutes must be a multiple of 10 minutes.");return {@@ -990,6 +991,14 @@ async function schedule(interval_minutes: minutes,};}+ if (everyHours !== undefined) {+ if (timezone !== undefined || weekdays.length)+ invalid("--every-hours cannot include timezone or weekday.");+ return {+ kind: "every_n_hours",+ interval_hours: integer(everyHours, "--every-hours", 1, 168),+ };+ }if (timezone === undefined)invalid("Provide --timezone explicitly for a daily or weekly schedule.");if (daily !== undefined) {@@ -1025,6 +1034,9 @@ const routines = ["create", "list", "pause", "enable", "run", "delete"].map("--every-minutes": flag("Repeat every 10-10080 minutes (multiples of 10).",),+ "--every-hours": flag(+ "Repeat every 1-168 hours (compatibility alias for --every-minutes).",+ ),"--at": flag("Fire once at this RFC 3339 time (with offset); done afterwards.",),diff --git a/apps/teamhub-cli/src/business-render.ts b/apps/teamhub-cli/src/business-render.tsindex f58fb338..242c5390 100644--- a/apps/teamhub-cli/src/business-render.ts+++ b/apps/teamhub-cli/src/business-render.ts@@ -43,6 +43,8 @@ function schedule(routine: Json): string {const item = routine.schedule as Json;if (item.kind === "every_n_minutes")return `every ${String(item.interval_minutes)} minutes`;+ if (item.kind === "every_n_hours")+ return `every ${String(item.interval_hours)} hours`;if (item.kind === "once") return `once at ${String(item.run_at)}`;return `${String(item.kind)} ${Array.isArray(item.weekdays) ? `${item.weekdays.join(", ")} ` : ""}${String(item.time)} ${String(item.timezone)}`;}diff --git a/apps/teamhub-cli/src/domains/collaboration/tools/routines.ts b/apps/teamhub-cli/src/domains/collaboration/tools/routines.tsindex 91f17e92..c0c2f54e 100644--- a/apps/teamhub-cli/src/domains/collaboration/tools/routines.ts+++ b/apps/teamhub-cli/src/domains/collaboration/tools/routines.ts@@ -82,6 +82,23 @@ const intervalScheduleSchema = z.strict().describe("Repeat every N minutes, starting from now.");+const hourlyIntervalScheduleSchema = z+ .object({+ kind: z+ .literal("every_n_hours")+ .describe("Repeat a fixed number of whole hours on a fixed grid."),+ interval_hours: z+ .number()+ .int()+ .min(1, "interval_hours must be at least 1 hour.")+ .max(168, "interval_hours must be at most 168 hours (7 days).")+ .describe(+ "How many whole hours between posts, from 1 to 168 (compatibility alias for every_n_minutes).",+ ),+ })+ .strict()+ .describe("Repeat every N hours, starting from now.");+const onceScheduleSchema = z.object({kind: z.literal("once").describe("Post a single time, then stop."),@@ -103,10 +120,11 @@ export const routineScheduleSchema = zdailyScheduleSchema,weeklyScheduleSchema,intervalScheduleSchema,+ hourlyIntervalScheduleSchema,onceScheduleSchema,]).describe(- "When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes repeats from now. once posts a single time at run_at.",+ "When the Routine posts. daily and weekly use a clock time and timezone. every_n_minutes (or compatibility alias every_n_hours) repeats from now. once posts a single time at run_at.",);const mentionSchema = teamHubIdSchema.describe(diff --git a/apps/teamhub-cli/src/domains/routines.test.ts b/apps/teamhub-cli/src/domains/routines.test.tsindex 395c0d12..ceba9bb0 100644--- a/apps/teamhub-cli/src/domains/routines.test.ts+++ b/apps/teamhub-cli/src/domains/routines.test.ts@@ -55,6 +55,27 @@ describe("TeamHub Collaboration routines", () => {instruction: "Post it.",schedule: { kind: "every_n_hours", interval_hours: 4 },}).success,+ ).toBe(true);+ for (const invalidHours of [0, 169]) {+ expect(+ createRoutineInputSchema.safeParse({+ name: "Morning",+ instruction: "Post it.",+ schedule: { kind: "every_n_hours", interval_hours: invalidHours },+ }).success,+ `interval_hours=${invalidHours}`,+ ).toBe(false);+ }+ expect(+ createRoutineInputSchema.safeParse({+ name: "Morning",+ instruction: "Post it.",+ schedule: {+ kind: "every_n_hours",+ interval_hours: 4,+ timezone: "UTC",+ },+ }).success,).toBe(false);for (const invalidMinutes of [0, 5, 9, 15, 10090]) {expect(diff --git a/apps/teamhub/AGENTS.md b/apps/teamhub/AGENTS.mdindex 8bd1b2f5..d6486581 100644--- a/apps/teamhub/AGENTS.md+++ b/apps/teamhub/AGENTS.md@@ -90,10 +90,11 @@ Go service owning Human HTTP/SSE, Agent callbacks, and active product state.increments), advance on a fixed `dueAt + k * interval` grid without drift orcatch-up, and skip overlapping scheduled fires while an undelivered quietwake or non-terminal trigger Message from the last 24 hours remains- unfinished. Agent API, CLI, and Live Voice expose only `every_n_minutes` +- `interval_minutes`; Web API keeps `every_n_hours` + `interval_hours` for- whole-hour intervals and uses `every_n_minutes` + `interval_minutes` for- non-whole-hour intervals.+ unfinished. Agent API, CLI, and Live Voice standardize on `every_n_minutes` ++ `interval_minutes` (and still accept `every_n_hours` + `interval_hours` on+ input for compatibility with older CLI/Desktop builds); Web API keeps+ `every_n_hours` + `interval_hours` for whole-hour intervals and uses+ `every_n_minutes` + `interval_minutes` for non-whole-hour intervals.- Room input acceptance: Runtime State validates canonicalconversation/targeted agent_runtime inputs atomically with Local Run and cursor.diff --git a/apps/teamhub/internal/app/contract_server_agent_routines.go b/apps/teamhub/internal/app/contract_server_agent_routines.goindex b29fabd9..6ee70623 100644--- a/apps/teamhub/internal/app/contract_server_agent_routines.go+++ b/apps/teamhub/internal/app/contract_server_agent_routines.go@@ -240,6 +240,10 @@ func reminderSchedule(schedule teamhubagentapi.AgentRoutineSchedule) reminder.Scminutes := *schedule.IntervalMinutesparsed.IntervalMinutes = &minutes}+ if schedule.IntervalHours != nil {+ hours := *schedule.IntervalHours+ parsed.IntervalHours = &hours+ }parsed.RunAt = schedule.RunAtreturn parsed}diff --git a/apps/teamhub/internal/reminder/cadence.go b/apps/teamhub/internal/reminder/cadence.goindex 4c78c19d..e88d548b 100644--- a/apps/teamhub/internal/reminder/cadence.go+++ b/apps/teamhub/internal/reminder/cadence.go@@ -99,7 +99,7 @@ func ParseSchedule(schedule Schedule) (Cadence, error) {kind := strings.TrimSpace(schedule.Kind)switch kind {case "daily", "weekly":- if schedule.IntervalMinutes != nil || schedule.RunAt != nil || (kind == "daily" && schedule.Weekdays != nil) {+ if schedule.IntervalMinutes != nil || schedule.IntervalHours != nil || schedule.RunAt != nil || (kind == "daily" && schedule.Weekdays != nil) {return Cadence{}, ErrInvalid}hour, minute, err := parseClock(schedule.Time)@@ -114,7 +114,7 @@ func ParseSchedule(schedule Schedule) (Cadence, error) {}return validateCadence(cadence)case "every_n_minutes":- if strings.TrimSpace(schedule.Time) != "" || strings.TrimSpace(schedule.Timezone) != "" || schedule.Weekdays != nil || schedule.RunAt != nil {+ if strings.TrimSpace(schedule.Time) != "" || strings.TrimSpace(schedule.Timezone) != "" || schedule.Weekdays != nil || schedule.RunAt != nil || schedule.IntervalHours != nil {return Cadence{}, ErrInvalid}if schedule.IntervalMinutes == nil {@@ -122,9 +122,18 @@ func ParseSchedule(schedule Schedule) (Cadence, error) {}minutes := *schedule.IntervalMinutesreturn validateCadence(Cadence{Kind: kind, Timezone: "UTC", IntervalMinutes: &minutes})+ case "every_n_hours":+ if strings.TrimSpace(schedule.Time) != "" || strings.TrimSpace(schedule.Timezone) != "" || schedule.Weekdays != nil || schedule.RunAt != nil || schedule.IntervalMinutes != nil {+ return Cadence{}, ErrInvalid+ }+ if schedule.IntervalHours == nil || *schedule.IntervalHours < 1 || *schedule.IntervalHours > maxIntervalMinutes/60 {+ return Cadence{}, ErrIntervalInvalid+ }+ minutes := *schedule.IntervalHours * 60+ return validateCadence(Cadence{Kind: "every_n_minutes", Timezone: "UTC", IntervalMinutes: &minutes})case "once":if strings.TrimSpace(schedule.Time) != "" || schedule.Weekdays != nil ||- schedule.IntervalMinutes != nil || schedule.RunAt == nil {+ schedule.IntervalMinutes != nil || schedule.IntervalHours != nil || schedule.RunAt == nil {return Cadence{}, ErrInvalid}timezone := strings.TrimSpace(schedule.Timezone)diff --git a/apps/teamhub/internal/reminder/cadence_test.go b/apps/teamhub/internal/reminder/cadence_test.goindex 067b977a..b47b3239 100644--- a/apps/teamhub/internal/reminder/cadence_test.go+++ b/apps/teamhub/internal/reminder/cadence_test.go@@ -225,3 +225,30 @@ func TestOnceRunsAtItsTimeAndNeverAfter(t *testing.T) {}}}++func TestParseScheduleAcceptsHourlyAliasForCompatibility(t *testing.T) {+ hours := 2+ cadence, err := ParseSchedule(Schedule{Kind: "every_n_hours", IntervalHours: &hours})+ if err != nil {+ t.Fatalf("ParseSchedule every_n_hours: %v", err)+ }+ if cadence.Kind != "every_n_minutes" || cadence.IntervalMinutes == nil || *cadence.IntervalMinutes != 120 {+ t.Fatalf("cadence=%+v want every_n_minutes=120", cadence)+ }+ if back := ScheduleFromCadence(cadence); back.Kind != "every_n_minutes" || back.IntervalMinutes == nil || *back.IntervalMinutes != 120 || back.IntervalHours != nil {+ t.Fatalf("ScheduleFromCadence=%+v want every_n_minutes=120", back)+ }+ for _, badHours := range []int{0, 169} {+ h := badHours+ if _, err := ParseSchedule(Schedule{Kind: "every_n_hours", IntervalHours: &h}); !errors.Is(err, ErrIntervalInvalid) {+ t.Fatalf("hours=%d err=%v want ErrIntervalInvalid", badHours, err)+ }+ }+ minutes := 60+ if _, err := ParseSchedule(Schedule{Kind: "every_n_hours", IntervalHours: &hours, IntervalMinutes: &minutes}); !errors.Is(err, ErrInvalid) {+ t.Fatalf("mixing interval_hours and interval_minutes err=%v want ErrInvalid", err)+ }+ if _, err := ParseSchedule(Schedule{Kind: "every_n_minutes", IntervalHours: &hours, IntervalMinutes: &minutes}); !errors.Is(err, ErrInvalid) {+ t.Fatalf("every_n_minutes with interval_hours err=%v want ErrInvalid", err)+ }+}diff --git a/apps/teamhub/internal/reminder/types.go b/apps/teamhub/internal/reminder/types.goindex 726940f8..2f1fe95a 100644--- a/apps/teamhub/internal/reminder/types.go+++ b/apps/teamhub/internal/reminder/types.go@@ -45,6 +45,7 @@ type Schedule struct {Timezone stringWeekdays []stringIntervalMinutes *int+ IntervalHours *int// RunAt is the one moment a "once" Routine fires.RunAt *time.Time}diff --git a/apps/teamhub/internal/store/queries/reminder.sql b/apps/teamhub/internal/store/queries/reminder.sqlindex fa5ecbd3..3ed77c70 100644--- a/apps/teamhub/internal/store/queries/reminder.sql+++ b/apps/teamhub/internal/store/queries/reminder.sql@@ -237,7 +237,7 @@ WITH latest_wake AS (LIMIT 1),latest_message AS (- SELECT m.id, m.created_at+ SELECT m.id, m.created_at, m.mentioned_actor_idsFROM messages mWHERE m.room_id=sqlc.arg(room_id)::textAND m.fired_routine_id=sqlc.arg(routine_id)::text@@ -273,10 +273,13 @@ SELECTJOIN agent_local_runs runON run.context_key=relation.context_keyAND run.run_id=relation.run_id- WHERE ctx.room_id=sqlc.arg(room_id)::text- AND (input.source_message_id=lm.id- OR (jsonb_typeof(input.payload->'invocationMessageIds')='array'- AND input.payload->'invocationMessageIds' @> to_jsonb(lm.id)))+ WHERE ctx.context_kind='meta'+ AND ctx.room_id=sqlc.arg(room_id)::text+ AND ctx.agent_actor_id=ANY(lm.mentioned_actor_ids)+ AND input.source_kind='inbox'+ AND input.created_at>=lm.created_at+ AND jsonb_typeof(input.payload->'invocationMessageIds')='array'+ AND (input.payload->'invocationMessageIds') ? lm.idAND run.status IN ('succeeded', 'failed', 'canceled')))diff --git a/apps/teamhub/internal/store/reminder.sql.go b/apps/teamhub/internal/store/reminder.sql.goindex 5677036d..62bec1be 100644--- a/apps/teamhub/internal/store/reminder.sql.go+++ b/apps/teamhub/internal/store/reminder.sql.go@@ -526,7 +526,7 @@ WITH latest_wake AS (LIMIT 1),latest_message AS (- SELECT m.id, m.created_at+ SELECT m.id, m.created_at, m.mentioned_actor_idsFROM messages mWHERE m.room_id=$1::textAND m.fired_routine_id=$2::text@@ -562,10 +562,13 @@ SELECTJOIN agent_local_runs runON run.context_key=relation.context_keyAND run.run_id=relation.run_id- WHERE ctx.room_id=$1::text- AND (input.source_message_id=lm.id- OR (jsonb_typeof(input.payload->'invocationMessageIds')='array'- AND input.payload->'invocationMessageIds' @> to_jsonb(lm.id)))+ WHERE ctx.context_kind='meta'+ AND ctx.room_id=$1::text+ AND ctx.agent_actor_id=ANY(lm.mentioned_actor_ids)+ AND input.source_kind='inbox'+ AND input.created_at>=lm.created_at+ AND jsonb_typeof(input.payload->'invocationMessageIds')='array'+ AND (input.payload->'invocationMessageIds') ? lm.idAND run.status IN ('succeeded', 'failed', 'canceled')))diff --git a/apps/teamhub/internal/voicelive/routines.go b/apps/teamhub/internal/voicelive/routines.goindex 7779a698..fcb379ab 100644--- a/apps/teamhub/internal/voicelive/routines.go+++ b/apps/teamhub/internal/voicelive/routines.go@@ -75,6 +75,7 @@ type RoutineArguments struct {Timezone string `json:"timezone"`Weekdays []string `json:"weekdays"`IntervalMinutes int `json:"interval_minutes"`+ IntervalHours int `json:"interval_hours"`AgentDoesIt LooseBool `json:"agent_does_it"`Confirmed LooseBool `json:"confirmed"`}@@ -100,6 +101,9 @@ func RoutineCadence(args RoutineArguments) (reminder.Cadence, error) {case "every_n_minutes":minutes := args.IntervalMinutesschedule.IntervalMinutes = &minutes+ case "every_n_hours":+ hours := args.IntervalHours+ schedule.IntervalHours = &hours}return reminder.ParseSchedule(schedule)}diff --git a/apps/teamhub/internal/voicelive/routines_test.go b/apps/teamhub/internal/voicelive/routines_test.goindex bd95f8bc..a1083a31 100644--- a/apps/teamhub/internal/voicelive/routines_test.go+++ b/apps/teamhub/internal/voicelive/routines_test.go@@ -33,6 +33,10 @@ func TestRoutineCadenceReadsEachKind(t *testing.T) {if err != nil || RoutineWhen(sixtyMin) != "every 60 minutes" {t.Fatalf("sixtyMin=%+v err=%v when=%q", sixtyMin, err, RoutineWhen(sixtyMin))}+ legacyHours, err := RoutineCadence(RoutineArguments{Kind: "every_n_hours", IntervalHours: 2})+ if err != nil || RoutineWhen(legacyHours) != "every 120 minutes" {+ t.Fatalf("legacyHours=%+v err=%v when=%q", legacyHours, err, RoutineWhen(legacyHours))+ }}func TestRoutineCadenceRejectsIncompleteSchedules(t *testing.T) {@@ -48,7 +52,8 @@ func TestRoutineCadenceRejectsIncompleteSchedules(t *testing.T) {"minutes under ten": {Kind: "every_n_minutes", IntervalMinutes: 5},"minutes not step 10": {Kind: "every_n_minutes", IntervalMinutes: 15},"minutes over 7 days": {Kind: "every_n_minutes", IntervalMinutes: 10090},- "legacy hours kind": {Kind: "every_n_hours", IntervalMinutes: 60},+ "hours zero": {Kind: "every_n_hours"},+ "hours over 7 days": {Kind: "every_n_hours", IntervalHours: 169},} {if _, err := RoutineCadence(args); err == nil && name != "once in the past" {t.Fatalf("%s accepted", name)diff --git a/apps/teamhub/tests/integration/reminder_test.go b/apps/teamhub/tests/integration/reminder_test.goindex 0e3d0833..1e9568ab 100644--- a/apps/teamhub/tests/integration/reminder_test.go+++ b/apps/teamhub/tests/integration/reminder_test.go@@ -908,6 +908,25 @@ func TestRoutineIntervalGridAndSkipRule(t *testing.T) {tenID := createAgent("a1", 10)sixtyID := createAgent("a2", 60)+ // Compatibility with older CLI/Desktop clients sending every_n_hours.+ legacyStatus, legacyBody := postAgentInRoom(t, env, issued.AccessToken, roomID, "/api/agent/v1/routines", map[string]any{+ "invocation_id": routineInvocation("a3"),+ "name": "Legacy hourly",+ "instruction": "Check status",+ "mention_actor_id": "self",+ "schedule": map[string]any{"kind": "every_n_hours", "interval_hours": 2},+ })+ if legacyStatus != http.StatusOK || !strings.Contains(string(legacyBody), `"kind":"every_n_minutes"`) || !strings.Contains(string(legacyBody), `"interval_minutes":120`) {+ t.Fatalf("legacy every_n_hours create=%d %s", legacyStatus, legacyBody)+ }+ var legacyResp struct {+ Routine struct {+ ID string `json:"id"`+ } `json:"routine"`+ }+ decode(t, legacyBody, &legacyResp)+ legacyID := legacyResp.Routine.ID+status, body := postAgentInRoom(t, env, issued.AccessToken, roomID, "/api/agent/v1/routines/query", map[string]any{})if status != http.StatusOK || !strings.Contains(string(body), `"interval_minutes":10`) || !strings.Contains(string(body), `"interval_minutes":60`) {t.Fatalf("agent list=%d %s", status, body)@@ -964,7 +983,7 @@ func TestRoutineIntervalGridAndSkipRule(t *testing.T) {t.Fatalf("web toggle altered cadence: %s", raw)}}- for _, id := range []string{tenID, sixtyID} {+ for _, id := range []string{tenID, sixtyID, legacyID} {if _, err := env.pool.Exec(t.Context(), `DELETE FROM room_reminders WHERE id=$1`, id); err != nil {t.Fatal(err)}@@ -1120,6 +1139,38 @@ func TestRoutineIntervalGridAndSkipRule(t *testing.T) {if third.MessageID == "" || third.MessageID == second.MessageID {t.Fatalf("third fire after 24h TTL=%+v", third)}++ // Coalesced inbox input (only payload.invocationMessageIds references third.MessageID):+ // blocks while running and unblocks once terminal.+ coalescedRunID := "coalesced-run-" + tc.tag + "-" + suffix+ coalescedInputID := coalescedRunID + "-input"+ coalescedPayload, _ := json.Marshal(map[string]any{"invocationMessageIds": []string{third.MessageID}})+ if _, err := env.pool.Exec(t.Context(), `INSERT INTO agent_local_runs(run_id,context_key,status,status_room_id,started_at) VALUES($1,$2,'running',$3,now())`,+ coalescedRunID, ensured.Context.ContextKey, subRoom); err != nil {+ t.Fatal(err)+ }+ if _, err := env.pool.Exec(t.Context(), `INSERT INTO agent_runtime_inputs(context_key,input_id,input_sequence,payload,payload_hash,source_kind,source_inbox_id,status,local_run_id)+ VALUES($1,$2,9999,$3,decode(repeat('b',64),'hex'),'inbox',$4,'handled',$5)`,+ ensured.Context.ContextKey, coalescedInputID, coalescedPayload, "room:"+subRoom, coalescedRunID); err != nil {+ t.Fatal(err)+ }+ if _, err := env.pool.Exec(t.Context(), `INSERT INTO agent_local_run_inputs(run_id,context_key,input_id,relation,ordinal)+ VALUES($1,$2,$3,'initial',0)`, coalescedRunID, ensured.Context.ContextKey, coalescedInputID); err != nil {+ t.Fatal(err)+ }+ markReminderOverdue(t, env, routineID)+ for _, res := range runReminderWorker(t, env) {+ if res.ReminderID == routineID {+ t.Fatalf("fired while coalesced run still running: %+v", res)+ }+ }+ if _, err := env.pool.Exec(t.Context(), `UPDATE agent_local_runs SET status='succeeded', terminal='{"type":"succeeded"}', finished_at=now() WHERE run_id=$1`, coalescedRunID); err != nil {+ t.Fatal(err)+ }+ fourth := fireReminderOccurrence(t, env, routineID)+ if fourth.MessageID == "" || fourth.MessageID == third.MessageID {+ t.Fatalf("fourth fire after coalesced terminal run=%+v", fourth)+ }})}})diff --git a/apps/web/src/features/rooms/task-sidebar/reminders-panel.test.tsx b/apps/web/src/features/rooms/task-sidebar/reminders-panel.test.tsxindex 857bd8f3..88129b46 100644--- a/apps/web/src/features/rooms/task-sidebar/reminders-panel.test.tsx+++ b/apps/web/src/features/rooms/task-sidebar/reminders-panel.test.tsx@@ -631,6 +631,42 @@ describe("minute-interval routines", () => {);});+ it("shows an error alert when deleting a minute-interval routine fails", async () => {+ const minuteRoutine: TeamHubRoutine = {+ ...reminder,+ id: "routine_min_conflict",+ name: "Check build",+ cadence: {+ kind: "every_n_minutes",+ timezone: "UTC",+ interval_minutes: 10,+ },+ revision: 3,+ };+ const deleteRoutine = vi.fn<TestRouteHandler>(+ () =>+ new Response(+ JSON.stringify({+ error: {+ code: "CONFLICT",+ message: "Routine revision is out of date.",+ request_id: "req-conflict",+ },+ }),+ { status: 409, headers: { "content-type": "application/json" } },+ ),+ );+ renderPanel({+ listRoomRoutines: list([minuteRoutine]),+ deleteRoutine,+ });+ expect(await screen.findByText("Check build")).toBeVisible();+ fireEvent.click(screen.getByRole("button", { name: "Delete routine" }));+ expect(await screen.findByRole("alert")).toHaveTextContent(+ /revision is out of date/i,+ );+ });+it("keeps creating and editing hourly routines unchanged without minute options", async () => {const createRoomRoutine = vi.fn<TestRouteHandler>(() => reminder);renderPanel({ listRoomRoutines: list([]), createRoomRoutine });diff --git a/apps/web/src/features/rooms/task-sidebar/reminders-panel.tsx b/apps/web/src/features/rooms/task-sidebar/reminders-panel.tsxindex b417e4e4..dda9d441 100644--- a/apps/web/src/features/rooms/task-sidebar/reminders-panel.tsx+++ b/apps/web/src/features/rooms/task-sidebar/reminders-panel.tsx@@ -15,7 +15,7 @@ import {SettingsRow,SettingsRowText,} from "@/components/ui/settings-group";-import { teamHubData, teamHubDone } from "@/features/teamhub/teamhub-api";+import { teamHubData } from "@/features/teamhub/teamhub-api";import { type TeamHubClient } from "@/features/teamhub/teamhub-client";import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";import type {@@ -39,7 +39,7 @@ import {isEditableRoutine,isScheduled,} from "./routine-cadence";-import { RoutineDialog } from "./routine-dialog";+import { deleteRoomRoutine, RoutineDialog } from "./routine-dialog";import { PanelLoading } from "./panel-loading";/** One Agent's Routines in a Room, laid out by the day they next run. */@@ -153,6 +153,7 @@ function RoutineAgenda({}) {const queryClient = useQueryClient();const [showDone, setShowDone] = useState(false);+ const [deleteError, setDeleteError] = useState<string | null>(null);// The Routine as the last pause or enable left it, offered for undo for a// few seconds.const [offer, setOffer] = useState<{@@ -202,10 +203,12 @@ function RoutineAgenda({);}const onToggled = (routine: TeamHubRoutine) => {+ setDeleteError(null);undo.reset();setOffer({ routine, secondsLeft: UNDO_SECONDS });};const onDeleted = (routineId: string) => {+ setDeleteError(null);setOffer((current) => (current?.routine.id === routineId ? null : current));};const scheduled = routines.filter(isScheduled);@@ -225,9 +228,21 @@ function RoutineAgenda({);const done = scheduled.filter(isDone);const upcoming = [...reminders].sort((a, b) => runTime(a) - runTime(b));- const rowProps = { agentActorId, client, onDeleted, onToggled, tenantId };+ const rowProps = {+ agentActorId,+ client,+ onDeleteError: setDeleteError,+ onDeleted,+ onToggled,+ tenantId,+ };return (<div className="flex min-h-0 flex-1 flex-col gap-5 pb-6 font-(family-name:--app-room-font)">+ {deleteError ? (+ <p className="px-1.5 text-sm text-destructive" role="alert">+ {deleteError}+ </p>+ ) : null}{scheduled.length === 0 && listeners.length === 0 ? (<SettingsGroup ariaLabel="No routines"><SettingsRow icon={<Icon icon={Clock01Icon} size={16} />}>@@ -404,6 +419,7 @@ interface ToggleProps {function RoutineRow({agentActorId,detail,+ onDeleteError,onDeleted,onOpen,routine,@@ -411,6 +427,7 @@ function RoutineRow({}: ToggleProps & {agentActorId?: string;detail: string;+ onDeleteError: (message: string | null) => void;onDeleted: (routineId: string) => void;onOpen: () => void;routine: TeamHubScheduledRoutine;@@ -445,6 +462,7 @@ function RoutineRow({<RoutineDeleteButtonclient={toggle.client}onDeleted={() => onDeleted(routine.id)}+ onError={onDeleteError}routine={routine}tenantId={toggle.tenantId}/>@@ -477,31 +495,30 @@ function RoutineRow({function RoutineDeleteButton({client,onDeleted,+ onError,routine,tenantId,}: {client: TeamHubClient;onDeleted: () => void;+ onError: (message: string | null) => void;routine: TeamHubScheduledRoutine;tenantId: string;}) {const queryClient = useQueryClient();const remove = useMutation({- mutationFn: () =>- teamHubDone(- client.api.DELETE("/v0/routines/{routineId}", {- params: {- path: { routineId: routine.id },- query: { expected_revision: routine.revision },- },- }),- ),+ mutationFn: () => deleteRoomRoutine(client, routine),+ onMutate: () => onError(null),onSuccess: async () => {onDeleted();await queryClient.invalidateQueries({queryKey: roomRoutinesQueryKey(tenantId, routine.room_id),});},+ onError: (cause) =>+ onError(+ cause instanceof Error ? cause.message : "Could not delete routine.",+ ),});return (<buttondiff --git a/apps/web/src/features/rooms/task-sidebar/routine-dialog.tsx b/apps/web/src/features/rooms/task-sidebar/routine-dialog.tsxindex 07551ff4..d661141b 100644--- a/apps/web/src/features/rooms/task-sidebar/routine-dialog.tsx+++ b/apps/web/src/features/rooms/task-sidebar/routine-dialog.tsx@@ -71,6 +71,21 @@ function routineName(draft: RoutineDraft) {return draft.instruction.trim().split("\n")[0]!.slice(0, 60).trim();}+/** Deletes a scheduled Routine at its current revision. */+export function deleteRoomRoutine(+ client: TeamHubClient,+ routine: Pick<TeamHubScheduledRoutine, "id" | "revision">,+) {+ return teamHubDone(+ client.api.DELETE("/v0/routines/{routineId}", {+ params: {+ path: { routineId: routine.id },+ query: { expected_revision: routine.revision },+ },+ }),+ );+}+export function RoutineDialog({agentScoped = false,client,@@ -144,14 +159,7 @@ export function RoutineDialog({const remove = useMutation({mutationFn: async () => {if (!routine) return;- await teamHubDone(- client.api.DELETE("/v0/routines/{routineId}", {- params: {- path: { routineId: routine.id },- query: { expected_revision: routine.revision },- },- }),- );+ await deleteRoomRoutine(client, routine);},onSuccess: onSaved,onError: fail("Could not delete routine."),diff --git a/contracts/generated/go/teamhubagentapi/openapi.gen.go b/contracts/generated/go/teamhubagentapi/openapi.gen.goindex 79620c3b..83ad040e 100644--- a/contracts/generated/go/teamhubagentapi/openapi.gen.go+++ b/contracts/generated/go/teamhubagentapi/openapi.gen.go@@ -662,6 +662,7 @@ func (e AgentRoutineListenerApp) Valid() bool {// Defines values for AgentRoutineScheduleKind.const (Daily AgentRoutineScheduleKind = "daily"+ EveryNHours AgentRoutineScheduleKind = "every_n_hours"EveryNMinutes AgentRoutineScheduleKind = "every_n_minutes"Once AgentRoutineScheduleKind = "once"Weekly AgentRoutineScheduleKind = "weekly"@@ -672,6 +673,8 @@ func (e AgentRoutineScheduleKind) Valid() bool {switch e {case Daily:return true+ case EveryNHours:+ return truecase EveryNMinutes:return truecase Once:@@ -2306,6 +2309,9 @@ type AgentRoutineResponse struct {// AgentRoutineSchedule defines model for AgentRoutineSchedule.type AgentRoutineSchedule struct {+ // IntervalHours Repeat interval in whole hours for every_n_hours (1 to 168), accepted on input for compatibility with older clients and stored in minutes. Responses always use every_n_minutes with interval_minutes. Do not send a clock or timezone with it.+ IntervalHours *int `json:"interval_hours,omitempty"`+// IntervalMinutes Repeat interval in minutes for every_n_minutes (10 to 10080, in 10-minute increments). Do not send a clock or timezone with it.IntervalMinutes *int `json:"interval_minutes,omitempty"`Kind AgentRoutineScheduleKind `json:"kind"`diff --git a/contracts/generated/typescript/src/generated/teamhub-agent-api/types.ts b/contracts/generated/typescript/src/generated/teamhub-agent-api/types.tsindex 0a66b898..be862421 100644--- a/contracts/generated/typescript/src/generated/teamhub-agent-api/types.ts+++ b/contracts/generated/typescript/src/generated/teamhub-agent-api/types.ts@@ -2351,7 +2351,7 @@ export interface components {| "sunday";AgentRoutineSchedule: {/** @enum {string} */- kind: "daily" | "weekly" | "every_n_minutes" | "once";+ kind: "daily" | "weekly" | "every_n_minutes" | "every_n_hours" | "once";/** @description Local 24-hour clock as HH:MM. Required for daily and weekly. */time?: string;/** @description IANA timezone. Required for daily and weekly. */@@ -2360,6 +2360,8 @@ export interface components {weekdays?: components["schemas"]["AgentRoutineWeekday"][];/** @description Repeat interval in minutes for every_n_minutes (10 to 10080, in 10-minute increments). Do not send a clock or timezone with it. */interval_minutes?: number;+ /** @description Repeat interval in whole hours for every_n_hours (1 to 168), accepted on input for compatibility with older clients and stored in minutes. Responses always use every_n_minutes with interval_minutes. Do not send a clock or timezone with it. */+ interval_hours?: number;/*** Format: date-time* @description The one moment a once Routine fires (RFC 3339 with offset). It must be in the future; the Routine is done (disabled) after it fires. Timezone is optional and only used for display.diff --git a/contracts/openapi/components/agent-collaboration.yaml b/contracts/openapi/components/agent-collaboration.yamlindex 4b6b204d..31d093d6 100644--- a/contracts/openapi/components/agent-collaboration.yaml+++ b/contracts/openapi/components/agent-collaboration.yaml@@ -1365,7 +1365,7 @@ components:properties:kind:type: string- enum: [daily, weekly, every_n_minutes, once]+ enum: [daily, weekly, every_n_minutes, every_n_hours, once]time:type: stringdescription: Local 24-hour clock as HH:MM. Required for daily and weekly.@@ -1389,6 +1389,11 @@ components:maximum: 10080multipleOf: 10description: Repeat interval in minutes for every_n_minutes (10 to 10080, in 10-minute increments). Do not send a clock or timezone with it.+ interval_hours:+ type: integer+ minimum: 1+ maximum: 168+ description: Repeat interval in whole hours for every_n_hours (1 to 168), accepted on input for compatibility with older clients and stored in minutes. Responses always use every_n_minutes with interval_minutes. Do not send a clock or timezone with it.run_at:type: stringformat: date-time