kimi-agent-module-api 2.0.0__tar.gz → 2.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.
- {kimi_agent_module_api-2.0.0/src/kimi_agent_module_api.egg-info → kimi_agent_module_api-2.1.0}/PKG-INFO +12 -8
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/README.md +11 -7
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/pyproject.toml +1 -1
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/tools.py +3 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0/src/kimi_agent_module_api.egg-info}/PKG-INFO +12 -8
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/tests/test_contracts.py +5 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/LICENSE +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/setup.cfg +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/__init__.py +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/contracts.py +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/events.py +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/images.py +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/py.typed +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/settings.py +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/testing.py +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/trust.py +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api.egg-info/SOURCES.txt +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api.egg-info/dependency_links.txt +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api.egg-info/requires.txt +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api.egg-info/top_level.txt +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/tests/test_public_api.py +0 -0
- {kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/tests/test_testing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kimi-agent-module-api
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Stable contracts for community-built assistant modules
|
|
5
5
|
Author: Webhead
|
|
6
6
|
License-Expression: MIT
|
|
@@ -69,23 +69,27 @@ documents installation, declarations, lifecycle, and every runtime port. The
|
|
|
69
69
|
[reference module](https://github.com/webhead2oo9/kimi-agent/tree/main/bot/modules/example)
|
|
70
70
|
is a complete, commented example that exercises most ports; start there.
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Modules using guild-scoped live command replacement through
|
|
73
73
|
`InteractionRouter.replace_guild_commands()` should require the host capability
|
|
74
74
|
`discord.guild_commands.v1`.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
The SDK provides typed modal forms and a narrow Components V2 layout model. Once a response uses
|
|
77
77
|
that layout model, Discord requires every later edit of the same message to remain a layout.
|
|
78
78
|
Modules using them should require
|
|
79
79
|
`discord.modals.v1` and/or `discord.components_v2.v1`.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Message-deletion events include cached author classification:
|
|
82
82
|
`MessageDeleteEvent.author_is_bot` and `MessageBulkDeleteEvent.bot_message_ids`.
|
|
83
83
|
The values remain unknown for messages that were absent from Discord's cache.
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Modules
|
|
88
|
-
|
|
85
|
+
SDK 2.1 adds `ModuleToolContext.trigger_discord_message_id`. Mention-path tool
|
|
86
|
+
calls receive the exact source Discord message snowflake; other surfaces receive
|
|
87
|
+
`None`. Modules that act on a user's source message should require
|
|
88
|
+
`kimi-agent-module-api>=2.1,<3`, reject `None`, fetch that exact message through
|
|
89
|
+
`ctx.discord`, and verify its author before acting.
|
|
90
|
+
|
|
91
|
+
Modules use namespaced guild documents and the physical table names returned
|
|
92
|
+
by `ctx.storage.table()`.
|
|
89
93
|
|
|
90
94
|
## Testing the SDK
|
|
91
95
|
|
|
@@ -52,23 +52,27 @@ documents installation, declarations, lifecycle, and every runtime port. The
|
|
|
52
52
|
[reference module](https://github.com/webhead2oo9/kimi-agent/tree/main/bot/modules/example)
|
|
53
53
|
is a complete, commented example that exercises most ports; start there.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Modules using guild-scoped live command replacement through
|
|
56
56
|
`InteractionRouter.replace_guild_commands()` should require the host capability
|
|
57
57
|
`discord.guild_commands.v1`.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
The SDK provides typed modal forms and a narrow Components V2 layout model. Once a response uses
|
|
60
60
|
that layout model, Discord requires every later edit of the same message to remain a layout.
|
|
61
61
|
Modules using them should require
|
|
62
62
|
`discord.modals.v1` and/or `discord.components_v2.v1`.
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Message-deletion events include cached author classification:
|
|
65
65
|
`MessageDeleteEvent.author_is_bot` and `MessageBulkDeleteEvent.bot_message_ids`.
|
|
66
66
|
The values remain unknown for messages that were absent from Discord's cache.
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Modules
|
|
71
|
-
|
|
68
|
+
SDK 2.1 adds `ModuleToolContext.trigger_discord_message_id`. Mention-path tool
|
|
69
|
+
calls receive the exact source Discord message snowflake; other surfaces receive
|
|
70
|
+
`None`. Modules that act on a user's source message should require
|
|
71
|
+
`kimi-agent-module-api>=2.1,<3`, reject `None`, fetch that exact message through
|
|
72
|
+
`ctx.discord`, and verify its author before acting.
|
|
73
|
+
|
|
74
|
+
Modules use namespaced guild documents and the physical table names returned
|
|
75
|
+
by `ctx.storage.table()`.
|
|
72
76
|
|
|
73
77
|
## Testing the SDK
|
|
74
78
|
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/tools.py
RENAMED
|
@@ -29,6 +29,9 @@ class ModuleToolContext:
|
|
|
29
29
|
trust_tier: TrustTier
|
|
30
30
|
# Operator per-tool configuration from ``<CONFIG_DIR>/tools/<tool>.md``.
|
|
31
31
|
tool_configs: Mapping[str, Mapping[str, Any]] = field(default_factory=dict)
|
|
32
|
+
# Discord message that initiated this model turn. It is absent for personal
|
|
33
|
+
# app commands and other surfaces that are not rooted in a Discord message.
|
|
34
|
+
trigger_discord_message_id: int | None = None
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
type ModuleToolHandler = Callable[[dict[str, Any], ModuleToolContext], Coroutine[Any, Any, str]]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kimi-agent-module-api
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Stable contracts for community-built assistant modules
|
|
5
5
|
Author: Webhead
|
|
6
6
|
License-Expression: MIT
|
|
@@ -69,23 +69,27 @@ documents installation, declarations, lifecycle, and every runtime port. The
|
|
|
69
69
|
[reference module](https://github.com/webhead2oo9/kimi-agent/tree/main/bot/modules/example)
|
|
70
70
|
is a complete, commented example that exercises most ports; start there.
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Modules using guild-scoped live command replacement through
|
|
73
73
|
`InteractionRouter.replace_guild_commands()` should require the host capability
|
|
74
74
|
`discord.guild_commands.v1`.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
The SDK provides typed modal forms and a narrow Components V2 layout model. Once a response uses
|
|
77
77
|
that layout model, Discord requires every later edit of the same message to remain a layout.
|
|
78
78
|
Modules using them should require
|
|
79
79
|
`discord.modals.v1` and/or `discord.components_v2.v1`.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Message-deletion events include cached author classification:
|
|
82
82
|
`MessageDeleteEvent.author_is_bot` and `MessageBulkDeleteEvent.bot_message_ids`.
|
|
83
83
|
The values remain unknown for messages that were absent from Discord's cache.
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Modules
|
|
88
|
-
|
|
85
|
+
SDK 2.1 adds `ModuleToolContext.trigger_discord_message_id`. Mention-path tool
|
|
86
|
+
calls receive the exact source Discord message snowflake; other surfaces receive
|
|
87
|
+
`None`. Modules that act on a user's source message should require
|
|
88
|
+
`kimi-agent-module-api>=2.1,<3`, reject `None`, fetch that exact message through
|
|
89
|
+
`ctx.discord`, and verify its author before acting.
|
|
90
|
+
|
|
91
|
+
Modules use namespaced guild documents and the physical table names returned
|
|
92
|
+
by `ctx.storage.table()`.
|
|
89
93
|
|
|
90
94
|
## Testing the SDK
|
|
91
95
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from importlib.metadata import version
|
|
5
6
|
import dataclasses
|
|
6
7
|
from typing import Any
|
|
7
8
|
|
|
@@ -82,6 +83,10 @@ def test_spec_and_runtime_context_keep_stable_defaults() -> None:
|
|
|
82
83
|
assert {"events", "scheduler", "storage", "discord", "interactions", "services"} <= required
|
|
83
84
|
|
|
84
85
|
|
|
86
|
+
def test_distribution_version_includes_trigger_message_contract() -> None:
|
|
87
|
+
assert version("kimi-agent-module-api") == "2.1.0"
|
|
88
|
+
|
|
89
|
+
|
|
85
90
|
def test_spec_requires_an_explicit_keyword_api_version() -> None:
|
|
86
91
|
def create(_ctx: ModuleLoadContext) -> AppModule:
|
|
87
92
|
raise AssertionError("not called")
|
|
File without changes
|
|
File without changes
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/__init__.py
RENAMED
|
File without changes
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/contracts.py
RENAMED
|
File without changes
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/events.py
RENAMED
|
File without changes
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/images.py
RENAMED
|
File without changes
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/py.typed
RENAMED
|
File without changes
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/settings.py
RENAMED
|
File without changes
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/testing.py
RENAMED
|
File without changes
|
{kimi_agent_module_api-2.0.0 → kimi_agent_module_api-2.1.0}/src/kimi_agent_module_api/trust.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|