@crazx/dsh-client-ui-conversation 0.1.5-alpha.1.zw.3
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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +127 -0
- package/README.zh.md +127 -0
- package/lib/client.js +16935 -0
- package/lib/index.js +27 -0
- package/lib/types/client/apply.d.ts +25 -0
- package/lib/types/client/context-occupancy.d.ts +14 -0
- package/lib/types/client/contract/composer-blocks.d.ts +28 -0
- package/lib/types/client/contract/composer-submission.d.ts +8 -0
- package/lib/types/client/contract/context-provenance.d.ts +29 -0
- package/lib/types/client/contract/conversation.d.ts +256 -0
- package/lib/types/client/contract/input.d.ts +427 -0
- package/lib/types/client/contract/queue.d.ts +9 -0
- package/lib/types/client/contract/records.d.ts +272 -0
- package/lib/types/client/contract/request-inspection.d.ts +131 -0
- package/lib/types/client/contract/slots.d.ts +409 -0
- package/lib/types/client/contract/snapshot.d.ts +20 -0
- package/lib/types/client/contract/system-prompt.d.ts +35 -0
- package/lib/types/client/contract/views.d.ts +26 -0
- package/lib/types/client/conversation/assembler.d.ts +128 -0
- package/lib/types/client/conversation/assembly.d.ts +97 -0
- package/lib/types/client/conversation/definition-registry.d.ts +33 -0
- package/lib/types/client/conversation/event-registry.d.ts +24 -0
- package/lib/types/client/conversation/historical-images.d.ts +51 -0
- package/lib/types/client/conversation/location-index.d.ts +85 -0
- package/lib/types/client/conversation/view-registry.d.ts +12 -0
- package/lib/types/client/image-labels.d.ts +23 -0
- package/lib/types/client/index.d.ts +36 -0
- package/lib/types/client/input/blocks.d.ts +27 -0
- package/lib/types/client/input/decorations.d.ts +32 -0
- package/lib/types/client/input/editor/ComposerContentEditable.d.ts +16 -0
- package/lib/types/client/input/editor/DecoratorPortals.d.ts +14 -0
- package/lib/types/client/input/editor/ReferenceChip.d.ts +17 -0
- package/lib/types/client/input/editor/chip-node.d.ts +110 -0
- package/lib/types/client/input/editor/claim-decor.d.ts +23 -0
- package/lib/types/client/input/editor/keymap.d.ts +41 -0
- package/lib/types/client/input/editor/projection.d.ts +93 -0
- package/lib/types/client/input/editor/span-map.d.ts +38 -0
- package/lib/types/client/input/editor/text-ref.d.ts +60 -0
- package/lib/types/client/input/facade.d.ts +298 -0
- package/lib/types/client/input/hub.d.ts +88 -0
- package/lib/types/client/input/machine.d.ts +46 -0
- package/lib/types/client/input/queue-store.d.ts +20 -0
- package/lib/types/client/input/submission-policy.d.ts +52 -0
- package/lib/types/client/locales.d.ts +330 -0
- package/lib/types/client/queue/QueueDock.d.ts +26 -0
- package/lib/types/client/service.d.ts +185 -0
- package/lib/types/client/settings/EnterBehaviorRow.d.ts +21 -0
- package/lib/types/client/skeleton/ContextMeter.d.ts +14 -0
- package/lib/types/client/skeleton/ConversationRoot.d.ts +5 -0
- package/lib/types/client/skeleton/ConversationSession.d.ts +26 -0
- package/lib/types/client/skeleton/EmptyHero.d.ts +46 -0
- package/lib/types/client/skeleton/InputBar.d.ts +18 -0
- package/lib/types/client/skeleton/PermissionSelect.d.ts +11 -0
- package/lib/types/client/skeleton/TodoPanel.d.ts +21 -0
- package/lib/types/client/skeleton/safari.d.ts +18 -0
- package/lib/types/client/skeleton/toolbar-hosts.d.ts +17 -0
- package/lib/types/client/stores.d.ts +24 -0
- package/lib/types/client/view-selection.d.ts +9 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/submission-settings.d.ts +20 -0
- package/package.json +103 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Per-Session target-neutral Conversation assembly. */
|
|
2
|
+
import { Service, type Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
4
|
+
import type { ISessions, SessionBinding } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
5
|
+
import type { SessionEvent, SessionId } from '@deepseek-ai/dsh-session/types';
|
|
6
|
+
import { type ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
7
|
+
import type { ConversationViewSnapshotMap } from '../contract/conversation.ts';
|
|
8
|
+
import type { ConversationSnapshot } from '../contract/snapshot.ts';
|
|
9
|
+
import type { ConversationPromptSnapshot, RequestPromptInspection, SystemPromptNode } from '../contract/request-inspection.ts';
|
|
10
|
+
import { type SystemPromptState } from '../contract/system-prompt.ts';
|
|
11
|
+
import { ConversationEventRegistry } from './event-registry.ts';
|
|
12
|
+
import { ConversationViewRegistry } from './view-registry.ts';
|
|
13
|
+
/** Observable faces published for one Session's Conversation assembly. */
|
|
14
|
+
export interface ConversationBinding {
|
|
15
|
+
readonly snapshot: ObservableSnapshot<ConversationSnapshot>;
|
|
16
|
+
/**
|
|
17
|
+
* Add one selected target to the Session's monotonic active set.
|
|
18
|
+
* @param target - registered or subsequently registered Conversation target.
|
|
19
|
+
*/
|
|
20
|
+
activate(target: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve one target-owned snapshot source.
|
|
23
|
+
* The first subscriber activates the target unless shell selection already
|
|
24
|
+
* activated it; activation lasts for the remaining Session lifetime.
|
|
25
|
+
* @param target - registered Conversation target.
|
|
26
|
+
* @returns identity-stable source following the target.
|
|
27
|
+
*/
|
|
28
|
+
target<Target extends Extract<keyof ConversationViewSnapshotMap, string>>(target: Target): ObservableSnapshot<ConversationViewSnapshotMap[Target] | undefined>;
|
|
29
|
+
}
|
|
30
|
+
/** Root service owning Conversation registries and per-Session bindings. */
|
|
31
|
+
export declare class UiConversation extends Service {
|
|
32
|
+
private readonly sessions;
|
|
33
|
+
/** Registry of event matchers and target snapshot builders. */
|
|
34
|
+
readonly events: ConversationEventRegistry;
|
|
35
|
+
/** Registry of target View definitions. */
|
|
36
|
+
readonly views: ConversationViewRegistry;
|
|
37
|
+
private readonly bindings;
|
|
38
|
+
private readonly images;
|
|
39
|
+
/**
|
|
40
|
+
* @param ctx - owning Client context.
|
|
41
|
+
* @param sessions - Session Controller object layer.
|
|
42
|
+
*/
|
|
43
|
+
constructor(ctx: Context, sessions: ISessions);
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the Conversation binding for one Controller binding or Session id.
|
|
46
|
+
* @param source - Session binding or identity.
|
|
47
|
+
* @returns stable Conversation binding.
|
|
48
|
+
*/
|
|
49
|
+
binding(source: SessionBinding | SessionId): ConversationBinding;
|
|
50
|
+
/**
|
|
51
|
+
* Resolve one session-authorized durable image URL, cached per Session so
|
|
52
|
+
* every Conversation target shares one read and one browser URL.
|
|
53
|
+
* @param sessionId - Session authorization and lifetime scope.
|
|
54
|
+
* @param attachment - Durable image reference from a session event.
|
|
55
|
+
* @returns browser URL valid until the Session binding is released.
|
|
56
|
+
*/
|
|
57
|
+
imageUrl(sessionId: SessionId, attachment: ImageAttachmentRef): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Read a cached durable image URL synchronously when one is available.
|
|
60
|
+
* @param sessionId - Session authorization and lifetime scope.
|
|
61
|
+
* @param attachment - Durable image reference from a session event.
|
|
62
|
+
* @returns current preview or canonical URL, if cached.
|
|
63
|
+
*/
|
|
64
|
+
peekImageUrl(sessionId: SessionId, attachment: ImageAttachmentRef): string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Adopt an already-displayable URL for one durable reference (see
|
|
67
|
+
* HistoricalImageCache.seed): the transcript node then renders it without a
|
|
68
|
+
* byte round-trip.
|
|
69
|
+
* @param sessionId - Session authorization and lifetime scope.
|
|
70
|
+
* @param attachment - Durable image reference the URL displays.
|
|
71
|
+
* @param url - browser URL to adopt.
|
|
72
|
+
* @returns whether the cache took URL ownership.
|
|
73
|
+
*/
|
|
74
|
+
seedImageUrl(sessionId: SessionId, attachment: ImageAttachmentRef, url: string): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Interpret a system message or surface replacement for target-owned prompt Definitions.
|
|
77
|
+
* @param previous - System facts at the preceding relevant loaded event.
|
|
78
|
+
* @param event - Durable system message or positional replacement.
|
|
79
|
+
* @returns Immutable prompt interpretation at this event.
|
|
80
|
+
*/
|
|
81
|
+
inspectSystemPrompt(previous: SystemPromptState | undefined, event: SessionEvent): SystemPromptState;
|
|
82
|
+
/**
|
|
83
|
+
* Canonicalize one `request/header` event against the previous prompt state
|
|
84
|
+
* and the `system/message` node in force.
|
|
85
|
+
*
|
|
86
|
+
* A pure interpretation shared by the Chat and Trajectory Definitions, exposed
|
|
87
|
+
* as a service method because cross-plugin value imports are forbidden in
|
|
88
|
+
* client bundles.
|
|
89
|
+
* @param previous - prompt recorded by the preceding loaded header, if any.
|
|
90
|
+
* @param event - the `request/header` session event to interpret.
|
|
91
|
+
* @param system - effective prompt after loaded surface replacements, if any.
|
|
92
|
+
* @returns the canonical prompt snapshot and any model-visible change.
|
|
93
|
+
*/
|
|
94
|
+
inspectRequestPrompt(previous: ConversationPromptSnapshot | undefined, event: SessionEvent<'request/header'>, system: SystemPromptNode | undefined): RequestPromptInspection;
|
|
95
|
+
private drop;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=assembly.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/** Shared lifecycle and stable-entry storage for one Conversation Definition registry. */
|
|
3
|
+
export declare abstract class ConversationDefinitionRegistry<Definition> {
|
|
4
|
+
protected readonly ctx: Context;
|
|
5
|
+
protected readonly definitions: Map<string, Definition>;
|
|
6
|
+
private listeners;
|
|
7
|
+
private cached;
|
|
8
|
+
/** @param ctx - Context whose effects own contributed Definitions. */
|
|
9
|
+
constructor(ctx: Context);
|
|
10
|
+
/**
|
|
11
|
+
* Return reference-stable Definitions in registration order.
|
|
12
|
+
* @returns current Definitions.
|
|
13
|
+
*/
|
|
14
|
+
entries(): readonly Definition[];
|
|
15
|
+
/**
|
|
16
|
+
* Observe low-frequency registry changes.
|
|
17
|
+
* @param listener - synchronous invalidation callback.
|
|
18
|
+
* @returns unsubscribe callback.
|
|
19
|
+
*/
|
|
20
|
+
subscribe(listener: () => void): () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Register one uniquely keyed Definition for the caller's lifetime.
|
|
23
|
+
* @param key - registry-local unique key.
|
|
24
|
+
* @param definition - contributed Definition.
|
|
25
|
+
* @param duplicateMessage - error raised when the key is already owned.
|
|
26
|
+
* @param effectName - Cordis effect diagnostic label.
|
|
27
|
+
* @returns idempotent disposer.
|
|
28
|
+
*/
|
|
29
|
+
protected registerDefinition(key: string, definition: Definition, duplicateMessage: string, effectName: string): () => void;
|
|
30
|
+
/** Refresh cached entries and synchronously invalidate subscribers. */
|
|
31
|
+
protected refresh(): void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=definition-registry.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ConversationNodeDefinition } from '../contract/conversation.ts';
|
|
2
|
+
import { ConversationDefinitionRegistry } from './definition-registry.ts';
|
|
3
|
+
/** Runtime registry of independently owned Conversation business Definitions. */
|
|
4
|
+
export declare class ConversationEventRegistry extends ConversationDefinitionRegistry<ConversationNodeDefinition> {
|
|
5
|
+
private fallback;
|
|
6
|
+
/**
|
|
7
|
+
* Register a uniquely named business Definition for the caller's lifetime.
|
|
8
|
+
* @param definition - Definition contribution.
|
|
9
|
+
* @returns idempotent disposer.
|
|
10
|
+
*/
|
|
11
|
+
register(definition: ConversationNodeDefinition): () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Register the sole fallback used only when no ordinary Definition matches.
|
|
14
|
+
* @param definition - fallback Definition.
|
|
15
|
+
* @returns idempotent disposer.
|
|
16
|
+
*/
|
|
17
|
+
registerFallback(definition: ConversationNodeDefinition): () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Return the current unmatched-event fallback.
|
|
20
|
+
* @returns installed fallback, when present.
|
|
21
|
+
*/
|
|
22
|
+
fallbackEntry(): ConversationNodeDefinition | undefined;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=event-registry.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Session-scoped durable image URL cache shared by Conversation targets. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
4
|
+
import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
5
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
6
|
+
/** Resolve durable Conversation images and release their browser URLs with Session scope. */
|
|
7
|
+
export declare class HistoricalImageCache {
|
|
8
|
+
private readonly sessions;
|
|
9
|
+
private readonly entries;
|
|
10
|
+
private readonly generations;
|
|
11
|
+
private readonly scopeDisposers;
|
|
12
|
+
private readonly urls;
|
|
13
|
+
private disposed;
|
|
14
|
+
/**
|
|
15
|
+
* @param ctx - Owning ui-conversation fiber.
|
|
16
|
+
* @param sessions - Session Controller object layer.
|
|
17
|
+
*/
|
|
18
|
+
constructor(ctx: Context, sessions: ISessions);
|
|
19
|
+
/**
|
|
20
|
+
* Resolve and cache one session-authorized image URL.
|
|
21
|
+
* @param sessionId - Session authorization and lifetime scope.
|
|
22
|
+
* @param attachment - Durable image reference.
|
|
23
|
+
* @returns browser URL valid until the Session binding is released.
|
|
24
|
+
*/
|
|
25
|
+
resolve(sessionId: SessionId, attachment: ImageAttachmentRef): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Return an already-displayable URL without starting a read.
|
|
28
|
+
* @param sessionId - Session authorization and lifetime scope.
|
|
29
|
+
* @param attachment - Durable image reference.
|
|
30
|
+
* @returns current preview or canonical URL when cached.
|
|
31
|
+
*/
|
|
32
|
+
peek(sessionId: SessionId, attachment: ImageAttachmentRef): string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Adopt a submission preview while fetching the durable admitted bytes.
|
|
35
|
+
* The preview is available synchronously, then replaced and revoked when
|
|
36
|
+
* the canonical attachment read completes.
|
|
37
|
+
* @param sessionId - Session authorization and lifetime scope.
|
|
38
|
+
* @param attachment - Durable image reference the URL temporarily displays.
|
|
39
|
+
* @param url - browser URL to adopt.
|
|
40
|
+
* @returns whether the cache took ownership.
|
|
41
|
+
*/
|
|
42
|
+
seed(sessionId: SessionId, attachment: ImageAttachmentRef, url: string): boolean;
|
|
43
|
+
private key;
|
|
44
|
+
private loadCanonical;
|
|
45
|
+
private assertLive;
|
|
46
|
+
private bindScope;
|
|
47
|
+
private release;
|
|
48
|
+
private releaseUrl;
|
|
49
|
+
private dispose;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=historical-images.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type AssistantLiveChunkEvent, type SessionEventLike, type SessionEventLikeEntry } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
2
|
+
import type { SessionEvent } from '@deepseek-ai/dsh-session/types';
|
|
3
|
+
import type { ConversationLocation, ConversationLocationData, ConversationTimelineSnapshot } from '../contract/conversation.ts';
|
|
4
|
+
/** One Context's previous and next Location-data publication. */
|
|
5
|
+
export interface ConversationLocationDataChange {
|
|
6
|
+
readonly owner: string;
|
|
7
|
+
readonly previous: ConversationLocationData | null;
|
|
8
|
+
readonly next: ConversationLocationData | null;
|
|
9
|
+
}
|
|
10
|
+
/** Session-owned Turn/Step timeline and event-to-Location index. */
|
|
11
|
+
export declare class ConversationLocationIndex {
|
|
12
|
+
private coordinates;
|
|
13
|
+
private locations;
|
|
14
|
+
private seqsByTurn;
|
|
15
|
+
private timeline;
|
|
16
|
+
private readonly turnDataStores;
|
|
17
|
+
private readonly stepDataStores;
|
|
18
|
+
private readonly dirtyDataStores;
|
|
19
|
+
private currentTurn;
|
|
20
|
+
private currentStep;
|
|
21
|
+
/**
|
|
22
|
+
* Return the current reference-stable timeline.
|
|
23
|
+
* @returns current timeline snapshot.
|
|
24
|
+
*/
|
|
25
|
+
snapshot(): ConversationTimelineSnapshot;
|
|
26
|
+
/**
|
|
27
|
+
* Replace all Definition-owned Location values while preserving reader identities.
|
|
28
|
+
* @param entries - complete current set of Definition-owned Location values.
|
|
29
|
+
* @returns whether any published Location data changed.
|
|
30
|
+
*/
|
|
31
|
+
replaceData(entries: readonly {
|
|
32
|
+
readonly owner: string;
|
|
33
|
+
readonly data: ConversationLocationData;
|
|
34
|
+
}[]): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Apply changed Context publications without rebuilding Turn/Step membership.
|
|
37
|
+
* @param changes - incremental removals and replacements from published Contexts.
|
|
38
|
+
* @returns whether any published Location data changed.
|
|
39
|
+
*/
|
|
40
|
+
applyData(changes: readonly ConversationLocationDataChange[]): boolean;
|
|
41
|
+
/** Publish committed Location-data changes to their keyed sources. */
|
|
42
|
+
publishData(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Resolve the latest Location for one event.
|
|
45
|
+
* @param event - event already ingested into this index.
|
|
46
|
+
* @returns current Location, falling back to session when it has no Turn/Step affinity.
|
|
47
|
+
*/
|
|
48
|
+
locationOf(event: SessionEventLike): ConversationLocation;
|
|
49
|
+
/**
|
|
50
|
+
* Rebuild timeline facts after replace/prepend or a boundary append.
|
|
51
|
+
* @param entries - complete current window in ascending seq order.
|
|
52
|
+
* @returns seqs whose resolved Location changed.
|
|
53
|
+
*/
|
|
54
|
+
rebuild(entries: readonly SessionEventLikeEntry[]): ReadonlySet<number>;
|
|
55
|
+
/**
|
|
56
|
+
* Append one Turn/Step boundary while revisiting only the owning Turn.
|
|
57
|
+
* @param event - contiguous tail boundary event.
|
|
58
|
+
* @returns seqs whose immutable Location reference changed.
|
|
59
|
+
*/
|
|
60
|
+
appendBoundary(event: SessionEvent): ReadonlySet<number>;
|
|
61
|
+
/**
|
|
62
|
+
* Index one non-boundary tail event without rescanning the window.
|
|
63
|
+
* @param event - contiguous appended event.
|
|
64
|
+
*/
|
|
65
|
+
appendNonBoundary(event: SessionEventLike): void;
|
|
66
|
+
/**
|
|
67
|
+
* Remove indexed Assistant transients without rebuilding the Turn/Step timeline.
|
|
68
|
+
* @param events - transient events retired by one Assistant settlement.
|
|
69
|
+
*/
|
|
70
|
+
removeAssistantTransients(events: readonly AssistantLiveChunkEvent[]): void;
|
|
71
|
+
/**
|
|
72
|
+
* Index one durable Assistant settlement inserted before an already visible tail.
|
|
73
|
+
* @param event - message or attempt settlement with explicit Turn and Step coordinates.
|
|
74
|
+
*/
|
|
75
|
+
insertAssistantSettlement(event: SessionEvent<'assistant/message'> | SessionEvent<'assistant/attempt'>): void;
|
|
76
|
+
private indexTurnSeq;
|
|
77
|
+
private turnData;
|
|
78
|
+
private stepData;
|
|
79
|
+
private mutableTurnData;
|
|
80
|
+
private mutableStepData;
|
|
81
|
+
private createDataStore;
|
|
82
|
+
private storeFor;
|
|
83
|
+
private resolve;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=location-index.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ConversationViewDefinition } from '../contract/conversation.ts';
|
|
2
|
+
import { ConversationDefinitionRegistry } from './definition-registry.ts';
|
|
3
|
+
/** Runtime registry of per-target Conversation snapshot builders. */
|
|
4
|
+
export declare class ConversationViewRegistry extends ConversationDefinitionRegistry<ConversationViewDefinition> {
|
|
5
|
+
/**
|
|
6
|
+
* Register a uniquely named view builder factory for the caller's lifetime.
|
|
7
|
+
* @param definition - target builder contribution.
|
|
8
|
+
* @returns idempotent disposer.
|
|
9
|
+
*/
|
|
10
|
+
register(definition: ConversationViewDefinition): () => void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=view-registry.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Attachment error and limit copy owned by the conversation input flow. */
|
|
2
|
+
import type { ImageAttachmentLimits } from '@deepseek-ai/dsh-attachment';
|
|
3
|
+
import type { Translate } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
|
+
import type { ConversationKey } from './locales.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Byte count as user-facing megabytes (`10MB`, `2.5MB`).
|
|
7
|
+
* @param bytes - the byte count.
|
|
8
|
+
* @returns the rounded megabyte text.
|
|
9
|
+
*/
|
|
10
|
+
export declare function imageSizeText(bytes: number): string;
|
|
11
|
+
/**
|
|
12
|
+
* Product copy for a host attachment rejection (the `details.reason` of
|
|
13
|
+
* `session/attachment-invalid` or `subagent/attachment-invalid`).
|
|
14
|
+
* User-solvable reasons name the limit and the way out;
|
|
15
|
+
* reasons the user cannot act on fold into one send-failed line carrying the
|
|
16
|
+
* reason code for a bug report.
|
|
17
|
+
* @param t - the conversation-namespace translate.
|
|
18
|
+
* @param reason - the wire `details.reason` code.
|
|
19
|
+
* @param limits - projected limits interpolated into count/size copy, when known.
|
|
20
|
+
* @returns the banner text.
|
|
21
|
+
*/
|
|
22
|
+
export declare function attachmentErrorText(t: Translate<ConversationKey>, reason: string, limits?: ImageAttachmentLimits): string;
|
|
23
|
+
//# sourceMappingURL=image-labels.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Browser Conversation assemble core, React adapter, shell, and input plugin. */
|
|
2
|
+
export { apply, Config, inject } from './apply.ts';
|
|
3
|
+
export type { Config as ConversationConfig } from './apply.ts';
|
|
4
|
+
export { UiConversation } from './conversation/assembly.ts';
|
|
5
|
+
export type { ConversationBinding } from './conversation/assembly.ts';
|
|
6
|
+
export { ConversationController, UnsupportedImageMediaTypeError } from './service.ts';
|
|
7
|
+
export type { IConversation } from './service.ts';
|
|
8
|
+
export type { ConversationContextReader, ConversationLocation, ConversationLocationData, ConversationLocationDataScope, ConversationLocationDataSource, ConversationLocationDataStore, ConversationMatch, ConversationMatchResult, ConversationNodeContext, ConversationNodeDefinition, ConversationPreviousContext, ConversationPublication, ConversationStartMatch, ConversationStepDataMap, ConversationTimelineSnapshot, ConversationTurnDataMap, ConversationViewBuilder, ConversationViewDefinition, ConversationViewNode, ConversationViewSnapshotMap, ConversationViewSnapshotStore, StepLocation, TurnLocation, } from './contract/conversation.ts';
|
|
9
|
+
export { EMPTY_CONVERSATION_SNAPSHOT, conversationPhase } from './contract/snapshot.ts';
|
|
10
|
+
export type { ConversationPhase, ConversationSnapshot, } from './contract/snapshot.ts';
|
|
11
|
+
export type { AssistantBlock, AssistantMessageNode, AssistantProvenanceView, AssistantRequestConfig, AssistantTiming, CommandNode, CompactionSummaryNode, ContextMessageNode, ConversationNode, ModelRetryNode, PartialAssistant, RunningToolCall, SteeringMessageNode, TodoItem, ToolCallBlock, ToolResultNode, TurnErrorNode, TurnMaxTokensNode, UnknownSurfaceNode, UserMessageNode, } from './contract/records.ts';
|
|
12
|
+
export type { ContextProvenanceView, ContextRole, KnownContextForm, } from './contract/context-provenance.ts';
|
|
13
|
+
export type { ConversationPromptSnapshot, RequestInspectionSnapshot, RequestPromptChange, RequestPromptInspection, RequestPromptInspector, RequestView, SystemPromptNode, } from './contract/request-inspection.ts';
|
|
14
|
+
export { inspectRequestPrompt } from './contract/request-inspection.ts';
|
|
15
|
+
export type { SystemPromptState, SystemPromptInspector } from './contract/system-prompt.ts';
|
|
16
|
+
export type { ConversationStoreState, ConversationViewRequest, ViewTab } from './contract/views.ts';
|
|
17
|
+
export { ConversationNodeAssembler } from './conversation/assembler.ts';
|
|
18
|
+
export type { ConversationEventDefinitions, ConversationViewDefinitions, } from './conversation/assembler.ts';
|
|
19
|
+
export { ConversationDefinitionRegistry } from './conversation/definition-registry.ts';
|
|
20
|
+
export { ConversationEventRegistry } from './conversation/event-registry.ts';
|
|
21
|
+
export { ConversationLocationIndex } from './conversation/location-index.ts';
|
|
22
|
+
export type { ConversationLocationDataChange } from './conversation/location-index.ts';
|
|
23
|
+
export { ConversationViewRegistry } from './conversation/view-registry.ts';
|
|
24
|
+
export type { ConversationKey } from './locales.ts';
|
|
25
|
+
export type { ComposerAttachment, ComposerAttachmentsOwnerProps, ComposerAttachmentsProps, ComposerFileAttachment, ComposerImageAttachment, DraftFileUpload, DraftFileUploads, ComposerBarInjected, ComposerBarOwnerProps, ComposerBarProps, ComposerChainProps, ConversationHeaderActionOwnerProps, ConversationHeaderCornerOwnerProps, ConversationHeaderLineageOwnerProps, ConversationInjected, ConversationSessionHeaderInjected, ConversationSessionHeaderSlotProps, ConversationSessionInjected, ConversationSessionSlotProps, ConversationSlotProps, ConversationStore, ConvViewOwnerProps, ConvViewProps, EmptyWorkspaceOwnerProps, HeroAgentPresetOwnerProps, HeroBrandMarkOwnerProps, InputControlOwnerProps, InputZone, MessageImageLoader, MessageImageSource, MessageImagesOwnerProps, RenderMessageImages, UseConversation, UseConversationViews, } from './contract/slots.ts';
|
|
26
|
+
export type { ArbitrateKey, ArbitrateOutcome, BeginCommandRequest, CommandClaim, ConsumeTokenRequest, DraftAttachmentId, InputActions, InputState, InsertReferenceRequest, InsertTextRequest, PickOutcome, ReferenceInsert, SessionInput, SessionInputResolver, SubmitAttachment, SubmitOutcome, TokenSpan, } from './contract/input.ts';
|
|
27
|
+
export type { ComposerBlock, ComposerBlocks } from './contract/composer-blocks.ts';
|
|
28
|
+
declare module '@deepseek-ai/cordis' {
|
|
29
|
+
interface Context {
|
|
30
|
+
/** Scope-addressed Conversation actions and per-Session input registry. */
|
|
31
|
+
conversation: import('./service.ts').IConversation;
|
|
32
|
+
/** Target-neutral Conversation registries and per-Session assembly. */
|
|
33
|
+
uiConversation: import('./conversation/assembly.ts').UiConversation;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer blocks: the one way another plugin stops a session's input.
|
|
3
|
+
*
|
|
4
|
+
* The composer cannot read the plugins that would know — the dependency runs
|
|
5
|
+
* ui-model-selection → ui-conversation, never back — so a blocker pushes here and the
|
|
6
|
+
* bar reads its own session's store. A block carries the localized reason it
|
|
7
|
+
* exists, because the plugin that raised it owns that copy; the composer only
|
|
8
|
+
* knows how to render an inert textarea with a placeholder, exactly as it
|
|
9
|
+
* already does for a session with no workspace.
|
|
10
|
+
*
|
|
11
|
+
* This is an affordance, not enforcement: the Host refuses a prompt it cannot
|
|
12
|
+
* route regardless of what any client disables.
|
|
13
|
+
*/
|
|
14
|
+
import { type SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
15
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
16
|
+
import type { ComposerBlock, ComposerBlocks } from '../contract/composer-blocks.ts';
|
|
17
|
+
/** The per-session composer-block registry (one instance per plugin fiber). */
|
|
18
|
+
export declare class ComposerBlockRegistry implements ComposerBlocks {
|
|
19
|
+
private readonly stores;
|
|
20
|
+
/** @inheritdoc */
|
|
21
|
+
set(sessionId: SessionId, block: ComposerBlock | undefined): void;
|
|
22
|
+
/** @inheritdoc */
|
|
23
|
+
storeFor(sessionId: SessionId): SnapshotStore<ComposerBlock | undefined>;
|
|
24
|
+
/** @inheritdoc */
|
|
25
|
+
forget(sessionId: SessionId): void;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plain-text reference scan (the plain-text-reference decision;
|
|
3
|
+
* see .agents/notes/archived/architecture/2026-07-25-web-input-machine-and-slash-pipeline.md):
|
|
4
|
+
* a `/name` or `@name` token whose name is on the trigger's lexicon, and
|
|
5
|
+
* syntax-recognizable `@dir/` folder tokens. Pure derivation — the editor's
|
|
6
|
+
* text-ref entity transform consumes these ranges; editing the text out of
|
|
7
|
+
* match shape simply drops the range next scan.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* One plain-text reference range (the plain-text-reference decision;
|
|
11
|
+
* see .agents/notes/archived/architecture/2026-07-25-web-input-machine-and-slash-pipeline.md):
|
|
12
|
+
* a `/name` or `@name` token
|
|
13
|
+
* whose name is on the trigger's lexicon. Pure derivation — editing the text
|
|
14
|
+
* out of match shape simply drops the range next scan.
|
|
15
|
+
*/
|
|
16
|
+
export interface TextRefRange {
|
|
17
|
+
readonly start: number;
|
|
18
|
+
readonly end: number;
|
|
19
|
+
readonly trigger: '/' | '@';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Scan the draft for plain-text reference tokens against the hot lexicons.
|
|
23
|
+
* Word-boundary discipline: the trigger must sit at the draft
|
|
24
|
+
* start or after whitespace ('x/name' never matches); the name must be an
|
|
25
|
+
* exact lexicon member; a `/name` token must end at whitespace or the draft
|
|
26
|
+
* end ('/name/x' is a path, '/name。' is prose).
|
|
27
|
+
* @param draft - draft text.
|
|
28
|
+
* @param lexicon - per-trigger name lists (a missing trigger scans nothing).
|
|
29
|
+
* @returns matched ranges in draft order.
|
|
30
|
+
*/
|
|
31
|
+
export declare function scanTextRefs(draft: string, lexicon: ReadonlyMap<'/' | '@', readonly string[]>): TextRefRange[];
|
|
32
|
+
//# sourceMappingURL=decorations.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { LexicalEditor } from 'lexical';
|
|
3
|
+
/** Host props: the editor binding plus the div passthroughs the bar owns. */
|
|
4
|
+
export interface ComposerContentEditableProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** The shell-owned editor; null renders the same div unbound and inert. */
|
|
6
|
+
readonly editor: LexicalEditor | null;
|
|
7
|
+
/** Whether the user may edit (readOnly/disabled states fold in here). */
|
|
8
|
+
readonly editable: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Render the composer's editable surface.
|
|
12
|
+
* @param props - editor binding, editability, and div passthroughs.
|
|
13
|
+
* @returns the resident contenteditable div.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ComposerContentEditable({ editor, editable, ...rest }: ComposerContentEditableProps): ReactNode;
|
|
16
|
+
//# sourceMappingURL=ComposerContentEditable.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { LexicalEditor } from 'lexical';
|
|
3
|
+
/** Portal-loop props. */
|
|
4
|
+
export interface DecoratorPortalsProps {
|
|
5
|
+
/** The bound editor; null (no-session) renders nothing. */
|
|
6
|
+
readonly editor: LexicalEditor | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Render every decorator's React face into its editor host element.
|
|
10
|
+
* @param props - the editor to observe.
|
|
11
|
+
* @returns the live portal set.
|
|
12
|
+
*/
|
|
13
|
+
export declare function DecoratorPortals({ editor }: DecoratorPortalsProps): ReactNode;
|
|
14
|
+
//# sourceMappingURL=DecoratorPortals.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReferenceIconKind } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
/** Display inputs of one chip (the node's cached owner projections). */
|
|
4
|
+
export interface ReferenceChipProps {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
/** Domain glyph; absent renders the trigger marker instead of an icon. */
|
|
7
|
+
readonly appearance?: ReferenceIconKind | undefined;
|
|
8
|
+
/** Owner-resolution failure styling bit. */
|
|
9
|
+
readonly invalid: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Render one inline reference chip.
|
|
13
|
+
* @param props - label, optional domain glyph, and the invalid bit.
|
|
14
|
+
* @returns the chip body (icon + truncating label).
|
|
15
|
+
*/
|
|
16
|
+
export declare function ReferenceChip({ label, appearance, invalid }: ReferenceChipProps): ReactNode;
|
|
17
|
+
//# sourceMappingURL=ReferenceChip.d.ts.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReferenceChipNode: one inline reference as an atomic Lexical decorator.
|
|
3
|
+
* The node IS the occurrence — NodeKey carries identity, the node carries
|
|
4
|
+
* the owner's insert-time projections (label/appearance/clipboardText), and
|
|
5
|
+
* `getTextContent()` answers the clipboard/persistence projection so native
|
|
6
|
+
* copy and the draft mirror stay correct without expansion code. The detect
|
|
7
|
+
* projection (trigger scanning and TokenSpan coordinates) counts every chip
|
|
8
|
+
* as one U+FFFC instead; see projection.ts.
|
|
9
|
+
*/
|
|
10
|
+
import type { JSX } from 'react';
|
|
11
|
+
import type { EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
|
|
12
|
+
import { DecoratorNode } from 'lexical';
|
|
13
|
+
import type { ReferenceInsert } from '../../contract/input.ts';
|
|
14
|
+
/** JSON form of one chip (Lexical node serialization contract). */
|
|
15
|
+
export type SerializedReferenceChipNode = Spread<{
|
|
16
|
+
source: string;
|
|
17
|
+
ref: string;
|
|
18
|
+
label: string;
|
|
19
|
+
appearance?: ReferenceInsert['appearance'];
|
|
20
|
+
clipboardText: string;
|
|
21
|
+
invalid: boolean;
|
|
22
|
+
}, SerializedLexicalNode>;
|
|
23
|
+
/** One inline reference occurrence as an atomic decorator node. */
|
|
24
|
+
export declare class ReferenceChipNode extends DecoratorNode<JSX.Element> {
|
|
25
|
+
/** Owning source name (serializer routing key). */
|
|
26
|
+
__source: string;
|
|
27
|
+
/** Owner-scoped reference id. */
|
|
28
|
+
__ref: string;
|
|
29
|
+
/** Inline display label (insert-time cache). */
|
|
30
|
+
__label: string;
|
|
31
|
+
/** Optional domain glyph (insert-time cache). */
|
|
32
|
+
__appearance: ReferenceInsert['appearance'];
|
|
33
|
+
/** Clipboard / persistence projection, e.g. `/name` (never the model form). */
|
|
34
|
+
__clipboardText: string;
|
|
35
|
+
/** Owner-resolution failure flag: chip renders invalid; serialization must fail. */
|
|
36
|
+
__invalid: boolean;
|
|
37
|
+
/** Lexical node registry type tag. */
|
|
38
|
+
static getType(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Clone with identity (Lexical writable-copy contract).
|
|
41
|
+
* @param node - node to clone.
|
|
42
|
+
* @returns a copy carrying the same NodeKey.
|
|
43
|
+
*/
|
|
44
|
+
static clone(node: ReferenceChipNode): ReferenceChipNode;
|
|
45
|
+
/**
|
|
46
|
+
* Rebuild one chip from its JSON form.
|
|
47
|
+
* @param json - serialized chip.
|
|
48
|
+
* @returns a fresh node (new key).
|
|
49
|
+
*/
|
|
50
|
+
static importJSON(json: SerializedReferenceChipNode): ReferenceChipNode;
|
|
51
|
+
/**
|
|
52
|
+
* @param insert - the owner's reference insertion (display projections included).
|
|
53
|
+
* @param invalid - owner-resolution failure bit (defaults valid).
|
|
54
|
+
* @param key - Lexical clone-path key; absent for fresh nodes.
|
|
55
|
+
*/
|
|
56
|
+
constructor(insert: Omit<ReferenceInsert, 'appearance'> & {
|
|
57
|
+
appearance?: ReferenceInsert['appearance'];
|
|
58
|
+
}, invalid?: boolean, key?: NodeKey);
|
|
59
|
+
/** Serialize to the JSON node form. */
|
|
60
|
+
exportJSON(): SerializedReferenceChipNode;
|
|
61
|
+
/**
|
|
62
|
+
* Mount the chip's host element; the decorator portal renders into it.
|
|
63
|
+
* @returns an inline, non-editable span carrying the test/e2e anchor.
|
|
64
|
+
*/
|
|
65
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
66
|
+
/** Host element never changes shape. */
|
|
67
|
+
updateDOM(): boolean;
|
|
68
|
+
/** Chips sit in the text line. */
|
|
69
|
+
isInline(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* No keyboard-selected intermediate state: arrows step across the chip in
|
|
72
|
+
* one move and Backspace/Delete remove it whole (the placeholder semantics
|
|
73
|
+
* of the old textarea). `true` would put a NodeSelection between the
|
|
74
|
+
* keystroke and the caret — a state the plain-text binding's handlers all
|
|
75
|
+
* ignore, deadlocking arrows, typing, and deletion at the chip edge.
|
|
76
|
+
*/
|
|
77
|
+
isKeyboardSelectable(): boolean;
|
|
78
|
+
/** Clipboard / persistence projection (native copy reads this). */
|
|
79
|
+
getTextContent(): string;
|
|
80
|
+
/**
|
|
81
|
+
* Flip the owner-resolution failure bit.
|
|
82
|
+
* @param invalid - next bit; no-op writes are the caller's concern.
|
|
83
|
+
*/
|
|
84
|
+
setInvalid(invalid: boolean): void;
|
|
85
|
+
/** Owner-resolution failure bit. */
|
|
86
|
+
isInvalid(): boolean;
|
|
87
|
+
/** Owning source name. */
|
|
88
|
+
getSource(): string;
|
|
89
|
+
/** Owner-scoped reference id. */
|
|
90
|
+
getReference(): string;
|
|
91
|
+
/** Inline display label. */
|
|
92
|
+
getLabel(): string;
|
|
93
|
+
/** Optional domain glyph. */
|
|
94
|
+
getAppearance(): ReferenceInsert['appearance'];
|
|
95
|
+
/** React face rendered into the host element by the decorator portal. */
|
|
96
|
+
decorate(): JSX.Element;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Mint one chip node from a reference insertion.
|
|
100
|
+
* @param insert - the owner's reference insertion.
|
|
101
|
+
* @returns the fresh node.
|
|
102
|
+
*/
|
|
103
|
+
export declare function $createReferenceChipNode(insert: ReferenceInsert): ReferenceChipNode;
|
|
104
|
+
/**
|
|
105
|
+
* Chip type guard.
|
|
106
|
+
* @param node - any node or nullish.
|
|
107
|
+
* @returns whether the node is a ReferenceChipNode.
|
|
108
|
+
*/
|
|
109
|
+
export declare function $isReferenceChipNode(node: LexicalNode | null | undefined): node is ReferenceChipNode;
|
|
110
|
+
//# sourceMappingURL=chip-node.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claim-token highlight: while a command claim holds, the draft's leading
|
|
3
|
+
* token renders in the warn color. A TextNode transform keeps the token in
|
|
4
|
+
* its own styled node (splitting when typing merges text into it), and the
|
|
5
|
+
* shell nudges the first leaf dirty when the claim flips so entering and
|
|
6
|
+
* leaving claimed restyles without a text edit.
|
|
7
|
+
*/
|
|
8
|
+
import type { LexicalEditor } from 'lexical';
|
|
9
|
+
/**
|
|
10
|
+
* Register the claim-token styling transform.
|
|
11
|
+
* @param editor - the shell-owned editor.
|
|
12
|
+
* @param activeToken - live claim token accessor; null while unclaimed.
|
|
13
|
+
* @returns the unregister disposer.
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerClaimDecoration(editor: LexicalEditor, activeToken: () => string | null): () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Nudge the token seat dirty so the transform restyles after a claim flip
|
|
18
|
+
* (claims change phase without a text edit; transforms only run on dirty
|
|
19
|
+
* nodes).
|
|
20
|
+
* @param editor - the shell-owned editor.
|
|
21
|
+
*/
|
|
22
|
+
export declare function refreshClaimDecoration(editor: LexicalEditor): void;
|
|
23
|
+
//# sourceMappingURL=claim-decor.d.ts.map
|