agent-roster 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.
Potentially problematic release.
This version of agent-roster might be problematic. Click here for more details.
- agent_roster-0.1.0/LICENSE +21 -0
- agent_roster-0.1.0/PKG-INFO +57 -0
- agent_roster-0.1.0/README.md +28 -0
- agent_roster-0.1.0/pyproject.toml +17 -0
- agent_roster-0.1.0/src/agent_roster/__init__.py +4 -0
- agent_roster-0.1.0/src/agent_roster/__main__.py +7 -0
- agent_roster-0.1.0/src/agent_roster/cli.py +147 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bean Lab
|
|
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,57 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: agent-roster
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Agent roster CLI
|
|
5
|
+
Author: Unknown
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Bean Lab
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
Requires-Python: >=3.11
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# Roster
|
|
31
|
+
|
|
32
|
+
An agent roster is a directory of Agent definitions AI coding tools can take advantage of when using multi agent workflows.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
`pip install roster`
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
To initialize the agent roster, run `roster init`. This will create the following:
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
AGENTS.md
|
|
45
|
+
.agents/
|
|
46
|
+
└──developer/
|
|
47
|
+
└──info.md
|
|
48
|
+
└──instructions.md
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The `.agents` dir is where agent roles will be defined. The init script creates an `developer` role which can be modified or deleted if desired.
|
|
52
|
+
To create a new role, run `roster new <role>`, which will create a new dir within `.agents` named after the provided role containing empty `info.md` and `instructions.md` files.
|
|
53
|
+
To delete a role, run `roster remove <role>`, which will delete that role's directory and contents.
|
|
54
|
+
|
|
55
|
+
The initial `AGENTS.md` file contains the following instructions: Run `roster whoami <role>` with your role. If you have no role, assume your role is `main`.
|
|
56
|
+
|
|
57
|
+
When the agent runs `roster whoami <role>` with its role, it's `instructions.md` file will be printed out. If a `agent.py` file is provided in the agent dir, it will be run instead.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Roster
|
|
2
|
+
|
|
3
|
+
An agent roster is a directory of Agent definitions AI coding tools can take advantage of when using multi agent workflows.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`pip install roster`
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
To initialize the agent roster, run `roster init`. This will create the following:
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
AGENTS.md
|
|
16
|
+
.agents/
|
|
17
|
+
└──developer/
|
|
18
|
+
└──info.md
|
|
19
|
+
└──instructions.md
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The `.agents` dir is where agent roles will be defined. The init script creates an `developer` role which can be modified or deleted if desired.
|
|
23
|
+
To create a new role, run `roster new <role>`, which will create a new dir within `.agents` named after the provided role containing empty `info.md` and `instructions.md` files.
|
|
24
|
+
To delete a role, run `roster remove <role>`, which will delete that role's directory and contents.
|
|
25
|
+
|
|
26
|
+
The initial `AGENTS.md` file contains the following instructions: Run `roster whoami <role>` with your role. If you have no role, assume your role is `main`.
|
|
27
|
+
|
|
28
|
+
When the agent runs `roster whoami <role>` with its role, it's `instructions.md` file will be printed out. If a `agent.py` file is provided in the agent dir, it will be run instead.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv-build>=0.2"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agent-roster"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Agent roster CLI"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = []
|
|
12
|
+
authors = [{ name = "Unknown" }]
|
|
13
|
+
license = { file = "LICENSE" }
|
|
14
|
+
|
|
15
|
+
[project.scripts]
|
|
16
|
+
roster = "roster.cli:main"
|
|
17
|
+
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"""Command-line interface for the roster package."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import sys
|
|
5
|
+
import argparse
|
|
6
|
+
import shutil
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
from . import __version__
|
|
10
|
+
|
|
11
|
+
APP_NAME = "roster"
|
|
12
|
+
DEFAULT_ROLE = "main"
|
|
13
|
+
AGENTS_DIRNAME = ".agents"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _agents_root(base: Path) -> Path:
|
|
17
|
+
return base / AGENTS_DIRNAME
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _role_dir(base: Path, role: str) -> Path:
|
|
21
|
+
return _agents_root(base) / role
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _ensure_dir(path: Path) -> None:
|
|
25
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def cmd_init(base: Path) -> int:
|
|
29
|
+
"""Initialize the roster directory with default developer role."""
|
|
30
|
+
agents_dir = _agents_root(base)
|
|
31
|
+
_ensure_dir(agents_dir)
|
|
32
|
+
|
|
33
|
+
# Create AGENTS.md with onboarding instructions.
|
|
34
|
+
agents_md = base / "AGENTS.md"
|
|
35
|
+
if not agents_md.exists():
|
|
36
|
+
agents_md.write_text(
|
|
37
|
+
"Run `roster whoami <role>` with your role. If you have no role, assume your role is `main`.\n",
|
|
38
|
+
encoding="utf-8",
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# Create default developer role.
|
|
42
|
+
developer_dir = _role_dir(base, "developer")
|
|
43
|
+
_ensure_dir(developer_dir)
|
|
44
|
+
|
|
45
|
+
(developer_dir / "info.md").touch(exist_ok=True)
|
|
46
|
+
instructions = developer_dir / "instructions.md"
|
|
47
|
+
if not instructions.exists():
|
|
48
|
+
instructions.write_text("Provide developer-specific instructions here.\n", encoding="utf-8")
|
|
49
|
+
|
|
50
|
+
return 0
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def cmd_new(base: Path, role: str) -> int:
|
|
54
|
+
"""Create a new role directory with placeholder files."""
|
|
55
|
+
role_dir = _role_dir(base, role)
|
|
56
|
+
if role_dir.exists():
|
|
57
|
+
print(f"Role '{role}' already exists at {role_dir}", file=sys.stderr)
|
|
58
|
+
return 1
|
|
59
|
+
|
|
60
|
+
_ensure_dir(role_dir)
|
|
61
|
+
(role_dir / "info.md").write_text("", encoding="utf-8")
|
|
62
|
+
(role_dir / "instructions.md").write_text("", encoding="utf-8")
|
|
63
|
+
return 0
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def cmd_remove(base: Path, role: str) -> int:
|
|
67
|
+
"""Delete the directory for a role if it exists."""
|
|
68
|
+
role_dir = _role_dir(base, role)
|
|
69
|
+
if not role_dir.exists():
|
|
70
|
+
print(f"Role '{role}' not found at {role_dir}", file=sys.stderr)
|
|
71
|
+
return 1
|
|
72
|
+
|
|
73
|
+
if not role_dir.is_dir():
|
|
74
|
+
print(f"Path for role '{role}' is not a directory: {role_dir}", file=sys.stderr)
|
|
75
|
+
return 1
|
|
76
|
+
|
|
77
|
+
try:
|
|
78
|
+
shutil.rmtree(role_dir)
|
|
79
|
+
except OSError as exc:
|
|
80
|
+
print(f"Failed to remove role '{role}': {exc}", file=sys.stderr)
|
|
81
|
+
return 1
|
|
82
|
+
|
|
83
|
+
return 0
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def cmd_whoami(base: Path, role: str) -> int:
|
|
87
|
+
"""Print the instructions for the given role if available."""
|
|
88
|
+
role_dir = _role_dir(base, role)
|
|
89
|
+
if not role_dir.exists():
|
|
90
|
+
print(f"Role '{role}' not found. Run 'roster new {role}' to create it.", file=sys.stderr)
|
|
91
|
+
return 1
|
|
92
|
+
|
|
93
|
+
agent_py = role_dir / "agent.py"
|
|
94
|
+
if agent_py.exists():
|
|
95
|
+
# For now, we simply notify; executing arbitrary code is avoided.
|
|
96
|
+
print(f"agent.py found at {agent_py}; execution not implemented.")
|
|
97
|
+
return 0
|
|
98
|
+
|
|
99
|
+
instructions = role_dir / "instructions.md"
|
|
100
|
+
if instructions.exists():
|
|
101
|
+
print(instructions.read_text(encoding="utf-8"))
|
|
102
|
+
return 0
|
|
103
|
+
|
|
104
|
+
print(f"No instructions found for role '{role}'.", file=sys.stderr)
|
|
105
|
+
return 1
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
109
|
+
parser = argparse.ArgumentParser(prog=APP_NAME, description="Manage agent roster roles.")
|
|
110
|
+
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
|
|
111
|
+
sub = parser.add_subparsers(dest="command", required=True)
|
|
112
|
+
|
|
113
|
+
sub.add_parser("init", help="Initialize roster with default files.")
|
|
114
|
+
|
|
115
|
+
new_parser = sub.add_parser("new", help="Create a new role.")
|
|
116
|
+
new_parser.add_argument("role", help="Role name to create.")
|
|
117
|
+
|
|
118
|
+
remove_parser = sub.add_parser("remove", help="Delete an existing role.")
|
|
119
|
+
remove_parser.add_argument("role", help="Role name to delete.")
|
|
120
|
+
|
|
121
|
+
who_parser = sub.add_parser("whoami", help="Print instructions for a role.")
|
|
122
|
+
who_parser.add_argument("role", nargs="?", default=DEFAULT_ROLE, help="Role name (default: main).")
|
|
123
|
+
|
|
124
|
+
return parser
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def main(argv: list[str] | None = None) -> int:
|
|
128
|
+
argv = sys.argv[1:] if argv is None else argv
|
|
129
|
+
base = Path.cwd()
|
|
130
|
+
parser = build_parser()
|
|
131
|
+
args = parser.parse_args(argv)
|
|
132
|
+
|
|
133
|
+
if args.command == "init":
|
|
134
|
+
return cmd_init(base)
|
|
135
|
+
if args.command == "new":
|
|
136
|
+
return cmd_new(base, args.role)
|
|
137
|
+
if args.command == "remove":
|
|
138
|
+
return cmd_remove(base, args.role)
|
|
139
|
+
if args.command == "whoami":
|
|
140
|
+
return cmd_whoami(base, args.role)
|
|
141
|
+
|
|
142
|
+
parser.error("Unknown command")
|
|
143
|
+
return 1
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
if __name__ == "__main__":
|
|
147
|
+
sys.exit(main())
|