dsh-workbuddy-bridge 0.5.7 → 0.5.8
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/lib/bin.js +1 -1
- package/lib/client.js +45 -27
- package/lib/{heartbeat-C5YGccWb.js → heartbeat-CaRoYefq.js} +1 -1
- package/lib/index.js +10 -1
- package/package.json +1 -1
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as variantFor, D as WorkBuddyUpstreamClient, Q as resolveAppVersion, S as WORKBUDDY_VARIANTS, a as readHostHeartbeat, c as WORKBUDDY_BRIDGE_VERSION, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, o as workbuddyHostHeartbeatPath, r as isHeartbeatProcessAlive, u as FALLBACK_WORKBUDDY_MODELS, x as CN_VARIANT } from "./heartbeat-
|
|
2
|
+
import { C as variantFor, D as WorkBuddyUpstreamClient, Q as resolveAppVersion, S as WORKBUDDY_VARIANTS, a as readHostHeartbeat, c as WORKBUDDY_BRIDGE_VERSION, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, o as workbuddyHostHeartbeatPath, r as isHeartbeatProcessAlive, u as FALLBACK_WORKBUDDY_MODELS, x as CN_VARIANT } from "./heartbeat-CaRoYefq.js";
|
|
3
3
|
import { realpathSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
//#region src/cli/bin.ts
|
package/lib/client.js
CHANGED
|
@@ -1664,7 +1664,7 @@ window.__ModuleLoader__.load({
|
|
|
1664
1664
|
}
|
|
1665
1665
|
//#endregion
|
|
1666
1666
|
//#region \0workbuddy-css:/home/runner/work/dsh-workbuddy-bridge/dsh-workbuddy-bridge/src/client/probe-control.module.css.js
|
|
1667
|
-
const css$2 = ".EVr7sG_wrapper{align-items:center;display:inline-flex;position:relative}.EVr7sG_trigger{corner-shape:round;cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:999px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.EVr7sG_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.EVr7sG_trigger:disabled{cursor:default;color:var(--dsw-alias-label-dimmed)}.EVr7sG_trigger:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}.EVr7sG_panel{isolation:isolate;z-index:1100;box-sizing:border-box;border-radius:var(--dsw-radius-lg);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);width:max-content;min-width:min(280px,100vw - 24px);max-width:min(360px,100vw - 24px);box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-secondary);cursor:default;border:0;padding:12px;font-size:12px;line-height:1.5;position:fixed}.EVr7sG_panel:before{z-index:-1;border-radius:inherit;background:var(--dsw-specific-menu);backdrop-filter:var(--dsw-menu-backdrop-filter);content:\"\";pointer-events:none;position:absolute;inset:0}.EVr7sG_panelTitle{color:var(--dsw-alias-label-primary);align-items:center;gap:8px;font-size:13px;font-weight:500;line-height:1.5;display:flex}.EVr7sG_panelTitleIcon{color:var(--dsw-alias-label-secondary);flex:none;align-items:center;display:inline-flex}.EVr7sG_panelTitleText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.EVr7sG_titleRule{border-top:.5px solid var(--dsw-alias-border-l2);margin:8px 0 10px}.EVr7sG_levelsLabel{color:var(--dsw-alias-label-tertiary);margin:0 0 2px;font-size:12px;line-height:1.5}.EVr7sG_levels{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0;font-size:13px;font-weight:500;line-height:1.5}.EVr7sG_note,.EVr7sG_dim{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.6}.EVr7sG_dim{margin-top:2px}.EVr7sG_panelActions{justify-content:flex-end;gap:8px;margin-top:12px;display:flex}";
|
|
1667
|
+
const css$2 = ".EVr7sG_wrapper{align-items:center;display:inline-flex;position:relative}.EVr7sG_trigger{corner-shape:round;cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-secondary);anchor-name:var(--dsh-workbuddy-probe-anchor);background:0 0;border:none;border-radius:999px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.EVr7sG_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.EVr7sG_trigger:disabled{cursor:default;color:var(--dsw-alias-label-dimmed)}.EVr7sG_trigger:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}.EVr7sG_panel{isolation:isolate;z-index:1100;box-sizing:border-box;position-anchor:var(--dsh-workbuddy-probe-anchor);top:max(12px, var(--dsh-frame-overlay-top,12px));bottom:max(12px, calc(anchor(top) + 8px));left:max(12px, anchor(left));position-try-fallbacks:--dsh-workbuddy-probe-flush-end;border-radius:var(--dsw-radius-lg);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);width:max-content;min-width:min(280px,100vw - 24px);max-width:min(360px,100vw - 24px);height:fit-content;box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-secondary);cursor:default;border:0;place-self:safe end start;padding:12px;font-size:12px;line-height:1.5;position:fixed;right:12px}@position-try --dsh-workbuddy-probe-flush-end{left:12px;justify-self:safe end}.EVr7sG_panel:before{z-index:-1;border-radius:inherit;background:var(--dsw-specific-menu);backdrop-filter:var(--dsw-menu-backdrop-filter);content:\"\";pointer-events:none;position:absolute;inset:0}.EVr7sG_panelTitle{color:var(--dsw-alias-label-primary);align-items:center;gap:8px;font-size:13px;font-weight:500;line-height:1.5;display:flex}.EVr7sG_panelTitleIcon{color:var(--dsw-alias-label-secondary);flex:none;align-items:center;display:inline-flex}.EVr7sG_panelTitleText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.EVr7sG_titleRule{border-top:.5px solid var(--dsw-alias-border-l2);margin:8px 0 10px}.EVr7sG_levelsLabel{color:var(--dsw-alias-label-tertiary);margin:0 0 2px;font-size:12px;line-height:1.5}.EVr7sG_levels{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0;font-size:13px;font-weight:500;line-height:1.5}.EVr7sG_note,.EVr7sG_dim{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.6}.EVr7sG_dim{margin-top:2px}.EVr7sG_panelActions{justify-content:flex-end;gap:8px;margin-top:12px;display:flex}";
|
|
1668
1668
|
const tagId$2 = "dsh-workbuddy-bridge/probe-control.module.css";
|
|
1669
1669
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
1670
1670
|
const tag = document.createElement("style");
|
|
@@ -1714,12 +1714,25 @@ window.__ModuleLoader__.load({
|
|
|
1714
1714
|
* it belongs next to the thing it acts on.
|
|
1715
1715
|
*
|
|
1716
1716
|
* The popover surface follows `dsh-ds-balance`'s balance popover, which itself
|
|
1717
|
-
* copies the host's own stat dialog: a portal to `document.body`,
|
|
1718
|
-
* the host's `
|
|
1719
|
-
*
|
|
1720
|
-
* `--dsw-menu-backdrop-filter` (the pair the host requires together — fill
|
|
1717
|
+
* copies the host's own stat dialog: a portal to `document.body`, dismissed by
|
|
1718
|
+
* the host's `useDismissOnOutsidePointer`, skinned with `--dsw-specific-menu`
|
|
1719
|
+
* plus `--dsw-menu-backdrop-filter` (the pair the host requires together — fill
|
|
1721
1720
|
* alone is "translucent but not frosted").
|
|
1722
1721
|
*
|
|
1722
|
+
* Its **placement is CSS, not JavaScript**: the trigger carries a unique
|
|
1723
|
+
* `anchor-name`, the panel names it in `position-anchor`, and the insets in
|
|
1724
|
+
* `probe-control.module.css` put the panel 8px above the trigger while keeping
|
|
1725
|
+
* 12px viewport margins. That replaced the host's old anchored-position hook,
|
|
1726
|
+
* which the 0.2.2 rc line **removed** (its migration guide prescribes exactly
|
|
1727
|
+
* this). The dead import kept compiling here because this repo's devDependencies
|
|
1728
|
+
* sit one rc behind the running host, and only threw in the browser — and only
|
|
1729
|
+
* once a WorkBuddy model was actually selected, which is why it stayed latent.
|
|
1730
|
+
* The removed symbol's name is deliberately **not written here**: the bundle
|
|
1731
|
+
* keeps comments, and `tests/redlines.spec.ts` greps the built artifact for it,
|
|
1732
|
+
* so a reintroduced import cannot come back quietly. That is the same trade the
|
|
1733
|
+
* bundle's inline-runtime guard already makes — it too fires on prose, so the
|
|
1734
|
+
* wording of comments in this half is part of the contract.
|
|
1735
|
+
*
|
|
1723
1736
|
* **The filter must not sit on the panel itself**: a non-`none`
|
|
1724
1737
|
* `backdrop-filter` makes the element the containing block for its fixed
|
|
1725
1738
|
* descendants, and this panel contains non-portal `Tooltip` bubbles. The fill
|
|
@@ -1731,18 +1744,19 @@ window.__ModuleLoader__.load({
|
|
|
1731
1744
|
/** How often the control re-checks state when the window regains focus. */
|
|
1732
1745
|
const RECONCILE_MS = 6e4;
|
|
1733
1746
|
/**
|
|
1734
|
-
*
|
|
1735
|
-
*
|
|
1736
|
-
*
|
|
1747
|
+
* The custom property that carries this control's anchor name.
|
|
1748
|
+
*
|
|
1749
|
+
* The name itself has to be **unique per instance** — two composers, or a
|
|
1750
|
+
* remount, would otherwise point two panels at one trigger — so it is derived
|
|
1751
|
+
* from `useId` and handed to CSS through this variable. Both the trigger
|
|
1752
|
+
* (`anchor-name`) and the portalled panel (`position-anchor`) read it, which is
|
|
1753
|
+
* how the host's own model picker wires its menu.
|
|
1754
|
+
*
|
|
1755
|
+
* Geometry lives entirely in `probe-control.module.css`: the 8px gap, the 12px
|
|
1756
|
+
* viewport margins, the size caps and the right-edge fallback are all CSS, so
|
|
1757
|
+
* nothing here measures an element or reacts to scroll.
|
|
1737
1758
|
*/
|
|
1738
|
-
const
|
|
1739
|
-
visibility: "hidden",
|
|
1740
|
-
left: 0,
|
|
1741
|
-
top: 0
|
|
1742
|
-
};
|
|
1743
|
-
/** Gap between the control and the popover, and the viewport margin it keeps. */
|
|
1744
|
-
const POPOVER_GAP = 8;
|
|
1745
|
-
const POPOVER_MARGIN = 12;
|
|
1759
|
+
const ANCHOR_PROPERTY = "--dsh-workbuddy-probe-anchor";
|
|
1746
1760
|
/** One model's row out of the probe section's single list. */
|
|
1747
1761
|
function effortModelFor(status, model) {
|
|
1748
1762
|
if (status.status !== "signed-in") return void 0;
|
|
@@ -1867,12 +1881,23 @@ window.__ModuleLoader__.load({
|
|
|
1867
1881
|
const [fresh, setFresh] = (0, react.useState)();
|
|
1868
1882
|
const inFlight = (0, react.useRef)(false);
|
|
1869
1883
|
const mounted = (0, react.useRef)(false);
|
|
1884
|
+
/**
|
|
1885
|
+
* This control's anchor name, unique per instance.
|
|
1886
|
+
*
|
|
1887
|
+
* Generated here rather than in the panel because the **trigger** is what CSS
|
|
1888
|
+
* anchors onto, and the control exists before the panel does. The panel is
|
|
1889
|
+
* portalled to `document.body`, so it inherits nothing: both elements get the
|
|
1890
|
+
* property inline, and the stylesheet reads it on each side
|
|
1891
|
+
* (`anchor-name` on the trigger, `position-anchor` on the panel).
|
|
1892
|
+
*/
|
|
1893
|
+
const anchorStyle = { [ANCHOR_PROPERTY]: `--dsh-workbuddy-probe-${(0, react.useId)().replaceAll(":", "")}` };
|
|
1870
1894
|
/** The control itself: the popover's anchor and the "inside" test for dismissal. */
|
|
1871
1895
|
const rootRef = (0, react.useRef)(null);
|
|
1872
1896
|
/**
|
|
1873
1897
|
* The panel, portalled to `document.body` so it is not clipped by the composer
|
|
1874
|
-
* row.
|
|
1875
|
-
*
|
|
1898
|
+
* row. Passed to the outside-pointer test, which would otherwise read a click
|
|
1899
|
+
* on the panel as a click outside it. Its *placement* needs no ref: CSS anchors
|
|
1900
|
+
* resolve it against the trigger.
|
|
1876
1901
|
*/
|
|
1877
1902
|
const panelRef = (0, react.useRef)(null);
|
|
1878
1903
|
(0, react.useEffect)(() => {
|
|
@@ -1944,14 +1969,6 @@ window.__ModuleLoader__.load({
|
|
|
1944
1969
|
if (mounted.current) setBusy(false);
|
|
1945
1970
|
}
|
|
1946
1971
|
};
|
|
1947
|
-
const position = (0, _deepseek_ai_dsh_client_ui_primitives.useAnchoredPosition)({
|
|
1948
|
-
open,
|
|
1949
|
-
anchorRef: rootRef,
|
|
1950
|
-
panelRef,
|
|
1951
|
-
side: "top",
|
|
1952
|
-
gap: POPOVER_GAP,
|
|
1953
|
-
margin: POPOVER_MARGIN
|
|
1954
|
-
});
|
|
1955
1972
|
(0, _deepseek_ai_dsh_client_ui_primitives.useDismissOnOutsidePointer)(rootRef, open, () => {
|
|
1956
1973
|
setOpen(false);
|
|
1957
1974
|
}, panelRef);
|
|
@@ -1979,6 +1996,7 @@ window.__ModuleLoader__.load({
|
|
|
1979
1996
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1980
1997
|
type: "button",
|
|
1981
1998
|
className: probe_control_module_css_default.trigger,
|
|
1999
|
+
style: anchorStyle,
|
|
1982
2000
|
"aria-label": text,
|
|
1983
2001
|
"aria-busy": busy,
|
|
1984
2002
|
"aria-expanded": open,
|
|
@@ -1990,7 +2008,7 @@ window.__ModuleLoader__.load({
|
|
|
1990
2008
|
})
|
|
1991
2009
|
}), open ? (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProbePanel, {
|
|
1992
2010
|
panelRef,
|
|
1993
|
-
style:
|
|
2011
|
+
style: anchorStyle,
|
|
1994
2012
|
model,
|
|
1995
2013
|
lit,
|
|
1996
2014
|
levels,
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as validAppVersion, A as modelWithCurrentPromotion, B as upstreamDisplayMessage, C as variantFor, D as WorkBuddyUpstreamClient, F as regionOf, G as readCliVersion, H as FALLBACK_CN_APP_VERSION, I as PROBE_EFFORT_CANDIDATES, J as WORKBUDDY_APP_VERSION_FILENAME, K as resolveChatIdentity, L as probeModel, M as parseModelCatalog, N as prepareChatBody, O as isChannelGateBody, P as prepareInternationalChatBody, Q as resolveAppVersion, R as randomSentinel, S as WORKBUDDY_VARIANTS, U as chatUserAgent, V as CN_APP_VERSION_FILENAME, W as fallbackChatIdentity, X as installedAppVersion, Y as appUserAgent, Z as readBundleVersion, _ as desktopAuthCandidatesFor, a as readHostHeartbeat, b as AI_VARIANT, c as WORKBUDDY_BRIDGE_VERSION, d as WorkBuddyCatalog, f as WORKBUDDY_AUTH_FILENAME, g as defaultDesktopAuthPath, h as defaultDesktopAuthCandidates, i as processStartTimeMs, j as normalizeCredits, k as isPlanLimitBody, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, n as clearHostHeartbeat, o as workbuddyHostHeartbeatPath, p as WORKBUDDY_AUTH_FILE_ENV, q as validCliVersion, r as isHeartbeatProcessAlive, s as writeHostHeartbeat, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, u as FALLBACK_WORKBUDDY_MODELS, v as parseWorkBuddyAuth, w as WORKBUDDY_CREDIT_PATH, x as CN_VARIANT, y as workbuddyOwnAuthPath, z as classifyUpstreamError } from "./heartbeat-
|
|
1
|
+
import { $ as validAppVersion, A as modelWithCurrentPromotion, B as upstreamDisplayMessage, C as variantFor, D as WorkBuddyUpstreamClient, F as regionOf, G as readCliVersion, H as FALLBACK_CN_APP_VERSION, I as PROBE_EFFORT_CANDIDATES, J as WORKBUDDY_APP_VERSION_FILENAME, K as resolveChatIdentity, L as probeModel, M as parseModelCatalog, N as prepareChatBody, O as isChannelGateBody, P as prepareInternationalChatBody, Q as resolveAppVersion, R as randomSentinel, S as WORKBUDDY_VARIANTS, U as chatUserAgent, V as CN_APP_VERSION_FILENAME, W as fallbackChatIdentity, X as installedAppVersion, Y as appUserAgent, Z as readBundleVersion, _ as desktopAuthCandidatesFor, a as readHostHeartbeat, b as AI_VARIANT, c as WORKBUDDY_BRIDGE_VERSION, d as WorkBuddyCatalog, f as WORKBUDDY_AUTH_FILENAME, g as defaultDesktopAuthPath, h as defaultDesktopAuthCandidates, i as processStartTimeMs, j as normalizeCredits, k as isPlanLimitBody, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, n as clearHostHeartbeat, o as workbuddyHostHeartbeatPath, p as WORKBUDDY_AUTH_FILE_ENV, q as validCliVersion, r as isHeartbeatProcessAlive, s as writeHostHeartbeat, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, u as FALLBACK_WORKBUDDY_MODELS, v as parseWorkBuddyAuth, w as WORKBUDDY_CREDIT_PATH, x as CN_VARIANT, y as workbuddyOwnAuthPath, z as classifyUpstreamError } from "./heartbeat-CaRoYefq.js";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
|
|
@@ -353,9 +353,18 @@ const WORKBUDDY_STREAM_IDLE_TIMEOUT_MS = 3e5;
|
|
|
353
353
|
* Image-request budgets at the dsh-llm-pi-ai defaults; the profile type made
|
|
354
354
|
* them required in 0.1.1-rc.2. They bound requests to models whose catalog
|
|
355
355
|
* entry declares `supportsImages`; text-only models never receive images.
|
|
356
|
+
*
|
|
357
|
+
* The **retained-count** pair joined them in the 0.2.2 rc line, with the same
|
|
358
|
+
* defaults the host's own config schema applies: at most 50 image occurrences
|
|
359
|
+
* per request, overflowing 10 at a time. Both are whole-request bounds on a
|
|
360
|
+
* deterministic inline request version, so the route simply adopts the host's
|
|
361
|
+
* defaults rather than inventing tighter ones — crossing them would rewrite
|
|
362
|
+
* the request prefix, which this route never has a reason to do.
|
|
356
363
|
*/
|
|
357
364
|
const REQUEST_IMAGE_BUDGETS = {
|
|
358
365
|
maxRequestImageBytes: 20971520,
|
|
366
|
+
maxRequestImages: 50,
|
|
367
|
+
imageOffloadCountQuantum: 10,
|
|
359
368
|
requestImagePixelBudget: 4194304,
|
|
360
369
|
requestImageMaxBytes: 1048576
|
|
361
370
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-workbuddy-bridge",
|
|
3
3
|
"displayName": "DSH WorkBuddy Bridge",
|
|
4
4
|
"description": "将 WorkBuddy 桌面 App 包含的模型自动接入 DeepSeek Harness — bring WorkBuddy desktop app models into DeepSeek Harness with zero configuration.",
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.8",
|
|
6
6
|
"author": "zlZayn",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"dsh",
|