+
- {settled !== undefined &&
{t(settled)}
}
- {view?.invalid ?
{t('invalid-history')}
- : details === null ?
{t('transport')}
- : details?.status === 'refused' ?
{t(details.reason)}
- : open && error !== undefined &&
{t(error)}
}
+ {status !== undefined &&
{t(status)}
}
+ {failure !== undefined &&
{t(failure)}
}
+ {current === null ?
{t('transport')}
+ : current?.status === 'refused' ?
{t(current.reason)}
+ : open && error !== undefined &&
{t(error)}
}
{open &&
}
-
+ >
}
diff --git a/packages/experimental/client-ui-plugin-recommendations/src/client/locales.ts b/packages/experimental/client-ui-plugin-recommendations/src/client/locales.ts
index 60c95c066c..e4fe174db4 100644
--- a/packages/experimental/client-ui-plugin-recommendations/src/client/locales.ts
+++ b/packages/experimental/client-ui-plugin-recommendations/src/client/locales.ts
@@ -5,16 +5,14 @@ export const zh = {
detailsFor: '查看详情:{title}',
'version-error': '插件与当前 DSH 版本不兼容,请更新 DSH 后重试。',
'management-error': '无法启用插件,请打开详情检查错误后重试。',
- 'invalid-history': '无法读取此会话的推荐记录。请更新 DSH,或新建会话后重试。',
enable: '启用',
dismiss: '暂不需要',
enabling: '正在处理…',
scope: '启用后可在所有会话中使用',
- applied: '已启用',
+ enabled: '已启用',
'already-enabled': '已在插件页开启,可查看详情了解运行状态',
dismissed: '已忽略',
replaced: '已替换',
- suppressed: '未展示',
'restart-required': '已保存,重启 DSH 后生效',
overridden: '已保存,但被其他配置覆盖。请在插件页检查。',
failed: '启用失败。可重试或在插件页检查。',
@@ -38,16 +36,14 @@ export const en = {
detailsFor: 'View details: {title}',
'version-error': 'This plugin is incompatible with this DSH version. Update DSH and retry.',
'management-error': 'Could not enable the plugin. Open its details to check the error and retry.',
- 'invalid-history': 'This conversation has an unreadable recommendation receipt. Update DSH or try in a new conversation.',
enable: 'Enable',
dismiss: 'Not now',
enabling: 'Working…',
scope: 'Available in all conversations when enabled',
- applied: 'Enabled',
+ enabled: 'Enabled',
'already-enabled': 'Already selected in Plugins. Open details to check its runtime status.',
dismissed: 'Dismissed',
replaced: 'Replaced',
- suppressed: 'Not offered',
'restart-required': 'Saved. Restart DSH to apply.',
overridden: 'Saved, but another configuration overrides it. Check Plugins.',
failed: 'Could not enable. Retry or check Plugins.',
@@ -68,16 +64,14 @@ export const ja = {
detailsFor: '詳細を表示:{title}',
'version-error': 'このプラグインは現在の DSH バージョンと互換性がありません。DSH を更新してから再試行してください。',
'management-error': 'プラグインを有効にできませんでした。詳細を開いてエラーを確認し、再試行してください。',
- 'invalid-history': 'この会話の推薦記録を読み取れません。DSH を更新するか、新しい会話で試してください。',
enable: '有効にする',
dismiss: '今はしない',
enabling: '処理中…',
scope: '有効にするとすべての会話で使えます',
- applied: '有効化済み',
+ enabled: '有効化済み',
'already-enabled': 'プラグイン画面で有効になっています。詳細で動作状況を確認できます。',
dismissed: '却下済み',
replaced: '置き換え済み',
- suppressed: '非表示',
'restart-required': '保存しました。適用するには DSH を再起動してください。',
overridden: '保存しましたが、別の設定で上書きされています。プラグイン画面を確認してください。',
failed: '有効にできませんでした。再試行するか、プラグイン画面を確認してください。',
diff --git a/packages/experimental/client-ui-plugin-recommendations/src/client/mount.ts b/packages/experimental/client-ui-plugin-recommendations/src/client/mount.ts
index 5f84862ff9..d07cfacfc9 100644
--- a/packages/experimental/client-ui-plugin-recommendations/src/client/mount.ts
+++ b/packages/experimental/client-ui-plugin-recommendations/src/client/mount.ts
@@ -1,61 +1,49 @@
-/** Register completed-answer recommendations and their localized actions. */
+/** Register the official plugin card body, its catalog-text Remote and its localized copy. */
+import { createElement } from 'react'
import type { Context } from '@deepseek-ai/cordis'
import { createSnapshotStore } from '@deepseek-ai/dsh-client-store'
-import type { SessionId } from '@deepseek-ai/dsh-session/types'
import type {} from '@deepseek-ai/dsh-api-remotes/client'
import type {} from '@deepseek-ai/dsh-client-locale/client'
-import type {} from '@deepseek-ai/dsh-client-ui-renderer/client'
import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'
+import type {} from '@deepseek-ai/dsh-experimental-client-ui-action-cards/client'
import type {} from '@deepseek-ai/dsh-experimental-plugin-recommendations/remote'
import type { TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol'
-import type {} from '@deepseek-ai/dsh-experimental-plugin-recommendations/types'
-import { RecommendationTail, type CardInjected, type CatalogDetails } from './Card.tsx'
+import { PluginCardBody, type CatalogDetails, type PluginCardServices } from './Card.tsx'
import { en, ja, zh, type RecommendationKey } from './locales.ts'
declare module '@deepseek-ai/dsh-client-ui-slots' {
interface LocaleNamespaceMap { pluginRecommendations: RecommendationKey }
}
-/** Registries available before this plugin mounts its optional Remote. */
-export const inject = ['slots', 'locale', 'remote', 'pluginNavigation']
+/** Services the body needs; the shared card plugin provides `actionCards`. */
+export const inject = ['locale', 'remote', 'actionCards', 'pluginNavigation']
-/** Mount the optional Remote and UI for the same plugin lifetime.
+/** Mount the catalog-text Remote, then register the body for the same plugin lifetime.
* @param ctx - Client plugin context.
* @param contribution - Generated Remote descriptors supplied by the built entry.
- * @returns disposer removing the UI before the Remote contribution.
+ * @returns disposer removing the body before the Remote contribution.
*/
export async function mountRecommendations(ctx: Context, contribution: TypertRemoteContribution): Promise<() => Promise