Repository navigation
Conversation
3 tasks
CodFrm
added a commit
to scriptscat/scriptcat
that referenced
this pull request
Nov 5, 2026
…间接办法 - dev-loop.md:新增 sctl run / sctl logs 用法与注意事项(只限后台/定时脚本、exit 0 看状态、不经审批但有真实副作用、 手动运行不排重试、debug 级 GM_log 不入库、与编辑器运行或 cron 交叠可能误认),旧 sctl / 旧脚本猫的识别与回退 - background.md:删去无代码依据的「编辑器运行不同步值、菜单不触发」,改为与 sctl run 同一通路 - SKILL.md、api.md:GM_log 的 debug 级别在正式版不入库 - README 已知限制:依赖 scriptscat/sctl#17 与 #1825 的版本
Open
3 tasks
…态不得误认、日志字段容错、MCP 运行等待发进度
- MCP scripts_run 等待期间周期发 progress(文案不提审批),wait:false 与 scripts_logs 不发 - sctl run 被 Ctrl-C 时说明运行可能已在 ScriptCat 中进行,不再说操作已作废 - run 结果日志被截断时提示 sctl logs <uuid>,不再指向 run 没有的筛选参数 - 升级提示同时覆盖旧版 ScriptCat 与旧版 sctl daemon - 修正 error 状态行的悬空冒号与 --timeout 上限的写法 - 补日志表格终端转义与 --since 30m 的测试
- protocol.md/cli.md/mcp.md:run-in 不符、统一超时含排队、wait:false 不排队、取消放弃未触发的排队运行 - METHOD_NOT_FOUND 的来源改为 daemon 的能力检查,并补旧版 daemon 需重启的说明 - mcp.md:scripts_run 等待期间发 progress,如实描述其他 ScriptCat 工具的 progress - 技能说明:logs 的 limit 语义(取最新 N 条、按旧到新打印)与 run-in 失败
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
sctl 无法触发脚本猫的后台/定时脚本运行,也读不到脚本运行日志。这两类脚本跑在 offscreen/sandbox 里,不是网页,sctl 也不能 attach 扩展页面(
PAGE_NOT_AUTOMATABLE),所以 AI 代理写完这类脚本后只能请用户去脚本列表里人工查看。Spec:
docs/specs/2026-11-04-script-run-logs.md(本 PR 前两个提交)。改动
scripts.run、scripts.logs(peerscriptcat,无审批阻塞)。schemaVersion保持 1.0.0:daemon 握手要求版本完全相等(conn.go:367),升版本会让旧版 ScriptCat 连不上,做法与 ✨ daemon 同时接入多个 ScriptCat 实例,修复普通与隐身进程互相顶替 (#14) #16 一致。protocol.md中“scriptcat 定义会改变schemaVersion”的说法已一并更正。生成给 ScriptCat 的 TS 不允许出现level子串,所以日志级别字段叫severity。sctl run <uuid>:默认等待本次运行结束,--timeout默认 60s、上限 240s;--no-wait触发后立即返回。sctl logs <uuid>:支持--since(默认 1h)、--level(映射到severity)、--text、--limit(默认 100,范围 1..1000)。METHOD_NOT_FOUND时附带升级提示,提示文案放在internal/cli/upgradehint,供 MCP 复用。terminalSafe转义后才输出到终端。scripts_run/scripts_logs的参数与 CLI 等价,不发“等待审批”进度,工具描述是静态文本。cli.md、mcp.md、architecture.md、README(中英)、skills/sctl已同步。threat-model.md把这两个操作列入未门控能力,并记录维护者于 2026-11-04 接受的残余风险:持有控制 token 的进程可以反复触发已安装的后台脚本,并读到GM_log过的内容。SCRIPTCAT_REF指向 ScriptCat373a117c。已知限制
GM_log的 debug 级别写进日志库,run/logs看不到 debug 日志。file://路径,来自 jsonschema 的错误格式。关联
SCRIPTCAT_REF。验证
base
2939485…headdc71bef,26 个文件。go test ./... -raceexit 0;make protocol-checkexit 0;golangci-lint run ./...0 issues。SCRIPTCAT_REF比对 exit 1,用373a117c比对 exit 0。docs/verification.md):本分支构建的 daemon 隔离在127.0.0.1:18643、使用临时 data dir,配对由 #1825 构建、在无头 Chromium 中运行的 ScriptCat。spec 的 18 项要求全部通过,包括:--no-wait;INVALID_REQUEST,未知 uuid 返回NOT_FOUND;6c0459b8构建的旧版收到METHOD_NOT_FOUND和升级提示,已有命令照常可用;SCRIPTCAT_AMBIGUOUS。审查修复(2026-11-05)
729a663spec 修订:INVALID_REQUEST;--no-wait不排队;取消时放弃还在排队的运行;62ef80d:scripts_run等待期间发中性进度(“Waiting for the script run to end…”),避免客户端 60 秒左右超时;wait:false和scripts_logs不发。sctl run被 Ctrl-C 时,提示运行可能已在 ScriptCat 中进行,不再说“已作废”。run的日志被截断时,提示改用sctl logs <uuid>查看完整记录。dc71bef:protocol.md、cli.md、mcp.md、skills/sctl按修订后的 spec 更新。验证(head
dc71bef):go test ./... -raceexit 0(我修复后自己重跑的结果),golangci-lint0 个问题,make protocol-checkexit 0。3b0038f5联合做了真实验证。SCRIPTCAT_REF不变。