@xmoon76/dsh-pi-tui 0.5.7 → 0.5.9

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 (78) hide show
  1. package/README.en.md +64 -26
  2. package/README.md +64 -26
  3. package/cordis.patch.yml +13 -0
  4. package/dist/acp-stdio.mjs +151 -0
  5. package/dist/{bootstrap-C9nl6e13.mjs → bootstrap-CVyHGQDX.mjs} +22330 -6888
  6. package/dist/browser-CDUSHIIr.mjs +76 -0
  7. package/dist/builtins.mjs +2 -2
  8. package/dist/{client-bootstrap-CGezi85O.mjs → client-bootstrap-4UoeVIHE.mjs} +2407 -1830
  9. package/dist/client-runtime-BHBlVUf5.mjs +1376 -0
  10. package/dist/{daemon-launcher-H_1r5Cqs.mjs → daemon-launcher-DxIgjBHW.mjs} +1551 -57
  11. package/dist/daemon-launcher.d.mts +85 -14
  12. package/dist/daemon-launcher.mjs +2 -2
  13. package/dist/diagnostics-Db5iVcuJ.mjs +123 -0
  14. package/dist/{entry-control-jBfKn1qO.mjs → entry-control-BDLZgg4m.mjs} +1 -1
  15. package/dist/{extensions-6a5vvJUT.mjs → extensions-Dx7ncPNA.mjs} +1 -4
  16. package/dist/extensions.mjs +1 -1
  17. package/dist/handoff-BjoEy3f8.mjs +106 -0
  18. package/dist/history-search-limits-Cx2UvRC2.mjs +16 -0
  19. package/dist/history-search-remote-BHuoellG.mjs +113 -0
  20. package/dist/history-search-remote-BzXdvrxk.mjs +26 -0
  21. package/dist/history-search-seat-BcHJTpeB.mjs +639 -0
  22. package/dist/history-search-seat-rZcq0XV6.mjs +639 -0
  23. package/dist/{host-bootstrap-MVxks641.mjs → host-bootstrap-BfnufpnW.mjs} +37 -72
  24. package/dist/{host-foundation-probe-DK7n5jDu.mjs → host-foundation-probe-DlD8-N_Q.mjs} +2 -2
  25. package/dist/host-runtime.mjs +5611 -290
  26. package/dist/index.d.mts +13 -6
  27. package/dist/index.mjs +22766 -6893
  28. package/dist/installed-dsh-BjUiJSwR.mjs +142 -0
  29. package/dist/interaction-port-D1Yv9zgu.mjs +45 -0
  30. package/dist/local-acp-control-CC5z4Xbq.mjs +304 -0
  31. package/dist/local-acp-endpoint-D1jYdJdv.mjs +41 -0
  32. package/dist/local-acp-listener-Cmgb5M0H.mjs +9493 -0
  33. package/dist/local-acp-status-B_25Q6kU.mjs +101 -0
  34. package/dist/local-client.mjs +719 -93
  35. package/dist/local-daemon-control-BFJAC8Kg.mjs +2199 -0
  36. package/dist/local-daemon-control-Bm3imctD.mjs +2101 -0
  37. package/dist/{local-discovery-BPZw1wEd.mjs → local-discovery-BMhaGIiJ.mjs} +254 -544
  38. package/dist/{local-discovery-BMoNXZjJ.mjs → local-discovery-Ba7_-NNC.mjs} +1 -1
  39. package/dist/{local-discovery-Bq3jLAn1.mjs → local-discovery-QSbFpjK2.mjs} +301 -544
  40. package/dist/local-host.mjs +970 -501
  41. package/dist/local-profile-daemon-admin-otpm69R6.mjs +469 -0
  42. package/dist/{local-scope-DEuGAy8l.mjs → local-scope-5DEKA_lW.mjs} +1075 -31
  43. package/dist/{local-transport-X4ZCe2uE.mjs → local-transport-DeWmdZ5E.mjs} +14 -3
  44. package/dist/{local-web-control-DKWtXIkr.mjs → local-web-control-Dny93N-r.mjs} +10 -7
  45. package/dist/{local-workspace-object-D06GL0UO.mjs → local-workspace-object-D0RVQt8U.mjs} +33 -9
  46. package/dist/model-selection-CYlqg2DV.mjs +83 -0
  47. package/dist/native-client-domains-Dg4srzYt.mjs +2 -0
  48. package/dist/native-client.d.mts +735 -0
  49. package/dist/native-client.mjs +3534 -0
  50. package/dist/{open-CmOBxSjN.mjs → open-QQva8-ar.mjs} +24 -20
  51. package/dist/{pi-tui-remote-contribution-Do8ECrUy.mjs → pi-tui-remote-contribution-565wiLWp.mjs} +741 -150
  52. package/dist/preferences.mjs +1 -1
  53. package/dist/{profile-preferences-migration-CThz4rHH.mjs → profile-preferences-migration-CNOWIdnr.mjs} +1 -1
  54. package/dist/{profile-preferences-migration-BfUGdPZx.mjs → profile-preferences-migration-IrnXcJWK.mjs} +10 -8
  55. package/dist/{prompt-sections-DXmjB58H.mjs → prompt-sections-Bi-9_Gr_.mjs} +28 -10
  56. package/dist/{prompt-sections-DUKmWb8g.mjs → prompt-sections-DFS1dqsY.mjs} +342 -56
  57. package/dist/{dist-BFgC-5tL.mjs → recall-scope-9Nuoto_i.mjs} +353 -1
  58. package/dist/rolldown-runtime-8H4AJuhK.mjs +14 -0
  59. package/dist/schema-CCLvDa7Q.mjs +177 -0
  60. package/dist/{schema-qE_P09zJ.mjs → schema-t97l3aK8.mjs} +56 -3
  61. package/dist/{session-DC0XQr5O.mjs → session-Cs8iLCEx.mjs} +784 -342
  62. package/dist/{session-Cihe8PPS.mjs → session-EBRZF6Ow.mjs} +783 -341
  63. package/dist/session-create-facts-CkfG5DpQ.mjs +20 -0
  64. package/dist/{startup-CarQxWwi.d.mts → startup-Dti3Udne.d.mts} +30 -3
  65. package/dist/{startup-CARqn3kV.mjs → startup-UtFQSDe_.mjs} +90 -15
  66. package/dist/startup.d.mts +2 -2
  67. package/dist/startup.mjs +1 -1
  68. package/dist/task-read-remote-DRtkXDrZ.mjs +1083 -0
  69. package/dist/{terminal-progress-source-D4DHyXDo.mjs → terminal-progress-source-VsczdXA-.mjs} +610 -335
  70. package/dist/{transcript-view-a7cROAaI.mjs → transcript-view-B6vCnukn.mjs} +2284 -1166
  71. package/dist/{transcript-view-hvNVkPtv.mjs → transcript-view-DSSdE2vK.mjs} +2191 -765
  72. package/dist/write-failure-xNKczXH7.mjs +189 -0
  73. package/package.json +25 -8
  74. package/dist/local-acp-listener-CNkguN5-.mjs +0 -2566
  75. package/dist/local-daemon-control-Bg9s2aYi.mjs +0 -1424
  76. package/dist/local-daemon-control-Cu_4FIdd.mjs +0 -1585
  77. package/dist/local-profile-daemon-admin-AXgVH-6y.mjs +0 -91
  78. package/dist/preset-BcWqOtY7.mjs +0 -46
