Repository navigation
feat(plugins): item 23 archive 插件源 + SHA-256 锁定 (CC 2.1.224, #117) - #118
Merged
Merged
Conversation
schemas.ts: PluginSourceSchema 新增 archive arm (第 7 源) — HTTPS url + 可选 sha256 (64-hex) + 可选 rootDir。vendored ink 风格 surgical +28/-1。 archiveSource.ts (新): installFromArchive — validateHttpsUrl (拒 http://) → axios arraybuffer 下载 → 可选 SHA-256 常量时间校验 (createHash + timingSafeEqual) → extractArchiveBuffer (复用 dxt/zip.ts unzipFile /parseZipModes/isPathSafe, zip-bomb + 路径遍历防护 + exec-bit 保留)。 fail-visible (mismatch throw 不解压) / fail-open (无 sha256 跳过+log)。 pluginLoader.ts: cachePlugin + generateTemporaryCacheNameForPlugin 各加 case 'archive'。surgical +8。 20 单测: schema 校验/isArchivePluginSource/verifyArchiveIntegrity /extractArchiveBuffer/installFromArchive validateHttpsUrl。真 zip 字节 (fflate zipSync), 不 mock axios。 Refs #117 Closes #117 Co-Authored-By: Claude Fable 5 <[email protected]>
dahai80
added a commit
that referenced
this pull request
Aug 22, 2026
Patch release bundling 17 commits since v0.4.23: - item 15(a) MLX OOM auto-recovery gc+retry (#129) - #7 one-click diagnostic fixAction framework (#131) - 维度5 background-default spawn FUSION_SUBAGENT_DEFAULT_BACKGROUND (#127) - #4 proactive MLX OOM detection via /v1/health (#125) - item 17 fullscreen pre-compact history + :598 synthetic decouple (#123) - item 25B workflow stagger fan-out (#122) - item 21 auto-mode local rule classifier test coverage (#120) - item 23 archive plugin source + SHA-256 lock (#118) - item 24 marketplace command source (#116) - item 6 transcript disk trimming + crash-safe checkpoint (#114) - item 5 normalizeMessages secondary normalize cache (#112) - item 19 screen-reader plaintext render (#110) - item 16 compact retry countdown + stall hint (#108) - item 25A workflow execution runtime docs (#106) - item 25A minimal workflow execution runtime (#105) - item 12 subagent auto-background threshold (#103) - item 20 vimInsertModeRemaps dual-key INSERT sequence (#101) Co-Authored-By: Claude Fable 5 <[email protected]>
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.
Closes #117
改动
src/utils/plugins/schemas.ts— PluginSourceSchema 新增archivearm (第 7 源):source: 'archive'+ HTTPSurl+ 可选sha256(64-hex regex) + 可选rootDir。vendored ink 风格 (2-space/no-semi/single-quote), surgical +28/-1。refine 消息加archive。src/utils/plugins/archiveSource.ts(新, 213 行) —installFromArchive: validateHttpsUrl (拒 http://, 同 mcpbHandler/validateGitUrl precedent) → axios arraybuffer 下载 (120s timeout) → 可选verifyArchiveIntegrity(createHash sha256 + timingSafeEqual 常量时间) →extractArchiveBuffer(复用 dxt/zip.ts unzipFile/parseZipModes/isPathSafe)。fail-visible (mismatch throw 不解压, Rule 12) / fail-open (无 sha256 跳过+log)。rootDir 剥离 + exec-bit 保留。src/utils/plugins/pluginLoader.ts— cachePlugin switch + generateTemporaryCacheNameForPlugin switch 各加case 'archive'。surgical +8。src/__tests__/archiveSource.test.ts(新, 250 行) — 20 单测: PluginSourceSchema archive (7) + isArchivePluginSource (3) + verifyArchiveIntegrity (3) + extractArchiveBuffer (5) + installFromArchive validateHttpsUrl (2)。真 zip 字节 (fflate zipSync), 不 mock axios — 安全逻辑走纯函数直测。安全 (供应链防篡改)
验证
Co-Authored-By: Claude Fable 5 [email protected]