Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(github): document managed setup and label copy action

Dashe4edb54ea319
diff --git a/apps/desktop/src/main/cindy-brain/__tests__/forge.test.ts b/apps/desktop/src/main/cindy-brain/__tests__/forge.test.ts
index 44657f92e6..e501e781b2 100644
--- a/apps/desktop/src/main/cindy-brain/__tests__/forge.test.ts
+++ b/apps/desktop/src/main/cindy-brain/__tests__/forge.test.ts
@@ -2065,6 +2065,8 @@ describe('FORGE_GUIDE', () => {
'gh-cli',
'gh auth token',
'hostAvailable',
+ 'hostManagedSetup',
+ '字段缺失或为 false 时保留旧版设置页的连接提示',
// 多连接(connections,2026-07-14):声明形态 / 设置页协议 / 主机受信确认。
'connections',
'/connections',
diff --git a/apps/desktop/src/main/cindy-brain/forge.ts b/apps/desktop/src/main/cindy-brain/forge.ts
index 10cddcd277..abfdd8dad0 100644
--- a/apps/desktop/src/main/cindy-brain/forge.ts
+++ b/apps/desktop/src/main/cindy-brain/forge.ts
@@ -3091,7 +3091,10 @@ PUT/DELETE 一律 405(派生身份不可配置)。
两种 token 都只在 Main 的 networkSlot 内存中进入请求头,插件沙箱、settings 页面、
Renderer、Agent、KV 和日志都拿不到。设置页 GET \`/secrets\` 对这条 key 额外返回
\`hostSource:"gh-cli"\` 与 \`hostAvailable:boolean\`,其中 \`saved/tail\` 仍只描述备用
-PAT;页面可据此展示“已检测到 gh,可直接使用”,但不能读取 gh 的账号或 token。
+PAT。支持宿主管理连接入口时还返回可选的 \`hostManagedSetup:true\`:此时宿主统一
+展示账号状态、安装与登录入口,settingsHtml 不再重复渲染这些内容,只保留备用 PAT
+配置(可折叠到“其他连接方式”)。字段缺失或为 false 时保留旧版设置页的连接提示,
+可根据 \`hostAvailable\` 展示“已检测到 gh,可直接使用”;不能读取 gh 的账号或 token。
此来源的注入形态固定为 \`api.github.com\` 的
\`Authorization: Bearer {value}\`,不允许 exchange,也不要放进 \`setup.requires\`。
diff --git a/apps/desktop/src/renderer/features/cc-agent/GithubSetupDialog.tsx b/apps/desktop/src/renderer/features/cc-agent/GithubSetupDialog.tsx
index 922fbe0533..051f22f3b8 100644
--- a/apps/desktop/src/renderer/features/cc-agent/GithubSetupDialog.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/GithubSetupDialog.tsx
@@ -4,6 +4,7 @@ import { Check, Copy } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
import { Spinner } from '@/components/ui/spinner';
+import { Tip } from '@/components/ui/tooltip';
import { DownloadMeter } from '@/components/settings/DownloadMeter';
import type { GithubSetupState } from '../../../shared/githubSetup';
@@ -134,6 +135,7 @@ export function GithubSetupDialog({
const completed = stage === 'connected';
const retry = ['error', 'cancelled', 'unavailable'].includes(stage);
const unsupported = stage === 'error' && state.error === 'unsupported';
+ const copyLabel = copy(copiedCode === state.userCode ? 'copied' : 'copyCode');
return (
<Dialog.Root
@@ -176,14 +178,16 @@ export function GithubSetupDialog({
<code className="select-all whitespace-nowrap font-mono text-18 tracking-widest text-[var(--text-primary)]">
{state.userCode}
</code>
- <button
- type="button"
- onClick={() => void copyCode()}
- aria-label={copy(copiedCode === state.userCode ? 'copied' : 'copyCode')}
- className="flex size-8 shrink-0 items-center justify-center rounded-full text-[var(--text-secondary)] hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--focus-ring)]"
- >
- {copiedCode === state.userCode ? <Check size={16} /> : <Copy size={16} />}
- </button>
+ <Tip text={copyLabel} contentClassName="z-[10002]">
+ <button
+ type="button"
+ onClick={() => void copyCode()}
+ aria-label={copyLabel}
+ className="flex size-8 shrink-0 items-center justify-center rounded-full text-[var(--text-secondary)] hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--focus-ring)]"
+ >
+ {copiedCode === state.userCode ? <Check size={16} /> : <Copy size={16} />}
+ </button>
+ </Tip>
</div>
</div>
<span className="select-text text-12 text-[var(--text-tertiary)]">