astra-cli-agent 0.1.0__tar.gz

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 (144) hide show
  1. astra_cli_agent-0.1.0/.env.example +28 -0
  2. astra_cli_agent-0.1.0/.github/workflows/ci.yml +37 -0
  3. astra_cli_agent-0.1.0/.github/workflows/release.yml +49 -0
  4. astra_cli_agent-0.1.0/.gitignore +15 -0
  5. astra_cli_agent-0.1.0/HANDOFF.md +1752 -0
  6. astra_cli_agent-0.1.0/PKG-INFO +130 -0
  7. astra_cli_agent-0.1.0/README.md +96 -0
  8. astra_cli_agent-0.1.0/docs/ARCHITECTURE.md +224 -0
  9. astra_cli_agent-0.1.0/pyproject.toml +61 -0
  10. astra_cli_agent-0.1.0/src/astra/__init__.py +1 -0
  11. astra_cli_agent-0.1.0/src/astra/agents/__init__.py +0 -0
  12. astra_cli_agent-0.1.0/src/astra/agents/base.py +44 -0
  13. astra_cli_agent-0.1.0/src/astra/agents/coder_agent.py +39 -0
  14. astra_cli_agent-0.1.0/src/astra/agents/debug_agent.py +41 -0
  15. astra_cli_agent-0.1.0/src/astra/agents/docker_agent.py +139 -0
  16. astra_cli_agent-0.1.0/src/astra/agents/documentation_agent.py +41 -0
  17. astra_cli_agent-0.1.0/src/astra/agents/file_agent.py +176 -0
  18. astra_cli_agent-0.1.0/src/astra/agents/git_agent.py +163 -0
  19. astra_cli_agent-0.1.0/src/astra/agents/kubernetes_agent.py +150 -0
  20. astra_cli_agent-0.1.0/src/astra/agents/mcp_agent.py +135 -0
  21. astra_cli_agent-0.1.0/src/astra/agents/memory_agent.py +35 -0
  22. astra_cli_agent-0.1.0/src/astra/agents/planner_agent.py +149 -0
  23. astra_cli_agent-0.1.0/src/astra/agents/research_agent.py +121 -0
  24. astra_cli_agent-0.1.0/src/astra/agents/retrieve_agent.py +52 -0
  25. astra_cli_agent-0.1.0/src/astra/agents/reviewer_agent.py +133 -0
  26. astra_cli_agent-0.1.0/src/astra/cli/__init__.py +0 -0
  27. astra_cli_agent-0.1.0/src/astra/cli/app.py +175 -0
  28. astra_cli_agent-0.1.0/src/astra/cli/chat.py +145 -0
  29. astra_cli_agent-0.1.0/src/astra/cli/ingest.py +57 -0
  30. astra_cli_agent-0.1.0/src/astra/cli/mcp.py +65 -0
  31. astra_cli_agent-0.1.0/src/astra/cli/memory.py +197 -0
  32. astra_cli_agent-0.1.0/src/astra/cli/rendering.py +50 -0
  33. astra_cli_agent-0.1.0/src/astra/cli/setup.py +206 -0
  34. astra_cli_agent-0.1.0/src/astra/cli/single.py +35 -0
  35. astra_cli_agent-0.1.0/src/astra/config/__init__.py +0 -0
  36. astra_cli_agent-0.1.0/src/astra/config/defaults.yaml +37 -0
  37. astra_cli_agent-0.1.0/src/astra/config/profiles/.gitkeep +0 -0
  38. astra_cli_agent-0.1.0/src/astra/core/__init__.py +0 -0
  39. astra_cli_agent-0.1.0/src/astra/core/confirm.py +18 -0
  40. astra_cli_agent-0.1.0/src/astra/core/events.py +18 -0
  41. astra_cli_agent-0.1.0/src/astra/core/exceptions.py +15 -0
  42. astra_cli_agent-0.1.0/src/astra/core/graph.py +141 -0
  43. astra_cli_agent-0.1.0/src/astra/core/json_stream.py +101 -0
  44. astra_cli_agent-0.1.0/src/astra/core/onboarding.py +37 -0
  45. astra_cli_agent-0.1.0/src/astra/core/settings.py +139 -0
  46. astra_cli_agent-0.1.0/src/astra/core/state.py +32 -0
  47. astra_cli_agent-0.1.0/src/astra/llm/__init__.py +0 -0
  48. astra_cli_agent-0.1.0/src/astra/llm/cost.py +27 -0
  49. astra_cli_agent-0.1.0/src/astra/llm/litellm_client.py +138 -0
  50. astra_cli_agent-0.1.0/src/astra/llm/ollama_client.py +139 -0
  51. astra_cli_agent-0.1.0/src/astra/llm/provider.py +88 -0
  52. astra_cli_agent-0.1.0/src/astra/llm/router.py +201 -0
  53. astra_cli_agent-0.1.0/src/astra/memory/__init__.py +0 -0
  54. astra_cli_agent-0.1.0/src/astra/memory/chunking.py +77 -0
  55. astra_cli_agent-0.1.0/src/astra/memory/embeddings.py +42 -0
  56. astra_cli_agent-0.1.0/src/astra/memory/models.py +48 -0
  57. astra_cli_agent-0.1.0/src/astra/memory/retriever.py +16 -0
  58. astra_cli_agent-0.1.0/src/astra/memory/store.py +219 -0
  59. astra_cli_agent-0.1.0/src/astra/memory/vector_store.py +102 -0
  60. astra_cli_agent-0.1.0/src/astra/models/__init__.py +0 -0
  61. astra_cli_agent-0.1.0/src/astra/models/tool_result.py +11 -0
  62. astra_cli_agent-0.1.0/src/astra/prompts/.gitkeep +0 -0
  63. astra_cli_agent-0.1.0/src/astra/tools/__init__.py +0 -0
  64. astra_cli_agent-0.1.0/src/astra/tools/code/__init__.py +0 -0
  65. astra_cli_agent-0.1.0/src/astra/tools/code/backend.py +76 -0
  66. astra_cli_agent-0.1.0/src/astra/tools/code/tools.py +38 -0
  67. astra_cli_agent-0.1.0/src/astra/tools/docker/__init__.py +0 -0
  68. astra_cli_agent-0.1.0/src/astra/tools/docker/backend.py +122 -0
  69. astra_cli_agent-0.1.0/src/astra/tools/docker/tools.py +53 -0
  70. astra_cli_agent-0.1.0/src/astra/tools/filesystem/__init__.py +0 -0
  71. astra_cli_agent-0.1.0/src/astra/tools/filesystem/backend.py +121 -0
  72. astra_cli_agent-0.1.0/src/astra/tools/filesystem/tools.py +46 -0
  73. astra_cli_agent-0.1.0/src/astra/tools/git/__init__.py +0 -0
  74. astra_cli_agent-0.1.0/src/astra/tools/git/backend.py +110 -0
  75. astra_cli_agent-0.1.0/src/astra/tools/git/tools.py +55 -0
  76. astra_cli_agent-0.1.0/src/astra/tools/kubernetes/__init__.py +0 -0
  77. astra_cli_agent-0.1.0/src/astra/tools/kubernetes/backend.py +101 -0
  78. astra_cli_agent-0.1.0/src/astra/tools/kubernetes/tools.py +47 -0
  79. astra_cli_agent-0.1.0/src/astra/tools/mcp/__init__.py +0 -0
  80. astra_cli_agent-0.1.0/src/astra/tools/mcp/backend.py +103 -0
  81. astra_cli_agent-0.1.0/src/astra/tools/mcp/client.py +249 -0
  82. astra_cli_agent-0.1.0/src/astra/tools/mcp/discovery.py +137 -0
  83. astra_cli_agent-0.1.0/src/astra/tools/registry.py +48 -0
  84. astra_cli_agent-0.1.0/src/astra/tools/shell/__init__.py +0 -0
  85. astra_cli_agent-0.1.0/src/astra/tools/shell/backend.py +116 -0
  86. astra_cli_agent-0.1.0/src/astra/tools/shell/tools.py +32 -0
  87. astra_cli_agent-0.1.0/src/astra/tools/web/__init__.py +0 -0
  88. astra_cli_agent-0.1.0/src/astra/tools/web/backend.py +186 -0
  89. astra_cli_agent-0.1.0/src/astra/tools/web/tools.py +58 -0
  90. astra_cli_agent-0.1.0/src/astra/utils/__init__.py +0 -0
  91. astra_cli_agent-0.1.0/src/astra/utils/logging.py +43 -0
  92. astra_cli_agent-0.1.0/tests/e2e/.gitkeep +0 -0
  93. astra_cli_agent-0.1.0/tests/e2e/test_e2e_live_groq.py +100 -0
  94. astra_cli_agent-0.1.0/tests/fixtures/mcp_fixture_server.py +50 -0
  95. astra_cli_agent-0.1.0/tests/integration/.gitkeep +0 -0
  96. astra_cli_agent-0.1.0/tests/integration/_helpers.py +37 -0
  97. astra_cli_agent-0.1.0/tests/integration/conftest.py +112 -0
  98. astra_cli_agent-0.1.0/tests/integration/test_cli_ask.py +25 -0
  99. astra_cli_agent-0.1.0/tests/integration/test_cli_confirm_gate.py +82 -0
  100. astra_cli_agent-0.1.0/tests/integration/test_cli_ingest_and_retrieval.py +86 -0
  101. astra_cli_agent-0.1.0/tests/integration/test_cli_mcp.py +82 -0
  102. astra_cli_agent-0.1.0/tests/integration/test_cli_run_pipeline.py +106 -0
  103. astra_cli_agent-0.1.0/tests/unit/.gitkeep +0 -0
  104. astra_cli_agent-0.1.0/tests/unit/conftest.py +104 -0
  105. astra_cli_agent-0.1.0/tests/unit/test_agents.py +261 -0
  106. astra_cli_agent-0.1.0/tests/unit/test_chat.py +219 -0
  107. astra_cli_agent-0.1.0/tests/unit/test_chunking.py +50 -0
  108. astra_cli_agent-0.1.0/tests/unit/test_cli.py +40 -0
  109. astra_cli_agent-0.1.0/tests/unit/test_code_backend.py +79 -0
  110. astra_cli_agent-0.1.0/tests/unit/test_code_tools.py +29 -0
  111. astra_cli_agent-0.1.0/tests/unit/test_docker_agent.py +171 -0
  112. astra_cli_agent-0.1.0/tests/unit/test_docker_backend.py +125 -0
  113. astra_cli_agent-0.1.0/tests/unit/test_docker_tools.py +67 -0
  114. astra_cli_agent-0.1.0/tests/unit/test_file_agent.py +188 -0
  115. astra_cli_agent-0.1.0/tests/unit/test_filesystem_backend.py +141 -0
  116. astra_cli_agent-0.1.0/tests/unit/test_filesystem_tools.py +41 -0
  117. astra_cli_agent-0.1.0/tests/unit/test_git_agent.py +162 -0
  118. astra_cli_agent-0.1.0/tests/unit/test_git_backend.py +136 -0
  119. astra_cli_agent-0.1.0/tests/unit/test_git_tools.py +67 -0
  120. astra_cli_agent-0.1.0/tests/unit/test_graph.py +138 -0
  121. astra_cli_agent-0.1.0/tests/unit/test_json_stream.py +75 -0
  122. astra_cli_agent-0.1.0/tests/unit/test_kubernetes_agent.py +181 -0
  123. astra_cli_agent-0.1.0/tests/unit/test_kubernetes_backend.py +122 -0
  124. astra_cli_agent-0.1.0/tests/unit/test_kubernetes_tools.py +72 -0
  125. astra_cli_agent-0.1.0/tests/unit/test_llm_adapters.py +137 -0
  126. astra_cli_agent-0.1.0/tests/unit/test_llm_cost.py +14 -0
  127. astra_cli_agent-0.1.0/tests/unit/test_llm_router.py +143 -0
  128. astra_cli_agent-0.1.0/tests/unit/test_llm_router_streaming.py +153 -0
  129. astra_cli_agent-0.1.0/tests/unit/test_mcp_agent.py +149 -0
  130. astra_cli_agent-0.1.0/tests/unit/test_mcp_backend.py +58 -0
  131. astra_cli_agent-0.1.0/tests/unit/test_mcp_client.py +95 -0
  132. astra_cli_agent-0.1.0/tests/unit/test_mcp_discovery.py +94 -0
  133. astra_cli_agent-0.1.0/tests/unit/test_mcp_http_transport.py +90 -0
  134. astra_cli_agent-0.1.0/tests/unit/test_memory_agent.py +57 -0
  135. astra_cli_agent-0.1.0/tests/unit/test_memory_store.py +138 -0
  136. astra_cli_agent-0.1.0/tests/unit/test_onboarding.py +44 -0
  137. astra_cli_agent-0.1.0/tests/unit/test_rag_e2e.py +103 -0
  138. astra_cli_agent-0.1.0/tests/unit/test_research_agent.py +106 -0
  139. astra_cli_agent-0.1.0/tests/unit/test_setup.py +154 -0
  140. astra_cli_agent-0.1.0/tests/unit/test_shell_backend.py +145 -0
  141. astra_cli_agent-0.1.0/tests/unit/test_shell_tools.py +17 -0
  142. astra_cli_agent-0.1.0/tests/unit/test_vector_store.py +61 -0
  143. astra_cli_agent-0.1.0/tests/unit/test_web_backend.py +109 -0
  144. astra_cli_agent-0.1.0/tests/unit/test_web_tools.py +59 -0
