mirror of
https://github.com/makecindy/cindy.git
synced 2026-12-02 02:21:07 +08:00
feature/plugin-network-credentials
12 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5577e963bb |
feat(plugins): 复用宿主存储并开放跨插件副本分享
Signed-off-by: liugaowei <liugaowei@xd.com> |
||
|
|
509623aa7f |
feat(plugins): 将插件创建统一为内置 Skill (#6433)
* feat(plugins): unify plugin authoring in a built-in skill Signed-off-by: xd-bobo <caojianbo@xd.com> * fix(plugins): prioritize the built-in creator command Signed-off-by: xd-bobo <caojianbo@xd.com> * fix(plugins): preserve authoring guide line endings on Windows Signed-off-by: xd-bobo <caojianbo@xd.com> * docs(plugins): route creation help through the built-in entry Signed-off-by: xd-bobo <caojianbo@xd.com> * fix(plugins): resolve the built-in creator in the final task environment Signed-off-by: xd-bobo <caojianbo@xd.com> * fix(plugins): 在最终 worktree 中解析内置创建技能 Signed-off-by: xd-bobo <caojianbo@xd.com> * fix(plugins): 语音回填保留内置创建技能身份 Signed-off-by: xd-bobo <caojianbo@xd.com> * fix(plugins): 恢复与重试时持续核验内置技能身份 Signed-off-by: xd-bobo <caojianbo@xd.com> * fix(plugins): 在首条消息交接与最终分派中保留内置身份 Signed-off-by: xd-bobo <caojianbo@xd.com> * docs(plugins): 统一内置创作手册中的插件术语 Signed-off-by: xd-bobo <caojianbo@xd.com> --------- Signed-off-by: xd-bobo <caojianbo@xd.com> |
||
|
|
c950b50464 |
fix(plugins): 修复 0.1.105 作品库读写变慢与重装后作品库变空 (#5967)
* fix(plugins): 企业市场重装时接回升级前卸载留下的作品库 在 0.1.104 卸载企业插件、升级后再从企业市场安装时,新版本没有这个插件的 实例记录,于是分配了 _ns__<org>__<id> 新键。原来按裸 id 存的作品库还在磁盘上, 但不再被打开,用户只看到演示画布。 现在实例注册表里没有占用裸键的记录时,如果市场账本里有同一插件的 升级前组织级记录(同 pluginId、已卸载、未打 namespace 标记、组织 id 与 当前组织一致),这次安装就收回裸键。效果和升级普查确认过的旧安装一致, 作品库、目录绑定都原样接回。缺少任一证据时仍按新规则分配新键。 Signed-off-by: fattycat <fattycat.u@gmail.com> * perf(plugins): 作品库请求复核目标时只读当前插件 作品库请求在每次 await 之后都要复核目标插件没有被卸载、停用或换版本。 #5753 之后每次复核都走完整的 list():同步整个实例注册表、重读每个插件的 收据和市场账本。一次请求约 20 次,插件越多越慢。 现在复核改用 findInstalledInstance:用内存里的注册表定位这个实例,只按 list() 同一套投影读它自己的收据。注册表不可用、实例未启用或目录不在时仍回到 完整查找。每次复核里的资格检查和目标比较也合用同一次查找。 测试沙箱(4 个插件)装好 Mivo Canvas 后首次存档 88 个文件: - 修复前:p50 9.4 秒,p90 13.3 秒 - 修复后:p50 4.0 秒,p90 4.9 秒(两次一致) - 0.1.104:约 3 秒 Signed-off-by: fattycat <fattycat.u@gmail.com> * feat(plugins): 本地装过的插件改从企业市场装时,询问是否接回旧作品库 上一个提交只在市场账本能证明归属时自动接回旧作品库。以前从本地 .cindy 导入、内容又和市场版不同的安装,账本里没有组织证据,重装后仍会从空库开始。 现在用户从企业市场首次安装、且本机按裸 id 还留着作品库(默认位置或自选位置) 时,在安装确认之后用系统对话框询问是否接回: - 选「接回」:这次安装收回裸 id,作品库和目录绑定原样接上,不搬文件; - 选「不接回」、对话框无法显示、后台或默认安装:仍按新规则使用新键,旧数据留在原处。 账本已有证据时照旧自动接回、不再询问。用户确认也只能顶替一条已停用、 从未属于企业的旧记录;属于其他企业的旧记录始终不让出裸 id。 Signed-off-by: fattycat <fattycat.u@gmail.com> * feat(plugins): 设置页可接回裸 id 下遗留的旧作品库 已经在 0.1.105 上重装、拿到新实例键空库的用户,旧作品库还按裸 id 留在 本机。插件详情页的作品库区现在会提示「这台电脑上还有这个插件以前留下的 作品数据」,并提供「接回以前的作品数据」。 只在这些条件都成立时提示:当前实例用新键且仍在默认位置;裸 id 下的旧库 带卸载标记、身份是裸 id;裸 id 没有被已装插件或其他企业的记录占用。 用户在 Main 的确认框里确认后: - 先停掉插件运行进程,关闭两边的作品库会话; - 当前作品数据(含暂存区)移入作品库回收站,保留 30 天; - 旧库改名到当前实例键(自定义位置由 binding store 搬),改身份记录与暂存区; - 恢复插件进程,并通知各窗口里该插件的面板从磁盘重新加载,避免面板或进程 把内存里的旧状态写回接回来的库。 动手前写日志,每一步都可以重跑;中途中断后,下次作品库请求或打开设置页时 先按日志做完。日志确认不存在后,后续请求不再读文件。 Signed-off-by: fattycat <fattycat.u@gmail.com> * docs(plugins): 作品库规范补充重装接回与设置页接回 布局里的 <ghostId> 实际是实例键;卸载不删一节补上企业市场重装接回、安装时询问、设置页接回三条路径与它们的安全边界。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 设置页接回作品库补齐评审意见 - 接回前卸下插件面板,换完清掉该实例的 Electron 分区存储,再重启运行时、 让面板重新挂上,避免旧库的缓存写进接回的库。 - 接回时清掉 meta 里卸载留下的 orphaned,设置页不再误显示「插件已卸载」。 - 没有 .cindy-library 的旧目录也能接回,提示为「来源不明」,接回时补写 meta。 - 裸 id 下仍有启用中的安装(如本地版)时,提示旧数据正被占用,不给接回按钮。 Signed-off-by: fattycat <fattycat.u@gmail.com> * perf(plugins): 按实例键查插件时只读这一个实例 findGhostForInstanceId 每次都走完整的 list()(同步注册表、读每个插件的收据和 市场账本)。插件请求每一步都要复核目标,KV、通用请求入口、网络和文件槽都经过 这里,所以装的插件越多,所有插件请求都越慢。 精确的实例键改走 GhostManager.findInstalledInstance,只读这一个实例;带 namespace 或按插件 id 查找时仍走完整列表。作品库原先单独的快路径并入这里。 23 个插件的测试沙箱里,Mivo Canvas 首次存档 90 个文件:p50 7.8 秒降到 3.8 秒, 存档期间 list() 调用从每 5 秒约 200 次降到约 10 次。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 作品库接回日志的恢复与校验按评审收紧 - 接回没续完时只拦日志里的两个库;恢复失败后其他插件的作品库照常读写, 也不再被无关请求反复重试。 - 日志里的 fromId / toId 必须是合法的作品库身份,回收站名不能是 . 或 ..。 - 写完日志后刷盘所在目录,再移动任何作品库。 - 自定义位置的旧库在写日志前确认能按目录身份搬;不提供 inode 的卷直接拒绝, 不会先把当前库移进回收站。 - 回收站里已有目标就算这一步做完,不再依赖 ino 为 0 时分不出新旧库的目录身份。 - 设置页认旧库不再要求卸载标记:自定义位置的标记会落在默认根,裸 id 下没有 安装已足以说明是遗留库。 - 补测:带真实上传任务的暂存区在只改了一部分时中断,按日志续完。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 换库时关掉旧页,清缓存失败不恢复插件 回应第二轮 Codex review: - 面板与后台页走同源 BroadcastChannel,Main 不在中间,只通知面板卸下不够。 换库前和清分区前,Main 都关掉该实例分区里仍开着的页面并等它们销毁。 - 清分区失败重试一次;仍失败时插件保持停止、作品库保持拦截、面板不重新挂上, 提示用户重启 Cindy。 - 没有身份文件的旧库:建好 .cindy-library、还没写 meta 时中断,重跑会补写 meta,而不是一直失败;meta 写入落盘。 - 设置页接回失败只给界面通用文案,原始错误(可能含绝对路径)留在 Main 日志。 - 未完成的接回只在真正打开作品库的请求里续完;能力查询、非法请求和资格不符的 插件不再触发停插件、搬目录。 Signed-off-by: fattycat <fattycat.u@gmail.com> * test(plugins): cindy-ghost:// 目标复核不因其他插件全量扫描 回应 #5983:用生产里接到协议 handler 的 guard(captureTarget / isTargetCurrent)和 /wake 回调,接真实 GhostManager 装 14 个插件: - 注册后 40 次资源请求的前后复核和一次 wake 都不调 list()、不扫目录; - 同名的 root 与组织实例不串用,裸 id 指向两份安装时两边都不打开; - 卸载、重装(收据替换)和换账号后旧目标被拒,当前目标照常通过。 撤掉 findGhostForInstanceId 的单实例快路径时第一条用例失败。 Signed-off-by: fattycat <fattycat.u@gmail.com> * perf(plugins): 面板点击和按键复核时只读这一个实例 webview-security 在面板里每次 mouseDown / keyDown 都调 resolveGhostWebviewAttach 复核挂载授权,它仍用 availableGhosts() 全量重扫 所有插件(#5983 验收 profile 里剩下的大头,连带其中的 syncInstanceRegistry)。 分区声明里已经是实例键,改走 findGhostForInstanceId 的单实例快路径;实例键 必须与安装完全一致、入口路径必须声明过等校验不变。 回归测试补一条:装 14 个插件,40 次点击/按键复核不调 list()。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 换库后缓存清不掉时,插件在重启前不能再启动 回应 Greptile:清分区连续失败后,只是没重启插件、继续拦作品库,Main 没有 记住这个实例要等应用重启;用户重开面板、/wake 或重载都会把插件拉起来, 带着没清掉的缓存运行。 Main 记下这个实例(按 owner 区分,只在内存里,重启应用即清空,分区本来也是 内存分区),面板挂载(resolveGhostWebviewAttach)、插件运行时 spawn 和 Node 运行时启动(startWorkerWithRetry,含常驻与恢复)都先查它,命中就拒绝并给出 需要重启的提示。 补测试:三处入口在实例被记下时拒绝启动,解除后照常。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 换库需重启提示的繁中文案用「插件」 i18n 术语表规定 Plugin 在 zh-TW 也译作「插件」,「外掛」是禁用译法, verify-checks 的 check:i18n-glossary 因此失败。 Signed-off-by: fattycat <fattycat.u@gmail.com> * test(plugins): 实例查找的账号边界断言改为检查快路径本身 marketGhostSessionBoundary 用源码断言 findGhostForInstanceId 不能有 `if (namespace === undefined)` 分支,守的是账号切换途中插件读取一律失败。 单实例快路径正是这个分支,它在查找前先判账号边界、命中后仍过当前会话可用性 过滤,语义没变,但旧断言让 CI 失败。改为断言快路径里先判账号边界、 再保留可用性过滤。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 接回前预检自定义目标,删日志前把换库落盘 回应 Codex: - 自定义位置的旧库在写日志前调 LibraryBindingStore.assertCanRelocateBinding, 目标已有 binding 或自定义父目录下已有同名目录时直接拒绝,什么都不动; 之前要等当前库进了回收站才在搬 binding 时失败,之后每次续完都失败。 - 删日志前把回收站、库与暂存区的父目录以及两边 .cindy-library 刷盘,删完再刷 日志所在目录;meta 改名的写入也 fsync 文件和目录。避免断电后日志没了、 目录或身份却还停在半路。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 接回续完时固定日志路径,删除前复核账号 回应 Greptile:上一轮在删日志前加了刷盘,刷盘的几次 await 之后没有再复核 账号,日志路径又在删除时按当前账号现算。设置页打开作品库概览也会触发续完, 这条路径不挡账号切换;刷盘期间切了账号,就会删掉新账号的 library-reattach.json。 续完开始时固定本次的日志路径,刷盘结束、删除之前再调一次 assertCurrent。 补测试:刷盘期间切账号时,本账号日志保留、另一个账号的日志不被碰;去掉修复时 用例失败。 Signed-off-by: fattycat <fattycat.u@gmail.com> --------- Signed-off-by: fattycat <fattycat.u@gmail.com> |
||
|
|
93f1393143 |
feat(plugins): 按 namespace 识别并隔离插件实例 (#5753)
* feat(plugin-protocol): 补上 namespace 投递和插件身份 投递用的 namespace 可以是 slug,也可以显式传 null 表示 root,还可以省略。 省略是旧记录,不是 root。Manifest 仍然不能自己声明 namespace。 共用的辅助函数只把已经核对过的安装身份编成目录和 storage part,不从路径反推。 Signed-off-by: fattycat <fattycat.u@gmail.com> * feat(plugins): 登记实例并保留旧安装 每次安装都按所在目录得到一个稳定的实例键,记在这个数据所有者自己的注册表里。 存储、运行时、凭证和权限都用这个键,不再用裸插件 id。旧安装继续运行; namespace 只有拿到正面证据才会确认。旧客户端改写 receipt,不能丢掉企业身份或它的数据。 行为变化: - 删除了 Filo Google 自动搬账和构建期 OAuth client 注入 - 本地 mivo-canvas 的 OIDC 例外保留为临时规则,只对 root 实例生效 - Mivo 历史密钥只认裸 id xd-mivo - 用户装入通道的保留前缀只剩 cindy- - 新建插件 ID 必须以字母开头 Signed-off-by: fattycat <fattycat.u@gmail.com> * feat(plugins): Agent 工具和输入框按 namespace 寻址插件 Agent 工具、斜杠命令和输入框菜单使用插件 id,也可以带上 namespace。 同名有多份安装时视为无法区分,不会悄悄选中公开版。 共享的输入框清单带上实例键,远程菜单才能选中它展示的那一份。 Signed-off-by: fattycat <fattycat.u@gmail.com> * feat(plugins): 移动端按 namespace 寻址已安装插件 移动端的调用标题和插件页使用和桌面端相同的实例身份。 带 namespace 的安装不能再用裸插件 id 寻址,远程资源链接也一样。 Signed-off-by: fattycat <fattycat.u@gmail.com> * docs(plugins): 写明 namespace 寻址和实例注册表 记下实例注册表、storage key 的编码,以及「没有 namespace 不是 root」。 输入框和插件发现文档补上 namespace 寻址,以及同名安装无法区分时的结果。 Signed-off-by: fattycat <fattycat.u@gmail.com> * refactor(plugins): 停止写入旧迁移账本,并去掉重复的待迁移字段 旧 namespace 账本只导入一次,之后不再写入。待迁移只记在 namespaceState 上。 重复的 namespaceMigration 标记只有桌面端在读,所以投影里不再输出它。 提交计划改称注册表,不再称旧账本。没有调用方的无标记组织辅助函数, 连同只覆盖它的测试一起删除。 Signed-off-by: fattycat <fattycat.u@gmail.com> * test(plugins): 钉住旧 Forge 安装的归属例外 升级普查里的 Forge 安装,如果 id 对上当前组织登记的前缀,就归到这个组织的 orgSlug, 即使 slug 和前缀并不相同。前缀不同、缺少 orgSlug、手动导入,或者普查之后才装上的, 都不走这条规则。已经确认的 namespace 不会因为换了登录组织而改变。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 按实例键确认下线已读 下线已读接受已安装实例的实例键,因此企业安装也可以标成已读。 如果这份安装本来就记在裸插件 id 上,裸 id 仍然是它的实例键。 Signed-off-by: fattycat <fattycat.u@gmail.com> * refactor(plugins): 不再读取旧的 namespace 账本 尚未对外发布的迁移文件不再读取。第一次普查记下当时存在的旧 root 目录, 提交和对账直接使用 pendingRelIds。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 升级后的安装仍按原来的身份寻址 客户端联网时已经在跑的常驻插件会被停下并重试,而不是一直停在待迁移。 升级收来的市场安装保留 plugin id,别的市场不能复用这个目录。 注册表不可用时,不能把企业插件装到 root。定时任务草稿和 ghost_info 按真实实例寻址。 切到本地模式时,会停掉企业账号对应的运行时。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 只有 namespace 提交会落地时才停常驻插件 先看分类结果,再决定要不要停待迁移插件,而且只停浏览器常驻或 Node 常驻。 用户正开着的面板保持运行,留给下次重试。如果已经停下但提交没有成功,常驻插件会重新启动。 市场 plugin id 只有在 namespace、scope 和包 sha 都对上这个目录时才写入。 注册表读不出来时,市场安装和更新都会先停下来等待。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 插件页面按实例键声明 webview 分区 面板、主视图和设置页的分区声明改为物理实例键。协议地址仍用 manifest.id。 设置页高度缓存继续用逻辑键,原位迁移后已记住的高度不会被清掉。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 拖入插件文件时按 root 身份查找已装实例 文件导入不再用裸 id 做物理实例查找。已确认或未确认的 root,以及没有 namespace 字段的待迁移旧目录,才会被更新。同名企业插件会另装一个 root。详情页更新仍按实例键精确查找。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 移动端选插件时保留 namespace Desktop 的 composer 列表会带上 namespace 和 instanceKey。移动端解析时把这两个字段剥掉后,同名的 root 和企业插件只能生成无法区分的指令。选中插件时按实例补上限定符,旧列表没有这两个字段时仍走原来的裸指令。 Signed-off-by: fattycat <fattycat.u@gmail.com> * test(plugins): 按拆出的设置探测检查实例键 设置账号查询已经从 getGhostSetupAssessment 挪进 getGhostSetupProbes。断言改成同时检查调用点和探测函数内部仍使用实例键。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 未确认身份不再从安装路径补回 namespace 注册表能区分 unknown 和 unconfirmed。只有没有记录或注册表阻塞时,才允许从安装路径推出 namespace。unconfirmed 不再获得 Broker、宿主原语或 Forge Connection。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 安装提交后注册表写入失败不再报安装失败 目录和 receipt 已经提交后,注册表写盘失败只记警告,安装仍按成功返回,下一次 list() 会收养这条记录。publish 在缓存为空时先同步再写,避免清掉其他实例。namespace 提交后的注册表确认同样不再把已提交的 receipt 报成失败。 Signed-off-by: fattycat <fattycat.u@gmail.com> * fix(plugins): 企业插件确认 namespace 后改用新分区 Signed-off-by: fattycat <fattycat.u@gmail.com> --------- Signed-off-by: fattycat <fattycat.u@gmail.com> |
||
|
|
b032d35e6f |
feat(library): 暂存未入库原件并在确认归档后释放 (#4730)
* fix(desktop): keep cached Library sessions from mkdir empty custom roots Re-resolve the live binding on each request so a missing custom root stays unavailable instead of recreating an empty library. Same-disk restore continues through existing open/status; a rebuilt path remains binding-moved. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not mint unavailable Library identity from default root Unavailable cached custom sessions are not required to keep the live identity. Restore still uses the original disk object; a replaced directory stays binding-moved. Signed-off-by: PraiseZhu <zhuzan@xd.com> * feat(desktop): add owner-scoped Library staging adapter Host H1 is a thin LibraryVault adapter for plugin upload staging. It keeps owner×ghost isolation, hard quota, tombstones, and ACK-gated release without a second media library, new UI, or TCC path. Quota counts durable, orphan blobs, closed tmp, and in-memory uploads without overlap. abort of a commitPending blob is STREAM_INVALID so the landed original stays reserved until ACK. disposeAll/bind/unbind/relocate/delete drain in-flight release behind relocating. First-minted staging roots also fsync parent directory entries; Windows still reports fsynced:false. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): recover staging commit from retained manifest and intent Same-instance retry after a durable manifest write plus failed journal fsync no longer dies on ifNotExists ALREADY_EXISTS. Matching identity is adopted; conflicting identity is rejected without overwrite. New originals write intent.json before blob rename. A new Store recovers only from that trusted identity after hash/bytes checks, then installs manifest+dirsync. Incomplete or conflicting intent fails closed and keeps the source. Historical orphans without intent stay billed in isolation and are not TTL-deleted. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): fail closed when a custom Library parent vanishes A stale custom resolveLibraryRoot could still reach vault.open, which recursively created the missing user parent and reported ready empty. Custom open now refuses to recreate a vanished parent (disk-missing); default first-time create still mkdir. keep files remain in the renamed directory and are not treated as deleted. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): reject replaced custom parents and revoke extraDir on drift Stale resolve plus a same-path new inode is binding-moved at the mkdir boundary. disk-missing after a granted extraDir actually revokes the slot. Auto-open failures latch drift so status-only restore works. Keep files stay in the renamed-away directory. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not recursive-mkdir custom Library parent after inspect Custom skeleton mkdir is non-recursive so a vanished user parent cannot be rebuilt as an empty library. Default roots still create recursively. Keep files stay in the renamed-away directory. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): bind custom Library mkdir to held parent identity After the last successful inspect, hold the parent directory and compare path identity after mkdir(root). A same-path new inode fails closed as binding-moved; an empty root created on the replacement is rolled back and keep files stay parked. Node has no mkdirat; this is not atomic. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): create custom Library trees via held parent fd Darwin mkdirat/openat (SYS_mkdirat=475) and Linux /proc/self/fd keep ghostId/meta on the granted parent object. Missing helper fail-closed before mutation; no path mkdir fallback. Windows custom init unsupported. Default roots still mkdir recursively. Keep files stay parked. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): skip custom first-open path usage persist and sweep After the held parent fd is closed, custom open does not write, rename, or unlink under this.root. Sweep unlink and persistUsage are skipped; read-only usage scan remains. Default roots unchanged. Later library writes still persist. Isolated D: no replacement usage.json. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): existing custom open, session teardown, usage ledger Open an already-initialized custom library from the held parent fd without mkdir. Missing structure on platforms without create stays fail-closed. Teardown only the captured session. Reuse a valid usage ledger; scan only when it is missing or corrupt. Custom tmp is not path-unlinked. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): Windows existing custom open via FILE_OPEN ReadFile Existing libraries open from the inherited parent handle with NtCreateFile FILE_OPEN+ReadFile. FileIndex 0 and missing helpers fail closed. Create stays unsupported on Windows. Linux may unlink only uuid.tmp/.stream staging leftovers via /proc/self/fd. No path mkdir fallback. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): parse existing-open helper JSON as complete values Pretty-printed and compact meta/usage payloads both parse. Malformed JSON or failed field checks stay CORRUPT. Do not split on the first newline of the helper stdout. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not delete custom Library uuid tmp/stream on open Age and an empty streams map cannot prove a fsynced .tmp/.stream is garbage after a crash before rename. Open no longer unlinks them. P2_tmp stays unresolved. Unknown names are kept. Signed-off-by: PraiseZhu <zhuzan@xd.com> * feat(desktop): Windows custom Library first-create via NtCreateFile Create dirs with FILE_OPEN_IF and meta.json with FILE_CREATE from the inherited parent handle. No path mkdir, no rollback rmdir, no new native dependency. Existing FILE_OPEN stays read-only. Missing helper still fails closed before mutation. Signed-off-by: PraiseZhu <zhuzan@xd.com> * test(maker-core): time durable Subagent system-deny waitFor Record list/resolver/control monotonic marks and dump them on waitFor failure so Linux CI can discriminate missed 500ms poll vs unpublished system-deny. Keep the original assertion and timeout. Mac is syntax sanity only. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): distinguish Windows meta exists from reparse collision FILE_CREATE collision is exists only after FILE_OPEN of a regular file. Reparse and unknown collisions fail closed. CreateRelative always releases handles it still owns, including the catch path. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): sweep idle staging uploads and count concurrent disk reserve Idle incomplete uploads now yield BUSY/QUOTA slots after timeout. Concurrent begin reservations are checked against reserveBytes. Durables and commitPending originals are never TTL-deleted. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): count idle tmp residue and unwritten disk reserve Refresh closed tmp bytes after idle abort before quota admission. Disk reserve subtracts only unwritten stream remainder; commitPending does not double-count landed blobs. Durables stay off TTL. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): recover staging durables across owner generation Restart resets app-session generation so live ownerScopeKey (local🆔2 vs local🆔0) no longer matches the on-disk manifest. Treat generation as a process lease, not durable owner identity. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): fail closed on custom ghost loss and staging.release races Greptile P1: vanished custom ghost dirs must not rebuild an empty library on a live vault; staging.release re-hashes the unique original and blocks concurrent library mutates until the staging original is gone. P2: disposeAll now invalidates staging stores, uploads, and vaults. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): persist custom libraryReady so vanished ghost dirs stay fail-closed Binding records first-create vs already-built trees without bumping generation. Restart after `<parent>/<ghostId>` disappears now returns disk-missing instead of initializing an empty replacement library. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): serialize Library mutates with staging.release Greptile P1 r4058467558 needs a real per-ghost mutex, not only a second hash. Mutating Library ops and staging.release now share one chain so hash-then-delete cannot overlap write/delete/rename. Relocating releases still fail closed without taking the lock. Signed-off-by: PraiseZhu <zhuzan@xd.com> --------- Signed-off-by: PraiseZhu <zhuzan@xd.com> |
||
|
|
6ee28d50c5 |
fix(library): 自定义媒体库暂时不可用时不重建空库 (#4728)
* fix(desktop): keep cached Library sessions from mkdir empty custom roots Re-resolve the live binding on each request so a missing custom root stays unavailable instead of recreating an empty library. Same-disk restore continues through existing open/status; a rebuilt path remains binding-moved. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not mint unavailable Library identity from default root Unavailable cached custom sessions are not required to keep the live identity. Restore still uses the original disk object; a replaced directory stays binding-moved. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): fail closed when a custom Library parent vanishes A stale custom resolveLibraryRoot could still reach vault.open, which recursively created the missing user parent and reported ready empty. Custom open now refuses to recreate a vanished parent (disk-missing); default first-time create still mkdir. keep files remain in the renamed directory and are not treated as deleted. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): reject replaced custom parents and revoke extraDir on drift Stale resolve plus a same-path new inode is binding-moved at the mkdir boundary. disk-missing after a granted extraDir actually revokes the slot. Auto-open failures latch drift so status-only restore works. Keep files stay in the renamed-away directory. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not recursive-mkdir custom Library parent after inspect Custom skeleton mkdir is non-recursive so a vanished user parent cannot be rebuilt as an empty library. Default roots still create recursively. Keep files stay in the renamed-away directory. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): bind custom Library mkdir to held parent identity After the last successful inspect, hold the parent directory and compare path identity after mkdir(root). A same-path new inode fails closed as binding-moved; an empty root created on the replacement is rolled back and keep files stay parked. Node has no mkdirat; this is not atomic. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): create custom Library trees via held parent fd Darwin mkdirat/openat (SYS_mkdirat=475) and Linux /proc/self/fd keep ghostId/meta on the granted parent object. Missing helper fail-closed before mutation; no path mkdir fallback. Windows custom init unsupported. Default roots still mkdir recursively. Keep files stay parked. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): skip custom first-open path usage persist and sweep After the held parent fd is closed, custom open does not write, rename, or unlink under this.root. Sweep unlink and persistUsage are skipped; read-only usage scan remains. Default roots unchanged. Later library writes still persist. Isolated D: no replacement usage.json. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): existing custom open, session teardown, usage ledger Open an already-initialized custom library from the held parent fd without mkdir. Missing structure on platforms without create stays fail-closed. Teardown only the captured session. Reuse a valid usage ledger; scan only when it is missing or corrupt. Custom tmp is not path-unlinked. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): Windows existing custom open via FILE_OPEN ReadFile Existing libraries open from the inherited parent handle with NtCreateFile FILE_OPEN+ReadFile. FileIndex 0 and missing helpers fail closed. Create stays unsupported on Windows. Linux may unlink only uuid.tmp/.stream staging leftovers via /proc/self/fd. No path mkdir fallback. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): parse existing-open helper JSON as complete values Pretty-printed and compact meta/usage payloads both parse. Malformed JSON or failed field checks stay CORRUPT. Do not split on the first newline of the helper stdout. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not delete custom Library uuid tmp/stream on open Age and an empty streams map cannot prove a fsynced .tmp/.stream is garbage after a crash before rename. Open no longer unlinks them. P2_tmp stays unresolved. Unknown names are kept. Signed-off-by: PraiseZhu <zhuzan@xd.com> * feat(desktop): Windows custom Library first-create via NtCreateFile Create dirs with FILE_OPEN_IF and meta.json with FILE_CREATE from the inherited parent handle. No path mkdir, no rollback rmdir, no new native dependency. Existing FILE_OPEN stays read-only. Missing helper still fails closed before mutation. Signed-off-by: PraiseZhu <zhuzan@xd.com> * test(maker-core): time durable Subagent system-deny waitFor Record list/resolver/control monotonic marks and dump them on waitFor failure so Linux CI can discriminate missed 500ms poll vs unpublished system-deny. Keep the original assertion and timeout. Mac is syntax sanity only. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): distinguish Windows meta exists from reparse collision FILE_CREATE collision is exists only after FILE_OPEN of a regular file. Reparse and unknown collisions fail closed. CreateRelative always releases handles it still owns, including the catch path. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): recycle extra tmp hard links without deleting unique originals Custom libraries skip age-based path sweep. Unlink uuid.tmp/.stream only when nlink>=2 and ino!=0 (successful commit residue). nlink=1 after fsync and before rename is kept. Linux custom uses held-parent fd unlinkat-style paths; Darwin/Windows custom stay fail-closed with no path fallback. Signed-off-by: PraiseZhu <zhuzan@xd.com> * Revert "fix(desktop): recycle extra tmp hard links without deleting unique originals" Lead ruled nlink>=2 unlink is not a sound unique-original proof (name can be swapped after lstat; held parent does not lock names). Restore d7c custom skip + default age sweep. Do not close P2_tmp. Signed-off-by: PraiseZhu <zhuzan@xd.com> --------- Signed-off-by: PraiseZhu <zhuzan@xd.com> |
||
|
|
02780b580c |
fix(library): 让原生Agent自行定位library并获得生效的只读权限 (#4250)
* fix(library): capture write epoch and host-owned library root contract Write/writeCommit receipts now carry the session-captured identity and generation, including stream begin/commit. Host extraDir roots resolve library: relative keys without leaking absolute paths to plugins. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(library): wire task-scoped roots into native readers Signed-off-by: Praise <praise@PraisedeMac-mini.local> * fix(desktop): preserve trusted library grants and retire stream epochs Signed-off-by: Praise <praise@PraisedeMac-mini.local> * test(desktop): avoid duplicate abort controller import Signed-off-by: Praise <praise@PraisedeMac-mini.local> * test(desktop): reconcile upstream abort controller setup Signed-off-by: Praise <praise@PraisedeMac-mini.local> * fix(desktop): treat closed owner probes as ended Signed-off-by: Praise <praise@PraisedeMac-mini.local> * chore(design): refresh inventory after merging Cindy Make UI Signed-off-by: Praise <praise@PraisedeMac-mini.local> * fix(desktop): align Cindy Make tests and billing copy after main merge Signed-off-by: Praise <praise@PraisedeMac-mini.local> * fix(i18n): avoid banned Credits wording in billing comparison copy Signed-off-by: Praise <praise@PraisedeMac-mini.local> --------- Signed-off-by: PraiseZhu <zhuzan@xd.com> Signed-off-by: Praise <praise@PraisedeMac-mini.local> Co-authored-by: Praise <praise@PraisedeMac-mini.local> |
||
|
|
db09a43cf3 |
fix(library): 宿主只读 Library 操作能力合同 (#4000)
* fix(library): add sessionless library capabilities contract
Host library now answers {op:capabilities} after eligibility/op checks and
before session creation, exposing a v1 clipboardWrite/saveAs support list
without opening vaults, leaking owner/paths, or treating availability as
implementation support. Actual ops keep old error codes and add stable
reason values; docs cover unknown-op vs supported/no-window/denied.
Signed-off-by: PraiseZhu <zhuzan@xd.com>
* fix(library): reject mixed-type capabilities lists and sync FORGE_GUIDE
Keep the sessionless capabilities contract, but treat operations arrays
with non-string items as unknown instead of a valid v1 list. Sync the
author-visible Library pipe in FORGE_GUIDE §4.10.1, including stable
failure reasons, and cover mixed-type plus handbook assertions.
Signed-off-by: PraiseZhu <zhuzan@xd.com>
* fix(library): attach stable reasons on dbPath and vault unavailable
Greptile P1: illegal/out-of-root dbPath and vault-passthrough
LIBRARY_UNAVAILABLE from open/status now carry the documented
reason instead of leaving plugins to parse message.
Signed-off-by: PraiseZhu <zhuzan@xd.com>
---------
Signed-off-by: PraiseZhu <zhuzan@xd.com>
|
||
|
|
11e02c0306 |
feat(desktop): 会话级只读 library extraDirs,ChatInput 不计系统槽 (#3745)
* docs(library): PR0 会话级只读 extraDirs 契约 把 G2 的会话级只读 extraDirs 注入、blob 相对键、限额与 confirmed=writeCommit ACK 写进权威 library 规则与冻结稿。仓内无 libraryConfirmed.ts,不得发明该文件。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): libraryVault 读路径 O_NOFOLLOW + identity 复核 read() 打开后用 bigint dev/ino 同 fd 复核,换链/ino=0 走 INTERNAL 且不返回字节; 打开器保持私有,失败不回落裸 open。writeCommit ACK 形状不变。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): library 正本 blob 消费口 + open/status 握手 editImage 只认 assets/<2>/<hash>/blob.<ext>,sidecar 禁止当像素; writeCommit ACK 仍用 sha256 升格 confirmed;open/status 回 authorizedReadonly 与 generation/identity,不回绝对路径。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * refactor(desktop): 复用 library blob 门,去掉重复 sidecar 判断 editImage 解析后的绝对路径走 assertLibraryEditImageSource; 通道门只认 helper,不再平行正则。握手测试直接打 open/status。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): library: 前缀 sidecar 不再绕过源图形状门 hashes 先剥 library: 再判 blob/sidecar,前缀加 preview.webp/meta.json 不得进 resolveOwnedMedia。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * feat(desktop): 抽出 applyDirectoryGrants 并静默注入 library extraDirs IPC 与 library 槽共用内部入口;writableDirs 仍走 picker。 library 槽不占用户 10 名额,迁根/卸载传 null 即撤,恢复时剥前缀。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * refactor(desktop): 收平 extraDirs 冲突检测的 IIFE library 槽剥前缀后再走 excludeDirectoryGrantConflicts,写法改为 if/else,行为不变。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(maker-core): Claude extraDirs 代际不一致时 resume+fork 重建 setExtraDirs 只改 closure;下一次 send 复用 rewind 三件套, 不用 fresh:true。拷贝兜底默认关闭。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(maker-core): Codex 低版本 setExtraDirs 忽略以免假授权 启动仍闸 0.144.6;运行中低版本忽略 extraDirs, 读像素继续走 cindy-media 备胎。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * feat(desktop): extraDirs library 槽显示系统项且不占 10 名额 cindy-library: 前缀与用户目录分区,计数豁免 EXTRA_DIRS_MAX。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(maker-core): Pi extraDirs prompt 不再写入绝对库根 只描述只读作品库能力并用 basename 标签,不含 /Users/.../libraries/。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): validateExtraDirs 豁免 library 槽 10 名额上限 cindy-library: 前缀不计入 EXTRA_DIRS_MAX;满 10 个用户目录时槽仍通过。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): ChatInput 配额不计 library 系统槽 composer 加目录入口与 + 计数改走 countUserExtraDirs,列表把 cindy-library: 显示为系统项且不可移除。顺手把 applyDirectoryGrants 抽出后的源码扫描锚点改到 export function。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * docs(design-previews): library extraDirs 配额系统槽 QA demo ChatInput 不计 cindy-library: 名额、列表显示「Mivo 作品库(只读)」的可交互验收件。 verify A-D 绿,未采像素基准。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): 把 library extraDirs 接到当前 Mivo 会话 open/status 与迁根、停用、卸载后调用 applyLibraryReadonlyExtraDir。 有焦点只注入当前会话;撤槽扫可见活跃会话。Codex 旧版 setExtraDirs 不再静默忽略,避免库里已授权、运行时读不到。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): 停用/删除成功后再撤 library extraDirs 停用改到 setEnabled 成功之后刷新,避免仍读到 enabled=true 又把槽注回去。 删除改到 trash 成功之后刷新。切走焦点时也撤槽。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): 切会话撤旧 library 槽,空闲会话也能落库 焦点同步对可见会话逐条写:当前焦点注入,其余撤槽。无 live handle 时仍 persist extraDirs。迁根失败也会 refresh 把旧根加回。懒恢复剥掉 cindy-library: 前缀再交给 harness。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): library extraDirs 用 realpath 槽并钉验收测试 注入走 cindy-library:realpath,切焦点把未聚焦会话的槽撤掉。 Claude 中途授权 resume+fork 续聊,不把 session id 当 resumeSessionAt,也不用 fresh:true。 单测钉死注入/撤权/10 名额豁免/代际换根/低版本 Codex 不持久化/握手无绝对路径。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): library extraDirs 同步只认最新一轮 焦点切换时旧一轮 sync 不得覆盖新一轮授权。Orca idle worker 唤醒时把 cindy-library: 逻辑槽剥成真实路径再交给 harness。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * test(desktop): Orca resume extraDirs 断言跟 extraDirsForRuntime idle worker 唤醒已剥 cindy-library: 前缀,静态扫描测试跟着改。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): library extraDirs 每会话写入后再核代次 旧一轮 sync 在某个 session 的 apply 返回后不得继续写后续会话。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): library extraDirs 失败不再假装授权 握手 authorizedReadonly 只在 focused 本地会话 extraDirs 真正写入后为 true。 Codex 旧版本、远端会话、槽竞态与 writable 重叠都 fail-closed,走 cindy-media 备胎。 SET_EXTRA_DIRS 在 session 锁内合并 library 槽,不再锁外预读。 Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(maker-core): rewind 重建不再二次关闭旧 Query commitRewindFiles 已经 close 过旧 q。send 再建时只给 extraDirs 中途授权补 close,避免 abort rewind 测试里 close spy 被调两次。 Signed-off-by: PraiseZhu <zhuzan@xd.com> --------- Signed-off-by: PraiseZhu <zhuzan@xd.com> |
||
|
|
ac1435b88b |
feat(library): 作品库支持在文件夹中显示与系统另存为 (#3626)
* feat(library): 作品库支持在文件夹中显示与系统另存为
给 cindy.library 增加 reveal / saveAs:插件可把库内文件显示到 Finder,
或经系统另存为拷到用户选的路径。不放开 webview 的 File System Access。
* fix(library): saveAs 成功只回相对键并补骚扰钳制
对话框后复核 owner/vault,成功 path 用库内相对键;同插件 3 秒连发 RATE_LIMITED,在场 BUSY。FORGE §4.10.1 同步。
DCO Remediation Commit for PraiseZhu <zhuzan@xd.com>
I, PraiseZhu <zhuzan@xd.com>, hereby add my Signed-off-by to this commit:
|
||
|
|
348dacc1d7 |
feat(plugin): decouple capabilities from install approval
Signed-off-by: liugaowei <liugaowei@xd.com> |
||
|
|
625a7d714f |
feat(desktop): 插件持久 Library(library 槽):受控 SQLite + 自定义位置 + 随时迁移 (#3079)
新增 owner×plugin 隔离的持久作品库基座:原子文件操作、受控 SQLite worker、装入时目录选择、随时安全迁移、卸载保留与独立确认删除;同步 FORGE_GUIDE、五语 UI 与开发规则。所有 Linux/Windows 单测、CodeQL、Cursor Security、Greptile、DCO 门禁通过。 |