@xmoon76/dsh-pi-tui 0.5.3 → 0.5.4
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 +174 -150
- package/README.md +118 -103
- package/cordis.patch.yml +54 -2
- package/dist/builtins.mjs +2 -2
- package/dist/client-bootstrap-F5DHFI9t.mjs +5576 -0
- package/dist/context-summary-DAisTA_7.mjs +8557 -0
- package/dist/dispose-cause-CNFuUnjR.mjs +24 -0
- package/dist/entry-control-DvSrndWd.mjs +111 -0
- package/dist/extension/advanced.d.mts +1 -1
- package/dist/extension/unstable.d.mts +1 -1
- package/dist/{extensions-DzpBiiYb.d.mts → extensions-Bte3XOt5.d.mts} +1 -1
- package/dist/{extensions-a-rxanjw.mjs → extensions-CcuMY4n2.mjs} +722 -324
- package/dist/extensions.d.mts +2 -2
- package/dist/extensions.mjs +1 -1
- package/dist/host-bootstrap-DAgKknbY.mjs +119 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +45243 -27018
- package/dist/local-client.mjs +323 -0
- package/dist/local-host.mjs +176 -0
- package/dist/{performance-host-BJT6scGF.mjs → performance-host-CcDJjjVA.mjs} +1 -1
- package/dist/performance-host.mjs +1 -1
- package/dist/{performance-view-jvvd8Jn7.mjs → performance-view-CfGvLZyD.mjs} +1 -1
- package/dist/{public-types-gZi3iFNh.d.mts → public-types-Dgf1bDke.d.mts} +3 -3
- package/dist/runtime-status-0lp9CM0V.mjs +1923 -0
- package/dist/{runtime-BtPH-UUb.mjs → runtime-vc4mdr-R.mjs} +1395 -1088
- package/dist/{session-BZLxhrPQ.mjs → session-tdJHLnJR.mjs} +3329 -281
- package/dist/{startup-D5Xu8diR.mjs → startup-JaVZoTIl.mjs} +54 -13
- package/dist/startup.d.mts +2 -1
- package/dist/startup.mjs +1 -1
- package/dist/{terminal-progress-source-BlmksrSD.mjs → terminal-progress-source-xor3vakJ.mjs} +102 -46
- package/dist/visual-tools.d.mts +62 -0
- package/dist/visual-tools.mjs +556 -0
- package/generated/dsh-presets/README.md +1 -1
- package/package.json +132 -113
- package/dist/context-summary-CxUpNkA9.mjs +0 -2951
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/app/remote/dispose-cause.ts
|
|
2
|
+
/**
|
|
3
|
+
* Transport-neutral disposal failure chaining for the Remote composition.
|
|
4
|
+
*
|
|
5
|
+
* The helper is shared by the Host composition, the official Client runtime,
|
|
6
|
+
* the Client UI subtree and the application aggregate. It deliberately lives
|
|
7
|
+
* beside them (not inside `host-runtime.ts`) so a Client-only process entry can
|
|
8
|
+
* reuse it without importing a Host-only value graph.
|
|
9
|
+
*
|
|
10
|
+
* @module app/remote/dispose-cause
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Attach one secondary failure to `failure`'s cause chain without losing an
|
|
14
|
+
* existing cause: when the failure already carries a cause, both aggregate
|
|
15
|
+
* into a single `AggregateError`. A `undefined` secondary is a no-op.
|
|
16
|
+
*/
|
|
17
|
+
function mergeCause(failure, secondary) {
|
|
18
|
+
if (secondary === void 0) return failure;
|
|
19
|
+
const existingCause = failure.cause;
|
|
20
|
+
failure.cause = existingCause === void 0 ? secondary : new AggregateError([existingCause, secondary], "remote composition: aggregated failure causes");
|
|
21
|
+
return failure;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { mergeCause as t };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
//#region src/app/remote-process/entry-control.ts
|
|
3
|
+
/**
|
|
4
|
+
* Narrow stdin control channel for the M4-A0 qualification entries.
|
|
5
|
+
*
|
|
6
|
+
* The two process entries are internal qualification surfaces, not public
|
|
7
|
+
* commands: a launcher starts one OS process per role and drives it with
|
|
8
|
+
* newline-delimited JSON on stdin, while the process reports structured JSON
|
|
9
|
+
* lines on stdout. This module owns only that protocol and the Linux process
|
|
10
|
+
* start identity; it carries no application state.
|
|
11
|
+
*
|
|
12
|
+
* @module app/remote-process/entry-control
|
|
13
|
+
*/
|
|
14
|
+
/** One structured line emitted by a process entry. */
|
|
15
|
+
function writeEntryRecord(record) {
|
|
16
|
+
process.stdout.write(`${JSON.stringify(record)}\n`);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The kernel start identity of a process: field 22 of `/proc/<pid>/stat`
|
|
20
|
+
* (`starttime`, in clock ticks since boot). It distinguishes PID reuse from
|
|
21
|
+
* the same live process. `undefined` when the platform does not expose it.
|
|
22
|
+
*/
|
|
23
|
+
function readProcessStartIdentity(pid = process.pid) {
|
|
24
|
+
try {
|
|
25
|
+
const stat = readFileSync(`/proc/${pid}/stat`, "utf8");
|
|
26
|
+
return stat.slice(stat.lastIndexOf(")") + 2).trim().split(/\s+/)[19];
|
|
27
|
+
} catch {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** A role-labelled structured diagnostics sink for the entry's detached work. */
|
|
32
|
+
function createEntryDiag(processRole) {
|
|
33
|
+
const emit = (level) => (message, fields) => {
|
|
34
|
+
writeEntryRecord({
|
|
35
|
+
m4a0: "diag",
|
|
36
|
+
processRole,
|
|
37
|
+
level,
|
|
38
|
+
message,
|
|
39
|
+
...fields
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
debug: emit("debug"),
|
|
44
|
+
info: emit("info"),
|
|
45
|
+
warn: emit("warn"),
|
|
46
|
+
error: emit("error"),
|
|
47
|
+
dispose: () => {}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Build the serialized control queue. A malformed request or a rejecting
|
|
52
|
+
* handler is reported as a structured `control-failure` line and the queue
|
|
53
|
+
* continues: the launcher owns the process, and one bad status query must not
|
|
54
|
+
* strand later shutdown/status requests or crash the Host outside its official
|
|
55
|
+
* disposer. The handler failure is never swallowed silently.
|
|
56
|
+
*/
|
|
57
|
+
function createControlDispatcher(handler, options = {}) {
|
|
58
|
+
const emit = options.emit ?? writeEntryRecord;
|
|
59
|
+
let chain = Promise.resolve();
|
|
60
|
+
return { dispatch(line) {
|
|
61
|
+
chain = chain.then(async () => {
|
|
62
|
+
let request;
|
|
63
|
+
try {
|
|
64
|
+
request = JSON.parse(line);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
emit({
|
|
67
|
+
m4a0: "control-error",
|
|
68
|
+
error: error instanceof Error ? error.message : String(error)
|
|
69
|
+
});
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (typeof request !== "object" || request === null || typeof request.op !== "string") {
|
|
73
|
+
emit({
|
|
74
|
+
m4a0: "control-error",
|
|
75
|
+
error: "control request must be an object with a string op"
|
|
76
|
+
});
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (await handler(request)) options.onStop?.();
|
|
80
|
+
}).catch((error) => {
|
|
81
|
+
emit({
|
|
82
|
+
m4a0: "control-failure",
|
|
83
|
+
error: error instanceof Error ? error.message : String(error),
|
|
84
|
+
...error instanceof Error && error.stack !== void 0 ? { stack: error.stack } : {}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
return chain;
|
|
88
|
+
} };
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Read newline-delimited JSON control requests from stdin. Malformed input is
|
|
92
|
+
* reported as a structured `control-error` line and otherwise ignored: the
|
|
93
|
+
* launcher is the only writer, and a typo must not crash a live Host.
|
|
94
|
+
*/
|
|
95
|
+
function attachEntryControl(handler) {
|
|
96
|
+
process.stdin.setEncoding("utf8");
|
|
97
|
+
process.stdin.resume();
|
|
98
|
+
const dispatcher = createControlDispatcher(handler, { onStop: () => process.stdin.pause() });
|
|
99
|
+
let buffer = "";
|
|
100
|
+
process.stdin.on("data", (chunk) => {
|
|
101
|
+
buffer += chunk;
|
|
102
|
+
for (let newline = buffer.indexOf("\n"); newline >= 0; newline = buffer.indexOf("\n")) {
|
|
103
|
+
const line = buffer.slice(0, newline).trim();
|
|
104
|
+
buffer = buffer.slice(newline + 1);
|
|
105
|
+
if (line === "") continue;
|
|
106
|
+
dispatcher.dispatch(line);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { writeEntryRecord as i, createEntryDiag as n, readProcessStartIdentity as r, attachEntryControl as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as PiTuiApiInfo, E as NormalizedKey, _ as ExtensionTier, h as EditorSnapshot, ot as TuiOverlayOptions, v as ExtensionView } from "../public-types-
|
|
1
|
+
import { D as PiTuiApiInfo, E as NormalizedKey, _ as ExtensionTier, h as EditorSnapshot, ot as TuiOverlayOptions, v as ExtensionView } from "../public-types-Dgf1bDke.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/extension/advanced-types.d.ts
|
|
4
4
|
/** API level of the advanced tier. Bumped only on advanced breaking changes. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as PiTuiApiInfo, _ as ExtensionTier, ot as TuiOverlayOptions } from "../public-types-
|
|
1
|
+
import { D as PiTuiApiInfo, _ as ExtensionTier, ot as TuiOverlayOptions } from "../public-types-Dgf1bDke.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/extension/unstable-types.d.ts
|
|
4
4
|
/** API level of the unstable tier. Bumped only on unstable breaking changes. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as TuiKeybindingContribution, D as PiTuiApiInfo, K as TuiAutocompleteRegistryView, M as RegistrationSpec, Q as TuiCommandHandle, X as TuiCommandBridgeView, Z as TuiCommandContribution, at as TuiOverlayHandle, dt as TuiSettingHandle, et as TuiKeybindingHandle, gt as TuiThemeHandle, ht as TuiThemeContribution, i as AutocompleteProviderContribution, it as TuiMessageRendererContribution, j as RegistrationHandle, l as EditorContribution, lt as TuiRendererRegistryView, nt as TuiKeybindingRegistryView, ot as TuiOverlayOptions, pt as TuiSettingsRegistryView, r as AutocompleteHandle, st as TuiRendererHandle, u as EditorHandle, ut as TuiSettingContribution, v as ExtensionView, vt as TuiThemeRegistryView, yt as TuiToolRendererContribution, z as SurfaceStateValues } from "./public-types-
|
|
1
|
+
import { $ as TuiKeybindingContribution, D as PiTuiApiInfo, K as TuiAutocompleteRegistryView, M as RegistrationSpec, Q as TuiCommandHandle, X as TuiCommandBridgeView, Z as TuiCommandContribution, at as TuiOverlayHandle, dt as TuiSettingHandle, et as TuiKeybindingHandle, gt as TuiThemeHandle, ht as TuiThemeContribution, i as AutocompleteProviderContribution, it as TuiMessageRendererContribution, j as RegistrationHandle, l as EditorContribution, lt as TuiRendererRegistryView, nt as TuiKeybindingRegistryView, ot as TuiOverlayOptions, pt as TuiSettingsRegistryView, r as AutocompleteHandle, st as TuiRendererHandle, u as EditorHandle, ut as TuiSettingContribution, v as ExtensionView, vt as TuiThemeRegistryView, yt as TuiToolRendererContribution, z as SurfaceStateValues } from "./public-types-Dgf1bDke.mjs";
|
|
2
2
|
import { EventEmitter } from "events";
|
|
3
3
|
import { Context, Service } from "@deepseek-ai/cordis";
|
|
4
4
|
|