@xmoon76/dsh-pi-tui 0.5.6 → 0.5.8

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 (90) hide show
  1. package/LICENSE +33 -0
  2. package/README.en.md +103 -814
  3. package/README.md +102 -711
  4. package/cordis.patch.yml +186 -0
  5. package/dist/acp-preferences.d.mts +29 -0
  6. package/dist/acp-preferences.mjs +15 -0
  7. package/dist/{bootstrap-DQ4YPL-7.mjs → bootstrap-CMIjGyuk.mjs} +33515 -7587
  8. package/dist/builtins.mjs +3 -3
  9. package/dist/{client-bootstrap-Cr1JCaF5.mjs → client-bootstrap-BjGPc-DM.mjs} +4637 -492
  10. package/dist/client-extension-loader-probe-BUw7q8bJ.mjs +119 -0
  11. package/dist/command-trust-DChWUamk.mjs +406 -0
  12. package/dist/daemon-launcher-Dult7Jxv.mjs +1932 -0
  13. package/dist/daemon-launcher.d.mts +159 -0
  14. package/dist/daemon-launcher.mjs +2 -0
  15. package/dist/diagnostics-D5jwc-q1.d.mts +11 -0
  16. package/dist/{dist-CIsR7cz4.mjs → dist-BFgC-5tL.mjs} +938 -487
  17. package/dist/entry-control-DjNsE3I0.mjs +190 -0
  18. package/dist/extension/advanced.d.mts +1 -1
  19. package/dist/extension/unstable.d.mts +1 -1
  20. package/dist/extension-config-probe-BDdvutkG.mjs +95 -0
  21. package/dist/extension-config.d.mts +29 -0
  22. package/dist/extension-config.mjs +22 -0
  23. package/dist/{extensions-Bp0L37lP.mjs → extensions-B4uLpSTv.mjs} +1109 -100
  24. package/dist/{extensions-Bte3XOt5.d.mts → extensions-C8eAM0gX.d.mts} +1 -1
  25. package/dist/extensions.d.mts +2 -2
  26. package/dist/extensions.mjs +1 -1
  27. package/dist/{host-bootstrap-DilsvA6f.mjs → host-bootstrap-MVxks641.mjs} +129 -24
  28. package/dist/{host-foundation-probe--5jtvHVe.mjs → host-foundation-probe-DMNTmNrH.mjs} +2 -2
  29. package/dist/host-runtime.d.mts +11 -5
  30. package/dist/host-runtime.mjs +4171 -920
  31. package/dist/index.d.mts +86 -174
  32. package/dist/index.mjs +38087 -9967
  33. package/dist/local-acp-listener-B65J0Bx4.mjs +3115 -0
  34. package/dist/local-client.mjs +1158 -59
  35. package/dist/local-daemon-control-C14q9KnD.mjs +1588 -0
  36. package/dist/local-daemon-control-TCnERL7n.mjs +1424 -0
  37. package/dist/local-discovery-DOSsCh9q.mjs +2883 -0
  38. package/dist/local-discovery-egN4_gsQ.mjs +2 -0
  39. package/dist/local-discovery-uOBfFq5j.mjs +2764 -0
  40. package/dist/local-host.mjs +812 -89
  41. package/dist/local-profile-daemon-admin-BmQSdzT0.mjs +210 -0
  42. package/dist/local-scope-DamiMqPd.mjs +1340 -0
  43. package/dist/{local-transport-BVwFYq_Y.mjs → local-transport-Iwo0mtu3.mjs} +313 -38
  44. package/dist/local-web-control-DMrjwCkl.mjs +454 -0
  45. package/dist/local-workspace-object-D06GL0UO.mjs +248 -0
  46. package/dist/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
  47. package/dist/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
  48. package/dist/open-CmOBxSjN.mjs +63 -0
  49. package/dist/persisted-setting-probe-DWZLtWoB.mjs +145 -0
  50. package/dist/pi-tui-acp-access-contract-BdLwduU6.mjs +75 -0
  51. package/dist/pi-tui-remote-contribution-Do8ECrUy.mjs +1492 -0
  52. package/dist/pi-tui-terminal-progress-contract-B3RoEzjK.mjs +146 -0
  53. package/dist/preferences.d.mts +17 -0
  54. package/dist/preferences.mjs +20 -0
  55. package/dist/preset-BcWqOtY7.mjs +46 -0
  56. package/dist/profile-preferences-migration-BfUGdPZx.mjs +500 -0
  57. package/dist/profile-preferences-migration-CThz4rHH.mjs +2 -0
  58. package/dist/prompt-sections-DUKmWb8g.mjs +2232 -0
  59. package/dist/prompt-sections-DXmjB58H.mjs +634 -0
  60. package/dist/{public-types-Dgf1bDke.d.mts → public-types-C1YgFtwC.d.mts} +56 -3
  61. package/dist/row-id-DPbyt9Nn.mjs +24 -0
  62. package/dist/{runtime-status-Cj1nFOdS.mjs → runtime-status-v-FTnWcD.mjs} +49 -3
  63. package/dist/schema-BTGYn8_X.d.mts +54 -0
  64. package/dist/schema-qE_P09zJ.mjs +124 -0
  65. package/dist/{session-BKGXyh80.mjs → session-C6tSs86s.mjs} +9672 -7270
  66. package/dist/{session-CPt_U8_f.mjs → session-CstInGIA.mjs} +9674 -7273
  67. package/dist/startup-CarQxWwi.d.mts +213 -0
  68. package/dist/{startup-7BYWuvBU.mjs → startup-EG5UqIcd.mjs} +341 -26
  69. package/dist/startup.d.mts +2 -99
  70. package/dist/startup.mjs +2 -2
  71. package/dist/{terminal-progress-source-DrqQhtT8.mjs → terminal-progress-source-CpfpQO_h.mjs} +2038 -67
  72. package/dist/{pasted-path-range-CMnxuGPx.mjs → transcript-view-C1YtJ49Y.mjs} +11590 -6718
  73. package/dist/{pasted-path-range-r6qzV_tC.mjs → transcript-view-CuJYWkhp.mjs} +12296 -6923
  74. package/dist/version-B9yC7bBk.mjs +83 -0
  75. package/dist/visual-tools.d.mts +1 -1
  76. package/dist/visual-tools.mjs +1 -1
  77. package/dist/web-preferences.d.mts +1 -1
  78. package/dist/{web-roster-CjqnUXNk.mjs → web-roster-Dis7BhrA.mjs} +63 -3
  79. package/generated/dsh-presets/cordis.patch.yml +4 -2
  80. package/generated/dsh-presets/ptc.patch.yml +4 -0
  81. package/generated/dsh-presets/standard.patch.yml +7 -0
  82. package/generated/web-access/cordis.patch.yml +239 -0
  83. package/package.json +217 -170
  84. package/dist/entry-control-DnduyDiw.mjs +0 -92
  85. package/dist/local-discovery-C9VMjc0K.mjs +0 -759
  86. package/dist/local-discovery-CDaQHA_R.mjs +0 -2
  87. package/dist/pi-tui-remote-contribution-B0EQsP0N.mjs +0 -85
  88. package/dist/pi-tui-terminal-progress-contract-CdBH9j78.mjs +0 -70
  89. package/dist/pi-tui-terminal-progress-contract-MLXZ-i3t.mjs +0 -905
  90. package/dist/version-a-eF-QER.mjs +0 -80
