tactus 0.35.0__py3-none-any.whl → 0.35.1__py3-none-any.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.
tactus/__init__.py CHANGED
@@ -5,7 +5,7 @@ Tactus provides a declarative workflow engine for AI agents with pluggable
5
5
  backends for storage, HITL, and chat recording.
6
6
  """
7
7
 
8
- __version__ = "0.35.0"
8
+ __version__ = "0.35.1"
9
9
 
10
10
  # Core exports
11
11
  from tactus.core.runtime import TactusRuntime
@@ -102,7 +102,7 @@ class HostControlChannel(InProcessChannel):
102
102
 
103
103
  # Start background thread for input collection
104
104
  self._input_thread = threading.Thread(
105
- target=self._input_thread_main,
105
+ target=self._collect_input_in_thread,
106
106
  args=(request,),
107
107
  daemon=True,
108
108
  )
@@ -142,7 +142,7 @@ class HostControlChannel(InProcessChannel):
142
142
  if self._input_thread and self._input_thread.is_alive():
143
143
  self._input_thread.join(timeout=1.0)
144
144
 
145
- def _input_thread_main(self, request: ControlRequest) -> None:
145
+ def _collect_input_in_thread(self, request: ControlRequest) -> None:
146
146
  """
147
147
  Background thread main function.
148
148
 
