@norman-else/dsh-claude 0.1.23 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.d.ts +11 -0
- package/lib/client.js +285 -1
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
package/lib/client.d.ts
CHANGED
|
@@ -215,6 +215,17 @@ declare const en: {
|
|
|
215
215
|
readonly prCommentsSend: "Have Claude address the GitHub pull request comments";
|
|
216
216
|
readonly autoFixLabel: "Auto fix";
|
|
217
217
|
readonly autoFixTitle: "Watch this pull request for review comments and failing checks, hand them to Claude to fix and push until everything passes; uncheck to stop.";
|
|
218
|
+
readonly queueCount: "{n} queued messages";
|
|
219
|
+
readonly queueEdit: "Edit";
|
|
220
|
+
readonly queueEditUnsupported: "Contains non-text content and cannot be edited";
|
|
221
|
+
readonly queueSave: "Save";
|
|
222
|
+
readonly queueCancelEdit: "Cancel edit";
|
|
223
|
+
readonly queueRemove: "Remove";
|
|
224
|
+
readonly queueSteer: "Steer into the running turn";
|
|
225
|
+
readonly queueSteerUnavailable: "No running turn to steer into";
|
|
226
|
+
readonly queueEditFailed: "The queued message could not be edited.";
|
|
227
|
+
readonly queueRemoveFailed: "The queued message could not be removed.";
|
|
228
|
+
readonly queueSteerFailed: "The queued message could not be steered.";
|
|
218
229
|
readonly reviewCommentAdd: "Add line comment";
|
|
219
230
|
readonly reviewCommentPlaceholder: "Request changes";
|
|
220
231
|
readonly reviewCommentSubmit: "Comment";
|
package/lib/client.js
CHANGED
|
@@ -4,7 +4,7 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
module.exports;
|
|
6
6
|
var { Fragment, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } = require("react");
|
|
7
|
-
var { DiffBlock, DisclosureRow, HoverCard, IconApiOutline14, IconBranchOutline16, IconCheckOutline14, IconChevronDownOutline14, IconCloseOutline16, IconFullscreenOutline16, IconSearchOutline16, IconThinkOutline14, MarkdownText, Menu, Modal, StateDot, Tooltip } = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7
|
+
var { DiffBlock, DisclosureRow, HoverCard, IconApiOutline14, IconBranchOutline16, IconCheckOutline14, IconCheckOutline16, IconChevronDownOutline14, IconChevronUpOutline14, IconCloseOutline16, IconEditOutline16, IconFullscreenOutline16, IconQueueOutline14, IconSearchOutline16, IconSendOutline14, IconThinkOutline14, IconTrashOutline16, MarkdownText, Menu, Modal, StateDot, Tooltip } = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8
8
|
var { Fragment: Fragment$1, jsx, jsxs } = require("react/jsx-runtime");
|
|
9
9
|
var { createPortal } = require("react-dom");
|
|
10
10
|
/** Claude's subagent dispatch tools; rendered as plugin-owned group cards
|
|
@@ -1411,6 +1411,91 @@ window.__ModuleLoader__.load({
|
|
|
1411
1411
|
lineHeight: "22px",
|
|
1412
1412
|
textAlign: "left"
|
|
1413
1413
|
};
|
|
1414
|
+
const queueBar = {
|
|
1415
|
+
width: "100%",
|
|
1416
|
+
minWidth: 0,
|
|
1417
|
+
boxSizing: "border-box",
|
|
1418
|
+
display: "flex",
|
|
1419
|
+
flexDirection: "column",
|
|
1420
|
+
padding: "3px 6px 3px 11px",
|
|
1421
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1422
|
+
borderRadius: 11,
|
|
1423
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
1424
|
+
color: "var(--dsw-alias-label-primary)",
|
|
1425
|
+
boxShadow: "0 1px 2px color-mix(in srgb, var(--dsw-alias-label-primary) 4%, transparent)",
|
|
1426
|
+
font: "inherit",
|
|
1427
|
+
fontSize: 13,
|
|
1428
|
+
lineHeight: "20px"
|
|
1429
|
+
};
|
|
1430
|
+
const queueHeader = {
|
|
1431
|
+
width: "100%",
|
|
1432
|
+
minHeight: 30,
|
|
1433
|
+
display: "flex",
|
|
1434
|
+
alignItems: "center",
|
|
1435
|
+
gap: 8,
|
|
1436
|
+
padding: "2px 0",
|
|
1437
|
+
border: "none",
|
|
1438
|
+
outline: "none",
|
|
1439
|
+
background: "transparent",
|
|
1440
|
+
color: "inherit",
|
|
1441
|
+
font: "inherit",
|
|
1442
|
+
fontSize: 13,
|
|
1443
|
+
textAlign: "left",
|
|
1444
|
+
cursor: "pointer"
|
|
1445
|
+
};
|
|
1446
|
+
const queueLead = {
|
|
1447
|
+
flex: "none",
|
|
1448
|
+
display: "grid",
|
|
1449
|
+
placeItems: "center",
|
|
1450
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
1451
|
+
};
|
|
1452
|
+
const queueCount = {
|
|
1453
|
+
minWidth: 0,
|
|
1454
|
+
flex: 1,
|
|
1455
|
+
fontWeight: 550
|
|
1456
|
+
};
|
|
1457
|
+
const queueList = {
|
|
1458
|
+
maxHeight: 180,
|
|
1459
|
+
margin: 0,
|
|
1460
|
+
padding: 0,
|
|
1461
|
+
listStyle: "none",
|
|
1462
|
+
overflowY: "auto"
|
|
1463
|
+
};
|
|
1464
|
+
const queueRow = {
|
|
1465
|
+
minHeight: 30,
|
|
1466
|
+
display: "flex",
|
|
1467
|
+
alignItems: "center",
|
|
1468
|
+
gap: 8
|
|
1469
|
+
};
|
|
1470
|
+
const queueRowDivider = { borderTop: "1px solid var(--dsw-alias-border-l1, color-mix(in srgb, currentColor 12%, transparent))" };
|
|
1471
|
+
const queuePreview = {
|
|
1472
|
+
minWidth: 0,
|
|
1473
|
+
flex: 1,
|
|
1474
|
+
overflow: "hidden",
|
|
1475
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
1476
|
+
textOverflow: "ellipsis",
|
|
1477
|
+
whiteSpace: "nowrap"
|
|
1478
|
+
};
|
|
1479
|
+
const queueEditor = {
|
|
1480
|
+
minWidth: 0,
|
|
1481
|
+
flex: 1,
|
|
1482
|
+
height: 26,
|
|
1483
|
+
boxSizing: "border-box",
|
|
1484
|
+
padding: "0 8px",
|
|
1485
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1486
|
+
borderRadius: 6,
|
|
1487
|
+
outline: "none",
|
|
1488
|
+
background: "var(--dsw-alias-bg-layer-2)",
|
|
1489
|
+
color: "var(--dsw-alias-label-primary)",
|
|
1490
|
+
font: "inherit",
|
|
1491
|
+
fontSize: 13
|
|
1492
|
+
};
|
|
1493
|
+
const queueActions = {
|
|
1494
|
+
flex: "none",
|
|
1495
|
+
display: "inline-flex",
|
|
1496
|
+
alignItems: "center",
|
|
1497
|
+
gap: 2
|
|
1498
|
+
};
|
|
1414
1499
|
const repositoryBarMerged = {
|
|
1415
1500
|
borderColor: "color-mix(in srgb, #a78bfa 30%, var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent)))",
|
|
1416
1501
|
background: "color-mix(in srgb, #a78bfa 5%, var(--dsw-alias-bg-layer-1))"
|
|
@@ -6305,6 +6390,165 @@ window.__ModuleLoader__.load({
|
|
|
6305
6390
|
});
|
|
6306
6391
|
}
|
|
6307
6392
|
//#endregion
|
|
6393
|
+
//#region src/client/ClaudeQueueDock.tsx
|
|
6394
|
+
/** Replaces the Host queue strip (same slot cell, lower priority) with one
|
|
6395
|
+
* styled like the repository status bar. Behaviour mirrors the Host strip:
|
|
6396
|
+
* one row inline, several rows behind a collapsible count, edit/remove/steer. */
|
|
6397
|
+
function ClaudeQueueDock({ useSession, t, updateQueue, notify }) {
|
|
6398
|
+
const inbox = useSession((session) => session.queue);
|
|
6399
|
+
const queue = useMemo(() => inbox.filter((row) => row.placement === "queued"), [inbox]);
|
|
6400
|
+
const running = useSession((session) => session.running);
|
|
6401
|
+
const mutable = useSession((session) => session.subagent === null);
|
|
6402
|
+
const [editing, setEditing] = useState();
|
|
6403
|
+
const [busy, setBusy] = useState();
|
|
6404
|
+
const [collapsed, setCollapsed] = useState(true);
|
|
6405
|
+
const listId = useId();
|
|
6406
|
+
useEffect(() => {
|
|
6407
|
+
if (queue.length === 0 && !collapsed) setCollapsed(true);
|
|
6408
|
+
if (editing !== void 0 && (!mutable || !queue.some((row) => row.id === editing.id))) setEditing(void 0);
|
|
6409
|
+
}, [
|
|
6410
|
+
collapsed,
|
|
6411
|
+
editing,
|
|
6412
|
+
mutable,
|
|
6413
|
+
queue
|
|
6414
|
+
]);
|
|
6415
|
+
if (queue.length === 0) return null;
|
|
6416
|
+
const interacting = mutable && (editing !== void 0 || busy !== void 0);
|
|
6417
|
+
const expanded = !collapsed || interacting;
|
|
6418
|
+
const listVisible = queue.length === 1 || expanded;
|
|
6419
|
+
const apply = async (id, action, failure) => {
|
|
6420
|
+
setBusy(id);
|
|
6421
|
+
try {
|
|
6422
|
+
await updateQueue(id, action);
|
|
6423
|
+
return true;
|
|
6424
|
+
} catch {
|
|
6425
|
+
notify("error", failure);
|
|
6426
|
+
return false;
|
|
6427
|
+
} finally {
|
|
6428
|
+
setBusy((current) => current === id ? void 0 : current);
|
|
6429
|
+
}
|
|
6430
|
+
};
|
|
6431
|
+
const saveEdit = async () => {
|
|
6432
|
+
if (editing === void 0 || editing.text.trim() === "") return;
|
|
6433
|
+
if (await apply(editing.id, {
|
|
6434
|
+
kind: "edit",
|
|
6435
|
+
content: [{
|
|
6436
|
+
type: "text",
|
|
6437
|
+
text: editing.text
|
|
6438
|
+
}]
|
|
6439
|
+
}, t("queueEditFailed"))) setEditing(void 0);
|
|
6440
|
+
};
|
|
6441
|
+
const action = (label, icon, onClick, disabled, hint) => /* @__PURE__ */ jsx(Tooltip, {
|
|
6442
|
+
label: hint ?? label,
|
|
6443
|
+
side: "bottom",
|
|
6444
|
+
delayMs: 400,
|
|
6445
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
6446
|
+
type: "button",
|
|
6447
|
+
className: panelIconButtonClass,
|
|
6448
|
+
"aria-label": label,
|
|
6449
|
+
disabled,
|
|
6450
|
+
onClick,
|
|
6451
|
+
children: icon
|
|
6452
|
+
})
|
|
6453
|
+
});
|
|
6454
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6455
|
+
style: repositoryBarFrame,
|
|
6456
|
+
"data-claude-queue-dock": "",
|
|
6457
|
+
children: [/* @__PURE__ */ jsx("style", {
|
|
6458
|
+
"data-dsh-claude-queue-styles": true,
|
|
6459
|
+
children: panelIconButtonCss
|
|
6460
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6461
|
+
style: queueBar,
|
|
6462
|
+
children: [queue.length > 1 ? /* @__PURE__ */ jsxs("button", {
|
|
6463
|
+
type: "button",
|
|
6464
|
+
style: queueHeader,
|
|
6465
|
+
"aria-controls": listId,
|
|
6466
|
+
"aria-expanded": expanded,
|
|
6467
|
+
disabled: interacting,
|
|
6468
|
+
onClick: () => {
|
|
6469
|
+
setCollapsed((value) => !value);
|
|
6470
|
+
},
|
|
6471
|
+
children: [
|
|
6472
|
+
/* @__PURE__ */ jsx("span", {
|
|
6473
|
+
style: queueLead,
|
|
6474
|
+
"aria-hidden": "true",
|
|
6475
|
+
children: /* @__PURE__ */ jsx(IconQueueOutline14, {})
|
|
6476
|
+
}),
|
|
6477
|
+
/* @__PURE__ */ jsx("span", {
|
|
6478
|
+
style: queueCount,
|
|
6479
|
+
children: t("queueCount", { n: queue.length })
|
|
6480
|
+
}),
|
|
6481
|
+
/* @__PURE__ */ jsx("span", {
|
|
6482
|
+
style: queueLead,
|
|
6483
|
+
"aria-hidden": "true",
|
|
6484
|
+
children: expanded ? /* @__PURE__ */ jsx(IconChevronDownOutline14, {}) : /* @__PURE__ */ jsx(IconChevronUpOutline14, {})
|
|
6485
|
+
})
|
|
6486
|
+
]
|
|
6487
|
+
}) : null, /* @__PURE__ */ jsx("ul", {
|
|
6488
|
+
id: listId,
|
|
6489
|
+
style: queueList,
|
|
6490
|
+
hidden: !listVisible,
|
|
6491
|
+
children: listVisible ? queue.map((row, index) => /* @__PURE__ */ jsxs("li", {
|
|
6492
|
+
style: {
|
|
6493
|
+
...queueRow,
|
|
6494
|
+
...index > 0 ? queueRowDivider : {}
|
|
6495
|
+
},
|
|
6496
|
+
children: [
|
|
6497
|
+
queue.length === 1 ? /* @__PURE__ */ jsx("span", {
|
|
6498
|
+
style: queueLead,
|
|
6499
|
+
"aria-hidden": "true",
|
|
6500
|
+
children: /* @__PURE__ */ jsx(IconQueueOutline14, {})
|
|
6501
|
+
}) : null,
|
|
6502
|
+
editing?.id === row.id ? /* @__PURE__ */ jsx("input", {
|
|
6503
|
+
autoFocus: true,
|
|
6504
|
+
style: queueEditor,
|
|
6505
|
+
"aria-label": t("queueEdit"),
|
|
6506
|
+
value: editing.text,
|
|
6507
|
+
onChange: (event) => {
|
|
6508
|
+
setEditing({
|
|
6509
|
+
id: row.id,
|
|
6510
|
+
text: event.currentTarget.value
|
|
6511
|
+
});
|
|
6512
|
+
},
|
|
6513
|
+
onKeyDown: (event) => {
|
|
6514
|
+
if (event.key === "Escape") setEditing(void 0);
|
|
6515
|
+
else if (event.key === "Enter" && !event.nativeEvent.isComposing) {
|
|
6516
|
+
event.preventDefault();
|
|
6517
|
+
saveEdit();
|
|
6518
|
+
}
|
|
6519
|
+
}
|
|
6520
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
6521
|
+
style: queuePreview,
|
|
6522
|
+
children: row.preview
|
|
6523
|
+
}),
|
|
6524
|
+
mutable ? /* @__PURE__ */ jsx("span", {
|
|
6525
|
+
style: queueActions,
|
|
6526
|
+
children: editing?.id === row.id ? /* @__PURE__ */ jsxs(Fragment$1, { children: [action(t("queueSave"), /* @__PURE__ */ jsx(IconCheckOutline16, { size: 14 }), () => {
|
|
6527
|
+
saveEdit();
|
|
6528
|
+
}, busy !== void 0 || editing.text.trim() === ""), action(t("queueCancelEdit"), /* @__PURE__ */ jsx(IconCloseOutline16, { size: 14 }), () => {
|
|
6529
|
+
setEditing(void 0);
|
|
6530
|
+
}, busy !== void 0)] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6531
|
+
action(t("queueEdit"), /* @__PURE__ */ jsx(IconEditOutline16, { size: 14 }), () => {
|
|
6532
|
+
if (row.text !== null) setEditing({
|
|
6533
|
+
id: row.id,
|
|
6534
|
+
text: row.text
|
|
6535
|
+
});
|
|
6536
|
+
}, busy !== void 0 || row.text === null, row.text === null ? t("queueEditUnsupported") : void 0),
|
|
6537
|
+
action(t("queueRemove"), /* @__PURE__ */ jsx(IconTrashOutline16, { size: 14 }), () => {
|
|
6538
|
+
apply(row.id, { kind: "remove" }, t("queueRemoveFailed"));
|
|
6539
|
+
}, busy !== void 0),
|
|
6540
|
+
action(t("queueSteer"), /* @__PURE__ */ jsx(IconSendOutline14, {}), () => {
|
|
6541
|
+
apply(row.id, { kind: "steer" }, t("queueSteerFailed"));
|
|
6542
|
+
}, busy !== void 0 || !running, running ? void 0 : t("queueSteerUnavailable"))
|
|
6543
|
+
] })
|
|
6544
|
+
}) : null
|
|
6545
|
+
]
|
|
6546
|
+
}, row.id)) : null
|
|
6547
|
+
})]
|
|
6548
|
+
})]
|
|
6549
|
+
});
|
|
6550
|
+
}
|
|
6551
|
+
//#endregion
|
|
6308
6552
|
//#region src/client/hero-dom-bridge.ts
|
|
6309
6553
|
const PORTAL_ATTRIBUTE = "data-dsh-claude-hero-controls";
|
|
6310
6554
|
function normalizedText(element) {
|
|
@@ -7373,6 +7617,17 @@ window.__ModuleLoader__.load({
|
|
|
7373
7617
|
prCommentsSend: "让 Claude 处理 GitHub 上的 PR 评论",
|
|
7374
7618
|
autoFixLabel: "Auto fix",
|
|
7375
7619
|
autoFixTitle: "自动监听这个 PR 的 review 评论与 CI 失败,交给 Claude 修复并推送,直到全部通过;取消勾选即停止。",
|
|
7620
|
+
queueCount: "{n} 条排队消息",
|
|
7621
|
+
queueEdit: "编辑",
|
|
7622
|
+
queueEditUnsupported: "包含非文本内容,无法编辑",
|
|
7623
|
+
queueSave: "保存",
|
|
7624
|
+
queueCancelEdit: "取消编辑",
|
|
7625
|
+
queueRemove: "删除",
|
|
7626
|
+
queueSteer: "插入当前回合",
|
|
7627
|
+
queueSteerUnavailable: "没有正在运行的回合",
|
|
7628
|
+
queueEditFailed: "排队消息编辑失败。",
|
|
7629
|
+
queueRemoveFailed: "排队消息删除失败。",
|
|
7630
|
+
queueSteerFailed: "排队消息插入失败。",
|
|
7376
7631
|
reviewCommentAdd: "添加行评论",
|
|
7377
7632
|
reviewCommentPlaceholder: "请求更改",
|
|
7378
7633
|
reviewCommentSubmit: "注释",
|
|
@@ -7600,6 +7855,17 @@ window.__ModuleLoader__.load({
|
|
|
7600
7855
|
prCommentsSend: "Have Claude address the GitHub pull request comments",
|
|
7601
7856
|
autoFixLabel: "Auto fix",
|
|
7602
7857
|
autoFixTitle: "Watch this pull request for review comments and failing checks, hand them to Claude to fix and push until everything passes; uncheck to stop.",
|
|
7858
|
+
queueCount: "{n} queued messages",
|
|
7859
|
+
queueEdit: "Edit",
|
|
7860
|
+
queueEditUnsupported: "Contains non-text content and cannot be edited",
|
|
7861
|
+
queueSave: "Save",
|
|
7862
|
+
queueCancelEdit: "Cancel edit",
|
|
7863
|
+
queueRemove: "Remove",
|
|
7864
|
+
queueSteer: "Steer into the running turn",
|
|
7865
|
+
queueSteerUnavailable: "No running turn to steer into",
|
|
7866
|
+
queueEditFailed: "The queued message could not be edited.",
|
|
7867
|
+
queueRemoveFailed: "The queued message could not be removed.",
|
|
7868
|
+
queueSteerFailed: "The queued message could not be steered.",
|
|
7603
7869
|
reviewCommentAdd: "Add line comment",
|
|
7604
7870
|
reviewCommentPlaceholder: "Request changes",
|
|
7605
7871
|
reviewCommentSubmit: "Comment",
|
|
@@ -7849,6 +8115,24 @@ window.__ModuleLoader__.load({
|
|
|
7849
8115
|
};
|
|
7850
8116
|
}
|
|
7851
8117
|
}, ClaudeRepositoryStatus));
|
|
8118
|
+
if (sessions !== void 0 && conversation !== void 0) ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
|
8119
|
+
name: "conversation.input.dock",
|
|
8120
|
+
id: "queue",
|
|
8121
|
+
order: 20,
|
|
8122
|
+
priority: -10,
|
|
8123
|
+
locale: namespace,
|
|
8124
|
+
inject: (sessionId) => {
|
|
8125
|
+
const scope = sessions.scope(sessionId);
|
|
8126
|
+
const target = (scope === void 0 ? void 0 : scope.get("conversation")) ?? conversation;
|
|
8127
|
+
return {
|
|
8128
|
+
t,
|
|
8129
|
+
updateQueue: (itemId, action) => target.updateQueue(itemId, action),
|
|
8130
|
+
notify: (level, text) => {
|
|
8131
|
+
if (scope !== void 0) conversation.input.for(scope).notify(level, text);
|
|
8132
|
+
}
|
|
8133
|
+
};
|
|
8134
|
+
}
|
|
8135
|
+
}, ClaudeQueueDock));
|
|
7852
8136
|
if (sessions !== void 0 && workspaces !== void 0 && conversation !== void 0 && connection !== void 0) ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
|
7853
8137
|
name: "conversation.input.dock",
|
|
7854
8138
|
id: "claude-hero-repository-controls",
|