makecindy / makecindy/cindy

功能建议:IM(企业微信)会话支持指定工作目录与会话级权限限制(只读/禁执行)

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

Description

**提交人**: Aqua
**客户端版本**: 0.1.52

---

## 使用场景

希望通过企业微信远程使用 Cindy 访问本地工程目录,但企业微信是群内远程入口,群成员 @机器人 即可触发 Cindy,不应让所有会话都拥有完整读写与执行权限:

- 部分会话/群只允许查询代码、文档、日志(只读);
- 少数受信任会话放开写权限;
- 希望能用一段自定义约束提示词限制行为范围(如「只回答与某项目相关的问题」)。

## 当前痛点

1. 企业微信会话工作目录被固定分配在托管路径 `im-working-dir/wecom-<会话ID>`,不能在应用内指定/切换(#1413 已详述);
2. 会话没有可配置的行为限制手段:无法声明「只读」「禁止执行命令」这类策略,也无法为该会话注入自定义约束提示词;
3. 由 1+2,目前只有「完全隔离的沙箱会话」一种形态,缺少「受限地访问真实目录」的中间档——要么全无权限,要么(若未来放开目录)全权限。

## 诉求

1. **工作目录**:渠道默认 + 会话覆盖——企业微信渠道设一个默认目录,个别会话可覆盖为其他目录;
2. **权限/提示词限制**:同样渠道默认 + 会话覆盖,形式为预设开关 + 自定义提示词:
- 预设开关:如「只读模式(禁写文件、禁 shell)」「禁执行命令」「禁文件写入」;
- 自定义提示词:一段可编辑的约束文本,注入该会话的系统提示词。

## 建议方案

- 两级配置:渠道设置(企业微信默认值)+ 会话属性(覆盖),未覆盖时继承渠道默认;
- 预设开关走**硬限制**(工具层拦截,如只读模式下不暴露写/执行类工具),自定义提示词走**软约束**(提示词层引导),两者可叠加;
- 机制可泛化到其他 IM 渠道(飞书/Telegram/Discord/钉钉),企业微信为首个诉求渠道;
- 目录部分与 #1413 互补,可合并实现。

(配置粒度与形式已与提出用户确认:渠道默认+会话覆盖、预设开关+自定义提示词。)
---
**OS**: win32 x64 (10.0.22621)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing WeCom session handling and the related issue #1413. Define how channel defaults and session overrides should cover working directories, hard tool restrictions, and soft prompt constraints. The work is done when the requested inheritance and override behavior is implemented for WeCom and can be extended to other IM channels.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authorization, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.