@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.
Files changed (39) hide show
  1. package/README.en.md +200 -124
  2. package/README.md +132 -90
  3. package/cordis.patch.yml +54 -50
  4. package/dist/builtins.mjs +2 -2
  5. package/dist/client-bootstrap-F5DHFI9t.mjs +5576 -0
  6. package/dist/context-summary-DAisTA_7.mjs +8557 -0
  7. package/dist/dispose-cause-CNFuUnjR.mjs +24 -0
  8. package/dist/entry-control-DvSrndWd.mjs +111 -0
  9. package/dist/extension/advanced.d.mts +1 -1
  10. package/dist/extension/unstable.d.mts +1 -1
  11. package/dist/{extensions-DzpBiiYb.d.mts → extensions-Bte3XOt5.d.mts} +1 -1
  12. package/dist/{extensions-VuoIE_Jc.mjs → extensions-CcuMY4n2.mjs} +722 -324
  13. package/dist/extensions.d.mts +2 -2
  14. package/dist/extensions.mjs +1 -1
  15. package/dist/host-bootstrap-DAgKknbY.mjs +119 -0
  16. package/dist/index.d.mts +10 -10
  17. package/dist/index.mjs +52682 -30024
  18. package/dist/local-client.mjs +323 -0
  19. package/dist/local-host.mjs +176 -0
  20. package/dist/{performance-host-BJT6scGF.mjs → performance-host-CcDJjjVA.mjs} +1 -1
  21. package/dist/performance-host.mjs +1 -1
  22. package/dist/{performance-view-jvvd8Jn7.mjs → performance-view-CfGvLZyD.mjs} +1 -1
  23. package/dist/{public-types-gZi3iFNh.d.mts → public-types-Dgf1bDke.d.mts} +3 -3
  24. package/dist/runtime-status-0lp9CM0V.mjs +1923 -0
  25. package/dist/{runtime-Dq6HoyjZ.mjs → runtime-vc4mdr-R.mjs} +1907 -1276
  26. package/dist/{session-DTauqYx6.mjs → session-tdJHLnJR.mjs} +3420 -339
  27. package/dist/{startup-CWQl0-0n.mjs → startup-JaVZoTIl.mjs} +69 -13
  28. package/dist/startup.d.mts +2 -2
  29. package/dist/startup.mjs +1 -1
  30. package/dist/{terminal-progress-source-Dpwz3csm.mjs → terminal-progress-source-xor3vakJ.mjs} +172 -49
  31. package/dist/visual-tools.d.mts +62 -0
  32. package/dist/visual-tools.mjs +556 -0
  33. package/generated/dsh-presets/README.md +1 -1
  34. package/generated/dsh-presets/cordis.patch.yml +8 -26
  35. package/generated/dsh-presets/minimal.patch.yml +17 -0
  36. package/generated/dsh-presets/ptc.patch.yml +8 -26
  37. package/generated/dsh-presets/standard.patch.yml +8 -26
  38. package/package.json +184 -154
  39. package/dist/context-summary-CxQnkDEN.mjs +0 -2478
