bashkit 0.9.0__cp313-cp313-pyemscripten_2025_0_wasm32.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.
bashkit/__init__.py ADDED
@@ -0,0 +1,73 @@
1
+ """
2
+ Bashkit — a sandboxed bash interpreter for AI agents.
3
+
4
+ Core interpreter (``Bash``)::
5
+
6
+ >>> from bashkit import Bash
7
+ >>> bash = Bash(timeout_seconds=30)
8
+ >>> result = bash.execute_sync("echo 'Hello, World!'")
9
+ >>> print(result.stdout)
10
+ Hello, World!
11
+
12
+ LLM tool wrapper with schema and system prompt (``BashTool``)::
13
+
14
+ >>> from bashkit import BashTool
15
+ >>> tool = BashTool()
16
+ >>> result = tool.execute_sync("echo 'Hello, World!'")
17
+ >>> print(result.stdout)
18
+ Hello, World!
19
+ >>> print(tool.input_schema()) # JSON Schema for LLM function calling
20
+
21
+ Multi-tool orchestration (``ScriptedTool``)::
22
+
23
+ >>> from bashkit import ScriptedTool
24
+ >>> tool = ScriptedTool("api")
25
+ >>> tool.add_tool("greet", "Greet user",
26
+ ... callback=lambda p, s=None: f"hello {p.get('name', 'world')}\\n")
27
+ >>> result = tool.execute_sync("greet --name Alice")
28
+ >>> print(result.stdout.strip())
29
+ hello Alice
30
+
31
+ Direct VFS access (``FileSystem``)::
32
+
33
+ >>> from bashkit import FileSystem
34
+ >>> fs = FileSystem()
35
+ >>> fs.write_file("/data.txt", b"content")
36
+ >>> fs.read_file("/data.txt")
37
+ b'content'
38
+
39
+ Framework integrations::
40
+
41
+ >>> from bashkit.langchain import create_bash_tool, create_scripted_tool
42
+ >>> from bashkit.pydantic_ai import create_bash_tool
43
+ >>> from bashkit.deepagents import create_bashkit_backend
44
+ """
45
+
46
+ from bashkit._bashkit import (
47
+ Bash,
48
+ BashError,
49
+ BashTool,
50
+ BuiltinContext,
51
+ BuiltinResult,
52
+ ExecResult,
53
+ FileSystem,
54
+ ScriptedTool,
55
+ ShellState,
56
+ create_langchain_tool_spec,
57
+ get_version,
58
+ )
59
+
60
+ __version__ = "0.1.2"
61
+ __all__ = [
62
+ "Bash",
63
+ "BashError",
64
+ "BuiltinContext",
65
+ "BuiltinResult",
66
+ "BashTool",
67
+ "ExecResult",
68
+ "FileSystem",
69
+ "ShellState",
70
+ "ScriptedTool",
71
+ "create_langchain_tool_spec",
72
+ "get_version",
73
+ ]