claude-dev-env 8.113.0 → 8.113.1
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.
|
@@ -7,6 +7,8 @@ import re
|
|
|
7
7
|
ORIGIN_KEY = "origin"
|
|
8
8
|
ORIGIN_KIND_KEY = "kind"
|
|
9
9
|
HUMAN_ORIGIN_KIND = "human"
|
|
10
|
+
RECORD_TYPE_KEY = "type"
|
|
11
|
+
USER_RECORD_TYPE = "user"
|
|
10
12
|
TASK_NOTIFICATION_MARKER = "<task-notification"
|
|
11
13
|
BACKGROUND_EVENT_PATTERN = re.compile(
|
|
12
14
|
r"(?:\A\s*|<system-reminder>\s*)" + re.escape("[SYSTEM NOTIFICATION - NOT USER INPUT]")
|
|
@@ -44,9 +44,11 @@ from hooks_constants.background_silence_prompt_constants import (
|
|
|
44
44
|
ORIGIN_KEY,
|
|
45
45
|
ORIGIN_KIND_KEY,
|
|
46
46
|
QUOTED_LINE_PATTERN,
|
|
47
|
+
RECORD_TYPE_KEY,
|
|
47
48
|
SILENCE_NOTE_TEMPLATE,
|
|
48
49
|
SILENCE_NOTE_WITHOUT_EXCEPTION,
|
|
49
50
|
TASK_NOTIFICATION_MARKER,
|
|
51
|
+
USER_RECORD_TYPE,
|
|
50
52
|
)
|
|
51
53
|
from hooks_constants.hook_specific_output_keys import (
|
|
52
54
|
HOOK_EVENT_NAME_KEY,
|
|
@@ -81,6 +83,8 @@ def _is_user_typed_text(prompt_text: str) -> bool:
|
|
|
81
83
|
|
|
82
84
|
|
|
83
85
|
def _user_words(all_record_fields: dict[str, object]) -> str | None:
|
|
86
|
+
if all_record_fields.get(RECORD_TYPE_KEY) != USER_RECORD_TYPE:
|
|
87
|
+
return None
|
|
84
88
|
origin = all_record_fields.get(ORIGIN_KEY)
|
|
85
89
|
if isinstance(origin, dict) and origin.get(ORIGIN_KIND_KEY) not in (None, HUMAN_ORIGIN_KIND):
|
|
86
90
|
return None
|
|
@@ -171,6 +171,13 @@ def test_should_keep_silence_through_text_that_is_not_the_user_lifting_it(
|
|
|
171
171
|
notification_entry("<task-notification>stay silent unless blocked</task-notification>"),
|
|
172
172
|
typed_entry('<agent-message from="a1">stay silent unless blocked</agent-message>'),
|
|
173
173
|
typed_entry("> stay silent unless blocked\n\nwhy is this so loud?"),
|
|
174
|
+
{
|
|
175
|
+
"type": "api-request-blob",
|
|
176
|
+
"message": {
|
|
177
|
+
"role": "user",
|
|
178
|
+
"content": [{"type": "text", "text": "Summary: stay silent unless blocked"}],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
174
181
|
],
|
|
175
182
|
)
|
|
176
183
|
def test_should_not_set_silence_from_text_that_is_not_the_users_own(
|