@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.
- package/README.en.md +64 -26
- package/README.md +64 -26
- package/cordis.patch.yml +13 -0
- package/dist/acp-stdio.mjs +151 -0
- package/dist/{bootstrap-C9nl6e13.mjs → bootstrap-CVyHGQDX.mjs} +22330 -6888
- package/dist/browser-CDUSHIIr.mjs +76 -0
- package/dist/builtins.mjs +2 -2
- package/dist/{client-bootstrap-CGezi85O.mjs → client-bootstrap-4UoeVIHE.mjs} +2407 -1830
- package/dist/client-runtime-BHBlVUf5.mjs +1376 -0
- package/dist/{daemon-launcher-H_1r5Cqs.mjs → daemon-launcher-DxIgjBHW.mjs} +1551 -57
- package/dist/daemon-launcher.d.mts +85 -14
- package/dist/daemon-launcher.mjs +2 -2
- package/dist/diagnostics-Db5iVcuJ.mjs +123 -0
- package/dist/{entry-control-jBfKn1qO.mjs → entry-control-BDLZgg4m.mjs} +1 -1
- package/dist/{extensions-6a5vvJUT.mjs → extensions-Dx7ncPNA.mjs} +1 -4
- 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-DK7n5jDu.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 +22766 -6893
- 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 +719 -93
- package/dist/local-daemon-control-BFJAC8Kg.mjs +2199 -0
- package/dist/local-daemon-control-Bm3imctD.mjs +2101 -0
- package/dist/{local-discovery-BPZw1wEd.mjs → local-discovery-BMhaGIiJ.mjs} +254 -544
- package/dist/{local-discovery-BMoNXZjJ.mjs → local-discovery-Ba7_-NNC.mjs} +1 -1
- package/dist/{local-discovery-Bq3jLAn1.mjs → local-discovery-QSbFpjK2.mjs} +301 -544
- package/dist/local-host.mjs +970 -501
- package/dist/local-profile-daemon-admin-otpm69R6.mjs +469 -0
- package/dist/{local-scope-DEuGAy8l.mjs → local-scope-5DEKA_lW.mjs} +1075 -31
- package/dist/{local-transport-X4ZCe2uE.mjs → local-transport-DeWmdZ5E.mjs} +14 -3
- package/dist/{local-web-control-DKWtXIkr.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-DC0XQr5O.mjs → session-Cs8iLCEx.mjs} +784 -342
- package/dist/{session-Cihe8PPS.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-CARqn3kV.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-D4DHyXDo.mjs → terminal-progress-source-VsczdXA-.mjs} +610 -335
- package/dist/{transcript-view-a7cROAaI.mjs → transcript-view-B6vCnukn.mjs} +2284 -1166
- package/dist/{transcript-view-hvNVkPtv.mjs → transcript-view-DSSdE2vK.mjs} +2191 -765
- package/dist/write-failure-xNKczXH7.mjs +189 -0
- package/package.json +25 -8
- package/dist/local-acp-listener-CNkguN5-.mjs +0 -2566
- package/dist/local-daemon-control-Bg9s2aYi.mjs +0 -1424
- package/dist/local-daemon-control-Cu_4FIdd.mjs +0 -1585
- package/dist/local-profile-daemon-admin-AXgVH-6y.mjs +0 -91
- package/dist/preset-BcWqOtY7.mjs +0 -46
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { i as parsePiTuiAcpAccessStatus } from "./pi-tui-acp-access-contract-BdLwduU6.mjs";
|
|
2
|
+
//#region src/app/remote-process/local-acp-status.ts
|
|
3
|
+
/** The one Owner-only authenticated route of the live ACP status observation. */
|
|
4
|
+
const LOCAL_ACP_STATUS_ROUTE = "/api/pi-tui.acp-status";
|
|
5
|
+
/** Hard cap on the status response body; the DTO is a few hundred bytes. */
|
|
6
|
+
const LOCAL_ACP_STATUS_MAX_BYTES = 1024;
|
|
7
|
+
/** Bound on the one observation request. */
|
|
8
|
+
const LOCAL_ACP_STATUS_TIMEOUT_MS = 3e3;
|
|
9
|
+
/** Drain the body within the byte cap; an oversized/unreadable body is absent. */
|
|
10
|
+
async function readBoundedBody(response) {
|
|
11
|
+
if (response.body === null) return "";
|
|
12
|
+
const reader = response.body.getReader();
|
|
13
|
+
const chunks = [];
|
|
14
|
+
let total = 0;
|
|
15
|
+
try {
|
|
16
|
+
for (;;) {
|
|
17
|
+
const { done, value } = await reader.read();
|
|
18
|
+
if (done) break;
|
|
19
|
+
total += value.byteLength;
|
|
20
|
+
if (total > LOCAL_ACP_STATUS_MAX_BYTES) {
|
|
21
|
+
await reader.cancel();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
chunks.push(value);
|
|
25
|
+
}
|
|
26
|
+
} finally {
|
|
27
|
+
reader.releaseLock();
|
|
28
|
+
}
|
|
29
|
+
return Buffer.concat(chunks.map((chunk) => Buffer.from(chunk))).toString("utf8");
|
|
30
|
+
}
|
|
31
|
+
/** Cancel an unread body without observing it. */
|
|
32
|
+
async function discard(response) {
|
|
33
|
+
try {
|
|
34
|
+
await response.body?.cancel();
|
|
35
|
+
} catch {}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Observe the running Host's live ACP listener status through the authenticated
|
|
39
|
+
* read-only route. This is the ONLY headless observation; it never creates a
|
|
40
|
+
* controller, never calls `setEnabled`, and never caches the result.
|
|
41
|
+
*
|
|
42
|
+
* Every external-boundary failure category is `undefined` (the caller's
|
|
43
|
+
* `unavailable`), including an instance id that does not match the Host the
|
|
44
|
+
* Cookie was issued for: a response from a replaced/foreign Host can never be
|
|
45
|
+
* attributed to this observation.
|
|
46
|
+
*
|
|
47
|
+
* @param verified - the already authenticated Host record and in-memory cookie.
|
|
48
|
+
* @param signal - an optional owner cancellation (the management CLI lifecycle);
|
|
49
|
+
* it is combined with the fixed observation timeout and never extends it.
|
|
50
|
+
* @returns the validated live listener status, or `undefined` when unprovable.
|
|
51
|
+
*/
|
|
52
|
+
async function observeAuthenticatedLocalAcpStatus(verified, signal) {
|
|
53
|
+
const timeout = AbortSignal.timeout(LOCAL_ACP_STATUS_TIMEOUT_MS);
|
|
54
|
+
const request = {
|
|
55
|
+
method: "GET",
|
|
56
|
+
headers: { cookie: verified.cookie },
|
|
57
|
+
redirect: "manual",
|
|
58
|
+
cache: "no-store",
|
|
59
|
+
signal: signal === void 0 ? timeout : AbortSignal.any([signal, timeout])
|
|
60
|
+
};
|
|
61
|
+
let response;
|
|
62
|
+
try {
|
|
63
|
+
response = await fetch(`${verified.record.origin}${LOCAL_ACP_STATUS_ROUTE}`, request);
|
|
64
|
+
} catch {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (response.status !== 200) {
|
|
68
|
+
await discard(response);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
72
|
+
const cacheControl = response.headers.get("cache-control") ?? "";
|
|
73
|
+
if (!/^application\/json\b/iu.test(contentType) || !/\bno-store\b/iu.test(cacheControl)) {
|
|
74
|
+
await discard(response);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
let text;
|
|
78
|
+
try {
|
|
79
|
+
const body = await readBoundedBody(response);
|
|
80
|
+
if (body === void 0) return void 0;
|
|
81
|
+
text = body;
|
|
82
|
+
} catch {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let value;
|
|
86
|
+
try {
|
|
87
|
+
value = JSON.parse(text);
|
|
88
|
+
} catch {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
92
|
+
const record = value;
|
|
93
|
+
if (Object.keys(record).length !== 3 || record.schema !== 1 || typeof record.instanceId !== "string" || record.instanceId !== verified.identity.instanceId) return;
|
|
94
|
+
try {
|
|
95
|
+
return parsePiTuiAcpAccessStatus(record.status);
|
|
96
|
+
} catch {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { observeAuthenticatedLocalAcpStatus as t };
|