@pactor-app/chat 1.15.4 → 1.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +14 -11
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +14 -11
- package/package.json +6 -6
- package/styles.css +26 -0
package/dist/index.cjs
CHANGED
|
@@ -2680,6 +2680,7 @@ function ActivityTrace({ message }) {
|
|
|
2680
2680
|
);
|
|
2681
2681
|
const answerPhase = mode === "responding" || !streaming;
|
|
2682
2682
|
const { open, toggle } = usePinnedCollapse(!answerPhase);
|
|
2683
|
+
const collapsible = entries.length > 0 || thinkingParts.length > 0;
|
|
2683
2684
|
const mountTimeRef = (0, import_react12.useRef)(0);
|
|
2684
2685
|
if (mountTimeRef.current === 0) {
|
|
2685
2686
|
mountTimeRef.current = Date.now();
|
|
@@ -2701,10 +2702,10 @@ function ActivityTrace({ message }) {
|
|
|
2701
2702
|
elapsed,
|
|
2702
2703
|
"s"
|
|
2703
2704
|
] }),
|
|
2704
|
-
|
|
2705
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "pactor-chat-trace__chevron", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_components8.Icon, { name: "chevron-right", size: 12 }) })
|
|
2705
2706
|
] });
|
|
2706
2707
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "pactor-chat-trace", "data-open": open, children: [
|
|
2707
|
-
|
|
2708
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2708
2709
|
"button",
|
|
2709
2710
|
{
|
|
2710
2711
|
type: "button",
|
|
@@ -2714,15 +2715,17 @@ function ActivityTrace({ message }) {
|
|
|
2714
2715
|
children: header
|
|
2715
2716
|
}
|
|
2716
2717
|
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "pactor-chat-trace__header", children: header }),
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2718
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2719
|
+
entries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "pactor-chat-trace__entries", children: entries.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TraceRow, { entry }, entry.callIndex)) }),
|
|
2720
|
+
thinkingParts.map((part, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2721
|
+
ThinkingCard,
|
|
2722
|
+
{
|
|
2723
|
+
part,
|
|
2724
|
+
answerPhase
|
|
2725
|
+
},
|
|
2726
|
+
part.id ?? index
|
|
2727
|
+
))
|
|
2728
|
+
] })
|
|
2726
2729
|
] });
|
|
2727
2730
|
}
|
|
2728
2731
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1338,8 +1338,11 @@ declare function ChatView({ store, transport, onSend, safeRegistry, capabilities
|
|
|
1338
1338
|
*
|
|
1339
1339
|
* - 流式状态头(StreamingStatus):动画图标 + 呼吸状态文案 + 秒级计时,
|
|
1340
1340
|
* 模式由纯函数 detectStreamingMode 推导;消息结束后定格为完成态;
|
|
1341
|
-
*
|
|
1342
|
-
* -
|
|
1341
|
+
* 状态头同时是外层容器的折叠开关,统一折叠/展开区内全部内容;
|
|
1342
|
+
* - 配对工具轨迹(TraceRow):pairToolTraces 输出的单行可展开条目,
|
|
1343
|
+
* 与状态头同块、紧随其后;
|
|
1344
|
+
* - thinking 折叠卡(ThinkingCard):与工具列表并排的独立块,
|
|
1345
|
+
* markdown 正文,流式展开 + 进行中指示,
|
|
1343
1346
|
* 答案阶段自动折叠,用户操作后 pin。
|
|
1344
1347
|
*
|
|
1345
1348
|
* 折叠状态机(每条消息独立,随组件实例记忆):`auto | pinned-open |
|
package/dist/index.d.ts
CHANGED
|
@@ -1338,8 +1338,11 @@ declare function ChatView({ store, transport, onSend, safeRegistry, capabilities
|
|
|
1338
1338
|
*
|
|
1339
1339
|
* - 流式状态头(StreamingStatus):动画图标 + 呼吸状态文案 + 秒级计时,
|
|
1340
1340
|
* 模式由纯函数 detectStreamingMode 推导;消息结束后定格为完成态;
|
|
1341
|
-
*
|
|
1342
|
-
* -
|
|
1341
|
+
* 状态头同时是外层容器的折叠开关,统一折叠/展开区内全部内容;
|
|
1342
|
+
* - 配对工具轨迹(TraceRow):pairToolTraces 输出的单行可展开条目,
|
|
1343
|
+
* 与状态头同块、紧随其后;
|
|
1344
|
+
* - thinking 折叠卡(ThinkingCard):与工具列表并排的独立块,
|
|
1345
|
+
* markdown 正文,流式展开 + 进行中指示,
|
|
1343
1346
|
* 答案阶段自动折叠,用户操作后 pin。
|
|
1344
1347
|
*
|
|
1345
1348
|
* 折叠状态机(每条消息独立,随组件实例记忆):`auto | pinned-open |
|
package/dist/index.js
CHANGED
|
@@ -2635,6 +2635,7 @@ function ActivityTrace({ message }) {
|
|
|
2635
2635
|
);
|
|
2636
2636
|
const answerPhase = mode === "responding" || !streaming;
|
|
2637
2637
|
const { open, toggle } = usePinnedCollapse(!answerPhase);
|
|
2638
|
+
const collapsible = entries.length > 0 || thinkingParts.length > 0;
|
|
2638
2639
|
const mountTimeRef = useRef8(0);
|
|
2639
2640
|
if (mountTimeRef.current === 0) {
|
|
2640
2641
|
mountTimeRef.current = Date.now();
|
|
@@ -2656,10 +2657,10 @@ function ActivityTrace({ message }) {
|
|
|
2656
2657
|
elapsed,
|
|
2657
2658
|
"s"
|
|
2658
2659
|
] }),
|
|
2659
|
-
|
|
2660
|
+
collapsible && /* @__PURE__ */ jsx12("span", { className: "pactor-chat-trace__chevron", children: /* @__PURE__ */ jsx12(Icon7, { name: "chevron-right", size: 12 }) })
|
|
2660
2661
|
] });
|
|
2661
2662
|
return /* @__PURE__ */ jsxs8("div", { className: "pactor-chat-trace", "data-open": open, children: [
|
|
2662
|
-
|
|
2663
|
+
collapsible ? /* @__PURE__ */ jsx12(
|
|
2663
2664
|
"button",
|
|
2664
2665
|
{
|
|
2665
2666
|
type: "button",
|
|
@@ -2669,15 +2670,17 @@ function ActivityTrace({ message }) {
|
|
|
2669
2670
|
children: header
|
|
2670
2671
|
}
|
|
2671
2672
|
) : /* @__PURE__ */ jsx12("div", { className: "pactor-chat-trace__header", children: header }),
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2673
|
+
open && /* @__PURE__ */ jsxs8(Fragment8, { children: [
|
|
2674
|
+
entries.length > 0 && /* @__PURE__ */ jsx12("div", { className: "pactor-chat-trace__entries", children: entries.map((entry) => /* @__PURE__ */ jsx12(TraceRow, { entry }, entry.callIndex)) }),
|
|
2675
|
+
thinkingParts.map((part, index) => /* @__PURE__ */ jsx12(
|
|
2676
|
+
ThinkingCard,
|
|
2677
|
+
{
|
|
2678
|
+
part,
|
|
2679
|
+
answerPhase
|
|
2680
|
+
},
|
|
2681
|
+
part.id ?? index
|
|
2682
|
+
))
|
|
2683
|
+
] })
|
|
2681
2684
|
] });
|
|
2682
2685
|
}
|
|
2683
2686
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pactor-app/chat",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.6",
|
|
4
4
|
"description": "Pactor chat: AI message rendering protocol (message model, streaming reducer, safe registry, capability action) and chat runtime view (ChatView / MessageBubble / PartRenderer / Composer / chat layout)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pactor",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@pactor-app/core": "1.15.
|
|
53
|
-
"@pactor-app/
|
|
54
|
-
"@pactor-app/
|
|
55
|
-
"@pactor-app/
|
|
56
|
-
"@pactor-app/runtime": "1.15.
|
|
52
|
+
"@pactor-app/core": "1.15.6",
|
|
53
|
+
"@pactor-app/markdown": "1.15.6",
|
|
54
|
+
"@pactor-app/ui": "1.15.6",
|
|
55
|
+
"@pactor-app/permission": "1.15.6",
|
|
56
|
+
"@pactor-app/runtime": "1.15.6"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": ">=18"
|
package/styles.css
CHANGED
|
@@ -1716,3 +1716,29 @@ button.pactor-chat-trace__header:hover,
|
|
|
1716
1716
|
animation: none !important;
|
|
1717
1717
|
}
|
|
1718
1718
|
}
|
|
1719
|
+
|
|
1720
|
+
.pactor-markdown {
|
|
1721
|
+
line-height: 2;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
.pactor-markdown hr {
|
|
1725
|
+
margin: 1em 0;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
.pactor-markdown h2 {
|
|
1729
|
+
font-size: 1.2rem;
|
|
1730
|
+
font-weight: 600;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
.pactor-markdown h1 {
|
|
1734
|
+
font-size: 1.3rem;
|
|
1735
|
+
font-weight: 600;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
.pactor-chat-thinking {
|
|
1739
|
+
margin-top: 8px;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
.pactor-chat-thinking__body .pactor-markdown {
|
|
1743
|
+
line-height: 1.5;
|
|
1744
|
+
}
|