indent 0.1.13__py3-none-any.whl → 0.1.28__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/cli.py +0 -2
- exponent/commands/cloud_commands.py +2 -87
- exponent/commands/common.py +25 -40
- exponent/commands/config_commands.py +0 -87
- exponent/commands/run_commands.py +5 -2
- exponent/core/config.py +1 -1
- exponent/core/container_build/__init__.py +0 -0
- exponent/core/container_build/types.py +25 -0
- exponent/core/graphql/mutations.py +2 -31
- exponent/core/graphql/queries.py +0 -3
- exponent/core/remote_execution/cli_rpc_types.py +201 -5
- exponent/core/remote_execution/client.py +355 -92
- exponent/core/remote_execution/code_execution.py +26 -7
- exponent/core/remote_execution/default_env.py +31 -0
- exponent/core/remote_execution/languages/shell_streaming.py +11 -6
- exponent/core/remote_execution/port_utils.py +73 -0
- exponent/core/remote_execution/system_context.py +2 -0
- exponent/core/remote_execution/terminal_session.py +517 -0
- exponent/core/remote_execution/terminal_types.py +29 -0
- exponent/core/remote_execution/tool_execution.py +228 -18
- exponent/core/remote_execution/tool_type_utils.py +39 -0
- exponent/core/remote_execution/truncation.py +9 -1
- exponent/core/remote_execution/types.py +71 -19
- exponent/utils/version.py +8 -7
- {indent-0.1.13.dist-info → indent-0.1.28.dist-info}/METADATA +5 -2
- {indent-0.1.13.dist-info → indent-0.1.28.dist-info}/RECORD +29 -24
- exponent/commands/workflow_commands.py +0 -111
- exponent/core/graphql/github_config_queries.py +0 -56
- {indent-0.1.13.dist-info → indent-0.1.28.dist-info}/WHEEL +0 -0
- {indent-0.1.13.dist-info → indent-0.1.28.dist-info}/entry_points.txt +0 -0
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
exponent/__init__.py,sha256=
|
|
2
|
-
exponent/cli.py,sha256=
|
|
1
|
+
exponent/__init__.py,sha256=1F4XTGwwdJozvgbsUgvu0kddraJ7P8oKbqLP8wGuYI8,706
|
|
2
|
+
exponent/cli.py,sha256=QnIeDTgWaQJrRs5WESCkQpVEQiJiAO4qWgB0rYlkd78,3344
|
|
3
3
|
exponent/py.typed,sha256=9XZl5avs8yHp89XP_1Fjtbeg_2rjYorCC9I0k_j-h2c,334
|
|
4
|
-
exponent/commands/cloud_commands.py,sha256=
|
|
5
|
-
exponent/commands/common.py,sha256=
|
|
6
|
-
exponent/commands/config_commands.py,sha256=
|
|
7
|
-
exponent/commands/run_commands.py,sha256=
|
|
4
|
+
exponent/commands/cloud_commands.py,sha256=C4BH3pFudWMhtnQJ1IrJu35WyI4i20Twirwzm8qC-kc,16726
|
|
5
|
+
exponent/commands/common.py,sha256=69Qh7EcAsKJeQn9eW41lFHgWbiFLXUy9yG0xah-Ro3Y,13030
|
|
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
|
|
11
11
|
exponent/commands/utils.py,sha256=Z3eu3mvYwBh7J_hq17lyt7_MwMG8KcsP7AnsCgOnTNc,4638
|
|
12
|
-
exponent/
|
|
13
|
-
exponent/core/
|
|
12
|
+
exponent/core/config.py,sha256=GGEE5sXye5AX88LtmpYfKwPQlRconRILnlaziAsgS9U,5735
|
|
13
|
+
exponent/core/container_build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
exponent/core/container_build/types.py,sha256=UohT3CuO0fW9G0YMnXIephLbBPrt46j6PFjwZr_KR2Q,628
|
|
14
15
|
exponent/core/graphql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
16
|
exponent/core/graphql/client.py,sha256=SRagD3YPyoYZSO1RtfO-OXD7b5dm1NvgoL6CTbN380o,2009
|
|
16
17
|
exponent/core/graphql/get_chats_query.py,sha256=9-2N1VfapXUZB3IFIKw5U_gKdmfyviJp5JSUntB_Yyk,1177
|
|
17
|
-
exponent/core/graphql/
|
|
18
|
-
exponent/core/graphql/
|
|
19
|
-
exponent/core/graphql/queries.py,sha256=RYsk8bub0esspqgakilhzX07yJf2652Ey9tBZK1l_lY,3297
|
|
18
|
+
exponent/core/graphql/mutations.py,sha256=i1zONxXew5DsQag-tH25IBif6Z8oYXygJmciQjMN9uE,2980
|
|
19
|
+
exponent/core/graphql/queries.py,sha256=9u0PWcTYYRW_2yE7x5p5FzrIwDfeeuPSXrNwMzK5ffc,3246
|
|
20
20
|
exponent/core/graphql/subscriptions.py,sha256=SQngv_nYVNJjiZ_P2k0UcLIu1pzc4vi7q7lhH89NCZM,393
|
|
21
21
|
exponent/core/remote_execution/checkpoints.py,sha256=3QGYMLa8vT7XmxMYTRcGrW8kNGHwRC0AkUfULribJWg,6354
|
|
22
|
-
exponent/core/remote_execution/cli_rpc_types.py,sha256=
|
|
23
|
-
exponent/core/remote_execution/client.py,sha256=
|
|
24
|
-
exponent/core/remote_execution/code_execution.py,sha256=
|
|
22
|
+
exponent/core/remote_execution/cli_rpc_types.py,sha256=fnqubTYTUCn2wIeBYkpkpmWPVr-1RqevTKu6NoPNaOA,12883
|
|
23
|
+
exponent/core/remote_execution/client.py,sha256=bUl2w28c_okWndW9jEreVyYKeFNyL8h8OMZNBb4lf3g,40307
|
|
24
|
+
exponent/core/remote_execution/code_execution.py,sha256=QL78v2yHMrIcbNWIczAICWRceziXgG4pzw7gvhUOLxs,3328
|
|
25
|
+
exponent/core/remote_execution/default_env.py,sha256=s44A1Cz9EgYuhF17WO3ESVNSLQw57EoOLyi9k6qliIo,911
|
|
25
26
|
exponent/core/remote_execution/error_info.py,sha256=Rd7OA3ps06qYejPVcOaMBB9AtftP3wqQoOfiILFASnc,1378
|
|
26
27
|
exponent/core/remote_execution/exceptions.py,sha256=eT57lBnBhvh-KJ5lsKWcfgGA5-WisAxhjZx-Z6OupZY,135
|
|
27
28
|
exponent/core/remote_execution/file_write.py,sha256=8Sa70ANIDHGxIAq4_Uy2Qoo55K7-cSzU3282zyu7hG8,978
|
|
28
29
|
exponent/core/remote_execution/files.py,sha256=mIVjhStaEKETW6y3pCVeV8eJKNaPtroWGP_kBK1x8uA,8776
|
|
29
30
|
exponent/core/remote_execution/git.py,sha256=dGjBpeoKJZsYgRwctSq29GmbsNIN9tbSA3VwBnRD0IQ,7810
|
|
30
31
|
exponent/core/remote_execution/http_fetch.py,sha256=aFEyXd0S-MRfisSMuIFiEyc1AEAj9nUZ9Rj_P_YRows,2827
|
|
32
|
+
exponent/core/remote_execution/port_utils.py,sha256=kWje8ikCzBXMeS7qr6NZZOzQOMoMuacgPUDYyloYgwM,2183
|
|
31
33
|
exponent/core/remote_execution/session.py,sha256=jlQIdeUj0f7uOk3BgzlJtBJ_GyTIjCchBp5ApQuF2-I,3847
|
|
32
|
-
exponent/core/remote_execution/system_context.py,sha256=
|
|
33
|
-
exponent/core/remote_execution/
|
|
34
|
-
exponent/core/remote_execution/
|
|
35
|
-
exponent/core/remote_execution/
|
|
34
|
+
exponent/core/remote_execution/system_context.py,sha256=I4RNuM60isS-529EuRrrEPPwJssNFC2TZ_7MhBTWEd0,754
|
|
35
|
+
exponent/core/remote_execution/terminal_session.py,sha256=GgPP4BUeNYB6O2sAKeVdlVWewnAXxd0qIQeb3Sebgho,17845
|
|
36
|
+
exponent/core/remote_execution/terminal_types.py,sha256=t4snBiTtidAEJZTvy789x-5HFqjkV9rlonjDO30PfAY,731
|
|
37
|
+
exponent/core/remote_execution/tool_execution.py,sha256=wwKS7GiCsK_I0Na-Vo1xuzUR5wgbZ9bapck2iEuWmQo,20819
|
|
38
|
+
exponent/core/remote_execution/tool_type_utils.py,sha256=7qi6Qd8fvHts019ZSLPbtiy17BUqgqBg3P_gdfvFf7w,1301
|
|
39
|
+
exponent/core/remote_execution/truncation.py,sha256=0zFnmqXES2vtQCSpfXIQn5hgg6bZK4Sad_Cfh27xTZU,9849
|
|
40
|
+
exponent/core/remote_execution/types.py,sha256=2tp73g6WLhL3x-5FyP9jhadcRHIswt4wfJJlEvNwlvk,15782
|
|
36
41
|
exponent/core/remote_execution/utils.py,sha256=6PlBqYJ3OQwZ0dgXiIu3br04a-d-glDeDZpD0XGGPAE,14793
|
|
37
42
|
exponent/core/remote_execution/languages/python_execution.py,sha256=nsX_LsXcUcHhiEHpSTjOTVNd7CxM146al0kw_iQX5OU,7724
|
|
38
|
-
exponent/core/remote_execution/languages/shell_streaming.py,sha256=
|
|
43
|
+
exponent/core/remote_execution/languages/shell_streaming.py,sha256=MpE1XQiu18xWUGp1wD_Hb1nuPCQE-i5-_XO6FnkcNvo,7675
|
|
39
44
|
exponent/core/remote_execution/languages/types.py,sha256=f7FjSRNRSga-ZaE3LddDhxCirUVjlSYMEdoskG6Pta4,314
|
|
40
45
|
exponent/core/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
46
|
exponent/core/types/command_data.py,sha256=_HqQsnamRZeVoVaTpeO3ecVUzNBdG62WXlFy6Q7rtUM,5294
|
|
@@ -45,8 +50,8 @@ exponent/core/types/generated/strategy_info.py,sha256=LN6_ykFMszb21Qc3yw77xEKUtd
|
|
|
45
50
|
exponent/migration-docs/login.md,sha256=KIeXy3m2nzSUgw-4PW1XzXfHael1D4Zu93CplLMb3hI,4252
|
|
46
51
|
exponent/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
52
|
exponent/utils/colors.py,sha256=HBkqe_ZmhJ9YiL2Fpulqek4KvLS5mwBTY4LQSM5N8SM,2762
|
|
48
|
-
exponent/utils/version.py,sha256=
|
|
49
|
-
indent-0.1.
|
|
50
|
-
indent-0.1.
|
|
51
|
-
indent-0.1.
|
|
52
|
-
indent-0.1.
|
|
53
|
+
exponent/utils/version.py,sha256=_7UyBC-xy7jt2McHIdqMaXPmHmAQSxtzrJJ8q0KZ_8w,8953
|
|
54
|
+
indent-0.1.28.dist-info/METADATA,sha256=SGqskcDWZNEVKGf4q3bdzu-BcfcwhiG91EiOEMrvCmY,1367
|
|
55
|
+
indent-0.1.28.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
56
|
+
indent-0.1.28.dist-info/entry_points.txt,sha256=q8q1t1sbl4NULGOR0OV5RmSG4KEjkpEQRU_RUXEGzcs,44
|
|
57
|
+
indent-0.1.28.dist-info/RECORD,,
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
import os
|
|
3
|
-
import sys
|
|
4
|
-
from typing import cast
|
|
5
|
-
|
|
6
|
-
import click
|
|
7
|
-
|
|
8
|
-
from exponent.commands.run_commands import run_chat
|
|
9
|
-
from exponent.commands.settings import use_settings
|
|
10
|
-
from exponent.commands.types import exponent_cli_group
|
|
11
|
-
from exponent.core.config import Settings
|
|
12
|
-
from exponent.core.remote_execution.client import RemoteExecutionClient, WSDisconnected
|
|
13
|
-
from exponent.core.remote_execution.types import (
|
|
14
|
-
PrReviewWorkflowInput,
|
|
15
|
-
WorkflowTriggerResponse,
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@exponent_cli_group(name="workflow")
|
|
20
|
-
def workflow_cli() -> None:
|
|
21
|
-
"""Workflow commands."""
|
|
22
|
-
pass
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@workflow_cli.group(hidden=True)
|
|
26
|
-
def workflow() -> None:
|
|
27
|
-
"""Workflow management commands."""
|
|
28
|
-
pass
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@workflow.command()
|
|
32
|
-
@use_settings
|
|
33
|
-
@click.argument("workflow_type", type=click.STRING)
|
|
34
|
-
def trigger(settings: Settings, workflow_type: str) -> None:
|
|
35
|
-
"""Trigger a workflow."""
|
|
36
|
-
|
|
37
|
-
if not settings.api_key:
|
|
38
|
-
raise click.ClickException(
|
|
39
|
-
"No API key found. Use `indent login` to set your API key."
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
if workflow_type != "pr_review":
|
|
43
|
-
raise click.UsageError("Invalid workflow name. Only 'pr_review' is supported.")
|
|
44
|
-
|
|
45
|
-
loop = asyncio.get_event_loop()
|
|
46
|
-
response = loop.run_until_complete(trigger_pr_review_workflow(settings))
|
|
47
|
-
|
|
48
|
-
while True:
|
|
49
|
-
result = run_chat(
|
|
50
|
-
loop, settings.api_key, response.chat_uuid, settings, None, None, None
|
|
51
|
-
)
|
|
52
|
-
if result is None or isinstance(result, WSDisconnected):
|
|
53
|
-
# NOTE: None here means that handle_connection_changes exited
|
|
54
|
-
# first. We should likely have a different message for this.
|
|
55
|
-
if result and result.error_message:
|
|
56
|
-
click.secho(f"Error: {result.error_message}", fg="red")
|
|
57
|
-
sys.exit(10)
|
|
58
|
-
else:
|
|
59
|
-
click.echo("Disconnected upon user request, shutting down...")
|
|
60
|
-
break
|
|
61
|
-
else:
|
|
62
|
-
raise click.ClickException("Workflow run exited unexpectedly")
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
async def _subprocess_check_output(command: str) -> str:
|
|
66
|
-
process = await asyncio.create_subprocess_shell(
|
|
67
|
-
command,
|
|
68
|
-
stdout=asyncio.subprocess.PIPE,
|
|
69
|
-
stderr=asyncio.subprocess.STDOUT,
|
|
70
|
-
)
|
|
71
|
-
stdout, _ = await process.communicate()
|
|
72
|
-
|
|
73
|
-
if process.returncode != 0:
|
|
74
|
-
output = stdout.decode().strip()
|
|
75
|
-
raise click.ClickException(
|
|
76
|
-
f"Command '{command}' failed with exit code {process.returncode}:\n{output}"
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
return stdout.decode().strip()
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
async def trigger_pr_review_workflow(settings: Settings) -> WorkflowTriggerResponse:
|
|
83
|
-
origin_url = await _subprocess_check_output("git ls-remote --get-url origin")
|
|
84
|
-
url = origin_url.strip().removesuffix(".git")
|
|
85
|
-
remote = url.split(":")[-1]
|
|
86
|
-
owner, repo = remote.split("/")[-2:]
|
|
87
|
-
|
|
88
|
-
pr_number_str = os.environ.get("PR_NUMBER")
|
|
89
|
-
if not pr_number_str:
|
|
90
|
-
raise click.ClickException("PR_NUMBER environment variable is not set")
|
|
91
|
-
try:
|
|
92
|
-
pr_number = int(pr_number_str)
|
|
93
|
-
except ValueError:
|
|
94
|
-
raise click.ClickException(
|
|
95
|
-
"PR_NUMBER environment variable is not a valid integer"
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
async with RemoteExecutionClient.session(
|
|
99
|
-
api_key=cast(str, settings.api_key),
|
|
100
|
-
base_url=settings.get_base_api_url(),
|
|
101
|
-
base_ws_url=settings.get_base_ws_url(),
|
|
102
|
-
working_directory=os.getcwd(),
|
|
103
|
-
) as client:
|
|
104
|
-
return await client.trigger_workflow(
|
|
105
|
-
workflow_name="pr_review",
|
|
106
|
-
workflow_input=PrReviewWorkflowInput(
|
|
107
|
-
repo_owner=owner,
|
|
108
|
-
repo_name=repo,
|
|
109
|
-
pr_number=pr_number,
|
|
110
|
-
),
|
|
111
|
-
)
|
|
@@ -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
|