@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.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +127 -0
  4. package/README.zh.md +127 -0
  5. package/lib/client.js +16935 -0
  6. package/lib/index.js +27 -0
  7. package/lib/types/client/apply.d.ts +25 -0
  8. package/lib/types/client/context-occupancy.d.ts +14 -0
  9. package/lib/types/client/contract/composer-blocks.d.ts +28 -0
  10. package/lib/types/client/contract/composer-submission.d.ts +8 -0
  11. package/lib/types/client/contract/context-provenance.d.ts +29 -0
  12. package/lib/types/client/contract/conversation.d.ts +256 -0
  13. package/lib/types/client/contract/input.d.ts +427 -0
  14. package/lib/types/client/contract/queue.d.ts +9 -0
  15. package/lib/types/client/contract/records.d.ts +272 -0
  16. package/lib/types/client/contract/request-inspection.d.ts +131 -0
  17. package/lib/types/client/contract/slots.d.ts +409 -0
  18. package/lib/types/client/contract/snapshot.d.ts +20 -0
  19. package/lib/types/client/contract/system-prompt.d.ts +35 -0
  20. package/lib/types/client/contract/views.d.ts +26 -0
  21. package/lib/types/client/conversation/assembler.d.ts +128 -0
  22. package/lib/types/client/conversation/assembly.d.ts +97 -0
  23. package/lib/types/client/conversation/definition-registry.d.ts +33 -0
  24. package/lib/types/client/conversation/event-registry.d.ts +24 -0
  25. package/lib/types/client/conversation/historical-images.d.ts +51 -0
  26. package/lib/types/client/conversation/location-index.d.ts +85 -0
  27. package/lib/types/client/conversation/view-registry.d.ts +12 -0
  28. package/lib/types/client/image-labels.d.ts +23 -0
  29. package/lib/types/client/index.d.ts +36 -0
  30. package/lib/types/client/input/blocks.d.ts +27 -0
  31. package/lib/types/client/input/decorations.d.ts +32 -0
  32. package/lib/types/client/input/editor/ComposerContentEditable.d.ts +16 -0
  33. package/lib/types/client/input/editor/DecoratorPortals.d.ts +14 -0
  34. package/lib/types/client/input/editor/ReferenceChip.d.ts +17 -0
  35. package/lib/types/client/input/editor/chip-node.d.ts +110 -0
  36. package/lib/types/client/input/editor/claim-decor.d.ts +23 -0
  37. package/lib/types/client/input/editor/keymap.d.ts +41 -0
  38. package/lib/types/client/input/editor/projection.d.ts +93 -0
  39. package/lib/types/client/input/editor/span-map.d.ts +38 -0
  40. package/lib/types/client/input/editor/text-ref.d.ts +60 -0
  41. package/lib/types/client/input/facade.d.ts +298 -0
  42. package/lib/types/client/input/hub.d.ts +88 -0
  43. package/lib/types/client/input/machine.d.ts +46 -0
  44. package/lib/types/client/input/queue-store.d.ts +20 -0
  45. package/lib/types/client/input/submission-policy.d.ts +52 -0
  46. package/lib/types/client/locales.d.ts +330 -0
  47. package/lib/types/client/queue/QueueDock.d.ts +26 -0
  48. package/lib/types/client/service.d.ts +185 -0
  49. package/lib/types/client/settings/EnterBehaviorRow.d.ts +21 -0
  50. package/lib/types/client/skeleton/ContextMeter.d.ts +14 -0
  51. package/lib/types/client/skeleton/ConversationRoot.d.ts +5 -0
  52. package/lib/types/client/skeleton/ConversationSession.d.ts +26 -0
  53. package/lib/types/client/skeleton/EmptyHero.d.ts +46 -0
  54. package/lib/types/client/skeleton/InputBar.d.ts +18 -0
  55. package/lib/types/client/skeleton/PermissionSelect.d.ts +11 -0
  56. package/lib/types/client/skeleton/TodoPanel.d.ts +21 -0
  57. package/lib/types/client/skeleton/safari.d.ts +18 -0
  58. package/lib/types/client/skeleton/toolbar-hosts.d.ts +17 -0
  59. package/lib/types/client/stores.d.ts +24 -0
  60. package/lib/types/client/view-selection.d.ts +9 -0
  61. package/lib/types/index.d.ts +9 -0
  62. package/lib/types/submission-settings.d.ts +20 -0
  63. package/package.json +103 -0
