feat(v2): 补齐模型连接与会议反馈闭环并完成真实模拟联调
This commit is contained in:
@@ -22,7 +22,7 @@ def validate_files(files):
|
||||
if not 1 <= len(files) <= 100:
|
||||
raise LibraryError('SKILL_PACKAGE_INVALID', 'Skills 文件夹需要 1–100 个文件')
|
||||
decoded, total = {}, 0
|
||||
roots = set()
|
||||
roots, folded = set(), set()
|
||||
for item in files:
|
||||
path = str(item['path']).replace('\\', '/')
|
||||
parts = PurePosixPath(path).parts
|
||||
@@ -33,7 +33,7 @@ def validate_files(files):
|
||||
raise LibraryError('SKILL_PACKAGE_INVALID', '文件路径不安全,请选择一个标准 Skills 文件夹')
|
||||
roots.add(parts[0])
|
||||
relative = '/'.join(parts[1:])
|
||||
if relative in decoded:
|
||||
if relative.casefold() in folded:
|
||||
raise LibraryError('SKILL_PACKAGE_INVALID', '文件夹存在重复路径')
|
||||
try:
|
||||
raw = base64.b64decode(item['content_base64'], validate=True)
|
||||
@@ -42,6 +42,7 @@ def validate_files(files):
|
||||
total += len(raw)
|
||||
if len(raw) > 2 * 1024 * 1024 or total > MAX_TOTAL:
|
||||
raise LibraryError('SKILL_PACKAGE_INVALID', '文件超过单文件 2MiB 或文件夹 10MiB 上限')
|
||||
folded.add(relative.casefold())
|
||||
decoded[relative] = raw
|
||||
if len(roots) != 1 or 'SKILL.md' not in decoded:
|
||||
raise LibraryError('SKILL_PACKAGE_INVALID', '请选择单个文件夹,根目录必须有 SKILL.md')
|
||||
|
||||
Reference in New Issue
Block a user