@poco-ai/agentero-dsh-recommend 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,74 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ declare const zh: {
3
+ title: string;
4
+ arxivTab: string;
5
+ zhihuTab: string;
6
+ refresh: string;
7
+ computing: string;
8
+ probing: string;
9
+ addCategory: string;
10
+ categoryPlaceholder: string;
11
+ removeCategory: string;
12
+ categories: string;
13
+ expand: string;
14
+ collapse: string;
15
+ settings: string;
16
+ settingsDescription: string;
17
+ baseUrl: string;
18
+ apiKey: string;
19
+ model: string;
20
+ zhihuSecret: string;
21
+ save: string;
22
+ saving: string;
23
+ saved: string;
24
+ keyConfigured: string;
25
+ keyMissing: string;
26
+ secretConfigured: string;
27
+ secretMissing: string;
28
+ keepBlank: string;
29
+ close: string;
30
+ idle: string;
31
+ needsEmbedding: string;
32
+ probeFailed: string;
33
+ needsCorpus: string;
34
+ noCandidates: string;
35
+ retry: string;
36
+ openSettings: string;
37
+ updatedAt: string;
38
+ corpusCount: string;
39
+ import: string;
40
+ imported: string;
41
+ importing: string;
42
+ open: string;
43
+ actionFailed: string;
44
+ vaultMissing: string;
45
+ zhihuSearchPlaceholder: string;
46
+ zhihuSearch: string;
47
+ zhihuNote: string;
48
+ zhihuEmpty: string;
49
+ zhihuLoading: string;
50
+ zhihuRefresh: string;
51
+ answer: string;
52
+ article: string;
53
+ votes: string;
54
+ zhihuNoSecret: string;
55
+ zhihuEmptyQuery: string;
56
+ zhihuHint: string;
57
+ };
58
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
59
+ interface LocaleNamespaceMap {
60
+ /** Recommendation dock copy. */
61
+ 'agentero.recommend': keyof typeof zh;
62
+ }
63
+ }
64
+ /** Browser plugin name. */
65
+ export declare const name = "agentero-recommend";
66
+ /** Slot and locale services. The dock renders inside the composer stack. */
67
+ export declare const inject: string[];
68
+ /**
69
+ * Dock the recommendation strip under the conversation composer.
70
+ * arXiv daily and Zhihu share one surface so neither takes a sidebar page.
71
+ * @param ctx - Browser plugin context.
72
+ */
73
+ export declare function apply(ctx: Context): void;
74
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import { type ReactNode } from 'react';
3
+ import { type RecommendFace } from './types';
4
+ type RecommendDockProps = PropsLocale<'agentero.recommend'> & RecommendFace;
5
+ /**
6
+ * Recommendation cards docked under the composer.
7
+ *
8
+ * arXiv daily ranking and Zhihu discussions share one compact strip so the
9
+ * surface never steals the conversation column. Results only refresh on
10
+ * request: mounting reads the host's same-day cache instead of re-embedding
11
+ * the whole library.
12
+ */
13
+ export declare function RecommendDock({ t, loadSettings, saveSettings, probeEmbedding, loadArxiv, recommendArxiv, searchZhihu, importPaper, }: RecommendDockProps): ReactNode;
14
+ export {};
@@ -0,0 +1,68 @@
1
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
2
+ export type RecommendT = PropsLocale<'agentero.recommend'>['t'];
3
+ export interface EmbeddingSettingsView {
4
+ configured: boolean;
5
+ baseUrl: string;
6
+ model: string;
7
+ keyPresent: boolean;
8
+ source: 'agentero' | 'dsh' | 'none';
9
+ }
10
+ export interface SettingsView {
11
+ vaultConfigured: boolean;
12
+ embedding: EmbeddingSettingsView;
13
+ zhihu: {
14
+ configured: boolean;
15
+ source: 'agentero' | 'dsh' | 'none';
16
+ };
17
+ }
18
+ export interface ArxivRecommendItem {
19
+ arxivId: string;
20
+ title: string;
21
+ abstract: string;
22
+ url: string;
23
+ publishedAt?: string;
24
+ score: number;
25
+ }
26
+ export interface ArxivRecommendResult {
27
+ items: ArxivRecommendItem[];
28
+ computedAt: string;
29
+ categories: string[];
30
+ corpusSize: number;
31
+ reusedCache: boolean;
32
+ }
33
+ export interface ZhihuSearchItem {
34
+ kind: 'answer' | 'article';
35
+ title: string;
36
+ url: string;
37
+ excerpt: string;
38
+ author: string;
39
+ votes: number;
40
+ score: number;
41
+ }
42
+ export interface ProbeResult {
43
+ dim: number;
44
+ latencyMs: number;
45
+ }
46
+ export interface SettingsPatch {
47
+ embeddingBaseUrl?: string;
48
+ embeddingApiKey?: string;
49
+ embeddingModel?: string;
50
+ zhihuAccessSecret?: string;
51
+ }
52
+ export interface RecommendFace {
53
+ loadSettings(): Promise<SettingsView>;
54
+ saveSettings(patch: SettingsPatch): Promise<SettingsView>;
55
+ probeEmbedding(): Promise<ProbeResult>;
56
+ loadArxiv(categories: string[]): Promise<ArxivRecommendResult | null>;
57
+ recommendArxiv(categories: string[]): Promise<ArxivRecommendResult>;
58
+ searchZhihu(query: string, count?: number): Promise<ZhihuSearchItem[]>;
59
+ importPaper(text: string): Promise<void>;
60
+ }
61
+ export declare function errorText(body: unknown): string | undefined;
62
+ export declare function settingsFrom(body: unknown): SettingsView;
63
+ export declare function arxivFrom(body: unknown): ArxivRecommendResult | null;
64
+ export declare function zhihuFrom(body: unknown): ZhihuSearchItem[];
65
+ export declare function probeFrom(body: unknown): ProbeResult;
66
+ export declare function reasonOf(message: string): 'noEmbedding' | 'probeFailed' | 'emptyCorpus' | 'noCandidates' | 'noSecret' | 'emptyQuery' | 'other';
67
+ export declare function shown(message: string, t: RecommendT): string;
68
+ export declare function messageOf(error: unknown): string;