dsh-context 0.22.1 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +36 -6
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -910,6 +910,35 @@ window.__ModuleLoader__.load({
|
|
|
910
910
|
mdClass: "lc-ts-desc-md"
|
|
911
911
|
}));
|
|
912
912
|
}
|
|
913
|
+
/**
|
|
914
|
+
* One assistant tool call as its own card, mirroring the tool-definition
|
|
915
|
+
* parameter card: the head names the call target (with the parsed argument
|
|
916
|
+
* count), the body lists the arguments as name/type/value rows. Arguments
|
|
917
|
+
* that are not a parseable JSON object fall back to the raw payload inside
|
|
918
|
+
* the same card.
|
|
919
|
+
*/
|
|
920
|
+
function ToolCallCard(props) {
|
|
921
|
+
const args = React.useMemo(() => {
|
|
922
|
+
if (typeof props.argsRaw !== "string" || props.argsRaw === "") return null;
|
|
923
|
+
try {
|
|
924
|
+
const parsed = JSON.parse(props.argsRaw);
|
|
925
|
+
return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
926
|
+
} catch {
|
|
927
|
+
return null;
|
|
928
|
+
}
|
|
929
|
+
}, [props.argsRaw]);
|
|
930
|
+
return /* @__PURE__ */ React.createElement("div", { className: "lc-ts-card" }, /* @__PURE__ */ React.createElement("div", { className: "lc-ts-card-head" }, /* @__PURE__ */ React.createElement("b", null, "→ " + props.name), args !== null ? /* @__PURE__ */ React.createElement("span", { className: "lc-ts-card-count" }, Object.keys(args).length) : null), args !== null ? Object.keys(args).map((k) => /* @__PURE__ */ React.createElement(CallArgRow, {
|
|
931
|
+
key: k,
|
|
932
|
+
name: k,
|
|
933
|
+
value: args[k]
|
|
934
|
+
})) : typeof props.argsRaw === "string" && props.argsRaw !== "" ? /* @__PURE__ */ React.createElement("pre", { className: "lc-br-pre lc-br-dim" }, props.argsRaw) : null);
|
|
935
|
+
}
|
|
936
|
+
/** One parsed call argument: name, value type, and the value itself (full-width line). */
|
|
937
|
+
function CallArgRow(props) {
|
|
938
|
+
const v = props.value;
|
|
939
|
+
const text = typeof v === "string" ? v : v === void 0 ? "" : JSON.stringify(v);
|
|
940
|
+
return /* @__PURE__ */ React.createElement("div", { className: "lc-ts-param-row" }, /* @__PURE__ */ React.createElement("span", { className: "lc-ts-param-name" }, props.name), /* @__PURE__ */ React.createElement("span", { className: "lc-ts-param-type" }, v === null ? "null" : Array.isArray(v) ? "array" : typeof v), /* @__PURE__ */ React.createElement("span", { className: "lc-ts-param-desc" }, text));
|
|
941
|
+
}
|
|
913
942
|
/** The actual content of one surface element, joined from the conversation snapshot. */
|
|
914
943
|
function NodeContent(props) {
|
|
915
944
|
const { node, conv, rich, img } = props;
|
|
@@ -936,10 +965,11 @@ window.__ModuleLoader__.load({
|
|
|
936
965
|
text: blk.text,
|
|
937
966
|
rich
|
|
938
967
|
});
|
|
939
|
-
if (blk.kind === "tool-call") return /* @__PURE__ */ React.createElement(
|
|
968
|
+
if (blk.kind === "tool-call") return /* @__PURE__ */ React.createElement(ToolCallCard, {
|
|
940
969
|
key: i,
|
|
941
|
-
|
|
942
|
-
|
|
970
|
+
name: blk.name ?? "?",
|
|
971
|
+
argsRaw: blk.argsRaw
|
|
972
|
+
});
|
|
943
973
|
const image = imageRefOf(b);
|
|
944
974
|
if (image !== null) return /* @__PURE__ */ React.createElement(img.Card, {
|
|
945
975
|
key: i,
|
|
@@ -1647,7 +1677,7 @@ window.__ModuleLoader__.load({
|
|
|
1647
1677
|
return function PluginInfo() {
|
|
1648
1678
|
const [latest, setLatest] = React.useState(null);
|
|
1649
1679
|
React.useEffect(() => {
|
|
1650
|
-
if ("0.22.
|
|
1680
|
+
if ("0.22.2".includes("-dev")) return;
|
|
1651
1681
|
let on = true;
|
|
1652
1682
|
fetchLatestVersion().then((v) => {
|
|
1653
1683
|
if (on && v) setLatest(v);
|
|
@@ -1656,8 +1686,8 @@ window.__ModuleLoader__.load({
|
|
|
1656
1686
|
on = false;
|
|
1657
1687
|
};
|
|
1658
1688
|
}, []);
|
|
1659
|
-
const update = latest !== null && isNewerVersion(latest, "0.22.
|
|
1660
|
-
const nameValue = ["dsh-context (v0.22.
|
|
1689
|
+
const update = latest !== null && isNewerVersion(latest, "0.22.2") ? latest : null;
|
|
1690
|
+
const nameValue = ["dsh-context (v0.22.2)"];
|
|
1661
1691
|
if (update) nameValue.push(/* @__PURE__ */ React.createElement("span", {
|
|
1662
1692
|
key: "update",
|
|
1663
1693
|
className: "lc-pi-update"
|