@@ -1,3 +1,3 @@
1
- import { $ as TuiKeybindingContribution, A as PiTuiSlotSemantic, B as TextView, C as InputWidget, D as PiTuiApiInfo, E as NormalizedKey, F as SpacerView, G as TuiAutocompleteQuery, H as TuiAction, I as StackView, J as TuiColorPalette, K as TuiAutocompleteRegistryView, L as StyledSpan, M as RegistrationSpec, N as RowsView, O as PiTuiCapability, P as SessionSnapshot, Q as TuiCommandHandle, R as SurfaceSnapshot, S as HeaderBadge, T as MessagePresentationSnapshot, U as TuiAutocompleteItem, V as ToolPresentationSnapshot, W as TuiAutocompleteProvider, X as TuiCommandBridgeView, Y as TuiCommandBridgeSnapshot, Z as TuiCommandContribution, _t as TuiThemeRegistrySnapshot, a as ContributionHealth, at as TuiOverlayHandle, b as FooterSegment, bt as describeKey, c as DockItem, ct as TuiRendererRegistrySnapshot, d as EditorHost, dt as TuiSettingHandle, et as TuiKeybindingHandle, f as EditorHostAction, ft as TuiSettingsRegistrySnapshot, g as ExtensionEditor, gt as TuiThemeHandle, h as EditorSnapshot, ht as TuiThemeContribution, i as AutocompleteProviderContribution, it as TuiMessageRendererContribution, j as RegistrationHandle, k as PiTuiSlotName, l as EditorContribution, m as EditorInputEvent, mt as TuiSizeValue, n as ActivitySnapshot, nt as TuiKeybindingRegistryView, o as ContributionRecord, ot as TuiOverlayOptions, p as EditorHostActionResult, pt as TuiSettingsRegistryView, q as TuiAutocompleteSuggestions, r as AutocompleteHandle, rt as TuiLocalCommandHandler, s as ContributionState, st as TuiRendererHandle, t as API_VERSION, tt as TuiKeybindingRegistrySnapshot, u as EditorHandle, ut as TuiSettingContribution, v as ExtensionView, vt as TuiThemeRegistryView, w as MarkdownView, x as FrameView, y as FooterItemContribution, yt as TuiToolRendererContribution, z as SurfaceStateValues } from "./public-types-gZi3iFNh.mjs";
2
- import { a as PiTuiExtensionService, i as PI_TUI_EXTENSIONS_SERVICE, n as inject, r as name, t as apply } from "./extensions-DzpBiiYb.mjs";
1
+ import { $ as TuiKeybindingContribution, A as PiTuiSlotSemantic, B as TextView, C as InputWidget, D as PiTuiApiInfo, E as NormalizedKey, F as SpacerView, G as TuiAutocompleteQuery, H as TuiAction, I as StackView, J as TuiColorPalette, K as TuiAutocompleteRegistryView, L as StyledSpan, M as RegistrationSpec, N as RowsView, O as PiTuiCapability, P as SessionSnapshot, Q as TuiCommandHandle, R as SurfaceSnapshot, S as HeaderBadge, T as MessagePresentationSnapshot, U as TuiAutocompleteItem, V as ToolPresentationSnapshot, W as TuiAutocompleteProvider, X as TuiCommandBridgeView, Y as TuiCommandBridgeSnapshot, Z as TuiCommandContribution, _t as TuiThemeRegistrySnapshot, a as ContributionHealth, at as TuiOverlayHandle, b as FooterSegment, bt as describeKey, c as DockItem, ct as TuiRendererRegistrySnapshot, d as EditorHost, dt as TuiSettingHandle, et as TuiKeybindingHandle, f as EditorHostAction, ft as TuiSettingsRegistrySnapshot, g as ExtensionEditor, gt as TuiThemeHandle, h as EditorSnapshot, ht as TuiThemeContribution, i as AutocompleteProviderContribution, it as TuiMessageRendererContribution, j as RegistrationHandle, k as PiTuiSlotName, l as EditorContribution, m as EditorInputEvent, mt as TuiSizeValue, n as ActivitySnapshot, nt as TuiKeybindingRegistryView, o as ContributionRecord, ot as TuiOverlayOptions, p as EditorHostActionResult, pt as TuiSettingsRegistryView, q as TuiAutocompleteSuggestions, r as AutocompleteHandle, rt as TuiLocalCommandHandler, s as ContributionState, st as TuiRendererHandle, t as API_VERSION, tt as TuiKeybindingRegistrySnapshot, u as EditorHandle, ut as TuiSettingContribution, v as ExtensionView, vt as TuiThemeRegistryView, w as MarkdownView, x as FrameView, y as FooterItemContribution, yt as TuiToolRendererContribution, z as SurfaceStateValues } from "./public-types-Dgf1bDke.mjs";
2
+ import { a as PiTuiExtensionService, i as PI_TUI_EXTENSIONS_SERVICE, n as inject, r as name, t as apply } from "./extensions-Bte3XOt5.mjs";
3
3
  export { API_VERSION, type ActivitySnapshot, type AutocompleteHandle, type AutocompleteProviderContribution, type ContributionHealth, type ContributionRecord, type ContributionState, type DockItem, type EditorContribution, type EditorHandle, type EditorHost, type EditorHostAction, type EditorHostActionResult, type EditorInputEvent, type EditorSnapshot, type ExtensionEditor, type ExtensionView, type FooterItemContribution, type FooterSegment, type FrameView, type HeaderBadge, type InputWidget, type MarkdownView, type MessagePresentationSnapshot, type NormalizedKey, PI_TUI_EXTENSIONS_SERVICE, type PiTuiApiInfo, type PiTuiCapability, type PiTuiExtensionService, type PiTuiSlotName, type PiTuiSlotSemantic, type RegistrationHandle, type RegistrationSpec, type RowsView, type SessionSnapshot, type SpacerView, type StackView, type StyledSpan, type SurfaceSnapshot, type SurfaceStateValues, type TextView, type ToolPresentationSnapshot, type TuiAction, type TuiAutocompleteItem, type TuiAutocompleteProvider, type TuiAutocompleteQuery, type TuiAutocompleteRegistryView, type TuiAutocompleteSuggestions, type TuiColorPalette, type TuiCommandBridgeSnapshot, type TuiCommandBridgeView, type TuiCommandContribution, type TuiCommandHandle, type TuiKeybindingContribution, type TuiKeybindingHandle, type TuiKeybindingRegistrySnapshot, type TuiKeybindingRegistryView, type TuiLocalCommandHandler, type TuiMessageRendererContribution, type TuiOverlayHandle, type TuiOverlayOptions, type TuiRendererHandle, type TuiRendererRegistrySnapshot, type TuiSettingContribution, type TuiSettingHandle, type TuiSettingsRegistrySnapshot, type TuiSettingsRegistryView, type TuiSizeValue, type TuiThemeContribution, type TuiThemeHandle, type TuiThemeRegistrySnapshot, type TuiThemeRegistryView, type TuiToolRendererContribution, apply, describeKey, inject, name };
