agentless-mcp 0.1.0__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 (60) hide show
  1. agentless_mcp/__init__.py +1 -0
  2. agentless_mcp/__main__.py +6 -0
  3. agentless_mcp/adapters/__init__.py +1 -0
  4. agentless_mcp/adapters/cli/__init__.py +1 -0
  5. agentless_mcp/adapters/cli/formatting.py +78 -0
  6. agentless_mcp/adapters/cli/main.py +1424 -0
  7. agentless_mcp/adapters/mcp/__init__.py +1 -0
  8. agentless_mcp/adapters/mcp/annotations.py +31 -0
  9. agentless_mcp/adapters/mcp/server.py +605 -0
  10. agentless_mcp/application/__init__.py +1 -0
  11. agentless_mcp/application/envelope.py +241 -0
  12. agentless_mcp/application/graph_service.py +528 -0
  13. agentless_mcp/application/lint_service.py +181 -0
  14. agentless_mcp/application/map_service.py +383 -0
  15. agentless_mcp/application/patch_service.py +409 -0
  16. agentless_mcp/application/render.py +791 -0
  17. agentless_mcp/application/repo_context.py +108 -0
  18. agentless_mcp/application/symbol_service.py +595 -0
  19. agentless_mcp/application/validate_service.py +826 -0
  20. agentless_mcp/application/view_service.py +207 -0
  21. agentless_mcp/bootstrap.py +153 -0
  22. agentless_mcp/core/__init__.py +1 -0
  23. agentless_mcp/core/cache.py +1086 -0
  24. agentless_mcp/core/communities.py +339 -0
  25. agentless_mcp/core/extractor.py +1993 -0
  26. agentless_mcp/core/gitinfo.py +147 -0
  27. agentless_mcp/core/grammars.py +314 -0
  28. agentless_mcp/core/graph.py +301 -0
  29. agentless_mcp/core/imports.py +20 -0
  30. agentless_mcp/core/locs.py +307 -0
  31. agentless_mcp/core/mermaid.py +357 -0
  32. agentless_mcp/core/normalize.py +237 -0
  33. agentless_mcp/core/patches.py +588 -0
  34. agentless_mcp/core/patchlint.py +1761 -0
  35. agentless_mcp/core/projectconfig.py +334 -0
  36. agentless_mcp/core/refs.py +246 -0
  37. agentless_mcp/core/resolve.py +776 -0
  38. agentless_mcp/core/sandbox.py +436 -0
  39. agentless_mcp/core/skeleton.py +304 -0
  40. agentless_mcp/core/slices.py +164 -0
  41. agentless_mcp/core/symbols.py +279 -0
  42. agentless_mcp/core/treewalk.py +245 -0
  43. agentless_mcp/core/vote.py +295 -0
  44. agentless_mcp/prompts/__init__.py +107 -0
  45. agentless_mcp/prompts/envelope.json +13 -0
  46. agentless_mcp/prompts/loader.py +94 -0
  47. agentless_mcp/prompts/messages.json +16 -0
  48. agentless_mcp/prompts/tool_descriptions.json +13 -0
  49. agentless_mcp/util/__init__.py +1 -0
  50. agentless_mcp/util/errors.py +43 -0
  51. agentless_mcp/util/filelock.py +104 -0
  52. agentless_mcp/util/fslimits.py +211 -0
  53. agentless_mcp/util/platforms.py +21 -0
  54. agentless_mcp/util/tokens.py +44 -0
  55. agentless_mcp-0.1.0.dist-info/METADATA +162 -0
  56. agentless_mcp-0.1.0.dist-info/RECORD +60 -0
  57. agentless_mcp-0.1.0.dist-info/WHEEL +4 -0
  58. agentless_mcp-0.1.0.dist-info/entry_points.txt +4 -0
  59. agentless_mcp-0.1.0.dist-info/licenses/LICENSE +21 -0
  60. agentless_mcp-0.1.0.dist-info/licenses/NOTICE +53 -0
