@fses/workbench-app 0.2.3 → 0.2.6
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/WORKBENCH-CLOSURE.json +12 -12
- package/dist/{Workspace-fYH2XNdb.js → Workspace-7_3p28OA.js} +6 -7
- package/dist/fses-workbench-app.js +4 -4
- package/dist/{index-CbIJlts1.js → index-CqkM30RV.js} +239 -234
- package/dist/internal/personal-workbench/lib/cardRecommendationIdentity.d.ts +37 -0
- package/dist/internal/personal-workbench/lib/workbenchCardRecommendationFallback.d.ts +2 -0
- package/dist/internal/personal-workbench/lib/workbenchCardRecommendationReturnItemUpsert.d.ts +32 -0
- package/dist/runtime/index.js +1 -1
- package/dist/{useWorkbenchRuntime-Ch8lqkjO.js → useWorkbenchRuntime-Ci-QDnAY.js} +6042 -5853
- package/node_modules/@fses/ai-chat/package.json +5 -5
- package/node_modules/@fses/workbench-card/package.json +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 推荐卡片规范化身份工具 - 为工作台多入口推荐去重提供统一纯函数。
|
|
3
|
+
* @author seadon
|
|
4
|
+
* @created 2026-08-15
|
|
5
|
+
*/
|
|
6
|
+
export type CardRecommendationEvidenceLevel = 'identity' | 'structure' | 'question' | 'none';
|
|
7
|
+
export type CardRecommendationDedupeScope = 'conversation' | 'answer_section' | 'none';
|
|
8
|
+
export interface CardRecommendationIdentityInput {
|
|
9
|
+
payload: unknown;
|
|
10
|
+
conversationId?: string;
|
|
11
|
+
answerSectionKey?: string;
|
|
12
|
+
groupType?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CardRecommendationIdentity {
|
|
15
|
+
sourceKeys: string[];
|
|
16
|
+
strongKeys: string[];
|
|
17
|
+
weakAliasKeys: string[];
|
|
18
|
+
renderIdentityKeys: string[];
|
|
19
|
+
primaryKey: string;
|
|
20
|
+
renderKey: string;
|
|
21
|
+
evidenceLevel: CardRecommendationEvidenceLevel;
|
|
22
|
+
dedupeScope: CardRecommendationDedupeScope;
|
|
23
|
+
scopeKey?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Builds the normalized identity for one recommendation payload or draft.
|
|
27
|
+
* @param input - Identity input.
|
|
28
|
+
* @returns Canonical recommendation identity.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildCardRecommendationIdentity(input: CardRecommendationIdentityInput): CardRecommendationIdentity;
|
|
31
|
+
/**
|
|
32
|
+
* Checks whether two recommendation identities can be merged by strong evidence.
|
|
33
|
+
* @param a - First identity.
|
|
34
|
+
* @param b - Second identity.
|
|
35
|
+
* @returns True when both identities represent the same scoped query result.
|
|
36
|
+
*/
|
|
37
|
+
export declare function hasStrongCardRecommendationOverlap(a: CardRecommendationIdentity, b: CardRecommendationIdentity): boolean;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* @created 2026-07-03
|
|
5
5
|
*/
|
|
6
6
|
import type { CardRecommendationItem } from '@fses/workbench-app/types';
|
|
7
|
+
/** 空注册卡片候选降级为明细表时展示给用户的成功文案。 */
|
|
8
|
+
export declare const CARD_RECOMMENDATION_FALLBACK_MESSAGE = "\u5DF2\u6839\u636E\u95EE\u6570\u7ED3\u679C\u751F\u6210\u660E\u7EC6\u8868\u5019\u9009\uFF0C\u8BF7\u9009\u62E9\u540E\u63D2\u5165\u5DE5\u4F5C\u533A\u3002";
|
|
7
9
|
interface BuildFallbackRecommendationsInput {
|
|
8
10
|
queryResult?: Record<string, unknown>;
|
|
9
11
|
source?: unknown;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 工作台推荐卡片 returnItem 写入工具 - 收敛多入口推荐去重与替换。
|
|
3
|
+
* @author seadon
|
|
4
|
+
* @created 2026-08-15
|
|
5
|
+
*/
|
|
6
|
+
import type { ConversationReturnItem, ConversationTurn, WorkbenchPlanStreamEvent } from '@fses/workbench-app/types';
|
|
7
|
+
export type CardRecommendationsReadyEvent = Extract<WorkbenchPlanStreamEvent, {
|
|
8
|
+
type: 'card_recommendations_ready';
|
|
9
|
+
}> & {
|
|
10
|
+
conversationId?: string;
|
|
11
|
+
recommendationProducer?: string;
|
|
12
|
+
};
|
|
13
|
+
export interface UpsertCardRecommendationReturnItemInput {
|
|
14
|
+
turns: ConversationTurn[];
|
|
15
|
+
event: CardRecommendationsReadyEvent;
|
|
16
|
+
conversationId?: string;
|
|
17
|
+
answerSectionKey?: string;
|
|
18
|
+
producer: 'card_module' | 'deep_agent_transcript' | 'standalone_query_result_api';
|
|
19
|
+
createdAt?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parses a recommendation return-item payload.
|
|
23
|
+
* @param item - Candidate return item.
|
|
24
|
+
* @returns Parsed recommendation payload, or null.
|
|
25
|
+
*/
|
|
26
|
+
export declare function cardRecommendationReturnPayload(item: ConversationReturnItem): Record<string, unknown> | null;
|
|
27
|
+
/**
|
|
28
|
+
* Upserts one card recommendation return item across realtime, standalone and transcript paths.
|
|
29
|
+
* @param input - Upsert input.
|
|
30
|
+
* @returns Updated conversation turns.
|
|
31
|
+
*/
|
|
32
|
+
export declare function upsertCardRecommendationReturnItem(input: UpsertCardRecommendationReturnItemInput): ConversationTurn[];
|
package/dist/runtime/index.js
CHANGED