toolang 0.2.4__tar.gz → 0.2.5__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 (222) hide show
  1. {toolang-0.2.4 → toolang-0.2.5}/.gitignore +2 -0
  2. {toolang-0.2.4 → toolang-0.2.5}/PKG-INFO +3 -3
  3. {toolang-0.2.4 → toolang-0.2.5}/README.md +1 -1
  4. {toolang-0.2.4 → toolang-0.2.5}/docs/api.md +29 -2
  5. {toolang-0.2.4 → toolang-0.2.5}/docs/caps.md +1 -1
  6. {toolang-0.2.4 → toolang-0.2.5}/docs/concepts.md +4 -4
  7. {toolang-0.2.4 → toolang-0.2.5}/docs/execution.md +12 -1
  8. {toolang-0.2.4 → toolang-0.2.5}/docs/ids.md +9 -2
  9. {toolang-0.2.4 → toolang-0.2.5}/docs/layout.md +6 -1
  10. {toolang-0.2.4 → toolang-0.2.5}/docs/prepared-lock.md +3 -4
  11. {toolang-0.2.4 → toolang-0.2.5}/docs/program.md +8 -8
  12. {toolang-0.2.4 → toolang-0.2.5}/examples/alice.too +12 -16
  13. toolang-0.2.5/examples/deep_search.too +61 -0
  14. toolang-0.2.5/examples/file-inbox-indexer.too +20 -0
  15. {toolang-0.2.4 → toolang-0.2.5}/examples/invoke-playground.too +7 -7
  16. {toolang-0.2.4 → toolang-0.2.5}/examples/invoke.fixed-model.too +1 -1
  17. {toolang-0.2.4 → toolang-0.2.5}/examples/invoke.openrouter-smoke.too +5 -5
  18. {toolang-0.2.4 → toolang-0.2.5}/examples/invoke.priority.too +1 -1
  19. {toolang-0.2.4 → toolang-0.2.5}/examples/invoke.simulated-history.memory.too +3 -3
  20. {toolang-0.2.4 → toolang-0.2.5}/examples/invoke.simulated-history.none.too +2 -2
  21. toolang-0.2.5/examples/llm-wiki.too +33 -0
  22. {toolang-0.2.4 → toolang-0.2.5}/pyproject.toml +2 -2
  23. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/caps.py +26 -26
  24. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/channels/telegram.py +1 -1
  25. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/invoke.py +468 -128
  26. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/toolang/app.py +1524 -11
  27. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/toolang/fmt.py +1 -1
  28. toolang-0.2.5/src/toolang/cli/toolang/parse.py +66 -0
  29. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/registry.py +6 -3
  30. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/chat.py +9 -3
  31. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/inspect/_shared.py +3 -3
  32. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/inspect/execution.py +1 -1
  33. toolang-0.2.5/src/toolang/components/trigger/files.py +240 -0
  34. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/assembly.py +13 -5
  35. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/binding.py +16 -2
  36. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/context.py +6 -6
  37. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/db.py +92 -7
  38. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/detail.py +15 -1
  39. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/effective.py +84 -76
  40. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/events.py +7 -0
  41. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/execute.py +71 -24
  42. toolang-0.2.5/src/toolang/execution/executor.py +987 -0
  43. toolang-0.2.5/src/toolang/execution/labels.py +181 -0
  44. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/model_call.py +21 -2
  45. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/records.py +121 -2
  46. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/runner.py +1 -0
  47. toolang-0.2.5/src/toolang/file_requests.py +369 -0
  48. toolang-0.2.5/src/toolang/lang/__init__.py +50 -0
  49. toolang-0.2.5/src/toolang/lang/ast.py +254 -0
  50. toolang-0.2.5/src/toolang/lang/diagnostics.py +31 -0
  51. toolang-0.2.4/src/toolang/program_format.py → toolang-0.2.5/src/toolang/lang/format.py +53 -74
  52. toolang-0.2.5/src/toolang/lang/lower.py +1788 -0
  53. toolang-0.2.5/src/toolang/lang/validate.py +267 -0
  54. toolang-0.2.5/src/toolang/program.py +49 -0
  55. toolang-0.2.5/src/toolang/program_format.py +7 -0
  56. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/state/program.py +126 -178
  57. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/agent_chat.py +1 -1
  58. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/filesystem.py +20 -5
  59. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/up.py +65 -2
  60. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/work.py +6 -6
  61. toolang-0.2.5/tests/fixtures/sample.too +17 -0
  62. toolang-0.2.5/tests/fixtures/source_only.too +25 -0
  63. {toolang-0.2.4 → toolang-0.2.5}/tests/test_channels.py +1 -1
  64. {toolang-0.2.4 → toolang-0.2.5}/tests/test_cli.py +1098 -61
  65. toolang-0.2.5/tests/test_flow_execution.py +289 -0
  66. {toolang-0.2.4 → toolang-0.2.5}/tests/test_models.py +1 -1
  67. {toolang-0.2.4 → toolang-0.2.5}/tests/test_program.py +239 -133
  68. {toolang-0.2.4 → toolang-0.2.5}/tests/test_program_format.py +130 -32
  69. {toolang-0.2.4 → toolang-0.2.5}/tests/test_run_queue_runner.py +273 -122
  70. {toolang-0.2.4 → toolang-0.2.5}/tests/test_tools.py +31 -12
  71. {toolang-0.2.4 → toolang-0.2.5}/uv.lock +10 -10
  72. toolang-0.2.4/src/toolang/program.py +0 -1177
  73. toolang-0.2.4/syntax.too +0 -352
  74. toolang-0.2.4/tests/fixtures/sample.too +0 -20
  75. toolang-0.2.4/tests/fixtures/source_only.too +0 -33
  76. {toolang-0.2.4 → toolang-0.2.5}/.github/workflows/publish-pypi.yml +0 -0
  77. {toolang-0.2.4 → toolang-0.2.5}/AGENTS.md +0 -0
  78. {toolang-0.2.4 → toolang-0.2.5}/LICENSE +0 -0
  79. {toolang-0.2.4 → toolang-0.2.5}/docs/chat.md +0 -0
  80. {toolang-0.2.4 → toolang-0.2.5}/docs/index.md +0 -0
  81. {toolang-0.2.4 → toolang-0.2.5}/docs/models.md +0 -0
  82. {toolang-0.2.4 → toolang-0.2.5}/docs/plugins.md +0 -0
  83. {toolang-0.2.4 → toolang-0.2.5}/docs/selectors.md +0 -0
  84. {toolang-0.2.4 → toolang-0.2.5}/docs/tasks.md +0 -0
  85. {toolang-0.2.4 → toolang-0.2.5}/docs/tools.md +0 -0
  86. {toolang-0.2.4 → toolang-0.2.5}/docs/webui-jobs.md +0 -0
  87. {toolang-0.2.4 → toolang-0.2.5}/reference/README.md +0 -0
  88. {toolang-0.2.4 → toolang-0.2.5}/reference/build.py +0 -0
  89. {toolang-0.2.4 → toolang-0.2.5}/reference/config.toml +0 -0
  90. {toolang-0.2.4 → toolang-0.2.5}/reference/templates/index.html.jinja2 +0 -0
  91. {toolang-0.2.4 → toolang-0.2.5}/reference/templates/module.html.jinja2 +0 -0
  92. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/__init__.py +0 -0
  93. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/agents.py +0 -0
  94. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/__init__.py +0 -0
  95. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/error.py +0 -0
  96. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/examples/__init__.py +0 -0
  97. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/examples/tools.py +0 -0
  98. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/protocols/__init__.py +0 -0
  99. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/protocols/channel.py +0 -0
  100. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/protocols/loop.py +0 -0
  101. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/protocols/model.py +0 -0
  102. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/protocols/sandbox.py +0 -0
  103. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/protocols/tool.py +0 -0
  104. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/types/__init__.py +0 -0
  105. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/types/channel.py +0 -0
  106. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/types/message.py +0 -0
  107. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/types/model.py +0 -0
  108. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/types/run.py +0 -0
  109. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/types/sandbox.py +0 -0
  110. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/types/tool.py +0 -0
  111. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/utils/__init__.py +0 -0
  112. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/utils/channels.py +0 -0
  113. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/utils/function_tools.py +0 -0
  114. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/utils/tools.py +0 -0
  115. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/base/utils/typer_tools.py +0 -0
  116. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/channels/__init__.py +0 -0
  117. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/__init__.py +0 -0
  118. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/__main__.py +0 -0
  119. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/caps/__init__.py +0 -0
  120. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/caps/__main__.py +0 -0
  121. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/caps/app.py +0 -0
  122. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/caps/commands.py +0 -0
  123. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/logo.py +0 -0
  124. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/progress.py +0 -0
  125. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/toolang/__init__.py +0 -0
  126. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/toolang/__main__.py +0 -0
  127. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/toolang/caps.py +0 -0
  128. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/cli/utils.py +0 -0
  129. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/common/__init__.py +0 -0
  130. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/common/ids.py +0 -0
  131. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/common/progress.py +0 -0
  132. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/common/template.py +0 -0
  133. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/__init__.py +0 -0
  134. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/__init__.py +0 -0
  135. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/_streaming.py +0 -0
  136. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/inspect/__init__.py +0 -0
  137. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/inspect/agent.py +0 -0
  138. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/inspect/caps.py +0 -0
  139. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/inspect/jobs.py +0 -0
  140. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/inspect/router.py +0 -0
  141. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/manage/__init__.py +0 -0
  142. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/manage/caps.py +0 -0
  143. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/manage/jobs.py +0 -0
  144. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/router/manage/router.py +0 -0
  145. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/runner/__init__.py +0 -0
  146. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/trigger/__init__.py +0 -0
  147. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/trigger/poll.py +0 -0
  148. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/trigger/pulse.py +0 -0
  149. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/components/trigger/watch.py +0 -0
  150. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/config/__init__.py +0 -0
  151. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/config/env.py +0 -0
  152. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/config/log.py +0 -0
  153. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/config/log_spec.py +0 -0
  154. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/config/plugins.py +0 -0
  155. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/config/web.py +0 -0
  156. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/__init__.py +0 -0
  157. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/input.py +0 -0
  158. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/model.py +0 -0
  159. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/prompts/__init__.py +0 -0
  160. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/prompts/context.default.md +0 -0
  161. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/prompts/instruct.default.md +0 -0
  162. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/response.py +0 -0
  163. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/execution/stream.py +0 -0
  164. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/jobs.py +0 -0
  165. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/loops/__init__.py +0 -0
  166. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/loops/basic.py +0 -0
  167. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/__init__.py +0 -0
  168. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/adapters/__init__.py +0 -0
  169. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/adapters/chat_completions.py +0 -0
  170. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/adapters/responses.py +0 -0
  171. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/config.py +0 -0
  172. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/discovery.py +0 -0
  173. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/errors.py +0 -0
  174. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/providers/__init__.py +0 -0
  175. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/providers/custom.py +0 -0
  176. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/providers/deepseek.py +0 -0
  177. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/providers/google.py +0 -0
  178. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/providers/ollama.py +0 -0
  179. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/providers/openai.py +0 -0
  180. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/providers/openrouter.py +0 -0
  181. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/resolution.py +0 -0
  182. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/models/views.py +0 -0
  183. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/plugin.py +0 -0
  184. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/sandboxes/__init__.py +0 -0
  185. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/sandboxes/docker.py +0 -0
  186. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/sandboxes/none.py +0 -0
  187. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/selectors.py +0 -0
  188. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/state/__init__.py +0 -0
  189. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/state/durable.py +0 -0
  190. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/state/live.py +0 -0
  191. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/state/prepared.py +0 -0
  192. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/__init__.py +0 -0
  193. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/agent.default.too +0 -0
  194. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/chore.default.md +0 -0
  195. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/prompt.default.md +0 -0
  196. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/psyche.default.md +0 -0
  197. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/service.default.md +0 -0
  198. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/service.stdio.md +0 -0
  199. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/skill.default.md +0 -0
  200. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/templates/task.default.md +0 -0
  201. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/__init__.py +0 -0
  202. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/agent_state.py +0 -0
  203. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/registry.py +0 -0
  204. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/service_use.py +0 -0
  205. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/shell.py +0 -0
  206. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/views.py +0 -0
  207. {toolang-0.2.4 → toolang-0.2.5}/src/toolang/tools/web_search.py +0 -0
  208. {toolang-0.2.4 → toolang-0.2.5}/tests/fixtures/remote-prompt/rewrite.md +0 -0
  209. {toolang-0.2.4 → toolang-0.2.5}/tests/fixtures/remote-psyche/reviewer.md +0 -0
  210. {toolang-0.2.4 → toolang-0.2.5}/tests/fixtures/remote-service/github.md +0 -0
  211. {toolang-0.2.4 → toolang-0.2.5}/tests/fixtures/remote-skill/pdf-processing/SKILL.md +0 -0
  212. {toolang-0.2.4 → toolang-0.2.5}/tests/fixtures/remote-skill/pdf-processing/assets/template.md +0 -0
  213. {toolang-0.2.4 → toolang-0.2.5}/tests/test_agent_state_tool.py +0 -0
  214. {toolang-0.2.4 → toolang-0.2.5}/tests/test_execution_template.py +0 -0
  215. {toolang-0.2.4 → toolang-0.2.5}/tests/test_ids.py +0 -0
  216. {toolang-0.2.4 → toolang-0.2.5}/tests/test_log_config.py +0 -0
  217. {toolang-0.2.4 → toolang-0.2.5}/tests/test_plugin_tools.py +0 -0
  218. {toolang-0.2.4 → toolang-0.2.5}/tests/test_prepared.py +0 -0
  219. {toolang-0.2.4 → toolang-0.2.5}/tests/test_sandboxes.py +0 -0
  220. {toolang-0.2.4 → toolang-0.2.5}/tests/test_selectors.py +0 -0
  221. {toolang-0.2.4 → toolang-0.2.5}/tests/test_typer_tools.py +0 -0
  222. {toolang-0.2.4 → toolang-0.2.5}/tests/test_work.py +0 -0
