{
  "schemaVersion": "agent9-managed-tool-package-v1",
  "name": "managed_auto_oncall_wetech",
  "version": 65,
  "description": "Wetech-backed read-only evidence Tool for ticket-bound OP Grafana PromQL and TiDB Dashboard TopSQL, Statements, and Slow Query. The isolated browser Tool reads and refreshes login state in a dedicated Drive9 workspace.",
  "parameters": {
    "type": "object",
    "additionalProperties": false,
    "required": [
      "accountAlias",
      "issueKey",
      "cluster",
      "region",
      "operation",
      "queryId",
      "start",
      "end"
    ],
    "properties": {
      "accountAlias": {
        "const": "Wetech"
      },
      "issueKey": {
        "type": "string",
        "pattern": "^APID-[0-9]+$"
      },
      "cluster": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      },
      "region": {
        "enum": [
          "asia-prod",
          "middle-east-prod"
        ]
      },
      "operation": {
        "enum": [
          "metrics_query_range",
          "topsql",
          "statements",
          "slow_query"
        ]
      },
      "queryId": {
        "type": "string",
        "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$",
        "description": "Stable semantic objective ID. Reuse it only for a changed same-Turn correction of that failed objective."
      },
      "query": {
        "type": "string",
        "minLength": 1,
        "maxLength": 8192,
        "description": "PromQL authored by the Evidence Agent for the exact authorized cluster and window."
      },
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      },
      "unit": {
        "type": "string",
        "minLength": 1,
        "maxLength": 32,
        "description": "Short plain string label for the PromQL result, for example cores, seconds, bytes, ratio, or count."
      },
      "instance": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256,
        "description": "Required for topsql: an available exact TiDB instance selector without surrounding whitespace. Omission is not cluster-wide mode. Never guess or use opaque entity references; instanceFromQueryId is not supported by this Managed Tool."
      },
      "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 20,
        "description": "JSON integer from 1 through 20. TopSQL defaults to 5; Slow Query defaults to 20. Use more than 5 TopSQL entries only for a specific evidence objective; 100 is not supported."
      },
      "includeSqlText": {
        "type": "boolean",
        "description": "Dashboard result projection. Defaults to false for broad lists and true for Digest-selected Slow Query detail. Use true only for bounded target-SQL matching or a load-bearing candidate detail; workload/latency lists need only Digests and metrics."
      },
      "digest": {
        "type": "string",
        "pattern": "^[a-fA-F0-9]{6,64}$",
        "description": "A 6-64 character hexadecimal SQL Digest or prefix copied from suppliedQueryDigests or a prior Provider result. Prefixes are queryable; single-SQL matches include detailed plans. Opaque entity references are invalid."
      },
      "orderBy": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      },
      "desc": {
        "type": "boolean"
      },
      "start": {
        "type": "integer"
      },
      "end": {
        "type": "integer"
      },
      "step": {
        "type": "integer",
        "minimum": 15,
        "maximum": 300
      }
    }
  },
  "effect": "read",
  "entrypoint": "index.mjs",
  "entrypointSha256": "234300e3d2344e76e1820733706657a68432877b9f5af14823e25c74016246da",
  "files": [
    {
      "path": "clusters.json",
      "sha256": "5253d5461817eed21309af8fb1dedfb784a8a4208ed7d511a14b5e97f3376efb"
    },
    {
      "path": "credential-redaction.mjs",
      "sha256": "0da0064a6a4c658ef935f4ffd25f48d7c499e9837e2e9fb7bc023359f27ed3ed"
    },
    {
      "path": "dashboard-query-contract.mjs",
      "sha256": "118e7bb71df0a74d26d7a91bb3926071965bb8e35e3ee1fec7726fa8052fa054"
    },
    {
      "path": "drive-state.mjs",
      "sha256": "dbc1f99b028231cd79912e257ef3666b706facf908c6e3ceeb0a2ee83beee91c"
    },
    {
      "path": "egress-proxy-client.bundle.mjs",
      "sha256": "da061eb6cf01a47a94e4892cd4e86887dc2174e938c92bc9ab800d36e9ced48b"
    },
    {
      "path": "index.mjs",
      "sha256": "234300e3d2344e76e1820733706657a68432877b9f5af14823e25c74016246da"
    }
  ],
  "packageSha256": "ad5e9deeaeb827c9226601ec08c15f1f3d4105944777c8a624c9e68ddb5b9dbc",
  "secretEnv": [
    "WETECH_P81_USERNAME",
    "WETECH_P81_PASSWORD",
    "WETECH_P81_TOTP",
    "WETECH_GRAFANA_USERNAME",
    "WETECH_GRAFANA_PASSWORD_ASIA_PROD",
    "WETECH_GRAFANA_PASSWORD_DEFAULT",
    "WETECH_DASHBOARD_USERNAME",
    "WETECH_DASHBOARD_PASSWORD_ASIA_SAAS",
    "WETECH_DASHBOARD_PASSWORD_DEFAULT",
    "WETECH_DRIVE9_SERVER",
    "WETECH_DRIVE9_OWNER_KEY",
    "WETECH_EGRESS_PROXY_TOKEN"
  ],
  "timeoutMs": 120000,
  "maxOutputBytes": 65536,
  "network": {
    "mode": "restricted",
    "allowedHosts": [
      "0vpufqvsr1.pzero.perimeter81.com",
      "4dr1vc4uv4.pzero.perimeter81.com",
      "5k4nyucryn.pzero.perimeter81.com",
      "7bdo93ukkj.pzero.perimeter81.com",
      "api-ui.perimeter81.com",
      "api.drive9.ai",
      "auth.perimeter81.com",
      "aws-us-west-2.drive9.ai",
      "cdn.auth0.com",
      "cgxxx.perimeter81.com",
      "challenges.cloudflare.com",
      "expi6h7wuv.pzero.perimeter81.com",
      "fyz1icbv5b.pzero.perimeter81.com",
      "ihrmajekdd.pzero.perimeter81.com",
      "irts42uvdv.pzero.perimeter81.com",
      "iya6xny2n0.pzero.perimeter81.com",
      "lxh6tutsef.pzero.perimeter81.com",
      "mu6vinaxyh.pzero.perimeter81.com",
      "nfzpljggn3.pzero.perimeter81.com",
      "oncall.ops-staging.pingcap.net",
      "p81-assets.perimeter81.com",
      "phkymwfdqy.pzero.perimeter81.com",
      "ssl.gstatic.com",
      "static.perimeter81.com",
      "uaephgf2ho.pzero.perimeter81.com",
      "webclient-mfes.perimeter81.com",
      "y6oja6thhj.pzero.perimeter81.com",
      "zgby9flykp.pzero.perimeter81.com"
    ],
    "workspaceAdminMayAllowUnrestricted": true
  },
  "egress": []
}
