@waq666/pneuma 0.8.0 → 0.8.1

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.
Files changed (84) hide show
  1. package/README.md +10 -5
  2. package/lib/adapter/transcript.js +12 -1
  3. package/lib/app/Composer.js +14 -2
  4. package/lib/contract/plugin.d.ts +8 -0
  5. package/lib/contract/session.d.ts +8 -0
  6. package/lib/contract/snapshot.d.ts +5 -0
  7. package/lib/core/agent-roles.js +3 -2
  8. package/lib/core/commands-completion.d.ts +17 -0
  9. package/lib/core/commands-completion.js +56 -3
  10. package/lib/core/compact.d.ts +36 -6
  11. package/lib/core/compact.js +89 -17
  12. package/lib/core/events.d.ts +5 -0
  13. package/lib/core/git-info.d.ts +127 -15
  14. package/lib/core/git-info.js +307 -32
  15. package/lib/core/host-methods.d.ts +1 -1
  16. package/lib/core/host-methods.js +1 -0
  17. package/lib/core/llm.d.ts +9 -0
  18. package/lib/core/llm.js +1 -0
  19. package/lib/core/loop.js +8 -2
  20. package/lib/core/permission-scope.d.ts +12 -1
  21. package/lib/core/permission-scope.js +26 -1
  22. package/lib/core/presets.js +30 -2
  23. package/lib/core/session.d.ts +48 -7
  24. package/lib/core/session.js +263 -9
  25. package/lib/core/ui-methods.d.ts +1 -1
  26. package/lib/core/ui-methods.js +6 -0
  27. package/lib/plugins/agent.js +47 -6
  28. package/lib/plugins/commands.js +118 -14
  29. package/lib/plugins/compact.d.ts +2 -2
  30. package/lib/plugins/compact.js +150 -22
  31. package/lib/plugins/git.js +15 -1
  32. package/lib/plugins/goal.js +8 -4
  33. package/lib/plugins/host-stdio.js +11 -1
  34. package/lib/plugins/microcompact.d.ts +3 -0
  35. package/lib/plugins/microcompact.js +26 -0
  36. package/lib/plugins/remote.js +7 -1
  37. package/lib/plugins/runtime.js +5 -0
  38. package/lib/plugins/session.js +81 -7
  39. package/lib/plugins/skills.js +16 -0
  40. package/lib/plugins/subagent.js +47 -11
  41. package/lib/services/types.d.ts +66 -8
  42. package/lib/ui/assets/{app-MhfBFsp-.js → app-B-Jx5dnh.js} +60 -59
  43. package/lib/ui/assets/{chunk-Cq7xGE-D.js → chunk-Bfdlo8Me.js} +1 -1
  44. package/lib/ui/assets/{chunk-CA5f1pGf.js → chunk-DGX-i4eb.js} +1 -1
  45. package/lib/ui/assets/index.html +2 -2
  46. package/lib/ui/assets/style-WzxwEPaE.css +1 -0
  47. package/lib/ui/plugins/actions/bundle.json +2 -2
  48. package/lib/ui/plugins/ask/bundle.json +2 -2
  49. package/lib/ui/plugins/browser/bundle.json +2 -2
  50. package/lib/ui/plugins/composer/bundle.json +2 -2
  51. package/lib/ui/plugins/composer/client.js +57 -4
  52. package/lib/ui/plugins/files/bundle.json +2 -2
  53. package/lib/ui/plugins/manifest.json +1 -1
  54. package/lib/ui/plugins/palette/bundle.json +2 -2
  55. package/lib/ui/plugins/plugins/bundle.json +2 -2
  56. package/lib/ui/plugins/preview/bundle.json +2 -2
  57. package/lib/ui/plugins/prompt/bundle.json +2 -2
  58. package/lib/ui/plugins/sessions/bundle.json +2 -2
  59. package/lib/ui/plugins/sessions/client.js +41 -13
  60. package/lib/ui/plugins/settings/bundle.json +2 -2
  61. package/lib/ui/plugins/skills/bundle.json +2 -2
  62. package/lib/ui/plugins/status/bundle.json +2 -2
  63. package/lib/ui/plugins/status/client.js +162 -9
  64. package/lib/ui/plugins/statusbar/bundle.json +2 -2
  65. package/lib/ui/plugins/tasks/bundle.json +2 -2
  66. package/lib/ui/plugins/team/bundle.json +2 -2
  67. package/lib/ui/plugins/terminal/bundle.json +2 -2
  68. package/lib/ui/plugins/trace/bundle.json +2 -2
  69. package/lib/ui/plugins/transcript/bundle.json +2 -2
  70. package/lib/ui/plugins/transcript/client.js +156 -96
  71. package/lib/ui/sdk/@dsc/ui/package.json +1 -1
  72. package/lib/ui/sdk/@dsc/ui-core/package.json +1 -1
  73. package/lib/ui/sdk/@dsc/ui-dockkit/package.json +1 -1
  74. package/lib/ui/sdk/@dsc/ui-layout/package.json +1 -1
  75. package/lib/ui/sdk/@dsc/ui-primitives/icons.d.ts +13 -2
  76. package/lib/ui/sdk/@dsc/ui-primitives/image-lightbox.d.ts +21 -0
  77. package/lib/ui/sdk/@dsc/ui-primitives/index.d.ts +3 -0
  78. package/lib/ui/sdk/@dsc/ui-primitives/package.json +1 -1
  79. package/lib/ui/sdk/@dsc/ui-primitives/review-findings-card.d.ts +25 -0
  80. package/lib/ui/sdk/@dsc/ui-primitives/review-findings.d.ts +64 -0
  81. package/lib/ui/sdk/@dsc/ui-renderer/package.json +1 -1
  82. package/lib/ui/sdk/@dsc/ui-slots/package.json +1 -1
  83. package/package.json +1 -1
  84. package/lib/ui/assets/style-CIJVQKkj.css +0 -1
