@oneciel-ai/claude-any 0.1.94 → 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 +53 -11
- 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}
|
|
@@ -1272,7 +1272,7 @@ DEFAULT_CONFIG: dict[str, Any] = {
|
|
|
1272
1272
|
"compat_prompt_for_non_anthropic": True,
|
|
1273
1273
|
"channels": [],
|
|
1274
1274
|
"development_channels": False,
|
|
1275
|
-
"channel_delivery": "
|
|
1275
|
+
"channel_delivery": "native",
|
|
1276
1276
|
},
|
|
1277
1277
|
"cleanup": {
|
|
1278
1278
|
"managed_services_on_launch": True,
|
|
@@ -1464,6 +1464,16 @@ def apply_config_migrations(cfg: dict[str, Any]) -> None:
|
|
|
1464
1464
|
pcfg["stream_enabled"] = True
|
|
1465
1465
|
migrations[marker] = True
|
|
1466
1466
|
|
|
1467
|
+
marker = "default_channel_delivery_native_20260520"
|
|
1468
|
+
if not migrations.get(marker):
|
|
1469
|
+
ccfg = cfg.setdefault("claude_code", {})
|
|
1470
|
+
if not isinstance(ccfg, dict):
|
|
1471
|
+
ccfg = {}
|
|
1472
|
+
cfg["claude_code"] = ccfg
|
|
1473
|
+
if normalize_channel_delivery(ccfg.get("channel_delivery")) == "stdin":
|
|
1474
|
+
ccfg["channel_delivery"] = "native"
|
|
1475
|
+
migrations[marker] = True
|
|
1476
|
+
|
|
1467
1477
|
|
|
1468
1478
|
_config_cache: dict[str, Any] | None = None
|
|
1469
1479
|
_config_cache_mtime: float = 0.0
|
|
@@ -9687,9 +9697,11 @@ def normalize_channel_delivery(value: Any) -> str:
|
|
|
9687
9697
|
text = str(value or "").strip().lower().replace("_", "-")
|
|
9688
9698
|
if text in {"native", "native-channel", "native-channel-bridge", "claude-channel", "claude/native"}:
|
|
9689
9699
|
return "native"
|
|
9690
|
-
if text in {"stdin", "pty", "terminal", "wake", "wake-proxy", "legacy"
|
|
9700
|
+
if text in {"stdin", "pty", "terminal", "wake", "wake-proxy", "legacy"}:
|
|
9691
9701
|
return "stdin"
|
|
9692
|
-
|
|
9702
|
+
if text in {"auto", ""}:
|
|
9703
|
+
return "native"
|
|
9704
|
+
return "native"
|
|
9693
9705
|
|
|
9694
9706
|
|
|
9695
9707
|
def channel_delivery_mode(cfg: dict[str, Any] | None = None) -> str:
|
|
@@ -9697,7 +9709,7 @@ def channel_delivery_mode(cfg: dict[str, Any] | None = None) -> str:
|
|
|
9697
9709
|
if env_value is not None:
|
|
9698
9710
|
return normalize_channel_delivery(env_value)
|
|
9699
9711
|
cfg = cfg or load_config()
|
|
9700
|
-
return normalize_channel_delivery(cfg.setdefault("claude_code", {}).get("channel_delivery", "
|
|
9712
|
+
return normalize_channel_delivery(cfg.setdefault("claude_code", {}).get("channel_delivery", "native"))
|
|
9701
9713
|
|
|
9702
9714
|
|
|
9703
9715
|
def set_channel_delivery_config(value: Any) -> list[str]:
|
|
@@ -13120,11 +13132,11 @@ def channel_panel_rows(cfg: dict[str, Any]) -> tuple[list[str], list[str]]:
|
|
|
13120
13132
|
def channel_delivery_panel_rows(cfg: dict[str, Any]) -> tuple[list[str], list[str]]:
|
|
13121
13133
|
current = channel_delivery_mode(cfg)
|
|
13122
13134
|
rows = [
|
|
13123
|
-
f"{'*' if current == 'stdin' else ' '} stdin PTY wake proxy; works broadly, uses terminal input",
|
|
13124
13135
|
f"{'*' if current == 'native' else ' '} native Claude Code claude/channel queue bridge",
|
|
13136
|
+
f"{'*' if current == 'stdin' else ' '} stdin PTY wake proxy; works broadly, uses terminal input",
|
|
13125
13137
|
"Back",
|
|
13126
13138
|
]
|
|
13127
|
-
return rows, ["
|
|
13139
|
+
return rows, ["native", "stdin", "back"]
|
|
13128
13140
|
|
|
13129
13141
|
|
|
13130
13142
|
def api_key_panel_rows(provider: str) -> tuple[list[str], list[str]]:
|
|
@@ -14148,20 +14160,41 @@ def _write_fd_all(fd: int, data: bytes) -> None:
|
|
|
14148
14160
|
view = view[written:]
|
|
14149
14161
|
|
|
14150
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
|
+
|
|
14151
14173
|
def _channel_wake_enter_bytes(value: str | bytes | None = None) -> bytes:
|
|
14152
14174
|
raw: str | bytes | None = value
|
|
14153
14175
|
if raw is None:
|
|
14154
14176
|
raw = os.environ.get("CLAUDE_ANY_CHANNEL_WAKE_ENTER")
|
|
14177
|
+
if raw is None:
|
|
14178
|
+
return _channel_platform_default_enter_bytes()
|
|
14155
14179
|
if isinstance(raw, bytes):
|
|
14156
|
-
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()
|
|
14157
14181
|
normalized = str(raw or "").strip().lower()
|
|
14158
|
-
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"}:
|
|
14159
14185
|
return b"\n"
|
|
14160
14186
|
if normalized in {"cr", "return", "carriage-return", "carriage_return", "\\r"}:
|
|
14161
14187
|
return b"\r"
|
|
14162
14188
|
if normalized in {"crlf", "cr-lf", "return-newline", "\\r\\n"}:
|
|
14163
14189
|
return b"\r\n"
|
|
14164
|
-
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"}
|
|
14165
14198
|
|
|
14166
14199
|
|
|
14167
14200
|
def _channel_enter_bytes_from_user_input(data: bytes) -> bytes | None:
|
|
@@ -14257,6 +14290,10 @@ def subprocess_call_with_channel_wake_proxy(cmd: list[str], env: dict[str, str])
|
|
|
14257
14290
|
old_attrs = termios.tcgetattr(stdin_fd)
|
|
14258
14291
|
last_channel_poll = 0.0
|
|
14259
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
|
+
)
|
|
14260
14297
|
try:
|
|
14261
14298
|
tty.setraw(stdin_fd)
|
|
14262
14299
|
while proc.poll() is None:
|
|
@@ -14268,7 +14305,12 @@ def subprocess_call_with_channel_wake_proxy(cmd: list[str], env: dict[str, str])
|
|
|
14268
14305
|
data = os.read(stdin_fd, 4096)
|
|
14269
14306
|
if data:
|
|
14270
14307
|
observed_enter = _channel_synthetic_enter_bytes_from_user_input(data)
|
|
14271
|
-
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
|
+
)
|
|
14272
14314
|
channel_enter_bytes = observed_enter
|
|
14273
14315
|
_write_fd_all(master_fd, data)
|
|
14274
14316
|
if master_fd in readable:
|
package/package.json
CHANGED