@@ -21,3 +21,5 @@ wheels/
21
21
  archive/
22
22
  scratch/
23
23
  reference/generated/
24
+
25
+ .zed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toolang
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: A programming language and runtime for agents
5
5
  Project-URL: Homepage, https://toolang.ai/
6
6
  Project-URL: Documentation, https://toolang.ai/docs
@@ -224,7 +224,7 @@ Requires-Dist: python-dotenv<2,>=1.0
224
224
  Requires-Dist: python-frontmatter>=1.1.0
225
225
  Requires-Dist: rich<15,>=14
226
226
  Requires-Dist: tomli-w>=1.2.0
227
- Requires-Dist: tree-sitter-toolang>=0.0.16
227
+ Requires-Dist: tree-sitter-toolang>=0.1.3
228
228
  Requires-Dist: tree-sitter<0.26,>=0.24
229
229
  Requires-Dist: typer<1,>=0.16
230
230
  Requires-Dist: uvicorn<1,>=0.35
@@ -237,7 +237,7 @@ Description-Content-Type: text/markdown
237
237
 
238
238
  # Toolang
239
239
 
240
- A programming language and runtime for agents.
240
+ A description language and runtime for agents.
241
241
 
242
242
  Tool calling turned LLMs from chatbots into agents. Toolang makes agents easy to build, run, and share.
