dsh-local-link 0.2.1 → 1.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/CHANGELOG.md +46 -0
- package/README.md +66 -29
- package/SECURITY.md +1 -1
- package/docs/ARCHITECTURE.md +24 -17
- package/docs/COMPATIBILITY.md +51 -0
- package/docs/DIAGNOSTICS.md +2 -1
- package/docs/MOBILE_VIEW.md +4 -4
- package/docs/SECURITY.md +7 -6
- package/lib/client.js +20 -13
- package/lib/client.js.map +1 -1
- package/lib/index.mjs +143 -15
- package/package.json +32 -23
package/lib/client.js
CHANGED
|
@@ -443,6 +443,9 @@ window.__ModuleLoader__.load({
|
|
|
443
443
|
const MOBILE_AGENT_PRESET_PRIORITY = -100;
|
|
444
444
|
const MOBILE_SESSION_LOG_PRIORITY = -100;
|
|
445
445
|
const MOBILE_STATS_PRIORITY = -100;
|
|
446
|
+
function sessionAgentPreset(summary) {
|
|
447
|
+
return summary.projectionValues?.agentPreset;
|
|
448
|
+
}
|
|
446
449
|
var MobileSessionInfoController = class {
|
|
447
450
|
snapshot = Object.freeze({ open: false });
|
|
448
451
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -536,7 +539,7 @@ window.__ModuleLoader__.load({
|
|
|
536
539
|
}
|
|
537
540
|
function formatSessionTokens(value) {
|
|
538
541
|
const scaled = (n) => n >= 100 ? String(Math.round(n)) : String(Math.round(n * 10) / 10);
|
|
539
|
-
if (value < 1e3) return
|
|
542
|
+
if (value < 1e3) return scaled(value);
|
|
540
543
|
if (value < 1e6) return `${scaled(value / 1e3)}K`;
|
|
541
544
|
return `${scaled(value / 1e6)}M`;
|
|
542
545
|
}
|
|
@@ -592,13 +595,17 @@ window.__ModuleLoader__.load({
|
|
|
592
595
|
const model = group.models.map(recordOf).find((candidate) => candidate?.id === modelId);
|
|
593
596
|
return typeof model?.name === "string" ? model.name : modelId;
|
|
594
597
|
}
|
|
595
|
-
function lastUsedModel(
|
|
596
|
-
|
|
597
|
-
|
|
598
|
+
function lastUsedModel(value) {
|
|
599
|
+
const nodes = recordOf(value)?.nodes;
|
|
600
|
+
if (!Array.isArray(nodes)) return void 0;
|
|
601
|
+
for (let index = nodes.length - 1; index >= 0; index -= 1) {
|
|
602
|
+
const node = recordOf(nodes[index]);
|
|
598
603
|
if (node?.kind !== "assistant") continue;
|
|
599
|
-
const identity = node.requestConfig ?? node.provenance;
|
|
600
|
-
|
|
601
|
-
|
|
604
|
+
const identity = recordOf(node.requestConfig) ?? recordOf(node.provenance);
|
|
605
|
+
const model = typeof identity?.model === "string" ? identity.model : void 0;
|
|
606
|
+
if (model === void 0) continue;
|
|
607
|
+
const provider = typeof identity?.provider === "string" ? identity.provider : "";
|
|
608
|
+
return provider.length > 0 ? `${provider} · ${model}` : model;
|
|
602
609
|
}
|
|
603
610
|
}
|
|
604
611
|
function sessionStats(value) {
|
|
@@ -811,7 +818,7 @@ window.__ModuleLoader__.load({
|
|
|
811
818
|
}), /* @__PURE__ */ react.default.createElement("span", {
|
|
812
819
|
className: "dllm-context-segment dllm-context-messages",
|
|
813
820
|
style: { width: `${occupancy.percent * breakdown.messageTokens / (breakdown.systemTokens + breakdown.toolsTokens + breakdown.messageTokens)}%` }
|
|
814
|
-
})), /* @__PURE__ */ react.default.createElement("div", { className: "dllm-context-breakdown-rows" }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("span", null, /* @__PURE__ */ react.default.createElement("i", { className: "dllm-context-swatch dllm-context-system" }), t("mobile.sessionInfo.context.system")), /* @__PURE__ */ react.default.createElement("span", null, "~", formatSessionTokens(breakdown.systemTokens))), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("span", null, /* @__PURE__ */ react.default.createElement("i", { className: "dllm-context-swatch dllm-context-tools" }), t("mobile.sessionInfo.context.tools")), /* @__PURE__ */ react.default.createElement("span", null, "~", formatSessionTokens(breakdown.toolsTokens))), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("span", null, /* @__PURE__ */ react.default.createElement("i", { className: "dllm-context-swatch dllm-context-messages" }), t("mobile.sessionInfo.context.messages")), /* @__PURE__ */ react.default.createElement("span", null, "~", formatSessionTokens(breakdown.messageTokens)))))), /* @__PURE__ */ react.default.createElement("section", { className: "dllm-session-info-card dllm-session-properties-card" }, /* @__PURE__ */ react.default.createElement("div", { className: "dllm-session-property" }, /* @__PURE__ */ react.default.createElement("small", null, t("mobile.sessionInfo.model")), /* @__PURE__ */ react.default.createElement("span", null, model ?? t("mobile.sessionInfo.notRecorded"))), /* @__PURE__ */ react.default.createElement("div", { className: "dllm-session-property" }, /* @__PURE__ */ react.default.createElement("small", { className: "dllm-session-property-label" }, /* @__PURE__ */ react.default.createElement(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpenOutline16, { size: 13 }), t("mobile.sessionInfo.permissions")), /* @__PURE__ */ react.default.createElement("span", { className: "dllm-session-property-value dllm-session-property-access" }, /* @__PURE__ */ react.default.createElement(PermissionGlyph, { value: accessValue }), access ?? t("mobile.sessionInfo.notRecorded"))), /* @__PURE__ */ react.default.createElement("div", { className: "dllm-session-property" }, /* @__PURE__ */ react.default.createElement("small", { className: "dllm-session-property-label" }, /* @__PURE__ */ react.default.createElement(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 13 }), t("mobile.sessionInfo.agentPreset")), /* @__PURE__ */ react.default.createElement("span", null, mobilePresetLabel(session
|
|
821
|
+
})), /* @__PURE__ */ react.default.createElement("div", { className: "dllm-context-breakdown-rows" }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("span", null, /* @__PURE__ */ react.default.createElement("i", { className: "dllm-context-swatch dllm-context-system" }), t("mobile.sessionInfo.context.system")), /* @__PURE__ */ react.default.createElement("span", null, "~", formatSessionTokens(breakdown.systemTokens))), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("span", null, /* @__PURE__ */ react.default.createElement("i", { className: "dllm-context-swatch dllm-context-tools" }), t("mobile.sessionInfo.context.tools")), /* @__PURE__ */ react.default.createElement("span", null, "~", formatSessionTokens(breakdown.toolsTokens))), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("span", null, /* @__PURE__ */ react.default.createElement("i", { className: "dllm-context-swatch dllm-context-messages" }), t("mobile.sessionInfo.context.messages")), /* @__PURE__ */ react.default.createElement("span", null, "~", formatSessionTokens(breakdown.messageTokens)))))), /* @__PURE__ */ react.default.createElement("section", { className: "dllm-session-info-card dllm-session-properties-card" }, /* @__PURE__ */ react.default.createElement("div", { className: "dllm-session-property" }, /* @__PURE__ */ react.default.createElement("small", null, t("mobile.sessionInfo.model")), /* @__PURE__ */ react.default.createElement("span", null, model ?? t("mobile.sessionInfo.notRecorded"))), /* @__PURE__ */ react.default.createElement("div", { className: "dllm-session-property" }, /* @__PURE__ */ react.default.createElement("small", { className: "dllm-session-property-label" }, /* @__PURE__ */ react.default.createElement(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpenOutline16, { size: 13 }), t("mobile.sessionInfo.permissions")), /* @__PURE__ */ react.default.createElement("span", { className: "dllm-session-property-value dllm-session-property-access" }, /* @__PURE__ */ react.default.createElement(PermissionGlyph, { value: accessValue }), access ?? t("mobile.sessionInfo.notRecorded"))), /* @__PURE__ */ react.default.createElement("div", { className: "dllm-session-property" }, /* @__PURE__ */ react.default.createElement("small", { className: "dllm-session-property-label" }, /* @__PURE__ */ react.default.createElement(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 13 }), t("mobile.sessionInfo.agentPreset")), /* @__PURE__ */ react.default.createElement("span", null, mobilePresetLabel(sessionAgentPreset(session), t)))), stats.length > 0 && /* @__PURE__ */ react.default.createElement("section", { className: "dllm-session-info-card dllm-session-stats-card" }, /* @__PURE__ */ react.default.createElement("div", {
|
|
815
822
|
className: "dllm-session-info-icon",
|
|
816
823
|
"aria-hidden": "true"
|
|
817
824
|
}, /* @__PURE__ */ react.default.createElement(_deepseek_ai_dsh_client_ui_primitives.IconDataOutline16, { size: 15 })), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("small", null, t("mobile.sessionInfo.statistics")), stats.map((line) => /* @__PURE__ */ react.default.createElement("p", { key: line }, line)))), /* @__PURE__ */ react.default.createElement("section", { className: "dllm-session-info-card dllm-session-log-card" }, /* @__PURE__ */ react.default.createElement("div", {
|
|
@@ -993,11 +1000,11 @@ window.__ModuleLoader__.load({
|
|
|
993
1000
|
}
|
|
994
1001
|
const MOBILE_STOCK_LAYOUT_STYLES = `
|
|
995
1002
|
body[data-dsh-local-link-mobile]{overflow:hidden}
|
|
996
|
-
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay]){--dllm-side-drawer-width:min(88vw,340px);grid-template-columns:minmax(0,1fr)!important}
|
|
1003
|
+
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay]){--dllm-side-drawer-width:min(88vw,340px);--dllm-side-drawer-closed-transform:translateX(calc(-1 * var(--dllm-side-drawer-width) - 14px));grid-template-columns:minmax(0,1fr)!important}
|
|
997
1004
|
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay])>:first-child{position:fixed;z-index:70;inset:0 auto 0 0;box-sizing:border-box;width:var(--dllm-side-drawer-width);transform:translateX(0);transition:transform 190ms cubic-bezier(.22,1,.36,1);box-shadow:18px 0 46px rgb(15 23 42 / 18%)}
|
|
998
1005
|
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay])>:first-child>[data-slot="sidebar"]>*{width:100%!important;height:100%!important}
|
|
999
1006
|
body[data-dsh-local-link-mobile] [data-slot="sidebar"] button[class*="_brand"]{flex:0 0 auto!important;inline-size:max-content!important;width:max-content!important;min-width:0!important;max-width:calc(100% - 72px)!important;margin-right:auto!important}
|
|
1000
|
-
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div[data-sidebar-collapsed]:has(>[data-shell-overlay])>:first-child{transform:
|
|
1007
|
+
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div[data-sidebar-collapsed]:has(>[data-shell-overlay])>:first-child{transform:var(--dllm-side-drawer-closed-transform);pointer-events:none}
|
|
1001
1008
|
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay])>:nth-child(2){grid-column:1;grid-row:1;min-width:0}
|
|
1002
1009
|
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay])>:nth-child(3){display:none}
|
|
1003
1010
|
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay])>[data-shell-overlay]{z-index:90}
|
|
@@ -1007,9 +1014,9 @@ body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-o
|
|
|
1007
1014
|
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:not([data-sidebar-collapsed]):has(>[data-shell-overlay]) .dllm-stock-menu{opacity:0;transform:scale(.9);pointer-events:none}
|
|
1008
1015
|
.dllm-stock-scrim{position:absolute;inset:0 0 0 var(--dllm-side-drawer-width);width:auto;height:auto;min-height:0;padding:0;border:0;border-radius:0;background:var(--dsw-alias-bg-mask-1,rgb(15 23 42 / 40%))!important;pointer-events:auto}
|
|
1009
1016
|
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div[data-sidebar-collapsed]:has(>[data-shell-overlay]) .dllm-stock-scrim{opacity:0;pointer-events:none}
|
|
1010
|
-
.dllm-stock-theme{position:absolute;top:calc(env(safe-area-inset-top) + 22px);left:calc(var(--dllm-side-drawer-width) - 76px);display:grid;width:28px;height:28px;place-items:center;pointer-events:auto}
|
|
1017
|
+
.dllm-stock-theme{position:absolute;top:calc(env(safe-area-inset-top) + 22px);left:calc(var(--dllm-side-drawer-width) - 76px);display:grid;width:28px;height:28px;place-items:center;opacity:1;visibility:visible;transform:translateX(0);pointer-events:auto;transition:opacity 120ms ease,transform 190ms cubic-bezier(.22,1,.36,1),visibility 0s linear 0s}
|
|
1011
1018
|
.dllm-stock-theme .dllm-theme-button{box-sizing:border-box!important;width:28px!important;min-width:28px!important;max-width:28px!important;height:28px!important;min-height:28px!important;padding:0!important;border-radius:50%!important}
|
|
1012
|
-
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div[data-sidebar-collapsed]:has(>[data-shell-overlay]) .dllm-stock-theme{
|
|
1019
|
+
body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div[data-sidebar-collapsed]:has(>[data-shell-overlay]) .dllm-stock-theme{opacity:0;visibility:hidden;transform:var(--dllm-side-drawer-closed-transform);pointer-events:none;transition:opacity 120ms ease,transform 190ms cubic-bezier(.22,1,.36,1),visibility 0s linear 190ms}
|
|
1013
1020
|
body[data-dsh-local-link-mobile] [data-slot="sidebar.workspaces"] button[aria-label="Add workspace"],body[data-dsh-local-link-mobile] [data-slot="sidebar.workspaces"] button[aria-label="添加工作区"]{display:none!important}
|
|
1014
1021
|
body[data-dsh-local-link-mobile] [role="treeitem"][aria-selected="true"]>span:has(button[aria-label]){display:inline-flex!important;margin-left:4px}
|
|
1015
1022
|
body[data-dsh-local-link-mobile] [role="treeitem"][aria-selected="true"]>span:has(button[aria-label]) button{width:28px!important;height:28px!important}
|
|
@@ -1026,7 +1033,7 @@ body[data-dsh-local-link-mobile] [data-turn-tail]>div:last-child>button[aria-has
|
|
|
1026
1033
|
body[data-dsh-local-link-mobile] [data-turn-tail]>div:last-child>button[aria-haspopup=dialog][aria-expanded]::before{content:"";display:block;width:16px;height:16px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.8 2.4a1.7 1.7 0 0 1 2.4 2.4L6 12l-3 .6.6-3 7.2-7.2Z'/%3E%3Cpath d='m9.8 3.4 2.8 2.8'/%3E%3C/svg%3E") center/16px 16px no-repeat}
|
|
1027
1034
|
body[data-dsh-local-link-mobile] [data-cordis-panel]{left:max(12px,env(safe-area-inset-left))!important;right:max(12px,env(safe-area-inset-right))!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:auto!important;max-width:none!important;max-height:calc(100dvh - max(24px,env(safe-area-inset-top) + env(safe-area-inset-bottom)))!important}
|
|
1028
1035
|
body[data-dsh-local-link-mobile] [data-cordis-row]{min-width:0}body[data-dsh-local-link-mobile] [data-cordis-row]>div{min-width:0;flex-wrap:wrap}body[data-dsh-local-link-mobile] [data-cordis-row] span{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
|
|
1029
|
-
@media(prefers-reduced-motion:reduce){body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay])>:first-child{transition:none!important}}
|
|
1036
|
+
@media(prefers-reduced-motion:reduce){body[data-dsh-local-link-mobile] #root>[data-slot="root"]>div:has(>[data-shell-overlay])>:first-child,.dllm-stock-theme{transition:none!important}}
|
|
1030
1037
|
${MOBILE_SUBAGENT_STYLES}
|
|
1031
1038
|
${MOBILE_SESSION_INFO_STYLES}
|
|
1032
1039
|
`;
|