@@ -0,0 +1,159 @@
1
+ import { t as Diag } from "./diagnostics-D5jwc-q1.mjs";
2
+ import { u as TuiDaemonClientStartup } from "./startup-CarQxWwi.mjs";
3
+ import { spawn } from "node:child_process";
4
+ import { Context } from "@deepseek-ai/cordis";
5
+
6
+ //#region src/app/remote-process/daemon-launcher.d.ts
7
+ /** Stable Loader row id / Cordis plugin name. */
8
+ declare const name = "pi-tui-daemon-launcher";
9
+ /** The daemon Coordinator only exists when the daemon backend published its service. */
10
+ declare const inject: string[];
11
+ /** The launcher-provided Profile facts the Coordinator needs (official shape). */
12
+ interface ProfileContextLike {
13
+ readonly name: string;
14
+ readonly dir: string;
15
+ readonly home: string;
16
+ readonly installAnchor: string;
17
+ readonly cwd: string;
18
+ }
19
+ /** The one-shot public launch envelope encoded for the Client child. */
20
+ declare function encodeLaunchEnvelope(startup: TuiDaemonClientStartup): string;
21
+ /**
22
+ * Resolve the installed Client entry from THIS package root and prove its real
23
+ * target is a regular file. A shared npm package, a root-owned system install
24
+ * and a legal entry symlink are normal installs; only a missing or non-regular
25
+ * target is a hard failure — never a fallback to a source tree or `tsx`.
26
+ */
27
+ declare function resolveClientEntry(packageRoot: string): string;
28
+ /**
29
+ * Resolve this installed bundle's package root through the OFFICIAL profile
30
+ * resolution. The launcher module itself may be reached through a symlinked
31
+ * `dist`, so its own module URL is not a reliable package-root locator.
32
+ * Exported for the M6 UX PR2 Direct-side admin port, which must reuse the SAME
33
+ * official Profile resolution as this CLI path — never a second copy.
34
+ */
35
+ declare function resolveProfilePackageRoot(profileDir: string): string;
36
+ /**
37
+ * Build the child environment at the ONE new-spawn boundary. Every inherited
38
+ * `SPLIT_PROCESS_*` test/qualification injection is stripped first, then the
39
+ * four required internal facts are set explicitly. The supervisor's own role /
40
+ * Host-entry markers and the one-shot public selector are never propagated.
41
+ */
42
+ declare function buildChildEnvironment(profileContext: ProfileContextLike, launchEnvelope: string, source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
43
+ /** Injectable spawn for a structural (L2/L3) test; production uses `child_process.spawn`. */
44
+ type SpawnImpl = typeof spawn;
45
+ /**
46
+ * The ONE child lifecycle. Idempotent start/dispose; a single settle drives the
47
+ * launcher `appExit` exactly once. `dispose()` is the SINGLE stop owner: it is
48
+ * driven by the row's fiber disposal (the official `runProfile` SIGTERM → shutdown
49
+ * → fiber disposal path) and asks the live child to stop once. The Coordinator
50
+ * installs NO second SIGTERM/SIGINT handler — a terminal SIGINT already reaches
51
+ * the foreground child through the shared TTY group, and the parent's own SIGTERM
52
+ * is the official shutdown's, so there is exactly one stop request.
53
+ */
54
+ declare class DaemonCoordinator {
55
+ private readonly spawnImpl;
56
+ private readonly entry;
57
+ private readonly env;
58
+ private readonly appExit;
59
+ private readonly diag;
60
+ /** A sanitized human line for the supervisor TTY when the Client cannot be
61
+ * spawned at all (never a JSON record, never a raw error/message/path). */
62
+ private readonly reportFatal;
63
+ private readonly shutdownBudgetMs;
64
+ private child;
65
+ private childExit;
66
+ private started;
67
+ private disposed;
68
+ private settled;
69
+ private disposePromise;
70
+ /** Test observation: how many children were actually spawned. */
71
+ spawnCount: number;
72
+ constructor(options: {
73
+ spawnImpl: SpawnImpl;
74
+ entry: string;
75
+ env: NodeJS.ProcessEnv;
76
+ appExit: (code: number) => void;
77
+ diag: Diag;
78
+ reportFatal?: (line: string) => void;
79
+ shutdownBudgetMs?: number;
80
+ });
81
+ /** Spawn the ONE foreground Client. No-op after a prior start or dispose. */
82
+ start(): void;
83
+ private settle;
84
+ /**
85
+ * The SINGLE stop owner, AWAITABLE. A spawn not yet started is cancelled; a
86
+ * live child is asked to stop once (SIGTERM) and dispose() resolves only after
87
+ * the child actually exited, so the parent Fiber disposer holds the child's
88
+ * cleanup rather than the parent process exiting underneath it. The wait is
89
+ * bounded to fit the official ~5s shutdown deadline; a child that does not exit
90
+ * within it is escalated to SIGKILL and awaited briefly. Idempotent.
91
+ */
92
+ dispose(): Promise<boolean>;
93
+ }
94
+ /** The result of one management operation, as written to the real TTY. */
95
+ interface DaemonManagementResult {
96
+ readonly code: number;
97
+ readonly stdout: string;
98
+ readonly stderr: string;
99
+ }
100
+ /** One management executor: the production one dynamically imports the control
101
+ * module; a structural test supplies its own. */
102
+ type DaemonManagementExecutor = () => Promise<DaemonManagementResult>;
103
+ /**
104
+ * The ONE management operation lifecycle. It runs at most once, writes its
105
+ * output and requests `appExit` exactly once, and a fiber disposal before the
106
+ * result settles suppresses both the output and the exit so a late result can
107
+ * never surface after the supervisor has gone away. The operation itself is
108
+ * bounded so a shutdown never waits indefinitely on a management action.
109
+ */
110
+ declare class DaemonControlRunner {
111
+ private readonly run;
112
+ private readonly appExit;
113
+ private readonly writeStdout;
114
+ private readonly writeStderr;
115
+ private readonly reportFatal;
116
+ private readonly shutdownBudgetMs;
117
+ /** The fixed result for an unexpected local throw; the daemon manager text
118
+ * stays the default so its behavior is unchanged. */
119
+ private readonly fallback;
120
+ private started;
121
+ private disposed;
122
+ private settled;
123
+ private operation;
124
+ /** Test observation: how many management operations actually started. */
125
+ runCount: number;
126
+ constructor(options: {
127
+ run: DaemonManagementExecutor;
128
+ appExit: (code: number) => void;
129
+ writeStdout?: (text: string) => void;
130
+ writeStderr?: (text: string) => void;
131
+ reportFatal?: (line: string) => void;
132
+ shutdownBudgetMs?: number;
133
+ fallback?: DaemonManagementResult;
134
+ });
135
+ /** Start exactly one management operation. A no-op after a prior start/dispose. */
136
+ start(): void;
137
+ /** Stop accepting a late result and bound the wait for an in-flight one. */
138
+ dispose(): Promise<boolean>;
139
+ }
140
+ /**
141
+ * Write a qualification dump to a SAFE, PRIVATE target: absolute path, a real
142
+ * parent directory owned by this process user, NEVER overwriting an existing
143
+ * file and never following a symlink; created 0600. Throws on any unsafe target
144
+ * (mirrors the qualification record-sink contract in local-client-entry).
145
+ */
146
+ declare function writeQualificationDump(target: string, text: string): void;
147
+ /** A cancelable, Fiber-lifecycle-owned one-shot qualification dump scheduler. */
148
+ interface LoaderDumpScheduler {
149
+ schedule(delayMs: number): void;
150
+ flush(): void;
151
+ dispose(): void;
152
+ }
153
+ declare function createLoaderDumpScheduler(produce: () => string, write: (text: string) => void): LoaderDumpScheduler;
154
+ /** The production Coordinator row. A `client` launch spawns the ONE foreground
155
+ * Client; a `control` launch runs ONE management operation. Both settle on the
156
+ * real cold-ready commit and are owned by this row's Fiber. */
157
+ declare function apply(ctx: Context): void;
158
+ //#endregion
159
+ export { DaemonControlRunner, DaemonCoordinator, DaemonManagementExecutor, DaemonManagementResult, LoaderDumpScheduler, SpawnImpl, apply, buildChildEnvironment, createLoaderDumpScheduler, encodeLaunchEnvelope, inject, name, resolveClientEntry, resolveProfilePackageRoot, writeQualificationDump };
@@ -0,0 +1,2 @@
1
+ import { a as createLoaderDumpScheduler, c as name, d as writeQualificationDump, i as buildChildEnvironment, l as resolveClientEntry, n as DaemonCoordinator, o as encodeLaunchEnvelope, r as apply, s as inject, t as DaemonControlRunner, u as resolveProfilePackageRoot } from "./daemon-launcher-Dult7Jxv.mjs";
2
+ export { DaemonControlRunner, DaemonCoordinator, apply, buildChildEnvironment, createLoaderDumpScheduler, encodeLaunchEnvelope, inject, name, resolveClientEntry, resolveProfilePackageRoot, writeQualificationDump };
@@ -0,0 +1,11 @@
1
+ //#region src/runtime/process/diagnostics.d.ts
2
+ interface Diag {
3
+ debug(message: string, fields?: Record<string, unknown>): void;
4
+ info(message: string, fields?: Record<string, unknown>): void;
5
+ warn(message: string, fields?: Record<string, unknown>): void;
6
+ error(message: string, fields?: Record<string, unknown>): void;
7
+ /** Release the file handle, if one is open. */
8
+ dispose(): void;
9
+ }
10
+ //#endregion
11
+ export { Diag as t };