Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Rebuild the Connectors page as a grouped app grid

Fei2411dd13eb05f2f1
diff --git a/ds-bot/client.js b/ds-bot/client.js
index da228141..6a6046a7 100644
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@ -1264,6 +1264,21 @@ var ZH = {
"Authorization code": "授权码",
"Password or app password": "密码或授权码",
"Official help": "官方帮助",
+ "Finish signing in in your browser.": "在浏览器里完成登录。",
+ "Open again": "重新打开",
+ "Did not come back here?": "登录后没有回到这里?",
+ "Paste the code on {host} and authorize.": "在 {host} 粘贴这个码并授权。",
+ "Add another": "再添加一个",
+ "QQ, 163, 126, Gmail, iCloud, and other IMAP mail": "QQ、163、126、Gmail、iCloud 等 IMAP 邮箱",
+ "Other MCP server": "其他 MCP 服务器",
+ "An address, a command, or one from Claude Desktop, Cursor, or VS Code": "填地址或命令,或从 Claude Desktop、Cursor、VS Code 导入",
+ "Kind of server": "服务器类型",
+ "Nothing matches": "没有匹配的连接器",
+ Recommended: "推荐",
+ "See all": "查看全部",
+ "{count} connected": "已连接 {count} 个",
+ "{count} accounts": "{count} 个账户",
+ Category: "分类",
"Could not reach the mail server. Check the server address.": "连不上邮件服务器,请检查服务器地址。",
"Sign in at mail.qq.com, click your avatar at the top right, and open Settings → Account and Security → Security Settings.": "在 mail.qq.com 登录,点右上角头像,进入 设置 → 账号与安全 → 安全设置。",
"Turn on the POP3/IMAP/SMTP service, then click Generate authorization code and verify yourself.": "开启 POP3/IMAP/SMTP 服务,再点「生成授权码」,按提示验证身份。",
@@ -1725,8 +1740,8 @@ function bodyOf(def, paint, flat = false) {
return "";
}
}
-var eyeMarkup = ([cx, cy, w, h54, tilt]) => `<g transform="translate(${cx} ${cy}) rotate(${tilt})"><rect class="bt-eye" x="${-w / 2}" y="${-h54 / 2}" width="${w}" height="${h54}" rx="${w / 2}"/></g>`;
-var happyEyeMarkup = ([cx, cy, w, h54, tilt]) => `<g transform="translate(${cx} ${cy}) rotate(${tilt})"><path class="bt-eye-happy" opacity="0" d="M${-w * 0.62} ${h54 * 0.14}Q0 ${-h54 * 0.42} ${w * 0.62} ${h54 * 0.14}" fill="none" stroke="#000" stroke-width="${w * 0.5}" stroke-linecap="round"/></g>`;
+var eyeMarkup = ([cx, cy, w, h55, tilt]) => `<g transform="translate(${cx} ${cy}) rotate(${tilt})"><rect class="bt-eye" x="${-w / 2}" y="${-h55 / 2}" width="${w}" height="${h55}" rx="${w / 2}"/></g>`;
+var happyEyeMarkup = ([cx, cy, w, h55, tilt]) => `<g transform="translate(${cx} ${cy}) rotate(${tilt})"><path class="bt-eye-happy" opacity="0" d="M${-w * 0.62} ${h55 * 0.14}Q0 ${-h55 * 0.42} ${w * 0.62} ${h55 * 0.14}" fill="none" stroke="#000" stroke-width="${w * 0.5}" stroke-linecap="round"/></g>`;
var maskBox = (size) => `maskUnits="userSpaceOnUse" x="${-size}" y="${-size}" width="${size * 3}" height="${size * 3}"`;
var holes = (def, eyes) => `<rect x="${-def.size}" y="${-def.size}" width="${def.size * 3}" height="${def.size * 3}" fill="#fff"/>${eyes}`;
var MASK_ID = "%MASK%";
@@ -2522,12 +2537,12 @@ function liveSprings(apply2) {
const dt = Math.min(0.5, Math.max(1e-3, (now - last) / 1e3));
last = now;
const steps = Math.ceil(dt * 240);
- const h54 = dt / steps;
+ const h55 = dt / steps;
let moving = false;
for (const [key, value] of values) {
for (let index = 0; index < steps; index += 1) {
- value.v += (-value.k * (value.x - value.to) - value.c * value.v) * h54;
- value.x += value.v * h54;
+ value.v += (-value.k * (value.x - value.to) - value.c * value.v) * h55;
+ value.x += value.v * h55;
}
if (Math.abs(value.x - value.to) < 0.05 && Math.abs(value.v) < 1) {
value.x = value.to;
@@ -3309,12 +3324,23 @@ button.bt-set-row:hover{background:var(--bt-hover)}
.bt-connector-actions{flex:none;display:flex;gap:6px}
.bt-connector-form{display:flex;flex-direction:column;gap:8px;padding-left:48px;animation:bt-q-in ${SPRING_SHAPE.duration}ms ${SPRING_SHAPE.easing},bt-veil-in .2s ease-out}
.bt-connector-form-row{display:flex;align-items:center;gap:6px}
-.bt-connector-link{flex:1;font-size:12px;color:var(--bt-ink-2)}
+.bt-connector-form-row>:first-child{margin-right:auto}
+.bt-connector-link{flex:none;padding:0;border:0;background:none;font:inherit;font-size:12px;color:var(--bt-ink-2);text-decoration:underline;text-underline-offset:2px;cursor:pointer}
+.bt-connector-link:hover:not(:disabled){color:var(--bt-ink)}
+.bt-connector-wait{flex:1;min-width:0;font-size:12px;line-height:16px;color:var(--bt-ink-2)}
+.bt-connector-aside{align-self:flex-start}
.bt-connector-error{padding-left:48px;font-size:12px;line-height:16px;color:var(--bt-danger)}
-.bt-mail-guide{margin:0;padding-left:20px;font-size:12px;line-height:16px;color:color-mix(in srgb,var(--bt-ink-2) 50%,var(--bt-ink-3));display:flex;flex-direction:column;gap:4px}
-.bt-mail-form .bt-connector-error{padding-left:0}
-.bt-mail-links{gap:16px}
-.bt-mail-links .bt-connector-link{flex:none}
+.bt-connector-banner{padding:0 0 8px}
+.bt-mail-form{gap:10px}
+.bt-mail-seg{align-self:flex-start}
+.bt-mail-guide{display:flex;flex-direction:column;gap:8px;padding:10px 12px;border-radius:10px;background:var(--bt-hover);font-size:12px;line-height:18px;color:var(--bt-ink-2)}
+.bt-mail-guide ol{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:2px}
+.bt-mail-links{display:flex;gap:16px}
+.bt-mail-error{font-size:12px;line-height:16px;color:var(--bt-danger)}
+.bt-mail-rules{gap:4px}
+.bt-mail-rules-title{font-size:12px;line-height:16px;font-weight:500;color:var(--bt-ink-2)}
+.bt-mail-rule{display:flex;align-items:center;gap:12px;min-height:36px}
+.bt-mail-rule-name{font-size:13px;line-height:18px;color:var(--bt-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bt-im-mark{width:20px;height:20px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;color:var(--bt-im-mark-ink)}
.bt-im-line{display:flex;align-items:center;gap:8px}
.bt-im-label{flex:1;font-size:12px;color:var(--bt-ink-2)}
@@ -8183,7 +8209,7 @@ function AddSecret({ actions, run: run2, onDone }) {
)
);
}
-function SecretsPage({ roster, actions, run: run2, Section }) {
+function SecretsPage({ roster, actions, run: run2, Section: Section2 }) {
const [open, setOpen] = (0, import_react16.useState)(null);
const [adding, setAdding] = (0, import_react16.useState)(false);
const secrets = roster.secrets ?? [];
@@ -8198,7 +8224,7 @@ function SecretsPage({ roster, actions, run: run2, Section }) {
t(" before anything goes to a model.")
),
(0, import_react16.createElement)(
- Section,
+ Section2,
{ key: "list", title: t("Secrets · {count}", { count: secrets.length }) },
secrets.length === 0 && !adding ? (0, import_react16.createElement)("div", { className: "bt-set-row" }, (0, import_react16.createElement)("span", { className: "bt-set-hint" }, t("No keys yet. When a Bot needs one, it shows a card in its chat."))) : null,
secrets.map((secret) => (0, import_react16.createElement)(SecretRow, { key: secret.name, secret, roster, actions, run: run2, open: open === secret.name, onToggle: () => setOpen(open === secret.name ? null : secret.name) })),
@@ -10599,99 +10625,175 @@ label.bt-bs-row{cursor:text}
@media (prefers-reduced-motion:reduce){.bt-switch,.bt-switch-knob{transition:none}.bt-avedit :is(.bt-shapes,.bt-colors,.bt-dropzone){animation:none}}
`;
+// src/client/open-window.js
+function reserveWindow() {
+ if (window.dshDesktop !== void 0) return { go: (url) => {
+ window.open(url, "_blank");
+ return true;
+ }, close: () => {
+ } };
+ const reserved = window.open("", "_blank");
+ if (reserved !== null) reserved.opener = null;
+ return {
+ go: (url) => {
+ if (reserved === null) return false;
+ reserved.location.href = url;
+ return true;
+ },
+ close: () => {
+ reserved?.close();
+ }
+ };
+}
+var openPage = (url) => reserveWindow().go(url);
+
// src/client/connector-marks.js
var import_react24 = require("react");
-var svg = (...kids) => (0, import_react24.createElement)("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": true }, ...kids);
-var path = (d) => (0, import_react24.createElement)("path", { d });
+var svg = (...kids) => (0, import_react24.createElement)("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", "aria-hidden": true }, ...kids);
+var path = (d, fill2) => (0, import_react24.createElement)("path", { d, fill: fill2 });
var mark = (...kids) => () => svg(...kids);
+var GITHUB_D = "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z";
var GitHubMark = () => (0, import_react24.createElement)(
"svg",
{ width: 20, height: 20, viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": true },
- (0, import_react24.createElement)("path", { d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" })
+ (0, import_react24.createElement)("path", { d: GITHUB_D })
+);
+var GithubBrandMark = () => (0, import_react24.createElement)(
+ "svg",
+ { width: 20, height: 20, viewBox: "0 0 16 16", fill: "var(--bt-mark-ink)", "aria-hidden": true },
+ (0, import_react24.createElement)("path", { d: GITHUB_D })
);
var SI = {
- notion: "M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z",
- linear: "M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z",
- atlassian: "M7.12 11.084a.683.683 0 00-1.16.126L.075 22.974a.703.703 0 00.63 1.018h8.19a.678.678 0 00.63-.39c1.767-3.65.696-9.203-2.406-12.52zM11.434.386a15.515 15.515 0 00-.906 15.317l3.95 7.9a.703.703 0 00.628.388h8.19a.703.703 0 00.63-1.017L12.63.38a.664.664 0 00-1.196.006z",
- sentry: "M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z",
- stripe: "M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z",
- paypal: "M15.607 4.653H8.941L6.645 19.251H1.82L4.862 0h7.995c3.754 0 6.375 2.294 6.473 5.513-.648-.478-2.105-.86-3.722-.86m6.57 5.546c0 3.41-3.01 6.853-6.958 6.853h-2.493L11.595 24H6.74l1.845-11.538h3.592c4.208 0 7.346-3.634 7.153-6.949a5.24 5.24 0 0 1 2.848 4.686M9.653 5.546h6.408c.907 0 1.942.222 2.363.541-.195 2.741-2.655 5.483-6.441 5.483H8.714Z",
- square: "M4.01 0A4.01 4.01 0 000 4.01v15.98c0 2.21 1.8 4 4.01 4.01h15.98C22.2 24 24 22.2 24 19.99V4A4.01 4.01 0 0019.99 0H4zm1.62 4.36h12.74c.7 0 1.26.57 1.26 1.27v12.74c0 .7-.56 1.27-1.26 1.27H5.63c-.7 0-1.26-.57-1.26-1.27V5.63a1.27 1.27 0 011.26-1.27zm3.83 4.35a.73.73 0 00-.73.73v5.09c0 .4.32.72.72.72h5.1a.73.73 0 00.73-.72V9.44a.73.73 0 00-.73-.73h-5.1Z",
- cloudflare: "M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727",
- vercel: "m12 1.608 12 20.784H0Z",
- supabase: "M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z",
- neon: "M24 0V24l-9.365-8.045V24H0V0ZM2.942 21.087h8.751V9.563l9.365 8.204V2.919L2.942 2.914Z",
- figma: "M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z",
- intercom: "M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z",
- webflow: "m24 4.515-7.658 14.97H9.149l3.205-6.204h-.144C9.566 16.713 5.621 18.973 0 19.485v-6.118s3.596-.213 5.71-2.435H0V4.515h6.417v5.278l.144-.001 2.622-5.277h4.854v5.244h.144l2.72-5.244H24Z",
- wix: "m0 7.354 2.113 9.292h.801a1.54 1.54 0 0 0 1.506-1.218l1.351-6.34a.171.171 0 0 1 .167-.137c.08 0 .15.058.167.137l1.352 6.34a1.54 1.54 0 0 0 1.506 1.218h.805l2.113-9.292h-.565c-.62 0-1.159.43-1.296 1.035l-1.26 5.545-1.106-5.176a1.76 1.76 0 0 0-2.19-1.324c-.639.176-1.113.716-1.251 1.365l-1.094 5.127-1.26-5.537A1.33 1.33 0 0 0 .563 7.354H0zm13.992 0a.951.951 0 0 0-.951.95v8.342h.635a.952.952 0 0 0 .951-.95V7.353h-.635zm1.778 0 3.158 4.66-3.14 4.632h1.325c.368 0 .712-.181.918-.486l1.756-2.59a.12.12 0 0 1 .197 0l1.754 2.59c.206.305.55.486.918.486h1.326l-3.14-4.632L24 7.354h-1.326c-.368 0-.712.181-.918.486l-1.772 2.617a.12.12 0 0 1-.197 0L18.014 7.84a1.108 1.108 0 0 0-.918-.486H15.77z",
- netlify: "M6.49 19.04h-.23L5.13 17.9v-.23l1.73-1.71h1.2l.15.15v1.2L6.5 19.04ZM5.13 6.31V6.1l1.13-1.13h.23L8.2 6.68v1.2l-.15.15h-1.2L5.13 6.31Zm9.96 9.09h-1.65l-.14-.13v-3.83c0-.68-.27-1.2-1.1-1.23-.42 0-.9 0-1.43.02l-.07.08v4.96l-.14.14H8.9l-.13-.14V8.73l.13-.14h3.7a2.6 2.6 0 0 1 2.61 2.6v4.08l-.13.14Zm-8.37-2.44H.14L0 12.82v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14Zm17.14 0h-6.58l-.14-.14v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14ZM11.05 6.55V1.64l.14-.14h1.65l.14.14v4.9l-.14.14h-1.65l-.14-.13Zm0 15.81v-4.9l.14-.14h1.65l.14.13v4.91l-.14.14h-1.65l-.14-.14Z",
- airtable: "M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z",
- dropbox: "M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z",
- zapier: "M4.157 0A4.151 4.151 0 0 0 0 4.161v15.678A4.151 4.151 0 0 0 4.157 24h15.682A4.152 4.152 0 0 0 24 19.839V4.161A4.152 4.152 0 0 0 19.839 0H4.157Zm10.61 8.761h.03a.577.577 0 0 1 .23.038.585.585 0 0 1 .201.124.63.63 0 0 1 .162.431.612.612 0 0 1-.162.435.58.58 0 0 1-.201.128.58.58 0 0 1-.23.042.529.529 0 0 1-.235-.042.585.585 0 0 1-.332-.328.559.559 0 0 1-.038-.235.613.613 0 0 1 .17-.431.59.59 0 0 1 .405-.162Zm2.853 1.572c.03.004.061.004.095.004.325-.011.646.064.937.219.238.144.431.355.552.609.128.279.189.582.185.888v.193a2 2 0 0 1 0 .219h-2.498c.003.227.075.45.204.642a.78.78 0 0 0 .646.265.714.714 0 0 0 .484-.136.642.642 0 0 0 .23-.318l.915.257a1.398 1.398 0 0 1-.28.537c-.14.159-.321.284-.521.355a2.234 2.234 0 0 1-.836.136 1.923 1.923 0 0 1-1.001-.245 1.618 1.618 0 0 1-.665-.703 2.221 2.221 0 0 1-.227-1.036 1.95 1.95 0 0 1 .48-1.398 1.9 1.9 0 0 1 1.3-.488Zm-9.607.023c.162.004.325.026.48.079.207.065.4.174.563.314.26.302.393.692.366 1.088v2.276H8.53l-.109-.711h-.065c-.064.163-.155.31-.272.439a1.122 1.122 0 0 1-.374.264 1.023 1.023 0 0 1-.453.083 1.334 1.334 0 0 1-.866-.264.965.965 0 0 1-.329-.801.993.993 0 0 1 .076-.431 1.02 1.02 0 0 1 .242-.363 1.478 1.478 0 0 1 1.043-.303h.952v-.181a.696.696 0 0 0-.136-.454.553.553 0 0 0-.438-.154.695.695 0 0 0-.378.086.48.48 0 0 0-.193.254l-.99-.144a1.26 1.26 0 0 1 .257-.563c.14-.174.321-.302.533-.378.261-.091.54-.136.82-.129.053-.003.106-.007.163-.007Zm4.384.007c.174 0 .347.038.506.114.182.083.34.211.458.374.257.423.377.911.351 1.406a2.53 2.53 0 0 1-.355 1.448 1.148 1.148 0 0 1-1.009.517c-.204 0-.401-.045-.582-.136a1.052 1.052 0 0 1-.48-.457 1.298 1.298 0 0 1-.114-.234h-.045l.004 1.784h-1.059v-4.713h.904l.117.805h.057c.068-.208.177-.401.328-.56a1.129 1.129 0 0 1 .843-.344h.076v-.004Zm7.559.084h.903l.113.805h.053a1.37 1.37 0 0 1 .235-.484.813.813 0 0 1 .313-.242.82.82 0 0 1 .39-.076h.234v1.051h-.401a.662.662 0 0 0-.313.008.623.623 0 0 0-.272.155.663.663 0 0 0-.174.26.683.683 0 0 0-.027.314v1.875h-1.054v-3.666Zm-17.515.003h3.262v.896L3.73 13.104l.034.113h1.973l.042.9H2.4v-.9l1.931-1.754-.045-.117H2.441v-.896Zm11.815 0h1.055v3.659h-1.055V10.45Zm3.443.684.019.016a.69.69 0 0 0-.351.045.756.756 0 0 0-.287.204c-.11.155-.174.336-.189.522h1.545c-.034-.526-.257-.787-.74-.787h.003Zm-5.718.163c-.026 0-.057 0-.083.004a.78.78 0 0 0-.31.053.746.746 0 0 0-.257.189 1.016 1.016 0 0 0-.204.695v.064c-.015.257.057.507.204.711a.634.634 0 0 0 .253.196.638.638 0 0 0 .314.061.644.644 0 0 0 .578-.265c.14-.223.204-.48.189-.74a1.216 1.216 0 0 0-.181-.711.677.677 0 0 0-.503-.257Zm-4.509 1.266a.464.464 0 0 0-.268.102.373.373 0 0 0-.114.276c0 .053.008.106.027.155a.375.375 0 0 0 .087.132.576.576 0 0 0 .397.11v.004a.863.863 0 0 0 .563-.182.573.573 0 0 0 .211-.457v-.14h-.903Z",
- clickup: "M2 18.439l3.69-2.828c1.961 2.56 4.044 3.739 6.363 3.739 2.307 0 4.33-1.166 6.203-3.704L22 18.405C19.298 22.065 15.941 24 12.053 24 8.178 24 4.788 22.078 2 18.439zM12.04 6.15l-6.568 5.66-3.036-3.52L12.055 0l9.543 8.296-3.05 3.509z",
- todoist: "M21 0H3C1.35 0 0 1.35 0 3v3.858s3.854 2.24 4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.608 8.136-4.675.279-.161.58-.107.748-.01.164.097.606.348.84.48.232.134.221.502.013.622l-9.712 5.59c-.346.2-.69.204-1.048.002C3.478 10.907.998 9.463 0 8.882v2.02l4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.609 8.136-4.676.279-.16.58-.106.748-.008.164.096.606.347.84.48.232.133.221.5.013.62-.208.121-9.288 5.346-9.712 5.59-.346.2-.69.205-1.048.002C3.478 14.951.998 13.506 0 12.926v2.02l4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.609 8.136-4.676.279-.16.58-.106.748-.009.164.097.606.348.84.48.232.133.221.502.013.622l-9.712 5.59c-.346.199-.69.204-1.048.001C3.478 18.994.998 17.55 0 16.97V21c0 1.65 1.35 3 3 3h18c1.65 0 3-1.35 3-3V3c0-1.65-1.35-3-3-3z",
- miro: "M17.392 0H13.9L17 4.808 10.444 0H6.949l3.102 6.3L3.494 0H0l3.05 8.131L0 24h3.494L10.05 6.985 6.949 24h3.494L17 5.494 13.899 24h3.493L24 3.672 17.392 0z",
- postman: "M13.527.099C6.955-.744.942 3.9.099 10.473c-.843 6.572 3.8 12.584 10.373 13.428 6.573.843 12.587-3.801 13.428-10.374C24.744 6.955 20.101.943 13.527.099zm2.471 7.485a.855.855 0 0 0-.593.25l-4.453 4.453-.307-.307-.643-.643c4.389-4.376 5.18-4.418 5.996-3.753zm-4.863 4.861l4.44-4.44a.62.62 0 1 1 .847.903l-4.699 4.125-.588-.588zm.33.694l-1.1.238a.06.06 0 0 1-.067-.032.06.06 0 0 1 .01-.073l.645-.645.512.512zm-2.803-.459l1.172-1.172.879.878-1.979.426a.074.074 0 0 1-.085-.039.072.072 0 0 1 .013-.093zm-3.646 6.058a.076.076 0 0 1-.069-.083.077.077 0 0 1 .022-.046h.002l.946-.946 1.222 1.222-2.123-.147zm2.425-1.256a.228.228 0 0 0-.117.256l.203.865a.125.125 0 0 1-.211.117h-.003l-.934-.934-.294-.295 3.762-3.758 1.82-.393.874.874c-1.255 1.102-2.971 2.201-5.1 3.268zm5.279-3.428h-.002l-.839-.839 4.699-4.125a.952.952 0 0 0 .119-.127c-.148 1.345-2.029 3.245-3.977 5.091zm3.657-6.46l-.003-.002a1.822 1.822 0 0 1 2.459-2.684l-1.61 1.613a.119.119 0 0 0 0 .169l1.247 1.247a1.817 1.817 0 0 1-2.093-.343zm2.578 0a1.714 1.714 0 0 1-.271.218h-.001l-1.207-1.207 1.533-1.533c.661.72.637 1.832-.054 2.522zM18.855 6.05a.143.143 0 0 0-.053.157.416.416 0 0 1-.053.45.14.14 0 0 0 .023.197.141.141 0 0 0 .084.03.14.14 0 0 0 .106-.05.691.691 0 0 0 .087-.751.138.138 0 0 0-.194-.033z",
- asana: "M18.78 12.653c-2.882 0-5.22 2.336-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.34 5.22-5.22-2.336-5.22-5.22-5.22zm-13.56 0c-2.88 0-5.22 2.337-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.338 5.22-5.22-2.336-5.22-5.22-5.22zm12-6.525c0 2.883-2.337 5.22-5.22 5.22-2.882 0-5.22-2.337-5.22-5.22 0-2.88 2.338-5.22 5.22-5.22 2.883 0 5.22 2.34 5.22 5.22z",
- box: "M.959 5.523c-.54 0-.959.42-.959.899v7.549a4.59 4.59 0 004.613 4.494 4.717 4.717 0 004.135-2.457c.779 1.438 2.337 2.457 4.074 2.457 2.577 0 4.674-2.037 4.674-4.613.06-2.457-2.037-4.495-4.613-4.495-1.738 0-3.295.959-4.074 2.397-.78-1.438-2.338-2.397-4.135-2.397-1.079 0-2.038.36-2.817.899V6.422a.92.92 0 00-.898-.899zM17.602 9.26a.95.95 0 00-.704.158c-.36.3-.479.899-.18 1.318l2.397 3.116-2.396 3.115c-.3.42-.24.96.18 1.26.419.3 1.016.298 1.316-.122l2.039-2.636 2.096 2.697c.3.36.899.419 1.318.12.36-.3.42-.84.121-1.259l-2.338-3.115 2.338-3.057c.3-.419.298-1.018-.121-1.318-.48-.3-1.019-.24-1.318.18l-2.096 2.576-2.04-2.695c-.149-.18-.373-.3-.612-.338zM4.613 11.154c1.558 0 2.817 1.26 2.817 2.758 0 1.558-1.259 2.756-2.817 2.756-1.558 0-2.816-1.198-2.816-2.756 0-1.498 1.258-2.758 2.816-2.758zm8.27 0c1.558 0 2.816 1.26 2.816 2.758-.06 1.558-1.318 2.756-2.816 2.756-1.558 0-2.817-1.198-2.817-2.756 0-1.498 1.259-2.758 2.817-2.758Z",
- hubspot: "M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z",
- huggingface: "M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378 0 1.112.178 2.181.503 3.185.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284.278.173.48.408.71.694.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542.01.026.653 1.552 1.657 2.54.616.605 1.01 1.223 1.082 1.912.055.537-.096 1.059-.38 1.572.637.121 1.294.187 1.967.187.657 0 1.298-.063 1.921-.178-.287-.517-.44-1.041-.384-1.581.07-.69.465-1.307 1.081-1.913 1.004-.987 1.647-2.513 1.657-2.539.021-.074.083-.285.233-.542.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952.23-.286.432-.52.71-.694.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174 1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013 1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164 1.607-.007 2.984-1.155 3.572-1.164.196-.003.305.12.305.454 0 .886-.424 2.328-1.563 3.202-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026-.01.008-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116 1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243 1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444-.034-.016-.104-.008-.2.022q-.094.03-.216.087-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096 3 3 0 0 0-.26.219 2 2 0 0 0-.12.121 2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203 0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647 2.822 2.813 2.562 3.244-1.176-.506-1.176-.506-2.866-2.567-3.49-1.898.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405-.238.839-2.71-1.587-3.216-.642-.506.946 3.49 2.056 3.522 2.064 1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194 1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647-2.822 2.813-2.562 3.244 1.176-.506 1.176-.506 2.866-2.567 3.49-1.898-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405.238.839 2.71-1.587 3.216-.642.506.946-3.49 2.056-3.522 2.064-1.29.33-4.568 1.028-5.713-.624",
- gmail: "M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z",
- icloud: "M13.762 4.29a6.51 6.51 0 0 0-5.669 3.332 3.571 3.571 0 0 0-1.558-.36 3.571 3.571 0 0 0-3.516 3A4.918 4.918 0 0 0 0 14.796a4.918 4.918 0 0 0 4.92 4.914 4.93 4.93 0 0 0 .617-.045h14.42c2.305-.272 4.041-2.258 4.043-4.589v-.009a4.594 4.594 0 0 0-3.727-4.508 6.51 6.51 0 0 0-6.511-6.27z",
- qq: "M21.395 15.035a40 40 0 0 0-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526 4.632 17.351 0 12 0S4.474 4.632 4.474 9.241c0 .274.013.804.014.836l-1.08 2.695a39 39 0 0 0-.802 2.264c-1.021 3.283-.69 4.643-.438 4.673.54.065 2.103-2.472 2.103-2.472 0 1.469.756 3.387 2.394 4.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578 5.883.369 7.482.189 1.6.18 7.14.389 7.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836 1.637-1.384 2.393-3.302 2.393-4.771 0 0 1.563 2.537 2.103 2.472.251-.03.581-1.39-.438-4.673"
+ notion: ["M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z", "var(--bt-mark-ink)"],
+ linear: ["M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z", "#5E6AD2"],
+ sentry: ["M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z", "#6C5FC7"],
+ stripe: ["M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z", "#635BFF"],
+ square: ["M4.01 0A4.01 4.01 0 000 4.01v15.98c0 2.21 1.8 4 4.01 4.01h15.98C22.2 24 24 22.2 24 19.99V4A4.01 4.01 0 0019.99 0H4zm1.62 4.36h12.74c.7 0 1.26.57 1.26 1.27v12.74c0 .7-.56 1.27-1.26 1.27H5.63c-.7 0-1.26-.57-1.26-1.27V5.63a1.27 1.27 0 011.26-1.27zm3.83 4.35a.73.73 0 00-.73.73v5.09c0 .4.32.72.72.72h5.1a.73.73 0 00.73-.72V9.44a.73.73 0 00-.73-.73h-5.1Z", "#006AFF"],
+ vercel: ["m12 1.608 12 20.784H0Z", "var(--bt-mark-ink)"],
+ supabase: ["M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z", "#3ECF8E"],
+ neon: ["M24 0V24l-9.365-8.045V24H0V0ZM2.942 21.087h8.751V9.563l9.365 8.204V2.919L2.942 2.914Z", "#00C885"],
+ intercom: ["M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z", "#0057FF"],
+ webflow: ["m24 4.515-7.658 14.97H9.149l3.205-6.204h-.144C9.566 16.713 5.621 18.973 0 19.485v-6.118s3.596-.213 5.71-2.435H0V4.515h6.417v5.278l.144-.001 2.622-5.277h4.854v5.244h.144l2.72-5.244H24Z", "#146EF5"],
+ wix: ["m0 7.354 2.113 9.292h.801a1.54 1.54 0 0 0 1.506-1.218l1.351-6.34a.171.171 0 0 1 .167-.137c.08 0 .15.058.167.137l1.352 6.34a1.54 1.54 0 0 0 1.506 1.218h.805l2.113-9.292h-.565c-.62 0-1.159.43-1.296 1.035l-1.26 5.545-1.106-5.176a1.76 1.76 0 0 0-2.19-1.324c-.639.176-1.113.716-1.251 1.365l-1.094 5.127-1.26-5.537A1.33 1.33 0 0 0 .563 7.354H0zm13.992 0a.951.951 0 0 0-.951.95v8.342h.635a.952.952 0 0 0 .951-.95V7.353h-.635zm1.778 0 3.158 4.66-3.14 4.632h1.325c.368 0 .712-.181.918-.486l1.756-2.59a.12.12 0 0 1 .197 0l1.754 2.59c.206.305.55.486.918.486h1.326l-3.14-4.632L24 7.354h-1.326c-.368 0-.712.181-.918.486l-1.772 2.617a.12.12 0 0 1-.197 0L18.014 7.84a1.108 1.108 0 0 0-.918-.486H15.77z", "#0C6EFC"],
+ netlify: ["M6.49 19.04h-.23L5.13 17.9v-.23l1.73-1.71h1.2l.15.15v1.2L6.5 19.04ZM5.13 6.31V6.1l1.13-1.13h.23L8.2 6.68v1.2l-.15.15h-1.2L5.13 6.31Zm9.96 9.09h-1.65l-.14-.13v-3.83c0-.68-.27-1.2-1.1-1.23-.42 0-.9 0-1.43.02l-.07.08v4.96l-.14.14H8.9l-.13-.14V8.73l.13-.14h3.7a2.6 2.6 0 0 1 2.61 2.6v4.08l-.13.14Zm-8.37-2.44H.14L0 12.82v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14Zm17.14 0h-6.58l-.14-.14v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14ZM11.05 6.55V1.64l.14-.14h1.65l.14.14v4.9l-.14.14h-1.65l-.14-.13Zm0 15.81v-4.9l.14-.14h1.65l.14.13v4.91l-.14.14h-1.65l-.14-.14Z", "#00C7B7"],
+ dropbox: ["M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z", "#0061FF"],
+ zapier: ["M4.157 0A4.151 4.151 0 0 0 0 4.161v15.678A4.151 4.151 0 0 0 4.157 24h15.682A4.152 4.152 0 0 0 24 19.839V4.161A4.152 4.152 0 0 0 19.839 0H4.157Zm10.61 8.761h.03a.577.577 0 0 1 .23.038.585.585 0 0 1 .201.124.63.63 0 0 1 .162.431.612.612 0 0 1-.162.435.58.58 0 0 1-.201.128.58.58 0 0 1-.23.042.529.529 0 0 1-.235-.042.585.585 0 0 1-.332-.328.559.559 0 0 1-.038-.235.613.613 0 0 1 .17-.431.59.59 0 0 1 .405-.162Zm2.853 1.572c.03.004.061.004.095.004.325-.011.646.064.937.219.238.144.431.355.552.609.128.279.189.582.185.888v.193a2 2 0 0 1 0 .219h-2.498c.003.227.075.45.204.642a.78.78 0 0 0 .646.265.714.714 0 0 0 .484-.136.642.642 0 0 0 .23-.318l.915.257a1.398 1.398 0 0 1-.28.537c-.14.159-.321.284-.521.355a2.234 2.234 0 0 1-.836.136 1.923 1.923 0 0 1-1.001-.245 1.618 1.618 0 0 1-.665-.703 2.221 2.221 0 0 1-.227-1.036 1.95 1.95 0 0 1 .48-1.398 1.9 1.9 0 0 1 1.3-.488Zm-9.607.023c.162.004.325.026.48.079.207.065.4.174.563.314.26.302.393.692.366 1.088v2.276H8.53l-.109-.711h-.065c-.064.163-.155.31-.272.439a1.122 1.122 0 0 1-.374.264 1.023 1.023 0 0 1-.453.083 1.334 1.334 0 0 1-.866-.264.965.965 0 0 1-.329-.801.993.993 0 0 1 .076-.431 1.02 1.02 0 0 1 .242-.363 1.478 1.478 0 0 1 1.043-.303h.952v-.181a.696.696 0 0 0-.136-.454.553.553 0 0 0-.438-.154.695.695 0 0 0-.378.086.48.48 0 0 0-.193.254l-.99-.144a1.26 1.26 0 0 1 .257-.563c.14-.174.321-.302.533-.378.261-.091.54-.136.82-.129.053-.003.106-.007.163-.007Zm4.384.007c.174 0 .347.038.506.114.182.083.34.211.458.374.257.423.377.911.351 1.406a2.53 2.53 0 0 1-.355 1.448 1.148 1.148 0 0 1-1.009.517c-.204 0-.401-.045-.582-.136a1.052 1.052 0 0 1-.48-.457 1.298 1.298 0 0 1-.114-.234h-.045l.004 1.784h-1.059v-4.713h.904l.117.805h.057c.068-.208.177-.401.328-.56a1.129 1.129 0 0 1 .843-.344h.076v-.004Zm7.559.084h.903l.113.805h.053a1.37 1.37 0 0 1 .235-.484.813.813 0 0 1 .313-.242.82.82 0 0 1 .39-.076h.234v1.051h-.401a.662.662 0 0 0-.313.008.623.623 0 0 0-.272.155.663.663 0 0 0-.174.26.683.683 0 0 0-.027.314v1.875h-1.054v-3.666Zm-17.515.003h3.262v.896L3.73 13.104l.034.113h1.973l.042.9H2.4v-.9l1.931-1.754-.045-.117H2.441v-.896Zm11.815 0h1.055v3.659h-1.055V10.45Zm3.443.684.019.016a.69.69 0 0 0-.351.045.756.756 0 0 0-.287.204c-.11.155-.174.336-.189.522h1.545c-.034-.526-.257-.787-.74-.787h.003Zm-5.718.163c-.026 0-.057 0-.083.004a.78.78 0 0 0-.31.053.746.746 0 0 0-.257.189 1.016 1.016 0 0 0-.204.695v.064c-.015.257.057.507.204.711a.634.634 0 0 0 .253.196.638.638 0 0 0 .314.061.644.644 0 0 0 .578-.265c.14-.223.204-.48.189-.74a1.216 1.216 0 0 0-.181-.711.677.677 0 0 0-.503-.257Zm-4.509 1.266a.464.464 0 0 0-.268.102.373.373 0 0 0-.114.276c0 .053.008.106.027.155a.375.375 0 0 0 .087.132.576.576 0 0 0 .397.11v.004a.863.863 0 0 0 .563-.182.573.573 0 0 0 .211-.457v-.14h-.903Z", "#FF4F00"],
+ todoist: ["M21 0H3C1.35 0 0 1.35 0 3v3.858s3.854 2.24 4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.608 8.136-4.675.279-.161.58-.107.748-.01.164.097.606.348.84.48.232.134.221.502.013.622l-9.712 5.59c-.346.2-.69.204-1.048.002C3.478 10.907.998 9.463 0 8.882v2.02l4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.609 8.136-4.676.279-.16.58-.106.748-.008.164.096.606.347.84.48.232.133.221.5.013.62-.208.121-9.288 5.346-9.712 5.59-.346.2-.69.205-1.048.002C3.478 14.951.998 13.506 0 12.926v2.02l4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.609 8.136-4.676.279-.16.58-.106.748-.009.164.097.606.348.84.48.232.133.221.502.013.622l-9.712 5.59c-.346.199-.69.204-1.048.001C3.478 18.994.998 17.55 0 16.97V21c0 1.65 1.35 3 3 3h18c1.65 0 3-1.35 3-3V3c0-1.65-1.35-3-3-3z", "#E44332"],
+ miro: ["M17.392 0H13.9L17 4.808 10.444 0H6.949l3.102 6.3L3.494 0H0l3.05 8.131L0 24h3.494L10.05 6.985 6.949 24h3.494L17 5.494 13.899 24h3.493L24 3.672 17.392 0z", "#F59E0B"],
+ postman: ["M13.527.099C6.955-.744.942 3.9.099 10.473c-.843 6.572 3.8 12.584 10.373 13.428 6.573.843 12.587-3.801 13.428-10.374C24.744 6.955 20.101.943 13.527.099zm2.471 7.485a.855.855 0 0 0-.593.25l-4.453 4.453-.307-.307-.643-.643c4.389-4.376 5.18-4.418 5.996-3.753zm-4.863 4.861l4.44-4.44a.62.62 0 1 1 .847.903l-4.699 4.125-.588-.588zm.33.694l-1.1.238a.06.06 0 0 1-.067-.032.06.06 0 0 1 .01-.073l.645-.645.512.512zm-2.803-.459l1.172-1.172.879.878-1.979.426a.074.074 0 0 1-.085-.039.072.072 0 0 1 .013-.093zm-3.646 6.058a.076.076 0 0 1-.069-.083.077.077 0 0 1 .022-.046h.002l.946-.946 1.222 1.222-2.123-.147zm2.425-1.256a.228.228 0 0 0-.117.256l.203.865a.125.125 0 0 1-.211.117h-.003l-.934-.934-.294-.295 3.762-3.758 1.82-.393.874.874c-1.255 1.102-2.971 2.201-5.1 3.268zm5.279-3.428h-.002l-.839-.839 4.699-4.125a.952.952 0 0 0 .119-.127c-.148 1.345-2.029 3.245-3.977 5.091zm3.657-6.46l-.003-.002a1.822 1.822 0 0 1 2.459-2.684l-1.61 1.613a.119.119 0 0 0 0 .169l1.247 1.247a1.817 1.817 0 0 1-2.093-.343zm2.578 0a1.714 1.714 0 0 1-.271.218h-.001l-1.207-1.207 1.533-1.533c.661.72.637 1.832-.054 2.522zM18.855 6.05a.143.143 0 0 0-.053.157.416.416 0 0 1-.053.45.14.14 0 0 0 .023.197.141.141 0 0 0 .084.03.14.14 0 0 0 .106-.05.691.691 0 0 0 .087-.751.138.138 0 0 0-.194-.033z", "#FF6C37"],
+ asana: ["M18.78 12.653c-2.882 0-5.22 2.336-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.34 5.22-5.22-2.336-5.22-5.22-5.22zm-13.56 0c-2.88 0-5.22 2.337-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.338 5.22-5.22-2.336-5.22-5.22-5.22zm12-6.525c0 2.883-2.337 5.22-5.22 5.22-2.882 0-5.22-2.337-5.22-5.22 0-2.88 2.338-5.22 5.22-5.22 2.883 0 5.22 2.34 5.22 5.22z", "#F06A6A"],
+ box: ["M.959 5.523c-.54 0-.959.42-.959.899v7.549a4.59 4.59 0 004.613 4.494 4.717 4.717 0 004.135-2.457c.779 1.438 2.337 2.457 4.074 2.457 2.577 0 4.674-2.037 4.674-4.613.06-2.457-2.037-4.495-4.613-4.495-1.738 0-3.295.959-4.074 2.397-.78-1.438-2.338-2.397-4.135-2.397-1.079 0-2.038.36-2.817.899V6.422a.92.92 0 00-.898-.899zM17.602 9.26a.95.95 0 00-.704.158c-.36.3-.479.899-.18 1.318l2.397 3.116-2.396 3.115c-.3.42-.24.96.18 1.26.419.3 1.016.298 1.316-.122l2.039-2.636 2.096 2.697c.3.36.899.419 1.318.12.36-.3.42-.84.121-1.259l-2.338-3.115 2.338-3.057c.3-.419.298-1.018-.121-1.318-.48-.3-1.019-.24-1.318.18l-2.096 2.576-2.04-2.695c-.149-.18-.373-.3-.612-.338zM4.613 11.154c1.558 0 2.817 1.26 2.817 2.758 0 1.558-1.259 2.756-2.817 2.756-1.558 0-2.816-1.198-2.816-2.756 0-1.498 1.258-2.758 2.816-2.758zm8.27 0c1.558 0 2.816 1.26 2.816 2.758-.06 1.558-1.318 2.756-2.816 2.756-1.558 0-2.817-1.198-2.817-2.756 0-1.498 1.259-2.758 2.817-2.758Z", "#0061D5"],
+ hubspot: ["M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z", "#FF7A59"],
+ huggingface: ["M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378 0 1.112.178 2.181.503 3.185.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284.278.173.48.408.71.694.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542.01.026.653 1.552 1.657 2.54.616.605 1.01 1.223 1.082 1.912.055.537-.096 1.059-.38 1.572.637.121 1.294.187 1.967.187.657 0 1.298-.063 1.921-.178-.287-.517-.44-1.041-.384-1.581.07-.69.465-1.307 1.081-1.913 1.004-.987 1.647-2.513 1.657-2.539.021-.074.083-.285.233-.542.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952.23-.286.432-.52.71-.694.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174 1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013 1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164 1.607-.007 2.984-1.155 3.572-1.164.196-.003.305.12.305.454 0 .886-.424 2.328-1.563 3.202-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026-.01.008-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116 1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243 1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444-.034-.016-.104-.008-.2.022q-.094.03-.216.087-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096 3 3 0 0 0-.26.219 2 2 0 0 0-.12.121 2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203 0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647 2.822 2.813 2.562 3.244-1.176-.506-1.176-.506-2.866-2.567-3.49-1.898.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405-.238.839-2.71-1.587-3.216-.642-.506.946 3.49 2.056 3.522 2.064 1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194 1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647-2.822 2.813-2.562 3.244 1.176-.506 1.176-.506 2.866-2.567 3.49-1.898-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405.238.839 2.71-1.587 3.216-.642.506.946-3.49 2.056-3.522 2.064-1.29.33-4.568 1.028-5.713-.624", "#F59E0B"],
+ icloud: ["M13.762 4.29a6.51 6.51 0 0 0-5.669 3.332 3.571 3.571 0 0 0-1.558-.36 3.571 3.571 0 0 0-3.516 3A4.918 4.918 0 0 0 0 14.796a4.918 4.918 0 0 0 4.92 4.914 4.93 4.93 0 0 0 .617-.045h14.42c2.305-.272 4.041-2.258 4.043-4.589v-.009a4.594 4.594 0 0 0-3.727-4.508 6.51 6.51 0 0 0-6.511-6.27z", "#3693F3"],
+ qq: ["M21.395 15.035a40 40 0 0 0-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526 4.632 17.351 0 12 0S4.474 4.632 4.474 9.241c0 .274.013.804.014.836l-1.08 2.695a39 39 0 0 0-.802 2.264c-1.021 3.283-.69 4.643-.438 4.673.54.065 2.103-2.472 2.103-2.472 0 1.469.756 3.387 2.394 4.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578 5.883.369 7.482.189 1.6.18 7.14.389 7.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836 1.637-1.384 2.393-3.302 2.393-4.771 0 0 1.563 2.537 2.103 2.472.251-.03.581-1.39-.438-4.673", "#1EBAFC"]
};
-var siMarks = Object.fromEntries(Object.entries(SI).map(([id, d]) => [id, mark(path(d))]));
-var SLACK_DROP = "M11.2 7H8.9A2.3 2.3 0 1 0 11.2 4.7V7Z";
+var siMarks = Object.fromEntries(Object.entries(SI).map(([id, [d, fill2]]) => [id, mark(path(d, fill2))]));
+var AtlassianMark = mark(
+ path("M7.12 11.084a.683.683 0 00-1.16.126L.075 22.974a.703.703 0 00.63 1.018h8.19a.678.678 0 00.63-.39c1.767-3.65.696-9.203-2.406-12.52z", "#2684FF"),
+ path("M11.434.386a15.515 15.515 0 00-.906 15.317l3.95 7.9a.703.703 0 00.628.388h8.19a.703.703 0 00.63-1.017L12.63.38a.664.664 0 00-1.196.006z", "#0052CC")
+);
+var CloudflareMark = mark(
+ path("M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268z", "#F38020"),
+ path("M19.2656 11.2813c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727", "#FAAE40")
+);
+var PaypalMark = mark(
+ path("M15.607 4.653H8.941L6.645 19.251H1.82L4.862 0h7.995c3.754 0 6.375 2.294 6.473 5.513-.648-.478-2.105-.86-3.722-.86Z", "#1557C0"),
+ path("M22.178 10.199c0 3.41-3.01 6.853-6.958 6.853h-2.493L11.595 24H6.74l1.845-11.538h3.592c4.208 0 7.346-3.634 7.153-6.949a5.24 5.24 0 0 1 2.848 4.686Z", "#2997FF"),
+ path("M9.653 5.546h6.408c.907 0 1.942.222 2.363.541-.195 2.741-2.655 5.483-6.441 5.483H8.714Z", "#00457C")
+);
+var AirtableMark = mark(
+ path("M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257z", "#FCB400"),
+ path("M23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596z", "#18BFFF"),
+ path("M.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z", "#F82B60")
+);
+var ClickupMark = mark(
+ path("M2 18.439l3.69-2.828c1.961 2.56 4.044 3.739 6.363 3.739 2.307 0 4.33-1.166 6.203-3.704L22 18.405C19.298 22.065 15.941 24 12.053 24 8.178 24 4.788 22.078 2 18.439z", "#49CCF9"),
+ path("M12.04 6.15l-6.568 5.66-3.036-3.52L12.055 0l9.543 8.296-3.05 3.509z", "#7B68EE")
+);
+var FigmaMark = mark(
+ path("M8.4 1.2h3.6v7.2H8.4a3.6 3.6 0 1 1 0-7.2Z", "#F24E1E"),
+ path("M12 1.2h3.6a3.6 3.6 0 1 1 0 7.2H12V1.2Z", "#FF7262"),
+ path("M8.4 8.4h3.6v7.2H8.4a3.6 3.6 0 1 1 0-7.2Z", "#A259FF"),
+ (0, import_react24.createElement)("circle", { cx: 15.6, cy: 12, r: 3.6, fill: "#1ABCFE" }),
+ path("M8.4 15.6h3.6v3.6a3.6 3.6 0 1 1-3.6-3.6Z", "#0ACF83")
+);
+var GmailMark = mark(
+ path("M0 5.457v13.909c0 .904.732 1.636 1.636 1.636h3.819V11.73L0 7.64V5.457Z", "#4285F4"),
+ path("M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L24 7.64V5.457Z", "#34A853"),
+ path("M18.545 4.64v7.09L24 7.64V5.457c0-2.023-2.31-3.177-3.927-1.964L18.545 4.64Z", "#FBBC04"),
+ path("M5.455 4.64v7.09L12 16.64l6.545-4.91V4.64L12 9.548 5.455 4.64Z", "#EA4335"),
+ path("M0 5.457v2.183l5.455 4.09V4.64L3.927 3.493C2.309 2.28 0 3.434 0 5.457Z", "#C5221F")
+);
+var SLACK_QUAD = [[0, "#36C5F0"], [90, "#2EB67D"], [180, "#ECB22E"], [270, "#E01E5A"]];
var SlackMark = () => svg(
- [0, 90, 180, 270].map((a) => (0, import_react24.createElement)(
+ SLACK_QUAD.map(([a, fill2]) => (0, import_react24.createElement)(
"g",
- { key: a, transform: `rotate(${a} 12 12)` },
- path(SLACK_DROP),
- (0, import_react24.createElement)("rect", { x: 2.6, y: 8.2, width: 7.6, height: 4.4, rx: 2.2 })
+ { key: a, transform: `rotate(${a} 12 12)`, fill: fill2 },
+ (0, import_react24.createElement)("path", { d: "M9.3 1.8a1.9 1.9 0 0 0 0 3.8h1.9V3.7a1.9 1.9 0 0 0-1.9-1.9Z" }),
+ (0, import_react24.createElement)("rect", { x: 1.8, y: 7.4, width: 9.4, height: 3.8, rx: 1.9 })
))
);
-var CanvaMark = mark((0, import_react24.createElement)("path", { d: "M17.6 7.6C14.9 4.8 10.4 4.5 7.4 7.6 4.2 10.9 4.7 16.2 8.6 18.6c3 1.9 7.4 1.4 9.5-1.1", fill: "none", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round" }));
+var CanvaMark = mark(
+ path("M17.8 7.5A6.8 6.8 0 0 0 6.8 9.2c-1.5 3.6-.1 7.8 3.4 9.3a6.8 6.8 0 0 0 7.6-1.8", "none"),
+ (0, import_react24.createElement)("path", { d: "M17.8 7.5A6.8 6.8 0 0 0 6.8 9.2", stroke: "#00C4CC", strokeWidth: 3.2, strokeLinecap: "round" }),
+ (0, import_react24.createElement)("path", { d: "M6.8 9.2c-1.5 3.6-.1 7.8 3.4 9.3a6.8 6.8 0 0 0 7.6-1.8", stroke: "#7D2AE8", strokeWidth: 3.2, strokeLinecap: "round" })
+);
var MondayMark = () => svg(
- (0, import_react24.createElement)("path", { d: "M5.2 3.4L8 14.8 13.8 18.6", fill: "none", stroke: "currentColor", strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" }),
- (0, import_react24.createElement)("path", { d: "M13.4 6.2L17.8 13.6", fill: "none", stroke: "currentColor", strokeWidth: 4, strokeLinecap: "round" }),
- (0, import_react24.createElement)("circle", { cx: 18.6, cy: 19.2, r: 2.5 })
+ (0, import_react24.createElement)("path", { d: "M4.6 17.2L8.8 7.2", stroke: "#FF3D57", strokeWidth: 4.4, strokeLinecap: "round" }),
+ (0, import_react24.createElement)("path", { d: "M12.2 17.2L16.4 7.2", stroke: "#FFCB00", strokeWidth: 4.4, strokeLinecap: "round" }),
+ (0, import_react24.createElement)("circle", { cx: 19.6, cy: 17.2, r: 2.3, fill: "#00CA72" })
);
var AttioMark = mark((0, import_react24.createElement)(
"g",
{ transform: "translate(3 0) skewX(-15)" },
- (0, import_react24.createElement)("rect", { x: 4.4, y: 3.4, width: 4.4, height: 17.2, rx: 1.2 }),
- (0, import_react24.createElement)("rect", { x: 13.4, y: 3.4, width: 4.4, height: 17.2, rx: 1.2 })
+ (0, import_react24.createElement)("rect", { x: 4.4, y: 3.4, width: 4.4, height: 17.2, rx: 1.2, fill: "var(--bt-mark-ink)" }),
+ (0, import_react24.createElement)("rect", { x: 13.4, y: 3.4, width: 4.4, height: 17.2, rx: 1.2, fill: "#6366F1" })
));
var ExaMark = () => svg(
- (0, import_react24.createElement)("rect", { x: 4.7, y: 4.7, width: 14.6, height: 14.6, fill: "none", stroke: "currentColor", strokeWidth: 1.9 }),
- (0, import_react24.createElement)("path", { d: "M6 6L10.9 12 6 18M18 6L10.9 12 18 18", fill: "none", stroke: "currentColor", strokeWidth: 1.9 })
+ (0, import_react24.createElement)("rect", { x: 4.2, y: 4.2, width: 15.6, height: 15.6, rx: 1.5, stroke: "#254BF6", strokeWidth: 2.1 }),
+ (0, import_react24.createElement)("path", { d: "M5.6 5.6L11 12 5.6 18.4M18.4 5.6L11 12 18.4 18.4", stroke: "#254BF6", strokeWidth: 2.1 })
);
var HEX = (cx, cy, r) => `M${cx} ${cy - r}l${r * 0.87} ${r * 0.5}v${r}l-${r * 0.87} ${r * 0.5}l-${r * 0.87}-${r * 0.5}v-${r}l${r * 0.87}-${r * 0.5}z`;
-var DeepwikiMark = mark(path(HEX(7.2, 6.9, 4.4)) + HEX(7.2, 17.1, 4.4) + HEX(15.6, 12, 4.4));
+var DeepwikiMark = mark(
+ path(HEX(7.2, 6.9, 4.4) + HEX(7.2, 17.1, 4.4), "#2B7FFF"),
+ path(HEX(15.6, 12, 4.4), "#0D9488")
+);
var Context7Mark = () => (0, import_react24.createElement)(
"svg",
- { width: 20, height: 20, viewBox: "0 0 28 28", fill: "currentColor", "aria-hidden": true },
- path("M10.5724 15.2565C10.5724 17.5025 9.6613 19.3778 8.17805 21.1047H11.6319L11.6319 22.7786H6.33459V21.1895C7.95557 19.3566 8.58065 17.8628 8.58065 15.2565L10.5724 15.2565Z"),
- path("M17.4276 15.2565C17.4276 17.5025 18.3387 19.3778 19.822 21.1047H16.3681V22.7786H21.6654V21.1895C20.0444 19.3566 19.4194 17.8628 19.4194 15.2565H17.4276Z"),
- path("M10.5724 12.7435C10.5724 10.4975 9.66131 8.62224 8.17807 6.89532L11.6319 6.89532V5.22137L6.33461 5.22137V6.81056C7.95558 8.64343 8.58066 10.1373 8.58066 12.7435L10.5724 12.7435Z"),
- path("M17.4276 12.7435C17.4276 10.4975 18.3387 8.62224 19.822 6.89532L16.3681 6.89532L16.3681 5.22138L21.6654 5.22138V6.81056C20.0444 8.64343 19.4194 10.1373 19.4194 12.7435H17.4276Z")
+ { width: 20, height: 20, viewBox: "0 0 28 28", fill: "#059669", "aria-hidden": true },
+ (0, import_react24.createElement)("path", { d: "M10.5724 15.2565C10.5724 17.5025 9.6613 19.3778 8.17805 21.1047H11.6319L11.6319 22.7786H6.33459V21.1895C7.95557 19.3566 8.58065 17.8628 8.58065 15.2565L10.5724 15.2565Z" }),
+ (0, import_react24.createElement)("path", { d: "M17.4276 15.2565C17.4276 17.5025 18.3387 19.3778 19.822 21.1047H16.3681V22.7786H21.6654V21.1895C20.0444 19.3566 19.4194 17.8628 19.4194 15.2565H17.4276Z" }),
+ (0, import_react24.createElement)("path", { d: "M10.5724 12.7435C10.5724 10.4975 9.66131 8.62224 8.17807 6.89532L11.6319 6.89532V5.22137L6.33461 5.22137V6.81056C7.95558 8.64343 8.58066 10.1373 8.58066 12.7435L10.5724 12.7435Z" }),
+ (0, import_react24.createElement)("path", { d: "M17.4276 12.7435C17.4276 10.4975 18.3387 8.62224 19.822 6.89532L16.3681 6.89532L16.3681 5.22138L21.6654 5.22138V6.81056C20.0444 8.64343 19.4194 10.1373 19.4194 12.7435H17.4276Z" })
);
var MslearnMark = () => svg(
- (0, import_react24.createElement)("rect", { x: 2.5, y: 2.5, width: 8.75, height: 8.75 }),
- (0, import_react24.createElement)("rect", { x: 12.75, y: 2.5, width: 8.75, height: 8.75 }),
- (0, import_react24.createElement)("rect", { x: 2.5, y: 12.75, width: 8.75, height: 8.75 }),
- (0, import_react24.createElement)("rect", { x: 12.75, y: 12.75, width: 8.75, height: 8.75 })
+ (0, import_react24.createElement)("rect", { x: 2.5, y: 2.5, width: 8.75, height: 8.75, fill: "#F25022" }),
+ (0, import_react24.createElement)("rect", { x: 12.75, y: 2.5, width: 8.75, height: 8.75, fill: "#7FBA00" }),
+ (0, import_react24.createElement)("rect", { x: 2.5, y: 12.75, width: 8.75, height: 8.75, fill: "#00A4EF" }),
+ (0, import_react24.createElement)("rect", { x: 12.75, y: 12.75, width: 8.75, height: 8.75, fill: "#FFB900" })
+);
+var AmapMark = mark(
+ path("M20.6 3.4L2.4 11.9l6.7 2.5L20.6 3.4Z", "#42A5F5"),
+ path("M20.6 3.4L9.1 14.4l1.1 5.8 3.2-3.7 7.2-13.1Z", "#1565C0"),
+ path("M20.6 3.4l-7.2 13.1 4.8 3.9 2.4-17Z", "#1E88E5")
);
-var AmapMark = mark(path("M12 2.9L19.6 20.8 12.9 16.8 12 14.9 11.1 16.8 4.4 20.8Z"));
-var EnvelopeMark = () => svg(
- (0, import_react24.createElement)("rect", { x: 2.4, y: 5.2, width: 19.2, height: 13.6, rx: 2.4 }),
- (0, import_react24.createElement)("path", { d: "M4.2 7.4L12 13.6 19.8 7.4", fill: "none", stroke: "var(--bt-card)", strokeWidth: 1.7, strokeLinecap: "round", strokeLinejoin: "round" })
+var envelope = (fill2) => mark(
+ path("M3.2 5.2h17.6c.7 0 1.3.4 1.6 1L12 13.4 1.6 6.2c.3-.6.9-1 1.6-1Z", fill2),
+ path("M1.6 8.2l9.7 6.7a1.2 1.2 0 0 0 1.4 0l9.7-6.7v8.6a2 2 0 0 1-2 2H3.6a2 2 0 0 1-2-2V8.2Z", fill2)
);
+var EnvelopeBlue = envelope("#3B82F6");
+var EnvelopeRed = envelope("#E60012");
var MARKS = {
- github: GitHubMark,
+ github: GithubBrandMark,
...siMarks,
- "cloudflare-docs": siMarks.cloudflare,
+ atlassian: AtlassianMark,
+ cloudflare: CloudflareMark,
+ "cloudflare-docs": CloudflareMark,
+ paypal: PaypalMark,
+ airtable: AirtableMark,
+ clickup: ClickupMark,
+ figma: FigmaMark,
slack: SlackMark,
canva: CanvaMark,
monday: MondayMark,
@@ -10701,11 +10803,11 @@ var MARKS = {
context7: Context7Mark,
mslearn: MslearnMark,
amap: AmapMark,
- mail: EnvelopeMark,
- "mail-163": EnvelopeMark,
- "mail-126": EnvelopeMark,
- "mail-other": EnvelopeMark,
- "mail-gmail": siMarks.gmail,
+ mail: EnvelopeBlue,
+ "mail-163": EnvelopeRed,
+ "mail-126": EnvelopeRed,
+ "mail-other": EnvelopeBlue,
+ "mail-gmail": GmailMark,
"mail-icloud": siMarks.icloud,
"mail-qq": siMarks.qq
};
@@ -10720,17 +10822,19 @@ function ConnectorMark({ connector }) {
for (const ch of String(connector.id)) hash = hash * 31 + ch.charCodeAt(0) >>> 0;
return (0, import_react25.createElement)("span", { className: "bt-connector-mono", style: { "--bt-hue": hash % 360 }, "aria-hidden": true }, (connector.name ?? "?").slice(0, 1).toUpperCase());
}
-var CATEGORIES = ["dev", "docs", "work", "design", "data", "commerce", "search"];
-var CATEGORY_LABEL = { dev: "Developer", docs: "Docs & files", work: "Work", design: "Design", data: "Data", commerce: "Commerce", search: "Search" };
function statusText2(connector) {
if (connector.state === "connecting") return connector.pending ? t("Waiting for sign-in…") : t("Connecting…");
if (connector.state === "needs-sign-in") return t("Sign in again");
if (connector.state === "needs-client") return t("This service needs an app client ID");
if (connector.state === "error") return t("Could not connect: {error}", { error: connector.error ?? "" });
- if (connector.state === "ready") return connector.account ? t("Connected as {account}", { account: connector.account }) : t("Connected");
- return connector.about ?? "";
+ if (connector.state === "ready") {
+ const who = connector.account ? t("Connected as {account}", { account: connector.account }) : t("Connected");
+ return connector.tools > 0 ? `${who} · ${t("{count} tools", { count: connector.tools })}` : who;
+ }
+ return connector.about ? t(connector.about) : "";
}
function BrowserPanel({ connector, actions, run: run2 }) {
+ const [pasting, setPasting] = (0, import_react25.useState)(false);
const [input, setInput] = (0, import_react25.useState)("");
return (0, import_react25.createElement)(
"div",
@@ -10738,37 +10842,41 @@ function BrowserPanel({ connector, actions, run: run2 }) {
(0, import_react25.createElement)(
"div",
{ className: "bt-connector-form-row" },
- (0, import_react25.createElement)("a", { className: "bt-connector-link", href: connector.pending.url, target: "_blank", rel: "noopener noreferrer" }, t("Open the sign-in page")),
+ (0, import_react25.createElement)("span", { className: "bt-connector-wait" }, t("Finish signing in in your browser.")),
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-connector-link", onClick: () => openPage(connector.pending.url) }, t("Open again")),
(0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void run2(actions.connectorCancel(connector.id)) }, t("Cancel"))
),
- (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": t("Paste the address you land on"), placeholder: t("Or paste the address you land on"), value: input, spellCheck: false, autoComplete: "off", onChange: (e) => setInput(e.target.value) }),
- input.trim() !== "" ? (0, import_react25.createElement)(
+ pasting ? (0, import_react25.createElement)(
"div",
{ className: "bt-connector-form-row" },
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void run2(actions.connectorSignInCode(connector.id, input.trim())) }, t("Finish sign-in"))
- ) : null
+ (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": t("Paste the address you land on"), placeholder: t("Paste the address you land on"), value: input, spellCheck: false, autoComplete: "off", autoFocus: true, onChange: (e) => setInput(e.target.value) }),
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: input.trim() === "", onClick: () => void run2(actions.connectorSignInCode(connector.id, input.trim())) }, t("Finish sign-in"))
+ ) : (0, import_react25.createElement)("button", { type: "button", className: "bt-connector-link bt-connector-aside", onClick: () => setPasting(true) }, t("Did not come back here?"))
);
}
function DevicePanel({ connector, actions, run: run2, onUseToken }) {
+ const { userCode, verificationUri } = connector.pending;
const [copied, setCopied] = (0, import_react25.useState)(false);
+ const copy2 = () => {
+ void navigator.clipboard?.writeText(userCode).then(() => {
+ setCopied(true);
+ setTimeout(() => setCopied(false), 1600);
+ });
+ };
return (0, import_react25.createElement)(
"div",
{ className: "bt-connector-form" },
(0, import_react25.createElement)(
"div",
{ className: "bt-connector-device" },
- (0, import_react25.createElement)("code", { className: "bt-connector-code" }, connector.pending.userCode),
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => {
- void navigator.clipboard?.writeText(connector.pending.userCode).then(() => {
- setCopied(true);
- setTimeout(() => setCopied(false), 1600);
- });
- } }, copied ? t("Copied") : t("Copy"))
+ (0, import_react25.createElement)("code", { className: "bt-connector-code" }, userCode),
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: copy2 }, copied ? t("Copied") : t("Copy"))
),
(0, import_react25.createElement)(
"div",
{ className: "bt-connector-form-row" },
- (0, import_react25.createElement)("a", { className: "bt-connector-link", href: connector.pending.verificationUri, target: "_blank", rel: "noopener noreferrer" }, t("Open {host}", { host: connector.pending.verificationUri.replace(/^https?:\/\//, "") })),
+ (0, import_react25.createElement)("span", { className: "bt-connector-wait" }, t("Paste the code on {host} and authorize.", { host: verificationUri.replace(/^https?:\/\//, "") })),
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-connector-link", onClick: () => openPage(verificationUri) }, t("Open again")),
connector.auth?.token === true && onUseToken ? (0, import_react25.createElement)("button", { type: "button", className: "bt-connector-link", onClick: () => void run2(actions.connectorCancel(connector.id), onUseToken) }, t("Use a token instead")) : null,
(0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void run2(actions.connectorCancel(connector.id)) }, t("Cancel"))
)
@@ -10807,36 +10915,62 @@ function TokenPanel({ connector, actions, run: run2, onDone }) {
(0, import_react25.createElement)(
"div",
{ className: "bt-connector-form-row" },
- connector.id === "github" ? (0, import_react25.createElement)("a", { className: "bt-connector-link", href: TOKEN_URL, target: "_blank", rel: "noopener noreferrer" }, t("Create a token on GitHub")) : connector.auth?.keyUrl ? (0, import_react25.createElement)("a", { className: "bt-connector-link", href: connector.auth.keyUrl, target: "_blank", rel: "noopener noreferrer" }, t("Get a key")) : (0, import_react25.createElement)("span", { className: "bt-connector-link" }),
+ connector.id === "github" ? (0, import_react25.createElement)("a", { className: "bt-connector-link", href: TOKEN_URL, target: "_blank", rel: "noopener noreferrer" }, t("Create a token on GitHub")) : connector.auth?.keyUrl ? (0, import_react25.createElement)("a", { className: "bt-connector-link", href: connector.auth.keyUrl, target: "_blank", rel: "noopener noreferrer" }, t("Get a key")) : (0, import_react25.createElement)("span", { className: "bt-connector-wait" }),
(0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onDone }, t("Cancel")),
(0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: token.trim() === "", onClick: connect }, t("Connect"))
)
);
}
+var openSignIn = (win, id, view) => {
+ const pending = view?.connectors?.find((entry) => entry.id === id)?.pending;
+ if (pending?.kind === "browser") return void win.go(pending.url);
+ if (pending?.kind === "device") {
+ void navigator.clipboard?.writeText(pending.userCode).catch(() => {
+ });
+ return void win.go(pending.verificationUri);
+ }
+ win.close();
+};
function ConnectorRow({ connector, actions }) {
const [form, setForm] = (0, import_react25.useState)(null);
const [busy, setBusy] = (0, import_react25.useState)(false);
const [error, setError] = (0, import_react25.useState)(null);
- const run2 = (task, after) => {
+ const run2 = (task, after, failed) => {
setBusy(true);
setError(null);
- return Promise.resolve(task).then(() => {
- after?.();
- }, (failure) => setError(failure?.message ?? String(failure))).finally(() => setBusy(false));
+ return Promise.resolve(task).then((value) => {
+ after?.(value);
+ }, (failure) => {
+ failed?.();
+ setError(failure?.message ?? String(failure));
+ }).finally(() => setBusy(false));
};
const on = connector.state !== "off" && connector.state !== "needs-client";
const pending = connector.pending;
const row = (0, import_react25.useRef)(null);
useMorph(row, `${form}:${error !== null}:${connector.state}:${pending?.kind ?? ""}`);
+ const signIn = () => {
+ const win = reserveWindow();
+ void run2(actions.connectorConnect(connector.id, {}), (view) => openSignIn(win, connector.id, view), () => win.close());
+ };
const connect = () => {
if (connector.auth?.kind === "none") return void run2(actions.connectorConnect(connector.id, {}));
if (connector.auth?.kind === "key") return setForm("token");
- if (connector.auth?.kind === "oauth") {
- if (connector.auth.client?.id || !connector.auth.token) return void run2(actions.connectorConnect(connector.id, {}));
- return setForm("token");
- }
+ if (connector.auth?.kind === "oauth") return connector.auth.client?.id || !connector.auth.token ? signIn() : setForm("token");
return void 0;
};
+ const button = (label, onClick) => (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick }, label);
+ let actionsNode = null;
+ if (pending || form) actionsNode = null;
+ else if (connector.state === "needs-sign-in") actionsNode = [button(t("Sign in again"), signIn), button(t("Disconnect"), () => void run2(actions.connectorDisconnect(connector.id)))];
+ else if (connector.state === "error") actionsNode = [button(t("Try again"), () => void run2(actions.connectorRetry(connector.id))), button(connector.custom ? t("Remove") : t("Disconnect"), () => void run2(actions.connectorDisconnect(connector.id)))];
+ else if (on) actionsNode = button(connector.custom ? t("Remove") : t("Disconnect"), () => void run2(actions.connectorDisconnect(connector.id)));
+ else {
+ actionsNode = [
+ connector.auth?.kind === "oauth" && connector.auth.token === true && connector.auth.client?.id ? (0, import_react25.createElement)("button", { key: "token", type: "button", className: "bt-connector-link", disabled: busy, onClick: () => setForm("token") }, t("Use a token instead")) : null,
+ (0, import_react25.createElement)("button", { key: "connect", type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: connect }, busy ? t("Connecting…") : t("Connect"))
+ ];
+ }
return (0, import_react25.createElement)(
"div",
{ ref: row, className: "bt-connector", "data-state": connector.state },
@@ -10848,17 +10982,11 @@ function ConnectorRow({ connector, actions }) {
"span",
{ className: "bt-connector-text" },
(0, import_react25.createElement)("span", { className: "bt-connector-name" }, connector.name, connector.custom ? (0, import_react25.createElement)("span", { className: "bt-tag" }, t("Added")) : null),
- (0, import_react25.createElement)("span", { className: "bt-connector-status" }, t(statusText2(connector)))
+ (0, import_react25.createElement)("span", { className: "bt-connector-status" }, statusText2(connector))
),
- (0, import_react25.createElement)(
- "span",
- { className: "bt-connector-actions" },
- connector.state === "error" || connector.state === "needs-sign-in" ? (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.connectorRetry(connector.id)) }, connector.state === "needs-sign-in" ? t("Sign in again") : t("Try again")) : null,
- on && !pending ? (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.connectorDisconnect(connector.id)) }, connector.custom ? t("Remove") : t("Disconnect")) : pending || form ? null : (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: connect }, t("Connect")),
- !on && !pending && form === null && connector.auth?.kind === "oauth" && connector.auth.token === true && connector.auth.client?.id ? (0, import_react25.createElement)("button", { type: "button", className: "bt-connector-link", disabled: busy, onClick: () => setForm("token") }, t("Use a token instead")) : null
- )
+ actionsNode ? (0, import_react25.createElement)("span", { className: "bt-connector-actions" }, actionsNode) : null
),
- connector.readOnly !== void 0 && on ? (0, import_react25.createElement)(
+ connector.readOnly !== void 0 && on && connector.state === "ready" ? (0, import_react25.createElement)(
"div",
{ className: "bt-connector-ro" },
(0, import_react25.createElement)(SwitchRow, { label: t("Read-only"), on: connector.readOnly === true, onChange: (checked) => void run2(actions.connectorSet(connector.id, { readOnly: checked })) })
@@ -10870,8 +10998,7 @@ function ConnectorRow({ connector, actions }) {
setForm(null);
setError(null);
} }) : null,
- error ? (0, import_react25.createElement)("div", { className: "bt-connector-error", role: "alert" }, error) : null,
- connector.tools > 0 ? (0, import_react25.createElement)("div", { className: "bt-connector-status" }, t("{count} tools", { count: connector.tools })) : null
+ error ? (0, import_react25.createElement)("div", { className: "bt-connector-error", role: "alert" }, hostText(error)) : null
);
}
var NETEASE_STEPS = [
@@ -10919,23 +11046,19 @@ var MAIL_GUIDES = {
};
function MailAccount({ account, actions, run: run2 }) {
const [busy, setBusy] = (0, import_react25.useState)(false);
- const busyRef = (0, import_react25.useRef)(false);
const remove = () => {
- if (busyRef.current || busy) return;
- busyRef.current = true;
+ if (busy) return;
setBusy(true);
- void Promise.resolve(run2(actions.mailAccountRemove(account.id))).finally(() => {
- busyRef.current = false;
- setBusy(false);
- });
+ void Promise.resolve(run2(actions.mailAccountRemove(account.id))).finally(() => setBusy(false));
};
+ const markId = `mail-${account.provider}`;
return (0, import_react25.createElement)(
"div",
{ className: "bt-connector", "data-state": account.error ? "error" : "ready" },
(0, import_react25.createElement)(
"div",
{ className: "bt-connector-head" },
- (0, import_react25.createElement)("span", { className: "bt-connector-mark" }, (0, import_react25.createElement)(ConnectorMark, { connector: { id: `mail-${account.provider}`, name: account.address } })),
+ (0, import_react25.createElement)("span", { className: "bt-connector-mark" }, (0, import_react25.createElement)(ConnectorMark, { connector: { id: markId, name: account.address } })),
(0, import_react25.createElement)(
"span",
{ className: "bt-connector-text" },
@@ -10961,169 +11084,142 @@ function MailPending({ pending }) {
(0, import_react25.createElement)(
"span",
{ className: "bt-connector-text" },
- (0, import_react25.createElement)("span", { className: "bt-connector-name" }, pending.address ?? "Google"),
- (0, import_react25.createElement)("span", { className: "bt-connector-status" }, t("Waiting for sign-in…"))
+ (0, import_react25.createElement)("span", { className: "bt-connector-name" }, pending.address ?? "Gmail"),
+ (0, import_react25.createElement)("span", { className: "bt-connector-status" }, t("Finish signing in in your browser."))
),
(0, import_react25.createElement)(
"span",
{ className: "bt-connector-actions" },
- (0, import_react25.createElement)("a", { className: "bt-soft bt-soft-sm bt-mail-open", href: pending.url, target: "_blank", rel: "noopener noreferrer" }, t("Open the sign-in page"))
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-connector-link", onClick: () => openPage(pending.url) }, t("Open again"))
)
)
);
}
-function MailForm({ mail, actions, mailRun, busy, error, fields, setField, onClose }) {
- const { address, password, provider, imapHost, smtpHost } = fields;
- const setAddress = (value) => setField("address", value);
- const setPassword = (value) => setField("password", value);
- const setProvider = (value) => setField("provider", value);
- const setImapHost = (value) => setField("imapHost", value);
- const setSmtpHost = (value) => setField("smtpHost", value);
+function MailRules({ mail, bots, actions, run: run2 }) {
+ const allowed2 = mail?.allowedRecipients ?? [];
+ const direct = mail?.noDraftFor ?? [];
+ if (allowed2.length === 0 && direct.length === 0) return null;
+ const rule = (key, name, kind, onRemove) => (0, import_react25.createElement)(
+ "div",
+ { key, className: "bt-mail-rule" },
+ (0, import_react25.createElement)(
+ "span",
+ { className: "bt-connector-text" },
+ (0, import_react25.createElement)("span", { className: "bt-mail-rule-name" }, name),
+ (0, import_react25.createElement)("span", { className: "bt-connector-status" }, kind)
+ ),
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onRemove }, t("Remove"))
+ );
+ return (0, import_react25.createElement)(
+ "div",
+ { className: "bt-connector bt-mail-rules", "data-state": "ready" },
+ (0, import_react25.createElement)("div", { className: "bt-mail-rules-title" }, t("Sending rules")),
+ allowed2.map((addr) => rule(`r:${addr}`, addr, t("Allow recipient"), () => void run2(actions.mailRuleSet({ removeRecipient: addr })))),
+ direct.map((botId) => rule(`b:${botId}`, (bots ?? []).find((b) => b.id === botId)?.name ?? botId, t("Allow this Bot to send directly"), () => void run2(actions.mailRuleSet({ botId, noDraft: false }))))
+ );
+}
+var PROVIDERS = [["qq", "QQ"], ["163", "163"], ["126", "126"], ["gmail", "Gmail"], ["icloud", "iCloud"], ["other", "Other"]];
+var guessProvider = (address) => {
const domain = address.split("@")[1]?.toLowerCase() ?? "";
- const guessed = ["qq.com", "foxmail.com"].includes(domain) ? "qq" : ["163.com", "126.com", "gmail.com", "googlemail.com"].includes(domain) ? domain.replace(/\..*/, "").replace("googlemail", "gmail") : ["icloud.com", "me.com", "mac.com"].includes(domain) ? "icloud" : "";
- const chosen = provider || guessed || "other";
+ if (["qq.com", "foxmail.com"].includes(domain)) return "qq";
+ if (["163.com", "126.com"].includes(domain)) return domain.slice(0, 3);
+ if (["gmail.com", "googlemail.com"].includes(domain)) return "gmail";
+ if (["icloud.com", "me.com", "mac.com"].includes(domain)) return "icloud";
+ return "";
+};
+function MailForm({ mail, actions, onClose }) {
+ const [fields, setFields] = (0, import_react25.useState)({ address: "", password: "", provider: "", imapHost: "", smtpHost: "" });
+ const [busy, setBusy] = (0, import_react25.useState)(false);
+ const [error, setError] = (0, import_react25.useState)(null);
+ const busyRef = (0, import_react25.useRef)(false);
+ const set = (key, value) => setFields((current) => ({ ...current, [key]: value }));
+ const chosen = fields.provider || guessProvider(fields.address) || "qq";
const guide = MAIL_GUIDES[chosen];
- const add = () => void mailRun(() => actions.mailAccountAdd({ address: address.trim(), password, provider: chosen, imapHost: imapHost.trim(), smtpHost: smtpHost.trim() }), onClose);
+ const google = chosen === "gmail" && mail?.google === true;
+ const go = (task, done) => {
+ if (busyRef.current) return;
+ busyRef.current = true;
+ setBusy(true);
+ setError(null);
+ void Promise.resolve().then(task).then(done, (failure) => {
+ setError(failure?.message ?? String(failure));
+ }).finally(() => {
+ busyRef.current = false;
+ setBusy(false);
+ });
+ };
+ const add = () => go(() => actions.mailAccountAdd({ address: fields.address.trim(), password: fields.password, provider: chosen, imapHost: fields.imapHost.trim(), smtpHost: fields.smtpHost.trim() }), onClose);
+ const signInWithGoogle = () => {
+ const win = reserveWindow();
+ go(() => actions.mailAccountAdd({ address: fields.address.trim(), google: true }).catch((failure) => {
+ win.close();
+ throw failure;
+ }), (view) => {
+ const url = view?.mail?.pending?.at(-1)?.url ?? view?.pending?.at(-1)?.url;
+ if (url) win.go(url);
+ else win.close();
+ onClose();
+ });
+ };
+ const input = (key, label, extra = {}) => (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": label, placeholder: label, value: fields[key], autoComplete: "off", spellCheck: false, disabled: busy, onChange: (e) => set(key, e.target.value), ...extra });
return (0, import_react25.createElement)(
"div",
- { className: "bt-set-row bt-set-paste bt-mail-form" },
+ { className: "bt-connector-form bt-mail-form" },
(0, import_react25.createElement)(
- "div",
- { className: "bt-mail-providers", role: "radiogroup", "aria-label": t("Provider") },
- [["qq", "QQ"], ["163", "163"], ["126", "126"], ["gmail", "Gmail"], ["icloud", "iCloud"], ["other", t("Other")]].map(([id, label]) => (0, import_react25.createElement)("button", { key: id, type: "button", role: "radio", "aria-checked": chosen === id, className: "bt-secret-seg", disabled: busy, onClick: () => setProvider(id) }, label))
+ Segmented,
+ { label: t("Provider"), value: chosen, className: "bt-mail-seg" },
+ PROVIDERS.map(([id, label]) => (0, import_react25.createElement)("button", { key: id, type: "button", "aria-pressed": chosen === id, disabled: busy, onClick: () => set("provider", id) }, id === "other" ? t(label) : label))
),
- guide ? [
- (0, import_react25.createElement)("ol", { key: "guide", className: "bt-mail-guide" }, guide.steps.map((step) => (0, import_react25.createElement)("li", { key: step }, t(step, { host: guide.host })))),
+ guide ? (0, import_react25.createElement)(
+ "div",
+ { className: "bt-mail-guide" },
+ (0, import_react25.createElement)("ol", null, guide.steps.map((step) => (0, import_react25.createElement)("li", { key: step }, t(step, { host: guide.host })))),
(0, import_react25.createElement)(
"div",
- { key: "links", className: "bt-connector-form-row bt-mail-links" },
- (0, import_react25.createElement)("a", { className: "bt-connector-link", href: guide.open, target: "_blank", rel: "noopener noreferrer" }, t("Open {host}", { host: guide.host })),
- (0, import_react25.createElement)("a", { className: "bt-connector-link", href: guide.help, target: "_blank", rel: "noopener noreferrer" }, t("Official help"))
+ { className: "bt-mail-links" },
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-connector-link", onClick: () => openPage(guide.open) }, t("Open {host}", { host: guide.host })),
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-connector-link", onClick: () => openPage(guide.help) }, t("Official help"))
)
- ] : null,
- (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": t("Email address"), placeholder: t("Email address"), value: address, autoComplete: "off", disabled: busy, onChange: (e) => setAddress(e.target.value) }),
- (0, import_react25.createElement)("label", { className: "bt-q-field bt-secret-field" }, (0, import_react25.createElement)(MaskedInput, { value: password, onChange: setPassword, label: t(guide?.label ?? "Password or app password"), disabled: busy })),
- chosen === "other" ? [
- (0, import_react25.createElement)("input", { key: "ih", className: "bt-input", "aria-label": t("IMAP host"), placeholder: t("IMAP host"), value: imapHost, disabled: busy, onChange: (e) => setImapHost(e.target.value) }),
- (0, import_react25.createElement)("input", { key: "sh", className: "bt-input", "aria-label": t("SMTP host"), placeholder: t("SMTP host"), value: smtpHost, disabled: busy, onChange: (e) => setSmtpHost(e.target.value) })
- ] : null,
- error ? (0, import_react25.createElement)("div", { className: "bt-connector-error", role: "alert" }, hostText(error)) : null,
+ ) : null,
+ input("address", t("Email address"), { type: "email" }),
+ (0, import_react25.createElement)("label", { className: "bt-q-field bt-secret-field" }, (0, import_react25.createElement)(MaskedInput, { value: fields.password, onChange: (value) => set("password", value), onEnter: add, label: t(guide?.label ?? "Password or app password"), disabled: busy })),
+ chosen === "other" ? (0, import_react25.createElement)("div", { className: "bt-provider-pair" }, input("imapHost", t("IMAP host")), input("smtpHost", t("SMTP host"))) : null,
+ error ? (0, import_react25.createElement)("div", { className: "bt-mail-error", role: "alert" }, hostText(error)) : null,
(0, import_react25.createElement)(
"div",
{ className: "bt-secret-row-actions" },
- mail?.google ? (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void mailRun(() => actions.mailAccountAdd({ address: address.trim(), google: true }), onClose) }, t("Sign in with Google")) : (0, import_react25.createElement)("span", { className: "bt-connector-link" }),
+ google ? (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: signInWithGoogle }, t("Sign in with Google")) : null,
+ (0, import_react25.createElement)("span", { className: "bt-set-hint" }),
(0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: onClose }, t("Cancel")),
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy || !address.includes("@") || password === "", onClick: add }, busy ? t("Verifying…") : t("Add account"))
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy || !fields.address.includes("@") || fields.password === "" || chosen === "other" && (fields.imapHost.trim() === "" || fields.smtpHost.trim() === ""), onClick: add }, busy ? t("Verifying…") : t("Add"))
)
);
}
-var EMPTY_MAIL = { address: "", password: "", provider: "", imapHost: "", smtpHost: "" };
-function MailRules({ mail, bots, actions, run: run2 }) {
- const [recipient, setRecipient] = (0, import_react25.useState)("");
- const allowed2 = mail?.allowedRecipients ?? [];
- const noDraft = mail?.noDraftFor ?? [];
- const add = () => {
- const addr = recipient.trim();
- if (!addr.includes("@")) return;
- void run2(actions.mailRuleSet({ addRecipient: addr }), () => setRecipient(""));
- };
+function MailCatalogRow({ mail, actions }) {
+ const [open, setOpen] = (0, import_react25.useState)(false);
+ const row = (0, import_react25.useRef)(null);
+ useMorph(row, String(open));
return (0, import_react25.createElement)(
"div",
- { className: "bt-set-row bt-set-paste bt-mail-rules" },
- (0, import_react25.createElement)("div", { className: "bt-connector-name" }, t("Sending rules")),
- allowed2.map((addr) => (0, import_react25.createElement)(
+ { ref: row, className: "bt-connector", "data-state": "off" },
+ (0, import_react25.createElement)(
"div",
- { key: `r:${addr}`, className: "bt-connector-head" },
+ { className: "bt-connector-head" },
+ (0, import_react25.createElement)("span", { className: "bt-connector-mark" }, (0, import_react25.createElement)(ConnectorMark, { connector: { id: "mail", name: t("Mailbox") } })),
(0, import_react25.createElement)(
"span",
{ className: "bt-connector-text" },
- (0, import_react25.createElement)("span", { className: "bt-connector-name" }, addr),
- (0, import_react25.createElement)("span", { className: "bt-connector-status" }, t("Allow recipient"))
+ (0, import_react25.createElement)("span", { className: "bt-connector-name" }, t("Mailbox")),
+ (0, import_react25.createElement)("span", { className: "bt-connector-status" }, t("QQ, 163, 126, Gmail, iCloud, and other IMAP mail"))
),
- (0, import_react25.createElement)(
+ open ? null : (0, import_react25.createElement)(
"span",
{ className: "bt-connector-actions" },
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void run2(actions.mailRuleSet({ removeRecipient: addr })) }, t("Remove"))
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setOpen(true) }, (mail?.accounts?.length ?? 0) > 0 ? t("Add another") : t("Connect"))
)
- )),
- noDraft.map((botId) => {
- const botName = (bots ?? []).find((b) => b.id === botId)?.name ?? botId;
- return (0, import_react25.createElement)(
- "div",
- { key: `b:${botId}`, className: "bt-connector-head" },
- (0, import_react25.createElement)(
- "span",
- { className: "bt-connector-text" },
- (0, import_react25.createElement)("span", { className: "bt-connector-name" }, botName),
- (0, import_react25.createElement)("span", { className: "bt-connector-status" }, t("Allow this Bot to send directly"))
- ),
- (0, import_react25.createElement)(
- "span",
- { className: "bt-connector-actions" },
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void run2(actions.mailRuleSet({ botId, noDraft: false })) }, t("Needs approval"))
- )
- );
- }),
- (0, import_react25.createElement)(
- "div",
- { className: "bt-connector-form-row" },
- (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": t("Allow recipient"), placeholder: "[email protected]", value: recipient, autoComplete: "off", onChange: (e) => setRecipient(e.target.value) }),
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: !recipient.includes("@"), onClick: add }, t("Add"))
- )
- );
-}
-function MailSection({ mail, bots, actions, run: run2 }) {
- const [form, setForm] = (0, import_react25.useState)(false);
- const [rulesOpen, setRulesOpen] = (0, import_react25.useState)(false);
- const [busy, setBusy] = (0, import_react25.useState)(false);
- const [error, setError] = (0, import_react25.useState)(null);
- const [fields, setFields] = (0, import_react25.useState)(EMPTY_MAIL);
- const busyRef = (0, import_react25.useRef)(false);
- const accounts = mail?.accounts ?? [];
- const hasRules = (mail?.allowedRecipients?.length ?? 0) > 0 || (mail?.noDraftFor?.length ?? 0) > 0;
- const setField = (key, value) => setFields((current) => ({ ...current, [key]: value }));
- const close = () => {
- setError(null);
- setForm(false);
- setFields(EMPTY_MAIL);
- };
- const mailRun = (task, onDone) => {
- if (busyRef.current || busy) return false;
- busyRef.current = true;
- setBusy(true);
- setError(null);
- void Promise.resolve().then(task).then(() => {
- onDone?.();
- }, (failure) => {
- setError(failure?.message ?? String(failure));
- }).finally(() => {
- busyRef.current = false;
- setBusy(false);
- });
- return true;
- };
- return [
- (0, import_react25.createElement)("div", { key: "title", className: "bt-section-title" }, t("Mailbox")),
- (0, import_react25.createElement)(
- "div",
- { key: "card", className: "bt-set-card bt-connectors-card" },
- accounts.length === 0 && !form ? (0, import_react25.createElement)("div", { className: "bt-set-row" }, (0, import_react25.createElement)("span", { className: "bt-set-hint" }, t("No mail accounts yet"))) : null,
- accounts.map((account) => (0, import_react25.createElement)(MailAccount, { key: account.id, account, actions, run: run2 })),
- (mail?.pending ?? []).map((p) => (0, import_react25.createElement)(MailPending, { key: p.address ?? "google", pending: p })),
- form ? (0, import_react25.createElement)(MailForm, { mail, actions, mailRun, busy, error, fields, setField, onClose: close }) : null,
- hasRules || rulesOpen ? (0, import_react25.createElement)(MailRules, { mail, bots, actions, run: run2 }) : null
),
- form ? null : (0, import_react25.createElement)(
- "div",
- { key: "add", className: "bt-actions" },
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => {
- setError(null);
- setForm(true);
- } }, t("Add an account")),
- mail?.google ? (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.mailAccountAdd({ google: true })) }, t("Sign in with Google")) : null,
- !hasRules && accounts.length > 0 ? (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setRulesOpen((v) => !v) }, t("Manage rules")) : null
- )
- ];
+ open ? (0, import_react25.createElement)(MailForm, { mail, actions, onClose: () => setOpen(false) }) : null
+ );
}
function AddMenu({ actions, run: run2 }) {
const [kind, setKind] = (0, import_react25.useState)(null);
@@ -11132,6 +11228,8 @@ function AddMenu({ actions, run: run2 }) {
const [command, setCommand] = (0, import_react25.useState)("");
const [found, setFound] = (0, import_react25.useState)(null);
const [picked, setPicked] = (0, import_react25.useState)([]);
+ const row = (0, import_react25.useRef)(null);
+ useMorph(row, `${kind}:${found === null}`);
const reset = () => {
setKind(null);
setName("");
@@ -11140,93 +11238,55 @@ function AddMenu({ actions, run: run2 }) {
setFound(null);
setPicked([]);
};
- if (kind === "import" && found === null) {
- void Promise.resolve(actions.connectorImportScan()).then((list) => setFound(Array.isArray(list) ? list : list?.items ?? []), () => setFound([]));
- }
+ const choose = (next) => {
+ setKind(next);
+ if (next === "import" && found === null) void Promise.resolve(actions.connectorImportScan()).then((list) => setFound(Array.isArray(list) ? list : list?.items ?? []), () => setFound([]));
+ };
+ const key = (item) => `${item.source}:${item.name}`;
+ const ready = name.trim() !== "" && (kind === "url" ? url.trim() !== "" : command.trim() !== "");
return (0, import_react25.createElement)(
"div",
- { className: "bt-connector-add" },
- kind === null ? (0, import_react25.createElement)(
+ { ref: row, className: "bt-connector", "data-state": "off" },
+ (0, import_react25.createElement)(
"div",
- { className: "bt-connector-form-row" },
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setKind("url") }, t("Add an address")),
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setKind("command") }, t("Add a command")),
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setKind("import") }, t("Import from other apps"))
- ) : null,
- kind === "url" || kind === "command" ? (0, import_react25.createElement)(
+ { className: "bt-connector-head" },
+ (0, import_react25.createElement)("span", { className: "bt-connector-mark" }, (0, import_react25.createElement)(ConnectorMark, { connector: { id: "custom", name: "+" } })),
+ (0, import_react25.createElement)(
+ "span",
+ { className: "bt-connector-text" },
+ (0, import_react25.createElement)("span", { className: "bt-connector-name" }, t("Other MCP server")),
+ (0, import_react25.createElement)("span", { className: "bt-connector-status" }, t("An address, a command, or one from Claude Desktop, Cursor, or VS Code"))
+ ),
+ kind === null ? (0, import_react25.createElement)("span", { className: "bt-connector-actions" }, (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => choose("url") }, t("Add"))) : null
+ ),
+ kind === null ? null : (0, import_react25.createElement)(
"div",
{ className: "bt-connector-form" },
- (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": t("Name"), placeholder: t("Name"), value: name, onChange: (e) => setName(e.target.value) }),
- kind === "url" ? (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": t("Server address"), placeholder: "https://…", value: url, onChange: (e) => setUrl(e.target.value) }) : (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": t("Command"), placeholder: t("Command, e.g. npx -y some-mcp"), value: command, onChange: (e) => setCommand(e.target.value) }),
(0, import_react25.createElement)(
+ Segmented,
+ { label: t("Kind of server"), value: kind },
+ [["url", t("Address")], ["command", t("Command")], ["import", t("Import from other apps")]].map(([id, label]) => (0, import_react25.createElement)("button", { key: id, type: "button", "aria-pressed": kind === id, onClick: () => choose(id) }, label))
+ ),
+ kind === "import" ? found === null ? (0, import_react25.createElement)("span", { className: "bt-set-hint" }, t("Scanning…")) : found.length === 0 ? (0, import_react25.createElement)("span", { className: "bt-set-hint" }, t("No MCP servers found in Claude Desktop, Cursor, or VS Code settings.")) : (0, import_react25.createElement)("div", { className: "bt-mail-rules" }, found.map((item) => (0, import_react25.createElement)(
"div",
- { className: "bt-connector-form-row" },
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: reset }, t("Cancel")),
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: name.trim() === "" || (kind === "url" ? url.trim() === "" : command.trim() === ""), onClick: () => void run2(kind === "url" ? actions.connectorAdd({ name: name.trim(), url: url.trim() }) : actions.connectorAdd({ name: name.trim(), command: command.trim() }), reset) }, t("Add"))
- )
- ) : null,
- kind === "import" ? (0, import_react25.createElement)(
- "div",
- { className: "bt-connector-form" },
- found === null ? (0, import_react25.createElement)("span", { className: "bt-set-hint" }, t("Scanning…")) : found.length === 0 ? (0, import_react25.createElement)("span", { className: "bt-set-hint" }, t("No MCP servers found in Claude Desktop, Cursor, or VS Code settings.")) : [
- found.map((item) => (0, import_react25.createElement)(
- "label",
- { key: `${item.source}:${item.name}`, className: "bt-connector-import" },
- (0, import_react25.createElement)("input", { type: "checkbox", checked: picked.some((p) => p.source === item.source && p.name === item.name), onChange: (e) => setPicked((list) => e.target.checked ? [...list, { source: item.source, name: item.name }] : list.filter((p) => !(p.source === item.source && p.name === item.name))) }),
- (0, import_react25.createElement)("span", null, item.name),
- (0, import_react25.createElement)("span", { className: "bt-set-hint" }, `${item.source} · ${item.url ?? item.command}${item.envNames?.length ? ` · ${item.envNames.length} env` : ""}`)
- )),
+ { key: key(item), className: "bt-mail-rule" },
(0, import_react25.createElement)(
- "div",
- { key: "go", className: "bt-connector-form-row" },
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: reset }, t("Cancel")),
- (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: picked.length === 0, onClick: () => void run2(actions.connectorImport(picked), reset) }, t("Import {count}", { count: picked.length }))
- )
- ]
- ) : null
- );
-}
-function ConnectorsPage({ roster, actions }) {
- const [query, setQuery] = (0, import_react25.useState)("");
- const [category, setCategory] = (0, import_react25.useState)("");
- const [error, setError] = (0, import_react25.useState)(null);
- const run2 = (task, onDone) => Promise.resolve(task).then(() => {
- setError(null);
- onDone?.();
- }, (failure) => setError(failure?.message ?? String(failure)));
- const data = roster?.connectors ?? { connectors: [], mail: { accounts: [], google: false } };
- const list = data.connectors ?? [];
- const connected = list.filter((c) => c.state !== "off" || c.pending);
- const catalog = list.filter((c) => c.state === "off" && !c.pending).filter((c) => category === "" || c.category === category).filter((c) => query === "" || `${c.name} ${c.about}`.toLowerCase().includes(query.toLowerCase()));
- return (0, import_react25.createElement)(
- "section",
- { className: "bt-set-section" },
- error ? (0, import_react25.createElement)("div", { className: "bt-connector-error", role: "alert" }, error) : null,
- (0, import_react25.createElement)("div", { className: "bt-section-title" }, t("Connected")),
- (0, import_react25.createElement)(
- "div",
- { className: "bt-set-card bt-connectors-card" },
- connected.length === 0 ? (0, import_react25.createElement)("div", { className: "bt-set-row" }, (0, import_react25.createElement)("span", { className: "bt-set-hint" }, t("No connectors connected"))) : null,
- connected.map((connector) => (0, import_react25.createElement)(ConnectorRow, { key: connector.id, connector, actions }))
- ),
- (0, import_react25.createElement)(MailSection, { mail: data.mail, bots: roster?.bots, actions, run: run2 }),
- (0, import_react25.createElement)("div", { className: "bt-section-title" }, t("Catalog")),
- (0, import_react25.createElement)(
- "div",
- { className: "bt-set-card bt-connectors-card" },
+ "span",
+ { className: "bt-connector-text" },
+ (0, import_react25.createElement)("span", { className: "bt-mail-rule-name" }, item.name),
+ (0, import_react25.createElement)("span", { className: "bt-connector-status" }, `${item.source} · ${item.url ?? item.command}`)
+ ),
+ (0, import_react25.createElement)(Switch, { label: item.name, on: picked.some((p) => key(p) === key(item)), onChange: (on) => setPicked((list) => on ? [...list, { source: item.source, name: item.name }] : list.filter((p) => key(p) !== key(item))) })
+ ))) : [
+ (0, import_react25.createElement)("input", { key: "name", className: "bt-input", "aria-label": t("Name"), placeholder: t("Name"), value: name, onChange: (e) => setName(e.target.value) }),
+ kind === "url" ? (0, import_react25.createElement)("input", { key: "url", className: "bt-input", "aria-label": t("Server address"), placeholder: "https://…", value: url, spellCheck: false, onChange: (e) => setUrl(e.target.value) }) : (0, import_react25.createElement)("input", { key: "cmd", className: "bt-input", "aria-label": t("Command"), placeholder: t("Command, e.g. npx -y some-mcp"), value: command, spellCheck: false, onChange: (e) => setCommand(e.target.value) })
+ ],
(0, import_react25.createElement)(
"div",
- { className: "bt-connector-search" },
- (0, import_react25.createElement)("input", { className: "bt-input", "aria-label": t("Search connectors"), placeholder: t("Search"), value: query, onChange: (e) => setQuery(e.target.value) }),
- (0, import_react25.createElement)(
- "div",
- { className: "bt-connector-chips" },
- (0, import_react25.createElement)("button", { type: "button", className: "bt-secret-seg", "aria-pressed": category === "", onClick: () => setCategory("") }, t("All")),
- CATEGORIES.map((id) => (0, import_react25.createElement)("button", { key: id, type: "button", className: "bt-secret-seg", "aria-pressed": category === id, onClick: () => setCategory(category === id ? "" : id) }, t(CATEGORY_LABEL[id])))
- )
- ),
- catalog.map((connector) => (0, import_react25.createElement)(ConnectorRow, { key: connector.id, connector, actions })),
- (0, import_react25.createElement)(AddMenu, { actions, run: run2 })
+ { className: "bt-secret-row-actions" },
+ (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: reset }, t("Cancel")),
+ kind === "import" ? (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: picked.length === 0, onClick: () => void run2(actions.connectorImport(picked), reset) }, t("Import {count}", { count: picked.length })) : (0, import_react25.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: !ready, onClick: () => void run2(kind === "url" ? actions.connectorAdd({ name: name.trim(), url: url.trim() }) : actions.connectorAdd({ name: name.trim(), command: command.trim() }), reset) }, t("Add"))
+ )
)
);
}
@@ -11501,16 +11561,10 @@ var CONNECTOR_CSS = `
.bt-connector-chips{display:flex;flex-wrap:wrap;gap:6px}
.bt-connector-chips .bt-secret-seg{height:26px;padding:0 10px;border:.5px solid var(--bt-line)}
.bt-connector-chips .bt-secret-seg[aria-pressed=true]{background:var(--bt-active)}
-.bt-connector-add{padding:0 12px 12px}
.bt-connector-ro{padding-left:48px}
.bt-connector-device{display:flex;align-items:center;gap:10px}
.bt-connector-code{font-family:ui-monospace,Menlo,monospace;font-size:16px;letter-spacing:.12em;padding:4px 10px;border-radius:8px;background:var(--bt-hover)}
-.bt-connector-import{display:flex;align-items:center;gap:8px;font-size:13px;padding:4px 0;cursor:pointer}
-.bt-mail-providers{display:flex;gap:4px;flex-wrap:wrap}
-.bt-mail-providers .bt-secret-seg{height:26px;padding:0 10px;border:.5px solid var(--bt-line)}
-.bt-mail-providers .bt-secret-seg[aria-checked=true]{background:var(--bt-active)}
.bt-connector-bot .bt-set-copy{min-width:0}
-.bt-mail-open{text-decoration:none}
.bt-mail-rule-wrap{position:relative;display:inline-flex;align-items:center}
.bt-mail-rule-btn{display:inline-flex;align-items:center;gap:4px;height:30px;padding:0 8px;border:0;border-radius:8px;background:none;color:var(--bt-ink-2);font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background-color .12s ease,color .12s ease}
.bt-mail-rule-btn:hover:not(:disabled){background:var(--bt-hover);color:var(--bt-ink)}
@@ -11519,7 +11573,6 @@ var CONNECTOR_CSS = `
.dv-menu.bt-mail-rule-menu{position:absolute;left:0;bottom:calc(100% + 6px);z-index:20;min-width:190px;--dv-origin:bottom left}
.dv-menu.bt-mail-rule-menu button{justify-content:space-between;gap:12px}
.bt-mail-rule-item-text{flex:1 1 auto;min-width:0}
-.bt-mail-rules{display:flex;flex-direction:column;gap:8px}
.dv-widget-stack:has(>.dv-widget-form){gap:8px}
.dv-widget-stack>.dv-widget-form{display:contents}
.dv-widget-stack>.dv-widget-form>.dv-q-foot{order:2;padding-top:4px}
@@ -15677,7 +15730,7 @@ function whenRosterReady(roster, signal) {
finish();
});
}
-async function matchSideEnter(roster, sessionId, line, envelope, signal) {
+async function matchSideEnter(roster, sessionId, line, envelope2, signal) {
const parsed = parseSideLine(line);
if (!parsed) return void 0;
const snap = readRoster(roster)?.ready ? readRoster(roster) : await whenRosterReady(roster, signal);
@@ -15685,7 +15738,7 @@ async function matchSideEnter(roster, sessionId, line, envelope, signal) {
if (surface === "other") return void 0;
if (surface === "group") throw new Error(t(GROUP_REFUSAL));
if (surface !== "bot") throw new Error(t(LOADING_REFUSAL));
- if ((envelope?.attachments ?? 0) > 0) throw new Error(t(ATTACHMENT_REFUSAL));
+ if ((envelope2?.attachments ?? 0) > 0) throw new Error(t(ATTACHMENT_REFUSAL));
if (parsed.bare) throw new Error(t(EMPTY_REFUSAL));
return { claim: true };
}
@@ -15859,8 +15912,8 @@ function sideSource({ roster, actions }) {
const outcome = matchSideSpace(roster.getSnapshot(), session.sessionId, token);
return outcome === void 0 ? void 0 : { claim: claimFor(session.sessionId) };
},
- matchEnter(session, line, signal, envelope) {
- return matchSideEnter(roster, session.sessionId, line, envelope, signal).then((outcome) => {
+ matchEnter(session, line, signal, envelope2) {
+ return matchSideEnter(roster, session.sessionId, line, envelope2, signal).then((outcome) => {
if (outcome === void 0) return void 0;
return { claim: claimFor(session.sessionId) };
});
@@ -16801,7 +16854,7 @@ function NewChat({ mode, roster, actions }) {
useEscape(close);
const paneLeft = usePaneLeft();
const wanted = query.trim().toLowerCase();
- const matches = roster.bots.filter((bot) => !picked.includes(bot.id) && bot.id !== admin && (wanted === "" || bot.name.toLowerCase().includes(wanted) || (bot.role ?? "").toLowerCase().includes(wanted)));
+ const matches2 = roster.bots.filter((bot) => !picked.includes(bot.id) && bot.id !== admin && (wanted === "" || bot.name.toLowerCase().includes(wanted) || (bot.role ?? "").toLowerCase().includes(wanted)));
const choosingAdmin = group && admin === null;
const exact = roster.bots.some((bot) => bot.name.toLowerCase() === wanted);
const pickedBots = picked.map((id) => roster.byId[id]).filter(Boolean);
@@ -16895,7 +16948,7 @@ function NewChat({ mode, roster, actions }) {
}) });
}
}
- for (const bot of matches) {
+ for (const bot of matches2) {
options.push({ key: bot.id, bot, label: bot.name, hint: choosingAdmin ? t("Make admin") : group || picked.length > 0 ? t("Add to group chat") : void 0, run: () => openBot(bot) });
}
if (wanted !== "" && !exact && mode !== "search") options.push({ key: "create", icon: (0, import_react38.createElement)(PlusIcon), label: t("Create new Bot “{name}”", { name: query.trim() }), run: createBot });
@@ -17792,7 +17845,7 @@ var GROUP_SETTINGS_CSS = `
// src/client/kept-private.js
var import_react43 = require("react");
-function KeptPrivateSection({ roster, actions, run: run2, Section, Row: Row3 }) {
+function KeptPrivateSection({ roster, actions, run: run2, Section: Section2, Row: Row3 }) {
const kept = roster.privateArchives ?? [];
const [confirming, setConfirming] = (0, import_react43.useState)(null);
(0, import_react43.useEffect)(() => {
@@ -17810,7 +17863,7 @@ function KeptPrivateSection({ roster, actions, run: run2, Section, Row: Row3 })
void run2(actions.releasePrivate(entry.id));
};
return (0, import_react43.createElement)(
- Section,
+ Section2,
{ title: t("Closed after deletion · {count}", { count: kept.length }) },
kept.map((entry) => (0, import_react43.createElement)(Row3, {
key: entry.id,
@@ -18828,58 +18881,352 @@ button.bt-us-row:hover{background:var(--bt-hover)}
}
`;
-// node_modules/qrcode-generator/dist/qrcode.mjs
-var qrcode = function(typeNumber, errorCorrectionLevel) {
- const PAD0 = 236;
- const PAD1 = 17;
- let _typeNumber = typeNumber;
- const _errorCorrectionLevel = QRErrorCorrectionLevel[errorCorrectionLevel];
- let _modules = null;
- let _moduleCount = 0;
- let _dataCache = null;
- const _dataList = [];
- const _this = {};
- const makeImpl = function(test, maskPattern) {
- _moduleCount = _typeNumber * 4 + 17;
- _modules = (function(moduleCount) {
- const modules = new Array(moduleCount);
- for (let row = 0; row < moduleCount; row += 1) {
- modules[row] = new Array(moduleCount);
- for (let col = 0; col < moduleCount; col += 1) {
- modules[row][col] = null;
- }
- }
- return modules;
- })(_moduleCount);
- setupPositionProbePattern(0, 0);
- setupPositionProbePattern(_moduleCount - 7, 0);
- setupPositionProbePattern(0, _moduleCount - 7);
- setupPositionAdjustPattern();
- setupTimingPattern();
- setupTypeInfo(test, maskPattern);
- if (_typeNumber >= 7) {
- setupTypeNumber(test);
- }
- if (_dataCache == null) {
- _dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList);
- }
- mapData(_dataCache, maskPattern);
+// src/client/connectors-page.js
+var import_react45 = require("react");
+var CATEGORIES = [["dev", "Developer"], ["docs", "Docs & files"], ["work", "Work"], ["design", "Design"], ["data", "Data"], ["commerce", "Commerce"], ["search", "Search"]];
+var FEATURED = ["github", "mail", "notion", "linear", "figma", "slack"];
+var PREVIEW = 6;
+var matches = (query, ...texts2) => query === "" || texts2.join(" ").toLowerCase().includes(query.toLowerCase());
+function useJustConnected(state) {
+ const last = (0, import_react45.useRef)(state);
+ const [fresh, setFresh] = (0, import_react45.useState)(false);
+ (0, import_react45.useEffect)(() => {
+ const was = last.current;
+ last.current = state;
+ if (state !== "ready" || was === "ready") return void 0;
+ setFresh(true);
+ const timer = setTimeout(() => setFresh(false), 1100);
+ return () => clearTimeout(timer);
+ }, [state]);
+ return fresh;
+}
+function AppIcon({ app, size = 36 }) {
+ return (0, import_react45.createElement)("span", { className: "bt-app-icon", style: { width: size, height: size } }, (0, import_react45.createElement)(ConnectorMark, { connector: app }));
+}
+function tileStatus(app) {
+ if (app.state === "ready") return app.account ?? null;
+ if (app.state === "connecting") return app.pending ? t("Waiting for sign-in…") : t("Connecting…");
+ if (app.state === "needs-sign-in") return t("Sign in again");
+ if (app.state === "needs-client") return t("This service needs an app client ID");
+ if (app.state === "error") return t("Could not connect: {error}", { error: hostText(app.error ?? "") });
+ return null;
+}
+function AppTile({ app, actions, onOpen }) {
+ const [busy, setBusy] = (0, import_react45.useState)(false);
+ const [error, setError] = (0, import_react45.useState)(null);
+ const fresh = useJustConnected(app.state);
+ const run2 = (task, after, failed) => {
+ setBusy(true);
+ setError(null);
+ return Promise.resolve(task).then((value) => after?.(value), (failure) => {
+ failed?.();
+ setError(failure?.message ?? String(failure));
+ }).finally(() => setBusy(false));
};
- const setupPositionProbePattern = function(row, col) {
- for (let r = -1; r <= 7; r += 1) {
- if (row + r <= -1 || _moduleCount <= row + r) continue;
- for (let c = -1; c <= 7; c += 1) {
- if (col + c <= -1 || _moduleCount <= col + c) continue;
- if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
- _modules[row + r][col + c] = true;
- } else {
- _modules[row + r][col + c] = false;
- }
- }
- }
+ const connect = () => {
+ const auth = app.auth ?? {};
+ if (app.id === "mail" || auth.kind === "key" || auth.kind === "oauth" && auth.token && !auth.client?.id) return onOpen();
+ if (auth.kind === "oauth") {
+ const win = reserveWindow();
+ return void run2(actions.connectorConnect(app.id, {}), (view) => openSignIn(win, app.id, view), () => win.close());
+ }
+ return void run2(actions.connectorConnect(app.id, {}));
+ };
+ const ready = app.state === "ready";
+ const off = app.state === "off";
+ const status = error ? hostText(error) : tileStatus(app);
+ const label = busy ? t("Connecting…") : ready ? t("Connected") : off ? t("Connect") : app.state === "error" ? t("Try again") : app.state === "needs-sign-in" ? t("Sign in again") : t("Open");
+ const press = () => {
+ if (off) return connect();
+ if (app.state === "error") return void run2(actions.connectorRetry(app.id));
+ return onOpen();
};
- const getBestMaskPattern = function() {
- let minLostPoint = 0;
+ return (0, import_react45.createElement)(
+ "div",
+ { className: "bt-app", "data-state": app.state, "data-fresh": fresh ? "" : void 0, "data-error": error ? "" : void 0 },
+ (0, import_react45.createElement)(
+ "button",
+ { type: "button", className: "bt-app-main", onClick: onOpen },
+ (0, import_react45.createElement)(AppIcon, { app }),
+ (0, import_react45.createElement)(
+ "span",
+ { className: "bt-app-text" },
+ (0, import_react45.createElement)("span", { className: "bt-app-name" }, app.name, app.custom ? (0, import_react45.createElement)("span", { className: "bt-tag" }, t("Added")) : null),
+ status ? (0, import_react45.createElement)("span", { className: "bt-app-status" }, status) : null
+ )
+ ),
+ (0, import_react45.createElement)(
+ "button",
+ { type: "button", className: ready ? "bt-app-btn bt-app-btn-done" : "bt-app-btn", disabled: busy, onClick: press },
+ ready ? (0, import_react45.createElement)(CheckIcon) : null,
+ label
+ )
+ );
+}
+function Grid({ apps, actions, open }) {
+ return (0, import_react45.createElement)("div", { className: "bt-app-grid" }, apps.map((app) => (0, import_react45.createElement)(AppTile, { key: app.id, app, actions, onOpen: () => open(app.id) })));
+}
+function Section({ title, apps, actions, open, onAll }) {
+ if (apps.length === 0) return null;
+ return (0, import_react45.createElement)(
+ "section",
+ { className: "bt-app-section" },
+ (0, import_react45.createElement)(
+ "div",
+ { className: "bt-app-section-head" },
+ (0, import_react45.createElement)("h3", null, title),
+ onAll && apps.length > PREVIEW ? (0, import_react45.createElement)("button", { type: "button", className: "bt-app-all", onClick: onAll }, t("See all")) : null
+ ),
+ (0, import_react45.createElement)(Grid, { apps: onAll ? apps.slice(0, PREVIEW) : apps, actions, open })
+ );
+}
+function Subview({ title, onBack, children }) {
+ return (0, import_react45.createElement)(
+ "div",
+ { className: "bt-app-sub" },
+ (0, import_react45.createElement)(
+ "div",
+ { className: "bt-app-sub-head" },
+ (0, import_react45.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Back"), onClick: onBack }, (0, import_react45.createElement)(ChevronLeftIcon)),
+ (0, import_react45.createElement)("h3", null, title)
+ ),
+ children
+ );
+}
+function ConnectedSummary({ apps, count, onClick }) {
+ if (count === 0) return null;
+ return (0, import_react45.createElement)(
+ "button",
+ { type: "button", className: "bt-app-summary", onClick },
+ (0, import_react45.createElement)("span", { className: "bt-app-stack" }, apps.slice(0, 3).map((app) => (0, import_react45.createElement)(AppIcon, { key: app.id, app, size: 22 }))),
+ t("{count} connected", { count }),
+ (0, import_react45.createElement)(ChevronRightIcon)
+ );
+}
+function ConnectorsPage({ roster, actions }) {
+ const [query, setQuery] = (0, import_react45.useState)("");
+ const [category, setCategory] = (0, import_react45.useState)("");
+ const [view, setView] = (0, import_react45.useState)(null);
+ const [error, setError] = (0, import_react45.useState)(null);
+ const run2 = (task, onDone) => Promise.resolve(task).then((value) => {
+ setError(null);
+ onDone?.(value);
+ }, (failure) => setError(failure?.message ?? String(failure)));
+ const data = roster?.connectors ?? { connectors: [], mail: { accounts: [], google: false } };
+ const mail = data.mail ?? { accounts: [] };
+ const accounts = mail.accounts ?? [];
+ const mailbox = {
+ id: "mail",
+ name: t("Mailbox"),
+ category: "work",
+ about: t("QQ, 163, 126, Gmail, iCloud, and other IMAP mail"),
+ state: accounts.length > 0 ? "ready" : (mail.pending?.length ?? 0) > 0 ? "connecting" : "off",
+ account: accounts.length === 1 ? accounts[0].address : accounts.length > 1 ? t("{count} accounts", { count: accounts.length }) : null
+ };
+ const apps = [mailbox, ...(data.connectors ?? []).filter((c) => c.id !== "mail")];
+ const connected = apps.filter((app) => app.state !== "off" || app.pending);
+ const marks = [...accounts.map((account) => ({ id: `mail-${account.provider}`, name: account.address })), ...connected.filter((app) => app.id !== "mail")];
+ const count = accounts.length + connected.filter((app) => app.id !== "mail").length;
+ const open = (id) => setView({ app: id });
+ const back = () => setView(null);
+ const banner = error ? (0, import_react45.createElement)("div", { className: "bt-connector-error bt-connector-banner", role: "alert" }, hostText(error)) : null;
+ if (view?.app === "mail") {
+ return (0, import_react45.createElement)(
+ Subview,
+ { title: t("Mailbox"), onBack: back },
+ banner,
+ (0, import_react45.createElement)(
+ "div",
+ { className: "bt-set-card bt-connectors-card" },
+ accounts.map((account) => (0, import_react45.createElement)(MailAccount, { key: account.id, account, actions, run: run2 })),
+ (mail.pending ?? []).map((p) => (0, import_react45.createElement)(MailPending, { key: p.address ?? "google", pending: p })),
+ (0, import_react45.createElement)(MailCatalogRow, { mail, actions }),
+ (0, import_react45.createElement)(MailRules, { mail, bots: roster?.bots, actions, run: run2 })
+ )
+ );
+ }
+ const shown = view?.app ? apps.find((app) => app.id === view.app) : null;
+ if (shown) {
+ return (0, import_react45.createElement)(
+ Subview,
+ { title: shown.name, onBack: back },
+ (0, import_react45.createElement)("div", { className: "bt-set-card bt-connectors-card bt-app-detail" }, (0, import_react45.createElement)(ConnectorRow, { connector: shown, actions })),
+ shown.about ? (0, import_react45.createElement)("p", { className: "bt-app-about" }, t(shown.about)) : null
+ );
+ }
+ if (view === "connected") {
+ const rows2 = connected.filter((app) => app.id !== "mail");
+ return (0, import_react45.createElement)(
+ Subview,
+ { title: t("Connected"), onBack: back },
+ banner,
+ (0, import_react45.createElement)(
+ "div",
+ { className: "bt-set-card bt-connectors-card" },
+ count === 0 ? (0, import_react45.createElement)("div", { className: "bt-set-row" }, (0, import_react45.createElement)("span", { className: "bt-set-hint" }, t("No connectors connected"))) : null,
+ rows2.map((app) => (0, import_react45.createElement)(ConnectorRow, { key: app.id, connector: app, actions })),
+ accounts.map((account) => (0, import_react45.createElement)(MailAccount, { key: account.id, account, actions, run: run2 })),
+ (mail.pending ?? []).map((p) => (0, import_react45.createElement)(MailPending, { key: p.address ?? "google", pending: p })),
+ (0, import_react45.createElement)(MailRules, { mail, bots: roster?.bots, actions, run: run2 })
+ )
+ );
+ }
+ if (view === "custom") {
+ return (0, import_react45.createElement)(
+ Subview,
+ { title: t("Other MCP server"), onBack: back },
+ banner,
+ (0, import_react45.createElement)("div", { className: "bt-set-card bt-connectors-card" }, (0, import_react45.createElement)(AddMenu, { actions, run: run2 }))
+ );
+ }
+ const inCategory = (id) => apps.filter((app) => app.category === id);
+ const searching = query.trim() !== "";
+ const found = apps.filter((app) => (category === "" || app.category === category) && matches(query.trim(), app.name, app.about ?? ""));
+ let body;
+ if (searching || category !== "") {
+ body = found.length === 0 ? (0, import_react45.createElement)("p", { className: "bt-app-empty" }, t("Nothing matches")) : (0, import_react45.createElement)(Grid, { apps: found, actions, open });
+ } else {
+ const featured = FEATURED.map((id) => apps.find((app) => app.id === id)).filter(Boolean);
+ body = [
+ (0, import_react45.createElement)(Section, { key: "featured", title: t("Recommended"), apps: featured, actions, open }),
+ ...CATEGORIES.map(([id, label]) => (0, import_react45.createElement)(Section, { key: id, title: t(label), apps: inCategory(id), actions, open, onAll: () => setCategory(id) }))
+ ];
+ }
+ return (0, import_react45.createElement)(
+ "div",
+ { className: "bt-apps" },
+ banner,
+ (0, import_react45.createElement)(
+ "div",
+ { className: "bt-app-bar" },
+ (0, import_react45.createElement)(
+ "label",
+ { className: "bt-app-search" },
+ (0, import_react45.createElement)(SearchIcon),
+ (0, import_react45.createElement)("input", { type: "search", "aria-label": t("Search connectors"), placeholder: t("Search connectors"), value: query, onChange: (e) => setQuery(e.target.value) })
+ ),
+ (0, import_react45.createElement)("button", { type: "button", className: "bt-app-pill", onClick: () => setView("custom") }, (0, import_react45.createElement)(PlusIcon), t("Custom")),
+ (0, import_react45.createElement)(ConnectedSummary, { apps: marks, count, onClick: () => setView("connected") })
+ ),
+ (0, import_react45.createElement)(
+ "div",
+ { className: "bt-app-chips", role: "group", "aria-label": t("Category") },
+ [["", "All"], ...CATEGORIES].map(([id, label]) => (0, import_react45.createElement)("button", { key: id || "all", type: "button", "aria-pressed": category === id, onClick: () => setCategory(id) }, t(label)))
+ ),
+ body
+ );
+}
+var CONNECTORS_PAGE_CSS = `
+.bt-apps{display:flex;flex-direction:column;gap:14px;container-type:inline-size}
+.bt-app-bar{display:flex;align-items:center;gap:8px}
+.bt-app-search{flex:1;min-width:0;display:flex;align-items:center;gap:8px;height:36px;padding:0 14px;border:1px solid var(--bt-line);border-radius:999px;background:var(--bt-card);color:var(--bt-ink-3);cursor:text}
+.bt-app-search:focus-within{border-color:var(--bt-line-2)}
+.bt-app-search svg{flex:none;width:15px;height:15px}
+.bt-app-search input{flex:1;min-width:0;border:0;outline:none;background:none;color:var(--bt-ink);font:inherit;font-size:13px}
+.bt-app-search input::-webkit-search-cancel-button{display:none}
+.bt-app-pill,.bt-app-summary{flex:none;display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border:1px solid var(--bt-line);border-radius:999px;background:var(--bt-card);color:var(--bt-ink);font:inherit;font-size:13px;cursor:pointer;transition:background-color .12s ease}
+.bt-app-pill:hover,.bt-app-summary:hover{background:var(--bt-hover)}
+.bt-app-pill svg{width:14px;height:14px}
+.bt-app-summary{padding:0 10px 0 6px;border-color:transparent;background:none;color:var(--bt-ink-2)}
+.bt-app-summary svg{width:12px;height:12px}
+.bt-app-stack{display:inline-flex}
+.bt-app-stack .bt-app-icon{border-radius:6px;box-shadow:0 0 0 1.5px var(--bt-main)}
+.bt-app-stack .bt-app-icon+.bt-app-icon{margin-left:-6px}
+.bt-app-stack .bt-app-icon svg,.bt-app-stack .bt-connector-mono{width:13px;height:13px;font-size:9px}
+.bt-app-chips{display:flex;flex-wrap:wrap;gap:6px}
+.bt-app-chips button{height:28px;padding:0 12px;border:0;border-radius:999px;background:var(--bt-hover);color:var(--bt-ink);font:inherit;font-size:13px;cursor:pointer;transition:background-color .12s ease,color .12s ease}
+.bt-app-chips button:hover{background:var(--bt-active)}
+.bt-app-chips button[aria-pressed=true]{background:var(--bt-ink);color:var(--bt-main)}
+.bt-app-section{display:flex;flex-direction:column;gap:4px;margin-top:6px}
+.bt-app-section-head{display:flex;align-items:center;justify-content:space-between;min-height:24px}
+.bt-app-section-head h3{margin:0;font-size:14px;line-height:20px;font-weight:600}
+.bt-app-all{border:0;background:none;padding:2px 4px;color:var(--bt-ink-3);font:inherit;font-size:12px;cursor:pointer}
+.bt-app-all:hover{color:var(--bt-ink)}
+.bt-app-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:28px}
+@container (max-width:520px){.bt-app-grid{grid-template-columns:minmax(0,1fr)}}
+.bt-app{position:relative;display:flex;align-items:center;gap:10px;min-height:60px;border-radius:12px}
+.bt-app-main{flex:1;min-width:0;display:flex;align-items:center;gap:12px;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
+.bt-app-icon{--bt-mark-ink:var(--bt-ink);flex:none;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:var(--bt-card);box-shadow:inset 0 0 0 .5px var(--bt-line-2)}
+.bt-app-icon svg{width:22px;height:22px}
+.bt-app-text{min-width:0;display:flex;flex-direction:column;gap:1px}
+.bt-app-name{display:inline-flex;align-items:center;gap:6px;font-size:14px;line-height:20px;color:var(--bt-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.bt-app-status{font-size:12px;line-height:16px;color:var(--bt-ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.bt-app[data-state=error] .bt-app-status,.bt-app[data-error] .bt-app-status{color:var(--bt-danger)}
+.bt-app-btn{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:72px;height:28px;padding:0 14px;border:0;border-radius:999px;background:var(--bt-hover);color:var(--bt-ink);font:inherit;font-size:13px;cursor:pointer;transition:background-color .12s ease,color .12s ease}
+.bt-app-btn:hover:not(:disabled){background:var(--bt-active)}
+.bt-app-btn:disabled{opacity:.5;cursor:default}
+.bt-app-btn svg{width:13px;height:13px}
+.bt-app-btn-done{background:none;color:var(--bt-ink-2);box-shadow:inset 0 0 0 1px var(--bt-line)}
+.bt-app-icon svg{transition:filter .6s ease,opacity .6s ease}
+.bt-app:not([data-state=ready]) .bt-app-icon svg{filter:grayscale(1);opacity:.5}
+.bt-app[data-fresh] .bt-app-icon{animation:bt-app-pop .5s cubic-bezier(.3,1.5,.5,1)}
+.bt-app[data-fresh]::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(105deg,transparent 28%,color-mix(in srgb,var(--bt-ink) 7%,transparent) 44%,color-mix(in srgb,var(--bt-ink) 2%,transparent) 50%,color-mix(in srgb,var(--bt-ink) 7%,transparent) 56%,transparent 72%);background-size:300% 100%;border-radius:inherit;animation:bt-app-shine .9s cubic-bezier(.25,.8,.3,1) both}
+.bt-app[data-fresh] .bt-app-btn-done{animation:bt-app-done .4s ease-out}
+@keyframes bt-app-pop{0%{transform:scale(.86)}55%{transform:scale(1.07)}100%{transform:scale(1)}}
+@keyframes bt-app-shine{0%{background-position:100% 0}100%{background-position:0 0}}
+@keyframes bt-app-done{0%{opacity:.4;transform:scale(.94)}100%{opacity:1;transform:none}}
+.bt-app-empty{margin:24px 0;text-align:center;font-size:13px;color:var(--bt-ink-3)}
+.bt-app-sub{display:flex;flex-direction:column;gap:12px}
+.bt-app-sub-head{display:flex;align-items:center;gap:4px;margin-left:-6px}
+.bt-app-sub-head h3{margin:0;font-size:14px;line-height:20px;font-weight:600}
+.bt-app-about{margin:0 4px;font-size:13px;line-height:20px;color:var(--bt-ink-2)}
+.bt-connector-mark{--bt-mark-ink:var(--bt-ink)}
+[data-bt-motion=off] .bt-app,[data-bt-motion=off] .bt-app *,[data-bt-motion=off] .bt-app::after{animation:none!important;transition:none!important}
+@media (prefers-reduced-motion:reduce){.bt-app[data-fresh]::after,.bt-app[data-fresh] .bt-app-icon,.bt-app[data-fresh] .bt-app-btn-done{animation:none}}
+`;
+
+// node_modules/qrcode-generator/dist/qrcode.mjs
+var qrcode = function(typeNumber, errorCorrectionLevel) {
+ const PAD0 = 236;
+ const PAD1 = 17;
+ let _typeNumber = typeNumber;
+ const _errorCorrectionLevel = QRErrorCorrectionLevel[errorCorrectionLevel];
+ let _modules = null;
+ let _moduleCount = 0;
+ let _dataCache = null;
+ const _dataList = [];
+ const _this = {};
+ const makeImpl = function(test, maskPattern) {
+ _moduleCount = _typeNumber * 4 + 17;
+ _modules = (function(moduleCount) {
+ const modules = new Array(moduleCount);
+ for (let row = 0; row < moduleCount; row += 1) {
+ modules[row] = new Array(moduleCount);
+ for (let col = 0; col < moduleCount; col += 1) {
+ modules[row][col] = null;
+ }
+ }
+ return modules;
+ })(_moduleCount);
+ setupPositionProbePattern(0, 0);
+ setupPositionProbePattern(_moduleCount - 7, 0);
+ setupPositionProbePattern(0, _moduleCount - 7);
+ setupPositionAdjustPattern();
+ setupTimingPattern();
+ setupTypeInfo(test, maskPattern);
+ if (_typeNumber >= 7) {
+ setupTypeNumber(test);
+ }
+ if (_dataCache == null) {
+ _dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList);
+ }
+ mapData(_dataCache, maskPattern);
+ };
+ const setupPositionProbePattern = function(row, col) {
+ for (let r = -1; r <= 7; r += 1) {
+ if (row + r <= -1 || _moduleCount <= row + r) continue;
+ for (let c = -1; c <= 7; c += 1) {
+ if (col + c <= -1 || _moduleCount <= col + c) continue;
+ if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
+ _modules[row + r][col + c] = true;
+ } else {
+ _modules[row + r][col + c] = false;
+ }
+ }
+ }
+ };
+ const getBestMaskPattern = function() {
+ let minLostPoint = 0;
let pattern = 0;
for (let i = 0; i < 8; i += 1) {
makeImpl(true, i);
@@ -20463,7 +20810,7 @@ var qrcode_default = qrcode;
var stringToBytes = qrcode.stringToBytes;
// src/client/im-page.js
-var import_react45 = require("react");
+var import_react46 = require("react");
var SHORT = {
telegram: "Tg",
weixin: "微",
@@ -20484,7 +20831,7 @@ var LINKS = {
discord: ["https://discord.com/developers/applications", "discord.com"],
slack: ["https://api.slack.com/apps", "api.slack.com"]
};
-var Mark = ({ id }) => (0, import_react45.createElement)("span", { className: "bt-im-mark", style: { background: `var(--bt-im-${id}, var(--bt-hover))` } }, SHORT[id] ?? id.slice(0, 2));
+var Mark = ({ id }) => (0, import_react46.createElement)("span", { className: "bt-im-mark", style: { background: `var(--bt-im-${id}, var(--bt-hover))` } }, SHORT[id] ?? id.slice(0, 2));
var QUIET = 4;
function QrCode({ text }) {
const qr = qrcode_default(0, "M");
@@ -20496,18 +20843,18 @@ function QrCode({ text }) {
for (let y = 0; y < count; y += 1) {
for (let x = 0; x < count; x += 1) if (qr.isDark(y, x)) path2 += `M${x + QUIET} ${y + QUIET}h1v1h-1z`;
}
- return (0, import_react45.createElement)(
+ return (0, import_react46.createElement)(
"svg",
{ className: "bt-im-qr", viewBox: `0 0 ${size} ${size}`, role: "img", "aria-label": t("Pairing QR code"), shapeRendering: "crispEdges" },
- (0, import_react45.createElement)("rect", { width: size, height: size }),
- (0, import_react45.createElement)("path", { d: path2 })
+ (0, import_react46.createElement)("rect", { width: size, height: size }),
+ (0, import_react46.createElement)("path", { d: path2 })
);
}
function QrPanel({ actions, platform, botId, onDone }) {
- const [login, setLogin] = (0, import_react45.useState)(null);
- const [status, setStatus] = (0, import_react45.useState)("waiting");
- const [error, setError] = (0, import_react45.useState)(null);
- (0, import_react45.useEffect)(() => {
+ const [login, setLogin] = (0, import_react46.useState)(null);
+ const [status, setStatus] = (0, import_react46.useState)("waiting");
+ const [error, setError] = (0, import_react46.useState)(null);
+ (0, import_react46.useEffect)(() => {
let live = true;
let loginId;
void (async () => {
@@ -20534,18 +20881,18 @@ function QrPanel({ actions, platform, botId, onDone }) {
live = false;
};
}, []);
- return (0, import_react45.createElement)(
+ return (0, import_react46.createElement)(
"div",
{ className: "bt-im-qr-panel" },
- login === null && error === null ? (0, import_react45.createElement)("p", { className: "bt-mid" }, t("Connecting…")) : null,
- login !== null && status !== "expired" ? (0, import_react45.createElement)(QrCode, { text: login.qr }) : null,
- login !== null && status === "scanned" ? (0, import_react45.createElement)("p", { className: "bt-mid" }, t("Scanned — confirm on the phone")) : null,
- status === "expired" ? (0, import_react45.createElement)("p", { className: "bt-mid" }, t("Code expired")) : null,
- error ? (0, import_react45.createElement)("div", { className: "bt-connector-error", role: "alert" }, error) : null,
- (0, import_react45.createElement)(
+ login === null && error === null ? (0, import_react46.createElement)("p", { className: "bt-mid" }, t("Connecting…")) : null,
+ login !== null && status !== "expired" ? (0, import_react46.createElement)(QrCode, { text: login.qr }) : null,
+ login !== null && status === "scanned" ? (0, import_react46.createElement)("p", { className: "bt-mid" }, t("Scanned — confirm on the phone")) : null,
+ status === "expired" ? (0, import_react46.createElement)("p", { className: "bt-mid" }, t("Code expired")) : null,
+ error ? (0, import_react46.createElement)("div", { className: "bt-connector-error", role: "alert" }, error) : null,
+ (0, import_react46.createElement)(
"div",
{ className: "bt-connector-form-row" },
- status === "expired" ? (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onDone }, t("Done")) : (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onDone }, t("Cancel"))
+ status === "expired" ? (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onDone }, t("Done")) : (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onDone }, t("Cancel"))
)
);
}
@@ -20557,20 +20904,20 @@ function statusText3(status) {
return t("Off");
}
function TargetPicker({ value, roster, onChange, label }) {
- return (0, import_react45.createElement)(
+ return (0, import_react46.createElement)(
"select",
{ className: "bt-select", "aria-label": label ?? t("Bound to"), value: value ?? "", onChange: (event) => onChange(event.target.value || null) },
- (0, import_react45.createElement)("option", { value: "" }, t("Not bound")),
- roster.bots.map((bot) => (0, import_react45.createElement)("option", { key: bot.id, value: `b:${bot.id}` }, bot.name)),
- roster.rooms.map((room2) => (0, import_react45.createElement)("option", { key: room2.id, value: `r:${room2.id}` }, `${room2.name}`))
+ (0, import_react46.createElement)("option", { value: "" }, t("Not bound")),
+ roster.bots.map((bot) => (0, import_react46.createElement)("option", { key: bot.id, value: `b:${bot.id}` }, bot.name)),
+ roster.rooms.map((room2) => (0, import_react46.createElement)("option", { key: room2.id, value: `r:${room2.id}` }, `${room2.name}`))
);
}
var targetValue = (chat) => chat.target?.roomId !== void 0 ? `r:${chat.target.roomId}` : chat.target?.botId !== void 0 ? `b:${chat.target.botId}` : "";
function ConnectionRow({ conn, status, roster, actions }) {
- const [open, setOpen] = (0, import_react45.useState)(false);
- const [busy, setBusy] = (0, import_react45.useState)(false);
- const [confirmRemove, setConfirmRemove] = (0, import_react45.useState)(false);
- const [error, setError] = (0, import_react45.useState)(null);
+ const [open, setOpen] = (0, import_react46.useState)(false);
+ const [busy, setBusy] = (0, import_react46.useState)(false);
+ const [confirmRemove, setConfirmRemove] = (0, import_react46.useState)(false);
+ const [error, setError] = (0, import_react46.useState)(null);
const platform = IM_PLATFORMS.find((entry) => entry.id === conn.platform) ?? { name: conn.platform, fields: [] };
const run2 = (task) => {
setBusy(true);
@@ -20587,40 +20934,40 @@ function ConnectionRow({ conn, status, roster, actions }) {
void run2(actions.imChat(conn.id, { chatKey, target }));
};
const chats = Object.entries(conn.chats ?? {});
- return (0, import_react45.createElement)(
+ return (0, import_react46.createElement)(
"div",
{ className: "bt-connector", "data-state": status?.state ?? "off" },
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)(
"div",
{ className: "bt-connector-head" },
- (0, import_react45.createElement)("span", { className: "bt-connector-mark" }, (0, import_react45.createElement)(Mark, { id: conn.platform })),
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)("span", { className: "bt-connector-mark" }, (0, import_react46.createElement)(Mark, { id: conn.platform })),
+ (0, import_react46.createElement)(
"span",
{ className: "bt-connector-text" },
- (0, import_react45.createElement)("span", { className: "bt-connector-name" }, conn.account?.name ?? platform.name),
- (0, import_react45.createElement)("span", { className: "bt-connector-status" }, conn.enabled ? `${platform.name} · ${statusText3(status)}` : `${platform.name} · ${t("Disabled")}`)
+ (0, import_react46.createElement)("span", { className: "bt-connector-name" }, conn.account?.name ?? platform.name),
+ (0, import_react46.createElement)("span", { className: "bt-connector-status" }, conn.enabled ? `${platform.name} · ${statusText3(status)}` : `${platform.name} · ${t("Disabled")}`)
),
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)(
"span",
{ className: "bt-connector-actions" },
- status?.state === "error" ? (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imRetry(conn.id)) }, t("Try again")) : null,
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setOpen((value) => !value) }, open ? t("Collapse") : t("Manage"))
+ status?.state === "error" ? (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imRetry(conn.id)) }, t("Try again")) : null,
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setOpen((value) => !value) }, open ? t("Collapse") : t("Manage"))
)
),
- open ? (0, import_react45.createElement)(
+ open ? (0, import_react46.createElement)(
"div",
{ className: "bt-connector-form" },
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)(
"div",
{ className: "bt-im-line" },
- (0, import_react45.createElement)("span", { className: "bt-im-label" }, t("Talks to")),
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)("span", { className: "bt-im-label" }, t("Talks to")),
+ (0, import_react46.createElement)(
"select",
{ className: "bt-select", "aria-label": t("Talks to"), value: conn.botId ?? "", onChange: (event) => setBot(`b:${event.target.value}`) },
- roster.bots.map((bot) => (0, import_react45.createElement)("option", { key: bot.id, value: bot.id }, bot.name))
+ roster.bots.map((bot) => (0, import_react46.createElement)("option", { key: bot.id, value: bot.id }, bot.name))
),
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imUpdate(conn.id, { enabled: !conn.enabled })) }, conn.enabled ? t("Disable") : t("Enable")),
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => {
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imUpdate(conn.id, { enabled: !conn.enabled })) }, conn.enabled ? t("Disable") : t("Enable")),
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => {
if (!confirmRemove) {
setConfirmRemove(true);
return;
@@ -20628,52 +20975,52 @@ function ConnectionRow({ conn, status, roster, actions }) {
void run2(actions.imRemove(conn.id));
} }, confirmRemove ? t("Remove?") : t("Remove"))
),
- conn.requests.length > 0 ? (0, import_react45.createElement)(
+ conn.requests.length > 0 ? (0, import_react46.createElement)(
"div",
{ className: "bt-im-block" },
- (0, import_react45.createElement)("div", { className: "bt-im-label" }, t("Wants to connect")),
- conn.requests.map((request) => (0, import_react45.createElement)(
+ (0, import_react46.createElement)("div", { className: "bt-im-label" }, t("Wants to connect")),
+ conn.requests.map((request) => (0, import_react46.createElement)(
"div",
{ key: request.id, className: "bt-im-line" },
- (0, import_react45.createElement)("span", { className: "bt-im-name" }, request.name),
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imPair(conn.id, request.id, true)) }, t("Allow")),
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imPair(conn.id, request.id, false)) }, t("Deny"))
+ (0, import_react46.createElement)("span", { className: "bt-im-name" }, request.name),
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imPair(conn.id, request.id, true)) }, t("Allow")),
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imPair(conn.id, request.id, false)) }, t("Deny"))
))
) : null,
- conn.paired.length > 0 ? (0, import_react45.createElement)(
+ conn.paired.length > 0 ? (0, import_react46.createElement)(
"div",
{ className: "bt-im-block" },
- (0, import_react45.createElement)("div", { className: "bt-im-label" }, t("Connected accounts")),
- conn.paired.map((entry) => (0, import_react45.createElement)(
+ (0, import_react46.createElement)("div", { className: "bt-im-label" }, t("Connected accounts")),
+ conn.paired.map((entry) => (0, import_react46.createElement)(
"div",
{ key: entry.id, className: "bt-im-line" },
- (0, import_react45.createElement)("span", { className: "bt-im-name" }, entry.name),
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imUnpair(conn.id, entry.id)) }, t("Remove"))
+ (0, import_react46.createElement)("span", { className: "bt-im-name" }, entry.name),
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: () => void run2(actions.imUnpair(conn.id, entry.id)) }, t("Remove"))
))
) : null,
- chats.length > 0 ? (0, import_react45.createElement)(
+ chats.length > 0 ? (0, import_react46.createElement)(
"div",
{ className: "bt-im-block" },
- (0, import_react45.createElement)("div", { className: "bt-im-label" }, t("Chats")),
- chats.map(([chatKey, chat]) => (0, import_react45.createElement)(
+ (0, import_react46.createElement)("div", { className: "bt-im-label" }, t("Chats")),
+ chats.map(([chatKey, chat]) => (0, import_react46.createElement)(
"div",
{ key: chatKey, className: "bt-im-line" },
- (0, import_react45.createElement)("span", { className: "bt-im-name" }, chat.title ?? chatKey),
- chat.kind === "group" ? (0, import_react45.createElement)(TargetPicker, { roster, value: targetValue(chat), label: t("Bound to"), onChange: (value) => setChatTarget(chatKey, value) }) : (0, import_react45.createElement)("span", { className: "bt-im-label" }, t("Direct")),
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: removeChat(chatKey) }, t("Remove"))
+ (0, import_react46.createElement)("span", { className: "bt-im-name" }, chat.title ?? chatKey),
+ chat.kind === "group" ? (0, import_react46.createElement)(TargetPicker, { roster, value: targetValue(chat), label: t("Bound to"), onChange: (value) => setChatTarget(chatKey, value) }) : (0, import_react46.createElement)("span", { className: "bt-im-label" }, t("Direct")),
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: removeChat(chatKey) }, t("Remove"))
))
) : null
) : null,
- error ? (0, import_react45.createElement)("div", { className: "bt-connector-error", role: "alert" }, error) : null
+ error ? (0, import_react46.createElement)("div", { className: "bt-connector-error", role: "alert" }, error) : null
);
}
function AddForm({ roster, actions, onDone }) {
const platforms = (roster.im?.platforms ?? []).map((id) => IM_PLATFORMS.find((entry) => entry.id === id)).filter(Boolean);
- const [platform, setPlatform] = (0, import_react45.useState)(platforms[0]?.id ?? "");
- const [fields, setFields] = (0, import_react45.useState)({});
- const [botId, setBotId] = (0, import_react45.useState)(roster.bots[0]?.id ?? "");
- const [busy, setBusy] = (0, import_react45.useState)(false);
- const [error, setError] = (0, import_react45.useState)(null);
+ const [platform, setPlatform] = (0, import_react46.useState)(platforms[0]?.id ?? "");
+ const [fields, setFields] = (0, import_react46.useState)({});
+ const [botId, setBotId] = (0, import_react46.useState)(roster.bots[0]?.id ?? "");
+ const [busy, setBusy] = (0, import_react46.useState)(false);
+ const [error, setError] = (0, import_react46.useState)(null);
const shown = IM_PLATFORMS.find((entry) => entry.id === platform);
const link = platform === "feishu" && fields.domain === "lark" ? LINKS.lark : LINKS[platform];
const add = () => {
@@ -20686,67 +21033,67 @@ function AddForm({ roster, actions, onDone }) {
}).catch((failure) => setError(failure?.message ?? String(failure))).finally(() => setBusy(false));
};
if (platforms.length === 0) return null;
- return (0, import_react45.createElement)(
+ return (0, import_react46.createElement)(
"div",
{ className: "bt-connector-form" },
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)(
"div",
{ className: "bt-im-line" },
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)(
"select",
{ className: "bt-select", "aria-label": t("Platform"), value: platform, onChange: (event) => {
setPlatform(event.target.value);
setFields({});
} },
- platforms.map((entry) => (0, import_react45.createElement)("option", { key: entry.id, value: entry.id }, entry.name))
+ platforms.map((entry) => (0, import_react46.createElement)("option", { key: entry.id, value: entry.id }, entry.name))
),
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)(
"select",
{ className: "bt-select", "aria-label": t("Talks to"), value: botId, onChange: (event) => setBotId(event.target.value) },
- roster.bots.map((bot) => (0, import_react45.createElement)("option", { key: bot.id, value: bot.id }, bot.name))
+ roster.bots.map((bot) => (0, import_react46.createElement)("option", { key: bot.id, value: bot.id }, bot.name))
)
),
- shown?.login === "qr" ? (0, import_react45.createElement)(QrPanel, { key: `${platform}:${botId}`, actions, platform, botId, onDone }) : (shown?.fields ?? []).map((field) => field.options !== void 0 ? (0, import_react45.createElement)(
+ shown?.login === "qr" ? (0, import_react46.createElement)(QrPanel, { key: `${platform}:${botId}`, actions, platform, botId, onDone }) : (shown?.fields ?? []).map((field) => field.options !== void 0 ? (0, import_react46.createElement)(
"div",
{ key: field.key, className: "bt-im-line" },
- (0, import_react45.createElement)("span", { className: "bt-im-label" }, field.label),
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)("span", { className: "bt-im-label" }, field.label),
+ (0, import_react46.createElement)(
"select",
{ className: "bt-select", "aria-label": field.label, value: fields[field.key] ?? field.options[0][0], onChange: (event) => setFields((current) => ({ ...current, [field.key]: event.target.value })) },
- field.options.map(([id, label]) => (0, import_react45.createElement)("option", { key: id, value: id }, label))
+ field.options.map(([id, label]) => (0, import_react46.createElement)("option", { key: id, value: id }, label))
)
- ) : (0, import_react45.createElement)(
+ ) : (0, import_react46.createElement)(
"label",
{ key: field.key, className: "bt-q-field bt-secret-field" },
- field.secret ? (0, import_react45.createElement)(MaskedInput, { value: fields[field.key] ?? "", onChange: (value) => setFields((current) => ({ ...current, [field.key]: value })), onEnter: add, label: field.hint ? `${field.label} (${field.hint}…)` : field.label }) : (0, import_react45.createElement)("input", { className: "bt-input", "aria-label": field.label, placeholder: field.label, value: fields[field.key] ?? "", onChange: (event) => setFields((current) => ({ ...current, [field.key]: event.target.value })) })
+ field.secret ? (0, import_react46.createElement)(MaskedInput, { value: fields[field.key] ?? "", onChange: (value) => setFields((current) => ({ ...current, [field.key]: value })), onEnter: add, label: field.hint ? `${field.label} (${field.hint}…)` : field.label }) : (0, import_react46.createElement)("input", { className: "bt-input", "aria-label": field.label, placeholder: field.label, value: fields[field.key] ?? "", onChange: (event) => setFields((current) => ({ ...current, [field.key]: event.target.value })) })
)),
- shown?.login === "qr" ? null : (0, import_react45.createElement)(
+ shown?.login === "qr" ? null : (0, import_react46.createElement)(
"div",
{ className: "bt-connector-form-row" },
- link ? (0, import_react45.createElement)("a", { className: "bt-connector-link", href: link[0], target: "_blank", rel: "noopener noreferrer" }, link[1]) : null,
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onDone }, t("Cancel")),
- (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: add }, busy ? t("Connecting…") : t("Connect"))
+ link ? (0, import_react46.createElement)("a", { className: "bt-connector-link", href: link[0], target: "_blank", rel: "noopener noreferrer" }, link[1]) : null,
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onDone }, t("Cancel")),
+ (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: busy, onClick: add }, busy ? t("Connecting…") : t("Connect"))
),
- shown?.login === "qr" ? null : error ? (0, import_react45.createElement)("div", { className: "bt-connector-error", role: "alert" }, error) : null
+ shown?.login === "qr" ? null : error ? (0, import_react46.createElement)("div", { className: "bt-connector-error", role: "alert" }, error) : null
);
}
function ImPage({ roster, actions }) {
- const [adding, setAdding] = (0, import_react45.useState)(false);
+ const [adding, setAdding] = (0, import_react46.useState)(false);
const list = roster.im?.connections ?? [];
const statuses = roster.imStatus ?? {};
const pending = list.reduce((count, conn) => count + (conn.requests?.length ?? 0), 0);
return [
- (0, import_react45.createElement)(
+ (0, import_react46.createElement)(
"div",
{ key: "new", className: "bt-actions" },
- adding ? null : (0, import_react45.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-with-icon", onClick: () => setAdding(true) }, t("Add IM bot"))
+ adding ? null : (0, import_react46.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-with-icon", onClick: () => setAdding(true) }, t("Add IM bot"))
),
- adding ? (0, import_react45.createElement)("section", { key: "add", className: "bt-set-section" }, (0, import_react45.createElement)("div", { className: "bt-set-card bt-connectors-card" }, (0, import_react45.createElement)(AddForm, { roster, actions, onDone: () => setAdding(false) }))) : null,
- (0, import_react45.createElement)(
+ adding ? (0, import_react46.createElement)("section", { key: "add", className: "bt-set-section" }, (0, import_react46.createElement)("div", { className: "bt-set-card bt-connectors-card" }, (0, import_react46.createElement)(AddForm, { roster, actions, onDone: () => setAdding(false) }))) : null,
+ (0, import_react46.createElement)(
"section",
{ key: "list", className: "bt-set-section" },
- (0, import_react45.createElement)("h3", null, pending > 0 ? t("IM · {count} requests", { count: pending }) : t("IM bots")),
- (0, import_react45.createElement)("div", { className: "bt-set-card bt-connectors-card" }, list.length === 0 ? (0, import_react45.createElement)("div", { className: "bt-set-row" }, (0, import_react45.createElement)("span", { className: "bt-set-hint" }, t("No IM bots"))) : list.map((conn) => (0, import_react45.createElement)(ConnectionRow, { key: conn.id, conn, status: statuses[conn.id], roster, actions })))
+ (0, import_react46.createElement)("h3", null, pending > 0 ? t("IM · {count} requests", { count: pending }) : t("IM bots")),
+ (0, import_react46.createElement)("div", { className: "bt-set-card bt-connectors-card" }, list.length === 0 ? (0, import_react46.createElement)("div", { className: "bt-set-row" }, (0, import_react46.createElement)("span", { className: "bt-set-hint" }, t("No IM bots"))) : list.map((conn) => (0, import_react46.createElement)(ConnectionRow, { key: conn.id, conn, status: statuses[conn.id], roster, actions })))
)
];
}
@@ -20761,7 +21108,7 @@ var IM_CSS = `
`;
// src/client/browser-settings.js
-var import_react46 = require("react");
+var import_react47 = require("react");
var ACTIONS = [["post", "Post"], ["upload", "Upload"], ["download", "Download"], ["delete", "Delete"]];
var DURATIONS = [["hour", "1 hour"], ["today", "Today"], ["week", "7 days"], ["permanent", "Permanent"]];
var expired = (grant) => Number.isFinite(grant.until) && grant.until <= Date.now();
@@ -20778,15 +21125,15 @@ function grantKinds(grant) {
if (grant.kinds.includes("*")) return [t("All four")];
return ACTIONS.filter(([kind]) => grant.kinds.includes(kind)).map(([, label]) => t(label));
}
-function BrowserPage({ roster, actions, run: run2, Section, Row: Row3 }) {
+function BrowserPage({ roster, actions, run: run2, Section: Section2, Row: Row3 }) {
const bots = roster.bots ?? [];
- const [botId, setBotId] = (0, import_react46.useState)(bots[0]?.id ?? "");
- const [site, setSite] = (0, import_react46.useState)("");
- const [kinds, setKinds] = (0, import_react46.useState)(["post"]);
- const [duration, setDuration] = (0, import_react46.useState)("hour");
- const [busy, setBusy] = (0, import_react46.useState)(false);
+ const [botId, setBotId] = (0, import_react47.useState)(bots[0]?.id ?? "");
+ const [site, setSite] = (0, import_react47.useState)("");
+ const [kinds, setKinds] = (0, import_react47.useState)(["post"]);
+ const [duration, setDuration] = (0, import_react47.useState)("hour");
+ const [busy, setBusy] = (0, import_react47.useState)(false);
const selectedBot = bots.find((bot) => bot.id === botId);
- (0, import_react46.useEffect)(() => {
+ (0, import_react47.useEffect)(() => {
if (!bots.some((bot) => bot.id === botId)) setBotId(bots[0]?.id ?? "");
}, [bots, botId]);
const grants = bots.flatMap((bot) => (bot.browserGrants ?? []).map((grant, index) => ({
@@ -20819,37 +21166,37 @@ function BrowserPage({ roster, actions, run: run2, Section, Row: Row3 }) {
const toggleKind = (kind, checked) => {
setKinds((current) => checked ? current.includes(kind) ? current : [...current, kind] : current.filter((value) => value !== kind));
};
- return (0, import_react46.createElement)(
+ return (0, import_react47.createElement)(
"div",
{ className: "bt-browser-settings" },
- (0, import_react46.createElement)(
- Section,
+ (0, import_react47.createElement)(
+ Section2,
{ title: t("Browser access") },
- (0, import_react46.createElement)("p", { className: "bt-browser-note" }, t("Bots browse, click and fill in forms freely. Posting, uploading, downloading and deleting ask you first unless you allow them here. Payments are always yours: the Bot hands the page to you."))
+ (0, import_react47.createElement)("p", { className: "bt-browser-note" }, t("Bots browse, click and fill in forms freely. Posting, uploading, downloading and deleting ask you first unless you allow them here. Payments are always yours: the Bot hands the page to you."))
),
- (0, import_react46.createElement)(
- Section,
+ (0, import_react47.createElement)(
+ Section2,
{ title: t("Allowed actions") },
- grants.length === 0 ? (0, import_react46.createElement)(Row3, { label: t("Nothing allowed yet.") }) : grants.map(({ bot, grant, index, expired: expired2 }) => (0, import_react46.createElement)(
+ grants.length === 0 ? (0, import_react47.createElement)(Row3, { label: t("Nothing allowed yet.") }) : grants.map(({ bot, grant, index, expired: expired2 }) => (0, import_react47.createElement)(
"div",
{
key: `${bot.id}:${index}`,
className: `bt-browser-grant${expired2 ? " bt-browser-grant-expired" : ""}`
},
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
"div",
{ className: "bt-browser-grant-who" },
- (0, import_react46.createElement)(BotAvatar, { bot, size: 28 }),
- (0, import_react46.createElement)("span", null, bot.name)
+ (0, import_react47.createElement)(BotAvatar, { bot, size: 28 }),
+ (0, import_react47.createElement)("span", null, bot.name)
),
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
"div",
{ className: "bt-browser-grant-meta" },
- (0, import_react46.createElement)("span", { className: "bt-browser-grant-site" }, grant.site === "*" ? t("All sites") : grant.site),
- (0, import_react46.createElement)("div", { className: "bt-browser-grant-kinds" }, grantKinds(grant).map((label) => (0, import_react46.createElement)("span", { key: label, className: "bt-chip" }, label))),
- (0, import_react46.createElement)("span", { className: "bt-set-hint" }, grantTime(grant))
+ (0, import_react47.createElement)("span", { className: "bt-browser-grant-site" }, grant.site === "*" ? t("All sites") : grant.site),
+ (0, import_react47.createElement)("div", { className: "bt-browser-grant-kinds" }, grantKinds(grant).map((label) => (0, import_react47.createElement)("span", { key: label, className: "bt-chip" }, label))),
+ (0, import_react47.createElement)("span", { className: "bt-set-hint" }, grantTime(grant))
),
- (0, import_react46.createElement)("button", {
+ (0, import_react47.createElement)("button", {
type: "button",
className: "bt-soft bt-soft-sm",
onClick: () => remove(bot, index),
@@ -20857,25 +21204,25 @@ function BrowserPage({ roster, actions, run: run2, Section, Row: Row3 }) {
}, t("Remove grant"))
))
),
- (0, import_react46.createElement)(
- Section,
+ (0, import_react47.createElement)(
+ Section2,
{ title: t("Allow an action") },
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
"form",
{ className: "bt-browser-form", onSubmit: add },
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
Row3,
{ label: t("Bot") },
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
"select",
{ className: "bt-select", value: botId, onChange: (event) => setBotId(event.target.value), disabled: bots.length === 0 },
- bots.map((bot) => (0, import_react46.createElement)("option", { key: bot.id, value: bot.id }, bot.name))
+ bots.map((bot) => (0, import_react47.createElement)("option", { key: bot.id, value: bot.id }, bot.name))
)
),
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
Row3,
{ label: t("Site") },
- (0, import_react46.createElement)("input", {
+ (0, import_react47.createElement)("input", {
className: "bt-input bt-browser-site",
type: "text",
value: site,
@@ -20883,16 +21230,16 @@ function BrowserPage({ roster, actions, run: run2, Section, Row: Row3 }) {
onChange: (event) => setSite(event.target.value)
})
),
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
Row3,
{ label: t("Actions") },
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
"div",
{ className: "bt-browser-action-list" },
- ACTIONS.map(([kind, label]) => (0, import_react46.createElement)(
+ ACTIONS.map(([kind, label]) => (0, import_react47.createElement)(
"label",
{ key: kind, className: "bt-browser-action-choice" },
- (0, import_react46.createElement)("input", {
+ (0, import_react47.createElement)("input", {
type: "checkbox",
checked: kinds.includes(kind),
onChange: (event) => toggleKind(kind, event.target.checked)
@@ -20901,13 +21248,13 @@ function BrowserPage({ roster, actions, run: run2, Section, Row: Row3 }) {
))
)
),
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
Row3,
{ label: t("Duration") },
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
"div",
{ className: "bt-browser-duration", role: "group", "aria-label": t("Duration") },
- DURATIONS.map(([key, label]) => (0, import_react46.createElement)("button", {
+ DURATIONS.map(([key, label]) => (0, import_react47.createElement)("button", {
key,
type: "button",
className: "bt-browser-duration-choice",
@@ -20916,10 +21263,10 @@ function BrowserPage({ roster, actions, run: run2, Section, Row: Row3 }) {
}, t(label)))
)
),
- (0, import_react46.createElement)(
+ (0, import_react47.createElement)(
"div",
{ className: "bt-browser-form-foot" },
- (0, import_react46.createElement)("button", {
+ (0, import_react47.createElement)("button", {
type: "submit",
className: "bt-soft bt-soft-sm",
disabled: busy || !selectedBot || kinds.length === 0
@@ -20931,12 +21278,12 @@ function BrowserPage({ roster, actions, run: run2, Section, Row: Row3 }) {
}
// src/client/feedback.js
-var import_react47 = require("react");
-var FeedbackIcon = () => (0, import_react47.createElement)(
+var import_react48 = require("react");
+var FeedbackIcon = () => (0, import_react48.createElement)(
"svg",
{ width: 15, height: 15, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true },
- (0, import_react47.createElement)("path", { d: "M4 4.5h12a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H9l-3.5 3v-3H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1z" }),
- (0, import_react47.createElement)("path", { d: "M10 7v2.6M10 11.4h.01" })
+ (0, import_react48.createElement)("path", { d: "M4 4.5h12a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H9l-3.5 3v-3H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1z" }),
+ (0, import_react48.createElement)("path", { d: "M10 7v2.6M10 11.4h.01" })
);
function download(name, text) {
const url = URL.createObjectURL(new Blob([text], { type: "text/plain;charset=utf-8" }));
@@ -20958,32 +21305,18 @@ function entrySummary(entry) {
return entry.text;
}
var SOURCES = { turn: "Model call", host: "DS Bot", api: "DS Bot", browser: "This window" };
-function issueWindow() {
- if (window.dshDesktop !== void 0) return { go: (url) => {
- window.open(url, "_blank");
- return true;
- } };
- const reserved = window.open("", "_blank");
- if (reserved !== null) reserved.opener = null;
- return {
- go: (url) => {
- if (reserved === null) return false;
- reserved.location.href = url;
- return true;
- }
- };
-}
-function FeedbackPage({ actions, run: run2, Section, Row: Row3 }) {
- const [what, setWhat] = (0, import_react47.useState)("");
- const [report, setReport] = (0, import_react47.useState)(null);
- const [preview, setPreview] = (0, import_react47.useState)(false);
- const [note, setNote] = (0, import_react47.useState)("");
+var issueWindow = reserveWindow;
+function FeedbackPage({ actions, run: run2, Section: Section2, Row: Row3 }) {
+ const [what, setWhat] = (0, import_react48.useState)("");
+ const [report, setReport] = (0, import_react48.useState)(null);
+ const [preview, setPreview] = (0, import_react48.useState)(false);
+ const [note, setNote] = (0, import_react48.useState)("");
const fetchReport = () => actions.diagnostics({ client: clientFacts(), clientErrors: clientErrors() }).then((next) => {
setReport(next);
return next;
});
const load = () => fetchReport().then(() => void 0);
- (0, import_react47.useEffect)(() => {
+ (0, import_react48.useEffect)(() => {
void run2(load());
}, []);
const copyReport = () => run2(fetchReport().then(async (next) => {
@@ -20991,7 +21324,7 @@ function FeedbackPage({ actions, run: run2, Section, Row: Row3 }) {
setNote(copied ? t("Copied the diagnostics.") : t("Could not copy. Select the text below and copy it."));
if (!copied) setPreview(true);
}));
- const [issueLink, setIssueLink] = (0, import_react47.useState)(null);
+ const [issueLink, setIssueLink] = (0, import_react48.useState)(null);
const openIssue = () => {
const target = issueWindow();
run2(fetchReport().then(async (next) => {
@@ -21017,59 +21350,59 @@ function FeedbackPage({ actions, run: run2, Section, Row: Row3 }) {
const total = (report?.total ?? 0) + browserErrors.length;
const shown = entries2.slice(0, 8);
return [
- (0, import_react47.createElement)(
- Section,
+ (0, import_react48.createElement)(
+ Section2,
{ key: "report", title: t("Report a problem") },
- (0, import_react47.createElement)(
+ (0, import_react48.createElement)(
"div",
{ className: "bt-set-row bt-set-paste bt-fb-what" },
- (0, import_react47.createElement)(
+ (0, import_react48.createElement)(
"label",
{ className: "bt-set-copy", htmlFor: "bt-fb-what" },
- (0, import_react47.createElement)("span", null, t("What happened?")),
- (0, import_react47.createElement)("span", { className: "bt-set-hint" }, t("What you did, what you expected, and what happened instead. It goes into the issue."))
+ (0, import_react48.createElement)("span", null, t("What happened?")),
+ (0, import_react48.createElement)("span", { className: "bt-set-hint" }, t("What you did, what you expected, and what happened instead. It goes into the issue."))
),
- (0, import_react47.createElement)("textarea", { id: "bt-fb-what", className: "bt-input bt-input-area", value: what, maxLength: WHAT_MAX, placeholder: t("For example: I asked Writer in the group chat and it showed an error."), onChange: (event) => setWhat(event.target.value) })
+ (0, import_react48.createElement)("textarea", { id: "bt-fb-what", className: "bt-input bt-input-area", value: what, maxLength: WHAT_MAX, placeholder: t("For example: I asked Writer in the group chat and it showed an error."), onChange: (event) => setWhat(event.target.value) })
),
- (0, import_react47.createElement)(
+ (0, import_react48.createElement)(
Row3,
{ label: t("Diagnostics"), hint: t("Versions, system, models, and the latest errors. Saved keys, tokens, and your home folder are hidden.") },
- (0, import_react47.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setPreview(!preview), "aria-expanded": preview }, preview ? t("Hide") : t("Show")),
- (0, import_react47.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: copyReport }, t("Copy"))
+ (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setPreview(!preview), "aria-expanded": preview }, preview ? t("Hide") : t("Show")),
+ (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: copyReport }, t("Copy"))
),
- preview ? (0, import_react47.createElement)("div", { className: "bt-set-row bt-fb-preview" }, (0, import_react47.createElement)("pre", { tabIndex: 0, "aria-label": t("Diagnostics") }, report?.markdown || t("Loading…"))) : null,
- (0, import_react47.createElement)(
+ preview ? (0, import_react48.createElement)("div", { className: "bt-set-row bt-fb-preview" }, (0, import_react48.createElement)("pre", { tabIndex: 0, "aria-label": t("Diagnostics") }, report?.markdown || t("Loading…"))) : null,
+ (0, import_react48.createElement)(
Row3,
{ label: t("GitHub issue"), hint: t("Opens a new issue in the DS Bot repository with all of this filled in. Nothing is sent until you submit it there.") },
- (0, import_react47.createElement)("button", { type: "button", className: "bt-fb-primary", onClick: openIssue }, t("Report on GitHub"))
+ (0, import_react48.createElement)("button", { type: "button", className: "bt-fb-primary", onClick: openIssue }, t("Report on GitHub"))
)
),
- note ? (0, import_react47.createElement)(
+ note ? (0, import_react48.createElement)(
"div",
{ key: "note", className: "bt-note bt-fb-note", role: "status" },
note,
- issueLink ? [" ", (0, import_react47.createElement)("a", { key: "link", href: issueLink, target: "_blank", rel: "noopener noreferrer" }, t("Open the issue"))] : null
+ issueLink ? [" ", (0, import_react48.createElement)("a", { key: "link", href: issueLink, target: "_blank", rel: "noopener noreferrer" }, t("Open the issue"))] : null
) : null,
- (0, import_react47.createElement)(
- Section,
+ (0, import_react48.createElement)(
+ Section2,
{ key: "errors", title: report ? t("Recent errors · {count}", { count: total }) : t("Recent errors") },
- shown.length === 0 ? (0, import_react47.createElement)(Row3, { label: t("No errors recorded."), hint: t("Failed model calls and DS Bot problems show here, newest first.") }) : shown.map((entry, index) => (0, import_react47.createElement)(
+ shown.length === 0 ? (0, import_react48.createElement)(Row3, { label: t("No errors recorded."), hint: t("Failed model calls and DS Bot problems show here, newest first.") }) : shown.map((entry, index) => (0, import_react48.createElement)(
"div",
{ key: `${entry.time}-${index}`, className: "bt-set-row bt-fb-entry", title: entry.text },
- (0, import_react47.createElement)("span", { className: "bt-fb-dot", "data-level": entry.level, "aria-hidden": true }),
- (0, import_react47.createElement)(
+ (0, import_react48.createElement)("span", { className: "bt-fb-dot", "data-level": entry.level, "aria-hidden": true }),
+ (0, import_react48.createElement)(
"div",
{ className: "bt-set-copy" },
- (0, import_react47.createElement)("span", { className: "bt-fb-text" }, entrySummary(entry)),
- (0, import_react47.createElement)("span", { className: "bt-set-hint" }, [whenText(entry.time), entry.bot, entry.where, t(SOURCES[entry.source] ?? "DS Bot")].filter(Boolean).join(" · "))
+ (0, import_react48.createElement)("span", { className: "bt-fb-text" }, entrySummary(entry)),
+ (0, import_react48.createElement)("span", { className: "bt-set-hint" }, [whenText(entry.time), entry.bot, entry.where, t(SOURCES[entry.source] ?? "DS Bot")].filter(Boolean).join(" · "))
),
- entry.code ? (0, import_react47.createElement)("span", { className: "bt-tag bt-fb-code" }, entry.status ? `${entry.code} ${entry.status}` : entry.code) : null
+ entry.code ? (0, import_react48.createElement)("span", { className: "bt-tag bt-fb-code" }, entry.status ? `${entry.code} ${entry.status}` : entry.code) : null
)),
- (0, import_react47.createElement)(
+ (0, import_react48.createElement)(
Row3,
{ label: t("Error log"), hint: t("Kept on this computer across restarts, up to about 1 MB.") },
- (0, import_react47.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: downloadLog }, t("Download")),
- (0, import_react47.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: clearLog, disabled: !report || total === 0 }, t("Clear"))
+ (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: downloadLog }, t("Download")),
+ (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: clearLog, disabled: !report || total === 0 }, t("Clear"))
)
)
];
@@ -21077,8 +21410,8 @@ function FeedbackPage({ actions, run: run2, Section, Row: Row3 }) {
var TOAST_MS = 6e3;
function ErrorToast({ useUi, actions }) {
const toast = useUi((state) => state.toast);
- const [leaving, setLeaving] = (0, import_react47.useState)(false);
- (0, import_react47.useEffect)(() => {
+ const [leaving, setLeaving] = (0, import_react48.useState)(false);
+ (0, import_react48.useEffect)(() => {
if (!toast) return void 0;
setLeaving(false);
const fade = setTimeout(() => setLeaving(true), TOAST_MS);
@@ -21089,15 +21422,15 @@ function ErrorToast({ useUi, actions }) {
};
}, [toast?.token]);
if (!toast) return null;
- return (0, import_react47.createElement)(
+ return (0, import_react48.createElement)(
"div",
{ className: "bt-toast", role: "alert", "data-leaving": leaving || void 0 },
- (0, import_react47.createElement)("span", { className: "bt-toast-text" }, toast.text),
- (0, import_react47.createElement)("button", { type: "button", className: "bt-toast-link", onClick: () => {
+ (0, import_react48.createElement)("span", { className: "bt-toast-text" }, toast.text),
+ (0, import_react48.createElement)("button", { type: "button", className: "bt-toast-link", onClick: () => {
actions.dismissToast(toast.token);
actions.openSettings("feedback");
} }, t("Details")),
- (0, import_react47.createElement)("button", { type: "button", className: "bt-icon-btn bt-toast-close", "aria-label": t("Dismiss"), onClick: () => actions.dismissToast(toast.token) }, (0, import_react47.createElement)(CloseIcon))
+ (0, import_react48.createElement)("button", { type: "button", className: "bt-icon-btn bt-toast-close", "aria-label": t("Dismiss"), onClick: () => actions.dismissToast(toast.token) }, (0, import_react48.createElement)(CloseIcon))
);
}
var FEEDBACK_CSS = `
@@ -21129,7 +21462,7 @@ var FEEDBACK_CSS = `
`;
// src/client/about.js
-var import_react48 = require("react");
+var import_react49 = require("react");
var CHEER_MS = 1800;
var starCount = (count) => new Intl.NumberFormat(dateLocale(), { notation: "compact", maximumFractionDigits: 1 }).format(count);
function botHint(update) {
@@ -21175,11 +21508,11 @@ function dshHint(dsh, shown) {
return t("Version {version}", { version: dsh.current });
}
var linkProps = (href) => ({ className: "bt-soft bt-soft-sm bt-about-link", href, target: "_blank", rel: "noopener noreferrer" });
-function AboutPage({ useUpdate, actions, run: run2, Section, Row: Row3 }) {
+function AboutPage({ useUpdate, actions, run: run2, Section: Section2, Row: Row3 }) {
const update = useUpdate((value) => value) ?? {};
- const [checking, setChecking] = (0, import_react48.useState)(false);
- const [stars, setStars] = (0, import_react48.useState)(null);
- (0, import_react48.useEffect)(() => {
+ const [checking, setChecking] = (0, import_react49.useState)(false);
+ const [stars, setStars] = (0, import_react49.useState)(null);
+ (0, import_react49.useEffect)(() => {
let live = true;
actions.repoStars().then((count) => {
if (live && Number.isInteger(count)) setStars(count);
@@ -21189,8 +21522,8 @@ function AboutPage({ useUpdate, actions, run: run2, Section, Row: Row3 }) {
live = false;
};
}, []);
- const [cheer, setCheer] = (0, import_react48.useState)(true);
- (0, import_react48.useEffect)(() => {
+ const [cheer, setCheer] = (0, import_react49.useState)(true);
+ (0, import_react49.useEffect)(() => {
if (!cheer) return void 0;
const timer = setTimeout(() => setCheer(false), CHEER_MS);
return () => clearTimeout(timer);
@@ -21205,37 +21538,37 @@ function AboutPage({ useUpdate, actions, run: run2, Section, Row: Row3 }) {
const phase = update.phase ?? "idle";
const dsh = update.dsh;
const dshPhase = dsh?.phase ?? "idle";
- (0, import_react48.useEffect)(() => {
+ (0, import_react49.useEffect)(() => {
if (phase === "installed" || phase === "updated" || dshPhase === "installed") setCheer(true);
}, [phase, dshPhase]);
const markState = checking ? "searching" : phase === "installing" || dshPhase === "installing" ? "working" : cheer ? "done" : "idle";
const dshNew = showsDshRow(dsh, update.app);
const dshShown = dshNew && dsh.available;
const ownRow = update.source === "app" ? ownAppRow(update.ownApp) : null;
- const ownControl = ownRow?.button === "restart" ? (0, import_react48.createElement)("button", { type: "button", className: "bt-fb-primary", onClick: () => run2(actions.installOwnApp()) }, t("Restart to update")) : ownRow?.button === "check" ? (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.checkOwnApp()) }, t("Check for updates")) : ownRow?.button === "open" ? (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.openOwnApp()) }, t("Download")) : null;
- const botControl = ownRow !== null ? ownControl : phase === "installed" || phase === "updated" || update.source === "app" ? null : update.available || phase === "installing" ? (0, import_react48.createElement)(
+ const ownControl = ownRow?.button === "restart" ? (0, import_react49.createElement)("button", { type: "button", className: "bt-fb-primary", onClick: () => run2(actions.installOwnApp()) }, t("Restart to update")) : ownRow?.button === "check" ? (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.checkOwnApp()) }, t("Check for updates")) : ownRow?.button === "open" ? (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.openOwnApp()) }, t("Download")) : null;
+ const botControl = ownRow !== null ? ownControl : phase === "installed" || phase === "updated" || update.source === "app" ? null : update.available || phase === "installing" ? (0, import_react49.createElement)(
"button",
{ type: "button", className: "bt-fb-primary", disabled: phase === "installing", onClick: () => run2(actions.installUpdate()) },
phase === "installing" ? t("Updating…") : phase === "failed" ? t("Try again") : t("Update")
- ) : (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: checking || update.enabled === false, onClick: check }, checking ? t("Checking…") : t("Check for updates"));
- const dshControl = !dshNew || dshPhase === "installed" ? null : dsh.kind === "app" ? dsh.available ? (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.openAppUpdates(dsh.verified)) }, t("Open updates")) : null : dsh.available || dshPhase !== "idle" ? (0, import_react48.createElement)(
+ ) : (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: checking || update.enabled === false, onClick: check }, checking ? t("Checking…") : t("Check for updates"));
+ const dshControl = !dshNew || dshPhase === "installed" ? null : dsh.kind === "app" ? dsh.available ? (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.openAppUpdates(dsh.verified)) }, t("Open updates")) : null : dsh.available || dshPhase !== "idle" ? (0, import_react49.createElement)(
"button",
{ type: "button", className: "bt-fb-primary", disabled: dshPhase === "installing", onClick: () => run2(actions.installDshUpdate()) },
dshPhase === "installing" ? t("Updating…") : dshPhase === "failed" ? t("Try again") : t("Update")
) : null;
const repo = update.repoUrl;
return [
- (0, import_react48.createElement)(
+ (0, import_react49.createElement)(
"div",
{ key: "hero", className: "bt-about-hero" },
- (0, import_react48.createElement)("span", { className: "bt-about-mark" }, (0, import_react48.createElement)(BotMark, { look: MAIN_LOOK, bot: { id: "about" }, size: 52, state: markState, live: true, gaze: true, pokeable: true })),
- (0, import_react48.createElement)(
+ (0, import_react49.createElement)("span", { className: "bt-about-mark" }, (0, import_react49.createElement)(BotMark, { look: MAIN_LOOK, bot: { id: "about" }, size: 52, state: markState, live: true, gaze: true, pokeable: true })),
+ (0, import_react49.createElement)(
"div",
{ className: "bt-about-copy" },
- (0, import_react48.createElement)("span", { className: "bt-about-name" }, "DS Bot"),
- update.current ? (0, import_react48.createElement)("span", { className: "bt-about-version" }, t("Version {version}", { version: update.current })) : null
+ (0, import_react49.createElement)("span", { className: "bt-about-name" }, "DS Bot"),
+ update.current ? (0, import_react49.createElement)("span", { className: "bt-about-version" }, t("Version {version}", { version: update.current })) : null
),
- repo ? (0, import_react48.createElement)(
+ repo ? (0, import_react49.createElement)(
"a",
{
className: "bt-star",
@@ -21245,23 +21578,23 @@ function AboutPage({ useUpdate, actions, run: run2, Section, Row: Row3 }) {
title: t("Star DS Bot on GitHub"),
"aria-label": stars === null ? t("Star DS Bot on GitHub") : `${t("Star DS Bot on GitHub")} · ${t("{count} stars", { count: stars })}`
},
- (0, import_react48.createElement)("span", { className: "bt-star-main" }, (0, import_react48.createElement)("span", { className: "bt-star-icon" }, (0, import_react48.createElement)(StarLineIcon)), "Star"),
- stars === null ? null : (0, import_react48.createElement)("span", { className: "bt-star-count" }, starCount(stars))
+ (0, import_react49.createElement)("span", { className: "bt-star-main" }, (0, import_react49.createElement)("span", { className: "bt-star-icon" }, (0, import_react49.createElement)(StarLineIcon)), "Star"),
+ stars === null ? null : (0, import_react49.createElement)("span", { className: "bt-star-count" }, starCount(stars))
) : null
),
- repo ? (0, import_react48.createElement)("p", { key: "ask", className: "bt-about-ask" }, t("If DS Bot helps you, a star on GitHub helps more people find it.")) : null,
- (0, import_react48.createElement)(
- Section,
+ repo ? (0, import_react49.createElement)("p", { key: "ask", className: "bt-about-ask" }, t("If DS Bot helps you, a star on GitHub helps more people find it.")) : null,
+ (0, import_react49.createElement)(
+ Section2,
{ key: "updates", title: t("Updates") },
- (0, import_react48.createElement)(Row3, { label: "DS Bot", hint: ownRow?.hint ?? botHint(update) }, botControl, update.available && update.notesUrl ? (0, import_react48.createElement)("a", linkProps(update.notesUrl), t("What's new")) : null),
- dsh?.current ? (0, import_react48.createElement)(Row3, { label: "DeepSeek Harness", hint: dshHint(dsh, dshShown) }, dshControl) : null
+ (0, import_react49.createElement)(Row3, { label: "DS Bot", hint: ownRow?.hint ?? botHint(update) }, botControl, update.available && update.notesUrl ? (0, import_react49.createElement)("a", linkProps(update.notesUrl), t("What's new")) : null),
+ dsh?.current ? (0, import_react49.createElement)(Row3, { label: "DeepSeek Harness", hint: dshHint(dsh, dshShown) }, dshControl) : null
),
- (0, import_react48.createElement)(
- Section,
+ (0, import_react49.createElement)(
+ Section2,
{ key: "links", title: t("Links") },
- repo ? (0, import_react48.createElement)(Row3, { label: t("Source code"), hint: repo.replace(/^https:\/\//, "") }, (0, import_react48.createElement)("a", linkProps(repo), (0, import_react48.createElement)(GitHubMark), t("Open"))) : null,
- update.notesUrl ? (0, import_react48.createElement)(Row3, { label: t("Release notes") }, (0, import_react48.createElement)("a", linkProps(update.notesUrl), t("Open"))) : null,
- (0, import_react48.createElement)(Row3, { label: t("Report a problem") }, (0, import_react48.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => actions.openSettings("feedback") }, t("Open")))
+ repo ? (0, import_react49.createElement)(Row3, { label: t("Source code"), hint: repo.replace(/^https:\/\//, "") }, (0, import_react49.createElement)("a", linkProps(repo), (0, import_react49.createElement)(GitHubMark), t("Open"))) : null,
+ update.notesUrl ? (0, import_react49.createElement)(Row3, { label: t("Release notes") }, (0, import_react49.createElement)("a", linkProps(update.notesUrl), t("Open"))) : null,
+ (0, import_react49.createElement)(Row3, { label: t("Report a problem") }, (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => actions.openSettings("feedback") }, t("Open")))
)
];
}
@@ -21294,30 +21627,30 @@ body:not([data-bt-motion=quiet]) .bt-about-mark:hover .bt-mark[data-live][data-s
`;
// src/client/providers-page.js
-var import_react49 = require("react");
+var import_react50 = require("react");
var PROTOCOL_NAMES = { "openai-completions": "OpenAI Chat Completions", "openai-responses": "OpenAI Responses", "anthropic-messages": "Anthropic Messages" };
var ENDPOINT_HINTS = { "anthropic-messages": "https://gateway.example" };
var SHOWN_MODELS = 8;
var translated = (promise) => Promise.resolve(promise).catch((failure) => {
throw new Error(hostText(failure?.message ?? String(failure)));
});
-function ProvidersPage({ actions, run: run2, Section }) {
- const [view, setView] = (0, import_react49.useState)(null);
- const [open, setOpen] = (0, import_react49.useState)(null);
- const [adding, setAdding] = (0, import_react49.useState)(false);
+function ProvidersPage({ actions, run: run2, Section: Section2 }) {
+ const [view, setView] = (0, import_react50.useState)(null);
+ const [open, setOpen] = (0, import_react50.useState)(null);
+ const [adding, setAdding] = (0, import_react50.useState)(false);
const apply2 = (promise) => run2(translated(promise).then((next) => {
if (next?.providers) setView(next);
}));
- (0, import_react49.useEffect)(() => {
+ (0, import_react50.useEffect)(() => {
void apply2(actions.providers());
}, []);
if (view === null) return null;
- if (!view.available) return (0, import_react49.createElement)("p", { className: "bt-set-hint" }, t("This DSH cannot set up model providers."));
+ if (!view.available) return (0, import_react50.createElement)("p", { className: "bt-set-hint" }, t("This DSH cannot set up model providers."));
return [
- (0, import_react49.createElement)(
- Section,
+ (0, import_react50.createElement)(
+ Section2,
{ key: "list", title: t("Model providers · {count}", { count: view.providers.length }) },
- view.providers.map((provider) => (0, import_react49.createElement)(ProviderRow, {
+ view.providers.map((provider) => (0, import_react50.createElement)(ProviderRow, {
key: provider.id,
provider,
apply: apply2,
@@ -21325,9 +21658,9 @@ function ProvidersPage({ actions, run: run2, Section }) {
open: open === provider.id,
onToggle: () => setOpen(open === provider.id ? null : provider.id)
})),
- adding ? (0, import_react49.createElement)(AddProvider, { key: "add", view, apply: apply2, actions, onDone: () => setAdding(false) }) : null
+ adding ? (0, import_react50.createElement)(AddProvider, { key: "add", view, apply: apply2, actions, onDone: () => setAdding(false) }) : null
),
- adding ? null : (0, import_react49.createElement)("div", { key: "add", className: "bt-actions" }, (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setAdding(true) }, t("Add a provider")))
+ adding ? null : (0, import_react50.createElement)("div", { key: "add", className: "bt-actions" }, (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => setAdding(true) }, t("Add a provider")))
];
}
function keyState(key) {
@@ -21336,58 +21669,58 @@ function keyState(key) {
return key.writable ? ["set", t("Key set")] : ["outside", t("Key set outside DS Bot")];
}
function ProviderRow({ provider, apply: apply2, actions, open, onToggle }) {
- const [confirm, setConfirm] = (0, import_react49.useState)(false);
- (0, import_react49.useEffect)(() => {
+ const [confirm, setConfirm] = (0, import_react50.useState)(false);
+ (0, import_react50.useEffect)(() => {
if (!open) setConfirm(false);
}, [open]);
const state = keyState(provider.key);
const shown = provider.models.slice(0, SHOWN_MODELS);
const hint = provider.error ?? (provider.models.length === 0 ? t("No models") : t("{count} models", { count: provider.models.length }));
- return (0, import_react49.createElement)(
+ return (0, import_react50.createElement)(
"div",
{ className: "bt-secret-item bt-provider", "data-open": open ? "" : void 0 },
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)(
"button",
{ type: "button", className: "bt-set-row bt-secret-summary", "aria-expanded": open, onClick: onToggle },
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)(
"span",
{ className: "bt-set-copy" },
- (0, import_react49.createElement)("span", { className: "bt-secret-title" }, provider.name, provider.name !== provider.id ? (0, import_react49.createElement)("span", { className: "bt-provider-id" }, provider.id) : null),
- (0, import_react49.createElement)("span", { className: "bt-set-hint", "data-error": provider.error ? "" : void 0 }, hint)
+ (0, import_react50.createElement)("span", { className: "bt-secret-title" }, provider.name, provider.name !== provider.id ? (0, import_react50.createElement)("span", { className: "bt-provider-id" }, provider.id) : null),
+ (0, import_react50.createElement)("span", { className: "bt-set-hint", "data-error": provider.error ? "" : void 0 }, hint)
),
- state ? (0, import_react49.createElement)("span", { className: "bt-set-control" }, (0, import_react49.createElement)("span", { className: "bt-provider-state", "data-state": state[0] }, state[1])) : null
+ state ? (0, import_react50.createElement)("span", { className: "bt-set-control" }, (0, import_react50.createElement)("span", { className: "bt-provider-state", "data-state": state[0] }, state[1])) : null
),
- open ? (0, import_react49.createElement)(
+ open ? (0, import_react50.createElement)(
"div",
{ className: "bt-secret-edit" },
- provider.key?.writable ? (0, import_react49.createElement)(KeyEditor, { provider, apply: apply2, actions }) : null,
- provider.key && !provider.key.writable ? (0, import_react49.createElement)("div", { className: "bt-set-hint" }, t("This key comes from outside DS Bot, such as an environment variable, and cannot be changed here.")) : null,
- provider.models.length > 0 ? (0, import_react49.createElement)(
+ provider.key?.writable ? (0, import_react50.createElement)(KeyEditor, { provider, apply: apply2, actions }) : null,
+ provider.key && !provider.key.writable ? (0, import_react50.createElement)("div", { className: "bt-set-hint" }, t("This key comes from outside DS Bot, such as an environment variable, and cannot be changed here.")) : null,
+ provider.models.length > 0 ? (0, import_react50.createElement)(
"div",
{ className: "bt-secret-edit-block" },
- (0, import_react49.createElement)("div", { className: "bt-secret-edit-label" }, t("Models")),
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)("div", { className: "bt-secret-edit-label" }, t("Models")),
+ (0, import_react50.createElement)(
"div",
{ className: "bt-provider-models" },
- shown.map((model) => (0, import_react49.createElement)("span", { key: model.ref, className: "bt-tag", title: model.ref }, model.name)),
- provider.models.length > shown.length ? (0, import_react49.createElement)("span", { className: "bt-set-hint" }, t("and {count} more", { count: provider.models.length - shown.length })) : null
+ shown.map((model) => (0, import_react50.createElement)("span", { key: model.ref, className: "bt-tag", title: model.ref }, model.name)),
+ provider.models.length > shown.length ? (0, import_react50.createElement)("span", { className: "bt-set-hint" }, t("and {count} more", { count: provider.models.length - shown.length })) : null
)
) : null,
- provider.removable ? (0, import_react49.createElement)(
+ provider.removable ? (0, import_react50.createElement)(
"div",
{ className: "bt-secret-row-actions" },
confirm ? [
- (0, import_react49.createElement)("span", { key: "q", className: "bt-set-hint" }, t("Remove {name}? Bots on its models need another model.", { name: provider.name })),
- (0, import_react49.createElement)("button", { key: "no", type: "button", className: "bt-soft bt-soft-sm", onClick: () => setConfirm(false) }, t("Keep")),
- (0, import_react49.createElement)("button", { key: "yes", type: "button", className: "bt-soft bt-soft-sm bt-secret-danger", onClick: () => apply2(actions.removeProvider(provider.id)) }, t("Remove"))
- ] : (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-secret-danger", onClick: () => setConfirm(true) }, (0, import_react49.createElement)(TrashIcon), t("Remove provider"))
+ (0, import_react50.createElement)("span", { key: "q", className: "bt-set-hint" }, t("Remove {name}? Bots on its models need another model.", { name: provider.name })),
+ (0, import_react50.createElement)("button", { key: "no", type: "button", className: "bt-soft bt-soft-sm", onClick: () => setConfirm(false) }, t("Keep")),
+ (0, import_react50.createElement)("button", { key: "yes", type: "button", className: "bt-soft bt-soft-sm bt-secret-danger", onClick: () => apply2(actions.removeProvider(provider.id)) }, t("Remove"))
+ ] : (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-secret-danger", onClick: () => setConfirm(true) }, (0, import_react50.createElement)(TrashIcon), t("Remove provider"))
) : null
) : null
);
}
function KeyEditor({ provider, apply: apply2, actions }) {
- const [value, setValue] = (0, import_react49.useState)("");
- const [saved, setSaved] = (0, import_react49.useState)(false);
+ const [value, setValue] = (0, import_react50.useState)("");
+ const [saved, setSaved] = (0, import_react50.useState)(false);
const ready = value.trim() !== "";
const save = () => {
if (!ready) return;
@@ -21403,29 +21736,29 @@ function KeyEditor({ provider, apply: apply2, actions }) {
setSaved(false);
};
const label = t("{provider} API key", { provider: provider.name });
- return (0, import_react49.createElement)(
+ return (0, import_react50.createElement)(
"div",
{ className: "bt-secret-edit-block" },
- (0, import_react49.createElement)("div", { className: "bt-secret-edit-label" }, provider.key.configured ? t("Replace the API key") : t("API key")),
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)("div", { className: "bt-secret-edit-label" }, provider.key.configured ? t("Replace the API key") : t("API key")),
+ (0, import_react50.createElement)(
"div",
{ className: "bt-secret-inline" },
- (0, import_react49.createElement)("label", { className: "bt-q-field bt-secret-field" }, (0, import_react49.createElement)(KeyIcon), (0, import_react49.createElement)(MaskedInput, { value, onChange: edit, onEnter: save, label })),
- (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: !ready, onClick: save }, t("Save")),
- provider.key.configured ? (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-secret-danger", onClick: () => apply2(actions.setProviderKey(provider.id, null)) }, t("Remove key")) : null
+ (0, import_react50.createElement)("label", { className: "bt-q-field bt-secret-field" }, (0, import_react50.createElement)(KeyIcon), (0, import_react50.createElement)(MaskedInput, { value, onChange: edit, onEnter: save, label })),
+ (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: !ready, onClick: save }, t("Save")),
+ provider.key.configured ? (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-secret-danger", onClick: () => apply2(actions.setProviderKey(provider.id, null)) }, t("Remove key")) : null
),
- saved ? (0, import_react49.createElement)("div", { className: "bt-set-hint bt-secret-ok", role: "status" }, (0, import_react49.createElement)(CheckIcon), t("Saved.")) : null
+ saved ? (0, import_react50.createElement)("div", { className: "bt-set-hint bt-secret-ok", role: "status" }, (0, import_react50.createElement)(CheckIcon), t("Saved.")) : null
);
}
function AddProvider({ view, apply: apply2, actions, onDone }) {
- const [mode, setMode] = (0, import_react49.useState)(view.addable.length > 0 ? "known" : "custom");
- return (0, import_react49.createElement)(
+ const [mode, setMode] = (0, import_react50.useState)(view.addable.length > 0 ? "known" : "custom");
+ return (0, import_react50.createElement)(
"div",
{ className: "bt-set-row bt-set-paste bt-provider-add" },
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)(
Segmented,
{ label: t("Kind of provider"), value: mode },
- [["known", t("Known provider")], ["custom", t("Custom API")]].map(([id, label]) => (0, import_react49.createElement)("button", {
+ [["known", t("Known provider")], ["custom", t("Custom API")]].map(([id, label]) => (0, import_react50.createElement)("button", {
key: id,
type: "button",
"aria-pressed": mode === id,
@@ -21434,13 +21767,13 @@ function AddProvider({ view, apply: apply2, actions, onDone }) {
}, label))
),
// Both forms stay mounted, so switching keeps what is typed in the other.
- (0, import_react49.createElement)("div", { hidden: mode !== "known" }, (0, import_react49.createElement)(KnownForm, { view, apply: apply2, actions, onDone })),
- (0, import_react49.createElement)("div", { hidden: mode !== "custom" }, (0, import_react49.createElement)(CustomForm, { view, apply: apply2, actions, onDone }))
+ (0, import_react50.createElement)("div", { hidden: mode !== "known" }, (0, import_react50.createElement)(KnownForm, { view, apply: apply2, actions, onDone })),
+ (0, import_react50.createElement)("div", { hidden: mode !== "custom" }, (0, import_react50.createElement)(CustomForm, { view, apply: apply2, actions, onDone }))
);
}
function KnownForm({ view, apply: apply2, actions, onDone }) {
- const [provider, setProvider] = (0, import_react49.useState)("");
- const [key, setKey] = (0, import_react49.useState)("");
+ const [provider, setProvider] = (0, import_react50.useState)("");
+ const [key, setKey] = (0, import_react50.useState)("");
const options = [...view.addable].sort((a, b) => a.name.localeCompare(b.name));
const add = () => {
if (provider === "") return;
@@ -21448,24 +21781,24 @@ function KnownForm({ view, apply: apply2, actions, onDone }) {
if (ok) onDone();
});
};
- return (0, import_react49.createElement)(
+ return (0, import_react50.createElement)(
"div",
{ className: "bt-provider-form" },
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)(
"select",
{ className: "bt-select", "aria-label": t("Provider"), value: provider, onChange: (event) => setProvider(event.target.value) },
- (0, import_react49.createElement)("option", { value: "", disabled: true }, t("Choose a provider")),
- options.map((option) => (0, import_react49.createElement)("option", { key: option.id, value: option.id }, option.name))
+ (0, import_react50.createElement)("option", { value: "", disabled: true }, t("Choose a provider")),
+ options.map((option) => (0, import_react50.createElement)("option", { key: option.id, value: option.id }, option.name))
),
- (0, import_react49.createElement)("label", { className: "bt-q-field bt-secret-field" }, (0, import_react49.createElement)(KeyIcon), (0, import_react49.createElement)(MaskedInput, { value: key, onChange: setKey, onEnter: add, label: t("API key") })),
- (0, import_react49.createElement)(FormActions, { onCancel: onDone, onAdd: add, ready: provider !== "" })
+ (0, import_react50.createElement)("label", { className: "bt-q-field bt-secret-field" }, (0, import_react50.createElement)(KeyIcon), (0, import_react50.createElement)(MaskedInput, { value: key, onChange: setKey, onEnter: add, label: t("API key") })),
+ (0, import_react50.createElement)(FormActions, { onCancel: onDone, onAdd: add, ready: provider !== "" })
);
}
function CustomForm({ view, apply: apply2, actions, onDone }) {
- const [draft, setDraft] = (0, import_react49.useState)({ provider: "", name: "", baseURL: "", api: view.protocols[0], key: "", typed: "" });
- const [found, setFound] = (0, import_react49.useState)(null);
- const [picked, setPicked] = (0, import_react49.useState)([]);
- const [asking, setAsking] = (0, import_react49.useState)(false);
+ const [draft, setDraft] = (0, import_react50.useState)({ provider: "", name: "", baseURL: "", api: view.protocols[0], key: "", typed: "" });
+ const [found, setFound] = (0, import_react50.useState)(null);
+ const [picked, setPicked] = (0, import_react50.useState)([]);
+ const [asking, setAsking] = (0, import_react50.useState)(false);
const set = (field, value) => setDraft((current) => ({ ...current, [field]: value }));
const typed = draft.typed.split(/[\s,]+/).map((id) => id.trim()).filter(Boolean);
const models = [...(found ?? []).filter((model) => picked.includes(model.id)), ...typed.filter((id) => !picked.includes(id)).map((id) => ({ id }))];
@@ -21484,7 +21817,7 @@ function CustomForm({ view, apply: apply2, actions, onDone }) {
if (ok) onDone();
});
};
- const input = (field, label, placeholder) => (0, import_react49.createElement)("input", {
+ const input = (field, label, placeholder) => (0, import_react50.createElement)("input", {
className: "bt-input",
"aria-label": label,
placeholder,
@@ -21493,55 +21826,55 @@ function CustomForm({ view, apply: apply2, actions, onDone }) {
autoComplete: "off",
onChange: (event) => set(field, event.target.value)
});
- return (0, import_react49.createElement)(
+ return (0, import_react50.createElement)(
"div",
{ className: "bt-provider-form" },
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)(
"div",
{ className: "bt-provider-pair" },
input("provider", t("Provider ID"), t("Provider ID, e.g. my-gateway")),
input("name", t("Name"), t("Name (optional)"))
),
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)(
"div",
{ className: "bt-provider-pair" },
input("baseURL", t("Endpoint"), ENDPOINT_HINTS[draft.api] ?? "https://gateway.example/v1"),
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)(
"select",
{ className: "bt-select", "aria-label": t("Protocol"), value: draft.api, onChange: (event) => set("api", event.target.value) },
- view.protocols.map((api) => (0, import_react49.createElement)("option", { key: api, value: api }, PROTOCOL_NAMES[api] ?? api))
+ view.protocols.map((api) => (0, import_react50.createElement)("option", { key: api, value: api }, PROTOCOL_NAMES[api] ?? api))
)
),
- (0, import_react49.createElement)("label", { className: "bt-q-field bt-secret-field" }, (0, import_react49.createElement)(KeyIcon), (0, import_react49.createElement)(MaskedInput, { value: draft.key, onChange: (value) => set("key", value), label: t("API key") })),
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)("label", { className: "bt-q-field bt-secret-field" }, (0, import_react50.createElement)(KeyIcon), (0, import_react50.createElement)(MaskedInput, { value: draft.key, onChange: (value) => set("key", value), label: t("API key") })),
+ (0, import_react50.createElement)(
"div",
{ className: "bt-secret-edit-block" },
- (0, import_react49.createElement)(
+ (0, import_react50.createElement)(
"div",
{ className: "bt-provider-models-head" },
- (0, import_react49.createElement)("span", { className: "bt-secret-edit-label" }, t("Models")),
- (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: asking || draft.baseURL.trim() === "", onClick: fetchModels }, asking ? t("Asking…") : t("Fetch models"))
+ (0, import_react50.createElement)("span", { className: "bt-secret-edit-label" }, t("Models")),
+ (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: asking || draft.baseURL.trim() === "", onClick: fetchModels }, asking ? t("Asking…") : t("Fetch models"))
),
- found !== null && found.length === 0 ? (0, import_react49.createElement)("div", { className: "bt-set-hint" }, t("The endpoint lists no models. Enter their ids below.")) : null,
- found !== null && found.length > 0 ? (0, import_react49.createElement)("div", { className: "bt-secret-bots bt-provider-found" }, found.map((model) => (0, import_react49.createElement)("button", {
+ found !== null && found.length === 0 ? (0, import_react50.createElement)("div", { className: "bt-set-hint" }, t("The endpoint lists no models. Enter their ids below.")) : null,
+ found !== null && found.length > 0 ? (0, import_react50.createElement)("div", { className: "bt-secret-bots bt-provider-found" }, found.map((model) => (0, import_react50.createElement)("button", {
key: model.id,
type: "button",
className: "bt-secret-bot",
"aria-pressed": picked.includes(model.id),
title: model.name && model.name !== model.id ? model.name : void 0,
onClick: () => toggle(model.id)
- }, (0, import_react49.createElement)("code", null, model.id), picked.includes(model.id) ? (0, import_react49.createElement)(CheckIcon) : null))) : null,
+ }, (0, import_react50.createElement)("code", null, model.id), picked.includes(model.id) ? (0, import_react50.createElement)(CheckIcon) : null))) : null,
input("typed", t("Model ids"), t("Model ids, separated by commas"))
),
- (0, import_react49.createElement)(FormActions, { onCancel: onDone, onAdd: add, ready })
+ (0, import_react50.createElement)(FormActions, { onCancel: onDone, onAdd: add, ready })
);
}
function FormActions({ onCancel, onAdd, ready }) {
- return (0, import_react49.createElement)(
+ return (0, import_react50.createElement)(
"div",
{ className: "bt-secret-row-actions" },
- (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onCancel }, t("Cancel")),
- (0, import_react49.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: !ready, onClick: onAdd }, t("Add"))
+ (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: onCancel }, t("Cancel")),
+ (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: !ready, onClick: onAdd }, t("Add"))
);
}
var PROVIDERS_CSS = `
@@ -21572,24 +21905,24 @@ var PROVIDERS_CSS = `
`;
// src/client/settings.js
-var import_react50 = require("react");
+var import_react51 = require("react");
var capitalize2 = (word) => word[0].toUpperCase() + word.slice(1);
var SETTINGS_PAGES = [["general", "General"], ["models", "Models"], ["bots", "Bots"], ["groups", "Group chats"], ["connectors", "Connectors"], ["im", "IM"], ["capabilities", "Capabilities"], ["browser", "Browser"], ["schedules", "Scheduled tasks"], ["usage", "Usage"], ["secrets", "Secrets"], ["feedback", "Feedback"], ["about", "About DS Bot"]];
var PAGE_ICONS = { ...SETTINGS_ICONS, models: SlidersIcon, connectors: ConnectorIcon, im: ChatsIcon, capabilities: PlugIcon, browser: GlobeIcon, schedules: ClockIcon, secrets: KeyIcon, feedback: FeedbackIcon, about: InfoIcon };
function SetSection({ title, className = "", children }) {
- return (0, import_react50.createElement)("section", { className: `bt-set-section ${className}`.trim() }, (0, import_react50.createElement)("h3", null, title), (0, import_react50.createElement)("div", { className: "bt-set-card" }, children));
+ return (0, import_react51.createElement)("section", { className: `bt-set-section ${className}`.trim() }, (0, import_react51.createElement)("h3", null, title), (0, import_react51.createElement)("div", { className: "bt-set-card" }, children));
}
function SetRow({ label, hint, children, className = "" }) {
- return (0, import_react50.createElement)(
+ return (0, import_react51.createElement)(
"div",
{ className: `bt-set-row ${className}`.trim() },
- (0, import_react50.createElement)("div", { className: "bt-set-copy" }, (0, import_react50.createElement)("span", null, label), hint ? (0, import_react50.createElement)("span", { className: "bt-set-hint" }, hint) : null),
- children ? (0, import_react50.createElement)("div", { className: "bt-set-control" }, children) : null
+ (0, import_react51.createElement)("div", { className: "bt-set-copy" }, (0, import_react51.createElement)("span", null, label), hint ? (0, import_react51.createElement)("span", { className: "bt-set-hint" }, hint) : null),
+ children ? (0, import_react51.createElement)("div", { className: "bt-set-control" }, children) : null
);
}
var LAYOUTS = [["bubble", "Bubble"], ["flat", "Flat"]];
function Choice({ label, value, options, pick: pick2 }) {
- return (0, import_react50.createElement)(Segmented, { label, value, className: "bt-look-seg" }, options.map(([id, text]) => (0, import_react50.createElement)("button", {
+ return (0, import_react51.createElement)(Segmented, { label, value, className: "bt-look-seg" }, options.map(([id, text]) => (0, import_react51.createElement)("button", {
key: id,
type: "button",
"aria-pressed": value === id,
@@ -21599,12 +21932,12 @@ function Choice({ label, value, options, pick: pick2 }) {
}, t(text))));
}
function WidthSlider({ label, value, save }) {
- const [width, setWidth] = (0, import_react50.useState)(value);
- const pending = (0, import_react50.useRef)(null);
- const timer = (0, import_react50.useRef)(0);
- const saveRef = (0, import_react50.useRef)(save);
+ const [width, setWidth] = (0, import_react51.useState)(value);
+ const pending = (0, import_react51.useRef)(null);
+ const timer = (0, import_react51.useRef)(0);
+ const saveRef = (0, import_react51.useRef)(save);
saveRef.current = save;
- (0, import_react50.useEffect)(() => {
+ (0, import_react51.useEffect)(() => {
if (pending.current === null) setWidth(value);
}, [value]);
const flush = () => {
@@ -21612,7 +21945,7 @@ function WidthSlider({ label, value, save }) {
pending.current = null;
if (next !== null) saveRef.current(next);
};
- (0, import_react50.useEffect)(() => () => {
+ (0, import_react51.useEffect)(() => () => {
clearTimeout(timer.current);
flush();
}, []);
@@ -21623,46 +21956,46 @@ function WidthSlider({ label, value, save }) {
timer.current = setTimeout(flush, 350);
};
const { min, max, step } = MESSAGE_WIDTH;
- return (0, import_react50.createElement)(
+ return (0, import_react51.createElement)(
"div",
{ className: "bt-range", style: { "--bt-fill": `${(width - min) / (max - min) * 100}%` } },
- (0, import_react50.createElement)("input", { type: "range", min, max, step, value: width, "aria-label": label, "aria-valuetext": `${width}%`, onChange: (event) => pick2(Number(event.target.value)) }),
- (0, import_react50.createElement)("output", null, `${width}%`)
+ (0, import_react51.createElement)("input", { type: "range", min, max, step, value: width, "aria-label": label, "aria-valuetext": `${width}%`, onChange: (event) => pick2(Number(event.target.value)) }),
+ (0, import_react51.createElement)("output", null, `${width}%`)
);
}
function GeneralPage({ roster, actions, run: run2 }) {
const prefs = roster.prefs ?? {};
const themes = allThemes();
const current = themes[prefs.theme] ? prefs.theme : "deepseek";
- const [custom, setCustom] = (0, import_react50.useState)(prefs.accent ?? "#4d6bfe");
- const timer = (0, import_react50.useRef)(0);
- (0, import_react50.useEffect)(() => () => clearTimeout(timer.current), []);
+ const [custom, setCustom] = (0, import_react51.useState)(prefs.accent ?? "#4d6bfe");
+ const timer = (0, import_react51.useRef)(0);
+ (0, import_react51.useEffect)(() => () => clearTimeout(timer.current), []);
const pickCustom = (value) => {
setCustom(value);
clearTimeout(timer.current);
timer.current = setTimeout(() => run2(actions.setPrefs({ accent: value })), 350);
};
return [
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetSection,
{ key: "look", title: t("Appearance") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetRow,
{ label: t("Theme"), hint: t("Colors for the whole team, on every device.") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
"select",
{ className: "bt-select", "aria-label": t("Theme"), value: current, onChange: (event) => run2(actions.setPrefs({ theme: event.target.value })) },
- Object.entries(themes).map(([id, theme]) => (0, import_react50.createElement)("option", { key: id, value: id }, t(theme.label)))
+ Object.entries(themes).map(([id, theme]) => (0, import_react51.createElement)("option", { key: id, value: id }, t(theme.label)))
)
),
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetRow,
{ label: t("Accent"), hint: t("Unread marks, badges, and the brand mark.") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
"div",
{ className: "bt-swatches" },
- (0, import_react50.createElement)("button", { type: "button", className: "bt-swatch bt-swatch-default", title: t("Theme accent"), "aria-label": t("Theme accent"), "aria-pressed": !prefs.accent, onClick: () => run2(actions.setPrefs({ accent: null })) }),
- ACCENT_INKS.map((ink) => (0, import_react50.createElement)("button", {
+ (0, import_react51.createElement)("button", { type: "button", className: "bt-swatch bt-swatch-default", title: t("Theme accent"), "aria-label": t("Theme accent"), "aria-pressed": !prefs.accent, onClick: () => run2(actions.setPrefs({ accent: null })) }),
+ ACCENT_INKS.map((ink) => (0, import_react51.createElement)("button", {
key: ink,
type: "button",
className: "bt-swatch",
@@ -21672,26 +22005,26 @@ function GeneralPage({ roster, actions, run: run2 }) {
style: { background: INKS[ink][0] },
onClick: () => run2(actions.setPrefs({ accent: INKS[ink][0] }))
})),
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
"label",
{ className: "bt-swatch bt-swatch-custom", title: t("Custom accent"), "data-on": Boolean(prefs.accent) && !ACCENT_INKS.some((ink) => INKS[ink][0] === prefs.accent) },
- (0, import_react50.createElement)("input", { type: "color", value: custom, "aria-label": t("Custom accent"), onChange: (event) => pickCustom(event.target.value) })
+ (0, import_react51.createElement)("input", { type: "color", value: custom, "aria-label": t("Custom accent"), onChange: (event) => pickCustom(event.target.value) })
)
)
),
- (0, import_react50.createElement)(SetRow, { label: t("Message layout") }, (0, import_react50.createElement)(Choice, { label: t("Message layout"), value: layoutOf(prefs), options: LAYOUTS, pick: (id) => run2(actions.setPrefs({ layout: id })) })),
+ (0, import_react51.createElement)(SetRow, { label: t("Message layout") }, (0, import_react51.createElement)(Choice, { label: t("Message layout"), value: layoutOf(prefs), options: LAYOUTS, pick: (id) => run2(actions.setPrefs({ layout: id })) })),
// The flat layout's text has a width of its own; the bubble width stays for the user's messages.
- layoutOf(prefs) === "flat" ? (0, import_react50.createElement)(SetRow, { label: t("Text width") }, (0, import_react50.createElement)(WidthSlider, { label: t("Text width"), value: flatWidthOf(prefs), save: (flatWidth) => run2(actions.setPrefs({ flatWidth })) })) : null,
- (0, import_react50.createElement)(SetRow, { label: t("Bubble width") }, (0, import_react50.createElement)(WidthSlider, { label: t("Bubble width"), value: widthOf(prefs), save: (width) => run2(actions.setPrefs({ width })) })),
- (0, import_react50.createElement)(SetRow, { label: t("Show thinking") }, (0, import_react50.createElement)(Switch, { label: t("Show thinking"), on: thinkingShown(prefs), onChange: (thinking) => run2(actions.setPrefs({ thinking })) }))
+ layoutOf(prefs) === "flat" ? (0, import_react51.createElement)(SetRow, { label: t("Text width") }, (0, import_react51.createElement)(WidthSlider, { label: t("Text width"), value: flatWidthOf(prefs), save: (flatWidth) => run2(actions.setPrefs({ flatWidth })) })) : null,
+ (0, import_react51.createElement)(SetRow, { label: t("Bubble width") }, (0, import_react51.createElement)(WidthSlider, { label: t("Bubble width"), value: widthOf(prefs), save: (width) => run2(actions.setPrefs({ width })) })),
+ (0, import_react51.createElement)(SetRow, { label: t("Show thinking") }, (0, import_react51.createElement)(Switch, { label: t("Show thinking"), on: thinkingShown(prefs), onChange: (thinking) => run2(actions.setPrefs({ thinking })) }))
),
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetSection,
{ key: "new", title: t("New Bots") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetRow,
{ label: t("Default model"), className: "bt-set-model" },
- (0, import_react50.createElement)(ModelMenu, {
+ (0, import_react51.createElement)(ModelMenu, {
bot: { id: "new-bots", name: t("New Bots"), model: prefs.defaultBotModel },
roster,
actions,
@@ -21700,37 +22033,37 @@ function GeneralPage({ roster, actions, run: run2 }) {
withEfforts: false,
onPick: (ref) => run2(actions.setPrefs({ defaultBotModel: ref }))
}),
- prefs.defaultBotModel ? (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.setPrefs({ defaultBotModel: null })) }, t("Reset")) : null
+ prefs.defaultBotModel ? (0, import_react51.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.setPrefs({ defaultBotModel: null })) }, t("Reset")) : null
)
),
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetSection,
{ key: "input", title: t("Input") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetRow,
{ label: t("Enter sends message") },
- (0, import_react50.createElement)(Switch, { label: t("Enter sends message"), on: prefs.enterToSend !== false, onChange: (enterToSend) => run2(actions.setPrefs({ enterToSend })) })
+ (0, import_react51.createElement)(Switch, { label: t("Enter sends message"), on: prefs.enterToSend !== false, onChange: (enterToSend) => run2(actions.setPrefs({ enterToSend })) })
)
),
- actions.setSurface ? (0, import_react50.createElement)(
+ actions.setSurface ? (0, import_react51.createElement)(
SetSection,
{ key: "mode", title: t("Mode") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetRow,
{ label: t("Classic Agent mode") },
- (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => actions.setSurface("agent") }, t("Switch"))
+ (0, import_react51.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => actions.setSurface("agent") }, t("Switch"))
)
) : null,
- (0, import_react50.createElement)(LocationsSection, { key: "places", actions, run: run2 })
+ (0, import_react51.createElement)(LocationsSection, { key: "places", actions, run: run2 })
];
}
function LocationsSection({ actions, run: run2 }) {
const app = globalThis.dsBotApp;
- const [team, setTeam] = (0, import_react50.useState)(null);
- const [data, setData] = (0, import_react50.useState)(null);
- const [moving, setMoving] = (0, import_react50.useState)(false);
- const busy = (0, import_react50.useRef)(false);
- (0, import_react50.useEffect)(() => {
+ const [team, setTeam] = (0, import_react51.useState)(null);
+ const [data, setData] = (0, import_react51.useState)(null);
+ const [moving, setMoving] = (0, import_react51.useState)(false);
+ const busy = (0, import_react51.useRef)(false);
+ (0, import_react51.useEffect)(() => {
void Promise.resolve(actions.folders()).then((info) => setTeam(info?.team ?? null)).catch(() => {
});
if (app !== void 0) void Promise.resolve(app.dataLocation()).then(setData).catch(() => {
@@ -21748,18 +22081,18 @@ function LocationsSection({ actions, run: run2 }) {
setMoving(false);
}));
};
- return (0, import_react50.createElement)(
+ return (0, import_react51.createElement)(
SetSection,
{ title: t("Locations"), className: "bt-set-places" },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetRow,
{ label: t("Team workspace"), hint: t("Where Bots without a folder of their own work.") },
- team === null ? null : (0, import_react50.createElement)(FolderMenu, { value: team, team: true, actions, run: run2, onPick: pickTeam, disabled: moving })
+ team === null ? null : (0, import_react51.createElement)(FolderMenu, { value: team, team: true, actions, run: run2, onPick: pickTeam, disabled: moving })
),
- data === null ? null : (0, import_react50.createElement)(
+ data === null ? null : (0, import_react51.createElement)(
SetRow,
{ label: t("Data location"), hint: data.path },
- data.fixed ? null : (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: moving, onClick: () => {
+ data.fixed ? null : (0, import_react51.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: moving, onClick: () => {
if (!busy.current) void run2(app.moveData(team ?? void 0));
} }, t("Change…"))
)
@@ -21769,52 +22102,52 @@ function MainBotsSection({ roster, actions, run: run2 }) {
const mains = (roster.mainBotIds ?? []).map((id) => roster.byId[id]).filter(Boolean);
const [first, ...others] = mains;
const candidates = roster.bots.filter((bot) => !isMainOf(roster, bot.id));
- return (0, import_react50.createElement)(
+ return (0, import_react51.createElement)(
SetSection,
{ title: t("Main Bot") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetRow,
{
label: t("Main Bot"),
hint: first ? t("First in the sidebar. Pick another Bot to hand it the role; {name} then stops being a Main Bot.", { name: first.name }) : void 0
},
- (0, import_react50.createElement)("select", {
+ (0, import_react51.createElement)("select", {
className: "bt-select",
"aria-label": t("Main Bot"),
value: first?.id ?? "",
onChange: (event) => run2(actions.setMain(event.target.value, true, first ? { replace: first.id } : {}))
- }, first ? null : (0, import_react50.createElement)("option", { value: "" }, t("Choose a Bot…")), roster.bots.map((bot) => (0, import_react50.createElement)("option", { key: bot.id, value: bot.id }, bot.name)))
+ }, first ? null : (0, import_react51.createElement)("option", { value: "" }, t("Choose a Bot…")), roster.bots.map((bot) => (0, import_react51.createElement)("option", { key: bot.id, value: bot.id }, bot.name)))
),
- others.map((bot) => (0, import_react50.createElement)(
+ others.map((bot) => (0, import_react51.createElement)(
SetRow,
{ key: bot.id, label: bot.name, hint: t("Also a Main Bot.") },
- (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.setMain(bot.id, true, { primary: true })) }, t("Move to first")),
- (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.setMain(bot.id, false)) }, t("Remove Main Bot role"))
+ (0, import_react51.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.setMain(bot.id, true, { primary: true })) }, t("Move to first")),
+ (0, import_react51.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(actions.setMain(bot.id, false)) }, t("Remove Main Bot role"))
)),
- candidates.length > 0 ? (0, import_react50.createElement)(
+ candidates.length > 0 ? (0, import_react51.createElement)(
SetRow,
{ label: t("Add a Main Bot"), hint: t("Main Bots can create and change Bots, and run every group chat.") },
- (0, import_react50.createElement)("select", {
+ (0, import_react51.createElement)("select", {
className: "bt-select",
"aria-label": t("Add a Main Bot"),
value: "",
onChange: (event) => {
if (event.target.value) void run2(actions.setMain(event.target.value, true));
}
- }, (0, import_react50.createElement)("option", { value: "" }, t("Choose a Bot…")), candidates.map((bot) => (0, import_react50.createElement)("option", { key: bot.id, value: bot.id }, bot.name)))
+ }, (0, import_react51.createElement)("option", { value: "" }, t("Choose a Bot…")), candidates.map((bot) => (0, import_react51.createElement)("option", { key: bot.id, value: bot.id }, bot.name)))
) : null
);
}
var MOTIONS = [["quiet", "Quiet"], ["normal", "Normal"], ["lively", "Lively"]];
function MotionSection({ roster, actions, run: run2 }) {
const motion = roster.prefs?.motion === "quiet" || roster.prefs?.motion === "lively" ? roster.prefs.motion : "normal";
- return (0, import_react50.createElement)(
+ return (0, import_react51.createElement)(
SetSection,
{ title: t("Animation") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetRow,
{ label: t("Bot animation") },
- (0, import_react50.createElement)(Segmented, { label: t("Bot animation"), value: motion, className: "bt-motion-seg" }, MOTIONS.map(([id, label]) => (0, import_react50.createElement)("button", {
+ (0, import_react51.createElement)(Segmented, { label: t("Bot animation"), value: motion, className: "bt-motion-seg" }, MOTIONS.map(([id, label]) => (0, import_react51.createElement)("button", {
key: id,
type: "button",
"aria-pressed": motion === id,
@@ -21826,70 +22159,70 @@ function MotionSection({ roster, actions, run: run2 }) {
);
}
function BotsPage({ roster, actions, run: run2 }) {
- const [creating, setCreating] = (0, import_react50.useState)(false);
+ const [creating, setCreating] = (0, import_react51.useState)(false);
return [
- (0, import_react50.createElement)(MainBotsSection, { key: "main", roster, actions, run: run2 }),
- (0, import_react50.createElement)(MotionSection, { key: "motion", roster, actions, run: run2 }),
- creating ? (0, import_react50.createElement)(CreateBot, { key: "create", roster, actions, inline: true, onBack: () => setCreating(false), onCreated: (bot) => actions.openSettings("bots", bot.id) }) : (0, import_react50.createElement)(
+ (0, import_react51.createElement)(MainBotsSection, { key: "main", roster, actions, run: run2 }),
+ (0, import_react51.createElement)(MotionSection, { key: "motion", roster, actions, run: run2 }),
+ creating ? (0, import_react51.createElement)(CreateBot, { key: "create", roster, actions, inline: true, onBack: () => setCreating(false), onCreated: (bot) => actions.openSettings("bots", bot.id) }) : (0, import_react51.createElement)(
"div",
{ key: "new", className: "bt-actions" },
- (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-with-icon", onClick: () => setCreating(true) }, (0, import_react50.createElement)(PlusIcon), t("New Bot"))
+ (0, import_react51.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-with-icon", onClick: () => setCreating(true) }, (0, import_react51.createElement)(PlusIcon), t("New Bot"))
),
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetSection,
{ key: "bots", title: t("Bots · {count}", { count: roster.bots.length }) },
- roster.bots.map((bot) => (0, import_react50.createElement)(
+ roster.bots.map((bot) => (0, import_react51.createElement)(
"button",
{ key: bot.id, type: "button", className: "bt-set-row", onClick: () => actions.openSettings("bots", bot.id) },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
"span",
{ className: "bt-set-bot" },
- (0, import_react50.createElement)(BotAvatar, { bot, size: 28, badge: false, live: false }),
- (0, import_react50.createElement)("span", { className: "bt-row-title" }, bot.name),
- bot.role ? (0, import_react50.createElement)("span", { className: "bt-tag" }, bot.role) : null,
- isMainOf(roster, bot.id) ? (0, import_react50.createElement)("span", { className: "bt-tag" }, t("Main Bot")) : null,
- bot.hidden && !isMainOf(roster, bot.id) ? (0, import_react50.createElement)("span", { className: "bt-tag" }, t("Hidden")) : null
+ (0, import_react51.createElement)(BotAvatar, { bot, size: 28, badge: false, live: false }),
+ (0, import_react51.createElement)("span", { className: "bt-row-title" }, bot.name),
+ bot.role ? (0, import_react51.createElement)("span", { className: "bt-tag" }, bot.role) : null,
+ isMainOf(roster, bot.id) ? (0, import_react51.createElement)("span", { className: "bt-tag" }, t("Main Bot")) : null,
+ bot.hidden && !isMainOf(roster, bot.id) ? (0, import_react51.createElement)("span", { className: "bt-tag" }, t("Hidden")) : null
),
- (0, import_react50.createElement)("span", { className: "bt-chevron" }, (0, import_react50.createElement)(ChevronRightIcon))
+ (0, import_react51.createElement)("span", { className: "bt-chevron" }, (0, import_react51.createElement)(ChevronRightIcon))
))
),
- (0, import_react50.createElement)(KeptPrivateSection, { key: "kept", roster, actions, run: run2, Section: SetSection, Row: SetRow })
+ (0, import_react51.createElement)(KeptPrivateSection, { key: "kept", roster, actions, run: run2, Section: SetSection, Row: SetRow })
];
}
function GroupsPage({ roster, actions, run: run2 }) {
- const [creating, setCreating] = (0, import_react50.useState)(false);
+ const [creating, setCreating] = (0, import_react51.useState)(false);
return [
- creating ? (0, import_react50.createElement)(NewGroupForm, { key: "create", roster, actions, run: run2, onCancel: () => setCreating(false), onCreated: (room2) => actions.openSettings("groups", room2.id) }) : (0, import_react50.createElement)(
+ creating ? (0, import_react51.createElement)(NewGroupForm, { key: "create", roster, actions, run: run2, onCancel: () => setCreating(false), onCreated: (room2) => actions.openSettings("groups", room2.id) }) : (0, import_react51.createElement)(
"div",
{ key: "new", className: "bt-actions" },
- (0, import_react50.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-with-icon", disabled: roster.bots.length < 2, title: roster.bots.length < 2 ? t("A group chat needs at least two Bots") : void 0, onClick: () => setCreating(true) }, (0, import_react50.createElement)(PlusIcon), t("Create group chat"))
+ (0, import_react51.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm bt-with-icon", disabled: roster.bots.length < 2, title: roster.bots.length < 2 ? t("A group chat needs at least two Bots") : void 0, onClick: () => setCreating(true) }, (0, import_react51.createElement)(PlusIcon), t("Create group chat"))
),
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
SetSection,
{ key: "groups", title: t("Group chats · {count}", { count: roster.rooms.length }) },
- roster.rooms.length === 0 ? (0, import_react50.createElement)(SetRow, { label: t("No group chats yet."), hint: t("A group chat lets several Bots work on one thing with you.") }) : roster.rooms.map((room2) => {
+ roster.rooms.length === 0 ? (0, import_react51.createElement)(SetRow, { label: t("No group chats yet."), hint: t("A group chat lets several Bots work on one thing with you.") }) : roster.rooms.map((room2) => {
const admin = roster.byId[room2.admin];
- return (0, import_react50.createElement)(
+ return (0, import_react51.createElement)(
"button",
{ key: room2.id, type: "button", className: "bt-set-row", onClick: () => actions.openSettings("groups", room2.id) },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
"span",
{ className: "bt-set-bot" },
- (0, import_react50.createElement)(RoomAvatar, { room: room2, roster, size: 28 }),
- (0, import_react50.createElement)("span", { className: "bt-row-title" }, room2.name),
- (0, import_react50.createElement)("span", { className: "bt-tag" }, t("{count} members", { count: room2.members.length })),
- admin ? (0, import_react50.createElement)("span", { className: "bt-tag bt-tag-admin" }, (0, import_react50.createElement)(AdminStar), admin.name) : null,
- room2.hidden ? (0, import_react50.createElement)("span", { className: "bt-tag" }, t("Hidden")) : null
+ (0, import_react51.createElement)(RoomAvatar, { room: room2, roster, size: 28 }),
+ (0, import_react51.createElement)("span", { className: "bt-row-title" }, room2.name),
+ (0, import_react51.createElement)("span", { className: "bt-tag" }, t("{count} members", { count: room2.members.length })),
+ admin ? (0, import_react51.createElement)("span", { className: "bt-tag bt-tag-admin" }, (0, import_react51.createElement)(AdminStar), admin.name) : null,
+ room2.hidden ? (0, import_react51.createElement)("span", { className: "bt-tag" }, t("Hidden")) : null
),
- (0, import_react50.createElement)("span", { className: "bt-chevron" }, (0, import_react50.createElement)(ChevronRightIcon))
+ (0, import_react51.createElement)("span", { className: "bt-chevron" }, (0, import_react51.createElement)(ChevronRightIcon))
);
})
)
];
}
function SettingsDialog({ page, id, roster, actions, useUpdate, leaving = false }) {
- const [error, setError] = (0, import_react50.useState)("");
- const close = (0, import_react50.useCallback)(() => actions.closeSettings(), []);
+ const [error, setError] = (0, import_react51.useState)("");
+ const close = (0, import_react51.useCallback)(() => actions.closeSettings(), []);
useEscape(close);
const run2 = (promise) => Promise.resolve(promise).then(() => {
setError("");
@@ -21908,32 +22241,32 @@ function SettingsDialog({ page, id, roster, actions, useUpdate, leaving = false
const nav = useGlide(shown, { axis: "y" });
const pageKey = `${shown}:${bot?.id ?? room2?.id ?? ""}`;
const depth = bot || room2 ? 1 : 0;
- const last = (0, import_react50.useRef)({ key: pageKey, depth, move: "up" });
+ const last = (0, import_react51.useRef)({ key: pageKey, depth, move: "up" });
if (last.current.key !== pageKey) {
last.current = { key: pageKey, depth, move: depth > last.current.depth ? "in" : depth < last.current.depth ? "out" : "up" };
}
- const [usageOpened, setUsageOpened] = (0, import_react50.useState)(shown === "usage");
+ const [usageOpened, setUsageOpened] = (0, import_react51.useState)(shown === "usage");
if (shown === "usage" && !usageOpened) setUsageOpened(true);
- const errorLine = error ? (0, import_react50.createElement)("div", { className: "bt-error", role: "alert", style: { padding: 0 } }, error) : null;
- return (0, import_react50.createElement)(
+ const errorLine = error ? (0, import_react51.createElement)("div", { className: "bt-error", role: "alert", style: { padding: 0 } }, error) : null;
+ return (0, import_react51.createElement)(
"div",
{ className: "bt-settings-layer", "data-leaving": leaving || void 0 },
- (0, import_react50.createElement)("div", { className: "bt-scrim", onMouseDown: close }),
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)("div", { className: "bt-scrim", onMouseDown: close }),
+ (0, import_react51.createElement)(
"div",
{ className: "bt-settings", role: "dialog", "aria-modal": true, "aria-label": t("DS Bot settings") },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
"nav",
{ ref: nav.box, className: "bt-settings-nav", "aria-label": t("Settings pages") },
- (0, import_react50.createElement)("span", { ref: nav.thumb, className: "bt-thumb", "aria-hidden": true }),
- pages.map(([key, text]) => (0, import_react50.createElement)("button", {
+ (0, import_react51.createElement)("span", { ref: nav.thumb, className: "bt-thumb", "aria-hidden": true }),
+ pages.map(([key, text]) => (0, import_react51.createElement)("button", {
key,
type: "button",
className: "bt-settings-item",
"aria-current": shown === key ? "page" : void 0,
onClick: () => actions.openSettings(key)
- }, (0, import_react50.createElement)(PAGE_ICONS[key]), t(text))),
- actions.openHarnessSettings ? (0, import_react50.createElement)("button", {
+ }, (0, import_react51.createElement)(PAGE_ICONS[key]), t(text))),
+ actions.openHarnessSettings ? (0, import_react51.createElement)("button", {
type: "button",
className: "bt-settings-item bt-settings-shell",
title: t("Models, providers, and the rest of DeepSeek Harness"),
@@ -21941,55 +22274,55 @@ function SettingsDialog({ page, id, roster, actions, useUpdate, leaving = false
close();
actions.openHarnessSettings();
}
- }, (0, import_react50.createElement)(SlidersIcon), t("Harness settings")) : null
+ }, (0, import_react51.createElement)(SlidersIcon), t("Harness settings")) : null
),
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
"div",
{ className: "bt-settings-main" },
- (0, import_react50.createElement)(
+ (0, import_react51.createElement)(
"div",
{ className: "bt-settings-head" },
- back ? (0, import_react50.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": back, title: back, onClick: () => actions.openSettings(shown) }, (0, import_react50.createElement)(ChevronLeftIcon)) : null,
- (0, import_react50.createElement)("h2", { key: bot?.id ?? room2?.id ?? shown }, bot?.name ?? room2?.name ?? label)
+ back ? (0, import_react51.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": back, title: back, onClick: () => actions.openSettings(shown) }, (0, import_react51.createElement)(ChevronLeftIcon)) : null,
+ (0, import_react51.createElement)("h2", { key: bot?.id ?? room2?.id ?? shown }, bot?.name ?? room2?.name ?? label)
),
- shown === "usage" ? null : (0, import_react50.createElement)(
+ shown === "usage" ? null : (0, import_react51.createElement)(
"div",
{ key: pageKey, className: "bt-settings-scroll bt-settings-page", "data-move": last.current.move },
errorLine,
- shown === "general" ? (0, import_react50.createElement)(GeneralPage, { roster, actions, run: run2 }) : null,
- shown === "models" ? (0, import_react50.createElement)(ProvidersPage, { actions, run: run2, Section: SetSection }) : null,
- bot ? (0, import_react50.createElement)("div", { className: "bt-settings-form" }, (0, import_react50.createElement)(BotSettingsForm, { key: bot.id, bot, roster, actions, run: run2 })) : null,
- shown === "bots" && !bot ? (0, import_react50.createElement)(BotsPage, { roster, actions, run: run2 }) : null,
- room2 ? (0, import_react50.createElement)("div", { className: "bt-settings-form" }, (0, import_react50.createElement)(GroupSettingsForm, { key: room2.id, room: room2, roster, actions, run: run2 })) : null,
- shown === "groups" && !room2 ? (0, import_react50.createElement)(GroupsPage, { roster, actions, run: run2 }) : null,
- shown === "connectors" ? (0, import_react50.createElement)(ConnectorsPage, { roster, actions }) : null,
- shown === "im" ? (0, import_react50.createElement)(ImPage, { roster, actions }) : null,
- shown === "capabilities" ? (0, import_react50.createElement)(CapabilitiesPage, { roster, actions, run: run2 }) : null,
- shown === "browser" ? (0, import_react50.createElement)(BrowserPage, { roster, actions, run: run2, Section: SetSection, Row: SetRow }) : null,
- shown === "schedules" ? (0, import_react50.createElement)(SchedulesPage, { roster, actions, start: id ?? void 0 }) : null,
- shown === "secrets" ? (0, import_react50.createElement)(SecretsPage, { roster, actions, run: run2, Section: SetSection }) : null,
- shown === "feedback" ? (0, import_react50.createElement)(FeedbackPage, { actions, run: run2, Section: SetSection, Row: SetRow }) : null,
- shown === "about" ? (0, import_react50.createElement)(AboutPage, { useUpdate, actions, run: run2, Section: SetSection, Row: SetRow }) : null
+ shown === "general" ? (0, import_react51.createElement)(GeneralPage, { roster, actions, run: run2 }) : null,
+ shown === "models" ? (0, import_react51.createElement)(ProvidersPage, { actions, run: run2, Section: SetSection }) : null,
+ bot ? (0, import_react51.createElement)("div", { className: "bt-settings-form" }, (0, import_react51.createElement)(BotSettingsForm, { key: bot.id, bot, roster, actions, run: run2 })) : null,
+ shown === "bots" && !bot ? (0, import_react51.createElement)(BotsPage, { roster, actions, run: run2 }) : null,
+ room2 ? (0, import_react51.createElement)("div", { className: "bt-settings-form" }, (0, import_react51.createElement)(GroupSettingsForm, { key: room2.id, room: room2, roster, actions, run: run2 })) : null,
+ shown === "groups" && !room2 ? (0, import_react51.createElement)(GroupsPage, { roster, actions, run: run2 }) : null,
+ shown === "connectors" ? (0, import_react51.createElement)(ConnectorsPage, { roster, actions }) : null,
+ shown === "im" ? (0, import_react51.createElement)(ImPage, { roster, actions }) : null,
+ shown === "capabilities" ? (0, import_react51.createElement)(CapabilitiesPage, { roster, actions, run: run2 }) : null,
+ shown === "browser" ? (0, import_react51.createElement)(BrowserPage, { roster, actions, run: run2, Section: SetSection, Row: SetRow }) : null,
+ shown === "schedules" ? (0, import_react51.createElement)(SchedulesPage, { roster, actions, start: id ?? void 0 }) : null,
+ shown === "secrets" ? (0, import_react51.createElement)(SecretsPage, { roster, actions, run: run2, Section: SetSection }) : null,
+ shown === "feedback" ? (0, import_react51.createElement)(FeedbackPage, { actions, run: run2, Section: SetSection, Row: SetRow }) : null,
+ shown === "about" ? (0, import_react51.createElement)(AboutPage, { useUpdate, actions, run: run2, Section: SetSection, Row: SetRow }) : null
),
- usageOpened ? (0, import_react50.createElement)(
+ usageOpened ? (0, import_react51.createElement)(
"div",
{ key: "usage", className: "bt-settings-scroll bt-settings-usage", "data-off": shown === "usage" ? void 0 : "", "aria-hidden": shown === "usage" ? void 0 : true },
shown === "usage" ? errorLine : null,
- (0, import_react50.createElement)(UsagePage, { roster, actions, focusId: usageFocus })
+ (0, import_react51.createElement)(UsagePage, { roster, actions, focusId: usageFocus })
) : null
),
- (0, import_react50.createElement)("button", { type: "button", className: "bt-settings-close", "aria-label": t("Close settings"), onClick: close }, (0, import_react50.createElement)(CloseIcon))
+ (0, import_react51.createElement)("button", { type: "button", className: "bt-settings-close", "aria-label": t("Close settings"), onClick: close }, (0, import_react51.createElement)(CloseIcon))
)
);
}
// src/client/context-menu.js
-var import_react51 = require("react");
+var import_react52 = require("react");
function ContextMenu({ menu, roster, actions, leaving = false }) {
useEscape(() => actions.closeMenu());
- const ref = (0, import_react51.useRef)(null);
- const trigger = (0, import_react51.useRef)(typeof document === "undefined" ? null : document.activeElement);
- (0, import_react51.useEffect)(() => {
+ const ref = (0, import_react52.useRef)(null);
+ const trigger = (0, import_react52.useRef)(typeof document === "undefined" ? null : document.activeElement);
+ (0, import_react52.useEffect)(() => {
const onDown = (event) => {
if (!(event.target instanceof Element) || !event.target.closest(".bt-menu")) actions.closeMenu();
};
@@ -22003,14 +22336,14 @@ function ContextMenu({ menu, roster, actions, leaving = false }) {
window.removeEventListener("keydown", onKey, true);
};
}, []);
- const [place, setPlace] = (0, import_react51.useState)({ left: menu.x, top: menu.y });
+ const [place, setPlace] = (0, import_react52.useState)({ left: menu.x, top: menu.y });
const tick = useViewport();
- (0, import_react51.useLayoutEffect)(() => {
+ (0, import_react52.useLayoutEffect)(() => {
const box = ref.current?.getBoundingClientRect();
if (!box) return;
setPlace({ left: Math.max(8, Math.min(menu.x, window.innerWidth - box.width - 8)), top: Math.max(8, Math.min(menu.y, viewBottom() - box.height - 8)) });
}, [menu.x, menu.y, tick]);
- if (menu.kind === "agent" || menu.kind === "agent-session") return (0, import_react51.createElement)(AgentMenu, { menu, roster, actions, leaving });
+ if (menu.kind === "agent" || menu.kind === "agent-session") return (0, import_react52.createElement)(AgentMenu, { menu, roster, actions, leaving });
const bot = roster.byId[menu.id];
const room2 = roster.roomsById[menu.id];
const entry = bot ?? room2;
@@ -22041,14 +22374,14 @@ function ContextMenu({ menu, roster, actions, leaving = false }) {
isMainBot ? null : [room2 ? t("Delete group") : t("Delete"), TrashIcon, () => bot ? actions.deleteBot(bot.id) : actions.deleteRoom(menu.id), true]
]
].map((group) => group.filter(Boolean)).filter((group) => group.length > 0);
- return (0, import_react51.createElement)(
+ return (0, import_react52.createElement)(
"div",
{ ref, className: "bt-menu", role: "menu", "aria-label": t("{name} actions", { name: bot?.name ?? room2.name }), style: place, "data-leaving": leaving || void 0 },
- groups.map((group, index) => (0, import_react51.createElement)(
- import_react51.Fragment,
+ groups.map((group, index) => (0, import_react52.createElement)(
+ import_react52.Fragment,
{ key: index },
- index > 0 ? (0, import_react51.createElement)("div", { className: "bt-menu-sep", role: "separator" }) : null,
- group.map(([label, Icon, run2, danger]) => (0, import_react51.createElement)("button", {
+ index > 0 ? (0, import_react52.createElement)("div", { className: "bt-menu-sep", role: "separator" }) : null,
+ group.map(([label, Icon, run2, danger]) => (0, import_react52.createElement)("button", {
key: label,
type: "button",
role: "menuitem",
@@ -22057,23 +22390,23 @@ function ContextMenu({ menu, roster, actions, leaving = false }) {
actions.closeMenu();
void Promise.resolve(run2()).catch((error) => actions.reportError(error, "menu"));
}
- }, (0, import_react51.createElement)(Icon), label))
+ }, (0, import_react52.createElement)(Icon), label))
))
);
}
function AgentMenu({ menu, roster, actions, leaving }) {
- const ref = (0, import_react51.useRef)(null);
- const trigger = (0, import_react51.useRef)(typeof document === "undefined" ? null : document.activeElement);
- (0, import_react51.useEffect)(() => {
+ const ref = (0, import_react52.useRef)(null);
+ const trigger = (0, import_react52.useRef)(typeof document === "undefined" ? null : document.activeElement);
+ (0, import_react52.useEffect)(() => {
const onKey = (event) => {
stepMenuFocus(ref.current, event, trigger.current);
};
window.addEventListener("keydown", onKey, true);
return () => window.removeEventListener("keydown", onKey, true);
}, []);
- const [place, setPlace] = (0, import_react51.useState)({ left: menu.x, top: menu.y });
+ const [place, setPlace] = (0, import_react52.useState)({ left: menu.x, top: menu.y });
const tick = useViewport();
- (0, import_react51.useLayoutEffect)(() => {
+ (0, import_react52.useLayoutEffect)(() => {
const box = ref.current?.getBoundingClientRect();
if (!box) return;
setPlace({ left: Math.max(8, Math.min(menu.x, window.innerWidth - box.width - 8)), top: Math.max(8, Math.min(menu.y, viewBottom() - box.height - 8)) });
@@ -22095,14 +22428,14 @@ function AgentMenu({ menu, roster, actions, leaving }) {
[t("Archive"), TrashIcon, () => actions.archiveAgentSession(agent.id, menu.id), true]
]
];
- return (0, import_react51.createElement)(
+ return (0, import_react52.createElement)(
"div",
{ ref, className: "bt-menu", role: "menu", "aria-label": menu.kind === "agent" ? "DSH Agent" : t("Session actions"), style: place, "data-leaving": leaving || void 0 },
- groups.map((group, index) => (0, import_react51.createElement)(
- import_react51.Fragment,
+ groups.map((group, index) => (0, import_react52.createElement)(
+ import_react52.Fragment,
{ key: index },
- index > 0 ? (0, import_react51.createElement)("div", { className: "bt-menu-sep", role: "separator" }) : null,
- group.map(([label, Icon, run2, danger]) => (0, import_react51.createElement)("button", {
+ index > 0 ? (0, import_react52.createElement)("div", { className: "bt-menu-sep", role: "separator" }) : null,
+ group.map(([label, Icon, run2, danger]) => (0, import_react52.createElement)("button", {
key: label,
type: "button",
role: "menuitem",
@@ -22111,13 +22444,13 @@ function AgentMenu({ menu, roster, actions, leaving }) {
actions.closeMenu();
void Promise.resolve(run2()).catch((error) => console.warn("[ds-bot]", error));
}
- }, (0, import_react51.createElement)(Icon), label))
+ }, (0, import_react52.createElement)(Icon), label))
))
);
}
// src/client/member-status.js
-var import_react52 = require("react");
+var import_react53 = require("react");
var NO_WORK = { bots: {}, rooms: {}, approvals: [] };
var FACES_MAX2 = 3;
var DOCK_EXIT_MS = 160;
@@ -22178,15 +22511,15 @@ function dockModel(sessionId, roster, work) {
};
}
function Face({ bot, ask, state }) {
- return (0, import_react52.createElement)(
+ return (0, import_react53.createElement)(
"span",
{ className: "bt-mw-face", "data-ask": ask || void 0 },
- (0, import_react52.createElement)(BotMark, { bot, size: 20, state: ask ? "alert" : state })
+ (0, import_react53.createElement)(BotMark, { bot, size: 20, state: ask ? "alert" : state })
);
}
function useFitWidth(inner, key) {
- const [width, setWidth] = (0, import_react52.useState)(null);
- (0, import_react52.useLayoutEffect)(() => {
+ const [width, setWidth] = (0, import_react53.useState)(null);
+ (0, import_react53.useLayoutEffect)(() => {
setWidth(key && inner.current ? inner.current.offsetWidth : null);
}, [key]);
return width;
@@ -22197,93 +22530,93 @@ function MemberDock({ sessionId, useRoster, useWork, actions }) {
const live = dockModel(sessionId, roster, work);
const [kept, leaving] = useLinger(live ? JSON.stringify(live) : null, DOCK_EXIT_MS);
const model = kept ? JSON.parse(kept) : null;
- const inner = (0, import_react52.useRef)(null);
+ const inner = (0, import_react53.useRef)(null);
const width = useFitWidth(inner, kept);
if (!model) return null;
const faces = model.faces.map((face) => ({ ...face, bot: roster.byId[face.id] })).filter((face) => face.bot);
const label = [model.waiting, model.doing].filter(Boolean).join(" · ");
const open = () => model.open.details ? actions.showDetails(model.open.details) : actions.openSession(model.open.session);
- return (0, import_react52.createElement)(
+ return (0, import_react53.createElement)(
"div",
{ className: "bt-mw-dock", "data-leaving": leaving || void 0 },
- (0, import_react52.createElement)(
+ (0, import_react53.createElement)(
"button",
{ type: "button", className: "bt-mw-pill", "aria-label": label, onClick: open, disabled: leaving, style: width ? { width } : void 0 },
- (0, import_react52.createElement)(
+ (0, import_react53.createElement)(
"span",
{ ref: inner, className: "bt-mw-pill-in" },
- (0, import_react52.createElement)("span", { className: "bt-mw-faces", "aria-hidden": true }, faces.map((face) => (0, import_react52.createElement)(Face, { key: face.id, ...face }))),
- (0, import_react52.createElement)(
+ (0, import_react53.createElement)("span", { className: "bt-mw-faces", "aria-hidden": true }, faces.map((face) => (0, import_react53.createElement)(Face, { key: face.id, ...face }))),
+ (0, import_react53.createElement)(
"span",
{ key: label, className: "bt-mw-label", "aria-hidden": true },
- model.waiting ? (0, import_react52.createElement)("span", { className: "bt-mw-ask" }, model.waiting) : null,
- model.waiting && model.doing ? (0, import_react52.createElement)("span", { className: "bt-mw-dot" }, "·") : null,
- model.doing ? (0, import_react52.createElement)("span", { className: "bt-mw-doing" }, (0, import_react52.createElement)(Shimmer, null, model.doing)) : null
+ model.waiting ? (0, import_react53.createElement)("span", { className: "bt-mw-ask" }, model.waiting) : null,
+ model.waiting && model.doing ? (0, import_react53.createElement)("span", { className: "bt-mw-dot" }, "·") : null,
+ model.doing ? (0, import_react53.createElement)("span", { className: "bt-mw-doing" }, (0, import_react53.createElement)(Shimmer, null, model.doing)) : null
)
)
)
);
}
-var stateLine = (className, at, ...what) => (0, import_react52.createElement)(
+var stateLine = (className, at, ...what) => (0, import_react53.createElement)(
"span",
{ className },
- (0, import_react52.createElement)("span", { className: "bt-member-what" }, ...what),
- typeof at === "number" ? (0, import_react52.createElement)(Elapsed, { at, className: "bt-member-time" }) : null
+ (0, import_react53.createElement)("span", { className: "bt-member-what" }, ...what),
+ typeof at === "number" ? (0, import_react53.createElement)(Elapsed, { at, className: "bt-member-time" }) : null
);
function ApprovalCard({ approval, bot, actions }) {
- const [busy, setBusy] = (0, import_react52.useState)(false);
+ const [busy, setBusy] = (0, import_react53.useState)(false);
const answer = (choice) => {
setBusy(true);
void Promise.resolve(actions.answerApproval(approval.id, choice)).catch((error) => actions.reportError(error, "approval")).finally(() => setBusy(false));
};
- return (0, import_react52.createElement)(
+ return (0, import_react53.createElement)(
"div",
{ className: "bt-mw-card", role: "group", "aria-label": t("{name} is waiting for your approval", { name: bot.name }) },
- (0, import_react52.createElement)("div", { className: "bt-mw-tool" }, approval.tool),
- approval.detail?.text ? (0, import_react52.createElement)("div", { className: "bt-mw-text" }, approval.detail.text) : null,
- approval.reason ? (0, import_react52.createElement)("div", { className: "bt-mw-reason" }, approval.reason) : null,
- approval.detail?.code ? (0, import_react52.createElement)("code", { className: "bt-mw-code", title: approval.detail.code }, approval.detail.code) : null,
+ (0, import_react53.createElement)("div", { className: "bt-mw-tool" }, approval.tool),
+ approval.detail?.text ? (0, import_react53.createElement)("div", { className: "bt-mw-text" }, approval.detail.text) : null,
+ approval.reason ? (0, import_react53.createElement)("div", { className: "bt-mw-reason" }, approval.reason) : null,
+ approval.detail?.code ? (0, import_react53.createElement)("code", { className: "bt-mw-code", title: approval.detail.code }, approval.detail.code) : null,
// Own-chat approvals are answerable for IM and the phone app; here the Bot's
// own DSH card stays the place to answer, so the row still opens that chat.
- approval.answerable && approval.roomId !== void 0 ? (0, import_react52.createElement)(
+ approval.answerable && approval.roomId !== void 0 ? (0, import_react53.createElement)(
"div",
{ className: "bt-mw-actions" },
- (0, import_react52.createElement)("button", { type: "button", className: "bt-q-btn", disabled: busy, onClick: () => answer("reject") }, t("Reject")),
- (0, import_react52.createElement)("button", { type: "button", className: "bt-q-submit", disabled: busy, onClick: () => answer("allow") }, t("Allow once"))
- ) : (0, import_react52.createElement)(
+ (0, import_react53.createElement)("button", { type: "button", className: "bt-q-btn", disabled: busy, onClick: () => answer("reject") }, t("Reject")),
+ (0, import_react53.createElement)("button", { type: "button", className: "bt-q-submit", disabled: busy, onClick: () => answer("allow") }, t("Allow once"))
+ ) : (0, import_react53.createElement)(
"div",
{ className: "bt-mw-actions" },
- (0, import_react52.createElement)("button", { type: "button", className: "bt-q-btn", onClick: () => actions.openSession(bot.id) }, t("Open {name}'s chat", { name: bot.name }))
+ (0, import_react53.createElement)("button", { type: "button", className: "bt-q-btn", onClick: () => actions.openSession(bot.id) }, t("Open {name}'s chat", { name: bot.name }))
)
);
}
function MemberState({ entry, bot }) {
if (entry?.state === "ask") return stateLine("bt-member-state bt-mw-ask", entry.approvals[0].at, t("Waiting for your approval"));
if (entry?.state !== "work") return bot.role ? stateLine("bt-member-state", void 0, bot.role) : null;
- return stateLine("bt-member-state", entry.doing.since, (0, import_react52.createElement)(Shimmer, null, `${workPhrase(entry.doing)}…`));
+ return stateLine("bt-member-state", entry.doing.since, (0, import_react53.createElement)(Shimmer, null, `${workPhrase(entry.doing)}…`));
}
function StopMemberWork({ entry, bot, room: room2, actions }) {
- const [stopping, setStopping] = (0, import_react52.useState)(false);
+ const [stopping, setStopping] = (0, import_react53.useState)(false);
if (!entry?.here || entry.state !== "work" && entry.state !== "ask") return null;
const stop = () => {
setStopping(true);
void Promise.resolve(actions.stopMemberWork(room2.id, bot.id)).catch((error) => actions.reportError(error, "stop")).finally(() => setStopping(false));
};
- return (0, import_react52.createElement)("button", { type: "button", className: "bt-member-stop", disabled: stopping, "aria-label": `${t("Stop")} · ${bot.name}`, onClick: stop }, t("Stop"));
+ return (0, import_react53.createElement)("button", { type: "button", className: "bt-member-stop", disabled: stopping, "aria-label": `${t("Stop")} · ${bot.name}`, onClick: stop }, t("Stop"));
}
function StopRoomWork({ room: room2, entries: entries2, actions }) {
- const [stopping, setStopping] = (0, import_react52.useState)(false);
+ const [stopping, setStopping] = (0, import_react53.useState)(false);
if (!entries2.some((entry) => entry.here)) return null;
const stop = () => {
setStopping(true);
void Promise.resolve(actions.stopRoomWork(room2.id)).catch((error) => actions.reportError(error, "stop")).finally(() => setStopping(false));
};
const label = t("Stop all work in this group");
- return (0, import_react52.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: stopping, "aria-label": label, title: label, onClick: stop }, t("Stop all"));
+ return (0, import_react53.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", disabled: stopping, "aria-label": label, title: label, onClick: stop }, t("Stop all"));
}
function MemberApprovals({ entry, bot, actions }) {
if (entry?.state !== "ask") return null;
- return (0, import_react52.createElement)("div", { className: "bt-member-cards" }, entry.approvals.map((approval) => (0, import_react52.createElement)(ApprovalCard, { key: approval.id, approval, bot, actions })));
+ return (0, import_react53.createElement)("div", { className: "bt-member-cards" }, entry.approvals.map((approval) => (0, import_react53.createElement)(ApprovalCard, { key: approval.id, approval, bot, actions })));
}
function useMemberWork(room2, useWork) {
const work = useWork?.((value) => value) ?? NO_WORK;
@@ -22347,7 +22680,7 @@ body[data-ds-dark-theme] .bt-member-state.bt-mw-ask{color:#f0b84a}
`;
// src/client/details-drawer.js
-var import_react53 = require("react");
+var import_react54 = require("react");
function transcriptOf(list, id, name, hiddenTurns = []) {
const outline = list.projectionsBySession?.[id]?.values?.turnOutline ?? list.byId[id]?.projectionValues?.turnOutline;
if (!Array.isArray(outline)) return "";
@@ -22372,17 +22705,17 @@ var EMPTY_TABS = { ids: [], active: null };
function PermissionRow({ bot, roster, actions, run: run2 }) {
const catalog = roster.permissions;
if (!catalog?.options?.length) return null;
- return (0, import_react53.createElement)(
+ return (0, import_react54.createElement)(
"div",
{ className: "bt-drawer-permission" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Permissions")),
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Permissions")),
// A Bot without its own preset may run on another one set in DSH, so its first pick always applies.
- (0, import_react53.createElement)(PermissionPicker, { catalog, saved: bot.permission ?? catalog.defaultPreset, repick: bot.permission === void 0, onPick: (permission) => run2(actions.updateBot(bot.id, { permission })) })
+ (0, import_react54.createElement)(PermissionPicker, { catalog, saved: bot.permission ?? catalog.defaultPreset, repick: bot.permission === void 0, onPick: (permission) => run2(actions.updateBot(bot.id, { permission })) })
);
}
function RunStats({ bot, part, running, actions }) {
- const [values, setValues] = (0, import_react53.useState)(null);
- (0, import_react53.useEffect)(() => {
+ const [values, setValues] = (0, import_react54.useState)(null);
+ (0, import_react54.useEffect)(() => {
if (!actions.runStats) return void 0;
let current = true;
actions.runStats(bot.id).then(
@@ -22399,56 +22732,56 @@ function RunStats({ bot, part, running, actions }) {
}, [bot.id, part, running]);
const shown = runStatsOf(values);
if (shown.length === 0) return null;
- return (0, import_react53.createElement)(
+ return (0, import_react54.createElement)(
"div",
{ className: "bt-run-stats" },
- shown.map((entry, index) => (0, import_react53.createElement)(
- import_react53.Fragment,
+ shown.map((entry, index) => (0, import_react54.createElement)(
+ import_react54.Fragment,
{ key: entry.key },
- index > 0 ? (0, import_react53.createElement)("span", { className: "bt-run-sep", "aria-hidden": true }, "·") : null,
- (0, import_react53.createElement)("span", { title: entry.title }, entry.text)
+ index > 0 ? (0, import_react54.createElement)("span", { className: "bt-run-sep", "aria-hidden": true }, "·") : null,
+ (0, import_react54.createElement)("span", { title: entry.title }, entry.text)
))
);
}
function BrowserCards({ bot, sessionId, roster, actions, useBrowserTabs, useBrowserPages }) {
const state = useBrowserTabs((map) => map[bot.id] ?? EMPTY_TABS);
const pages = useBrowserPages((map) => map);
- (0, import_react53.useEffect)(() => {
+ (0, import_react54.useEffect)(() => {
actions.browserEnsure?.(bot.id);
}, [bot.id]);
if (roster.browser !== true || !actions.browserShow) {
- return (0, import_react53.createElement)("div", { className: "bt-muted" }, t("The browser is in DSH Desktop and the DS Bot app."));
+ return (0, import_react54.createElement)("div", { className: "bt-muted" }, t("The browser is in DSH Desktop and the DS Bot app."));
}
if (state.ids.length === 0) {
- return (0, import_react53.createElement)(
+ return (0, import_react54.createElement)(
"div",
{ className: "bt-browser-empty-mark" },
- (0, import_react53.createElement)(BotMark, { bot, size: 40, state: "idle", live: true }),
- (0, import_react53.createElement)("div", { className: "bt-browser-empty-title" }, t("{name}'s browser", { name: bot.name })),
- (0, import_react53.createElement)("div", { className: "bt-muted" }, t("Open a page here and {name} can read it with you. Logins and cookies stay with {name}; other Bots never see them.", { name: bot.name })),
- (0, import_react53.createElement)("button", { type: "button", className: "bt-browser-retry", onClick: () => actions.openBrowser(sessionId) }, t("Open browser"))
+ (0, import_react54.createElement)(BotMark, { bot, size: 40, state: "idle", live: true }),
+ (0, import_react54.createElement)("div", { className: "bt-browser-empty-title" }, t("{name}'s browser", { name: bot.name })),
+ (0, import_react54.createElement)("div", { className: "bt-muted" }, t("Open a page here and {name} can read it with you. Logins and cookies stay with {name}; other Bots never see them.", { name: bot.name })),
+ (0, import_react54.createElement)("button", { type: "button", className: "bt-browser-retry", onClick: () => actions.openBrowser(sessionId) }, t("Open browser"))
);
}
- return (0, import_react53.createElement)(
+ return (0, import_react54.createElement)(
"div",
{ className: "bt-bcards" },
state.ids.map((tabId, index) => {
const page = pages[tabId] ?? {};
const label = page.title || shortUrl(page.url) || t("New tab");
- return (0, import_react53.createElement)(
+ return (0, import_react54.createElement)(
"div",
{ key: tabId, className: "bt-bcard", "data-active": state.active === tabId || void 0, style: { animationDelay: `${index * 30}ms` } },
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"button",
{ type: "button", className: "bt-bcard-shot", "aria-label": t("Open {title}", { title: label }), title: page.url, onClick: () => actions.browserPick(sessionId, tabId) },
- page.excerpt ? (0, import_react53.createElement)(
+ page.excerpt ? (0, import_react54.createElement)(
"span",
{ className: "bt-bcard-preview" },
- (0, import_react53.createElement)("span", { className: "bt-bcard-ptitle" }, label),
- (0, import_react53.createElement)("span", { className: "bt-bcard-excerpt" }, page.excerpt)
- ) : (0, import_react53.createElement)("span", { className: "bt-bcard-blank" }, (0, import_react53.createElement)(GlobeIcon2), (0, import_react53.createElement)("span", null, label))
+ (0, import_react54.createElement)("span", { className: "bt-bcard-ptitle" }, label),
+ (0, import_react54.createElement)("span", { className: "bt-bcard-excerpt" }, page.excerpt)
+ ) : (0, import_react54.createElement)("span", { className: "bt-bcard-blank" }, (0, import_react54.createElement)(GlobeIcon2), (0, import_react54.createElement)("span", null, label))
),
- (0, import_react53.createElement)("button", {
+ (0, import_react54.createElement)("button", {
type: "button",
className: "bt-bcard-x",
"aria-label": t("Close tab"),
@@ -22457,29 +22790,29 @@ function BrowserCards({ bot, sessionId, roster, actions, useBrowserTabs, useBrow
void actions.browserCloseTab(bot.id, tabId);
}
}, "×"),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"div",
{ className: "bt-bcard-row" },
- (0, import_react53.createElement)(Favicon, { src: page.favicon, className: "bt-bcard-fav" }),
- (0, import_react53.createElement)("span", { className: "bt-bcard-title" }, label),
- page.url ? (0, import_react53.createElement)("span", { className: "bt-bcard-host" }, hostOf2(page.url)) : null
+ (0, import_react54.createElement)(Favicon, { src: page.favicon, className: "bt-bcard-fav" }),
+ (0, import_react54.createElement)("span", { className: "bt-bcard-title" }, label),
+ page.url ? (0, import_react54.createElement)("span", { className: "bt-bcard-host" }, hostOf2(page.url)) : null
)
);
}),
- (0, import_react53.createElement)("button", { type: "button", className: "bt-bcard-new", style: { animationDelay: `${state.ids.length * 30}ms` }, onClick: () => actions.browserNewTab(sessionId) }, (0, import_react53.createElement)(PlusIcon), t("New tab"))
+ (0, import_react54.createElement)("button", { type: "button", className: "bt-bcard-new", style: { animationDelay: `${state.ids.length * 30}ms` }, onClick: () => actions.browserNewTab(sessionId) }, (0, import_react54.createElement)(PlusIcon), t("New tab"))
);
}
function About({ text, title = "About" }) {
- const [open, setOpen] = (0, import_react53.useState)(false);
+ const [open, setOpen] = (0, import_react54.useState)(false);
const long = text.split("\n").length > 5 || text.length > 240;
- const body = (0, import_react53.useRef)(null);
+ const body = (0, import_react54.useRef)(null);
useMorph(body, open);
- return (0, import_react53.createElement)(
+ return (0, import_react54.createElement)(
"div",
null,
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t(title)),
- (0, import_react53.createElement)("div", { ref: body, className: "bt-about", "data-open": open || void 0 }, text),
- long ? (0, import_react53.createElement)("button", { type: "button", className: "bt-more", onClick: () => setOpen((value) => !value) }, open ? t("Show less") : t("Show more")) : null
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t(title)),
+ (0, import_react54.createElement)("div", { ref: body, className: "bt-about", "data-open": open || void 0 }, text),
+ long ? (0, import_react54.createElement)("button", { type: "button", className: "bt-more", onClick: () => setOpen((value) => !value) }, open ? t("Show less") : t("Show more")) : null
);
}
var PILE_MAX = 4;
@@ -22487,57 +22820,57 @@ function MemberPile({ room: room2, roster }) {
const members = room2.members.map((id) => roster.byId[id]).filter(Boolean);
const shown = members.length > PILE_MAX ? members.slice(0, PILE_MAX - 1) : members;
const more = members.length - shown.length;
- return (0, import_react53.createElement)(
+ return (0, import_react54.createElement)(
"span",
{ className: "bt-pile", "aria-hidden": true },
- shown.map((bot, index) => (0, import_react53.createElement)("span", { key: bot.id, className: "bt-pile-face", style: { animationDelay: `${index * 40}ms` } }, (0, import_react53.createElement)(BotMark, { bot, size: 44, live: true }))),
- more > 0 ? (0, import_react53.createElement)("span", { key: "more", className: "bt-pile-face bt-pile-more", style: { animationDelay: `${shown.length * 40}ms` } }, `+${more}`) : null
+ shown.map((bot, index) => (0, import_react54.createElement)("span", { key: bot.id, className: "bt-pile-face", style: { animationDelay: `${index * 40}ms` } }, (0, import_react54.createElement)(BotMark, { bot, size: 44, live: true }))),
+ more > 0 ? (0, import_react54.createElement)("span", { key: "more", className: "bt-pile-face bt-pile-more", style: { animationDelay: `${shown.length * 40}ms` } }, `+${more}`) : null
);
}
var markOf = (entry) => entry?.state === "ask" ? "alert" : entry?.state === "work" ? workState(entry.doing) : "idle";
function MemberRow({ member, entry, room: room2, roster, actions }) {
- return (0, import_react53.createElement)(
+ return (0, import_react54.createElement)(
"div",
{ role: "listitem", className: "bt-member" },
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"div",
{ className: "bt-member-row" },
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"button",
{ type: "button", className: "bt-member-open", title: t("Open {name}'s chat", { name: member.name }), onClick: () => actions.openSession(member.id) },
- (0, import_react53.createElement)(BotMark, { bot: member, size: 32, state: markOf(entry) }),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(BotMark, { bot: member, size: 32, state: markOf(entry) }),
+ (0, import_react54.createElement)(
"span",
{ className: "bt-member-text" },
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"span",
{ className: "bt-member-line" },
- (0, import_react53.createElement)("span", { className: "bt-member-name" }, member.name),
- room2.admin === member.id ? (0, import_react53.createElement)("span", { className: "bt-tag" }, t("Admin")) : null
+ (0, import_react54.createElement)("span", { className: "bt-member-name" }, member.name),
+ room2.admin === member.id ? (0, import_react54.createElement)("span", { className: "bt-tag" }, t("Admin")) : null
),
- (0, import_react53.createElement)(MemberState, { entry, bot: member, room: room2, roster })
+ (0, import_react54.createElement)(MemberState, { entry, bot: member, room: room2, roster })
)
),
- (0, import_react53.createElement)(StopMemberWork, { entry, bot: member, room: room2, actions })
+ (0, import_react54.createElement)(StopMemberWork, { entry, bot: member, room: room2, actions })
),
- (0, import_react53.createElement)(MemberApprovals, { entry, bot: member, actions })
+ (0, import_react54.createElement)(MemberApprovals, { entry, bot: member, actions })
);
}
function GroupOverview({ room: room2, roster, actions, usage, useWork, openSettings }) {
const members = room2.members.map((id) => roster.byId[id]).filter(Boolean);
const { entries: entries2 } = useMemberWork(room2, useWork);
return [
- room2.notice ? (0, import_react53.createElement)(About, { key: "notice", title: "Notice", text: room2.notice }) : (0, import_react53.createElement)("button", { key: "notice", type: "button", className: "bt-more", onClick: openSettings }, t("Add a notice in group settings")),
- (0, import_react53.createElement)(
+ room2.notice ? (0, import_react54.createElement)(About, { key: "notice", title: "Notice", text: room2.notice }) : (0, import_react54.createElement)("button", { key: "notice", type: "button", className: "bt-more", onClick: openSettings }, t("Add a notice in group settings")),
+ (0, import_react54.createElement)(
"div",
{ key: "members" },
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"div",
{ className: "bt-members-head" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Members · {count}", { count: members.length })),
- (0, import_react53.createElement)(StopRoomWork, { room: room2, entries: entries2, actions })
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Members · {count}", { count: members.length })),
+ (0, import_react54.createElement)(StopRoomWork, { room: room2, entries: entries2, actions })
),
- (0, import_react53.createElement)("div", { className: "bt-members", role: "list" }, members.map((member) => (0, import_react53.createElement)(MemberRow, {
+ (0, import_react54.createElement)("div", { className: "bt-members", role: "list" }, members.map((member) => (0, import_react54.createElement)(MemberRow, {
key: member.id,
member,
entry: entries2.find((item) => item.id === member.id),
@@ -22546,16 +22879,16 @@ function GroupOverview({ room: room2, roster, actions, usage, useWork, openSetti
actions
})))
),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"div",
{ key: "goal" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Goal")),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Goal")),
+ (0, import_react54.createElement)(
"div",
{ className: "bt-kv" },
room2.goal ? [
- (0, import_react53.createElement)("span", { key: "t" }, room2.goal.title, " ", (0, import_react53.createElement)("span", { className: "bt-note" }, goalView(room2.goal, { roster })?.barLabel ?? "")),
- (0, import_react53.createElement)("button", {
+ (0, import_react54.createElement)("span", { key: "t" }, room2.goal.title, " ", (0, import_react54.createElement)("span", { className: "bt-note" }, goalView(room2.goal, { roster })?.barLabel ?? "")),
+ (0, import_react54.createElement)("button", {
key: "s",
type: "button",
className: "bt-soft bt-soft-sm",
@@ -22564,7 +22897,7 @@ function GroupOverview({ room: room2, roster, actions, usage, useWork, openSetti
if (typeof document !== "undefined" && document.querySelector("[data-rightbar-fullscreen]")) actions.closeOverlay();
}
}, t("Show"))
- ] : (0, import_react53.createElement)("button", {
+ ] : (0, import_react54.createElement)("button", {
type: "button",
className: "bt-soft bt-soft-sm",
disabled: !canSetGoal(room2, roster),
@@ -22573,24 +22906,24 @@ function GroupOverview({ room: room2, roster, actions, usage, useWork, openSetti
}, t("Set a goal"))
)
),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"div",
{ key: "mode" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Who answers")),
- (0, import_react53.createElement)("div", { className: "bt-kv" }, (0, import_react53.createElement)("span", null, t(ROOM_MODES.find(([id]) => id === shownMode(room2, roster))?.[1] ?? "Everyone")))
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Who answers")),
+ (0, import_react54.createElement)("div", { className: "bt-kv" }, (0, import_react54.createElement)("span", null, t(ROOM_MODES.find(([id]) => id === shownMode(room2, roster))?.[1] ?? "Everyone")))
),
- room2.permission ? (0, import_react53.createElement)(
+ room2.permission ? (0, import_react54.createElement)(
"div",
{ key: "permission" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Permissions")),
- (0, import_react53.createElement)("div", { className: "bt-kv" }, (0, import_react53.createElement)("span", { className: presetDanger(room2.permission) ? "bt-perm-danger" : void 0 }, presetName(room2.permission, roster.permissions)))
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Permissions")),
+ (0, import_react54.createElement)("div", { className: "bt-kv" }, (0, import_react54.createElement)("span", { className: presetDanger(room2.permission) ? "bt-perm-danger" : void 0 }, presetName(room2.permission, roster.permissions)))
) : null,
- roster.memory === false ? null : (0, import_react53.createElement)(MemoryRow, { key: "memory", owner: { id: room2.id, name: room2.name, group: true }, actions }),
- usage ? (0, import_react53.createElement)(
+ roster.memory === false ? null : (0, import_react54.createElement)(MemoryRow, { key: "memory", owner: { id: room2.id, name: room2.name, group: true }, actions }),
+ usage ? (0, import_react54.createElement)(
"div",
{ key: "usage" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Usage")),
- (0, import_react53.createElement)("div", { className: "bt-kv" }, (0, import_react53.createElement)("span", null, room2.name), (0, import_react53.createElement)("span", null, usage))
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Usage")),
+ (0, import_react54.createElement)("div", { className: "bt-kv" }, (0, import_react54.createElement)("span", null, room2.name), (0, import_react54.createElement)("span", null, usage))
) : null
];
}
@@ -22598,15 +22931,15 @@ function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, roster, a
const owner = roster.byId[sessionId];
const part = owner ? currentPart(owner) : sessionId;
const isMainBot = isMainOf(roster, owner?.id);
- const [tab, setTab] = (0, import_react53.useState)("details");
+ const [tab, setTab] = (0, import_react54.useState)("details");
const room2 = roster.roomsById[sessionId];
- const [view, setView] = (0, import_react53.useState)(startTab === "settings" && (owner || room2) ? "settings" : "overview");
- const [editing, setEditing] = (0, import_react53.useState)(Boolean(startRenaming && (roster.byId[sessionId] || roster.roomsById[sessionId])));
- const [draftName, setDraftName] = (0, import_react53.useState)(roster.byId[sessionId]?.name ?? (roster.roomsById[sessionId]?.named ? roster.roomsById[sessionId].name : ""));
- const [copied, setCopied] = (0, import_react53.useState)(false);
- const [error, setError] = (0, import_react53.useState)("");
+ const [view, setView] = (0, import_react54.useState)(startTab === "settings" && (owner || room2) ? "settings" : "overview");
+ const [editing, setEditing] = (0, import_react54.useState)(Boolean(startRenaming && (roster.byId[sessionId] || roster.roomsById[sessionId])));
+ const [draftName, setDraftName] = (0, import_react54.useState)(roster.byId[sessionId]?.name ?? (roster.roomsById[sessionId]?.named ? roster.roomsById[sessionId].name : ""));
+ const [copied, setCopied] = (0, import_react54.useState)(false);
+ const [error, setError] = (0, import_react54.useState)("");
const glide = useGlide(tab);
- const last = (0, import_react53.useRef)({ view, tab, move: void 0 });
+ const last = (0, import_react54.useRef)({ view, tab, move: void 0 });
if (last.current.view !== view) last.current = { view, tab, move: view === "settings" ? "in" : "out" };
else if (last.current.tab !== tab) last.current = { view, tab, move: "tab" };
const move = last.current.move;
@@ -22631,21 +22964,21 @@ function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, roster, a
setTimeout(() => setCopied(false), 1600);
});
};
- const errorLine = error ? (0, import_react53.createElement)("div", { className: "bt-error", role: "alert", style: { padding: 0 } }, error) : null;
+ const errorLine = error ? (0, import_react54.createElement)("div", { className: "bt-error", role: "alert", style: { padding: 0 } }, error) : null;
if ((bot || room2) && view === "settings") {
return [
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"div",
{ key: "head", className: "bt-subhead", "data-move": move },
- (0, import_react53.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Back to details"), onClick: () => setView("overview") }, (0, import_react53.createElement)(ChevronLeftIcon)),
- (0, import_react53.createElement)("span", { className: "bt-subhead-title" }, bot ? t("Settings") : t("Group settings")),
- hasStrip ? null : (0, import_react53.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Close details"), onClick: close }, (0, import_react53.createElement)(CloseIcon))
+ (0, import_react54.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Back to details"), onClick: () => setView("overview") }, (0, import_react54.createElement)(ChevronLeftIcon)),
+ (0, import_react54.createElement)("span", { className: "bt-subhead-title" }, bot ? t("Settings") : t("Group settings")),
+ hasStrip ? null : (0, import_react54.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Close details"), onClick: close }, (0, import_react54.createElement)(CloseIcon))
),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"div",
{ key: "set-body", className: "bt-drawer-body bt-set-body", "data-move": move },
errorLine,
- bot ? (0, import_react53.createElement)(BotSettingsForm, { bot, roster, actions, run: run2 }) : (0, import_react53.createElement)(GroupSettingsForm, { room: room2, roster, actions, run: run2, onDeleted: close })
+ bot ? (0, import_react54.createElement)(BotSettingsForm, { bot, roster, actions, run: run2 }) : (0, import_react54.createElement)(GroupSettingsForm, { room: room2, roster, actions, run: run2, onDeleted: close })
)
];
}
@@ -22656,18 +22989,18 @@ function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, roster, a
canTerminal: actions.canOpenTerminal?.() === true,
canFiles: actions.canOpenFiles?.() === true
}).map((key) => menuItemFor(key, actions, sessionId));
- const top = (0, import_react53.createElement)(
+ const top = (0, import_react54.createElement)(
"div",
{ className: "bt-drawer-top", "data-move": side },
- bot || room2 ? (0, import_react53.createElement)("button", { type: "button", className: "bt-round", "aria-label": bot ? t("Edit Bot") : t("Group settings"), title: bot ? t("Edit Bot") : t("Group settings"), "data-info-row": "settings", onClick: () => setView("settings") }, (0, import_react53.createElement)(GearIcon)) : null,
- more.length > 0 ? (0, import_react53.createElement)("span", { "data-info-row": "more" }, (0, import_react53.createElement)(PanelMenu, { items: more, className: "bt-round", "aria-label": t("More") })) : null,
- bot || room2 ? (0, import_react53.createElement)("button", { type: "button", className: "bt-round", "aria-label": copied ? t("Copied conversation") : t("Share conversation"), title: copied ? t("Copied") : t("Copy conversation as Markdown"), onClick: share }, copied ? (0, import_react53.createElement)("span", { key: "copied", className: "bt-pop-in" }, "✓") : (0, import_react53.createElement)(ShareIcon)) : null,
- hasStrip ? null : (0, import_react53.createElement)("button", { type: "button", className: "bt-round", "aria-label": t("Close details"), onClick: close }, (0, import_react53.createElement)(CloseIcon))
+ bot || room2 ? (0, import_react54.createElement)("button", { type: "button", className: "bt-round", "aria-label": bot ? t("Edit Bot") : t("Group settings"), title: bot ? t("Edit Bot") : t("Group settings"), "data-info-row": "settings", onClick: () => setView("settings") }, (0, import_react54.createElement)(GearIcon)) : null,
+ more.length > 0 ? (0, import_react54.createElement)("span", { "data-info-row": "more" }, (0, import_react54.createElement)(PanelMenu, { items: more, className: "bt-round", "aria-label": t("More") })) : null,
+ bot || room2 ? (0, import_react54.createElement)("button", { type: "button", className: "bt-round", "aria-label": copied ? t("Copied conversation") : t("Share conversation"), title: copied ? t("Copied") : t("Copy conversation as Markdown"), onClick: share }, copied ? (0, import_react54.createElement)("span", { key: "copied", className: "bt-pop-in" }, "✓") : (0, import_react54.createElement)(ShareIcon)) : null,
+ hasStrip ? null : (0, import_react54.createElement)("button", { type: "button", className: "bt-round", "aria-label": t("Close details"), onClick: close }, (0, import_react54.createElement)(CloseIcon))
);
if (!bot && !room2) {
return [
- (0, import_react53.createElement)(import_react53.Fragment, { key: "top" }, top),
- (0, import_react53.createElement)("div", { key: "body", className: "bt-drawer-body" }, (0, import_react53.createElement)("div", { className: "bt-muted" }, t("This conversation is not part of your Bot team.")))
+ (0, import_react54.createElement)(import_react54.Fragment, { key: "top" }, top),
+ (0, import_react54.createElement)("div", { key: "body", className: "bt-drawer-body" }, (0, import_react54.createElement)("div", { className: "bt-muted" }, t("This conversation is not part of your Bot team.")))
];
}
const current = bot?.name ?? room2.name;
@@ -22681,12 +23014,12 @@ function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, roster, a
const subtitle = bot ? bot.role : roomSubtitle(room2, roster);
const tabs = bot ? ["details", "browser"] : ["details"];
return [
- (0, import_react53.createElement)(import_react53.Fragment, { key: "top" }, top),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(import_react54.Fragment, { key: "top" }, top),
+ (0, import_react54.createElement)(
"div",
{ key: "id", className: "bt-drawer-id", "data-move": side },
- bot ? (0, import_react53.createElement)(BotAvatar, { bot, size: 64, state: botState(running, doing, roster.questions?.[part] !== void 0), main: isMainBot, badge: false, gaze: true, pokeable: true }) : (0, import_react53.createElement)(MemberPile, { room: room2, roster }),
- editing ? (0, import_react53.createElement)("input", {
+ bot ? (0, import_react54.createElement)(BotAvatar, { bot, size: 64, state: botState(running, doing, roster.questions?.[part] !== void 0), main: isMainBot, badge: false, gaze: true, pokeable: true }) : (0, import_react54.createElement)(MemberPile, { room: room2, roster }),
+ editing ? (0, import_react54.createElement)("input", {
className: "bt-drawer-name-input",
autoFocus: true,
value: draftName,
@@ -22701,51 +23034,51 @@ function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, roster, a
setEditing(false);
}
}
- }) : (0, import_react53.createElement)("button", { type: "button", className: "bt-drawer-name", "aria-label": t("Rename {name}", { name: current }), title: t("Rename"), onClick: () => {
+ }) : (0, import_react54.createElement)("button", { type: "button", className: "bt-drawer-name", "aria-label": t("Rename {name}", { name: current }), title: t("Rename"), onClick: () => {
setDraftName(room2 && !room2.named ? "" : current);
setEditing(true);
} }, current),
- subtitle ? (0, import_react53.createElement)("span", { className: "bt-drawer-role" }, subtitle) : null
+ subtitle ? (0, import_react54.createElement)("span", { className: "bt-drawer-role" }, subtitle) : null
),
- tabs.length > 1 ? (0, import_react53.createElement)(
+ tabs.length > 1 ? (0, import_react54.createElement)(
"div",
{ key: "tabs", ref: glide.box, className: "bt-tabs", role: "tablist", "data-move": side },
- (0, import_react53.createElement)("span", { ref: glide.thumb, className: "bt-thumb", "aria-hidden": true }),
- tabs.map((key) => (0, import_react53.createElement)("button", { key, type: "button", role: "tab", className: "bt-tab", "aria-selected": tab === key, onClick: () => setTab(key) }, t(TAB_LABELS[key])))
+ (0, import_react54.createElement)("span", { ref: glide.thumb, className: "bt-thumb", "aria-hidden": true }),
+ tabs.map((key) => (0, import_react54.createElement)("button", { key, type: "button", role: "tab", className: "bt-tab", "aria-selected": tab === key, onClick: () => setTab(key) }, t(TAB_LABELS[key])))
) : null,
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(
"div",
{ key: `body:${tab}`, className: "bt-drawer-body", "data-move": move },
errorLine,
- room2 && tab === "details" ? (0, import_react53.createElement)(GroupOverview, { room: room2, roster, actions, usage, useWork, openSettings: () => setView("settings") }) : null,
+ room2 && tab === "details" ? (0, import_react54.createElement)(GroupOverview, { room: room2, roster, actions, usage, useWork, openSettings: () => setView("settings") }) : null,
bot && tab === "details" ? [
- (0, import_react53.createElement)(RunStats, { key: "stats", bot, part, running, actions }),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(RunStats, { key: "stats", bot, part, running, actions }),
+ (0, import_react54.createElement)(
"div",
{ key: "model", className: "bt-drawer-model" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Model")),
- (0, import_react53.createElement)(ModelMenu, { bot, roster, actions, run: run2, wide: true }),
- modelOf(bot, roster) ? null : (0, import_react53.createElement)("div", { className: "bt-note" }, t("Pick a model and {name} can start.", { name: bot.name }))
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Model")),
+ (0, import_react54.createElement)(ModelMenu, { bot, roster, actions, run: run2, wide: true }),
+ modelOf(bot, roster) ? null : (0, import_react54.createElement)("div", { className: "bt-note" }, t("Pick a model and {name} can start.", { name: bot.name }))
),
- (0, import_react53.createElement)(PermissionRow, { key: "permission", bot, roster, actions, run: run2 }),
- (0, import_react53.createElement)(BotConnectors, { key: "connectors", bot, roster, actions, run: run2 }),
- (0, import_react53.createElement)(
+ (0, import_react54.createElement)(PermissionRow, { key: "permission", bot, roster, actions, run: run2 }),
+ (0, import_react54.createElement)(BotConnectors, { key: "connectors", bot, roster, actions, run: run2 }),
+ (0, import_react54.createElement)(
"div",
{ key: "folder", className: "bt-drawer-model" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Working folder")),
- (0, import_react53.createElement)(FolderMenu, { value: bot.workDir, actions, run: run2, wide: true, onPick: (workDir) => run2(actions.updateBot(bot.id, { workDir })) })
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Working folder")),
+ (0, import_react54.createElement)(FolderMenu, { value: bot.workDir, actions, run: run2, wide: true, onPick: (workDir) => run2(actions.updateBot(bot.id, { workDir })) })
),
- bot.instructions ? (0, import_react53.createElement)(About, { key: "about", text: bot.instructions }) : (0, import_react53.createElement)("button", { key: "about", type: "button", className: "bt-more", onClick: () => setView("settings") }, t("Add instructions in Bot settings")),
- roster.memory === false ? null : (0, import_react53.createElement)(MemoryRow, { key: "memory", owner: { id: bot.id, name: bot.name }, actions }),
- usage ? (0, import_react53.createElement)(
+ bot.instructions ? (0, import_react54.createElement)(About, { key: "about", text: bot.instructions }) : (0, import_react54.createElement)("button", { key: "about", type: "button", className: "bt-more", onClick: () => setView("settings") }, t("Add instructions in Bot settings")),
+ roster.memory === false ? null : (0, import_react54.createElement)(MemoryRow, { key: "memory", owner: { id: bot.id, name: bot.name }, actions }),
+ usage ? (0, import_react54.createElement)(
"div",
{ key: "usage" },
- (0, import_react53.createElement)("div", { className: "bt-section-title" }, t("Usage")),
- (0, import_react53.createElement)("div", { className: "bt-kv" }, (0, import_react53.createElement)("span", null, bot.name), (0, import_react53.createElement)("span", null, usage))
+ (0, import_react54.createElement)("div", { className: "bt-section-title" }, t("Usage")),
+ (0, import_react54.createElement)("div", { className: "bt-kv" }, (0, import_react54.createElement)("span", null, bot.name), (0, import_react54.createElement)("span", null, usage))
) : null,
- (0, import_react53.createElement)(ScheduleSummary, { key: "routines", bot, actions })
+ (0, import_react54.createElement)(ScheduleSummary, { key: "routines", bot, actions })
] : null,
- bot && tab === "browser" ? (0, import_react53.createElement)(BrowserCards, { bot, sessionId, roster, actions, useBrowserTabs, useBrowserPages }) : null
+ bot && tab === "browser" ? (0, import_react54.createElement)(BrowserCards, { bot, sessionId, roster, actions, useBrowserTabs, useBrowserPages }) : null
)
];
}
@@ -22756,7 +23089,7 @@ function rectsOverlap(a, b) {
}
// src/client/browser-pane.js
-var import_react54 = require("react");
+var import_react55 = require("react");
var import_react_dom8 = require("react-dom");
var PANEL_LINGER_MS = 300;
var WIDTH_KEY = STORAGE.browserWidth;
@@ -22768,10 +23101,10 @@ var READ_FLASH_MS = 2400;
var EMPTY_PAGE = { url: "", title: "", favicon: null, loading: false, canGoBack: false, canGoForward: false, error: null, excerpt: "" };
var EMPTY_TABS2 = { ids: [], active: null };
var icon = (paths) => function BrowserIcon() {
- return (0, import_react54.createElement)(
+ return (0, import_react55.createElement)(
"svg",
{ width: 16, height: 16, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true },
- paths.map((d, index) => (0, import_react54.createElement)("path", { key: index, d }))
+ paths.map((d, index) => (0, import_react55.createElement)("path", { key: index, d }))
);
};
var GlobeIcon2 = icon(["M10 3a7 7 0 1 0 0 14 7 7 0 0 0 0-14z", "M3 10h14", "M10 3c2 2.2 2.9 4.5 2.9 7S12 14.8 10 17c-2-2.2-2.9-4.5-2.9-7S8 5.2 10 3z"]);
@@ -22786,9 +23119,9 @@ var ImportIcon = icon(["M10 3.5v8.5", "M6 8.5l4 4 4-4", "M4.5 14v1.5a1.5 1.5 0 0
var FileIcon = icon(["M6 3.5h5.5L14.5 6.5v10H6z", "M11 3.5v3.5h3.5"]);
var WindowIcon = icon(["M4 5h12v9.5H4z", "M4 7.5h12"]);
function Favicon({ src, className }) {
- const [failed, setFailed] = (0, import_react54.useState)(null);
- if (!src || failed === src) return (0, import_react54.createElement)("span", { className: `${className} bt-ptab-globe` }, (0, import_react54.createElement)(GlobeIcon2));
- return (0, import_react54.createElement)("img", { className, src, alt: "", "aria-hidden": true, onError: () => setFailed(src) });
+ const [failed, setFailed] = (0, import_react55.useState)(null);
+ if (!src || failed === src) return (0, import_react55.createElement)("span", { className: `${className} bt-ptab-globe` }, (0, import_react55.createElement)(GlobeIcon2));
+ return (0, import_react55.createElement)("img", { className, src, alt: "", "aria-hidden": true, onError: () => setFailed(src) });
}
var savedWidth = () => {
try {
@@ -22804,11 +23137,11 @@ var shortAddress = (url) => String(url ?? "").replace(/^https?:\/\//i, "").repla
var reducedMotion2 = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
var tabLabel = (page) => page.title || shortAddress(page.url) || t("New tab");
function PanelMenu({ items, className, "aria-label": label }) {
- const [open, setOpen] = (0, import_react54.useState)(false);
+ const [open, setOpen] = (0, import_react55.useState)(false);
const [shown, leaving] = useLinger(open, 120);
- const wrap = (0, import_react54.useRef)(null);
- const button = (0, import_react54.useRef)(null);
- (0, import_react54.useEffect)(() => {
+ const wrap = (0, import_react55.useRef)(null);
+ const button = (0, import_react55.useRef)(null);
+ (0, import_react55.useEffect)(() => {
if (!open) return void 0;
const onDown = (event) => {
if (wrap.current && !wrap.current.contains(event.target)) setOpen(false);
@@ -22827,10 +23160,10 @@ function PanelMenu({ items, className, "aria-label": label }) {
};
}, [open]);
if (items.length === 0) return null;
- return (0, import_react54.createElement)(
+ return (0, import_react55.createElement)(
"span",
{ className: "bt-pmenu", ref: wrap },
- (0, import_react54.createElement)("button", {
+ (0, import_react55.createElement)("button", {
ref: button,
type: "button",
className,
@@ -22839,11 +23172,11 @@ function PanelMenu({ items, className, "aria-label": label }) {
"aria-haspopup": "menu",
"aria-expanded": open,
onClick: () => setOpen((value) => !value)
- }, (0, import_react54.createElement)(DotsIcon)),
- shown ? (0, import_react54.createElement)(
+ }, (0, import_react55.createElement)(DotsIcon)),
+ shown ? (0, import_react55.createElement)(
"div",
{ className: "bt-pmenu-pop", role: "menu", "data-leaving": leaving || void 0 },
- items.map((item, index) => item.sep ? (0, import_react54.createElement)("span", { key: `sep-${index}`, className: "bt-pmenu-sep", role: "separator" }) : (0, import_react54.createElement)("button", {
+ items.map((item, index) => item.sep ? (0, import_react55.createElement)("span", { key: `sep-${index}`, className: "bt-pmenu-sep", role: "separator" }) : (0, import_react55.createElement)("button", {
key: item.key,
type: "button",
role: "menuitem",
@@ -22852,7 +23185,7 @@ function PanelMenu({ items, className, "aria-label": label }) {
setOpen(false);
item.onPick();
}
- }, (0, import_react54.createElement)(item.icon), (0, import_react54.createElement)("span", null, item.label)))
+ }, (0, import_react55.createElement)(item.icon), (0, import_react55.createElement)("span", null, item.label)))
) : null
);
}
@@ -22878,12 +23211,12 @@ function menuItemFor(key, actions, subject) {
var sideTitle = (chat) => chat?.entries?.[0]?.question?.trim() || t("Side chat");
function PanelStrip({ bot, subject, view, ids, active, sides, side, canBrowse, reading, onView, actions, useBrowserPages }) {
const pages = useBrowserPages((map) => map);
- const wrap = (0, import_react54.useRef)(null);
- const ind = (0, import_react54.useRef)(null);
- const spot = (0, import_react54.useRef)(null);
- const under = (0, import_react54.useRef)(null);
- const watcher = (0, import_react54.useRef)(null);
- (0, import_react54.useLayoutEffect)(() => {
+ const wrap = (0, import_react55.useRef)(null);
+ const ind = (0, import_react55.useRef)(null);
+ const spot = (0, import_react55.useRef)(null);
+ const under = (0, import_react55.useRef)(null);
+ const watcher = (0, import_react55.useRef)(null);
+ (0, import_react55.useLayoutEffect)(() => {
const box = wrap.current;
const capsule = ind.current;
if (!box || !capsule) return void 0;
@@ -22916,7 +23249,7 @@ function PanelStrip({ bot, subject, view, ids, active, sides, side, canBrowse, r
trail.cancel();
};
});
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
const box = wrap.current;
if (!box) return void 0;
const observer = new ResizeObserver(() => {
@@ -22940,13 +23273,13 @@ function PanelStrip({ bot, subject, view, ids, active, sides, side, canBrowse, r
canTerminal: actions.canOpenTerminal?.() === true,
canFiles: actions.canOpenFiles?.() === true
}).map((key) => menuItemFor(key, actions, subject));
- return (0, import_react54.createElement)(
+ return (0, import_react55.createElement)(
"div",
{ className: "bt-ptabs", role: "tablist", "aria-label": t("Panel tabs") },
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)(
"div",
{ className: "bt-ptabs-in", ref: wrap },
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)(
"button",
{
type: "button",
@@ -22956,13 +23289,13 @@ function PanelStrip({ bot, subject, view, ids, active, sides, side, canBrowse, r
title: bot.name,
onClick: () => onView("details")
},
- (0, import_react54.createElement)(BotMark, { bot, size: 20, state: reading ? "searching" : "idle" }),
- view === "details" ? (0, import_react54.createElement)("span", { className: "bt-ptab-name" }, bot.name) : null
+ (0, import_react55.createElement)(BotMark, { bot, size: 20, state: reading ? "searching" : "idle" }),
+ view === "details" ? (0, import_react55.createElement)("span", { className: "bt-ptab-name" }, bot.name) : null
),
ids.map((tabId) => {
const page = pages[tabId] ?? EMPTY_PAGE;
const on = view === "browser" && tabId === active;
- return (0, import_react54.createElement)(
+ return (0, import_react55.createElement)(
"button",
{
key: tabId,
@@ -22983,9 +23316,9 @@ function PanelStrip({ bot, subject, view, ids, active, sides, side, canBrowse, r
}
}
},
- (0, import_react54.createElement)(Favicon, { src: page.favicon, className: "bt-ptab-fav" }),
- (0, import_react54.createElement)("span", { className: "bt-ptab-title" }, tabLabel(page)),
- (0, import_react54.createElement)("span", {
+ (0, import_react55.createElement)(Favicon, { src: page.favicon, className: "bt-ptab-fav" }),
+ (0, import_react55.createElement)("span", { className: "bt-ptab-title" }, tabLabel(page)),
+ (0, import_react55.createElement)("span", {
className: "bt-ptab-x",
role: "button",
"aria-label": t("Close tab"),
@@ -22999,7 +23332,7 @@ function PanelStrip({ bot, subject, view, ids, active, sides, side, canBrowse, r
}),
sides.map((chat) => {
const on = view === "side" && chat.id === side;
- return (0, import_react54.createElement)(
+ return (0, import_react55.createElement)(
"button",
{
key: chat.id,
@@ -23017,9 +23350,9 @@ function PanelStrip({ bot, subject, view, ids, active, sides, side, canBrowse, r
}
}
},
- (0, import_react54.createElement)("span", { className: "bt-ptab-globe", "aria-hidden": true }, (0, import_react54.createElement)(SideIcon)),
- (0, import_react54.createElement)("span", { className: "bt-ptab-title" }, sideTitle(chat)),
- (0, import_react54.createElement)("span", {
+ (0, import_react55.createElement)("span", { className: "bt-ptab-globe", "aria-hidden": true }, (0, import_react55.createElement)(SideIcon)),
+ (0, import_react55.createElement)("span", { className: "bt-ptab-title" }, sideTitle(chat)),
+ (0, import_react55.createElement)("span", {
className: "bt-ptab-x",
role: "button",
"aria-label": t("Close side chat"),
@@ -23031,30 +23364,30 @@ function PanelStrip({ bot, subject, view, ids, active, sides, side, canBrowse, r
}, "×")
);
}),
- (0, import_react54.createElement)("span", { ref: ind, className: "bt-ptab-ind", "aria-hidden": true })
+ (0, import_react55.createElement)("span", { ref: ind, className: "bt-ptab-ind", "aria-hidden": true })
),
// The `···` and Close stay outside the scrolling tabs, so a narrow panel keeps both.
- (0, import_react54.createElement)(PanelMenu, { items, className: "bt-ptab-new", "aria-label": t("More") }),
- (0, import_react54.createElement)("button", { type: "button", className: "bt-icon-btn bt-ptab-close", "aria-label": t("Close panel"), title: t("Close panel"), onClick: () => actions.closePanel() }, (0, import_react54.createElement)(CloseIcon3))
+ (0, import_react55.createElement)(PanelMenu, { items, className: "bt-ptab-new", "aria-label": t("More") }),
+ (0, import_react55.createElement)("button", { type: "button", className: "bt-icon-btn bt-ptab-close", "aria-label": t("Close panel"), title: t("Close panel"), onClick: () => actions.closePanel() }, (0, import_react55.createElement)(CloseIcon3))
);
}
function BrowserView({ bot, tabId, leaving, landed, actions, useBrowserPages, hold }) {
const page = useBrowserPages((pages) => pages[tabId ?? ""]) ?? EMPTY_PAGE;
- const frame = (0, import_react54.useRef)(null);
- const input = (0, import_react54.useRef)(null);
- const [draft, setDraft] = (0, import_react54.useState)(null);
- const [covered, setCovered] = (0, import_react54.useState)(false);
+ const frame = (0, import_react55.useRef)(null);
+ const input = (0, import_react55.useRef)(null);
+ const [draft, setDraft] = (0, import_react55.useState)(null);
+ const [covered, setCovered] = (0, import_react55.useState)(false);
const imports = actions.browserImport;
- const [flow, setFlow] = (0, import_react54.useState)(null);
- const flowRef = (0, import_react54.useRef)(null);
- const [sources, setSources] = (0, import_react54.useState)(null);
- const [busy, setBusy] = (0, import_react54.useState)(false);
+ const [flow, setFlow] = (0, import_react55.useState)(null);
+ const flowRef = (0, import_react55.useRef)(null);
+ const [sources, setSources] = (0, import_react55.useState)(null);
+ const [busy, setBusy] = (0, import_react55.useState)(false);
const setFlowTracked = (next) => {
flowRef.current = typeof next === "function" ? next(flowRef.current) : next;
setFlow(flowRef.current);
};
const showGuest = landed && !leaving && !covered && Boolean(page.url) && !page.error && flow === null;
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
const update = () => {
const panel = frame.current?.getBoundingClientRect();
const overlaps2 = panel && [...document.querySelectorAll('[role="dialog"],[role="menu"],[role="listbox"]')].some((element) => rectsOverlap(panel, element.getBoundingClientRect()));
@@ -23069,7 +23402,7 @@ function BrowserView({ bot, tabId, leaving, landed, actions, useBrowserPages, ho
window.removeEventListener("resize", update);
};
}, []);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
setFlowTracked(null);
return () => {
const id = typeof flowRef.current === "object" && flowRef.current !== null ? flowRef.current.id : null;
@@ -23113,7 +23446,7 @@ function BrowserView({ bot, tabId, leaving, landed, actions, useBrowserPages, ho
if (id) void imports?.cancel(id).catch(() => {
});
};
- (0, import_react54.useLayoutEffect)(() => {
+ (0, import_react55.useLayoutEffect)(() => {
const element = frame.current;
if (!element || leaving || !tabId) {
void actions.browserShow(null);
@@ -23139,7 +23472,7 @@ function BrowserView({ bot, tabId, leaving, landed, actions, useBrowserPages, ho
window.removeEventListener("resize", schedule);
};
}, [tabId, showGuest, leaving]);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
setDraft(null);
if (landed && !page.url) input.current?.focus();
}, [tabId, landed]);
@@ -23155,38 +23488,38 @@ function BrowserView({ bot, tabId, leaving, landed, actions, useBrowserPages, ho
};
const editing = draft !== null;
const secure = /^https:/i.test(page.url);
- return (0, import_react54.createElement)(
+ return (0, import_react55.createElement)(
"div",
{ className: "bt-panel-view bt-panel-browser", "aria-label": t("{name}'s browser", { name: bot.name }) },
- actions.browserTakeover ? (0, import_react54.createElement)(
+ actions.browserTakeover ? (0, import_react55.createElement)(
"div",
{ className: "bt-browser-takeover", "data-held": hold?.by === "user" || void 0 },
- (0, import_react54.createElement)("span", null, hold?.by === "user" ? t("You control this browser") : hold?.by === "bot" ? t("The Bot handed this browser to you: {reason}", { reason: hold.reason }) : t("The Bot controls this browser")),
- hold?.by ? (0, import_react54.createElement)("button", { type: "button", onClick: () => void actions.browserGiveBack(bot.id) }, t("Give back")) : (0, import_react54.createElement)(
+ (0, import_react55.createElement)("span", null, hold?.by === "user" ? t("You control this browser") : hold?.by === "bot" ? t("The Bot handed this browser to you: {reason}", { reason: hold.reason }) : t("The Bot controls this browser")),
+ hold?.by ? (0, import_react55.createElement)("button", { type: "button", onClick: () => void actions.browserGiveBack(bot.id) }, t("Give back")) : (0, import_react55.createElement)(
"span",
{ className: "bt-browser-takeover-actions" },
- (0, import_react54.createElement)("button", { type: "button", onClick: () => void actions.browserTakeover(bot.id) }, t("Take over")),
- (0, import_react54.createElement)("button", { type: "button", onClick: () => void actions.browserStop(bot.id) }, t("Stop"))
+ (0, import_react55.createElement)("button", { type: "button", onClick: () => void actions.browserTakeover(bot.id) }, t("Take over")),
+ (0, import_react55.createElement)("button", { type: "button", onClick: () => void actions.browserStop(bot.id) }, t("Stop"))
)
) : null,
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)(
"div",
{ className: "bt-browser-bar" },
- (0, import_react54.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Back"), title: t("Back"), disabled: !page.canGoBack, onClick: () => actions.browserCommand(tabId, "back") }, (0, import_react54.createElement)(BackIcon)),
- (0, import_react54.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Forward"), title: t("Forward"), disabled: !page.canGoForward, onClick: () => actions.browserCommand(tabId, "forward") }, (0, import_react54.createElement)(ForwardIcon)),
- (0, import_react54.createElement)("button", {
+ (0, import_react55.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Back"), title: t("Back"), disabled: !page.canGoBack, onClick: () => actions.browserCommand(tabId, "back") }, (0, import_react55.createElement)(BackIcon)),
+ (0, import_react55.createElement)("button", { type: "button", className: "bt-icon-btn", "aria-label": t("Forward"), title: t("Forward"), disabled: !page.canGoForward, onClick: () => actions.browserCommand(tabId, "forward") }, (0, import_react55.createElement)(ForwardIcon)),
+ (0, import_react55.createElement)("button", {
type: "button",
className: "bt-icon-btn",
disabled: !page.url,
"aria-label": page.loading ? t("Stop") : t("Reload"),
title: page.loading ? t("Stop") : t("Reload"),
onClick: () => actions.browserCommand(tabId, page.loading ? "stop" : "reload")
- }, (0, import_react54.createElement)(page.loading ? StopIcon : ReloadIcon)),
- (0, import_react54.createElement)(
+ }, (0, import_react55.createElement)(page.loading ? StopIcon : ReloadIcon)),
+ (0, import_react55.createElement)(
"form",
{ className: "bt-browser-address", onSubmit: go, "data-editing": editing || void 0 },
- (0, import_react54.createElement)("span", { className: "bt-browser-scheme", "aria-hidden": true }, (0, import_react54.createElement)(secure && !editing ? LockIcon2 : GlobeIcon2)),
- (0, import_react54.createElement)("input", {
+ (0, import_react55.createElement)("span", { className: "bt-browser-scheme", "aria-hidden": true }, (0, import_react55.createElement)(secure && !editing ? LockIcon2 : GlobeIcon2)),
+ (0, import_react55.createElement)("input", {
ref: input,
type: "text",
spellCheck: false,
@@ -23210,14 +23543,14 @@ function BrowserView({ bot, tabId, leaving, landed, actions, useBrowserPages, ho
}
})
),
- (0, import_react54.createElement)("button", {
+ (0, import_react55.createElement)("button", {
type: "button",
className: "bt-icon-btn",
"aria-label": t("New browser tab"),
title: t("New browser tab"),
onClick: () => actions.browserNewTab(bot.id)
- }, (0, import_react54.createElement)(PlusTabIcon)),
- imports ? (0, import_react54.createElement)("button", {
+ }, (0, import_react55.createElement)(PlusTabIcon)),
+ imports ? (0, import_react55.createElement)("button", {
type: "button",
className: "bt-icon-btn bt-import-btn",
"aria-label": t("Import cookies"),
@@ -23228,29 +23561,29 @@ function BrowserView({ bot, tabId, leaving, landed, actions, useBrowserPages, ho
if (flow === "menu") setFlowTracked(null);
else openImport();
}
- }, (0, import_react54.createElement)(ImportIcon)) : null,
- page.loading ? (0, import_react54.createElement)("span", { className: "bt-browser-progress", "aria-hidden": true }) : null
+ }, (0, import_react55.createElement)(ImportIcon)) : null,
+ page.loading ? (0, import_react55.createElement)("span", { className: "bt-browser-progress", "aria-hidden": true }) : null
),
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)(
"div",
{ ref: frame, className: "bt-browser-frame", "data-guest": showGuest || void 0 },
- flow === "menu" ? (0, import_react54.createElement)(ImportMenu, { sources, busy, onFile: pickFile, onSource: pickSource, onClose: () => setFlowTracked(null) }) : null,
- typeof flow === "object" && flow !== null ? (0, import_react54.createElement)(ImportCard, { flow, page, busy, onApply: applyImport, onCancel: cancelImport, onCloseAndImport: closeAndImport, onDone: () => setFlowTracked(null), onReload: () => actions.browserCommand(tabId, "reload") }) : null,
- flow === null && page.error ? (0, import_react54.createElement)(
+ flow === "menu" ? (0, import_react55.createElement)(ImportMenu, { sources, busy, onFile: pickFile, onSource: pickSource, onClose: () => setFlowTracked(null) }) : null,
+ typeof flow === "object" && flow !== null ? (0, import_react55.createElement)(ImportCard, { flow, page, busy, onApply: applyImport, onCancel: cancelImport, onCloseAndImport: closeAndImport, onDone: () => setFlowTracked(null), onReload: () => actions.browserCommand(tabId, "reload") }) : null,
+ flow === null && page.error ? (0, import_react55.createElement)(
"div",
{ className: "bt-browser-empty" },
- (0, import_react54.createElement)("div", { className: "bt-browser-empty-title" }, t("This page didn’t load")),
- (0, import_react54.createElement)("div", { className: "bt-browser-empty-text" }, t(page.error)),
- page.url ? (0, import_react54.createElement)("button", { type: "button", className: "bt-browser-retry", onClick: () => {
+ (0, import_react55.createElement)("div", { className: "bt-browser-empty-title" }, t("This page didn’t load")),
+ (0, import_react55.createElement)("div", { className: "bt-browser-empty-text" }, t(page.error)),
+ page.url ? (0, import_react55.createElement)("button", { type: "button", className: "bt-browser-retry", onClick: () => {
void actions.browserNavigate(tabId, page.url);
} }, t("Try again")) : null
- ) : flow === null && !page.url ? (0, import_react54.createElement)(
+ ) : flow === null && !page.url ? (0, import_react55.createElement)(
"div",
{ className: "bt-browser-empty" },
- (0, import_react54.createElement)(BotMark, { bot, size: 48, state: "idle", live: true }),
- (0, import_react54.createElement)("div", { className: "bt-browser-empty-title" }, t("{name}'s browser", { name: bot.name })),
- (0, import_react54.createElement)("div", { className: "bt-browser-empty-text" }, t("Open a page here and {name} can read it with you. Logins and cookies stay with {name}; other Bots never see them.", { name: bot.name })),
- imports ? (0, import_react54.createElement)("button", { type: "button", className: "bt-browser-retry", onClick: openImport }, t("Import cookies")) : null
+ (0, import_react55.createElement)(BotMark, { bot, size: 48, state: "idle", live: true }),
+ (0, import_react55.createElement)("div", { className: "bt-browser-empty-title" }, t("{name}'s browser", { name: bot.name })),
+ (0, import_react55.createElement)("div", { className: "bt-browser-empty-text" }, t("Open a page here and {name} can read it with you. Logins and cookies stay with {name}; other Bots never see them.", { name: bot.name })),
+ imports ? (0, import_react55.createElement)("button", { type: "button", className: "bt-browser-retry", onClick: openImport }, t("Import cookies")) : null
) : null
)
);
@@ -23262,25 +23595,25 @@ function importError(error) {
return String(error);
}
function ImportMenu({ sources, busy, onFile, onSource, onClose }) {
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
const close = (event) => {
if (event.key === "Escape") onClose();
};
window.addEventListener("keydown", close);
return () => window.removeEventListener("keydown", close);
}, [onClose]);
- return (0, import_react54.createElement)(
+ return (0, import_react55.createElement)(
"div",
{ className: "bt-import-menu", role: "menu", "aria-label": t("Import cookies") },
- (0, import_react54.createElement)("div", { className: "bt-import-menu-title" }, t("Import cookies")),
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)("div", { className: "bt-import-menu-title" }, t("Import cookies")),
+ (0, import_react55.createElement)(
"button",
{ type: "button", className: "bt-import-item", role: "menuitem", disabled: busy, onClick: onFile },
- (0, import_react54.createElement)(FileIcon, { className: "bt-import-item-icon" }),
- (0, import_react54.createElement)("span", { className: "bt-import-item-name" }, t("From a file…")),
- (0, import_react54.createElement)("span", { className: "bt-import-item-sub" }, t("cookies.txt, JSON, storageState"))
+ (0, import_react55.createElement)(FileIcon, { className: "bt-import-item-icon" }),
+ (0, import_react55.createElement)("span", { className: "bt-import-item-name" }, t("From a file…")),
+ (0, import_react55.createElement)("span", { className: "bt-import-item-sub" }, t("cookies.txt, JSON, storageState"))
),
- sources === null ? (0, import_react54.createElement)("div", { className: "bt-import-menu-note" }, t("Loading…")) : sources.length === 0 ? (0, import_react54.createElement)("div", { className: "bt-import-menu-note" }, t("No browsers found")) : sources.map((source) => (0, import_react54.createElement)(
+ sources === null ? (0, import_react55.createElement)("div", { className: "bt-import-menu-note" }, t("Loading…")) : sources.length === 0 ? (0, import_react55.createElement)("div", { className: "bt-import-menu-note" }, t("No browsers found")) : sources.map((source) => (0, import_react55.createElement)(
"button",
{
key: source.id,
@@ -23290,83 +23623,83 @@ function ImportMenu({ sources, busy, onFile, onSource, onClose }) {
disabled: busy,
onClick: () => onSource(source)
},
- (0, import_react54.createElement)(WindowIcon, { className: "bt-import-item-icon" }),
- (0, import_react54.createElement)("span", { className: "bt-import-item-name" }, source.label),
- (0, import_react54.createElement)("span", { className: "bt-import-item-sub" }, t("Copy of its cookies"))
+ (0, import_react55.createElement)(WindowIcon, { className: "bt-import-item-icon" }),
+ (0, import_react55.createElement)("span", { className: "bt-import-item-name" }, source.label),
+ (0, import_react55.createElement)("span", { className: "bt-import-item-sub" }, t("Copy of its cookies"))
))
);
}
function ImportCard({ flow, page, busy, onApply, onCancel, onCloseAndImport, onDone, onReload }) {
const { stage } = flow;
if (stage === "running") {
- return (0, import_react54.createElement)("div", { className: "bt-import-card" }, (0, import_react54.createElement)(
+ return (0, import_react55.createElement)("div", { className: "bt-import-card" }, (0, import_react55.createElement)(
"div",
{ className: "bt-import-box" },
- (0, import_react54.createElement)("div", { className: "bt-import-title" }, t("{name} is running", { name: flow.source.name })),
- (0, import_react54.createElement)("div", { className: "bt-import-text" }, t("It must close for a moment so its cookies can be copied. It will reopen with your tabs.")),
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)("div", { className: "bt-import-title" }, t("{name} is running", { name: flow.source.name })),
+ (0, import_react55.createElement)("div", { className: "bt-import-text" }, t("It must close for a moment so its cookies can be copied. It will reopen with your tabs.")),
+ (0, import_react55.createElement)(
"div",
{ className: "bt-import-actions" },
- (0, import_react54.createElement)("button", { type: "button", className: "bt-import-primary", disabled: busy, onClick: onCloseAndImport }, busy ? t("Closing…") : t("Close {name} and import", { name: flow.source.name })),
- (0, import_react54.createElement)("button", { type: "button", className: "bt-import-plain", disabled: busy, onClick: onCancel }, t("Cancel"))
+ (0, import_react55.createElement)("button", { type: "button", className: "bt-import-primary", disabled: busy, onClick: onCloseAndImport }, busy ? t("Closing…") : t("Close {name} and import", { name: flow.source.name })),
+ (0, import_react55.createElement)("button", { type: "button", className: "bt-import-plain", disabled: busy, onClick: onCancel }, t("Cancel"))
)
));
}
if (stage === "error") {
- return (0, import_react54.createElement)("div", { className: "bt-import-card" }, (0, import_react54.createElement)(
+ return (0, import_react55.createElement)("div", { className: "bt-import-card" }, (0, import_react55.createElement)(
"div",
{ className: "bt-import-box" },
- (0, import_react54.createElement)("div", { className: "bt-import-title" }, t("Import failed")),
- (0, import_react54.createElement)("div", { className: "bt-import-text" }, flow.message),
- (0, import_react54.createElement)("div", { className: "bt-import-actions" }, (0, import_react54.createElement)("button", { type: "button", className: "bt-import-plain", onClick: onCancel }, t("Close")))
+ (0, import_react55.createElement)("div", { className: "bt-import-title" }, t("Import failed")),
+ (0, import_react55.createElement)("div", { className: "bt-import-text" }, flow.message),
+ (0, import_react55.createElement)("div", { className: "bt-import-actions" }, (0, import_react55.createElement)("button", { type: "button", className: "bt-import-plain", onClick: onCancel }, t("Close")))
));
}
if (stage === "result") {
const { report } = flow;
const problems = [...report.dropped ?? [], ...report.failed ?? []];
- return (0, import_react54.createElement)("div", { className: "bt-import-card" }, (0, import_react54.createElement)(
+ return (0, import_react55.createElement)("div", { className: "bt-import-card" }, (0, import_react55.createElement)(
"div",
{ className: "bt-import-box" },
- (0, import_react54.createElement)("div", { className: "bt-import-title" }, report.stored > 0 ? t("Imported {count} cookies", { count: report.stored }) : t("No cookies were stored")),
- flow.label ? (0, import_react54.createElement)("div", { className: "bt-import-sub" }, flow.label) : null,
- problems.length ? (0, import_react54.createElement)(
+ (0, import_react55.createElement)("div", { className: "bt-import-title" }, report.stored > 0 ? t("Imported {count} cookies", { count: report.stored }) : t("No cookies were stored")),
+ flow.label ? (0, import_react55.createElement)("div", { className: "bt-import-sub" }, flow.label) : null,
+ problems.length ? (0, import_react55.createElement)(
"div",
{ className: "bt-import-list" },
- problems.slice(0, 8).map((item, index) => (0, import_react54.createElement)(
+ problems.slice(0, 8).map((item, index) => (0, import_react55.createElement)(
"div",
{ key: index, className: "bt-import-line" },
- (0, import_react54.createElement)("span", { className: "bt-import-line-name" }, item.name ?? "—"),
- (0, import_react54.createElement)("span", { className: "bt-import-line-reason" }, item.reason)
+ (0, import_react55.createElement)("span", { className: "bt-import-line-name" }, item.name ?? "—"),
+ (0, import_react55.createElement)("span", { className: "bt-import-line-reason" }, item.reason)
)),
- problems.length > 8 ? (0, import_react54.createElement)("div", { className: "bt-import-line" }, (0, import_react54.createElement)("span", { className: "bt-import-line-reason" }, t("and {count} more", { count: problems.length - 8 }))) : null
+ problems.length > 8 ? (0, import_react55.createElement)("div", { className: "bt-import-line" }, (0, import_react55.createElement)("span", { className: "bt-import-line-reason" }, t("and {count} more", { count: problems.length - 8 }))) : null
) : null,
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)(
"div",
{ className: "bt-import-actions" },
- page.url ? (0, import_react54.createElement)("button", { type: "button", className: "bt-import-plain", onClick: onReload }, t("Reload the page")) : null,
- (0, import_react54.createElement)("button", { type: "button", className: "bt-import-primary", onClick: onDone }, t("Done"))
+ page.url ? (0, import_react55.createElement)("button", { type: "button", className: "bt-import-plain", onClick: onReload }, t("Reload the page")) : null,
+ (0, import_react55.createElement)("button", { type: "button", className: "bt-import-primary", onClick: onDone }, t("Done"))
)
));
}
const { preview } = flow;
- return (0, import_react54.createElement)("div", { className: "bt-import-card" }, (0, import_react54.createElement)(
+ return (0, import_react55.createElement)("div", { className: "bt-import-card" }, (0, import_react55.createElement)(
"div",
{ className: "bt-import-box" },
- (0, import_react54.createElement)("div", { className: "bt-import-title" }, t("Import {count} cookies", { count: preview.cookies })),
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)("div", { className: "bt-import-title" }, t("Import {count} cookies", { count: preview.cookies })),
+ (0, import_react55.createElement)(
"div",
{ className: "bt-import-sub" },
preview.source?.label ?? "",
flow.restarted ? ` · ${t("the browser was restarted")}` : ""
),
- preview.sites.length ? (0, import_react54.createElement)(
+ preview.sites.length ? (0, import_react55.createElement)(
"div",
{ className: "bt-import-list" },
- preview.sites.map((site) => (0, import_react54.createElement)(
+ preview.sites.map((site) => (0, import_react55.createElement)(
"div",
{ key: site.site, className: "bt-import-line" },
- (0, import_react54.createElement)("span", { className: "bt-import-line-name" }, site.site),
- (0, import_react54.createElement)(
+ (0, import_react55.createElement)("span", { className: "bt-import-line-name" }, site.site),
+ (0, import_react55.createElement)(
"span",
{ className: "bt-import-line-count" },
t("{count}", { count: site.cookies }),
@@ -23374,35 +23707,35 @@ function ImportCard({ flow, page, busy, onApply, onCancel, onCloseAndImport, onD
)
))
) : null,
- preview.skipped.length ? (0, import_react54.createElement)(
+ preview.skipped.length ? (0, import_react55.createElement)(
"div",
{ className: "bt-import-list" },
- (0, import_react54.createElement)("div", { className: "bt-import-note" }, t("{count} skipped", { count: preview.skipped.length })),
- preview.skipped.slice(0, 5).map((item, index) => (0, import_react54.createElement)(
+ (0, import_react55.createElement)("div", { className: "bt-import-note" }, t("{count} skipped", { count: preview.skipped.length })),
+ preview.skipped.slice(0, 5).map((item, index) => (0, import_react55.createElement)(
"div",
{ key: index, className: "bt-import-line" },
- (0, import_react54.createElement)("span", { className: "bt-import-line-name" }, item.name ?? item.where),
- (0, import_react54.createElement)("span", { className: "bt-import-line-reason" }, item.reason)
+ (0, import_react55.createElement)("span", { className: "bt-import-line-name" }, item.name ?? item.where),
+ (0, import_react55.createElement)("span", { className: "bt-import-line-reason" }, item.reason)
)),
- preview.skipped.length > 5 ? (0, import_react54.createElement)("div", { className: "bt-import-line" }, (0, import_react54.createElement)("span", { className: "bt-import-line-reason" }, t("and {count} more", { count: preview.skipped.length - 5 }))) : null
+ preview.skipped.length > 5 ? (0, import_react55.createElement)("div", { className: "bt-import-line" }, (0, import_react55.createElement)("span", { className: "bt-import-line-reason" }, t("and {count} more", { count: preview.skipped.length - 5 }))) : null
) : null,
- preview.warnings.length ? (0, import_react54.createElement)(
+ preview.warnings.length ? (0, import_react55.createElement)(
"details",
{ className: "bt-import-warns" },
- (0, import_react54.createElement)("summary", null, t("{count} adjusted", { count: preview.warnings.reduce((n, w) => n + w.count, 0) })),
- preview.warnings.map((w, index) => (0, import_react54.createElement)(
+ (0, import_react55.createElement)("summary", null, t("{count} adjusted", { count: preview.warnings.reduce((n, w) => n + w.count, 0) })),
+ preview.warnings.map((w, index) => (0, import_react55.createElement)(
"div",
{ key: index, className: "bt-import-line" },
- (0, import_react54.createElement)("span", { className: "bt-import-line-reason" }, `${w.count} × ${w.message}`)
+ (0, import_react55.createElement)("span", { className: "bt-import-line-reason" }, `${w.count} × ${w.message}`)
))
) : null,
- preview.notes.includes("session-cookies") ? (0, import_react54.createElement)("div", { className: "bt-import-note" }, t("Cookies without an expiry stay until the app closes.")) : null,
- preview.notes.includes("local-storage-left") ? (0, import_react54.createElement)("div", { className: "bt-import-note" }, t("Some sites also keep sign-in outside cookies; you may need to sign in again there.")) : null,
- (0, import_react54.createElement)(
+ preview.notes.includes("session-cookies") ? (0, import_react55.createElement)("div", { className: "bt-import-note" }, t("Cookies without an expiry stay until the app closes.")) : null,
+ preview.notes.includes("local-storage-left") ? (0, import_react55.createElement)("div", { className: "bt-import-note" }, t("Some sites also keep sign-in outside cookies; you may need to sign in again there.")) : null,
+ (0, import_react55.createElement)(
"div",
{ className: "bt-import-actions" },
- (0, import_react54.createElement)("button", { type: "button", className: "bt-import-primary", disabled: busy, onClick: onApply }, busy ? t("Importing…") : t("Import")),
- (0, import_react54.createElement)("button", { type: "button", className: "bt-import-plain", disabled: busy, onClick: onCancel }, t("Cancel"))
+ (0, import_react55.createElement)("button", { type: "button", className: "bt-import-primary", disabled: busy, onClick: onApply }, busy ? t("Importing…") : t("Import")),
+ (0, import_react55.createElement)("button", { type: "button", className: "bt-import-plain", disabled: busy, onClick: onCancel }, t("Cancel"))
)
));
}
@@ -23416,41 +23749,41 @@ function BotPanel({ pane, leaving, room: room2, overlay, roster, actions, useSes
const active = tabState.active;
const page = useBrowserPages((pages) => (active ? pages[active] : null) ?? EMPTY_PAGE);
const hold = useBrowserHolds?.((map) => bot ? map[bot.id] ?? null : null) ?? null;
- const root = (0, import_react54.useRef)(null);
- const fly = (0, import_react54.useRef)(null);
- const [landed, setLanded] = (0, import_react54.useState)(false);
- const [settling, setSettling] = (0, import_react54.useState)(false);
- const [width, setWidth] = (0, import_react54.useState)(savedWidth);
- const [dragging, setDragging] = (0, import_react54.useState)(false);
- const [resizing, setResizing] = (0, import_react54.useState)(false);
+ const root = (0, import_react55.useRef)(null);
+ const fly = (0, import_react55.useRef)(null);
+ const [landed, setLanded] = (0, import_react55.useState)(false);
+ const [settling, setSettling] = (0, import_react55.useState)(false);
+ const [width, setWidth] = (0, import_react55.useState)(savedWidth);
+ const [dragging, setDragging] = (0, import_react55.useState)(false);
+ const [resizing, setResizing] = (0, import_react55.useState)(false);
const instant = dragging || resizing;
- const [reading, setReading] = (0, import_react54.useState)(false);
+ const [reading, setReading] = (0, import_react55.useState)(false);
const panelWidth = fitWidth(width ?? (view === "browser" ? DEFAULT_WIDTH : DETAILS_WIDTH), widthRange(view, room2));
- (0, import_react54.useLayoutEffect)(() => {
+ (0, import_react55.useLayoutEffect)(() => {
if (view === "browser" && width === null) setWidth(DEFAULT_WIDTH);
}, [view, width]);
- (0, import_react54.useLayoutEffect)(() => {
+ (0, import_react55.useLayoutEffect)(() => {
chatRoom.hold(instant);
}, [instant]);
- const [last, setLast] = (0, import_react54.useState)({ view, width: panelWidth });
+ const [last, setLast] = (0, import_react55.useState)({ view, width: panelWidth });
if (last.view !== view || last.width !== panelWidth) {
setLast({ view, width: panelWidth });
if (last.view !== view) setSettling(last.width !== panelWidth && !instant);
}
- const shownView = (0, import_react54.useRef)(view);
- (0, import_react54.useLayoutEffect)(() => {
+ const shownView = (0, import_react55.useRef)(view);
+ (0, import_react55.useLayoutEffect)(() => {
const switched = settling && shownView.current !== view;
shownView.current = view;
if (switched) chatRoom.hold(true);
chatRoom.setRight(leaving || overlay ? null : panelWidth);
if (switched) chatRoom.hold(false);
}, [view, panelWidth, leaving, overlay]);
- (0, import_react54.useEffect)(() => () => {
+ (0, import_react55.useEffect)(() => () => {
chatRoom.setRight(null);
chatRoom.hold(false);
}, []);
- const mounted = (0, import_react54.useRef)(false);
- (0, import_react54.useEffect)(() => {
+ const mounted = (0, import_react55.useRef)(false);
+ (0, import_react55.useEffect)(() => {
if (!mounted.current) {
mounted.current = true;
return void 0;
@@ -23459,31 +23792,31 @@ function BotPanel({ pane, leaving, room: room2, overlay, roster, actions, useSes
const timer = setTimeout(() => setResizing(false), 160);
return () => clearTimeout(timer);
}, [room2]);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
if (!settling) return void 0;
const timer = setTimeout(() => setSettling(false), SPRING_SHAPE.duration + 40);
return () => clearTimeout(timer);
}, [settling, view]);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
const timer = setTimeout(() => setLanded(true), 360);
return () => clearTimeout(timer);
}, []);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
if (canBrowse) actions.browserEnsure(bot.id);
}, [bot?.id, canBrowse]);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
if (view === "browser" && (active === null || !tabState.ids.includes(active))) actions.setPanelView("details");
}, [view, active, tabState.ids.length]);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
if (pane.view === "side" && sideChat === void 0) actions.setPanelView("details");
}, [pane.view, sideChat]);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
if (view !== "browser" || leaving) void actions.browserShow?.(null);
}, [view, leaving]);
- (0, import_react54.useEffect)(() => () => {
+ (0, import_react55.useEffect)(() => () => {
void actions.browserShow?.(null);
}, []);
- (0, import_react54.useEffect)(() => {
+ (0, import_react55.useEffect)(() => {
if (!page.readAt || Date.now() - page.readAt > READ_FLASH_MS) return void 0;
setReading(true);
const timer = setTimeout(() => setReading(false), READ_FLASH_MS);
@@ -23527,7 +23860,7 @@ function BotPanel({ pane, leaving, room: room2, overlay, roster, actions, useSes
return actions[name](...args);
};
}
- (0, import_react54.useLayoutEffect)(() => {
+ (0, import_react55.useLayoutEffect)(() => {
const move = fly.current;
if (!move) return;
fly.current = null;
@@ -23610,7 +23943,7 @@ function BotPanel({ pane, leaving, room: room2, overlay, roster, actions, useSes
for (const name of ends) grip.addEventListener(name, onEnd);
};
const hasStrip = panelHasStrip(canBrowse, tabState.ids.length, sideChats.length);
- return (0, import_react54.createElement)(
+ return (0, import_react55.createElement)(
"aside",
{
ref: root,
@@ -23628,15 +23961,15 @@ function BotPanel({ pane, leaving, room: room2, overlay, roster, actions, useSes
if (event.target === event.currentTarget) setLanded(true);
}
},
- leaving || overlay ? null : (0, import_react54.createElement)("div", { className: "bt-panel-grip", role: "separator", "aria-orientation": "vertical", "aria-label": t("Resize panel"), onPointerDown: startResize }),
+ leaving || overlay ? null : (0, import_react55.createElement)("div", { className: "bt-panel-grip", role: "separator", "aria-orientation": "vertical", "aria-label": t("Resize panel"), onPointerDown: startResize }),
// Over the whole window while dragging: the cursor stays a resize cursor and the
// pages underneath (the chat, the guest) see no pointer.
- dragging ? (0, import_react_dom8.createPortal)((0, import_react54.createElement)("div", { className: "bt-drag-shield", "aria-hidden": true }), document.body) : null,
- hasStrip ? (0, import_react54.createElement)(PanelStrip, { bot, subject: pane.id, view, ids: tabState.ids, active, sides: sideChats, side: pane.side, canBrowse, reading, onView: switchView, actions: panelActions, useBrowserPages }) : null,
- view === "browser" && bot ? (0, import_react54.createElement)(BrowserView, { key: `browser:${active}`, bot, tabId: active, leaving, landed: landed && !settling, actions, useBrowserPages, hold }) : view === "side" && sideChat ? (0, import_react54.createElement)("div", { key: `side:${sideChat.id}`, className: "bt-panel-view" }, (0, import_react54.createElement)(SideChatView, { subject: pane.id, chat: sideChat, roster, actions: panelActions })) : (0, import_react54.createElement)(
+ dragging ? (0, import_react_dom8.createPortal)((0, import_react55.createElement)("div", { className: "bt-drag-shield", "aria-hidden": true }), document.body) : null,
+ hasStrip ? (0, import_react55.createElement)(PanelStrip, { bot, subject: pane.id, view, ids: tabState.ids, active, sides: sideChats, side: pane.side, canBrowse, reading, onView: switchView, actions: panelActions, useBrowserPages }) : null,
+ view === "browser" && bot ? (0, import_react55.createElement)(BrowserView, { key: `browser:${active}`, bot, tabId: active, leaving, landed: landed && !settling, actions, useBrowserPages, hold }) : view === "side" && sideChat ? (0, import_react55.createElement)("div", { key: `side:${sideChat.id}`, className: "bt-panel-view" }, (0, import_react55.createElement)(SideChatView, { subject: pane.id, chat: sideChat, roster, actions: panelActions })) : (0, import_react55.createElement)(
"div",
{ key: `details:${pane.id}:${pane.renaming ? "rename" : ""}:${pane.tab ?? ""}`, className: "bt-panel-view" },
- (0, import_react54.createElement)(DetailsDrawer, {
+ (0, import_react55.createElement)(DetailsDrawer, {
sessionId: pane.id,
startRenaming: pane.renaming,
startTab: pane.tab,
@@ -23778,7 +24111,7 @@ var BROWSER_CSS = `
`;
// src/client/overlays.js
-var import_react55 = require("react");
+var import_react56 = require("react");
var import_react_dom9 = require("react-dom");
var DIALOG_EXIT_MS = 160;
var MENU_EXIT_MS3 = 120;
@@ -23789,8 +24122,8 @@ function Overlays({ useRoster, useUi, useSessions, useSessionStatus, useActivity
const frameSnap = useFrame ? useFrame((value) => value) : { viewport: window.innerWidth, sidebarWidth: FALLBACK_SIDEBAR_WIDTH, collapsedWidth: 0 };
const pref = useSidebarPref ? useSidebarPref((value) => value) : "open";
const current = useSessions((list) => Object.values(list.byId).find((session) => (session?.retainedBy?.mainView ?? 0) > 0)?.id ?? null);
- const previous = (0, import_react55.useRef)(current);
- (0, import_react55.useEffect)(() => {
+ const previous = (0, import_react56.useRef)(current);
+ (0, import_react56.useEffect)(() => {
if (previous.current === current) return;
previous.current = current;
if (current) actions.followPanel?.(current);
@@ -23804,8 +24137,8 @@ function Overlays({ useRoster, useUi, useSessions, useSessionStatus, useActivity
panel: open ? { view: open.view, yielded: ui2.panelYield === true } : null
});
const shown = open !== null && layout.panel !== "folded" ? open : null;
- const [kept, setKept] = (0, import_react55.useState)(shown);
- (0, import_react55.useEffect)(() => {
+ const [kept, setKept] = (0, import_react56.useState)(shown);
+ (0, import_react56.useEffect)(() => {
if (shown) {
setKept(shown);
return void 0;
@@ -23824,17 +24157,17 @@ function Overlays({ useRoster, useUi, useSessions, useSessionStatus, useActivity
const [memory, memoryLeaving] = useLinger(ui2.memory && memoryOwner(ui2.memory) ? ui2.memory : null, DIALOG_EXIT_MS);
const owner = memory ? memoryOwner(memory) : null;
const [menu, menuLeaving] = useLinger(ui2.menu, MENU_EXIT_MS3);
- return (0, import_react55.createElement)(
- import_react55.Fragment,
+ return (0, import_react56.createElement)(
+ import_react56.Fragment,
null,
- pane ? (0, import_react_dom9.createPortal)((0, import_react55.createElement)(BotPanel, { pane, leaving: shown === null, room: layout.room, overlay: layout.panel === "overlay", roster, actions, useSessions, useSessionStatus, useActivity, useWork, useBrowserTabs, useBrowserPages, useBrowserHolds }), document.body) : null,
- ui2.newChat ? (0, import_react_dom9.createPortal)((0, import_react55.createElement)(NewChat, { key: ui2.newChat, mode: ui2.newChat, roster, actions }), document.body) : null,
- ui2.palette ? (0, import_react_dom9.createPortal)((0, import_react55.createElement)(CommandPalette, { key: ui2.palette.token, start: ui2.palette.query, token: ui2.palette.token, roster, actions, useSessions }), document.body) : null,
- ui2.exchange ? (0, import_react_dom9.createPortal)((0, import_react55.createElement)(ExchangeDialog, { pair: ui2.exchange, roster, actions }), document.body) : null,
- ui2.voice ? (0, import_react_dom9.createPortal)((0, import_react55.createElement)(VoiceMode, { key: ui2.voice, sessionId: ui2.voice, roster, actions, useSessions, useSessionStatus }), document.body) : null,
- menu ? (0, import_react_dom9.createPortal)((0, import_react55.createElement)(ContextMenu, { key: `${menu.kind ?? ""}:${menu.id}:${menu.x}:${menu.y}`, menu, roster, actions, leaving: menuLeaving }), document.body) : null,
- settings ? (0, import_react_dom9.createPortal)((0, import_react55.createElement)(SettingsDialog, { page: settings.page, id: settings.id, roster, actions, useUpdate, leaving: settingsLeaving }), document.body) : null,
- owner ? (0, import_react_dom9.createPortal)((0, import_react55.createElement)(MemoryDialog, { key: owner.id, owner, actions, leaving: memoryLeaving }), document.body) : null
+ pane ? (0, import_react_dom9.createPortal)((0, import_react56.createElement)(BotPanel, { pane, leaving: shown === null, room: layout.room, overlay: layout.panel === "overlay", roster, actions, useSessions, useSessionStatus, useActivity, useWork, useBrowserTabs, useBrowserPages, useBrowserHolds }), document.body) : null,
+ ui2.newChat ? (0, import_react_dom9.createPortal)((0, import_react56.createElement)(NewChat, { key: ui2.newChat, mode: ui2.newChat, roster, actions }), document.body) : null,
+ ui2.palette ? (0, import_react_dom9.createPortal)((0, import_react56.createElement)(CommandPalette, { key: ui2.palette.token, start: ui2.palette.query, token: ui2.palette.token, roster, actions, useSessions }), document.body) : null,
+ ui2.exchange ? (0, import_react_dom9.createPortal)((0, import_react56.createElement)(ExchangeDialog, { pair: ui2.exchange, roster, actions }), document.body) : null,
+ ui2.voice ? (0, import_react_dom9.createPortal)((0, import_react56.createElement)(VoiceMode, { key: ui2.voice, sessionId: ui2.voice, roster, actions, useSessions, useSessionStatus }), document.body) : null,
+ menu ? (0, import_react_dom9.createPortal)((0, import_react56.createElement)(ContextMenu, { key: `${menu.kind ?? ""}:${menu.id}:${menu.x}:${menu.y}`, menu, roster, actions, leaving: menuLeaving }), document.body) : null,
+ settings ? (0, import_react_dom9.createPortal)((0, import_react56.createElement)(SettingsDialog, { page: settings.page, id: settings.id, roster, actions, useUpdate, leaving: settingsLeaving }), document.body) : null,
+ owner ? (0, import_react_dom9.createPortal)((0, import_react56.createElement)(MemoryDialog, { key: owner.id, owner, actions, leaving: memoryLeaving }), document.body) : null
);
}
@@ -24892,13 +25225,13 @@ function lineDiff(before, after) {
}
// src/client/learning-card.js
-var import_react56 = require("react");
+var import_react57 = require("react");
var failedAnswers = /* @__PURE__ */ new Map();
function ProposalCard({ proposal, initialError = "", onFailure, onResolved, actions }) {
- const [busy, setBusy] = (0, import_react56.useState)(false);
- const [error, setError] = (0, import_react56.useState)(initialError);
- const busyRef = (0, import_react56.useRef)(false);
- const titleId = (0, import_react56.useId)();
+ const [busy, setBusy] = (0, import_react57.useState)(false);
+ const [error, setError] = (0, import_react57.useState)(initialError);
+ const busyRef = (0, import_react57.useRef)(false);
+ const titleId = (0, import_react57.useId)();
const answer = (approve) => {
if (busyRef.current) return;
busyRef.current = true;
@@ -24914,58 +25247,58 @@ function ProposalCard({ proposal, initialError = "", onFailure, onResolved, acti
});
};
const update = proposal.action === "update";
- const rows2 = (0, import_react56.useMemo)(() => lineDiff(update ? proposal.previous?.content : "", proposal.content), [update, proposal.previous?.content, proposal.content]);
+ const rows2 = (0, import_react57.useMemo)(() => lineDiff(update ? proposal.previous?.content : "", proposal.content), [update, proposal.previous?.content, proposal.content]);
if (proposal.kind === "agents") {
const blocks = proposal.edits.map((edit) => [
...(edit.op === "add" ? [] : editLines(edit.old)).map((line) => ({ kind: "removed", line })),
...(edit.op === "remove" ? [] : editLines(edit.text)).map((line) => ({ kind: "added", line }))
]);
- return (0, import_react56.createElement)(
+ return (0, import_react57.createElement)(
"section",
{ className: "bt-q bt-learning-card", role: "group", "aria-labelledby": titleId, "aria-busy": busy },
- (0, import_react56.createElement)(ProposalHead, { titleId, icon: PencilIcon, title: t("AGENTS.md update") }),
- (0, import_react56.createElement)(FileBox, { name: "AGENTS.md", path: proposal.folder, state: proposal.exists === false ? "Added" : "Modified", blocks }),
- proposal.edits.map((edit, index) => edit.why ? (0, import_react56.createElement)("p", { className: "bt-learning-why", key: index }, edit.why) : null),
- error ? (0, import_react56.createElement)("div", { className: "bt-learning-error", role: "alert" }, error) : null,
- (0, import_react56.createElement)(ProposalFoot, { busy, answer })
+ (0, import_react57.createElement)(ProposalHead, { titleId, icon: PencilIcon, title: t("AGENTS.md update") }),
+ (0, import_react57.createElement)(FileBox, { name: "AGENTS.md", path: proposal.folder, state: proposal.exists === false ? "Added" : "Modified", blocks }),
+ proposal.edits.map((edit, index) => edit.why ? (0, import_react57.createElement)("p", { className: "bt-learning-why", key: index }, edit.why) : null),
+ error ? (0, import_react57.createElement)("div", { className: "bt-learning-error", role: "alert" }, error) : null,
+ (0, import_react57.createElement)(ProposalFoot, { busy, answer })
);
}
const oldDetail = update && typeof proposal.previous?.description === "string" && proposal.previous.description !== proposal.description ? proposal.previous.description : void 0;
- return (0, import_react56.createElement)(
+ return (0, import_react57.createElement)(
"section",
{ className: "bt-q bt-learning-card", role: "group", "aria-labelledby": titleId, "aria-busy": busy },
- (0, import_react56.createElement)(ProposalHead, { titleId, title: proposal.name, kind: t(update ? "Skill update" : "New skill"), detail: proposal.description, oldDetail }),
- (0, import_react56.createElement)(FileBox, { name: "SKILL.md", path: `skills/${proposal.name}`, state: update ? "Updated" : "Added", blocks: [rows2] }),
- proposal.why ? (0, import_react56.createElement)("p", { className: "bt-learning-why" }, proposal.why) : null,
- error ? (0, import_react56.createElement)("div", { className: "bt-learning-error", role: "alert" }, error) : null,
- (0, import_react56.createElement)(ProposalFoot, { busy, answer })
+ (0, import_react57.createElement)(ProposalHead, { titleId, title: proposal.name, kind: t(update ? "Skill update" : "New skill"), detail: proposal.description, oldDetail }),
+ (0, import_react57.createElement)(FileBox, { name: "SKILL.md", path: `skills/${proposal.name}`, state: update ? "Updated" : "Added", blocks: [rows2] }),
+ proposal.why ? (0, import_react57.createElement)("p", { className: "bt-learning-why" }, proposal.why) : null,
+ error ? (0, import_react57.createElement)("div", { className: "bt-learning-error", role: "alert" }, error) : null,
+ (0, import_react57.createElement)(ProposalFoot, { busy, answer })
);
}
function ProposalHead({ titleId, icon: icon2 = MemoryIcon, title, kind, detail, oldDetail }) {
- return (0, import_react56.createElement)(
+ return (0, import_react57.createElement)(
"div",
{ className: "bt-q-head" },
- (0, import_react56.createElement)("span", { className: "bt-learning-icon", "aria-hidden": true }, (0, import_react56.createElement)(icon2)),
- (0, import_react56.createElement)(
+ (0, import_react57.createElement)("span", { className: "bt-learning-icon", "aria-hidden": true }, (0, import_react57.createElement)(icon2)),
+ (0, import_react57.createElement)(
"div",
{ className: "bt-q-text" },
- (0, import_react56.createElement)("p", { className: "bt-q-title", id: titleId }, title),
- kind ? (0, import_react56.createElement)("div", { className: "bt-q-detail" }, kind) : null,
- oldDetail ? (0, import_react56.createElement)("p", { className: "bt-learning-description bt-learning-old" }, (0, import_react56.createElement)("del", null, oldDetail)) : null,
- detail ? (0, import_react56.createElement)("p", { className: "bt-learning-description" }, detail) : null
+ (0, import_react57.createElement)("p", { className: "bt-q-title", id: titleId }, title),
+ kind ? (0, import_react57.createElement)("div", { className: "bt-q-detail" }, kind) : null,
+ oldDetail ? (0, import_react57.createElement)("p", { className: "bt-learning-description bt-learning-old" }, (0, import_react57.createElement)("del", null, oldDetail)) : null,
+ detail ? (0, import_react57.createElement)("p", { className: "bt-learning-description" }, detail) : null
),
- (0, import_react56.createElement)("span", { className: "bt-q-badge bt-learning-status" }, (0, import_react56.createElement)("span", { className: "bt-learning-dot", "aria-hidden": true }), t("Awaiting approval"))
+ (0, import_react57.createElement)("span", { className: "bt-q-badge bt-learning-status" }, (0, import_react57.createElement)("span", { className: "bt-learning-dot", "aria-hidden": true }), t("Awaiting approval"))
);
}
function ProposalFoot({ busy, answer }) {
- return (0, import_react56.createElement)(
+ return (0, import_react57.createElement)(
"div",
{ className: "bt-q-foot bt-learning-foot" },
- (0, import_react56.createElement)("button", { type: "button", className: "bt-learning-btn bt-learning-decline", disabled: busy, onClick: () => answer(false) }, t("Decline")),
- (0, import_react56.createElement)(
+ (0, import_react57.createElement)("button", { type: "button", className: "bt-learning-btn bt-learning-decline", disabled: busy, onClick: () => answer(false) }, t("Decline")),
+ (0, import_react57.createElement)(
"button",
{ type: "button", className: "bt-learning-btn bt-learning-approve", disabled: busy, onClick: () => answer(true) },
- (0, import_react56.createElement)(CheckIcon),
+ (0, import_react57.createElement)(CheckIcon),
t("Approve")
)
);
@@ -24973,43 +25306,43 @@ function ProposalFoot({ busy, answer }) {
var COLLAPSE_ROWS = 8;
var SIGNS = { added: "+", removed: "−", same: "" };
function FileBox({ name, path: path2, state, blocks }) {
- const [open, setOpen] = (0, import_react56.useState)(false);
+ const [open, setOpen] = (0, import_react57.useState)(false);
const all = blocks.flat();
const added = all.filter((row) => row.kind === "added").length;
const removed = all.filter((row) => row.kind === "removed").length;
const folds = all.length > COLLAPSE_ROWS;
const shut = folds && !open;
- return (0, import_react56.createElement)(
+ return (0, import_react57.createElement)(
"div",
{ className: "bt-learning-file" },
- (0, import_react56.createElement)(
+ (0, import_react57.createElement)(
"div",
{ className: "bt-learning-filehead" },
- (0, import_react56.createElement)("span", { className: "bt-learning-name" }, name),
- path2 ? (0, import_react56.createElement)("span", { className: "bt-learning-path" }, path2) : null,
- (0, import_react56.createElement)("span", { className: "bt-learning-spacer" }),
- added > 0 ? (0, import_react56.createElement)("span", { className: "bt-learning-plus" }, `+${added}`) : null,
- removed > 0 ? (0, import_react56.createElement)("span", { className: "bt-learning-minus" }, `−${removed}`) : null,
- (0, import_react56.createElement)("span", { className: `bt-learning-state bt-learning-state-${state.toLowerCase()}` }, t(state))
+ (0, import_react57.createElement)("span", { className: "bt-learning-name" }, name),
+ path2 ? (0, import_react57.createElement)("span", { className: "bt-learning-path" }, path2) : null,
+ (0, import_react57.createElement)("span", { className: "bt-learning-spacer" }),
+ added > 0 ? (0, import_react57.createElement)("span", { className: "bt-learning-plus" }, `+${added}`) : null,
+ removed > 0 ? (0, import_react57.createElement)("span", { className: "bt-learning-minus" }, `−${removed}`) : null,
+ (0, import_react57.createElement)("span", { className: `bt-learning-state bt-learning-state-${state.toLowerCase()}` }, t(state))
),
- (0, import_react56.createElement)(
+ (0, import_react57.createElement)(
"div",
{ className: shut ? "bt-learning-code bt-learning-shut" : "bt-learning-code" },
blocks.map((rows2, blockIndex) => [
- blockIndex > 0 ? (0, import_react56.createElement)("div", { className: "bt-learning-gap", key: `gap-${blockIndex}` }) : null,
- ...rows2.map((row, rowIndex) => (0, import_react56.createElement)(
+ blockIndex > 0 ? (0, import_react57.createElement)("div", { className: "bt-learning-gap", key: `gap-${blockIndex}` }) : null,
+ ...rows2.map((row, rowIndex) => (0, import_react57.createElement)(
"div",
{ className: `bt-learning-row bt-learning-${row.kind}`, key: `${blockIndex}-${rowIndex}` },
- (0, import_react56.createElement)("span", { className: "bt-learning-num", "aria-hidden": true }, row.number ?? ""),
- (0, import_react56.createElement)("span", { className: "bt-learning-sign", "aria-hidden": true }, SIGNS[row.kind]),
- (0, import_react56.createElement)("span", { className: "bt-learning-text" }, row.line || " ")
+ (0, import_react57.createElement)("span", { className: "bt-learning-num", "aria-hidden": true }, row.number ?? ""),
+ (0, import_react57.createElement)("span", { className: "bt-learning-sign", "aria-hidden": true }, SIGNS[row.kind]),
+ (0, import_react57.createElement)("span", { className: "bt-learning-text" }, row.line || " ")
))
])
),
- folds ? (0, import_react56.createElement)(
+ folds ? (0, import_react57.createElement)(
"div",
{ className: shut ? "bt-learning-morebar bt-learning-morebar-shut" : "bt-learning-morebar" },
- (0, import_react56.createElement)(
+ (0, import_react57.createElement)(
"button",
{ type: "button", className: "bt-learning-more", "aria-expanded": open, onClick: () => setOpen(!open) },
t(open ? "Show less" : "Show all {count} lines", { count: all.length })
@@ -25020,7 +25353,7 @@ function FileBox({ name, path: path2, state, blocks }) {
function LearningProposals({ turn, dock, sessionId, useRoster, actions }) {
const roster = useRoster((value) => value);
const facts = useTurnFacts(sessionId, actions);
- const [failed, setFailed] = (0, import_react56.useState)({});
+ const [failed, setFailed] = (0, import_react57.useState)({});
const bot = roster.byId?.[sessionId];
if (!bot || currentPart(bot) !== sessionId) return null;
const proposals = roster.learning?.[bot.id] ?? [];
@@ -25047,10 +25380,10 @@ function LearningProposals({ turn, dock, sessionId, useRoster, actions }) {
delete next[id];
return next;
});
- return (0, import_react56.createElement)("div", { className: dock ? "bt-learning-stack bt-learning-dock" : "bt-learning-stack" }, cards.map((proposal) => (0, import_react56.createElement)(
+ return (0, import_react57.createElement)("div", { className: dock ? "bt-learning-stack bt-learning-dock" : "bt-learning-stack" }, cards.map((proposal) => (0, import_react57.createElement)(
"div",
{ className: "bt-q-inline", key: proposal.id },
- (0, import_react56.createElement)(ProposalCard, {
+ (0, import_react57.createElement)(ProposalCard, {
proposal,
initialError: failed[proposal.id]?.error ?? failedAnswers.get(proposal.id)?.error,
onFailure,
@@ -25060,10 +25393,10 @@ function LearningProposals({ turn, dock, sessionId, useRoster, actions }) {
)));
}
function LearningTurnTail(props) {
- return (0, import_react56.createElement)(LearningProposals, { ...props, dock: false });
+ return (0, import_react57.createElement)(LearningProposals, { ...props, dock: false });
}
function LearningDock(props) {
- return (0, import_react56.createElement)(LearningProposals, { ...props, dock: true });
+ return (0, import_react57.createElement)(LearningProposals, { ...props, dock: true });
}
var LEARNING_CSS = `
.bt-learning-stack{display:flex;flex-direction:column;gap:4px}
@@ -26043,7 +26376,7 @@ function apply(ctx) {
const installShell = () => [
() => installCompiledStyles(SHELL_CSS, "shell"),
() => installCompiledStyles(SIDEBAR_CSS, "sidebar"),
- () => installCompiledStyles(SECRET_CSS + CONNECTOR_CSS, "secrets"),
+ () => installCompiledStyles(SECRET_CSS + CONNECTOR_CSS + CONNECTORS_PAGE_CSS, "secrets"),
() => installCompiledStyles(LEARNING_CSS, "learning"),
() => installCompiledStyles(MODEL_CSS + FOLDER_CSS + BOT_SETTINGS_CSS + GROUP_SETTINGS_CSS + AVATAR_LIBRARY_CSS, "models"),
() => installCompiledStyles(USAGE_CSS, "usage"),
diff --git a/ds-bot/scripts/style-debt.mjs b/ds-bot/scripts/style-debt.mjs
index 2d3f9d66..36bd1994 100644
--- a/ds-bot/scripts/style-debt.mjs
+++ b/ds-bot/scripts/style-debt.mjs
@@ -14,8 +14,8 @@ const PLUGIN = resolve(import.meta.dirname, '..')
const CLIENT = join(PLUGIN, 'src', 'client')
export const DEBT = join(PLUGIN, 'test', 'style-debt.json')
-// The theme colors, the Bot colors and the generated characters.
-const PALETTES = new Set(['themes.js', 'inks.js', 'characters.js'])
+// The theme colors, the Bot colors, the generated characters and the service logos.
+const PALETTES = new Set(['themes.js', 'inks.js', 'characters.js', 'connector-marks.js'])
export const RADII = ['0', '4px', '6px', '8px', '10px', '12px', '16px', '18px', '20px', '22px', '999px', '50%', 'inherit']
const COLOR = /#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})\b|\b(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\([^)]*\)/gi
diff --git a/ds-bot/src/client/connector-marks.js b/ds-bot/src/client/connector-marks.js
index bb9067ba..42c7d366 100644
--- a/ds-bot/src/client/connector-marks.js
+++ b/ds-bot/src/client/connector-marks.js
@@ -1,109 +1,159 @@
-// Connector and mailbox marks. The SI paths are each service's single-color
-// logo from Simple Icons 16.36.0 (CC0-1.0, https://simpleicons.org); Context7's
-// mark is the icon from upstash/context7 (MIT, public/context7-icon.svg). The
-// remaining marks are drawn here: Slack, Canva, monday.com, Attio, Exa,
-// DeepWiki, Microsoft Learn, Amap and the envelope. See NOTICE.
+// Connector and mailbox marks. The SI paths are each service's logo from
+// Simple Icons 16.36.0 (CC0-1.0, https://simpleicons.org); Context7's mark is
+// the icon from upstash/context7 (MIT, public/context7-icon.svg). The remaining
+// marks are drawn here: Slack, Canva, monday.com, Attio, Exa, DeepWiki,
+// Microsoft Learn, Amap and the envelope. See NOTICE.
import { createElement as h } from 'react'
-const svg = (...kids) => h('svg', { width: 20, height: 20, viewBox: '0 0 24 24', fill: 'currentColor', 'aria-hidden': true }, ...kids)
-const path = d => h('path', { d })
+const svg = (...kids) => h('svg', { width: 20, height: 20, viewBox: '0 0 24 24', fill: 'none', 'aria-hidden': true }, ...kids)
+const path = (d, fill) => h('path', { d, fill })
const mark = (...kids) => () => svg(...kids)
+const GITHUB_D = 'M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z'
+
// The GitHub mark predates the catalog; About also uses it.
export const GitHubMark = () => h('svg', { width: 20, height: 20, viewBox: '0 0 16 16', fill: 'currentColor', 'aria-hidden': true },
- h('path', { d: 'M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z' }))
+ h('path', { d: GITHUB_D }))
+const GithubBrandMark = () => h('svg', { width: 20, height: 20, viewBox: '0 0 16 16', fill: 'var(--bt-mark-ink)', 'aria-hidden': true },
+ h('path', { d: GITHUB_D }))
-// Simple Icons, one path per brand (see the file header).
+// Single-path Simple Icons with their brand hex.
const SI = {
- notion: "M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z",
- linear: "M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z",
- atlassian: "M7.12 11.084a.683.683 0 00-1.16.126L.075 22.974a.703.703 0 00.63 1.018h8.19a.678.678 0 00.63-.39c1.767-3.65.696-9.203-2.406-12.52zM11.434.386a15.515 15.515 0 00-.906 15.317l3.95 7.9a.703.703 0 00.628.388h8.19a.703.703 0 00.63-1.017L12.63.38a.664.664 0 00-1.196.006z",
- sentry: "M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z",
- stripe: "M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z",
- paypal: "M15.607 4.653H8.941L6.645 19.251H1.82L4.862 0h7.995c3.754 0 6.375 2.294 6.473 5.513-.648-.478-2.105-.86-3.722-.86m6.57 5.546c0 3.41-3.01 6.853-6.958 6.853h-2.493L11.595 24H6.74l1.845-11.538h3.592c4.208 0 7.346-3.634 7.153-6.949a5.24 5.24 0 0 1 2.848 4.686M9.653 5.546h6.408c.907 0 1.942.222 2.363.541-.195 2.741-2.655 5.483-6.441 5.483H8.714Z",
- square: "M4.01 0A4.01 4.01 0 000 4.01v15.98c0 2.21 1.8 4 4.01 4.01h15.98C22.2 24 24 22.2 24 19.99V4A4.01 4.01 0 0019.99 0H4zm1.62 4.36h12.74c.7 0 1.26.57 1.26 1.27v12.74c0 .7-.56 1.27-1.26 1.27H5.63c-.7 0-1.26-.57-1.26-1.27V5.63a1.27 1.27 0 011.26-1.27zm3.83 4.35a.73.73 0 00-.73.73v5.09c0 .4.32.72.72.72h5.1a.73.73 0 00.73-.72V9.44a.73.73 0 00-.73-.73h-5.1Z",
- cloudflare: "M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727",
- vercel: "m12 1.608 12 20.784H0Z",
- supabase: "M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z",
- neon: "M24 0V24l-9.365-8.045V24H0V0ZM2.942 21.087h8.751V9.563l9.365 8.204V2.919L2.942 2.914Z",
- figma: "M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z",
- intercom: "M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z",
- webflow: "m24 4.515-7.658 14.97H9.149l3.205-6.204h-.144C9.566 16.713 5.621 18.973 0 19.485v-6.118s3.596-.213 5.71-2.435H0V4.515h6.417v5.278l.144-.001 2.622-5.277h4.854v5.244h.144l2.72-5.244H24Z",
- wix: "m0 7.354 2.113 9.292h.801a1.54 1.54 0 0 0 1.506-1.218l1.351-6.34a.171.171 0 0 1 .167-.137c.08 0 .15.058.167.137l1.352 6.34a1.54 1.54 0 0 0 1.506 1.218h.805l2.113-9.292h-.565c-.62 0-1.159.43-1.296 1.035l-1.26 5.545-1.106-5.176a1.76 1.76 0 0 0-2.19-1.324c-.639.176-1.113.716-1.251 1.365l-1.094 5.127-1.26-5.537A1.33 1.33 0 0 0 .563 7.354H0zm13.992 0a.951.951 0 0 0-.951.95v8.342h.635a.952.952 0 0 0 .951-.95V7.353h-.635zm1.778 0 3.158 4.66-3.14 4.632h1.325c.368 0 .712-.181.918-.486l1.756-2.59a.12.12 0 0 1 .197 0l1.754 2.59c.206.305.55.486.918.486h1.326l-3.14-4.632L24 7.354h-1.326c-.368 0-.712.181-.918.486l-1.772 2.617a.12.12 0 0 1-.197 0L18.014 7.84a1.108 1.108 0 0 0-.918-.486H15.77z",
- netlify: "M6.49 19.04h-.23L5.13 17.9v-.23l1.73-1.71h1.2l.15.15v1.2L6.5 19.04ZM5.13 6.31V6.1l1.13-1.13h.23L8.2 6.68v1.2l-.15.15h-1.2L5.13 6.31Zm9.96 9.09h-1.65l-.14-.13v-3.83c0-.68-.27-1.2-1.1-1.23-.42 0-.9 0-1.43.02l-.07.08v4.96l-.14.14H8.9l-.13-.14V8.73l.13-.14h3.7a2.6 2.6 0 0 1 2.61 2.6v4.08l-.13.14Zm-8.37-2.44H.14L0 12.82v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14Zm17.14 0h-6.58l-.14-.14v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14ZM11.05 6.55V1.64l.14-.14h1.65l.14.14v4.9l-.14.14h-1.65l-.14-.13Zm0 15.81v-4.9l.14-.14h1.65l.14.13v4.91l-.14.14h-1.65l-.14-.14Z",
- airtable: "M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z",
- dropbox: "M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z",
- zapier: "M4.157 0A4.151 4.151 0 0 0 0 4.161v15.678A4.151 4.151 0 0 0 4.157 24h15.682A4.152 4.152 0 0 0 24 19.839V4.161A4.152 4.152 0 0 0 19.839 0H4.157Zm10.61 8.761h.03a.577.577 0 0 1 .23.038.585.585 0 0 1 .201.124.63.63 0 0 1 .162.431.612.612 0 0 1-.162.435.58.58 0 0 1-.201.128.58.58 0 0 1-.23.042.529.529 0 0 1-.235-.042.585.585 0 0 1-.332-.328.559.559 0 0 1-.038-.235.613.613 0 0 1 .17-.431.59.59 0 0 1 .405-.162Zm2.853 1.572c.03.004.061.004.095.004.325-.011.646.064.937.219.238.144.431.355.552.609.128.279.189.582.185.888v.193a2 2 0 0 1 0 .219h-2.498c.003.227.075.45.204.642a.78.78 0 0 0 .646.265.714.714 0 0 0 .484-.136.642.642 0 0 0 .23-.318l.915.257a1.398 1.398 0 0 1-.28.537c-.14.159-.321.284-.521.355a2.234 2.234 0 0 1-.836.136 1.923 1.923 0 0 1-1.001-.245 1.618 1.618 0 0 1-.665-.703 2.221 2.221 0 0 1-.227-1.036 1.95 1.95 0 0 1 .48-1.398 1.9 1.9 0 0 1 1.3-.488Zm-9.607.023c.162.004.325.026.48.079.207.065.4.174.563.314.26.302.393.692.366 1.088v2.276H8.53l-.109-.711h-.065c-.064.163-.155.31-.272.439a1.122 1.122 0 0 1-.374.264 1.023 1.023 0 0 1-.453.083 1.334 1.334 0 0 1-.866-.264.965.965 0 0 1-.329-.801.993.993 0 0 1 .076-.431 1.02 1.02 0 0 1 .242-.363 1.478 1.478 0 0 1 1.043-.303h.952v-.181a.696.696 0 0 0-.136-.454.553.553 0 0 0-.438-.154.695.695 0 0 0-.378.086.48.48 0 0 0-.193.254l-.99-.144a1.26 1.26 0 0 1 .257-.563c.14-.174.321-.302.533-.378.261-.091.54-.136.82-.129.053-.003.106-.007.163-.007Zm4.384.007c.174 0 .347.038.506.114.182.083.34.211.458.374.257.423.377.911.351 1.406a2.53 2.53 0 0 1-.355 1.448 1.148 1.148 0 0 1-1.009.517c-.204 0-.401-.045-.582-.136a1.052 1.052 0 0 1-.48-.457 1.298 1.298 0 0 1-.114-.234h-.045l.004 1.784h-1.059v-4.713h.904l.117.805h.057c.068-.208.177-.401.328-.56a1.129 1.129 0 0 1 .843-.344h.076v-.004Zm7.559.084h.903l.113.805h.053a1.37 1.37 0 0 1 .235-.484.813.813 0 0 1 .313-.242.82.82 0 0 1 .39-.076h.234v1.051h-.401a.662.662 0 0 0-.313.008.623.623 0 0 0-.272.155.663.663 0 0 0-.174.26.683.683 0 0 0-.027.314v1.875h-1.054v-3.666Zm-17.515.003h3.262v.896L3.73 13.104l.034.113h1.973l.042.9H2.4v-.9l1.931-1.754-.045-.117H2.441v-.896Zm11.815 0h1.055v3.659h-1.055V10.45Zm3.443.684.019.016a.69.69 0 0 0-.351.045.756.756 0 0 0-.287.204c-.11.155-.174.336-.189.522h1.545c-.034-.526-.257-.787-.74-.787h.003Zm-5.718.163c-.026 0-.057 0-.083.004a.78.78 0 0 0-.31.053.746.746 0 0 0-.257.189 1.016 1.016 0 0 0-.204.695v.064c-.015.257.057.507.204.711a.634.634 0 0 0 .253.196.638.638 0 0 0 .314.061.644.644 0 0 0 .578-.265c.14-.223.204-.48.189-.74a1.216 1.216 0 0 0-.181-.711.677.677 0 0 0-.503-.257Zm-4.509 1.266a.464.464 0 0 0-.268.102.373.373 0 0 0-.114.276c0 .053.008.106.027.155a.375.375 0 0 0 .087.132.576.576 0 0 0 .397.11v.004a.863.863 0 0 0 .563-.182.573.573 0 0 0 .211-.457v-.14h-.903Z",
- clickup: "M2 18.439l3.69-2.828c1.961 2.56 4.044 3.739 6.363 3.739 2.307 0 4.33-1.166 6.203-3.704L22 18.405C19.298 22.065 15.941 24 12.053 24 8.178 24 4.788 22.078 2 18.439zM12.04 6.15l-6.568 5.66-3.036-3.52L12.055 0l9.543 8.296-3.05 3.509z",
- todoist: "M21 0H3C1.35 0 0 1.35 0 3v3.858s3.854 2.24 4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.608 8.136-4.675.279-.161.58-.107.748-.01.164.097.606.348.84.48.232.134.221.502.013.622l-9.712 5.59c-.346.2-.69.204-1.048.002C3.478 10.907.998 9.463 0 8.882v2.02l4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.609 8.136-4.676.279-.16.58-.106.748-.008.164.096.606.347.84.48.232.133.221.5.013.62-.208.121-9.288 5.346-9.712 5.59-.346.2-.69.205-1.048.002C3.478 14.951.998 13.506 0 12.926v2.02l4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.609 8.136-4.676.279-.16.58-.106.748-.009.164.097.606.348.84.48.232.133.221.502.013.622l-9.712 5.59c-.346.199-.69.204-1.048.001C3.478 18.994.998 17.55 0 16.97V21c0 1.65 1.35 3 3 3h18c1.65 0 3-1.35 3-3V3c0-1.65-1.35-3-3-3z",
- miro: "M17.392 0H13.9L17 4.808 10.444 0H6.949l3.102 6.3L3.494 0H0l3.05 8.131L0 24h3.494L10.05 6.985 6.949 24h3.494L17 5.494 13.899 24h3.493L24 3.672 17.392 0z",
- postman: "M13.527.099C6.955-.744.942 3.9.099 10.473c-.843 6.572 3.8 12.584 10.373 13.428 6.573.843 12.587-3.801 13.428-10.374C24.744 6.955 20.101.943 13.527.099zm2.471 7.485a.855.855 0 0 0-.593.25l-4.453 4.453-.307-.307-.643-.643c4.389-4.376 5.18-4.418 5.996-3.753zm-4.863 4.861l4.44-4.44a.62.62 0 1 1 .847.903l-4.699 4.125-.588-.588zm.33.694l-1.1.238a.06.06 0 0 1-.067-.032.06.06 0 0 1 .01-.073l.645-.645.512.512zm-2.803-.459l1.172-1.172.879.878-1.979.426a.074.074 0 0 1-.085-.039.072.072 0 0 1 .013-.093zm-3.646 6.058a.076.076 0 0 1-.069-.083.077.077 0 0 1 .022-.046h.002l.946-.946 1.222 1.222-2.123-.147zm2.425-1.256a.228.228 0 0 0-.117.256l.203.865a.125.125 0 0 1-.211.117h-.003l-.934-.934-.294-.295 3.762-3.758 1.82-.393.874.874c-1.255 1.102-2.971 2.201-5.1 3.268zm5.279-3.428h-.002l-.839-.839 4.699-4.125a.952.952 0 0 0 .119-.127c-.148 1.345-2.029 3.245-3.977 5.091zm3.657-6.46l-.003-.002a1.822 1.822 0 0 1 2.459-2.684l-1.61 1.613a.119.119 0 0 0 0 .169l1.247 1.247a1.817 1.817 0 0 1-2.093-.343zm2.578 0a1.714 1.714 0 0 1-.271.218h-.001l-1.207-1.207 1.533-1.533c.661.72.637 1.832-.054 2.522zM18.855 6.05a.143.143 0 0 0-.053.157.416.416 0 0 1-.053.45.14.14 0 0 0 .023.197.141.141 0 0 0 .084.03.14.14 0 0 0 .106-.05.691.691 0 0 0 .087-.751.138.138 0 0 0-.194-.033z",
- asana: "M18.78 12.653c-2.882 0-5.22 2.336-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.34 5.22-5.22-2.336-5.22-5.22-5.22zm-13.56 0c-2.88 0-5.22 2.337-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.338 5.22-5.22-2.336-5.22-5.22-5.22zm12-6.525c0 2.883-2.337 5.22-5.22 5.22-2.882 0-5.22-2.337-5.22-5.22 0-2.88 2.338-5.22 5.22-5.22 2.883 0 5.22 2.34 5.22 5.22z",
- box: "M.959 5.523c-.54 0-.959.42-.959.899v7.549a4.59 4.59 0 004.613 4.494 4.717 4.717 0 004.135-2.457c.779 1.438 2.337 2.457 4.074 2.457 2.577 0 4.674-2.037 4.674-4.613.06-2.457-2.037-4.495-4.613-4.495-1.738 0-3.295.959-4.074 2.397-.78-1.438-2.338-2.397-4.135-2.397-1.079 0-2.038.36-2.817.899V6.422a.92.92 0 00-.898-.899zM17.602 9.26a.95.95 0 00-.704.158c-.36.3-.479.899-.18 1.318l2.397 3.116-2.396 3.115c-.3.42-.24.96.18 1.26.419.3 1.016.298 1.316-.122l2.039-2.636 2.096 2.697c.3.36.899.419 1.318.12.36-.3.42-.84.121-1.259l-2.338-3.115 2.338-3.057c.3-.419.298-1.018-.121-1.318-.48-.3-1.019-.24-1.318.18l-2.096 2.576-2.04-2.695c-.149-.18-.373-.3-.612-.338zM4.613 11.154c1.558 0 2.817 1.26 2.817 2.758 0 1.558-1.259 2.756-2.817 2.756-1.558 0-2.816-1.198-2.816-2.756 0-1.498 1.258-2.758 2.816-2.758zm8.27 0c1.558 0 2.816 1.26 2.816 2.758-.06 1.558-1.318 2.756-2.816 2.756-1.558 0-2.817-1.198-2.817-2.756 0-1.498 1.259-2.758 2.817-2.758Z",
- hubspot: "M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z",
- huggingface: "M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378 0 1.112.178 2.181.503 3.185.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284.278.173.48.408.71.694.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542.01.026.653 1.552 1.657 2.54.616.605 1.01 1.223 1.082 1.912.055.537-.096 1.059-.38 1.572.637.121 1.294.187 1.967.187.657 0 1.298-.063 1.921-.178-.287-.517-.44-1.041-.384-1.581.07-.69.465-1.307 1.081-1.913 1.004-.987 1.647-2.513 1.657-2.539.021-.074.083-.285.233-.542.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952.23-.286.432-.52.71-.694.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174 1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013 1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164 1.607-.007 2.984-1.155 3.572-1.164.196-.003.305.12.305.454 0 .886-.424 2.328-1.563 3.202-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026-.01.008-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116 1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243 1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444-.034-.016-.104-.008-.2.022q-.094.03-.216.087-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096 3 3 0 0 0-.26.219 2 2 0 0 0-.12.121 2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203 0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647 2.822 2.813 2.562 3.244-1.176-.506-1.176-.506-2.866-2.567-3.49-1.898.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405-.238.839-2.71-1.587-3.216-.642-.506.946 3.49 2.056 3.522 2.064 1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194 1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647-2.822 2.813-2.562 3.244 1.176-.506 1.176-.506 2.866-2.567 3.49-1.898-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405.238.839 2.71-1.587 3.216-.642.506.946-3.49 2.056-3.522 2.064-1.29.33-4.568 1.028-5.713-.624",
- gmail: "M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z",
- icloud: "M13.762 4.29a6.51 6.51 0 0 0-5.669 3.332 3.571 3.571 0 0 0-1.558-.36 3.571 3.571 0 0 0-3.516 3A4.918 4.918 0 0 0 0 14.796a4.918 4.918 0 0 0 4.92 4.914 4.93 4.93 0 0 0 .617-.045h14.42c2.305-.272 4.041-2.258 4.043-4.589v-.009a4.594 4.594 0 0 0-3.727-4.508 6.51 6.51 0 0 0-6.511-6.27z",
- qq: "M21.395 15.035a40 40 0 0 0-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526 4.632 17.351 0 12 0S4.474 4.632 4.474 9.241c0 .274.013.804.014.836l-1.08 2.695a39 39 0 0 0-.802 2.264c-1.021 3.283-.69 4.643-.438 4.673.54.065 2.103-2.472 2.103-2.472 0 1.469.756 3.387 2.394 4.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578 5.883.369 7.482.189 1.6.18 7.14.389 7.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836 1.637-1.384 2.393-3.302 2.393-4.771 0 0 1.563 2.537 2.103 2.472.251-.03.581-1.39-.438-4.673",
+ notion: ["M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z", "var(--bt-mark-ink)"],
+ linear: ["M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z", "#5E6AD2"],
+ sentry: ["M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z", "#6C5FC7"],
+ stripe: ["M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z", "#635BFF"],
+ square: ["M4.01 0A4.01 4.01 0 000 4.01v15.98c0 2.21 1.8 4 4.01 4.01h15.98C22.2 24 24 22.2 24 19.99V4A4.01 4.01 0 0019.99 0H4zm1.62 4.36h12.74c.7 0 1.26.57 1.26 1.27v12.74c0 .7-.56 1.27-1.26 1.27H5.63c-.7 0-1.26-.57-1.26-1.27V5.63a1.27 1.27 0 011.26-1.27zm3.83 4.35a.73.73 0 00-.73.73v5.09c0 .4.32.72.72.72h5.1a.73.73 0 00.73-.72V9.44a.73.73 0 00-.73-.73h-5.1Z", "#006AFF"],
+ vercel: ["m12 1.608 12 20.784H0Z", "var(--bt-mark-ink)"],
+ supabase: ["M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z", "#3ECF8E"],
+ neon: ["M24 0V24l-9.365-8.045V24H0V0ZM2.942 21.087h8.751V9.563l9.365 8.204V2.919L2.942 2.914Z", "#00C885"],
+ intercom: ["M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z", "#0057FF"],
+ webflow: ["m24 4.515-7.658 14.97H9.149l3.205-6.204h-.144C9.566 16.713 5.621 18.973 0 19.485v-6.118s3.596-.213 5.71-2.435H0V4.515h6.417v5.278l.144-.001 2.622-5.277h4.854v5.244h.144l2.72-5.244H24Z", "#146EF5"],
+ wix: ["m0 7.354 2.113 9.292h.801a1.54 1.54 0 0 0 1.506-1.218l1.351-6.34a.171.171 0 0 1 .167-.137c.08 0 .15.058.167.137l1.352 6.34a1.54 1.54 0 0 0 1.506 1.218h.805l2.113-9.292h-.565c-.62 0-1.159.43-1.296 1.035l-1.26 5.545-1.106-5.176a1.76 1.76 0 0 0-2.19-1.324c-.639.176-1.113.716-1.251 1.365l-1.094 5.127-1.26-5.537A1.33 1.33 0 0 0 .563 7.354H0zm13.992 0a.951.951 0 0 0-.951.95v8.342h.635a.952.952 0 0 0 .951-.95V7.353h-.635zm1.778 0 3.158 4.66-3.14 4.632h1.325c.368 0 .712-.181.918-.486l1.756-2.59a.12.12 0 0 1 .197 0l1.754 2.59c.206.305.55.486.918.486h1.326l-3.14-4.632L24 7.354h-1.326c-.368 0-.712.181-.918.486l-1.772 2.617a.12.12 0 0 1-.197 0L18.014 7.84a1.108 1.108 0 0 0-.918-.486H15.77z", "#0C6EFC"],
+ netlify: ["M6.49 19.04h-.23L5.13 17.9v-.23l1.73-1.71h1.2l.15.15v1.2L6.5 19.04ZM5.13 6.31V6.1l1.13-1.13h.23L8.2 6.68v1.2l-.15.15h-1.2L5.13 6.31Zm9.96 9.09h-1.65l-.14-.13v-3.83c0-.68-.27-1.2-1.1-1.23-.42 0-.9 0-1.43.02l-.07.08v4.96l-.14.14H8.9l-.13-.14V8.73l.13-.14h3.7a2.6 2.6 0 0 1 2.61 2.6v4.08l-.13.14Zm-8.37-2.44H.14L0 12.82v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14Zm17.14 0h-6.58l-.14-.14v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14ZM11.05 6.55V1.64l.14-.14h1.65l.14.14v4.9l-.14.14h-1.65l-.14-.13Zm0 15.81v-4.9l.14-.14h1.65l.14.13v4.91l-.14.14h-1.65l-.14-.14Z", "#00C7B7"],
+ dropbox: ["M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z", "#0061FF"],
+ zapier: ["M4.157 0A4.151 4.151 0 0 0 0 4.161v15.678A4.151 4.151 0 0 0 4.157 24h15.682A4.152 4.152 0 0 0 24 19.839V4.161A4.152 4.152 0 0 0 19.839 0H4.157Zm10.61 8.761h.03a.577.577 0 0 1 .23.038.585.585 0 0 1 .201.124.63.63 0 0 1 .162.431.612.612 0 0 1-.162.435.58.58 0 0 1-.201.128.58.58 0 0 1-.23.042.529.529 0 0 1-.235-.042.585.585 0 0 1-.332-.328.559.559 0 0 1-.038-.235.613.613 0 0 1 .17-.431.59.59 0 0 1 .405-.162Zm2.853 1.572c.03.004.061.004.095.004.325-.011.646.064.937.219.238.144.431.355.552.609.128.279.189.582.185.888v.193a2 2 0 0 1 0 .219h-2.498c.003.227.075.45.204.642a.78.78 0 0 0 .646.265.714.714 0 0 0 .484-.136.642.642 0 0 0 .23-.318l.915.257a1.398 1.398 0 0 1-.28.537c-.14.159-.321.284-.521.355a2.234 2.234 0 0 1-.836.136 1.923 1.923 0 0 1-1.001-.245 1.618 1.618 0 0 1-.665-.703 2.221 2.221 0 0 1-.227-1.036 1.95 1.95 0 0 1 .48-1.398 1.9 1.9 0 0 1 1.3-.488Zm-9.607.023c.162.004.325.026.48.079.207.065.4.174.563.314.26.302.393.692.366 1.088v2.276H8.53l-.109-.711h-.065c-.064.163-.155.31-.272.439a1.122 1.122 0 0 1-.374.264 1.023 1.023 0 0 1-.453.083 1.334 1.334 0 0 1-.866-.264.965.965 0 0 1-.329-.801.993.993 0 0 1 .076-.431 1.02 1.02 0 0 1 .242-.363 1.478 1.478 0 0 1 1.043-.303h.952v-.181a.696.696 0 0 0-.136-.454.553.553 0 0 0-.438-.154.695.695 0 0 0-.378.086.48.48 0 0 0-.193.254l-.99-.144a1.26 1.26 0 0 1 .257-.563c.14-.174.321-.302.533-.378.261-.091.54-.136.82-.129.053-.003.106-.007.163-.007Zm4.384.007c.174 0 .347.038.506.114.182.083.34.211.458.374.257.423.377.911.351 1.406a2.53 2.53 0 0 1-.355 1.448 1.148 1.148 0 0 1-1.009.517c-.204 0-.401-.045-.582-.136a1.052 1.052 0 0 1-.48-.457 1.298 1.298 0 0 1-.114-.234h-.045l.004 1.784h-1.059v-4.713h.904l.117.805h.057c.068-.208.177-.401.328-.56a1.129 1.129 0 0 1 .843-.344h.076v-.004Zm7.559.084h.903l.113.805h.053a1.37 1.37 0 0 1 .235-.484.813.813 0 0 1 .313-.242.82.82 0 0 1 .39-.076h.234v1.051h-.401a.662.662 0 0 0-.313.008.623.623 0 0 0-.272.155.663.663 0 0 0-.174.26.683.683 0 0 0-.027.314v1.875h-1.054v-3.666Zm-17.515.003h3.262v.896L3.73 13.104l.034.113h1.973l.042.9H2.4v-.9l1.931-1.754-.045-.117H2.441v-.896Zm11.815 0h1.055v3.659h-1.055V10.45Zm3.443.684.019.016a.69.69 0 0 0-.351.045.756.756 0 0 0-.287.204c-.11.155-.174.336-.189.522h1.545c-.034-.526-.257-.787-.74-.787h.003Zm-5.718.163c-.026 0-.057 0-.083.004a.78.78 0 0 0-.31.053.746.746 0 0 0-.257.189 1.016 1.016 0 0 0-.204.695v.064c-.015.257.057.507.204.711a.634.634 0 0 0 .253.196.638.638 0 0 0 .314.061.644.644 0 0 0 .578-.265c.14-.223.204-.48.189-.74a1.216 1.216 0 0 0-.181-.711.677.677 0 0 0-.503-.257Zm-4.509 1.266a.464.464 0 0 0-.268.102.373.373 0 0 0-.114.276c0 .053.008.106.027.155a.375.375 0 0 0 .087.132.576.576 0 0 0 .397.11v.004a.863.863 0 0 0 .563-.182.573.573 0 0 0 .211-.457v-.14h-.903Z", "#FF4F00"],
+ todoist: ["M21 0H3C1.35 0 0 1.35 0 3v3.858s3.854 2.24 4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.608 8.136-4.675.279-.161.58-.107.748-.01.164.097.606.348.84.48.232.134.221.502.013.622l-9.712 5.59c-.346.2-.69.204-1.048.002C3.478 10.907.998 9.463 0 8.882v2.02l4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.609 8.136-4.676.279-.16.58-.106.748-.008.164.096.606.347.84.48.232.133.221.5.013.62-.208.121-9.288 5.346-9.712 5.59-.346.2-.69.205-1.048.002C3.478 14.951.998 13.506 0 12.926v2.02l4.098 2.38c.31.18.694.177 1.004 0 .26-.147 8.02-4.609 8.136-4.676.279-.16.58-.106.748-.009.164.097.606.348.84.48.232.133.221.502.013.622l-9.712 5.59c-.346.199-.69.204-1.048.001C3.478 18.994.998 17.55 0 16.97V21c0 1.65 1.35 3 3 3h18c1.65 0 3-1.35 3-3V3c0-1.65-1.35-3-3-3z", "#E44332"],
+ miro: ["M17.392 0H13.9L17 4.808 10.444 0H6.949l3.102 6.3L3.494 0H0l3.05 8.131L0 24h3.494L10.05 6.985 6.949 24h3.494L17 5.494 13.899 24h3.493L24 3.672 17.392 0z", "#F59E0B"],
+ postman: ["M13.527.099C6.955-.744.942 3.9.099 10.473c-.843 6.572 3.8 12.584 10.373 13.428 6.573.843 12.587-3.801 13.428-10.374C24.744 6.955 20.101.943 13.527.099zm2.471 7.485a.855.855 0 0 0-.593.25l-4.453 4.453-.307-.307-.643-.643c4.389-4.376 5.18-4.418 5.996-3.753zm-4.863 4.861l4.44-4.44a.62.62 0 1 1 .847.903l-4.699 4.125-.588-.588zm.33.694l-1.1.238a.06.06 0 0 1-.067-.032.06.06 0 0 1 .01-.073l.645-.645.512.512zm-2.803-.459l1.172-1.172.879.878-1.979.426a.074.074 0 0 1-.085-.039.072.072 0 0 1 .013-.093zm-3.646 6.058a.076.076 0 0 1-.069-.083.077.077 0 0 1 .022-.046h.002l.946-.946 1.222 1.222-2.123-.147zm2.425-1.256a.228.228 0 0 0-.117.256l.203.865a.125.125 0 0 1-.211.117h-.003l-.934-.934-.294-.295 3.762-3.758 1.82-.393.874.874c-1.255 1.102-2.971 2.201-5.1 3.268zm5.279-3.428h-.002l-.839-.839 4.699-4.125a.952.952 0 0 0 .119-.127c-.148 1.345-2.029 3.245-3.977 5.091zm3.657-6.46l-.003-.002a1.822 1.822 0 0 1 2.459-2.684l-1.61 1.613a.119.119 0 0 0 0 .169l1.247 1.247a1.817 1.817 0 0 1-2.093-.343zm2.578 0a1.714 1.714 0 0 1-.271.218h-.001l-1.207-1.207 1.533-1.533c.661.72.637 1.832-.054 2.522zM18.855 6.05a.143.143 0 0 0-.053.157.416.416 0 0 1-.053.45.14.14 0 0 0 .023.197.141.141 0 0 0 .084.03.14.14 0 0 0 .106-.05.691.691 0 0 0 .087-.751.138.138 0 0 0-.194-.033z", "#FF6C37"],
+ asana: ["M18.78 12.653c-2.882 0-5.22 2.336-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.34 5.22-5.22-2.336-5.22-5.22-5.22zm-13.56 0c-2.88 0-5.22 2.337-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.338 5.22-5.22-2.336-5.22-5.22-5.22zm12-6.525c0 2.883-2.337 5.22-5.22 5.22-2.882 0-5.22-2.337-5.22-5.22 0-2.88 2.338-5.22 5.22-5.22 2.883 0 5.22 2.34 5.22 5.22z", "#F06A6A"],
+ box: ["M.959 5.523c-.54 0-.959.42-.959.899v7.549a4.59 4.59 0 004.613 4.494 4.717 4.717 0 004.135-2.457c.779 1.438 2.337 2.457 4.074 2.457 2.577 0 4.674-2.037 4.674-4.613.06-2.457-2.037-4.495-4.613-4.495-1.738 0-3.295.959-4.074 2.397-.78-1.438-2.338-2.397-4.135-2.397-1.079 0-2.038.36-2.817.899V6.422a.92.92 0 00-.898-.899zM17.602 9.26a.95.95 0 00-.704.158c-.36.3-.479.899-.18 1.318l2.397 3.116-2.396 3.115c-.3.42-.24.96.18 1.26.419.3 1.016.298 1.316-.122l2.039-2.636 2.096 2.697c.3.36.899.419 1.318.12.36-.3.42-.84.121-1.259l-2.338-3.115 2.338-3.057c.3-.419.298-1.018-.121-1.318-.48-.3-1.019-.24-1.318.18l-2.096 2.576-2.04-2.695c-.149-.18-.373-.3-.612-.338zM4.613 11.154c1.558 0 2.817 1.26 2.817 2.758 0 1.558-1.259 2.756-2.817 2.756-1.558 0-2.816-1.198-2.816-2.756 0-1.498 1.258-2.758 2.816-2.758zm8.27 0c1.558 0 2.816 1.26 2.816 2.758-.06 1.558-1.318 2.756-2.816 2.756-1.558 0-2.817-1.198-2.817-2.756 0-1.498 1.259-2.758 2.817-2.758Z", "#0061D5"],
+ hubspot: ["M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z", "#FF7A59"],
+ huggingface: ["M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378 0 1.112.178 2.181.503 3.185.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284.278.173.48.408.71.694.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542.01.026.653 1.552 1.657 2.54.616.605 1.01 1.223 1.082 1.912.055.537-.096 1.059-.38 1.572.637.121 1.294.187 1.967.187.657 0 1.298-.063 1.921-.178-.287-.517-.44-1.041-.384-1.581.07-.69.465-1.307 1.081-1.913 1.004-.987 1.647-2.513 1.657-2.539.021-.074.083-.285.233-.542.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952.23-.286.432-.52.71-.694.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174 1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013 1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164 1.607-.007 2.984-1.155 3.572-1.164.196-.003.305.12.305.454 0 .886-.424 2.328-1.563 3.202-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026-.01.008-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116 1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243 1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444-.034-.016-.104-.008-.2.022q-.094.03-.216.087-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096 3 3 0 0 0-.26.219 2 2 0 0 0-.12.121 2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203 0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647 2.822 2.813 2.562 3.244-1.176-.506-1.176-.506-2.866-2.567-3.49-1.898.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405-.238.839-2.71-1.587-3.216-.642-.506.946 3.49 2.056 3.522 2.064 1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194 1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647-2.822 2.813-2.562 3.244 1.176-.506 1.176-.506 2.866-2.567 3.49-1.898-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405.238.839 2.71-1.587 3.216-.642.506.946-3.49 2.056-3.522 2.064-1.29.33-4.568 1.028-5.713-.624", "#F59E0B"],
+ icloud: ["M13.762 4.29a6.51 6.51 0 0 0-5.669 3.332 3.571 3.571 0 0 0-1.558-.36 3.571 3.571 0 0 0-3.516 3A4.918 4.918 0 0 0 0 14.796a4.918 4.918 0 0 0 4.92 4.914 4.93 4.93 0 0 0 .617-.045h14.42c2.305-.272 4.041-2.258 4.043-4.589v-.009a4.594 4.594 0 0 0-3.727-4.508 6.51 6.51 0 0 0-6.511-6.27z", "#3693F3"],
+ qq: ["M21.395 15.035a40 40 0 0 0-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526 4.632 17.351 0 12 0S4.474 4.632 4.474 9.241c0 .274.013.804.014.836l-1.08 2.695a39 39 0 0 0-.802 2.264c-1.021 3.283-.69 4.643-.438 4.673.54.065 2.103-2.472 2.103-2.472 0 1.469.756 3.387 2.394 4.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578 5.883.369 7.482.189 1.6.18 7.14.389 7.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836 1.637-1.384 2.393-3.302 2.393-4.771 0 0 1.563 2.537 2.103 2.472.251-.03.581-1.39-.438-4.673", "#1EBAFC"],
}
-const siMarks = Object.fromEntries(Object.entries(SI).map(([id, d]) => [id, mark(path(d))]))
+const siMarks = Object.fromEntries(Object.entries(SI).map(([id, [d, fill]]) => [id, mark(path(d, fill))]))
+
+// Multi-color Simple Icons split by subpath.
+const AtlassianMark = mark(
+ path("M7.12 11.084a.683.683 0 00-1.16.126L.075 22.974a.703.703 0 00.63 1.018h8.19a.678.678 0 00.63-.39c1.767-3.65.696-9.203-2.406-12.52z", '#2684FF'),
+ path("M11.434.386a15.515 15.515 0 00-.906 15.317l3.95 7.9a.703.703 0 00.628.388h8.19a.703.703 0 00.63-1.017L12.63.38a.664.664 0 00-1.196.006z", '#0052CC'))
+
+const CloudflareMark = mark(
+ path("M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268z", '#F38020'),
+ path("M19.2656 11.2813c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727", '#FAAE40'))
+
+const PaypalMark = mark(
+ path('M15.607 4.653H8.941L6.645 19.251H1.82L4.862 0h7.995c3.754 0 6.375 2.294 6.473 5.513-.648-.478-2.105-.86-3.722-.86Z', '#1557C0'),
+ path('M22.178 10.199c0 3.41-3.01 6.853-6.958 6.853h-2.493L11.595 24H6.74l1.845-11.538h3.592c4.208 0 7.346-3.634 7.153-6.949a5.24 5.24 0 0 1 2.848 4.686Z', '#2997FF'),
+ path('M9.653 5.546h6.408c.907 0 1.942.222 2.363.541-.195 2.741-2.655 5.483-6.441 5.483H8.714Z', '#00457C'))
+
+const AirtableMark = mark(
+ path("M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257z", '#FCB400'),
+ path("M23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596z", '#18BFFF'),
+ path("M.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z", '#F82B60'))
-// Slack: a comma droplet and a capsule per quadrant, rotated 90° four times.
-const SLACK_DROP = 'M11.2 7H8.9A2.3 2.3 0 1 0 11.2 4.7V7Z'
+const ClickupMark = mark(
+ path("M2 18.439l3.69-2.828c1.961 2.56 4.044 3.739 6.363 3.739 2.307 0 4.33-1.166 6.203-3.704L22 18.405C19.298 22.065 15.941 24 12.053 24 8.178 24 4.788 22.078 2 18.439z", '#49CCF9'),
+ path("M12.04 6.15l-6.568 5.66-3.036-3.52L12.055 0l9.543 8.296-3.05 3.509z", '#7B68EE'))
+
+const FigmaMark = mark(
+ path('M8.4 1.2h3.6v7.2H8.4a3.6 3.6 0 1 1 0-7.2Z', '#F24E1E'),
+ path('M12 1.2h3.6a3.6 3.6 0 1 1 0 7.2H12V1.2Z', '#FF7262'),
+ path('M8.4 8.4h3.6v7.2H8.4a3.6 3.6 0 1 1 0-7.2Z', '#A259FF'),
+ h('circle', { cx: 15.6, cy: 12, r: 3.6, fill: '#1ABCFE' }),
+ path('M8.4 15.6h3.6v3.6a3.6 3.6 0 1 1-3.6-3.6Z', '#0ACF83'))
+
+const GmailMark = mark(
+ path('M0 5.457v13.909c0 .904.732 1.636 1.636 1.636h3.819V11.73L0 7.64V5.457Z', '#4285F4'),
+ path('M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L24 7.64V5.457Z', '#34A853'),
+ path('M18.545 4.64v7.09L24 7.64V5.457c0-2.023-2.31-3.177-3.927-1.964L18.545 4.64Z', '#FBBC04'),
+ path('M5.455 4.64v7.09L12 16.64l6.545-4.91V4.64L12 9.548 5.455 4.64Z', '#EA4335'),
+ path('M0 5.457v2.183l5.455 4.09V4.64L3.927 3.493C2.309 2.28 0 3.434 0 5.457Z', '#C5221F'))
+
+// Slack: a droplet and a capsule per quadrant in the four Slack colors.
+const SLACK_QUAD = [[0, '#36C5F0'], [90, '#2EB67D'], [180, '#ECB22E'], [270, '#E01E5A']]
const SlackMark = () => svg(
- [0, 90, 180, 270].map(a => h('g', { key: a, transform: `rotate(${a} 12 12)` },
- path(SLACK_DROP),
- h('rect', { x: 2.6, y: 8.2, width: 7.6, height: 4.4, rx: 2.2 }))))
+ SLACK_QUAD.map(([a, fill]) => h('g', { key: a, transform: `rotate(${a} 12 12)`, fill },
+ h('path', { d: 'M9.3 1.8a1.9 1.9 0 0 0 0 3.8h1.9V3.7a1.9 1.9 0 0 0-1.9-1.9Z' }),
+ h('rect', { x: 1.8, y: 7.4, width: 9.4, height: 3.8, rx: 1.9 }))))
-// Canva: the cursive C.
-const CanvaMark = mark(h('path', { d: 'M17.6 7.6C14.9 4.8 10.4 4.5 7.4 7.6 4.2 10.9 4.7 16.2 8.6 18.6c3 1.9 7.4 1.4 9.5-1.1', fill: 'none', stroke: 'currentColor', strokeWidth: 3, strokeLinecap: 'round' }))
+// Canva: the cursive C in teal-to-violet.
+const CanvaMark = mark(
+ path('M17.8 7.5A6.8 6.8 0 0 0 6.8 9.2c-1.5 3.6-.1 7.8 3.4 9.3a6.8 6.8 0 0 0 7.6-1.8', 'none'),
+ h('path', { d: 'M17.8 7.5A6.8 6.8 0 0 0 6.8 9.2', stroke: '#00C4CC', strokeWidth: 3.2, strokeLinecap: 'round' }),
+ h('path', { d: 'M6.8 9.2c-1.5 3.6-.1 7.8 3.4 9.3a6.8 6.8 0 0 0 7.6-1.8', stroke: '#7D2AE8', strokeWidth: 3.2, strokeLinecap: 'round' }))
-// monday.com: the bent capsule, the straight capsule and the dot.
+// monday.com: the two leaning capsules and the green dot.
const MondayMark = () => svg(
- h('path', { d: 'M5.2 3.4L8 14.8 13.8 18.6', fill: 'none', stroke: 'currentColor', strokeWidth: 4, strokeLinecap: 'round', strokeLinejoin: 'round' }),
- h('path', { d: 'M13.4 6.2L17.8 13.6', fill: 'none', stroke: 'currentColor', strokeWidth: 4, strokeLinecap: 'round' }),
- h('circle', { cx: 18.6, cy: 19.2, r: 2.5 }))
+ h('path', { d: 'M4.6 17.2L8.8 7.2', stroke: '#FF3D57', strokeWidth: 4.4, strokeLinecap: 'round' }),
+ h('path', { d: 'M12.2 17.2L16.4 7.2', stroke: '#FFCB00', strokeWidth: 4.4, strokeLinecap: 'round' }),
+ h('circle', { cx: 19.6, cy: 17.2, r: 2.3, fill: '#00CA72' }))
-// Attio: the two leaning slashes.
+// Attio: the two leaning bars.
const AttioMark = mark(h('g', { transform: 'translate(3 0) skewX(-15)' },
- h('rect', { x: 4.4, y: 3.4, width: 4.4, height: 17.2, rx: 1.2 }),
- h('rect', { x: 13.4, y: 3.4, width: 4.4, height: 17.2, rx: 1.2 })))
+ h('rect', { x: 4.4, y: 3.4, width: 4.4, height: 17.2, rx: 1.2, fill: 'var(--bt-mark-ink)' }),
+ h('rect', { x: 13.4, y: 3.4, width: 4.4, height: 17.2, rx: 1.2, fill: '#6366F1' })))
// Exa: the square with the pinched hourglass.
const ExaMark = () => svg(
- h('rect', { x: 4.7, y: 4.7, width: 14.6, height: 14.6, fill: 'none', stroke: 'currentColor', strokeWidth: 1.9 }),
- h('path', { d: 'M6 6L10.9 12 6 18M18 6L10.9 12 18 18', fill: 'none', stroke: 'currentColor', strokeWidth: 1.9 }))
+ h('rect', { x: 4.2, y: 4.2, width: 15.6, height: 15.6, rx: 1.5, stroke: '#254BF6', strokeWidth: 2.1 }),
+ h('path', { d: 'M5.6 5.6L11 12 5.6 18.4M18.4 5.6L11 12 18.4 18.4', stroke: '#254BF6', strokeWidth: 2.1 }))
// DeepWiki: the three fused hexagons.
const HEX = (cx, cy, r) => `M${cx} ${cy - r}l${r * 0.87} ${r * 0.5}v${r}l-${r * 0.87} ${r * 0.5}l-${r * 0.87}-${r * 0.5}v-${r}l${r * 0.87}-${r * 0.5}z`
-const DeepwikiMark = mark(path(HEX(7.2, 6.9, 4.4)) + HEX(7.2, 17.1, 4.4) + HEX(15.6, 12, 4.4))
+const DeepwikiMark = mark(
+ path(HEX(7.2, 6.9, 4.4) + HEX(7.2, 17.1, 4.4), '#2B7FFF'),
+ path(HEX(15.6, 12, 4.4), '#0D9488'))
// Context7 (MIT, upstash/context7): the serif 7 on the brand square's viewBox.
-const Context7Mark = () => h('svg', { width: 20, height: 20, viewBox: '0 0 28 28', fill: 'currentColor', 'aria-hidden': true },
- path('M10.5724 15.2565C10.5724 17.5025 9.6613 19.3778 8.17805 21.1047H11.6319L11.6319 22.7786H6.33459V21.1895C7.95557 19.3566 8.58065 17.8628 8.58065 15.2565L10.5724 15.2565Z'),
- path('M17.4276 15.2565C17.4276 17.5025 18.3387 19.3778 19.822 21.1047H16.3681V22.7786H21.6654V21.1895C20.0444 19.3566 19.4194 17.8628 19.4194 15.2565H17.4276Z'),
- path('M10.5724 12.7435C10.5724 10.4975 9.66131 8.62224 8.17807 6.89532L11.6319 6.89532V5.22137L6.33461 5.22137V6.81056C7.95558 8.64343 8.58066 10.1373 8.58066 12.7435L10.5724 12.7435Z'),
- path('M17.4276 12.7435C17.4276 10.4975 18.3387 8.62224 19.822 6.89532L16.3681 6.89532L16.3681 5.22138L21.6654 5.22138V6.81056C20.0444 8.64343 19.4194 10.1373 19.4194 12.7435H17.4276Z'))
+const Context7Mark = () => h('svg', { width: 20, height: 20, viewBox: '0 0 28 28', fill: '#059669', 'aria-hidden': true },
+ h('path', { d: 'M10.5724 15.2565C10.5724 17.5025 9.6613 19.3778 8.17805 21.1047H11.6319L11.6319 22.7786H6.33459V21.1895C7.95557 19.3566 8.58065 17.8628 8.58065 15.2565L10.5724 15.2565Z' }),
+ h('path', { d: 'M17.4276 15.2565C17.4276 17.5025 18.3387 19.3778 19.822 21.1047H16.3681V22.7786H21.6654V21.1895C20.0444 19.3566 19.4194 17.8628 19.4194 15.2565H17.4276Z' }),
+ h('path', { d: 'M10.5724 12.7435C10.5724 10.4975 9.66131 8.62224 8.17807 6.89532L11.6319 6.89532V5.22137L6.33461 5.22137V6.81056C7.95558 8.64343 8.58066 10.1373 8.58066 12.7435L10.5724 12.7435Z' }),
+ h('path', { d: 'M17.4276 12.7435C17.4276 10.4975 18.3387 8.62224 19.822 6.89532L16.3681 6.89532L16.3681 5.22138L21.6654 5.22138V6.81056C20.0444 8.64343 19.4194 10.1373 19.4194 12.7435H17.4276Z' }))
// Microsoft Learn: the four panes.
const MslearnMark = () => svg(
- h('rect', { x: 2.5, y: 2.5, width: 8.75, height: 8.75 }),
- h('rect', { x: 12.75, y: 2.5, width: 8.75, height: 8.75 }),
- h('rect', { x: 2.5, y: 12.75, width: 8.75, height: 8.75 }),
- h('rect', { x: 12.75, y: 12.75, width: 8.75, height: 8.75 }))
+ h('rect', { x: 2.5, y: 2.5, width: 8.75, height: 8.75, fill: '#F25022' }),
+ h('rect', { x: 12.75, y: 2.5, width: 8.75, height: 8.75, fill: '#7FBA00' }),
+ h('rect', { x: 2.5, y: 12.75, width: 8.75, height: 8.75, fill: '#00A4EF' }),
+ h('rect', { x: 12.75, y: 12.75, width: 8.75, height: 8.75, fill: '#FFB900' }))
-// Amap: the paper plane.
-const AmapMark = mark(path('M12 2.9L19.6 20.8 12.9 16.8 12 14.9 11.1 16.8 4.4 20.8Z'))
+// Amap: the blue paper plane.
+const AmapMark = mark(
+ path('M20.6 3.4L2.4 11.9l6.7 2.5L20.6 3.4Z', '#42A5F5'),
+ path('M20.6 3.4L9.1 14.4l1.1 5.8 3.2-3.7 7.2-13.1Z', '#1565C0'),
+ path('M20.6 3.4l-7.2 13.1 4.8 3.9 2.4-17Z', '#1E88E5'))
-// The mailbox and the mail providers with no brand mark.
-const EnvelopeMark = () => svg(
- h('rect', { x: 2.4, y: 5.2, width: 19.2, height: 13.6, rx: 2.4 }),
- h('path', { d: 'M4.2 7.4L12 13.6 19.8 7.4', fill: 'none', stroke: 'var(--bt-card)', strokeWidth: 1.7, strokeLinecap: 'round', strokeLinejoin: 'round' }))
+// The mailbox and the mail providers with no separate symbol.
+const envelope = fill => mark(
+ path('M3.2 5.2h17.6c.7 0 1.3.4 1.6 1L12 13.4 1.6 6.2c.3-.6.9-1 1.6-1Z', fill),
+ path('M1.6 8.2l9.7 6.7a1.2 1.2 0 0 0 1.4 0l9.7-6.7v8.6a2 2 0 0 1-2 2H3.6a2 2 0 0 1-2-2V8.2Z', fill))
+const EnvelopeBlue = envelope('#3B82F6')
+const EnvelopeRed = envelope('#E60012')
export const MARKS = {
- github: GitHubMark,
+ github: GithubBrandMark,
...siMarks,
- 'cloudflare-docs': siMarks.cloudflare,
+ atlassian: AtlassianMark,
+ cloudflare: CloudflareMark,
+ 'cloudflare-docs': CloudflareMark,
+ paypal: PaypalMark,
+ airtable: AirtableMark,
+ clickup: ClickupMark,
+ figma: FigmaMark,
slack: SlackMark,
canva: CanvaMark,
monday: MondayMark,
@@ -113,11 +163,12 @@ export const MARKS = {
context7: Context7Mark,
mslearn: MslearnMark,
amap: AmapMark,
- mail: EnvelopeMark,
- 'mail-163': EnvelopeMark,
- 'mail-126': EnvelopeMark,
- 'mail-other': EnvelopeMark,
- 'mail-gmail': siMarks.gmail,
+ mail: EnvelopeBlue,
+ 'mail-163': EnvelopeRed,
+ 'mail-126': EnvelopeRed,
+ 'mail-other': EnvelopeBlue,
+ 'mail-gmail': GmailMark,
'mail-icloud': siMarks.icloud,
'mail-qq': siMarks.qq,
}
+
diff --git a/ds-bot/src/client/connectors-page.js b/ds-bot/src/client/connectors-page.js
new file mode 100644
index 00000000..219d6b60
--- /dev/null
+++ b/ds-bot/src/client/connectors-page.js
@@ -0,0 +1,249 @@
+// Settings → Connectors. The catalog is a two-column grid of apps grouped by
+// category, with search and category chips on top and the connected count at the
+// right. A tile connects in place when nothing more is needed; anything that needs
+// a form, a code or a choice opens the app's own view, which reuses the rows in
+// connectors.js. Connected apps and the mailbox accounts have their own view.
+import { createElement as h, useEffect, useRef, useState } from 'react'
+import { ConnectorMark, ConnectorRow, MailAccount, MailCatalogRow, MailPending, MailRules, AddMenu, openSignIn } from './connectors.js'
+import { reserveWindow } from './open-window.js'
+import { ChevronLeftIcon, ChevronRightIcon, CheckIcon, PlusIcon, SearchIcon } from './icons.js'
+import { hostText, t } from './i18n.js'
+
+const CATEGORIES = [['dev', 'Developer'], ['docs', 'Docs & files'], ['work', 'Work'], ['design', 'Design'], ['data', 'Data'], ['commerce', 'Commerce'], ['search', 'Search']]
+const FEATURED = ['github', 'mail', 'notion', 'linear', 'figma', 'slack']
+const PREVIEW = 6
+
+const matches = (query, ...texts) => query === '' || texts.join(' ').toLowerCase().includes(query.toLowerCase())
+
+// The row that just turned ready plays one sweep; rows that load already
+// connected stay still.
+function useJustConnected(state) {
+ const last = useRef(state)
+ const [fresh, setFresh] = useState(false)
+ useEffect(() => {
+ const was = last.current
+ last.current = state
+ if (state !== 'ready' || was === 'ready') return undefined
+ setFresh(true)
+ const timer = setTimeout(() => setFresh(false), 1100)
+ return () => clearTimeout(timer)
+ }, [state])
+ return fresh
+}
+
+function AppIcon({ app, size = 36 }) {
+ return h('span', { className: 'bt-app-icon', style: { width: size, height: size } }, h(ConnectorMark, { connector: app }))
+}
+
+function tileStatus(app) {
+ if (app.state === 'ready') return app.account ?? null
+ if (app.state === 'connecting') return app.pending ? t('Waiting for sign-in…') : t('Connecting…')
+ if (app.state === 'needs-sign-in') return t('Sign in again')
+ if (app.state === 'needs-client') return t('This service needs an app client ID')
+ if (app.state === 'error') return t('Could not connect: {error}', { error: hostText(app.error ?? '') })
+ return null
+}
+
+function AppTile({ app, actions, onOpen }) {
+ const [busy, setBusy] = useState(false)
+ const [error, setError] = useState(null)
+ const fresh = useJustConnected(app.state)
+ const run = (task, after, failed) => {
+ setBusy(true); setError(null)
+ return Promise.resolve(task).then(value => after?.(value), (failure) => { failed?.(); setError(failure?.message ?? String(failure)) }).finally(() => setBusy(false))
+ }
+ // Connects in place when no form is needed; a browser sign-in gets its window
+ // inside the click so it is not blocked.
+ const connect = () => {
+ const auth = app.auth ?? {}
+ if (app.id === 'mail' || auth.kind === 'key' || (auth.kind === 'oauth' && auth.token && !auth.client?.id)) return onOpen()
+ if (auth.kind === 'oauth') {
+ const win = reserveWindow()
+ return void run(actions.connectorConnect(app.id, {}), view => openSignIn(win, app.id, view), () => win.close())
+ }
+ return void run(actions.connectorConnect(app.id, {}))
+ }
+ const ready = app.state === 'ready'
+ const off = app.state === 'off'
+ const status = error ? hostText(error) : tileStatus(app)
+ const label = busy ? t('Connecting…') : ready ? t('Connected') : off ? t('Connect') : app.state === 'error' ? t('Try again') : app.state === 'needs-sign-in' ? t('Sign in again') : t('Open')
+ const press = () => {
+ if (off) return connect()
+ if (app.state === 'error') return void run(actions.connectorRetry(app.id))
+ return onOpen()
+ }
+ return h('div', { className: 'bt-app', 'data-state': app.state, 'data-fresh': fresh ? '' : undefined, 'data-error': error ? '' : undefined },
+ h('button', { type: 'button', className: 'bt-app-main', onClick: onOpen },
+ h(AppIcon, { app }),
+ h('span', { className: 'bt-app-text' },
+ h('span', { className: 'bt-app-name' }, app.name, app.custom ? h('span', { className: 'bt-tag' }, t('Added')) : null),
+ status ? h('span', { className: 'bt-app-status' }, status) : null)),
+ h('button', { type: 'button', className: ready ? 'bt-app-btn bt-app-btn-done' : 'bt-app-btn', disabled: busy, onClick: press },
+ ready ? h(CheckIcon) : null, label))
+}
+
+function Grid({ apps, actions, open }) {
+ return h('div', { className: 'bt-app-grid' }, apps.map(app => h(AppTile, { key: app.id, app, actions, onOpen: () => open(app.id) })))
+}
+
+function Section({ title, apps, actions, open, onAll }) {
+ if (apps.length === 0) return null
+ return h('section', { className: 'bt-app-section' },
+ h('div', { className: 'bt-app-section-head' },
+ h('h3', null, title),
+ onAll && apps.length > PREVIEW ? h('button', { type: 'button', className: 'bt-app-all', onClick: onAll }, t('See all')) : null),
+ h(Grid, { apps: onAll ? apps.slice(0, PREVIEW) : apps, actions, open }))
+}
+
+function Subview({ title, onBack, children }) {
+ return h('div', { className: 'bt-app-sub' },
+ h('div', { className: 'bt-app-sub-head' },
+ h('button', { type: 'button', className: 'bt-icon-btn', 'aria-label': t('Back'), onClick: onBack }, h(ChevronLeftIcon)),
+ h('h3', null, title)),
+ children)
+}
+
+function ConnectedSummary({ apps, count, onClick }) {
+ if (count === 0) return null
+ return h('button', { type: 'button', className: 'bt-app-summary', onClick },
+ h('span', { className: 'bt-app-stack' }, apps.slice(0, 3).map(app => h(AppIcon, { key: app.id, app, size: 22 }))),
+ t('{count} connected', { count }), h(ChevronRightIcon))
+}
+
+export function ConnectorsPage({ roster, actions }) {
+ const [query, setQuery] = useState('')
+ const [category, setCategory] = useState('')
+ const [view, setView] = useState(null)
+ const [error, setError] = useState(null)
+ const run = (task, onDone) => Promise.resolve(task).then((value) => { setError(null); onDone?.(value) }, failure => setError(failure?.message ?? String(failure)))
+ const data = roster?.connectors ?? { connectors: [], mail: { accounts: [], google: false } }
+ const mail = data.mail ?? { accounts: [] }
+ const accounts = mail.accounts ?? []
+ const mailbox = {
+ id: 'mail', name: t('Mailbox'), category: 'work', about: t('QQ, 163, 126, Gmail, iCloud, and other IMAP mail'),
+ state: accounts.length > 0 ? 'ready' : (mail.pending?.length ?? 0) > 0 ? 'connecting' : 'off',
+ account: accounts.length === 1 ? accounts[0].address : accounts.length > 1 ? t('{count} accounts', { count: accounts.length }) : null,
+ }
+ const apps = [mailbox, ...(data.connectors ?? []).filter(c => c.id !== 'mail')]
+ const connected = apps.filter(app => app.state !== 'off' || app.pending)
+ const marks = [...accounts.map(account => ({ id: `mail-${account.provider}`, name: account.address })), ...connected.filter(app => app.id !== 'mail')]
+ const count = accounts.length + connected.filter(app => app.id !== 'mail').length
+ const open = id => setView({ app: id })
+ const back = () => setView(null)
+ const banner = error ? h('div', { className: 'bt-connector-error bt-connector-banner', role: 'alert' }, hostText(error)) : null
+
+ if (view?.app === 'mail') {
+ return h(Subview, { title: t('Mailbox'), onBack: back }, banner,
+ h('div', { className: 'bt-set-card bt-connectors-card' },
+ accounts.map(account => h(MailAccount, { key: account.id, account, actions, run })),
+ (mail.pending ?? []).map(p => h(MailPending, { key: p.address ?? 'google', pending: p })),
+ h(MailCatalogRow, { mail, actions }),
+ h(MailRules, { mail, bots: roster?.bots, actions, run })))
+ }
+ const shown = view?.app ? apps.find(app => app.id === view.app) : null
+ if (shown) {
+ return h(Subview, { title: shown.name, onBack: back },
+ h('div', { className: 'bt-set-card bt-connectors-card bt-app-detail' }, h(ConnectorRow, { connector: shown, actions })),
+ shown.about ? h('p', { className: 'bt-app-about' }, t(shown.about)) : null)
+ }
+ if (view === 'connected') {
+ const rows = connected.filter(app => app.id !== 'mail')
+ return h(Subview, { title: t('Connected'), onBack: back }, banner,
+ h('div', { className: 'bt-set-card bt-connectors-card' },
+ count === 0 ? h('div', { className: 'bt-set-row' }, h('span', { className: 'bt-set-hint' }, t('No connectors connected'))) : null,
+ rows.map(app => h(ConnectorRow, { key: app.id, connector: app, actions })),
+ accounts.map(account => h(MailAccount, { key: account.id, account, actions, run })),
+ (mail.pending ?? []).map(p => h(MailPending, { key: p.address ?? 'google', pending: p })),
+ h(MailRules, { mail, bots: roster?.bots, actions, run })))
+ }
+ if (view === 'custom') {
+ return h(Subview, { title: t('Other MCP server'), onBack: back }, banner,
+ h('div', { className: 'bt-set-card bt-connectors-card' }, h(AddMenu, { actions, run })))
+ }
+
+ const inCategory = id => apps.filter(app => app.category === id)
+ const searching = query.trim() !== ''
+ const found = apps.filter(app => (category === '' || app.category === category) && matches(query.trim(), app.name, app.about ?? ''))
+ let body
+ if (searching || category !== '') {
+ body = found.length === 0
+ ? h('p', { className: 'bt-app-empty' }, t('Nothing matches'))
+ : h(Grid, { apps: found, actions, open })
+ } else {
+ const featured = FEATURED.map(id => apps.find(app => app.id === id)).filter(Boolean)
+ body = [
+ h(Section, { key: 'featured', title: t('Recommended'), apps: featured, actions, open }),
+ ...CATEGORIES.map(([id, label]) => h(Section, { key: id, title: t(label), apps: inCategory(id), actions, open, onAll: () => setCategory(id) })),
+ ]
+ }
+ return h('div', { className: 'bt-apps' },
+ banner,
+ h('div', { className: 'bt-app-bar' },
+ h('label', { className: 'bt-app-search' },
+ h(SearchIcon),
+ h('input', { type: 'search', 'aria-label': t('Search connectors'), placeholder: t('Search connectors'), value: query, onChange: e => setQuery(e.target.value) })),
+ h('button', { type: 'button', className: 'bt-app-pill', onClick: () => setView('custom') }, h(PlusIcon), t('Custom')),
+ h(ConnectedSummary, { apps: marks, count, onClick: () => setView('connected') })),
+ h('div', { className: 'bt-app-chips', role: 'group', 'aria-label': t('Category') },
+ [['', 'All'], ...CATEGORIES].map(([id, label]) => h('button', { key: id || 'all', type: 'button', 'aria-pressed': category === id, onClick: () => setCategory(id) }, t(label)))),
+ body)
+}
+
+export const CONNECTORS_PAGE_CSS = `
+.bt-apps{display:flex;flex-direction:column;gap:14px;container-type:inline-size}
+.bt-app-bar{display:flex;align-items:center;gap:8px}
+.bt-app-search{flex:1;min-width:0;display:flex;align-items:center;gap:8px;height:36px;padding:0 14px;border:1px solid var(--bt-line);border-radius:999px;background:var(--bt-card);color:var(--bt-ink-3);cursor:text}
+.bt-app-search:focus-within{border-color:var(--bt-line-2)}
+.bt-app-search svg{flex:none;width:15px;height:15px}
+.bt-app-search input{flex:1;min-width:0;border:0;outline:none;background:none;color:var(--bt-ink);font:inherit;font-size:13px}
+.bt-app-search input::-webkit-search-cancel-button{display:none}
+.bt-app-pill,.bt-app-summary{flex:none;display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border:1px solid var(--bt-line);border-radius:999px;background:var(--bt-card);color:var(--bt-ink);font:inherit;font-size:13px;cursor:pointer;transition:background-color .12s ease}
+.bt-app-pill:hover,.bt-app-summary:hover{background:var(--bt-hover)}
+.bt-app-pill svg{width:14px;height:14px}
+.bt-app-summary{padding:0 10px 0 6px;border-color:transparent;background:none;color:var(--bt-ink-2)}
+.bt-app-summary svg{width:12px;height:12px}
+.bt-app-stack{display:inline-flex}
+.bt-app-stack .bt-app-icon{border-radius:6px;box-shadow:0 0 0 1.5px var(--bt-main)}
+.bt-app-stack .bt-app-icon+.bt-app-icon{margin-left:-6px}
+.bt-app-stack .bt-app-icon svg,.bt-app-stack .bt-connector-mono{width:13px;height:13px;font-size:9px}
+.bt-app-chips{display:flex;flex-wrap:wrap;gap:6px}
+.bt-app-chips button{height:28px;padding:0 12px;border:0;border-radius:999px;background:var(--bt-hover);color:var(--bt-ink);font:inherit;font-size:13px;cursor:pointer;transition:background-color .12s ease,color .12s ease}
+.bt-app-chips button:hover{background:var(--bt-active)}
+.bt-app-chips button[aria-pressed=true]{background:var(--bt-ink);color:var(--bt-main)}
+.bt-app-section{display:flex;flex-direction:column;gap:4px;margin-top:6px}
+.bt-app-section-head{display:flex;align-items:center;justify-content:space-between;min-height:24px}
+.bt-app-section-head h3{margin:0;font-size:14px;line-height:20px;font-weight:600}
+.bt-app-all{border:0;background:none;padding:2px 4px;color:var(--bt-ink-3);font:inherit;font-size:12px;cursor:pointer}
+.bt-app-all:hover{color:var(--bt-ink)}
+.bt-app-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:28px}
+@container (max-width:520px){.bt-app-grid{grid-template-columns:minmax(0,1fr)}}
+.bt-app{position:relative;display:flex;align-items:center;gap:10px;min-height:60px;border-radius:12px}
+.bt-app-main{flex:1;min-width:0;display:flex;align-items:center;gap:12px;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
+.bt-app-icon{--bt-mark-ink:var(--bt-ink);flex:none;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:var(--bt-card);box-shadow:inset 0 0 0 .5px var(--bt-line-2)}
+.bt-app-icon svg{width:22px;height:22px}
+.bt-app-text{min-width:0;display:flex;flex-direction:column;gap:1px}
+.bt-app-name{display:inline-flex;align-items:center;gap:6px;font-size:14px;line-height:20px;color:var(--bt-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.bt-app-status{font-size:12px;line-height:16px;color:var(--bt-ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.bt-app[data-state=error] .bt-app-status,.bt-app[data-error] .bt-app-status{color:var(--bt-danger)}
+.bt-app-btn{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:72px;height:28px;padding:0 14px;border:0;border-radius:999px;background:var(--bt-hover);color:var(--bt-ink);font:inherit;font-size:13px;cursor:pointer;transition:background-color .12s ease,color .12s ease}
+.bt-app-btn:hover:not(:disabled){background:var(--bt-active)}
+.bt-app-btn:disabled{opacity:.5;cursor:default}
+.bt-app-btn svg{width:13px;height:13px}
+.bt-app-btn-done{background:none;color:var(--bt-ink-2);box-shadow:inset 0 0 0 1px var(--bt-line)}
+.bt-app-icon svg{transition:filter .6s ease,opacity .6s ease}
+.bt-app:not([data-state=ready]) .bt-app-icon svg{filter:grayscale(1);opacity:.5}
+.bt-app[data-fresh] .bt-app-icon{animation:bt-app-pop .5s cubic-bezier(.3,1.5,.5,1)}
+.bt-app[data-fresh]::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(105deg,transparent 28%,color-mix(in srgb,var(--bt-ink) 7%,transparent) 44%,color-mix(in srgb,var(--bt-ink) 2%,transparent) 50%,color-mix(in srgb,var(--bt-ink) 7%,transparent) 56%,transparent 72%);background-size:300% 100%;border-radius:inherit;animation:bt-app-shine .9s cubic-bezier(.25,.8,.3,1) both}
+.bt-app[data-fresh] .bt-app-btn-done{animation:bt-app-done .4s ease-out}
+@keyframes bt-app-pop{0%{transform:scale(.86)}55%{transform:scale(1.07)}100%{transform:scale(1)}}
+@keyframes bt-app-shine{0%{background-position:100% 0}100%{background-position:0 0}}
+@keyframes bt-app-done{0%{opacity:.4;transform:scale(.94)}100%{opacity:1;transform:none}}
+.bt-app-empty{margin:24px 0;text-align:center;font-size:13px;color:var(--bt-ink-3)}
+.bt-app-sub{display:flex;flex-direction:column;gap:12px}
+.bt-app-sub-head{display:flex;align-items:center;gap:4px;margin-left:-6px}
+.bt-app-sub-head h3{margin:0;font-size:14px;line-height:20px;font-weight:600}
+.bt-app-about{margin:0 4px;font-size:13px;line-height:20px;color:var(--bt-ink-2)}
+.bt-connector-mark{--bt-mark-ink:var(--bt-ink)}
+[data-bt-motion=off] .bt-app,[data-bt-motion=off] .bt-app *,[data-bt-motion=off] .bt-app::after{animation:none!important;transition:none!important}
+@media (prefers-reduced-motion:reduce){.bt-app[data-fresh]::after,.bt-app[data-fresh] .bt-app-icon,.bt-app[data-fresh] .bt-app-btn-done{animation:none}}
+`
diff --git a/ds-bot/src/client/connectors.js b/ds-bot/src/client/connectors.js
index 2bb493c5..784f6675 100644
--- a/ds-bot/src/client/connectors.js
+++ b/ds-bot/src/client/connectors.js
@@ -2,9 +2,10 @@
// an Add menu, and the mailbox. One row component draws the mark, name, status
// and the expanding panels (browser sign-in, device code, key/token, client).
import { createElement as h, useEffect, useRef, useState } from 'react'
-import { useMorph } from './motion.js'
import { MaskedInput } from './secret-card.js'
-import { SwitchRow } from './bot-settings.js'
+import { Switch, SwitchRow } from './bot-settings.js'
+import { Segmented, useMorph } from './motion.js'
+import { openPage, reserveWindow } from './open-window.js'
import { contentText, currentPart } from './text.js'
import { useDockHold } from './card-hold.js'
import { heldCardKey } from './sources.js'
@@ -17,7 +18,7 @@ export { GitHubMark } from './connector-marks.js'
import { MARKS } from './connector-marks.js'
const TOKEN_URL = 'https://github.com/settings/personal-access-tokens/new'
-// Rows show a generated monogram: first letter, color from the id hash.
+// Rows show the service mark, or a generated monogram for custom entries.
export function ConnectorMark({ connector }) {
const Mark = MARKS[connector.id]
if (Mark) return h(Mark)
@@ -26,37 +27,47 @@ export function ConnectorMark({ connector }) {
return h('span', { className: 'bt-connector-mono', style: { '--bt-hue': hash % 360 }, 'aria-hidden': true }, (connector.name ?? '?').slice(0, 1).toUpperCase())
}
-const CATEGORIES = ['dev', 'docs', 'work', 'design', 'data', 'commerce', 'search']
-const CATEGORY_LABEL = { dev: 'Developer', docs: 'Docs & files', work: 'Work', design: 'Design', data: 'Data', commerce: 'Commerce', search: 'Search' }
function statusText(connector) {
if (connector.state === 'connecting') return connector.pending ? t('Waiting for sign-in…') : t('Connecting…')
if (connector.state === 'needs-sign-in') return t('Sign in again')
if (connector.state === 'needs-client') return t('This service needs an app client ID')
if (connector.state === 'error') return t('Could not connect: {error}', { error: connector.error ?? '' })
- if (connector.state === 'ready') return connector.account ? t('Connected as {account}', { account: connector.account }) : t('Connected')
- return connector.about ?? ''
+ if (connector.state === 'ready') {
+ const who = connector.account ? t('Connected as {account}', { account: connector.account }) : t('Connected')
+ return connector.tools > 0 ? `${who} · ${t('{count} tools', { count: connector.tools })}` : who
+ }
+ return connector.about ? t(connector.about) : ''
}
+// Sign-in pages open on their own when Connect is clicked; these panels say what
+// is happening and keep a way back if the page was closed or never came back.
function BrowserPanel({ connector, actions, run }) {
+ const [pasting, setPasting] = useState(false)
const [input, setInput] = useState('')
return h('div', { className: 'bt-connector-form' },
h('div', { className: 'bt-connector-form-row' },
- h('a', { className: 'bt-connector-link', href: connector.pending.url, target: '_blank', rel: 'noopener noreferrer' }, t('Open the sign-in page')),
+ h('span', { className: 'bt-connector-wait' }, t('Finish signing in in your browser.')),
+ h('button', { type: 'button', className: 'bt-connector-link', onClick: () => openPage(connector.pending.url) }, t('Open again')),
h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void run(actions.connectorCancel(connector.id)) }, t('Cancel'))),
- h('input', { className: 'bt-input', 'aria-label': t('Paste the address you land on'), placeholder: t('Or paste the address you land on'), value: input, spellCheck: false, autoComplete: 'off', onChange: e => setInput(e.target.value) }),
- input.trim() !== '' ? h('div', { className: 'bt-connector-form-row' },
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void run(actions.connectorSignInCode(connector.id, input.trim())) }, t('Finish sign-in'))) : null)
+ pasting
+ ? h('div', { className: 'bt-connector-form-row' },
+ h('input', { className: 'bt-input', 'aria-label': t('Paste the address you land on'), placeholder: t('Paste the address you land on'), value: input, spellCheck: false, autoComplete: 'off', autoFocus: true, onChange: e => setInput(e.target.value) }),
+ h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: input.trim() === '', onClick: () => void run(actions.connectorSignInCode(connector.id, input.trim())) }, t('Finish sign-in')))
+ : h('button', { type: 'button', className: 'bt-connector-link bt-connector-aside', onClick: () => setPasting(true) }, t('Did not come back here?')))
}
function DevicePanel({ connector, actions, run, onUseToken }) {
+ const { userCode, verificationUri } = connector.pending
const [copied, setCopied] = useState(false)
+ const copy = () => { void navigator.clipboard?.writeText(userCode).then(() => { setCopied(true); setTimeout(() => setCopied(false), 1600) }) }
return h('div', { className: 'bt-connector-form' },
h('div', { className: 'bt-connector-device' },
- h('code', { className: 'bt-connector-code' }, connector.pending.userCode),
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => { void navigator.clipboard?.writeText(connector.pending.userCode).then(() => { setCopied(true); setTimeout(() => setCopied(false), 1600) }) } }, copied ? t('Copied') : t('Copy'))),
+ h('code', { className: 'bt-connector-code' }, userCode),
+ h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: copy }, copied ? t('Copied') : t('Copy'))),
h('div', { className: 'bt-connector-form-row' },
- h('a', { className: 'bt-connector-link', href: connector.pending.verificationUri, target: '_blank', rel: 'noopener noreferrer' }, t('Open {host}', { host: connector.pending.verificationUri.replace(/^https?:\/\//, '') })),
+ h('span', { className: 'bt-connector-wait' }, t('Paste the code on {host} and authorize.', { host: verificationUri.replace(/^https?:\/\//, '') })),
+ h('button', { type: 'button', className: 'bt-connector-link', onClick: () => openPage(verificationUri) }, t('Open again')),
connector.auth?.token === true && onUseToken ? h('button', { type: 'button', className: 'bt-connector-link', onClick: () => void run(actions.connectorCancel(connector.id), onUseToken) }, t('Use a token instead')) : null,
h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void run(actions.connectorCancel(connector.id)) }, t('Cancel'))))
}
@@ -83,54 +94,73 @@ function TokenPanel({ connector, actions, run, onDone }) {
h('label', { className: 'bt-q-field bt-secret-field' }, h(MaskedInput, { value: token, onChange: setToken, onEnter: connect, label: isKey ? t('{name} key', { name: connector.name }) : t('{name} token', { name: connector.name }), autoFocus: true })),
h('div', { className: 'bt-connector-form-row' },
(connector.id === 'github' ? h('a', { className: 'bt-connector-link', href: TOKEN_URL, target: '_blank', rel: 'noopener noreferrer' }, t('Create a token on GitHub'))
- : connector.auth?.keyUrl ? h('a', { className: 'bt-connector-link', href: connector.auth.keyUrl, target: '_blank', rel: 'noopener noreferrer' }, t('Get a key')) : h('span', { className: 'bt-connector-link' })),
+ : connector.auth?.keyUrl ? h('a', { className: 'bt-connector-link', href: connector.auth.keyUrl, target: '_blank', rel: 'noopener noreferrer' }, t('Get a key')) : h('span', { className: 'bt-connector-wait' })),
h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: onDone }, t('Cancel')),
h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: token.trim() === '', onClick: connect }, t('Connect'))))
}
+// Opens the sign-in page the host answers with: the browser page for OAuth, or the
+// device page with the code already on the clipboard.
+export const openSignIn = (win, id, view) => {
+ const pending = view?.connectors?.find(entry => entry.id === id)?.pending
+ if (pending?.kind === 'browser') return void win.go(pending.url)
+ if (pending?.kind === 'device') {
+ void navigator.clipboard?.writeText(pending.userCode).catch(() => {})
+ return void win.go(pending.verificationUri)
+ }
+ win.close()
+}
+
export function ConnectorRow({ connector, actions }) {
const [form, setForm] = useState(null)
const [busy, setBusy] = useState(false)
const [error, setError] = useState(null)
- const run = (task, after) => {
+ const run = (task, after, failed) => {
setBusy(true); setError(null)
- return Promise.resolve(task).then(() => { after?.() }, failure => setError(failure?.message ?? String(failure))).finally(() => setBusy(false))
+ return Promise.resolve(task).then(value => { after?.(value) }, (failure) => { failed?.(); setError(failure?.message ?? String(failure)) }).finally(() => setBusy(false))
}
const on = connector.state !== 'off' && connector.state !== 'needs-client'
const pending = connector.pending
const row = useRef(null)
useMorph(row, `${form}:${error !== null}:${connector.state}:${pending?.kind ?? ''}`)
+ const signIn = () => {
+ const win = reserveWindow()
+ void run(actions.connectorConnect(connector.id, {}), view => openSignIn(win, connector.id, view), () => win.close())
+ }
const connect = () => {
if (connector.auth?.kind === 'none') return void run(actions.connectorConnect(connector.id, {}))
if (connector.auth?.kind === 'key') return setForm('token')
- if (connector.auth?.kind === 'oauth') {
- if (connector.auth.client?.id || !connector.auth.token) return void run(actions.connectorConnect(connector.id, {}))
- return setForm('token')
- }
+ if (connector.auth?.kind === 'oauth') return connector.auth.client?.id || !connector.auth.token ? signIn() : setForm('token')
return undefined
}
+ const button = (label, onClick) => h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick }, label)
+ let actionsNode = null
+ if (pending || form) actionsNode = null
+ else if (connector.state === 'needs-sign-in') actionsNode = [button(t('Sign in again'), signIn), button(t('Disconnect'), () => void run(actions.connectorDisconnect(connector.id)))]
+ else if (connector.state === 'error') actionsNode = [button(t('Try again'), () => void run(actions.connectorRetry(connector.id))), button(connector.custom ? t('Remove') : t('Disconnect'), () => void run(actions.connectorDisconnect(connector.id)))]
+ else if (on) actionsNode = button(connector.custom ? t('Remove') : t('Disconnect'), () => void run(actions.connectorDisconnect(connector.id)))
+ else {
+ actionsNode = [
+ connector.auth?.kind === 'oauth' && connector.auth.token === true && connector.auth.client?.id
+ ? h('button', { key: 'token', type: 'button', className: 'bt-connector-link', disabled: busy, onClick: () => setForm('token') }, t('Use a token instead'))
+ : null,
+ h('button', { key: 'connect', type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: connect }, busy ? t('Connecting…') : t('Connect')),
+ ]
+ }
return h('div', { ref: row, className: 'bt-connector', 'data-state': connector.state },
h('div', { className: 'bt-connector-head' },
h('span', { className: 'bt-connector-mark' }, h(ConnectorMark, { connector })),
h('span', { className: 'bt-connector-text' },
h('span', { className: 'bt-connector-name' }, connector.name, connector.custom ? h('span', { className: 'bt-tag' }, t('Added')) : null),
- h('span', { className: 'bt-connector-status' }, t(statusText(connector)))),
- h('span', { className: 'bt-connector-actions' },
- connector.state === 'error' || connector.state === 'needs-sign-in' ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: () => void run(actions.connectorRetry(connector.id)) }, connector.state === 'needs-sign-in' ? t('Sign in again') : t('Try again')) : null,
- on && !pending
- ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: () => void run(actions.connectorDisconnect(connector.id)) }, connector.custom ? t('Remove') : t('Disconnect'))
- : pending || form ? null : h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: connect }, t('Connect')),
- !on && !pending && form === null && connector.auth?.kind === 'oauth' && connector.auth.token === true && connector.auth.client?.id
- ? h('button', { type: 'button', className: 'bt-connector-link', disabled: busy, onClick: () => setForm('token') }, t('Use a token instead'))
- : null)),
- connector.readOnly !== undefined && on ? h('div', { className: 'bt-connector-ro' },
+ h('span', { className: 'bt-connector-status' }, statusText(connector))),
+ actionsNode ? h('span', { className: 'bt-connector-actions' }, actionsNode) : null),
+ connector.readOnly !== undefined && on && connector.state === 'ready' ? h('div', { className: 'bt-connector-ro' },
h(SwitchRow, { label: t('Read-only'), on: connector.readOnly === true, onChange: checked => void run(actions.connectorSet(connector.id, { readOnly: checked })) })) : null,
pending?.kind === 'browser' ? h(BrowserPanel, { connector, actions, run }) : null,
pending?.kind === 'device' ? h(DevicePanel, { connector, actions, run, onUseToken: () => setForm('token') }) : null,
connector.state === 'needs-client' && !pending?.kind ? h(ClientPanel, { connector, actions, run }) : null,
form === 'token' ? h(TokenPanel, { connector, actions, run, onDone: () => { setForm(null); setError(null) } }) : null,
- error ? h('div', { className: 'bt-connector-error', role: 'alert' }, error) : null,
- connector.tools > 0 ? h('div', { className: 'bt-connector-status' }, t('{count} tools', { count: connector.tools })) : null)
+ error ? h('div', { className: 'bt-connector-error', role: 'alert' }, hostText(error)) : null)
}
// Where each mail provider's authorization code or app password comes from.
@@ -178,18 +208,17 @@ const MAIL_GUIDES = {
},
}
-function MailAccount({ account, actions, run }) {
+export function MailAccount({ account, actions, run }) {
const [busy, setBusy] = useState(false)
- const busyRef = useRef(false)
const remove = () => {
- if (busyRef.current || busy) return
- busyRef.current = true
+ if (busy) return
setBusy(true)
- void Promise.resolve(run(actions.mailAccountRemove(account.id))).finally(() => { busyRef.current = false; setBusy(false) })
+ void Promise.resolve(run(actions.mailAccountRemove(account.id))).finally(() => setBusy(false))
}
+ const markId = `mail-${account.provider}`
return h('div', { className: 'bt-connector', 'data-state': account.error ? 'error' : 'ready' },
h('div', { className: 'bt-connector-head' },
- h('span', { className: 'bt-connector-mark' }, h(ConnectorMark, { connector: { id: `mail-${account.provider}`, name: account.address } })),
+ h('span', { className: 'bt-connector-mark' }, h(ConnectorMark, { connector: { id: markId, name: account.address } })),
h('span', { className: 'bt-connector-text' },
h('span', { className: 'bt-connector-name' }, account.address),
h('span', { className: 'bt-connector-status' }, account.error ? hostText(account.error) : t('Connected'))),
@@ -197,184 +226,155 @@ function MailAccount({ account, actions, run }) {
h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: remove }, t('Remove')))))
}
-// The Google sign-in the host started: it waits as a row that looks like the
-// connector rows, with the sign-in page one click away.
-function MailPending({ pending }) {
+// A Google sign-in the host started; its page opened with the click.
+export function MailPending({ pending }) {
return h('div', { className: 'bt-connector', 'data-state': 'connecting' },
h('div', { className: 'bt-connector-head' },
h('span', { className: 'bt-connector-mark' }, h(ConnectorMark, { connector: { id: 'mail-gmail', name: 'Google' } })),
h('span', { className: 'bt-connector-text' },
- h('span', { className: 'bt-connector-name' }, pending.address ?? 'Google'),
- h('span', { className: 'bt-connector-status' }, t('Waiting for sign-in…'))),
+ h('span', { className: 'bt-connector-name' }, pending.address ?? 'Gmail'),
+ h('span', { className: 'bt-connector-status' }, t('Finish signing in in your browser.'))),
h('span', { className: 'bt-connector-actions' },
- h('a', { className: 'bt-soft bt-soft-sm bt-mail-open', href: pending.url, target: '_blank', rel: 'noopener noreferrer' }, t('Open the sign-in page')))))
+ h('button', { type: 'button', className: 'bt-connector-link', onClick: () => openPage(pending.url) }, t('Open again')))))
}
-// The add form lives in the card like the other pages' add rows. While the host
-// verifies the sign-in every field and button is disabled, so a second click
-// cannot start a second add. A good add closes the form, which drops the typed
-// address, code, provider and hosts with it.
-function MailForm({ mail, actions, mailRun, busy, error, fields, setField, onClose }) {
- const { address, password, provider, imapHost, smtpHost } = fields
- const setAddress = value => setField('address', value)
- const setPassword = value => setField('password', value)
- const setProvider = value => setField('provider', value)
- const setImapHost = value => setField('imapHost', value)
- const setSmtpHost = value => setField('smtpHost', value)
- const domain = address.split('@')[1]?.toLowerCase() ?? ''
- const guessed = ['qq.com', 'foxmail.com'].includes(domain) ? 'qq' : ['163.com', '126.com', 'gmail.com', 'googlemail.com'].includes(domain) ? domain.replace(/\..*/, '').replace('googlemail', 'gmail') : ['icloud.com', 'me.com', 'mac.com'].includes(domain) ? 'icloud' : ''
- const chosen = provider || guessed || 'other'
- const guide = MAIL_GUIDES[chosen]
- const add = () => void mailRun(() => actions.mailAccountAdd({ address: address.trim(), password, provider: chosen, imapHost: imapHost.trim(), smtpHost: smtpHost.trim() }), onClose)
- return h('div', { className: 'bt-set-row bt-set-paste bt-mail-form' },
- h('div', { className: 'bt-mail-providers', role: 'radiogroup', 'aria-label': t('Provider') },
- [['qq', 'QQ'], ['163', '163'], ['126', '126'], ['gmail', 'Gmail'], ['icloud', 'iCloud'], ['other', t('Other')]].map(([id, label]) =>
- h('button', { key: id, type: 'button', role: 'radio', 'aria-checked': chosen === id, className: 'bt-secret-seg', disabled: busy, onClick: () => setProvider(id) }, label))),
- guide ? [
- h('ol', { key: 'guide', className: 'bt-mail-guide' }, guide.steps.map(step => h('li', { key: step }, t(step, { host: guide.host })))),
- h('div', { key: 'links', className: 'bt-connector-form-row bt-mail-links' },
- h('a', { className: 'bt-connector-link', href: guide.open, target: '_blank', rel: 'noopener noreferrer' }, t('Open {host}', { host: guide.host })),
- h('a', { className: 'bt-connector-link', href: guide.help, target: '_blank', rel: 'noopener noreferrer' }, t('Official help'))),
- ] : null,
- h('input', { className: 'bt-input', 'aria-label': t('Email address'), placeholder: t('Email address'), value: address, autoComplete: 'off', disabled: busy, onChange: e => setAddress(e.target.value) }),
- h('label', { className: 'bt-q-field bt-secret-field' }, h(MaskedInput, { value: password, onChange: setPassword, label: t(guide?.label ?? 'Password or app password'), disabled: busy })),
- chosen === 'other' ? [
- h('input', { key: 'ih', className: 'bt-input', 'aria-label': t('IMAP host'), placeholder: t('IMAP host'), value: imapHost, disabled: busy, onChange: e => setImapHost(e.target.value) }),
- h('input', { key: 'sh', className: 'bt-input', 'aria-label': t('SMTP host'), placeholder: t('SMTP host'), value: smtpHost, disabled: busy, onChange: e => setSmtpHost(e.target.value) }),
- ] : null,
- error ? h('div', { className: 'bt-connector-error', role: 'alert' }, hostText(error)) : null,
- h('div', { className: 'bt-secret-row-actions' },
- mail?.google ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: () => void mailRun(() => actions.mailAccountAdd({ address: address.trim(), google: true }), onClose) }, t('Sign in with Google')) : h('span', { className: 'bt-connector-link' }),
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: onClose }, t('Cancel')),
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy || !address.includes('@') || password === '', onClick: add }, busy ? t('Verifying…') : t('Add account'))))
+// The sending rules a mail card added; they only show once there is one.
+export function MailRules({ mail, bots, actions, run }) {
+ const allowed = mail?.allowedRecipients ?? []
+ const direct = mail?.noDraftFor ?? []
+ if (allowed.length === 0 && direct.length === 0) return null
+ const rule = (key, name, kind, onRemove) => h('div', { key, className: 'bt-mail-rule' },
+ h('span', { className: 'bt-connector-text' },
+ h('span', { className: 'bt-mail-rule-name' }, name),
+ h('span', { className: 'bt-connector-status' }, kind)),
+ h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: onRemove }, t('Remove')))
+ return h('div', { className: 'bt-connector bt-mail-rules', 'data-state': 'ready' },
+ h('div', { className: 'bt-mail-rules-title' }, t('Sending rules')),
+ allowed.map(addr => rule(`r:${addr}`, addr, t('Allow recipient'), () => void run(actions.mailRuleSet({ removeRecipient: addr })))),
+ direct.map(botId => rule(`b:${botId}`, (bots ?? []).find(b => b.id === botId)?.name ?? botId, t('Allow this Bot to send directly'), () => void run(actions.mailRuleSet({ botId, noDraft: false })))))
}
-const EMPTY_MAIL = { address: '', password: '', provider: '', imapHost: '', smtpHost: '' }
-function MailRules({ mail, bots, actions, run }) {
- const [recipient, setRecipient] = useState('')
- const allowed = mail?.allowedRecipients ?? []
- const noDraft = mail?.noDraftFor ?? []
- const add = () => {
- const addr = recipient.trim()
- if (!addr.includes('@')) return
- void run(actions.mailRuleSet({ addRecipient: addr }), () => setRecipient(''))
- }
- return h('div', { className: 'bt-set-row bt-set-paste bt-mail-rules' },
- h('div', { className: 'bt-connector-name' }, t('Sending rules')),
- allowed.map(addr => h('div', { key: `r:${addr}`, className: 'bt-connector-head' },
- h('span', { className: 'bt-connector-text' },
- h('span', { className: 'bt-connector-name' }, addr),
- h('span', { className: 'bt-connector-status' }, t('Allow recipient'))),
- h('span', { className: 'bt-connector-actions' },
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void run(actions.mailRuleSet({ removeRecipient: addr })) }, t('Remove'))))),
- noDraft.map((botId) => {
- const botName = (bots ?? []).find(b => b.id === botId)?.name ?? botId
- return h('div', { key: `b:${botId}`, className: 'bt-connector-head' },
- h('span', { className: 'bt-connector-text' },
- h('span', { className: 'bt-connector-name' }, botName),
- h('span', { className: 'bt-connector-status' }, t('Allow this Bot to send directly'))),
- h('span', { className: 'bt-connector-actions' },
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void run(actions.mailRuleSet({ botId, noDraft: false })) }, t('Needs approval'))))
- }),
- h('div', { className: 'bt-connector-form-row' },
- h('input', { className: 'bt-input', 'aria-label': t('Allow recipient'), placeholder: '[email protected]', value: recipient, autoComplete: 'off', onChange: e => setRecipient(e.target.value) }),
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: !recipient.includes('@'), onClick: add }, t('Add'))))
+const PROVIDERS = [['qq', 'QQ'], ['163', '163'], ['126', '126'], ['gmail', 'Gmail'], ['icloud', 'iCloud'], ['other', 'Other']]
+const guessProvider = (address) => {
+ const domain = address.split('@')[1]?.toLowerCase() ?? ''
+ if (['qq.com', 'foxmail.com'].includes(domain)) return 'qq'
+ if (['163.com', '126.com'].includes(domain)) return domain.slice(0, 3)
+ if (['gmail.com', 'googlemail.com'].includes(domain)) return 'gmail'
+ if (['icloud.com', 'me.com', 'mac.com'].includes(domain)) return 'icloud'
+ return ''
}
-export function MailSection({ mail, bots, actions, run }) {
- const [form, setForm] = useState(false)
- const [rulesOpen, setRulesOpen] = useState(false)
+// The add form opens under the Mailbox catalog row. While the host verifies the
+// login every field is disabled, so a second click cannot add twice; a good add
+// closes the form and drops what was typed.
+function MailForm({ mail, actions, onClose }) {
+ const [fields, setFields] = useState({ address: '', password: '', provider: '', imapHost: '', smtpHost: '' })
const [busy, setBusy] = useState(false)
const [error, setError] = useState(null)
- const [fields, setFields] = useState(EMPTY_MAIL)
const busyRef = useRef(false)
- const accounts = mail?.accounts ?? []
- const hasRules = (mail?.allowedRecipients?.length ?? 0) > 0 || (mail?.noDraftFor?.length ?? 0) > 0
- const setField = (key, value) => setFields(current => ({ ...current, [key]: value }))
- const close = () => { setError(null); setForm(false); setFields(EMPTY_MAIL) }
- const mailRun = (task, onDone) => {
- if (busyRef.current || busy) return false
+ const set = (key, value) => setFields(current => ({ ...current, [key]: value }))
+ const chosen = fields.provider || guessProvider(fields.address) || 'qq'
+ const guide = MAIL_GUIDES[chosen]
+ const google = chosen === 'gmail' && mail?.google === true
+ const go = (task, done) => {
+ if (busyRef.current) return
busyRef.current = true
setBusy(true)
setError(null)
- void Promise.resolve().then(task).then(() => { onDone?.() }, (failure) => { setError(failure?.message ?? String(failure)) }).finally(() => { busyRef.current = false; setBusy(false) })
- return true
+ void Promise.resolve().then(task).then(done, (failure) => { setError(failure?.message ?? String(failure)) }).finally(() => { busyRef.current = false; setBusy(false) })
}
- return [
- h('div', { key: 'title', className: 'bt-section-title' }, t('Mailbox')),
- h('div', { key: 'card', className: 'bt-set-card bt-connectors-card' },
- accounts.length === 0 && !form ? h('div', { className: 'bt-set-row' }, h('span', { className: 'bt-set-hint' }, t('No mail accounts yet'))) : null,
- accounts.map(account => h(MailAccount, { key: account.id, account, actions, run })),
- (mail?.pending ?? []).map(p => h(MailPending, { key: p.address ?? 'google', pending: p })),
- form ? h(MailForm, { mail, actions, mailRun, busy, error, fields, setField, onClose: close }) : null,
- hasRules || rulesOpen ? h(MailRules, { mail, bots, actions, run }) : null),
- form ? null : h('div', { key: 'add', className: 'bt-actions' },
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => { setError(null); setForm(true) } }, t('Add an account')),
- mail?.google ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: () => void run(actions.mailAccountAdd({ google: true })) }, t('Sign in with Google')) : null,
- !hasRules && accounts.length > 0 ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => setRulesOpen(v => !v) }, t('Manage rules')) : null),
- ]
+ const add = () => go(() => actions.mailAccountAdd({ address: fields.address.trim(), password: fields.password, provider: chosen, imapHost: fields.imapHost.trim(), smtpHost: fields.smtpHost.trim() }), onClose)
+ const signInWithGoogle = () => {
+ const win = reserveWindow()
+ go(() => actions.mailAccountAdd({ address: fields.address.trim(), google: true }).catch((failure) => { win.close(); throw failure }), (view) => {
+ const url = view?.mail?.pending?.at(-1)?.url ?? view?.pending?.at(-1)?.url
+ if (url) win.go(url)
+ else win.close()
+ onClose()
+ })
+ }
+ const input = (key, label, extra = {}) => h('input', { className: 'bt-input', 'aria-label': label, placeholder: label, value: fields[key], autoComplete: 'off', spellCheck: false, disabled: busy, onChange: e => set(key, e.target.value), ...extra })
+ return h('div', { className: 'bt-connector-form bt-mail-form' },
+ h(Segmented, { label: t('Provider'), value: chosen, className: 'bt-mail-seg' },
+ PROVIDERS.map(([id, label]) => h('button', { key: id, type: 'button', 'aria-pressed': chosen === id, disabled: busy, onClick: () => set('provider', id) }, id === 'other' ? t(label) : label))),
+ guide ? h('div', { className: 'bt-mail-guide' },
+ h('ol', null, guide.steps.map(step => h('li', { key: step }, t(step, { host: guide.host })))),
+ h('div', { className: 'bt-mail-links' },
+ h('button', { type: 'button', className: 'bt-connector-link', onClick: () => openPage(guide.open) }, t('Open {host}', { host: guide.host })),
+ h('button', { type: 'button', className: 'bt-connector-link', onClick: () => openPage(guide.help) }, t('Official help')))) : null,
+ input('address', t('Email address'), { type: 'email' }),
+ h('label', { className: 'bt-q-field bt-secret-field' }, h(MaskedInput, { value: fields.password, onChange: value => set('password', value), onEnter: add, label: t(guide?.label ?? 'Password or app password'), disabled: busy })),
+ chosen === 'other' ? h('div', { className: 'bt-provider-pair' }, input('imapHost', t('IMAP host')), input('smtpHost', t('SMTP host'))) : null,
+ error ? h('div', { className: 'bt-mail-error', role: 'alert' }, hostText(error)) : null,
+ h('div', { className: 'bt-secret-row-actions' },
+ google ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: signInWithGoogle }, t('Sign in with Google')) : null,
+ h('span', { className: 'bt-set-hint' }),
+ h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy, onClick: onClose }, t('Cancel')),
+ h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: busy || !fields.address.includes('@') || fields.password === '' || (chosen === 'other' && (fields.imapHost.trim() === '' || fields.smtpHost.trim() === '')), onClick: add }, busy ? t('Verifying…') : t('Add'))))
}
-function AddMenu({ actions, run }) {
+// The Mailbox in the catalog: one row for every mail service, with the add form.
+export function MailCatalogRow({ mail, actions }) {
+ const [open, setOpen] = useState(false)
+ const row = useRef(null)
+ useMorph(row, String(open))
+ return h('div', { ref: row, className: 'bt-connector', 'data-state': 'off' },
+ h('div', { className: 'bt-connector-head' },
+ h('span', { className: 'bt-connector-mark' }, h(ConnectorMark, { connector: { id: 'mail', name: t('Mailbox') } })),
+ h('span', { className: 'bt-connector-text' },
+ h('span', { className: 'bt-connector-name' }, t('Mailbox')),
+ h('span', { className: 'bt-connector-status' }, t('QQ, 163, 126, Gmail, iCloud, and other IMAP mail'))),
+ open ? null : h('span', { className: 'bt-connector-actions' },
+ h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => setOpen(true) }, (mail?.accounts?.length ?? 0) > 0 ? t('Add another') : t('Connect')))),
+ open ? h(MailForm, { mail, actions, onClose: () => setOpen(false) }) : null)
+}
+
+// Your own MCP servers: an address, a command, or ones found in other apps.
+export function AddMenu({ actions, run }) {
const [kind, setKind] = useState(null)
const [name, setName] = useState('')
const [url, setUrl] = useState('')
const [command, setCommand] = useState('')
const [found, setFound] = useState(null)
const [picked, setPicked] = useState([])
+ const row = useRef(null)
+ useMorph(row, `${kind}:${found === null}`)
const reset = () => { setKind(null); setName(''); setUrl(''); setCommand(''); setFound(null); setPicked([]) }
- if (kind === 'import' && found === null) { void Promise.resolve(actions.connectorImportScan()).then(list => setFound(Array.isArray(list) ? list : list?.items ?? []), () => setFound([])) }
- return h('div', { className: 'bt-connector-add' },
- kind === null ? h('div', { className: 'bt-connector-form-row' },
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => setKind('url') }, t('Add an address')),
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => setKind('command') }, t('Add a command')),
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => setKind('import') }, t('Import from other apps'))) : null,
- kind === 'url' || kind === 'command' ? h('div', { className: 'bt-connector-form' },
- h('input', { className: 'bt-input', 'aria-label': t('Name'), placeholder: t('Name'), value: name, onChange: e => setName(e.target.value) }),
- kind === 'url'
- ? h('input', { className: 'bt-input', 'aria-label': t('Server address'), placeholder: 'https://…', value: url, onChange: e => setUrl(e.target.value) })
- : h('input', { className: 'bt-input', 'aria-label': t('Command'), placeholder: t('Command, e.g. npx -y some-mcp'), value: command, onChange: e => setCommand(e.target.value) }),
- h('div', { className: 'bt-connector-form-row' },
+ const choose = (next) => {
+ setKind(next)
+ if (next === 'import' && found === null) void Promise.resolve(actions.connectorImportScan()).then(list => setFound(Array.isArray(list) ? list : list?.items ?? []), () => setFound([]))
+ }
+ const key = (item) => `${item.source}:${item.name}`
+ const ready = name.trim() !== '' && (kind === 'url' ? url.trim() !== '' : command.trim() !== '')
+ return h('div', { ref: row, className: 'bt-connector', 'data-state': 'off' },
+ h('div', { className: 'bt-connector-head' },
+ h('span', { className: 'bt-connector-mark' }, h(ConnectorMark, { connector: { id: 'custom', name: '+' } })),
+ h('span', { className: 'bt-connector-text' },
+ h('span', { className: 'bt-connector-name' }, t('Other MCP server')),
+ h('span', { className: 'bt-connector-status' }, t('An address, a command, or one from Claude Desktop, Cursor, or VS Code'))),
+ kind === null ? h('span', { className: 'bt-connector-actions' }, h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => choose('url') }, t('Add'))) : null),
+ kind === null ? null : h('div', { className: 'bt-connector-form' },
+ h(Segmented, { label: t('Kind of server'), value: kind },
+ [['url', t('Address')], ['command', t('Command')], ['import', t('Import from other apps')]].map(([id, label]) => h('button', { key: id, type: 'button', 'aria-pressed': kind === id, onClick: () => choose(id) }, label))),
+ kind === 'import'
+ ? (found === null ? h('span', { className: 'bt-set-hint' }, t('Scanning…'))
+ : found.length === 0 ? h('span', { className: 'bt-set-hint' }, t('No MCP servers found in Claude Desktop, Cursor, or VS Code settings.'))
+ : h('div', { className: 'bt-mail-rules' }, found.map(item => h('div', { key: key(item), className: 'bt-mail-rule' },
+ h('span', { className: 'bt-connector-text' },
+ h('span', { className: 'bt-mail-rule-name' }, item.name),
+ h('span', { className: 'bt-connector-status' }, `${item.source} · ${item.url ?? item.command}`)),
+ h(Switch, { label: item.name, on: picked.some(p => key(p) === key(item)), onChange: on => setPicked(list => on ? [...list, { source: item.source, name: item.name }] : list.filter(p => key(p) !== key(item))) })))))
+ : [
+ h('input', { key: 'name', className: 'bt-input', 'aria-label': t('Name'), placeholder: t('Name'), value: name, onChange: e => setName(e.target.value) }),
+ kind === 'url'
+ ? h('input', { key: 'url', className: 'bt-input', 'aria-label': t('Server address'), placeholder: 'https://…', value: url, spellCheck: false, onChange: e => setUrl(e.target.value) })
+ : h('input', { key: 'cmd', className: 'bt-input', 'aria-label': t('Command'), placeholder: t('Command, e.g. npx -y some-mcp'), value: command, spellCheck: false, onChange: e => setCommand(e.target.value) }),
+ ],
+ h('div', { className: 'bt-secret-row-actions' },
h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: reset }, t('Cancel')),
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: name.trim() === '' || (kind === 'url' ? url.trim() === '' : command.trim() === ''), onClick: () => void run(kind === 'url' ? actions.connectorAdd({ name: name.trim(), url: url.trim() }) : actions.connectorAdd({ name: name.trim(), command: command.trim() }), reset) }, t('Add')))) : null,
- kind === 'import' ? h('div', { className: 'bt-connector-form' },
- found === null ? h('span', { className: 'bt-set-hint' }, t('Scanning…')) : found.length === 0 ? h('span', { className: 'bt-set-hint' }, t('No MCP servers found in Claude Desktop, Cursor, or VS Code settings.')) : [
- found.map(item => h('label', { key: `${item.source}:${item.name}`, className: 'bt-connector-import' },
- h('input', { type: 'checkbox', checked: picked.some(p => p.source === item.source && p.name === item.name), onChange: e => setPicked(list => e.target.checked ? [...list, { source: item.source, name: item.name }] : list.filter(p => !(p.source === item.source && p.name === item.name))) }),
- h('span', null, item.name), h('span', { className: 'bt-set-hint' }, `${item.source} · ${item.url ?? item.command}${item.envNames?.length ? ` · ${item.envNames.length} env` : ''}`))),
- h('div', { key: 'go', className: 'bt-connector-form-row' },
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: reset }, t('Cancel')),
- h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: picked.length === 0, onClick: () => void run(actions.connectorImport(picked), reset) }, t('Import {count}', { count: picked.length }))),
- ]) : null)
-}
-
-export function ConnectorsPage({ roster, actions }) {
- const [query, setQuery] = useState('')
- const [category, setCategory] = useState('')
- const [error, setError] = useState(null)
- const run = (task, onDone) => Promise.resolve(task).then(() => { setError(null); onDone?.() }, failure => setError(failure?.message ?? String(failure)))
- const data = roster?.connectors ?? { connectors: [], mail: { accounts: [], google: false } }
- const list = data.connectors ?? []
- const connected = list.filter(c => c.state !== 'off' || c.pending)
- const catalog = list.filter(c => c.state === 'off' && !c.pending)
- .filter(c => category === '' || c.category === category)
- .filter(c => query === '' || `${c.name} ${c.about}`.toLowerCase().includes(query.toLowerCase()))
- return h('section', { className: 'bt-set-section' },
- error ? h('div', { className: 'bt-connector-error', role: 'alert' }, error) : null,
- h('div', { className: 'bt-section-title' }, t('Connected')),
- h('div', { className: 'bt-set-card bt-connectors-card' },
- connected.length === 0 ? h('div', { className: 'bt-set-row' }, h('span', { className: 'bt-set-hint' }, t('No connectors connected'))) : null,
- connected.map(connector => h(ConnectorRow, { key: connector.id, connector, actions }))),
- h(MailSection, { mail: data.mail, bots: roster?.bots, actions, run }),
- h('div', { className: 'bt-section-title' }, t('Catalog')),
- h('div', { className: 'bt-set-card bt-connectors-card' },
- h('div', { className: 'bt-connector-search' },
- h('input', { className: 'bt-input', 'aria-label': t('Search connectors'), placeholder: t('Search'), value: query, onChange: e => setQuery(e.target.value) }),
- h('div', { className: 'bt-connector-chips' },
- h('button', { type: 'button', className: 'bt-secret-seg', 'aria-pressed': category === '', onClick: () => setCategory('') }, t('All')),
- CATEGORIES.map(id => h('button', { key: id, type: 'button', className: 'bt-secret-seg', 'aria-pressed': category === id, onClick: () => setCategory(category === id ? '' : id) }, t(CATEGORY_LABEL[id]))))),
- catalog.map(connector => h(ConnectorRow, { key: connector.id, connector, actions })),
- h(AddMenu, { actions, run })))
+ kind === 'import'
+ ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: picked.length === 0, onClick: () => void run(actions.connectorImport(picked), reset) }, t('Import {count}', { count: picked.length }))
+ : h('button', { type: 'button', className: 'bt-soft bt-soft-sm', disabled: !ready, onClick: () => void run(kind === 'url' ? actions.connectorAdd({ name: name.trim(), url: url.trim() }) : actions.connectorAdd({ name: name.trim(), command: command.trim() }), reset) }, t('Add')))))
}
// Bot details → Connectors: one switch per connected connector (default on).
@@ -625,16 +625,10 @@ export const CONNECTOR_CSS = `
.bt-connector-chips{display:flex;flex-wrap:wrap;gap:6px}
.bt-connector-chips .bt-secret-seg{height:26px;padding:0 10px;border:.5px solid var(--bt-line)}
.bt-connector-chips .bt-secret-seg[aria-pressed=true]{background:var(--bt-active)}
-.bt-connector-add{padding:0 12px 12px}
.bt-connector-ro{padding-left:48px}
.bt-connector-device{display:flex;align-items:center;gap:10px}
.bt-connector-code{font-family:ui-monospace,Menlo,monospace;font-size:16px;letter-spacing:.12em;padding:4px 10px;border-radius:8px;background:var(--bt-hover)}
-.bt-connector-import{display:flex;align-items:center;gap:8px;font-size:13px;padding:4px 0;cursor:pointer}
-.bt-mail-providers{display:flex;gap:4px;flex-wrap:wrap}
-.bt-mail-providers .bt-secret-seg{height:26px;padding:0 10px;border:.5px solid var(--bt-line)}
-.bt-mail-providers .bt-secret-seg[aria-checked=true]{background:var(--bt-active)}
.bt-connector-bot .bt-set-copy{min-width:0}
-.bt-mail-open{text-decoration:none}
.bt-mail-rule-wrap{position:relative;display:inline-flex;align-items:center}
.bt-mail-rule-btn{display:inline-flex;align-items:center;gap:4px;height:30px;padding:0 8px;border:0;border-radius:8px;background:none;color:var(--bt-ink-2);font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background-color .12s ease,color .12s ease}
.bt-mail-rule-btn:hover:not(:disabled){background:var(--bt-hover);color:var(--bt-ink)}
@@ -643,7 +637,6 @@ export const CONNECTOR_CSS = `
.dv-menu.bt-mail-rule-menu{position:absolute;left:0;bottom:calc(100% + 6px);z-index:20;min-width:190px;--dv-origin:bottom left}
.dv-menu.bt-mail-rule-menu button{justify-content:space-between;gap:12px}
.bt-mail-rule-item-text{flex:1 1 auto;min-width:0}
-.bt-mail-rules{display:flex;flex-direction:column;gap:8px}
.dv-widget-stack:has(>.dv-widget-form){gap:8px}
.dv-widget-stack>.dv-widget-form{display:contents}
.dv-widget-stack>.dv-widget-form>.dv-q-foot{order:2;padding-top:4px}
diff --git a/ds-bot/src/client/feedback.js b/ds-bot/src/client/feedback.js
index 7f073acf..6fe3aa2e 100644
--- a/ds-bot/src/client/feedback.js
+++ b/ds-bot/src/client/feedback.js
@@ -6,6 +6,7 @@ import { clearClientErrors, clientErrors, clientFacts, failureLabel, issueUrl, W
import { dateLocale, t } from './i18n.js'
import { CloseIcon } from './icons.js'
import { SPRING_SHAPE } from './motion.js'
+import { reserveWindow } from './open-window.js'
export const FeedbackIcon = () => h('svg', { width: 15, height: 15, viewBox: '0 0 20 20', fill: 'none', stroke: 'currentColor', strokeWidth: 1.5, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true },
h('path', { d: 'M4 4.5h12a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H9l-3.5 3v-3H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1z' }), h('path', { d: 'M10 7v2.6M10 11.4h.01' }))
@@ -39,23 +40,8 @@ function entrySummary(entry) {
const SOURCES = { turn: 'Model call', host: 'DS Bot', api: 'DS Bot', browser: 'This window' }
-// Where the new issue opens; `go(url)` tells whether it did. In a browser the window is
-// reserved inside the click gesture and addressed once the diagnostics are gathered:
-// opening after the awaits would hit the popup blocker. The Desktop makes no window. It
-// hands an http(s) address to the system browser, has no blocker, and returns null even
-// then, so it gets the address itself.
-function issueWindow() {
- if (window.dshDesktop !== undefined) return { go: (url) => { window.open(url, '_blank'); return true } }
- const reserved = window.open('', '_blank')
- if (reserved !== null) reserved.opener = null
- return {
- go: (url) => {
- if (reserved === null) return false
- reserved.location.href = url
- return true
- },
- }
-}
+// Where the new issue opens; `go(url)` tells whether it did.
+const issueWindow = reserveWindow
export function FeedbackPage({ actions, run, Section, Row }) {
const [what, setWhat] = useState('')
diff --git a/ds-bot/src/client/i18n.js b/ds-bot/src/client/i18n.js
index 5493fa00..f49f5a80 100644
--- a/ds-bot/src/client/i18n.js
+++ b/ds-bot/src/client/i18n.js
@@ -1217,6 +1217,21 @@ const ZH = {
'Authorization code': '授权码',
'Password or app password': '密码或授权码',
'Official help': '官方帮助',
+ 'Finish signing in in your browser.': '在浏览器里完成登录。',
+ 'Open again': '重新打开',
+ 'Did not come back here?': '登录后没有回到这里?',
+ 'Paste the code on {host} and authorize.': '在 {host} 粘贴这个码并授权。',
+ 'Add another': '再添加一个',
+ 'QQ, 163, 126, Gmail, iCloud, and other IMAP mail': 'QQ、163、126、Gmail、iCloud 等 IMAP 邮箱',
+ 'Other MCP server': '其他 MCP 服务器',
+ 'An address, a command, or one from Claude Desktop, Cursor, or VS Code': '填地址或命令,或从 Claude Desktop、Cursor、VS Code 导入',
+ 'Kind of server': '服务器类型',
+ 'Nothing matches': '没有匹配的连接器',
+ Recommended: '推荐',
+ 'See all': '查看全部',
+ '{count} connected': '已连接 {count} 个',
+ '{count} accounts': '{count} 个账户',
+ Category: '分类',
'Could not reach the mail server. Check the server address.': '连不上邮件服务器,请检查服务器地址。',
'Sign in at mail.qq.com, click your avatar at the top right, and open Settings → Account and Security → Security Settings.': '在 mail.qq.com 登录,点右上角头像,进入 设置 → 账号与安全 → 安全设置。',
'Turn on the POP3/IMAP/SMTP service, then click Generate authorization code and verify yourself.': '开启 POP3/IMAP/SMTP 服务,再点「生成授权码」,按提示验证身份。',
diff --git a/ds-bot/src/client/index.js b/ds-bot/src/client/index.js
index 8539b67e..06e1ad0a 100644
--- a/ds-bot/src/client/index.js
+++ b/ds-bot/src/client/index.js
@@ -28,6 +28,7 @@ import { createBotBrowsers, serveBrowserReads } from './bot-browsers.js'
import { BROWSER_CSS } from './browser-pane.js'
import { SECRET_CSS, SecretDock } from './secret-card.js'
import { ConnectorDock, MailDock, CONNECTOR_CSS } from './connectors.js'
+import { CONNECTORS_PAGE_CSS } from './connectors-page.js'
import { LearningDock, LearningTurnTail, LEARNING_CSS } from './learning-card.js'
import { MODEL_CSS, ModelChoiceDock, DeepSeekSignIn } from './model-menu.js'
import { BOT_SETTINGS_CSS } from './bot-settings.js'
@@ -926,7 +927,7 @@ export function apply(ctx) {
const installShell = () => [
() => installCompiledStyles(SHELL_CSS, 'shell'),
() => installCompiledStyles(SIDEBAR_CSS, 'sidebar'),
- () => installCompiledStyles(SECRET_CSS + CONNECTOR_CSS, 'secrets'),
+ () => installCompiledStyles(SECRET_CSS + CONNECTOR_CSS + CONNECTORS_PAGE_CSS, 'secrets'),
() => installCompiledStyles(LEARNING_CSS, 'learning'),
() => installCompiledStyles(MODEL_CSS + FOLDER_CSS + BOT_SETTINGS_CSS + GROUP_SETTINGS_CSS + AVATAR_LIBRARY_CSS, 'models'),
() => installCompiledStyles(USAGE_CSS, 'usage'),
diff --git a/ds-bot/src/client/open-window.js b/ds-bot/src/client/open-window.js
new file mode 100644
index 00000000..99d8017f
--- /dev/null
+++ b/ds-bot/src/client/open-window.js
@@ -0,0 +1,21 @@
+// A page that opens once a request answers with its address. In a browser the window
+// is reserved inside the click gesture and addressed later: opening after the awaits
+// would hit the popup blocker. The Desktop makes no window. It hands an http(s)
+// address to the system browser, has no blocker, and returns null even then, so it
+// gets the address itself. `close()` drops a reserved window nothing needed.
+export function reserveWindow() {
+ if (window.dshDesktop !== undefined) return { go: (url) => { window.open(url, '_blank'); return true }, close: () => {} }
+ const reserved = window.open('', '_blank')
+ if (reserved !== null) reserved.opener = null
+ return {
+ go: (url) => {
+ if (reserved === null) return false
+ reserved.location.href = url
+ return true
+ },
+ close: () => { reserved?.close() },
+ }
+}
+
+// Opens an address now, inside the current click.
+export const openPage = url => reserveWindow().go(url)
diff --git a/ds-bot/src/client/settings.js b/ds-bot/src/client/settings.js
index 9947194d..1afcd6de 100644
--- a/ds-bot/src/client/settings.js
+++ b/ds-bot/src/client/settings.js
@@ -12,7 +12,7 @@ import { CreateBot } from './create-bot.js'
import { KeptPrivateSection } from './kept-private.js'
import { KeyIcon, SecretsPage } from './secret-card.js'
import { UsagePage } from './usage-page.js'
-import { ConnectorsPage } from './connectors.js'
+import { ConnectorsPage } from './connectors-page.js'
import { ImPage } from './im-page.js'
import { CapabilitiesPage } from './capability-settings.js'
import { BrowserPage } from './browser-settings.js'
diff --git a/ds-bot/src/client/styles.js b/ds-bot/src/client/styles.js
index 6d691c9d..032059b3 100644
--- a/ds-bot/src/client/styles.js
+++ b/ds-bot/src/client/styles.js
@@ -603,12 +603,23 @@ button.bt-set-row:hover{background:var(--bt-hover)}
.bt-connector-actions{flex:none;display:flex;gap:6px}
.bt-connector-form{display:flex;flex-direction:column;gap:8px;padding-left:48px;animation:bt-q-in ${SPRING_SHAPE.duration}ms ${SPRING_SHAPE.easing},bt-veil-in .2s ease-out}
.bt-connector-form-row{display:flex;align-items:center;gap:6px}
-.bt-connector-link{flex:1;font-size:12px;color:var(--bt-ink-2)}
+.bt-connector-form-row>:first-child{margin-right:auto}
+.bt-connector-link{flex:none;padding:0;border:0;background:none;font:inherit;font-size:12px;color:var(--bt-ink-2);text-decoration:underline;text-underline-offset:2px;cursor:pointer}
+.bt-connector-link:hover:not(:disabled){color:var(--bt-ink)}
+.bt-connector-wait{flex:1;min-width:0;font-size:12px;line-height:16px;color:var(--bt-ink-2)}
+.bt-connector-aside{align-self:flex-start}
.bt-connector-error{padding-left:48px;font-size:12px;line-height:16px;color:var(--bt-danger)}
-.bt-mail-guide{margin:0;padding-left:20px;font-size:12px;line-height:16px;color:color-mix(in srgb,var(--bt-ink-2) 50%,var(--bt-ink-3));display:flex;flex-direction:column;gap:4px}
-.bt-mail-form .bt-connector-error{padding-left:0}
-.bt-mail-links{gap:16px}
-.bt-mail-links .bt-connector-link{flex:none}
+.bt-connector-banner{padding:0 0 8px}
+.bt-mail-form{gap:10px}
+.bt-mail-seg{align-self:flex-start}
+.bt-mail-guide{display:flex;flex-direction:column;gap:8px;padding:10px 12px;border-radius:10px;background:var(--bt-hover);font-size:12px;line-height:18px;color:var(--bt-ink-2)}
+.bt-mail-guide ol{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:2px}
+.bt-mail-links{display:flex;gap:16px}
+.bt-mail-error{font-size:12px;line-height:16px;color:var(--bt-danger)}
+.bt-mail-rules{gap:4px}
+.bt-mail-rules-title{font-size:12px;line-height:16px;font-weight:500;color:var(--bt-ink-2)}
+.bt-mail-rule{display:flex;align-items:center;gap:12px;min-height:36px}
+.bt-mail-rule-name{font-size:13px;line-height:18px;color:var(--bt-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bt-im-mark{width:20px;height:20px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;color:var(--bt-im-mark-ink)}
.bt-im-line{display:flex;align-items:center;gap:8px}
.bt-im-label{flex:1;font-size:12px;color:var(--bt-ink-2)}
diff --git a/ds-bot/test/connectors-page.test.js b/ds-bot/test/connectors-page.test.js
index 0836ee8a..0221221d 100644
--- a/ds-bot/test/connectors-page.test.js
+++ b/ds-bot/test/connectors-page.test.js
@@ -10,12 +10,12 @@ import { build } from 'esbuild'
const PLUGIN = dirname(dirname(fileURLToPath(import.meta.url)))
const { JSDOM } = createRequire(join(process.env.DSH_HARNESS ?? join(PLUGIN, '..', 'deepseek-harness'), 'package.json'))('jsdom')
-// The mail section, bundled once and rendered with a minimal React stand-in whose
+// The mailbox catalog row, bundled once and rendered with a minimal React stand-in whose
// useState survives re-renders: hooks are numbered by expansion order, which is
// stable because the tree expands the same way every pass.
const { outputFiles } = await build({
stdin: {
- contents: "export { MailSection, MailToolCell } from './src/client/connectors.js'",
+ contents: "export { MailCatalogRow, MailToolCell } from './src/client/connectors.js'",
resolveDir: PLUGIN,
},
bundle: true, format: 'cjs', platform: 'browser', write: false, logLevel: 'silent',
@@ -32,7 +32,7 @@ const expand = (node) => {
if (typeof node.type === 'function') return expand(node.type(node.props))
return { ...node, props: { ...(node.props ?? {}), children: expand(node.props?.children) } }
}
-let active = () => expand(MailSection(props))
+let active = () => expand(MailCatalogRow(props))
const rerender = () => { idx = 0; concrete = active() }
const react = {
createContext: (initial) => { const ctx = { value: initial }; ctx.Provider = ({ value, children }) => { ctx.value = value; return children }; return ctx },
@@ -47,18 +47,25 @@ const react = {
if (!(i in slots)) slots[i] = typeof init === 'function' ? init() : init
return [slots[i], (value) => { slots[i] = typeof value === 'function' ? value(slots[i]) : value; rerender() }]
},
- useMemo: make => make(), useRef: current => ({ current }), useId: () => 'id',
+ useMemo: make => make(),
+ useRef: (current) => {
+ const i = idx++
+ if (!(i in slots)) slots[i] = { current }
+ return slots[i]
+ },
+ useId: () => 'id',
}
+const opened = []
const dom = new JSDOM('<!doctype html><body></body>')
const module = { exports: {} }
runInNewContext(outputFiles[0].text, {
module, exports: module.exports,
document: dom.window.document,
- window: { matchMedia: () => ({ matches: false }) },
+ window: { matchMedia: () => ({ matches: false }), dshDesktop: {}, open: (url) => { opened.push(url); return null } },
require: name => (name === 'react' ? react : name === 'react-dom' ? { createPortal: node => node } : {}),
})
-const { MailSection, MailToolCell } = module.exports
-const render = () => { active = () => expand(MailSection(props)); rerender() }
+const { MailCatalogRow, MailToolCell } = module.exports
+const render = () => { active = () => expand(MailCatalogRow(props)); rerender() }
const renderCell = (cellProps) => { slots.length = 0; active = () => expand(MailToolCell(cellProps)); rerender() }
const flatten = (node, out = []) => {
@@ -98,23 +105,23 @@ test('the mail form shows the QQ guide with its links and closes after a good ad
mailAccountAdd: (body) => { adds.push(body); return Promise.resolve({ accounts: [] }) },
mailAccountRemove: () => Promise.resolve(true),
}
- const run = (task, onDone) => Promise.resolve(task).then(() => onDone?.(), () => {})
- props = { mail: { accounts: [] }, actions, run }
+ props = { mail: { accounts: [] }, actions }
slots.length = 0
render()
- click('Add an account')
+ click('Connect')
click('QQ')
const guide = collect(n => n.props?.className === 'bt-mail-guide')[0]
assert.ok(guide, 'guide list')
assert.equal(collect(n => n.type === 'li').length, 3)
- const links = collect(n => n.type === 'a' && n.props?.className === 'bt-connector-link')
+ const links = collect(n => n.type === 'button' && n.props?.className === 'bt-connector-link')
assert.equal(links.length, 2)
- assert.equal(links[0].props.href, 'https://mail.qq.com')
- assert.match(links[1].props.href, /help\.mail\.qq\.com/)
- assert.equal(links[0].props.target, '_blank')
+ opened.length = 0
+ links.forEach(link => link.props.onClick())
+ assert.equal(opened[0], 'https://mail.qq.com')
+ assert.match(opened[1], /help\.mail\.qq\.com/)
fill('Email address', addressAt('qq.com'))
fill('Authorization code', 'CODE')
- click('Add account')
+ click('Add')
await flush()
assert.equal(adds.length, 1)
assert.equal(adds[0].provider, 'qq')
@@ -128,14 +135,13 @@ test('a busy mail add blocks a second click and a good add clears the fields', a
mailAccountAdd: (body) => { adds.push(body); return new Promise(resolve => { release = resolve }) },
mailAccountRemove: () => Promise.resolve(true),
}
- const run = (task, onDone) => Promise.resolve(task).then(() => onDone?.(), () => {})
- props = { mail: { accounts: [] }, actions, run }
+ props = { mail: { accounts: [] }, actions }
slots.length = 0
render()
- click('Add an account')
+ click('Connect')
fill('Email address', addressAt('qq.com'))
fill('Authorization code', 'CODE')
- click('Add account')
+ click('Add')
await flush()
assert.equal(adds.length, 1)
const adding = collect(n => n.type === 'button' && flatten(n).join('') === 'Verifying…')[0]
@@ -149,11 +155,15 @@ test('a busy mail add blocks a second click and a good add clears the fields', a
release({ accounts: [] })
await flush()
assert.equal(collect(n => String(n.props?.className ?? '').includes('bt-mail-form')).length, 0, 'form closed after a resolved add')
- click('Add an account')
+ // The closed form unmounted; the stand-in keeps hook slots by index, so start them over.
+ slots.length = 0
+ render()
+ click('Connect')
assert.equal(collect(n => n.type === 'input' && n.props?.['aria-label'] === 'Email address')[0].props.value, '', 'address cleared')
assert.equal(collect(n => n.type === 'input' && String(n.props?.className ?? '') === 'bt-secret-input')[0].props.value, '', 'code cleared')
- const other = collect(n => n.type === 'button' && flatten(n).join('') === 'Other')[0]
- assert.equal(other.props['aria-checked'], true, 'provider chip back to the default')
+ const qq = collect(n => n.type === 'button' && flatten(n).join('') === 'QQ')[0]
+ assert.equal(qq.props['aria-pressed'], true, 'provider back to the default')
+ click('Other')
assert.equal(collect(n => n.type === 'input' && n.props?.['aria-label'] === 'IMAP host')[0].props.value, '', 'IMAP host cleared')
assert.equal(collect(n => n.type === 'input' && n.props?.['aria-label'] === 'SMTP host')[0].props.value, '', 'SMTP host cleared')
})
@@ -234,14 +244,13 @@ test('a failed mail add shows the host message inside the form', async () => {
mailAccountAdd: () => Promise.reject(new Error('The password was refused. Use the mailbox app password or authorization code, not the account password.')),
mailAccountRemove: () => Promise.resolve(true),
}
- const run = (task, onDone) => Promise.resolve(task).then(() => onDone?.(), () => {})
- props = { mail: { accounts: [] }, actions, run }
+ props = { mail: { accounts: [] }, actions }
slots.length = 0
render()
- click('Add an account')
+ click('Connect')
fill('Email address', addressAt('qq.com'))
fill('Authorization code', 'WRONG')
- click('Add account')
+ click('Add')
await flush()
const alert = collect(n => n.props?.role === 'alert')[0]
assert.ok(alert, 'inline error')