@xmoon76/dsh-pi-tui 0.3.0 → 0.3.2
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/dist/builtins.mjs +1 -1
- package/dist/extension/advanced.d.mts +1 -1
- package/dist/extension/unstable.d.mts +1 -1
- package/dist/extensions.d.mts +1 -1
- package/dist/extensions.mjs +1 -1
- package/dist/index.d.mts +114 -12
- package/dist/index.mjs +2 -2
- package/dist/{public-types-2omeXG8d.d.mts → public-types-CZz5_arj.d.mts} +3 -0
- package/dist/{src-ClAKiW0z.mjs → src-oZjot5jQ.mjs} +2925 -191
- package/dist/startup.d.mts +41 -1
- package/dist/startup.mjs +99 -2
- package/package.json +1 -1
- package/scripts/bench.mts +6 -0
- package/scripts/preview-prompt.mts +62 -0
- package/scripts/preview-role-styles.mts +97 -0
- package/scripts/tarball-smoke.mjs +6 -2
package/dist/builtins.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TUI_STARTUP_SERVICE } from "./startup.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { L as PI_TUI_EXTENSIONS_SERVICE, M as dshVersion } from "./src-oZjot5jQ.mjs";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
//#region src/builtins.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as PiTuiApiInfo, T as NormalizedKey, _ as ExtensionTier, at as TuiOverlayOptions, h as EditorSnapshot, v as ExtensionView } from "../public-types-
|
|
1
|
+
import { E as PiTuiApiInfo, T as NormalizedKey, _ as ExtensionTier, at as TuiOverlayOptions, h as EditorSnapshot, v as ExtensionView } from "../public-types-CZz5_arj.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. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as PiTuiApiInfo, _ as ExtensionTier, at as TuiOverlayOptions } from "../public-types-
|
|
1
|
+
import { E as PiTuiApiInfo, _ as ExtensionTier, at as TuiOverlayOptions } from "../public-types-CZz5_arj.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. */
|
package/dist/extensions.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as TuiKeybindingHandle, A as RegistrationHandle, B as ToolPresentationSnapshot, C as MarkdownView, D as PiTuiCapability, E as PiTuiApiInfo, F as StackView, G as TuiAutocompleteRegistryView, H as TuiAutocompleteItem, I as StyledSpan, J as TuiCommandBridgeSnapshot, K as TuiAutocompleteSuggestions, L as SurfaceSnapshot, M as RowsView, N as SessionSnapshot, O as PiTuiSlotName, P as SpacerView, Q as TuiKeybindingContribution, R as SurfaceStateValues, S as InputWidget, T as NormalizedKey, U as TuiAutocompleteProvider, V as TuiAction, W as TuiAutocompleteQuery, X as TuiCommandContribution, Y as TuiCommandBridgeView, Z as TuiCommandHandle, _t as TuiThemeRegistryView, a as ContributionHealth, at as TuiOverlayOptions, b as FrameView, c as DockItem, ct as TuiRendererRegistryView, d as EditorHost, dt as TuiSettingsRegistrySnapshot, et as TuiKeybindingRegistrySnapshot, f as EditorHostAction, ft as TuiSettingsRegistryView, g as ExtensionEditor, gt as TuiThemeRegistrySnapshot, h as EditorSnapshot, ht as TuiThemeHandle, i as AutocompleteProviderContribution, it as TuiOverlayHandle, j as RegistrationSpec, k as PiTuiSlotSemantic, l as EditorContribution, lt as TuiSettingContribution, m as EditorInputEvent, mt as TuiThemeContribution, n as ActivitySnapshot, nt as TuiLocalCommandHandler, o as ContributionRecord, ot as TuiRendererHandle, p as EditorHostActionResult, pt as TuiSizeValue, q as TuiColorPalette, r as AutocompleteHandle, rt as TuiMessageRendererContribution, s as ContributionState, st as TuiRendererRegistrySnapshot, t as API_VERSION, tt as TuiKeybindingRegistryView, u as EditorHandle, ut as TuiSettingHandle, v as ExtensionView, vt as TuiToolRendererContribution, w as MessagePresentationSnapshot, x as HeaderBadge, y as FooterSegment, yt as describeKey, z as TextView } from "./public-types-
|
|
1
|
+
import { $ as TuiKeybindingHandle, A as RegistrationHandle, B as ToolPresentationSnapshot, C as MarkdownView, D as PiTuiCapability, E as PiTuiApiInfo, F as StackView, G as TuiAutocompleteRegistryView, H as TuiAutocompleteItem, I as StyledSpan, J as TuiCommandBridgeSnapshot, K as TuiAutocompleteSuggestions, L as SurfaceSnapshot, M as RowsView, N as SessionSnapshot, O as PiTuiSlotName, P as SpacerView, Q as TuiKeybindingContribution, R as SurfaceStateValues, S as InputWidget, T as NormalizedKey, U as TuiAutocompleteProvider, V as TuiAction, W as TuiAutocompleteQuery, X as TuiCommandContribution, Y as TuiCommandBridgeView, Z as TuiCommandHandle, _t as TuiThemeRegistryView, a as ContributionHealth, at as TuiOverlayOptions, b as FrameView, c as DockItem, ct as TuiRendererRegistryView, d as EditorHost, dt as TuiSettingsRegistrySnapshot, et as TuiKeybindingRegistrySnapshot, f as EditorHostAction, ft as TuiSettingsRegistryView, g as ExtensionEditor, gt as TuiThemeRegistrySnapshot, h as EditorSnapshot, ht as TuiThemeHandle, i as AutocompleteProviderContribution, it as TuiOverlayHandle, j as RegistrationSpec, k as PiTuiSlotSemantic, l as EditorContribution, lt as TuiSettingContribution, m as EditorInputEvent, mt as TuiThemeContribution, n as ActivitySnapshot, nt as TuiLocalCommandHandler, o as ContributionRecord, ot as TuiRendererHandle, p as EditorHostActionResult, pt as TuiSizeValue, q as TuiColorPalette, r as AutocompleteHandle, rt as TuiMessageRendererContribution, s as ContributionState, st as TuiRendererRegistrySnapshot, t as API_VERSION, tt as TuiKeybindingRegistryView, u as EditorHandle, ut as TuiSettingHandle, v as ExtensionView, vt as TuiToolRendererContribution, w as MessagePresentationSnapshot, x as HeaderBadge, y as FooterSegment, yt as describeKey, z as TextView } from "./public-types-CZz5_arj.mjs";
|
|
2
2
|
import { Context, Service } from "@deepseek-ai/cordis";
|
|
3
3
|
|
|
4
4
|
//#region src/extension/service.d.ts
|
package/dist/extensions.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "./startup.mjs";
|
|
2
|
-
import { F as
|
|
2
|
+
import { F as inject, I as name, L as PI_TUI_EXTENSIONS_SERVICE, P as apply, R as API_VERSION, z as describeKey } from "./src-oZjot5jQ.mjs";
|
|
3
3
|
export { API_VERSION, PI_TUI_EXTENSIONS_SERVICE, apply, describeKey, inject, name };
|
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,86 @@ import { ContentBlock } from "@deepseek-ai/dsh-llm";
|
|
|
4
4
|
import { SessionEvent, SessionId } from "@deepseek-ai/dsh-session";
|
|
5
5
|
import { CommandDescriptor } from "@deepseek-ai/dsh-commands";
|
|
6
6
|
import { Context } from "@deepseek-ai/cordis";
|
|
7
|
+
//#region src/image/admission.d.ts
|
|
8
|
+
/** Structural subset of `ImageAttachmentRef`. */
|
|
9
|
+
interface ImageAttachmentRefLike {
|
|
10
|
+
readonly attachmentId: string;
|
|
11
|
+
readonly mediaType: ImageMediaType;
|
|
12
|
+
readonly bytes: number;
|
|
13
|
+
readonly width: number;
|
|
14
|
+
readonly height: number;
|
|
15
|
+
readonly name?: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/image/types.d.ts
|
|
19
|
+
/**
|
|
20
|
+
* Image draft vocabulary for the TUI input pipeline (plan M1).
|
|
21
|
+
*
|
|
22
|
+
* The draft layer is TUI-owned: it stages clipboard/file bytes until a
|
|
23
|
+
* submission turns them into durable `ImageAttachmentRef`s through the dsh
|
|
24
|
+
* attachment service. Nothing in this module persists; the durable boundary
|
|
25
|
+
* is the harness's `ctx.attachments.saveImages()`.
|
|
26
|
+
*
|
|
27
|
+
* The media-type union mirrors `@deepseek-ai/dsh-attachment`'s
|
|
28
|
+
* `ImageMediaType` structurally, so drafts flow into the harness without a
|
|
29
|
+
* runtime dependency on the attachment package (AGENTS.md decision 7:
|
|
30
|
+
* structural typing for dsh services).
|
|
31
|
+
* @module @xmoon76/dsh-pi-tui/image/types
|
|
32
|
+
*/
|
|
33
|
+
/** Raster media types accepted by the TUI image intake. */
|
|
34
|
+
type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
|
|
35
|
+
/** Per-TUI draft image identity; only meaningful inside one TUI run. */
|
|
36
|
+
type DraftImageId = number;
|
|
37
|
+
/** Where a staged image's bytes came from. */
|
|
38
|
+
type DraftImageSource = {
|
|
39
|
+
readonly type: 'clipboard';
|
|
40
|
+
} | {
|
|
41
|
+
readonly type: 'path';
|
|
42
|
+
readonly path: string;
|
|
43
|
+
}
|
|
44
|
+
/** The image was pulled back from a queued message: its bytes are ALREADY
|
|
45
|
+
* durable with the harness (the recalled ref) — the draft holds no local
|
|
46
|
+
* copy and re-submitting reuses the ref instead of re-uploading. */
|
|
47
|
+
| {
|
|
48
|
+
readonly type: 'recalled';
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* One image staged in the editor draft. The draft holds the raw bytes so
|
|
52
|
+
* clipboard and path entries share one shape and a submit never depends on
|
|
53
|
+
* the source file still existing (plan §5.1). A RECALLED draft (pulled
|
|
54
|
+
* back from the queue) instead carries the durable `ImageAttachmentRef`
|
|
55
|
+
* and NO local bytes — the bytes stay in harness storage and re-submitting
|
|
56
|
+
* reuses the ref.
|
|
57
|
+
*/
|
|
58
|
+
interface DraftImage {
|
|
59
|
+
/** Per-TUI draft identity (the `#N` of the placeholder). */
|
|
60
|
+
readonly id: DraftImageId;
|
|
61
|
+
readonly kind: 'image';
|
|
62
|
+
readonly source: DraftImageSource;
|
|
63
|
+
/** Exact encoded bytes, held only for the draft lifetime. Empty for a
|
|
64
|
+
* recalled draft (its bytes live in harness storage). */
|
|
65
|
+
readonly bytes: Uint8Array;
|
|
66
|
+
readonly mediaType: ImageMediaType;
|
|
67
|
+
/** Intrinsic encoded width in pixels. */
|
|
68
|
+
readonly width: number;
|
|
69
|
+
/** Intrinsic encoded height in pixels. */
|
|
70
|
+
readonly height: number;
|
|
71
|
+
/** Exact encoded byte length (`bytes.byteLength` for local drafts; the
|
|
72
|
+
* durable ref's recorded `bytes` for recalled drafts). */
|
|
73
|
+
readonly byteLength: number;
|
|
74
|
+
/** Optional display name (basename for path sources), never a path. */
|
|
75
|
+
readonly name?: string;
|
|
76
|
+
/** The canonical editor placeholder text for this draft. */
|
|
77
|
+
readonly placeholder: string;
|
|
78
|
+
/** The durable ref this draft reuses on submit; present ONLY for
|
|
79
|
+
* recalled drafts (already-durable images are never re-uploaded). */
|
|
80
|
+
readonly recalledRef?: ImageAttachmentRefLike;
|
|
81
|
+
}
|
|
82
|
+
/** The store surface the placeholder expansion needs (structural). */
|
|
83
|
+
interface DraftImageStoreLike {
|
|
84
|
+
values(): readonly DraftImage[];
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
7
87
|
//#region src/diag.d.ts
|
|
8
88
|
interface Diag {
|
|
9
89
|
debug(message: string, fields?: Record<string, unknown>): void;
|
|
@@ -159,6 +239,23 @@ declare const SESSIONLESS_COMMANDS: Set<string>;
|
|
|
159
239
|
* body — there is no command-execution wire for skills.
|
|
160
240
|
*/
|
|
161
241
|
declare const LOCAL_COMMANDS: Set<string>;
|
|
242
|
+
/**
|
|
243
|
+
* Command semantics matrix (plan §19.3/M12): a LOCAL command line carrying a
|
|
244
|
+
* staged image placeholder is REJECTED — local commands are pure UI
|
|
245
|
+
* controls, never LLM prompts. AGENT-FACING input (plain prompts AND
|
|
246
|
+
* per-skill slash invocations like `/grilling`) SUPPORTS images: the skill
|
|
247
|
+
* wrapper builds its message through the same prepared-input path, so an
|
|
248
|
+
* image-bearing skill line is a real multimodal prompt (review finding 4).
|
|
249
|
+
* There is never a silent drop.
|
|
250
|
+
* @param parsed - the parsed slash command, undefined for a plain prompt.
|
|
251
|
+
* @param text - the submission text.
|
|
252
|
+
* @param store - the live draft store.
|
|
253
|
+
* @param isLocal - whether the command name is a LOCAL (TUI-owned/UI)
|
|
254
|
+
* command; skill names answer false.
|
|
255
|
+
*/
|
|
256
|
+
declare function commandRejectsImages(parsed: {
|
|
257
|
+
name: string;
|
|
258
|
+
} | undefined, text: string, store: DraftImageStoreLike, isLocal: (name: string) => boolean): boolean;
|
|
162
259
|
/**
|
|
163
260
|
* The AUTHORITATIVE host-owned command catalog (P1-04): every command name
|
|
164
261
|
* the TUI registers itself (registerTuiCommands in commands.ts) plus the
|
|
@@ -183,7 +280,23 @@ declare const HOST_COMMAND_CATALOG: ReadonlySet<string>;
|
|
|
183
280
|
*/
|
|
184
281
|
declare function shouldSteerOnEnter(parsed: {
|
|
185
282
|
name: string;
|
|
283
|
+
rawInput?: string;
|
|
186
284
|
} | undefined, running: boolean, busyEnter: string | undefined, forceQueue: boolean, isDynamicLocal?: (name: string) => boolean): boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Normalize an explicit `/skill <name> <args>` invocation to the skill's
|
|
287
|
+
* own slash line `/<name> <args>` (review finding 2). The harness's
|
|
288
|
+
* explicit skill gesture scans for `/<skill-name>` — it would extract
|
|
289
|
+
* `skill` from a raw `/skill grilling ...` line and never inject the
|
|
290
|
+
* grilling body. The command handler already performs this conversion
|
|
291
|
+
* (`loadSkill` builds `'/' + skill.name + ' ' + args`); the busy-Enter
|
|
292
|
+
* steer path must use the SAME normalized line so the body injects and
|
|
293
|
+
* any image placeholders ride along.
|
|
294
|
+
* @param text - the submitted line.
|
|
295
|
+
* @returns the normalized `/<name> <args>` line, or undefined when the
|
|
296
|
+
* line is not an explicit skill invocation (plain prompt, other
|
|
297
|
+
* commands, or the bare `/skill` picker).
|
|
298
|
+
*/
|
|
299
|
+
declare function normalizeSkillInvocation(text: string): string | undefined;
|
|
187
300
|
/**
|
|
188
301
|
* The advertised-claim miss decision (pure, exported for the headless
|
|
189
302
|
* suite): a slash input whose name was advertised by the completion list at
|
|
@@ -336,17 +449,6 @@ interface QueueFoldResult {
|
|
|
336
449
|
/** Failed settlement summaries not yet notified (the caller notifies). */
|
|
337
450
|
readonly failures: readonly string[];
|
|
338
451
|
}
|
|
339
|
-
/**
|
|
340
|
-
* Build the queue-pane rows for one inbox batch, dropping background-subagent
|
|
341
|
-
* settlement notices (the task browser is their surface) and reporting which
|
|
342
|
-
* FAILED settlements should notify. Pure and injectable so the filter +
|
|
343
|
-
* once-notify semantics are testable without the agent.
|
|
344
|
-
* @param messages - one inbox batch (next-turn or next-step), in order.
|
|
345
|
-
* @param mode - the delivery mode for surviving rows.
|
|
346
|
-
* @param notified - the notify-once guard; failed notices already in it are
|
|
347
|
-
* skipped, and a newly-reported id is ADDED here so a re-render can never
|
|
348
|
-
* double-notify.
|
|
349
|
-
*/
|
|
350
452
|
declare function foldQueueRows(messages: readonly QueueInboxMessage[], mode: 'followup' | 'steer', notified: Set<string>): QueueFoldResult;
|
|
351
453
|
/**
|
|
352
454
|
* Whether a shell command matches a destructive pattern. `rm` is treated
|
|
@@ -508,4 +610,4 @@ declare function recomposeBlank(ctx: Context, agent: {
|
|
|
508
610
|
*/
|
|
509
611
|
declare function apply(ctx: Context, config: Config): void;
|
|
510
612
|
//#endregion
|
|
511
|
-
export { AgentComposition, CompactionFold, Config, HOST_COMMAND_CATALOG, InitialCatalogResolution, LOCAL_COMMANDS, PendingSubagentCall, QueueFoldResult, QueueInboxMessage, QueueNoticeSource, RecomposableSession, RecomposeOutcome, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, SessionLockRefusedError, apply, busyAfterTurnBoundary, compactingFromLog, composeAgent, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, recomposeBlank, recordedPreset, registerCredentialSurfaceRefresh, resolveInitialCatalog, resumeCommand, runningProfile, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure };
|
|
613
|
+
export { AgentComposition, CompactionFold, Config, HOST_COMMAND_CATALOG, InitialCatalogResolution, LOCAL_COMMANDS, PendingSubagentCall, QueueFoldResult, QueueInboxMessage, QueueNoticeSource, RecomposableSession, RecomposeOutcome, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, SessionLockRefusedError, apply, busyAfterTurnBoundary, commandRejectsImages, compactingFromLog, composeAgent, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, registerCredentialSurfaceRefresh, resolveInitialCatalog, resumeCommand, runningProfile, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "./startup.mjs";
|
|
2
|
-
import { C as
|
|
3
|
-
export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, SessionLockRefusedError, apply, busyAfterTurnBoundary, compactingFromLog, composeAgent, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, recomposeBlank, recordedPreset, registerCredentialSurfaceRefresh, resolveInitialCatalog, resumeCommand, runningProfile, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure };
|
|
2
|
+
import { A as subagentJobViewHint, C as registerCredentialSurfaceRefresh, D as shouldConsumeAdvertisedMiss, E as runningProfile, N as forkSeed, O as shouldSteerOnEnter, S as recordedPreset, T as resumeCommand, _ as isUserQueueInput, a as SessionLockRefusedError, b as normalizeSkillInvocation, c as commandRejectsImages, d as dangerCommand, f as foldCompactionEvent, g as isSubagentSettlementNotice, h as isPlainExitPrompt, i as SESSIONLESS_COMMANDS, j as subagentNoticeIsFailure, k as subagentJobTranscriptId, l as compactingFromLog, m as inject, n as HOST_COMMAND_CATALOG, o as apply, p as foldQueueRows, r as LOCAL_COMMANDS, s as busyAfterTurnBoundary, t as Config, u as composeAgent, v as matchPendingSubagentCall, w as resolveInitialCatalog, x as recomposeBlank, y as name } from "./src-oZjot5jQ.mjs";
|
|
3
|
+
export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, SessionLockRefusedError, apply, busyAfterTurnBoundary, commandRejectsImages, compactingFromLog, composeAgent, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, registerCredentialSurfaceRefresh, resolveInitialCatalog, resumeCommand, runningProfile, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure };
|
|
@@ -35,6 +35,9 @@ interface TuiColorPalette {
|
|
|
35
35
|
diffGutter: string;
|
|
36
36
|
diffMeta: string;
|
|
37
37
|
roleUser: string;
|
|
38
|
+
/** Optional user-bubble background (dsh-web `--dsw-specific-bubble`
|
|
39
|
+
* parity); absent = no bubble block. */
|
|
40
|
+
roleUserBg?: string;
|
|
38
41
|
shellMode: string;
|
|
39
42
|
}
|
|
40
43
|
/** One autocomplete suggestion item (structural — the host maps it onto
|