@xmoon76/dsh-pi-tui 0.5.0 → 0.5.2-rc.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.
@@ -1,4 +1,4 @@
1
- import { D as PiTuiApiInfo, E as NormalizedKey, _ as ExtensionTier, h as EditorSnapshot, ot as TuiOverlayOptions, v as ExtensionView } from "../public-types-YbB5Rhku.mjs";
1
+ import { D as PiTuiApiInfo, E as NormalizedKey, _ as ExtensionTier, h as EditorSnapshot, ot as TuiOverlayOptions, v as ExtensionView } from "../public-types-gZi3iFNh.mjs";
2
2
 
3
3
  //#region src/extension/advanced-types.d.ts
4
4
  /** API level of the advanced tier. Bumped only on advanced breaking changes. */
@@ -24,7 +24,7 @@ type AdvancedInputEvent = /** One key press, normalized to the semantic identity
24
24
  } /** One plain printable character run (ordinary typing). */ | {
25
25
  readonly kind: 'text';
26
26
  readonly text: string;
27
- } /** A paste burst (bracketed-paste or the host's paste heuristic). */ | {
27
+ } /** A bracket-paste burst (`CSI 200~` … `CSI 201~`). */ | {
28
28
  readonly kind: 'paste';
29
29
  readonly text: string;
30
30
  };
@@ -1,4 +1,4 @@
1
- import { D as PiTuiApiInfo, _ as ExtensionTier, ot as TuiOverlayOptions } from "../public-types-YbB5Rhku.mjs";
1
+ import { D as PiTuiApiInfo, _ as ExtensionTier, ot as TuiOverlayOptions } from "../public-types-gZi3iFNh.mjs";
2
2
 
3
3
  //#region src/extension/unstable-types.d.ts
4
4
  /** API level of the unstable tier. Bumped only on unstable breaking changes. */
@@ -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-gZi3iFNh.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 };