@oneciel-ai/claude-any 0.1.95 → 0.1.96
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.
- package/claude_any.py +35 -5
- package/package.json +1 -1
package/claude_any.py
CHANGED
|
@@ -105,7 +105,7 @@ OFFICIAL_CHANNEL_PLUGINS = {
|
|
|
105
105
|
"fakechat": "plugin:fakechat@claude-plugins-official",
|
|
106
106
|
}
|
|
107
107
|
APP_NAME = "Claude Any"
|
|
108
|
-
VERSION = "0.1.
|
|
108
|
+
VERSION = "0.1.96"
|
|
109
109
|
CREDITS = "Credits: One Ciel LLC"
|
|
110
110
|
|
|
111
111
|
LOG_LEVELS = {"SILENT": 0, "ERROR": 1, "WARN": 2, "INFO": 3, "DEBUG": 4, "TRACE": 5}
|
|
@@ -14160,20 +14160,41 @@ def _write_fd_all(fd: int, data: bytes) -> None:
|
|
|
14160
14160
|
view = view[written:]
|
|
14161
14161
|
|
|
14162
14162
|
|
|
14163
|
+
def _channel_platform_default_enter_bytes(platform: str | None = None, os_name: str | None = None) -> bytes:
|
|
14164
|
+
sys_platform = str(platform if platform is not None else sys.platform).lower()
|
|
14165
|
+
os_family = str(os_name if os_name is not None else os.name).lower()
|
|
14166
|
+
if os_family == "nt" or sys_platform.startswith(("win", "cygwin", "msys")):
|
|
14167
|
+
return b"\r\n"
|
|
14168
|
+
if os_family == "posix":
|
|
14169
|
+
return b"\r\n"
|
|
14170
|
+
return b"\r\n"
|
|
14171
|
+
|
|
14172
|
+
|
|
14163
14173
|
def _channel_wake_enter_bytes(value: str | bytes | None = None) -> bytes:
|
|
14164
14174
|
raw: str | bytes | None = value
|
|
14165
14175
|
if raw is None:
|
|
14166
14176
|
raw = os.environ.get("CLAUDE_ANY_CHANNEL_WAKE_ENTER")
|
|
14177
|
+
if raw is None:
|
|
14178
|
+
return _channel_platform_default_enter_bytes()
|
|
14167
14179
|
if isinstance(raw, bytes):
|
|
14168
|
-
return raw if raw in (b"\n", b"\r", b"\r\n") else
|
|
14180
|
+
return raw if raw in (b"\n", b"\r", b"\r\n") else _channel_platform_default_enter_bytes()
|
|
14169
14181
|
normalized = str(raw or "").strip().lower()
|
|
14170
|
-
if normalized in {"", "
|
|
14182
|
+
if normalized in {"", "auto", "default", "platform"}:
|
|
14183
|
+
return _channel_platform_default_enter_bytes()
|
|
14184
|
+
if normalized in {"lf", "nl", "newline", "linefeed", "\\n"}:
|
|
14171
14185
|
return b"\n"
|
|
14172
14186
|
if normalized in {"cr", "return", "carriage-return", "carriage_return", "\\r"}:
|
|
14173
14187
|
return b"\r"
|
|
14174
14188
|
if normalized in {"crlf", "cr-lf", "return-newline", "\\r\\n"}:
|
|
14175
14189
|
return b"\r\n"
|
|
14176
|
-
return
|
|
14190
|
+
return _channel_platform_default_enter_bytes()
|
|
14191
|
+
|
|
14192
|
+
|
|
14193
|
+
def _channel_wake_enter_env_is_fixed() -> bool:
|
|
14194
|
+
raw = os.environ.get("CLAUDE_ANY_CHANNEL_WAKE_ENTER")
|
|
14195
|
+
if raw is None:
|
|
14196
|
+
return False
|
|
14197
|
+
return str(raw).strip().lower() not in {"", "auto", "default", "platform"}
|
|
14177
14198
|
|
|
14178
14199
|
|
|
14179
14200
|
def _channel_enter_bytes_from_user_input(data: bytes) -> bytes | None:
|
|
@@ -14269,6 +14290,10 @@ def subprocess_call_with_channel_wake_proxy(cmd: list[str], env: dict[str, str])
|
|
|
14269
14290
|
old_attrs = termios.tcgetattr(stdin_fd)
|
|
14270
14291
|
last_channel_poll = 0.0
|
|
14271
14292
|
channel_enter_bytes = _channel_wake_enter_bytes()
|
|
14293
|
+
router_log(
|
|
14294
|
+
"INFO",
|
|
14295
|
+
f"channel_stdin_proxy_enter_default enter={_channel_enter_label(channel_enter_bytes)} os={os.name} platform={sys.platform}",
|
|
14296
|
+
)
|
|
14272
14297
|
try:
|
|
14273
14298
|
tty.setraw(stdin_fd)
|
|
14274
14299
|
while proc.poll() is None:
|
|
@@ -14280,7 +14305,12 @@ def subprocess_call_with_channel_wake_proxy(cmd: list[str], env: dict[str, str])
|
|
|
14280
14305
|
data = os.read(stdin_fd, 4096)
|
|
14281
14306
|
if data:
|
|
14282
14307
|
observed_enter = _channel_synthetic_enter_bytes_from_user_input(data)
|
|
14283
|
-
if observed_enter and not
|
|
14308
|
+
if observed_enter and not _channel_wake_enter_env_is_fixed():
|
|
14309
|
+
if observed_enter != channel_enter_bytes:
|
|
14310
|
+
router_log(
|
|
14311
|
+
"INFO",
|
|
14312
|
+
f"channel_stdin_proxy_enter_observed enter={_channel_enter_label(observed_enter)}",
|
|
14313
|
+
)
|
|
14284
14314
|
channel_enter_bytes = observed_enter
|
|
14285
14315
|
_write_fd_all(master_fd, data)
|
|
14286
14316
|
if master_fd in readable:
|
package/package.json
CHANGED