maf-sandbox-codeact 0.3.0__tar.gz → 0.4.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.
- {maf_sandbox_codeact-0.3.0 → maf_sandbox_codeact-0.4.0}/PKG-INFO +2 -2
- {maf_sandbox_codeact-0.3.0 → maf_sandbox_codeact-0.4.0}/pyproject.toml +2 -3
- {maf_sandbox_codeact-0.3.0 → maf_sandbox_codeact-0.4.0}/pyproject.toml.orig +2 -3
- {maf_sandbox_codeact-0.3.0 → maf_sandbox_codeact-0.4.0}/src/maf_sandbox_codeact/_tool.py +12 -12
- {maf_sandbox_codeact-0.3.0 → maf_sandbox_codeact-0.4.0}/LICENSE +0 -0
- {maf_sandbox_codeact-0.3.0 → maf_sandbox_codeact-0.4.0}/README.md +0 -0
- {maf_sandbox_codeact-0.3.0 → maf_sandbox_codeact-0.4.0}/src/maf_sandbox_codeact/__init__.py +0 -0
- {maf_sandbox_codeact-0.3.0 → maf_sandbox_codeact-0.4.0}/src/maf_sandbox_codeact/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maf-sandbox-codeact
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: CodeAct as a Microsoft Agent Framework tool — the model writes a short Python program and it runs inside a sandbox — written against maf-sandbox so it runs on any sandbox backend.
|
|
5
5
|
Keywords: codeact,code-execution,sandbox,agent-framework,microsoft-agent-framework
|
|
6
6
|
Author: SOKOLAI BV
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.14
|
|
17
17
|
Classifier: Topic :: Software Development :: Interpreters
|
|
18
|
-
Requires-Dist: maf-sandbox>=0.
|
|
18
|
+
Requires-Dist: maf-sandbox>=0.12.0,<0.14
|
|
19
19
|
Requires-Dist: agent-framework-core>=1.13.0,<2
|
|
20
20
|
Requires-Python: >=3.12, <3.15
|
|
21
21
|
Project-URL: Homepage, https://www.sokol.ai
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "maf-sandbox-codeact"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
description = "CodeAct as a Microsoft Agent Framework tool — the model writes a short Python program and it runs inside a sandbox — written against maf-sandbox so it runs on any sandbox backend."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12,<3.15"
|
|
@@ -24,7 +24,7 @@ classifiers = [
|
|
|
24
24
|
"Topic :: Software Development :: Interpreters",
|
|
25
25
|
]
|
|
26
26
|
dependencies = [
|
|
27
|
-
"maf-sandbox>=0.
|
|
27
|
+
"maf-sandbox>=0.12.0,<0.14",
|
|
28
28
|
"agent-framework-core>=1.13.0,<2",
|
|
29
29
|
]
|
|
30
30
|
|
|
@@ -57,7 +57,6 @@ extend-select = [
|
|
|
57
57
|
"D103",
|
|
58
58
|
"D104",
|
|
59
59
|
]
|
|
60
|
-
ignore = ["UP037"]
|
|
61
60
|
|
|
62
61
|
[tool.ruff.lint.per-file-ignores]
|
|
63
62
|
"tests/**" = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "maf-sandbox-codeact"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
description = "CodeAct as a Microsoft Agent Framework tool — the model writes a short Python program and it runs inside a sandbox — written against maf-sandbox so it runs on any sandbox backend."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12,<3.15"
|
|
@@ -34,7 +34,7 @@ dependencies = [
|
|
|
34
34
|
# published wheel resolves a maf-sandbox base missing those imports. The number itself is
|
|
35
35
|
# below, and `scripts/set_dependents_range.py` moves it — so this says which release the
|
|
36
36
|
# floor is for, never which release that is.
|
|
37
|
-
"maf-sandbox>=0.
|
|
37
|
+
"maf-sandbox>=0.12.0,<0.14",
|
|
38
38
|
# The `@tool` decorator. MAF is a genuine dependency of the tool itself, not of the host
|
|
39
39
|
# application.
|
|
40
40
|
"agent-framework-core>=1.13.0,<2",
|
|
@@ -61,7 +61,6 @@ target-version = "py312"
|
|
|
61
61
|
|
|
62
62
|
[tool.ruff.lint]
|
|
63
63
|
extend-select = ["I", "UP", "D100", "D101", "D103", "D104"]
|
|
64
|
-
ignore = ["UP037"]
|
|
65
64
|
|
|
66
65
|
[tool.ruff.lint.per-file-ignores]
|
|
67
66
|
# ruff resolves [tool.ruff] per file by the NEAREST ancestor pyproject.toml that has one, so
|
|
@@ -67,7 +67,7 @@ EXECUTE_CODE_TOOL_NAME = "execute_code"
|
|
|
67
67
|
CODEACT_KIND = "codeact"
|
|
68
68
|
|
|
69
69
|
#: Where every run's directory is created — a dedicated root rather than the image's own tree.
|
|
70
|
-
_WORK_DIR = "/work"
|
|
70
|
+
_WORK_DIR = "/maf-sandbox/work"
|
|
71
71
|
|
|
72
72
|
#: One fixed name inside each run's own directory.
|
|
73
73
|
_PROGRAM_FILENAME = "program.py"
|
|
@@ -161,7 +161,7 @@ def make_codeact_tools(
|
|
|
161
161
|
agent_dir: str,
|
|
162
162
|
context: CallerContext,
|
|
163
163
|
*,
|
|
164
|
-
file_store:
|
|
164
|
+
file_store: AgentFileStore | None = None,
|
|
165
165
|
output_sink: OutputSink | None = None,
|
|
166
166
|
outputs: CodeactOutputs = CodeactOutputs.NONE,
|
|
167
167
|
outbound_max_confidentiality: str | None = None,
|
|
@@ -362,10 +362,10 @@ def _tool_description(*, takes_files: bool, outputs: CodeactOutputs) -> str:
|
|
|
362
362
|
|
|
363
363
|
def _execute_code_tool(
|
|
364
364
|
session: SandboxToolSession,
|
|
365
|
-
store:
|
|
365
|
+
store: AgentFileStore | None,
|
|
366
366
|
outputs: CodeactOutputs,
|
|
367
367
|
timeout: int,
|
|
368
|
-
) ->
|
|
368
|
+
) -> Callable[..., Awaitable[str]]:
|
|
369
369
|
"""Build the ``execute_code`` body for one attached tool.
|
|
370
370
|
|
|
371
371
|
Four signatures over one implementation, because MAF derives the tool's schema from the
|
|
@@ -406,7 +406,7 @@ def _execute_code_tool(
|
|
|
406
406
|
|
|
407
407
|
async def _execute(
|
|
408
408
|
session: SandboxToolSession,
|
|
409
|
-
store:
|
|
409
|
+
store: AgentFileStore | None,
|
|
410
410
|
outputs: CodeactOutputs,
|
|
411
411
|
timeout: int,
|
|
412
412
|
code: str,
|
|
@@ -515,7 +515,7 @@ async def _execute(
|
|
|
515
515
|
|
|
516
516
|
async def _resolve_listed_files(
|
|
517
517
|
session: SandboxToolSession,
|
|
518
|
-
store:
|
|
518
|
+
store: AgentFileStore,
|
|
519
519
|
files: list[str],
|
|
520
520
|
*,
|
|
521
521
|
reserved: set[str],
|
|
@@ -583,7 +583,7 @@ def _listing_hint(name: str, listing: list[str]) -> str:
|
|
|
583
583
|
|
|
584
584
|
|
|
585
585
|
async def _read_listed_files(
|
|
586
|
-
store:
|
|
586
|
+
store: AgentFileStore, names: list[str], tally: _InboundTally
|
|
587
587
|
) -> list[tuple[str, str]] | str:
|
|
588
588
|
"""Read every requested file into memory, or answer with the refusal.
|
|
589
589
|
|
|
@@ -676,7 +676,7 @@ class _InboundTally:
|
|
|
676
676
|
return None
|
|
677
677
|
|
|
678
678
|
|
|
679
|
-
async def _write_shared(sandbox:
|
|
679
|
+
async def _write_shared(sandbox: Sandbox, name: str, guest_path: str, content: str) -> str | None:
|
|
680
680
|
"""Put one already-read file store file into the run's directory, or answer with the refusal."""
|
|
681
681
|
try:
|
|
682
682
|
await sandbox.write_file(guest_path, content)
|
|
@@ -698,7 +698,7 @@ def _normalization(session: SandboxToolSession) -> NameNormalization:
|
|
|
698
698
|
|
|
699
699
|
|
|
700
700
|
def _validated_output_names(
|
|
701
|
-
names:
|
|
701
|
+
names: Sequence[str],
|
|
702
702
|
*,
|
|
703
703
|
max_files: int,
|
|
704
704
|
reserved: set[str],
|
|
@@ -748,7 +748,7 @@ def _validated_output_names(
|
|
|
748
748
|
|
|
749
749
|
async def _collect(
|
|
750
750
|
session: SandboxToolSession,
|
|
751
|
-
sandbox:
|
|
751
|
+
sandbox: Sandbox,
|
|
752
752
|
run_id: str,
|
|
753
753
|
outputs: CodeactOutputs,
|
|
754
754
|
declared: list[str],
|
|
@@ -810,7 +810,7 @@ async def _collect(
|
|
|
810
810
|
|
|
811
811
|
|
|
812
812
|
async def _read_manifest(
|
|
813
|
-
session: SandboxToolSession, sandbox:
|
|
813
|
+
session: SandboxToolSession, sandbox: Sandbox, run_id: str
|
|
814
814
|
) -> tuple[list[str], int] | str:
|
|
815
815
|
"""Parse the program's own listing of what it produced, bounded and refusing malformed shapes.
|
|
816
816
|
|
|
@@ -889,7 +889,7 @@ async def _read_manifest(
|
|
|
889
889
|
return entries, len(raw)
|
|
890
890
|
|
|
891
891
|
|
|
892
|
-
def _format_landed(landed:
|
|
892
|
+
def _format_landed(landed: Sequence[LandedArtifact], declared: Sequence[str]) -> str:
|
|
893
893
|
"""What the model is told about the files: the host's own references, and what is absent.
|
|
894
894
|
|
|
895
895
|
The two sides are compared in NFC, because a landing name is normalized before the sink
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|