@@ -1,9 +1,9 @@
1
1
  {
2
- "apiVersion": "0.8.0",
2
+ "apiVersion": "0.8.1",
3
3
  "file": "client.js",
4
4
  "platforms": [
5
5
  "web"
6
6
  ],
7
- "api": "^0.8.0",
7
+ "api": "^0.8.1",
8
8
  "phase": "early"
9
9
  }
@@ -1,8 +1,8 @@
1
1
  {
2
- "apiVersion": "0.8.0",
2
+ "apiVersion": "0.8.1",
3
3
  "file": "client.js",
4
4
  "platforms": [
5
5
  "web"
6
6
  ],
7
- "api": "^0.8.0"
7
+ "api": "^0.8.1"
8
8
  }
@@ -1,8 +1,8 @@
1
1
  {
2
- "apiVersion": "0.8.0",
2
+ "apiVersion": "0.8.1",
3
3
  "file": "client.js",
4
4
  "platforms": [
5
5
  "web"
6
6
  ],
7
- "api": "^0.8.0"
7
+ "api": "^0.8.1"
8
8
  }
@@ -1,8 +1,8 @@
1
1
  {
2
- "apiVersion": "0.8.0",
2
+ "apiVersion": "0.8.1",
3
3
  "file": "client.js",
4
4
  "platforms": [
5
5
  "web"
6
6
  ],
7
- "api": "^0.8.0"
7
+ "api": "^0.8.1"
8
8
  }
