@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.
- package/LICENSE +33 -0
- package/README.en.md +103 -814
- package/README.md +102 -711
- package/cordis.patch.yml +186 -0
- package/dist/acp-preferences.d.mts +29 -0
- package/dist/acp-preferences.mjs +15 -0
- package/dist/{bootstrap-DQ4YPL-7.mjs → bootstrap-CMIjGyuk.mjs} +33515 -7587
- package/dist/builtins.mjs +3 -3
- package/dist/{client-bootstrap-Cr1JCaF5.mjs → client-bootstrap-BjGPc-DM.mjs} +4637 -492
- package/dist/client-extension-loader-probe-BUw7q8bJ.mjs +119 -0
- package/dist/command-trust-DChWUamk.mjs +406 -0
- package/dist/daemon-launcher-Dult7Jxv.mjs +1932 -0
- package/dist/daemon-launcher.d.mts +159 -0
- package/dist/daemon-launcher.mjs +2 -0
- package/dist/diagnostics-D5jwc-q1.d.mts +11 -0
- package/dist/{dist-CIsR7cz4.mjs → dist-BFgC-5tL.mjs} +938 -487
- package/dist/entry-control-DjNsE3I0.mjs +190 -0
- package/dist/extension/advanced.d.mts +1 -1
- package/dist/extension/unstable.d.mts +1 -1
- package/dist/extension-config-probe-BDdvutkG.mjs +95 -0
- package/dist/extension-config.d.mts +29 -0
- package/dist/extension-config.mjs +22 -0
- package/dist/{extensions-Bp0L37lP.mjs → extensions-B4uLpSTv.mjs} +1109 -100
- package/dist/{extensions-Bte3XOt5.d.mts → extensions-C8eAM0gX.d.mts} +1 -1
- package/dist/extensions.d.mts +2 -2
- package/dist/extensions.mjs +1 -1
- package/dist/{host-bootstrap-DilsvA6f.mjs → host-bootstrap-MVxks641.mjs} +129 -24
- package/dist/{host-foundation-probe--5jtvHVe.mjs → host-foundation-probe-DMNTmNrH.mjs} +2 -2
- package/dist/host-runtime.d.mts +11 -5
- package/dist/host-runtime.mjs +4171 -920
- package/dist/index.d.mts +86 -174
- package/dist/index.mjs +38087 -9967
- package/dist/local-acp-listener-B65J0Bx4.mjs +3115 -0
- package/dist/local-client.mjs +1158 -59
- package/dist/local-daemon-control-C14q9KnD.mjs +1588 -0
- package/dist/local-daemon-control-TCnERL7n.mjs +1424 -0
- package/dist/local-discovery-DOSsCh9q.mjs +2883 -0
- package/dist/local-discovery-egN4_gsQ.mjs +2 -0
- package/dist/local-discovery-uOBfFq5j.mjs +2764 -0
- package/dist/local-host.mjs +812 -89
- package/dist/local-profile-daemon-admin-BmQSdzT0.mjs +210 -0
- package/dist/local-scope-DamiMqPd.mjs +1340 -0
- package/dist/{local-transport-BVwFYq_Y.mjs → local-transport-Iwo0mtu3.mjs} +313 -38
- package/dist/local-web-control-DMrjwCkl.mjs +454 -0
- package/dist/local-workspace-object-D06GL0UO.mjs +248 -0
- package/dist/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
- package/dist/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
- package/dist/open-CmOBxSjN.mjs +63 -0
- package/dist/persisted-setting-probe-DWZLtWoB.mjs +145 -0
- package/dist/pi-tui-acp-access-contract-BdLwduU6.mjs +75 -0
- package/dist/pi-tui-remote-contribution-Do8ECrUy.mjs +1492 -0
- package/dist/pi-tui-terminal-progress-contract-B3RoEzjK.mjs +146 -0
- package/dist/preferences.d.mts +17 -0
- package/dist/preferences.mjs +20 -0
- package/dist/preset-BcWqOtY7.mjs +46 -0
- package/dist/profile-preferences-migration-BfUGdPZx.mjs +500 -0
- package/dist/profile-preferences-migration-CThz4rHH.mjs +2 -0
- package/dist/prompt-sections-DUKmWb8g.mjs +2232 -0
- package/dist/prompt-sections-DXmjB58H.mjs +634 -0
- package/dist/{public-types-Dgf1bDke.d.mts → public-types-C1YgFtwC.d.mts} +56 -3
- package/dist/row-id-DPbyt9Nn.mjs +24 -0
- package/dist/{runtime-status-Cj1nFOdS.mjs → runtime-status-v-FTnWcD.mjs} +49 -3
- package/dist/schema-BTGYn8_X.d.mts +54 -0
- package/dist/schema-qE_P09zJ.mjs +124 -0
- package/dist/{session-BKGXyh80.mjs → session-C6tSs86s.mjs} +9672 -7270
- package/dist/{session-CPt_U8_f.mjs → session-CstInGIA.mjs} +9674 -7273
- package/dist/startup-CarQxWwi.d.mts +213 -0
- package/dist/{startup-7BYWuvBU.mjs → startup-EG5UqIcd.mjs} +341 -26
- package/dist/startup.d.mts +2 -99
- package/dist/startup.mjs +2 -2
- package/dist/{terminal-progress-source-DrqQhtT8.mjs → terminal-progress-source-CpfpQO_h.mjs} +2038 -67
- package/dist/{pasted-path-range-CMnxuGPx.mjs → transcript-view-C1YtJ49Y.mjs} +11590 -6718
- package/dist/{pasted-path-range-r6qzV_tC.mjs → transcript-view-CuJYWkhp.mjs} +12296 -6923
- package/dist/version-B9yC7bBk.mjs +83 -0
- package/dist/visual-tools.d.mts +1 -1
- package/dist/visual-tools.mjs +1 -1
- package/dist/web-preferences.d.mts +1 -1
- package/dist/{web-roster-CjqnUXNk.mjs → web-roster-Dis7BhrA.mjs} +63 -3
- package/generated/dsh-presets/cordis.patch.yml +4 -2
- package/generated/dsh-presets/ptc.patch.yml +4 -0
- package/generated/dsh-presets/standard.patch.yml +7 -0
- package/generated/web-access/cordis.patch.yml +239 -0
- package/package.json +217 -170
- package/dist/entry-control-DnduyDiw.mjs +0 -92
- package/dist/local-discovery-C9VMjc0K.mjs +0 -759
- package/dist/local-discovery-CDaQHA_R.mjs +0 -2
- package/dist/pi-tui-remote-contribution-B0EQsP0N.mjs +0 -85
- package/dist/pi-tui-terminal-progress-contract-CdBH9j78.mjs +0 -70
- package/dist/pi-tui-terminal-progress-contract-MLXZ-i3t.mjs +0 -905
- package/dist/version-a-eF-QER.mjs +0 -80
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
//#region src/runtime/host-user-shell-port.ts
|
|
2
|
+
/** A started Remote run lost its terminal fact; automatic replay is forbidden. */
|
|
3
|
+
var HostUserShellOutcomeUnknownError = class extends Error {
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = "HostUserShellOutcomeUnknownError";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
/** The Host proved the sandbox runner/enforcement failed for this run. */
|
|
10
|
+
var HostUserShellSandboxRunnerError = class extends Error {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "HostUserShellSandboxRunnerError";
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
/** The retained-tail bound of one settled stream. It is the semantic result
|
|
17
|
+
* bound shared by the Host mapping, the private wire decoder and the
|
|
18
|
+
* application's Session text. */
|
|
19
|
+
const MAX_HOST_USER_SHELL_STREAM_BYTES = 65536;
|
|
20
|
+
/** Bound on one refusal/failure message carried back to the Client. */
|
|
21
|
+
const MAX_HOST_USER_SHELL_MESSAGE_BYTES = 2048;
|
|
22
|
+
/** Bound on a Host-local spill path carried as a semantic fact. */
|
|
23
|
+
const MAX_HOST_USER_SHELL_SPILL_PATH_BYTES = 4096;
|
|
24
|
+
/** Total output budget of one settled result across BOTH streams. One stream
|
|
25
|
+
* may use the full per-stream cap; the other is then tail-clamped to the
|
|
26
|
+
* remainder, so the Session text can never grow with two independent caps. */
|
|
27
|
+
const MAX_HOST_USER_SHELL_RESULT_BYTES = 98304;
|
|
28
|
+
function tailOnCodePoint(bytes, maxBytes) {
|
|
29
|
+
if (bytes.length <= maxBytes) return {
|
|
30
|
+
text: bytes.toString("utf8"),
|
|
31
|
+
truncated: false
|
|
32
|
+
};
|
|
33
|
+
let start = bytes.length - maxBytes;
|
|
34
|
+
while (start < bytes.length && (bytes[start] & 192) === 128) start += 1;
|
|
35
|
+
return {
|
|
36
|
+
text: bytes.subarray(start).toString("utf8"),
|
|
37
|
+
truncated: true
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Map one executor-collected stream to the bounded semantic output. The
|
|
42
|
+
* executor's own truncation fact is preserved; a stream larger than the
|
|
43
|
+
* semantic bound is clamped to its tail and marked truncated here.
|
|
44
|
+
* @param output - the executor's collected output for one stream.
|
|
45
|
+
* @param maxBytes - retained-tail bound (defaults to the per-stream cap).
|
|
46
|
+
* @returns the bounded semantic output.
|
|
47
|
+
*/
|
|
48
|
+
function boundedHostUserShellOutput(output, maxBytes = MAX_HOST_USER_SHELL_STREAM_BYTES) {
|
|
49
|
+
const bounded = tailOnCodePoint(Buffer.from(output.text, "utf8"), maxBytes);
|
|
50
|
+
return {
|
|
51
|
+
text: bounded.text,
|
|
52
|
+
truncated: output.truncated || bounded.truncated,
|
|
53
|
+
...output.spillPath === void 0 ? {} : { spillPath: output.spillPath }
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Apply the TOTAL result budget across both streams. The per-stream caps are
|
|
58
|
+
* independent; when both are large the second stream (stderr) is tail-clamped
|
|
59
|
+
* to the remaining total budget and marked truncated, so one Session row can
|
|
60
|
+
* never carry two full per-stream caps.
|
|
61
|
+
* @param stdout - already per-stream bounded stdout.
|
|
62
|
+
* @param stderr - already per-stream bounded stderr.
|
|
63
|
+
* @returns the pair that satisfies the total result bound.
|
|
64
|
+
*/
|
|
65
|
+
function boundedHostUserShellResultStreams(stdout, stderr) {
|
|
66
|
+
const stdoutBytes = Buffer.byteLength(stdout.text, "utf8");
|
|
67
|
+
if (stdoutBytes + Buffer.byteLength(stderr.text, "utf8") <= 98304) return {
|
|
68
|
+
stdout,
|
|
69
|
+
stderr
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
stdout,
|
|
73
|
+
stderr: boundedHostUserShellOutput(stderr, Math.max(0, MAX_HOST_USER_SHELL_RESULT_BYTES - stdoutBytes))
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/runtime/remote/pi-tui-terminal-progress-contract.ts
|
|
78
|
+
/** The wire namespace (and Host Cordis service key) of the private stream. */
|
|
79
|
+
const PI_TUI_TERMINAL_PROGRESS_NAMESPACE = "piTuiTerminalProgress";
|
|
80
|
+
/** The private method's stable endpoint identity. */
|
|
81
|
+
const PI_TUI_TERMINAL_PROGRESS_WATCH_ENDPOINT = "@xmoon76/dsh-pi-tui#piTuiTerminalProgress/watch";
|
|
82
|
+
/** One strict JSON codec that validates a wire string. */
|
|
83
|
+
function stringCodec(typeSymbol) {
|
|
84
|
+
return {
|
|
85
|
+
mode: "strict",
|
|
86
|
+
typeSymbol,
|
|
87
|
+
create: () => ({ parse: (value) => {
|
|
88
|
+
if (typeof value !== "string") throw new TypeError(`${typeSymbol}: the wire value must be a string`);
|
|
89
|
+
return value;
|
|
90
|
+
} })
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Validate and detach one `PiTuiTerminalProgressFrame`. This is the ONE
|
|
95
|
+
* structural validator of the frame shape: the descriptor's `result` codec
|
|
96
|
+
* uses it, and the R2 Client source must call it on every downlink item because
|
|
97
|
+
* the framework does not (see the module JSDoc).
|
|
98
|
+
*/
|
|
99
|
+
function parsePiTuiTerminalProgressFrame(value) {
|
|
100
|
+
if (typeof value !== "object" || value === null) throw new TypeError("piTuiTerminalProgress/watch: the frame must be an object");
|
|
101
|
+
const frame = value;
|
|
102
|
+
if (frame.kind !== "snapshot" && frame.kind !== "update") throw new TypeError("piTuiTerminalProgress/watch: the frame kind must be snapshot or update");
|
|
103
|
+
if (typeof frame.sessionId !== "string") throw new TypeError("piTuiTerminalProgress/watch: the frame needs a string sessionId");
|
|
104
|
+
if (typeof frame.hostEpoch !== "string") throw new TypeError("piTuiTerminalProgress/watch: the frame needs a string hostEpoch");
|
|
105
|
+
if (typeof frame.agentEpoch !== "number") throw new TypeError("piTuiTerminalProgress/watch: the frame needs a numeric agentEpoch");
|
|
106
|
+
if (typeof frame.revision !== "number") throw new TypeError("piTuiTerminalProgress/watch: the frame needs a numeric revision");
|
|
107
|
+
if (typeof frame.running !== "boolean") throw new TypeError("piTuiTerminalProgress/watch: the frame needs a boolean running");
|
|
108
|
+
if (frame.outcome !== "idle" && frame.outcome !== "done" && frame.outcome !== "error") throw new TypeError("piTuiTerminalProgress/watch: the frame outcome must be idle, done or error");
|
|
109
|
+
return {
|
|
110
|
+
kind: frame.kind,
|
|
111
|
+
sessionId: frame.sessionId,
|
|
112
|
+
hostEpoch: frame.hostEpoch,
|
|
113
|
+
agentEpoch: frame.agentEpoch,
|
|
114
|
+
revision: frame.revision,
|
|
115
|
+
running: frame.running,
|
|
116
|
+
outcome: frame.outcome
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const PI_TUI_TERMINAL_PROGRESS_FRAME_CODEC = {
|
|
120
|
+
mode: "strict",
|
|
121
|
+
typeSymbol: "@xmoon76/dsh-pi-tui#piTuiTerminalProgress/watch:frame",
|
|
122
|
+
create: () => ({ parse: parsePiTuiTerminalProgressFrame }),
|
|
123
|
+
decode: parsePiTuiTerminalProgressFrame
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* The ONE shared invocation descriptor both contributions derive from. The
|
|
127
|
+
* Host registers this exact object; the Client mounts this exact object.
|
|
128
|
+
*/
|
|
129
|
+
const PI_TUI_TERMINAL_PROGRESS_WATCH = {
|
|
130
|
+
id: PI_TUI_TERMINAL_PROGRESS_WATCH_ENDPOINT,
|
|
131
|
+
service: PI_TUI_TERMINAL_PROGRESS_NAMESPACE,
|
|
132
|
+
namespace: PI_TUI_TERMINAL_PROGRESS_NAMESPACE,
|
|
133
|
+
method: "watch",
|
|
134
|
+
mode: "stream",
|
|
135
|
+
invocation: { kind: "direct" },
|
|
136
|
+
parameters: [{
|
|
137
|
+
name: "sessionId",
|
|
138
|
+
wire: "sessionId",
|
|
139
|
+
source: "json",
|
|
140
|
+
codec: stringCodec("@xmoon76/dsh-pi-tui#piTuiTerminalProgress/watch:sessionId")
|
|
141
|
+
}],
|
|
142
|
+
cancellation: { parameter: "signal" },
|
|
143
|
+
result: PI_TUI_TERMINAL_PROGRESS_FRAME_CODEC
|
|
144
|
+
};
|
|
145
|
+
//#endregion
|
|
146
|
+
export { HostUserShellSandboxRunnerError as a, MAX_HOST_USER_SHELL_SPILL_PATH_BYTES as c, boundedHostUserShellResultStreams as d, HostUserShellOutcomeUnknownError as i, MAX_HOST_USER_SHELL_STREAM_BYTES as l, PI_TUI_TERMINAL_PROGRESS_WATCH as n, MAX_HOST_USER_SHELL_MESSAGE_BYTES as o, parsePiTuiTerminalProgressFrame as r, MAX_HOST_USER_SHELL_RESULT_BYTES as s, PI_TUI_TERMINAL_PROGRESS_NAMESPACE as t, boundedHostUserShellOutput as u };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { n as PreferencesConfig } from "./schema-BTGYn8_X.mjs";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
|
|
4
|
+
//#region src/app/config/preferences.d.ts
|
|
5
|
+
/** Stable Cordis plugin name (the Loader row id in `cordis.patch.yml`). */
|
|
6
|
+
declare const name = "pi-tui-preferences";
|
|
7
|
+
/** The canonical service key every consumer injects. */
|
|
8
|
+
declare const PI_TUI_PREFERENCES_SERVICE = "piTuiPreferences";
|
|
9
|
+
/**
|
|
10
|
+
* Publish the live preference references and hide the row's auto page.
|
|
11
|
+
*
|
|
12
|
+
* @param ctx - the Host/Direct context this row is mounted in.
|
|
13
|
+
* @param config - the resolved preference document (live volatile references).
|
|
14
|
+
*/
|
|
15
|
+
declare function apply(ctx: Context, config: PreferencesConfig): void;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { PreferencesConfig as Config, PI_TUI_PREFERENCES_SERVICE, apply, name };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { r as PreferencesConfig } from "./schema-qE_P09zJ.mjs";
|
|
2
|
+
//#region src/app/config/preferences.ts
|
|
3
|
+
/** Stable Cordis plugin name (the Loader row id in `cordis.patch.yml`). */
|
|
4
|
+
const name = "pi-tui-preferences";
|
|
5
|
+
/** The canonical service key every consumer injects. */
|
|
6
|
+
const PI_TUI_PREFERENCES_SERVICE = "piTuiPreferences";
|
|
7
|
+
/**
|
|
8
|
+
* Publish the live preference references and hide the row's auto page.
|
|
9
|
+
*
|
|
10
|
+
* @param ctx - the Host/Direct context this row is mounted in.
|
|
11
|
+
* @param config - the resolved preference document (live volatile references).
|
|
12
|
+
*/
|
|
13
|
+
function apply(ctx, config) {
|
|
14
|
+
ctx.provide(PI_TUI_PREFERENCES_SERVICE, config);
|
|
15
|
+
ctx.inject(["settings"], (child) => {
|
|
16
|
+
child.effect(() => child.settings.configure({ auto: false }, ctx.fiber));
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { PreferencesConfig as Config, PI_TUI_PREFERENCES_SERVICE, apply, name };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/domain/display/preset.ts
|
|
2
|
+
/** Whether a value is one of the complete display preset names. */
|
|
3
|
+
function isDisplayPreset(value) {
|
|
4
|
+
return value === "focus" || value === "compact" || value === "full";
|
|
5
|
+
}
|
|
6
|
+
/** Every preset whose projection exists in this build ships as available. */
|
|
7
|
+
function isDisplayPresetAvailable(preset) {
|
|
8
|
+
return preset === "focus" || preset === "compact" || preset === "full";
|
|
9
|
+
}
|
|
10
|
+
/** Whether a preset enables the model-facing Focus behavioral policy. The
|
|
11
|
+
* neutral behavioral answer is exactly the preset identity — it must never
|
|
12
|
+
* depend on the terminal disclosure policy. */
|
|
13
|
+
function isFocusDisplayPreset(preset) {
|
|
14
|
+
return preset === "focus";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the canonical field before the legacy Focus field. Every recognized
|
|
18
|
+
* preset (Compact included) is canonical as of PR3 and is never rewritten; an
|
|
19
|
+
* unrecognized value falls back to Full.
|
|
20
|
+
*/
|
|
21
|
+
function resolveDisplayPreset(input) {
|
|
22
|
+
if (input.displayPreset !== void 0) {
|
|
23
|
+
if (isDisplayPreset(input.displayPreset)) return {
|
|
24
|
+
preset: input.displayPreset,
|
|
25
|
+
canonicalize: false,
|
|
26
|
+
source: "canonical"
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
preset: "full",
|
|
30
|
+
canonicalize: true,
|
|
31
|
+
source: "invalid-canonical"
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (input.focusMode === "on") return {
|
|
35
|
+
preset: "focus",
|
|
36
|
+
canonicalize: true,
|
|
37
|
+
source: "legacy-focus"
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
preset: "full",
|
|
41
|
+
canonicalize: true,
|
|
42
|
+
source: "legacy-full"
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { resolveDisplayPreset as i, isDisplayPresetAvailable as n, isFocusDisplayPreset as r, isDisplayPreset as t };
|