zettcode-instructions 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.
- zettcode_instructions-0.4.1/.gitignore +37 -0
- zettcode_instructions-0.4.1/PKG-INFO +19 -0
- zettcode_instructions-0.4.1/pyproject.toml +50 -0
- zettcode_instructions-0.4.1/src/zettcode/instructions/__init__.py +12 -0
- zettcode_instructions-0.4.1/src/zettcode/instructions/plugin.py +34 -0
- zettcode_instructions-0.4.1/src/zettcode/instructions/py.typed +0 -0
|
@@ -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-instructions
|
|
3
|
+
Version: 0.4.1
|
|
4
|
+
Summary: The workspace's AGENTS.md instructions of ZettCode, 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,agents-md,instructions,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-instructions"
|
|
3
|
+
description = "The workspace's AGENTS.md instructions of ZettCode, 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", "agents-md", "instructions", "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 and the switch the runtime provides.
|
|
21
|
+
"zettcode-engine",
|
|
22
|
+
# The extension the factory builds.
|
|
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 `[agents_md] enabled` is what turns it off.
|
|
28
|
+
[project.entry-points."zettcode.plugin"]
|
|
29
|
+
project-instructions = "zettcode.instructions.plugin:ProjectInstructions"
|
|
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 workspace's ``AGENTS.md`` instructions of ZettCode: the plugin that hands them to the agent.
|
|
2
|
+
|
|
3
|
+
A part of the program that lives in a distribution of its own, found through the ``zettcode.plugin`` entry point.
|
|
4
|
+
``[agents_md] enabled`` in the configuration is what turns it off. The extension is imported by the factory, so a launch
|
|
5
|
+
that never builds an agent does not pay for it.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .plugin import ProjectInstructions
|
|
11
|
+
|
|
12
|
+
__all__ = ["ProjectInstructions"]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""The plugin that hands the agent the workspace's project instructions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
|
+
|
|
7
|
+
from zettcode.engine.plugins.context import PluginContext
|
|
8
|
+
from zettcode.engine.plugins.plugin import Plugin, PluginSetting
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING: # pragma: no cover - annotations only
|
|
11
|
+
from zett_agent.extensions.base import AgentExtension
|
|
12
|
+
|
|
13
|
+
from zettcode.engine.plugins.state import AgentBuild
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ProjectInstructions(Plugin[PluginContext]):
|
|
17
|
+
"""The workspace's ``AGENTS.md`` files, read again for every request so an edit applies at once."""
|
|
18
|
+
|
|
19
|
+
name = "project-instructions"
|
|
20
|
+
description = "The workspace's AGENTS.md instructions"
|
|
21
|
+
setting = PluginSetting("agents_md_enabled", "agents_md")
|
|
22
|
+
|
|
23
|
+
def activate(self, ctx: PluginContext) -> None:
|
|
24
|
+
"""Hand the agent the instructions, unless the configuration turned them off."""
|
|
25
|
+
config = ctx.config
|
|
26
|
+
if not config.agents_md_enabled:
|
|
27
|
+
return
|
|
28
|
+
|
|
29
|
+
def build(_: AgentBuild) -> AgentExtension:
|
|
30
|
+
from zett_agent.extensions.agents_md import AgentsMdExtension
|
|
31
|
+
|
|
32
|
+
return AgentsMdExtension(config.workspace)
|
|
33
|
+
|
|
34
|
+
ctx.agent.register_extension_factory("AgentsMdExtension", build)
|
|
File without changes
|