indent 0.1.26__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.
Files changed (55) hide show
  1. exponent/__init__.py +34 -0
  2. exponent/cli.py +110 -0
  3. exponent/commands/cloud_commands.py +585 -0
  4. exponent/commands/common.py +411 -0
  5. exponent/commands/config_commands.py +334 -0
  6. exponent/commands/run_commands.py +222 -0
  7. exponent/commands/settings.py +56 -0
  8. exponent/commands/types.py +111 -0
  9. exponent/commands/upgrade.py +29 -0
  10. exponent/commands/utils.py +146 -0
  11. exponent/core/config.py +180 -0
  12. exponent/core/graphql/__init__.py +0 -0
  13. exponent/core/graphql/client.py +61 -0
  14. exponent/core/graphql/get_chats_query.py +47 -0
  15. exponent/core/graphql/mutations.py +160 -0
  16. exponent/core/graphql/queries.py +146 -0
  17. exponent/core/graphql/subscriptions.py +16 -0
  18. exponent/core/remote_execution/checkpoints.py +212 -0
  19. exponent/core/remote_execution/cli_rpc_types.py +499 -0
  20. exponent/core/remote_execution/client.py +999 -0
  21. exponent/core/remote_execution/code_execution.py +77 -0
  22. exponent/core/remote_execution/default_env.py +31 -0
  23. exponent/core/remote_execution/error_info.py +45 -0
  24. exponent/core/remote_execution/exceptions.py +10 -0
  25. exponent/core/remote_execution/file_write.py +35 -0
  26. exponent/core/remote_execution/files.py +330 -0
  27. exponent/core/remote_execution/git.py +268 -0
  28. exponent/core/remote_execution/http_fetch.py +94 -0
  29. exponent/core/remote_execution/languages/python_execution.py +239 -0
  30. exponent/core/remote_execution/languages/shell_streaming.py +226 -0
  31. exponent/core/remote_execution/languages/types.py +20 -0
  32. exponent/core/remote_execution/port_utils.py +73 -0
  33. exponent/core/remote_execution/session.py +128 -0
  34. exponent/core/remote_execution/system_context.py +26 -0
  35. exponent/core/remote_execution/terminal_session.py +375 -0
  36. exponent/core/remote_execution/terminal_types.py +29 -0
  37. exponent/core/remote_execution/tool_execution.py +595 -0
  38. exponent/core/remote_execution/tool_type_utils.py +39 -0
  39. exponent/core/remote_execution/truncation.py +296 -0
  40. exponent/core/remote_execution/types.py +635 -0
  41. exponent/core/remote_execution/utils.py +477 -0
  42. exponent/core/types/__init__.py +0 -0
  43. exponent/core/types/command_data.py +206 -0
  44. exponent/core/types/event_types.py +89 -0
  45. exponent/core/types/generated/__init__.py +0 -0
  46. exponent/core/types/generated/strategy_info.py +213 -0
  47. exponent/migration-docs/login.md +112 -0
  48. exponent/py.typed +4 -0
  49. exponent/utils/__init__.py +0 -0
  50. exponent/utils/colors.py +92 -0
  51. exponent/utils/version.py +289 -0
  52. indent-0.1.26.dist-info/METADATA +38 -0
  53. indent-0.1.26.dist-info/RECORD +55 -0
  54. indent-0.1.26.dist-info/WHEEL +4 -0
  55. indent-0.1.26.dist-info/entry_points.txt +2 -0
