@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,213 @@
1
+ import z from "@deepseek-ai/schemastery";
2
+ import { Context } from "@deepseek-ai/cordis";
3
+
4
+ //#region src/startup.d.ts
5
+ /** Stable Cordis plugin name. */
6
+ declare const name = "tui-startup";
7
+ /** Services required before the flags can be resolved. */
8
+ declare const inject: string[];
9
+ /** Incompatible dsh harness ranges and the guidance each deserves. Entries
10
+ * are checked in ORDER and the first whose range covers the installed dsh
11
+ * version wins.
12
+ *
13
+ * Range semantics: `min` is inclusive, `max` is EXCLUSIVE. An entry with
14
+ * only `max` covers everything below it (the common "too old" case); an
15
+ * entry with only `min` covers everything at or above it ("too new" —
16
+ * e.g. a harness that removed a seam we still use).
17
+ *
18
+ * `since` names the bundle release line that FIRST imposed the constraint:
19
+ * it is shown as the fallback version label (`>= <since>`) when the
20
+ * bundle's own version cannot be read, so the message stays truthful.
21
+ *
22
+ * The current line has a minimum of the published npm release
23
+ * dsh-v0.2.1-rc.2 and a recommended upgrade target of the newer
24
+ * dsh-v0.2.1-rc.5. The recovery guidance names the recommended published
25
+ * upgrade target — which may be NEWER than the floor — and allows its native
26
+ * install scripts. The already-published 0.5.0 line keeps its own
27
+ * rc.1-era contract and remains the compatible fallback for a
28
+ * dsh-v0.2.0-rc.1 runtime.
29
+ */
30
+ interface HarnessCompatEntry {
31
+ /** Inclusive lower bound of the incompatible range; absent = unbounded below. */
32
+ min?: string;
33
+ /** Exclusive upper bound of the incompatible range; absent = unbounded above. */
34
+ max?: string;
35
+ /** The bundle release line that first required this constraint. */
36
+ since: string;
37
+ /** Human-readable requirement, e.g. `DeepSeek Harness 0.1.7-alpha.2 or later`. */
38
+ requires: string;
39
+ /** The target DSH version to install when the current runtime is too old. */
40
+ upgradeDsh?: string;
41
+ /** An exact install command when the target needs install-script flags. */
42
+ upgradeCommand?: string;
43
+ /** The compatible TUI line to install when keeping an old DSH runtime. */
44
+ fallbackTui?: string;
45
+ /** Special guidance for a range that is not covered by the normal recovery
46
+ * commands, such as an unvalidated future DSH line. */
47
+ guidance?: string;
48
+ }
49
+ /** The compatibility table, derived from the shared matrix and ordered from
50
+ * oldest to newest so `harnessCompatEntryFor()` can return the first matching
51
+ * range. The oldest entry is the catch-all floor; each matrix row contributes
52
+ * a range that ends at the NEXT row's lower bound (the last row is the current
53
+ * supported line and produces no incompatible entry).
54
+ *
55
+ * Two boundaries are worth keeping in mind: cross-core prereleases do not
56
+ * satisfy an older TUI package's semver peer range, and the official
57
+ * dsh-v0.1.5-alpha.1/.2 tags predate the setup contract required by the next
58
+ * supported TUI line, so they carry no fallback. */
59
+ declare const HARNESS_COMPAT: readonly HarnessCompatEntry[];
60
+ /** The compat entry covering the installed dsh version, or undefined when
61
+ * the harness is supported. */
62
+ declare function harnessCompatEntryFor(installed: string): HarnessCompatEntry | undefined;
63
+ /** The bundle's own version label for the gate message, read from
64
+ * package.json at runtime (never hardcoded). Falls back to the release
65
+ * line that first imposed the requirement when unreadable. */
66
+ declare function bundleVersionLabel(since: string): string;
67
+ /** The actionable compatibility notice printed when the installed harness
68
+ * falls in an incompatible range. `entry` MUST be the entry
69
+ * {@link harnessCompatEntryFor} matched for `installed`. The notice is
70
+ * advisory: DSH Loader mounts profile entries concurrently, so this row cannot
71
+ * guarantee that its output precedes another row's import failure. */
72
+ declare function incompatibleHarnessMessage(installed: string, entry: HarnessCompatEntry, profile: string): string;
73
+ /** Service provided by this plugin and injected by the TUI runner row. */
74
+ declare const TUI_STARTUP_SERVICE = "tuiStartup";
75
+ /**
76
+ * The ONE immutable Session-launch intent `--session <id-or-query>` /
77
+ * `-c, --continue` parsed. It is resolved against the official Host Session
78
+ * roster by the runner; it never replaces the exact `sessionId` identity field
79
+ * used by the internal split-Client channel.
80
+ */
81
+ type CliSessionLaunchIntent =
82
+ /** Bare `--session`, an explicitly empty value, or a whitespace-only query:
83
+ * open the Session Browser on Browse All. */
84
+ {
85
+ readonly kind: 'browse';
86
+ readonly query: string;
87
+ }
88
+ /** Any other non-blank value: resolve it as a full/listed id or a unique
89
+ * short prefix, otherwise seed the same Browser search with it. */
90
+ | {
91
+ readonly kind: 'lookup';
92
+ readonly query: string;
93
+ }
94
+ /** `-c, --continue`: continue the newest readable main Session in the
95
+ * CONFIRMED Host Workspace. */
96
+ | {
97
+ readonly kind: 'continue';
98
+ };
99
+ /** What the runner row reads from {@link TUI_STARTUP_SERVICE}. */
100
+ interface TuiStartupValues {
101
+ /** The EXACT Session identity of the internal split-Client channel. The
102
+ * public `--session` grammar never fills this field: production CLI
103
+ * launches carry {@link sessionLaunch} instead. */
104
+ sessionId?: string;
105
+ /** `--preset`, the agent preset a fresh session starts on. */
106
+ presetId?: string;
107
+ /** The public CLI Session launch intent, absent on a plain cold start. It is
108
+ * mutually exclusive with the exact fields above. */
109
+ sessionLaunch?: CliSessionLaunchIntent;
110
+ /**
111
+ * Mark the TUI required surface as mounted. `src/index.ts` calls this once
112
+ * its synchronous initialization succeeded and its async startup root is
113
+ * established. The readiness handshake registered by this row exits nonzero
114
+ * when the launcher commits readiness without it: 0.1.6 app-boot treats a
115
+ * failed `tui-app` row as an OPTIONAL plugin failure, so without this the
116
+ * explicitly requested TUI could report a successful startup that never
117
+ * mounted. Optional so structural test providers can omit it.
118
+ */
119
+ markSurfaceMounted?(): void;
120
+ }
121
+ /**
122
+ * Service provided when the invocation selects the local daemon backend
123
+ * (M6-2A). The daemon-launcher row injects it, launches exactly one foreground
124
+ * Client OS process, and waits for its real exit.
125
+ */
126
+ declare const TUI_DAEMON_STARTUP_SERVICE = "tuiDaemonStartup";
127
+ /**
128
+ * The ONE public backend selector (M6-2A). `direct` keeps the in-process TUI
129
+ * of earlier releases; `daemon` launches one foreground Client against a local
130
+ * Host. The value is chosen per cold launch from the environment override or
131
+ * the persisted Profile Config — never a CLI flag and never a hot switch.
132
+ */
133
+ type PublicBackend = 'direct' | 'daemon';
134
+ /** The public daemon management verbs (M6-2C). */
135
+ type DaemonControlVerb = 'status' | 'start' | 'stop' | 'restart' | 'logs' | 'install' | 'uninstall';
136
+ /** One immutable daemon management intent parsed by the nested CLI grammar. */
137
+ interface DaemonControlIntent {
138
+ readonly verb: DaemonControlVerb;
139
+ /** `logs` only: a validated integer in 1..1000. */
140
+ readonly lines?: number;
141
+ }
142
+ /** The client-launch arm of {@link TuiDaemonStartupValues}. */
143
+ interface TuiDaemonClientStartup {
144
+ readonly kind: 'client';
145
+ /** The public CLI Session launch intent, resolved Client-locally against the
146
+ * official Host roster (never an exact-id field). */
147
+ readonly sessionLaunch?: CliSessionLaunchIntent;
148
+ /** `--preset`, the agent preset a fresh session starts on. */
149
+ readonly presetId?: string;
150
+ /**
151
+ * The read-only public-backend choice for THIS launch: its value and whether
152
+ * the environment overrode the Profile. Carried to the Client so its Settings
153
+ * row can show the real "environment override" source WITHOUT depending on the
154
+ * deliberately-cleared `DSH_PI_TUI_BACKEND` (and never persisted).
155
+ */
156
+ readonly backendSource?: {
157
+ readonly value: PublicBackend;
158
+ readonly source: 'env' | 'profile';
159
+ };
160
+ /**
161
+ * Mark the daemon Coordinator (the launcher row) as mounted. The readiness
162
+ * handshake the daemon branch registers exits nonzero when readiness commits
163
+ * without it — i.e. the launcher row is missing, failed or pending on
164
+ * `tuiDaemonStartup`. Optional so structural test providers may omit it.
165
+ */
166
+ markCoordinatorMounted?(): void;
167
+ }
168
+ /** The management arm: no TUI, no Client, exactly one operation. */
169
+ interface TuiDaemonControlStartup {
170
+ readonly kind: 'control';
171
+ readonly control: DaemonControlIntent;
172
+ /** Same one-shot cold-ready handshake as the client arm. */
173
+ markCoordinatorMounted?(): void;
174
+ }
175
+ /** The public headless Web CLI verbs (M6 Web CLI). */
176
+ type WebControlVerb = 'status' | 'enable' | 'disable' | 'url' | 'open';
177
+ /** One immutable headless Web control intent parsed by the nested CLI grammar. */
178
+ interface WebControlIntent {
179
+ readonly verb: WebControlVerb;
180
+ }
181
+ /** The headless Web CLI arm: no TUI, no Client, no Host start. */
182
+ interface TuiWebControlStartup {
183
+ readonly kind: 'web-control';
184
+ readonly control: WebControlIntent;
185
+ /** Same one-shot cold-ready handshake as the client arm. */
186
+ markCoordinatorMounted?(): void;
187
+ }
188
+ /** What the daemon-launcher row reads from {@link TUI_DAEMON_STARTUP_SERVICE}. */
189
+ type TuiDaemonStartupValues = TuiDaemonClientStartup | TuiDaemonControlStartup | TuiWebControlStartup;
190
+ /**
191
+ * The row's Profile Config: the persisted backend selector. `.volatile()`
192
+ * projects the field into the official Settings form and keeps it live-editable
193
+ * (M6-2A writes it through the official revision-checked settings mutation); the
194
+ * selector reads it back via `config.backend.get()` at cold launch. The value is
195
+ * a plain string on purpose: an out-of-band illegal value then fails closed in
196
+ * THIS row with an explicit reason, instead of a Loader schema rejection that
197
+ * would also block an explicit environment override.
198
+ */
199
+ interface Config {
200
+ readonly backend: {
201
+ readonly get: () => string;
202
+ };
203
+ }
204
+ declare const Config: z<Config>;
205
+ /**
206
+ * Parse and provide the TUI invocation as an ordinary Cordis service. The
207
+ * command's action publishes the flags this invocation named; on `--help`
208
+ * nothing is provided, so no TUI row mounts.
209
+ * @param ctx - plugin context carrying the command line.
210
+ */
211
+ declare function apply(ctx: Context, config?: Config): void;
212
+ //#endregion
213
+ export { name as S, apply as _, HARNESS_COMPAT as a, incompatibleHarnessMessage as b, TUI_DAEMON_STARTUP_SERVICE as c, TuiDaemonControlStartup as d, TuiDaemonStartupValues as f, WebControlVerb as g, WebControlIntent as h, DaemonControlVerb as i, TUI_STARTUP_SERVICE as l, TuiWebControlStartup as m, Config as n, HarnessCompatEntry as o, TuiStartupValues as p, DaemonControlIntent as r, PublicBackend as s, CliSessionLaunchIntent as t, TuiDaemonClientStartup as u, bundleVersionLabel as v, inject as x, harnessCompatEntryFor as y };