tina-python 0.6.7__tar.gz → 0.6.8__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 (53) hide show
  1. {tina_python-0.6.7/tina_python.egg-info → tina_python-0.6.8}/PKG-INFO +1 -1
  2. {tina_python-0.6.7 → tina_python-0.6.8}/pyproject.toml +1 -1
  3. {tina_python-0.6.7 → tina_python-0.6.8}/setup.py +1 -1
  4. {tina_python-0.6.7 → tina_python-0.6.8}/tina/__init__.py +1 -1
  5. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/tui/context_manager.py +18 -3
  6. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/tui/tui.py +1545 -1428
  7. {tina_python-0.6.7 → tina_python-0.6.8/tina_python.egg-info}/PKG-INFO +1 -1
  8. {tina_python-0.6.7 → tina_python-0.6.8}/LICENSE +0 -0
  9. {tina_python-0.6.7 → tina_python-0.6.8}/MANIFEST.in +0 -0
  10. {tina_python-0.6.7 → tina_python-0.6.8}/README.md +0 -0
  11. {tina_python-0.6.7 → tina_python-0.6.8}/setup.cfg +0 -0
  12. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/__init__.py +0 -0
  13. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/agent.py +0 -0
  14. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/__init__.py +0 -0
  15. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/agent_response.py +0 -0
  16. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/agent_runtime.py +0 -0
  17. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/context_manager.py +0 -0
  18. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/events.py +0 -0
  19. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/executor.py +0 -0
  20. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/keyword_actions.py +0 -0
  21. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/prompt.py +0 -0
  22. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/state.py +0 -0
  23. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/tools.py +0 -0
  24. {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/multimodal_agent.py +0 -0
  25. {tina_python-0.6.7 → tina_python-0.6.8}/tina/core/__init__.py +0 -0
  26. {tina_python-0.6.7 → tina_python-0.6.8}/tina/core/error.py +0 -0
  27. {tina_python-0.6.7 → tina_python-0.6.8}/tina/core/logger.py +0 -0
  28. {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/BaseNewAPI.py +0 -0
  29. {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/__init__.py +0 -0
  30. {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/base_api.py +0 -0
  31. {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/base_multimodal_api.py +0 -0
  32. {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/ollama_api.py +0 -0
  33. {tina_python-0.6.7 → tina_python-0.6.8}/tina/mcp/__init__.py +0 -0
  34. {tina_python-0.6.7 → tina_python-0.6.8}/tina/mcp/client.py +0 -0
  35. {tina_python-0.6.7 → tina_python-0.6.8}/tina/mcp/mcp_tools_executor.py +0 -0
  36. {tina_python-0.6.7 → tina_python-0.6.8}/tina/py.typed +0 -0
  37. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/__init__.py +0 -0
  38. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/agent_worker.py +0 -0
  39. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/deepseek.py +0 -0
  40. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/doc_parser.py +0 -0
  41. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/env_reader.py +0 -0
  42. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/multimodal_formatter.py +0 -0
  43. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/output_parser.py +0 -0
  44. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/run_agent_in_cli.py +0 -0
  45. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/system_tools.py +0 -0
  46. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/timer.py +0 -0
  47. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/tui/__init__.py +0 -0
  48. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/tui/token.py +0 -0
  49. {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/type_mapper.py +0 -0
  50. {tina_python-0.6.7 → tina_python-0.6.8}/tina_python.egg-info/SOURCES.txt +0 -0
  51. {tina_python-0.6.7 → tina_python-0.6.8}/tina_python.egg-info/dependency_links.txt +0 -0
  52. {tina_python-0.6.7 → tina_python-0.6.8}/tina_python.egg-info/requires.txt +0 -0
  53. {tina_python-0.6.7 → tina_python-0.6.8}/tina_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tina-python
3
- Version: 0.6.7
3
+ Version: 0.6.8
4
4
  Summary: tina is in your computer!
5
5
  Home-page: https://gitee.com/wang-churi/tina
6
6
  Author: 王出日
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tina-python"
7
- version = "0.6.7"
7
+ version = "0.6.8"
8
8
  description = "tina is in your computer!"
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  requires-python = ">=3.10"
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="tina-python",
5
- version="0.6.7",
5
+ version="0.6.8",
6
6
  packages=find_packages(),
7
7
  package_data={"tina": ["py.typed"]},
8
8
  install_requires=["httpx", "python-dotenv"],
@@ -19,4 +19,4 @@ __all__ = [
19
19
  "AgentState",
20
20
  "AgentEvents",
21
21
  ]
22
- __version__ = "0.6.7"
22
+ __version__ = "0.6.8"
@@ -378,8 +378,9 @@ class TuiMessageStore:
378
378
  index = chunk.get("tool_index")
379
379
 
380
380
  if index is not None:
381
- # 并发调用:按 index 定位,绝不按名字串到别的调用上
382
- block = self._tool_by_index.get(index)
381
+ # 并发调用:按 index 定位,绝不按名字串到别的调用上。
382
+ # 已完成的旧卡片不复用(每次 LLM 响应的 index 都从 0 重新开始)
383
+ block = self._routed_tool_by_index(index)
383
384
  if block is None:
384
385
  block = self._start_tool(name or "unknown", index=index)
385
386
  else:
@@ -403,7 +404,7 @@ class TuiMessageStore:
403
404
  index = call.get("index")
404
405
  call_id = call.get("id")
405
406
 
406
- block = self._tool_by_index.get(index) if index is not None else None
407
+ block = self._routed_tool_by_index(index)
407
408
  if block is None and call_id:
408
409
  block = self._tool_by_id.get(call_id)
409
410
  if block is None and name:
@@ -449,6 +450,20 @@ class TuiMessageStore:
449
450
  self._notify("update", block)
450
451
  return block
451
452
 
453
+ @staticmethod
454
+ def _is_active_tool(block: TuiBlock | None) -> bool:
455
+ """工具卡片是否仍在进行中(可用于承接后续流式片段)"""
456
+ return block is not None and block["status"] in ("building", "calling")
457
+
458
+ def _routed_tool_by_index(self, index: int | None) -> TuiBlock | None:
459
+ """按 index 取当前轮次的工具卡片;已完成的不复用,避免跨轮次串卡"""
460
+ if index is None:
461
+ return None
462
+ block = self._tool_by_index.get(index)
463
+ if not self._is_active_tool(block):
464
+ return None
465
+ return block
466
+
452
467
  def _start_tool(
453
468
  self, name: str, index: int | None = None, tool_id: str | None = None
454
469
  ) -> TuiBlock: