@xmoon76/dsh-pi-tui 0.5.8 → 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.
- package/README.en.md +61 -25
- package/README.md +61 -25
- package/cordis.patch.yml +13 -0
- package/dist/acp-stdio.mjs +151 -0
- package/dist/{bootstrap-CMIjGyuk.mjs → bootstrap-CVyHGQDX.mjs} +21901 -6575
- package/dist/browser-CDUSHIIr.mjs +76 -0
- package/dist/builtins.mjs +2 -2
- package/dist/{client-bootstrap-BjGPc-DM.mjs → client-bootstrap-4UoeVIHE.mjs} +2488 -2734
- package/dist/client-runtime-BHBlVUf5.mjs +1376 -0
- package/dist/{daemon-launcher-Dult7Jxv.mjs → daemon-launcher-DxIgjBHW.mjs} +1549 -172
- package/dist/daemon-launcher.d.mts +85 -14
- package/dist/daemon-launcher.mjs +2 -2
- package/dist/{local-profile-daemon-admin-BmQSdzT0.mjs → diagnostics-Db5iVcuJ.mjs} +3 -90
- package/dist/{entry-control-DjNsE3I0.mjs → entry-control-BDLZgg4m.mjs} +1 -1
- package/dist/{extensions-B4uLpSTv.mjs → extensions-Dx7ncPNA.mjs} +1 -1
- package/dist/extensions.mjs +1 -1
- package/dist/handoff-BjoEy3f8.mjs +106 -0
- package/dist/history-search-limits-Cx2UvRC2.mjs +16 -0
- package/dist/history-search-remote-BHuoellG.mjs +113 -0
- package/dist/history-search-remote-BzXdvrxk.mjs +26 -0
- package/dist/history-search-seat-BcHJTpeB.mjs +639 -0
- package/dist/history-search-seat-rZcq0XV6.mjs +639 -0
- package/dist/{host-bootstrap-MVxks641.mjs → host-bootstrap-BfnufpnW.mjs} +37 -72
- package/dist/{host-foundation-probe-DMNTmNrH.mjs → host-foundation-probe-DlD8-N_Q.mjs} +2 -2
- package/dist/host-runtime.mjs +5611 -290
- package/dist/index.d.mts +13 -6
- package/dist/index.mjs +22334 -6695
- package/dist/installed-dsh-BjUiJSwR.mjs +142 -0
- package/dist/interaction-port-D1Yv9zgu.mjs +45 -0
- package/dist/local-acp-control-CC5z4Xbq.mjs +304 -0
- package/dist/local-acp-endpoint-D1jYdJdv.mjs +41 -0
- package/dist/local-acp-listener-Cmgb5M0H.mjs +9493 -0
- package/dist/local-acp-status-B_25Q6kU.mjs +101 -0
- package/dist/local-client.mjs +292 -63
- package/dist/local-daemon-control-BFJAC8Kg.mjs +2199 -0
- package/dist/local-daemon-control-Bm3imctD.mjs +2101 -0
- package/dist/{local-discovery-uOBfFq5j.mjs → local-discovery-BMhaGIiJ.mjs} +254 -544
- package/dist/{local-discovery-egN4_gsQ.mjs → local-discovery-Ba7_-NNC.mjs} +1 -1
- package/dist/{local-discovery-DOSsCh9q.mjs → local-discovery-QSbFpjK2.mjs} +301 -544
- package/dist/local-host.mjs +952 -501
- package/dist/local-profile-daemon-admin-otpm69R6.mjs +469 -0
- package/dist/{local-scope-DamiMqPd.mjs → local-scope-5DEKA_lW.mjs} +1023 -96
- package/dist/{local-transport-Iwo0mtu3.mjs → local-transport-DeWmdZ5E.mjs} +14 -3
- package/dist/{local-web-control-DMrjwCkl.mjs → local-web-control-Dny93N-r.mjs} +10 -7
- package/dist/{local-workspace-object-D06GL0UO.mjs → local-workspace-object-D0RVQt8U.mjs} +33 -9
- package/dist/model-selection-CYlqg2DV.mjs +83 -0
- package/dist/native-client-domains-Dg4srzYt.mjs +2 -0
- package/dist/native-client.d.mts +735 -0
- package/dist/native-client.mjs +3534 -0
- package/dist/{open-CmOBxSjN.mjs → open-QQva8-ar.mjs} +24 -20
- package/dist/{pi-tui-remote-contribution-Do8ECrUy.mjs → pi-tui-remote-contribution-565wiLWp.mjs} +741 -150
- package/dist/preferences.mjs +1 -1
- package/dist/{profile-preferences-migration-CThz4rHH.mjs → profile-preferences-migration-CNOWIdnr.mjs} +1 -1
- package/dist/{profile-preferences-migration-BfUGdPZx.mjs → profile-preferences-migration-IrnXcJWK.mjs} +10 -8
- package/dist/{prompt-sections-DXmjB58H.mjs → prompt-sections-Bi-9_Gr_.mjs} +28 -10
- package/dist/{prompt-sections-DUKmWb8g.mjs → prompt-sections-DFS1dqsY.mjs} +342 -56
- package/dist/{dist-BFgC-5tL.mjs → recall-scope-9Nuoto_i.mjs} +353 -1
- package/dist/rolldown-runtime-8H4AJuhK.mjs +14 -0
- package/dist/schema-CCLvDa7Q.mjs +177 -0
- package/dist/{schema-qE_P09zJ.mjs → schema-t97l3aK8.mjs} +56 -3
- package/dist/{session-C6tSs86s.mjs → session-Cs8iLCEx.mjs} +784 -342
- package/dist/{session-CstInGIA.mjs → session-EBRZF6Ow.mjs} +783 -341
- package/dist/session-create-facts-CkfG5DpQ.mjs +20 -0
- package/dist/{startup-CarQxWwi.d.mts → startup-Dti3Udne.d.mts} +30 -3
- package/dist/{startup-EG5UqIcd.mjs → startup-UtFQSDe_.mjs} +90 -15
- package/dist/startup.d.mts +2 -2
- package/dist/startup.mjs +1 -1
- package/dist/task-read-remote-DRtkXDrZ.mjs +1083 -0
- package/dist/{terminal-progress-source-CpfpQO_h.mjs → terminal-progress-source-VsczdXA-.mjs} +610 -332
- package/dist/{transcript-view-CuJYWkhp.mjs → transcript-view-B6vCnukn.mjs} +2096 -977
- package/dist/{transcript-view-C1YtJ49Y.mjs → transcript-view-DSSdE2vK.mjs} +2078 -651
- package/dist/write-failure-xNKczXH7.mjs +189 -0
- package/package.json +20 -3
- package/dist/local-acp-listener-B65J0Bx4.mjs +0 -3115
- package/dist/local-daemon-control-C14q9KnD.mjs +0 -1588
- package/dist/local-daemon-control-TCnERL7n.mjs +0 -1424
- 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-
|
|
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-
|
|
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";
|