arcade-core 4.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. arcade_core-4.0.0/.gitignore +181 -0
  2. arcade_core-4.0.0/PKG-INFO +79 -0
  3. arcade_core-4.0.0/README.md +43 -0
  4. arcade_core-4.0.0/arcade_core/__init__.py +2 -0
  5. arcade_core-4.0.0/arcade_core/annotations.py +8 -0
  6. arcade_core-4.0.0/arcade_core/auth.py +204 -0
  7. arcade_core-4.0.0/arcade_core/auth_tokens.py +110 -0
  8. arcade_core-4.0.0/arcade_core/catalog.py +1211 -0
  9. arcade_core-4.0.0/arcade_core/config.py +23 -0
  10. arcade_core-4.0.0/arcade_core/config_model.py +236 -0
  11. arcade_core-4.0.0/arcade_core/constants.py +11 -0
  12. arcade_core-4.0.0/arcade_core/context.py +128 -0
  13. arcade_core-4.0.0/arcade_core/converters/openai.py +220 -0
  14. arcade_core-4.0.0/arcade_core/discovery.py +253 -0
  15. arcade_core-4.0.0/arcade_core/errors.py +378 -0
  16. arcade_core-4.0.0/arcade_core/executor.py +131 -0
  17. arcade_core-4.0.0/arcade_core/network/__init__.py +1 -0
  18. arcade_core-4.0.0/arcade_core/network/org_transport.py +99 -0
  19. arcade_core-4.0.0/arcade_core/output.py +123 -0
  20. arcade_core-4.0.0/arcade_core/parse.py +74 -0
  21. arcade_core-4.0.0/arcade_core/py.typed +0 -0
  22. arcade_core-4.0.0/arcade_core/schema.py +654 -0
  23. arcade_core-4.0.0/arcade_core/toolkit.py +402 -0
  24. arcade_core-4.0.0/arcade_core/usage/__init__.py +5 -0
  25. arcade_core-4.0.0/arcade_core/usage/__main__.py +63 -0
  26. arcade_core-4.0.0/arcade_core/usage/constants.py +34 -0
  27. arcade_core-4.0.0/arcade_core/usage/identity.py +242 -0
  28. arcade_core-4.0.0/arcade_core/usage/usage_service.py +104 -0
  29. arcade_core-4.0.0/arcade_core/usage/utils.py +13 -0
  30. arcade_core-4.0.0/arcade_core/utils.py +109 -0
  31. arcade_core-4.0.0/arcade_core/version.py +1 -0
  32. arcade_core-4.0.0/pyproject.toml +63 -0
