trading_agent.extensions.installed_packages
¶
The packages installed in workspace/shared/packages/, and what each one brings.
A package is one folder holding any of these:
package.toml optional: [package] name, description, version
skills/ skills, used like the user's installed skills
agents/ subagent definitions, used from milestone 14
mcp_servers.json MCP servers, added to the ones in the project's mcp_servers.json
hooks/
Everything is read in place from the package's folder, so removing a package is deleting its folder, and nothing of a package runs inside the gateway: its MCP servers and hooks are separate processes.
Typical usage example:
packages = InstalledPackages(Path('workspace/shared/packages')) roots = packages.skill_roots()
PackageSummary
dataclass
¶
PackageSummary(name, description, version, skill_names, agent_names, mcp_server_names, hook_events, has_app)
What one package contains.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The package's name, its folder name. |
description |
str
|
Its description from package.toml, or an empty string. |
version |
str
|
Its version from package.toml, or an empty string. |
skill_names |
tuple[str, ...]
|
The folders under skills/ that hold a SKILL.md. |
agent_names |
tuple[str, ...]
|
The Markdown files under agents/, without the suffix. |
mcp_server_names |
tuple[str, ...]
|
The servers in its mcp_servers.json. |
hook_events |
tuple[str, ...]
|
The event folders under hooks/. |
has_app |
bool
|
Whether it has an app.toml. |
describe
¶
Lists the package's contents in one line.
Returns:
| Type | Description |
|---|---|
str
|
Such as "2 skills (a, b); MCP servers: news; hooks for: order_placed". |
Source code in src/trading_agent/extensions/installed_packages.py
InstalledPackages
¶
Finds the installed packages and their parts.
Describes the packages folder without reading it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
packages_directory
|
Path
|
workspace/shared/packages. |
required |
Source code in src/trading_agent/extensions/installed_packages.py
folders
¶
Every installed package's folder.
Returns:
| Type | Description |
|---|---|
list[Path]
|
The folders, sorted by name; hidden folders are skipped. |
Source code in src/trading_agent/extensions/installed_packages.py
skill_roots
¶
The skills/ folders of every package that has one.
Returns:
| Type | Description |
|---|---|
list[Path]
|
The folders. |
hook_roots
¶
The hooks/ folders of every package that has one.
Returns:
| Type | Description |
|---|---|
list[Path]
|
The folders. |
agent_roots
¶
The agents/ folders of every package that has one.
Returns:
| Type | Description |
|---|---|
list[Path]
|
The folders. |
mcp_files
¶
The mcp_servers.json files of every package that has one.
Returns:
| Type | Description |
|---|---|
list[Path]
|
The files. |
summary
¶
Describes one package folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder
|
Path
|
The package's folder, installed or not. |
required |
Returns:
| Type | Description |
|---|---|
PackageSummary
|
Its contents. |
Source code in src/trading_agent/extensions/installed_packages.py
manifest
¶
Reads the [package] table of a folder's package.toml.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder
|
Path
|
The package's folder. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
The table, or an empty dictionary when there is no readable package.toml. |