makecindy / makecindy/cindy

[Feature] 按 SSO 域配置 SkillHub 自动同步,实现组织级技能自动分发

Open
#1,020 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
2.7k
Forks
395
Avg merge
21h 48m
Merged PRs (30d)
776

Description

**提交人**: maoxinxin
**客户端版本**: 0.1.21

---

## 背景(现状问题)

Cindy 已实现了一套「启动自动同步」机制(`autoSyncService.ts`),但:

1. 线上配置文件 `https://hotfix.cindy.com.cn/cindy/cfg/auto-sync-skills.json` 持续返回 **404**
2. 代码兜底 `DEFAULT_SKILLHUB_AUTO_SYNC_SLUGS` 为**空数组**
3. 日志持续出现 `fetch auto sync config failed, using fallback`

导致整套自动安装/更新机制处于空转状态。

## 建议方案

将当前的「全局单一白名单」升级为 **按 SSO 域(tenant/组织)配置**,每个 SSO 域可以独立管理自己成员应自动安装和更新的技能列表。

### 预期工作流

1. 用户在 Cindy 中以某 SSO 域身份登录
2. 启动时根据用户当前 SSO 域(tenant_id / org_id)查询对应的技能白名单
3. 未安装的自动安装,已安装的检查版本并更新
4. 用户手动卸载后,记录该用户忽略,不再强行装回(现有 `autoSyncPreferences.ts` 逻辑可复用)

### 价值

- 企业/组织可统一为员工预装内部工具 Skill(如 OA 审批流、内部文档查询等)
- 个人用户不受影响(对应域无配置则跳过)
- 现有架构改动较小:`autoSyncConfig URL` 改为按 tenant 拼接路径,配置内容可沿用当前 JSON schema

## 期望行为

- SSO 域管理员可通过后台配置文件管理该组织的 Skill 列表
- 对应用户登录后自动获取/更新这些 Skill
- 配置缺失时优雅降级(不做任何操作,不报错)

## 关联代码

- `apps/desktop/src/main/skillhub/autoSyncService.ts`
- `apps/desktop/src/main/skillhub/installService.ts`
- `apps/desktop/src/main/skillhub/autoSyncPreferences.ts`
---
**版本区域**: CN
**OS**: darwin arm64 (25.5.0)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start by reading apps/desktop/src/main/skillhub/autoSyncService.ts, installService.ts, and autoSyncPreferences.ts, then trace how the current SSO tenant identity and auto-sync URL are obtained. Define the per-tenant configuration path and behavior for missing or invalid configuration. Done means configured users receive installation and update checks, manual ignores remain respected, and unconfigured tenants make no changes or errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.