@@ -0,0 +1,28 @@
1
+ # Copy to .env and fill in the providers you have keys for — or just run `astra setup`,
2
+ # which walks you through picking a provider and tests the key before saving it.
3
+ # Astra never reads these into logs or memory; they're loaded as env vars only.
4
+
5
+ ANTHROPIC_API_KEY=
6
+ OPENAI_API_KEY=
7
+ GROQ_API_KEY=
8
+
9
+ # Local Ollama server (optional last-resort fallback)
10
+ OLLAMA_HOST=http://localhost:11434
11
+
12
+ # Optional general web search (the research agent's `web_search_general` tool). Uses SerpApi
13
+ # (https://serpapi.com) to run a real Google search. Leaving SERPAPI_KEY unset simply disables
14
+ # `web_search_general`; the GitHub/StackOverflow/fetch tools work without it.
15
+ SERPAPI_KEY=
16
+
17
+ # Optional observability: set LANGCHAIN_TRACING_V2=true and provide a LangSmith API key to
18
+ # get a full trace (every graph node + every LLM call, with tokens/cost/latency) exported to
19
+ # https://smith.langchain.com for each `astra` request. LANGCHAIN_PROJECT groups traces under
20
+ # one project name in the LangSmith UI (defaults to "default" if unset). Leaving
21
+ # LANGCHAIN_TRACING_V2 unset/false costs nothing — Astra's own cost/token tracking
22
+ # (`astra memory costs`) works independently of this and needs no key at all.
23
+ LANGCHAIN_API_KEY=
24
+ LANGCHAIN_TRACING_V2=false
25
+ LANGCHAIN_PROJECT=astra-cli
26
+
27
+ # Nested settings overrides, e.g.:
28
+ # ASTRA_APP__LOG_LEVEL=DEBUG
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.12"
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v3
22
+
23
+ - name: Install dependencies
24
+ run: uv pip install --system -e ".[dev]"
25
+
26
+ - name: Ruff
27
+ run: ruff check .
28
+
29
+ - name: Mypy
30
+ run: mypy src
31
+
32
+ - name: Pytest
33
+ # No GROQ_API_KEY is configured in CI, so tests/e2e/test_e2e_live_groq.py
34
+ # skips cleanly (see HANDOFF.md Phase 17) rather than failing or spending
35
+ # real money. Docker/kubernetes-backed tests skip the same way when the
36
+ # runner has no reachable daemon/cluster.
37
+ run: pytest -q
@@ -0,0 +1,49 @@
1
+ name: Release
2
+
3
+ # Fires when a GitHub Release is published (create the release from a tag,
4
+ # e.g. v0.1.0, once CI is green on main). Uses PyPI's trusted-publishing
5
+ # (OIDC) flow, so no API token is stored as a repo secret.
6
+ on:
7
+ release:
8
+ types: [published]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ build:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.12"
23
+
24
+ - name: Build sdist and wheel
25
+ run: |
26
+ python -m pip install --upgrade build
27
+ python -m build
28
+
29
+ - name: Upload build artifacts
30
+ uses: actions/upload-artifact@v4
31
+ with:
32
+ name: dist
33
+ path: dist/
34
+
35
+ publish:
36
+ needs: build
37
+ runs-on: ubuntu-latest
38
+ environment: pypi
39
+ permissions:
40
+ id-token: write # required for PyPI trusted publishing
41
+ steps:
42
+ - name: Download build artifacts
43
+ uses: actions/download-artifact@v4
44
+ with:
45
+ name: dist
46
+ path: dist/
47
+
48
+ - name: Publish to PyPI
49
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,15 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .eggs/
5
+ build/
6
+ dist/
7
+ .venv/
8
+ venv/
9
+ .env
10
+ .pytest_cache/
11
+ .mypy_cache/
12
+ .ruff_cache/
13
+ .coverage
14
+ htmlcov/
15
+ .astra/