@@ -0,0 +1,26 @@
1
+ /** Strict per-session header/body content inserted into the resident conversation layout. */
2
+ import type { ConversationSessionHeaderSlotProps, ConversationSessionSlotProps } from '../contract/slots.ts';
3
+ /** Full props composed from the strict session body contract. */
4
+ export type ConversationSessionProps = ConversationSessionSlotProps;
5
+ /** Full props composed from the strict session header contract. */
6
+ export type ConversationSessionHeaderProps = ConversationSessionHeaderSlotProps;
7
+ /**
8
+ * Renders Session header chrome above the resident conversation scrollport.
9
+ * When the desktop bridge's unified toolbar is mounted, the title cluster
10
+ * (breadcrumbs + actions) and the utilities row portal into the toolbar's
11
+ * `centerHost` and the rightbar corner into its `sessionEndHost`: the header
12
+ * itself collapses to `display: contents`, keeping only the View-tabs row in
13
+ * the body — zero height when there are no tabs. Host absence (plain web, or
14
+ * the bridge unmounted mid-session) renders the original in-place header.
15
+ * @param props - Strict Session store, view ledger, navigation, render, and locale shares.
16
+ * @returns the hidden blank-session header or visible title and tabs.
17
+ */
18
+ export declare function ConversationSessionHeader({ sessionId, useSession, useSessions, useConversation, useConversationViews, useStore, renderSlot, open, selectView, t, }: ConversationSessionHeaderProps): import("react").JSX.Element;
19
+ /**
20
+ * Renders the active Session view inside the resident scrollport and keeps
21
+ * the input draft mirrored while blank Hero chrome is visible.
22
+ * @param props - Strict Session input/store, view ledger, and render shares.
23
+ * @returns the active view area, or null while the Session remains blank.
24
+ */
25
+ export declare function ConversationSession({ useSession, useConversation, useConversationViews, useInput, inputActions, useStore, actions, renderSlot, bindDraftMirror, openView, }: ConversationSessionProps): import("react").JSX.Element | null;
26
+ //# sourceMappingURL=ConversationSession.d.ts.map
@@ -0,0 +1,46 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+ import type { ConversationSlotProps } from '../contract/slots.ts';
3
+ /** The owner's locale seat type, passed to hero chrome as a plain prop. */
4
+ type HeroTranslate = ConversationSlotProps['t'];
5
+ /**
6
+ * Basename label for the workspace chip (the shared derivation);
7
+ * separator-only paths echo the raw cwd.
8
+ * @param cwd - workspace directory path (non-empty).
9
+ * @returns chip label.
10
+ */
11
+ export declare function workspaceLabel(cwd: string): string;
12
+ /**
13
+ * The workspace chip (folder + label + chevron), always interactive: before
14
+ * the first message the workspace stays switchable — picking another one
15
+ * moves the New Session flow to that workspace's blank session. Without a
16
+ * label the chip renders its placeholder state: closed folder + the
17
+ * "Choose workspace" call to action.
18
+ * @param props.label - chip label (see {@link workspaceLabel}); omitted → placeholder.
19
+ * @param props.menuOpen - menu expansion echo.
20
+ * @param props.onClick - menu toggle.
21
+ * @returns the chip button element.
22
+ */
23
+ export declare function WorkspaceChip({ buttonRef, label, menuOpen, onClick, t }: {
24
+ buttonRef?: RefObject<HTMLButtonElement>;
25
+ label?: string | undefined;
26
+ menuOpen?: boolean;
27
+ onClick?: () => void;
28
+ t: HeroTranslate;
29
+ }): import("react").JSX.Element;
30
+ /** Hero chrome props. The workspace row rides the InputBar accessory hole, not here. */
31
+ export interface HeroShellProps {
32
+ /** The owner's locale seat, passed down as a plain prop. */
33
+ t: HeroTranslate;
34
+ /** Authorized renderer for the hero brand-mark slot. */
35
+ renderSlot: ConversationSlotProps['renderSlot'];
36
+ /** Overlay content after the stack (modals). */
37
+ children?: ReactNode;
38
+ }
39
+ /**
40
+ * Render the hero chrome (headline only; no composer, no workspace row).
41
+ * @param props - see {@link HeroShellProps}.
42
+ * @returns the centered hero element tree.
43
+ */
44
+ export declare function HeroShell({ t, renderSlot, children }: HeroShellProps): import("react").JSX.Element;
45
+ export {};
46
+ //# sourceMappingURL=EmptyHero.d.ts.map
@@ -0,0 +1,18 @@
1
+ /** The default composer body: the 'conversation.composer.bar' slot entry.
2
+ * Machine state arrives through the standard provide channel
3
+ * (useInput + inputActions); the keyboard/DOM command face and stop arrive
4
+ * through this entry's own inject, whose hooks compartment binds
5
+ * useNotices/useLexicon; layout-phase inputs (variant and placeholder) ride
6
+ * the owner props. Session facts
7
+ * (running/removed/promptError) are self-selected via useSession.
8
+ *
9
+ * The text surface is the shell-owned Lexical editor bound here through
10
+ * ComposerContentEditable; chips render as decorator portals, and the
11
+ * keymap registers submit/menu/paste gestures on the editor command layer.
12
+ * The no-session state renders the SAME div inert as the Workspace-picker
13
+ * trigger instead of a parallel tree.
14
+ */
15
+ import type { ComposerBarProps } from '../contract/slots.ts';
16
+ export type InputBarProps = ComposerBarProps;
17
+ export declare const InputBar: import("react").MemoExoticComponent<({ useSession, useInput, inputActions, keyboard, addFiles, removeAttachment, resolveDraftAttachments, retryFileUpload, toggleCommandMenu, stop, command, t, renderSlot, useBusyEnter, useFileUploads, useNotices, useLexicon, useMenuLauncher, useProjection, sessionId, variant, disabled: inert, blocked, workspacePickerOpen, onRequestWorkspace, placeholder, accessory, }: InputBarProps) => import("react").JSX.Element>;
18
+ //# sourceMappingURL=InputBar.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { PermissionSelect as PermissionSelectValue } from '@deepseek-ai/dsh-permission-presets/client';
2
+ import type { ComposerBarProps } from '../contract/slots.ts';
3
+ export interface PermissionSelectProps {
4
+ value: PermissionSelectValue | undefined;
5
+ locked: boolean;
6
+ command: (line: string) => Promise<boolean>;
7
+ /** The owning bar's locale seat, passed down as a plain prop. */
8
+ t: ComposerBarProps['t'];
9
+ }
10
+ export declare function PermissionSelect({ value, locked, command, t }: PermissionSelectProps): import("react").JSX.Element | null;
11
+ //# sourceMappingURL=PermissionSelect.d.ts.map
@@ -0,0 +1,21 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
3
+ import type { TodoItem } from '@deepseek-ai/dsh-tool-todo/client';
4
+ export interface TodoPanelProps {
5
+ /** The session's current plan (empty renders nothing) — selected by the dock adapter. */
6
+ todos: readonly TodoItem[];
7
+ /** The dock entry's locale seat, passed down as a plain prop. */
8
+ t: TodoDockProps['t'];
9
+ }
10
+ export declare function TodoPanel({ todos, t }: TodoPanelProps): import("react").JSX.Element | null;
11
+ /** Props for the projected todo dock. */
12
+ export type TodoDockProps = PropsRuntime<'conversation.input.dock'> & PropsLocale<'conversation'>;
13
+ /** Renders the current todo projection, or nothing when it is absent. */
14
+ export declare function TodoDock({ useProjection, t }: TodoDockProps): import("react").JSX.Element;
15
+ /** Registers the projected todo dock. */
16
+ export declare const todoDockEntry: {
17
+ name: string;
18
+ inject: string[];
19
+ apply(ctx: Context): void;
20
+ };
21
+ //# sourceMappingURL=TodoPanel.d.ts.map
@@ -0,0 +1,18 @@
1
+ /** Safari-specific textarea layout recovery for the conversation composer. */
2
+ /** Browser identity fields needed to distinguish Safari from other WebKit-based browsers. */
3
+ export interface BrowserIdentity {
4
+ readonly userAgent: string;
5
+ readonly vendor: string;
6
+ }
7
+ /**
8
+ * Detect Safari's `Version/... Safari/...` form while excluding known alternate iOS browser tokens.
9
+ * @param identity - Browser user-agent and vendor values.
10
+ * @returns Whether the identity should use the Safari-specific recovery.
11
+ */
12
+ export declare function isSafariBrowser(identity: BrowserIdentity): boolean;
13
+ /**
14
+ * Repair Safari's stale native textarea layout and the scrollport auto height it can contaminate.
15
+ * @param input - Composer textarea whose own scrollable overflow must stay zero.
16
+ */
17
+ export declare function repairSafariTextareaLayout(input: HTMLTextAreaElement | null): void;
18
+ //# sourceMappingURL=safari.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Browser-local mirror of the desktop toolbar's portal hosts. The
3
+ * conversation apply world subscribes to `ctx.layout`'s toolbar-host
4
+ * registry (ui-layout) and republishes here, because React components in
5
+ * this package reach browser-local state through module stores, not through
6
+ * the cordis face. Elements only — nothing here is serialized or persisted;
7
+ * a reload (or a toolbar unmount) falls back to null and the session header
8
+ * renders in place.
9
+ */
10
+ import type { ToolbarHosts } from '@deepseek-ai/dsh-client-ui-layout/client';
11
+ /** Republish one registry snapshot (mount, remount, or null on unmount). */
12
+ export declare function setToolbarHosts(hosts: ToolbarHosts | null): void;
13
+ /** useSyncExternalStore snapshot getter. */
14
+ export declare function getToolbarHosts(): ToolbarHosts | null;
15
+ /** useSyncExternalStore subscription; returns the unsubscriber. */
16
+ export declare function subscribeToolbarHosts(listener: () => void): () => void;
17
+ //# sourceMappingURL=toolbar-hosts.d.ts.map
@@ -0,0 +1,24 @@
1
+ /** Per-session Conversation store shared by the shell body and header. */
2
+ import { type EngineStoreHandle } from '@deepseek-ai/dsh-client-store';
3
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
4
+ import type { ConversationStoreState } from './contract/views.ts';
5
+ /** Declared write set for the Conversation shell. */
6
+ type ConversationActions = {
7
+ setDraft: (draft: ConversationStoreState, text: string) => void;
8
+ setView: (draft: ConversationStoreState, view: string) => void;
9
+ openView: (draft: ConversationStoreState, view: string, focus: string) => void;
10
+ completeViewRequest: (draft: ConversationStoreState) => void;
11
+ };
12
+ /**
13
+ * Declare per-session draft persistence and View selection.
14
+ * @returns the store handle.
15
+ */
16
+ export declare function createConversationStore(): EngineStoreHandle<ConversationStoreState, ConversationActions>;
17
+ /**
18
+ * Read the persisted View preference before the Slot store is materialized.
19
+ * @param sessionId - Session-scoped persistence suffix.
20
+ * @returns the preferred View id, or null when storage has no usable value.
21
+ */
22
+ export declare function readConversationViewPreference(sessionId: SessionId): string | null;
23
+ export {};
24
+ //# sourceMappingURL=stores.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { ViewTab } from './contract/views.ts';
2
+ /**
3
+ * Resolve a preferred registered View, then Chat, without choosing another View.
4
+ * @param tabs - currently registered Views.
5
+ * @param selectedId - preferred View identity, when one is stored.
6
+ * @returns the selected View, Chat fallback, or undefined when neither is registered.
7
+ */
8
+ export declare function resolveActiveView(tabs: readonly ViewTab[], selectedId: string | null): ViewTab | undefined;
9
+ //# sourceMappingURL=view-selection.d.ts.map
@@ -0,0 +1,9 @@
1
+ /** Host registration for browser conversation preferences. */
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ export { BUSY_ENTER_BEHAVIORS, BUSY_ENTER_FIELD, CONVERSATION_SETTINGS_NAMESPACE, DEFAULT_BUSY_ENTER_BEHAVIOR, type BusyEnterBehavior, type ConversationSettings, } from './submission-settings.ts';
4
+ /**
5
+ * Register the durable conversation section when a settings provider exists.
6
+ * @param ctx - Host context whose optional settings service owns the section.
7
+ */
8
+ export declare function apply(ctx: Context): void;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,20 @@
1
+ /** Busy-Enter preference stored in the Host user-settings document. */
2
+ import z from '@deepseek-ai/schemastery';
3
+ /** Settings namespace owned by the conversation plugin. */
4
+ export declare const CONVERSATION_SETTINGS_NAMESPACE = "ui-conversation";
5
+ /** Field carrying the delivery mode for plain Enter while an agent is busy. */
6
+ export declare const BUSY_ENTER_FIELD = "busyEnter";
7
+ /** Busy-Enter behaviors accepted at settings and input boundaries. */
8
+ export declare const BUSY_ENTER_BEHAVIORS: readonly ["queue", "steer"];
9
+ /** Configurable meaning of plain Enter while the addressed agent is busy. */
10
+ export type BusyEnterBehavior = typeof BUSY_ENTER_BEHAVIORS[number];
11
+ /** Default preserves Enter-as-Queue for running conversations. */
12
+ export declare const DEFAULT_BUSY_ENTER_BEHAVIOR: BusyEnterBehavior;
13
+ /** Durable conversation section shared by the Host schema and the browser scope. */
14
+ export interface ConversationSettings {
15
+ /** Delivery mode for plain Enter while the addressed agent is busy. */
16
+ busyEnter: BusyEnterBehavior;
17
+ }
18
+ /** Durable conversation schema; also the wire envelope the browser scope validates against. */
19
+ export declare const ConversationSettingsSchema: z<ConversationSettings>;
20
+ //# sourceMappingURL=submission-settings.d.ts.map
package/package.json ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "name": "@crazx/dsh-client-ui-conversation",
3
+ "description": "Target-neutral Conversation assembly, shell, composer, queue, and view navigation",
4
+ "version": "0.1.5-alpha.1.zw.3",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/aka-danielZhang/deepseek-harness.git",
11
+ "directory": "packages/client/ui-conversation"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./lib/types/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./client": {
22
+ "types": "./lib/types/client/index.d.ts",
23
+ "default": "./lib/client.js"
24
+ },
25
+ "./src/*": "./src/*",
26
+ "./package.json": "./package.json"
27
+ },
28
+ "dsh": {
29
+ "client": {
30
+ "inject": [
31
+ "@deepseek-ai/dsh-api-session-controller",
32
+ "@deepseek-ai/dsh-client-file-upload",
33
+ "@deepseek-ai/dsh-client-locale",
34
+ "@deepseek-ai/dsh-client-ui-layout",
35
+ "@deepseek-ai/dsh-client-ui-renderer",
36
+ "@deepseek-ai/dsh-client-ui-session",
37
+ "@deepseek-ai/dsh-client-ui-settings",
38
+ "@deepseek-ai/dsh-client-ui-workspace"
39
+ ],
40
+ "platform": "web"
41
+ }
42
+ },
43
+ "license": "MIT",
44
+ "dependencies": {
45
+ "clsx": "^2.0.0",
46
+ "@deepseek-ai/schemastery": "^3.18.2",
47
+ "@lexical/history": "^0.49.0",
48
+ "@lexical/plain-text": "^0.49.0",
49
+ "@lexical/text": "^0.49.0",
50
+ "@lexical/utils": "^0.49.0",
51
+ "lexical": "^0.49.0"
52
+ },
53
+ "peerDependencies": {
54
+ "@deepseek-ai/cordis": "^4.0.2"
55
+ },
56
+ "devDependencies": {
57
+ "@deepseek-ai/cordis": "^4.0.2",
58
+ "@deepseek-ai/dsh-api-remotes": "^0.1.5-alpha.1",
59
+ "@deepseek-ai/dsh-api-session-controller": "npm:@crazx/dsh-api-session-controller@0.1.5-alpha.1.zw.3",
60
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.1.5-alpha.1",
61
+ "@deepseek-ai/dsh-attachment": "^0.1.5-alpha.1",
62
+ "@deepseek-ai/dsh-brand": "^0.1.5-alpha.1",
63
+ "@deepseek-ai/dsh-client-locale": "^0.1.5-alpha.1",
64
+ "@deepseek-ai/dsh-client-file-upload": "^0.1.5-alpha.1",
65
+ "@deepseek-ai/dsh-client-store": "^0.1.5-alpha.1",
66
+ "@deepseek-ai/dsh-client-test-runtime": "npm:@crazx/dsh-client-test-runtime@0.1.5-alpha.1.zw.3",
67
+ "@deepseek-ai/dsh-client-ui-layout": "npm:@crazx/dsh-client-ui-layout@0.1.5-alpha.1.zw.3",
68
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-alpha.1",
69
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-alpha.1",
70
+ "@deepseek-ai/dsh-client-ui-session": "^0.1.5-alpha.1",
71
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.5-alpha.1",
72
+ "@deepseek-ai/dsh-client-ui-workspace": "^0.1.5-alpha.1",
73
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-alpha.1",
74
+ "@deepseek-ai/dsh-commands": "^0.1.5-alpha.1",
75
+ "@deepseek-ai/dsh-goal": "^0.1.5-alpha.1",
76
+ "@deepseek-ai/dsh-llm": "^0.1.5-alpha.1",
77
+ "@deepseek-ai/dsh-llm-retry": "^0.1.5-alpha.1",
78
+ "@deepseek-ai/dsh-permission-presets": "^0.1.5-alpha.1",
79
+ "@deepseek-ai/dsh-plan-mode": "^0.1.5-alpha.1",
80
+ "@deepseek-ai/dsh-session": "^0.1.5-alpha.1",
81
+ "@deepseek-ai/dsh-token-meter": "^0.1.5-alpha.1",
82
+ "@deepseek-ai/dsh-tool-todo": "^0.1.5-alpha.1",
83
+ "@deepseek-ai/dsh-util-crypto": "^0.1.5-alpha.1",
84
+ "@deepseek-ai/dsh-workspace": "^0.1.5-alpha.1",
85
+ "@deepseek-ai/dsh-util-workspace-path": "^0.1.5-alpha.1",
86
+ "@types/react": "~18.3.1",
87
+ "react": "^18.2.0",
88
+ "@lexical/headless": "^0.49.0",
89
+ "react-dom": "^18.2.0",
90
+ "@types/react-dom": "~18.3.0",
91
+ "zod": "^4.4.3",
92
+ "@deepseek-ai/dsh-settings": "^0.1.5-alpha.1"
93
+ },
94
+ "files": [
95
+ "lib/index.js",
96
+ "lib/client.js",
97
+ "lib/types/**/*.d.ts"
98
+ ],
99
+ "scripts": {
100
+ "bundle": "tsdown",
101
+ "watch": "tsdown --watch"
102
+ }
103
+ }