xpander-sdk 2.0.330__tar.gz → 2.0.332__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 (138) hide show
  1. {xpander_sdk-2.0.330/src/xpander_sdk.egg-info → xpander_sdk-2.0.332}/PKG-INFO +1 -1
  2. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/setup.py +1 -1
  3. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/__init__.py +1 -1
  4. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/finalize_mode.py +17 -27
  5. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/prompts.py +35 -54
  6. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/models/agent.py +0 -19
  7. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/frameworks/agno.py +165 -628
  8. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332/src/xpander_sdk.egg-info}/PKG-INFO +1 -1
  9. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/LICENSE +0 -0
  10. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/README.md +0 -0
  11. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/pyproject.toml +0 -0
  12. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/setup.cfg +0 -0
  13. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/consts/__init__.py +0 -0
  14. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/consts/api_routes.py +0 -0
  15. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/__init__.py +0 -0
  16. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/__init__.py +0 -0
  17. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/action_ledger.py +0 -0
  18. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/compact_retry_result.py +0 -0
  19. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/completion_evidence.py +0 -0
  20. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/constants.py +0 -0
  21. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/context_optimizer.py +0 -0
  22. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/encryption.py +0 -0
  23. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/error_patterns.py +0 -0
  24. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/helpers/__init__.py +0 -0
  25. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/helpers/chunking.py +0 -0
  26. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/helpers/recent_actions.py +0 -0
  27. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/helpers/secrets.py +0 -0
  28. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/helpers/tool_result.py +0 -0
  29. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/helpers/xml_safety.py +0 -0
  30. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/mixins/__init__.py +0 -0
  31. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/mixins/map_reduce.py +0 -0
  32. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/context_optimizer/workspace_cache.py +0 -0
  33. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/module_base.py +0 -0
  34. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/state.py +0 -0
  35. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/core/xpander_api_client.py +0 -0
  36. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/exceptions/__init__.py +0 -0
  37. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/exceptions/module_exception.py +0 -0
  38. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/__init__.py +0 -0
  39. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/action_ledger.py +0 -0
  40. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/activity.py +0 -0
  41. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/compactization.py +0 -0
  42. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/configuration.py +0 -0
  43. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/deep_planning.py +0 -0
  44. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/events.py +0 -0
  45. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/frameworks.py +0 -0
  46. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/generic.py +0 -0
  47. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/notifications.py +0 -0
  48. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/orchestrations.py +0 -0
  49. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/shared.py +0 -0
  50. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/models/user.py +0 -0
  51. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/__init__.py +0 -0
  52. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/__init__.py +0 -0
  53. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/agents_module.py +0 -0
  54. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/models/__init__.py +0 -0
  55. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/models/agent_list.py +0 -0
  56. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/models/knowledge_bases.py +0 -0
  57. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/sub_modules/__init__.py +0 -0
  58. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/sub_modules/agent.py +0 -0
  59. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/utils/__init__.py +0 -0
  60. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/agents/utils/generic.py +0 -0
  61. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/__init__.py +0 -0
  62. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/backend_module.py +0 -0
  63. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/decorators/__init__.py +0 -0
  64. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/decorators/on_auth_event.py +0 -0
  65. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/events_registry.py +0 -0
  66. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/frameworks/__init__.py +0 -0
  67. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/frameworks/dispatch.py +0 -0
  68. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/utils/__init__.py +0 -0
  69. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/utils/extra_headers.py +0 -0
  70. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/utils/mcp_oauth.py +0 -0
  71. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/backend/utils/tool_call_events.py +0 -0
  72. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/__init__.py +0 -0
  73. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/decorators/__init__.py +0 -0
  74. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/decorators/on_boot.py +0 -0
  75. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/decorators/on_shutdown.py +0 -0
  76. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/decorators/on_task.py +0 -0
  77. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/decorators/on_tool.py +0 -0
  78. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/events_module.py +0 -0
  79. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/models/__init__.py +0 -0
  80. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/models/deployments.py +0 -0
  81. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/models/events.py +0 -0
  82. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/streaming_server.py +0 -0
  83. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/utils/__init__.py +0 -0
  84. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/utils/generic.py +0 -0
  85. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/events/utils/git_init.py +0 -0
  86. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/knowledge_bases/__init__.py +0 -0
  87. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/knowledge_bases/knowledge_bases_module.py +0 -0
  88. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/knowledge_bases/models/__init__.py +0 -0
  89. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/knowledge_bases/models/knowledge_bases.py +0 -0
  90. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/knowledge_bases/sub_modules/__init__.py +0 -0
  91. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base.py +0 -0
  92. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base_document_item.py +0 -0
  93. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/knowledge_bases/utils/__init__.py +0 -0
  94. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/__init__.py +0 -0
  95. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/models/__init__.py +0 -0
  96. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/models/task.py +0 -0
  97. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/models/tasks_list.py +0 -0
  98. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/sub_modules/__init__.py +0 -0
  99. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/sub_modules/task.py +0 -0
  100. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/tasks_module.py +0 -0
  101. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/utils/__init__.py +0 -0
  102. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tasks/utils/files.py +0 -0
  103. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/__init__.py +0 -0
  104. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/decorators/__init__.py +0 -0
  105. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/decorators/register_tool.py +0 -0
  106. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/models/__init__.py +0 -0
  107. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/models/mcp.py +0 -0
  108. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/models/tool_invocation_result.py +0 -0
  109. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/sub_modules/__init__.py +0 -0
  110. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/sub_modules/tool.py +0 -0
  111. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/tools_repository_module.py +0 -0
  112. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/utils/__init__.py +0 -0
  113. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/utils/generic.py +0 -0
  114. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/utils/local_tools.py +0 -0
  115. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/utils/schemas.py +0 -0
  116. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/modules/tools_repository/utils/workspace_payload.py +0 -0
  117. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/utils/__init__.py +0 -0
  118. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/utils/agents/__init__.py +0 -0
  119. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/utils/env.py +0 -0
  120. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/utils/event_loop.py +0 -0
  121. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/utils/generic.py +0 -0
  122. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk/utils/tools.py +0 -0
  123. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk.egg-info/SOURCES.txt +0 -0
  124. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk.egg-info/dependency_links.txt +0 -0
  125. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk.egg-info/requires.txt +0 -0
  126. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/src/xpander_sdk.egg-info/top_level.txt +0 -0
  127. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_action_ledger_dedup.py +0 -0
  128. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_boot_shutdown_handlers.py +0 -0
  129. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_context_optimizer_chunked.py +0 -0
  130. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_context_optimizer_perf.py +0 -0
  131. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_context_optimizer_recent_actions.py +0 -0
  132. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_context_optimizer_unwrap.py +0 -0
  133. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_context_optimizer_window.py +0 -0
  134. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_context_window_detection.py +0 -0
  135. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_layer_1_cache_integration.py +0 -0
  136. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_reasoning_plan_task_id.py +0 -0
  137. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_tool_call_events.py +0 -0
  138. {xpander_sdk-2.0.330 → xpander_sdk-2.0.332}/tests/test_workspace_cache.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xpander-sdk