@@ -1,10 +1,10 @@
1
1
  {
2
- "apiVersion": "0.8.0",
2
+ "apiVersion": "0.8.1",
3
3
  "file": "client.js",
4
4
  "platforms": [
5
5
  "web"
6
6
  ],
7
- "api": "^0.8.0",
7
+ "api": "^0.8.1",
8
8
  "inject": [
9
9
  "transcript"
10
10
  ]
@@ -1,8 +1,8 @@
1
1
  {
2
- "apiVersion": "0.8.0",
2
+ "apiVersion": "0.8.1",
3
3
  "file": "client.js",
4
4
  "platforms": [
5
5
  "web"
6
6
  ],
7
- "api": "^0.8.0"
7
+ "api": "^0.8.1"
8
8
  }
@@ -69,6 +69,16 @@ function teammateReportLabel(text) {
69
69
  const verb = report.state === "已失败" ? "失败了" : report.state === "已停止" ? "停了下来" : "汇报了运行结果";
70
70
  return `${who} ${verb}`;
71
71
  }
72
+ function internalLabel(text) {
73
+ if (text.startsWith(TEAMMATE_REPORT_OPEN)) return teammateReportLabel(text);
74
+ const job = /^后台作业\s+(\S+?)\s*((|\(|启动失败|成功|失败)/.exec(text);
75
+ if (job !== null) {
76
+ const id = job[1] ?? "";
77
+ const failed = text.includes("失败");
78
+ return failed ? `后台作业 ${id} 失败了` : `后台作业 ${id} 完成了`;
79
+ }
80
+ return "运行时通知";
81
+ }
72
82
  function liveActivity(entries, turnState) {
73
83
  if (turnState === "idle") return null;
74
84
  if (turnState === "awaiting-approval") {
@@ -1114,7 +1124,7 @@ function TraceJumpButton(props) {
1114
1124
  }
1115
1125
  const FOLD_PREFS = { policy: processFoldPolicy("standard"), reasoningOpen: false, toolOpen: false };
1116
1126
  const FoldPrefsContext = react.createContext(FOLD_PREFS);
1117
- const NO_ACTIONS = { editRefork: () => void 0, busy: false };
1127
+ const NO_ACTIONS = { editAndResend: () => void 0, busy: false };
1118
1128
  const FlowActionsContext = react.createContext(NO_ACTIONS);
1119
1129
  const ShellCwdContext = react.createContext("");
1120
1130
  const ShellSessionContext = react.createContext(null);
@@ -1582,99 +1592,147 @@ function FileAttachmentCard({ file }) {
1582
1592
  }
1583
1593
  function UserRow({ entry }) {
1584
1594
  const actions = react.useContext(FlowActionsContext);
1595
+ const cwd = react.useContext(ShellCwdContext);
1585
1596
  const [draft, setDraft] = react.useState(null);
1597
+ const [zoom, setZoom] = react.useState(null);
1598
+ const findings = uiPrimitives.parseReviewFindings(entry.text);
1599
+ if (findings !== null) {
1600
+ return /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.ReviewFindingsCard, { doc: findings, cwd, onOpenLocation: (path) => ui$1.setDockPreview({ path }) });
1601
+ }
1586
1602
  if (entry.internal === true) {
1587
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "entry-system", "data-internal": "1", title: entry.text, children: teammateReportLabel(entry.text) });
1603
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "entry-system", "data-internal": "1", title: entry.text, children: internalLabel(entry.text) });
1588
1604
  }
1589
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "user-turn", children: [
1590
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `entry-user${draft === null ? "" : " editing"}`, children: [
1591
- entry.images === void 0 || entry.images.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "entry-user-images", children: entry.images.map((url, index) => /* @__PURE__ */ jsxRuntime.jsx("a", { href: url, target: "_blank", rel: "noreferrer", "data-tip": "点开看原图", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: `第 ${String(index + 1)} 张贴图` }) }, index)) }),
1592
- /* @__PURE__ */ jsxRuntime.jsx(UserFileCards, { files: entry.files }),
1593
- draft === null ? entry.text : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "user-edit", children: [
1594
- /* @__PURE__ */ jsxRuntime.jsx(
1595
- "textarea",
1605
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1606
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "user-turn", children: [
1607
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `entry-user${draft === null ? "" : " editing"}`, children: [
1608
+ entry.images === void 0 || entry.images.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "entry-user-images", children: entry.images.map((url, index) => /* @__PURE__ */ jsxRuntime.jsx(
1609
+ "button",
1596
1610
  {
1597
- className: "user-edit-box",
1598
- value: draft,
1599
- autoFocus: true,
1600
- rows: Math.min(10, Math.max(2, draft.split("\n").length)),
1601
- "aria-label": "编辑这条消息",
1602
- onChange: (event) => {
1603
- setDraft(event.target.value);
1611
+ type: "button",
1612
+ className: "entry-shot",
1613
+ "data-tip": "点开看原图",
1614
+ "aria-label": `放大第 ${String(index + 1)} 张贴图`,
1615
+ onClick: () => {
1616
+ setZoom(url);
1604
1617
  },
1605
- onKeyDown: (event) => {
1606
- if (event.key === "Escape") {
1607
- event.preventDefault();
1608
- setDraft(null);
1609
- return;
1610
- }
1611
- if (event.key !== "Enter" || event.shiftKey || event.nativeEvent.isComposing) return;
1612
- event.preventDefault();
1613
- const text = draft.trim();
1614
- if (text === "") return;
1615
- setDraft(null);
1616
- actions.editRefork(entry, text);
1617
- }
1618
- }
1619
- ),
1620
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "user-edit-note", children: "Enter 重发(分叉出新会话,原会话保留) · Shift+Enter 换行 · Esc 取消" }),
1621
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "user-edit-actions", children: [
1618
+ children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: `第 ${String(index + 1)} 张贴图` })
1619
+ },
1620
+ index
1621
+ )) }),
1622
+ /* @__PURE__ */ jsxRuntime.jsx(UserFileCards, { files: entry.files }),
1623
+ draft === null ? entry.text : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "user-edit", children: [
1622
1624
  /* @__PURE__ */ jsxRuntime.jsx(
1623
- "button",
1625
+ "textarea",
1624
1626
  {
1625
- type: "button",
1626
- className: "dsc-btn",
1627
- "data-variant": "ghost",
1628
- "data-size": "xs",
1629
- onClick: () => {
1630
- setDraft(null);
1627
+ className: "user-edit-box",
1628
+ value: draft,
1629
+ autoFocus: true,
1630
+ rows: Math.min(10, Math.max(2, draft.split("\n").length)),
1631
+ "aria-label": "编辑这条消息",
1632
+ onChange: (event) => {
1633
+ setDraft(event.target.value);
1631
1634
  },
1632
- children: "取消"
1633
- }
1634
- ),
1635
- /* @__PURE__ */ jsxRuntime.jsx(
1636
- "button",
1637
- {
1638
- type: "button",
1639
- className: "dsc-btn",
1640
- "data-variant": "primary",
1641
- "data-size": "xs",
1642
- disabled: draft.trim() === "",
1643
- onClick: () => {
1635
+ onKeyDown: (event) => {
1636
+ if (event.key === "Escape") {
1637
+ event.preventDefault();
1638
+ setDraft(null);
1639
+ return;
1640
+ }
1641
+ if (event.key !== "Enter" || event.shiftKey || event.nativeEvent.isComposing) return;
1642
+ event.preventDefault();
1644
1643
  const text = draft.trim();
1645
1644
  if (text === "") return;
1646
1645
  setDraft(null);
1647
- actions.editRefork(entry, text);
1648
- },
1649
- children: "重发"
1646
+ actions.editAndResend(entry, text);
1647
+ }
1650
1648
  }
1651
- )
1649
+ ),
1650
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "user-edit-note", children: "Enter 重发(这条之后的回答会作废,在当前会话里重来) · Shift+Enter 换行 · Esc 取消" }),
1651
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "user-edit-actions", children: [
1652
+ /* @__PURE__ */ jsxRuntime.jsx(
1653
+ "button",
1654
+ {
1655
+ type: "button",
1656
+ className: "dsc-btn",
1657
+ "data-variant": "ghost",
1658
+ "data-size": "xs",
1659
+ onClick: () => {
1660
+ setDraft(null);
1661
+ },
1662
+ children: "取消"
1663
+ }
1664
+ ),
1665
+ /* @__PURE__ */ jsxRuntime.jsx(
1666
+ "button",
1667
+ {
1668
+ type: "button",
1669
+ className: "dsc-btn",
1670
+ "data-variant": "primary",
1671
+ "data-size": "xs",
1672
+ disabled: draft.trim() === "",
1673
+ onClick: () => {
1674
+ const text = draft.trim();
1675
+ if (text === "") return;
1676
+ setDraft(null);
1677
+ actions.editAndResend(entry, text);
1678
+ },
1679
+ children: "重发"
1680
+ }
1681
+ )
1682
+ ] })
1652
1683
  ] })
