dsh-builtin-browser 1.0.1 → 1.0.4
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/CHANGELOG.md +55 -0
- package/README.md +1 -1
- package/assets/browser-panel-locales.mjs +37 -5
- package/assets/browser-policy.d.mts +29 -0
- package/assets/browser-policy.mjs +40 -0
- package/desktop-bridge/desktop-discovery.d.mts +1 -1
- package/desktop-bridge/desktop-discovery.mjs +59 -9
- package/desktop-bridge/desktop-identity.json +12 -0
- package/desktop-bridge/install.mjs +14 -7
- package/desktop-bridge/plugin-browser-bridge.js +19 -7
- package/docs/acceptance-2026-11-27.md +67 -0
- package/docs/architecture.md +1 -1
- package/docs/development.md +33 -4
- package/docs/dsh-0.2.3-host-patch-task.md +34 -0
- package/docs/hardcoding-audit.md +28 -8
- package/docs/known-issues.md +26 -0
- package/docs/limitations.md +6 -2
- package/docs/tool-reference.md +1 -1
- package/docs/v1.1.0-bu-data-batching-task.md +66 -0
- package/docs/v1.1.0-compat-hardcoding-task.md +85 -0
- package/dsh-host-patch/README.md +4 -0
- package/dsh-host-patch/apply.mjs +61 -13
- package/dsh-host-patch/rc3-revision9.json.gz +0 -0
- package/dsh-host-patch/rc5-revision9.json.gz +0 -0
- package/dsh-host-patch/tauri/desktop-main.cjs +62 -0
- package/dsh-host-patch/tauri/sidebar-session.cjs +104 -0
- package/dsh-host-patch/tauri-revision1.json +39 -0
- package/dsh-host-patch/tauri.json +43 -0
- package/dsh-host-patch/v023-alpha2.json +153 -0
- package/lib/browser/anti-bot.js +215 -0
- package/lib/browser/deep-dom.js +39 -0
- package/lib/browser/runtime.js +15 -0
- package/lib/browser/takeover-target.js +13 -6
- package/lib/browser/types.js +30 -1
- package/lib/browser-electron/authenticated-route.js +16 -2
- package/lib/browser-electron/automatic-maintenance.js +16 -10
- package/lib/browser-electron/bridge-connection.js +3 -8
- package/lib/browser-electron/bridge-install.js +2 -1
- package/lib/browser-electron/bridge-status.js +55 -26
- package/lib/browser-electron/desktop-bridge-host.js +7 -6
- package/lib/browser-electron/desktop-identity.js +28 -5
- package/lib/browser-electron/desktop-shell.js +64 -0
- package/lib/browser-electron/electron-provision.js +105 -18
- package/lib/browser-electron/entry.js +129 -44
- package/lib/browser-electron/extension-browser.js +4 -4
- package/lib/browser-electron/foreground-watch.js +134 -0
- package/lib/browser-electron/guest-cookie-jar.js +13 -13
- package/lib/browser-electron/guest-route.js +181 -32
- package/lib/browser-electron/guest-runtime.js +61 -10
- package/lib/browser-electron/guest-storage.js +2 -2
- package/lib/browser-electron/history-store.js +1 -5
- package/lib/browser-electron/host-main.js +8 -4
- package/lib/browser-electron/host-patch-maintenance.js +14 -8
- package/lib/browser-electron/maintenance-route.js +2 -1
- package/lib/browser-electron/missing-system-browser.js +5 -9
- package/lib/browser-electron/preferred-browser.js +7 -3
- package/lib/browser-electron/preview-route.js +9 -13
- package/lib/browser-electron/process-ownership.js +1 -1
- package/lib/browser-electron/profile-command.js +2 -1
- package/lib/browser-electron/profile-extension.js +5 -0
- package/lib/browser-electron/profile-lease.js +152 -47
- package/lib/browser-electron/provider-core.js +527 -0
- package/lib/browser-electron/provider-interaction.js +963 -0
- package/lib/browser-electron/provider-media.js +518 -0
- package/lib/browser-electron/provider-navigation.js +301 -0
- package/lib/browser-electron/provider-observation.js +623 -0
- package/lib/browser-electron/provider-tabs.js +372 -0
- package/lib/browser-electron/provider.js +150 -3301
- package/lib/browser-electron/reference-route.js +9 -18
- package/lib/browser-electron/remote-host.js +79 -34
- package/lib/browser-electron/runtime-status.js +56 -6
- package/lib/browser-electron/settings-store.js +3 -6
- package/lib/browser-electron/sidebar-only-host.js +1 -1
- package/lib/browser-electron/system-browser.js +539 -172
- package/lib/browser-electron/tauri-host.js +208 -0
- package/lib/browser-electron/virtual-cursor.js +23 -13
- package/lib/browser-reference/service.js +22 -4
- package/lib/browser-reference/web-sources.js +1 -1
- package/lib/client.js +43409 -0
- package/lib/compat/host-features.js +75 -0
- package/lib/reference-source.js +1 -1
- package/lib/reference-text.js +23 -1
- package/lib/takeover-protocol.js +1 -1
- package/lib/tool-browser/block-recovery.js +69 -0
- package/lib/tool-browser/code-tool.js +170 -19
- package/lib/tool-browser/code-worker.js +115 -20
- package/lib/tool-browser/errors.js +34 -0
- package/lib/tool-browser/index.js +66 -3593
- package/lib/tool-browser/page-probe.js +227 -28
- package/lib/tool-browser/panel-page.js +2 -1
- package/lib/tool-browser/probe-client.js +157 -0
- package/lib/tool-browser/screenshot-annotations.js +108 -0
- package/lib/tool-browser/state.js +337 -0
- package/lib/tool-browser/takeover.js +1 -1
- package/lib/tool-browser/tools-debug.js +862 -0
- package/lib/tool-browser/tools-interaction.js +993 -0
- package/lib/tool-browser/tools-navigation.js +807 -0
- package/lib/tool-browser/tools-observation.js +461 -0
- package/lib/tool-browser/tools-reference.js +293 -0
- package/lib/web-guest.js +1 -0
- package/package.json +16 -36
- package/scripts/build-client.mjs +305 -0
- package/scripts/build.mjs +15 -12
- package/scripts/fix-exports.mjs +6 -16
- package/scripts/install-electron.mjs +55 -5
- package/scripts/pack.mjs +99 -0
- package/scripts/publish-manifest.mjs +56 -0
- package/scripts/verify-exports.mjs +26 -15
- package/skills/dsh-builtin-browser/SKILL.md +27 -2
- package/skills/dsh-builtin-browser/references/batch.md +15 -0
- package/src/browser/anti-bot.ts +251 -0
- package/src/browser/deep-dom.ts +40 -0
- package/src/browser/runtime.ts +18 -0
- package/src/browser/takeover-target.ts +16 -7
- package/src/browser/types.ts +56 -3
- package/src/browser-electron/authenticated-route.ts +29 -4
- package/src/browser-electron/automatic-maintenance.ts +23 -13
- package/src/browser-electron/bridge-connection.ts +11 -10
- package/src/browser-electron/bridge-install.ts +2 -1
- package/src/browser-electron/bridge-status.ts +61 -22
- package/src/browser-electron/desktop-bridge-host.ts +9 -7
- package/src/browser-electron/desktop-identity.ts +38 -5
- package/src/browser-electron/desktop-shell.ts +100 -0
- package/src/browser-electron/electron-provision.ts +104 -18
- package/src/browser-electron/entry.ts +1378 -1299
- package/src/browser-electron/extension-browser.ts +11 -4
- package/src/browser-electron/foreground-watch.ts +142 -0
- package/src/browser-electron/guest-cookie-jar.ts +3 -2
- package/src/browser-electron/guest-route.ts +180 -32
- package/src/browser-electron/guest-runtime.ts +61 -10
- package/src/browser-electron/guest-storage.ts +5 -2
- package/src/browser-electron/history-store.ts +3 -6
- package/src/browser-electron/host-main.ts +8 -4
- package/src/browser-electron/host-patch-maintenance.ts +18 -9
- package/src/browser-electron/maintenance-route.ts +2 -1
- package/src/browser-electron/missing-system-browser.ts +11 -10
- package/src/browser-electron/preferred-browser.ts +13 -3
- package/src/browser-electron/preview-route.ts +9 -12
- package/src/browser-electron/process-ownership.ts +9 -3
- package/src/browser-electron/profile-command.ts +2 -1
- package/src/browser-electron/profile-extension.ts +5 -0
- package/src/browser-electron/profile-lease.ts +131 -35
- package/src/browser-electron/provider-core.ts +1107 -0
- package/src/browser-electron/provider-interaction.ts +1034 -0
- package/src/browser-electron/provider-media.ts +589 -0
- package/src/browser-electron/provider-navigation.ts +323 -0
- package/src/browser-electron/provider-observation.ts +664 -0
- package/src/browser-electron/provider-tabs.ts +372 -0
- package/src/browser-electron/provider.ts +158 -4063
- package/src/browser-electron/reference-route.ts +598 -608
- package/src/browser-electron/remote-host.ts +118 -42
- package/src/browser-electron/runtime-status.ts +80 -13
- package/src/browser-electron/settings-store.ts +10 -6
- package/src/browser-electron/sidebar-only-host.ts +4 -2
- package/src/browser-electron/system-browser.ts +537 -184
- package/src/browser-electron/tauri-host.ts +194 -0
- package/src/browser-electron/virtual-cursor.ts +24 -14
- package/src/browser-reference/service.ts +38 -7
- package/src/browser-reference/web-sources.ts +4 -1
- package/src/client/apply-guard.ts +22 -0
- package/src/client/browser/BrowserController.ts +3 -3
- package/src/client/browser/IframeImpl.ts +182 -176
- package/src/client/browser/frame-history.ts +125 -0
- package/src/client/browser/frame-state.ts +27 -0
- package/src/client/browser/web-reference-source.ts +5 -1
- package/src/client/definition.tsx +36 -30
- package/src/client/electron/ElectronWebViewImpl.ts +20 -13
- package/src/client/electron/ElectronWebviewPresentation.ts +4 -2
- package/src/client/electron/NativeChildPresentation.ts +11 -3
- package/src/client/electron/NativeViewPage.ts +19 -5
- package/src/client/index.ts +333 -293
- package/src/client/locales.ts +9 -6
- package/src/client/reference/client/plugin.ts +21 -2
- package/src/client/reference/client/production/ReferenceCapsules.tsx +3 -3
- package/src/client/reference/client/production/assembly.ts +4 -28
- package/src/client/reference/client/production/availability.ts +0 -2
- package/src/client/reference/client/production/composer-attachments.ts +44 -0
- package/src/client/reference/client/production/draft-adapter.ts +4 -0
- package/src/client/reference/client/production/http-transport.ts +0 -5
- package/src/client/reference/client/production/production-submission.ts +50 -290
- package/src/client/reference/client/production/protocol.ts +7 -4
- package/src/client/reference/client/production/runtime.ts +41 -86
- package/src/client/reference/client/production/source-marker.ts +49 -13
- package/src/client/reference/client/production/user-text-rule.ts +10 -1
- package/src/client/reference/client/reveal.ts +3 -1
- package/src/client/reference/client/session-schedule.ts +36 -0
- package/src/client/settings/index.ts +8 -0
- package/src/client/settings/mount-guard.ts +31 -0
- package/src/client/settings/panel.ts +163 -52
- package/src/client/startpage/controller.ts +3 -6
- package/src/client/view/BrowserBody.tsx +2 -1
- package/src/client/view/IframePresentation.ts +37 -16
- package/src/client/view/StartPage.tsx +2 -1
- package/src/compat/host-features.ts +92 -0
- package/src/reference-source.ts +1 -1
- package/src/reference-text.ts +23 -1
- package/src/takeover-protocol.ts +11 -2
- package/src/tool-browser/block-recovery.ts +85 -0
- package/src/tool-browser/code-tool.ts +173 -19
- package/src/tool-browser/code-worker.ts +101 -15
- package/src/tool-browser/errors.ts +40 -0
- package/src/tool-browser/index.ts +66 -3534
- package/src/tool-browser/page-probe.ts +229 -28
- package/src/tool-browser/panel-page.ts +3 -1
- package/src/tool-browser/probe-client.ts +183 -0
- package/src/tool-browser/screenshot-annotations.ts +131 -0
- package/src/tool-browser/state.ts +375 -0
- package/src/tool-browser/takeover.ts +3 -2
- package/src/tool-browser/tools-debug.ts +806 -0
- package/src/tool-browser/tools-interaction.ts +956 -0
- package/src/tool-browser/tools-navigation.ts +786 -0
- package/src/tool-browser/tools-observation.ts +474 -0
- package/src/tool-browser/tools-reference.ts +294 -0
- package/src/web-guest.ts +35 -34
- package/dist/client.cjs +0 -43167
- package/dist/client.d.cts +0 -516
- package/dist/client.d.mts +0 -516
- package/dist/index.cjs +0 -92
- package/dist/index.d.mts +0 -2960
- package/dist/index.mjs +0 -24
- package/lib/browser-reference/submission-receipts.js +0 -139
- package/src/browser-reference/submission-receipts.ts +0 -122
package/dist/client.d.cts
DELETED
|
@@ -1,516 +0,0 @@
|
|
|
1
|
-
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
import { TabId } from "@deepseek-ai/dsh-client-ui-dockkit";
|
|
3
|
-
import "react";
|
|
4
|
-
import { HostObservable, InjectFace, PropsLocale, PropsRuntime, PropsStore } from "@deepseek-ai/dsh-client-ui-slots";
|
|
5
|
-
import { BoundActions, EngineStoreHandle } from "@deepseek-ai/dsh-client-store";
|
|
6
|
-
import "@deepseek-ai/dsh-client-ui-settings/client";
|
|
7
|
-
/** A normalized Browser navigation target. */
|
|
8
|
-
type BrowserTarget = {
|
|
9
|
-
readonly kind: 'https';
|
|
10
|
-
readonly url: string;
|
|
11
|
-
readonly title: string;
|
|
12
|
-
} | {
|
|
13
|
-
readonly kind: 'http';
|
|
14
|
-
readonly url: string;
|
|
15
|
-
readonly title: string;
|
|
16
|
-
};
|
|
17
|
-
/** Why an address was refused before navigation. */
|
|
18
|
-
type BrowserAddressFailure = 'empty' | 'invalid' | 'protocol' | 'credentials' | 'application-origin';
|
|
19
|
-
/** Result of parsing an address-bar value. */
|
|
20
|
-
type BrowserAddressResult = {
|
|
21
|
-
readonly ok: true;
|
|
22
|
-
readonly target: BrowserTarget;
|
|
23
|
-
} | {
|
|
24
|
-
readonly ok: false;
|
|
25
|
-
readonly reason: BrowserAddressFailure;
|
|
26
|
-
};
|
|
27
|
-
/** A loading failure, optionally carrying the underlying browser's diagnostic. */
|
|
28
|
-
interface BrowserLoadError {
|
|
29
|
-
readonly code: number | undefined;
|
|
30
|
-
readonly description: string | undefined;
|
|
31
|
-
}
|
|
32
|
-
/** State consumed by common browser chrome, without DOM or carrier identifiers. */
|
|
33
|
-
interface BrowserFrameState {
|
|
34
|
-
readonly target: BrowserTarget | undefined;
|
|
35
|
-
readonly address: 'empty' | 'requested' | 'observed' | 'unknown';
|
|
36
|
-
readonly loading: boolean;
|
|
37
|
-
readonly canGoBack: boolean;
|
|
38
|
-
readonly canGoForward: boolean;
|
|
39
|
-
readonly error: BrowserLoadError | undefined;
|
|
40
|
-
/** Undefined when this provider does not expose a sandbox control. */
|
|
41
|
-
readonly sandboxEnabled: boolean | undefined;
|
|
42
|
-
}
|
|
43
|
-
/** Optional iframe policy control, not an Electron process-sandbox switch. */
|
|
44
|
-
interface BrowserSandboxControl {
|
|
45
|
-
/** @param enabled - whether the provider's embedding sandbox is enforced. */
|
|
46
|
-
setEnabled(enabled: boolean): void;
|
|
47
|
-
}
|
|
48
|
-
/** Carrier-level initialization stage, below the navigation record. */
|
|
49
|
-
type BrowserCarrierStage = 'idle' | 'guest' | 'ready' | 'failed';
|
|
50
|
-
/** What the carrier can prove about the page it owns. */
|
|
51
|
-
interface BrowserCarrierState {
|
|
52
|
-
readonly stage: BrowserCarrierStage;
|
|
53
|
-
/** Native guest id once the shell reports one. */
|
|
54
|
-
readonly guestId?: string;
|
|
55
|
-
/** Why the carrier could not reach `ready`; machine code, localized by the UI. */
|
|
56
|
-
readonly reason?: 'workspace-unavailable' | 'acquire-failed' | 'guest-bootstrap-failed';
|
|
57
|
-
/** Original carrier failure text, bounded and kept with its owning attempt. */
|
|
58
|
-
readonly detail?: string;
|
|
59
|
-
}
|
|
60
|
-
/** Navigation owns page lifetime; mounting and hiding belong to BrowserPresentation. */
|
|
61
|
-
interface BrowserFrame extends HostObservable<BrowserFrameState> {
|
|
62
|
-
readonly sandbox?: BrowserSandboxControl;
|
|
63
|
-
/**
|
|
64
|
-
* Optional carrier proof (`guest created`, `document ready`, bootstrap failure).
|
|
65
|
-
* A frame without it still navigates; its initialization receipt simply stops
|
|
66
|
-
* at `navigating`, which is exactly what an older carrier can promise.
|
|
67
|
-
*/
|
|
68
|
-
readonly lifecycle?: HostObservable<BrowserCarrierState>;
|
|
69
|
-
/** @param target - validated HTTP(S) address; loading failures are published in state. */
|
|
70
|
-
loadUrl(target: BrowserTarget): void;
|
|
71
|
-
/** Move backward when the provider reports an available entry. */
|
|
72
|
-
goBack(): void;
|
|
73
|
-
/** Move forward when the provider reports an available entry. */
|
|
74
|
-
goForward(): void;
|
|
75
|
-
/** Reload the current address without creating a new history entry. */
|
|
76
|
-
reload(): void;
|
|
77
|
-
/** @returns after the page, listeners and pending initialization have been released; repeated calls join disposal. */
|
|
78
|
-
dispose(): Promise<void>;
|
|
79
|
-
}
|
|
80
|
-
/** The presentation face is separate from page navigation and terminal disposal. */
|
|
81
|
-
interface BrowserPresentation {
|
|
82
|
-
/**
|
|
83
|
-
* Attach the page inside a committed content container.
|
|
84
|
-
* @param viewportId - content element id; its DOM ancestors must remain connected for page retention.
|
|
85
|
-
* @returns ends physical attachment, without disposing the navigation model; a later mount may reload the page.
|
|
86
|
-
*/
|
|
87
|
-
mount(viewportId: string): () => void;
|
|
88
|
-
}
|
|
89
|
-
/** One retained address. */
|
|
90
|
-
type BrowserHistoryEntry = BrowserTarget;
|
|
91
|
-
/** Observability recorded for a controlled navigation. */
|
|
92
|
-
type BrowserNavigationStatus = {
|
|
93
|
-
readonly status: 'empty';
|
|
94
|
-
} | {
|
|
95
|
-
readonly status: 'loading';
|
|
96
|
-
readonly revision: number;
|
|
97
|
-
} | {
|
|
98
|
-
readonly status: 'known';
|
|
99
|
-
readonly revision: number;
|
|
100
|
-
} | {
|
|
101
|
-
readonly status: 'unknown';
|
|
102
|
-
readonly revision: number;
|
|
103
|
-
};
|
|
104
|
-
/** Address refusal carried by existing browser-local records. */
|
|
105
|
-
type BrowserFailure = {
|
|
106
|
-
readonly kind: 'address';
|
|
107
|
-
readonly reason: BrowserAddressFailure;
|
|
108
|
-
};
|
|
109
|
-
/** Serializable record; providers retain the history they can restore. */
|
|
110
|
-
interface BrowserTabState {
|
|
111
|
-
readonly entries: readonly BrowserHistoryEntry[];
|
|
112
|
-
readonly index: number;
|
|
113
|
-
readonly request: {
|
|
114
|
-
readonly revision: number;
|
|
115
|
-
readonly target: BrowserTarget;
|
|
116
|
-
} | undefined;
|
|
117
|
-
readonly navigation: BrowserNavigationStatus;
|
|
118
|
-
readonly failure: BrowserFailure | undefined;
|
|
119
|
-
}
|
|
120
|
-
/** Provider construction inputs; persistence does not enter the live navigation interface. */
|
|
121
|
-
interface BrowserPageOptions {
|
|
122
|
-
readonly initial: BrowserTabState | undefined;
|
|
123
|
-
readonly persist: (state: BrowserTabState) => void;
|
|
124
|
-
readonly openRequested: (url: string) => void;
|
|
125
|
-
}
|
|
126
|
-
/** The owning controller disposes frame; UI mounts only presentation. */
|
|
127
|
-
interface BrowserPage {
|
|
128
|
-
readonly frame: BrowserFrame;
|
|
129
|
-
readonly presentation: BrowserPresentation;
|
|
130
|
-
}
|
|
131
|
-
/** Construct an idle provider without attaching DOM; saved navigation waits for an explicit frame command. */
|
|
132
|
-
type BrowserPageFactory = (options: BrowserPageOptions) => BrowserPage;
|
|
133
|
-
/** One search endpoint whose address is stored without template syntax. */
|
|
134
|
-
interface SearchEngine {
|
|
135
|
-
readonly id: string;
|
|
136
|
-
readonly label: string;
|
|
137
|
-
readonly homeUrl: string;
|
|
138
|
-
readonly searchUrl: string;
|
|
139
|
-
readonly queryParameter: string;
|
|
140
|
-
readonly extraParameters?: Readonly<Record<string, string>>;
|
|
141
|
-
}
|
|
142
|
-
/** Locally shared search selection used to resolve keyword input. */
|
|
143
|
-
interface OmniboxPreferences {
|
|
144
|
-
readonly defaultSearchEngineId: string;
|
|
145
|
-
readonly searchEngines: readonly SearchEngine[];
|
|
146
|
-
}
|
|
147
|
-
/** Why manual input produced no navigation; address failures keep their strict meaning. */
|
|
148
|
-
type OmniboxRefusal = BrowserAddressFailure | 'path' | 'engine-unavailable';
|
|
149
|
-
/** All Browser tabs in one Session-scoped store. */
|
|
150
|
-
interface BrowserState {
|
|
151
|
-
byTab: Record<TabId, BrowserTabState>;
|
|
152
|
-
}
|
|
153
|
-
type BrowserActions = {
|
|
154
|
-
replace: (draft: BrowserState, tabId: TabId, state: BrowserTabState) => void;
|
|
155
|
-
forget: (draft: BrowserState, tabId: TabId) => void;
|
|
156
|
-
};
|
|
157
|
-
/**
|
|
158
|
-
* Declare the Session-scoped Browser persistence store.
|
|
159
|
-
* @returns a fresh store handle for Slot registration.
|
|
160
|
-
*/
|
|
161
|
-
declare function createBrowserStore(): EngineStoreHandle<BrowserState, BrowserActions>;
|
|
162
|
-
/** Browser store handle shared by body and title registrations. */
|
|
163
|
-
type BrowserStore = ReturnType<typeof createBrowserStore>;
|
|
164
|
-
/** One user-visible website entry. */
|
|
165
|
-
interface BrowserShortcut {
|
|
166
|
-
readonly id: string;
|
|
167
|
-
readonly title: string;
|
|
168
|
-
readonly url: string;
|
|
169
|
-
readonly iconKey?: string;
|
|
170
|
-
}
|
|
171
|
-
/** One shortcut as the start page renders and navigates it. */
|
|
172
|
-
interface StartPageShortcutView {
|
|
173
|
-
readonly id: string;
|
|
174
|
-
readonly title: string;
|
|
175
|
-
readonly url: string;
|
|
176
|
-
readonly iconKey: string;
|
|
177
|
-
/** Validated target; undefined when the stored address is unusable. */
|
|
178
|
-
readonly target: BrowserTarget | undefined;
|
|
179
|
-
}
|
|
180
|
-
/** One search engine as the address bar and engine menu use it. */
|
|
181
|
-
interface StartPageEngineView {
|
|
182
|
-
readonly id: string;
|
|
183
|
-
readonly label: string;
|
|
184
|
-
readonly homeUrl: string;
|
|
185
|
-
readonly searchUrl: string;
|
|
186
|
-
readonly queryParameter: string;
|
|
187
|
-
readonly extraParameters: Readonly<Record<string, string>>;
|
|
188
|
-
/** Whether the endpoint and parameters can produce a validated search address. */
|
|
189
|
-
readonly valid: boolean;
|
|
190
|
-
}
|
|
191
|
-
/** Domain-level projection of the shared preference section. */
|
|
192
|
-
interface StartPageData {
|
|
193
|
-
readonly defaultSearchEngineId: string;
|
|
194
|
-
readonly engines: readonly StartPageEngineView[];
|
|
195
|
-
readonly shortcuts: readonly StartPageShortcutView[];
|
|
196
|
-
}
|
|
197
|
-
/** A user-editable shortcut form value. */
|
|
198
|
-
interface ShortcutDraft {
|
|
199
|
-
readonly title: string;
|
|
200
|
-
readonly url: string;
|
|
201
|
-
/** Empty or absent selects the destination's local mark. */
|
|
202
|
-
readonly iconKey?: string;
|
|
203
|
-
}
|
|
204
|
-
/** A user-editable search-engine form value. */
|
|
205
|
-
interface SearchEngineDraft {
|
|
206
|
-
readonly label: string;
|
|
207
|
-
readonly homeUrl: string;
|
|
208
|
-
readonly searchUrl: string;
|
|
209
|
-
readonly queryParameter: string;
|
|
210
|
-
readonly extraParameters?: Readonly<Record<string, string>>;
|
|
211
|
-
}
|
|
212
|
-
/** Every refusal a start-page edit can report. */
|
|
213
|
-
type StartPageFailure = OmniboxRefusal | 'title' | 'label' | 'icon' | 'parameter' | 'parameters' | 'limit' | 'missing' | 'readonly' | 'unavailable' | 'conflict' | 'failed';
|
|
214
|
-
/** Render-facing shared preference state. */
|
|
215
|
-
interface StartPageSnapshot extends StartPageData {
|
|
216
|
-
readonly status: 'loading' | 'ready' | 'unavailable';
|
|
217
|
-
readonly writable: boolean;
|
|
218
|
-
readonly revision: number | undefined;
|
|
219
|
-
}
|
|
220
|
-
/** Result of one start-page edit. */
|
|
221
|
-
type StartPageWriteResult = {
|
|
222
|
-
readonly ok: true;
|
|
223
|
-
} | {
|
|
224
|
-
readonly ok: false;
|
|
225
|
-
readonly reason: StartPageFailure;
|
|
226
|
-
};
|
|
227
|
-
/** Start-page state, actions, and the resolver preferences read at submission time. */
|
|
228
|
-
interface BrowserStartPageInjected {
|
|
229
|
-
readonly hooks: {
|
|
230
|
-
readonly startPage: HostObservable<StartPageSnapshot>;
|
|
231
|
-
};
|
|
232
|
-
/** @returns current engines and selection for manual address-bar input. */
|
|
233
|
-
omniboxPreferences(): OmniboxPreferences;
|
|
234
|
-
/** @returns the selected engine when it can search. */
|
|
235
|
-
selectedEngine(): StartPageEngineView | undefined;
|
|
236
|
-
readonly shortcuts: {
|
|
237
|
-
add(draft: ShortcutDraft): Promise<StartPageWriteResult>;
|
|
238
|
-
update(id: string, draft: ShortcutDraft): Promise<StartPageWriteResult>;
|
|
239
|
-
remove(id: string): Promise<StartPageWriteResult>;
|
|
240
|
-
restore(shortcut: BrowserShortcut, index: number): Promise<StartPageWriteResult>;
|
|
241
|
-
move(id: string, offset: -1 | 1): Promise<StartPageWriteResult>;
|
|
242
|
-
reorder(ids: readonly string[]): Promise<StartPageWriteResult>;
|
|
243
|
-
};
|
|
244
|
-
readonly engines: {
|
|
245
|
-
setDefault(id: string): Promise<StartPageWriteResult>;
|
|
246
|
-
add(draft: SearchEngineDraft): Promise<StartPageWriteResult>;
|
|
247
|
-
update(id: string, draft: SearchEngineDraft): Promise<StartPageWriteResult>;
|
|
248
|
-
remove(id: string, replacementId?: string): Promise<StartPageWriteResult>;
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
/** How far one initialization got. */
|
|
252
|
-
type BrowserInitStage = 'accepted' | 'mounted' | 'navigating' | 'attached' | 'failed';
|
|
253
|
-
/** Machine reason carried by a failed receipt; the UI localizes it. */
|
|
254
|
-
type BrowserInitFailure = 'occurrence-aborted' | 'controller-missing' | 'workspace-unavailable' | 'acquire-failed' | 'guest-bootstrap-failed' | 'navigation-failed' | 'navigation-rejected' | 'timeout';
|
|
255
|
-
/** One immutable observation of an initialization attempt. */
|
|
256
|
-
interface BrowserInitReceipt {
|
|
257
|
-
readonly requestId: string;
|
|
258
|
-
readonly sessionId: string;
|
|
259
|
-
readonly tabId: TabId;
|
|
260
|
-
/** Distinguishes a reopened tab from its previous lifetime. */
|
|
261
|
-
readonly occurrenceId: string;
|
|
262
|
-
/** The navigation record this request was aimed at. */
|
|
263
|
-
readonly navigationRevision: number;
|
|
264
|
-
readonly url: string;
|
|
265
|
-
readonly stage: BrowserInitStage;
|
|
266
|
-
/** Present once the carrier reports an attached guest/document. */
|
|
267
|
-
readonly guestId?: string;
|
|
268
|
-
/** Present only when `stage === 'failed'`. */
|
|
269
|
-
readonly reason?: BrowserInitFailure;
|
|
270
|
-
/** Original carrier failure text, when the failed stage supplied it. */
|
|
271
|
-
readonly detail?: string;
|
|
272
|
-
/** Epoch milliseconds; diagnostic only, never used for ordering. */
|
|
273
|
-
readonly at: number;
|
|
274
|
-
}
|
|
275
|
-
/** Exact read capability for a caller observing its own pending navigation. */
|
|
276
|
-
interface BrowserInitializationReader {
|
|
277
|
-
readonly protocolVersion: 1;
|
|
278
|
-
read(query: {
|
|
279
|
-
readonly sessionId: string;
|
|
280
|
-
readonly tabId: TabId;
|
|
281
|
-
readonly url: string;
|
|
282
|
-
readonly requestId?: string;
|
|
283
|
-
}): BrowserInitReceipt | undefined;
|
|
284
|
-
}
|
|
285
|
-
/** Live tab state; navigation comes from its provider and draft validation stays local. */
|
|
286
|
-
interface BrowserControllerState {
|
|
287
|
-
readonly frame: BrowserFrameState;
|
|
288
|
-
/** Saved address offered for explicit restoration before any page has been requested. */
|
|
289
|
-
readonly restoreTarget: BrowserTarget | undefined;
|
|
290
|
-
readonly addressFailure: OmniboxRefusal | undefined;
|
|
291
|
-
/** Counts explicit navigation commands; a page changing on its own leaves the address draft intact. */
|
|
292
|
-
readonly commandRevision: number;
|
|
293
|
-
/** Prefilled new-shortcut form requested from the tab's actions menu. */
|
|
294
|
-
readonly shortcutDraft: ShortcutDraft | undefined;
|
|
295
|
-
/** Last explicit initialization receipt for this occurrence; failed stages are visible. */
|
|
296
|
-
readonly initialization: BrowserInitReceipt | undefined;
|
|
297
|
-
}
|
|
298
|
-
/** Values available once a Sidebar body has committed its content container. */
|
|
299
|
-
interface BrowserMountRequest {
|
|
300
|
-
readonly tabId: TabId;
|
|
301
|
-
/** DSH Session; recorded in every initialization receipt. */
|
|
302
|
-
readonly sessionId?: string;
|
|
303
|
-
/** The navigation record revision this mount represents. */
|
|
304
|
-
readonly navigationRevision?: number;
|
|
305
|
-
readonly signal: AbortSignal;
|
|
306
|
-
readonly viewportId: string;
|
|
307
|
-
readonly applicationOrigin: string;
|
|
308
|
-
readonly initial: BrowserTabState | undefined;
|
|
309
|
-
readonly initialUrl: string | undefined;
|
|
310
|
-
readonly openTab: (url: string) => void;
|
|
311
|
-
readonly omnibox?: () => OmniboxPreferences;
|
|
312
|
-
}
|
|
313
|
-
/** Result of aiming a tab at a URL; `controller-missing` is the recoverable failure. */
|
|
314
|
-
type BrowserNavigationOutcome = {
|
|
315
|
-
readonly ok: true;
|
|
316
|
-
readonly requestId: string;
|
|
317
|
-
} | {
|
|
318
|
-
readonly ok: false;
|
|
319
|
-
readonly reason: BrowserInitFailure;
|
|
320
|
-
};
|
|
321
|
-
/** Plain Slot callbacks and a framework-bound state source, not a desktop protocol. */
|
|
322
|
-
interface BrowserInjected extends BrowserStartPageInjected {
|
|
323
|
-
readonly keyedHooks: {
|
|
324
|
-
readonly browserState: (key: string) => HostObservable<BrowserControllerState> | undefined;
|
|
325
|
-
};
|
|
326
|
-
/** @param request - committed tab and container. @returns ends physical attachment without closing the tab. */
|
|
327
|
-
mount(request: BrowserMountRequest): () => void;
|
|
328
|
-
/** @returns after every page has been disposed. */
|
|
329
|
-
dispose(): Promise<void>;
|
|
330
|
-
/** @param actions - writer from a recreated Session binding. */
|
|
331
|
-
rebind(actions: BoundActions<BrowserStore>): void;
|
|
332
|
-
/** @param tabId - owning tab. @param value - address input. */
|
|
333
|
-
loadUrl(tabId: TabId, value: string): BrowserNavigationOutcome;
|
|
334
|
-
/** @param tabId - owning tab. @param value - manual address-bar input resolved as URL or search. */
|
|
335
|
-
submitInput(tabId: TabId, value: string): BrowserNavigationOutcome;
|
|
336
|
-
/**
|
|
337
|
-
* Aim an existing (or recoverable) tab at one navigation record revision.
|
|
338
|
-
* Used by the body's revision effect; it never creates a second tab.
|
|
339
|
-
*/
|
|
340
|
-
navigate(tabId: TabId, request: {
|
|
341
|
-
readonly url: string;
|
|
342
|
-
readonly navigationRevision: number;
|
|
343
|
-
readonly requestId?: string;
|
|
344
|
-
}): BrowserNavigationOutcome;
|
|
345
|
-
/** @param tabId - owning tab. @returns the latest initialization receipt. */
|
|
346
|
-
initialization(tabId: TabId): BrowserInitReceipt | undefined;
|
|
347
|
-
/** Newest-first receipts for diagnostics; bounded by the shared journal. */
|
|
348
|
-
initializationLog(): readonly BrowserInitReceipt[];
|
|
349
|
-
/** Capability marker: a caller may rely on receipts only when this is true. */
|
|
350
|
-
readonly initializationReceipts: true;
|
|
351
|
-
/** @param tabId - tab whose saved address the user requested to restore. */
|
|
352
|
-
restore(tabId: TabId): void;
|
|
353
|
-
/** @param tabId - owning tab. */
|
|
354
|
-
goBack(tabId: TabId): void;
|
|
355
|
-
/** @param tabId - owning tab. */
|
|
356
|
-
goForward(tabId: TabId): void;
|
|
357
|
-
/** Restore a saved address or reload its page. @param tabId - owning tab. */
|
|
358
|
-
reload(tabId: TabId): void;
|
|
359
|
-
/** @param tabId - owning tab. @param enabled - provider's optional sandbox control. */
|
|
360
|
-
setSandbox(tabId: TabId, enabled: boolean): void;
|
|
361
|
-
/** @param tabId - owning tab. @param focus - focuses the mounted address bar. @returns unregister callback. */
|
|
362
|
-
bindAddressFocus(tabId: TabId, focus: () => void): () => void;
|
|
363
|
-
/** @param tabId - owning tab. @returns whether a mounted address bar can take focus. */
|
|
364
|
-
canFocusAddress(tabId: TabId): boolean;
|
|
365
|
-
/** @param tabId - owning tab. @returns whether a mounted address bar received focus. */
|
|
366
|
-
focusAddress(tabId: TabId): boolean;
|
|
367
|
-
/** @param tabId - owning tab. @returns the current confirmable page address and title. */
|
|
368
|
-
pageInfo(tabId: TabId): {
|
|
369
|
-
readonly url: string;
|
|
370
|
-
readonly title: string;
|
|
371
|
-
} | undefined;
|
|
372
|
-
/** @param tabId - owning tab. @param draft - current page address and title. @returns whether the form opened. */
|
|
373
|
-
requestShortcut(tabId: TabId, draft: ShortcutDraft): boolean;
|
|
374
|
-
/** @param tabId - owning tab. */
|
|
375
|
-
dismissShortcut(tabId: TabId): void;
|
|
376
|
-
}
|
|
377
|
-
/** Browser body props assembled by the tab seat. */
|
|
378
|
-
type BrowserBodyProps = PropsRuntime<'sidebar.right.pane.tab'> & PropsStore<BrowserStore> & PropsLocale<'sidebarBrowser'> & InjectFace<BrowserInjected>;
|
|
379
|
-
/** Locale-owned Browser tab copy. */
|
|
380
|
-
declare const zh: {
|
|
381
|
-
'type.label': string;
|
|
382
|
-
'guide.title': string;
|
|
383
|
-
'guide.description': string;
|
|
384
|
-
'shortcut.noSession': string;
|
|
385
|
-
'address.placeholder': string;
|
|
386
|
-
'address.changed': string;
|
|
387
|
-
back: string;
|
|
388
|
-
forward: string;
|
|
389
|
-
reload: string;
|
|
390
|
-
go: string;
|
|
391
|
-
external: string;
|
|
392
|
-
'sandbox.disable': string;
|
|
393
|
-
'sandbox.enable': string;
|
|
394
|
-
'sandbox.warning': string;
|
|
395
|
-
start: string;
|
|
396
|
-
loading: string;
|
|
397
|
-
'restore.previous': string;
|
|
398
|
-
'restore.action': string;
|
|
399
|
-
'error.empty': string;
|
|
400
|
-
'error.invalid': string;
|
|
401
|
-
'error.protocol': string;
|
|
402
|
-
'error.credentials': string;
|
|
403
|
-
'error.application-origin': string;
|
|
404
|
-
'load.failed': string;
|
|
405
|
-
'load.failed.detail': string;
|
|
406
|
-
'init.failed.occurrence-aborted': string;
|
|
407
|
-
'init.failed.controller-missing': string;
|
|
408
|
-
'init.failed.workspace-unavailable': string;
|
|
409
|
-
'init.failed.acquire-failed': string;
|
|
410
|
-
'init.failed.guest-bootstrap-failed': string;
|
|
411
|
-
'init.failed.navigation-failed': string;
|
|
412
|
-
'init.failed.navigation-rejected': string;
|
|
413
|
-
'init.failed.timeout': string;
|
|
414
|
-
'address.unknown': string;
|
|
415
|
-
'address.openHint': string;
|
|
416
|
-
'address.searchHint': string;
|
|
417
|
-
'address.searchThis': string;
|
|
418
|
-
'address.shortcut': string;
|
|
419
|
-
'address.focus': string;
|
|
420
|
-
'address.focus.blocked': string;
|
|
421
|
-
'startpage.title': string;
|
|
422
|
-
'startpage.add': string;
|
|
423
|
-
'startpage.addTitle': string;
|
|
424
|
-
'startpage.editTitle': string;
|
|
425
|
-
'startpage.empty': string;
|
|
426
|
-
'startpage.loading': string;
|
|
427
|
-
'startpage.unavailable': string;
|
|
428
|
-
'startpage.manage': string;
|
|
429
|
-
'startpage.done': string;
|
|
430
|
-
'startpage.edit': string;
|
|
431
|
-
'startpage.delete': string;
|
|
432
|
-
'startpage.moveEarlier': string;
|
|
433
|
-
'startpage.moveLater': string;
|
|
434
|
-
'startpage.deleted': string;
|
|
435
|
-
'startpage.undo': string;
|
|
436
|
-
'startpage.lateSuccess': string;
|
|
437
|
-
'startpage.invalidUrl': string;
|
|
438
|
-
'startpage.name': string;
|
|
439
|
-
'startpage.namePlaceholder': string;
|
|
440
|
-
'startpage.url': string;
|
|
441
|
-
'startpage.urlPlaceholder': string;
|
|
442
|
-
'startpage.save': string;
|
|
443
|
-
'startpage.cancel': string;
|
|
444
|
-
'startpage.icon': string;
|
|
445
|
-
'startpage.icon.auto': string;
|
|
446
|
-
'startpage.icon.globe': string;
|
|
447
|
-
'startpage.icon.letter': string;
|
|
448
|
-
'startpage.addFromPage': string;
|
|
449
|
-
'startpage.open': string;
|
|
450
|
-
'startpage.openNewTab': string;
|
|
451
|
-
'startpage.engine': string;
|
|
452
|
-
'startpage.engine.manage': string;
|
|
453
|
-
'startpage.engine.add': string;
|
|
454
|
-
'startpage.engine.edit': string;
|
|
455
|
-
'startpage.engine.default': string;
|
|
456
|
-
'startpage.engine.setDefault': string;
|
|
457
|
-
'startpage.engine.name': string;
|
|
458
|
-
'startpage.engine.home': string;
|
|
459
|
-
'startpage.engine.search': string;
|
|
460
|
-
'startpage.engine.parameter': string;
|
|
461
|
-
'startpage.engine.extra': string;
|
|
462
|
-
'startpage.engine.remove': string;
|
|
463
|
-
'startpage.engine.replacement': string;
|
|
464
|
-
'startpage.engine.last': string;
|
|
465
|
-
'error.path': string;
|
|
466
|
-
'error.engine-unavailable': string;
|
|
467
|
-
'error.title': string;
|
|
468
|
-
'error.label': string;
|
|
469
|
-
'error.icon': string;
|
|
470
|
-
'error.parameter': string;
|
|
471
|
-
'error.parameters': string;
|
|
472
|
-
'error.limit': string;
|
|
473
|
-
'error.missing': string;
|
|
474
|
-
'error.readonly': string;
|
|
475
|
-
'error.unavailable': string;
|
|
476
|
-
'error.conflict': string;
|
|
477
|
-
'error.failed': string;
|
|
478
|
-
};
|
|
479
|
-
/** Browser dictionary key union. */
|
|
480
|
-
type SidebarBrowserKey = keyof typeof zh;
|
|
481
|
-
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
482
|
-
interface LocaleNamespaceMap {
|
|
483
|
-
/** Sidebar Browser labels, navigation controls, and failures. */
|
|
484
|
-
sidebarBrowser: SidebarBrowserKey;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
declare module '@deepseek-ai/cordis' {
|
|
488
|
-
interface Context {
|
|
489
|
-
/** Read initialization receipts for one exact Session/tab/document request. */
|
|
490
|
-
sidebarBrowserInitialization: BrowserInitializationReader;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
declare module '@deepseek-ai/dsh-client-ui-sidebar-right/client' {
|
|
494
|
-
interface SidebarRightTabParamsMap {
|
|
495
|
-
/** Optional initial Browser URL. */
|
|
496
|
-
browser: {
|
|
497
|
-
readonly url?: string;
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
declare module '@deepseek-ai/dsh-client-ui-context-menu/client' {
|
|
502
|
-
interface ContextMenuTargetMap {
|
|
503
|
-
/** One start-page shortcut card; the originating tab owns the menu. */
|
|
504
|
-
shortcut: {
|
|
505
|
-
readonly sessionId: BrowserBodyProps['sessionId'];
|
|
506
|
-
readonly tabId: TabId;
|
|
507
|
-
readonly title: string;
|
|
508
|
-
readonly url: string;
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
/** Required Browser services. */
|
|
513
|
-
export declare const inject: string[];
|
|
514
|
-
/** Register the Browser type, localized guide entry, body, and title. */
|
|
515
|
-
export declare function apply(ctx: Context): void;
|
|
516
|
-
export type { BrowserAddressFailure, BrowserAddressResult, BrowserBodyProps, BrowserControllerState, BrowserFailure, BrowserFrame, BrowserFrameState, BrowserHistoryEntry, BrowserInjected, BrowserLoadError, BrowserMountRequest, BrowserNavigationStatus, BrowserPage, BrowserPageFactory, BrowserPageOptions, BrowserPresentation, BrowserSandboxControl, BrowserState, BrowserTabState, BrowserTarget, SidebarBrowserKey };
|