@@ -0,0 +1,181 @@
1
+ .DS_Store
2
+ credentials.yaml
3
+ docker/credentials.yaml
4
+
5
+ *.lock
6
+
7
+ # example data
8
+ examples/data
9
+ scratch
10
+
11
+
12
+ docs/source
13
+
14
+ # From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
15
+
16
+ # Byte-compiled / optimized / DLL files
17
+ __pycache__/
18
+ *.py[cod]
19
+ *$py.class
20
+
21
+ # C extensions
22
+ *.so
23
+
24
+ # Distribution / packaging
25
+ .Python
26
+ build/
27
+ develop-eggs/
28
+ dist/
29
+ downloads/
30
+ eggs/
31
+ .eggs/
32
+ lib/
33
+ lib64/
34
+ parts/
35
+ sdist/
36
+ var/
37
+ wheels/
38
+ share/python-wheels/
39
+ *.egg-info/
40
+ .installed.cfg
41
+ *.egg
42
+ MANIFEST
43
+
44
+ # PyInstaller
45
+ # Usually these files are written by a python script from a template
46
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
47
+ *.manifest
48
+ *.spec
49
+
50
+ # Installer logs
51
+ pip-log.txt
52
+ pip-delete-this-directory.txt
53
+
54
+ # Unit test / coverage reports
55
+ htmlcov/
56
+ .tox/
57
+ .nox/
58
+ .coverage
59
+ .coverage.*
60
+ .cache
61
+ nosetests.xml
62
+ coverage.xml
63
+ *.cover
64
+ *.py,cover
65
+ .hypothesis/
66
+ .pytest_cache/
67
+ cover/
68
+
69
+ # Translations
70
+ *.mo
71
+ *.pot
72
+
73
+ # Django stuff:
74
+ *.log
75
+ local_settings.py
76
+ db.sqlite3
77
+ db.sqlite3-journal
78
+
79
+ # Flask stuff:
80
+ instance/
81
+ .webassets-cache
82
+
83
+ # Scrapy stuff:
84
+ .scrapy
85
+
86
+ # Sphinx documentation
87
+ docs/_build/
88
+
89
+ # PyBuilder
90
+ .pybuilder/
91
+ target/
92
+
93
+ # Jupyter Notebook
94
+ .ipynb_checkpoints
95
+
96
+ # IPython
97
+ profile_default/
98
+ ipython_config.py
99
+
100
+ # IDE
101
+ *.code-workspace
102
+
103
+ # pyenv
104
+ # For a library or package, you might want to ignore these files since the code is
105
+ # intended to run in multiple environments; otherwise, check them in:
106
+ # .python-version
107
+
108
+ # pipenv
109
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
110
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
111
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
112
+ # install all needed dependencies.
113
+ #Pipfile.lock
114
+
115
+ # poetry
116
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
117
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
118
+ # commonly ignored for libraries.
119
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
120
+ poetry.lock
121
+
122
+ # pdm
123
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
124
+ #pdm.lock
125
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
126
+ # in version control.
127
+ # https://pdm.fming.dev/#use-with-ide
128
+ .pdm.toml
129
+
130
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
131
+ __pypackages__/
132
+
133
+ # Celery stuff
134
+ celerybeat-schedule
135
+ celerybeat.pid
136
+
137
+ # SageMath parsed files
138
+ *.sage.py
139
+
140
+ # Environments
141
+ .env
142
+ .venv
143
+ env/
144
+ venv/
145
+ ENV/
146
+ env.bak/
147
+ venv.bak/
148
+
149
+ # Spyder project settings
150
+ .spyderproject
151
+ .spyproject
152
+
153
+ # Rope project settings
154
+ .ropeproject
155
+
156
+ # mkdocs documentation
157
+ /site
158
+
159
+ # mypy
160
+ .mypy_cache/
161
+ .dmypy.json
162
+ dmypy.json
163
+
164
+ # Pyre type checker
165
+ .pyre/
166
+
167
+ # pytype static type analyzer
168
+ .pytype/
169
+
170
+ # Cython debug symbols
171
+ cython_debug/
172
+
173
+ # PyCharm
174
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
175
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
176
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
177
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
178
+ #.idea/
179
+
180
+ # Docs
181
+ libs/arcade-mcp-server/site/*
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: arcade-core
3
+ Version: 4.0.0
4
+ Summary: Arcade Core - Core library for Arcade platform
5
+ Author-email: Arcade <dev@arcade.dev>
6
+ License: MIT
7
+ Classifier: Development Status :: 5 - Production/Stable
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Requires-Python: >=3.10
16
+ Requires-Dist: httpx>=0.27.0
17
+ Requires-Dist: loguru>=0.7.0
18
+ Requires-Dist: packaging>=24.1
19
+ Requires-Dist: pydantic>=2.7.0
20
+ Requires-Dist: pyjwt>=2.8.0
21
+ Requires-Dist: pyyaml>=6.0
22
+ Requires-Dist: toml>=0.10.2
23
+ Requires-Dist: types-python-dateutil==2.9.0.20241003
24
+ Requires-Dist: types-pytz==2024.2.0.20241003
25
+ Requires-Dist: types-toml==0.10.8.20240310
26
+ Provides-Extra: dev
27
+ Requires-Dist: mypy>=1.5.1; extra == 'dev'
28
+ Requires-Dist: pre-commit>=3.4.0; extra == 'dev'
29
+ Requires-Dist: pytest-asyncio>=0.23.7; extra == 'dev'
30
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
31
+ Requires-Dist: pytest>=8.1.2; extra == 'dev'
32
+ Requires-Dist: types-python-dateutil>=2.8.2; extra == 'dev'
33
+ Requires-Dist: types-pytz>=2024.1; extra == 'dev'
34
+ Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # Arcade Core
38
+
39
+ Core library for the Arcade platform providing foundational components and utilities.
40
+
41
+ ## Overview
42
+
43
+ Arcade Core provides the essential building blocks for the Arcade platform:
44
+
45
+ - **Tool Catalog & Toolkit Management**: Core classes for managing and organizing tools
46
+ - **Configuration & Schema Handling**: Configuration management and validation
47
+ - **Authentication & Authorization**: Auth providers and security utilities
48
+ - **Error Handling**: Comprehensive error types and handling
49
+ - **Telemetry & Observability**: Monitoring and tracing capabilities
50
+ - **Utilities**: Common helper functions and validators
51
+
52
+ ## Installation
53
+
54
+ ```bash
55
+ pip install arcade-core
56
+ ```
57
+
58
+ ## Usage
59
+
60
+ 1. Install an arcade toolkit
61
+ ```bash
62
+ pip install arcade-math
63
+ ```
64
+
65
+ 2. Load the toolkit
66
+ ```python
67
+ import arcade_math
68
+ from arcade_core import ToolCatalog, Toolkit
69
+
70
+ # Create a tool catalog
71
+ catalog = ToolCatalog()
72
+
73
+ # Load a toolkit
74
+ toolkit = Toolkit.from_module(arcade_math)
75
+ ```
76
+
77
+ ## License
78
+
79
+ MIT License - see LICENSE file for details.
@@ -0,0 +1,43 @@
1
+ # Arcade Core
2
+
3
+ Core library for the Arcade platform providing foundational components and utilities.
4
+
5
+ ## Overview
6
+
7
+ Arcade Core provides the essential building blocks for the Arcade platform:
8
+
9
+ - **Tool Catalog & Toolkit Management**: Core classes for managing and organizing tools
10
+ - **Configuration & Schema Handling**: Configuration management and validation
11
+ - **Authentication & Authorization**: Auth providers and security utilities
12
+ - **Error Handling**: Comprehensive error types and handling
13
+ - **Telemetry & Observability**: Monitoring and tracing capabilities
14
+ - **Utilities**: Common helper functions and validators
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ pip install arcade-core
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ 1. Install an arcade toolkit
25
+ ```bash
26
+ pip install arcade-math
27
+ ```
28
+
29
+ 2. Load the toolkit
30
+ ```python
31
+ import arcade_math
32
+ from arcade_core import ToolCatalog, Toolkit
33
+
34
+ # Create a tool catalog
35
+ catalog = ToolCatalog()
36
+
37
+ # Load a toolkit
38
+ toolkit = Toolkit.from_module(arcade_math)
39
+ ```
40
+
41
+ ## License
42
+
43
+ MIT License - see LICENSE file for details.
@@ -0,0 +1,2 @@
1
+ from .catalog import ToolCatalog as ToolCatalog
2
+ from .toolkit import Toolkit as Toolkit
@@ -0,0 +1,8 @@
1
+ from dataclasses import dataclass
2
+
3
+
4
+ @dataclass(frozen=True)
5
+ class Inferrable:
6
+ """An annotation indicating that a parameter can be inferred by a model (default: True)."""
7
+
8
+ value: bool = True
@@ -0,0 +1,204 @@
1
+ from enum import Enum
2
+ from typing import Optional
3
+
4
+ from pydantic import BaseModel, ConfigDict
5
+
6
+
7
+ class AuthProviderType(str, Enum):
8
+ oauth2 = "oauth2"
9
+
10
+
11
+ class ToolAuthorization(BaseModel):
12
+ """Marks a tool as requiring authorization."""
13
+
14
+ model_config = ConfigDict(frozen=True)
15
+
16
+ provider_id: Optional[str] = None
17
+ """The provider ID configured in Arcade that acts as an alias to well-known configuration."""
18
+
19
+ provider_type: AuthProviderType
20
+ """The type of the authorization provider."""
21
+
22
+ id: Optional[str] = None
23
+ """A provider's unique identifier, allowing the tool to specify a specific authorization provider. Recommended for private tools only."""
24
+
25
+ scopes: Optional[list[str]] = None
26
+ """The scope(s) needed for the authorized action."""
27
+
28
+
29
+ class OAuth2(ToolAuthorization):
30
+ """Marks a tool as requiring OAuth 2.0 authorization."""
31
+
32
+ def __init__(self, *, id: str | None, scopes: Optional[list[str]] = None): # noqa: A002
33
+ super().__init__(id=id, scopes=scopes, provider_type=AuthProviderType.oauth2)
34
+
35
+
36
+ class Asana(OAuth2):
37
+ """Marks a tool as requiring Asana authorization."""
38
+
39
+ provider_id: str = "asana"
40
+
41
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
42
+ super().__init__(id=id, scopes=scopes)
43
+
44
+
45
+ class Atlassian(OAuth2):
46
+ """Marks a tool as requiring Atlassian authorization."""
47
+
48
+ provider_id: str = "atlassian"
49
+
50
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
51
+ super().__init__(id=id, scopes=scopes)
52
+
53
+
54
+ class ClickUp(OAuth2):
55
+ """Marks a tool as requiring ClickUp authorization."""
56
+
57
+ provider_id: str = "clickup"
58
+
59
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
60
+ super().__init__(id=id, scopes=scopes)
61
+
62
+
63
+ class Discord(OAuth2):
64
+ """Marks a tool as requiring Discord authorization."""
65
+
66
+ provider_id: str = "discord"
67
+
68
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
69
+ super().__init__(id=id, scopes=scopes)
70
+
71
+
72
+ class Dropbox(OAuth2):
73
+ """Marks a tool as requiring Dropbox authorization."""
74
+
75
+ provider_id: str = "dropbox"
76
+
77
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
78
+ super().__init__(id=id, scopes=scopes)
79
+
80
+
81
+ class Figma(OAuth2):
82
+ """Marks a tool as requiring Figma authorization."""
83
+
84
+ provider_id: str = "figma"
85
+
86
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
87
+ super().__init__(id=id, scopes=scopes)
88
+
89
+
90
+ class GitHub(OAuth2):
91
+ """Marks a tool as requiring GitHub App authorization."""
92
+
93
+ provider_id: str = "github"
94
+
95
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
96
+ super().__init__(id=id, scopes=scopes)
97
+
98
+
99
+ class Google(OAuth2):
100
+ """Marks a tool as requiring Google authorization."""
101
+
102
+ provider_id: str = "google"
103
+
104
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
105
+ super().__init__(id=id, scopes=scopes)
106
+
107
+
108
+ class Hubspot(OAuth2):
109
+ """Marks a tool as requiring Hubspot authorization."""
110
+
111
+ provider_id: str = "hubspot"
112
+
113
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
114
+ super().__init__(id=id, scopes=scopes)
115
+
116
+
117
+ class Linear(OAuth2):
118
+ """Marks a tool as requiring Linear authorization."""
119
+
120
+ provider_id: str = "linear"
121
+
122
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
123
+ super().__init__(id=id, scopes=scopes)
124
+
125
+
126
+ class LinkedIn(OAuth2):
127
+ """Marks a tool as requiring LinkedIn authorization."""
128
+
129
+ provider_id: str = "linkedin"
130
+
131
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
132
+ super().__init__(id=id, scopes=scopes)
133
+
134
+
135
+ class Microsoft(OAuth2):
136
+ """Marks a tool as requiring Microsoft authorization."""
137
+
138
+ provider_id: str = "microsoft"
139
+
140
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
141
+ super().__init__(id=id, scopes=scopes)
142
+
143
+
144
+ class Notion(OAuth2):
145
+ """Marks a tool as requiring Notion authorization."""
146
+
147
+ provider_id: str = "notion"
148
+
149
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
150
+ super().__init__(id=id, scopes=scopes)
151
+
152
+
153
+ class Reddit(OAuth2):
154
+ """Marks a tool as requiring Reddit authorization."""
155
+
156
+ provider_id: str = "reddit"
157
+
158
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
159
+ super().__init__(id=id, scopes=scopes)
160
+
161
+
162
+ class Slack(OAuth2):
163
+ """Marks a tool as requiring Slack (user token) authorization."""
164
+
165
+ provider_id: str = "slack"
166
+
167
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
168
+ super().__init__(id=id, scopes=scopes)
169
+
170
+
171
+ class Spotify(OAuth2):
172
+ """Marks a tool as requiring Spotify authorization."""
173
+
174
+ provider_id: str = "spotify"
175
+
176
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
177
+ super().__init__(id=id, scopes=scopes)
178
+
179
+
180
+ class Twitch(OAuth2):
181
+ """Marks a tool as requiring Twitch authorization."""
182
+
183
+ provider_id: str = "twitch"
184
+
185
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
186
+ super().__init__(id=id, scopes=scopes)
187
+
188
+
189
+ class X(OAuth2):
190
+ """Marks a tool as requiring X (Twitter) authorization."""
191
+
192
+ provider_id: str = "x"
193
+
194
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
195
+ super().__init__(id=id, scopes=scopes)
196
+
197
+
198
+ class Zoom(OAuth2):
199
+ """Marks a tool as requiring Zoom authorization."""
200
+
201
+ provider_id: str = "zoom"
202
+
203
+ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
204
+ super().__init__(id=id, scopes=scopes)
@@ -0,0 +1,110 @@
1
+ """
2
+ Shared access-token utilities used by both the CLI and MCP server.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ from datetime import datetime, timedelta
8
+
9
+ import httpx
10
+ from pydantic import BaseModel
11
+
12
+ from arcade_core.config_model import Config
13
+ from arcade_core.constants import PROD_COORDINATOR_HOST
14
+
15
+
16
+ class CLIConfig(BaseModel):
17
+ """OAuth configuration returned by the Coordinator."""
18
+
19
+ client_id: str
20
+ authorization_endpoint: str
21
+ token_endpoint: str
22
+
23
+
24
+ class TokenResponse(BaseModel):
25
+ """OAuth token response."""
26
+
27
+ access_token: str
28
+ refresh_token: str
29
+ expires_in: int
30
+ token_type: str
31
+
32
+
33
+ def fetch_cli_config(coordinator_url: str) -> CLIConfig:
34
+ """Fetch OAuth configuration from the Coordinator."""
35
+ url = f"{coordinator_url}/api/v1/auth/cli_config"
36
+ response = httpx.get(url, timeout=30)
37
+ response.raise_for_status()
38
+ return CLIConfig.model_validate(response.json())
39
+
40
+
41
+ def refresh_access_token(
42
+ cli_config: CLIConfig,
43
+ refresh_token: str,
44
+ ) -> TokenResponse:
45
+ """Refresh the access token using authlib-compatible token endpoint."""
46
+ response = httpx.post(
47
+ cli_config.token_endpoint,
48
+ data={
49
+ "grant_type": "refresh_token",
50
+ "refresh_token": refresh_token,
51
+ "client_id": cli_config.client_id,
52
+ },
53
+ timeout=30,
54
+ )
55
+ response.raise_for_status()
56
+ token = response.json()
57
+ return TokenResponse(
58
+ access_token=token["access_token"],
59
+ refresh_token=token.get("refresh_token", refresh_token),
60
+ expires_in=token["expires_in"],
61
+ token_type=token["token_type"],
62
+ )
63
+
64
+
65
+ def get_valid_access_token(coordinator_url: str | None = None) -> str:
66
+ """
67
+ Get a valid access token, refreshing if necessary.
68
+
69
+ Returns:
70
+ Valid access token
71
+
72
+ Raises:
73
+ ValueError: If not logged in or token refresh fails
74
+ """
75
+ try:
76
+ config = Config.load_from_file()
77
+ except FileNotFoundError:
78
+ raise ValueError("Not logged in. Please run 'arcade login' first.")
79
+
80
+ resolved_coordinator_url = (
81
+ coordinator_url
82
+ or (config.coordinator_url if config.coordinator_url else None)
83
+ or f"https://{PROD_COORDINATOR_HOST}"
84
+ )
85
+
86
+ if not config.auth:
87
+ raise ValueError("Not logged in. Please run 'arcade login' first.")
88
+
89
+ # Check if token needs refresh
90
+ if config.is_token_expired():
91
+ cli_config = fetch_cli_config(resolved_coordinator_url)
92
+
93
+ try:
94
+ new_tokens = refresh_access_token(cli_config, config.auth.refresh_token)
95
+ except httpx.HTTPError as e:
96
+ raise ValueError(
97
+ f"Failed to refresh token: {e}. Please run 'arcade login' to re-authenticate."
98
+ )
99
+
100
+ # Update stored credentials
101
+ expires_at = datetime.now() + timedelta(seconds=new_tokens.expires_in)
102
+ config.coordinator_url = resolved_coordinator_url
103
+ config.auth.access_token = new_tokens.access_token
104
+ config.auth.refresh_token = new_tokens.refresh_token
105
+ config.auth.expires_at = expires_at
106
+ config.save_to_file()
107
+
108
+ return new_tokens.access_token
109
+
110
+ return config.auth.access_token