@xmoon76/dsh-pi-tui 0.5.3 → 0.5.5

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 (59) hide show
  1. package/README.en.md +195 -150
  2. package/README.md +137 -103
  3. package/cordis.patch.yml +54 -2
  4. package/dist/application-runtime-CbBO4bY-.mjs +6860 -0
  5. package/dist/bootstrap-DLOydLLj.mjs +108410 -0
  6. package/dist/builtins.mjs +2 -3
  7. package/dist/client-bootstrap-DwSFzcTW.mjs +872 -0
  8. package/dist/context-summary-Bz0AGXa1.mjs +12027 -0
  9. package/dist/context-summary-D9mhxPXL.mjs +10015 -0
  10. package/dist/custom-items-CKrOBCox.mjs +655 -0
  11. package/dist/disposal-BYBbEpVY.mjs +54 -0
  12. package/dist/dispose-cause-BzcXo4hu.mjs +123 -0
  13. package/dist/dispose-cause-CNFuUnjR.mjs +24 -0
  14. package/dist/dist-C7QMk0ws.mjs +15431 -0
  15. package/dist/entry-control-DnduyDiw.mjs +92 -0
  16. package/dist/extension/advanced.d.mts +1 -1
  17. package/dist/extension/unstable.d.mts +1 -1
  18. package/dist/{extensions-DzpBiiYb.d.mts → extensions-Bte3XOt5.d.mts} +1 -1
  19. package/dist/{extensions-a-rxanjw.mjs → extensions-pcFiH7Qe.mjs} +1498 -410
  20. package/dist/extensions.d.mts +2 -2
  21. package/dist/extensions.mjs +1 -1
  22. package/dist/host-bootstrap-CKdfLkNS.mjs +188 -0
  23. package/dist/host-foundation-probe-CYHsbAw6.mjs +143 -0
  24. package/dist/host-prerequisites-9JBTtVNu.mjs +36 -0
  25. package/dist/host-runtime.d.mts +26 -0
  26. package/dist/host-runtime.mjs +450 -0
  27. package/dist/index.d.mts +9 -2
  28. package/dist/index.mjs +45779 -24480
  29. package/dist/local-client.mjs +1816 -0
  30. package/dist/local-discovery-CXnLT4GF.mjs +755 -0
  31. package/dist/local-discovery-DVFFpfBG.mjs +2 -0
  32. package/dist/local-host.mjs +1025 -0
  33. package/dist/local-transport-C9aonplC.mjs +513 -0
  34. package/dist/performance-host.d.mts +2 -2
  35. package/dist/performance-host.mjs +258 -1
  36. package/dist/{performance-view-jvvd8Jn7.mjs → performance-view-CfGvLZyD.mjs} +1 -1
  37. package/dist/pi-tui-remote-contribution-DRk6Tl3J.mjs +78 -0
  38. package/dist/pi-tui-terminal-progress-contract-CdBH9j78.mjs +70 -0
  39. package/dist/pi-tui-terminal-progress-contract-XTQKj-WW.mjs +905 -0
  40. package/dist/{public-types-gZi3iFNh.d.mts → public-types-Dgf1bDke.d.mts} +3 -3
  41. package/dist/{runtime-BtPH-UUb.mjs → runtime-Bh5OsftD.mjs} +1311 -1024
  42. package/dist/runtime-C5ROZqFj.mjs +2 -0
  43. package/dist/runtime-status-0lp9CM0V.mjs +1923 -0
  44. package/dist/session-4keoXjk0.mjs +10869 -0
  45. package/dist/session-B2zqv4wr.mjs +10869 -0
  46. package/dist/{startup-D5Xu8diR.mjs → startup-Ct2UUjUL.mjs} +55 -13
  47. package/dist/startup.d.mts +2 -1
  48. package/dist/startup.mjs +1 -1
  49. package/dist/terminal-progress-source-BhufrZ74.mjs +6000 -0
  50. package/dist/terminal-progress-source-CsBinCJ_.mjs +965 -0
  51. package/dist/visual-tools.d.mts +62 -0
  52. package/dist/visual-tools.mjs +556 -0
  53. package/generated/dsh-presets/README.md +1 -1
  54. package/package.json +145 -117
  55. package/dist/context-summary-CxUpNkA9.mjs +0 -2951
  56. package/dist/performance-host-BJT6scGF.mjs +0 -266
  57. package/dist/rolldown-runtime-8H4AJuhK.mjs +0 -14
  58. package/dist/session-BZLxhrPQ.mjs +0 -5697
  59. package/dist/terminal-progress-source-BlmksrSD.mjs +0 -2200