@@ -1,2 +1,2 @@
1
- import { a as PI_TUI_EXTENSIONS_SERVICE, i as name, o as API_VERSION, r as inject, s as describeKey, t as apply } from "./extensions-VuoIE_Jc.mjs";
1
+ import { a as PI_TUI_EXTENSIONS_SERVICE, i as name, o as API_VERSION, r as inject, s as describeKey, t as apply } from "./extensions-CcuMY4n2.mjs";
2
2
  export { API_VERSION, PI_TUI_EXTENSIONS_SERVICE, apply, describeKey, inject, name };
@@ -0,0 +1,119 @@
1
+ //#region src/app/remote/host-prerequisites.ts
2
+ /**
3
+ * Host services the ordinary Host Context must already expose before any
4
+ * Remote Host row mounts. The check fails fast with the missing service named
5
+ * instead of parking the runtime.
6
+ */
7
+ const REMOTE_HOST_PREREQUISITE_SERVICES = [
8
+ "credentials",
9
+ "userQuestions",
10
+ "typert",
11
+ "typertGateway",
12
+ "agents",
13
+ "agentDefaultModel",
14
+ "attachments",
15
+ "commands",
16
+ "fileReferences",
17
+ "fs",
18
+ "workingDirectory",
19
+ "llm",
20
+ "sessions",
21
+ "sessionProjections",
22
+ "sessionQuery",
23
+ "workspaceRegistry",
24
+ "jobController",
25
+ "workspaceFiles"
26
+ ];
27
+ /**
28
+ * Fail fast when the ordinary Host lacks one of the required base services.
29
+ * Reads via the reflect store so the diagnostic can name the missing key
30
+ * without depending on any one service's shape.
31
+ */
32
+ function assertRemoteHostPrerequisites(hostContext) {
33
+ for (const service of REMOTE_HOST_PREREQUISITE_SERVICES) if (hostContext.reflect.get(service) === void 0) throw new Error(`remote host runtime: the Host Context is missing the required "${service}" service`);
34
+ }
35
+ //#endregion
36
+ //#region src/app/remote-process/host-bootstrap.ts
37
+ /** Cordis `FiberState.ACTIVE` (the enum is a const enum with no runtime value). */
38
+ const FIBER_ACTIVE = 2;
39
+ /** Loader rows that must never be active in the Host-only process. */
40
+ const FORBIDDEN_HOST_ENTRY_IDS = [
41
+ "tui-app",
42
+ "pi-tui-extension-host",
43
+ "pi-tui-builtins"
44
+ ];
45
+ function loaderOf(context) {
46
+ const loader = context.loader;
47
+ if (loader === void 0) throw new Error("local host entry: the booted profile has no Loader service");
48
+ return loader;
49
+ }
50
+ /** A stable label for one fiber state, or `absent` for a disabled/never-started row. */
51
+ function fiberStateLabel(entry) {
52
+ const state = entry.fiber?.state;
53
+ if (state === void 0) return "absent";
54
+ if (state === FIBER_ACTIVE) return "active";
55
+ return `state-${String(state)}`;
56
+ }
57
+ /** Assert the disabled TUI rows did not activate despite the profile patch. */
58
+ function assertHostOnlyComposition(context) {
59
+ const activeForbidden = [...loaderOf(context).entries()].filter((entry) => FORBIDDEN_HOST_ENTRY_IDS.includes(entry.options.id)).filter((entry) => entry.fiber?.state === FIBER_ACTIVE).map((entry) => entry.options.id);
60
+ if (activeForbidden.length > 0) throw new Error(`local host entry: forbidden TUI/Client-UI rows are active: ${activeForbidden.join(", ")}`);
61
+ }
62
+ /** Wait for every Loader entry to settle after the profile boot returned. */
63
+ async function settleHostEntries(context) {
64
+ await loaderOf(context).await();
65
+ }
66
+ /**
67
+ * Prove the production Host prerequisite set is live and collect the readiness
68
+ * facts. Must run after {@link settleHostEntries}; a missing prerequisite is a
69
+ * hard failure, never a degraded ready.
70
+ */
71
+ function collectHostEntryStatus(context, identity) {
72
+ assertRemoteHostPrerequisites(context);
73
+ assertHostOnlyComposition(context);
74
+ const entries = [...loaderOf(context).entries()];
75
+ const services = {};
76
+ for (const service of REMOTE_HOST_PREREQUISITE_SERVICES) services[service] = context.reflect.get(service) !== void 0;
77
+ /** Only ACTIVE rows own a service; a disabled/absent row proves nothing. */
78
+ const activeIds = (id) => entries.filter((entry) => entry.options.id === id && entry.fiber?.state === FIBER_ACTIVE).map((entry) => entry.options.id);
79
+ const ownerEntries = {
80
+ agents: activeIds("agent"),
81
+ sessions: activeIds("session"),
82
+ jobController: activeIds("job-controller"),
83
+ connection: activeIds("connection")
84
+ };
85
+ for (const [owner, ids] of Object.entries(ownerEntries)) {
86
+ if (owner === "connection") {
87
+ if (ids.length !== 0) throw new Error(`local host entry: the A0 Host must not mount a Connection owner (found ${ids.join(", ")})`);
88
+ continue;
89
+ }
90
+ if (ids.length !== 1) throw new Error(`local host entry: expected exactly one active ${owner} owner row, found ${String(ids.length)}`);
91
+ }
92
+ const rootFiber = context.fiber;
93
+ const webServer = context.reflect.get("webServer");
94
+ return {
95
+ processRole: "host",
96
+ pid: process.pid,
97
+ ...identity.processStartIdentity === void 0 ? {} : { processStartIdentity: identity.processStartIdentity },
98
+ phase: "ready",
99
+ fiberOwner: "dsh-profile-root",
100
+ ...rootFiber?.uid == null ? {} : { rootFiberUid: rootFiber.uid },
101
+ transport: "not-connected",
102
+ sessionOpen: false,
103
+ profile: identity.profile,
104
+ services,
105
+ ownerEntries,
106
+ entries: entries.map((entry) => ({
107
+ id: entry.options.id,
108
+ name: entry.options.name,
109
+ state: fiberStateLabel(entry)
110
+ })),
111
+ forbiddenActive: [],
112
+ ...webServer?.host === void 0 || webServer.port === void 0 ? {} : { webServer: {
113
+ host: webServer.host,
114
+ port: webServer.port
115
+ } }
116
+ };
117
+ }
118
+ //#endregion
119
+ export { collectHostEntryStatus, settleHostEntries };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { H as TuiAction } from "./public-types-gZi3iFNh.mjs";
1
+ import { H as TuiAction } from "./public-types-Dgf1bDke.mjs";
2
2
  import { SessionId } from "@deepseek-ai/dsh-session";
