@deepseek-ai/dsh-experimental-client-ui-forge 0.0.0-stage → 0.2.2-alpha.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 +37 -0
- package/README.md +142 -2
- package/README.zh.md +143 -0
- package/lib/client.js +11802 -0
- package/lib/index.js +3238 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +2502 -0
- package/lib/typert.remote-client.d.ts +85 -0
- package/lib/typert.remote-client.js +1538 -0
- package/lib/types/client/ActionToast.d.ts +14 -0
- package/lib/types/client/ChangeRequestCard.d.ts +56 -0
- package/lib/types/client/ChangedFiles.d.ts +36 -0
- package/lib/types/client/ChangesTab.d.ts +59 -0
- package/lib/types/client/ChangesTabTitle.d.ts +13 -0
- package/lib/types/client/DiffFile.d.ts +76 -0
- package/lib/types/client/FileLabel.d.ts +20 -0
- package/lib/types/client/FileTreePane.d.ts +15 -0
- package/lib/types/client/ForgeTab.d.ts +57 -0
- package/lib/types/client/ForgeTabTitle.d.ts +11 -0
- package/lib/types/client/HeaderButton.d.ts +27 -0
- package/lib/types/client/LocalChangesCard.d.ts +29 -0
- package/lib/types/client/RefreshGlyph.d.ts +18 -0
- package/lib/types/client/ReviewComposer.d.ts +40 -0
- package/lib/types/client/ReviewThread.d.ts +26 -0
- package/lib/types/client/SessionHoverForge.d.ts +20 -0
- package/lib/types/client/SessionRowForge.d.ts +39 -0
- package/lib/types/client/SubmitReview.d.ts +22 -0
- package/lib/types/client/WorktreeProgress.d.ts +44 -0
- package/lib/types/client/WorktreeToggle.d.ts +43 -0
- package/lib/types/client/changes-address.d.ts +70 -0
- package/lib/types/client/changes-store.d.ts +39 -0
- package/lib/types/client/checkout.d.ts +34 -0
- package/lib/types/client/code-selection.d.ts +23 -0
- package/lib/types/client/diff-rows.d.ts +96 -0
- package/lib/types/client/file-tree.d.ts +33 -0
- package/lib/types/client/format.d.ts +21 -0
- package/lib/types/client/glyphs.d.ts +33 -0
- package/lib/types/client/index.d.ts +25 -0
- package/lib/types/client/locales.d.ts +282 -0
- package/lib/types/client/mount.d.ts +17 -0
- package/lib/types/client/review-queue.d.ts +136 -0
- package/lib/types/client/review.d.ts +56 -0
- package/lib/types/client/session-list.d.ts +46 -0
- package/lib/types/client/source.d.ts +146 -0
- package/lib/types/client/status.d.ts +99 -0
- package/lib/types/diff.d.ts +32 -0
- package/lib/types/git.d.ts +93 -0
- package/lib/types/index.d.ts +296 -0
- package/lib/types/local-diff.d.ts +100 -0
- package/lib/types/panel.d.ts +135 -0
- package/lib/types/parse.d.ts +57 -0
- package/lib/types/patch-cache.d.ts +33 -0
- package/lib/types/states.d.ts +95 -0
- package/lib/types/types.d.ts +399 -0
- package/lib/types/worktree.d.ts +225 -0
- package/locale/de.json +6 -0
- package/locale/en.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +123 -3
|
@@ -0,0 +1,43 @@
|
|
|
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 current branch, or the base branch menu once requested, then the checkbox.
|
|
35
|
+
* A blocked request keeps its selected base visible without a menu; the checkbox
|
|
36
|
+
* only withdraws it. Branch details support pointer, touch, and keyboard access.
|
|
37
|
+
* The request stays fixed while the worktree is being created.
|
|
38
|
+
* @param props - panel snapshot hook, request actions, and copy.
|
|
39
|
+
* @returns the option, or nothing outside a known Git checkout, once a turn started,
|
|
40
|
+
* the request settled, or no worktree service is mounted.
|
|
41
|
+
*/
|
|
42
|
+
export declare function WorktreeToggle({ usePanel, request, cancel, branches, t }: WorktreeToggleProps): ReactNode;
|
|
43
|
+
//# 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
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** What the panel's checkout row says about the checkout the Session works in. */
|
|
2
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { ForgePanelState } from '../types.ts';
|
|
4
|
+
import type { NS } from './locales.ts';
|
|
5
|
+
type Translate = PropsLocale<typeof NS>['t'];
|
|
6
|
+
/** Facts the checkout row shows. */
|
|
7
|
+
export interface CheckoutLabel {
|
|
8
|
+
/** Branch name, the abbreviated commit while HEAD is detached, or null when HEAD has no commit. */
|
|
9
|
+
readonly name: string | null;
|
|
10
|
+
/** Whether HEAD is detached. */
|
|
11
|
+
readonly detached: boolean;
|
|
12
|
+
/** Kind of directory: a worktree with its base, another worktree, the project directory, or a removed worktree. */
|
|
13
|
+
readonly kind: string;
|
|
14
|
+
/** The kind with the directory path, home abbreviated to `~`. */
|
|
15
|
+
readonly tooltip: string;
|
|
16
|
+
/** Whether the worktree the Session works in is gone. */
|
|
17
|
+
readonly missing: boolean;
|
|
18
|
+
/** Full path of the directory, home not abbreviated; a removed worktree keeps the path it was created at. */
|
|
19
|
+
readonly path: string;
|
|
20
|
+
/** Whether the directory is a worktree rather than the project directory. */
|
|
21
|
+
readonly worktree: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Describe the checkout of a Session. A worktree this panel created names its
|
|
25
|
+
* base; any other linked worktree is a worktree, and the main checkout is the
|
|
26
|
+
* project directory. A removed worktree keeps its branch name.
|
|
27
|
+
* @param state - panel state.
|
|
28
|
+
* @param home - Host account home, or undefined to show full paths.
|
|
29
|
+
* @param t - forge panel copy.
|
|
30
|
+
* @returns the label, or undefined before a successful inspection.
|
|
31
|
+
*/
|
|
32
|
+
export declare function checkoutLabel(state: ForgePanelState, home: string | undefined, t: Translate): CheckoutLabel | undefined;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=checkout.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Read browser text selections from one diff side without including the interleaved opposite column. */
|
|
2
|
+
/** Selected displayed lines and the exact selected text on their side. */
|
|
3
|
+
export interface CodeSelection {
|
|
4
|
+
readonly side: 'L' | 'R';
|
|
5
|
+
readonly from: number;
|
|
6
|
+
readonly to: number;
|
|
7
|
+
readonly text: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Find the side where a text selection begins; unified context belongs to the new side.
|
|
11
|
+
* @param root - this file's diff element.
|
|
12
|
+
* @param node - pointer or selection anchor.
|
|
13
|
+
* @returns the available side, or undefined outside code text.
|
|
14
|
+
*/
|
|
15
|
+
export declare function codeSideAt(root: HTMLElement, node: Node | null): 'L' | 'R' | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Read only code fragments from the selected side, retaining partial first and last lines for copy.
|
|
18
|
+
* @param root - this file's diff element.
|
|
19
|
+
* @param side - side captured when the gesture began.
|
|
20
|
+
* @returns the selected range and text, or undefined for collapsed or cross-file selections.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readCodeSelection(root: HTMLElement, side: 'L' | 'R'): CodeSelection | undefined;
|
|
23
|
+
//# sourceMappingURL=code-selection.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drawn rows of one file diff: numbered patch lines, their side-by-side
|
|
3
|
+
* pairing, and the unchanged lines between hunks, which stay collapsed until
|
|
4
|
+
* the file's new side supplies them.
|
|
5
|
+
*/
|
|
6
|
+
import type { ForgeDiffFile, ForgeDiffHunk } from '../types.ts';
|
|
7
|
+
/** One drawn line with its number on each side that has it. */
|
|
8
|
+
export type DiffRow = {
|
|
9
|
+
readonly kind: 'add';
|
|
10
|
+
readonly old: null;
|
|
11
|
+
readonly new: number;
|
|
12
|
+
readonly text: string;
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: 'del';
|
|
15
|
+
readonly old: number;
|
|
16
|
+
readonly new: null;
|
|
17
|
+
readonly text: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: 'context';
|
|
20
|
+
readonly old: number;
|
|
21
|
+
readonly new: number;
|
|
22
|
+
readonly text: string;
|
|
23
|
+
};
|
|
24
|
+
/** One side of a side-by-side row. */
|
|
25
|
+
export interface SplitCell {
|
|
26
|
+
readonly kind: DiffRow['kind'];
|
|
27
|
+
readonly no: number;
|
|
28
|
+
readonly text: string;
|
|
29
|
+
}
|
|
30
|
+
/** One side-by-side row; a side without a line is null. */
|
|
31
|
+
export interface SplitRow {
|
|
32
|
+
readonly left: SplitCell | null;
|
|
33
|
+
readonly right: SplitCell | null;
|
|
34
|
+
}
|
|
35
|
+
/** A run of drawn rows, or unchanged lines drawn as one row that expands them. */
|
|
36
|
+
export type DiffSegment = {
|
|
37
|
+
readonly kind: 'rows';
|
|
38
|
+
readonly rows: readonly DiffRow[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* `index` is the hunk the lines precede, or the hunk count for the lines after the last hunk;
|
|
42
|
+
* `count` is null while the length of the file is unknown.
|
|
43
|
+
*/
|
|
44
|
+
| {
|
|
45
|
+
readonly kind: 'gap';
|
|
46
|
+
readonly index: number;
|
|
47
|
+
readonly count: number | null;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Number the lines of a hunk. Context lines count on both sides, deletions on
|
|
51
|
+
* the old side, and additions on the new side; a ``
|
|
52
|
+
* marker is not a line.
|
|
53
|
+
* @param hunk - one hunk.
|
|
54
|
+
* @returns the rows in patch order.
|
|
55
|
+
*/
|
|
56
|
+
export declare function hunkRows(hunk: ForgeDiffHunk): DiffRow[];
|
|
57
|
+
/**
|
|
58
|
+
* Pair rows for the side-by-side view: each run of deletions sits beside the
|
|
59
|
+
* run of additions that follows it, row by row, and context rows fill both sides.
|
|
60
|
+
* @param rows - rows in patch order.
|
|
61
|
+
* @returns the paired rows.
|
|
62
|
+
*/
|
|
63
|
+
export declare function splitRows(rows: readonly DiffRow[]): SplitRow[];
|
|
64
|
+
/**
|
|
65
|
+
* Split file text into lines as a patch numbers them; a final line ending ends the last line.
|
|
66
|
+
* @param text - the file text.
|
|
67
|
+
* @returns the lines with any carriage returns kept.
|
|
68
|
+
*/
|
|
69
|
+
export declare function textLines(text: string): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Whether file text is the new side the hunks describe: every context and
|
|
72
|
+
* added line sits at its number. A file changed after its diff was read fails.
|
|
73
|
+
* @param lines - the file's lines.
|
|
74
|
+
* @param hunks - hunks of the file's diff.
|
|
75
|
+
* @returns whether the lines match.
|
|
76
|
+
*/
|
|
77
|
+
export declare function matchesHunks(lines: readonly string[], hunks: readonly ForgeDiffHunk[]): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Lay out one file as runs of rows separated by collapsed unchanged lines.
|
|
80
|
+
* Unchanged lines before a hunk, between hunks, and after the last hunk
|
|
81
|
+
* collapse into one gap each; an open gap draws its lines from `lines` once
|
|
82
|
+
* they are known. The lines after the last hunk are unknown until `lines`
|
|
83
|
+
* arrives, unless the file is new, deleted, or its last hunk reaches its end.
|
|
84
|
+
* @param file - one file of a diff.
|
|
85
|
+
* @param lines - the file's new side, which {@link matchesHunks} accepted, or undefined while it has not been read.
|
|
86
|
+
* @param open - indexes of the gaps the user expanded.
|
|
87
|
+
* @returns the segments in file order.
|
|
88
|
+
*/
|
|
89
|
+
export declare function segmentsOf(file: ForgeDiffFile, lines: readonly string[] | undefined, open: ReadonlySet<number>): DiffSegment[];
|
|
90
|
+
/**
|
|
91
|
+
* Count the rows a file's hunks draw.
|
|
92
|
+
* @param file - one file of a diff.
|
|
93
|
+
* @returns the number of context, added, and deleted lines in its hunks.
|
|
94
|
+
*/
|
|
95
|
+
export declare function drawnLines(file: ForgeDiffFile): number;
|
|
96
|
+
//# sourceMappingURL=diff-rows.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ForgeDiffFile } from '../types.ts';
|
|
2
|
+
/** A changed file or a compacted chain of directories containing changed files. */
|
|
3
|
+
export type ChangedFileNode = {
|
|
4
|
+
readonly kind: 'file';
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly file: ForgeDiffFile;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'directory';
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly children: readonly ChangedFileNode[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Build a directory-first tree, compacting directories with a single directory child.
|
|
16
|
+
* @param files - changed files; Git paths use forward slashes, including on Windows.
|
|
17
|
+
* @returns the root's children in stable name order.
|
|
18
|
+
*/
|
|
19
|
+
export declare function changedFileTree(files: readonly ForgeDiffFile[]): readonly ChangedFileNode[];
|
|
20
|
+
/**
|
|
21
|
+
* Read every file in the tree's depth-first display order, independent of navigation folds and filtering.
|
|
22
|
+
* @param nodes - the complete directory-first tree.
|
|
23
|
+
* @returns the original file objects in display order.
|
|
24
|
+
*/
|
|
25
|
+
export declare function filesInTreeOrder(nodes: readonly ChangedFileNode[]): readonly ForgeDiffFile[];
|
|
26
|
+
/**
|
|
27
|
+
* Keep matching files and their ancestors without changing directory identities.
|
|
28
|
+
* @param nodes - the complete compacted tree.
|
|
29
|
+
* @param query - case-insensitive text matched against current and previous paths.
|
|
30
|
+
* @returns matching branches, or the original tree for an empty query.
|
|
31
|
+
*/
|
|
32
|
+
export declare function filterFileTree(nodes: readonly ChangedFileNode[], query: string): readonly ChangedFileNode[];
|
|
33
|
+
//# sourceMappingURL=file-tree.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Localized durations and relative times shown on change request cards. */
|
|
2
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { NS } from './locales.ts';
|
|
4
|
+
type Translate = PropsLocale<typeof NS>['t'];
|
|
5
|
+
/**
|
|
6
|
+
* Format an elapsed time as hours and minutes, minutes and seconds, or seconds.
|
|
7
|
+
* @param ms - elapsed milliseconds.
|
|
8
|
+
* @param t - forge panel copy.
|
|
9
|
+
* @returns the localized duration.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatDuration(ms: number, t: Translate): string;
|
|
12
|
+
/**
|
|
13
|
+
* Format how long ago an ISO 8601 time was.
|
|
14
|
+
* @param iso - the time.
|
|
15
|
+
* @param now - current epoch milliseconds.
|
|
16
|
+
* @param t - forge panel copy.
|
|
17
|
+
* @returns the localized relative time, or undefined when `iso` does not parse.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatAgo(iso: string, now: number, t: Translate): string | undefined;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Lifecycle glyphs of change requests and outcome glyphs of their checks. */
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { CheckState } from '@deepseek-ai/dsh-experimental-forge/types';
|
|
4
|
+
import type { ChangeRequestTone } from './status.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Draw a change request in its lifecycle shape: open, open with a cross for
|
|
7
|
+
* one that needs its author, draft, merged, closed, or the open shape for an
|
|
8
|
+
* unknown state.
|
|
9
|
+
* @param props.tone - lifecycle state that picks the shape and, when tinted, the color.
|
|
10
|
+
* @param props.tinted - whether the state picks the color; otherwise the glyph uses the current text color.
|
|
11
|
+
* @param props.size - width and height in pixels, 15 by default.
|
|
12
|
+
* @param props.label - accessible name; omit it for a decorative glyph.
|
|
13
|
+
* @returns the SVG glyph.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ChangeRequestGlyph({ tone, tinted, size, label }: {
|
|
16
|
+
readonly tone: ChangeRequestTone;
|
|
17
|
+
readonly tinted?: boolean | undefined;
|
|
18
|
+
readonly size?: number | undefined;
|
|
19
|
+
readonly label?: string | undefined;
|
|
20
|
+
}): ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Draw the decorative outcome of one check beside its text: a filled circle
|
|
23
|
+
* for success or failure, a half-filled ring while it runs, and an empty ring
|
|
24
|
+
* for neutral, skipped, and cancelled checks.
|
|
25
|
+
* @param props.state - check outcome.
|
|
26
|
+
* @param props.size - width and height in pixels, 16 by default.
|
|
27
|
+
* @returns the glyph.
|
|
28
|
+
*/
|
|
29
|
+
export declare function CheckGlyph({ state, size }: {
|
|
30
|
+
readonly state: CheckState;
|
|
31
|
+
readonly size?: number | undefined;
|
|
32
|
+
}): ReactNode;
|
|
33
|
+
//# sourceMappingURL=glyphs.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser entry of the forge panel: the sidebar tab, the changes view, the
|
|
3
|
+
* header button, the worktree option and creation card, and their Remote.
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
export { inject } from './mount.ts';
|
|
7
|
+
export type { ForgePanelKey } from './locales.ts';
|
|
8
|
+
export type { ChangeRequestActions, ChangeRequestCardProps } from './ChangeRequestCard.tsx';
|
|
9
|
+
export type { ChangesParams, ChangesSource, ChangesTarget } from './changes-address.ts';
|
|
10
|
+
export type { ChangesTabInjected, ChangesTabProps } from './ChangesTab.tsx';
|
|
11
|
+
export type { ChangesTabTitleProps } from './ChangesTabTitle.tsx';
|
|
12
|
+
export type { DiffFileAction, DiffFileProps, DiffFileText } from './DiffFile.tsx';
|
|
13
|
+
export type { LocalChangesCardProps } from './LocalChangesCard.tsx';
|
|
14
|
+
export type { ForgeTabInjected, ForgeTabProps } from './ForgeTab.tsx';
|
|
15
|
+
export type { HeaderButtonInjected, HeaderButtonProps } from './HeaderButton.tsx';
|
|
16
|
+
export type { WorktreeProgressInjected, WorktreeProgressProps } from './WorktreeProgress.tsx';
|
|
17
|
+
export type { WorktreeToggleInjected, WorktreeToggleProps } from './WorktreeToggle.tsx';
|
|
18
|
+
export type { ActionNotice, NoticeOptions, PanelSnapshot } from './source.ts';
|
|
19
|
+
/**
|
|
20
|
+
* Mount the forge panel Remote and its UI.
|
|
21
|
+
* @param ctx - browser plugin context.
|
|
22
|
+
* @returns the disposer that withdraws the UI, then the Remote.
|
|
23
|
+
*/
|
|
24
|
+
export declare function apply(ctx: Context): Promise<() => Promise<void>>;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|