exponent/__init__.py ADDED
@@ -0,0 +1,34 @@
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
13
+ TYPE_CHECKING = False
14
+ if TYPE_CHECKING:
15
+ from typing import Tuple
16
+ from typing import Union
17
+
18
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
20
+ else:
21
+ VERSION_TUPLE = object
22
+ COMMIT_ID = object
23
+
24
+ version: str
25
+ __version__: str
26
+ __version_tuple__: VERSION_TUPLE
27
+ version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '0.1.26'
32
+ __version_tuple__ = version_tuple = (0, 1, 26)
33
+
34
+ __commit_id__ = commit_id = None
exponent/cli.py ADDED
@@ -0,0 +1,110 @@
1
+ import click
2
+ from click import Context, HelpFormatter
3
+
4
+ from exponent.commands.cloud_commands import cloud_cli
5
+ from exponent.commands.common import set_log_level
6
+ from exponent.commands.config_commands import config_cli
7
+ from exponent.commands.run_commands import run, run_cli
8
+ from exponent.commands.types import ExponentGroup, exponent_cli_group
9
+ from exponent.commands.upgrade import upgrade_cli
10
+ from exponent.utils.version import (
11
+ get_installed_version,
12
+ )
13
+
14
+
15
+ @exponent_cli_group(invoke_without_command=True)
16
+ @click.version_option(get_installed_version(), prog_name="Indent CLI")
17
+ @click.pass_context
18
+ def cli(ctx: Context) -> None:
19
+ """
20
+ Indent: Your AI pair programmer.
21
+
22
+ Run indent to start (or indent run)
23
+ """
24
+ set_log_level()
25
+
26
+ # If no command is provided, invoke the 'run' command
27
+ if ctx.invoked_subcommand is None:
28
+ ctx.invoke(run)
29
+
30
+
31
+ sources: list[ExponentGroup] = [
32
+ config_cli, # Configuration commands
33
+ run_cli, # Run AI chat commands
34
+ upgrade_cli, # Upgrade-related commands
35
+ cloud_cli, # Cloud commands
36
+ ]
37
+
38
+ for source in sources:
39
+ for command in source.commands.values():
40
+ cli.add_command(command)
41
+
42
+
43
+ def format_commands(
44
+ ctx: Context, formatter: HelpFormatter, include_hidden: bool = False
45
+ ) -> None:
46
+ commands = []
47
+ hidden_commands = []
48
+ for cmd_name in cli.list_commands(ctx):
49
+ cmd = cli.get_command(ctx, cmd_name)
50
+ if cmd is None:
51
+ continue
52
+ if cmd.hidden:
53
+ hidden_commands.append((cmd_name, cmd))
54
+ else:
55
+ commands.append((cmd_name, cmd))
56
+
57
+ if commands:
58
+ max_cmd_length = (
59
+ max(len(cmd_name) for cmd_name, _ in commands) if commands else 0
60
+ )
61
+ limit = (
62
+ (formatter.width or 80) - 6 - max_cmd_length
63
+ ) # Default width to 80 if None
64
+ rows = []
65
+ for cmd_name, cmd in commands:
66
+ help_text = cmd.get_short_help_str(limit)
67
+ rows.append((cmd_name, help_text))
68
+
69
+ with formatter.section("Commands"):
70
+ formatter.write_dl(rows)
71
+
72
+ if include_hidden and hidden_commands:
73
+ max_cmd_length = (
74
+ max(len(cmd_name) for cmd_name, _ in hidden_commands)
75
+ if hidden_commands
76
+ else 0
77
+ )
78
+ limit = (
79
+ (formatter.width or 80) - 6 - max_cmd_length
80
+ ) # Default width to 80 if None
81
+ hidden_rows = []
82
+ for cmd_name, cmd in hidden_commands:
83
+ help_text = cmd.get_short_help_str(limit)
84
+ hidden_rows.append((cmd_name, help_text))
85
+
86
+ with formatter.section("Hidden Commands"):
87
+ formatter.write_dl(hidden_rows)
88
+
89
+
90
+ @cli.command(hidden=True)
91
+ @click.pass_context
92
+ def hidden(ctx: Context) -> None:
93
+ """Show all commands, including hidden ones."""
94
+ formatter = ctx.make_formatter()
95
+ with formatter.section("Usage"):
96
+ if ctx.parent and ctx.parent.command:
97
+ formatter.write_usage(
98
+ ctx.parent.command.name or "indent", "COMMAND [ARGS]..."
99
+ )
100
+ formatter.write_paragraph()
101
+ with formatter.indentation():
102
+ if cli.help:
103
+ formatter.write_text(cli.help)
104
+ formatter.write_paragraph()
105
+ format_commands(ctx, formatter, include_hidden=True)
106
+ click.echo(formatter.getvalue().rstrip("\n"))
107
+
108
+
109
+ if __name__ == "__main__":
110
+ cli()