flowent 0.0.10 → 0.0.11

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 (24) hide show
  1. package/backend/pyproject.toml +1 -1
  2. package/backend/src/flowent/__init__.py +6 -2
  3. package/backend/src/flowent/__pycache__/__init__.cpython-313.pyc +0 -0
  4. package/backend/src/flowent/__pycache__/agent.cpython-313.pyc +0 -0
  5. package/backend/src/flowent/__pycache__/context.cpython-313.pyc +0 -0
  6. package/backend/src/flowent/__pycache__/llm.cpython-313.pyc +0 -0
  7. package/backend/src/flowent/__pycache__/logging.cpython-313.pyc +0 -0
  8. package/backend/src/flowent/__pycache__/main.cpython-313.pyc +0 -0
  9. package/backend/src/flowent/__pycache__/patch.cpython-313.pyc +0 -0
  10. package/backend/src/flowent/__pycache__/paths.cpython-313.pyc +0 -0
  11. package/backend/src/flowent/__pycache__/sandbox.cpython-313.pyc +0 -0
  12. package/backend/src/flowent/__pycache__/storage.cpython-313.pyc +0 -0
  13. package/backend/src/flowent/__pycache__/tools.cpython-313.pyc +0 -0
  14. package/backend/src/flowent/tools.py +15 -3
  15. package/backend/tests/__pycache__/test_agent_tools.cpython-313-pytest-9.0.3.pyc +0 -0
  16. package/backend/tests/__pycache__/test_health.cpython-313-pytest-9.0.3.pyc +0 -0
  17. package/backend/tests/__pycache__/test_llm_providers.cpython-313-pytest-9.0.3.pyc +0 -0
  18. package/backend/tests/__pycache__/test_logging.cpython-313-pytest-9.0.3.pyc +0 -0
  19. package/backend/tests/__pycache__/test_persistence.cpython-313-pytest-9.0.3.pyc +0 -0
  20. package/backend/tests/__pycache__/test_workspace_chat.cpython-313-pytest-9.0.3.pyc +0 -0
  21. package/backend/tests/test_agent_tools.py +28 -0
  22. package/backend/uv.lock +1 -1
  23. package/package.json +1 -1
  24. package/backend/src/flowent/__pycache__/cli.cpython-313.pyc +0 -0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "flowent"
3
- version = "0.0.10"
3
+ version = "0.0.11"
4
4
  description = "A workflow orchestration platform for multi-agent collaboration."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -1,3 +1,7 @@
1
- from flowent.cli import main
2
-
3
1
  __all__ = ["main"]
2
+
3
+
4
+ def main() -> None:
5
+ from flowent.cli import main as cli_main
6
+
7
+ cli_main()
@@ -261,9 +261,7 @@ def apply_patch_tool(arguments: dict[str, object], context: ToolContext) -> Tool
261
261
  input_text=patch,
262
262
  )
263
263
  if result.exit_code != 0:
264
- raise SandboxError(
265
- result.stderr or result.stdout or "Patch could not be applied."
266
- )
264
+ raise SandboxError(tool_failure_content(result))
267
265
  return ToolResult(
268
266
  content=result.stdout,
269
267
  data={"files": [str(path) for path in paths]},
@@ -271,6 +269,20 @@ def apply_patch_tool(arguments: dict[str, object], context: ToolContext) -> Tool
271
269
  )
272
270
 
273
271
 
272
+ def tool_failure_content(result: object) -> str:
273
+ stdout = str(getattr(result, "stdout", "") or "").strip()
274
+ stderr = str(getattr(result, "stderr", "") or "").strip()
275
+ if stdout:
276
+ try:
277
+ payload = json.loads(stdout)
278
+ except json.JSONDecodeError:
279
+ payload = None
280
+ if isinstance(payload, dict) and isinstance(payload.get("error"), str):
281
+ return payload["error"]
282
+ parts = [part for part in [stderr, stdout] if part]
283
+ return "\n".join(parts) or "Tool failed."
284
+
285
+
274
286
  def shell_command(arguments: dict[str, object], context: ToolContext) -> ToolResult:
275
287
  command = str(arguments["command"])
276
288
  timeout_seconds = integer_argument(arguments, "timeout_seconds", 30)
@@ -296,6 +296,34 @@ def test_apply_patch_uses_internal_subcommand(tmp_path, monkeypatch) -> None:
296
296
  assert calls[0][1:4] == ["-m", "flowent.cli", "apply-patch"]
297
297
 
298
298
 
299
+ def test_apply_patch_reports_patch_error_when_stderr_has_warning(
300
+ tmp_path, monkeypatch
301
+ ) -> None:
302
+ def fake_run(self, command, **kwargs):
303
+ from flowent.sandbox import CommandResult
304
+
305
+ return CommandResult(
306
+ command=" ".join(command),
307
+ exit_code=1,
308
+ stderr="RuntimeWarning: flowent.cli was already imported\n",
309
+ stdout='{"error": "Patch context was not found."}\n',
310
+ )
311
+
312
+ monkeypatch.setattr(SandboxRunner, "run", fake_run)
313
+ patch = """*** Begin Patch
314
+ *** Update File: notes.txt
315
+ @@
316
+ -missing
317
+ +ready
318
+ *** End Patch
319
+ """
320
+
321
+ result = run_tool("apply_patch", {"patch": patch}, ToolContext(cwd=tmp_path))
322
+
323
+ assert not result.ok
324
+ assert result.content == "Patch context was not found."
325
+
326
+
299
327
  def test_web_search_result_enters_tool_output(tmp_path) -> None:
300
328
  def fake_search(query: str):
301
329
  return [{"title": "Result", "url": "https://example.test", "snippet": query}]
package/backend/uv.lock CHANGED
@@ -388,7 +388,7 @@ wheels = [
388
388
 
389
389
  [[package]]
390
390
  name = "flowent"
391
- version = "0.0.10"
391
+ version = "0.0.11"
392
392
  source = { editable = "." }
393
393
  dependencies = [
394
394
  { name = "fastapi", extra = ["standard"] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowent",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "A workflow orchestration platform for multi-agent collaboration.",
5
5
  "author": "ImFeH2 <i@feh2.im>",
6
6
  "license": "Apache-2.0",