diff --git a/go.mod b/go.mod index 795c44c..2eae631 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/flashcatcloud/flashduty-cli go 1.25.1 require ( - github.com/flashcatcloud/go-flashduty v0.5.7 + github.com/flashcatcloud/go-flashduty v0.5.8-0.20260722114743-be934aea6779 github.com/mattn/go-runewidth v0.0.24 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 diff --git a/go.sum b/go.sum index d32da8f..b5ab74a 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,10 @@ github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJ github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/flashcatcloud/go-flashduty v0.5.7 h1:bTgs4wN2mLMaVi8tuPDdR+8ZA6Dd4y6SKeZD+KhL4w8= github.com/flashcatcloud/go-flashduty v0.5.7/go.mod h1:aA0RtZEs0AYOwwdNKdtVeD8YMOdnmVY1zAlVD+9Ovx8= +github.com/flashcatcloud/go-flashduty v0.5.8-0.20260722113601-d9766098937e h1:ZJ2FVBRoKfgQmqYHSQXw+cBjWiDVUKnB/8+/PUgZ+zw= +github.com/flashcatcloud/go-flashduty v0.5.8-0.20260722113601-d9766098937e/go.mod h1:aA0RtZEs0AYOwwdNKdtVeD8YMOdnmVY1zAlVD+9Ovx8= +github.com/flashcatcloud/go-flashduty v0.5.8-0.20260722114743-be934aea6779 h1:gUCg7EqrYbxYn1Z7jeNqpLWovPaNin9fdhTPgF093Dk= +github.com/flashcatcloud/go-flashduty v0.5.8-0.20260722114743-be934aea6779/go.mod h1:aA0RtZEs0AYOwwdNKdtVeD8YMOdnmVY1zAlVD+9Ovx8= 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.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU= diff --git a/internal/cli/zz_generated_data_sources.go b/internal/cli/zz_generated_data_sources.go index edcba3d..f198826 100644 --- a/internal/cli/zz_generated_data_sources.go +++ b/internal/cli/zz_generated_data_sources.go @@ -16,7 +16,7 @@ func genDataSourcesReadInfoCmd() *cobra.Command { Short: "Get datasource detail", Long: `Get datasource detail. -Retrieve full details of a single data source by its ID, including the 'payload' configuration. +Retrieve full details of a single data source by its ID, including the 'payload' configuration, with credential fields masked as '******'. API: POST /monit/datasource/info (monit-datasource-read-info) diff --git a/internal/cli/zz_generated_diagnostics.go b/internal/cli/zz_generated_diagnostics.go index 084d212..05fa074 100644 --- a/internal/cli/zz_generated_diagnostics.go +++ b/internal/cli/zz_generated_diagnostics.go @@ -428,9 +428,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - message (string) - target_kinds (array) - results (array) — Per-tool results, aligned with the request 'tools[]' order. Empty when a request-level 'error' is present. - - agent_elapsed_ms (integer) — Agent-self-reported tool execution time in milliseconds, excluding network round-trips. May be 0 when the failure occurred before execution started. - data (object) — Tool business payload. Present only on success. Webapi already unwraps the monit-agent result envelope, so there is no nested 'data.data'. - - e2e_elapsed_ms (integer) — Webapi-observed end-to-end time in milliseconds (webapi → ws → edge → agent → ws → webapi). A large gap versus 'agent_elapsed_ms' indicates network / edge slowness, not a slow tool. - error (object) — Per-tool failure. Present only on failure, and mutually exclusive with 'data' / 'summary' / 'truncated'. - code (string) — Common values: 'timeout', 'target_unavailable', 'edge_unsupported', 'invalid_tool_result', 'internal', 'invalid_args', 'unknown_tool', 'unknown_tool_version', 'unknown_toolset_hash', 'target_not_owned', 'wrong_agent', 'overloaded', 'denied', 'permission_denied', 'credential_unavailable', 'target_unreachable'. - message (string) diff --git a/internal/cli/zz_generated_response_help.go b/internal/cli/zz_generated_response_help.go index 6a6caed..9f49241 100644 --- a/internal/cli/zz_generated_response_help.go +++ b/internal/cli/zz_generated_response_help.go @@ -95,7 +95,7 @@ var responseHelpBySDKMethod = map[string]string{ "Diagnostics.QueryRows": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - fields (object) — String-valued fields (labels, log fields, SQL columns).\n - values (object) — Numeric fields. For metric queries the canonical key is `__value__`. May be `null` for detail-oriented sources.\n", "Diagnostics.TargetsList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - agent_version (string) — Most recently observed Agent version.\n - cluster_name (string) — Edge cluster name.\n - edge_ipport (string) — Edge instance address (`ip:port`), surfaced for diagnostics.\n - target_kind (string) — Target kind, e.g. `host`, `mysql`. Filtering by kind is not supported in v1.\n - target_locator (string) — Target identifier; the list is sorted by this field ascending.\n - updated_at (integer) — Last route-projection upsert time, Unix seconds. Treat as 'most recently observed', not a live-online indicator.\n", "Diagnostics.ToolsCatalog": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - error (object) — Request-level business error. Omitted on success. Returned with HTTP 200 — do not rely on the status code alone.\n - code (string) [target_unavailable, unknown_toolset_hash, ambiguous_target_kind]\n - message (string)\n - target_kinds (array) — Returned for `ambiguous_target_kind`; lists the candidate kinds.\n - target (object) — Resolved target. Omitted when `target_kind` was not supplied and the locator could not be uniquely inferred.\n - kind (string)\n - locator (string)\n - tools (array) — Tool metadata advertised by the target's agent. Always present; an empty array when `error` is set.\n - description (string) — Tool capability description for UI / AI-SRE consumption.\n - input_schema (object) — JSON Schema for `tools[].params`.\n - name (string) — Tool name; pass into `/monit/tools/invoke` as `tools[].tool`.\n - output_shape (object) — JSON Schema of the tool result. Returned only when the request set `include_output_shape` to true.\n - target_kind (string) — Target kind this tool applies to.\n", - "Diagnostics.ToolsInvoke": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - error (object) — Request-level business error. Omitted on success. Returned with HTTP 200 — do not rely on the status code alone.\n - code (string) [target_unavailable, unknown_toolset_hash, forward_failed, ambiguous_target_kind]\n - message (string)\n - target_kinds (array)\n - results (array) — Per-tool results, aligned with the request `tools[]` order. Empty when a request-level `error` is present.\n - agent_elapsed_ms (integer) — Agent-self-reported tool execution time in milliseconds, excluding network round-trips. May be 0 when the failure occurred before execution started.\n - data (object) — Tool business payload. Present only on success. Webapi already unwraps the monit-agent result envelope, so there is no nested `data.data`.\n - e2e_elapsed_ms (integer) — Webapi-observed end-to-end time in milliseconds (webapi → ws → edge → agent → ws → webapi). A large gap versus `agent_elapsed_ms` indicates network / edge slowness, not a slow tool.\n - error (object) — Per-tool failure. Present only on failure, and mutually exclusive with `data` / `summary` / `truncated`.\n - code (string) — Common values: `timeout`, `target_unavailable`, `edge_unsupported`, `invalid_tool_result`, `internal`, `invalid_args`, `unknown_tool`, `unknown_tool_version`, `unknown_toolset_hash`, `target_not_owned`, `wrong_agent`, `overloaded`, `denied`, `permission_denied`, `credential_unavailable`, `target_unreachable`.\n - message (string)\n - params (object) — Request params echoed back by webapi. Normalized to `{}` when the request omitted them or sent null.\n - summary (string) — Human/LLM-readable one-line distillation of the result. Present only when non-empty.\n - tool (string) — Tool name, aligned one-to-one with the request `tools[]` order.\n - tool_version (string) — Agent-executed tool version. Omitted when the failure occurred before the agent picked a version.\n - truncated (object) — Present only when the result was actually truncated — the field's presence is the signal, so there is no redundant `truncated: true`.\n - reason (string) — Why the result was truncated.\n - target (object) — Resolved target. Omitted when `target_kind` was not supplied and the locator could not be uniquely inferred.\n - kind (string)\n - locator (string)\n", + "Diagnostics.ToolsInvoke": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - error (object) — Request-level business error. Omitted on success. Returned with HTTP 200 — do not rely on the status code alone.\n - code (string) [target_unavailable, unknown_toolset_hash, forward_failed, ambiguous_target_kind]\n - message (string)\n - target_kinds (array)\n - results (array) — Per-tool results, aligned with the request `tools[]` order. Empty when a request-level `error` is present.\n - data (object) — Tool business payload. Present only on success. Webapi already unwraps the monit-agent result envelope, so there is no nested `data.data`.\n - error (object) — Per-tool failure. Present only on failure, and mutually exclusive with `data` / `summary` / `truncated`.\n - code (string) — Common values: `timeout`, `target_unavailable`, `edge_unsupported`, `invalid_tool_result`, `internal`, `invalid_args`, `unknown_tool`, `unknown_tool_version`, `unknown_toolset_hash`, `target_not_owned`, `wrong_agent`, `overloaded`, `denied`, `permission_denied`, `credential_unavailable`, `target_unreachable`.\n - message (string)\n - params (object) — Request params echoed back by webapi. Normalized to `{}` when the request omitted them or sent null.\n - summary (string) — Human/LLM-readable one-line distillation of the result. Present only when non-empty.\n - tool (string) — Tool name, aligned one-to-one with the request `tools[]` order.\n - tool_version (string) — Agent-executed tool version. Omitted when the failure occurred before the agent picked a version.\n - truncated (object) — Present only when the result was actually truncated — the field's presence is the signal, so there is no redundant `truncated: true`.\n - reason (string) — Why the result was truncated.\n - target (object) — Resolved target. Omitted when `target_kind` was not supplied and the locator could not be uniquely inferred.\n - kind (string)\n - locator (string)\n", "Facets.FacetCount": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - count (integer) (required) — Number of events with this facet value in the time range.\n - facet_value (any) (required) — The facet value. Type matches the field's `value_type`.\n", "Facets.FacetList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID. 0 for built-in fields.\n - description (string) (required) — Description of what this field captures.\n - edit_able (boolean) (required) — True if this is a custom field that can be edited by the user.\n - enum_values (array) (required) — Predefined enumerable values for this field. Element type matches the field's `value_type`: string for `string`, number for `number`, boolean for `boolean`. Empty when the field has no fixed set of values.\n - field_key (string) (required) — Unique field key, e.g. `error.type`.\n - field_name (string) (required) — Human-readable field name.\n - group (string) (required) — Display group for this field.\n - is_facet (boolean) (required) — True if value distribution counting is supported for this field.\n - queryable (boolean) (required) — True if this field can be used in DQL/SQL queries.\n - scopes (array) (required) — RUM scopes this field appears in.\n - show_type (string) (required) — Display type in the analytics UI. [list, range]\n - status (string) (required) — Field status, e.g. `active`.\n - unit_family (string) (required) — Measurement unit family, e.g. `time`, `bytes`. Empty for dimensionless fields.\n - unit_name (string) (required) — Specific measurement unit, e.g. `millisecond`, `byte`.\n - value_type (string) (required) — Data type of the field value. [string, number, boolean, array, array, array]\n", "Facets.FieldList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID. 0 for built-in fields.\n - description (string) (required) — Description of what this field captures.\n - edit_able (boolean) (required) — True if this is a custom field that can be edited by the user.\n - enum_values (array) (required) — Predefined enumerable values for this field. Element type matches the field's `value_type`: string for `string`, number for `number`, boolean for `boolean`. Empty when the field has no fixed set of values.\n - field_key (string) (required) — Unique field key, e.g. `error.type`.\n - field_name (string) (required) — Human-readable field name.\n - group (string) (required) — Display group for this field.\n - is_facet (boolean) (required) — True if value distribution counting is supported for this field.\n - queryable (boolean) (required) — True if this field can be used in DQL/SQL queries.\n - scopes (array) (required) — RUM scopes this field appears in.\n - show_type (string) (required) — Display type in the analytics UI. [list, range]\n - status (string) (required) — Field status, e.g. `active`.\n - unit_family (string) (required) — Measurement unit family, e.g. `time`, `bytes`. Empty for dimensionless fields.\n - unit_name (string) (required) — Specific measurement unit, e.g. `millisecond`, `byte`.\n - value_type (string) (required) — Data type of the field value. [string, number, boolean, array, array, array]\n", diff --git a/skills/flashduty/reference/monit-agent.md b/skills/flashduty/reference/monit-agent.md index 8d95897..0d385b0 100644 --- a/skills/flashduty/reference/monit-agent.md +++ b/skills/flashduty/reference/monit-agent.md @@ -41,7 +41,6 @@ Run up to 8 monit-agent tools concurrently on a target - **`catalog` → `invoke` is the order.** `catalog` returns each tool's `name` (+ `input_schema` for its params); `invoke` runs them. Tool names are target-specific — take them verbatim from the catalog, do not invent. - **`invoke` carries the tool list in `--data`**: `{"tools":[{"tool":"","params":{…}}, … up to 8]}`. `params` defaults to `{}`. `--target-locator` (required) and `--target-kind` override matching `--data` keys. -- Each result carries `agent_elapsed_ms` (agent-side) vs `e2e_elapsed_ms` (end-to-end) — a large gap signals network/edge slowness, not a slow tool. ## Gotchas