1653
- ] })
1684
+ ] }),
1685
+ draft === null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "user-actions", children: /* @__PURE__ */ jsxRuntime.jsx(
1686
+ "button",
1687
+ {
1688
+ type: "button",
1689
+ className: "user-act",
1690
+ title: actions.busy ? "这一轮还在跑,先等它结束或打断再编辑" : "编辑这条消息并重发(这条之后的回答会作废,在当前会话里重来)",
1691
+ "aria-label": "编辑并重发这条消息",
1692
+ disabled: actions.busy,
1693
+ onClick: () => {
1694
+ setDraft(entry.text);
1695
+ },
1696
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconEdit, { size: 15 })
1697
+ }
1698
+ ) }) : null
1654
1699
  ] }),
1655
- draft === null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "user-actions", children: /* @__PURE__ */ jsxRuntime.jsx(
1656
- "button",
1657
- {
1658
- type: "button",
1659
- className: "user-act",
1660
- title: actions.busy ? "这一轮还在跑,先等它结束或打断再编辑" : "编辑这条消息并重发(会分叉出新会话,原会话保留)",
1661
- "aria-label": "编辑并重发这条消息",
1662
- disabled: actions.busy,
1663
- onClick: () => {
1664
- setDraft(entry.text);
1665
- },
1666
- children: /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconEdit, { size: 15 })
1667
- }
1668
- ) }) : null
1700
+ zoom === null ? null : /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.ImageLightbox, { src: zoom, alt: "放大的贴图", onClose: () => {
1701
+ setZoom(null);
1702
+ } })
1669
1703
  ] });
1670
1704
  }
