indent 0.1.19__py3-none-any.whl → 0.1.20__py3-none-any.whl
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.
- exponent/__init__.py +2 -2
- exponent/commands/config_commands.py +0 -87
- exponent/commands/run_commands.py +1 -1
- exponent/core/remote_execution/cli_rpc_types.py +1 -0
- exponent/core/remote_execution/default_env.py +31 -0
- exponent/core/remote_execution/languages/shell_streaming.py +4 -0
- exponent/core/remote_execution/types.py +8 -1
- {indent-0.1.19.dist-info → indent-0.1.20.dist-info}/METADATA +1 -1
- {indent-0.1.19.dist-info → indent-0.1.20.dist-info}/RECORD +11 -11
- exponent/core/graphql/github_config_queries.py +0 -56
- {indent-0.1.19.dist-info → indent-0.1.20.dist-info}/WHEEL +0 -0
- {indent-0.1.19.dist-info → indent-0.1.20.dist-info}/entry_points.txt +0 -0
exponent/__init__.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.1.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
31
|
+
__version__ = version = '0.1.20'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 20)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -14,11 +14,6 @@ from exponent.commands.types import exponent_cli_group
|
|
|
14
14
|
from exponent.core.config import Settings
|
|
15
15
|
from exponent.core.graphql.client import GraphQLClient
|
|
16
16
|
from exponent.core.graphql.get_chats_query import GET_CHATS_QUERY
|
|
17
|
-
from exponent.core.graphql.github_config_queries import (
|
|
18
|
-
CHECK_GITHUB_CONFIG_VALIDITY_QUERY,
|
|
19
|
-
CREATE_GITHUB_CONFIG_MUTATION,
|
|
20
|
-
REPOS_FOR_GITHUB_CONFIG_QUERY,
|
|
21
|
-
)
|
|
22
17
|
from exponent.core.graphql.subscriptions import AUTHENTICATED_USER_SUBSCRIPTION
|
|
23
18
|
from exponent.utils.version import (
|
|
24
19
|
get_installed_metadata,
|
|
@@ -56,74 +51,6 @@ def debug(
|
|
|
56
51
|
click.echo(get_installed_metadata())
|
|
57
52
|
|
|
58
53
|
|
|
59
|
-
@config_cli.command(hidden=True)
|
|
60
|
-
@use_settings
|
|
61
|
-
def check_github_config_validity(
|
|
62
|
-
settings: Settings,
|
|
63
|
-
) -> None:
|
|
64
|
-
if not settings.api_key:
|
|
65
|
-
redirect_to_login(settings)
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
run_until_complete(
|
|
69
|
-
check_github_config_validity_task(
|
|
70
|
-
api_key=settings.api_key,
|
|
71
|
-
base_api_url=settings.get_base_api_url(),
|
|
72
|
-
base_ws_url=settings.get_base_ws_url(),
|
|
73
|
-
)
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
async def check_github_config_validity_task(
|
|
78
|
-
api_key: str,
|
|
79
|
-
base_api_url: str,
|
|
80
|
-
base_ws_url: str,
|
|
81
|
-
) -> None:
|
|
82
|
-
graphql_client = GraphQLClient(api_key, base_api_url, base_ws_url)
|
|
83
|
-
result = await graphql_client.execute(CHECK_GITHUB_CONFIG_VALIDITY_QUERY)
|
|
84
|
-
click.echo(result)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
@config_cli.command(hidden=True)
|
|
88
|
-
@use_settings
|
|
89
|
-
def repos_for_github_config(
|
|
90
|
-
settings: Settings,
|
|
91
|
-
) -> None:
|
|
92
|
-
if not settings.api_key:
|
|
93
|
-
redirect_to_login(settings)
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
run_until_complete(
|
|
97
|
-
repos_for_github_config_task(
|
|
98
|
-
api_key=settings.api_key,
|
|
99
|
-
base_api_url=settings.get_base_api_url(),
|
|
100
|
-
base_ws_url=settings.get_base_ws_url(),
|
|
101
|
-
)
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
async def repos_for_github_config_task(
|
|
106
|
-
api_key: str,
|
|
107
|
-
base_api_url: str,
|
|
108
|
-
base_ws_url: str,
|
|
109
|
-
) -> None:
|
|
110
|
-
graphql_client = GraphQLClient(api_key, base_api_url, base_ws_url)
|
|
111
|
-
try:
|
|
112
|
-
click.echo("Sending request to fetch repos...")
|
|
113
|
-
result = await graphql_client.execute(
|
|
114
|
-
REPOS_FOR_GITHUB_CONFIG_QUERY, timeout=120
|
|
115
|
-
) # 120 seconds timeout
|
|
116
|
-
click.echo("Request completed. Result:")
|
|
117
|
-
click.echo(result)
|
|
118
|
-
except Exception as e:
|
|
119
|
-
click.echo(f"An error occurred while fetching repos: {e!s}")
|
|
120
|
-
click.echo(f"Error type: {type(e).__name__}")
|
|
121
|
-
# Add more detailed error information if available
|
|
122
|
-
if hasattr(e, "response"):
|
|
123
|
-
click.echo(f"Response status: {e.response.status_code}")
|
|
124
|
-
click.echo(f"Response content: {e.response.text}")
|
|
125
|
-
|
|
126
|
-
|
|
127
54
|
@config_cli.command(hidden=True)
|
|
128
55
|
@click.option(
|
|
129
56
|
"--set-git-warning-disabled",
|
|
@@ -389,20 +316,6 @@ async def get_authenticated_user_task(
|
|
|
389
316
|
click.echo(it)
|
|
390
317
|
|
|
391
318
|
|
|
392
|
-
async def create_github_config_task(
|
|
393
|
-
api_key: str,
|
|
394
|
-
base_api_url: str,
|
|
395
|
-
base_ws_url: str,
|
|
396
|
-
github_pat: str,
|
|
397
|
-
) -> None:
|
|
398
|
-
graphql_client = GraphQLClient(api_key, base_api_url, base_ws_url)
|
|
399
|
-
variables = {
|
|
400
|
-
"githubPat": github_pat,
|
|
401
|
-
}
|
|
402
|
-
result = await graphql_client.execute(CREATE_GITHUB_CONFIG_MUTATION, variables)
|
|
403
|
-
click.echo(result)
|
|
404
|
-
|
|
405
|
-
|
|
406
319
|
@config_cli.command(hidden=True)
|
|
407
320
|
@use_settings
|
|
408
321
|
def refresh_key(settings: Settings) -> None:
|
|
@@ -97,7 +97,7 @@ def run(
|
|
|
97
97
|
create_chat(api_key, base_api_url, base_ws_url, ChatSource.CLI_RUN)
|
|
98
98
|
)
|
|
99
99
|
|
|
100
|
-
if timeout_seconds
|
|
100
|
+
if isinstance(timeout_seconds, int) and timeout_seconds <= 0:
|
|
101
101
|
click.secho("Error: --timeout-seconds must be a positive integer", fg="red")
|
|
102
102
|
sys.exit(1)
|
|
103
103
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def get_default_env() -> dict[str, str]:
|
|
5
|
+
"""
|
|
6
|
+
Returns default environment variables for CLI-spawned processes.
|
|
7
|
+
These are merged with the parent process environment.
|
|
8
|
+
"""
|
|
9
|
+
return {
|
|
10
|
+
"GIT_EDITOR": "true",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_process_env(env_overrides: dict[str, str] | None = None) -> dict[str, str]:
|
|
15
|
+
"""
|
|
16
|
+
Returns the complete environment for spawned processes.
|
|
17
|
+
Merges parent environment with default variables, then applies overrides.
|
|
18
|
+
|
|
19
|
+
Priority order (lowest to highest):
|
|
20
|
+
1. Parent process environment (os.environ)
|
|
21
|
+
2. Default environment variables (get_default_env())
|
|
22
|
+
3. Explicit overrides (env_overrides parameter)
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
env_overrides: Optional dict of environment variables that override defaults
|
|
26
|
+
"""
|
|
27
|
+
env = os.environ.copy()
|
|
28
|
+
env.update(get_default_env())
|
|
29
|
+
if env_overrides:
|
|
30
|
+
env.update(env_overrides)
|
|
31
|
+
return env
|
|
@@ -6,6 +6,7 @@ import signal
|
|
|
6
6
|
from collections.abc import AsyncGenerator, Callable
|
|
7
7
|
from typing import Any
|
|
8
8
|
|
|
9
|
+
from exponent.core.remote_execution.default_env import get_process_env
|
|
9
10
|
from exponent.core.remote_execution.languages.types import (
|
|
10
11
|
ShellExecutionResult,
|
|
11
12
|
StreamedOutputPiece,
|
|
@@ -80,6 +81,7 @@ async def execute_shell_streaming( # noqa: PLR0915
|
|
|
80
81
|
working_directory: str,
|
|
81
82
|
timeout: int,
|
|
82
83
|
should_halt: Callable[[], bool] | None = None,
|
|
84
|
+
env: dict[str, str] | None = None,
|
|
83
85
|
) -> AsyncGenerator[StreamedOutputPiece | ShellExecutionResult, None]:
|
|
84
86
|
timeout_seconds = min(timeout, MAX_TIMEOUT)
|
|
85
87
|
|
|
@@ -91,6 +93,7 @@ async def execute_shell_streaming( # noqa: PLR0915
|
|
|
91
93
|
stdout=asyncio.subprocess.PIPE,
|
|
92
94
|
stderr=asyncio.subprocess.PIPE,
|
|
93
95
|
cwd=working_directory,
|
|
96
|
+
env=get_process_env(env),
|
|
94
97
|
)
|
|
95
98
|
else:
|
|
96
99
|
# Add rc file sourcing to the command
|
|
@@ -105,6 +108,7 @@ async def execute_shell_streaming( # noqa: PLR0915
|
|
|
105
108
|
stdout=asyncio.subprocess.PIPE,
|
|
106
109
|
stderr=asyncio.subprocess.PIPE,
|
|
107
110
|
cwd=working_directory,
|
|
111
|
+
env=get_process_env(env),
|
|
108
112
|
start_new_session=True if platform.system() != "Windows" else False,
|
|
109
113
|
)
|
|
110
114
|
|
|
@@ -57,7 +57,13 @@ class SlackWorkflowInput(BaseModel):
|
|
|
57
57
|
message_ts: str | None = None
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
class SentryWorkflowInput(BaseModel):
|
|
61
|
+
title: str
|
|
62
|
+
issue_id: str
|
|
63
|
+
permalink: str
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
WorkflowInput = PrReviewWorkflowInput | SlackWorkflowInput | SentryWorkflowInput
|
|
61
67
|
|
|
62
68
|
|
|
63
69
|
class WorkflowTriggerRequest(BaseModel):
|
|
@@ -542,6 +548,7 @@ class ChatSource(str, Enum):
|
|
|
542
548
|
DESKTOP_APP = "DESKTOP_APP"
|
|
543
549
|
VSCODE_EXTENSION = "VSCODE_EXTENSION"
|
|
544
550
|
SLACK_APP = "SLACK_APP"
|
|
551
|
+
SENTRY_APP = "SENTRY_APP"
|
|
545
552
|
|
|
546
553
|
|
|
547
554
|
class CLIConnectedState(BaseModel):
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
exponent/__init__.py,sha256=
|
|
1
|
+
exponent/__init__.py,sha256=P88Jfo9OvOr8LB0vHFqLUwFR7A0eE281KxEewbcCSBc,706
|
|
2
2
|
exponent/cli.py,sha256=QnIeDTgWaQJrRs5WESCkQpVEQiJiAO4qWgB0rYlkd78,3344
|
|
3
3
|
exponent/py.typed,sha256=9XZl5avs8yHp89XP_1Fjtbeg_2rjYorCC9I0k_j-h2c,334
|
|
4
4
|
exponent/commands/cloud_commands.py,sha256=TNSbKnc7VBo7VALj44CqV5tdCACJejEGmtYvc5wjza4,19080
|
|
5
5
|
exponent/commands/common.py,sha256=M2KI9yKjB8fecPoDBphMa123c35-iNeaE9q4DxhkaFU,12817
|
|
6
|
-
exponent/commands/config_commands.py,sha256=
|
|
7
|
-
exponent/commands/run_commands.py,sha256=
|
|
6
|
+
exponent/commands/config_commands.py,sha256=mmQYuyRosODgawoHWsn9xnWnV37GiQaxJjMv-_xreAU,8902
|
|
7
|
+
exponent/commands/run_commands.py,sha256=xn0SJX0PPrmHu8Nh-kG-lJBhGC4qFCc04aLIzdVyFho,6389
|
|
8
8
|
exponent/commands/settings.py,sha256=UwwwoCgCY5hzAFD9slOBbA9Gr1hNfoyJ2blsFDC6V8w,1559
|
|
9
9
|
exponent/commands/types.py,sha256=iDJL3hdwhO1PrhsJTJBioNYSKo0CWV8Nv-ONcDaWIRs,3670
|
|
10
10
|
exponent/commands/upgrade.py,sha256=JZr0sNazziuLByQHdT8GZb-lDbRG1YpHW8VB94q-r8w,803
|
|
@@ -13,14 +13,14 @@ exponent/core/config.py,sha256=TNFLUgLnfSocRMVSav_7E4VcaNHXZ_3Mg5Lp1smP46U,5731
|
|
|
13
13
|
exponent/core/graphql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
exponent/core/graphql/client.py,sha256=SRagD3YPyoYZSO1RtfO-OXD7b5dm1NvgoL6CTbN380o,2009
|
|
15
15
|
exponent/core/graphql/get_chats_query.py,sha256=9-2N1VfapXUZB3IFIKw5U_gKdmfyviJp5JSUntB_Yyk,1177
|
|
16
|
-
exponent/core/graphql/github_config_queries.py,sha256=zKRDxF38q73apQcVaEAA_A20FVr3U0ADc5-8Y6Ns5Dw,1260
|
|
17
16
|
exponent/core/graphql/mutations.py,sha256=cAAiSefyamBgy1zJEZ7LNk0rbjwawTPxMyj8eU6yRRI,3502
|
|
18
17
|
exponent/core/graphql/queries.py,sha256=RYsk8bub0esspqgakilhzX07yJf2652Ey9tBZK1l_lY,3297
|
|
19
18
|
exponent/core/graphql/subscriptions.py,sha256=SQngv_nYVNJjiZ_P2k0UcLIu1pzc4vi7q7lhH89NCZM,393
|
|
20
19
|
exponent/core/remote_execution/checkpoints.py,sha256=3QGYMLa8vT7XmxMYTRcGrW8kNGHwRC0AkUfULribJWg,6354
|
|
21
|
-
exponent/core/remote_execution/cli_rpc_types.py,sha256=
|
|
20
|
+
exponent/core/remote_execution/cli_rpc_types.py,sha256=uBqmxGkhx_SjfMsUeBBKUp1gj273wtsEze0NFmVcwms,8292
|
|
22
21
|
exponent/core/remote_execution/client.py,sha256=9TlYzwh1lBiOeBlhGUhSo73KQGMh6nvbm1xdfxM48OY,31349
|
|
23
22
|
exponent/core/remote_execution/code_execution.py,sha256=jYPB_7dJzS9BTPLX9fKQpsFPatwjbXuaFFSxT9tDTfI,2388
|
|
23
|
+
exponent/core/remote_execution/default_env.py,sha256=s44A1Cz9EgYuhF17WO3ESVNSLQw57EoOLyi9k6qliIo,911
|
|
24
24
|
exponent/core/remote_execution/error_info.py,sha256=Rd7OA3ps06qYejPVcOaMBB9AtftP3wqQoOfiILFASnc,1378
|
|
25
25
|
exponent/core/remote_execution/exceptions.py,sha256=eT57lBnBhvh-KJ5lsKWcfgGA5-WisAxhjZx-Z6OupZY,135
|
|
26
26
|
exponent/core/remote_execution/file_write.py,sha256=8Sa70ANIDHGxIAq4_Uy2Qoo55K7-cSzU3282zyu7hG8,978
|
|
@@ -32,10 +32,10 @@ exponent/core/remote_execution/system_context.py,sha256=QY1zY8_fWj3sh-fmLYtewvgx
|
|
|
32
32
|
exponent/core/remote_execution/tool_execution.py,sha256=LSV4vL5eCdjEWxlQF5nL9XwC7PC4c-jPhbfHnBE1pBM,15737
|
|
33
33
|
exponent/core/remote_execution/tool_type_utils.py,sha256=7qi6Qd8fvHts019ZSLPbtiy17BUqgqBg3P_gdfvFf7w,1301
|
|
34
34
|
exponent/core/remote_execution/truncation.py,sha256=1L0qwbWgQFRwJZeCXRVKkEhKmzoS1x2usDLPUIp-jlU,9923
|
|
35
|
-
exponent/core/remote_execution/types.py,sha256=
|
|
35
|
+
exponent/core/remote_execution/types.py,sha256=nq-7ZppzpEt3pPj3pe18102GG-EYw2I_iLkRrTJjfg8,15078
|
|
36
36
|
exponent/core/remote_execution/utils.py,sha256=6PlBqYJ3OQwZ0dgXiIu3br04a-d-glDeDZpD0XGGPAE,14793
|
|
37
37
|
exponent/core/remote_execution/languages/python_execution.py,sha256=nsX_LsXcUcHhiEHpSTjOTVNd7CxM146al0kw_iQX5OU,7724
|
|
38
|
-
exponent/core/remote_execution/languages/shell_streaming.py,sha256=
|
|
38
|
+
exponent/core/remote_execution/languages/shell_streaming.py,sha256=SUlk_dyN0FME3KerwdP-EB7eVe1_dNNn_HRdiEYnTes,7644
|
|
39
39
|
exponent/core/remote_execution/languages/types.py,sha256=f7FjSRNRSga-ZaE3LddDhxCirUVjlSYMEdoskG6Pta4,314
|
|
40
40
|
exponent/core/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
exponent/core/types/command_data.py,sha256=_HqQsnamRZeVoVaTpeO3ecVUzNBdG62WXlFy6Q7rtUM,5294
|
|
@@ -46,7 +46,7 @@ exponent/migration-docs/login.md,sha256=KIeXy3m2nzSUgw-4PW1XzXfHael1D4Zu93CplLMb
|
|
|
46
46
|
exponent/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
47
|
exponent/utils/colors.py,sha256=HBkqe_ZmhJ9YiL2Fpulqek4KvLS5mwBTY4LQSM5N8SM,2762
|
|
48
48
|
exponent/utils/version.py,sha256=GHZ9ET1kMyDubJZU3w2sah5Pw8XpiEakS5IOlt3wUnQ,8888
|
|
49
|
-
indent-0.1.
|
|
50
|
-
indent-0.1.
|
|
51
|
-
indent-0.1.
|
|
52
|
-
indent-0.1.
|
|
49
|
+
indent-0.1.20.dist-info/METADATA,sha256=B9VbGtq-Ukm0jAsk18J05cPOitLswkeV7wVbYfQG2hA,1308
|
|
50
|
+
indent-0.1.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
51
|
+
indent-0.1.20.dist-info/entry_points.txt,sha256=q8q1t1sbl4NULGOR0OV5RmSG4KEjkpEQRU_RUXEGzcs,44
|
|
52
|
+
indent-0.1.20.dist-info/RECORD,,
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
CREATE_GITHUB_CONFIG_MUTATION: str = """
|
|
2
|
-
mutation CreateGithubConfig(
|
|
3
|
-
$githubPat: String!,
|
|
4
|
-
) {
|
|
5
|
-
createGithubConfig(
|
|
6
|
-
githubPat: $githubPat
|
|
7
|
-
) {
|
|
8
|
-
__typename
|
|
9
|
-
... on GithubConfig {
|
|
10
|
-
githubConfigUuid
|
|
11
|
-
githubPat
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
CHECK_GITHUB_CONFIG_VALIDITY_QUERY: str = """
|
|
18
|
-
query CheckGithubConfigValidity {
|
|
19
|
-
checkGithubConfigValidity {
|
|
20
|
-
__typename
|
|
21
|
-
... on GithubConfigValidityResult {
|
|
22
|
-
isValid
|
|
23
|
-
message
|
|
24
|
-
}
|
|
25
|
-
... on Error {
|
|
26
|
-
message
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
REPOS_FOR_GITHUB_CONFIG_QUERY: str = """
|
|
33
|
-
query ReposForGithubConfig {
|
|
34
|
-
reposForGithubConfig {
|
|
35
|
-
__typename
|
|
36
|
-
... on GithubConfigRepos {
|
|
37
|
-
repos {
|
|
38
|
-
id
|
|
39
|
-
name
|
|
40
|
-
fullName
|
|
41
|
-
private
|
|
42
|
-
owner
|
|
43
|
-
description
|
|
44
|
-
}
|
|
45
|
-
orgs {
|
|
46
|
-
login
|
|
47
|
-
id
|
|
48
|
-
url
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
... on Error {
|
|
52
|
-
message
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
"""
|
|
File without changes
|
|
File without changes
|