ai_co_discuss 0.2.25 → 0.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/runner.md CHANGED
@@ -283,7 +283,7 @@ agy 只用一套方法控制权限:
283
283
 
284
284
  1. **只在本工具新建的会话中执行**:每位参与者对应一个独立原生讨论项目,权限只写在该项目里。外部已有会话(包括从当前 agy 对话发起主持、在启动配置中填写 `session_id`)会恢复其原项目,无法套用讨论项目权限,因此启动时即拒绝,交付时也再次拒绝。
285
285
  2. **项目内规则**:allow 为受限的讨论命令规则与草稿目录写入(`write` 时加项目目录写入);deny 为项目目录写入(`read` 时)、运行目录、技能目录、`~/.gemini` 写入与 `mcp(*)`。规则按目录前缀递归匹配,不使用 `/**`;Deny > Ask > Allow,因此草稿不得位于受保护目录中,冲突在交付前报告。
286
- 3. **交付前检查全局设置**:CLI 的 `toolPermission` 须未设置或为 `request-review`;CLI 与共享全局 allow 中不得有任何 `command(...)`、`unsandboxed(...)`、`unsandboxed_command(...)` 或 `*` 放行,否则拒绝交付,因为全局放行会让 shell 绕过项目的文件规则。未授权 shell 在非交互模式下被拒绝。
286
+ 3. **交付前检查全局设置**:CLI 与共享全局 allow 中若有 `*`、`command(*)`、`unsandboxed(*)` 或 `unsandboxed_command(*)` 这类放行全部命令的规则,则拒绝交付,因为它会让 shell 绕过项目的文件规则。具体命令的放行和 `toolPermission` 不检查,属于用户自己的授权。未授权 shell 在非交互模式下被拒绝。
287
287
  4. **不改用户全局设置**:本工具不向 agy 全局设置写入任何规则;`setup` 只移除早期版本记录在 `agy-permission.json` 中的全局规则(先备份到服务目录 `agy-settings.backup.json`),其他设置与用户规则不变。
288
288
 
289
289
  原生工具权限不是操作系统沙箱;工具被拒绝时 agy 仍可能退出码为 0,验收以实际文件和网站结果为准。[原生权限文档](https://antigravity.google/docs/permissions?tab=cli)、[CLI 设置](https://antigravity.google/docs/settings?tab=cli)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -148,14 +148,13 @@ export function agy_rule() {
148
148
  /** Read optional native settings; malformed settings must not silently disable a permission check. */
149
149
  function read_json(path) { return existsSync(path) ? JSON.parse(readFileSync(path, 'utf8')) : {}; }
150
150
 
151
- /** Native headless review blocks unapproved shell commands; any global command grant could bypass the project rules. */
151
+ /** Native headless review blocks unapproved shell commands; only a global grant of every command could bypass the project rules. */
152
152
  function check_agy_shell(user_home) {
153
153
  const cli = read_json(join(user_home, '.gemini', 'antigravity-cli', 'settings.json'));
154
154
  const shared = read_json(join(user_home, '.gemini', 'config', 'config.json'));
155
155
  const grants = [...(cli.permissions?.allow || []), ...(shared.userSettings?.globalPermissionGrants?.allow || [])];
156
- if ((cli.toolPermission && cli.toolPermission !== 'request-review')
157
- || grants.some(rule => rule === '*' || /^(?:command|unsandboxed|unsandboxed_command)\(/.test(rule))) {
158
- throw new Error('agy 全局设置放行了命令或改了 toolPermission,会绕过讨论项目的权限;请移除全局 command / unsandboxed 放行并保留 request-review(本工具旧版写入的规则可运行 codiscuss setup 清理),未交付讨论任务');
156
+ if (grants.some(rule => rule === '*' || /^(?:command|unsandboxed|unsandboxed_command)\((?:\*|regex:\.\*)\)$/.test(rule))) {
157
+ throw new Error('agy 全局设置放行了所有命令,会绕过讨论项目的权限;请移除全局 command(*) / unsandboxed(*) 放行,具体命令的放行不受影响(本工具旧版写入的规则可运行 codiscuss setup 清理),未交付讨论任务');
159
158
  }
160
159
  }
161
160