1671
1705
  function ReadonlyUserRow({ entry }) {
1706
+ const cwd = react.useContext(ShellCwdContext);
1707
+ const [zoom, setZoom] = react.useState(null);
1708
+ const findings = uiPrimitives.parseReviewFindings(entry.text);
1709
+ if (findings !== null) {
1710
+ return /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.ReviewFindingsCard, { doc: findings, cwd, onOpenLocation: (path) => ui$1.setDockPreview({ path }) });
1711
+ }
1672
1712
  if (entry.internal === true) return /* @__PURE__ */ jsxRuntime.jsx(UserRow, { entry });
1673
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "user-turn", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "entry-user", children: [
1674
- entry.images === void 0 || entry.images.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "entry-user-images", children: entry.images.map((url, index) => /* @__PURE__ */ jsxRuntime.jsx("a", { href: url, target: "_blank", rel: "noreferrer", "data-tip": "点开看原图", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: `第 ${String(index + 1)} 张贴图` }) }, index)) }),
1675
- /* @__PURE__ */ jsxRuntime.jsx(UserFileCards, { files: entry.files }),
1676
- entry.text
1677
- ] }) });
1713
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1714
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "user-turn", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "entry-user", children: [
1715
+ entry.images === void 0 || entry.images.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "entry-user-images", children: entry.images.map((url, index) => /* @__PURE__ */ jsxRuntime.jsx(
1716
+ "button",
1717
+ {
1718
+ type: "button",
1719
+ className: "entry-shot",
1720
+ "data-tip": "点开看原图",
1721
+ "aria-label": `放大第 ${String(index + 1)} 张贴图`,
1722
+ onClick: () => {
1723
+ setZoom(url);
1724
+ },
1725
+ children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: `第 ${String(index + 1)} 张贴图` })
1726
+ },
1727
+ index
1728
+ )) }),
1729
+ /* @__PURE__ */ jsxRuntime.jsx(UserFileCards, { files: entry.files }),
1730
+ entry.text
1731
+ ] }) }),
1732
+ zoom === null ? null : /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.ImageLightbox, { src: zoom, alt: "放大的贴图", onClose: () => {
1733
+ setZoom(null);
1734
+ } })
1735
+ ] });
1678
1736
  }
1679
1737
  const BAR_MIN_CONTENT_H = 400;
1680
1738
  function expandedContentHeight(body) {
@@ -2222,8 +2280,8 @@ function RoundFoot(props) {
2222
2280
  const measured = props.running ? null : props.usage;
2223
2281
  const real = measured !== null && measured.inputTokens + measured.outputTokens > 0 ? measured.inputTokens + measured.outputTokens : null;
2224
2282
  const estimated = real !== null || props.running || props.tokens === null || props.tokens <= 0 ? null : props.tokens;
2225
- const copy = props.copyText !== void 0 && props.copyText !== "";
2226
- const fork = props.onFork !== void 0;
2283
+ const copy = !props.running && props.copyText !== void 0 && props.copyText !== "";
2284
+ const fork = !props.running && props.onFork !== void 0;
2227
2285
  if (clock === null && !copy && !fork && real === null && estimated === null) return null;
2228
2286
  return (
2229
2287
  // 与 `.changes-card` 同理:不再包 `.entry-row`,让 `.turn-seat > .round-foot` 的
@@ -2256,7 +2314,6 @@ function RoundFoot(props) {
2256
2314
  className: "user-act",
2257
2315
  title: "以这条消息为界分叉出新会话",
2258
2316
  "aria-label": "以这条消息为界分叉出新会话",
2259
- disabled: props.running,
2260
2317
  onClick: props.onFork,
2261
2318
  children: /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconBranch, { size: 15 })
2262
2319
  }
@@ -2428,7 +2485,7 @@ function SeatBody({
2428
2485
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "turn-process", "data-fold": collapsed ? "closed" : "open", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "turn-process-body", children: processBlocks }) })
2429
2486
  ),
2430
2487
  afterBlocks,
2431
- /* @__PURE__ */ jsxRuntime.jsx(ChangesCard, { rows: seat.rows, cwd }),
2488
+ running ? null : /* @__PURE__ */ jsxRuntime.jsx(ChangesCard, { rows: seat.rows, cwd }),
2432
2489
  /* @__PURE__ */ jsxRuntime.jsx(
2433
2490
  RoundFoot,
2434
2491
  {
@@ -2783,30 +2840,33 @@ function TranscriptFlow({
2783
2840
  }
2784
2841
  })();
2785
2842
  };
