@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { readFileSync, realpathSync } from "node:fs";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
3
|
+
import { basename, dirname, join } from "node:path";
|
|
4
4
|
import { parseCmdline } from "@deepseek-ai/dsh-cmdline";
|
|
5
5
|
//#region src/dsh-compat-matrix.json
|
|
6
6
|
var dsh_compat_matrix_default = {
|
|
@@ -15,7 +15,7 @@ var dsh_compat_matrix_default = {
|
|
|
15
15
|
"RESERVED candidate release identity this checkout carries while a promotion line is",
|
|
16
16
|
"being developed and qualified — reservation starts that release line but does not by",
|
|
17
17
|
"itself freeze product scope, and the value becomes an ordinary published fact once",
|
|
18
|
-
"the corresponding release tag is published (see docs/releasing.md). There is deliberately no second",
|
|
18
|
+
"the corresponding release tag is published (see docs/guides/releasing.md). There is deliberately no second",
|
|
19
19
|
"candidate matrix.",
|
|
20
20
|
"`floor` is the catch-all below the oldest row. `current` describes the line this",
|
|
21
21
|
"checkout ships: the release line whose identity it reserves (`since`, kept equal to",
|
|
@@ -32,11 +32,11 @@ var dsh_compat_matrix_default = {
|
|
|
32
32
|
"not by itself qualify every such prerelease."
|
|
33
33
|
],
|
|
34
34
|
current: {
|
|
35
|
-
"since": "0.5.
|
|
35
|
+
"since": "0.5.4",
|
|
36
36
|
"requires": "DeepSeek Harness 0.2.1-rc.2 or later",
|
|
37
|
-
"upgradeDsh": "0.2.1-rc.
|
|
38
|
-
"upgradeCommand": "npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.1-rc.
|
|
39
|
-
"guidance": "
|
|
37
|
+
"upgradeDsh": "0.2.1-rc.4",
|
|
38
|
+
"upgradeCommand": "npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.1-rc.4",
|
|
39
|
+
"guidance": "The published 0.5.4 release requires DeepSeek Harness 0.2.1-rc.2 or later; this checkout validates that runtime floor and targets 0.2.1-rc.4. See README.en.md for the DSH/TUI pairing table, and docs/guides/dsh-compatibility.md for compatibility/recovery rules."
|
|
40
40
|
},
|
|
41
41
|
floor: {
|
|
42
42
|
"below": "0.1.0-rc.8",
|
|
@@ -121,8 +121,12 @@ var dsh_compat_matrix_default = {
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
"dshFrom": "0.2.1-rc.2",
|
|
124
|
-
"tui": "0.5.
|
|
125
|
-
"versions": [
|
|
124
|
+
"tui": "0.5.4",
|
|
125
|
+
"versions": [
|
|
126
|
+
"0.2.1-rc.2",
|
|
127
|
+
"0.2.1-rc.3",
|
|
128
|
+
"0.2.1-rc.4"
|
|
129
|
+
]
|
|
126
130
|
}
|
|
127
131
|
]
|
|
128
132
|
};
|
|
@@ -135,6 +139,34 @@ var dsh_compat_matrix_default = {
|
|
|
135
139
|
* `cmdlineArgs`, providing a service that flag-configured rows inject.
|
|
136
140
|
* @module @xmoon76/dsh-pi-tui/startup
|
|
137
141
|
*/
|
|
142
|
+
/** Launcher-provided process role. The M4-A0 host-only entry sets `host`:
|
|
143
|
+
* that process composes the production Host rows gated on `tuiStartup` but
|
|
144
|
+
* deliberately mounts no TUI surface, so this row must not deliver the
|
|
145
|
+
* TUI-surface verdict (which would exit a healthy Host). Any other value
|
|
146
|
+
* (including unset) keeps the production TUI startup contract unchanged. */
|
|
147
|
+
const PROCESS_ROLE_ENV = "DSH_PI_TUI_ROLE";
|
|
148
|
+
/** The Host entry's own executable path, written by the entry itself. */
|
|
149
|
+
const HOST_ENTRY_ENV = "DSH_PI_TUI_HOST_ENTRY";
|
|
150
|
+
/**
|
|
151
|
+
* True only for the real M4-A0 Host entry, never for a regular CLI that merely
|
|
152
|
+
* inherited the role string. The role alone is not authoritative: the marker
|
|
153
|
+
* must name the running main module, and that module must be the internal
|
|
154
|
+
* `local-host.mjs` artifact. This prevents `DSH_PI_TUI_ROLE=host dsh --profile
|
|
155
|
+
* pi-tui` (or a child CLI spawned by a Host) from bypassing the Direct
|
|
156
|
+
* TUI-surface verdict.
|
|
157
|
+
*/
|
|
158
|
+
function isHostOnlyRole() {
|
|
159
|
+
if (process.env[PROCESS_ROLE_ENV] !== "host") return false;
|
|
160
|
+
const declaredEntry = process.env[HOST_ENTRY_ENV];
|
|
161
|
+
const mainEntry = process.argv[1];
|
|
162
|
+
if (declaredEntry === void 0 || declaredEntry === "" || mainEntry === void 0) return false;
|
|
163
|
+
try {
|
|
164
|
+
const mainReal = realpathSync(mainEntry);
|
|
165
|
+
return basename(mainReal) === "local-host.mjs" && realpathSync(declaredEntry) === mainReal;
|
|
166
|
+
} catch {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
138
170
|
/** The installed dsh version, resolved from the launcher's real path. */
|
|
139
171
|
function installedDshVersion() {
|
|
140
172
|
const bin = process.argv[1];
|
|
@@ -303,11 +335,20 @@ function apply(ctx) {
|
|
|
303
335
|
}
|
|
304
336
|
}
|
|
305
337
|
let surfaceMounted = false;
|
|
306
|
-
ctx.get("appReady")
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
338
|
+
const ready = ctx.get("appReady");
|
|
339
|
+
if (!isHostOnlyRole() && ready !== void 0) {
|
|
340
|
+
let registrationReturned = false;
|
|
341
|
+
const cancel = ready.onReady(() => {
|
|
342
|
+
if (!registrationReturned) return;
|
|
343
|
+
if (surfaceMounted) return;
|
|
344
|
+
process.stderr.write(`\n${surfaceNotMountedMessage()}\n\n`);
|
|
345
|
+
ctx.get("appExit")?.(1);
|
|
346
|
+
});
|
|
347
|
+
registrationReturned = true;
|
|
348
|
+
ctx.effect(() => () => {
|
|
349
|
+
cancel();
|
|
350
|
+
}, "tui-startup readiness handshake");
|
|
351
|
+
}
|
|
311
352
|
const options = program.opts();
|
|
312
353
|
ctx.provide(TUI_STARTUP_SERVICE, {
|
|
313
354
|
...options.session !== void 0 ? { sessionId: options.session } : {},
|
package/dist/startup.d.mts
CHANGED
|
@@ -19,7 +19,8 @@ declare const inject: string[];
|
|
|
19
19
|
* bundle's own version cannot be read, so the message stays truthful.
|
|
20
20
|
*
|
|
21
21
|
* The current line has a minimum of the published npm release
|
|
22
|
-
* dsh-v0.2.1-rc.2
|
|
22
|
+
* dsh-v0.2.1-rc.2 and a recommended upgrade target of the newer
|
|
23
|
+
* dsh-v0.2.1-rc.4. The recovery guidance names the recommended published
|
|
23
24
|
* upgrade target — which may be NEWER than the floor — and allows its native
|
|
24
25
|
* install scripts. The already-published 0.5.0 line keeps its own
|
|
25
26
|
* rc.1-era contract and remains the compatible fallback for a
|
package/dist/startup.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as harnessCompatEntryFor, c as name, i as bundleVersionLabel, n as TUI_STARTUP_SERVICE, o as incompatibleHarnessMessage, r as apply, s as inject, t as HARNESS_COMPAT } from "./startup-
|
|
1
|
+
import { a as harnessCompatEntryFor, c as name, i as bundleVersionLabel, n as TUI_STARTUP_SERVICE, o as incompatibleHarnessMessage, r as apply, s as inject, t as HARNESS_COMPAT } from "./startup-JaVZoTIl.mjs";
|
|
2
2
|
export { HARNESS_COMPAT, TUI_STARTUP_SERVICE, apply, bundleVersionLabel, harnessCompatEntryFor, incompatibleHarnessMessage, inject, name };
|
package/dist/{terminal-progress-source-BlmksrSD.mjs → terminal-progress-source-xor3vakJ.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _t as parseFooterLayout, gt as isFooterLayout } from "./extensions-CcuMY4n2.mjs";
|
|
2
2
|
import { accessSync, constants, readdirSync, statSync } from "node:fs";
|
|
3
3
|
import { delimiter, join, posix, win32 } from "node:path";
|
|
4
4
|
import { homedir } from "node:os";
|
|
@@ -816,21 +816,43 @@ const PROTOCOL_CHOICES = [
|
|
|
816
816
|
"anthropic-messages"
|
|
817
817
|
];
|
|
818
818
|
/**
|
|
819
|
+
* Project one profile value onto the merge's per-route facts: whether a
|
|
820
|
+
* profile EXISTS for the route, and the explicit `apiKeyEnv` it names.
|
|
821
|
+
* A primitive or an absent value is still a configuration fact: an absent
|
|
822
|
+
* profile is the only "not present" case.
|
|
823
|
+
*/
|
|
824
|
+
function providerProfileProjectionOf(profile) {
|
|
825
|
+
if (profile === void 0) return { present: false };
|
|
826
|
+
if (typeof profile !== "object" || profile === null) return { present: true };
|
|
827
|
+
const namedRef = profile.apiKeyEnv;
|
|
828
|
+
return {
|
|
829
|
+
present: true,
|
|
830
|
+
...typeof namedRef === "string" ? { namedRef } : {}
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
819
834
|
* Merge the configurable-provider directory with the existing settings
|
|
820
835
|
* section into the /login option list.
|
|
821
836
|
*
|
|
837
|
+
* The PROVIDER identity is the ROUTE: two routes that name the same
|
|
838
|
+
* credential reference are two providers, and both stay visible (the
|
|
839
|
+
* credential READ is deduplicated by reference later, in the read planner —
|
|
840
|
+
* not here, where the route is the identity). The deepseek official builtin
|
|
841
|
+
* leads and keeps its own route.
|
|
842
|
+
*
|
|
822
843
|
* @param entries - the llm directory entries (or undefined when the llm
|
|
823
844
|
* service is absent — degrades to the official target only).
|
|
824
|
-
* @param
|
|
825
|
-
* settings
|
|
826
|
-
*
|
|
845
|
+
* @param readProfile - project ONE route's profile facts from the adapter's
|
|
846
|
+
* single settings snapshot; undefined when the route's profile could not
|
|
847
|
+
* be read at all.
|
|
848
|
+
* @returns the merged options, deepseek official first, one entry per route.
|
|
827
849
|
*/
|
|
828
|
-
function providerOptionsFor(entries,
|
|
850
|
+
function providerOptionsFor(entries, readProfile) {
|
|
829
851
|
const options = [];
|
|
830
|
-
const
|
|
852
|
+
const seenRoutes = /* @__PURE__ */ new Set();
|
|
831
853
|
const push = (option) => {
|
|
832
|
-
if (
|
|
833
|
-
|
|
854
|
+
if (seenRoutes.has(option.route)) return;
|
|
855
|
+
seenRoutes.add(option.route);
|
|
834
856
|
options.push(option);
|
|
835
857
|
};
|
|
836
858
|
push({
|
|
@@ -847,10 +869,9 @@ function providerOptionsFor(entries, readSection) {
|
|
|
847
869
|
if (entries === void 0) return options;
|
|
848
870
|
for (const entry of entries) {
|
|
849
871
|
if (entry.provider.length === 0 || entry.settingsNs.length === 0) continue;
|
|
850
|
-
const
|
|
851
|
-
const
|
|
852
|
-
const
|
|
853
|
-
const namedRef = configured && typeof profile === "object" && profile !== null && typeof profile.apiKeyEnv === "string" ? profile.apiKeyEnv : void 0;
|
|
872
|
+
const profile = readProfile(entry);
|
|
873
|
+
const configured = profile?.present === true;
|
|
874
|
+
const namedRef = profile?.namedRef;
|
|
854
875
|
const namesCredential = namedRef !== void 0 && namedRef !== "";
|
|
855
876
|
const ref = namesCredential ? namedRef : deriveKeyRef(entry.provider);
|
|
856
877
|
push({
|
|
@@ -867,42 +888,28 @@ function providerOptionsFor(entries, readSection) {
|
|
|
867
888
|
}
|
|
868
889
|
return options;
|
|
869
890
|
}
|
|
870
|
-
/**
|
|
871
|
-
*
|
|
872
|
-
*
|
|
873
|
-
*
|
|
874
|
-
|
|
875
|
-
* Kept as the settings-only fallback when the llm directory is absent. */
|
|
876
|
-
function credentialOptionsFor(providers) {
|
|
877
|
-
const options = [{
|
|
878
|
-
label: "deepseek official",
|
|
879
|
-
ref: "DEEPSEEK_API_KEY"
|
|
880
|
-
}];
|
|
881
|
-
if (providers === void 0) return options;
|
|
882
|
-
const seen = new Set(options.map((option) => option.ref));
|
|
883
|
-
for (const [route, profile] of Object.entries(providers)) {
|
|
884
|
-
const ref = profile?.apiKeyEnv;
|
|
885
|
-
if (ref === void 0 || ref === "" || seen.has(ref)) continue;
|
|
886
|
-
seen.add(ref);
|
|
887
|
-
options.push({
|
|
888
|
-
label: route,
|
|
889
|
-
ref
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
return options;
|
|
893
|
-
}
|
|
894
|
-
/** Resolve a /login or /logout argument to a credential ref. A
|
|
895
|
-
* case-insensitive llm-pi-ai route name wins, then a literal env-var-looking
|
|
896
|
-
* name (any casing, uppercased like the old behavior — `/login my_key` sets
|
|
897
|
-
* `MY_KEY`); anything else is unknown and returns undefined so the caller
|
|
898
|
-
* can list the valid options. */
|
|
899
|
-
function resolveCredentialArg(arg, options) {
|
|
891
|
+
/** Resolve a /login or /logout argument with the SAME rules the command has
|
|
892
|
+
* always used: a route name (or a label's first word) wins, then a literal
|
|
893
|
+
* env-var-looking name (uppercased like the old behavior); anything else is
|
|
894
|
+
* unknown. */
|
|
895
|
+
function classifyCredentialArg(arg, options) {
|
|
900
896
|
const trimmed = arg.trim();
|
|
901
897
|
if (trimmed === "") return void 0;
|
|
902
898
|
const needle = trimmed.toLowerCase();
|
|
903
|
-
const route = options.find((option) => option.label.toLowerCase() === needle || option.label.split(" ")[0].toLowerCase() === needle);
|
|
904
|
-
if (route !== void 0) return
|
|
905
|
-
|
|
899
|
+
const route = options.find((option) => option.route !== void 0 && option.route.toLowerCase() === needle) ?? options.find((option) => option.label.toLowerCase() === needle || option.label.split(" ")[0].toLowerCase() === needle);
|
|
900
|
+
if (route !== void 0) return {
|
|
901
|
+
kind: "route",
|
|
902
|
+
option: route
|
|
903
|
+
};
|
|
904
|
+
const exactRef = options.find((option) => option.ref.toLowerCase() === needle);
|
|
905
|
+
if (exactRef !== void 0) return {
|
|
906
|
+
kind: "ref",
|
|
907
|
+
ref: exactRef.ref
|
|
908
|
+
};
|
|
909
|
+
if (/^[a-zA-Z][a-zA-Z0-9_]*$/.test(trimmed)) return {
|
|
910
|
+
kind: "ref",
|
|
911
|
+
ref: trimmed.toUpperCase()
|
|
912
|
+
};
|
|
906
913
|
}
|
|
907
914
|
//#endregion
|
|
908
915
|
//#region src/runtime/session-lifecycle-port.ts
|
|
@@ -976,6 +983,55 @@ function clientOwnerOf(next) {
|
|
|
976
983
|
return next.client;
|
|
977
984
|
}
|
|
978
985
|
//#endregion
|
|
986
|
+
//#region src/runtime/deliverables-port.ts
|
|
987
|
+
/** One DEFINITE read refusal the preview renders as a state (never a guess). */
|
|
988
|
+
var DeliveredFileReadError = class extends Error {
|
|
989
|
+
code;
|
|
990
|
+
constructor(code, message, options) {
|
|
991
|
+
super(message, options);
|
|
992
|
+
this.name = "DeliveredFileReadError";
|
|
993
|
+
this.code = code;
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
/**
|
|
997
|
+
* The official refusal code → the preview's semantic code.
|
|
998
|
+
*
|
|
999
|
+
* `gateway/lookup-not-found` is the generated Remote's ASSEMBLY refusal when its
|
|
1000
|
+
* Session-derived `workspaceFileScope` lookup cannot resolve the identity (a
|
|
1001
|
+
* closed/unknown Session): the preview's `session-unavailable`, never a
|
|
1002
|
+
* fabricated "Host says the file is missing".
|
|
1003
|
+
*/
|
|
1004
|
+
const OFFICIAL_CODE_MAP = {
|
|
1005
|
+
"workspace-file/not-found": "not-found",
|
|
1006
|
+
"workspace-file/not-text": "not-text",
|
|
1007
|
+
"workspace-file/not-regular-file": "not-regular-file",
|
|
1008
|
+
"workspace-file/too-large": "too-large",
|
|
1009
|
+
"gateway/lookup-not-found": "session-unavailable"
|
|
1010
|
+
};
|
|
1011
|
+
/** Whether one value is a module/instance code carrier. */
|
|
1012
|
+
function codeOf(error) {
|
|
1013
|
+
if (typeof error !== "object" || error === null) return void 0;
|
|
1014
|
+
const code = error.code;
|
|
1015
|
+
return typeof code === "string" ? code : void 0;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Map ONE official failure onto the port's vocabulary.
|
|
1019
|
+
*
|
|
1020
|
+
* A recognized `workspace-file/*` refusal becomes a definite
|
|
1021
|
+
* {@link DeliveredFileReadError}; ANYTHING else is returned as-is so the caller
|
|
1022
|
+
* keeps its own honesty (the UI reports an unknown failure and its diagnostics
|
|
1023
|
+
* channel records the cause) instead of receiving a fabricated state.
|
|
1024
|
+
* @param error - the thrown/rejected Host value.
|
|
1025
|
+
* @returns the mapped refusal, or the original error when unrecognized.
|
|
1026
|
+
*/
|
|
1027
|
+
function deliveredFileReadErrorFrom(error) {
|
|
1028
|
+
const code = codeOf(error);
|
|
1029
|
+
if (code === void 0) return error;
|
|
1030
|
+
const mapped = OFFICIAL_CODE_MAP[code];
|
|
1031
|
+
if (mapped === void 0) return error;
|
|
1032
|
+
return new DeliveredFileReadError(mapped, error instanceof Error ? error.message : `${code}`, { cause: error });
|
|
1033
|
+
}
|
|
1034
|
+
//#endregion
|
|
979
1035
|
//#region src/runtime/capability.ts
|
|
980
1036
|
/** The capabilities the experimental Remote backend serves: exactly the
|
|
981
1037
|
* ports its M3-3B assembly provides. A capability is added HERE only when its
|
|
@@ -2197,4 +2253,4 @@ function createRemoteTerminalProgressSource(deps) {
|
|
|
2197
2253
|
} };
|
|
2198
2254
|
}
|
|
2199
2255
|
//#endregion
|
|
2200
|
-
export {
|
|
2256
|
+
export { activeFooterItemIds as $, deliveredFileReadErrorFrom as A, deriveKeyRef as B, classifySubagentPromptSettlement as C, DIRECT_IMPLEMENTED_CAPABILITIES as D, isRemoteBusinessRefusalCode as E, requireCreated as F, rankPathCandidates as G, providerOptionsFor as H, requireOpened as I, separatorOfRaw as J, reattachDisplayBase as K, PROTOCOL_CHOICES as L, clientOwnerOf as M, directAgentOf as N, REMOTE_IMPLEMENTED_CAPABILITIES as O, ownerHandleOf as P, DEFAULT_CUSTOM_COMMAND_REFRESH_MS as Q, ROUTE_PATTERN as R, detachedTurnOutline as S, GATEWAY_PRE_INVOCATION_CODES as T, providerProfileProjectionOf as U, getPath as V, SupersededReadError as W, escapeFinderRegex as X, discoverForQuery as Y, normalizeFinderRecords as Z, QUESTION_BAD_ANSWER as _, PluginManagerStaleResultError as a, executableCommandItemIds as at, questionAnswerError as b, detachInspection as c, parseFooterCommandConfig as ct, detachPluginManagerSnapshot as d, resolveUserCommandItemFallbackActivationIds as dt, customCommandConfigOf as et, pluginInstallRequestId as f, resolveUserLayerFooterMode as ft, resolveFdPath as g, projectedWorkingDirectory as gt, hostPathQueryEnvironment as h, effectiveAgentCwd as ht, PI_TUI_TERMINAL_PROGRESS_WATCH as i, effectiveCustomCommandTimeoutMs as it, LifecycleError as j, DeliveredFileReadError as k, detachLog as l, resolveTrustedFooterCommand as lt, DirectHostDiscoveryDriver as m, contextPressureOccupancy as mt, createRemoteTerminalProgressSource as n, customItemName as nt, createTerminalProgressInterval as o, parseFooterCustomItem as ot, listPiTuiHostFileReferences as p, MAX_COMMAND_TIMEOUT_MS as pt, resolvePathQuery as q, PI_TUI_TERMINAL_PROGRESS_NAMESPACE as r, effectiveCustomCommandRefreshMs as rt, detachChange as s, parseFooterCustomItems as st, consumeRemoteTerminalProgress as t, customItemId as tt, detachPhase as u, resolveUserCommandItemActivationIds as ut, QUESTION_REPLY_QUEUED as v, safeSubagentErrorMessage as w, detachedSessionStatus as x, QuestionAnswerError as y, classifyCredentialArg as z };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Context, Volatile } from "@deepseek-ai/cordis";
|
|
2
|
+
import z from "@deepseek-ai/schemastery";
|
|
3
|
+
|
|
4
|
+
//#region src/app/host/visual-tools.d.ts
|
|
5
|
+
/** Stable Cordis plugin name (the Loader row id in `cordis.patch.yml`). */
|
|
6
|
+
declare const name = "pi-tui-visual-tools";
|
|
7
|
+
/**
|
|
8
|
+
* The Host services this row uses: the registry it owns, the live Agent (the
|
|
9
|
+
* executing Session identity) and the official Session read service that
|
|
10
|
+
* returns a committed observation.
|
|
11
|
+
*/
|
|
12
|
+
declare const inject: string[];
|
|
13
|
+
/**
|
|
14
|
+
* The two stable, namespaced generating tool names.
|
|
15
|
+
*
|
|
16
|
+
* These stay DEFINED here (not re-exported from `domain/visual/tools.ts`) for two
|
|
17
|
+
* reasons: `@xmoon76/dsh-pi-tui/visual-tools` has publicly exported them since the
|
|
18
|
+
* row shipped, so removing them would be a breaking change to a published entry,
|
|
19
|
+
* and a re-export would add the domain module's declaration region to the
|
|
20
|
+
* packaged `dist/visual-tools.d.mts`. They are compile-time literals, so the
|
|
21
|
+
* domain's copy is the same value and the two can never disagree at runtime.
|
|
22
|
+
*/
|
|
23
|
+
declare const CHART_TOOL_NAME = "dsh_pi_tui_chart";
|
|
24
|
+
declare const SVG_TOOL_NAME = "dsh_pi_tui_svg";
|
|
25
|
+
/**
|
|
26
|
+
* The row's profile-wide availability switch. `enabled` is a volatile field:
|
|
27
|
+
* the Settings service projects it into an editable form section, and a write
|
|
28
|
+
* is committed into this live reference without remounting the row. The
|
|
29
|
+
* default is ON, so an existing profile needs no migration.
|
|
30
|
+
*/
|
|
31
|
+
interface Config {
|
|
32
|
+
readonly enabled: Volatile<boolean>;
|
|
33
|
+
}
|
|
34
|
+
/** The Config schema the Loader resolves (default ON, live form field). */
|
|
35
|
+
declare const Config: z<Config>;
|
|
36
|
+
/**
|
|
37
|
+
* Register this Host row: reconcile the three tool registrations with the
|
|
38
|
+
* `enabled` Config reference at mount and after every volatile commit.
|
|
39
|
+
*
|
|
40
|
+
* `ctx.reflect.get` is the documented permanent-Host-plane idiom
|
|
41
|
+
* (`docs/architecture/host-client.md`): this module IS the Host plane, so the
|
|
42
|
+
* registry read is not Client-side coupling and the client-boundary inventory
|
|
43
|
+
* stays inside the existing baseline. The explicit `inject` above guarantees
|
|
44
|
+
* every service.
|
|
45
|
+
*
|
|
46
|
+
* The Loader commits every volatile value BEFORE it dispatches
|
|
47
|
+
* `loader/volatile-update`, so the listener must read the reference (never the
|
|
48
|
+
* event payload) and ignore unrelated paths. A throwing listener is contained
|
|
49
|
+
* by the Loader: the write stays committed, and the next read of
|
|
50
|
+
* {@link VISUAL_TOOLS_STATUS_SERVICE} proves the registration did not follow.
|
|
51
|
+
*
|
|
52
|
+
* Reconciliation is SERIALIZED: a `tools/change` listener may synchronously
|
|
53
|
+
* write the Config back from inside a registration/disposal callback, so that
|
|
54
|
+
* request is queued and applied after the current transition reaches a
|
|
55
|
+
* consistent group instead of interleaving two transitions.
|
|
56
|
+
*
|
|
57
|
+
* @param ctx - the Host context that owns this row's fiber.
|
|
58
|
+
* @param config - the resolved Config (the live `enabled` reference).
|
|
59
|
+
*/
|
|
60
|
+
declare function apply(ctx: Context, config: Config): void;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { CHART_TOOL_NAME, Config, SVG_TOOL_NAME, apply, inject, name };
|