@deepseek-ai/dsh-experimental-client-ui-forge 0.0.0-stage → 0.2.2-alpha.2

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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +37 -0
  3. package/README.md +134 -2
  4. package/README.zh.md +135 -0
  5. package/lib/client.js +8745 -0
  6. package/lib/index.js +3131 -0
  7. package/lib/typert.host.d.ts +3 -0
  8. package/lib/typert.host.js +2222 -0
  9. package/lib/typert.remote-client.d.ts +79 -0
  10. package/lib/typert.remote-client.js +1284 -0
  11. package/lib/types/client/ActionToast.d.ts +14 -0
  12. package/lib/types/client/ChangeRequestCard.d.ts +54 -0
  13. package/lib/types/client/ChangesTab.d.ts +49 -0
  14. package/lib/types/client/ChangesTabTitle.d.ts +13 -0
  15. package/lib/types/client/DiffFile.d.ts +75 -0
  16. package/lib/types/client/FileLabel.d.ts +20 -0
  17. package/lib/types/client/ForgeTab.d.ts +54 -0
  18. package/lib/types/client/ForgeTabTitle.d.ts +11 -0
  19. package/lib/types/client/HeaderButton.d.ts +27 -0
  20. package/lib/types/client/LocalChangesCard.d.ts +29 -0
  21. package/lib/types/client/RefreshGlyph.d.ts +18 -0
  22. package/lib/types/client/SessionHoverForge.d.ts +20 -0
  23. package/lib/types/client/SessionRowForge.d.ts +39 -0
  24. package/lib/types/client/WorktreeProgress.d.ts +44 -0
  25. package/lib/types/client/WorktreeToggle.d.ts +42 -0
  26. package/lib/types/client/changes-address.d.ts +70 -0
  27. package/lib/types/client/changes-store.d.ts +39 -0
  28. package/lib/types/client/checkout.d.ts +34 -0
  29. package/lib/types/client/diff-rows.d.ts +96 -0
  30. package/lib/types/client/format.d.ts +21 -0
  31. package/lib/types/client/glyphs.d.ts +33 -0
  32. package/lib/types/client/index.d.ts +25 -0
  33. package/lib/types/client/locales.d.ts +228 -0
  34. package/lib/types/client/mount.d.ts +17 -0
  35. package/lib/types/client/session-list.d.ts +46 -0
  36. package/lib/types/client/source.d.ts +146 -0
  37. package/lib/types/client/status.d.ts +95 -0
  38. package/lib/types/diff.d.ts +32 -0
  39. package/lib/types/git.d.ts +93 -0
  40. package/lib/types/index.d.ts +275 -0
  41. package/lib/types/local-diff.d.ts +93 -0
  42. package/lib/types/panel.d.ts +135 -0
  43. package/lib/types/parse.d.ts +57 -0
  44. package/lib/types/patch-cache.d.ts +33 -0
  45. package/lib/types/states.d.ts +89 -0
  46. package/lib/types/types.d.ts +395 -0
  47. package/lib/types/worktree.d.ts +225 -0
  48. package/locale/de.json +6 -0
  49. package/locale/en.json +6 -0
  50. package/locale/es.json +6 -0
  51. package/locale/fr.json +6 -0
  52. package/locale/ja.json +6 -0
  53. package/locale/pt.json +6 -0
  54. package/locale/ru.json +6 -0
  55. package/locale/zh.json +6 -0
  56. package/package.json +123 -3