2786
- const editRefork = (entry, text) => {
2843
+ const editAndResend = (entry, text) => {
2787
2844
  const all = [...entries, ...live];
2788
2845
  const at = all.findIndex((item) => item.id === entry.id);
2789
- const index = rounds.filter((round) => round.startIndex < at).length;
2846
+ if (at < 0) {
2847
+ ui$1.toastErr("这条消息已经不在会话里了,刷新后再试");
2848
+ return;
2849
+ }
2850
+ const keep = all.slice(0, at).filter((item) => item.kind === "user" && item.internal !== true).length;
2851
+ if (sessionPath === null) {
2852
+ ui$1.toastErr("这条会话还没落盘,先发一条消息再编辑");
2853
+ return;
2854
+ }
2790
2855
  void (async () => {
2791
2856
  try {
2792
- if (sessionPath === null || index === 0) {
2793
- await channel.invoke("openSession", []);
2794
- } else {
2795
- const result = await channel.invoke("forkSession", [sessionPath, index]);
2796
- if (result.ok !== true) {
2797
- ui$1.toastErr(result.error ?? "分叉失败");
2798
- return;
2799
- }
2800
- await channel.invoke("openSession", result.path === void 0 ? [] : [result.path]);
2857
+ const result = await channel.invoke("rewindSession", [sessionPath, keep, text]);
2858
+ if (result?.ok !== true) {
2859
+ ui$1.toastErr(result?.error ?? "编辑失败");
2860
+ return;
2801
2861
  }
2802
- await channel.invoke("refreshSessions", []);
2803
2862
  await channel.invoke("submit", [text]);
2863
+ await channel.invoke("refreshSessions", []);
2804
2864
  } catch (reason) {
2805
2865
  ui$1.toastErr(`重发失败:${reason instanceof Error ? reason.message : String(reason)}`);
2806
2866
  }
2807
2867
  })();
2808
2868
  };
2809
- const actions = { editRefork, busy: turnState !== "idle" };
2869
+ const actions = { editAndResend, busy: turnState !== "idle" };
2810
2870
  const activity = react.useMemo(() => liveActivity([...entries, ...live], turnState), [entries, live, turnState]);
2811
2871
  const railRounds = react.useMemo(
2812
2872
  () => seats.rounds.map((seat) => {
@@ -2815,9 +2875,9 @@ function TranscriptFlow({
2815
2875
  return {
2816
2876
  round: seat.round,
2817
2877
  // 题面预览只在来源是**人**时才填(对照 dsh 的 turnOutline:非 user 来源不留题面)。
2818
- // internal 汇报(队友干完活)有刻度但不给原文,改给一句人话——绝不把
2819
- // `<teammate-report …>` 当题面塞进悬停卡。
2820
- prompt: user?.kind !== "user" ? "" : user.internal === true ? teammateReportLabel(user.text) : previewText(user.text, "prompt"),
2878
+ // internal 消息(队友汇报、后台作业通知……)有刻度但不给原文,改给一句人话——
2879
+ // 绝不把 `<teammate-report …>` 或作业通知原文当题面塞进悬停卡。
2880
+ prompt: user?.kind !== "user" ? "" : user.internal === true ? internalLabel(user.text) : previewText(user.text, "prompt"),
2821
2881
  response: answer === void 0 ? "" : previewText(answer.text, "response")
2822
2882
  };
2823
2883
  }),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsc/ui",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": true,
5
5
  "description": "@dsc/ui 的界面 SDK 类型声明(随 dsc 界面壳发布)。",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsc/ui-core",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": true,
5
5
  "description": "插件版界面的共用核心(槽位 + 清单 + 原生桥规格):宿主与界面壳同一份源码,故意不下发给插件。",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsc/ui-dockkit",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": true,
5
5
  "description": "界面壳右侧栏的工具包(分栏模型 + 会话级状态 + React 画法):只依赖基元库,不许反向。",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsc/ui-layout",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": true,
5
5
  "description": "界面壳的应用骨架与运行时(App / 审查栏 / 正文与页的真源 / 宿主通道 React 面 / 外观落地):三包里最上层。",
6
6
  "type": "module",
@@ -81,8 +81,19 @@ export declare function IconMore(props: IconProps): JSX.Element;
81
81
  export declare function IconSort(props: IconProps): JSX.Element;
82
82
  /** 归档(箱子)。 */
83
83
  export declare function IconArchive(props: IconProps): JSX.Element;
84
- /** 置顶(图钉)。 */
85
- export declare function IconPin(props: IconProps): JSX.Element;
84
+ /**
85
+ * 置顶(图钉):竖向推钉——顶帽一横、梯形钉身、一根针。
86
+ *
87
+ * 为什么改成竖的(2026-11-03 用户报障「置顶图标太丑」):原来那版是 45° 斜拼的
88
+ * 三段线,缩到 13px 糊成一个小哑铃,谁看都认不出是图钉。竖向对称的形状在同样
89
+ * 尺寸下轮廓清楚,一眼能认。
90
+ *
91
+ * @param filled - 钉身填实。已置顶的那枚用它:和「悬浮才露出的灰描边」拉开区别,
92
+ * 不用再靠颜色深浅去猜有没有钉住。
93
+ */
94
+ export declare function IconPin({ filled, ...props }: IconProps & {
95
+ filled?: boolean;
96
+ }): JSX.Element;
86
97
  /** 终端(方框 + 提示符)。 */
87
98
  export declare function IconTerminal(props: IconProps): JSX.Element;
88
99
  /** 代码(尖括号对,VS Code 打开目录菜单用)。 */
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 贴图放大浮层:输入框上方那排待发贴图,点一下开大图,点遮罩或按 Esc 关。
3
+ *
4
+ * 为什么需要自己画这一层:待发贴图是用户当场贴/拖进来的本地文件,界面手上只有
5
+ * dataURL(`data:image/png;base64,…`)。浏览器禁止页面顶层导航到 `data:` 地址,所以
6
+ * 「外面套一个 `<a target="_blank">` 点开」这条路走不通;dataURL 也没有文件路径,
7
+ * 交给系统图片查看器同样没门。旧界面本来就有这个浮层,移植到壳的时候只把样式留下了
8
+ * (`.img-lightbox`,见 `ui-shell/src/legacy/views.css`),组件本身没搬过来——所以缩略图
9
+ * 就只剩缩略图。这里把组件补回来,视觉仍用那一份现成样式,不新造一套。
10
+ *
11
+ * 已发消息里的贴图不走这里:那些是宿主的同源地址(`/api/attachments/<sha>`),
12
+ * 普通链接就能开。
13
+ *
14
+ * @module dsc-ui-shell/ui-primitives/image-lightbox
15
+ */
16
+ import { type ReactNode } from 'react';
17
+ export declare function ImageLightbox(props: {
18
+ src: string;
19
+ alt: string;
20
+ onClose(): void;
21
+ }): ReactNode;
@@ -50,6 +50,7 @@ export * from './file-type-icon';
50
50
  export * from './file-icons';
51
51
  export * from './highlight';
52
52
  export * from './hover-delay';
53
+ export * from './image-lightbox';
53
54
  export * from './lang-table';
54
55
  export * from './markdown';
55
56
  export * from './native';
@@ -58,6 +59,8 @@ export * from './paths';
58
59
  export * from './pdf-view';
59
60
  export * from './review-notice';
60
61
  export * from './review-notice-card';
62
+ export * from './review-findings';
63
+ export * from './review-findings-card';
61
64
  export * from './select';
62
65
  export * from './table-view';
63
66
  export * from './thread-resizer';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsc/ui-primitives",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": true,
5
5
  "description": "界面壳的基元库(图标 + 载体基元 + 平台视图 + 面板几何/格式化口径):壳里最下层,E6 起作为平台种子下发给插件。",
6
6
  "type": "module",
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `/review` findings 卡(T45):审查队友交回的那段 `<review-findings>` 汇报在对话流里的
3
+ * 展示形态——卡头(队友名 + 收工状态)+ 引言 + 按条渲染(优先级徽标、标题、可点的位置、
4
+ * 说明、建议)。位置点开走右侧预览页签并定位到行。
5
+ *
6
+ * 解析在 `./review-findings`(零依赖纯模块,探针直测);本组件只管画。
7
+ * 样式全用 `ui-shell/src/legacy/views.css` 里已有的 `.review-findings*` / `.review-finding*`
8
+ * 那一套(含 `data-priority='P0'…'P3'` 四档徽标),这里不新造样式。
9
+ *
10
+ * @module dsc-ui-shell/ui-primitives/review-findings-card
11
+ */
12
+ import type { ReactNode } from 'react';
13
+ import type { ReviewFindingsView } from './review-findings';
14
+ /**
15
+ * 审查结论卡。
16
+ *
17
+ * @param props.doc - `parseReviewFindings` 的解析结果
18
+ * @param props.cwd - 会话工作目录(位置是仓库相对路径,点开预览要拼成绝对路径)
19
+ * @param props.onOpenLocation - 点位置时打开预览;不给就只显示文本(不引入新的打开方式)
20
+ */
21
+ export declare function ReviewFindingsCard({ doc, cwd, onOpenLocation }: {
22
+ doc: ReviewFindingsView;
23
+ cwd?: string;
24
+ onOpenLocation?: (path: string, line?: number) => void;
25
+ }): ReactNode;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * `/review` findings 的纯解析:审查队友交回的汇报被 `<review-findings …>` 包裹写进会话,
3
+ * 这里把它切成「卡头(队友名 / 状态)+ 按条 findings + 引言」,让对话流画成卡片而不是
4
+ * 把整段标记文本当用户消息摆出来。
5
+ *
6
+ * 条目格式是 reviewer 角色提示词里约定死的(`src/core/agent-roles.ts` 的 BUILTIN_FILES.reviewer,
7
+ * 任务书 `reviewTaskText` 里也再写了一遍):
8
+ *
9
+ * ```
10
+ * ### [P1] 一句话标题
11
+ * 位置:相对路径:行号
12
+ * 说明:……(可多行)
13
+ * 建议:……(可多行,可缺)
14
+ * ```
15
+ *
16
+ * 解析刻意宽松:字段标签认全半角冒号、剥 markdown 加粗与反引号;**解析不动的行原样留进
17
+ * 该条的说明**——宁可把原文多留一行,也不丢内容。整体没被包裹就返回 null(普通消息照旧渲染)。
18
+ *
19
+ * 零 React、零 DOM:探针按 Node 的类型擦除直接 import 本文件逐条钉,所以这里只许
20
+ * `import type`,不许任何运行期依赖。
21
+ *
22
+ * @module dsc-ui-shell/ui-primitives/review-findings
23
+ */
24
+ /** 一条 finding 的位置:仓库相对路径 + 可缺省的行号。 */
25
+ export interface ReviewFindingLocation {
26
+ path: string;
27
+ /** 真实行号;写不出数字(`src/a.ts` 或 `src/a.ts:见下`)时缺省。 */
28
+ line?: number;
29
+ }
30
+ /**
31
+ * 优先级档位:0 = P0(必须修)… 3 = P3(可更好)。
32
+ * 用数字而不是 `'P1'` 字符串:比较与排序直接按大小来,`data-priority` 再拼回 `P0`。
33
+ */
34
+ export type ReviewFindingPriority = 0 | 1 | 2 | 3;
35
+ /** 一条 finding:优先级 + 标题 + 位置 + 说明 + 可缺省的建议。 */
36
+ export interface ReviewFinding {
37
+ /** 认不出档位时缺省(`[P7]` 这种写错的不假装它是一档)。 */
38
+ priority?: ReviewFindingPriority;
39
+ title: string;
40
+ location?: ReviewFindingLocation;
41
+ /** 「说明」段(含解析不动、被兜进来的原文)。 */
42
+ detail: string;
43
+ /** 「建议」段;队友没写就没有。 */
44
+ suggestion?: string;
45
+ }
46
+ /** 一份解析完的审查汇报。 */
47
+ export interface ReviewFindingsView {
48
+ /** 交结论的队友名(`<review-findings teammate="…">`);没写就是空串。 */
49
+ teammate: string;
50
+ /** 收工状态(已完成 / 已停止 / 已失败);老消息没有这属性。 */
51
+ state?: string;
52
+ /** 按文档顺序的条目;队友没发现问题时是空的。 */
53
+ findings: ReviewFinding[];
54
+ /** 第一条之前的自由文字(「未发现问题,查了这些文件…」这类整体说明)。 */
55
+ note: string;
56
+ }
57
+ /**
58
+ * 把一条会话消息解析成 {@link ReviewFindingsView};不是 findings 文档(没被包裹)返回 null。
59
+ *
60
+ * 两段式:先扫出所有条目头的位置(这样每条的内容边界一眼可见),再逐条按字段收内容。
61
+ * 「解析不动的行」按当前打开的字段归位(在建议里就续建议,否则续说明)——审查队友的
62
+ * 说明经常换行写,把它整段塞进兜底会让「说明」和「补一句」拆成两截。
63
+ */
64
+ export declare function parseReviewFindings(text: string): ReviewFindingsView | null;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsc/ui-renderer",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": true,
5
5
  "description": "界面壳的渲染器/装载器包(启动图取回 + 分批装载 + 平台种子表 + 热更 + 页面入口):E4 起独立成包。",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsc/ui-slots",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": true,
5
5
  "description": "界面壳的槽位包(槽名契约 + React 渲染出口):E4 起独立成包,E6 起作为平台种子下发给插件。",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waq666/pneuma",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Pneuma(numa)— 独立的终端 AI harness(自研 ReAct loop + ink TUI)",
5
5
  "type": "module",
6
6
  "license": "MIT",