@xmoon76/dsh-pi-tui 0.5.2-rc.1 → 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 +200 -124
- package/README.md +132 -90
- package/cordis.patch.yml +54 -50
- 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-VuoIE_Jc.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 +10 -10
- package/dist/index.mjs +52682 -30024
- 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-Dq6HoyjZ.mjs → runtime-vc4mdr-R.mjs} +1907 -1276
- package/dist/{session-DTauqYx6.mjs → session-tdJHLnJR.mjs} +3420 -339
- package/dist/{startup-CWQl0-0n.mjs → startup-JaVZoTIl.mjs} +69 -13
- package/dist/startup.d.mts +2 -2
- package/dist/startup.mjs +1 -1
- package/dist/{terminal-progress-source-Dpwz3csm.mjs → terminal-progress-source-xor3vakJ.mjs} +172 -49
- package/dist/visual-tools.d.mts +62 -0
- package/dist/visual-tools.mjs +556 -0
- package/generated/dsh-presets/README.md +1 -1
- package/generated/dsh-presets/cordis.patch.yml +8 -26
- package/generated/dsh-presets/minimal.patch.yml +17 -0
- package/generated/dsh-presets/ptc.patch.yml +8 -26
- package/generated/dsh-presets/standard.patch.yml +8 -26
- package/package.json +184 -154
- package/dist/context-summary-CxQnkDEN.mjs +0 -2478
|
@@ -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",
|
|
@@ -23,14 +23,20 @@ var dsh_compat_matrix_default = {
|
|
|
23
23
|
"target and the recovery wording. The floor and the target are distinct values and",
|
|
24
24
|
"must stay independently derived. Consumed by src/startup.ts (inlined by the bundler)",
|
|
25
25
|
"and, through scripts/lib/dsh-compat.mjs, by the release tooling, the",
|
|
26
|
-
"installation-doc gate and the release-notes tests."
|
|
26
|
+
"installation-doc gate and the release-notes tests.",
|
|
27
|
+
"package.json restates the newest row's `dshFrom` as `engines.dsh` `>=<dshFrom>`; DSH",
|
|
28
|
+
"prefers that field over the DSH peer ranges and only falls back to the peers when it",
|
|
29
|
+
"is absent, so the peers keep the npm-level fallback in sync with the same floor",
|
|
30
|
+
"rather than defining a second one. Upstream matches `engines.dsh` with prereleases",
|
|
31
|
+
"included, which is broader than npm's peer prerelease-tuple rule; an equal range does",
|
|
32
|
+
"not by itself qualify every such prerelease."
|
|
27
33
|
],
|
|
28
34
|
current: {
|
|
29
|
-
"since": "0.5.
|
|
30
|
-
"requires": "DeepSeek Harness 0.2.
|
|
31
|
-
"upgradeDsh": "0.2.
|
|
32
|
-
"upgradeCommand": "npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.
|
|
33
|
-
"guidance": "
|
|
35
|
+
"since": "0.5.4",
|
|
36
|
+
"requires": "DeepSeek Harness 0.2.1-rc.2 or later",
|
|
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."
|
|
34
40
|
},
|
|
35
41
|
floor: {
|
|
36
42
|
"below": "0.1.0-rc.8",
|
|
@@ -108,6 +114,19 @@ var dsh_compat_matrix_default = {
|
|
|
108
114
|
"dshFrom": "0.2.0-rc.2",
|
|
109
115
|
"tui": "0.5.2-rc.1",
|
|
110
116
|
"versions": ["0.2.0-rc.2"]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"dshFrom": "0.2.1-rc.1",
|
|
120
|
+
"versions": ["0.2.1-rc.1"]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"dshFrom": "0.2.1-rc.2",
|
|
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
|
+
]
|
|
111
130
|
}
|
|
112
131
|
]
|
|
113
132
|
};
|
|
@@ -120,6 +139,34 @@ var dsh_compat_matrix_default = {
|
|
|
120
139
|
* `cmdlineArgs`, providing a service that flag-configured rows inject.
|
|
121
140
|
* @module @xmoon76/dsh-pi-tui/startup
|
|
122
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
|
+
}
|
|
123
170
|
/** The installed dsh version, resolved from the launcher's real path. */
|
|
124
171
|
function installedDshVersion() {
|
|
125
172
|
const bin = process.argv[1];
|
|
@@ -288,11 +335,20 @@ function apply(ctx) {
|
|
|
288
335
|
}
|
|
289
336
|
}
|
|
290
337
|
let surfaceMounted = false;
|
|
291
|
-
ctx.get("appReady")
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
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
|
+
}
|
|
296
352
|
const options = program.opts();
|
|
297
353
|
ctx.provide(TUI_STARTUP_SERVICE, {
|
|
298
354
|
...options.session !== void 0 ? { sessionId: options.session } : {},
|
package/dist/startup.d.mts
CHANGED
|
@@ -19,8 +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.
|
|
23
|
-
*
|
|
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
|
|
24
24
|
* upgrade target — which may be NEWER than the floor — and allows its native
|
|
25
25
|
* install scripts. The already-published 0.5.0 line keeps its own
|
|
26
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-Dpwz3csm.mjs → terminal-progress-source-xor3vakJ.mjs}
RENAMED
|
@@ -1,8 +1,34 @@
|
|
|
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";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
|
+
//#region src/runtime/direct/working-directory-direct.ts
|
|
7
|
+
/**
|
|
8
|
+
* The effective directory of one live Agent's Session: the official
|
|
9
|
+
* `workingDirectory.get(session)` value when the service is mounted, else the
|
|
10
|
+
* immutable header cwd — the INITIAL committed value of that same projection,
|
|
11
|
+
* so a minimal composition without the row keeps the historical read instead
|
|
12
|
+
* of inventing a directory.
|
|
13
|
+
*
|
|
14
|
+
* @param workingDirectory - the official service, or `undefined` when the
|
|
15
|
+
* composition does not mount the row.
|
|
16
|
+
* @param agent - the exact live Agent whose Session is read.
|
|
17
|
+
* @returns the effective absolute directory, or `undefined` when neither the
|
|
18
|
+
* service nor a header cwd can answer (never a Client-side guess).
|
|
19
|
+
*/
|
|
20
|
+
function effectiveAgentCwd(workingDirectory, agent) {
|
|
21
|
+
if (workingDirectory === void 0) return agent.session.header.cwd;
|
|
22
|
+
return workingDirectory.get(agent.session);
|
|
23
|
+
}
|
|
24
|
+
/** The effective directory recorded by one official `workingDirectory`
|
|
25
|
+
* projection SNAPSHOT value: its wire view is `string | null`, where `null`
|
|
26
|
+
* is the legal "no directory recorded" state (the header had none) — an
|
|
27
|
+
* absent/foreign value reads `undefined` (unavailable), never a directory. */
|
|
28
|
+
function projectedWorkingDirectory(value) {
|
|
29
|
+
return typeof value === "string" && value !== "" ? value : void 0;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
6
32
|
//#region src/runtime/session-reader-port.ts
|
|
7
33
|
/** The official context-pressure occupancy numerator shared by both
|
|
8
34
|
* backends: `projectedTokens ?? pressureTokens` over the raw projection
|
|
@@ -790,21 +816,43 @@ const PROTOCOL_CHOICES = [
|
|
|
790
816
|
"anthropic-messages"
|
|
791
817
|
];
|
|
792
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
|
+
/**
|
|
793
834
|
* Merge the configurable-provider directory with the existing settings
|
|
794
835
|
* section into the /login option list.
|
|
795
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
|
+
*
|
|
796
843
|
* @param entries - the llm directory entries (or undefined when the llm
|
|
797
844
|
* service is absent — degrades to the official target only).
|
|
798
|
-
* @param
|
|
799
|
-
* settings
|
|
800
|
-
*
|
|
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.
|
|
801
849
|
*/
|
|
802
|
-
function providerOptionsFor(entries,
|
|
850
|
+
function providerOptionsFor(entries, readProfile) {
|
|
803
851
|
const options = [];
|
|
804
|
-
const
|
|
852
|
+
const seenRoutes = /* @__PURE__ */ new Set();
|
|
805
853
|
const push = (option) => {
|
|
806
|
-
if (
|
|
807
|
-
|
|
854
|
+
if (seenRoutes.has(option.route)) return;
|
|
855
|
+
seenRoutes.add(option.route);
|
|
808
856
|
options.push(option);
|
|
809
857
|
};
|
|
810
858
|
push({
|
|
@@ -821,10 +869,9 @@ function providerOptionsFor(entries, readSection) {
|
|
|
821
869
|
if (entries === void 0) return options;
|
|
822
870
|
for (const entry of entries) {
|
|
823
871
|
if (entry.provider.length === 0 || entry.settingsNs.length === 0) continue;
|
|
824
|
-
const
|
|
825
|
-
const
|
|
826
|
-
const
|
|
827
|
-
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;
|
|
828
875
|
const namesCredential = namedRef !== void 0 && namedRef !== "";
|
|
829
876
|
const ref = namesCredential ? namedRef : deriveKeyRef(entry.provider);
|
|
830
877
|
push({
|
|
@@ -841,42 +888,28 @@ function providerOptionsFor(entries, readSection) {
|
|
|
841
888
|
}
|
|
842
889
|
return options;
|
|
843
890
|
}
|
|
844
|
-
/**
|
|
845
|
-
*
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
|
|
849
|
-
* Kept as the settings-only fallback when the llm directory is absent. */
|
|
850
|
-
function credentialOptionsFor(providers) {
|
|
851
|
-
const options = [{
|
|
852
|
-
label: "deepseek official",
|
|
853
|
-
ref: "DEEPSEEK_API_KEY"
|
|
854
|
-
}];
|
|
855
|
-
if (providers === void 0) return options;
|
|
856
|
-
const seen = new Set(options.map((option) => option.ref));
|
|
857
|
-
for (const [route, profile] of Object.entries(providers)) {
|
|
858
|
-
const ref = profile?.apiKeyEnv;
|
|
859
|
-
if (ref === void 0 || ref === "" || seen.has(ref)) continue;
|
|
860
|
-
seen.add(ref);
|
|
861
|
-
options.push({
|
|
862
|
-
label: route,
|
|
863
|
-
ref
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
return options;
|
|
867
|
-
}
|
|
868
|
-
/** Resolve a /login or /logout argument to a credential ref. A
|
|
869
|
-
* case-insensitive llm-pi-ai route name wins, then a literal env-var-looking
|
|
870
|
-
* name (any casing, uppercased like the old behavior — `/login my_key` sets
|
|
871
|
-
* `MY_KEY`); anything else is unknown and returns undefined so the caller
|
|
872
|
-
* can list the valid options. */
|
|
873
|
-
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) {
|
|
874
896
|
const trimmed = arg.trim();
|
|
875
897
|
if (trimmed === "") return void 0;
|
|
876
898
|
const needle = trimmed.toLowerCase();
|
|
877
|
-
const route = options.find((option) => option.label.toLowerCase() === needle || option.label.split(" ")[0].toLowerCase() === needle);
|
|
878
|
-
if (route !== void 0) return
|
|
879
|
-
|
|
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
|
+
};
|
|
880
913
|
}
|
|
881
914
|
//#endregion
|
|
882
915
|
//#region src/runtime/session-lifecycle-port.ts
|
|
@@ -950,6 +983,55 @@ function clientOwnerOf(next) {
|
|
|
950
983
|
return next.client;
|
|
951
984
|
}
|
|
952
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
|
|
953
1035
|
//#region src/runtime/capability.ts
|
|
954
1036
|
/** The capabilities the experimental Remote backend serves: exactly the
|
|
955
1037
|
* ports its M3-3B assembly provides. A capability is added HERE only when its
|
|
@@ -1683,7 +1765,7 @@ async function listPiTuiHostFileReferences(agent, query, signal, deps) {
|
|
|
1683
1765
|
}))
|
|
1684
1766
|
};
|
|
1685
1767
|
}
|
|
1686
|
-
const workspaceCwd =
|
|
1768
|
+
const workspaceCwd = effectiveAgentCwd(deps.workingDirectory, agent) ?? process.cwd();
|
|
1687
1769
|
const resolved = resolvePathQuery(query, workspaceCwd, deps.environment);
|
|
1688
1770
|
const searchBase = scopeSearchBase(resolved, query, workspaceCwd, deps.environment);
|
|
1689
1771
|
const discovered = await discoverForQuery(searchBase === resolved.searchBase ? resolved : {
|
|
@@ -1716,7 +1798,7 @@ function detachIncompatible(entry) {
|
|
|
1716
1798
|
name: entry.name,
|
|
1717
1799
|
version: entry.version,
|
|
1718
1800
|
runtimeVersion: entry.runtimeVersion,
|
|
1719
|
-
|
|
1801
|
+
requirements: Object.freeze({ ...entry.requirements })
|
|
1720
1802
|
});
|
|
1721
1803
|
}
|
|
1722
1804
|
function detachError(error) {
|
|
@@ -1744,12 +1826,19 @@ function detachBundle(bundle) {
|
|
|
1744
1826
|
}));
|
|
1745
1827
|
return Object.freeze({
|
|
1746
1828
|
name: bundle.name,
|
|
1829
|
+
official: bundle.official,
|
|
1830
|
+
availability: bundle.availability,
|
|
1831
|
+
...bundle.installTarget === void 0 ? {} : { installTarget: Object.freeze({
|
|
1832
|
+
spec: bundle.installTarget.spec,
|
|
1833
|
+
version: bundle.installTarget.version
|
|
1834
|
+
}) },
|
|
1747
1835
|
...bundle.version === void 0 ? {} : { version: bundle.version },
|
|
1748
1836
|
...bundle.meta === void 0 ? {} : pickMeta(bundle.meta),
|
|
1749
1837
|
...bundle.description === void 0 ? {} : { description: bundle.description },
|
|
1750
1838
|
enabled: bundle.enabled,
|
|
1751
1839
|
installed: bundle.installed,
|
|
1752
1840
|
optional: bundle.optional,
|
|
1841
|
+
...bundle.source === void 0 ? {} : { source: bundle.source },
|
|
1753
1842
|
removable: bundle.removable,
|
|
1754
1843
|
...bundle.readOnlyReason === void 0 ? {} : { readOnlyReason: bundle.readOnlyReason },
|
|
1755
1844
|
...bundle.error === void 0 ? {} : { error: detachError(bundle.error) },
|
|
@@ -1791,16 +1880,34 @@ function detachPluginManagerSnapshot(input) {
|
|
|
1791
1880
|
exemptionWarnings: Object.freeze([...input.exemptions.warnings])
|
|
1792
1881
|
});
|
|
1793
1882
|
}
|
|
1883
|
+
function detachPackageResult(result) {
|
|
1884
|
+
return Object.freeze({
|
|
1885
|
+
exitCode: result.exitCode,
|
|
1886
|
+
output: result.output,
|
|
1887
|
+
truncated: result.truncated,
|
|
1888
|
+
...result.kind === void 0 ? {} : { kind: result.kind },
|
|
1889
|
+
...result.timedOut === void 0 ? {} : { timedOut: result.timedOut },
|
|
1890
|
+
...result.incompatible === void 0 ? {} : { incompatible: Object.freeze(result.incompatible.map(detachIncompatible)) }
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1794
1893
|
/** Map one persisted change and its observed application outcome. */
|
|
1795
1894
|
function detachChange(result) {
|
|
1796
1895
|
return Object.freeze({
|
|
1797
1896
|
changed: result.changed,
|
|
1798
1897
|
application: result.application,
|
|
1898
|
+
...result.restartReason === void 0 ? {} : { restartReason: result.restartReason },
|
|
1799
1899
|
stage: result.stage,
|
|
1800
1900
|
target: result.target,
|
|
1901
|
+
...result.enabled === void 0 ? {} : { enabled: result.enabled },
|
|
1801
1902
|
...result.error === void 0 ? {} : { error: detachError(result.error) },
|
|
1802
1903
|
...result.warnings === void 0 ? {} : { warnings: Object.freeze([...result.warnings]) },
|
|
1803
|
-
...result.bundle === void 0 ? {} : { bundle: result.bundle }
|
|
1904
|
+
...result.bundle === void 0 ? {} : { bundle: result.bundle },
|
|
1905
|
+
...result.version === void 0 ? {} : { version: result.version },
|
|
1906
|
+
...result.pendingBuilds === void 0 ? {} : { pendingBuilds: Object.freeze([...result.pendingBuilds]) },
|
|
1907
|
+
...result.approvedBuilds === void 0 ? {} : { approvedBuilds: Object.freeze([...result.approvedBuilds]) },
|
|
1908
|
+
...result.packageResult === void 0 ? {} : { packageResult: detachPackageResult(result.packageResult) },
|
|
1909
|
+
...result.registries === void 0 ? {} : { registries: Object.freeze([...result.registries]) },
|
|
1910
|
+
...result.failedAt === void 0 ? {} : { failedAt: result.failedAt }
|
|
1804
1911
|
});
|
|
1805
1912
|
}
|
|
1806
1913
|
/** Map what a spec names before installation. */
|
|
@@ -1948,6 +2055,22 @@ function createTerminalProgressInterval(onUnknownReason) {
|
|
|
1948
2055
|
};
|
|
1949
2056
|
}
|
|
1950
2057
|
//#endregion
|
|
2058
|
+
//#region src/runtime/plugin-manager-port.ts
|
|
2059
|
+
/**
|
|
2060
|
+
* One plugin mutation's result arrived after the operation's authoritative
|
|
2061
|
+
* currentness context was superseded. The write may have been applied, so this
|
|
2062
|
+
* is NOT a refusal: the caller must present the outcome as indeterminate and
|
|
2063
|
+
* let the authoritative inventory reread decide what is true. A backend
|
|
2064
|
+
* adapter raises it only when its own currentness authority proves the reply
|
|
2065
|
+
* belongs to a superseded context; this module names no transport.
|
|
2066
|
+
*/
|
|
2067
|
+
var PluginManagerStaleResultError = class extends Error {
|
|
2068
|
+
constructor(operation) {
|
|
2069
|
+
super(`pluginManager.${operation} returned after its currentness context was superseded; the authoritative inventory reread decides the outcome`);
|
|
2070
|
+
this.name = "PluginManagerStaleResultError";
|
|
2071
|
+
}
|
|
2072
|
+
};
|
|
2073
|
+
//#endregion
|
|
1951
2074
|
//#region src/runtime/remote/pi-tui-terminal-progress-contract.ts
|
|
1952
2075
|
/** The wire namespace (and Host Cordis service key) of the private stream. */
|
|
1953
2076
|
const PI_TUI_TERMINAL_PROGRESS_NAMESPACE = "piTuiTerminalProgress";
|
|
@@ -2130,4 +2253,4 @@ function createRemoteTerminalProgressSource(deps) {
|
|
|
2130
2253
|
} };
|
|
2131
2254
|
}
|
|
2132
2255
|
//#endregion
|
|
2133
|
-
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 };
|