irene-tools 0.1.0__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.
- irene_tools-0.1.0/LICENSE +21 -0
- irene_tools-0.1.0/PKG-INFO +52 -0
- irene_tools-0.1.0/README.md +37 -0
- irene_tools-0.1.0/pyproject.toml +22 -0
- irene_tools-0.1.0/setup.cfg +4 -0
- irene_tools-0.1.0/src/irene_tools/__init__.py +19 -0
- irene_tools-0.1.0/src/irene_tools/decorator.py +62 -0
- irene_tools-0.1.0/src/irene_tools.egg-info/PKG-INFO +52 -0
- irene_tools-0.1.0/src/irene_tools.egg-info/SOURCES.txt +9 -0
- irene_tools-0.1.0/src/irene_tools.egg-info/dependency_links.txt +1 -0
- irene_tools-0.1.0/src/irene_tools.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Irene
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: irene-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Portable, zero-dependency @tool decorator for authoring agent toolkits — runs in Irene, standalone, or under agno.
|
|
5
|
+
Author: Irene
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: agent,llm,tools,toolkit
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# irene-tools
|
|
17
|
+
|
|
18
|
+
A tiny, **zero-dependency** `@tool` decorator for authoring agent toolkits. A toolkit
|
|
19
|
+
authored with `irene-tools` is **portable**: it runs inside Irene, runs standalone
|
|
20
|
+
(`python toolkit.py`), and is usable by [agno](https://github.com/agno-agi/agno) and other
|
|
21
|
+
frameworks — because it depends on nothing.
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from irene_tools import tool
|
|
25
|
+
|
|
26
|
+
@tool(category="weather")
|
|
27
|
+
def get_forecast(city: str) -> str:
|
|
28
|
+
"""Get the forecast for a city."""
|
|
29
|
+
return f"Sunny in {city}"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Why
|
|
33
|
+
|
|
34
|
+
A capability you build should be yours to keep and move. `irene-tools` is the opposite of
|
|
35
|
+
lock-in: the decorator only stamps metadata and returns your function unchanged, so the same
|
|
36
|
+
`toolkit.py` works everywhere. No SDK to install a runtime, no framework coupling.
|
|
37
|
+
|
|
38
|
+
## The toolkit convention
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
my_toolkit/
|
|
42
|
+
toolkit.py # @tool-decorated functions
|
|
43
|
+
manifest.json # derived: {name, description, tools[...], manifest_version}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## API
|
|
47
|
+
|
|
48
|
+
- `@tool(category="custom", tags=[], description=None, dangerous=False)` — mark a function.
|
|
49
|
+
- `get_workspace()` — the dir to read/write files in (host-injected; `cwd` standalone).
|
|
50
|
+
- `get_secret(key, default=None)` — the current end-user's per-user secret (host-injected).
|
|
51
|
+
|
|
52
|
+
MIT licensed.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# irene-tools
|
|
2
|
+
|
|
3
|
+
A tiny, **zero-dependency** `@tool` decorator for authoring agent toolkits. A toolkit
|
|
4
|
+
authored with `irene-tools` is **portable**: it runs inside Irene, runs standalone
|
|
5
|
+
(`python toolkit.py`), and is usable by [agno](https://github.com/agno-agi/agno) and other
|
|
6
|
+
frameworks — because it depends on nothing.
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
from irene_tools import tool
|
|
10
|
+
|
|
11
|
+
@tool(category="weather")
|
|
12
|
+
def get_forecast(city: str) -> str:
|
|
13
|
+
"""Get the forecast for a city."""
|
|
14
|
+
return f"Sunny in {city}"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Why
|
|
18
|
+
|
|
19
|
+
A capability you build should be yours to keep and move. `irene-tools` is the opposite of
|
|
20
|
+
lock-in: the decorator only stamps metadata and returns your function unchanged, so the same
|
|
21
|
+
`toolkit.py` works everywhere. No SDK to install a runtime, no framework coupling.
|
|
22
|
+
|
|
23
|
+
## The toolkit convention
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
my_toolkit/
|
|
27
|
+
toolkit.py # @tool-decorated functions
|
|
28
|
+
manifest.json # derived: {name, description, tools[...], manifest_version}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
- `@tool(category="custom", tags=[], description=None, dangerous=False)` — mark a function.
|
|
34
|
+
- `get_workspace()` — the dir to read/write files in (host-injected; `cwd` standalone).
|
|
35
|
+
- `get_secret(key, default=None)` — the current end-user's per-user secret (host-injected).
|
|
36
|
+
|
|
37
|
+
MIT licensed.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "irene-tools"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Portable, zero-dependency @tool decorator for authoring agent toolkits — runs in Irene, standalone, or under agno."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Irene" }]
|
|
13
|
+
keywords = ["agent", "llm", "tools", "toolkit"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
]
|
|
19
|
+
dependencies = []
|
|
20
|
+
|
|
21
|
+
[tool.setuptools.packages.find]
|
|
22
|
+
where = ["src"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""irene-tools — portable, zero-dependency `@tool` decorator for agent toolkits.
|
|
2
|
+
|
|
3
|
+
from irene_tools import tool
|
|
4
|
+
|
|
5
|
+
@tool(category="weather")
|
|
6
|
+
def get_forecast(city: str) -> str:
|
|
7
|
+
'''Get the forecast for a city.'''
|
|
8
|
+
...
|
|
9
|
+
|
|
10
|
+
A toolkit is a folder: `toolkit.py` (@tool-decorated functions) + a derived
|
|
11
|
+
`manifest.json`. Runs in Irene, standalone, or under agno — because it depends on
|
|
12
|
+
nothing.
|
|
13
|
+
"""
|
|
14
|
+
from irene_tools.decorator import get_secret, get_workspace, tool
|
|
15
|
+
|
|
16
|
+
__version__ = "0.1.0"
|
|
17
|
+
MANIFEST_VERSION = 1
|
|
18
|
+
|
|
19
|
+
__all__ = ["tool", "get_workspace", "get_secret", "__version__", "MANIFEST_VERSION"]
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""irene_tools.decorator — the portable @tool marker.
|
|
2
|
+
|
|
3
|
+
Zero dependencies. A toolkit is a folder with a `toolkit.py` whose functions are
|
|
4
|
+
marked with `@tool`; a host (Irene, or any framework) discovers them and exposes
|
|
5
|
+
them to a model. The decorator only STAMPS metadata and returns the function
|
|
6
|
+
UNCHANGED, so the same function is:
|
|
7
|
+
- callable directly (`get_forecast("NYC")`),
|
|
8
|
+
- importable + runnable standalone (`python toolkit.py`),
|
|
9
|
+
- usable by agno (which accepts a plain callable via `Function.from_callable`).
|
|
10
|
+
|
|
11
|
+
Portability comes from NOT depending on any framework — this is the whole point.
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
from typing import Callable, List, Optional
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def tool(func: Optional[Callable] = None, *, category: str = "custom",
|
|
20
|
+
tags: Optional[List[str]] = None, dangerous: bool = False,
|
|
21
|
+
runtime: str = "python", description: Optional[str] = None,
|
|
22
|
+
**_extra) -> Callable:
|
|
23
|
+
"""Mark a function as an agent-callable tool.
|
|
24
|
+
|
|
25
|
+
Works bare (`@tool`), called (`@tool()`), parametrized (`@tool(category="x")`),
|
|
26
|
+
and legacy-positional (`@tool("x")`). FORGIVING: `description=` is a first-class
|
|
27
|
+
kwarg (the model's most natural form) and any other kwarg is swallowed by
|
|
28
|
+
`**_extra`, so importing a toolkit never TypeErrors. Returns the function
|
|
29
|
+
unchanged plus a `_irene_tool` metadata attribute (read at authoring/inspection
|
|
30
|
+
time; Irene's loader discovers tools by AST, not this attribute).
|
|
31
|
+
"""
|
|
32
|
+
if isinstance(func, str): # legacy positional: @tool("category")
|
|
33
|
+
category, func = func, None
|
|
34
|
+
|
|
35
|
+
def decorator(f: Callable) -> Callable:
|
|
36
|
+
f._irene_tool = {
|
|
37
|
+
"category": category,
|
|
38
|
+
"tags": list(tags or []),
|
|
39
|
+
"dangerous": bool(dangerous),
|
|
40
|
+
"runtime": runtime,
|
|
41
|
+
"description": description,
|
|
42
|
+
}
|
|
43
|
+
return f
|
|
44
|
+
return decorator(func) if callable(func) else decorator
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def get_workspace() -> str:
|
|
48
|
+
"""The directory a tool should read/write files in. Standalone this is just
|
|
49
|
+
`os.getcwd()`; a host runtime (Irene) sets cwd to the session workspace before
|
|
50
|
+
invoking the tool."""
|
|
51
|
+
return os.getcwd()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def get_secret(key: str, default=None):
|
|
55
|
+
"""The CURRENT end-user's per-user secret for this tool on a multi-user deployed
|
|
56
|
+
agent. Returns `default` standalone / single-tenant (e.g. a bare `python
|
|
57
|
+
toolkit.py`); the host runtime injects real values in the sandbox. Never read
|
|
58
|
+
`os.environ` for per-user values (that's the OWNER's shared secret)."""
|
|
59
|
+
return default
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
__all__ = ["tool", "get_workspace", "get_secret"]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: irene-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Portable, zero-dependency @tool decorator for authoring agent toolkits — runs in Irene, standalone, or under agno.
|
|
5
|
+
Author: Irene
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: agent,llm,tools,toolkit
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# irene-tools
|
|
17
|
+
|
|
18
|
+
A tiny, **zero-dependency** `@tool` decorator for authoring agent toolkits. A toolkit
|
|
19
|
+
authored with `irene-tools` is **portable**: it runs inside Irene, runs standalone
|
|
20
|
+
(`python toolkit.py`), and is usable by [agno](https://github.com/agno-agi/agno) and other
|
|
21
|
+
frameworks — because it depends on nothing.
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from irene_tools import tool
|
|
25
|
+
|
|
26
|
+
@tool(category="weather")
|
|
27
|
+
def get_forecast(city: str) -> str:
|
|
28
|
+
"""Get the forecast for a city."""
|
|
29
|
+
return f"Sunny in {city}"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Why
|
|
33
|
+
|
|
34
|
+
A capability you build should be yours to keep and move. `irene-tools` is the opposite of
|
|
35
|
+
lock-in: the decorator only stamps metadata and returns your function unchanged, so the same
|
|
36
|
+
`toolkit.py` works everywhere. No SDK to install a runtime, no framework coupling.
|
|
37
|
+
|
|
38
|
+
## The toolkit convention
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
my_toolkit/
|
|
42
|
+
toolkit.py # @tool-decorated functions
|
|
43
|
+
manifest.json # derived: {name, description, tools[...], manifest_version}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## API
|
|
47
|
+
|
|
48
|
+
- `@tool(category="custom", tags=[], description=None, dangerous=False)` — mark a function.
|
|
49
|
+
- `get_workspace()` — the dir to read/write files in (host-injected; `cwd` standalone).
|
|
50
|
+
- `get_secret(key, default=None)` — the current end-user's per-user secret (host-injected).
|
|
51
|
+
|
|
52
|
+
MIT licensed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
irene_tools
|