@@ -0,0 +1 @@
1
+ """agentless-mcp: model-free tree-sitter repo-map and patch machinery."""
@@ -0,0 +1,6 @@
1
+ """Module entry point: ``python -m agentless_mcp`` runs the CLI bootstrap."""
2
+
3
+ from agentless_mcp.bootstrap import cli_main
4
+
5
+ if __name__ == "__main__":
6
+ raise SystemExit(cli_main())
@@ -0,0 +1 @@
1
+ """Adapters layer: CLI and MCP entry surfaces."""
@@ -0,0 +1 @@
1
+ """CLI adapter: argparse tree; exit 0 ok, 1 domain, 2 usage-security."""
@@ -0,0 +1,78 @@
1
+ """Output and exit-code conventions shared by every CLI subcommand.
2
+
3
+ The split is deliberate and load-bearing for an agent driving this over Bash:
4
+ **stdout carries the answer, stderr carries everything about the run**. A
5
+ pipeline that captures stdout gets only the receipt, the banner and the view;
6
+ a failure is on stderr with a non-zero exit, never interleaved into a view
7
+ that would then parse as a shorter answer.
8
+
9
+ Exit codes are the same three the plan fixes:
10
+
11
+ * ``0`` -- the call answered, including answers that are legitimately empty.
12
+ * ``1`` -- a domain failure: no such symbol, a file the grammar cannot parse,
13
+ a walk bound exceeded. The request made sense; the repository did not allow
14
+ it.
15
+ * ``2`` -- usage or security: a bad flag, a missing repository root, a path
16
+ or root refused. The request itself was not admissible.
17
+ """
18
+
19
+ import sys
20
+
21
+ from agentless_mcp.application.repo_context import RepoContext
22
+ from agentless_mcp.util.errors import (
23
+ AtlasError,
24
+ LanguageUnavailable,
25
+ RepoResolutionError,
26
+ SecurityRefusal,
27
+ WalkBoundExceeded,
28
+ )
29
+
30
+ EXIT_OK = 0
31
+ EXIT_DOMAIN = 1
32
+ EXIT_USAGE = 2
33
+
34
+
35
+ def emit(text: str) -> None:
36
+ """Write an answer to stdout, exactly once, newline-terminated."""
37
+ sys.stdout.write(text if text.endswith("\n") else text + "\n")
38
+
39
+
40
+ def note(text: str) -> None:
41
+ """Write a receipt or a summary to stderr, leaving stdout to the answer.
42
+
43
+ The write subcommands emit a unified diff or an equivalence key on stdout,
44
+ which a caller pipes straight into ``git apply`` or a comparison. Anything
45
+ describing the run -- which repository, which HEAD, how many edits landed
46
+ -- goes here, so that pipeline never has to be told to skip a header.
47
+ """
48
+ sys.stderr.write(text if text.endswith("\n") else text + "\n")
49
+
50
+
51
+ def fail(message: str, code: int = EXIT_DOMAIN) -> int:
52
+ """Report a failure on stderr and return the exit code to propagate."""
53
+ sys.stderr.write(f"agentless-mcp: {message}\n")
54
+ return code
55
+
56
+
57
+ def exit_code_for(error: AtlasError) -> int:
58
+ """Map a typed error onto its exit code.
59
+
60
+ Keyed on what the error *is* -- a refusal versus a degraded answer -- not
61
+ on which subcommand raised it, so a new subcommand inherits the mapping
62
+ instead of re-deciding it.
63
+ """
64
+ if isinstance(error, SecurityRefusal | RepoResolutionError):
65
+ return EXIT_USAGE
66
+ if isinstance(error, LanguageUnavailable | WalkBoundExceeded):
67
+ return EXIT_DOMAIN
68
+ return EXIT_DOMAIN
69
+
70
+
71
+ def warn_about(ctx: RepoContext) -> None:
72
+ """Put a degraded repository state on stderr as well as in the receipt.
73
+
74
+ The receipt already carries the note, but a caller that pipes stdout into
75
+ a prompt would never see it there in time to act.
76
+ """
77
+ if ctx.note:
78
+ sys.stderr.write(f"agentless-mcp: {ctx.note}\n")