@@ -154,32 +154,38 @@ class HostControlChannel(InProcessChannel):
154
154
  """
155
155
  try:
156
156
  # Collect input (may block)
157
- response_value = self._prompt_for_input(request)
157
+ user_response_value = self._prompt_for_input(request)
158
158
 
159
159
  # Check if cancelled while waiting
160
160
  if self._cancel_event.is_set():
161
161
  return
162
162
 
163
- if response_value is not None:
164
- # Create response and push to queue
165
- response = ControlResponse(
166
- request_id=request.request_id,
167
- value=response_value,
168
- responded_at=datetime.now(timezone.utc),
169
- timed_out=False,
170
- channel_id=self.channel_id,
171
- )
172
-
173
- # Push thread-safe
174
- if self._event_loop:
175
- self.push_response_threadsafe(response, self._event_loop)
176
- else:
177
- self.push_response(response)
163
+ if user_response_value is not None:
164
+ response = self._build_response(request, user_response_value)
165
+ self._push_response_from_thread(response)
178
166
 
179
167
  except Exception as error:
180
168
  if not self._cancel_event.is_set():
181
169
  logger.error("%s: input error: %s", self.channel_id, error)
182
170
 
171
+ def _input_thread_main(self, request: ControlRequest) -> None:
172
+ self._collect_input_in_thread(request)
173
+
174
+ def _build_response(self, request: ControlRequest, response_value: Any) -> ControlResponse:
175
+ return ControlResponse(
176
+ request_id=request.request_id,
177
+ value=response_value,
178
+ responded_at=datetime.now(timezone.utc),
179
+ timed_out=False,
180
+ channel_id=self.channel_id,
181
+ )
182
+
183
+ def _push_response_from_thread(self, response: ControlResponse) -> None:
184
+ if self._event_loop:
185
+ self.push_response_threadsafe(response, self._event_loop)
186
+ else:
187
+ self.push_response(response)
188
+
183
189
  @abstractmethod
184
190
  def _display_request(self, request: ControlRequest) -> None:
185
191
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tactus
3
- Version: 0.35.0
3
+ Version: 0.35.1
4
4
  Summary: Tactus: Lua-based DSL for agentic workflows
5
5
  Project-URL: Homepage, https://github.com/AnthusAI/Tactus
6
6
  Project-URL: Documentation, https://github.com/AnthusAI/Tactus/tree/main/docs
@@ -68,6 +68,7 @@ Description-Content-Type: text/markdown
68
68
 
69
69
  ![Continuous integration][continuous-integration-badge]
70
70
  ![Coverage][coverage-badge]
71
+ [![Documentation][documentation-badge]][documentation-link]
71
72
 
72
73
  **A programming language for reliable, tool-using AI agents.**
73
74
 
@@ -1830,3 +1831,5 @@ MIT License - see LICENSE file for details.
1830
1831
 
1831
1832
  [continuous-integration-badge]: https://github.com/AnthusAI/Tactus/actions/workflows/release.yml/badge.svg?branch=main
1832
1833
  [coverage-badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FAnthusAI%2FTactus%2Fmain%2Fcoverage_badge.json
1834
+ [documentation-badge]: https://img.shields.io/badge/docs-GitHub%20Pages-blue
1835
+ [documentation-link]: https://anthusai.github.io/Tactus/
@@ -1,4 +1,4 @@
1
- tactus/__init__.py,sha256=TLJbK9I-_38F3ieSk4YYBBrUy1C9RY1OTfxYYNTNxrc,1245
1
+ tactus/__init__.py,sha256=Y-1dJ93uEEgT5ANpQX755nyr6_Rdo1eup46JRhORocE,1245
2
2
  tactus/adapters/__init__.py,sha256=47Y8kGBR4QGxqEGvjA1mneOSACb2L7oELnj6P2uI7uk,759
3
3
  tactus/adapters/broker_log.py,sha256=9ZR-rJdyW6bMNZx3OfXoQEnDxcAzNsiJ8aPxZGqJYrM,6019
4
4
  tactus/adapters/cli_hitl.py,sha256=Nrfoi35Ei9fTMReLG2QxKkhKyIvl3pYcAUdQCAUOZDk,17361
@@ -17,7 +17,7 @@ tactus/adapters/channels/__init__.py,sha256=oh1ymJmP8Lalq6JSDnXEnPdKMiPosAuqiUYF
17
17
  tactus/adapters/channels/base.py,sha256=zKzGMkmL465RjWvc27aYDsgdkNA9CThgh_hd5mEJgvg,5584
18
18
  tactus/adapters/channels/broker.py,sha256=jXoTvjlOhCS96nHacoK5K7HbytZCXleZl_f-SvG3q5c,7431
19
19
  tactus/adapters/channels/cli.py,sha256=lC4WcUuVZD7ik5DkKDmaHTzA2axfnH7yKhWvAH55MuQ,16847
20
- tactus/adapters/channels/host.py,sha256=1ytWVTqTiVlzZsFiKZPT9dWgIp6DvXiV0t9hFFigayk,7594
20
+ tactus/adapters/channels/host.py,sha256=3sTvseD9UZ30D8_5RE8Bbj26iZYKK2CdavJDu-Rse9A,7862
21
21
  tactus/adapters/channels/ipc.py,sha256=xKcYERNA_UNoVHDktmOELpgRSQ7c6omZ6z177AstvVU,11749
22
22
  tactus/adapters/channels/sse.py,sha256=d7ztbZXchX-G9nYmGgqGVkX4nfkXgPbFZ1cAK0AG8oM,11318
23
23
  tactus/backends/http_backend.py,sha256=QZEAGdaKhdjmrLbT2kR5O_hgkER5_fhA2Wax9I6S3yA,1652
@@ -206,8 +206,8 @@ tactus/validation/generated/LuaParserVisitor.py,sha256=ageKSmHPxnO3jBS2fBtkmYBOd
206
206
  tactus/validation/generated/__init__.py,sha256=5gWlwRI0UvmHw2fnBpj_IG6N8oZeabr5tbj1AODDvjc,196
207
207
  tactus/validation/grammar/LuaLexer.g4,sha256=t2MXiTCr127RWAyQGvamkcU_m4veqPzSuHUtAKwalw4,2771
208
208
  tactus/validation/grammar/LuaParser.g4,sha256=ceZenb90BdiZmVdOxMGj9qJk3QbbWVZe5HUqPgoePfY,3202
209
- tactus-0.35.0.dist-info/METADATA,sha256=8gtDmbFYwzxEcYoUw7sFchxE7ab0N2DMjKlgQ14MCHQ,59903
210
- tactus-0.35.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
211
- tactus-0.35.0.dist-info/entry_points.txt,sha256=vWseqty8m3z-Worje0IYxlioMjPDCoSsm0AtY4GghBY,47
212
- tactus-0.35.0.dist-info/licenses/LICENSE,sha256=ivohBcAIYnaLPQ-lKEeCXSMvQUVISpQfKyxHBHoa4GA,1066
213
- tactus-0.35.0.dist-info/RECORD,,
209
+ tactus-0.35.1.dist-info/METADATA,sha256=F7RHcNpRlPNCIu6CNRtE0JFjIhfEcLrDFwRx-WcikNg,60097
210
+ tactus-0.35.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
211
+ tactus-0.35.1.dist-info/entry_points.txt,sha256=vWseqty8m3z-Worje0IYxlioMjPDCoSsm0AtY4GghBY,47
212
+ tactus-0.35.1.dist-info/licenses/LICENSE,sha256=ivohBcAIYnaLPQ-lKEeCXSMvQUVISpQfKyxHBHoa4GA,1066
213
+ tactus-0.35.1.dist-info/RECORD,,