indent 0.1.6__py3-none-any.whl → 0.1.7__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.

Potentially problematic release.


This version of indent might be problematic. Click here for more details.

exponent/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.6" # Keep in sync with pyproject.toml
1
+ __version__ = "0.1.7" # Keep in sync with pyproject.toml
@@ -139,6 +139,20 @@ class BashToolResult(ToolResult, tag=BASH_TOOL_NAME):
139
139
  stopped_by_user: bool
140
140
 
141
141
 
142
+
143
+ class HttpRequest(msgspec.Struct, tag="http_fetch_cli"):
144
+ url: str
145
+ method: str = "GET"
146
+ headers: dict[str, str] | None = None
147
+ timeout: int | None = None
148
+
149
+ class HttpResponse(msgspec.Struct, tag="http_fetch_cli"):
150
+ status_code: int | None = None
151
+ content: str | None = None
152
+ error_message: str | None = None
153
+ duration_ms: int | None = None
154
+ headers: dict[str, str] | None = None
155
+
142
156
  ToolInputType = (
143
157
  ReadToolInput
144
158
  | WriteToolInput
@@ -196,6 +210,7 @@ class CliRpcRequest(msgspec.Struct):
196
210
  ToolExecutionRequest
197
211
  | GetAllFilesRequest
198
212
  | TerminateRequest
213
+ | HttpRequest
199
214
  | BatchToolExecutionRequest
200
215
  )
201
216
 
@@ -216,4 +231,5 @@ class CliRpcResponse(msgspec.Struct):
216
231
  | ErrorResponse
217
232
  | TerminateResponse
218
233
  | BatchToolExecutionResponse
234
+ | HttpResponse
219
235
  )
@@ -29,6 +29,8 @@ from exponent.core.remote_execution.cli_rpc_types import (
29
29
  ErrorResponse,
30
30
  GetAllFilesRequest,
31
31
  GetAllFilesResponse,
32
+ HttpResponse,
33
+ HttpRequest,
32
34
  TerminateRequest,
33
35
  TerminateResponse,
34
36
  ToolExecutionRequest,
@@ -39,6 +41,7 @@ from exponent.core.remote_execution.code_execution import (
39
41
  execute_code_streaming,
40
42
  )
41
43
  from exponent.core.remote_execution.files import file_walk
44
+ from exponent.core.remote_execution.http_fetch import fetch_http_content
42
45
  from exponent.core.remote_execution.session import (
43
46
  RemoteExecutionClientSession,
44
47
  get_session,
@@ -488,6 +491,12 @@ class RemoteExecutionClient:
488
491
  tool_results=results,
489
492
  ),
490
493
  )
494
+ elif isinstance(request.request, HttpRequest):
495
+ http_response = await fetch_http_content(request.request)
496
+ return CliRpcResponse(
497
+ request_id=request.request_id,
498
+ response=http_response,
499
+ )
491
500
  elif isinstance(request.request, TerminateRequest):