243
243
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Toolang
6
6
 
7
- A programming language and runtime for agents.
7
+ A description language and runtime for agents.
8
8
 
9
9
  Tool calling turned LLMs from chatbots into agents. Toolang makes agents easy to build, run, and share.
10
10
 
@@ -82,6 +82,7 @@ toolang list
82
82
  PY_LOG=toolang.run=info toolang ./examples/invoke-playground.too summarize "Summarize this workspace"
83
83
  toolang ./examples/invoke-playground.too --help
84
84
  toolang ./examples/invoke-playground.too summarize "Summarize this workspace"
85
+ toolang ./examples/file-agent.too --inbox ./inbox
85
86
  toolang run alice
86
87
  toolang run brice/alice
87
88
  toolang run https://toolang.ai/alice.too
@@ -136,7 +137,8 @@ Foreground runtime port selection depends on the agent mode:
136
137
  | --- | --- | --- |
137
138
  | Resident | Local managed name such as `alice` | Reuse the agent's last port when available, otherwise choose from `7001-7999` |
138
139
  | Visiting | Remote selector such as `brice/alice` or `https://toolang.ai/alice.too` | Reuse the visiting root's last port when available, otherwise choose an OS temporary port |
139
- | Roaming | Local `.too` path invocation | No HTTP runtime port; the thunk is invoked directly |
140
+ | Roaming invoke | Local `.too` path with a thunk name | No HTTP runtime port; the thunk is invoked directly |
141
+ | Roaming file runtime | Local `.too` path with `--inbox` and no thunk name | Choose an OS temporary port |
140
142
 
