zettcode-todos 0.4.1__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.
@@ -0,0 +1,37 @@
1
+ **/.venv/
2
+ **/__pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ .smoke/
8
+ .coverage
9
+ **/.pytest_cache/
10
+ **/.ruff_cache/
11
+ .zett-tool-output/
12
+ .env
13
+ .DS_Store
14
+
15
+ # viztracer writes its trace here by default.
16
+ /result.json
17
+
18
+ # The docs site: dependencies, build output, and VitePress' cache.
19
+ node_modules/
20
+ docs/.vitepress/dist/
21
+ docs/.vitepress/cache/
22
+ docs/.vitepress/.temp/
23
+
24
+ # The TypeScript client is built from its sources; only dist/ is published.
25
+ clients/typescript/dist/
26
+
27
+ # The gateway's page is built from clients/gateway into the package when a distribution is made (`make gateway-ui`);
28
+ # the build output is not kept in the repository. pyproject's `artifacts` puts it in the wheel all the same.
29
+ packages/zettcode-gateway/src/zettcode/gateway/static/
30
+
31
+ # The palette gallery is generated by `make palettes`: every widget painted in
32
+ # every palette, written by docs/scripts/palette_gallery.py. Regenerate it
33
+ # rather than committing a 2 MB copy that goes stale the moment a colour moves.
34
+ docs/internal/palettes.html
35
+
36
+ # The release order is generated from the pyproject.toml files (`make order`); it is not kept in git.
37
+ packages/order.txt
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 2.5
2
+ Name: zettcode-todos
3
+ Version: 0.4.1
4
+ Summary: The todo_write tool and the plan it keeps, as a part of the agent that lives apart from it
5
+ Project-URL: Repository, https://github.com/Chang-LeHung/zettcode
6
+ Author: Chang-LeHung
7
+ License-Expression: MIT
8
+ Keywords: agent,todos,zettcode
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: zett-agent<0.3,>=0.2.7
19
+ Requires-Dist: zettcode-engine
@@ -0,0 +1,50 @@
1
+ [project]
2
+ name = "zettcode-todos"
3
+ description = "The todo_write tool and the plan it keeps, as a part of the agent that lives apart from it"
4
+ requires-python = ">=3.10"
5
+ dynamic = ["version"]
6
+ license = "MIT"
7
+ authors = [{name = "Chang-LeHung"}]
8
+ keywords = ["zettcode", "todos", "agent"]
9
+ classifiers = [
10
+ "Development Status :: 5 - Production/Stable",
11
+ "Programming Language :: Python :: 3.10",
12
+ "Programming Language :: Python :: 3.11",
13
+ "Programming Language :: Python :: 3.12",
14
+ "Programming Language :: Python :: 3.13",
15
+ "Programming Language :: Python :: 3.14",
16
+ "Programming Language :: Python :: 3.15",
17
+ "Typing :: Typed",
18
+ ]
19
+ dependencies = [
20
+ # The plugin base classes, the name the plan is provided under, and the switch the runtime provides.
21
+ "zettcode-engine",
22
+ # The extension the plan is.
23
+ "zett-agent>=0.2.7,<0.3",
24
+ ]
25
+
26
+ # A part of the program, not a plugin: the `[tool.zettcode] plugin = true` marker is what the plugin release line looks for. It is
27
+ # activated with the agent's other parts and `[harness] todowrite` is what gives the model the tool.
28
+ [project.entry-points."zettcode.plugin"]
29
+ todos = "zettcode.todos.plugin:TodoPlan"
30
+
31
+ [project.urls]
32
+ Repository = "https://github.com/Chang-LeHung/zettcode"
33
+
34
+ [build-system]
35
+ requires = ["hatchling"]
36
+ build-backend = "hatchling.build"
37
+
38
+ [tool.hatch.version]
39
+ # One version for the whole repository: the engine ships the file.
40
+ path = "../zettcode-engine/src/zettcode/version.py"
41
+
42
+ [tool.hatch.build.targets.wheel]
43
+ packages = ["src/zettcode"]
44
+
45
+ [tool.hatch.build.targets.sdist]
46
+ include = ["/src", "/pyproject.toml"]
47
+
48
+ [tool.pytest.ini_options]
49
+ testpaths = ["tests"]
50
+ asyncio_mode = "auto"
@@ -0,0 +1,12 @@
1
+ """The ``todo_write`` tool and the plan it keeps: the plugin that provides them to the agent and to the shell.
2
+
3
+ A part of the program that lives in a distribution of its own, found through the ``zettcode.plugin`` entry point.
4
+ ``[harness] todowrite`` is what gives the model the tool; the plan itself is provided as a service either way, because
5
+ the shell asks for it on every turn.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from .plugin import TodoPlan
11
+
12
+ __all__ = ["TodoPlan"]
@@ -0,0 +1,29 @@
1
+ """The plugin that keeps the plan the shell's panel draws."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from zettcode.engine.plugins.context import PluginContext
6
+ from zettcode.engine.plugins.plugin import Plugin, PluginSetting
7
+ from zettcode.engine.plugins.services import TODOS
8
+
9
+
10
+ class TodoPlan(Plugin[PluginContext]):
11
+ """The ``todo_write`` tool, and the plan it keeps, shown in the shell's panel.
12
+
13
+ The extension is provided as a service whether or not the tool is on, because the shell asks it for the
14
+ plan on every turn and an extension nobody registered simply has none to show. Only
15
+ ``[harness] todowrite`` decides whether the model is given the tool.
16
+ """
17
+
18
+ name = "todos"
19
+ description = "The todo_write tool and the plan it keeps"
20
+ setting = PluginSetting("todowrite_enabled", "harness", "todowrite")
21
+
22
+ def activate(self, ctx: PluginContext) -> None:
23
+ """Provide the extension, and hand it to the agent when the tool is on."""
24
+ from zett_agent.extensions.todo import TodoWriteExtension
25
+
26
+ extension = TodoWriteExtension()
27
+ ctx.agent.provide(TODOS, extension)
28
+ if ctx.config.todowrite_enabled:
29
+ ctx.agent.register_extension(extension)
File without changes