@xmoon76/dsh-pi-tui 0.4.9 → 0.5.1

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.
@@ -0,0 +1,139 @@
1
+ import { $ as TuiKeybindingContribution, D as PiTuiApiInfo, K as TuiAutocompleteRegistryView, M as RegistrationSpec, Q as TuiCommandHandle, X as TuiCommandBridgeView, Z as TuiCommandContribution, at as TuiOverlayHandle, dt as TuiSettingHandle, et as TuiKeybindingHandle, gt as TuiThemeHandle, ht as TuiThemeContribution, i as AutocompleteProviderContribution, it as TuiMessageRendererContribution, j as RegistrationHandle, l as EditorContribution, lt as TuiRendererRegistryView, nt as TuiKeybindingRegistryView, ot as TuiOverlayOptions, pt as TuiSettingsRegistryView, r as AutocompleteHandle, st as TuiRendererHandle, u as EditorHandle, ut as TuiSettingContribution, v as ExtensionView, vt as TuiThemeRegistryView, yt as TuiToolRendererContribution, z as SurfaceStateValues } from "./public-types-BEjj7FEb.mjs";
2
+ import { EventEmitter } from "events";
3
+ import { Context, Service } from "@deepseek-ai/cordis";
4
+
5
+ //#region src/extension/service.d.ts
6
+ /** The service name plugins inject (`piTuiExtensions` in cordis.patch.yml). */
7
+ declare const PI_TUI_EXTENSIONS_SERVICE = "piTuiExtensions";
8
+ /** The public service surface plugins consume. */
9
+ interface PiTuiExtensionService {
10
+ /** Host identity: version + capability set (feature-detect, never parse versions). */
11
+ readonly api: () => PiTuiApiInfo;
12
+ /**
13
+ * Register one contribution under a slot. The registration is owned by the
14
+ * CALLING fiber: it is disposed automatically when that fiber unloads.
15
+ * @param slot - one of the known slot names.
16
+ * @param spec - registration identity + ordering metadata.
17
+ * @param contribution - the contribution value (typed per slot contract).
18
+ */
19
+ register<T>(slot: string, spec: RegistrationSpec, contribution: T): RegistrationHandle<T>;
20
+ /** The semantic of one slot ('list' | 'single'), or undefined when unknown. */
21
+ slotSemantics(slot: string): string | undefined;
22
+ /**
23
+ * Subscribe to the live surface state snapshots (first-party builtins and
24
+ * state-driven contributions). Fires once synchronously with the current
25
+ * state, then on every change (batched). Returns a disposer.
26
+ * @param listener - receives the immutable snapshot values.
27
+ */
28
+ subscribeState(listener: (state: SurfaceStateValues) => void): () => void;
29
+ /**
30
+ * Register a CLIENT-OWNED command contribution (M5): a slash name whose
31
+ * behavior lives entirely on the client (the DSH client command
32
+ * contribution shape). It joins the `/` menu merged with the host catalog
33
+ * and the runner executes its own `handler` locally; a name that is also a
34
+ * host command fails loud at candidate synthesis and never shadows it.
35
+ * Owned by the calling fiber.
36
+ * @param contribution - the command contribution.
37
+ */
38
+ registerCommand(contribution: TuiCommandContribution): TuiCommandHandle;
39
+ /**
40
+ * Register a named theme palette (M5): selectable from the host's theme
41
+ * picker; owner unload removes it (a selected plugin theme falls back to
42
+ * the built-in palette). Owned by the calling fiber.
43
+ * @param contribution - the theme contribution.
44
+ */
45
+ registerTheme(contribution: TuiThemeContribution): TuiThemeHandle;
46
+ /**
47
+ * Register an autocomplete provider (M5): consulted after the host's own
48
+ * provider returns null, in registration order. Owned by the calling
49
+ * fiber.
50
+ * @param contribution - the provider contribution.
51
+ */
52
+ registerAutocomplete(contribution: AutocompleteProviderContribution): AutocompleteHandle;
53
+ /**
54
+ * Register a settings row (M5): appended to the host's /settings panel.
55
+ * Owned by the calling fiber.
56
+ * @param contribution - the row contribution.
57
+ */
58
+ registerSetting(contribution: TuiSettingContribution): TuiSettingHandle;
59
+ /**
60
+ * Register a keybinding (M5): normalized key → public semantic action.
61
+ * The registry validates the contribution (public TuiAction whitelist,
62
+ * reserved keys, text-producing keys, editor-owned keys, legacy C0 collisions) and its
63
+ * records feed the LIVE InputRouter lookups + the runner's
64
+ * effective-keymap plugin rules (M6); routing precedence stays
65
+ * Host-owned. Rejections throw loudly; the binding is owned by the
66
+ * calling fiber.
67
+ * @param contribution - the binding contribution.
68
+ */
69
+ registerKeybinding(contribution: TuiKeybindingContribution): TuiKeybindingHandle;
70
+ /**
71
+ * Register a transcript MESSAGE renderer (M7, chain slot): receives a
72
+ * semantic snapshot; returns an ExtensionView or undefined (abdicate →
73
+ * next renderer → host fallback). A throwing renderer is isolated.
74
+ * Owned by the calling fiber.
75
+ */
76
+ registerMessageRenderer(contribution: TuiMessageRendererContribution): TuiRendererHandle;
77
+ /**
78
+ * Register a TOOL renderer (M7, keyed slot): presents the tool card for
79
+ * ONE tool name; undefined abdicates. Priority ties on the same tool
80
+ * name are an explicit error. Owned by the calling fiber.
81
+ */
82
+ registerToolRenderer(contribution: TuiToolRendererContribution): TuiRendererHandle;
83
+ /**
84
+ * Open a MANAGED OVERLAY (M8, plan §13.3): the plugin supplies an
85
+ * ExtensionView + sizing hints; the host mounts it through its overlay
86
+ * broker (modal stacking, focus, fullscreen migration, teardown). The
87
+ * returned lease is generation-scoped (a stale surface's lease closes
88
+ * with the surface) and its close() is idempotent. The overlay content
89
+ * is the M4 component kit — a plugin can never mount a raw component
90
+ * or steal focus.
91
+ * @param view - the ExtensionView to present.
92
+ * @param options - sizing/positioning hints.
93
+ * @returns the overlay lease.
94
+ */
95
+ showOverlay(view: ExtensionView, options?: TuiOverlayOptions): TuiOverlayHandle;
96
+ /** M5 registries, exposed for the runner's dispatch/pickers (narrow
97
+ * read-side views — the concrete classes are host-internal, so the
98
+ * public declarations stay free of internal modules). */
99
+ readonly commands: TuiCommandBridgeView;
100
+ readonly themes: TuiThemeRegistryView;
101
+ readonly autocomplete: TuiAutocompleteRegistryView;
102
+ readonly settings: TuiSettingsRegistryView;
103
+ readonly keybindings: TuiKeybindingRegistryView;
104
+ /** M7: the transcript/tool renderer registry (the runner wires it into
105
+ * the surface's message cache; the narrow read-side view keeps the
106
+ * public declarations free of internal modules). */
107
+ readonly renderers: TuiRendererRegistryView;
108
+ /** Runner-only: wire the host's managed-overlay mount seam (M8). The
109
+ * seam is SURFACE-scoped (P1-4): it binds to the CURRENT attachment's
110
+ * surfaceId — a later attach replaces it, and a stale old-generation
111
+ * detach never unbinds a newer surface's seam (the detachSurface lease). */
112
+ setOverlayMount(surfaceId: string, mount: (view: ExtensionView, options?: TuiOverlayOptions) => TuiOverlayHandle): void;
113
+ /**
114
+ * Register an EDITOR contribution (M9, plan §14): single-winner by
115
+ * priority; a tie is an explicit error. The winner occupies the editor
116
+ * seat through the host's atomic handoff; the host default editor is
117
+ * the fallback (never a competing registration). Creation is atomic —
118
+ * a throw keeps the current editor working. Owned by the calling fiber.
119
+ */
120
+ registerEditor(contribution: EditorContribution): EditorHandle;
121
+ }
122
+ //#endregion
123
+ //#region src/extensions.d.ts
124
+ /** Stable Cordis plugin name for the extension host row. */
125
+ declare const name = "pi-tui-extension-host";
126
+ /** The host mounts only when the TUI startup flags were parsed (same gate
127
+ * as the runner row: `dsh --profile pi-tui --help` provides nothing, so no
128
+ * extension host mounts either). */
129
+ declare const inject: string[];
130
+ /**
131
+ * Provide the extension service. The Service base class registers the
132
+ * instance on `ctx` under `piTuiExtensions` and unregisters it when this
133
+ * provider fiber unloads; invalidations coalesce into render requests
134
+ * (until the SurfaceHost attaches in M2 the sink is a no-op).
135
+ * @param ctx - the provider's plugin context.
136
+ */
137
+ declare function apply(ctx: Context): void;
138
+ //#endregion
139
+ export { PiTuiExtensionService as a, PI_TUI_EXTENSIONS_SERVICE as i, inject as n, name as r, apply as t };
@@ -1,138 +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, lt as TuiRendererRegistryView, 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-YbB5Rhku.mjs";
2
- import { Context, Service } from "@deepseek-ai/cordis";
3
-
4
- //#region src/extension/service.d.ts
5
- /** The service name plugins inject (`piTuiExtensions` in cordis.patch.yml). */
6
- declare const PI_TUI_EXTENSIONS_SERVICE = "piTuiExtensions";
7
- /** The public service surface plugins consume. */
8
- interface PiTuiExtensionService {
9
- /** Host identity: version + capability set (feature-detect, never parse versions). */
10
- readonly api: () => PiTuiApiInfo;
11
- /**
12
- * Register one contribution under a slot. The registration is owned by the
13
- * CALLING fiber: it is disposed automatically when that fiber unloads.
14
- * @param slot - one of the known slot names.
15
- * @param spec - registration identity + ordering metadata.
16
- * @param contribution - the contribution value (typed per slot contract).
17
- */
18
- register<T>(slot: string, spec: RegistrationSpec, contribution: T): RegistrationHandle<T>;
19
- /** The semantic of one slot ('list' | 'single'), or undefined when unknown. */
20
- slotSemantics(slot: string): string | undefined;
21
- /**
22
- * Subscribe to the live surface state snapshots (first-party builtins and
23
- * state-driven contributions). Fires once synchronously with the current
24
- * state, then on every change (batched). Returns a disposer.
25
- * @param listener - receives the immutable snapshot values.
26
- */
27
- subscribeState(listener: (state: SurfaceStateValues) => void): () => void;
28
- /**
29
- * Register a CLIENT-OWNED command contribution (M5): a slash name whose
30
- * behavior lives entirely on the client (the DSH client command
31
- * contribution shape). It joins the `/` menu merged with the host catalog
32
- * and the runner executes its own `handler` locally; a name that is also a
33
- * host command fails loud at candidate synthesis and never shadows it.
34
- * Owned by the calling fiber.
35
- * @param contribution - the command contribution.
36
- */
37
- registerCommand(contribution: TuiCommandContribution): TuiCommandHandle;
38
- /**
39
- * Register a named theme palette (M5): selectable from the host's theme
40
- * picker; owner unload removes it (a selected plugin theme falls back to
41
- * the built-in palette). Owned by the calling fiber.
42
- * @param contribution - the theme contribution.
43
- */
44
- registerTheme(contribution: TuiThemeContribution): TuiThemeHandle;
45
- /**
46
- * Register an autocomplete provider (M5): consulted after the host's own
47
- * provider returns null, in registration order. Owned by the calling
48
- * fiber.
49
- * @param contribution - the provider contribution.
50
- */
51
- registerAutocomplete(contribution: AutocompleteProviderContribution): AutocompleteHandle;
52
- /**
53
- * Register a settings row (M5): appended to the host's /settings panel.
54
- * Owned by the calling fiber.
55
- * @param contribution - the row contribution.
56
- */
57
- registerSetting(contribution: TuiSettingContribution): TuiSettingHandle;
58
- /**
59
- * Register a keybinding (M5): normalized key → public semantic action.
60
- * The registry validates the contribution (public TuiAction whitelist,
61
- * reserved keys, text-producing keys, editor-owned keys, legacy C0 collisions) and its
62
- * records feed the LIVE InputRouter lookups + the runner's
63
- * effective-keymap plugin rules (M6); routing precedence stays
64
- * Host-owned. Rejections throw loudly; the binding is owned by the
65
- * calling fiber.
66
- * @param contribution - the binding contribution.
67
- */
68
- registerKeybinding(contribution: TuiKeybindingContribution): TuiKeybindingHandle;
69
- /**
70
- * Register a transcript MESSAGE renderer (M7, chain slot): receives a
71
- * semantic snapshot; returns an ExtensionView or undefined (abdicate →
72
- * next renderer → host fallback). A throwing renderer is isolated.
73
- * Owned by the calling fiber.
74
- */
75
- registerMessageRenderer(contribution: TuiMessageRendererContribution): TuiRendererHandle;
76
- /**
77
- * Register a TOOL renderer (M7, keyed slot): presents the tool card for
78
- * ONE tool name; undefined abdicates. Priority ties on the same tool
79
- * name are an explicit error. Owned by the calling fiber.
80
- */
81
- registerToolRenderer(contribution: TuiToolRendererContribution): TuiRendererHandle;
82
- /**
83
- * Open a MANAGED OVERLAY (M8, plan §13.3): the plugin supplies an
84
- * ExtensionView + sizing hints; the host mounts it through its overlay
85
- * broker (modal stacking, focus, fullscreen migration, teardown). The
86
- * returned lease is generation-scoped (a stale surface's lease closes
87
- * with the surface) and its close() is idempotent. The overlay content
88
- * is the M4 component kit — a plugin can never mount a raw component
89
- * or steal focus.
90
- * @param view - the ExtensionView to present.
91
- * @param options - sizing/positioning hints.
92
- * @returns the overlay lease.
93
- */
94
- showOverlay(view: ExtensionView, options?: TuiOverlayOptions): TuiOverlayHandle;
95
- /** M5 registries, exposed for the runner's dispatch/pickers (narrow
96
- * read-side views — the concrete classes are host-internal, so the
97
- * public declarations stay free of internal modules). */
98
- readonly commands: TuiCommandBridgeView;
99
- readonly themes: TuiThemeRegistryView;
100
- readonly autocomplete: TuiAutocompleteRegistryView;
101
- readonly settings: TuiSettingsRegistryView;
102
- readonly keybindings: TuiKeybindingRegistryView;
103
- /** M7: the transcript/tool renderer registry (the runner wires it into
104
- * the surface's message cache; the narrow read-side view keeps the
105
- * public declarations free of internal modules). */
106
- readonly renderers: TuiRendererRegistryView;
107
- /** Runner-only: wire the host's managed-overlay mount seam (M8). The
108
- * seam is SURFACE-scoped (P1-4): it binds to the CURRENT attachment's
109
- * surfaceId — a later attach replaces it, and a stale old-generation
110
- * detach never unbinds a newer surface's seam (the detachSurface lease). */
111
- setOverlayMount(surfaceId: string, mount: (view: ExtensionView, options?: TuiOverlayOptions) => TuiOverlayHandle): void;
112
- /**
113
- * Register an EDITOR contribution (M9, plan §14): single-winner by
114
- * priority; a tie is an explicit error. The winner occupies the editor
115
- * seat through the host's atomic handoff; the host default editor is
116
- * the fallback (never a competing registration). Creation is atomic —
117
- * a throw keeps the current editor working. Owned by the calling fiber.
118
- */
119
- registerEditor(contribution: EditorContribution): EditorHandle;
120
- }
121
- //#endregion
122
- //#region src/extensions.d.ts
123
- /** Stable Cordis plugin name for the extension host row. */
124
- declare const name = "pi-tui-extension-host";
125
- /** The host mounts only when the TUI startup flags were parsed (same gate
126
- * as the runner row: `dsh --profile pi-tui --help` provides nothing, so no
127
- * extension host mounts either). */
128
- declare const inject: string[];
129
- /**
130
- * Provide the extension service. The Service base class registers the
131
- * instance on `ctx` under `piTuiExtensions` and unregisters it when this
132
- * provider fiber unloads; invalidations coalesce into render requests
133
- * (until the SurfaceHost attaches in M2 the sink is a no-op).
134
- * @param ctx - the provider's plugin context.
135
- */
136
- declare function apply(ctx: Context): void;
137
- //#endregion
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-BEjj7FEb.mjs";
2
+ import { a as PiTuiExtensionService, i as PI_TUI_EXTENSIONS_SERVICE, n as inject, r as name, t as apply } from "./extensions-v3Rf-qJA.mjs";
138
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 { B as name, H as API_VERSION, R as apply, U as describeKey, V as PI_TUI_EXTENSIONS_SERVICE, z as inject } from "./src-BAwPimrH.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-1WYBUQ8I.mjs";
2
2
  export { API_VERSION, PI_TUI_EXTENSIONS_SERVICE, apply, describeKey, inject, name };