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。

Merge main into feature/plugin-community-contribution

liugaowei64917d0e50df
diff --cc apps/desktop/src/main/bootstrap-electron.ts
index f26ab92fdf,3fb364efa2..921e981903
--- a/apps/desktop/src/main/bootstrap-electron.ts
+++ b/apps/desktop/src/main/bootstrap-electron.ts
@@@ -1129,10 -1134,9 +1134,10 @@@ import { listActiveClaudeBackgroundActi
import { registerRelaunchBusyActivityIpc } from './relaunchBusyActivityIpc.js';
import { getGhostSetupChangeBus } from './cindy-brain/ghostSetupChangeBus.js';
import { getGhostSetupInteractionBridge } from './cindy-brain/ghostSetupInteractionBridge.js';
- import { registerPluginMarketIpc, syncDefaultMarketPlugins } from './plugin-market/registerIpc.js';
+ import { registerPluginMarketIpc, syncDefaultMarketPlugins, refreshForegroundMarketPlugins } from './plugin-market/registerIpc.js';
import { getPluginMarketService } from './plugin-market/service.js';
import { StableOwnerPostCommitStep } from './stableOwnerPostCommit.js';
+import { registerPluginContributionsIpc } from './plugin-contributions/registerIpc.js';
import { registerPluginPublisherIpc } from './plugin-publisher/registerIpc.js';
import { findCindyFileInArgv } from './cindy-brain/argv.js';
import { handleIncomingCindyFile } from './cindy-brain/openFileInstall.js';
diff --cc apps/desktop/src/main/cindy-brain/GhostManager.ts
index 776640d244,cdf5e5fba9..23df9b23c5
--- a/apps/desktop/src/main/cindy-brain/GhostManager.ts
+++ b/apps/desktop/src/main/cindy-brain/GhostManager.ts
@@@ -894,42 -914,6 +917,44 @@@ export class GhostManager
return this.instanceRegistryService.recordForAddress(id);
}
+ /** Author management must not turn an unreadable installation scan into "not installed". */
+ assertContributionReadAvailable(ghostId?: string): void {
+ this.ensureCurrentOwnerContextSync();
+ const registry = this.instanceRegistryStore().read();
+ if (registry.kind !== 'ok' && registry.kind !== 'missing') {
+ throw new Error('plugin instance registry is ' + registry.kind);
+ }
+ if (registry.kind === 'ok' && Object.values(registry.registry.instances).some((record) =>
+ record.active && (!ghostId || record.ghostId === ghostId) &&
+ this.hasPendingMutationJournal(record.contentRelId))) {
+ throw new Error('plugin installation is changing');
+ }
- for (const { relId, dir } of this.listContentEntries(true)) {
++ const entries = this.listContentEntries();
++ if (!this.isInstallationScanComplete()) throw new Error('plugin installation state is unavailable');
++ for (const { relId, dir } of entries) {
+ const identity = parsePluginInstallRelId(relId);
+ if (!identity || (ghostId && identity.ghostId !== ghostId)) continue;
+ if (this.hasPendingMutationJournal(relId)) throw new Error('plugin installation is changing');
+ const approval = this.readApproval(relId);
+ if (approval.state === 'invalid') throw new Error('plugin approval evidence is unavailable');
+ if (approval.state === 'approved') continue;
+ // list() may skip an unreadable legacy manifest. Do not interpret that
+ // omitted entry as proof that the user's corresponding plugin is absent.
+ try {
+ const manifestPath = resolveGhostContentPathSync(dir, GHOST_MANIFEST_FILE, {
+ expect: 'file', label: 'installed manifest',
+ });
+ const bytes = readBoundedFileNoFollowSync(manifestPath, MAX_GHOST_MANIFEST_BYTES);
+ const parsed = bytes && parseInstalledGhostManifest(JSON.parse(bytes.toString('utf8')));
+ if (!parsed || !parsed.ok || parsed.manifest.id !== identity.ghostId) {
+ throw new Error('invalid manifest');
+ }
+ } catch {
+ throw new Error('plugin manifest evidence is unavailable');
+ }
+ }
+ }
+
private instanceProjection(relId: string, ghostId: string): {
instanceKey?: string;
diff --cc apps/desktop/src/main/cindy-brain/index.ts
index fb7dfccf26,726f53abf8..d006580cf7
--- a/apps/desktop/src/main/cindy-brain/index.ts
+++ b/apps/desktop/src/main/cindy-brain/index.ts
@@@ -1896,27 -1897,19 +1898,30 @@@ export function getGhostManager(): Ghos
canReclaimLegacyBareInstance: (input) =>
getNamespaceMigrationHost().canReclaimLegacyBareInstance(input),
isNamespaceMigrationBusy: (ghostId) => getNamespaceMigrationHost().isNamespaceMigrationBusy(ghostId),
- marketIdentityForInstance: (instance) => {
+ marketIdentityForScan: () => {
try {
- const lookup = getPluginMarketLedger().lookupInstallationsForNamespaceMigration(instance.ghostId);
- if (lookup.kind !== 'found') return null;
- const pluginId = selectMarketPluginIdForInstance(instance, lookup.records ?? []);
- return pluginId ? { pluginId } : null;
+ const read = getPluginMarketLedger().createNamespaceMigrationLookup();
+ return (instance) => {
+ const lookup = read(instance.ghostId);
+ if (lookup.kind !== 'found') return null;
+ const pluginId = selectMarketPluginIdForInstance(instance, lookup.records ?? []);
+ return pluginId ? { pluginId } : null;
+ };
} catch {
- return null;
+ return () => null;
}
},
+ sourcesForInstance: (record, receipt) => {
+ let lookup: ReturnType<ReturnType<typeof getPluginMarketLedger>['lookupInstallationForAuthorization']>;
+ try {
+ lookup = getPluginMarketLedger().lookupInstallationForAuthorization({ ghostId: record.ghostId, namespace: record.namespace });
+ } catch {
+ lookup = { kind: 'invalid' };
+ }
+ return {
+ publishingSource: projectPluginPublishingSource(record, receipt, lookup),
+ };
+ },
canResumePendingResidentOffline: (ghostId) => getNamespaceMigrationHost().canResumePendingResidentOffline(ghostId),
onResumePendingResidentOffline: (ghost) => {
if (!isGhostAvailableForActiveSession(ghost.manifest.id)) return;
diff --cc apps/desktop/src/main/maker-host/index.ts
index 95e9ce9151,b1293a3bc0..af3dd6040f
--- a/apps/desktop/src/main/maker-host/index.ts
+++ b/apps/desktop/src/main/maker-host/index.ts
@@@ -117,11 -118,13 +119,14 @@@ import { prepareBotWorkspaceRuntime } f
import type { MakerSessionCreateOpts } from '../maker-ipc/sessionRequest.js';
import {
dispatchInterAgentMessage,
+ captureRemoteWorkerReportSettlement,
+ getSessionActiveInputClientIds,
+ getSessionInputProvenance,
isActiveInputOwnerAuthored,
+ isActiveInputAccountScoped,
- getSessionInputProvenance,
isSessionInTurn,
wireSessionToIpc,
+ releaseSessionBindingsForOwnerBoundary,
} from '../maker-ipc/register.js';
import { MAKER_PUSH } from '../maker-ipc/channels.js';
import { readProviderGroupBinding } from '../provider-group/bindings.js';
diff --cc apps/desktop/src/main/maker-ipc/register.ts
index d7f31ee534,6f0afdd886..03f66d79bb
--- a/apps/desktop/src/main/maker-ipc/register.ts
+++ b/apps/desktop/src/main/maker-ipc/register.ts
@@@ -4469,11 -4706,11 +4706,16 @@@ export function getTaskActionInputState
};
}
+/** Runtime-only account boundary for personal author tools; never grants external-write permission. */
+export function isActiveInputAccountScoped(sessionId: string): boolean {
+ return agentInputCoordinatorHolder?.isActiveInputAccountScoped(sessionId) ?? false;
+}
+
+ /** Live permission authority for Host task actions; never reconstructed from DB defaults. */
+ export function getTaskActionSession(sessionId: string) {
+ return getMakerIfReady()?.getSession(sessionId);
+ }
+
/** Owner-authored active input (see AgentInputCoordinator.isActiveInputOwnerAuthored). */
export function isActiveInputOwnerAuthored(sessionId: string): boolean {
return agentInputCoordinatorHolder?.isActiveInputOwnerAuthored(sessionId) ?? false;
diff --cc docs/product-rules/agent-user-parity.md
index 9941771143,1c3e020a13..4177b8615a
--- a/docs/product-rules/agent-user-parity.md
+++ b/docs/product-rules/agent-user-parity.md
@@@ -56,10 -56,9 +56,10 @@@
| 项目 | 列出、登记、改名、移除;工作目录列表 | 有 | 无 |
| 伙伴 | 发现伙伴、伙伴间消息 | 有 | 有 |
| 伙伴 | 资料、能力、待办、后台任务 | 有 | 无 |
- | 伙伴 | 工作台一眼(等你 / 在做) | 有 | 无 |
+ | 伙伴 | 「一眼」投影(等你 / 在做;用户界面已改为近况,2026-10-21) | 有 | 无 |
| 伙伴 | 跟进任务:读取与继续(自动跟进所有任务的伙伴) | 有 | 有(2026-10-17) |
| 伙伴 | 查看与更换主力电脑 | 有 | 有(2026-10-17) |
+| 社区插件贡献 | 当前安装快照准备、提交审核/当前进度、本人列表/详情/留存内容 | 有(2026-10-15) | 无 |
Worker 工具省略 working_dir 时保持继承 Lead 任务记录目录,不跟随之后 cd 进入的 worktree。
面板默认识别实际目录属于 UI 行为;Agent 通过显式 working_dir 共用已有 worktree,
@@@ -103,21 -102,24 +103,38 @@@ Session 委托写操作,以及 `cindy
2026-10-20 修订:主人私聊输入及经 Chat Server 实时核验的群内主人请求,沿用普通任务原有权限流程,
不再额外弹行动确认卡;helper 与 Orca、直接与渐进调用保持一致。群专线必须通过
`authorizeGroupTool(sessionId, botId, 'owner-action')`,仅有 role 或持久来源不算主人输入;
- 访客、其他伙伴/任务转入、定时跟进仍受自动行动门约束,核验暂不可用不得放行。
- 自动轮次没有有效委托只准备建议;已有委托的执行权不依赖自动观察规则的开关。
- 普通 Orca Lead 的当前 team 回报只延续原 team 范围,不能据此控制其它任务。跨电脑任务互发要求双方支持
+ 访客身份核验暂不可用不得放行。2026-10-21 修订:普通任务中,用户已委托的定时工作沿用
+ 当前任务的权限审核,不能在正常审核前一律拒绝。缺少可复用的实时权限决定时,Host 从活跃
+ Session 识别定时轮次,并对准确工具、目标和正文调用
+ `Session.reviewHostPermissionAction`:Full Access 放行,Auto 使用原任务已恢复的用户意图,
+ 审核同时携带宿主确认的「定时触发已经发生」上下文,区分先前的设置阶段与当前续跑,
+ 该事实不构成新授权。排队时应用模型设置不得改写绑定任务的权限档。
+ Ask 或审核要求确认时复用现有确认入口;Plan 不允许副作用。来源标签本身不提供授权。
+ 审核到执行及延迟投递均保留账号、实例、权限/Plan 代次与输入边界校验,
+ 不得借定时工作扩大原授权范围。
+ 2026-10-22 修订:伙伴、转入消息与定时跟进的任务操作
+ 统一沿用普通任务权限流程:Full Access 免审、Auto 使用原有自动审核、Ask 使用原有确认。
+ helper 任务写工具与 Orca 协作写工具均逐次进入该流程,不能借可信 server 静默跳过;Orca 只读查询保持免审。
+ Host 不因当前输入缺少主人标记再追加行动同意判定。只认运行中任务的实时权限,
+ 不读数据库旧值;从 Host 接收调用并捕获快照起,权限切换、计划模式或实例变化使该调用
+ 尚未执行及排队中的放行失效。该快照不是 Agent 审批回执:审批完成到进入 Host 之前的交接窗口
+ 沿用普通任务既有语义,本次不增加跨 harness 审批凭证,也不承诺该窗口的原子撤销。
+ 群成员、共享访客、插件托管工具范围及账号归属检查保持原边界。
+ 没有可核验的实时执行权限时,仍按原有主人输入或委托范围校验,不凭角色放行。
+ 已有委托的执行权不依赖自动观察规则的开关;仅凭普通 Orca Lead 的当前 team 回报只延续原 team 范围。
+ 跨电脑任务互发要求双方支持
行动回执,旧端明确提示不支持;未增加观察数据权限。实机多端验收仍待完成。
+
+## 社区插件贡献
+
+普通个人作者的独立入口为 `ghost_contribution_prepare`、`ghost_contribution_submit`、
+`ghost_contribution_status`、`ghost_contribution_stop`、`ghost_my_plugins`、`ghost_cancel_plugin_review`,由 `cindy-tools`
+直接提供工具说明。手动和 AI 复用 Host 的精确安装快照、操作键、回执及个人读取接口;AI 不拿到
+Bearer、PUT 票据或受管文件路径。公开写入遵循当前任务 Full Access / Auto / Ask,不加最后人工点击。
+共享任务访客及既有 helper surface 判为 restricted 的插件托管任务(包括其 Worker)不得读取个人
+个人插件发布资料或执行发布。普通用户自己的 Worker、自动任务沿相同账号边界与任务权限;人工审核不由 Agent 执行。
+客户端提交边界见 [社区贡献实现说明](../plugin-community-contribution.md)。
+
+2026-10-16:个人发布 prepare 返回包内 releaseNotes 和远端只读预检;submit 前重新校验所见快照内容。
+`ghost_cancel_plugin_review` 使用本人版本的精确 revision,区分停止上传与取消审核,沿现有 Full Access/Auto/Ask 授权。
+旧版本包仍可安装,成功提审后的同版本不再支持改包重提。