@@ -0,0 +1,92 @@
1
+ //#region src/app/remote-process/entry-control.ts
2
+ /** The default JSONL sink: the qualification control channel on stdout. */
3
+ const stdoutRecordSink = (record) => {
4
+ process.stdout.write(`${JSON.stringify(record)}\n`);
5
+ };
6
+ /** One structured line emitted by a process entry. */
7
+ function writeEntryRecord(record, sink = stdoutRecordSink) {
8
+ sink(record);
9
+ }
10
+ /** A role-labelled structured diagnostics sink for the entry's detached work.
11
+ * The surface entry supplies its private JSONL file sink; the qualification
12
+ * entries keep the default stdout control channel. */
13
+ function createEntryDiag(processRole, sink) {
14
+ const emit = (level) => (message, fields) => {
15
+ writeEntryRecord({
16
+ m4a0: "diag",
17
+ processRole,
18
+ level,
19
+ message,
20
+ ...fields
21
+ }, sink);
22
+ };
23
+ return {
24
+ debug: emit("debug"),
25
+ info: emit("info"),
26
+ warn: emit("warn"),
27
+ error: emit("error"),
28
+ dispose: () => {}
29
+ };
30
+ }
31
+ /**
32
+ * Build the serialized control queue. A malformed request or a rejecting
33
+ * handler is reported as a structured `control-failure` line and the queue
34
+ * continues: the launcher owns the process, and one bad status query must not
35
+ * strand later shutdown/status requests or crash the Host outside its official
36
+ * disposer. The handler failure is never swallowed silently.
37
+ */
38
+ function createControlDispatcher(handler, options = {}) {
39
+ const emit = options.emit ?? writeEntryRecord;
40
+ let chain = Promise.resolve();
41
+ return { dispatch(line) {
42
+ chain = chain.then(async () => {
43
+ let request;
44
+ try {
45
+ request = JSON.parse(line);
46
+ } catch (error) {
47
+ emit({
48
+ m4a0: "control-error",
49
+ error: error instanceof Error ? error.message : String(error)
50
+ });
51
+ return;
52
+ }
53
+ if (typeof request !== "object" || request === null || typeof request.op !== "string") {
54
+ emit({
55
+ m4a0: "control-error",
56
+ error: "control request must be an object with a string op"
57
+ });
58
+ return;
59
+ }
60
+ if (await handler(request)) options.onStop?.();
61
+ }).catch((error) => {
62
+ emit({
63
+ m4a0: "control-failure",
64
+ error: error instanceof Error ? error.message : String(error),
65
+ ...error instanceof Error && error.stack !== void 0 ? { stack: error.stack } : {}
66
+ });
67
+ });
68
+ return chain;
69
+ } };
70
+ }
71
+ /**
72
+ * Read newline-delimited JSON control requests from stdin. Malformed input is
73
+ * reported as a structured `control-error` line and otherwise ignored: the
74
+ * launcher is the only writer, and a typo must not crash a live Host.
75
+ */
76
+ function attachEntryControl(handler) {
77
+ process.stdin.setEncoding("utf8");
78
+ process.stdin.resume();
79
+ const dispatcher = createControlDispatcher(handler, { onStop: () => process.stdin.pause() });
80
+ let buffer = "";
81
+ process.stdin.on("data", (chunk) => {
82
+ buffer += chunk;
83
+ for (let newline = buffer.indexOf("\n"); newline >= 0; newline = buffer.indexOf("\n")) {
84
+ const line = buffer.slice(0, newline).trim();
85
+ buffer = buffer.slice(newline + 1);
86
+ if (line === "") continue;
87
+ dispatcher.dispatch(line);
88
+ }
89
+ });
90
+ }
91
+ //#endregion
92
+ export { createEntryDiag as n, writeEntryRecord 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-gZi3iFNh.mjs";
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-gZi3iFNh.mjs";
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-gZi3iFNh.mjs";
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