@evandu/super-pi 0.1.168 → 0.1.169

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 (29) hide show
  1. package/dist/client/.super-pi-client-sources.json +4 -4
  2. package/dist/client/assets/{CodeMirrorEditor-DWEFdLq1.js → CodeMirrorEditor-DArgTlD3.js} +2 -2
  3. package/dist/client/assets/{dist-H7kWZ7Cr.js → dist-B-z8liQC.js} +1 -1
  4. package/dist/client/assets/{dist-3mX68Ead.js → dist-BFaPEuXW.js} +1 -1
  5. package/dist/client/assets/{dist-D9UIUBjg.js → dist-BrRu0IXM.js} +1 -1
  6. package/dist/client/assets/{dist-i063EgJc.js → dist-C898Y-mu.js} +1 -1
  7. package/dist/client/assets/{dist-ELtcJv97.js → dist-CUbflO-e.js} +1 -1
  8. package/dist/client/assets/{dist-BygS3RZC.js → dist-ChtaZGr2.js} +1 -1
  9. package/dist/client/assets/{dist-BiVenLEE.js → dist-CvSvjAn3.js} +1 -1
  10. package/dist/client/assets/{dist-XSVtuaKi.js → dist-D3E66dY7.js} +1 -1
  11. package/dist/client/assets/{dist-Co6-VsRy.js → dist-DKB8S6yA.js} +1 -1
  12. package/dist/client/assets/{dist-B19er0Hr.js → dist-DN-9z_cD.js} +1 -1
  13. package/dist/client/assets/{dist-BsaizV0U.js → dist-DN_OOAtP.js} +1 -1
  14. package/dist/client/assets/{dist-Bh9F9CwL.js → dist-DUQ9n5h9.js} +1 -1
  15. package/dist/client/assets/{dist-BWN1gFkd.js → dist-D_aMYdFI.js} +1 -1
  16. package/dist/client/assets/{dist-ei0l0QpD.js → dist-DhpsFeLh.js} +1 -1
  17. package/dist/client/assets/{dist-CPZVRFqI.js → dist-DvtXvGUC.js} +1 -1
  18. package/dist/client/assets/{dist-Bp858rkg.js → dist-DyVwIwcR.js} +1 -1
  19. package/dist/client/assets/{dist-DR3gLDod.js → dist-EyFCbD4n.js} +1 -1
  20. package/dist/client/assets/{dist-D5SNpvpB.js → dist-HsjzJlZ8.js} +1 -1
  21. package/dist/client/assets/{dist-84wmy0xb.js → dist-J2qLs06H.js} +1 -1
  22. package/dist/client/assets/{dist-0cjcfZm8.js → dist-NDu6lgDA.js} +1 -1
  23. package/dist/client/assets/{dist-DTYN3KZG.js → dist-maPYW6Rs.js} +1 -1
  24. package/dist/client/assets/{dist-CXIdy9EI.js → dist-t2Ar76ug.js} +1 -1
  25. package/dist/client/assets/{index-C3ETe3EL.css → index-bxZsZR4M.css} +1 -1
  26. package/dist/client/assets/{index-C4d7l2t8.js → index-mr3cD5bb.js} +10 -10
  27. package/dist/client/index.html +2 -2
  28. package/dist/server/application/project-service.js +44 -1
  29. package/package.json +3 -1
@@ -8,8 +8,8 @@
8
8
  <link rel="alternate icon" href="/favicon.ico" />
9
9
  <link rel="apple-touch-icon" href="/favicon.svg" />
10
10
  <title>Super Pi</title>
11
- <script type="module" crossorigin src="/assets/index-C4d7l2t8.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-C3ETe3EL.css">
11
+ <script type="module" crossorigin src="/assets/index-mr3cD5bb.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-bxZsZR4M.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -184,6 +184,33 @@ const cell = (value) => oneLine(value).replace(/\|/g, "\\|");
184
184
  const truncate = (value, limit) => value.length > limit ? `${value.slice(0, limit)}…(已截断)` : value;
185
185
  /** A timestamp a person can read at a glance, and a missing one that says so. */
186
186
  const moment = (value) => value ? value.replace("T", " ").replace(/\.\d+Z$/, "") : "无";
