kodelet-sdk 0.5.2__tar.gz → 0.5.3__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.
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/PKG-INFO +1 -1
- kodelet_sdk-0.5.3/VERSION.txt +1 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/api.py +7 -1
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/test_api.py +16 -3
- kodelet_sdk-0.5.2/VERSION.txt +0 -1
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/.github/workflows/ci.yml +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/.github/workflows/release.yml +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/.gitignore +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/AGENTS.md +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/LICENSE +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/Makefile +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/README.md +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/examples/review/kodelet-extension-review +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/examples/review/reviewer-prompt.md +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/examples/sdk/README.md +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/examples/sdk/basic-agent-session +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/examples/sdk/inline-extension-session +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/examples/sdk/streaming-agent-session +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/examples/workspace/kodelet-extension-workspace +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/pyproject.toml +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/__init__.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/_utils.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/agent/__init__.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/agent/client.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/agent/relay.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/agent/rpc.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/agent/session.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/agent/transport.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/agent/types.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/context.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/execution.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/py.typed +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/runtime.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/schemas.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/task_progress.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/template.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/src/kodelet_sdk/test_harness.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/fixtures/workspace_policy_extension.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/test_acp_transport.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/test_agent.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/test_examples.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/test_execution.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/test_persistent_ui.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/test_runtime.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/tests/test_task_progress.py +0 -0
- {kodelet_sdk-0.5.2 → kodelet_sdk-0.5.3}/uv.lock +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.5.3
|
|
@@ -254,10 +254,16 @@ class UserMessageEvent(ExtensionEvent):
|
|
|
254
254
|
|
|
255
255
|
|
|
256
256
|
class AgentInitEvent(ExtensionEvent):
|
|
257
|
-
"""Event payload passed to ``agent.init`` handlers.
|
|
257
|
+
"""Event payload passed to ``agent.init`` handlers.
|
|
258
|
+
|
|
259
|
+
``allowedTools`` contains the current tool allowlist, including patches from
|
|
260
|
+
earlier host-dispatched init handlers. An empty list means no tools are allowed.
|
|
261
|
+
Older hosts may omit it; use ``event.get("allowedTools")`` for compatibility.
|
|
262
|
+
"""
|
|
258
263
|
|
|
259
264
|
event: Literal["agent.init"]
|
|
260
265
|
systemPrompt: str | None
|
|
266
|
+
allowedTools: list[str] | None
|
|
261
267
|
|
|
262
268
|
|
|
263
269
|
class TurnStartEvent(ExtensionEvent):
|
|
@@ -11,6 +11,7 @@ from typing import TYPE_CHECKING, Any, assert_type
|
|
|
11
11
|
import pytest
|
|
12
12
|
|
|
13
13
|
from kodelet_sdk import (
|
|
14
|
+
AgentInitEvent,
|
|
14
15
|
BackgroundTaskLease,
|
|
15
16
|
BaseModel,
|
|
16
17
|
CommandContext,
|
|
@@ -883,12 +884,24 @@ def test_tool_context_runner_identity_comes_from_initialize_metadata() -> None:
|
|
|
883
884
|
|
|
884
885
|
|
|
885
886
|
@pytest.mark.asyncio
|
|
886
|
-
|
|
887
|
+
@pytest.mark.parametrize(
|
|
888
|
+
"tool_payload",
|
|
889
|
+
[{"allowedTools": ["bash", "subagent"]}, {"allowedTools": []}, {"allowedTools": None}, {}],
|
|
890
|
+
)
|
|
891
|
+
async def test_agent_init_can_disable_tools_using_invoked_by_context(
|
|
892
|
+
tool_payload: dict[str, list[str] | None],
|
|
893
|
+
) -> None:
|
|
887
894
|
ext = Extension()
|
|
888
895
|
|
|
889
896
|
@ext.on("agent.init")
|
|
890
|
-
async def disable_recursive_tool(
|
|
897
|
+
async def disable_recursive_tool(event: AgentInitEvent, ctx: EventContext) -> EventResult:
|
|
891
898
|
assert ctx.invoked_by == "subagent"
|
|
899
|
+
assert event.get("allowedTools") == tool_payload.get("allowedTools")
|
|
900
|
+
if tool_payload.get("allowedTools") is not None:
|
|
901
|
+
assert_type(event.allowedTools, list[str] | None)
|
|
902
|
+
assert event.allowedTools == tool_payload["allowedTools"]
|
|
903
|
+
else:
|
|
904
|
+
assert "allowedTools" not in event
|
|
892
905
|
return {"tools": {"disable": ["subagent"]}}
|
|
893
906
|
|
|
894
907
|
harness = await create_test_harness(ext)
|
|
@@ -896,7 +909,7 @@ async def test_agent_init_can_disable_tools_using_invoked_by_context() -> None:
|
|
|
896
909
|
{
|
|
897
910
|
"id": "evt-agent-init",
|
|
898
911
|
"event": "agent.init",
|
|
899
|
-
"payload": {"systemPrompt": "base"},
|
|
912
|
+
"payload": {"systemPrompt": "base", **tool_payload},
|
|
900
913
|
"context": {"invokedBy": "subagent"},
|
|
901
914
|
}
|
|
902
915
|
)
|
kodelet_sdk-0.5.2/VERSION.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.5.2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|