141
143
 
142
144
  ## Invoke Surface
@@ -169,9 +171,10 @@ Behavior:
169
171
  - `NAME=VALUE` sets one thunk named param when `NAME` matches the thunk signature
170
172
  - `INPUT` rules:
171
173
  - `TEXT` adds one text part; use `@@TEXT` for literal text beginning with `@`
172
- - `@PATH` adds one path-based part; `.txt` and `.md` paths become text parts
174
+ - `@PATH` adds one path-based part; text-like paths become text parts
173
175
  - image extensions such as `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp`, and `.svg` infer image parts
174
176
  - audio extensions such as `.mp3`, `.wav`, `.m4a`, `.aac`, `.ogg`, and `.flac` infer audio parts
177
+ - video extensions such as `.mp4`, `.mov`, `.m4v`, `.webm`, `.mkv`, `.avi`, `.mpeg`, `.mpg`, `.3gp`, and `.ogv` infer video parts
175
178
  - all other path extensions infer generic file parts
176
179
  - `--` ends option parsing so later arguments stay `INPUT` values
177
180
  - `--option` is reserved for Toolang runtime options
@@ -179,6 +182,30 @@ Behavior:
179
182
  - key execution events are recorded in `runs.db` for script runs just like chat,
180
183
  task, and chore runs
181
184
 
185
+ ## File Request Runtime
186
+
187
+ Roaming scripts can also start a foreground file request runtime without naming
188
+ a thunk:
189
+
190
+ ```bash
191
+ toolang SCRIPT --inbox PATH [--inbox PATH...]
192
+ ```
193
+
194
+ Behavior:
195
+
196
+ - `SCRIPT` is materialized into its sibling `.toolang` roaming root.
197
+ - Each `--inbox` value must name an existing directory.
198
+ - Startup enables `runner.file`, `trigger.file`, and `trigger.watch`.
199
+ - Startup requires a thunk named `file` that accepts message input and has no
200
+ required parameters.
201
+ - Files already present in an inbox at startup are eligible for processing.
202
+ - Newly discovered stable files are passed to the `file` thunk using the same
203
+ file input part rules as `@PATH`.
204
+ - File request progress is stored in `.runtime/files.db`.
205
+ - Finished, failed, and canceled file fingerprints are not automatically retried.
206
+ - When a thunk name is present, such as `toolang SCRIPT file ...`, Toolang uses
207
+ normal one-shot thunk invocation.
208
+
182
209
 