187
+ /**
188
+ * THE FIRST SENTENCE OF A PROSE.
189
+ *
190
+ * The sentence boundary is where a Chinese reader's eye stops, so the first sentence is the part
191
+ * that can stand alone in a table cell. A case with no sentence mark at all is returned whole -
192
+ * there is nothing to cut it at, and cutting it anywhere else would be guessing.
193
+ */
194
+ const firstSentence = (value) => {
195
+ const text = oneLine(value).trim();
196
+ const index = text.search(/[。!?!?]/);
197
+ if (index < 0)
198
+ return text;
199
+ return text.slice(0, index + 1).trim();
200
+ };
201
+ /**
202
+ * THE QUESTION AN EXCEPTION ASKS, in one line.
203
+ *
204
+ * The reader decides on the question, and the case for it is a paragraph - so the table carries
205
+ * the question and the paragraph goes below the table. An exception raised before the title
206
+ * existed falls back to the first sentence of its case, which is the closest thing it has.
207
+ */
208
+ const exceptionTitle = (exception) => {
209
+ const title = exception.title?.trim();
210
+ if (title)
211
+ return oneLine(title);
212
+ return firstSentence(exception.reason ?? "") || "(未命名)";
213
+ };
187
214
  /**
188
215
  * THE TWO SHAPES A PROJECT CAN HAVE.
189
216
  *
@@ -792,9 +819,25 @@ export class ProjectService {
792
819
  if (!p.escalations.length)
793
820
  lines.push("无");
794
821
  else {
822
+ /* THE TABLE IS FOR COMPARING, so the cell is a TITLE - the question the reader decides on -
823
+ and the case goes under the table. A whole paragraph in one cell makes the table
824
+ unreadable, and a table that cannot be scanned is not a table any more. */
795
825
  lines.push("| 例外 | 严重程度 | 状态 | 决定 | 解决时间 |", "| --- | --- | --- | --- | --- |");
796
826
  for (const e of p.escalations) {
797
- lines.push(`| ${cell(e.reason)} | ${SEVERITY_TEXT[e.severity] ?? e.severity} | ${ESCALATION_STATUS_TEXT[e.status] ?? e.status} | ${cell(e.decision ?? "无")} | ${e.resolvedAt ? moment(e.resolvedAt) : "无"} |`);
827
+ lines.push(`| ${cell(exceptionTitle(e))} | ${SEVERITY_TEXT[e.severity] ?? e.severity} | ${ESCALATION_STATUS_TEXT[e.status] ?? e.status} | ${cell(e.decision ?? "无")} | ${e.resolvedAt ? moment(e.resolvedAt) : "无"} |`);
828
+ }
829
+ /* AND THE CASE IS NOT LOST. The title is what the reader compares; the reason is WHY, and it
830
+ is a paragraph - so it is printed in full below the table, where a paragraph belongs. */
831
+ const cases = p.escalations.filter((e) => (e.reason ?? "").trim());
832
+ if (cases.length) {
833
+ lines.push("", "例外详情:", "");
834
+ for (const e of cases) {
835
+ /* AN EXCEPTION WITH A TITLE is named by it; one without has only its case, and the case
836
+ is already the whole line - repeating its first sentence in front of it would say the
837
+ same thing twice. */
838
+ const title = e.title?.trim();
839
+ lines.push(title ? `- ${oneLine(title)}:${oneLine(e.reason)}` : `- ${oneLine(e.reason)}`);
840
+ }
798
841
  }
799
842
  }
800
843
  lines.push("", "## 时间线", "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.168",
3
+ "version": "0.1.169",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -87,6 +87,7 @@
87
87
  "scripts/session-result-callback-e2e.test.mjs",
88
88
  "scripts/session-orchestrator-tools.test.mjs",
89
89
  "scripts/project-service.test.mjs",
90
+ "scripts/project-report-exception-title.test.mjs",
90
91
  "scripts/project-api-scope.test.mjs",
91
92
  "scripts/project-report-chain.test.mjs",
92
93
  "scripts/session-tree-collapse.test.mjs",
@@ -272,6 +273,7 @@
272
273
  "scripts/project-evidence-panel-browser.test.mjs",
273
274
  "scripts/project-panel-fixes-browser.test.mjs",
274
275
  "scripts/boss-approval-readability-browser.test.mjs",
276
+ "scripts/prose-tidying-browser.test.mjs",
275
277
  "scripts/builtin-agents-project-browser.test.mjs",
276
278
  "scripts/tool-runtime-browser.test.mjs",
277
279
  "scripts/session-context-menu-browser.test.mjs",