3
- Version: 2.0.330
3
+ Version: 2.0.332
4
4
  Summary: xpander.ai Backend-as-a-service for AI Agents - SDK
5
5
  Home-page: https://www.xpander.ai
6
6
  Author: xpanderAI
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="xpander-sdk",
8
- version="2.0.330",
8
+ version="2.0.332",
9
9
  author="xpanderAI",
10
10
  author_email="dev@xpander.ai",
11
11
  description="xpander.ai Backend-as-a-service for AI Agents - SDK",
@@ -15,7 +15,7 @@ Main Components:
15
15
  For more information, visit: https://xpander.ai
16
16
  """
17
17
 
18
- __version__ = "2.0.330"
18
+ __version__ = "2.0.332"
19
19
 
20
20
  # Backend-related imports
21
21
  from .modules.backend.backend_module import Backend
@@ -47,33 +47,23 @@ FinalizeReason = Literal[
47
47
  # already contains every WRITE/VERIFY entry the agent needs.
48
48
  FINALIZE_ONLY_SYSTEM_OVERRIDE = """
49
49
  <finalize_only_mode>
50
- The system has determined this task must finalize NOW. Reasons can include:
51
- context budget exhausted, compaction loop detected, or durable evidence shows
52
- the work is already done.
53
-
54
- ABSOLUTE RULES:
55
- 1. The ONLY mutation tool you may call is `xpfinalize_task`. Every other
56
- mutation tool (writes, exec, HTTP POST, etc.) will be rejected with a
57
- synthetic error message do not retry them.
58
- 2. Read-only escape hatch: you MAY call `xpget_agent_plan`,
59
- `xpworkspace-context-retrieve`, or `xpworkspace-file-read` if you need
60
- to look up a value before composing the final answer (e.g. retrieve an
61
- offloaded payload from earlier). Use these sparingly and only for
62
- read-only lookups; do NOT use them as a way to keep working.
63
- 3. Read the `<authoritative_ledger>` block in the resume message. It lists
64
- every WRITE you already executed and every VERIFY that confirmed it.
65
- 4. Compose a concise final answer summarizing what was accomplished, citing
66
- the verified targets (table names, row counts, file paths).
67
- 5. Mark every plan item the ledger evidence covers as completed by passing
68
- their ids in `xpfinalize_task(payload={"completed_items": [...], ...})`.
69
- Do NOT call `xpcomplete_agent_plan_items` separately.
70
- 6. Pass the final answer inside the payload:
71
- `xpfinalize_task(payload={"final_answer": "...", "completed_items": [...],
72
- "headers": {"toolcallreasoningtitle": "...", "toolcallreasoningdescription":
73
- "..."}})`. The tool sets `task.result` and ends the run.
74
- 7. If you genuinely have nothing to report (no evidence, no plan items),
75
- call `xpfinalize_task(payload={"final_answer": "<short status>",
76
- "headers": {...}})` anyway — the task must terminate.
50
+ The system determined this task must finalize NOW (context budget exhausted, a
51
+ compaction loop detected, or durable evidence the work is already done).
52
+ - The ONLY mutation tool you may call is `xpfinalize_task`. Every other mutation
53
+ tool (writes, exec, HTTP POST, etc.) is rejected with a synthetic error — do not retry it.
54
+ - Read-only escape hatch: you MAY call `xpget_agent_plan`,
55
+ `xpworkspace-context-retrieve`, or `xpworkspace-file-read` to look up a value
56
+ before answering (e.g. an offloaded payload). Use sparingly not to keep working.
57
+ - Read the `<authoritative_ledger>` block in the resume message; it lists every
58
+ WRITE you executed and every VERIFY that confirmed it.
59
+ - Compose a concise final answer citing the verified targets (table names, row
60
+ counts, file paths). Pass everything in ONE call:
61
+ `xpfinalize_task(payload={"final_answer": "...", "completed_items": [<ids the
62
+ ledger covers>], "headers": {"toolcallreasoningtitle": "...",
63
+ "toolcallreasoningdescription": "..."}})`. This sets `task.result` and ends the
64
+ run do NOT call `xpcomplete_agent_plan_items` separately.
65
+ - If you genuinely have nothing to report, still call `xpfinalize_task` with a
66
+ short-status `final_answer` the task must terminate.
77
67
  </finalize_only_mode>