183
210
  ## Runtime Commands
184
211
 
@@ -64,7 +64,7 @@ Scope tells where a cap is available:
64
64
 
65
65
  | Origin | Meaning |
66
66
  | --- | --- |
67
- | `local` | Local authored content, including inline program declarations and local files or directories |
67
+ | `local` | Local authored content, including inline program caps and local files or directories |
68
68
  | `remote` | A remote authored cap fetched through a ref |
69
69
 
70
70
  Runtime APIs expose effective caps. They do not expose every authored source
@@ -93,8 +93,8 @@ Caps are assembled from the materialized root and source:
93
93
  | `visiting` | Inline caps and referenced caps from the materialized remote source |
94
94
  | `roaming` | Source-local `toolang.toml`, inline caps, and referenced caps from the local `.too` source |
95
95
 
96
- Caps do not have a separate placement allowlist. A program declaration or
97
- reference makes a cap available to that program, but it does not make the cap
96
+ Caps do not have a separate placement allowlist. A program cap or reference
97
+ makes a cap available to that program, but it does not make the cap
98
98
  effective for every thunk by itself.
99
99
 
100
100
 
@@ -159,8 +159,8 @@ through ordered sets.
159
159
  Placement provides a default resource set. CLI options may override or adjust
160
160
  that default for one activation. The result is the activation set.
161
161
 
162
- Programs may also declare or reference resources. Those declarations form a
163
- program set. Program resources are not automatically effective for every thunk.
162
+ Programs may also define inline caps or reference resources. Those items form
163
+ a program set. Program resources are not automatically effective for every thunk.
164
164
 
165
165
  Thunk directives compute the effective set from the activation set:
166
166
 
@@ -32,6 +32,12 @@ It stores:
32
32
  documents. It is used for atomic job claims and completion bookkeeping; it is
33
33
  not the transcript or run-history store.
34
34
 
35
+ `.runtime/files.db` stores file request claims for inbox directories. It records
36
+ the watched root, relative path, absolute path, size, mtime, content
37
+ fingerprint, terminal status, run id, timestamps, and terminal error. It is used
38
+ for deduplicating file fingerprints and completion bookkeeping; it is not the
39
+ transcript or run-history store.
40
+
35
41
 
36
42
  ## Durable Records
37
43
 
@@ -53,7 +59,12 @@ not the transcript or run-history store.
53
59
 
54
60
  Toolang-owned run ids use `run_<id>`, where `<id>` is encoded with the `run`
55
61
  id family. Thread ids use `<kind>_<id>`, such as `tsk_3nprht9x`,
56
- `chr_xy1234ab`, or `web_def456gh`.
62
+ `chr_xy1234ab`, `file_def456gh`, or `web_def456gh`.
63
+
64
+ File request runs use origin `file` and explicitly invoke the thunk named
65
+ `file`. The run input stores the rendered file message, and run metadata stores
66
+ the `invoke_parts` file attachment data plus the file request id and
67
+ fingerprint.
57
68
 
58
69
  ### StepRecord
59
70
 
@@ -73,11 +73,18 @@ The proposed full identities are:
73
73
  - chore thread: `chr_<id>`
74
74
  - web chat thread: `web_<id>`
75
75
  - TUI chat thread: `tui_<id>`
76
+ - file request thread: `file_<full-path-sha256-prefix>`
77
+ - script/invoke thunk thread: `thunk_<thunk-name>`
76
78
  - Telegram thread: `tg_<external_id>`
77
79
  - run id: `run_<id>`
78
80
 
79
- The bare `<id>` stays stable even when a file is renamed, moved, archived, or
80
- restored.
81
+ For task and chore ids, the bare `<id>` stays stable even when the authored file
82
+ is renamed, moved, archived, or restored.
83
+
84
+ File request threads use the first 12 hex chars of the SHA-256 of the absolute
85
+ source path, so new file fingerprints at the same path share a thread.
86
+ Script/invoke runs are stable for the invoked thunk name; the default thunk uses
87
+ `thunk_main`.
81
88
 
82
89
 
83
90
  ## Reversible Obfuscation
@@ -91,6 +91,7 @@ Key paths:
91
91
  | `logs/<thunk>/<run_id>.log` | Per-run script invoke logs when `PY_LOG` is set |
92
92
  | `jobs.db` | Scheduler job projection and atomic job claims |
93
93
  | `runs.db` | Threads, runs, steps, updates, and prompt blobs |
