@achasoft/dsh-advanced-sidebar 0.1.0
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.md +205 -0
- package/cordis.patch.yml +158 -0
- package/lib/client.js +24890 -0
- package/lib/client.js.map +1 -0
- package/lib/host.js +3156 -0
- package/lib/index.js +20 -0
- package/lib/remote.js +1994 -0
- package/lib/typert.host.js +2000 -0
- package/package.json +136 -0
- package/types/client/ActionMenu.d.ts +36 -0
- package/types/client/Glyphs.d.ts +49 -0
- package/types/client/PanelHost.d.ts +24 -0
- package/types/client/Seats.d.ts +16 -0
- package/types/client/SettingsCard.d.ts +22 -0
- package/types/client/contract.d.ts +358 -0
- package/types/client/controller.d.ts +224 -0
- package/types/client/cx.d.ts +16 -0
- package/types/client/index.d.ts +39 -0
- package/types/client/locales.d.ts +474 -0
- package/types/client/panels/ChangesPanel.d.ts +22 -0
- package/types/client/panels/FilesPanel.d.ts +16 -0
- package/types/client/panels/PreviewPanel.d.ts +27 -0
- package/types/client/panels/TasksPanel.d.ts +28 -0
- package/types/client/panels/TerminalPanel.d.ts +40 -0
- package/types/client/panels/shared.d.ts +65 -0
- package/types/client/target.d.ts +23 -0
- package/types/client/terminal-screen.d.ts +95 -0
- package/types/client/ui/Alert.d.ts +30 -0
- package/types/client/ui/Badge.d.ts +24 -0
- package/types/client/ui/Button.d.ts +28 -0
- package/types/client/ui/Calendar.d.ts +65 -0
- package/types/client/ui/DatePicker.d.ts +41 -0
- package/types/client/ui/Dialog.d.ts +61 -0
- package/types/client/ui/DropdownMenu.d.ts +98 -0
- package/types/client/ui/Input.d.ts +25 -0
- package/types/client/ui/Layer.d.ts +56 -0
- package/types/client/ui/Select.d.ts +49 -0
- package/types/client/ui/Separator.d.ts +15 -0
- package/types/client/ui/Tabs.d.ts +49 -0
- package/types/client/ui/Toggle.d.ts +57 -0
- package/types/client/ui/Tooltip.d.ts +22 -0
- package/types/client/ui/anchor.d.ts +92 -0
- package/types/client/ui/index.d.ts +42 -0
- package/types/client/use-capability.d.ts +27 -0
- package/types/host/deletion.d.ts +57 -0
- package/types/host/files.d.ts +43 -0
- package/types/host/git.d.ts +198 -0
- package/types/host/index.d.ts +210 -0
- package/types/host/open-in.d.ts +93 -0
- package/types/host/paths.d.ts +55 -0
- package/types/host/porcelain.d.ts +51 -0
- package/types/host/preview.d.ts +185 -0
- package/types/host/run.d.ts +72 -0
- package/types/host/tasks.d.ts +80 -0
- package/types/host/terminals.d.ts +86 -0
- package/types/host/types.d.ts +877 -0
- package/types/index.d.ts +17 -0
package/package.json
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@achasoft/dsh-advanced-sidebar",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Advanced sidebar operations for the DeepSeek Harness Web Client: git changes, multi-session terminals, a file browser, a dev-server preview, background tasks, Open in, Archive and Delete, in a resizable dock beside the conversation",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"types",
|
|
11
|
+
"cordis.patch.yml",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./types/index.d.ts",
|
|
18
|
+
"default": "./lib/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./host": {
|
|
21
|
+
"types": "./types/host/index.d.ts",
|
|
22
|
+
"default": "./lib/host.js"
|
|
23
|
+
},
|
|
24
|
+
"./client": {
|
|
25
|
+
"default": "./lib/client.js"
|
|
26
|
+
},
|
|
27
|
+
"./typert": {
|
|
28
|
+
"default": "./lib/typert.host.js"
|
|
29
|
+
},
|
|
30
|
+
"./remote": {
|
|
31
|
+
"default": "./lib/remote.js"
|
|
32
|
+
},
|
|
33
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"dsh": {
|
|
37
|
+
"bundle": {
|
|
38
|
+
"patch": "./cordis.patch.yml"
|
|
39
|
+
},
|
|
40
|
+
"client": {
|
|
41
|
+
"platform": "web",
|
|
42
|
+
"inject": [
|
|
43
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
44
|
+
"@deepseek-ai/dsh-client-locale",
|
|
45
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
48
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc -p tsconfig.build.json && tsdown",
|
|
54
|
+
"prepare": "tsc -p tsconfig.build.json && tsdown",
|
|
55
|
+
"typecheck": "tsc --noEmit",
|
|
56
|
+
"test": "node scripts/check-typert.mjs && vitest run",
|
|
57
|
+
"check:typert": "node scripts/check-typert.mjs",
|
|
58
|
+
"regen:typert": "node scripts/emit-typert.mjs"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@deepseek-ai/cordis": "*",
|
|
62
|
+
"@deepseek-ai/dsh-agent": "*",
|
|
63
|
+
"@deepseek-ai/dsh-agent-default-model": "*",
|
|
64
|
+
"@deepseek-ai/dsh-fs": "*",
|
|
65
|
+
"@deepseek-ai/dsh-jobs": "*",
|
|
66
|
+
"@deepseek-ai/dsh-llm": "*",
|
|
67
|
+
"@deepseek-ai/dsh-session": "*",
|
|
68
|
+
"@deepseek-ai/dsh-session-persistence": "*",
|
|
69
|
+
"@deepseek-ai/dsh-settings": "*",
|
|
70
|
+
"@deepseek-ai/dsh-subprocess": "*",
|
|
71
|
+
"@deepseek-ai/dsh-typert-protocol": "*",
|
|
72
|
+
"@deepseek-ai/dsh-workspace": "*",
|
|
73
|
+
"@deepseek-ai/schemastery": "*"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@xterm/addon-fit": "^0.11.0",
|
|
77
|
+
"@xterm/xterm": "^6.0.0",
|
|
78
|
+
"zod": "^4.4.3"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@deepseek-ai/cordis": "link:../../deepseek-harness/vendor/cordis",
|
|
82
|
+
"@deepseek-ai/dsh-agent": "link:../../deepseek-harness/packages/core/agent",
|
|
83
|
+
"@deepseek-ai/dsh-agent-default-model": "link:../../deepseek-harness/packages/core/agent-default-model",
|
|
84
|
+
"@deepseek-ai/dsh-api-remotes": "link:../../deepseek-harness/packages/api/remotes",
|
|
85
|
+
"@deepseek-ai/dsh-client-locale": "link:../../deepseek-harness/packages/client/locale",
|
|
86
|
+
"@deepseek-ai/dsh-client-runtime": "link:../../deepseek-harness/packages/client/runtime",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-conversation": "link:../../deepseek-harness/packages/client/ui-conversation",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-layout": "link:../../deepseek-harness/packages/client/ui-layout",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-primitives": "link:../../deepseek-harness/packages/client/ui-primitives",
|
|
90
|
+
"@deepseek-ai/dsh-client-ui-settings": "link:../../deepseek-harness/packages/client/ui-settings",
|
|
91
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "link:../../deepseek-harness/packages/client/ui-settings-plugins",
|
|
92
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "link:../../deepseek-harness/packages/client/ui-sidebar",
|
|
93
|
+
"@deepseek-ai/dsh-client-ui-slots": "link:../../deepseek-harness/packages/client/ui-slots",
|
|
94
|
+
"@deepseek-ai/dsh-client-ui-theme": "link:../../deepseek-harness/packages/client/ui-theme",
|
|
95
|
+
"@deepseek-ai/dsh-fs": "link:../../deepseek-harness/packages/fs/fs",
|
|
96
|
+
"@deepseek-ai/dsh-jobs": "link:../../deepseek-harness/packages/jobs/jobs",
|
|
97
|
+
"@deepseek-ai/dsh-llm": "link:../../deepseek-harness/packages/llm/llm",
|
|
98
|
+
"@deepseek-ai/dsh-session": "link:../../deepseek-harness/packages/core/session",
|
|
99
|
+
"@deepseek-ai/dsh-session-persistence": "link:../../deepseek-harness/packages/session/session-persistence",
|
|
100
|
+
"@deepseek-ai/dsh-settings": "link:../../deepseek-harness/packages/settings/settings",
|
|
101
|
+
"@deepseek-ai/dsh-subprocess": "link:../../deepseek-harness/packages/subprocess/subprocess",
|
|
102
|
+
"@deepseek-ai/dsh-typert-protocol": "link:../../deepseek-harness/packages/typert/protocol",
|
|
103
|
+
"@deepseek-ai/dsh-workspace": "link:../../deepseek-harness/packages/workspace/workspace",
|
|
104
|
+
"@deepseek-ai/schemastery": "link:../../deepseek-harness/vendor/schemastery",
|
|
105
|
+
"@types/node": "^22.20.1",
|
|
106
|
+
"@types/react": "~18.3.1",
|
|
107
|
+
"@types/react-dom": "^18.3.7",
|
|
108
|
+
"lightningcss": "^1.30.1",
|
|
109
|
+
"react": "^18.2.0",
|
|
110
|
+
"tsdown": "^0.15.6",
|
|
111
|
+
"typescript": "^5.9.2",
|
|
112
|
+
"vitest": "^3.2.7"
|
|
113
|
+
},
|
|
114
|
+
"publishConfig": {
|
|
115
|
+
"access": "public"
|
|
116
|
+
},
|
|
117
|
+
"repository": {
|
|
118
|
+
"type": "git",
|
|
119
|
+
"url": "git+https://github.com/navid-kianfar/dsh-advanced-sidebar.git"
|
|
120
|
+
},
|
|
121
|
+
"keywords": [
|
|
122
|
+
"deepseek-harness",
|
|
123
|
+
"dsh",
|
|
124
|
+
"dsh-plugin",
|
|
125
|
+
"sidebar",
|
|
126
|
+
"git",
|
|
127
|
+
"terminal",
|
|
128
|
+
"file-browser",
|
|
129
|
+
"background-tasks",
|
|
130
|
+
"cordis"
|
|
131
|
+
],
|
|
132
|
+
"types": "./types/index.d.ts",
|
|
133
|
+
"engines": {
|
|
134
|
+
"node": "^22.19 || >=24"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The advanced-operations menu itself, in the session header.
|
|
3
|
+
*
|
|
4
|
+
* Entries are built from two independent facts: what the settings section switched on, and what the
|
|
5
|
+
* Host reported it can serve. A switched-off entry is absent; an entry the Host cannot serve is
|
|
6
|
+
* present but disabled and carries the reason beside its label, because a person who configured an
|
|
7
|
+
* editor and sees no row cannot tell a typo from a feature that does not exist.
|
|
8
|
+
* @module @achasoft/dsh-advanced-sidebar/client/ActionMenu
|
|
9
|
+
*/
|
|
10
|
+
import type { AdvancedSidebarSettings, AdvancedSidebarView } from '../host/types.ts';
|
|
11
|
+
import type { MenuInjected, Translate } from './contract.ts';
|
|
12
|
+
import type { OperationTarget, PanelKind } from './controller.ts';
|
|
13
|
+
/** Everything the menu renders from, plus the callbacks it fires. */
|
|
14
|
+
export interface ActionMenuProps {
|
|
15
|
+
/** The session and directory every entry acts on; absent disables everything but the trigger. */
|
|
16
|
+
target: OperationTarget | undefined;
|
|
17
|
+
/** The resolved settings section; absent while the scope is still loading. */
|
|
18
|
+
settings: AdvancedSidebarSettings | undefined;
|
|
19
|
+
/** The Host capability view; absent until the first probe answers. */
|
|
20
|
+
view: AdvancedSidebarView | undefined;
|
|
21
|
+
/** The namespace translator. */
|
|
22
|
+
t: Translate;
|
|
23
|
+
/** Business callbacks, minus the reactive sources the seat binds itself. */
|
|
24
|
+
actions: Pick<MenuInjected, 'openPanel' | 'openIn' | 'openWindow' | 'archive' | 'requestDelete'>;
|
|
25
|
+
/** Ask the Host for a fresh capability view; called each time the menu opens. */
|
|
26
|
+
refresh: () => void;
|
|
27
|
+
/** Which panel the dock is showing, so the open entry reads as the current one. */
|
|
28
|
+
openPanel: PanelKind | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The trigger plus its menu.
|
|
32
|
+
* @param props - the target, settings, capability view, translator, and callbacks.
|
|
33
|
+
* @returns the menu element, or null when the settings section leaves it with no entries.
|
|
34
|
+
* @see {@link ActionMenuProps}
|
|
35
|
+
*/
|
|
36
|
+
export declare function ActionMenu(props: ActionMenuProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The glyphs this plugin draws itself, because the client's icon set has no member for them.
|
|
3
|
+
* Each is a 16×16 outline on `currentColor` at the icon family's stroke weight, so a menu mixing
|
|
4
|
+
* these with set icons reads as one row of icons.
|
|
5
|
+
* @module @achasoft/dsh-advanced-sidebar/client/Glyphs
|
|
6
|
+
*/
|
|
7
|
+
/** Props every glyph accepts; `size` overrides the 16px default for a denser row. */
|
|
8
|
+
export interface GlyphProps {
|
|
9
|
+
/** Edge length in pixels. */
|
|
10
|
+
size?: number;
|
|
11
|
+
/** Optional class, for a seat that colors or spaces its icons. */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A page with a folded corner: one file.
|
|
16
|
+
* @param props - size and class overrides.
|
|
17
|
+
* @returns the glyph element.
|
|
18
|
+
*/
|
|
19
|
+
export declare function FileGlyph({ size, className }: GlyphProps): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* A window with a prompt caret: a terminal.
|
|
22
|
+
* @param props - size and class overrides.
|
|
23
|
+
* @returns the glyph element.
|
|
24
|
+
*/
|
|
25
|
+
export declare function TerminalGlyph({ size, className }: GlyphProps): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Two file cards with a plus and a minus: changed files.
|
|
28
|
+
* @param props - size and class overrides.
|
|
29
|
+
* @returns the glyph element.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ChangesGlyph({ size, className }: GlyphProps): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* A browser window with a play mark: a running application.
|
|
34
|
+
* @param props - size and class overrides.
|
|
35
|
+
* @returns the glyph element.
|
|
36
|
+
*/
|
|
37
|
+
export declare function PreviewGlyph({ size, className }: GlyphProps): import("react").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* A browser window pushed out of a frame: open somewhere else.
|
|
40
|
+
* @param props - size and class overrides.
|
|
41
|
+
* @returns the glyph element.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ExternalGlyph({ size, className }: GlyphProps): import("react").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* An arrow leaving a branch line: a push.
|
|
46
|
+
* @param props - size and class overrides.
|
|
47
|
+
* @returns the glyph element.
|
|
48
|
+
*/
|
|
49
|
+
export declare function PushGlyph({ size, className }: GlyphProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dock: a resizable column on the right of the frame holding whichever panel is open, plus the
|
|
3
|
+
* notice line and the Delete confirmation.
|
|
4
|
+
*
|
|
5
|
+
* It was a floating card. It is now a real column — it reserves its own width on the app frame, so
|
|
6
|
+
* the conversation shrinks beside it instead of disappearing under it, and it carries a drag handle
|
|
7
|
+
* on its left edge like the frame's own two columns. The reservation is a padding on the frame
|
|
8
|
+
* element and a matching shift of the frame's details handle, both keyed on one custom property
|
|
9
|
+
* this component sets: `shell.overlay` is the only additive frame-wide seat a plugin has, and its
|
|
10
|
+
* layer is drawn above the columns rather than between them.
|
|
11
|
+
*
|
|
12
|
+
* Below a frame narrow enough that pushing would leave no conversation, the dock floats over it
|
|
13
|
+
* instead. That is the same concession every editor makes at that width, and it is derived from the
|
|
14
|
+
* frame's measured box rather than from a media query, because the frame is not the window.
|
|
15
|
+
* @module @achasoft/dsh-advanced-sidebar/client/PanelHost
|
|
16
|
+
*/
|
|
17
|
+
import type { PanelHostProps } from './contract.ts';
|
|
18
|
+
/**
|
|
19
|
+
* The dock, the notice, and the confirmation dialog.
|
|
20
|
+
* @param props - the standard kit plus this plugin's face.
|
|
21
|
+
* @returns the overlay tree, or null while nothing is open.
|
|
22
|
+
* @see {@link PanelHostProps}
|
|
23
|
+
*/
|
|
24
|
+
export declare function PanelHost(props: PanelHostProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The menu seat: the session header's utilities row.
|
|
3
|
+
*
|
|
4
|
+
* There was a second seat at the sidebar foot. It was withdrawn — the same menu in two places gave
|
|
5
|
+
* the column an action whose target was whatever session happened to be current, which is not what
|
|
6
|
+
* a column of sessions reads as; the header's menu acts on the session it sits in.
|
|
7
|
+
* @module @achasoft/dsh-advanced-sidebar/client/Seats
|
|
8
|
+
*/
|
|
9
|
+
import type { HeaderMenuProps } from './contract.ts';
|
|
10
|
+
/**
|
|
11
|
+
* The session header's trigger. Session-scoped, so the framework supplies the session id.
|
|
12
|
+
* @param props - the standard kit for a session seat plus this plugin's face.
|
|
13
|
+
* @returns the trigger and its menu, or null while the settings section switches it off.
|
|
14
|
+
* @see {@link HeaderMenuProps}
|
|
15
|
+
*/
|
|
16
|
+
export declare function HeaderMenu(props: HeaderMenuProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The advanced-sidebar card on the plugin-configuration tab.
|
|
3
|
+
*
|
|
4
|
+
* It reproduces the configuration section's own chrome — an `<li>` disclosure card, and fields laid
|
|
5
|
+
* out label / control / hint — because it cannot import those components: value-importing across a
|
|
6
|
+
* plugin boundary fails the client bundle-purity gate. The controls themselves come from this
|
|
7
|
+
* package's own shadcn-vocabulary kit, so the card matches the panels rather than the browser's
|
|
8
|
+
* default form widgets.
|
|
9
|
+
*
|
|
10
|
+
* There is no save or discard. Every control writes immediately through the bound settings scope,
|
|
11
|
+
* which owns revision fencing, so the card carries no staged form whose unsaved state would need
|
|
12
|
+
* reporting.
|
|
13
|
+
* @module @achasoft/dsh-advanced-sidebar/client/SettingsCard
|
|
14
|
+
*/
|
|
15
|
+
import type { SettingsCardProps } from './contract.ts';
|
|
16
|
+
/**
|
|
17
|
+
* The card, its four groups of fields, and the Open in roster.
|
|
18
|
+
* @param props - the standard kit plus this plugin's face.
|
|
19
|
+
* @returns the card element.
|
|
20
|
+
* @see {@link SettingsCardProps}
|
|
21
|
+
*/
|
|
22
|
+
export declare function SettingsCard(props: SettingsCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The registrant-side contracts of this plugin's four slot entries: what each component is handed,
|
|
3
|
+
* and the props type it composes from the framework's shares.
|
|
4
|
+
*
|
|
5
|
+
* Each face is the whole business surface of one seat. Components never reach a cordis service —
|
|
6
|
+
* the `apply` closes over `ctx` and hands plain callbacks down, which is what lets every one of
|
|
7
|
+
* these render in a test with no context at all.
|
|
8
|
+
* @module @achasoft/dsh-advanced-sidebar/client/contract
|
|
9
|
+
*/
|
|
10
|
+
import type { SettingsScope } from '@deepseek-ai/dsh-client-runtime/client';
|
|
11
|
+
import type { InjectFace, PropsLocale, PropsRuntime, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
|
|
12
|
+
import type { AdvancedSidebarSettings, AdvancedSidebarView, DeleteSessionResult, GitCommitMessageResult, GitCommitResult, GitDiffRequest, GitDiffResult, GitPushResult, GitStageResult, GitStatusResult, ListEntriesResult, PreviewListResult, PreviewLogsResult, PreviewStartResult, PreviewStopResult, ReadFileResult, TaskKillResult, TaskOutputResult, TerminalAckResult, TerminalOpenResult, TerminalReadResult } from '../host/types.ts';
|
|
13
|
+
import type { OperationTarget, PanelController, PanelKind } from './controller.ts';
|
|
14
|
+
import type { AdvancedSidebarKey } from './locales.ts';
|
|
15
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
16
|
+
interface LocaleNamespaceMap {
|
|
17
|
+
/** Copy of the session menu, the dock's five panels, the delete dialog, and the settings card. */
|
|
18
|
+
advancedSidebar: AdvancedSidebarKey;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This package's translator, declared once so every component types its `t` seat from the same
|
|
23
|
+
* place as the framework-synthesized one.
|
|
24
|
+
*/
|
|
25
|
+
export type Translate = TranslateNS<'advancedSidebar'>;
|
|
26
|
+
/** The dictionary namespace this plugin owns; also its settings namespace's camelCase twin. */
|
|
27
|
+
export declare const LOCALE_NS = "advancedSidebar";
|
|
28
|
+
/** The settings namespace the Host section is registered under (kebab-case, as that grammar requires). */
|
|
29
|
+
export declare const SETTINGS_NS = "advanced-sidebar";
|
|
30
|
+
/** The Remote namespace, read as `ctx.remote.advancedSidebar.…`. */
|
|
31
|
+
export declare const REMOTE_NS = "advancedSidebar";
|
|
32
|
+
/** Everything the session header's menu seat needs. */
|
|
33
|
+
export interface MenuInjected {
|
|
34
|
+
/** Registrant-private reactive sources the renderer binds to `use<Name>` hooks. */
|
|
35
|
+
hooks: {
|
|
36
|
+
/** Cross-registration panel state; the menu writes it and the dock reads it. */
|
|
37
|
+
sidebar: PanelController;
|
|
38
|
+
/** The bound `advanced-sidebar` settings scope, which decides the menu's entries. */
|
|
39
|
+
settings: SettingsScope<AdvancedSidebarSettings>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Read the Host's capability view so an entry can be disabled with a reason.
|
|
43
|
+
* @param signal - cancellation for the probe.
|
|
44
|
+
* @returns the capability view.
|
|
45
|
+
*/
|
|
46
|
+
describe: (signal?: AbortSignal) => Promise<AdvancedSidebarView>;
|
|
47
|
+
/**
|
|
48
|
+
* Show one panel in the dock.
|
|
49
|
+
* @param panel - which panel.
|
|
50
|
+
* @param target - the session and directory it acts on.
|
|
51
|
+
*/
|
|
52
|
+
openPanel: (panel: PanelKind, target: OperationTarget) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Hand one path to an Open in target.
|
|
55
|
+
* @param targetId - the target's id.
|
|
56
|
+
* @param path - the absolute Host path.
|
|
57
|
+
* @returns after the launch settled; a failure surfaces as a notice.
|
|
58
|
+
*/
|
|
59
|
+
openIn: (targetId: string, path: string) => Promise<void>;
|
|
60
|
+
/** Open the Web Client in a second browser window. */
|
|
61
|
+
openWindow: () => void;
|
|
62
|
+
/**
|
|
63
|
+
* Archive one session.
|
|
64
|
+
* @param target - the session to hide.
|
|
65
|
+
* @returns after the registry committed; a failure surfaces as a notice.
|
|
66
|
+
*/
|
|
67
|
+
archive: (target: OperationTarget) => Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Begin Delete: ask the Host what it would do, then confirm or commit per the settings.
|
|
70
|
+
* @param target - the session to delete.
|
|
71
|
+
* @returns after the confirmation opened, or after an unconfirmed delete committed.
|
|
72
|
+
*/
|
|
73
|
+
requestDelete: (target: OperationTarget) => Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/** Full props of the session-header trigger. */
|
|
76
|
+
export type HeaderMenuProps = PropsRuntime<'conversation.session.header.utilities'> & PropsLocale<'advancedSidebar'> & InjectFace<MenuInjected>;
|
|
77
|
+
/** Everything the dock and its confirmation dialog need. */
|
|
78
|
+
export interface PanelHostInjected {
|
|
79
|
+
/** Registrant-private reactive sources the renderer binds to `use<Name>` hooks. */
|
|
80
|
+
hooks: {
|
|
81
|
+
/** Cross-registration panel state; the dock reads it and its own controls write it. */
|
|
82
|
+
sidebar: PanelController;
|
|
83
|
+
/** The bound settings scope, which decides the dock's width and which verbs it offers. */
|
|
84
|
+
settings: SettingsScope<AdvancedSidebarSettings>;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Read the Host's capability view for the dock's own gating.
|
|
88
|
+
* @param signal - cancellation for the probe.
|
|
89
|
+
* @returns the capability view.
|
|
90
|
+
*/
|
|
91
|
+
describe: (signal?: AbortSignal) => Promise<AdvancedSidebarView>;
|
|
92
|
+
/**
|
|
93
|
+
* Read one workspace's git status.
|
|
94
|
+
* @param workspacePath - the directory to read.
|
|
95
|
+
* @param signal - cancellation for the reading.
|
|
96
|
+
* @returns the reading, or a classified failure.
|
|
97
|
+
*/
|
|
98
|
+
gitStatus: (workspacePath: string, signal?: AbortSignal) => Promise<GitStatusResult>;
|
|
99
|
+
/**
|
|
100
|
+
* Read one path's patch.
|
|
101
|
+
* @param request - the path and which index to compare.
|
|
102
|
+
* @param signal - cancellation for the reading.
|
|
103
|
+
* @returns the patch, or a classified failure.
|
|
104
|
+
*/
|
|
105
|
+
gitDiff: (request: GitDiffRequest, signal?: AbortSignal) => Promise<GitDiffResult>;
|
|
106
|
+
/**
|
|
107
|
+
* Stage paths into the index.
|
|
108
|
+
* @param workspacePath - the workspace the reading came from.
|
|
109
|
+
* @param paths - repository-relative paths.
|
|
110
|
+
* @returns the reading after the write, or a classified failure.
|
|
111
|
+
*/
|
|
112
|
+
gitStage: (workspacePath: string, paths: readonly string[]) => Promise<GitStageResult>;
|
|
113
|
+
/**
|
|
114
|
+
* Take paths back out of the index.
|
|
115
|
+
* @param workspacePath - the workspace the reading came from.
|
|
116
|
+
* @param paths - repository-relative paths.
|
|
117
|
+
* @returns the reading after the write, or a classified failure.
|
|
118
|
+
*/
|
|
119
|
+
gitUnstage: (workspacePath: string, paths: readonly string[]) => Promise<GitStageResult>;
|
|
120
|
+
/**
|
|
121
|
+
* Record the staged changes.
|
|
122
|
+
* @param workspacePath - the workspace the reading came from.
|
|
123
|
+
* @param message - the commit message.
|
|
124
|
+
* @param amend - replace the previous commit instead of adding one.
|
|
125
|
+
* @returns the new commit and the reading after it, or a classified failure.
|
|
126
|
+
*/
|
|
127
|
+
gitCommit: (workspacePath: string, message: string, amend: boolean) => Promise<GitCommitResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Send the current branch's commits to its remote.
|
|
130
|
+
* @param workspacePath - the workspace the reading came from.
|
|
131
|
+
* @param setUpstream - publish a branch that has no upstream instead of refusing it.
|
|
132
|
+
* @returns the push and the reading after it, or a classified failure.
|
|
133
|
+
*/
|
|
134
|
+
gitPush: (workspacePath: string, setUpstream: boolean) => Promise<GitPushResult>;
|
|
135
|
+
/**
|
|
136
|
+
* Ask the deployment's model to write a commit message for what is staged.
|
|
137
|
+
* @param workspacePath - the workspace the reading came from.
|
|
138
|
+
* @param amend - draft for an amend, which describes the previous commit's content too.
|
|
139
|
+
* @param signal - cancellation for the readings and the model call.
|
|
140
|
+
* @returns the drafted message, or a classified failure.
|
|
141
|
+
*/
|
|
142
|
+
gitCommitMessage: (workspacePath: string, amend: boolean, signal?: AbortSignal) => Promise<GitCommitMessageResult>;
|
|
143
|
+
/**
|
|
144
|
+
* Allocate a panel terminal.
|
|
145
|
+
* @param workspacePath - the directory to start in.
|
|
146
|
+
* @param cols - measured column count.
|
|
147
|
+
* @param rows - measured row count.
|
|
148
|
+
* @returns the handle, or a classified failure.
|
|
149
|
+
*/
|
|
150
|
+
terminalOpen: (workspacePath: string, cols: number, rows: number) => Promise<TerminalOpenResult>;
|
|
151
|
+
/**
|
|
152
|
+
* Read terminal output from the offset already rendered.
|
|
153
|
+
* @param terminalId - the handle.
|
|
154
|
+
* @param fromOffset - the rendered offset.
|
|
155
|
+
* @returns the delta, or a classified failure.
|
|
156
|
+
*/
|
|
157
|
+
terminalRead: (terminalId: string, fromOffset: number) => Promise<TerminalReadResult>;
|
|
158
|
+
/**
|
|
159
|
+
* Send keystrokes.
|
|
160
|
+
* @param terminalId - the handle.
|
|
161
|
+
* @param data - text delivered verbatim.
|
|
162
|
+
* @returns settlement, or a classified failure.
|
|
163
|
+
*/
|
|
164
|
+
terminalWrite: (terminalId: string, data: string) => Promise<TerminalAckResult>;
|
|
165
|
+
/**
|
|
166
|
+
* Interrupt the terminal's foreground process group.
|
|
167
|
+
* @param terminalId - the handle.
|
|
168
|
+
* @returns settlement, or a classified failure.
|
|
169
|
+
*/
|
|
170
|
+
terminalInterrupt: (terminalId: string) => Promise<TerminalAckResult>;
|
|
171
|
+
/**
|
|
172
|
+
* Close a terminal.
|
|
173
|
+
* @param terminalId - the handle.
|
|
174
|
+
* @returns settlement, or a classified failure.
|
|
175
|
+
*/
|
|
176
|
+
terminalClose: (terminalId: string) => Promise<TerminalAckResult>;
|
|
177
|
+
/**
|
|
178
|
+
* List one directory level inside a workspace.
|
|
179
|
+
* @param path - absolute directory.
|
|
180
|
+
* @param workspacePath - the directory the listing must stay inside.
|
|
181
|
+
* @param signal - cancellation for the listing.
|
|
182
|
+
* @returns the level, or a classified failure.
|
|
183
|
+
*/
|
|
184
|
+
listEntries: (path: string, workspacePath: string, signal?: AbortSignal) => Promise<ListEntriesResult>;
|
|
185
|
+
/**
|
|
186
|
+
* Read one file for preview.
|
|
187
|
+
* @param path - the file.
|
|
188
|
+
* @param workspacePath - the directory it must stay inside.
|
|
189
|
+
* @param signal - cancellation for the read.
|
|
190
|
+
* @returns the preview, or a classified failure.
|
|
191
|
+
*/
|
|
192
|
+
readFile: (path: string, workspacePath: string, signal?: AbortSignal) => Promise<ReadFileResult>;
|
|
193
|
+
/**
|
|
194
|
+
* List one workspace's preview launch configurations, each with its current state.
|
|
195
|
+
* @param workspacePath - the workspace to read.
|
|
196
|
+
* @param signal - cancellation for the read.
|
|
197
|
+
* @returns the list, or a classified failure.
|
|
198
|
+
*/
|
|
199
|
+
previewList: (workspacePath: string, signal?: AbortSignal) => Promise<PreviewListResult>;
|
|
200
|
+
/**
|
|
201
|
+
* Start one preview configuration.
|
|
202
|
+
* @param workspacePath - the workspace it belongs to.
|
|
203
|
+
* @param name - the configuration name.
|
|
204
|
+
* @returns the started row, or a classified failure.
|
|
205
|
+
*/
|
|
206
|
+
previewStart: (workspacePath: string, name: string) => Promise<PreviewStartResult>;
|
|
207
|
+
/**
|
|
208
|
+
* Stop one running preview server.
|
|
209
|
+
* @param serverId - the handle.
|
|
210
|
+
* @returns settlement, or a classified failure.
|
|
211
|
+
*/
|
|
212
|
+
previewStop: (serverId: string) => Promise<PreviewStopResult>;
|
|
213
|
+
/**
|
|
214
|
+
* Read one preview server's output from the offset already rendered, with its state.
|
|
215
|
+
* @param serverId - the handle.
|
|
216
|
+
* @param fromOffset - the rendered offset.
|
|
217
|
+
* @returns the delta and the state, or a classified failure.
|
|
218
|
+
*/
|
|
219
|
+
previewLogs: (serverId: string, fromOffset: number) => Promise<PreviewLogsResult>;
|
|
220
|
+
/**
|
|
221
|
+
* Open one path with the Host operating system's default application.
|
|
222
|
+
* @param path - the absolute path.
|
|
223
|
+
* @returns after the Host answered; a failure surfaces as a notice.
|
|
224
|
+
*/
|
|
225
|
+
openPath: (path: string) => Promise<void>;
|
|
226
|
+
/**
|
|
227
|
+
* Hand one path to an Open in target.
|
|
228
|
+
* @param targetId - the target's id.
|
|
229
|
+
* @param path - the absolute path.
|
|
230
|
+
* @returns after the launch settled.
|
|
231
|
+
*/
|
|
232
|
+
openIn: (targetId: string, path: string) => Promise<void>;
|
|
233
|
+
/**
|
|
234
|
+
* Stop one live background task.
|
|
235
|
+
* @param sessionId - the owning session.
|
|
236
|
+
* @param taskId - the task.
|
|
237
|
+
* @returns what the registry did, or a classified failure.
|
|
238
|
+
*/
|
|
239
|
+
taskKill: (sessionId: string, taskId: string) => Promise<TaskKillResult>;
|
|
240
|
+
/**
|
|
241
|
+
* Read one settled task's output.
|
|
242
|
+
* @param sessionId - the owning session.
|
|
243
|
+
* @param taskId - the task.
|
|
244
|
+
* @returns the output, or a classified failure.
|
|
245
|
+
*/
|
|
246
|
+
taskOutput: (sessionId: string, taskId: string) => Promise<TaskOutputResult>;
|
|
247
|
+
/**
|
|
248
|
+
* Commit the pending Delete.
|
|
249
|
+
* @param sessionId - the session to delete.
|
|
250
|
+
* @returns what was done, or a classified failure.
|
|
251
|
+
*/
|
|
252
|
+
deleteSession: (sessionId: string) => Promise<DeleteSessionResult>;
|
|
253
|
+
/**
|
|
254
|
+
* Copy text to the clipboard.
|
|
255
|
+
* @param text - the text to copy.
|
|
256
|
+
* @returns whether the browser accepted it.
|
|
257
|
+
*/
|
|
258
|
+
copy: (text: string) => Promise<boolean>;
|
|
259
|
+
/** Close the dock. */
|
|
260
|
+
close: () => void;
|
|
261
|
+
/**
|
|
262
|
+
* Store the width a resize settled on, for this browser session.
|
|
263
|
+
* @param width - the width in pixels.
|
|
264
|
+
*/
|
|
265
|
+
setDockWidth: (width: number) => void;
|
|
266
|
+
/**
|
|
267
|
+
* Persist the width a resize settled on into the settings section.
|
|
268
|
+
* @param width - the width in pixels.
|
|
269
|
+
* @returns settlement after the write; refused scopes reject and the dock keeps its own copy.
|
|
270
|
+
*/
|
|
271
|
+
setPanelWidth: (width: number) => Promise<void>;
|
|
272
|
+
/**
|
|
273
|
+
* Add one terminal tab, in the state it has before its shell has been allocated.
|
|
274
|
+
* @param key - the terminal group key.
|
|
275
|
+
* @param tabId - the caller-generated tab id the allocation will be recorded against.
|
|
276
|
+
*/
|
|
277
|
+
addTerminal: (key: string, tabId: string) => void;
|
|
278
|
+
/**
|
|
279
|
+
* Record what one tab's allocation answered.
|
|
280
|
+
* @param key - the terminal group key.
|
|
281
|
+
* @param tabId - the tab the allocation was for.
|
|
282
|
+
* @param outcome - the handle and the shell, or the failure.
|
|
283
|
+
*/
|
|
284
|
+
settleTerminal: (key: string, tabId: string, outcome: {
|
|
285
|
+
terminalId: string;
|
|
286
|
+
shell: string;
|
|
287
|
+
} | {
|
|
288
|
+
error: string;
|
|
289
|
+
}) => void;
|
|
290
|
+
/**
|
|
291
|
+
* Show one tab's screen.
|
|
292
|
+
* @param key - the terminal group key.
|
|
293
|
+
* @param tabId - the tab to show.
|
|
294
|
+
*/
|
|
295
|
+
activateTerminal: (key: string, tabId: string) => void;
|
|
296
|
+
/**
|
|
297
|
+
* Drop one tab and close the shell it held.
|
|
298
|
+
* @param key - the terminal group key.
|
|
299
|
+
* @param tabId - the tab to close.
|
|
300
|
+
* @returns after the Host answered; a failure surfaces as a notice.
|
|
301
|
+
*/
|
|
302
|
+
closeTerminal: (key: string, tabId: string) => Promise<void>;
|
|
303
|
+
/**
|
|
304
|
+
* Dismiss one notice, ignoring a request for one already replaced.
|
|
305
|
+
* @param id - the notice to dismiss.
|
|
306
|
+
*/
|
|
307
|
+
dismissNotice: (id: number) => void;
|
|
308
|
+
/** Dismiss the Delete confirmation without acting. */
|
|
309
|
+
dismissDelete: () => void;
|
|
310
|
+
/**
|
|
311
|
+
* Withdraw everything a session owned, because that session left the list.
|
|
312
|
+
* @param sessionId - the session that disappeared.
|
|
313
|
+
*/
|
|
314
|
+
forgetSession: (sessionId: string) => void;
|
|
315
|
+
/**
|
|
316
|
+
* Commit the confirmed Delete and report its outcome as a notice.
|
|
317
|
+
* @param target - the session to delete.
|
|
318
|
+
* @returns after the Host answered.
|
|
319
|
+
*/
|
|
320
|
+
commitDelete: (target: OperationTarget) => Promise<void>;
|
|
321
|
+
/**
|
|
322
|
+
* Report one message under the dock.
|
|
323
|
+
* @param tone - whether the message reports a failure.
|
|
324
|
+
* @param text - the message.
|
|
325
|
+
*/
|
|
326
|
+
notify: (tone: 'info' | 'error', text: string) => void;
|
|
327
|
+
}
|
|
328
|
+
/** Full props of the frame-wide dock. */
|
|
329
|
+
export type PanelHostProps = PropsRuntime<'shell.overlay'> & PropsLocale<'advancedSidebar'> & InjectFace<PanelHostInjected>;
|
|
330
|
+
/** Everything the settings card needs. */
|
|
331
|
+
export interface SettingsCardInjected {
|
|
332
|
+
/** Registrant-private reactive sources the renderer binds to `use<Name>` hooks. */
|
|
333
|
+
hooks: {
|
|
334
|
+
/** The bound `advanced-sidebar` settings scope: resolved value, layers, revision, writability. */
|
|
335
|
+
sidebarSettings: SettingsScope<AdvancedSidebarSettings>;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Read the Host's capability view for the card's status line and its Open in roster.
|
|
339
|
+
* @param signal - cancellation for the probe.
|
|
340
|
+
* @returns the capability view.
|
|
341
|
+
*/
|
|
342
|
+
describe: (signal?: AbortSignal) => Promise<AdvancedSidebarView>;
|
|
343
|
+
/**
|
|
344
|
+
* Store one field of the section; the bound scope owns revision fencing.
|
|
345
|
+
* @param field - the field name inside the namespace.
|
|
346
|
+
* @param value - the JSON-shaped value the control produced.
|
|
347
|
+
* @returns settlement after the write.
|
|
348
|
+
*/
|
|
349
|
+
setField: (field: string, value: unknown) => Promise<void>;
|
|
350
|
+
/**
|
|
351
|
+
* Clear one optional field back to the composition layer.
|
|
352
|
+
* @param field - the field name inside the namespace.
|
|
353
|
+
* @returns settlement after the write.
|
|
354
|
+
*/
|
|
355
|
+
unsetField: (field: string) => Promise<void>;
|
|
356
|
+
}
|
|
357
|
+
/** Full props of the plugin-settings card. */
|
|
358
|
+
export type SettingsCardProps = PropsRuntime<'settings.plugin.item'> & PropsLocale<'advancedSidebar'> & InjectFace<SettingsCardInjected>;
|