swarmauri_tool_containerfeedchars 0.11.0.dev1__tar.gz → 0.11.0.dev4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swarmauri_tool_containerfeedchars
3
- Version: 0.11.0.dev1
3
+ Version: 0.11.0.dev4
4
4
  Summary: Execute commands in Docker or Kubernetes containers.
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -17,9 +17,9 @@ Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Programming Language :: Python :: 3.14
20
- Requires-Dist: swarmauri_base
21
- Requires-Dist: swarmauri_core
22
- Requires-Dist: swarmauri_standard
20
+ Requires-Dist: swarmauri_base (>=0.11.0.dev6,<0.12)
21
+ Requires-Dist: swarmauri_core (>=0.11.0.dev6,<0.12)
22
+ Requires-Dist: swarmauri_standard (>=0.11.0.dev8,<0.12)
23
23
  Description-Content-Type: text/markdown
24
24
 
25
25
  ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "swarmauri_tool_containerfeedchars"
3
- version = "0.11.0.dev1"
3
+ version = "0.11.0.dev4"
4
4
  description = "Execute commands in Docker or Kubernetes containers."
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
@@ -19,9 +19,9 @@ classifiers = [
19
19
  ]
20
20
  authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
21
21
  dependencies = [
22
- "swarmauri_core",
23
- "swarmauri_base",
24
- "swarmauri_standard",
22
+ "swarmauri_core>=0.11.0.dev6,<0.12",
23
+ "swarmauri_base>=0.11.0.dev6,<0.12",
24
+ "swarmauri_standard>=0.11.0.dev8,<0.12",
25
25
  ]
26
26
  keywords = [
27
27
  'swarmauri',
@@ -1,5 +1,8 @@
1
1
  import subprocess
2
2
  from typing import List, Literal
3
+ from swarmauri_base.processes.collect_process import collect_process
4
+ from swarmauri_core.processes import IProcessBackend, ProcessRequest
5
+
3
6
  from pydantic import Field
4
7
  from swarmauri_base.tools.ToolBase import ToolBase
5
8
  from swarmauri_standard.tools.Parameter import Parameter
@@ -17,6 +20,8 @@ class ContainerFeedCharsTool(ToolBase):
17
20
  )
18
21
  type: Literal["ContainerFeedCharsTool"] = "ContainerFeedCharsTool"
19
22
 
23
+ backend: IProcessBackend | None = Field(default=None, exclude=True)
24
+
20
25
  driver: Literal["docker", "kubernetes"] = "docker"
21
26
 
22
27
  container_name: str | None = Field(
@@ -46,6 +51,14 @@ class ContainerFeedCharsTool(ToolBase):
46
51
  name = container_name or self.container_name
47
52
  if name is None:
48
53
  raise ValueError("container_name must be provided")
54
+ if self.backend is not None:
55
+ stdout, stderr, event = collect_process(
56
+ self.backend,
57
+ ProcessRequest(("sh", "-c", command), workspace=name),
58
+ )
59
+ if event.exit_code != 0:
60
+ raise RuntimeError(stderr.decode(errors="replace").strip())
61
+ return {"stdout": stdout.decode(errors="replace").strip()}
49
62
  if self.driver == "docker":
50
63
  cmd = ["docker", "exec", name, "sh", "-c", command]
51
64
  else: