@benz-ai-x/dsh-research-graph 0.1.5-rc.1

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,127 @@
1
+ import { S as SessionDigestResult, _ as DiscussionSearchResult, a as ExtractionPreparation, c as ExtractionResult, d as KnowledgeSave, f as KnowledgeSearch, g as DiscussionSearchRequest, h as ResearchTopicWrite, i as KnowledgeExportResult, l as KnowledgeCard, m as ResearchTopicSnapshot, n as ResearchReuseRecord, o as ExtractionPreparationRequest, p as ResearchTopic, r as KnowledgeExportRequest, s as ExtractionRequest, t as ResearchReusePreparation, u as KnowledgeMembership, v as SessionHistoryRequest, y as SessionHistoryResult } from "./research-reuse-3HT5WE0E.js";
2
+ import { Context } from "@deepseek-ai/cordis";
3
+ import { SessionId } from "@deepseek-ai/dsh-session/types";
4
+ import { ConvViewProps } from "@deepseek-ai/dsh-client-ui-conversation/client";
5
+ import { InjectFace, PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
6
+ import { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
7
+ //#region src/client/knowledge-remote.d.ts
8
+ interface KnowledgeApi {
9
+ readonly prepareExport: (request: KnowledgeExportRequest, signal: AbortSignal) => Promise<KnowledgeExportResult>;
10
+ readonly prepareExtraction: (request: ExtractionPreparationRequest, signal: AbortSignal) => Promise<ExtractionPreparation>;
11
+ readonly extract: (request: ExtractionRequest, signal: AbortSignal) => Promise<ExtractionResult>;
12
+ readonly read: (request: {
13
+ readonly cardId: string;
14
+ }, signal: AbortSignal) => Promise<KnowledgeCard | null>;
15
+ readonly save: (request: KnowledgeSave, signal: AbortSignal) => Promise<KnowledgeCard>;
16
+ readonly search: (request: KnowledgeSearch, signal: AbortSignal) => Promise<readonly KnowledgeCard[]>;
17
+ readonly membership: (request: KnowledgeMembership, signal: AbortSignal) => Promise<KnowledgeCard>;
18
+ }
19
+ declare module '@deepseek-ai/dsh-typert-protocol' {
20
+ interface TypertRemoteMap {
21
+ 'sessionGraphKnowledge/prepareExport': (request: KnowledgeExportRequest, signal?: AbortSignal) => Promise<RemoteResult<KnowledgeExportResult>>;
22
+ 'sessionGraphKnowledge/hostIdentity': (signal?: AbortSignal) => Promise<RemoteResult<{
23
+ readonly hostId: string;
24
+ }>>;
25
+ 'sessionGraphKnowledge/prepareExtraction': (request: ExtractionPreparationRequest, signal?: AbortSignal) => Promise<RemoteResult<ExtractionPreparation>>;
26
+ 'sessionGraphKnowledge/extract': (request: ExtractionRequest, signal?: AbortSignal) => Promise<RemoteResult<ExtractionResult>>;
27
+ 'sessionGraphKnowledge/read': (request: {
28
+ readonly cardId: string;
29
+ }, signal?: AbortSignal) => Promise<RemoteResult<KnowledgeCard | null>>;
30
+ 'sessionGraphKnowledge/save': (request: KnowledgeSave, signal?: AbortSignal) => Promise<RemoteResult<KnowledgeCard>>;
31
+ 'sessionGraphKnowledge/search': (request: KnowledgeSearch, signal?: AbortSignal) => Promise<RemoteResult<readonly KnowledgeCard[]>>;
32
+ 'sessionGraphKnowledge/membership': (request: KnowledgeMembership, signal?: AbortSignal) => Promise<RemoteResult<KnowledgeCard>>;
33
+ }
34
+ interface TypertRemoteNamespaceMap {
35
+ sessionGraphKnowledge: {
36
+ prepareExport: TypertRemoteMap['sessionGraphKnowledge/prepareExport'];
37
+ hostIdentity: TypertRemoteMap['sessionGraphKnowledge/hostIdentity'];
38
+ prepareExtraction: TypertRemoteMap['sessionGraphKnowledge/prepareExtraction'];
39
+ extract: TypertRemoteMap['sessionGraphKnowledge/extract'];
40
+ read: TypertRemoteMap['sessionGraphKnowledge/read'];
41
+ save: TypertRemoteMap['sessionGraphKnowledge/save'];
42
+ search: TypertRemoteMap['sessionGraphKnowledge/search'];
43
+ membership: TypertRemoteMap['sessionGraphKnowledge/membership'];
44
+ };
45
+ }
46
+ }
47
+ //#endregion
48
+ //#region src/client/research-reuse-remote.d.ts
49
+ interface ResearchReuseApi {
50
+ readonly prepare: (request: ResearchReusePreparation, signal: AbortSignal) => Promise<ResearchReuseRecord>;
51
+ readonly submit: (request: {
52
+ readonly operationId: string;
53
+ }, signal: AbortSignal) => Promise<ResearchReuseRecord>;
54
+ readonly read: (request: {
55
+ readonly operationId: string;
56
+ }, signal: AbortSignal) => Promise<ResearchReuseRecord | null>;
57
+ readonly forSession: (request: {
58
+ readonly sessionId: string;
59
+ }, signal: AbortSignal) => Promise<readonly ResearchReuseRecord[]>;
60
+ }
61
+ declare module '@deepseek-ai/dsh-typert-protocol' {
62
+ interface TypertRemoteMap {
63
+ 'sessionGraphReuse/prepare': (request: ResearchReusePreparation, signal?: AbortSignal) => Promise<RemoteResult<ResearchReuseRecord>>;
64
+ 'sessionGraphReuse/submit': (request: {
65
+ readonly operationId: string;
66
+ }, signal?: AbortSignal) => Promise<RemoteResult<ResearchReuseRecord>>;
67
+ 'sessionGraphReuse/read': (request: {
68
+ readonly operationId: string;
69
+ }, signal?: AbortSignal) => Promise<RemoteResult<ResearchReuseRecord | null>>;
70
+ 'sessionGraphReuse/forSession': (request: {
71
+ readonly sessionId: string;
72
+ }, signal?: AbortSignal) => Promise<RemoteResult<readonly ResearchReuseRecord[]>>;
73
+ }
74
+ interface TypertRemoteNamespaceMap {
75
+ sessionGraphReuse: {
76
+ prepare: TypertRemoteMap['sessionGraphReuse/prepare'];
77
+ submit: TypertRemoteMap['sessionGraphReuse/submit'];
78
+ read: TypertRemoteMap['sessionGraphReuse/read'];
79
+ forSession: TypertRemoteMap['sessionGraphReuse/forSession'];
80
+ };
81
+ }
82
+ }
83
+ //#endregion
84
+ //#region src/client/GraphView.d.ts
85
+ /** Business face the browser entry injects into the view (navigation verbs). */
86
+ interface GraphViewInjected {
87
+ readonly hostId: string;
88
+ readonly reuse: ResearchReuseApi;
89
+ readonly knowledge: KnowledgeApi;
90
+ topics: {
91
+ readonly list: (signal: AbortSignal) => Promise<readonly ResearchTopic[]>;
92
+ readonly read: (request: {
93
+ readonly topicId: string;
94
+ }, signal: AbortSignal) => Promise<ResearchTopicSnapshot>;
95
+ readonly write: (request: ResearchTopicWrite, signal: AbortSignal) => Promise<ResearchTopic>;
96
+ };
97
+ searchDiscussion: (request: DiscussionSearchRequest, signal: AbortSignal) => Promise<DiscussionSearchResult>;
98
+ /** Read addressed discussion text without activating an Agent. */
99
+ readSessionHistory: (request: SessionHistoryRequest, signal: AbortSignal) => Promise<SessionHistoryResult>;
100
+ /** Open one session on its own last view (double-click and panel verb). */
101
+ openSession: (id: SessionId) => void;
102
+ /** Create a Branch from one session (the panel's New-branch verb). */
103
+ branchSession: (id: SessionId) => Promise<void>;
104
+ /** Explicitly generate or refresh one read-only Session Digest. */
105
+ generateSessionDigest: (id: SessionId, options: {
106
+ readonly refresh: boolean;
107
+ }, signal: AbortSignal) => Promise<SessionDigestResult>;
108
+ /** Create, capture, and open one independent Merge Session. */
109
+ mergeSessions: (sourceIds: readonly SessionId[], instruction: string, signal: AbortSignal) => Promise<SessionId>;
110
+ /** Retry a failed Merge using its already-created target Session. */
111
+ retrySessionMerge: (targetSessionId: SessionId, sourceIds: readonly SessionId[], instruction: string, signal: AbortSignal) => Promise<SessionId>;
112
+ }
113
+ /** The graph view tab's composed props: runtime share + inject face + locale. */
114
+ type GraphViewProps = ConvViewProps & InjectFace<GraphViewInjected> & PropsLocale<'sessionGraph'>;
115
+ //#endregion
116
+ //#region src/client/index.d.ts
117
+ /** Required services: the conversation view slot, the sessions list, and the locale service. */
118
+ declare const inject: string[];
119
+ /**
120
+ * Mount the Digest, Merge, and History Remotes, then register the Graph UI
121
+ * inside a child Context that explicitly depends on those namespaces.
122
+ * @param ctx - client root context.
123
+ * @returns disposer that removes the UI before unmounting its Remote.
124
+ */
125
+ declare function apply(ctx: Context): Promise<() => Promise<void>>;
126
+ //#endregion
127
+ export { type GraphViewInjected, type GraphViewProps, apply, inject };
@@ -0,0 +1,240 @@
1
+ import { S as SessionDigestResult, _ as DiscussionSearchResult, a as ExtractionPreparation, b as SessionDigestModelRoute, c as ExtractionResult, d as KnowledgeSave, f as KnowledgeSearch, g as DiscussionSearchRequest, h as ResearchTopicWrite, i as KnowledgeExportResult, l as KnowledgeCard, m as ResearchTopicSnapshot, n as ResearchReuseRecord, o as ExtractionPreparationRequest, p as ResearchTopic, r as KnowledgeExportRequest, s as ExtractionRequest, t as ResearchReusePreparation, u as KnowledgeMembership, v as SessionHistoryRequest, x as SessionDigestRequest, y as SessionHistoryResult } from "./research-reuse-3HT5WE0E.js";
2
+ import { Context } from "@deepseek-ai/cordis";
3
+ import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
4
+ import z from "@deepseek-ai/schemastery";
5
+ import { z as z$1 } from "zod";
6
+ import { Domain } from "@deepseek-ai/dsh-storage-domain";
7
+ //#region src/session-digest-harness.d.ts
8
+ /** Optional deployment fallback when an old or blank Session has no logged route. */
9
+ interface SessionDigestRouteFallback extends SessionDigestModelRoute {}
10
+ //#endregion
11
+ //#region src/config.d.ts
12
+ /** Optional auxiliary-model fallback and bounded output policy. */
13
+ interface Config {
14
+ readonly provider?: string;
15
+ readonly model?: string;
16
+ readonly maxOutputTokens?: number;
17
+ readonly timeoutMs?: number;
18
+ }
19
+ interface ResolvedConfig {
20
+ readonly route?: SessionDigestRouteFallback;
21
+ readonly maxOutputTokens: number;
22
+ readonly timeoutMs: number;
23
+ }
24
+ /** Loader-facing runtime schema shared by direct callers and plugin activation. */
25
+ declare const Config: z<Config>;
26
+ /** Validate, default, and normalize configuration before runtime use. */
27
+ declare function resolveConfig(config?: Config): ResolvedConfig;
28
+ //#endregion
29
+ //#region src/session-merge.d.ts
30
+ /** Request submitted to the Host after the target is created and named. */
31
+ interface SessionMergeSubmission {
32
+ readonly targetSessionId: string;
33
+ readonly sourceIds: readonly string[];
34
+ readonly instruction: string;
35
+ readonly operationId: string;
36
+ }
37
+ //#endregion
38
+ //#region src/session-merge-projection.d.ts
39
+ /** One immutable source snapshot captured for a Merge Session. */
40
+ interface SessionMergeProjectionSource {
41
+ readonly sessionId: string;
42
+ readonly capturedThroughSeq: number | null;
43
+ }
44
+ /** Client-visible Merge Relation facts for one target Session. */
45
+ interface SessionMergeProjection {
46
+ readonly operationId: string;
47
+ readonly contextEventSeq: number;
48
+ readonly sources: readonly SessionMergeProjectionSource[];
49
+ }
50
+ interface SessionMergeMarker {
51
+ readonly operationId: string;
52
+ readonly sourceIds: readonly string[];
53
+ }
54
+ /** Plain-JSON fold state persisted by the Harness Projection Cache. */
55
+ interface SessionMergeProjectionState {
56
+ readonly inStep: boolean;
57
+ readonly marker: SessionMergeMarker | null;
58
+ readonly value: SessionMergeProjection | null;
59
+ }
60
+ declare module '@deepseek-ai/dsh-session-projection/types' {
61
+ interface SessionProjectionStateMap {
62
+ sessionGraphMerge: SessionMergeProjectionState;
63
+ }
64
+ interface SessionProjectionMap {
65
+ /** Immutable provenance of an explicit Merge Session, or null until captured. */
66
+ sessionGraphMerge: SessionMergeProjection | null;
67
+ }
68
+ }
69
+ //#endregion
70
+ //#region src/session-history-host.d.ts
71
+ /** Public read-only Host boundary; Session Controller remains the source authority. */
72
+ declare class SessionGraphHistoryService extends TypertRemoteService {
73
+ private readonly lifecycle;
74
+ private readonly activeReads;
75
+ private disposal;
76
+ constructor(ctx: Context);
77
+ read(request: SessionHistoryRequest, signal: AbortSignal): Promise<SessionHistoryResult>;
78
+ dispose(): Promise<void>;
79
+ private readHistory;
80
+ }
81
+ //#endregion
82
+ //#region src/session-search-host.d.ts
83
+ /** Host-owned search and source verification; queries never activate an Agent. */
84
+ declare class SessionGraphSearchService extends TypertRemoteService {
85
+ private readonly snapshots;
86
+ private readonly lifecycle;
87
+ private readonly activeSearches;
88
+ private disposal;
89
+ constructor(ctx: Context);
90
+ search(request: DiscussionSearchRequest, signal: AbortSignal): Promise<DiscussionSearchResult>;
91
+ dispose(): Promise<void>;
92
+ private searchValidated;
93
+ private searchDiscussion;
94
+ private page;
95
+ }
96
+ //#endregion
97
+ //#region src/research-topics-host.d.ts
98
+ declare const RESEARCH_TOPIC_DOMAIN: {
99
+ readonly name: "session_graph_topics";
100
+ readonly version: 1;
101
+ readonly tables: {
102
+ readonly topics: {
103
+ readonly valueSchema: import("zod").ZodType<ResearchTopic, unknown, import("zod/v4/core").$ZodTypeInternals<ResearchTopic, unknown>>;
104
+ };
105
+ };
106
+ };
107
+ /** Durable topic operations use the Host's configured storage domain. */
108
+ declare class ResearchTopicsService extends TypertRemoteService {
109
+ private readonly domain;
110
+ private readonly lifecycle;
111
+ private readonly active;
112
+ private tail;
113
+ private disposal;
114
+ constructor(ctx: Context, domain: Domain<typeof RESEARCH_TOPIC_DOMAIN>);
115
+ list(signal: AbortSignal): Promise<readonly ResearchTopic[]>;
116
+ read(request: {
117
+ readonly topicId: string;
118
+ }, signal: AbortSignal): Promise<ResearchTopicSnapshot>;
119
+ write(request: ResearchTopicWrite, signal: AbortSignal): Promise<ResearchTopic>;
120
+ private references;
121
+ private workspaceOwners;
122
+ dispose(): Promise<void>;
123
+ private run;
124
+ }
125
+ //#endregion
126
+ //#region src/knowledge-host.d.ts
127
+ declare const KNOWLEDGE_DOMAIN: {
128
+ readonly name: "session_graph_knowledge";
129
+ readonly version: 1;
130
+ readonly tables: {
131
+ readonly cards: {
132
+ readonly valueSchema: z$1.ZodType<KnowledgeCard, unknown, z$1.core.$ZodTypeInternals<KnowledgeCard, unknown>>;
133
+ };
134
+ readonly extraction_sources: {
135
+ readonly valueSchema: z$1.ZodType<ExtractionPreparation, unknown, z$1.core.$ZodTypeInternals<ExtractionPreparation, unknown>>;
136
+ };
137
+ readonly metadata: {
138
+ readonly valueSchema: z$1.ZodObject<{
139
+ hostId: z$1.ZodString;
140
+ }, z$1.core.$strip>;
141
+ };
142
+ };
143
+ };
144
+ /** Owns saved knowledge and explicit extraction; all source reads go through Harness. */
145
+ declare class KnowledgeService extends TypertRemoteService {
146
+ private readonly domain;
147
+ private readonly config;
148
+ private readonly requests;
149
+ private tail;
150
+ constructor(ctx: Context, domain: Domain<typeof KNOWLEDGE_DOMAIN>, config: ResolvedConfig);
151
+ hostIdentity(signal: AbortSignal): Promise<{
152
+ readonly hostId: string;
153
+ }>;
154
+ prepareExport(request: KnowledgeExportRequest, signal: AbortSignal): Promise<KnowledgeExportResult>;
155
+ prepareExtraction(request: ExtractionPreparationRequest, signal: AbortSignal): Promise<ExtractionPreparation>;
156
+ extract(request: ExtractionRequest, signal: AbortSignal): Promise<ExtractionResult>;
157
+ private preparation;
158
+ private extractionSource;
159
+ read(request: {
160
+ readonly cardId: string;
161
+ }, signal: AbortSignal): Promise<KnowledgeCard | null>;
162
+ search(request: KnowledgeSearch, signal: AbortSignal): Promise<readonly KnowledgeCard[]>;
163
+ membership(request: KnowledgeMembership, signal: AbortSignal): Promise<KnowledgeCard>;
164
+ save(request: KnowledgeSave, signal: AbortSignal): Promise<KnowledgeCard>;
165
+ private capture;
166
+ dispose(): Promise<void>;
167
+ }
168
+ //#endregion
169
+ //#region src/research-reuse-host.d.ts
170
+ declare const RESEARCH_REUSE_DOMAIN: {
171
+ readonly name: "session_graph_reuse";
172
+ readonly version: 1;
173
+ readonly tables: {
174
+ readonly attempts: {
175
+ readonly valueSchema: z$1.ZodType<ResearchReuseRecord, unknown, z$1.core.$ZodTypeInternals<ResearchReuseRecord, unknown>>;
176
+ };
177
+ };
178
+ };
179
+ /** A durable admission journal binds one frozen preview to one native Session/request identity. */
180
+ declare class ResearchReuseService extends TypertRemoteService {
181
+ private readonly domain;
182
+ private readonly requests;
183
+ private tail;
184
+ constructor(ctx: Context, domain: Domain<typeof RESEARCH_REUSE_DOMAIN>);
185
+ prepare(request: ResearchReusePreparation, signal: AbortSignal): Promise<ResearchReuseRecord>;
186
+ read(request: {
187
+ readonly operationId: string;
188
+ }, signal: AbortSignal): Promise<ResearchReuseRecord | null>;
189
+ forSession(request: {
190
+ readonly sessionId: string;
191
+ }, signal: AbortSignal): Promise<readonly ResearchReuseRecord[]>;
192
+ submit(request: {
193
+ readonly operationId: string;
194
+ }, signal: AbortSignal): Promise<ResearchReuseRecord>;
195
+ private recoverTarget;
196
+ private serialize;
197
+ dispose(): Promise<void>;
198
+ }
199
+ //#endregion
200
+ //#region src/index.d.ts
201
+ declare module '@deepseek-ai/cordis' {
202
+ interface Context {
203
+ sessionGraphDigest: SessionGraphDigestService;
204
+ sessionGraphMerge: SessionGraphMergeService;
205
+ sessionGraphHistory: SessionGraphHistoryService;
206
+ sessionGraphSearch: SessionGraphSearchService;
207
+ sessionGraphTopics: ResearchTopicsService;
208
+ sessionGraphKnowledge: KnowledgeService;
209
+ sessionGraphReuse: ResearchReuseService;
210
+ }
211
+ }
212
+ /** Eager Host services required by the read-only digest capability. */
213
+ declare const inject: string[];
214
+ interface QuiescentRemoteService {
215
+ dispose(): Promise<void>;
216
+ }
217
+ /** Package-owned Host service addressed by the browser contribution. */
218
+ declare class SessionGraphDigestService extends TypertRemoteService implements QuiescentRemoteService {
219
+ private readonly digests;
220
+ constructor(ctx: Context, config: ResolvedConfig);
221
+ generate(request: SessionDigestRequest, signal: AbortSignal): Promise<SessionDigestResult>;
222
+ dispose(): Promise<void>;
223
+ }
224
+ /** Package-owned Host service that submits one durable Session Merge capture. */
225
+ declare class SessionGraphMergeService extends TypertRemoteService implements QuiescentRemoteService {
226
+ private readonly merges;
227
+ private readonly lifecycle;
228
+ private readonly activeCalls;
229
+ private disposed;
230
+ private disposal;
231
+ constructor(ctx: Context);
232
+ private disposedFailure;
233
+ private submitAdmitted;
234
+ submit(request: SessionMergeSubmission, callerSignal: AbortSignal): Promise<SessionMergeProjection>;
235
+ dispose(): Promise<void>;
236
+ }
237
+ /** Install read-only Search/History/Digest services, the Merge projection, and Merge submission. */
238
+ declare function apply(ctx: Context, config?: Config): Promise<void>;
239
+ //#endregion
240
+ export { Config, SessionGraphDigestService, SessionGraphMergeService, apply, inject, resolveConfig };
@@ -0,0 +1,14 @@
1
+ import { Context } from "@deepseek-ai/cordis";
2
+ //#region src/invariant.d.ts
3
+ /** Cordis companion plugin name. */
4
+ declare const name = "research-graph-invariant";
5
+ /** Service required before the companion can reserve package ownership. */
6
+ declare const inject: string[];
7
+ /**
8
+ * Register this package's invariant companion.
9
+ * @param ctx - Cordis context carrying the invariant service.
10
+ * @returns the installed registration's disposer after setup succeeds.
11
+ */
12
+ declare const apply: (ctx: Context) => Promise<() => void>;
13
+ //#endregion
14
+ export { apply, inject, name };