@@ -0,0 +1,76 @@
1
+ /** Strip the `session-`/`session_` prefix and keep the first 8 characters, like
2
+ * the kimicode card's short id. */
3
+ function shortSessionId(id) {
4
+ return id.replace(/^session[-_]/i, "").slice(0, 8);
5
+ }
6
+ /** A canonical full Session id: the `session-`/`session_` prefix plus 32 hex
7
+ * characters, optionally written as a hyphenated canonical UUID. A BARE UUID
8
+ * is NOT a canonical Session id — it must match an official listed row. */
9
+ const CANONICAL_SESSION_ID = /^session[-_](?:[0-9a-f]{32}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i;
10
+ /** The CLI automatic-prefix rule: at least four ASCII hex digits after the
11
+ * optional `session-`/`session_` prefix. Deliberately stricter than the
12
+ * `/resume` matcher; the CLI must not auto-resume a word-like query. */
13
+ const CLI_PREFIX = /^[0-9a-f]{4,}$/i;
14
+ /** Whether `query` is a canonical full Session id that may be opened WITHOUT
15
+ * a roster read (the explicit full-id launch contract). */
16
+ function canonicalFullSessionId(query) {
17
+ return CANONICAL_SESSION_ID.test(query);
18
+ }
19
+ /** The legal automatic prefix `query` carries, or undefined. The returned
20
+ * value is the bare hex prefix (the leading Session prefix stripped). */
21
+ function cliAutoPrefix(query) {
22
+ const bare = query.replace(/^session[-_]/i, "");
23
+ return CLI_PREFIX.test(bare) ? bare : void 0;
24
+ }
25
+ /**
26
+ * Resolve one session row for a typed resume query. A full id wins over the
27
+ * row order; otherwise only a UNIQUE non-empty prefix (the `session-` form or
28
+ * the short id) is resolved. An ambiguous or missing prefix returns undefined
29
+ * so the read owner seeds the same global Browser search instead of guessing.
30
+ * @param rows - the listed main-session rows (never re-filtered here).
31
+ * @param query - the resume query.
32
+ * @returns the matching row, or undefined.
33
+ */
34
+ function findSessionMatch(rows, query) {
35
+ const exact = rows.find((row) => row.id === query);
36
+ if (exact !== void 0) return exact;
37
+ const bare = query.replace(/^session[-_]/i, "");
38
+ if (bare === "") return void 0;
39
+ let candidate;
40
+ for (const row of rows) {
41
+ if (!row.id.replace(/^session[-_]/i, "").startsWith(bare) && !shortSessionId(row.id).startsWith(bare)) continue;
42
+ if (candidate !== void 0) return void 0;
43
+ candidate = row;
44
+ }
45
+ return candidate;
46
+ }
47
+ /**
48
+ * Resolve one CLI `--session` value before the Browser mounts: an exact
49
+ * official row id first (including historical non-standard ids), then — only
50
+ * for a legal CLI automatic prefix — the SAME unique-prefix primitive
51
+ * `/resume` uses. An ambiguous, missing or word-like query returns undefined
52
+ * so the startup Browser keeps it as one global search instead of guessing.
53
+ * A subagent child is never an automatic main-Session selection.
54
+ */
55
+ function chooseListedSession(rows, query) {
56
+ if (query === "" || /^session[-_]$/i.test(query)) return void 0;
57
+ const exact = rows.find((row) => row.id === query);
58
+ if (exact !== void 0) return exact;
59
+ if (cliAutoPrefix(query) === void 0) return void 0;
60
+ return findSessionMatch(rows.filter((row) => row.origin !== "subagent"), query);
61
+ }
62
+ /** Canonicalize one user query for both metadata matching and Host search. */
63
+ function sanitizeSessionSearchInput(value) {
64
+ const trimmed = value.replace(/\0/g, "").trim();
65
+ if (trimmed.length <= 500) return trimmed;
66
+ const truncated = trimmed.slice(0, 500);
67
+ const last = truncated.charCodeAt(499);
68
+ return last >= 55296 && last <= 56319 ? truncated.slice(0, 499) : truncated;
69
+ }
70
+ /** Metadata-only membership; content membership belongs to SessionReader.search(). */
71
+ function sessionRowMatchesQuery(row, query) {
72
+ const needle = query.toLowerCase();
73
+ return row.id.toLowerCase().includes(needle) || (row.title ?? "").toLowerCase().includes(needle) || (row.cwd ?? "").toLowerCase().includes(needle) || (row.preset ?? "").toLowerCase().includes(needle) || (row.workspace?.title ?? "").toLowerCase().includes(needle) || (row.workspace?.path ?? "").toLowerCase().includes(needle);
74
+ }
75
+ //#endregion
76
+ export { sessionRowMatchesQuery as a, sanitizeSessionSearchInput as i, chooseListedSession as n, shortSessionId as o, findSessionMatch as r, canonicalFullSessionId as t };
package/dist/builtins.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { i as TUI_STARTUP_SERVICE } from "./startup-CARqn3kV.mjs";
1
+ import { i as TUI_STARTUP_SERVICE } from "./startup-UtFQSDe_.mjs";
2
2
  import { n as dshVersion, t as bundleVersion } from "./version-B9yC7bBk.mjs";
3
- import { i as PI_TUI_EXTENSIONS_SERVICE } from "./extensions-6a5vvJUT.mjs";
3
+ import { i as PI_TUI_EXTENSIONS_SERVICE } from "./extensions-Dx7ncPNA.mjs";
4
4
  //#region src/builtins.ts
5
5
  /** Stable Cordis plugin name for the builtins row. */
6
6
  const name = "pi-tui-builtins";