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。

feat(desktop): 市场插件装完即开,不再需要用户手动开启 (#482)

xxxcc12178ef1209e
diff --git a/apps/desktop/src/main/cindy-brain/index.ts b/apps/desktop/src/main/cindy-brain/index.ts
index 3b247f41de..b27d6432b4 100644
--- a/apps/desktop/src/main/cindy-brain/index.ts
+++ b/apps/desktop/src/main/cindy-brain/index.ts
@@ -2370,7 +2370,6 @@ export async function installOrUpdateMarketGhostPackage(
expected: {
ghostId: string;
version: string;
- initiallyEnabled?: boolean;
},
): Promise<InstalledGhost> {
const mutationOwner = captureGhostMutationOwner();
@@ -2399,10 +2398,12 @@ export async function installOrUpdateMarketGhostPackage(
// mutation.
releaseMutation = beginGhostMutation(mutationOwner);
if (!installed) {
- // defaultInstall 首次装入即启用;手动市场安装仍保持沉睡,等待用户主动开启。
- return installAndDock(manager, cindyFilePath, {
- enable: expected.initiallyEnabled === true,
- });
+ // 2026-07-26 定案:市场首装一律装完即开(defaultInstall 与手动安装归一),
+ // 用户不必再手动点一次开关。市场包走官方分发链路(服务端校验 + sha256
+ // 校验下载),且确认框如实展示权限清单,确认安装即授权运行;本地 .cindy
+ // 文件装入的初始启用态仍由确认框勾选决定(勾选默认开启,main 侧
+ // installAndDock 缺省不启用,授权判断始终来自 UI 显式值)。
+ return installAndDock(manager, cindyFilePath, { enable: true });
}
const runtime = getGhostRuntime();
diff --git a/apps/desktop/src/main/plugin-market/__tests__/service.test.ts b/apps/desktop/src/main/plugin-market/__tests__/service.test.ts
index 9892cf7122..a674c5f4f5 100644
--- a/apps/desktop/src/main/plugin-market/__tests__/service.test.ts
+++ b/apps/desktop/src/main/plugin-market/__tests__/service.test.ts
@@ -329,7 +329,6 @@ describe('PluginMarketService migration and defaultInstall', () => {
{
ghostId: 'cindy-test',
version: '1.0.0',
- initiallyEnabled: true,
},
);
expect(snapshot.items[0]).toMatchObject({
@@ -342,25 +341,28 @@ describe('PluginMarketService migration and defaultInstall', () => {
});
});
- it('keeps a manual market install disabled by default', async () => {
+ // 2026-07-26 定案:市场首装一律装完即开,手动安装与 defaultInstall 归一,
+ // 不再向装入入口透传 initiallyEnabled(启用语义收敛在市场装入入口本身)。
+ it('manual market install goes through the auto-enable install entry', async () => {
const item = summary();
runtime.install.mockResolvedValue({
manifest: manifest(),
dir: '/userData/cindy-brain/cindy-test',
- enabled: false,
+ enabled: true,
});
const h = harness([item]);
- await h.service.install(item.id);
+ const { ghost } = await h.service.install(item.id, { expectedReleaseId: item.currentRelease.id });
expect(runtime.install).toHaveBeenCalledWith(
expect.stringMatching(/\.cindy$/),
{
ghostId: 'cindy-test',
version: '1.0.0',
- initiallyEnabled: false,
},
);
+ // 锁定装完即开的最终结果:装入入口返回的 ghost 必须是启用态。
+ expect(ghost.enabled).toBe(true);
});
it('installs and enables a public defaultInstall package in local mode', async () => {
@@ -388,7 +390,6 @@ describe('PluginMarketService migration and defaultInstall', () => {
{
ghostId: item.ghostId,
version: item.currentRelease.version,
- initiallyEnabled: true,
},
);
expect(snapshot.items[0]).toMatchObject({
@@ -411,7 +412,7 @@ describe('PluginMarketService migration and defaultInstall', () => {
});
const h = harness([item]);
- await expect(h.service.install(item.id)).resolves.toMatchObject({
+ await expect(h.service.install(item.id, { expectedReleaseId: item.currentRelease.id })).resolves.toMatchObject({
ghost: { manifest: { id: 'cindy-test' }, enabled: false },
});
expect(h.api.download).toHaveBeenCalledWith(item.id, item.currentRelease.id);
@@ -433,7 +434,7 @@ describe('PluginMarketService migration and defaultInstall', () => {
});
const h = harness([item]);
- await expect(h.service.install(item.id)).rejects.toThrow('[NOT_FOUND]');
+ await expect(h.service.install(item.id, { expectedReleaseId: item.currentRelease.id })).rejects.toThrow('[NOT_FOUND]');
expect(h.api.detail).not.toHaveBeenCalled();
expect(runtime.install).not.toHaveBeenCalled();
});
@@ -607,7 +608,7 @@ describe('PluginMarketService migration and defaultInstall', () => {
installed: false,
});
- await expect(h.service.install(item.id)).rejects.toThrow('[ALREADY_EXISTS]');
+ await expect(h.service.install(item.id, { expectedReleaseId: item.currentRelease.id })).rejects.toThrow('[ALREADY_EXISTS]');
expect(runtime.install).not.toHaveBeenCalled();
});
@@ -639,17 +640,76 @@ describe('PluginMarketService migration and defaultInstall', () => {
});
h.api.detail.mockResolvedValue(detail(item, ['notify', 'fs']));
- await expect(h.service.install(item.id)).rejects.toThrow('[PRECONDITION_FAILED]');
+ await expect(h.service.install(item.id, { expectedReleaseId: item.currentRelease.id })).rejects.toThrow('[PRECONDITION_FAILED]');
expect(runtime.install).not.toHaveBeenCalled();
await expect(
- h.service.install(item.id, { allowPermissionExpansion: true }),
+ h.service.install(item.id, {
+ expectedReleaseId: item.currentRelease.id,
+ allowPermissionExpansion: true,
+ }),
).resolves.toMatchObject({
ghost: { manifest: { version: '2.0.0' } },
});
expect(runtime.install).toHaveBeenCalledTimes(1);
});
+ it('rejects an update when the installed target disappears during download', async () => {
+ const item = summary({ currentRelease: { ...summary().currentRelease, version: '2.0.0' } });
+ const h = harness([item]);
+ h.ledger.upsertInstallation({
+ ...recordForTest(item),
+ releaseId: 'release-0',
+ version: '1.0.0',
+ });
+ runtime.ghosts = [
+ {
+ manifest: manifest('cindy-test', '1.0.0'),
+ dir: '/userData/cindy-brain/cindy-test',
+ enabled: false,
+ },
+ ];
+ h.api.download.mockImplementationOnce(async () => {
+ // 模拟另一窗口在下载期间完成本地卸载。
+ runtime.ghosts = [];
+ return {
+ url: 'https://downloads.test.invalid/plugin.cindy',
+ expiresAt: '2099-01-01T00:00:00.000Z',
+ sha256: item.currentRelease.sha256,
+ sizeBytes: item.currentRelease.sizeBytes,
+ };
+ });
+
+ await expect(
+ h.service.install(item.id, { expectedReleaseId: item.currentRelease.id }),
+ ).rejects.toThrow('[PRECONDITION_FAILED]');
+ expect(runtime.install).not.toHaveBeenCalled();
+ });
+
+ it('rejects when the market release changes after renderer review', async () => {
+ const reviewed = summary();
+ const replacement = summary({
+ currentRelease: {
+ ...reviewed.currentRelease,
+ id: 'release-2',
+ version: '1.1.0',
+ sha256: 'b'.repeat(64),
+ },
+ });
+ const h = harness([reviewed]);
+ // listAll 仍让该 plugin 对当前用户可见;detail 在确认后已切到新 release。
+ h.api.detail.mockResolvedValue(detail(replacement, ['notify', 'fs']));
+
+ await expect(
+ h.service.install(reviewed.id, {
+ expectedReleaseId: reviewed.currentRelease.id,
+ allowPermissionExpansion: true,
+ }),
+ ).rejects.toThrow('[PRECONDITION_FAILED]');
+ expect(h.api.download).not.toHaveBeenCalled();
+ expect(runtime.install).not.toHaveBeenCalled();
+ });
+
it('rejects a download credential with an invalid expiry timestamp', async () => {
const item = summary();
const h = harness([item]);
@@ -660,7 +720,7 @@ describe('PluginMarketService migration and defaultInstall', () => {
sizeBytes: item.currentRelease.sizeBytes,
});
- await expect(h.service.install(item.id)).rejects.toThrow('[PRECONDITION_FAILED]');
+ await expect(h.service.install(item.id, { expectedReleaseId: item.currentRelease.id })).rejects.toThrow('[PRECONDITION_FAILED]');
expect(runtime.install).not.toHaveBeenCalled();
});
@@ -676,7 +736,7 @@ describe('PluginMarketService migration and defaultInstall', () => {
return [item];
});
- await expect(h.service.install(item.id)).rejects.toThrow('[PRECONDITION_FAILED]');
+ await expect(h.service.install(item.id, { expectedReleaseId: item.currentRelease.id })).rejects.toThrow('[PRECONDITION_FAILED]');
expect(runtime.install).not.toHaveBeenCalled();
expect(h.ledger.installationForGhost(item.ghostId)).toBeNull();
});
@@ -699,7 +759,7 @@ describe('PluginMarketService migration and defaultInstall', () => {
return installedGhost;
});
- await expect(h.service.install(item.id)).resolves.toEqual({
+ await expect(h.service.install(item.id, { expectedReleaseId: item.currentRelease.id })).resolves.toEqual({
ghost: installedGhost,
});
expect(h.ledger.installationForGhost(item.ghostId)).toMatchObject({
diff --git a/apps/desktop/src/main/plugin-market/registerIpc.ts b/apps/desktop/src/main/plugin-market/registerIpc.ts
index 912d56bedd..1ae767143c 100644
--- a/apps/desktop/src/main/plugin-market/registerIpc.ts
+++ b/apps/desktop/src/main/plugin-market/registerIpc.ts
@@ -54,12 +54,18 @@ export function registerPluginMarketIpc(): void {
'plugin-market:install',
(event, pluginId: unknown, options: unknown) => {
assertTrustedAppRendererEvent(event);
- const allowPermissionExpansion =
- typeof options === 'object' &&
- options !== null &&
- (options as { allowPermissionExpansion?: unknown }).allowPermissionExpansion === true;
+ const obj =
+ typeof options === 'object' && options !== null
+ ? (options as {
+ expectedReleaseId?: unknown;
+ allowPermissionExpansion?: unknown;
+ })
+ : null;
+ const expectedReleaseId = requireString(obj?.expectedReleaseId, 'expectedReleaseId');
+ const allowPermissionExpansion = obj?.allowPermissionExpansion === true;
return invokePluginMarket(() =>
service().install(requireString(pluginId, 'pluginId'), {
+ expectedReleaseId,
allowPermissionExpansion,
}),
);
diff --git a/apps/desktop/src/main/plugin-market/service.ts b/apps/desktop/src/main/plugin-market/service.ts
index b2c7a49b41..4e29b13345 100644
--- a/apps/desktop/src/main/plugin-market/service.ts
+++ b/apps/desktop/src/main/plugin-market/service.ts
@@ -230,7 +230,10 @@ export class PluginMarketService {
async install(
pluginId: string,
- options?: {
+ options: {
+ /** Renderer 确认框实际展示过的 release。Main 重拉详情后必须仍一致,
+ * 否则用户审阅 A、实际安装/启用 B(review P1)。 */
+ expectedReleaseId: string;
allowPermissionExpansion?: boolean;
},
): Promise<{ ghost: InstalledGhost }> {
@@ -254,12 +257,22 @@ export class PluginMarketService {
throwIpcError('ALREADY_EXISTS', 'Multiple market Plugins use the same Plugin ID');
}
const plugin = await this.api.detail(pluginId);
+ requireSameMarketOwner(owner);
+ if (plugin.currentRelease.id !== options.expectedReleaseId) {
+ throwIpcError(
+ 'PRECONDITION_FAILED',
+ 'Plugin release changed after permission review',
+ );
+ }
+ const existing = getGhostManager()
+ .list()
+ .some((ghost) => ghost.manifest.id === plugin.ghostId);
return {
ghost: await this.installDetail(
plugin,
{
- allowPermissionExpansion:
- options?.allowPermissionExpansion === true,
+ expectedInstalled: existing,
+ allowPermissionExpansion: options.allowPermissionExpansion === true,
},
owner,
ledger,
@@ -331,8 +344,9 @@ export class PluginMarketService {
plugin: VisiblePluginDetail,
options: {
allowPermissionExpansion?: boolean;
- initiallyEnabled?: boolean;
- } = {},
+ /** 确认操作时的安装意图;下载窗口期目标被另一窗口卸载时拒绝滑入首装。 */
+ expectedInstalled: boolean;
+ } = { expectedInstalled: false },
owner = captureMarketOwner(),
ledger = this.ledgerForOwner(owner),
): Promise<InstalledGhost> {
@@ -379,10 +393,24 @@ export class PluginMarketService {
try {
await downloadVerifiedPlugin(download.url, download, tempPath);
requireSameMarketOwner(owner);
+ if (options.expectedInstalled) {
+ const stillInstalled = getGhostManager()
+ .list()
+ .some((ghost) => ghost.manifest.id === plugin.ghostId);
+ if (!stillInstalled) {
+ // 用户确认的是更新;下载期间若另一窗口已卸载目标,不能把操作
+ // 降级成首装并自动启用。按状态变化拒绝,由 renderer 刷新重试。
+ throwIpcError(
+ 'PRECONDITION_FAILED',
+ 'Plugin was uninstalled while the update was downloading',
+ );
+ }
+ }
+ // 市场首装一律装完即开(2026-07-26 定案,见 installOrUpdateMarketGhostPackage);
+ // 已装过则走原位更新,唤醒/沉睡状态延续当前值。
const ghost = await installOrUpdateMarketGhostPackage(tempPath, {
ghostId: plugin.ghostId,
version: plugin.currentRelease.version,
- initiallyEnabled: options.initiallyEnabled === true,
});
// Once the package directory is committed, finish provenance against the
// owner captured at operation start even if the active session changes.
@@ -526,9 +554,10 @@ export class PluginMarketService {
await this.withMutation(summary.id, async () => {
requireSameMarketOwner(owner);
const detail = await this.api.detail(summary.id);
+ // 装完即开语义已收敛进市场安装入口本身,这里无需再显式声明。
await this.installDetail(
detail,
- { initiallyEnabled: true },
+ { expectedInstalled: false },
owner,
ledger,
);
diff --git a/apps/desktop/src/preload/preload.ts b/apps/desktop/src/preload/preload.ts
index 2e2e1297f7..7f9fe487da 100644
--- a/apps/desktop/src/preload/preload.ts
+++ b/apps/desktop/src/preload/preload.ts
@@ -952,7 +952,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
ipcRenderer.invoke('plugin-market:detail', pluginId),
install: (
pluginId: string,
- options?: { allowPermissionExpansion?: boolean },
+ options: { expectedReleaseId: string; allowPermissionExpansion?: boolean },
): Promise<{ ghost: import('../shared/ghost').InstalledGhost }> =>
ipcRenderer.invoke('plugin-market:install', pluginId, options),
uninstall: (pluginId: string): Promise<{ ok: true }> =>
diff --git a/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx b/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
index 20189e9f80..76cdb40a84 100644
--- a/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
+++ b/apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx
@@ -34,7 +34,7 @@ import {
import { patchDraft } from '@/state/newMakerDraft';
import { ghostInstallErrorKey } from '@/cindy-brain/installErrorKey';
import { confirmAndInstallGhost, pickAndUpdateGhost } from '@/cindy-brain/installFlow';
-import { GhostPermissionDiffView } from '@/cindy-brain/GhostPermissionList';
+import { GhostPermissionDiffView, GhostPermissionList } from '@/cindy-brain/GhostPermissionList';
import { cn } from '@/lib/utils';
import { Switch } from '@/components/ui/switch';
import { getLastWorkingDir, subscribeToLastWorkingDir } from '@/state/lastWorkingDir';
@@ -42,6 +42,7 @@ import { findSplitChildByPanelKind } from '../../../shared/layoutTree';
import {
diffGhostPermissionItems,
ghostPanelKind,
+ ghostPermissionItems,
type GhostSetupStatus,
} from '../../../shared/ghost';
import type {
@@ -458,6 +459,7 @@ export function GhostPluginPage() {
});
if (!approved || !isMarketBusyLeaseActive(marketBusyLease)) return;
const result = await window.electronAPI.pluginMarket.install(marketItem.pluginId, {
+ expectedReleaseId: next.releaseId,
allowPermissionExpansion: diff.added.length > 0,
});
if (!isMarketBusyLeaseActive(marketBusyLease)) return;
@@ -693,23 +695,92 @@ export function GhostPluginPage() {
// 旧确认回调恢复后必须先验权,不能在新会话里继续安装。
const marketBusyLease = acquireMarketBusy(marketDetail.pluginId);
if (!marketBusyLease) return;
+ // 详情页按钮在 update-available 态复用本入口,后端走原位更新并保留
+ // 生效状态 —— 文案必须分支,不能对更新路径承诺"装完即开"(review P1)。
+ const isUpdate = marketDetail.installState === 'update-available';
+ // 装完即开意味着"确认安装"就是运行授权,确认框里必须如实展示权限清单
+ // (与本地装入确认框同一信息量,review P1):首装展示完整清单,更新展示
+ // 与已装版本的权限 diff,并据此决定 allowPermissionExpansion(否则扩权
+ // 更新从本入口必被 main 的 PRECONDITION_FAILED 拦下)。更新详情来自 Main
+ // 的现查事实,renderer 的 ghosts 推送缓存可能短暂滞后;仅在 update 态且缓存
+ // 缺目标时,用既有 listSync 向 Main 现查一次。仍缺失说明状态已经变化,
+ // 让后端按原有校验拒绝,绝不能拿新清单和自己做 diff 吞掉新增权限。
+ let installedGhost =
+ ghosts.find((ghost) => ghost.manifest.id === marketDetail.ghostId) ?? null;
+ if (isUpdate && !installedGhost) {
+ try {
+ installedGhost =
+ window.electronAPI.ghosts
+ .listSync()
+ .ghosts.find((ghost) => ghost.manifest.id === marketDetail.ghostId) ?? null;
+ } catch {
+ // bridge 不可用/状态切换时保持 null;下面不展示伪造的空 diff,
+ // 安装调用也不放开 permission expansion,Main 会按真实状态 fail closed。
+ }
+ }
+ if (isUpdate && !installedGhost) {
+ // detail 仍说可更新、Main 的实时已装清单却没有目标:这是明确的状态
+ // 变化,不要展示伪造的空 diff 后让用户确认一次必失败的更新。
+ if (isMarketBusyLeaseActive(marketBusyLease)) {
+ toast.error(t('settings.ghosts.market.errors.stateChanged'));
+ }
+ releaseMarketBusy(marketBusyLease);
+ await refreshMarket();
+ return;
+ }
+ const diff = isUpdate
+ ? diffGhostPermissionItems(installedGhost!.manifest, marketDetail.manifest)
+ : null;
try {
const confirmed = await confirm({
- title: t('settings.ghosts.market.installConfirmTitle', {
- name: marketDetail.name,
- }),
- description: t('settings.ghosts.market.installConfirmDescription'),
- confirmText: t('settings.ghosts.market.install'),
- cancelText: t('settings.ghosts.installConfirm.cancel'),
+ title: isUpdate
+ ? t('settings.ghosts.updateConfirm.title', { name: marketDetail.name })
+ : t('settings.ghosts.market.installConfirmTitle', {
+ name: marketDetail.name,
+ }),
+ description: isUpdate
+ ? t('settings.ghosts.market.updateConfirmDescription')
+ : t('settings.ghosts.market.installConfirmDescription'),
+ content: (
+ <div
+ className="overflow-y-auto overscroll-contain pr-1"
+ style={{ maxHeight: 'min(56vh, 520px)', scrollbarGutter: 'stable' }}
+ >
+ {isUpdate ? (
+ <GhostPermissionDiffView diff={diff!} />
+ ) : (
+ <GhostPermissionList items={ghostPermissionItems(marketDetail.manifest)} />
+ )}
+ </div>
+ ),
+ maxWidth: 520,
+ confirmText: isUpdate
+ ? t('settings.ghosts.updateConfirm.confirm')
+ : t('settings.ghosts.market.install'),
+ cancelText: isUpdate
+ ? t('settings.ghosts.updateConfirm.cancel')
+ : t('settings.ghosts.installConfirm.cancel'),
autoFocusConfirm: true,
});
if (!confirmed || !isMarketBusyLeaseActive(marketBusyLease)) return;
- const result = await window.electronAPI.pluginMarket.install(marketDetail.pluginId);
+ const result = await window.electronAPI.pluginMarket.install(marketDetail.pluginId, {
+ expectedReleaseId: marketDetail.releaseId,
+ ...(isUpdate && diff!.added.length > 0
+ ? { allowPermissionExpansion: true }
+ : {}),
+ });
if (!isMarketBusyLeaseActive(marketBusyLease)) return;
+ // 市场首装装完即开(2026-07-26 定案),toast 用"已安装";更新路径如实
+ // 用"已更新"(生效状态未被改变)。
toast.success(
- t('settings.ghosts.toast.installedAsleep', {
- name: result.ghost.manifest.name,
- }),
+ isUpdate
+ ? t('settings.ghosts.toast.updated', {
+ name: result.ghost.manifest.name,
+ version: result.ghost.manifest.version,
+ })
+ : t('settings.ghosts.toast.installed', {
+ name: result.ghost.manifest.name,
+ }),
);
setMarketDetail(null);
setSelectedId(result.ghost.manifest.id);
@@ -724,6 +795,7 @@ export function GhostPluginPage() {
}, [
acquireMarketBusy,
confirm,
+ ghosts,
isMarketBusyLeaseActive,
marketDetail,
refreshMarket,
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index e437c219ac..a0a93ed3f2 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -2360,10 +2360,11 @@
"invalidPackage": "This plugin package is invalid or is not supported by this version of Cindy."
},
"securityTitle": "Install and permissions",
- "securityDescription": "Cindy verifies package size and SHA-256 in the main process, validates the plugin manifest, then installs atomically. New installs stay disabled until you review permissions and enable them.",
+ "securityDescription": "Cindy verifies package size and SHA-256 in the main process, validates the plugin manifest, then installs atomically. First-time installs are enabled automatically and can be disabled anytime on the Plugins page; updates keep the current enabled state.",
"noPermissions": "This plugin declares no additional capabilities.",
"installConfirmTitle": "Install “{{name}}”?",
- "installConfirmDescription": "The package will be verified for integrity and manifest compatibility, then installed disabled. Review its setup and enable it when ready."
+ "installConfirmDescription": "The package will be verified for integrity and manifest compatibility. The plugin is enabled automatically after install; you can disable it or adjust its setup anytime.",
+ "updateConfirmDescription": "The package will be verified for integrity and manifest compatibility, then replace the installed version. Its current enabled state stays unchanged."
},
"install": "Install Plugin…",
"empty": "No plugins installed yet",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index e956a3079e..fa16697199 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -2359,10 +2359,11 @@
"invalidPackage": "このプラグインパッケージは無効か、現在の Cindy バージョンではサポートされていません。"
},
"securityTitle": "インストールと権限",
- "securityDescription": "メインプロセスでサイズと SHA-256、プラグインマニフェストを検証してからアトミックにインストールします。権限を確認して有効にするまで、新規プラグインは無効のままです。",
+ "securityDescription": "メインプロセスでサイズと SHA-256、プラグインマニフェストを検証してからアトミックにインストールします。初回インストール後は自動的に有効になり、プラグインページからいつでも無効化できます。更新では現在の有効/無効の状態が維持されます。",
"noPermissions": "このプラグインは追加機能を宣言していません。",
"installConfirmTitle": "「{{name}}」をインストールしますか?",
- "installConfirmDescription": "パッケージの整合性とマニフェスト互換性を確認し、無効の状態でインストールします。設定を確認してから有効にできます。"
+ "installConfirmDescription": "パッケージの整合性とマニフェスト互換性を確認してからインストールします。インストール完了後は自動的に有効になり、いつでも無効化や設定の変更ができます。",
+ "updateConfirmDescription": "パッケージの整合性とマニフェスト互換性を確認してから、既存のバージョンを置き換えます。現在の有効/無効の状態は変わりません。"
},
"install": "プラグインをインストール…",
"empty": "まだプラグインがインストールされていません",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 02903573b7..f6c79dcf2b 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -2359,10 +2359,11 @@
"invalidPackage": "이 플러그인 패키지가 올바르지 않거나 현재 Cindy 버전에서 지원되지 않습니다."
},
"securityTitle": "설치 및 권한",
- "securityDescription": "메인 프로세스에서 크기와 SHA-256 및 플러그인 매니페스트를 검증한 뒤 원자적으로 설치합니다. 권한을 확인하고 활성화할 때까지 새 플러그인은 비활성 상태로 유지됩니다.",
+ "securityDescription": "메인 프로세스에서 크기와 SHA-256 및 플러그인 매니페스트를 검증한 뒤 원자적으로 설치합니다. 최초 설치 후 자동으로 활성화되며 플러그인 페이지에서 언제든지 비활성화할 수 있습니다. 업데이트 시 현재 활성화 상태가 유지됩니다.",
"noPermissions": "이 플러그인은 추가 기능을 선언하지 않았습니다.",
"installConfirmTitle": "‘{{name}}’을(를) 설치할까요?",
- "installConfirmDescription": "패키지 무결성과 매니페스트 호환성을 확인한 뒤 비활성 상태로 설치합니다. 설정을 검토한 후 직접 활성화할 수 있습니다."
+ "installConfirmDescription": "패키지 무결성과 매니페스트 호환성을 확인한 뒤 설치합니다. 설치가 완료되면 자동으로 활성화되며, 언제든지 비활성화하거나 설정을 변경할 수 있습니다.",
+ "updateConfirmDescription": "패키지 무결성과 매니페스트 호환성을 확인한 뒤 기존 버전을 교체합니다. 현재 활성화 상태는 그대로 유지됩니다."
},
"install": "플러그인 설치…",
"empty": "아직 설치된 플러그인이 없습니다",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 92c9ff0c91..3b80cfded0 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -2359,10 +2359,11 @@
"invalidPackage": "该插件包无效,或当前 Cindy 版本不支持它。"
},
"securityTitle": "安装与权限",
- "securityDescription": "安装包会在主进程中校验大小与 SHA-256,再经 Cindy 插件清单校验后原子安装。安装后默认不生效,由你确认权限后再开启。",
+ "securityDescription": "安装包会在主进程中校验大小与 SHA-256,再经 Cindy 插件清单校验后原子安装。首次安装完成后即自动开启,可随时在插件页停用;更新会保留当前生效状态。",
"noPermissions": "此插件未声明额外能力。",
"installConfirmTitle": "安装「{{name}}」?",
- "installConfirmDescription": "安装包将经过完整性与清单校验,并以未生效状态安装。你可以在安装后查看配置并手动开启。"
+ "installConfirmDescription": "安装包将经过完整性与清单校验。安装完成后插件将自动开启,你可以随时在插件页停用或调整配置。",
+ "updateConfirmDescription": "安装包将经过完整性与清单校验,并替换现有版本。当前生效状态保持不变。"
},
"install": "安装插件…",
"empty": "还没有安装任何插件",
diff --git a/apps/desktop/src/renderer/vite-env.d.ts b/apps/desktop/src/renderer/vite-env.d.ts
index 5958a8b214..01e0ac7581 100644
--- a/apps/desktop/src/renderer/vite-env.d.ts
+++ b/apps/desktop/src/renderer/vite-env.d.ts
@@ -1246,7 +1246,7 @@ interface ElectronAPI {
) => Promise<import('../shared/pluginMarket').PluginMarketDetail>;
install: (
pluginId: string,
- options?: { allowPermissionExpansion?: boolean },
+ options: { expectedReleaseId: string; allowPermissionExpansion?: boolean },
) => Promise<{ ghost: import('../shared/ghost').InstalledGhost }>;
uninstall: (pluginId: string) => Promise<{ ok: true }>;
};