fix: harden scoped tools and settings persistence

This commit is contained in:
lofyer
2026-08-13 14:56:53 +08:00
parent bf1ec5d2f1
commit aab961226f
62 changed files with 4343 additions and 1314 deletions
+4 -7
View File
@@ -3,6 +3,7 @@ import {
projectChannelSchema,
type ProjectChannel
} from './assistant-contracts'
import { settingsWarningsSchema } from './settings-warning-contracts'
export const CHANNEL_SETTINGS_LIMITS = {
maximumIdentifierLength: 256,
@@ -106,7 +107,8 @@ export type ChannelSettingsApply = z.infer<
export const channelCredentialSourceSchema = z.enum([
'none',
'encrypted',
'environment'
'environment',
'unreadable'
])
export type ChannelCredentialSource = z.infer<
typeof channelCredentialSourceSchema
@@ -186,12 +188,7 @@ export const channelSettingsSnapshotSchema = z
weixin: weixinChannelSettingsSchema,
wecom: weComChannelSettingsSchema,
dingtalk: dingTalkChannelSettingsSchema,
warning: z
.string()
.trim()
.min(1)
.max(CHANNEL_SETTINGS_LIMITS.maximumWarningLength)
.optional()
warnings: settingsWarningsSchema.optional()
})
.strict()
export type ChannelSettingsSnapshot = z.infer<