492
501
  raise ValueError(
493
502
  "TerminateRequest should not be handled by handle_request"
@@ -0,0 +1,87 @@
1
+ """HTTP fetch implementation for remote execution client."""
2
+
3
+ import logging
4
+ from typing import Any
5
+
6
+ import httpx
7
+
8
+ from exponent.core.remote_execution.cli_rpc_types import (
9
+ HttpResponse,
10
+ HttpRequest,
11
+ )
12
+
13
+ logger = logging.getLogger(__name__)
14
+
15
+ DEFAULT_TIMEOUT = 30.0
16
+ DEFAULT_USER_AGENT = "Indent-HTTP-Client/1.0"
17
+
18
+
19
+ async def fetch_http_content(http_request: HttpRequest) -> HttpResponse:
20
+ """
21
+ Fetch content from an HTTP URL and return the response.
22
+
23
+ Args:
24
+ http_request: HttpRequest containing URL, method, headers, and timeout
25
+
26
+ Returns:
27
+ HttpResponse with status code, content, and error message if any
28
+ """
29
+ logger.info(f"Fetching {http_request.method} {http_request.url}")
30
+
31
+ try:
32
+ # Set up timeout
33
+ timeout = http_request.timeout if http_request.timeout is not None else DEFAULT_TIMEOUT
34
+
35
+ # Set up headers with default User-Agent
36
+ headers = http_request.headers or {}
37
+ if "User-Agent" not in headers:
38
+ headers["User-Agent"] = DEFAULT_USER_AGENT
39
+
40
+ # Create HTTP client with timeout
41
+ async with httpx.AsyncClient(timeout=timeout) as client:
42
+ # Make the HTTP request
43
+ response = await client.request(
44
+ method=http_request.method,
45
+ url=http_request.url,
46
+ headers=headers,
47
+ )
48
+
49
+ # Get response content as text
50
+ try:
51
+ content = response.text
52
+ except UnicodeDecodeError:
53
+ # If content can't be decoded as text, provide a fallback
54
+ content = f"Binary content ({len(response.content)} bytes)"
55
+ logger.warning(f"Could not decode response content as text for {http_request.url}")
56
+
57
+ logger.info(f"HTTP {http_request.method} {http_request.url} -> {response.status_code}")
58
+
59
+ return HttpResponse(
60
+ status_code=response.status_code,
61
+ content=content,
62
+ error_message=None,
63
+ )
64
+
65
+ except httpx.TimeoutException:
66
+ error_msg = f"Request to {http_request.url} timed out after {timeout} seconds"
67
+ return HttpResponse(
68
+ status_code=None,
69
+ content="",
70
+ error_message=error_msg,
71
+ )
72
+
73
+ except httpx.RequestError as e:
74
+ error_msg = f"Request error for {http_request.url}: {str(e)}"
75
+ return HttpResponse(
76
+ status_code=None,
77
+ content="",
78
+ error_message=error_msg,
79
+ )
80
+
81
+ except Exception as e:
82
+ error_msg = f"Unexpected error fetching {http_request.url}: {str(e)}"
83
+ return HttpResponse(
84
+ status_code=None,
85
+ content="",
86
+ error_message=error_msg,
87
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: indent
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: Indent is an AI Pair Programmer
5
5
  Author-email: Sashank Thupukari <sashank@exponent.run>
6
6
  Requires-Python: <3.13,>=3.10
@@ -1,4 +1,4 @@
1
- exponent/__init__.py,sha256=oVf6rpSEmuBL8TgePOpVGMK15v_0KI_2MgQ0HuIaP14,58
1
+ exponent/__init__.py,sha256=RlRDAWCdKd6KRITEGyfrQ_c86ikzjoYuuCGv07KBb2I,58
2
2
  exponent/cli.py,sha256=GA-Bw1nys9JNrlob0t3LcS9OZ4U5JcNYjR_r3kDD_qs,3596
3
3
  exponent/py.typed,sha256=9XZl5avs8yHp89XP_1Fjtbeg_2rjYorCC9I0k_j-h2c,334
4
4
  exponent/commands/cloud_commands.py,sha256=4DgS7PjCtCFB5uNN-szzAzOj16UU1D9b9_qS7DskoLE,2026
@@ -24,14 +24,15 @@ exponent/core/graphql/mutations.py,sha256=WRwgJzMTETvry1yc9-EBlIRWkePjHIskBAm_6t
24
24
  exponent/core/graphql/queries.py,sha256=TXXHLGb7QpeICaofowVYsjyHDfqjCoQ3omLbesuw06s,2612
25
25
  exponent/core/graphql/subscriptions.py,sha256=gg42wG5HqEuNMJU7OUHruNCAGtM6FKPLRD7KfjcKjC4,9995
26
26
  exponent/core/remote_execution/checkpoints.py,sha256=3QGYMLa8vT7XmxMYTRcGrW8kNGHwRC0AkUfULribJWg,6354
27
- exponent/core/remote_execution/cli_rpc_types.py,sha256=GPRK_9bKJiNHJx3Y-3elO0rOwz70kyik9Wo3xdGoLVA,4587
28
- exponent/core/remote_execution/client.py,sha256=u5JH1yhbHcWpdee340x9JnYCsFJ-rJuu0-YPgSbojRw,21603
27
+ exponent/core/remote_execution/cli_rpc_types.py,sha256=k_hxkpP-VoktbW7f_wy0N2_UN8AEhkwgnN7DUJSSzzQ,5040
28
+ exponent/core/remote_execution/client.py,sha256=bXjcVgmWke3F9E7dx6uK6Q_ZzBW2uVi6tHTPcVpgOa4,21996
29
29
  exponent/core/remote_execution/code_execution.py,sha256=jYPB_7dJzS9BTPLX9fKQpsFPatwjbXuaFFSxT9tDTfI,2388
30
30
  exponent/core/remote_execution/error_info.py,sha256=Rd7OA3ps06qYejPVcOaMBB9AtftP3wqQoOfiILFASnc,1378
31
31
  exponent/core/remote_execution/exceptions.py,sha256=eT57lBnBhvh-KJ5lsKWcfgGA5-WisAxhjZx-Z6OupZY,135
32
32
  exponent/core/remote_execution/file_write.py,sha256=j9X4QfCBuZK6VIMfeu53WTN90G4w0AtN4U9GcoCJvJk,12531
33
33
  exponent/core/remote_execution/files.py,sha256=0EmOP2OdreGHjkKEIhtB_nNcjvLLx_UJWbbxt7cGSNg,12225
34
34
  exponent/core/remote_execution/git.py,sha256=Yo4mhkl6LYzGhVco91j_E8WOUey5KL9437rk43VCCA8,7826
35
+ exponent/core/remote_execution/http_fetch.py,sha256=HsELvOPtgq7O9rAR3QdpP5Z3wudPffedJfFRLnMQ6qQ,2839
35
36
  exponent/core/remote_execution/session.py,sha256=cSJcCG1o74mBE6lZS_9VFmhyZdW6BeIOsbq4IVWH0t4,3863
36
37
  exponent/core/remote_execution/system_context.py,sha256=0FkbsSxEVjdjTF0tQpOkYK_VaVM126C3_K8QP0YXxOs,1510
37
38
  exponent/core/remote_execution/tool_execution.py,sha256=_UQPyOTY49RQ70kfgnf03eev7c7lTWhFBC68cuifj2M,12354
@@ -50,7 +51,7 @@ exponent/migration-docs/login.md,sha256=KIeXy3m2nzSUgw-4PW1XzXfHael1D4Zu93CplLMb
50
51
  exponent/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
52
  exponent/utils/colors.py,sha256=HBkqe_ZmhJ9YiL2Fpulqek4KvLS5mwBTY4LQSM5N8SM,2762
52
53
  exponent/utils/version.py,sha256=Q4txP7Rg_KO0u0tUpx8O0DoOt32wrX7ctNeDXVKaOfA,8835
53
- indent-0.1.6.dist-info/METADATA,sha256=09jZnI_VohQwM0FiOXUtvE6Q-Bf_8AA_fgkXTYu77hc,1283
54
- indent-0.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
55
- indent-0.1.6.dist-info/entry_points.txt,sha256=q8q1t1sbl4NULGOR0OV5RmSG4KEjkpEQRU_RUXEGzcs,44
56
- indent-0.1.6.dist-info/RECORD,,
54
+ indent-0.1.7.dist-info/METADATA,sha256=zifHZkZXa-jGIOm8J9gyS5O1kEw_-HjWE4nvoZ5wzeY,1283
55
+ indent-0.1.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
56
+ indent-0.1.7.dist-info/entry_points.txt,sha256=q8q1t1sbl4NULGOR0OV5RmSG4KEjkpEQRU_RUXEGzcs,44
57
+ indent-0.1.7.dist-info/RECORD,,
File without changes