94
+ | `files.db` | File request claims, fingerprints, and completion state |
94
95
  | `ids.json` | Local id allocator state |
95
96
  | `tools/` | Per-tool plugin working directories |
96
97
  | `channels/` | Per-channel plugin working directories |
@@ -127,4 +128,8 @@ Durable authored state lives in:
127
128
  - agent `archive/`
128
129
 
129
130
  Durable execution state does not live in authored files. It lives in
130
- `jobs.db` and `runs.db`.
131
+ `jobs.db`, `runs.db`, and `files.db`.
132
+
133
+ Inbox directories passed with `--inbox` are external user directories. Toolang
134
+ does not write marker files into them; file request progress is recorded under
135
+ the agent runtime room in `files.db`.
@@ -437,7 +437,7 @@ Artifact buckets are:
437
437
 
438
438
  | Bucket | Meaning |
439
439
  | --- | --- |
440
- | `inline` | Files materialized from inline program declarations |
440
+ | `inline` | Files materialized from inline program caps |
441
441
  | `ref` | Files materialized from program `use` refs |
442
442
  | `wired` | Files materialized from config refs |
443
443
 
@@ -485,9 +485,8 @@ Thunk fields follow grammar names:
485
485
  | `directives` | Thunk `directive` items |
486
486
  | `blocks` | Thunk `block` items |
487
487
 
488
- Use `directives`, not `overlays`, and `blocks`, not `messages`, in the lock
489
- format. Those names match `tree-sitter-toolang`; overlay and message concepts
490
- are runtime projections.
488
+ Use `directives` and `blocks` in the lock format. Those names match
489
+ `tree-sitter-toolang`; directive and message concepts are runtime projections.
491
490
 
492
491
  Type strings use the canonical source spelling from the grammar. Built-in
493
492
  types include `Text`, `Number`, `Boolean`, `Json`, and `Message`. User type