78
68
  """
79
69
 
@@ -33,70 +33,55 @@ RECENT_ACTION_ENTRY_TEMPLATE = """\
33
33
 
34
34
 
35
35
  AUTO_COMPACT_USER_PROMPT_TEMPLATE = """\
36
- You are compacting an in-progress agent session into a binding state artifact that the
37
- resuming agent will treat as AUTHORITATIVE. The resuming agent will be told NOT to
38
- re-do anything you list under <work_completed>, NOT to relitigate decisions in
39
- <decisions_made>, and NOT to re-fetch values listed in <data_gathered>. Be precise.
36
+ You are compacting an in-progress agent session into a binding state artifact the resuming
37
+ agent will treat as AUTHORITATIVE: it will NOT re-do <work_completed>, NOT relitigate
38
+ <decisions_made>, NOT re-fetch <data_gathered>. Be precise.
40
39
 
41
- Here is the conversation history to summarize:
40
+ Conversation to summarize:
42
41
  <conversation>
43
42
  {conversation}
44
43
  </conversation>
45
44
 
46
- Output a single XML-tagged artifact with EXACTLY these sections in this order. No
47
- markdown headings, no preamble, no closing remarks, no commentary outside tags.
45
+ Output ONE XML-tagged artifact with EXACTLY these sections in this order — no markdown
46
+ headings, no preamble, no commentary outside tags.
48
47
 
49
48
  <work_completed>
50
- One bullet per concrete action that produced an output. Format each line as:
51
- - <verb> <target> <observed result>
52
- The <target> MUST be an exact identifier (file path, URL, ID, function name, command).
53
- The <observed result> MUST be a verifiable outcome the agent can trust later.
54
- Examples:
55
- - Edited /src/auth/middleware.py:42-58 — replaced expiry check `<` with `<=`, pytest tests/auth passed (47/0)
56
- - Created KB document doc_id=4f1e2... with 4 chunks from spec.pdf
57
- - Ran command `pytest tests/integration` — exit=0, 23 passed
58
- Use one bullet per action. Be exhaustive — anything missing here is something the
59
- resuming agent will redo.
49
+ One bullet per concrete action that produced an output: "- <verb> <target> — <observed result>".
50
+ <target> is an exact identifier (file path, URL, ID, function, command); <observed result> is a
51
+ verifiable outcome. e.g. "- Edited /src/auth/middleware.py:42-58 changed `<` to `<=`, pytest 47/0".
52
+ Be exhaustive anything missing here gets redone.
60
53
  </work_completed>
61
54
 
62
55
  <decisions_made>
63
- One line per choice or fact the agent has committed to. The resuming agent will NOT
64
- relitigate these. Examples:
65
- - chose JWT over session cookies (user confirmed in turn 3)
66
- - target Python version is 3.9, not 3.11 (per setup.py)
67
- Only include decisions that affect future actions.
56
+ One line per committed choice/fact that affects future actions; the resuming agent will NOT
57
+ relitigate these. e.g. "- chose JWT over session cookies (user confirmed turn 3)".
68
58
  </decisions_made>
69
59
 
70
60
  <data_gathered>
71
- Verbatim opaque values, IDs, schemas, snippets the agent retrieved that may be needed
72
- again. The resuming agent will look here BEFORE re-fetching. Format:
73
- - <kind> <identifier>: <value or summary> (source: <where it came from>)
74
- Examples:
75
- - org id: 7f1c... (source: GET /orgs/me)
76
- - file /src/config.py lines 1-20: <verbatim snippet> (source: file-read)
77
- Preserve identifiers EXACTLY as written. Do not shorten, normalize, or reconstruct.
61
+ Verbatim opaque values, IDs, schemas, snippets that may be needed again — looked up here BEFORE
62
+ re-fetching. Format "- <kind> <identifier>: <value or summary> (source: <where>)". Preserve
63
+ identifiers EXACTLY do not shorten, normalize, or reconstruct.
78
64
  </data_gathered>
79
65
 
80
66
  <user_requests_verbatim>
81
- Every user message verbatim, oldest first, one per line prefixed with the turn marker.
82
- Critical — non-negotiable preservation. Do NOT paraphrase. Do NOT attribute assistant
83
- suggestions as user preferences.
67
+ Every user message verbatim, oldest first, one per line with its turn marker. Non-negotiable: do
68
+ NOT paraphrase, do NOT attribute assistant suggestions as user preferences.
84
69
  </user_requests_verbatim>
85
70
 
86
71
  <open_questions>
87
- Anything the agent asked the user that is unanswered, OR ambiguities the agent flagged
88
- but did not resolve. One per line.
72
+ Anything the agent asked the user that is unanswered, or ambiguities flagged but unresolved.
73
+ One per line.
89
74
  </open_questions>
90
75
 
91
76
  <current_focus>
92
- One short paragraph: what the agent was doing in the LAST 1-2 turns of <conversation>,
93
- with a direct quote from the most recent assistant message. Do NOT speculate forward.
77
+ One short paragraph: what the agent was doing in the LAST 1-2 turns of <conversation>, with a
78
+ direct quote from the most recent assistant message. Do NOT speculate forward.
94
79
  </current_focus>
95
80
 
96
81
  <next_action>
97
- Single concrete next step: tool to call OR file to edit OR question to ask. MUST be
98
- verbatim from the most recent plan/user direction in <conversation>. Do NOT invent
99
- steps the user did not request and the plan does not require.
82
+ Single concrete next step (tool to call, file to edit, or question to ask), verbatim from the most
83
+ recent plan/user direction in <conversation>. Do NOT invent steps the user did not request and the
84
+ plan does not require.
100
85
  </next_action>
101
86
  {plan_section}
102
87
  HARD RULES (violations make the artifact useless to the resuming agent):
@@ -121,24 +106,20 @@ and contains ALL data, findings, and work products from the earlier session.
121
106
  </state>
122
107
  {authoritative_ledger_block}
123
108
  <binding_rules>
124
- 1. Treat <work_completed> as DONE. Do NOT re-run, re-verify, re-fetch, or re-edit
125
- anything listed there unless the user explicitly asks you to. Trust the observed
126
- results recorded inline.
127
- 2. Treat <data_gathered> as available. Do NOT re-fetch identifiers, IDs, schemas, or
128
- snippets listed there. If you need a value, look in <state> first.
109
+ 1. Treat <work_completed> as DONE do NOT re-run, re-verify, re-fetch, or re-edit
110
+ anything listed there unless the user explicitly asks. Trust the recorded results.
111
+ 2. Treat <data_gathered> as available — do NOT re-fetch listed IDs, schemas, or
112
+ snippets; look in <state> first.
129
113
  3. Treat <decisions_made> as final. Do NOT relitigate or propose alternatives.
130
114
  4. The plan section below shows completed tasks. Continue from <next_action>.
131
115
  5. Do NOT ask the user any questions about prior context — it is in <state>.
132
- 6. Continue execution. Do NOT stop until the plan is complete.
133
- 7. <authoritative_ledger> is the durable record of every tool call this task
134
- already executed. Do NOT blindly repeat a completed mutation just because
135
- you lost conversational context — if a WRITE entry shows status="ok" for
136
- the same tool + target + arguments you are about to invoke, that exact
137
- operation is already done. You MAY perform additional, distinct mutations
138
- on the same target when the current plan or the user explicitly requires
139
- them (e.g. a sequence of file edits, multiple appends, follow-up inserts).
140
- The ledger is ground truth over your recollection of the conversation —
141
- it survives compaction unchanged.
116
+ 6. Continue execution; do NOT stop until the plan is complete.
117
+ 7. <authoritative_ledger> is the durable record of every tool call this task already
118
+ executed. Do NOT repeat a completed mutation just because you lost conversational
119
+ context — a WRITE entry with status="ok" for the same tool + target + arguments is
120
+ already done. You MAY perform additional, distinct mutations the plan or user
121
+ requires (a sequence of edits, multiple appends, follow-up inserts). The ledger is
122
+ ground truth over recollection; it survives compaction unchanged.
142
123
  </binding_rules>
143
124
  {recent_actions_block}
144
125
  {backup_pointer}
@@ -357,23 +357,6 @@ class AgentGraphItemSettings(BaseModel):
357
357
  skills_settings: Optional[AgentGraphItemSkillsSettings] = None
358
358
 
359
359
 
360
- class AgentGraphItemLLMSettings(BaseModel):
361
- """
362
- Model for LLM (Large Language Model) settings in agent graph items.
363
-
364
- Attributes:
365
- type (Literal["before", "after"]): When to apply LLM processing.
366
- provider (Optional[str]): LLM provider name, defaults to "openai".
367
- model (Optional[str]): Specific model name, defaults to "gpt-4.1".
368
- temperature (Optional[float]): Model temperature setting, defaults to 0.0.
369
- """
370
-
371
- type: Literal["before", "after"]
372
- provider: Optional[str] = "openai"
373
- model: Optional[str] = "gpt-4.1"
374
- temperature: Optional[float] = 0.0
375
-
376
-
377
360
  class AgentGraphItem(BaseModel):
378
361
  """
379
362
  Model representing a single item in an agent's execution graph.
@@ -389,7 +372,6 @@ class AgentGraphItem(BaseModel):
389
372
  sub_type (Optional[AgentGraphItemSubType]): Subtype for more specific categorization.
390
373
  targets (List[str]): List of target graph item IDs for execution flow.
391
374
  settings (Optional[AgentGraphItemSettings]): Configuration settings for the item.
392
- llm_settings (Optional[List[AgentGraphItemLLMSettings]]): LLM processing settings.
393
375
  is_first (Optional[bool]): Whether this is the first item in the execution graph.
394
376
  """
395
377
 
@@ -400,7 +382,6 @@ class AgentGraphItem(BaseModel):
400
382
  sub_type: Optional[AgentGraphItemSubType] = None
401
383
  targets: List[str]
402
384
  settings: Optional[AgentGraphItemSettings] = None
403
- llm_settings: Optional[List[AgentGraphItemLLMSettings]] = []
404
385
  is_first: Optional[bool] = False
405
386
 
406
387