几个修复:
1. 拉取的名字可选,按每页15个,输入序号,--from选择,--page选择页面;支持中英双语,比如one page next page 下一页、第五页 2. 宝宝及交互,拉取支持先选到终端来源,记得名字输入名字就直接拉,不记得名字输序列号直接拉 3. 新增agents.md,内嵌workbuddy和opencode的skill目录。支持传完整的skill目录压缩包、skill目录或者直接输入wb、oc等。按照名字 键值的队列,括号会忽略。括号里的内容是全称,完整的名字,括号外面的才是真正敲下终端的名字
This commit is contained in:
@@ -393,8 +393,11 @@ def _post(
|
||||
|
||||
# ---------------------------------------------------------------- 端口发现 + 探活
|
||||
def _discover_oc_ports() -> list[int]:
|
||||
"""端口发现:tasklist 找 opencode.exe 的 PID,netstat -ano 找这些 PID 的
|
||||
LISTENING TCP 端口。OC 每次启动端口随机(实测 49374),写死 4096 必 10061。
|
||||
"""端口发现:tasklist 找 opencode 系进程的 PID,netstat -ano 找这些 PID 的
|
||||
LISTENING TCP 端口。OC 每次启动端口随机(实测 49374),写死 4096 必 10061;
|
||||
--port 4097 启动时默认端口探活扑空,全靠这里补中。
|
||||
进程名前缀匹配:既要普通 `opencode.exe`,也要 service 形态
|
||||
`opencode-service-<pid>-<hash>.exe`(tasklist 过滤 eq opencode.exe 会全漏)。
|
||||
任何一步失败都返回 [](回退默认端口),绝不抛异常。与 ocskill 逐字一致。"""
|
||||
if os.name != "nt":
|
||||
return []
|
||||
@@ -412,7 +415,8 @@ def _discover_oc_ports() -> list[int]:
|
||||
pids = set()
|
||||
for line in tl.splitlines():
|
||||
cols = re.findall(r'"([^"]*)"', line) # "opencode.exe","13748","Console",...
|
||||
if len(cols) >= 2 and cols[0].lower() == "opencode.exe" and cols[1].isdigit():
|
||||
# 前缀匹配(非等值):opencode*.exe 覆盖 opencode.exe / opencode-service-*.exe
|
||||
if len(cols) >= 2 and cols[0].lower().startswith("opencode") and cols[1].isdigit():
|
||||
pids.add(cols[1])
|
||||
if not pids:
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user