@xmanrui/dsh-im 3.0.4 → 3.0.6

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/client.js CHANGED
@@ -47,7 +47,7 @@ var React20 = __toESM(require("react"), 1);
47
47
  // package.json
48
48
  var package_default = {
49
49
  name: "@xmanrui/dsh-im",
50
- version: "3.0.4",
50
+ version: "3.0.6",
51
51
  description: "\u628A\u4E5D\u79CD IM \u673A\u5668\u4EBA\u548C\u516C\u7F51 AI Office \u63A5\u5165\u672C\u673A DeepSeek Harness\u3002 Connect nine IM channels and a public AI Office to a local DeepSeek Harness.",
52
52
  keywords: [
53
53
  "deepseek-harness",
@@ -423,6 +423,11 @@ var EN = Object.freeze({
423
423
  "\u9009\u62E9\u673A\u5668\u4EBA\u5DE5\u4F5C\u533A\u76EE\u5F55": "Select bot workspace folder",
424
424
  "\u5F53\u524D\u76EE\u5F55": "Current folder",
425
425
  "\u4E3B\u76EE\u5F55": "Home",
426
+ "\u76F4\u63A5\u8F93\u5165\u8DEF\u5F84": "Enter a path directly",
427
+ "\u652F\u6301 Windows \u76D8\u7B26\u3001UNC \u4E0E POSIX \u7EDD\u5BF9\u8DEF\u5F84\u3002": "Supports Windows drives, UNC paths, and POSIX absolute paths.",
428
+ "\u8F93\u5165 Host \u4E0A\u7684\u5B8C\u6574\u7EDD\u5BF9\u8DEF\u5F84": "Enter a full absolute path on the Host",
429
+ "\u524D\u5F80": "Go",
430
+ "\u8BFB\u53D6\u4E2D\u2026": "Loading\u2026",
426
431
  "\u6B63\u5728\u51C6\u5907\u76EE\u5F55\u9009\u62E9\u5668\u2026": "Preparing folder picker\u2026",
427
432
  "\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026": "Loading folders\u2026",
428
433
  "\u8FD9\u4E2A\u76EE\u5F55\u4E2D\u6CA1\u6709\u5B50\u6587\u4EF6\u5939\u3002": "This folder has no subfolders.",
@@ -1548,6 +1553,7 @@ function WorkspaceDirectoryPicker({
1548
1553
  const [listing, setListing] = React5.useState(null);
1549
1554
  const [loading, setLoading] = React5.useState(false);
1550
1555
  const [error, setError] = React5.useState(null);
1556
+ const [pathDraft, setPathDraft] = React5.useState(startPath ?? "");
1551
1557
  const [showHidden, setShowHidden] = React5.useState(false);
1552
1558
  const [retryKey, setRetryKey] = React5.useState(0);
1553
1559
  const requestRef = React5.useRef(0);
@@ -1556,6 +1562,8 @@ function WorkspaceDirectoryPicker({
1556
1562
  const bodyRef = React5.useRef(null);
1557
1563
  const titleId = React5.useId();
1558
1564
  const noticeId = React5.useId();
1565
+ const pathInputId = React5.useId();
1566
+ const errorId = React5.useId();
1559
1567
  const initialPathRef = React5.useRef(startPath);
1560
1568
  const onPickedRef = React5.useRef(onPicked);
1561
1569
  const onCancelRef = React5.useRef(onCancel);
@@ -1576,6 +1584,7 @@ function WorkspaceDirectoryPicker({
1576
1584
  if (request !== requestRef.current || controller.signal.aborted) return { aborted: true };
1577
1585
  if (bodyRef.current) bodyRef.current.scrollTop = 0;
1578
1586
  setListing(next);
1587
+ if (typeof next?.path === "string") setPathDraft(next.path);
1579
1588
  setError(null);
1580
1589
  return { value: next };
1581
1590
  } catch (cause) {
@@ -1591,6 +1600,7 @@ function WorkspaceDirectoryPicker({
1591
1600
  let active = true;
1592
1601
  setListing(null);
1593
1602
  setError(null);
1603
+ setPathDraft(initialPathRef.current ?? "");
1594
1604
  setShowHidden(false);
1595
1605
  dialogRef.current?.focus?.();
1596
1606
  const handleKeyDown = (event) => {
@@ -1637,6 +1647,7 @@ function WorkspaceDirectoryPicker({
1637
1647
  const entries = (listing?.entries ?? []).filter((entry) => showHidden || !entry.hidden);
1638
1648
  const crumbs = listing ? displayCrumbs(listing) : [];
1639
1649
  const presentedError = saveError ?? error;
1650
+ const pathReady = listing !== null && pathDraft === listing.path;
1640
1651
  const content = h2(
1641
1652
  "div",
1642
1653
  {
@@ -1675,7 +1686,49 @@ function WorkspaceDirectoryPicker({
1675
1686
  onClick: () => void loadDirectory(crumb.path)
1676
1687
  }, crumb.path === listing.home ? h2("span", null, "\u4E3B\u76EE\u5F55") : crumb.name || crumb.path)
1677
1688
  ))
1678
- ) : h2("p", null, "\u6B63\u5728\u51C6\u5907\u76EE\u5F55\u9009\u62E9\u5668\u2026")
1689
+ ) : h2("p", null, "\u6B63\u5728\u51C6\u5907\u76EE\u5F55\u9009\u62E9\u5668\u2026"),
1690
+ h2(
1691
+ "form",
1692
+ {
1693
+ className: "dim-directoryPathForm",
1694
+ onSubmit: (event) => {
1695
+ event.preventDefault();
1696
+ if (!busy && !loading && pathDraft.trim()) void loadDirectory(pathDraft);
1697
+ }
1698
+ },
1699
+ h2(
1700
+ "div",
1701
+ { className: "dim-directoryPathMeta" },
1702
+ h2("label", { htmlFor: pathInputId }, "\u76F4\u63A5\u8F93\u5165\u8DEF\u5F84"),
1703
+ h2("span", null, "\u652F\u6301 Windows \u76D8\u7B26\u3001UNC \u4E0E POSIX \u7EDD\u5BF9\u8DEF\u5F84\u3002")
1704
+ ),
1705
+ h2(
1706
+ "div",
1707
+ { className: "dim-directoryPathControl" },
1708
+ h2("input", {
1709
+ id: pathInputId,
1710
+ className: "dim-directoryPathInput",
1711
+ value: pathDraft,
1712
+ placeholder: "\u8F93\u5165 Host \u4E0A\u7684\u5B8C\u6574\u7EDD\u5BF9\u8DEF\u5F84",
1713
+ "aria-label": "\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84",
1714
+ "aria-describedby": presentedError ? errorId : void 0,
1715
+ "aria-invalid": presentedError ? "true" : void 0,
1716
+ autoCapitalize: "none",
1717
+ autoCorrect: "off",
1718
+ spellCheck: false,
1719
+ maxLength: 4096,
1720
+ disabled: busy || loading,
1721
+ onChange: (event) => {
1722
+ setPathDraft(event.target.value);
1723
+ setError(null);
1724
+ }
1725
+ }),
1726
+ h2("button", {
1727
+ type: "submit",
1728
+ disabled: busy || loading || !pathDraft.trim()
1729
+ }, loading ? "\u8BFB\u53D6\u4E2D\u2026" : "\u524D\u5F80")
1730
+ )
1731
+ )
1679
1732
  ),
1680
1733
  h2(
1681
1734
  "div",
@@ -1708,7 +1761,7 @@ function WorkspaceDirectoryPicker({
1708
1761
  listing?.truncated ? h2("p", { className: "dim-directoryPickerTruncated" }, "\u6B64\u76EE\u5F55\u7684\u5B50\u6587\u4EF6\u5939\u8FC7\u591A\uFF0C\u4EC5\u663E\u793A\u524D\u4E00\u90E8\u5206\u3002") : null,
1709
1762
  presentedError ? h2(
1710
1763
  "div",
1711
- { className: "dim-directoryPickerError", role: "alert" },
1764
+ { id: errorId, className: "dim-directoryPickerError", role: "alert" },
1712
1765
  h2("span", null, presentedError),
1713
1766
  !listing && !busy ? h2("button", {
1714
1767
  type: "button",
@@ -1739,7 +1792,7 @@ function WorkspaceDirectoryPicker({
1739
1792
  h2("button", {
1740
1793
  type: "button",
1741
1794
  className: "dim-directoryPickerPrimary",
1742
- disabled: busy || loading || !listing,
1795
+ disabled: busy || loading || !pathReady,
1743
1796
  onClick: () => listing && void onPicked(listing.path)
1744
1797
  }, busy ? "\u5207\u6362\u4E2D\u2026" : "\u9009\u62E9\u6B64\u76EE\u5F55")
1745
1798
  )
@@ -8330,7 +8383,7 @@ function safeVerificationUrl(value) {
8330
8383
  try {
8331
8384
  const url = new URL(value);
8332
8385
  const host = url.hostname.toLowerCase();
8333
- return url.protocol === "https:" && (host === "weixin.qq.com" || host.endsWith(".weixin.qq.com")) ? url.toString() : void 0;
8386
+ return url.protocol === "https:" && (host === "weixin.qq.com" || host.endsWith(".weixin.qq.com") || host === "wechat.com" || host.endsWith(".wechat.com")) ? url.toString() : void 0;
8334
8387
  } catch {
8335
8388
  return void 0;
8336
8389
  }
@@ -10501,8 +10554,21 @@ var CSS11 = String.raw`
10501
10554
  .dim-directoryCrumbs button { max-width: 210px; overflow: hidden; padding: 3px 5px; border: 0; border-radius: 6px; color: var(--dsw-alias-label-secondary, #646a73); background: transparent; font: inherit; font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
10502
10555
  .dim-directoryCrumbs button:hover:not(:disabled) { color: var(--dim-blue); background: var(--dim-blue-soft); }
10503
10556
  .dim-directoryCrumbs button[aria-current="page"] { color: var(--dsw-alias-label-primary, #1f2329); font-weight: 650; }
10504
- .dim-directoryCrumbs button:focus-visible, .dim-directoryList button:focus-visible, .dim-directoryPickerActions button:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 65%, white); outline-offset: 1px; }
10557
+ .dim-directoryCrumbs button:focus-visible, .dim-directoryPathInput:focus-visible, .dim-directoryPathControl button:focus-visible, .dim-directoryList button:focus-visible, .dim-directoryPickerActions button:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 65%, white); outline-offset: 1px; }
10505
10558
  .dim-directoryCrumbSeparator { flex: none; font-size: 12px; }
10559
+ .dim-directoryPathForm { display: grid; gap: 7px; margin-top: 14px; }
10560
+ .dim-directoryPathMeta { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
10561
+ .dim-directoryPathMeta label { flex: none; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; font-weight: 650; }
10562
+ .dim-directoryPathMeta span { min-width: 0; overflow: hidden; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
10563
+ .dim-directoryPathControl { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 8px; }
10564
+ .dim-directoryPathInput { min-width: 0; height: 38px; padding: 0 11px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: 12px ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; line-height: 38px; }
10565
+ .dim-directoryPathInput::placeholder { color: var(--dsw-alias-label-tertiary, #8f959e); }
10566
+ .dim-directoryPathInput:hover:not(:disabled) { border-color: var(--dsw-alias-border-l3, #bbbfc4); }
10567
+ .dim-directoryPathInput:focus { border-color: var(--dim-blue); }
10568
+ .dim-directoryPathInput[aria-invalid="true"] { border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary, #d54941) 62%, var(--dsw-alias-border-l2, #dfe1e5)); }
10569
+ .dim-directoryPathControl button { min-height: 38px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--dim-blue) 30%, var(--dsw-alias-border-l2, #dfe1e5)); border-radius: 8px; color: var(--dim-blue); background: var(--dim-blue-soft); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
10570
+ .dim-directoryPathControl button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--dim-blue) 48%, var(--dsw-alias-border-l2, #dfe1e5)); background: color-mix(in srgb, var(--dim-blue) 13%, transparent); }
10571
+ .dim-directoryPathInput:disabled, .dim-directoryPathControl button:disabled { cursor: not-allowed; opacity: .55; }
10506
10572
  .dim-directoryPickerBody { min-height: 0; overflow-y: auto; padding: 14px 16px; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-border-l2, #dfe1e5) transparent; }
10507
10573
  .dim-directoryList { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
10508
10574
  .dim-directoryList button { width: 100%; min-height: 46px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px; align-items: center; gap: 10px; padding: 7px 11px; border: 0; border-radius: 9px; color: var(--dsw-alias-label-primary, #1f2329); background: transparent; font: inherit; text-align: left; cursor: pointer; }
@@ -10596,6 +10662,7 @@ var CSS11 = String.raw`
10596
10662
  .dim-directoryPicker { height: calc(100vh - 20px); min-height: 0; border-radius: 14px; }
10597
10663
  .dim-directoryPickerHeader { padding: 18px 17px 14px; }
10598
10664
  .dim-directoryPickerHeader h3 { font-size: 18px; }
10665
+ .dim-directoryPathMeta span { display: none; }
10599
10666
  .dim-directoryPickerBody { padding: 10px; }
10600
10667
  .dim-directoryPickerFooter { grid-template-columns: minmax(0, 1fr) max-content; gap: 10px; padding: 13px 14px; }
10601
10668
  .dim-directoryPickerNotice { grid-column: 1 / -1; grid-row: 1; text-align: left; }