{
  "error_json": {
    "error": "unauthenticated",
    "code": "unauthenticated",
    "status": 401
  },
  "cli_to_operation": {
    "health": "getHealth",
    "login": "login",
    "session": "getSession",
    "templates": "listTemplates",
    "validate": "validateProject",
    "import": "importProject",
    "plan": "planProject",
    "reconcile": "reconcileProject",
    "deploy": "deployProject",
    "destroy": "destroyProject",
    "status": "getProjectStatus",
    "inspect": "inspectProject",
    "exec": "execProject",
    "export-config": "exportProjectConfig"
  },
  "cli_only": {
    "load": {
      "model": null,
      "notes": "Local command. Does not call eve-iac-agent. Creates `.eve-iac.yml` with mode load only.",
      "human": "project=/work/IaC/OSPF mode=load source_lab=/Customers/OSPF.unl",
      "json": {
        "project": "/work/IaC/OSPF",
        "source_lab": "/Customers/OSPF.unl",
        "mode": "load"
      },
      "jq": [
        "eve-iac load /Customers/OSPF.unl --json | jq -r .project",
        "eve-iac load /Customers/OSPF.unl --json | jq -r .source_lab"
      ],
      "python": "import json, subprocess\nout = subprocess.check_output([\"eve-iac\", \"--json\", \"load\", \"/Customers/OSPF.unl\"], text=True)\nmeta = json.loads(out)\nproject_dir = meta[\"project\"]",
      "typescript": "const { execFileSync } = require(\"node:child_process\");\nconst meta = JSON.parse(execFileSync(\"eve-iac\", [\"--json\", \"load\", \"/Customers/OSPF.unl\"], { encoding: \"utf8\" }));\nconst projectDir = meta.project;",
      "go": "meta := loadLocal{} // parse stdout from exec.Command(\"eve-iac\", \"--json\", \"load\", path)"
    },
    "reconcile_from_eve_cli": {
      "model": "ReconcileData",
      "notes": "After `reconcile --direction from_eve`, the CLI may persist files locally via commit_pulled. stdout JSON adds files_written and files_removed (paths only, no file bodies).",
      "human": "applied=3 direction=from_eve files_written=2 files_removed=1",
      "json": {
        "applied": 3,
        "direction": "from_eve",
        "applicable": true,
        "lab": "/IaC/demo.unl",
        "files_written": [
          "topology.yml",
          "configs/default/n_1.cfg"
        ],
        "files_removed": [
          "configs/default/stale.cfg"
        ]
      },
      "jq": [
        "eve-iac reconcile ./lab --direction from_eve --json | jq -r '.files_written[]'",
        "eve-iac reconcile ./lab --direction from_eve --json | jq '.applied'"
      ],
      "python": "from eveiac import commit_pulled, pulled_model_view, should_persist_from_eve\nresult = client.reconcile_project(body)\nif should_persist_from_eve(result):\n    persisted = commit_pulled(packed.root, result)\nview = pulled_model_view(result, persisted)\nprint(view.files_written)",
      "typescript": "const result = await client.reconcileProject({ ...packed, direction: \"from_eve\" });\n// persist locally in your app; CLI does this via commit_pulled equivalent",
      "go": "from, err := client.ReconcileProject(ctx, req)\n_ = from.Applied"
    }
  },
  "operations": {
    "getHealth": {
      "model": "HealthData",
      "human": "status=ok tls=true version=0.9.0-1",
      "json": {
        "status": "ok",
        "tls": true,
        "version": "0.9.0-1"
      },
      "jq": [
        "jq -r .status",
        "jq -r .version"
      ],
      "python": "health = client.get_health()\nif health.status != \"ok\":\n    raise SystemExit(1)",
      "typescript": "const health = await client.getHealth();\nif (health.status !== \"ok\") process.exit(1);",
      "go": "health, err := client.GetHealth(ctx)\nif health != nil && health.Status != nil && *health.Status != \"ok\" { return err }"
    },
    "login": {
      "model": "LoginData",
      "human": "signed in as admin",
      "json": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
        "username": "admin"
      },
      "notes": "Human login omits token. `--json` includes token — store as EVE_IAC_TOKEN, never log stdout in CI.",
      "jq": [
        "eve-iac login --json --username admin --password \"$PW\" | jq -r .token"
      ],
      "python": "session = client.login(LoginRequest(username=\"admin\", password=\"secret\"))\ntoken = session.token",
      "typescript": "const session = await client.login({ username: \"admin\", password: \"secret\" });\nconst token = session.token ?? \"\";",
      "go": "login, err := client.Login(ctx, eveiac.LoginRequest{Username: \"admin\", Password: \"secret\"})\ntoken := \"\"\nif login.Token != nil { token = *login.Token }"
    },
    "getSession": {
      "model": "SessionData",
      "human": "session admin",
      "json": {
        "username": "admin"
      },
      "jq": [
        "jq -r .username"
      ],
      "python": "session = client.get_session()\nassert session.username",
      "typescript": "const session = await client.getSession();\nconsole.log(session.username);",
      "go": "sess, _ := client.GetSession(ctx)\n_ = sess.Username"
    },
    "listTemplates": {
      "model": "TemplatesData",
      "human": "templates: 42\niol\nvpcs",
      "json": {
        "templates": [
          {
            "id": "iol",
            "description": "IOL",
            "type": "qemu",
            "provisioned": true,
            "configSupported": true
          },
          {
            "id": "vpcs",
            "description": "VPCS",
            "type": "vpcs",
            "provisioned": true,
            "configSupported": true
          }
        ]
      },
      "jq": [
        "jq '.templates | length'",
        "jq -r '.templates[].id'"
      ],
      "python": "data = client.list_templates()\nids = [t.id for t in (data.templates or []) if t.id]",
      "typescript": "const { templates } = await client.listTemplates();\nconst ids = (templates ?? []).map((t) => t.id).filter(Boolean);",
      "go": "data, _ := client.ListTemplates(ctx, nil)\nfor _, t := range data.Templates { _ = t.ID }"
    },
    "listFolders": {
      "model": "FoldersData",
      "human": "path=/Customers labs: 2",
      "json": {
        "path": "/Customers",
        "parent": "/",
        "folders": [
          {
            "name": "ACME",
            "path": "/Customers/ACME",
            "lock": false
          }
        ],
        "labs": [
          {
            "name": "OSPF.unl",
            "path": "/Customers/OSPF.unl",
            "lock": false
          }
        ]
      },
      "jq": [
        "jq -r .path",
        "jq -r '.labs[].path'"
      ],
      "python": "from eveiac import ListFoldersQuery\nroot = client.list_folders()\nnested = client.list_folders(ListFoldersQuery(path=\"/Customers\"))",
      "typescript": "const root = await client.listFolders();\nconst nested = await client.listFolders({ path: \"/Customers\" });",
      "go": "root, _ := client.ListFolders(ctx, nil)\nnested, _ := client.ListFolders(ctx, &eveiac.ListFoldersQuery{Path: eveiac.Ptr(\"/Customers\")})"
    },
    "validateProject": {
      "model": "ValidateData",
      "human": "valid=true",
      "json": {
        "valid": true,
        "errors": []
      },
      "jq": [
        "jq -r .valid",
        "jq -r '.errors[].path'"
      ],
      "python": "from eveiac import ValidateProjectRequest, pack_lab\npacked = pack_lab(\"./lab\")\nresult = client.validate_project(ValidateProjectRequest(**packed.payload))\nassert result.valid is True",
      "typescript": "const result = await client.validateProject(packed);\nif (!result.valid) throw new Error(\"validate failed\");",
      "go": "ok, err := client.ValidateProject(ctx, packed)\nif ok != nil && !ok.Valid { return fmt.Errorf(\"validate failed\") }"
    },
    "getPublicSchema": {
      "model": "SchemaData",
      "human": "revision=f7f8d72c… sections=traffic_filters,tasks",
      "json": {
        "revision": "f7f8d72c113b156e85907c716d4cfcc934179ecde0a0101f6937d7b0376b2399",
        "sections": {
          "traffic_filters": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/$defs/trafficFilter"
            }
          }
        }
      },
      "jq": [
        "jq -r .revision",
        "jq -r '.sections | keys[]'"
      ],
      "python": "schema = client.get_public_schema(SchemaRequest(sections=[\"traffic_filters\", \"tasks\"]))\nrev = schema.revision",
      "typescript": "const schema = await client.getPublicSchema({ sections: [\"traffic_filters\", \"tasks\"] });\nconst rev = schema.revision ?? \"\";",
      "go": "schema, err := client.GetPublicSchema(ctx, eveiac.SchemaRequest{Sections: []string{\"traffic_filters\", \"tasks\"}})\n_ = schema.Revision"
    },
    "editProject": {
      "model": "EditResult",
      "human": "applied=true operations=10 valid=true",
      "json": {
        "applied": true,
        "operations": 10,
        "changed": {
          "nodes": [
            "r1",
            "r2",
            "r3",
            "r4"
          ],
          "links": 6
        },
        "valid": true,
        "errors": []
      },
      "jq": [
        "jq -r .applied",
        "jq -r .operations",
        "jq -r '.changed.nodes[]'"
      ],
      "python": "edited = client.edit_project(EditProjectRequest(**{**packed.payload, \"operations\": ops}))\nassert edited.applied is True",
      "typescript": "const edited = await client.editProject({ ...packed, operations });\nif (!edited.applied) throw new Error(\"edit not applied\");",
      "go": "edited, _ := client.EditProject(ctx, req)\nif !edited.Applied { return fmt.Errorf(\"edit not applied\") }"
    },
    "getProjectConfig": {
      "model": "ConfigData",
      "human": "lab=mesh present=true bytes=842",
      "json": {
        "lab": "mesh",
        "node": "ceos1",
        "template": "ceos",
        "configset": "default",
        "present": true,
        "bytes": 842,
        "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "content": "hostname ceos1\n"
      },
      "jq": [
        "jq -r .lab",
        "jq -r .present",
        "jq -r .bytes"
      ],
      "python": "cfg = client.get_project_config(GetProjectConfigRequest(**{**packed.payload, \"operation\": \"get\", \"node\": \"ceos1\"}))\nassert cfg.present is True",
      "typescript": "const cfg = await client.getProjectConfig({ ...packed, operation: \"get\", node: \"ceos1\" });\nif (!cfg.present) throw new Error(\"missing config\");",
      "go": "cfg, _ := client.GetProjectConfig(ctx, req)\n_ = cfg.Present"
    },
    "editProjectConfig": {
      "model": "ConfigEditData",
      "human": "applied=true operations=1",
      "json": {
        "lab": "mesh",
        "applied": true,
        "operations": 1,
        "changed": {
          "ceos1": {
            "configset": "default",
            "present": true,
            "bytes": 14,
            "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
          }
        }
      },
      "jq": [
        "jq -r .applied",
        "jq -r .lab",
        "jq -r '.changed | keys[]'"
      ],
      "python": "edited = client.edit_project_config(EditProjectConfigRequest(**{**packed.payload, \"operations\": ops}))\nassert edited.applied is True",
      "typescript": "const edited = await client.editProjectConfig({ ...packed, operations });\nif (!edited.applied) throw new Error(\"config edit not applied\");",
      "go": "edited, _ := client.EditProjectConfig(ctx, req)\nif !edited.Applied { return fmt.Errorf(\"config edit not applied\") }"
    },
    "importProject": {
      "model": "ImportData",
      "human": "lab=/IaC/OSPF.unl",
      "json": {
        "mode": "import",
        "source_lab": "/Customers/OSPF.unl",
        "managed_lab": "/IaC/OSPF.unl",
        "lab": "/IaC/OSPF.unl",
        "name": "OSPF",
        "state": {
          "node_ids": {
            "n_1": 3,
            "n_2": 4
          }
        }
      },
      "notes": "Response includes yaml/files on first import. Never mutate source_lab.",
      "jq": [
        "jq -r .managed_lab",
        "jq -r '.state.node_ids | keys[]'"
      ],
      "python": "imported = client.import_project(ImportProjectRequest(**packed.payload))\nmanaged = imported.managed_lab or imported.lab\nstate = imported.state  # persist to .eve-iac-state.json",
      "typescript": "const imported = await client.importProject(packed);\nconst managed = imported.managed_lab ?? imported.lab;",
      "go": "imp, _ := client.ImportProject(ctx, req)\nif imp.ManagedLab != nil { _ = *imp.ManagedLab }"
    },
    "planProject": {
      "model": "PlanData",
      "human": "direction=to_eve actions=2 exists=true plan_identity=abc123",
      "json": {
        "lab": "/IaC/demo.unl",
        "exists": true,
        "direction": "to_eve",
        "applicable": true,
        "plan_identity": "abc123def456",
        "actions": [
          {
            "op": "update_node",
            "key": "n_1",
            "summary": "config changed"
          },
          {
            "op": "restart_node",
            "key": "n_1",
            "summary": "running node needs restart"
          }
        ],
        "summary": {
          "create": 0,
          "update": 1,
          "delete": 0,
          "restart": 1
        }
      },
      "jq": [
        "jq '.actions | length'",
        "jq -r .plan_identity",
        "jq -r '.actions[] | .op'"
      ],
      "python": "plan = client.plan_project(PlanProjectRequest(**packed.payload))\n# applicable is summary-only; do not gate reconcile on it\nidentity = plan.plan_identity  # pass to confirm=true reconcile",
      "typescript": "const plan = await client.planProject(packed);\nconst planIdentity = plan.plan_identity; // do not gate on plan.applicable",
      "go": "plan, _ := client.PlanProject(ctx, packed)\nif plan.PlanIdentity != nil { identity = *plan.PlanIdentity }"
    },
    "reconcileProject": {
      "model": "ReconcileData",
      "human": "applied=2 direction=to_eve",
      "json": {
        "lab": "/IaC/demo.unl",
        "applied": 2,
        "direction": "to_eve",
        "applicable": true,
        "state": {
          "node_ids": {
            "n_1": 3
          }
        }
      },
      "jq": [
        "jq .applied",
        "jq -r .direction"
      ],
      "python": "result = client.reconcile_project(ReconcileProjectRequest(**{**packed.payload, \"plan_identity\": identity}))\nprint(result.status, result.applied)\n# remaining requires_stop: confirm=True AND matching plan_identity; --yes does not invent it",
      "typescript": "const result = await client.reconcileProject({ ...packed, plan_identity: identity });\nconsole.log(result.status, result.applied);",
      "go": "rec, _ := client.ReconcileProject(ctx, req)\nif rec.Applied != nil { _ = *rec.Applied }"
    },
    "deployProject": {
      "model": "DeployData",
      "human": "lab=/IaC/demo.unl",
      "json": {
        "lab": "/IaC/demo.unl",
        "state": {
          "node_ids": {
            "n_1": 3,
            "n_2": 4
          }
        }
      },
      "jq": [
        "jq -r .lab"
      ],
      "python": "deployed = client.deploy_project(DeployProjectRequest(**packed.payload))\nlab = deployed.lab",
      "typescript": "const deployed = await client.deployProject(packed);\nconsole.log(deployed.lab);",
      "go": "dep, _ := client.DeployProject(ctx, packed)\n_ = dep.Lab"
    },
    "destroyProject": {
      "model": "DestroyData",
      "human": "lab=/IaC/demo.unl",
      "json": {
        "lab": "/IaC/demo.unl"
      },
      "jq": [
        "jq -r .lab"
      ],
      "python": "client.destroy_project(DestroyProjectRequest(**packed.payload))",
      "typescript": "await client.destroyProject(packed);",
      "go": "_, err := client.DestroyProject(ctx, packed)"
    },
    "getProjectStatus": {
      "model": "ProjectStatusData",
      "human": "lab=/IaC/demo.unl",
      "json": {
        "mode": "create",
        "runtime_lab": "/IaC/demo.unl",
        "managed_lab": "/IaC/demo.unl",
        "capabilities": {
          "topology_mutation": true,
          "reconcile": true,
          "destroy": true,
          "lifecycle": {
            "start": true,
            "stop": true,
            "wipe": true
          }
        },
        "locked": false
      },
      "jq": [
        "jq -r .runtime_lab",
        "jq -r .mode",
        "jq .capabilities.topology_mutation"
      ],
      "python": "status = client.get_project_status(GetProjectStatusRequest(**packed.payload))\nassert status.runtime_lab",
      "typescript": "const status = await client.getProjectStatus(packed);\nconsole.log(status.runtime_lab);",
      "go": "st, _ := client.GetProjectStatus(ctx, packed)\n_ = st.RuntimeLab"
    },
    "inspectProject": {
      "model": "InspectionData",
      "human": "lab=/Customers/OSPF.unl",
      "json": {
        "mode": "load",
        "observation": true,
        "desired_state": false,
        "runtime_lab": "/Customers/OSPF.unl",
        "cached": false,
        "capabilities": {
          "topology_mutation": false,
          "reconcile": false,
          "destroy": false,
          "lifecycle": {
            "start": true,
            "stop": true,
            "wipe": true
          }
        }
      },
      "notes": "Large observation payload is under additional keys when present. LOAD mode sets desired_state=false.",
      "jq": [
        "jq -r .runtime_lab",
        "jq .capabilities.lifecycle.start"
      ],
      "python": "data = client.inspect_project(InspectProjectRequest(**packed.payload))\nlab = data.runtime_lab",
      "typescript": "const data = await client.inspectProject(packed);\nconsole.log(data.runtime_lab);",
      "go": "insp, _ := client.InspectProject(ctx, packed)\n_ = insp.RuntimeLab"
    },
    "execProject": {
      "model": "BulkResult",
      "human": "requested=2 started=2 stopped=0 wiped=0 failed=0 invalid=0",
      "json": {
        "requested": 2,
        "started": 2,
        "already_running": 0,
        "already_starting": 0,
        "stopped": 0,
        "already_stopped": 0,
        "wiped": 0,
        "failed": 0,
        "invalid": 0
      },
      "jq": [
        "jq '.failed + .invalid'",
        "jq '{started, stopped, wiped}'"
      ],
      "python": "result = client.exec_project(ExecProjectRequest(**{**packed.payload, \"action\": \"start\"}))\nif result.failed or result.invalid:\n    raise SystemExit(1)",
      "typescript": "const result = await client.execProject({ ...packed, action: \"start\" });\nif ((result.failed ?? 0) + (result.invalid ?? 0) > 0) process.exit(1);",
      "go": "bulk, _ := client.ExecProject(ctx, eveiac.ExecProjectRequest{Action: \"start\", Lab: packed.Lab})\nif bulk.Failed != nil && *bulk.Failed > 0 { return fmt.Errorf(\"exec failed\") }"
    },
    "exportProjectConfig": {
      "model": "ExportConfigData",
      "human": "configset=default exported=1 skipped=0 failed=0",
      "json": {
        "lab": "/Lab.unl",
        "configset": "default",
        "nodes": [
          {
            "key": "n_1",
            "id": 1,
            "status": "exported"
          }
        ]
      },
      "notes": "Copies the running NOS configuration into an existing EVE startup-config set. Does not write topology.yml or configs/**. A later from_eve adopts the blob. Unknown set is unknown_configset and creates nothing. LOAD and source_lab are refused.",
      "jq": [
        "jq .configset",
        "jq '[.nodes[].status] | group_by(.) | map({status: .[0], count: length})'"
      ],
      "python": "saved = client.export_project_config({**packed.payload, \"configset\": \"default\", \"nodes\": [\"n_1\"]})\nfailed = [node for node in (saved.nodes or []) if node.status == \"failed\"]",
      "typescript": "const saved = await client.exportProjectConfig({ ...packed, configset: \"default\", nodes: [\"n_1\"] });\nconst failed = (saved.nodes ?? []).filter((node) => node.status === \"failed\");",
      "go": "saved, _ := client.ExportProjectConfig(ctx, map[string]any{\"lab\": lab, \"configset\": \"default\", \"nodes\": []string{\"n_1\"}})\n_ = saved.Configset"
    },
    "applyLinkQuality": {
      "model": "LinkQualityData",
      "human": "applied=true persisted=false",
      "json": {
        "applied": true,
        "persisted": false,
        "match": {
          "endpoints": [
            {
              "node": "n_1",
              "interface": "e0/0"
            },
            {
              "node": "n_2",
              "interface": "e0/1"
            }
          ]
        }
      },
      "notes": "Omitted save is live-only (persisted false, native save=0). save=true / CLI --save persists NETEM into the UNL when the session is admin and the lab is unlocked. Neither rewrites topology.yml. Observe inspectProject.",
      "jq": [
        "jq .applied",
        "jq .persisted"
      ],
      "python": "result = client.apply_link_quality(ApplyLinkQualityRequest(**{**packed.payload, \"match\": {\"endpoints\": [{\"node\": \"n_1\", \"interface\": \"e0/0\"}, {\"node\": \"n_2\", \"interface\": \"e0/1\"}]}, \"source_impairment\": {\"delay\": 50}, \"save\": True}))",
      "typescript": "const result = await client.applyLinkQuality({ ...packed, match: { endpoints: [{ node: \"n_1\", interface: \"e0/0\" }, { node: \"n_2\", interface: \"e0/1\" }] }, source_impairment: { delay: 50 }, save: true });",
      "go": "q, _ := client.ApplyLinkQuality(ctx, req)\n_ = q.Applied"
    },
    "setLinkSuspend": {
      "model": "LinkSuspendData",
      "human": "applied=true suspended=true side=both",
      "json": {
        "applied": true,
        "suspended": true,
        "side": "both",
        "match": {
          "endpoints": [
            {
              "node": "n_1",
              "interface": "e0/0"
            },
            {
              "node": "n_2",
              "interface": "e0/1"
            }
          ]
        },
        "targets": [
          {
            "node": "n_1",
            "interface": "e0/0"
          },
          {
            "node": "n_2",
            "interface": "e0/1"
          }
        ]
      },
      "notes": "Runtime TAP suspend. Never a topology.yml field. Observe inspect runtime source_suspend.",
      "jq": [
        "jq .suspended",
        "jq .side"
      ],
      "python": "result = client.set_link_suspend(SetLinkSuspendRequest(**{**packed.payload, \"match\": {\"endpoints\": [{\"node\": \"n_1\", \"interface\": \"e0/0\"}, {\"node\": \"n_2\", \"interface\": \"e0/1\"}]}, \"suspended\": True}))",
      "typescript": "const result = await client.setLinkSuspend({ ...packed, match: { endpoints: [{ node: \"n_1\", interface: \"e0/0\" }, { node: \"n_2\", interface: \"e0/1\" }] }, suspended: true });",
      "go": "s, _ := client.SetLinkSuspend(ctx, req)\n_ = s.Suspended"
    },
    "getCapabilities": {
      "model": "CapabilitiesData",
      "json": {
        "eveReachable": true,
        "eveBaseUrl": "https://127.0.0.1",
        "features": {
          "import": true,
          "inspect": true
        },
        "projectModes": {
          "create": {
            "topology_mutation": true,
            "reconcile": true
          },
          "load": {
            "topology_mutation": false,
            "lifecycle": {
              "start": true,
              "stop": true,
              "wipe": true
            }
          }
        }
      },
      "python": "caps = client.get_capabilities()\nassert caps.eve_reachable",
      "typescript": "const caps = await client.getCapabilities();",
      "go": "caps, _ := client.GetCapabilities(ctx)"
    },
    "getTemplate": {
      "model": "TemplateDetail",
      "json": {
        "id": "iol",
        "description": "IOL",
        "type": "qemu",
        "provisioned": true,
        "configSupported": true,
        "default": "iol-2024",
        "images": [
          {
            "id": "iol-2024",
            "available": true
          }
        ]
      },
      "python": "detail = client.get_template(\"iol\")\nprint(detail.default)",
      "typescript": "const detail = await client.getTemplate(\"iol\");",
      "go": "tpl, _ := client.GetTemplate(ctx, \"iol\")"
    },
    "getNetworkAuthoring": {
      "model": "NetworkAuthoring",
      "json": {
        "id": "bridge",
        "label": "bridge",
        "supported": true,
        "attributes": [
          {
            "name": "smart",
            "label": "Smart Bridge",
            "kind": "integer",
            "group": "manage",
            "values": [
              "0",
              "1"
            ]
          },
          {
            "name": "pnet_out",
            "label": "Uplink",
            "kind": "enum",
            "group": "manage",
            "values": [
              "",
              "pnet0",
              "nat0"
            ]
          }
        ]
      },
      "python": "data = client.get_network_authoring(\"bridge\")",
      "typescript": "const data = await client.getNetworkAuthoring(\"bridge\");",
      "go": "data, _ := client.GetNetworkAuthoring(ctx, \"bridge\")"
    },
    "previewInterfaces": {
      "model": "InterfacesData",
      "json": {
        "source": "template",
        "template": "ceos",
        "items": [
          {
            "name": "Ethernet1",
            "type": "ethernet"
          },
          {
            "name": "Ethernet2",
            "type": "ethernet"
          }
        ]
      },
      "python": "data = client.preview_interfaces({\"template\": \"ceos\"})\nassert data.source == \"template\"\nassert data.template == \"ceos\"",
      "typescript": "const data = await client.previewInterfaces({ template: \"ceos\" });",
      "go": "data, _ := client.PreviewInterfaces(ctx, req)"
    },
    "completeLinkInterfaces": {
      "model": "InterfacesData",
      "json": {
        "source": "node",
        "node": "core_r1",
        "template": "iol",
        "items": [
          {
            "name": "e0/0",
            "type": "ethernet",
            "used": true
          },
          {
            "name": "s0/0",
            "type": "serial",
            "used": false
          }
        ]
      },
      "python": "data = client.complete_link_interfaces({\"yaml\": yaml, \"node\": \"core_r1\"})\nassert data.source == \"node\"\nassert data.node == \"core_r1\"",
      "typescript": "const data = await client.completeLinkInterfaces({ yaml, node: \"core_r1\" });",
      "go": "data, _ := client.CompleteLinkInterfaces(ctx, req)"
    },
    "execConsole": {
      "model": "ConsoleExecData",
      "json": {
        "output": "Cisco IOS Software, Version 15.2(4)M6\n",
        "node": "n_1"
      },
      "python": "data = client.exec_console(ExecConsoleRequest(**{**packed.payload, \"node\": \"n_1\", \"command\": \"show version\"}))\nprint(data.output)",
      "typescript": "const data = await client.execConsole({ ...packed, node: \"n_1\", command: \"show version\" });\nconsole.log(data.output);",
      "go": "out, _ := client.ExecConsole(ctx, req)\n_ = out.Output"
    },
    "execConsoleMany": {
      "model": "ConsoleExecManyData",
      "json": {
        "results": [
          {
            "node": "n_1",
            "output": "R1#",
            "ok": true
          },
          {
            "node": "n_2",
            "output": "R2#",
            "ok": true
          }
        ]
      },
      "python": "data = client.exec_console_many(ExecConsoleManyRequest(**packed.payload))\nfor row in data.results or []:\n    print(row.node, row.output)",
      "typescript": "const data = await client.execConsoleMany(packed);\nfor (const row of data.results ?? []) console.log(row.node);",
      "go": "many, _ := client.ExecConsoleMany(ctx, req)"
    },
    "attachConsole": {
      "model": "ConsoleAttachData",
      "json": {
        "node": "n_1",
        "name": "R1",
        "console_type": "telnet",
        "stream": "/api/v1/console/stream/abc123",
        "transport": "eve-telnet",
        "mode": "interact"
      },
      "notes": "Omitted mode is interact. stream is a relative ticket path; success streamConsole uses 101 eve-telnet.",
      "python": "attached = client.attach_console(AttachConsoleRequest(**{**packed.payload, \"node\": \"n_1\"}))\nticket = attached.stream.rsplit(\"/\", 1)[-1] if attached.stream else None",
      "typescript": "const attached = await client.attachConsole({ ...packed, node: \"n_1\" });",
      "go": "att, _ := client.AttachConsole(ctx, req)"
    },
    "createConsoleSession": {
      "model": "ConsoleSessionData",
      "json": {
        "session_id": "sess-7f3a",
        "node": "n_1",
        "name": "R1",
        "console_type": "telnet",
        "mode": "interact",
        "state": "open",
        "observers": 1,
        "writers": 1
      },
      "python": "sess = client.create_console_session(CreateConsoleSessionRequest(**{**packed.payload, \"node\": \"n_1\", \"mode\": \"interact\"}))\nprint(sess.session_id)",
      "typescript": "const sess = await client.createConsoleSession({ ...packed, node: \"n_1\", mode: \"interact\" });",
      "go": "sess, _ := client.CreateConsoleSession(ctx, req)"
    },
    "listConsoleSessions": {
      "model": "ConsoleSessionListData",
      "json": {
        "sessions": [
          {
            "session_id": "sess-7f3a",
            "node": "n_1",
            "mode": "interact",
            "state": "open"
          }
        ]
      },
      "python": "listed = client.list_console_sessions(ListConsoleSessionsRequest(**packed.payload))",
      "typescript": "const listed = await client.listConsoleSessions(packed);",
      "go": "listed, _ := client.ListConsoleSessions(ctx, req)"
    },
    "getConsoleSession": {
      "model": "ConsoleSessionData",
      "json": {
        "session_id": "sess-7f3a",
        "node": "n_1",
        "mode": "exclusive",
        "state": "open",
        "owner": "agent-session-1",
        "writers": 1
      },
      "python": "sess = client.get_console_session(GetConsoleSessionRequest(**{**packed.payload, \"session_id\": \"sess-7f3a\"}))",
      "typescript": "const sess = await client.getConsoleSession({ ...packed, session_id: \"sess-7f3a\" });",
      "go": "sess, _ := client.GetConsoleSession(ctx, req)"
    },
    "closeConsoleSession": {
      "model": "ConsoleSessionData",
      "json": {
        "session_id": "sess-7f3a",
        "node": "n_1",
        "state": "closed"
      },
      "python": "closed = client.close_console_session(CloseConsoleSessionRequest(**{**packed.payload, \"session_id\": \"sess-7f3a\"}))",
      "typescript": "const closed = await client.closeConsoleSession({ ...packed, session_id: \"sess-7f3a\" });",
      "go": "closed, _ := client.CloseConsoleSession(ctx, req)"
    },
    "getConsoleHistory": {
      "model": "ConsoleHistoryData",
      "json": {
        "session_id": "sess-7f3a",
        "node": "n_1",
        "text": "Router>enable\\nRouter#",
        "truncated": false,
        "byte_count": 18,
        "available_bytes": 18
      },
      "notes": "Ephemeral Hub ring tail only; not persistent audit history.",
      "python": "hist = client.get_console_history(GetConsoleHistoryRequest(**{**packed.payload, \"session_id\": \"sess-7f3a\"}))",
      "typescript": "const hist = await client.getConsoleHistory({ ...packed, session_id: \"sess-7f3a\" });",
      "go": "hist, _ := client.GetConsoleHistory(ctx, req)"
    },
    "waitConsole": {
      "model": "ConsoleWaitData",
      "json": {
        "session_id": "sess-7f3a",
        "node": "n_1",
        "matched": true,
        "match": "Router#",
        "text": "Router#",
        "duration_ms": 42,
        "timed_out": false,
        "truncated": false
      },
      "python": "waited = client.wait_console(WaitConsoleRequest(**{**packed.payload, \"node\": \"n_1\", \"pattern\": \"Router#\", \"timeout_ms\": 30000}))",
      "typescript": "const waited = await client.waitConsole({ ...packed, node: \"n_1\", pattern: \"Router#\", timeout_ms: 30000 });",
      "go": "waited, _ := client.WaitConsole(ctx, req)"
    },
    "runConsole": {
      "model": "ConsoleRunData",
      "json": {
        "session_id": "sess-7f3a",
        "ok": true,
        "failed_step": -1,
        "duration_ms": 120,
        "truncated": false,
        "transcript": "Press RETURN to get started\\nRouter>enable\\nRouter#",
        "steps": [
          {
            "index": 0,
            "expect": "Press RETURN",
            "sent": "",
            "matched": "Press RETURN",
            "duration_ms": 10
          },
          {
            "index": 1,
            "expect": "Router>",
            "sent": "enable",
            "matched": "Router>",
            "duration_ms": 15
          },
          {
            "index": 2,
            "expect": "Router#",
            "sent": "********",
            "matched": "Router#",
            "duration_ms": 12
          }
        ]
      },
      "notes": "send_secret values appear as ******** in sent/transcript; never include real secrets in samples.",
      "python": "ran = client.run_console(RunConsoleRequest(**{**packed.payload, \"node\": \"n_1\", \"steps\": [{\"expect\": \"Router#\"}]}))",
      "typescript": "const ran = await client.runConsole({ ...packed, node: \"n_1\", steps: [{ expect: \"Router#\" }] });",
      "go": "ran, _ := client.RunConsole(ctx, req)"
    },
    "openProject": {
      "model": "OpenData",
      "json": {
        "url": "https://eve.example/#/lab/abc123"
      },
      "python": "opened = client.open_project(OpenProjectRequest(**packed.payload))\nprint(opened.url)",
      "typescript": "const opened = await client.openProject(packed);",
      "go": "open, _ := client.OpenProject(ctx, packed)"
    },
    "listProjectConsoles": {
      "model": "ConsolesData",
      "json": {
        "consoles": [
          {
            "node": "n_1",
            "name": "R1",
            "status": "running",
            "protocol": "telnet",
            "host": "127.0.0.1",
            "port": 32769
          }
        ]
      },
      "python": "consoles = client.list_project_consoles(ListProjectConsolesRequest(**packed.payload))\nfor c in consoles.consoles or []:\n    print(c.node, c.port)",
      "typescript": "const { consoles } = await client.listProjectConsoles(packed);",
      "go": "cons, _ := client.ListProjectConsoles(ctx, packed)"
    }
  }
}
