MCPcopy Create free account
hub / github.com/commandoperator/cmdop-sdk / resolve

Method resolve

python/src/cmdop/config.py:36–81  ·  view source on GitHub ↗

Build a config, applying explicit > env > default precedence. Relay token sources: ``CMDOP_TOKEN`` then ``CMDOP_API_KEY`` (token wins if both) — keeps single-credential setups working. The skills plane reads ``api_key`` from ``CMDOP_API_KEY`` independently.

(
        cls,
        *,
        token: str | None = None,
        base_url: str | None = None,
        fleet_id: str | None = None,
        timeout_ms: int | None = None,
        api_key: str | None = None,
        api_base_url: str | None = None,
    )

Source from the content-addressed store, hash-verified

34 if resolved_timeout is None:
35 value = os.environ.get("CMDOP_TIMEOUT_MS")
36 resolved_timeout = int(value) if value else DEFAULT_TIMEOUT_MS
37 if resolved_timeout <= 0:
38 raise ValueError("timeout_ms must be greater than zero")
39 resolved_base = base_url or os.environ.get("CMDOP_BASE_URL") or None
40 return cls(
41 token=token or os.environ.get("CMDOP_TOKEN") or None,
42 base_url=resolved_base.rstrip("/") if resolved_base else None,
43 timeout_ms=resolved_timeout,
44 )

Callers 15

__init__Method · 0.80
test_token_env_fallbackFunction · 0.80
test_defaultsFunction · 0.80
test_base_url_precedenceFunction · 0.80
_make_transportFunction · 0.80

Calls 1

getMethod · 0.45

Tested by 12

test_token_env_fallbackFunction · 0.64
test_defaultsFunction · 0.64
test_base_url_precedenceFunction · 0.64
_make_transportFunction · 0.64
_make_transportFunction · 0.64