diff --git a/go.mod b/go.mod index 54dc92f..fd51f2d 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/flashcatcloud/flashduty-cli go 1.26.0 require ( - github.com/flashcatcloud/go-flashduty v0.15.19 + github.com/flashcatcloud/go-flashduty v0.15.20 github.com/mattn/go-runewidth v0.0.30 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 diff --git a/go.sum b/go.sum index 874059d..9a23ee1 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/clipperhouse/uax29/v2 v2.2.0 h1:ChwIKnQN3kcZteTXMgb1wztSgaU+ZemkgWdohwgs8tY= github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= -github.com/flashcatcloud/go-flashduty v0.15.19 h1:QDb15Dssyb/q3n9UgCQHH7kNtuyyRw0Den6isoJ0gLU= -github.com/flashcatcloud/go-flashduty v0.15.19/go.mod h1:YpHiTYXR5NXBI/rGRZfUy537XMkhdCkwA8NW1QoRHwk= +github.com/flashcatcloud/go-flashduty v0.15.20 h1:VFWxpansyQRcwPS5F0hzM+P3zyiaFcaRsMkVpi/9SPE= +github.com/flashcatcloud/go-flashduty v0.15.20/go.mod h1:YpHiTYXR5NXBI/rGRZfUy537XMkhdCkwA8NW1QoRHwk= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/mattn/go-runewidth v0.0.30 h1:+KUuiDA4fF0R1p5FeueHefjDm+GIM+kWfFnDjybOPgk= diff --git a/internal/cli/automation.go b/internal/cli/automation.go index b7d8178..5c7140b 100644 --- a/internal/cli/automation.go +++ b/internal/cli/automation.go @@ -12,8 +12,10 @@ import ( "github.com/flashcatcloud/flashduty-cli/internal/timeutil" ) -const automationHTTPPostOnlyCron = "0 0 * * *" -const automationTimezoneNote = "The rule's timezone defaults to the caller's member timezone, then the account timezone; pass the user's local wall-clock time here, do not convert it to UTC." +const ( + automationHTTPPostOnlyCron = "0 0 * * *" + automationTimezoneNote = "The rule's timezone defaults to the caller's member timezone, then the account timezone; pass the user's local wall-clock time here, do not convert it to UTC." +) func newAutomationCmd() *cobra.Command { cmd := newGroupCmd("automation", "Manage AI SRE Automations") @@ -36,21 +38,24 @@ func newAutomationCmd() *cobra.Command { func newAutomationCreateCmd() *cobra.Command { var ( - name string - teamID int64 - schedule string - at string - weekday string - cronExpr string - disabled bool - scheduleEnabled = true - httpPostTrigger bool - prompt string - promptFile string - environmentKind string - environmentID string - runIn string - timezone string + name string + teamID int64 + schedule string + at string + weekday string + cronExpr string + disabled bool + scheduleEnabled = true + httpPostTrigger bool + prompt string + promptFile string + environmentKind string + environmentID string + runIn string + timezone string + warRoomTrigger bool + warRoomChannels []int64 + warRoomSeverities []string ) cmd := &cobra.Command{ @@ -86,7 +91,14 @@ or session identifiers: the server resolves and authorizes the current chat. wildcards, ranges, lists, and steps are unsupported. For HTTP POST-only rules, pass --http-post-trigger without a schedule; the CLI - sends a valid placeholder cron and disables the schedule trigger.`, "Automations", "RuleWriteCreate"), + sends a valid placeholder cron and disables the schedule trigger. + + For a war room trigger, pass --war-room-trigger together with + --war-room-channel-ids and --war-room-severities. When an AI SRE war room + (IM group chat) is created for a matching incident, the agent runs inside + that group chat. A war-room-only rule needs no schedule flags: the CLI + sends a placeholder cron and disables the schedule trigger, same as an + HTTP POST-only rule.`, "Automations", "RuleWriteCreate"), Example: ` flashduty automation create --name "Daily SRE brief" --schedule daily --at 01:30 --prompt "Summarize yesterday's incidents" flashduty automation create --name "Weekly noise review" --team-id 123 --schedule weekly --weekday mon --at 02:00 --prompt-file ./prompt.md flashduty automation create --name "Webhook triage" --http-post-trigger --prompt "Handle the posted payload"`, @@ -103,6 +115,9 @@ or session identifiers: the server resolves and authorizes the current chat. if strings.TrimSpace(taskPrompt) == "" { return fmt.Errorf("one of --prompt or --prompt-file is required") } + if warRoomTrigger && (len(warRoomChannels) == 0 || len(warRoomSeverities) == 0) { + return fmt.Errorf("--war-room-trigger requires --war-room-channel-ids and --war-room-severities") + } if cmd.Flags().Changed("run-in") { runIn = strings.TrimSpace(runIn) if runIn != "current-chat" && runIn != "web" { @@ -111,7 +126,7 @@ or session identifiers: the server resolves and authorizes the current chat. } effectiveScheduleEnabled := scheduleEnabled - cron, err := resolveAutomationCreateCron(cmd, schedule, at, weekday, cronExpr, httpPostTrigger, &effectiveScheduleEnabled) + cron, err := resolveAutomationCreateCron(cmd, schedule, at, weekday, cronExpr, httpPostTrigger || warRoomTrigger, &effectiveScheduleEnabled) if err != nil { return err } @@ -125,6 +140,13 @@ or session identifiers: the server resolves and authorizes the current chat. Prompt: taskPrompt, EnvironmentKind: strings.TrimSpace(environmentKind), EnvironmentID: strings.TrimSpace(environmentID), + WarRoomTriggerEnabled: warRoomTrigger, + } + if cmd.Flags().Changed("war-room-channel-ids") { + req.WarRoomChannelIDs = warRoomChannels + } + if cmd.Flags().Changed("war-room-severities") { + req.WarRoomSeverities = warRoomSeverities } if cmd.Flags().Changed("team-id") { req.TeamID = flashduty.Int64(teamID) @@ -155,6 +177,9 @@ or session identifiers: the server resolves and authorizes the current chat. cmd.Flags().BoolVar(&disabled, "disabled", false, "Create the Automation disabled") cmd.Flags().BoolVar(&scheduleEnabled, "schedule-enabled", true, "Whether the schedule trigger is enabled") cmd.Flags().BoolVar(&httpPostTrigger, "http-post-trigger", false, "Create and enable an HTTP POST trigger") + cmd.Flags().BoolVar(&warRoomTrigger, "war-room-trigger", false, "Create and enable the AI SRE war room trigger; requires --war-room-channel-ids and --war-room-severities") + cmd.Flags().Int64SliceVar(&warRoomChannels, "war-room-channel-ids", nil, "Channel (collaboration space) IDs whose new AI SRE war rooms trigger this Automation; at least one") + cmd.Flags().StringSliceVar(&warRoomSeverities, "war-room-severities", nil, "War room severities that trigger this Automation: Critical, Warning, or Info; at least one") cmd.Flags().StringVar(&prompt, "prompt", "", "Self-contained task prompt for the fresh AI SRE execution; include needed chat context and do not refer to earlier messages or 'above'") cmd.Flags().StringVar(&promptFile, "prompt-file", "", "Read task prompt from a file, or - for stdin") cmd.Flags().StringVar(&environmentKind, "environment-kind", "", "Runtime environment kind: cloud or byoc; empty means automatic") @@ -250,6 +275,10 @@ func newAutomationUpdateCmd() *cobra.Command { disableHTTPPostTrigger bool rotateHTTPPostToken bool timezone string + enableWarRoomTrigger bool + disableWarRoomTrigger bool + warRoomChannels []int64 + warRoomSeverities []string ) cmd := &cobra.Command{ @@ -267,10 +296,16 @@ func newAutomationUpdateCmd() *cobra.Command { to UTC first. An explicit empty --timezone "" is sent and stored as UTC, not the account default. Update recalculates the next fire immediately; read schedule_next_fire_at_ms from the response and do not assume the - previously scheduled occurrence will still run.`, "Automations", "RuleWriteUpdate"), + previously scheduled occurrence will still run. + + Use --enable-war-room-trigger or --disable-war-room-trigger to toggle the + AI SRE war room trigger; --war-room-channel-ids and --war-room-severities + replace its filters. Creating the trigger through update requires both + filter lists.`, "Automations", "RuleWriteUpdate"), Example: ` flashduty automation update auto_123 --name "Daily brief v2" --cron-expr "15 1 * * *" flashduty automation update auto_123 --disable - flashduty automation update auto_123 --enable-http-post-trigger --rotate-http-post-token`, + flashduty automation update auto_123 --enable-http-post-trigger --rotate-http-post-token + flashduty automation update auto_123 --enable-war-room-trigger --war-room-channel-ids 3521074710131 --war-room-severities Critical,Warning`, Args: requireExactArg("rule_id"), PreRunE: func(cmd *cobra.Command, args []string) error { if enableRule && disableRule { @@ -282,6 +317,9 @@ func newAutomationUpdateCmd() *cobra.Command { if enableHTTPPostTrigger && disableHTTPPostTrigger { return fmt.Errorf("only one of --enable-http-post-trigger or --disable-http-post-trigger may be set") } + if enableWarRoomTrigger && disableWarRoomTrigger { + return fmt.Errorf("only one of --enable-war-room-trigger or --disable-war-room-trigger may be set") + } return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -349,6 +387,22 @@ func newAutomationUpdateCmd() *cobra.Command { req.RotateHTTPPostTriggerToken = true changed = true } + if enableWarRoomTrigger { + req.WarRoomTriggerEnabled = flashduty.Bool(true) + changed = true + } + if disableWarRoomTrigger { + req.WarRoomTriggerEnabled = flashduty.Bool(false) + changed = true + } + if cmd.Flags().Changed("war-room-channel-ids") { + req.WarRoomChannelIDs = &warRoomChannels + changed = true + } + if cmd.Flags().Changed("war-room-severities") { + req.WarRoomSeverities = &warRoomSeverities + changed = true + } if !changed { return fmt.Errorf("at least one update field is required") } @@ -379,6 +433,10 @@ func newAutomationUpdateCmd() *cobra.Command { cmd.Flags().BoolVar(&enableHTTPPostTrigger, "enable-http-post-trigger", false, "Enable or create the HTTP POST trigger") cmd.Flags().BoolVar(&disableHTTPPostTrigger, "disable-http-post-trigger", false, "Disable the HTTP POST trigger") cmd.Flags().BoolVar(&rotateHTTPPostToken, "rotate-http-post-token", false, "Rotate the HTTP POST trigger token") + cmd.Flags().BoolVar(&enableWarRoomTrigger, "enable-war-room-trigger", false, "Enable or create the AI SRE war room trigger; creating it requires both filter lists") + cmd.Flags().BoolVar(&disableWarRoomTrigger, "disable-war-room-trigger", false, "Disable the AI SRE war room trigger") + cmd.Flags().Int64SliceVar(&warRoomChannels, "war-room-channel-ids", nil, "Replace the war room trigger's channel (collaboration space) IDs; at least one") + cmd.Flags().StringSliceVar(&warRoomSeverities, "war-room-severities", nil, "Replace the war room trigger's severities: Critical, Warning, or Info; at least one") registerEnumFlag(cmd, "schedule", "hourly", "daily", "weekly", "cron") registerEnumFlag(cmd, "environment-kind", "cloud", "byoc") return cmd @@ -465,7 +523,7 @@ func newAutomationRunsCmd() *cobra.Command { cmd.Flags().StringVar(&status, "status", "", "Run status filter") cmd.Flags().StringVar(&triggerKind, "trigger-kind", "", "Trigger kind filter: schedule, debug, or http_post") registerEnumFlag(cmd, "status", "queued", "running", "retrying", "succeeded", "partial", "failed", "skipped", "abandoned") - registerEnumFlag(cmd, "trigger-kind", "schedule", "debug", "http_post") + registerEnumFlag(cmd, "trigger-kind", "schedule", "debug", "http_post", "war_room_created") return cmd } diff --git a/internal/cli/automation_test.go b/internal/cli/automation_test.go index 79c8d58..027dc2b 100644 --- a/internal/cli/automation_test.go +++ b/internal/cli/automation_test.go @@ -298,6 +298,130 @@ func TestSafariAutomationRuleUpdateTimezone(t *testing.T) { assertBody(t, stub.lastBody, "timezone", "Europe/London") } +func TestAutomationCreateWarRoomOnly(t *testing.T) { + saveAndResetGlobals(t) + stub := newGFStub(t) + + _, err := execCommand( + "automation", "create", + "--name", "War room responder", + "--war-room-trigger", + "--war-room-channel-ids", "3521074710131,3521074710132", + "--war-room-severities", "Critical,Warning", + "--prompt", "Triage the incident inside the war room", + "--json", + ) + if err != nil { + t.Fatalf("[automation-create-war-room-only] unexpected error: %v", err) + } + if stub.lastPath != "/safari/automation/rule/create" { + t.Fatalf("[automation-create-war-room-only] path = %q", stub.lastPath) + } + assertBody(t, stub.lastBody, "cron_expr", automationHTTPPostOnlyCron) + assertBody(t, stub.lastBody, "schedule_trigger_enabled", false) + assertBody(t, stub.lastBody, "war_room_trigger_enabled", true) + assertBody(t, stub.lastBody, "war_room_channel_ids", []any{float64(3521074710131), float64(3521074710132)}) + assertBody(t, stub.lastBody, "war_room_severities", []any{"Critical", "Warning"}) +} + +func TestAutomationCreateWarRoomKeepsSchedule(t *testing.T) { + saveAndResetGlobals(t) + stub := newGFStub(t) + + _, err := execCommand( + "automation", "create", + "--name", "Daily war room check", + "--schedule", "daily", + "--at", "09:00", + "--war-room-trigger", + "--war-room-channel-ids", "3521074710131", + "--war-room-severities", "Critical", + "--prompt", "Check open war rooms", + "--json", + ) + if err != nil { + t.Fatalf("[automation-create-war-room-scheduled] unexpected error: %v", err) + } + assertBody(t, stub.lastBody, "cron_expr", "0 9 * * *") + assertBody(t, stub.lastBody, "schedule_trigger_enabled", true) + assertBody(t, stub.lastBody, "war_room_trigger_enabled", true) +} + +func TestAutomationCreateWarRoomRequiresFilters(t *testing.T) { + saveAndResetGlobals(t) + newGFStub(t) + + _, err := execCommand( + "automation", "create", + "--name", "Broken", + "--war-room-trigger", + "--prompt", "missing filters", + "--json", + ) + if err == nil || !strings.Contains(err.Error(), "--war-room-trigger requires --war-room-channel-ids and --war-room-severities") { + t.Fatalf("[automation-create-war-room-missing-filters] err = %v", err) + } +} + +func TestAutomationCreateWarRoomOmitsUnsetFilters(t *testing.T) { + saveAndResetGlobals(t) + stub := newGFStub(t) + + _, err := execCommand( + "automation", "create", + "--name", "Plain daily", + "--schedule", "daily", + "--at", "09:00", + "--prompt", "plain", + "--json", + ) + if err != nil { + t.Fatalf("[automation-create-war-room-omitted] unexpected error: %v", err) + } + for _, field := range []string{"war_room_trigger_enabled", "war_room_channel_ids", "war_room_severities"} { + if _, ok := stub.lastBody[field]; ok { + t.Fatalf("[automation-create-war-room-omitted] %s must be omitted, body=%#v", field, stub.lastBody) + } + } +} + +func TestAutomationUpdateWarRoomTrigger(t *testing.T) { + saveAndResetGlobals(t) + stub := newGFStub(t) + + _, err := execCommand( + "automation", "update", "auto_123", + "--enable-war-room-trigger", + "--war-room-channel-ids", "3521074710131", + "--war-room-severities", "Critical", + "--json", + ) + if err != nil { + t.Fatalf("[automation-update-war-room] unexpected error: %v", err) + } + if stub.lastPath != "/safari/automation/rule/update" { + t.Fatalf("[automation-update-war-room] path = %q", stub.lastPath) + } + assertBody(t, stub.lastBody, "war_room_trigger_enabled", true) + assertBody(t, stub.lastBody, "war_room_channel_ids", []any{float64(3521074710131)}) + assertBody(t, stub.lastBody, "war_room_severities", []any{"Critical"}) +} + +func TestAutomationUpdateWarRoomTriggerConflict(t *testing.T) { + saveAndResetGlobals(t) + newGFStub(t) + + _, err := execCommand( + "automation", "update", "auto_123", + "--enable-war-room-trigger", + "--disable-war-room-trigger", + "--json", + ) + if err == nil || !strings.Contains(err.Error(), "only one of --enable-war-room-trigger or --disable-war-room-trigger") { + t.Fatalf("[automation-update-war-room-conflict] err = %v", err) + } +} + func TestAutomationCreateHTTPPostOnly(t *testing.T) { saveAndResetGlobals(t) stub := newGFStub(t) diff --git a/internal/cli/zz_generated_automations.go b/internal/cli/zz_generated_automations.go index 53e299d..e85773a 100644 --- a/internal/cli/zz_generated_automations.go +++ b/internal/cli/zz_generated_automations.go @@ -59,6 +59,10 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - team_id (integer) (required) — Scope team ID; 0 means personal rule. - timezone (string) (required) — IANA timezone 'cron_expr' is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled. - updated_at (string) (required) — Last update time, Unix milliseconds. CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null. + - war_room_channel_ids (array) — Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger. + - war_room_severities (array) — Incident severities whose war rooms start a run: 'Critical' (most severe), 'Warning', or 'Info' (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger. [Critical, Warning, Info] + - war_room_trigger_enabled (boolean) — Whether the war room trigger is enabled. + - war_room_trigger_id (string) — War room trigger ID. Omitted when the rule has no war room trigger. `, Args: requireBodyFieldOrExactArg("rule_id", "rule-id"), Example: ` flashduty safari automation-rule-get --data '{"rule_id":"arule_7NnLzY2Qp8xS4kUaV3mR6b"}'`, @@ -159,6 +163,10 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - team_id (integer) (required) — Scope team ID; 0 means personal rule. - timezone (string) (required) — IANA timezone 'cron_expr' is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled. - updated_at (string) (required) — Last update time, Unix milliseconds. CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null. + - war_room_channel_ids (array) — Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger. + - war_room_severities (array) — Incident severities whose war rooms start a run: 'Critical' (most severe), 'Warning', or 'Info' (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger. [Critical, Warning, Info] + - war_room_trigger_enabled (boolean) — Whether the war room trigger is enabled. + - war_room_trigger_id (string) — War room trigger ID. Omitted when the rule has no war room trigger. - total (integer) (required) — Total count. `, Example: ` flashduty safari automation-rule-list --data '{"limit":20,"scope":"all"}'`, @@ -234,6 +242,9 @@ func genAutomationsRuleWriteCreateCmd() *cobra.Command { var fScheduleTriggerEnabled bool var fTeamID int64 var fTimezone string + var fWarRoomChannelIDs []int + var fWarRoomSeverities []string + var fWarRoomTriggerEnabled bool cmd := &cobra.Command{ Use: "automation-rule-create", Short: "Create Automation rule", @@ -258,6 +269,9 @@ Request fields: --schedule-trigger-enabled bool — Whether the schedule trigger is enabled. Defaults to true when omitted; HTTP-POST-only rules should send false. --team-id int — Scope team ID. Explicit 0 means personal scope; >0 means a team in the account. Omit it to inherit the authenticated IM conversation scope when one is available, otherwise let the server select the normal default. A current-chat rule must match that conversation's scope. (min 0) --timezone string — IANA timezone 'cron_expr' is evaluated in, e.g. 'Asia/Shanghai'. Must be a timezone name loadable by the server; an invalid value is rejected. Defaults to the caller's member timezone, then the account timezone, then the server default (Asia/Shanghai) when omitted. + --war-room-channel-ids []int — Channel IDs whose war rooms start a run. Each ID must be positive. + --war-room-severities []string — Incident severities that start a run when their war room is created: 'Critical' (most severe), 'Warning', or 'Info' (least severe) — the On-call incident severity levels. [Critical, Warning, Info] + --war-room-trigger-enabled bool — Whether the war room trigger is enabled. It fires when a war room (IM group chat) is created for an incident in one of 'war_room_channel_ids' with a severity in 'war_room_severities'; the agent then runs inside that group chat. When the trigger is created (this is 'true', or 'war_room_channel_ids' is sent), both lists must be non-empty. Response fields ('data' envelope is unwrapped — these fields are at the top level): - account_id (integer) (required) — Account ID. @@ -295,6 +309,10 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - team_id (integer) (required) — Scope team ID; 0 means personal rule. - timezone (string) (required) — IANA timezone 'cron_expr' is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled. - updated_at (string) (required) — Last update time, Unix milliseconds. CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null. + - war_room_channel_ids (array) — Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger. + - war_room_severities (array) — Incident severities whose war rooms start a run: 'Critical' (most severe), 'Warning', or 'Info' (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger. [Critical, Warning, Info] + - war_room_trigger_enabled (boolean) — Whether the war room trigger is enabled. + - war_room_trigger_id (string) — War room trigger ID. Omitted when the rule has no war room trigger. `, Example: ` flashduty safari automation-rule-create --data '{"cron_expr":"0 9 * * 1","enabled":true,"http_post_trigger_enabled":true,"name":"Weekly on-call review","oncall_incident_channel_ids":[456],"oncall_incident_severities":["Critical","Warning"],"oncall_incident_trigger_enabled":true,"prompt":"Summarize last week'\''s alert noise and escalation load.","schedule_trigger_enabled":true,"team_id":123,"timezone":"Asia/Shanghai"}'`, RunE: func(cmd *cobra.Command, args []string) error { @@ -342,6 +360,15 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le if cmd.Flags().Changed("timezone") { body["timezone"] = fTimezone } + if cmd.Flags().Changed("war-room-channel-ids") { + body["war_room_channel_ids"] = fWarRoomChannelIDs + } + if cmd.Flags().Changed("war-room-severities") { + body["war_room_severities"] = fWarRoomSeverities + } + if cmd.Flags().Changed("war-room-trigger-enabled") { + body["war_room_trigger_enabled"] = fWarRoomTriggerEnabled + } return nil }) if err != nil { @@ -373,6 +400,9 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le cmd.Flags().BoolVar(&fScheduleTriggerEnabled, "schedule-trigger-enabled", false, "Whether the schedule trigger is enabled. Defaults to true when omitted; HTTP-POST-only rules should send false.") cmd.Flags().Int64Var(&fTeamID, "team-id", 0, "Scope team ID. Explicit 0 means personal scope; >0 means a team in the account. Omit it to inherit the authenticated IM conversation scope when one is available, otherwise let the server select the normal default. A current-chat rule must match that conversation's scope. (min 0)") cmd.Flags().StringVar(&fTimezone, "timezone", "", "IANA timezone 'cron_expr' is evaluated in, e.g. 'Asia/Shanghai'. Must be a timezone name loadable by the server; an invalid value is rejected. Defaults to the caller's member timezone, then the account timezone, then the server default (Asia/Shanghai) when omitted.") + cmd.Flags().IntSliceVar(&fWarRoomChannelIDs, "war-room-channel-ids", nil, "Channel IDs whose war rooms start a run. Each ID must be positive.") + cmd.Flags().StringSliceVar(&fWarRoomSeverities, "war-room-severities", nil, "Incident severities that start a run when their war room is created: 'Critical' (most severe), 'Warning', or 'Info' (least severe) — the On-call incident severity levels. [Critical, Warning, Info]") + cmd.Flags().BoolVar(&fWarRoomTriggerEnabled, "war-room-trigger-enabled", false, "Whether the war room trigger is enabled. It fires when a war room (IM group chat) is created for an incident in one of 'war_room_channel_ids' with a severity in 'war_room_severities'; the agent then runs inside that group chat. When the trigger is created (this is 'true', or 'war_room_channel_ids' is sent), both lists must be non-empty.") cmd.Flags().StringVar(&dataJSON, "data", "", "Full request body as JSON; positional arguments and typed flags override its fields. Accepts inline JSON, or - to read stdin.") return cmd } @@ -504,6 +534,9 @@ func genAutomationsRuleWriteUpdateCmd() *cobra.Command { var fOncallIncidentTriggerEnabled bool var fOncallIncidentChannelIDs []int var fOncallIncidentSeverities []string + var fWarRoomTriggerEnabled bool + var fWarRoomChannelIDs []int + var fWarRoomSeverities []string cmd := &cobra.Command{ Use: "automation-rule-update ", Short: "Update Automation rule", @@ -528,6 +561,9 @@ Request fields: --oncall-incident-trigger-enabled bool — Whether the On-call incident trigger is enabled. --oncall-incident-channel-ids []int — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. --oncall-incident-severities []string — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. [Critical, Warning, Info] + --war-room-trigger-enabled bool + --war-room-channel-ids []int + --war-room-severities []string Response fields ('data' envelope is unwrapped — these fields are at the top level): - account_id (integer) (required) — Account ID. @@ -565,6 +601,10 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - team_id (integer) (required) — Scope team ID; 0 means personal rule. - timezone (string) (required) — IANA timezone 'cron_expr' is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled. - updated_at (string) (required) — Last update time, Unix milliseconds. CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null. + - war_room_channel_ids (array) — Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger. + - war_room_severities (array) — Incident severities whose war rooms start a run: 'Critical' (most severe), 'Warning', or 'Info' (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger. [Critical, Warning, Info] + - war_room_trigger_enabled (boolean) — Whether the war room trigger is enabled. + - war_room_trigger_id (string) — War room trigger ID. Omitted when the rule has no war room trigger. `, Args: requireBodyFieldOrExactArg("rule_id", "rule-id"), Example: ` flashduty safari automation-rule-update --data '{"cron_expr":"15 9 * * 1","enabled":true,"oncall_incident_channel_ids":[456],"oncall_incident_severities":["Critical","Warning"],"oncall_incident_trigger_enabled":true,"rotate_http_post_trigger_token":true,"rule_id":"arule_7NnLzY2Qp8xS4kUaV3mR6b"}'`, @@ -616,6 +656,15 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le if cmd.Flags().Changed("oncall-incident-severities") { body["oncall_incident_severities"] = fOncallIncidentSeverities } + if cmd.Flags().Changed("war-room-trigger-enabled") { + body["war_room_trigger_enabled"] = fWarRoomTriggerEnabled + } + if cmd.Flags().Changed("war-room-channel-ids") { + body["war_room_channel_ids"] = fWarRoomChannelIDs + } + if cmd.Flags().Changed("war-room-severities") { + body["war_room_severities"] = fWarRoomSeverities + } return nil }) if err != nil { @@ -647,6 +696,9 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le cmd.Flags().BoolVar(&fOncallIncidentTriggerEnabled, "oncall-incident-trigger-enabled", false, "Whether the On-call incident trigger is enabled.") cmd.Flags().IntSliceVar(&fOncallIncidentChannelIDs, "oncall-incident-channel-ids", nil, "On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID.") cmd.Flags().StringSliceVar(&fOncallIncidentSeverities, "oncall-incident-severities", nil, "Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. [Critical, Warning, Info]") + cmd.Flags().BoolVar(&fWarRoomTriggerEnabled, "war-room-trigger-enabled", false, "Request field ") + cmd.Flags().IntSliceVar(&fWarRoomChannelIDs, "war-room-channel-ids", nil, "Request field ") + cmd.Flags().StringSliceVar(&fWarRoomSeverities, "war-room-severities", nil, "Request field ") cmd.Flags().StringVar(&dataJSON, "data", "", "Full request body as JSON; positional arguments and typed flags override its fields. Accepts inline JSON, or - to read stdin.") return cmd } diff --git a/internal/cli/zz_generated_response_help.go b/internal/cli/zz_generated_response_help.go index fe052d1..c72a42a 100644 --- a/internal/cli/zz_generated_response_help.go +++ b/internal/cli/zz_generated_response_help.go @@ -66,11 +66,11 @@ var responseHelpBySDKMethod = map[string]string{ "Artifacts.WriteUpdate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - artifact_id (string) (required) — Artifact ID (`art_` prefix). Also the key of the public-share link.\n - can_edit (boolean) (required) — Whether the caller may manage this artifact (rename, transfer, delete, share): the creator, any member of the owning team, or a manager of the source session.\n - content_type (string) (required) — MIME type of the file.\n - created_at (string) (required) — Unix timestamp in milliseconds when the artifact was published. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - creator_name (string) (required) — Creator's display name.\n - file_id (string) (required) — Presented-file ID (`pf_` prefix) currently holding the artifact's bytes. Changes on every republish.\n - is_mine (boolean) (required) — Whether the caller is the creator.\n - name (string) (required) — Underlying file name including extension.\n - person_id (integer) (required) — Person (member) ID of the creator.\n - public_url (string) — Anonymous public link — a console `/share/artifact/` page served entirely from CDN. Present only while shared; anyone with the link can view it, no login required.\n - session_id (string) (required) — Source session ID (`sess_` prefix) that produced the file.\n - session_title (string) — Source session's title. Omitted when the session has been deleted.\n - share_enabled (boolean) — Whether anonymous public sharing is on. Omitted when false.\n - share_file_id (string) — Presented-file ID the public snapshot was materialized from. When `share_enabled` is true and `file_id` differs from `share_file_id`, the public snapshot is stale — call `/safari/artifact/gallery/share/sync` to refresh it.\n - shared_at (string) — Unix timestamp in milliseconds of the last share enable or snapshot sync. Present only while shared. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - shared_by (integer) — Person ID of the member who enabled sharing. Present only while shared.\n - size (integer) (required) — File size in bytes.\n - team_id (integer) (required) — Owning team ID. `0` means a personal artifact (creator-only management); a positive value means team-owned.\n - team_name (string) — Owning team's display name. Omitted for personal artifacts.\n - title (string) (required) — Display title in the gallery.\n - updated_at (string) (required) — Unix timestamp in milliseconds when the artifact was last updated (rename, transfer, or republish). CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n", "AuditLogs.OperationList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - name (string) (required) — Stable machine-readable operation name for use as a filter.\n - name_cn (string) (required) — Human-readable Chinese label shown in the console.\n", "AuditLogs.Search": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — ID of the account.\n - body (string) (required) — JSON-encoded request body. Bodies containing sensitive fields are base64url-encoded instead; bodies over 10 KB are replaced by a truncation placeholder.\n - created_at (string) (required) — Timestamp of the operation in Unix epoch milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - credential_id (integer) (required) — ID of the credential (the app key ID) when `credential_type` is `app_key`; 0 otherwise.\n - credential_type (string) (required) — Credential type used for the call. `app_key` for a long-lived console app key, `ephemeral_app_key` for a short-lived key issued to AI SRE, and an empty string for member sessions.\n - ip (string) (required) — Client IP address of the caller.\n - is_dangerous (boolean) (required) — True if this is flagged as a high-risk operation.\n - is_write (boolean) (required) — True for mutating operations; false for read-only ones.\n - member_id (integer) (required) — ID of the member who performed the action. 0 when the action was performed by the account principal itself.\n - member_name (string) (required) — Display name of the member. Empty when `member_id` is 0.\n - operation (string) (required) — Stable machine-readable operation name, e.g. `template:write:create`.\n - operation_name (string) (required) — Human-readable Chinese label of the operation (e.g. `创建模板`).\n - params (array) (required) — URL path parameters as an array of key-value pairs, or an empty array when none.\n - Key (string) — Name of a URL path parameter (the `:xxx` placeholder in the route).\n - Value (string) — The actual value of that path parameter in this request.\n - principal_kind (string) (required) — Kind of the caller. `member` — an interactive member session; `service` — an app key credential. [member, service]\n - request_id (string) (required) — Unique request ID for correlation.\n", - "Automations.RuleReadGet": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required) — Account ID.\n - can_edit (boolean) (required) — True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - cron_expr (string) (required) — Normalized 5-field cron expression.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - environment_id (string) (required) — BYOC Runner ID.\n - environment_kind (string) (required) — Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox). [cloud, byoc]\n - execution_location (object) — Read-only Automation execution destination. It never includes a chat, integration, or session identifier.\n - chat_name (string) — Display name of the bound IM conversation when available.\n - conversation_mode (string) — Bound IM conversation mode when execution place is `im`.\n - description (string) (required) — Human-readable destination description.\n - place (string) (required) — Execution destination: `im` or `web_console`. [im, web_console]\n - platform (string) — IM platform when execution place is `im`.\n - run_scope (string) (required) — Pinned execution scope: `person` or `team`. [person, team]\n - team_id (integer) (required) — Pinned scope team ID. 0 means personal scope.\n - execution_place (string) (required) — Configured execution destination for ordinary triggers. War-room triggers resolve their event war room at execution time. [im, web_console]\n - http_post_token (string) — HTTP POST trigger token. Returned only on create or token rotation; save it immediately.\n - http_post_trigger_enabled (boolean) (required) — Whether the HTTP POST trigger is enabled.\n - http_post_trigger_id (string) — HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.\n - http_post_trigger_url (string) — HTTP POST trigger path. Omitted when the rule has no HTTP POST trigger.\n - name (string) (required) — Rule name.\n - oncall_incident_channel_ids (array) — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. Omitted when no On-call incident trigger is configured.\n - oncall_incident_severities (array) — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. Omitted when no On-call incident trigger is configured. [Critical, Warning, Info]\n - oncall_incident_trigger_enabled (boolean) (required) — Whether the On-call incident trigger is enabled.\n - oncall_incident_trigger_id (string) — On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.\n - owner_id (integer) (required) — Creator person ID.\n - prompt (string) (required) — Task prompt.\n - rule_id (string) (required) — Rule ID.\n - run_scope (string) (required) — Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id. [person, team]\n - schedule_next_fire_at_ms (string) (required) — Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - schedule_trigger_enabled (boolean) (required) — Whether the schedule trigger is enabled.\n - schedule_trigger_id (string) — Schedule trigger ID. Omitted if the rule has no schedule trigger.\n - team_id (integer) (required) — Scope team ID; 0 means personal rule.\n - timezone (string) (required) — IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n", - "Automations.RuleReadList": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - rules (array) (required) — Array of automation rules for the current page, used with `total` for pagination.\n - account_id (integer) (required) — Account ID.\n - can_edit (boolean) (required) — True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - cron_expr (string) (required) — Normalized 5-field cron expression.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - environment_id (string) (required) — BYOC Runner ID.\n - environment_kind (string) (required) — Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox). [cloud, byoc]\n - execution_location (object) — Read-only Automation execution destination. It never includes a chat, integration, or session identifier.\n - chat_name (string) — Display name of the bound IM conversation when available.\n - conversation_mode (string) — Bound IM conversation mode when execution place is `im`.\n - description (string) (required) — Human-readable destination description.\n - place (string) (required) — Execution destination: `im` or `web_console`. [im, web_console]\n - platform (string) — IM platform when execution place is `im`.\n - run_scope (string) (required) — Pinned execution scope: `person` or `team`. [person, team]\n - team_id (integer) (required) — Pinned scope team ID. 0 means personal scope.\n - execution_place (string) (required) — Configured execution destination for ordinary triggers. War-room triggers resolve their event war room at execution time. [im, web_console]\n - http_post_token (string) — HTTP POST trigger token. Returned only on create or token rotation; save it immediately.\n - http_post_trigger_enabled (boolean) (required) — Whether the HTTP POST trigger is enabled.\n - http_post_trigger_id (string) — HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.\n - http_post_trigger_url (string) — HTTP POST trigger path. Omitted when the rule has no HTTP POST trigger.\n - name (string) (required) — Rule name.\n - oncall_incident_channel_ids (array) — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. Omitted when no On-call incident trigger is configured.\n - oncall_incident_severities (array) — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. Omitted when no On-call incident trigger is configured. [Critical, Warning, Info]\n - oncall_incident_trigger_enabled (boolean) (required) — Whether the On-call incident trigger is enabled.\n - oncall_incident_trigger_id (string) — On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.\n - owner_id (integer) (required) — Creator person ID.\n - prompt (string) (required) — Task prompt.\n - rule_id (string) (required) — Rule ID.\n - run_scope (string) (required) — Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id. [person, team]\n - schedule_next_fire_at_ms (string) (required) — Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - schedule_trigger_enabled (boolean) (required) — Whether the schedule trigger is enabled.\n - schedule_trigger_id (string) — Schedule trigger ID. Omitted if the rule has no schedule trigger.\n - team_id (integer) (required) — Scope team ID; 0 means personal rule.\n - timezone (string) (required) — IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - total (integer) (required) — Total count.\n", - "Automations.RuleWriteCreate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required) — Account ID.\n - can_edit (boolean) (required) — True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - cron_expr (string) (required) — Normalized 5-field cron expression.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - environment_id (string) (required) — BYOC Runner ID.\n - environment_kind (string) (required) — Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox). [cloud, byoc]\n - execution_location (object) — Read-only Automation execution destination. It never includes a chat, integration, or session identifier.\n - chat_name (string) — Display name of the bound IM conversation when available.\n - conversation_mode (string) — Bound IM conversation mode when execution place is `im`.\n - description (string) (required) — Human-readable destination description.\n - place (string) (required) — Execution destination: `im` or `web_console`. [im, web_console]\n - platform (string) — IM platform when execution place is `im`.\n - run_scope (string) (required) — Pinned execution scope: `person` or `team`. [person, team]\n - team_id (integer) (required) — Pinned scope team ID. 0 means personal scope.\n - execution_place (string) (required) — Configured execution destination for ordinary triggers. War-room triggers resolve their event war room at execution time. [im, web_console]\n - http_post_token (string) — HTTP POST trigger token. Returned only on create or token rotation; save it immediately.\n - http_post_trigger_enabled (boolean) (required) — Whether the HTTP POST trigger is enabled.\n - http_post_trigger_id (string) — HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.\n - http_post_trigger_url (string) — HTTP POST trigger path. Omitted when the rule has no HTTP POST trigger.\n - name (string) (required) — Rule name.\n - oncall_incident_channel_ids (array) — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. Omitted when no On-call incident trigger is configured.\n - oncall_incident_severities (array) — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. Omitted when no On-call incident trigger is configured. [Critical, Warning, Info]\n - oncall_incident_trigger_enabled (boolean) (required) — Whether the On-call incident trigger is enabled.\n - oncall_incident_trigger_id (string) — On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.\n - owner_id (integer) (required) — Creator person ID.\n - prompt (string) (required) — Task prompt.\n - rule_id (string) (required) — Rule ID.\n - run_scope (string) (required) — Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id. [person, team]\n - schedule_next_fire_at_ms (string) (required) — Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - schedule_trigger_enabled (boolean) (required) — Whether the schedule trigger is enabled.\n - schedule_trigger_id (string) — Schedule trigger ID. Omitted if the rule has no schedule trigger.\n - team_id (integer) (required) — Scope team ID; 0 means personal rule.\n - timezone (string) (required) — IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n", + "Automations.RuleReadGet": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required) — Account ID.\n - can_edit (boolean) (required) — True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - cron_expr (string) (required) — Normalized 5-field cron expression.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - environment_id (string) (required) — BYOC Runner ID.\n - environment_kind (string) (required) — Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox). [cloud, byoc]\n - execution_location (object) — Read-only Automation execution destination. It never includes a chat, integration, or session identifier.\n - chat_name (string) — Display name of the bound IM conversation when available.\n - conversation_mode (string) — Bound IM conversation mode when execution place is `im`.\n - description (string) (required) — Human-readable destination description.\n - place (string) (required) — Execution destination: `im` or `web_console`. [im, web_console]\n - platform (string) — IM platform when execution place is `im`.\n - run_scope (string) (required) — Pinned execution scope: `person` or `team`. [person, team]\n - team_id (integer) (required) — Pinned scope team ID. 0 means personal scope.\n - execution_place (string) (required) — Configured execution destination for ordinary triggers. War-room triggers resolve their event war room at execution time. [im, web_console]\n - http_post_token (string) — HTTP POST trigger token. Returned only on create or token rotation; save it immediately.\n - http_post_trigger_enabled (boolean) (required) — Whether the HTTP POST trigger is enabled.\n - http_post_trigger_id (string) — HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.\n - http_post_trigger_url (string) — HTTP POST trigger path. Omitted when the rule has no HTTP POST trigger.\n - name (string) (required) — Rule name.\n - oncall_incident_channel_ids (array) — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. Omitted when no On-call incident trigger is configured.\n - oncall_incident_severities (array) — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. Omitted when no On-call incident trigger is configured. [Critical, Warning, Info]\n - oncall_incident_trigger_enabled (boolean) (required) — Whether the On-call incident trigger is enabled.\n - oncall_incident_trigger_id (string) — On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.\n - owner_id (integer) (required) — Creator person ID.\n - prompt (string) (required) — Task prompt.\n - rule_id (string) (required) — Rule ID.\n - run_scope (string) (required) — Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id. [person, team]\n - schedule_next_fire_at_ms (string) (required) — Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - schedule_trigger_enabled (boolean) (required) — Whether the schedule trigger is enabled.\n - schedule_trigger_id (string) — Schedule trigger ID. Omitted if the rule has no schedule trigger.\n - team_id (integer) (required) — Scope team ID; 0 means personal rule.\n - timezone (string) (required) — IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - war_room_channel_ids (array) — Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger.\n - war_room_severities (array) — Incident severities whose war rooms start a run: `Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger. [Critical, Warning, Info]\n - war_room_trigger_enabled (boolean) — Whether the war room trigger is enabled.\n - war_room_trigger_id (string) — War room trigger ID. Omitted when the rule has no war room trigger.\n", + "Automations.RuleReadList": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - rules (array) (required) — Array of automation rules for the current page, used with `total` for pagination.\n - account_id (integer) (required) — Account ID.\n - can_edit (boolean) (required) — True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - cron_expr (string) (required) — Normalized 5-field cron expression.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - environment_id (string) (required) — BYOC Runner ID.\n - environment_kind (string) (required) — Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox). [cloud, byoc]\n - execution_location (object) — Read-only Automation execution destination. It never includes a chat, integration, or session identifier.\n - chat_name (string) — Display name of the bound IM conversation when available.\n - conversation_mode (string) — Bound IM conversation mode when execution place is `im`.\n - description (string) (required) — Human-readable destination description.\n - place (string) (required) — Execution destination: `im` or `web_console`. [im, web_console]\n - platform (string) — IM platform when execution place is `im`.\n - run_scope (string) (required) — Pinned execution scope: `person` or `team`. [person, team]\n - team_id (integer) (required) — Pinned scope team ID. 0 means personal scope.\n - execution_place (string) (required) — Configured execution destination for ordinary triggers. War-room triggers resolve their event war room at execution time. [im, web_console]\n - http_post_token (string) — HTTP POST trigger token. Returned only on create or token rotation; save it immediately.\n - http_post_trigger_enabled (boolean) (required) — Whether the HTTP POST trigger is enabled.\n - http_post_trigger_id (string) — HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.\n - http_post_trigger_url (string) — HTTP POST trigger path. Omitted when the rule has no HTTP POST trigger.\n - name (string) (required) — Rule name.\n - oncall_incident_channel_ids (array) — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. Omitted when no On-call incident trigger is configured.\n - oncall_incident_severities (array) — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. Omitted when no On-call incident trigger is configured. [Critical, Warning, Info]\n - oncall_incident_trigger_enabled (boolean) (required) — Whether the On-call incident trigger is enabled.\n - oncall_incident_trigger_id (string) — On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.\n - owner_id (integer) (required) — Creator person ID.\n - prompt (string) (required) — Task prompt.\n - rule_id (string) (required) — Rule ID.\n - run_scope (string) (required) — Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id. [person, team]\n - schedule_next_fire_at_ms (string) (required) — Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - schedule_trigger_enabled (boolean) (required) — Whether the schedule trigger is enabled.\n - schedule_trigger_id (string) — Schedule trigger ID. Omitted if the rule has no schedule trigger.\n - team_id (integer) (required) — Scope team ID; 0 means personal rule.\n - timezone (string) (required) — IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - war_room_channel_ids (array) — Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger.\n - war_room_severities (array) — Incident severities whose war rooms start a run: `Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger. [Critical, Warning, Info]\n - war_room_trigger_enabled (boolean) — Whether the war room trigger is enabled.\n - war_room_trigger_id (string) — War room trigger ID. Omitted when the rule has no war room trigger.\n - total (integer) (required) — Total count.\n", + "Automations.RuleWriteCreate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required) — Account ID.\n - can_edit (boolean) (required) — True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - cron_expr (string) (required) — Normalized 5-field cron expression.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - environment_id (string) (required) — BYOC Runner ID.\n - environment_kind (string) (required) — Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox). [cloud, byoc]\n - execution_location (object) — Read-only Automation execution destination. It never includes a chat, integration, or session identifier.\n - chat_name (string) — Display name of the bound IM conversation when available.\n - conversation_mode (string) — Bound IM conversation mode when execution place is `im`.\n - description (string) (required) — Human-readable destination description.\n - place (string) (required) — Execution destination: `im` or `web_console`. [im, web_console]\n - platform (string) — IM platform when execution place is `im`.\n - run_scope (string) (required) — Pinned execution scope: `person` or `team`. [person, team]\n - team_id (integer) (required) — Pinned scope team ID. 0 means personal scope.\n - execution_place (string) (required) — Configured execution destination for ordinary triggers. War-room triggers resolve their event war room at execution time. [im, web_console]\n - http_post_token (string) — HTTP POST trigger token. Returned only on create or token rotation; save it immediately.\n - http_post_trigger_enabled (boolean) (required) — Whether the HTTP POST trigger is enabled.\n - http_post_trigger_id (string) — HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.\n - http_post_trigger_url (string) — HTTP POST trigger path. Omitted when the rule has no HTTP POST trigger.\n - name (string) (required) — Rule name.\n - oncall_incident_channel_ids (array) — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. Omitted when no On-call incident trigger is configured.\n - oncall_incident_severities (array) — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. Omitted when no On-call incident trigger is configured. [Critical, Warning, Info]\n - oncall_incident_trigger_enabled (boolean) (required) — Whether the On-call incident trigger is enabled.\n - oncall_incident_trigger_id (string) — On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.\n - owner_id (integer) (required) — Creator person ID.\n - prompt (string) (required) — Task prompt.\n - rule_id (string) (required) — Rule ID.\n - run_scope (string) (required) — Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id. [person, team]\n - schedule_next_fire_at_ms (string) (required) — Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - schedule_trigger_enabled (boolean) (required) — Whether the schedule trigger is enabled.\n - schedule_trigger_id (string) — Schedule trigger ID. Omitted if the rule has no schedule trigger.\n - team_id (integer) (required) — Scope team ID; 0 means personal rule.\n - timezone (string) (required) — IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - war_room_channel_ids (array) — Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger.\n - war_room_severities (array) — Incident severities whose war rooms start a run: `Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger. [Critical, Warning, Info]\n - war_room_trigger_enabled (boolean) — Whether the war room trigger is enabled.\n - war_room_trigger_id (string) — War room trigger ID. Omitted when the rule has no war room trigger.\n", "Automations.RuleWriteRun": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - preflight (object) (required) — Readiness checks computed before a manual run is allowed to start.\n - app_name (string) (required) — App the rule is scoped to. Currently always ai-sre; manual runs are only supported for that app.\n - checks (array) (required) — Names of the readiness checks performed, in order. Current fixed set: rule_loaded, actor_authorized, app_allowed, runtime_scope_resolved, rule_config_valid.\n - ok (boolean) (required) — Whether all readiness checks passed. Always true in a response that reaches the caller — a failed preflight returns a 400/403 error instead of a payload with ok=false.\n - owner_id (integer) (required) — Rule owner person ID.\n - scope (string) (required) — Resolved run scope for this run; mirrors the rule's run_scope. One of: `person` (personal rule, runs as its creator), `team` (team rule, runs under the owning team). [person, team]\n - team_id (integer) (required) — Rule's scope team ID; 0 means a personal rule.\n - warnings (array) — Non-fatal warnings surfaced during preflight. Omitted or empty when there are none.\n - rule_id (string) (required) — Rule ID that was run.\n - run (object) — Reference to the run started by a manual trigger.\n - run_id (string) (required) — Run ID, always populated once a run is created.\n - session_id (string) — AI SRE session ID for this run. Always populated in a 200 response, since the call only returns after the session has started.\n - trigger_kind (string) (required) — Always manual for this operation. [manual]\n", - "Automations.RuleWriteUpdate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required) — Account ID.\n - can_edit (boolean) (required) — True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - cron_expr (string) (required) — Normalized 5-field cron expression.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - environment_id (string) (required) — BYOC Runner ID.\n - environment_kind (string) (required) — Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox). [cloud, byoc]\n - execution_location (object) — Read-only Automation execution destination. It never includes a chat, integration, or session identifier.\n - chat_name (string) — Display name of the bound IM conversation when available.\n - conversation_mode (string) — Bound IM conversation mode when execution place is `im`.\n - description (string) (required) — Human-readable destination description.\n - place (string) (required) — Execution destination: `im` or `web_console`. [im, web_console]\n - platform (string) — IM platform when execution place is `im`.\n - run_scope (string) (required) — Pinned execution scope: `person` or `team`. [person, team]\n - team_id (integer) (required) — Pinned scope team ID. 0 means personal scope.\n - execution_place (string) (required) — Configured execution destination for ordinary triggers. War-room triggers resolve their event war room at execution time. [im, web_console]\n - http_post_token (string) — HTTP POST trigger token. Returned only on create or token rotation; save it immediately.\n - http_post_trigger_enabled (boolean) (required) — Whether the HTTP POST trigger is enabled.\n - http_post_trigger_id (string) — HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.\n - http_post_trigger_url (string) — HTTP POST trigger path. Omitted when the rule has no HTTP POST trigger.\n - name (string) (required) — Rule name.\n - oncall_incident_channel_ids (array) — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. Omitted when no On-call incident trigger is configured.\n - oncall_incident_severities (array) — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. Omitted when no On-call incident trigger is configured. [Critical, Warning, Info]\n - oncall_incident_trigger_enabled (boolean) (required) — Whether the On-call incident trigger is enabled.\n - oncall_incident_trigger_id (string) — On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.\n - owner_id (integer) (required) — Creator person ID.\n - prompt (string) (required) — Task prompt.\n - rule_id (string) (required) — Rule ID.\n - run_scope (string) (required) — Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id. [person, team]\n - schedule_next_fire_at_ms (string) (required) — Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - schedule_trigger_enabled (boolean) (required) — Whether the schedule trigger is enabled.\n - schedule_trigger_id (string) — Schedule trigger ID. Omitted if the rule has no schedule trigger.\n - team_id (integer) (required) — Scope team ID; 0 means personal rule.\n - timezone (string) (required) — IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n", + "Automations.RuleWriteUpdate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required) — Account ID.\n - can_edit (boolean) (required) — True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - cron_expr (string) (required) — Normalized 5-field cron expression.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - environment_id (string) (required) — BYOC Runner ID.\n - environment_kind (string) (required) — Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox). [cloud, byoc]\n - execution_location (object) — Read-only Automation execution destination. It never includes a chat, integration, or session identifier.\n - chat_name (string) — Display name of the bound IM conversation when available.\n - conversation_mode (string) — Bound IM conversation mode when execution place is `im`.\n - description (string) (required) — Human-readable destination description.\n - place (string) (required) — Execution destination: `im` or `web_console`. [im, web_console]\n - platform (string) — IM platform when execution place is `im`.\n - run_scope (string) (required) — Pinned execution scope: `person` or `team`. [person, team]\n - team_id (integer) (required) — Pinned scope team ID. 0 means personal scope.\n - execution_place (string) (required) — Configured execution destination for ordinary triggers. War-room triggers resolve their event war room at execution time. [im, web_console]\n - http_post_token (string) — HTTP POST trigger token. Returned only on create or token rotation; save it immediately.\n - http_post_trigger_enabled (boolean) (required) — Whether the HTTP POST trigger is enabled.\n - http_post_trigger_id (string) — HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.\n - http_post_trigger_url (string) — HTTP POST trigger path. Omitted when the rule has no HTTP POST trigger.\n - name (string) (required) — Rule name.\n - oncall_incident_channel_ids (array) — On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID. Omitted when no On-call incident trigger is configured.\n - oncall_incident_severities (array) — Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value. Omitted when no On-call incident trigger is configured. [Critical, Warning, Info]\n - oncall_incident_trigger_enabled (boolean) (required) — Whether the On-call incident trigger is enabled.\n - oncall_incident_trigger_id (string) — On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.\n - owner_id (integer) (required) — Creator person ID.\n - prompt (string) (required) — Task prompt.\n - rule_id (string) (required) — Rule ID.\n - run_scope (string) (required) — Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id. [person, team]\n - schedule_next_fire_at_ms (string) (required) — Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - schedule_trigger_enabled (boolean) (required) — Whether the schedule trigger is enabled.\n - schedule_trigger_id (string) — Schedule trigger ID. Omitted if the rule has no schedule trigger.\n - team_id (integer) (required) — Scope team ID; 0 means personal rule.\n - timezone (string) (required) — IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - war_room_channel_ids (array) — Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger.\n - war_room_severities (array) — Incident severities whose war rooms start a run: `Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger. [Critical, Warning, Info]\n - war_room_trigger_enabled (boolean) — Whether the war room trigger is enabled.\n - war_room_trigger_id (string) — War room trigger ID. Omitted when the rule has no war room trigger.\n", "Automations.RunReadList": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - runs (array) (required) — Array of run records for the given `rule_id`, filtered by the request's status/trigger-kind/time-range and paginated.\n - account_id (integer) (required) — Account ID.\n - attempts (integer) (required) — Attempt count.\n - completed_at (string) (required) — Completion time, Unix milliseconds. 0 means not completed. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - created_at (string) (required) — Creation time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - duration_ms (integer) (required) — Duration in milliseconds.\n - error_code (string) (required) — Error code; empty when the run did not fail.\n - error_message (string) (required) — Error message; empty when the run did not fail.\n - execution_place (string) (required) — Actual execution destination: `im` or `web_console`. IM runs omit session details and deep links. [im, web_console]\n - kind (string) (required) — Run kind; runs listed for a rule are always `automation_rule`. [automation_rule]\n - occurrence_key (string) (required) — Idempotency key for this occurrence.\n - result_json (object) (required) — Raw run result JSON (carries the run's `session_id` once started); null when empty.\n - rule_id (string) (required) — Rule ID.\n - run_id (string) (required) — Run ID.\n - session_id (string) — Session created for this run, extracted from `result_json`. Omitted when the run has not (yet) started a session.\n - session_name (string) — Display name of the run's session, stamped via a batch lookup. Omitted when empty or when the lookup fails.\n - started_at (string) (required) — Start time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - stats_json (object) (required) — Raw run statistics JSON; null when empty.\n - status (string) (required) — Run status. One of (the first three are in-flight, the rest terminal): | Value | Meaning | | --- | --- | | `queued` | Enqueued, waiting for a worker | | `running` | Executing | | `retrying` | An attempt failed and a retry is scheduled | | `succeeded` | Completed successfully | | `partial` | Partially succeeded (currently only produced by memory-consolidation runs; rule runs never reach it) | | `failed` | Terminal failure, no further retries | | `skipped` | Not executed (e.g. grace period expired, trigger or rule invalid); the reason is kept on the run record | | `abandoned` | Still in-flight past the stale threshold and swept as never-completed (e.g. worker died) | | `blocked` | Terminal: the run produced output but ended with a connector waiting on a human to complete authorization (distinct from `failed`) | [queued, running, retrying, succeeded, partial, failed, skipped, abandoned, blocked]\n - trigger_kind (string) (required) — Trigger kind. One of: | Value | Meaning | | --- | --- | | `schedule` | Fired by the rule's schedule trigger | | `debug` | Debug run (reserved; current rule runs never carry this kind) | | `manual` | Triggered manually by a user | | `http_post` | Fired via the rule's HTTP POST webhook | | `oncall_incident` | Fired by an on-call incident event | [schedule, debug, manual, http_post, oncall_incident]\n - updated_at (string) (required) — Last update time, Unix milliseconds. CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - total (integer) (required) — Total count.\n", "Automations.TemplateReadList": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - templates (array) (required) — Array of built-in automation templates, with display text localized by the request `locale` (falling back to request headers).\n - description (string) (required) — Template description.\n - enabled (boolean) (required) — Whether a rule created from this template starts out enabled (prefill value).\n - icon (string) (required) — Icon identifier.\n - name (string) (required) — Template name.\n - prompt (string) (required) — Template prompt.\n", "Calendars.CalEventList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) — Account ID. Only present for private events.\n - cal_id (string) (required) — Calendar ID. For public events this is a locale key such as zh-cn.china.official.\n - created_at (string) (required) — Creation timestamp (Unix seconds). CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n - creator_id (integer) — Creator person ID. Only present for private events.\n - description (string) (required) — Event description.\n - end_at (string) (required) — Event end date (YYYY-MM-DD, exclusive).\n - event_id (string) (required) — Event ID.\n - is_off (boolean) (required) — Whether the event marks a non-working day.\n - start_at (string) (required) — Event start date (YYYY-MM-DD).\n - summary (string) (required) — Event summary.\n - updated_at (string) (required) — Last update timestamp (Unix seconds). CLI `--json` renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.\n", diff --git a/skills/flashduty/reference/automation.md b/skills/flashduty/reference/automation.md index b902fbd..7b1a1b3 100644 --- a/skills/flashduty/reference/automation.md +++ b/skills/flashduty/reference/automation.md @@ -24,6 +24,7 @@ The execution destination and pinned scope cannot be changed with `update`. | want | verb | |---|---| | create a scheduled or HTTP POST Automation | `create` | +| create an Automation that runs inside new AI SRE war rooms | `create` with `--war-room-trigger` | | list visible Automations | `list` | | inspect one Automation | `get ` | | update mutable fields | `update ` | @@ -92,6 +93,29 @@ The response can include `http_post_trigger_id`, `http_post_trigger_url`, and on flashduty automation update --rotate-http-post-token --output-format toon ``` +## Hot flow - create a war room Automation + +```bash +flashduty automation create \ + --name "War room responder" \ + --war-room-trigger \ + --war-room-channel-ids 3521074710131,3521074710132 \ + --war-room-severities Critical,Warning \ + --prompt "Triage the incident inside the war room" \ + --output-format toon +``` + +When an AI SRE war room (IM group chat) is created for a matching incident in +one of the watched channels and with a watched severity, the agent runs inside +that group chat; runs have `trigger_kind=war_room_created`. `--war-room-trigger` +requires both `--war-room-channel-ids` and `--war-room-severities` (at least one +value each). A war-room-only rule needs no schedule flags: the CLI sends a +placeholder cron and disables the schedule trigger, same as an HTTP POST-only +rule. Afterwards, toggle the trigger with `update +--enable-war-room-trigger` / `--disable-war-room-trigger` and replace its +filters with `--war-room-channel-ids` / `--war-room-severities`; creating the +trigger through update requires both filter lists. + ## Hot flow - exact cron ```bash @@ -143,8 +167,11 @@ Create an Automation - `--schedule-enabled` bool - `--team-id` int64 - `--timezone` string +- `--war-room-channel-ids` int64Slice +- `--war-room-severities` stringSlice +- `--war-room-trigger` bool - `--weekday` string -- response: single object (`data` unwrapped to the top level) — fields: account_id (integer); can_edit (boolean); created_at (string); cron_expr (string); enabled (boolean); environment_id (string); environment_kind (string); execution_location (object); execution_place (string); http_post_token (string); http_post_trigger_enabled (boolean); http_post_trigger_id (string); http_post_trigger_url (string); name (string); oncall_incident_channel_ids (array); oncall_incident_severities (array); oncall_incident_trigger_enabled (boolean); oncall_incident_trigger_id (string); owner_id (integer); prompt (string); rule_id (string); run_scope (string); schedule_next_fire_at_ms (string); schedule_trigger_enabled (boolean); schedule_trigger_id (string); team_id (integer); timezone (string); updated_at (string) +- response: single object (`data` unwrapped to the top level) — fields: account_id (integer); can_edit (boolean); created_at (string); cron_expr (string); enabled (boolean); environment_id (string); environment_kind (string); execution_location (object); execution_place (string); http_post_token (string); http_post_trigger_enabled (boolean); http_post_trigger_id (string); http_post_trigger_url (string); name (string); oncall_incident_channel_ids (array); oncall_incident_severities (array); oncall_incident_trigger_enabled (boolean); oncall_incident_trigger_id (string); owner_id (integer); prompt (string); rule_id (string); run_scope (string); schedule_next_fire_at_ms (string); schedule_trigger_enabled (boolean); schedule_trigger_id (string); team_id (integer); timezone (string); updated_at (string); war_room_channel_ids (array); war_room_severities (array); war_room_trigger_enabled (boolean); war_room_trigger_id (string) ### delete Delete an Automation @@ -191,9 +218,11 @@ Update an Automation - `--disable` bool - `--disable-http-post-trigger` bool - `--disable-schedule` bool +- `--disable-war-room-trigger` bool - `--enable` bool - `--enable-http-post-trigger` bool - `--enable-schedule` bool +- `--enable-war-room-trigger` bool - `--environment-id` string - `--environment-kind` string - `--name` string @@ -202,6 +231,8 @@ Update an Automation - `--rotate-http-post-token` bool - `--schedule` string - `--timezone` string +- `--war-room-channel-ids` int64Slice +- `--war-room-severities` stringSlice - `--weekday` string - response: same shape as `create` above diff --git a/skills/flashduty/reference/escalation.md b/skills/flashduty/reference/escalation.md index ee8dc44..1cf6eeb 100644 --- a/skills/flashduty/reference/escalation.md +++ b/skills/flashduty/reference/escalation.md @@ -78,6 +78,12 @@ List escalation rules - `--fields` string - response: TOP-LEVEL array — pipe `--json | jq '.[]'` (NOT `.items[]`) — fields: account_id (integer); aggr_window (integer); channel_id (integer); channel_name (string); created_at (string); deleted_at (string); description (string); filters (object); layers (array); priority (integer); rule_id (string); rule_name (string); status (string); template_id (string); time_filters (array); updated_at (string); updated_by (integer) +### escalate-rule-reorder +Reorder escalation rules +- `--channel-id` int64 (required) — Owning channel ID; obtain it from 'POST /channel/list'. +- `--drag-rule-id` string (required) — ID of the rule being dragged (24-character hex), as returned in 'rule_id' by the create or list endpoint. +- `--target-rule-id` string (required) — ID of the rule whose slot the dragged rule moves into (24-character hex). + ### escalate-rule-update Update escalation rule - `--aggr-window` int64 — Delay window in seconds. 0 disables delay. diff --git a/skills/flashduty/reference/safari.md b/skills/flashduty/reference/safari.md index 56eb78a..0dd6a80 100644 --- a/skills/flashduty/reference/safari.md +++ b/skills/flashduty/reference/safari.md @@ -184,7 +184,10 @@ Create Automation rule - `--schedule-trigger-enabled` bool — Whether the schedule trigger is enabled. Defaults to true when omitted; HTTP-POST-only rules should send false. - `--team-id` int64 — Scope team ID. Explicit 0 means personal scope; >0 means a team in the account. Omit it to inherit the authenticated IM conversation scope when one is available, otherwise let the server select the normal default. A current-chat rule must match that conversation's scope. (min 0) - `--timezone` string — IANA timezone 'cron_expr' is evaluated in, e.g. 'Asia/Shanghai'. Must be a timezone name loadable by the server; an invalid value is rejected. Defaults to the caller's member timezone, then the account timezone, then the server default (Asia/Shanghai) when omitted. -- response: single object (`data` unwrapped to the top level) — fields: account_id (integer); can_edit (boolean); created_at (string); cron_expr (string); enabled (boolean); environment_id (string); environment_kind (string); execution_location (object); execution_place (string); http_post_token (string); http_post_trigger_enabled (boolean); http_post_trigger_id (string); http_post_trigger_url (string); name (string); oncall_incident_channel_ids (array); oncall_incident_severities (array); oncall_incident_trigger_enabled (boolean); oncall_incident_trigger_id (string); owner_id (integer); prompt (string); rule_id (string); run_scope (string); schedule_next_fire_at_ms (string); schedule_trigger_enabled (boolean); schedule_trigger_id (string); team_id (integer); timezone (string); updated_at (string) +- `--war-room-channel-ids` intSlice — Channel IDs whose war rooms start a run. Each ID must be positive. +- `--war-room-severities` stringSlice — Incident severities that start a run when their war room is created: 'Critical' (most severe), 'Warning', or 'Info' (least severe) — the On-call incident severity levels. · enum: Critical | Warning | Info +- `--war-room-trigger-enabled` bool — Whether the war room trigger is enabled. It fires when a war room (IM group chat) is created for an incident in one of 'war_room_channel_ids' with a severity in 'war_room_severities'; the agent then runs inside that group chat. When the trigger is created (this is 'true', or 'war_room_channel_ids' is sent), both lists must be non-empty. +- response: single object (`data` unwrapped to the top level) — fields: account_id (integer); can_edit (boolean); created_at (string); cron_expr (string); enabled (boolean); environment_id (string); environment_kind (string); execution_location (object); execution_place (string); http_post_token (string); http_post_trigger_enabled (boolean); http_post_trigger_id (string); http_post_trigger_url (string); name (string); oncall_incident_channel_ids (array); oncall_incident_severities (array); oncall_incident_trigger_enabled (boolean); oncall_incident_trigger_id (string); owner_id (integer); prompt (string); rule_id (string); run_scope (string); schedule_next_fire_at_ms (string); schedule_trigger_enabled (boolean); schedule_trigger_id (string); team_id (integer); timezone (string); updated_at (string); war_room_channel_ids (array); war_room_severities (array); war_room_trigger_enabled (boolean); war_room_trigger_id (string) ### automation-rule-delete Delete Automation rule @@ -228,6 +231,9 @@ Update Automation rule - `` (positional, required) string — Target rule ID, from the list returned by 'POST /safari/automation/rule/list'. - `--schedule-trigger-enabled` bool — Whether the schedule trigger is enabled. - `--timezone` string — New IANA timezone for evaluating 'cron_expr'. Omit or send null to leave the current timezone unchanged. +- `--war-room-channel-ids` intSlice +- `--war-room-severities` stringSlice +- `--war-room-trigger-enabled` bool - response: same shape as `automation-rule-create` above ### automation-run-list