3
3
  import { ContentBlock } from "@deepseek-ai/dsh-llm";
4
4
  import { Context, Volatile } from "@deepseek-ai/cordis";
@@ -131,9 +131,17 @@ interface SurfaceCommandsService {
131
131
  /** The narrow context surface {@link readSurfaceCatalog} consumes. The
132
132
  * SKILL services are NOT reached here: every dsh skill/agent-presets
133
133
  * access goes through `runtime/direct/skill-catalog.ts` (the single-point
134
- * adapter, plan appendix B.1). */
134
+ * adapter, plan appendix B.1). `workingDirectory` is the official Session
135
+ * directory owner the skill scan scope resolves from — absent in a minimal
136
+ * composition, where the immutable header cwd remains the read. */
135
137
  interface SurfaceCatalogContext {
136
138
  get(name: 'commands'): SurfaceCommandsService | undefined;
139
+ /** The official Session directory owner (`workingDirectory.get(session)`),
140
+ * declared STRUCTURALLY here so this public interface never pulls a Direct
141
+ * adapter module into the shipped declaration graph. */
142
+ get(name: 'workingDirectory'): {
143
+ get(session: unknown): string;
144
+ } | undefined;
137
145
  }
138
146
  //#endregion
139
147
  //#region src/app/config/schema.d.ts
@@ -589,14 +597,6 @@ declare function busyAfterTurnBoundary(eventType: 'turn/start' | 'turn/end', com
589
597
  * re-measures through the fold-outcome path (settleCompactionSurface), so
590
598
  * a STALE compaction/end can never trigger a measurement. */
591
599
  declare function contextRefreshKind(eventType: string): 'measure' | 'cheap';
592
- /**
593
- * The in-flight compaction state a resumed session log implies: the newest
594
- * compaction bracket decides. A `session/end-seed` boundary makes any
595
- * EARLIER unmatched `compaction/start` STALE — the upstream invariant
596
- * (inheritedOrphanStartSeqs) treats seed compactions that never settled
597
- * inside the seed as abandoned, so they must not re-arm the compacting
598
- * surface on resume.
599
- */
600
600
  declare function compactingFromLog(events: readonly {
601
601
  type: unknown;
602
602
  data?: unknown;