@@ -0,0 +1,14 @@
1
+ /** App-wide notice for forge panel actions, rendered outside the panel so it outlives it. */
2
+ import type { ReactNode } from 'react';
3
+ import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { NS } from './locales.ts';
5
+ import type { NoticeSource } from './source.ts';
6
+ /** Full props of the `shell.overlay` entry. */
7
+ export type ActionToastProps = PropsLocale<typeof NS> & InjectFace<Omit<NoticeSource, 'report'>>;
8
+ /**
9
+ * Render the current notice: a success notice with its undo action, or a failure warning.
10
+ * @param props - notice hook, dismissal, and copy.
11
+ * @returns the toast, or nothing while no notice shows.
12
+ */
13
+ export declare function ActionToast({ useNotice, dismiss, t }: ActionToastProps): ReactNode;
14
+ //# sourceMappingURL=ActionToast.d.ts.map
@@ -0,0 +1,54 @@
1
+ /**
2
+ * One change request as a card: its title links to the host, a one-line
3
+ * summary shows while collapsed, and while expanded one row per fact (checks,
4
+ * review, merge state, and the changed lines, which open its changes) above
5
+ * the ready-for-review or merge action.
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
9
+ import type { MergeRequest } from '@deepseek-ai/dsh-experimental-forge/types';
10
+ import type { ForgePanelChangeRequest } from '../types.ts';
11
+ import type { NS } from './locales.ts';
12
+ type Translate = PropsLocale<typeof NS>['t'];
13
+ /** What a card can do; a surface without a Session binding omits `remove`, `markReady`, `merge`, and `viewChanges`. */
14
+ export interface ChangeRequestActions {
15
+ /** Open a URL outside the app. */
16
+ readonly openLink: (url: string) => void;
17
+ /** Copy a URL to the clipboard. */
18
+ readonly copyLink: (url: string) => void;
19
+ /** Read the status again after a failed read. */
20
+ readonly retry: () => void;
21
+ /** Remove the change request from its Session. */
22
+ readonly remove?: ((entry: ForgePanelChangeRequest) => void) | undefined;
23
+ /** Mark a draft ready for review; settles once the outcome is reported. */
24
+ readonly markReady?: ((entry: ForgePanelChangeRequest) => Promise<void>) | undefined;
25
+ /** Merge the change request as `request` describes; settles once the outcome is reported. */
26
+ readonly merge?: ((entry: ForgePanelChangeRequest, request: MergeRequest) => Promise<void>) | undefined;
27
+ /** Open the changes view of the change request. */
28
+ readonly viewChanges?: ((entry: ForgePanelChangeRequest) => void) | undefined;
29
+ }
30
+ /** Props of one change request card. */
31
+ export interface ChangeRequestCardProps {
32
+ /** Change request with its latest snapshot and polling result. */
33
+ readonly entry: ForgePanelChangeRequest;
34
+ /** Whether the details show. */
35
+ readonly expanded: boolean;
36
+ /** Show or hide the details. */
37
+ readonly onToggle: () => void;
38
+ /** Current epoch milliseconds for relative times. */
39
+ readonly now: number;
40
+ /** Card actions. */
41
+ readonly actions: ChangeRequestActions;
42
+ /** Active UI language for numeric formatting. */
43
+ readonly locale: string;
44
+ /** Forge panel copy. */
45
+ readonly t: Translate;
46
+ }
47
+ /**
48
+ * Render one change request.
49
+ * @param props - change request, expansion, current time, actions, and copy.
50
+ * @returns the card.
51
+ */
52
+ export declare function ChangeRequestCard({ entry, expanded, onToggle, now, actions, locale, t }: ChangeRequestCardProps): ReactNode;
53
+ export {};
54
+ //# sourceMappingURL=ChangeRequestCard.d.ts.map
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Body of the changes tab: the local changes of the Session's checkout in a
3
+ * chosen scope, or the changes of one of its change requests, as one list of
4
+ * file sections under a toolbar that jumps between files and switches the
5
+ * layout. The view reads the changes when it opens, on each navigation, on
6
+ * refresh, and when the change request's head or the checkout's `branch`
7
+ * scope summary changes; a read keeps the previous changes on screen until it settles.
8
+ */
9
+ import { type ReactNode } from 'react';
10
+ import type { HostObservable, InjectFace, PropsLocale, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots';
11
+ import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
12
+ import type { ForgeChangeRequestDiff, ForgeLocalDiff, ForgeLocalScope } from '../types.ts';
13
+ import type { createChangesStore } from './changes-store.ts';
14
+ import type { ForgePanelKey, NS } from './locales.ts';
15
+ import type { PanelSnapshot } from './source.ts';
16
+ /** Business face of the changes tab body. */
17
+ export interface ChangesTabInjected {
18
+ /** Panel source while visible; the renderer releases the subscription for an inactive key. */
19
+ readonly keyedHooks: {
20
+ readonly panel: (visibility: string) => HostObservable<PanelSnapshot> | undefined;
21
+ };
22
+ /** Open the panel stream again after it ended. */
23
+ readonly reconnect: () => void;
24
+ /** Read the local changes of one scope; `signal` aborts the read. */
25
+ readonly localDiff: (scope: ForgeLocalScope, signal: AbortSignal) => Promise<RemoteResult<ForgeLocalDiff>>;
26
+ /** Read the new side of one file in a local scope. */
27
+ readonly localText: (scope: ForgeLocalScope, path: string) => Promise<RemoteResult<string>>;
28
+ /** Read the changes of a change request by its binding URL; `signal` aborts the read. */
29
+ readonly changeRequestDiff: (url: string, signal: AbortSignal) => Promise<RemoteResult<ForgeChangeRequestDiff>>;
30
+ /** Read one file of a change request at a commit. */
31
+ readonly changeRequestText: (url: string, commit: string, path: string) => Promise<RemoteResult<string>>;
32
+ /** Open a URL outside the app. */
33
+ readonly openLink: (url: string) => void;
34
+ /** Copy a path to the clipboard and report the outcome. */
35
+ readonly copyPath: (path: string) => void;
36
+ /** Ask the Session's Agent to create a change request for its changes, reporting the outcome. */
37
+ readonly createChangeRequest: () => void;
38
+ /** Show a failure notice. */
39
+ readonly report: (key: ForgePanelKey, params?: Readonly<Record<string, string>>) => void;
40
+ }
41
+ /** Full props of the changes tab body. */
42
+ export type ChangesTabProps = Pick<PropsRuntime<'sidebar.right.pane.tab'>, 'useTabInfo' | 'sessionId'> & PropsStore<ReturnType<typeof createChangesStore>> & InjectFace<ChangesTabInjected> & PropsLocale<typeof NS>;
43
+ /**
44
+ * Render the changes tab of one Session.
45
+ * @param props - tab information, the tab's choices, the panel snapshot hook, reads and actions, and copy.
46
+ * @returns the view body.
47
+ */
48
+ export declare function ChangesTab({ useTabInfo, sessionId, useStore, actions, usePanel, reconnect, localDiff, localText, changeRequestDiff, changeRequestText, openLink, copyPath, createChangeRequest, report, t, }: ChangesTabProps): ReactNode;
49
+ //# sourceMappingURL=ChangesTab.d.ts.map
@@ -0,0 +1,13 @@
1
+ /** Chip title of a changes tab: the changes icon and the view's name in the current language. */
2
+ import type { ReactNode } from 'react';
3
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { NS } from './locales.ts';
5
+ /** Props of the changes tab title. */
6
+ export type ChangesTabTitleProps = Pick<PropsRuntime<'sidebar.right.pane.tab.title'>, 'useTabInfo'> & PropsLocale<typeof NS>;
7
+ /**
8
+ * Render the chip title of a changes tab; an address this package did not mint keeps the captured title.
9
+ * @param props - tab information and forge panel copy.
10
+ * @returns the icon followed by the title.
11
+ */
12
+ export declare function ChangesTabTitle({ useTabInfo, t }: ChangesTabTitleProps): ReactNode;
13
+ //# sourceMappingURL=ChangesTabTitle.d.ts.map
@@ -0,0 +1,75 @@
1
+ /**
2
+ * One file of the changes view: a sticky header with the path, badges, line
3
+ * counts, and file actions, then its hunks unified or side by side with the
4
+ * unchanged lines between them collapsed into rows that expand them.
5
+ */
6
+ import { type ReactNode } from 'react';
7
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
8
+ import type { ForgeDiffFile } from '../types.ts';
9
+ import type { ForgePanelKey, NS } from './locales.ts';
10
+ type Translate = PropsLocale<typeof NS>['t'];
11
+ /** One action of a file's menu. */
12
+ export interface DiffFileAction {
13
+ /** Dictionary key of the row label. */
14
+ readonly label: ForgePanelKey;
15
+ /** Runs the action. */
16
+ readonly run: () => void;
17
+ }
18
+ /** New side of a file: its lines once read, `loading` while a read runs, or undefined before any. */
19
+ export type DiffFileText = readonly string[] | 'loading' | undefined;
20
+ /** Props of one file section. */
21
+ export interface DiffFileProps {
22
+ /** Whether the owning tab is visible and may show temporary menus. */
23
+ readonly visible: boolean;
24
+ /** The file and its hunks. */
25
+ readonly file: ForgeDiffFile;
26
+ /** Whether the section shows its lines. */
27
+ readonly expanded: boolean;
28
+ /** Expand or collapse the section. */
29
+ readonly onToggle: () => void;
30
+ /** Whether the file shows the large-file notice instead of its lines until revealed. */
31
+ readonly large: boolean;
32
+ /** Whether the user revealed a large file. */
33
+ readonly revealed: boolean;
34
+ /** Show a large file anyway. */
35
+ readonly onReveal: () => void;
36
+ /** The file's new side, which supplies collapsed unchanged lines. */
37
+ readonly text: DiffFileText;
38
+ /** Indexes of the expanded gaps. */
39
+ readonly open: ReadonlySet<number>;
40
+ /** Expand one gap. */
41
+ readonly onExpand: (index: number) => void;
42
+ /** Whether deletions and additions show in two columns; a file with only additions or only deletions keeps one. */
43
+ readonly split: boolean;
44
+ /** Whether long lines wrap. */
45
+ readonly wrap: boolean;
46
+ /** Badge text after the path, or empty for none. */
47
+ readonly badge: string;
48
+ /** Hover text of the path: both paths of a renamed file, else the path. */
49
+ readonly tooltip: string;
50
+ /** Rows of the file's menu. */
51
+ readonly actions: readonly DiffFileAction[];
52
+ /** Copy the repository-relative path from the file header. */
53
+ readonly onCopyPath: () => void;
54
+ /** Receives the section element, which scrolling to the file targets. */
55
+ readonly sectionRef: (element: HTMLElement | null) => void;
56
+ /** Forge panel copy. */
57
+ readonly t: Translate;
58
+ }
59
+ /**
60
+ * Render added and deleted line counts, or the binary label for binary content.
61
+ * @param props - the counts and copy.
62
+ * @returns the counts.
63
+ */
64
+ export declare function Counts({ file, t }: {
65
+ readonly file: Pick<ForgeDiffFile, 'additions' | 'deletions' | 'binary'>;
66
+ readonly t: Translate;
67
+ }): ReactNode;
68
+ /**
69
+ * Render one file of a diff.
70
+ * @param props - the file, its section and gap state, layout choices, menu actions, and copy.
71
+ * @returns the file section.
72
+ */
73
+ export declare function DiffFile(props: DiffFileProps): ReactNode;
74
+ export {};
75
+ //# sourceMappingURL=DiffFile.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The label of a changed file in the files menu, the local changes list, and a
3
+ * file's header: its name, then its directory in smaller subdued type, with the
4
+ * complete path in a tooltip.
5
+ */
6
+ import type { ReactNode } from 'react';
7
+ /**
8
+ * Render a changed file's name and directory. The directory gives up its space
9
+ * before the name does; assistive technology reads the complete path.
10
+ * @param props.path - the file's path in the repository.
11
+ * @param props.tooltip - the hover text, such as both paths of a renamed file; defaults to the path.
12
+ * @param props.className - class of the outer element, which callers size within their row.
13
+ * @returns the label.
14
+ */
15
+ export declare function FileLabel({ path, tooltip, className }: {
16
+ readonly path: string;
17
+ readonly tooltip?: string | undefined;
18
+ readonly className?: string | undefined;
19
+ }): ReactNode;
20
+ //# sourceMappingURL=FileLabel.d.ts.map
@@ -0,0 +1,54 @@
1
+ /** Body of the forge sidebar tab: where the Session works, its local changes, and the change requests it created or pushed. */
2
+ import { type ReactNode } from 'react';
3
+ import type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { RemoteHostFacts } from '@deepseek-ai/dsh-api-remotes/client';
5
+ import type { MergeRequest } from '@deepseek-ai/dsh-experimental-forge/types';
6
+ import type { ForgePanelChangeRequest } from '../types.ts';
7
+ import type { NS } from './locales.ts';
8
+ import type { PanelSnapshot } from './source.ts';
9
+ /** Business face of the tab body. */
10
+ export interface ForgeTabInjected {
11
+ /** Panel snapshot of the Session and the Host facts; the renderer binds them as `usePanel` and `useHost`. */
12
+ readonly hooks: {
13
+ readonly panel: HostObservable<PanelSnapshot>;
14
+ readonly host: HostObservable<RemoteHostFacts>;
15
+ readonly locale: HostObservable<string>;
16
+ };
17
+ /** Open the stream again after it ended. */
18
+ readonly reconnect: () => void;
19
+ /**
20
+ * Reinspect the checkout, probe sign-in, and poll the change requests;
21
+ * settles once the Host has inspected and probed, after reporting a failure.
22
+ */
23
+ readonly refresh: () => Promise<void>;
24
+ /** Remove a change request from the Session, offering to undo it. */
25
+ readonly remove: (entry: ForgePanelChangeRequest) => void;
26
+ /** Mark a draft ready for review; settles once the outcome is reported. */
27
+ readonly markReady: (entry: ForgePanelChangeRequest) => Promise<void>;
28
+ /** Merge a change request as `request` describes; settles once the outcome is reported. */
29
+ readonly merge: (entry: ForgePanelChangeRequest, request: MergeRequest) => Promise<void>;
30
+ /** Check the removed worktree of the Session out again, reporting the outcome. */
31
+ readonly restore: () => void;
32
+ /** Open a URL outside the app. */
33
+ readonly openLink: (url: string) => void;
34
+ /** Copy text to the clipboard and report the outcome. */
35
+ readonly copyText: (text: string) => void;
36
+ /** Copy a path to the clipboard and report the outcome. */
37
+ readonly copyPath: (path: string) => void;
38
+ /** Record whether the tab is visible, for the header entry's pressed state. */
39
+ readonly reportVisible: (visible: boolean) => void;
40
+ /** Ask the Session's Agent to create a change request for its changes, reporting the outcome. */
41
+ readonly createChangeRequest: () => void;
42
+ }
43
+ /** Full props of the tab body. */
44
+ export type ForgeTabProps = Pick<PropsRuntime<'sidebar.right.pane.tab'>, 'useTabInfo' | 'sessionId'> & InjectFace<ForgeTabInjected> & PropsLocale<typeof NS>;
45
+ /**
46
+ * Render the forge tab of one Session. The local changes card shows while the
47
+ * `branch` scope changes files and no open change request has the checked-out
48
+ * branch as its head. The only open change request starts expanded; once the
49
+ * user expands or collapses a card, the panel keeps that choice across later updates.
50
+ * @param props - tab information, panel snapshot and Host facts hooks, actions, and copy.
51
+ * @returns the tab body.
52
+ */
53
+ export declare function ForgeTab({ useTabInfo, sessionId, usePanel, useHost, useLocale, reconnect, refresh, remove, markReady, merge, restore, openLink, copyText, copyPath, reportVisible, createChangeRequest, t, }: ForgeTabProps): ReactNode;
54
+ //# sourceMappingURL=ForgeTab.d.ts.map
@@ -0,0 +1,11 @@
1
+ /** Chip title of the forge tab: the change request glyph and the localized tab name. */
2
+ import type { ReactNode } from 'react';
3
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { NS } from './locales.ts';
5
+ /**
6
+ * Render the tab chip title in the current UI language.
7
+ * @param props - forge panel copy.
8
+ * @returns the glyph followed by the tab name.
9
+ */
10
+ export declare function ForgeTabTitle({ t }: PropsLocale<typeof NS>): ReactNode;
11
+ //# sourceMappingURL=ForgeTabTitle.d.ts.map
@@ -0,0 +1,27 @@
1
+ /** Session header entry that shows or hides the forge tab and marks change requests that need attention. */
2
+ import type { ReactNode } from 'react';
3
+ import type { HostObservable, InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { NS } from './locales.ts';
5
+ import type { PanelSnapshot } from './source.ts';
6
+ /** Business face of the header entry. */
7
+ export interface HeaderButtonInjected {
8
+ /** Panel snapshot and tab visibility of the Session; the renderer binds them as `usePanel` and `useVisible`. */
9
+ readonly hooks: {
10
+ readonly panel: HostObservable<PanelSnapshot>;
11
+ readonly visible: HostObservable<boolean>;
12
+ };
13
+ /**
14
+ * Hide the forge tab when it is visible, otherwise open or reveal it.
15
+ * @param visible - whether the tab is visible now.
16
+ */
17
+ readonly toggle: (visible: boolean) => void;
18
+ }
19
+ /** Full props of the header entry. */
20
+ export type HeaderButtonProps = InjectFace<HeaderButtonInjected> & PropsLocale<typeof NS>;
21
+ /**
22
+ * Render the header entry.
23
+ * @param props - panel snapshot and visibility hooks, the toggle, and copy.
24
+ * @returns the entry, or nothing outside a Git checkout without bound change requests.
25
+ */
26
+ export declare function HeaderButton({ usePanel, useVisible, toggle, t }: HeaderButtonProps): ReactNode;
27
+ //# sourceMappingURL=HeaderButton.d.ts.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The panel card of the checkout's changes before a change request carries
3
+ * them: the files the `branch` scope changes, their size, which opens the
4
+ * changes view, and the action that asks the Agent for a change request.
5
+ */
6
+ import { type ReactNode } from 'react';
7
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
8
+ import type { ForgeLocalChanges } from '../types.ts';
9
+ import type { NS } from './locales.ts';
10
+ /** Props of the local changes card. */
11
+ export interface LocalChangesCardProps {
12
+ /** Files the `branch` scope changes and the ref it compares with. */
13
+ readonly local: ForgeLocalChanges;
14
+ /** Whether the card offers to create a change request. */
15
+ readonly creatable: boolean;
16
+ /** Open the changes view, scrolled to `path` when given. */
17
+ readonly view: (path?: string) => void;
18
+ /** Ask the Agent to create a change request for the changes. */
19
+ readonly create: () => void;
20
+ /** Forge panel copy. */
21
+ readonly t: PropsLocale<typeof NS>['t'];
22
+ }
23
+ /**
24
+ * Render the local changes card; the file list starts collapsed.
25
+ * @param props - the changes, the view and create actions, and copy.
26
+ * @returns the card.
27
+ */
28
+ export declare function LocalChangesCard({ local, creatable, view, create, t }: LocalChangesCardProps): ReactNode;
29
+ //# sourceMappingURL=LocalChangesCard.d.ts.map
@@ -0,0 +1,18 @@
1
+ /** Refresh glyph that turns while a refresh runs. */
2
+ import { type ReactNode } from 'react';
3
+ /** Props of the refresh glyph. */
4
+ export interface RefreshGlyphProps {
5
+ /** Whether the refresh runs. */
6
+ readonly busy: boolean;
7
+ /** Glyph size in pixels. */
8
+ readonly size: number;
9
+ }
10
+ /**
11
+ * Render the refresh glyph. It turns while `busy` and, once `busy` ends,
12
+ * completes the turn under way, so a quick refresh still shows a whole turn
13
+ * and the glyph stops upright. Under reduced motion it dims and returns instead of turning.
14
+ * @param props - whether the refresh runs, and the glyph size.
15
+ * @returns the glyph.
16
+ */
17
+ export declare function RefreshGlyph({ busy, size }: RefreshGlyphProps): ReactNode;
18
+ //# sourceMappingURL=RefreshGlyph.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The forge section of a Session row's hover card: the worktree branch while
3
+ * the Session works in the worktree the panel created for it, and its change
4
+ * requests, most urgent first.
5
+ */
6
+ import type { ReactNode } from 'react';
7
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
8
+ import type { NS } from './locales.ts';
9
+ import { type SessionListInjected } from './session-list.ts';
10
+ /** Change requests the hover card lists before naming how many more there are. */
11
+ export declare const HOVER_CHANGE_REQUEST_LIMIT = 3;
12
+ /** Full props of the hover section. */
13
+ export type SessionHoverForgeProps = PropsRuntime<'sidebar.session.row.hover'> & PropsLocale<typeof NS> & InjectFace<SessionListInjected>;
14
+ /**
15
+ * Render the forge section of a Session's hover card.
16
+ * @param props - the row's Session, the shared hooks, and copy.
17
+ * @returns the section, or null for a Session without a worktree or change requests.
18
+ */
19
+ export declare function SessionHoverForge({ sessionId, useSessions, useStates, t }: SessionHoverForgeProps): ReactNode;
20
+ //# sourceMappingURL=SessionHoverForge.d.ts.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Session row icons after the time label: a branch glyph while the Session
3
+ * works in the worktree the panel created for it, and the state glyph of its
4
+ * most urgent change request. Glyphs of open change requests stay in the
5
+ * row's subdued color with a dot for their checks; merged and closed ones keep
6
+ * their state color.
7
+ */
8
+ import type { ReactNode } from 'react';
9
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
10
+ import type { ChecksRollup } from '@deepseek-ai/dsh-experimental-forge/types';
11
+ import type { ForgePanelKey, NS } from './locales.ts';
12
+ import { type SessionListChangeRequest, type SessionListInjected } from './session-list.ts';
13
+ type Translate = PropsLocale<typeof NS>['t'];
14
+ /** Copy of each checks outcome a row and its hover card name. */
15
+ export declare const CHECKS_LABEL: Record<Exclude<ChecksRollup, 'none'>, ForgePanelKey>;
16
+ /**
17
+ * The checks outcome a row shows for a change request: none for a merged,
18
+ * closed, or not yet polled one.
19
+ * @param entry - the change request.
20
+ * @returns the outcome.
21
+ */
22
+ export declare function rowChecks(entry: SessionListChangeRequest): ChecksRollup;
23
+ /**
24
+ * Name a change request's state and checks, as one line.
25
+ * @param entry - the change request.
26
+ * @param t - forge panel copy.
27
+ * @returns the line.
28
+ */
29
+ export declare function stateLine(entry: SessionListChangeRequest, t: Translate): string;
30
+ /** Full props of the row icons. */
31
+ export type SessionRowForgeProps = PropsRuntime<'sidebar.session.row.trailing'> & PropsLocale<typeof NS> & InjectFace<SessionListInjected>;
32
+ /**
33
+ * Render a Session row's forge icons.
34
+ * @param props - the row's Session, the shared hooks, and copy.
35
+ * @returns the icons, or nothing for a Session without a worktree or change requests.
36
+ */
37
+ export declare function SessionRowForge({ sessionId, useSessions, useStates, t }: SessionRowForgeProps): ReactNode;
38
+ export {};
39
+ //# sourceMappingURL=SessionRowForge.d.ts.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Card above the composer while a Session's worktree is created, while a message
3
+ * waits after a failed or stopped attempt, and when its worktree is gone or
4
+ * being restored.
5
+ */
6
+ import { type ReactNode } from 'react';
7
+ import type { HostObservable, InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
8
+ import type { NS } from './locales.ts';
9
+ import type { PanelSnapshot } from './source.ts';
10
+ /** Business face of the card. */
11
+ export interface WorktreeProgressInjected {
12
+ /** Panel snapshot of the Session; the renderer binds it as `usePanel`. */
13
+ readonly hooks: {
14
+ readonly panel: HostObservable<PanelSnapshot>;
15
+ };
16
+ /** Stop the running attempt a message waits for; the message keeps waiting. */
17
+ readonly stop: () => void;
18
+ /** Make another attempt at the worktree a message waits for. */
19
+ readonly retry: () => void;
20
+ /** Withdraw the worktree request, so the waiting message goes on without a worktree. */
21
+ readonly withdraw: () => void;
22
+ /**
23
+ * Check out the removed worktree again.
24
+ * @returns the failure text, or undefined once it is restored.
25
+ */
26
+ readonly restore: () => Promise<string | undefined>;
27
+ /** Move the Session back to the source checkout of its removed worktree. */
28
+ readonly leave: () => void;
29
+ }
30
+ /** Full props of the card. */
31
+ export type WorktreeProgressProps = InjectFace<WorktreeProgressInjected> & PropsLocale<typeof NS>;
32
+ /**
33
+ * Render the worktree card of a Session: the running attempt at its
34
+ * requested worktree, which can be stopped while a message waits for it; the
35
+ * failed or stopped attempt a message waits after, with another attempt or
36
+ * withdrawing the request so the message goes on without a worktree; or the
37
+ * removal of the worktree the Session works in, with restoring it, whose
38
+ * steps the card follows, and returning to the source checkout, after which
39
+ * a waiting message goes on.
40
+ * @param props - panel hook, actions, and copy.
41
+ * @returns the card, or nothing while no attempt runs, no message waits, and the worktree exists.
42
+ */
43
+ export declare function WorktreeProgress({ usePanel, stop, retry, withdraw, restore, leave, t }: WorktreeProgressProps): ReactNode;
44
+ //# sourceMappingURL=WorktreeProgress.d.ts.map
@@ -0,0 +1,42 @@
1
+ /** New Session option: start the Session in a new worktree, from a chosen local branch. */
2
+ import { type ReactNode } from 'react';
3
+ import type { HostObservable, InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { ForgeBranches } from '../types.ts';
5
+ import type { NS } from './locales.ts';
6
+ import type { PanelSnapshot } from './source.ts';
7
+ /** Business face of the New Session option. */
8
+ export interface WorktreeToggleInjected {
9
+ /** Panel snapshot of the Session; the renderer binds it as `usePanel`. */
10
+ readonly hooks: {
11
+ readonly panel: HostObservable<PanelSnapshot>;
12
+ };
13
+ /**
14
+ * Request a worktree from a base branch, replacing an open request.
15
+ * @param from - base branch, or null for HEAD.
16
+ * @returns whether the Host accepted it.
17
+ */
18
+ readonly request: (from: string | null) => Promise<boolean>;
19
+ /**
20
+ * Withdraw the open request.
21
+ * @returns whether the Host accepted it.
22
+ */
23
+ readonly cancel: () => Promise<boolean>;
24
+ /**
25
+ * List the local branches of the Session's checkout.
26
+ * @returns the branches, or undefined when they could not be read.
27
+ */
28
+ readonly branches: () => Promise<ForgeBranches | undefined>;
29
+ }
30
+ /** Full props of the New Session option. */
31
+ export type WorktreeToggleProps = InjectFace<WorktreeToggleInjected> & PropsLocale<typeof NS>;
32
+ /**
33
+ * Render the worktree option while the Session can still start in a worktree:
34
+ * the base branch menu once requested, then the checkbox. When the checkout
35
+ * cannot host a worktree, the tooltip gives the reason and the checkbox only
36
+ * withdraws an open request. Both stay fixed while the worktree is being
37
+ * created.
38
+ * @param props - panel snapshot hook, request actions, and copy.
39
+ * @returns the option, or nothing once a turn started, the request settled, or no worktree service is mounted.
40
+ */
41
+ export declare function WorktreeToggle({ usePanel, request, cancel, branches, t }: WorktreeToggleProps): ReactNode;
42
+ //# sourceMappingURL=WorktreeToggle.d.ts.map
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The changes view's tab type: the right-Sidebar view of one Session's local
3
+ * changes or of one change request bound to it. Its addresses name the Session
4
+ * and the source, `dsh-resource://forge-changes/<session>/local` or
5
+ * `dsh-resource://forge-changes/<session>/change/<url>`, each part
6
+ * percent-encoded; the source names the tab.
7
+ */
8
+ import type { SidebarRightTabDefinition } from '@deepseek-ai/dsh-client-ui-sidebar-right/client';
9
+ import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
10
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
11
+ import type { NS } from './locales.ts';
12
+ /** Kind of the changes tab. */
13
+ export declare const CHANGES_KIND = "forge-changes";
14
+ /** Registry id of the changes tab type, also the key its body and title register under. */
15
+ export declare const CHANGES_ID = "@deepseek-ai/dsh-experimental-client-ui-forge/changes";
16
+ /** What a changes view shows. */
17
+ export type ChangesSource =
18
+ /** The changes of the Session's checkout. */
19
+ {
20
+ readonly kind: 'local';
21
+ }
22
+ /** The changes of one change request bound to the Session, by its binding URL. */
23
+ | {
24
+ readonly kind: 'change';
25
+ readonly url: string;
26
+ };
27
+ /** The Session and the source one address names. */
28
+ export interface ChangesTarget {
29
+ /** Session whose checkout or binding the view reads. */
30
+ readonly sessionId: SessionId;
31
+ /** What the view shows. */
32
+ readonly source: ChangesSource;
33
+ }
34
+ /** Navigation parameters of a changes tab. */
35
+ export interface ChangesParams {
36
+ /** File to scroll to, by its path in the diff. */
37
+ readonly path?: string;
38
+ }
39
+ declare module '@deepseek-ai/dsh-client-ui-sidebar-right/client' {
40
+ interface SidebarRightResourceParamsMap {
41
+ /** The file a changes tab scrolls to. */
42
+ 'forge-changes': ChangesParams;
43
+ }
44
+ }
45
+ /**
46
+ * Mint the address of a changes view.
47
+ * @param target - Session and source.
48
+ * @returns the `dsh-resource://forge-changes/…` address.
49
+ */
50
+ export declare function changesAddress(target: ChangesTarget): string;
51
+ /**
52
+ * Read the Session and source back out of a changes address.
53
+ * @param address - a resource address.
54
+ * @returns the target, or undefined for an address this package did not mint.
55
+ */
56
+ export declare function parseChangesAddress(address: string): ChangesTarget | undefined;
57
+ /**
58
+ * Name a changes view: 变更 for the local changes, #N 的变更 for a change request with a number.
59
+ * @param source - what the view shows.
60
+ * @param t - forge panel copy.
61
+ * @returns the title in the current language.
62
+ */
63
+ export declare function changesTitle(source: ChangesSource, t: TranslateNS<typeof NS>): string;
64
+ /**
65
+ * The changes type's registry definition.
66
+ * @param t - forge panel copy, read on every title call.
67
+ * @returns the definition to register.
68
+ */
69
+ export declare function changesDefinition(t: TranslateNS<typeof NS>): SidebarRightTabDefinition;
70
+ //# sourceMappingURL=changes-address.d.ts.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Choices of each changes tab: the local scope, the side-by-side view, line
3
+ * wrapping, and the navigation it last applied. One bucket per tab, so two
4
+ * views in one Session keep their own choices; the bucket ends with the tab
5
+ * record's signal.
6
+ */
7
+ import { type EngineStoreHandle } from '@deepseek-ai/dsh-client-store';
8
+ import type { ForgeLocalScope } from '../types.ts';
9
+ /** One changes tab's choices. */
10
+ export interface ChangesTabState {
11
+ /** Local changes shown; a change request view ignores it. */
12
+ scope: ForgeLocalScope['kind'];
13
+ /** Whether deletions and additions show in two columns. */
14
+ split: boolean;
15
+ /** Whether long lines wrap instead of being cut at the column edge. */
16
+ wrap: boolean;
17
+ /** The navigation revision last applied, whose file the view scrolled to. */
18
+ navigated: number;
19
+ }
20
+ /** Every changes tab's choices, keyed by tab id. */
21
+ export interface ChangesState {
22
+ byTab: Record<string, ChangesTabState>;
23
+ }
24
+ /** The changes store's write set; every action names the tab it writes. */
25
+ type ChangesActions = {
26
+ navigated: (draft: ChangesState, tabId: string, revision: number) => void;
27
+ scoped: (draft: ChangesState, tabId: string, scope: ForgeLocalScope['kind']) => void;
28
+ toggledSplit: (draft: ChangesState, tabId: string) => void;
29
+ toggledWrap: (draft: ChangesState, tabId: string) => void;
30
+ forget: (draft: ChangesState, tabId: string) => void;
31
+ };
32
+ /**
33
+ * Declare the changes tab's store; the registration declares it as an
34
+ * exclusive store, so the framework mints one instance per Session.
35
+ * @returns the store handle to declare on the registration.
36
+ */
37
+ export declare function createChangesStore(): EngineStoreHandle<ChangesState, ChangesActions>;
38
+ export {};
39
+ //# sourceMappingURL=changes-store.d.ts.map