@@ -39,12 +39,12 @@ thunk pay:
39
39
  ```
40
40
 
41
41
 
42
- ## Embedded Cap Declarations
42
+ ## Embedded Caps
43
43
 
44
- Program-level `psyche`, `service`, and `prompt` declarations are embedded inline caps.
44
+ Program-level `psyche`, `service`, and `prompt` blocks are embedded inline caps.
45
45
  During prepare, Toolang materializes them into the agent-specific prepared cap
46
46
  set under `.caps/inline`, preserving the `.too` file as the definition
47
- source. This makes embedded declarations visible through cap APIs and WebUI
47
+ source. This makes embedded caps visible through cap APIs and WebUI
48
48
  surfaces before any thunk selects them. The prepared cap has `form=inline`,
49
49
  `scope=here`, and `origin=local`.
50
50
 
@@ -347,9 +347,9 @@ thunk review(input: Message, path?: Path) -> ReviewResult:
347
347
 
348
348
  ### Scalar and Set Directives
349
349
 
350
- Directives are ordered set overlays on the activation set. The activation set is
350
+ Directives are ordered set operations on the activation set. The activation set is
351
351
  computed before the program runs from placement defaults and CLI options.
352
- Program declarations and references form the program set.
352
+ Program caps and references form the program set.
353
353
 
354
354
  | Form | Meaning |
355
355
  | --- | --- |
@@ -367,7 +367,7 @@ Rules:
367
367
  | `+=` | union the current set with named program-set items |
368
368
  | `-=` | subtract matching selectors from the current set |
369
369
  | `=` | intersect the current set with matching selectors |
370
- | ordered CSV | preserve declaration order |
370
+ | ordered CSV | preserve source order |
371
371
  | no `default` keyword | `default` is treated like any other selector text |
372
372
  | model selectors | `models = ...` may use refs, aliases, globs, and bracket filters |
373
373
  | program-scoped additions | `+=` operands must name items from the program set |
@@ -503,9 +503,9 @@ The runtime expands the prompt before normal run-input assembly. The slash-style
503
503
  `/name ...` invocation remains the user-facing call shape.
504
504
 
505
505
 
506
- ## Service Declarations
506
+ ## Service Caps
507
507
 
508
- `service` declarations use fenced markdown bodies. Service metadata lives in
508
+ `service` caps use fenced markdown bodies. Service metadata lives in
509
509
  frontmatter inside that markdown.
510
510
 
511
511
  `service` frontmatter uses one minimal schema. `description` is the progressive
@@ -3,22 +3,18 @@
3
3
 
4
4
  use skill briceyan/pdf-processing
5
5
 
6
- service context7: ```md
7
- ---
8
- description: Use when current library or framework documentation matters.
9
- transport: http
10
- target: https://mcp.context7.com/mcp
11
- ---
12
-
13
- Use this service when current library or framework documentation matters.
14
- Prefer it over stale recollection when the user asks about APIs, versions, or
15
- integration details.
16
- ```
17
-
18
- psyche alice: ```md
19
- Be practical, concise, and source-aware.
20
- Prefer concrete next steps over broad explanations.
21
- ```
6
+ service context7:
7
+ description = Use when current library or framework documentation matters.
8
+ protocol = http
9
+ target = https://mcp.context7.com/mcp
10
+
11
+ Use this service when current library or framework documentation matters.
12
+ Prefer it over stale recollection when the user asks about APIs, versions, or
13
+ integration details.
14
+
15
+ psyche alice:
16
+ Be practical, concise, and source-aware.
17
+ Prefer concrete next steps over broad explanations.
22
18
 
23
19
  thunk:
24
20
  Help the user directly.
@@ -0,0 +1,61 @@
1
+ thunk expand_queries(in: Part[]):
2
+ Research question:
3
+ {{ _ }}
4
+
5
+ Turn this research question into 6 diverse web search queries.
6
+ Return one query per line. No bullets, no numbering.
7
+
8
+ thunk search_web(in: Part[]):
9
+ tools = web_search/*
10
+
11
+ Query:
12
+ {{ _ }}
13
+
14
+ Search the web for this query.
15
+ Return a compact evidence bundle:
16
+ - query
17
+ - 3-5 useful results
18
+ - title, url, date if available
19
+ - one sentence on why it matters
20
+
21
+ thunk extract_findings(in: Part[]):
22
+ Evidence bundle:
23
+ {{ _ }}
24
+
25
+ Extract durable findings from this evidence bundle.
26
+ Prefer source-backed claims.
27
+ Return concise bullets with URLs preserved.
28
+
29
+ thunk synthesize_report(in: Part[]):
30
+ Findings:
31
+ {{ _ }}
32
+
33
+ Write a deep research brief from these findings.
34
+
35
+ Structure:
36
+ - Executive summary
37
+ - Key findings
38
+ - Conflicting or uncertain points
39
+ - Source notes
40
+ - Next search directions
41
+
42
+ flow research(in: Text):
43
+ ## Expand the research question into diverse search queries
44
+ do expand_queries
45
+ ## Search the web for each query
46
+ each par 4 search_web
47
+ ## Keep evidence bundles that answer the research task
48
+ keep is_relevant
49
+ ## Rank the remaining evidence by relevance
50
+ rank 8: Return a numeric relevance score from 0 to 10. Higher is better.
51
+ ## Extract source-backed findings from each evidence bundle
52
+ each par 4 extract_findings
53
+ ## Synthesize the final research brief
54
+ do synthesize_report
55
+
56
+ thunk is_relevant(in: Part[]):
57
+ Evidence bundle:
58
+ {{ _ }}
59
+
60
+ Decide whether this evidence bundle contains concrete information about agent workflow implementations.
61
+ Return only "keep" or "drop".
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env toolang
2
+
3
+ # File request runtime example.
4
+ #
5
+ # Run:
6
+ # mkdir -p inbox
7
+ # toolang examples/file-inbox-indexer.too --inbox ./inbox
8
+ #
9
+ # Drop files into ./inbox. Each discovered file is sent to the `file` thunk.
10
+ # The thunk appends a short text summary to the roaming agent home file:
11
+ #
12
+ # examples/.toolang/agents/file-inbox-indexer/outbox/index.md
13
+
14
+ thunk file(in: Part[]):
15
+ tools = filesystem/*
16
+
17
+ user:
18
+ Process the current file request immediately. Do not ask for confirmation.
19
+ Append each file with its short text summary to `outbox/index.md` in the agent home.
20
+ After the file is written, reply with only: Indexed `<file name or path>`.
@@ -4,22 +4,22 @@
4
4
  # It keeps the capabilities minimal and focuses on different thunk shapes.
5
5
 
6
6
  struct Summary:
7
- title: string
8
- summary: string
7
+ title: Text
8
+ summary: Text
9
9
 
10
10
  struct BulletList:
11
- items: string[]
11
+ items: Text[]
12
12
 
13
- thunk summarize(_) -> Summary:
13
+ thunk summarize(in: Part[]) -> Summary:
14
14
  Produce a compact summary with a short title and a short summary paragraph.
15
15
 
16
- thunk bullets(_) -> BulletList:
16
+ thunk bullets(in: Part[]) -> BulletList:
17
17
  Extract the main points into short bullet items.
18
18
 
19
- thunk rewrite(_, tone?, audience?):
19
+ thunk rewrite(in: Part[], tone?, audience?):
20
20
  Rewrite the input in the requested tone.
21
21
  Adjust depth and wording for the requested audience when it is provided.
22
22
 
23
- thunk slug(title) -> text:
23
+ thunk slug(title) -> Text:
24
24
  Convert the provided title into a concise lowercase slug.
25
25
  Use hyphens between words and return only the slug text.
@@ -10,7 +10,7 @@
10
10
 
11
11
  use skill briceyan/review
12
12
 
13
- thunk gpt_only(_):
13
+ thunk gpt_only(in: Part[]):
14
14
  model = openai/gpt-5
15
15
 
16
16
  Rewrite the input into one concise paragraph.
@@ -17,27 +17,27 @@
17
17
  # Qwen3 Coder Next:
18
18
  # toolang examples/invoke.openrouter-smoke.too qwen "Summarize this repository." --model qwen/qwen3-coder-next@openrouter
19
19
 
20
- thunk gpt(_):
20
+ thunk gpt(in: Part[]):
21
21
  model = openai/gpt-5
22
22
 
23
23
  Summarize the input into three short technical bullet points.
24
24
 
25
- thunk claude(_):
25
+ thunk claude(in: Part[]):
26
26
  model = anthropic/claude-sonnet-4.5
27
27
 
28
28
  Summarize the input into three short technical bullet points.
29
29
 
30
- thunk gemini(_):
30
+ thunk gemini(in: Part[]):
31
31
  model = google/gemini-3.1-pro-preview
32
32
 
33
33
  Summarize the input into three short technical bullet points.
34
34
 
35
- thunk grok(_):
35
+ thunk grok(in: Part[]):
36
36
  model = x-ai/grok-4.20
37
37
 
38
38
  Summarize the input into three short technical bullet points.
39
39
 
40
- thunk qwen(_):
40
+ thunk qwen(in: Part[]):
41
41
  model = qwen/qwen3-coder-next
42
42
 
43
43
  Summarize the input into three short technical bullet points.
@@ -14,7 +14,7 @@
14
14
  # --model anthropic/claude-sonnet-4.5@openrouter \
15
15
  # --model google/gemini-3.1-pro-preview@openrouter
16
16
 
17
- thunk rewrite(_):
17
+ thunk rewrite(in: Part[]):
18
18
  model = openai/gpt-5, anthropic/claude-sonnet-4.5, google/gemini-3.1-pro-preview
19
19
 
20
20
  Rewrite the input for a technical audience.
@@ -6,11 +6,11 @@
6
6
  #
7
7
  # toolang examples/invoke.simulated-history.memory.too followup "What did I ask you to remember?"
8
8
 
9
- thunk followup(_):
9
+ thunk followup(in: Part[]):
10
10
  recall = memory
11
11
 
12
- context: none
13
- instruct: none
12
+ context none
13
+ instruct none
14
14
 
15
15
  user:
16
16
  Remember that the deployment window is Friday morning.
@@ -6,9 +6,9 @@
6
6
  #
7
7
  # toolang examples/invoke.simulated-history.none.too followup "What is my name?"
8
8
 
9
- thunk followup(_):
9
+ thunk followup(in: Part[]):
10
10
  recall = none
11
- context: none
11
+ context none
12
12
 
13
13
  user:
14
14
  My name is Ada.
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env toolang
2
+
3
+ # LLM wiki file request example.
4
+ #
5
+ # Run:
6
+ # mkdir -p wiki-inbox
7
+ # toolang examples/llm-wiki.too --inbox ./wiki-inbox
8
+ #
9
+ # Drop documents, images, audio, video, or other files into ./wiki-inbox.
10
+ # The `file` thunk turns each file into a concise wiki page in:
11
+ #
12
+ # examples/.toolang/agents/llm-wiki/wiki/
13
+ thunk file(in: Part[]):
14
+ tools = filesystem/*
15
+
16
+ user:
17
+ Process the current file request immediately. Do not ask for confirmation.
18
+ Maintain an LLM-readable wiki under `wiki/` in the agent home.
19
+
20
+ Write one concise Markdown page under `wiki/pages/` for this file.
21
+ Append one short link entry to `wiki/index.md`.
22
+
23
+ Each page should contain only useful text: a title, source reference when
24
+ visible, a compact summary, key facts, and searchable keywords.
25
+ After writing, reply with only: Wikified `<file name or path>`.
26
+
27
+ thunk chat(in: Part[]):
28
+ tools = filesystem/*
29
+
30
+ user:
31
+ Answer from the wiki in the agent home. Read `wiki/index.md` first, then
32
+ read the relevant pages under `wiki/pages/` before answering.
33
+ If the wiki does not contain enough information, say what is missing.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "toolang"
7
- version = "0.2.4"
7
+ version = "0.2.5"
8
8
  description = "A programming language and runtime for agents"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -41,7 +41,7 @@ dependencies = [
41
41
  "rich>=14,<15",
42
42
  "tomli-w>=1.2.0",
43
43
  "tree-sitter>=0.24,<0.26",
44
- "tree-sitter-toolang>=0.0.16",
44
+ "tree-sitter-toolang>=0.1.3",
45
45
  "typer>=0.16,<1",
46
46
  "uvicorn>=0.35,<1",
47
47
  "watchfiles>=1.1,<2",