@xmoon76/dsh-pi-tui 0.1.5 → 0.1.6
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/index.d.mts +94 -1
- package/dist/index.mjs +1389 -150
- package/package.json +1 -2
- package/scripts/naming-gate.mjs +43 -1
- package/scripts/repair-core.mjs +35 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
2
|
import { Agent, ModelSelectionRef } from "@deepseek-ai/dsh-agent";
|
|
3
|
+
import { ContentBlock } from "@deepseek-ai/dsh-llm";
|
|
3
4
|
import { SessionEvent, SessionId } from "@deepseek-ai/dsh-session";
|
|
4
5
|
import { CommandDescriptor } from "@deepseek-ai/dsh-commands";
|
|
5
6
|
import { EventEmitter } from "events";
|
|
@@ -14,6 +15,20 @@ interface Diag {
|
|
|
14
15
|
dispose(): void;
|
|
15
16
|
}
|
|
16
17
|
//#endregion
|
|
18
|
+
//#region src/tui-app.d.ts
|
|
19
|
+
/** One queued inbox row for the queue pane (mirrors the agent Inbox's lists). */
|
|
20
|
+
interface QueueItem {
|
|
21
|
+
/** The pending message id (agent inbox identity). */
|
|
22
|
+
id: string;
|
|
23
|
+
/** The message text, single-line display form. */
|
|
24
|
+
text: string;
|
|
25
|
+
/** next-turn followup vs next-step steer. */
|
|
26
|
+
mode: 'followup' | 'steer';
|
|
27
|
+
/** Plugin notice (e.g. a background-job completion): NOT steerable — it
|
|
28
|
+
* renders with its own marker and the hint drops the steer verbs. */
|
|
29
|
+
notice?: boolean;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
17
32
|
//#region src/skill-catalog.d.ts
|
|
18
33
|
/**
|
|
19
34
|
* The standing-scope skill catalog adapter: the SINGLE narrow seam between
|
|
@@ -212,6 +227,73 @@ declare function resolveInitialCatalog(options: ResolveInitialCatalogOptions): P
|
|
|
212
227
|
declare function subagentJobTranscriptId(snapshot: unknown): string | undefined;
|
|
213
228
|
/** Viewer body for a subagent job with no uniquely matched child. */
|
|
214
229
|
declare function subagentJobViewHint(status: string, detail: string | undefined): string;
|
|
230
|
+
/** The message-source projection the queue filter reads (a structural subset
|
|
231
|
+
* of dsh's message sources, so the helpers are testable without dsh types). */
|
|
232
|
+
interface QueueNoticeSource {
|
|
233
|
+
readonly form?: string;
|
|
234
|
+
readonly kind?: string;
|
|
235
|
+
readonly summary?: string;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Whether a plain submitted draft is the quit word: exactly `exit` (trimmed,
|
|
239
|
+
* lowercase). The runner intercepts this BEFORE any session creation or
|
|
240
|
+
* submission (shell muscle memory); anything else — `exit!`, `Exit`, or a
|
|
241
|
+
* draft with a recalled entry still in it — is an ordinary message.
|
|
242
|
+
* @param text - the submitted draft.
|
|
243
|
+
*/
|
|
244
|
+
declare function isPlainExitPrompt(text: string): boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Whether an inbox message is a BACKGROUND-SUBAGENT settlement notice — the
|
|
247
|
+
* runtime's account of a child ending, not steerable user input. Two dsh
|
|
248
|
+
* producers push these into the parent's inbox:
|
|
249
|
+
* - continuable children: `source.kind === 'subagent-settled'` (the
|
|
250
|
+
* continuation manager's settlement notice);
|
|
251
|
+
* - one-shot background subagent jobs: tool-jobs completion notices whose
|
|
252
|
+
* summary starts with the job kind (`subagent <label> [status: …]`).
|
|
253
|
+
* The queue pane mirrors the inbox, but these belong to the task browser
|
|
254
|
+
* (terminal job rows / inactive child rows), so the mirror drops them and
|
|
255
|
+
* only failures surface as a transient error notify.
|
|
256
|
+
* @param source - the message source projection, or undefined for a plain row.
|
|
257
|
+
*/
|
|
258
|
+
declare function isSubagentSettlementNotice(source: QueueNoticeSource | undefined): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Whether a subagent settlement notice reports FAILURE, classified on the
|
|
261
|
+
* producers' own deterministic wording:
|
|
262
|
+
* - `subagent-settled` summaries: "finished and will do no further work"
|
|
263
|
+
* is the only success wording; aborted / max-tokens / refusal / error /
|
|
264
|
+
* unknown endings all fail;
|
|
265
|
+
* - tool-jobs subagent summaries carry the terminal status line, whose
|
|
266
|
+
* failure statuses are `failed` and `killed` (dsh JobStatus).
|
|
267
|
+
* A notice that cannot be classified is treated as success (silent).
|
|
268
|
+
* @param source - the message source projection.
|
|
269
|
+
*/
|
|
270
|
+
declare function subagentNoticeIsFailure(source: QueueNoticeSource | undefined): boolean;
|
|
271
|
+
/** One inbox message as the queue mirror sees it (a structural projection). */
|
|
272
|
+
interface QueueInboxMessage {
|
|
273
|
+
readonly id: string;
|
|
274
|
+
readonly content: readonly ContentBlock[];
|
|
275
|
+
readonly source?: QueueNoticeSource;
|
|
276
|
+
}
|
|
277
|
+
/** The mirror result for one inbox batch: the rows to show plus the failed
|
|
278
|
+
* settlement summaries the caller should notify (each once). */
|
|
279
|
+
interface QueueFoldResult {
|
|
280
|
+
/** Queue rows (background-subagent settlement notices excluded). */
|
|
281
|
+
readonly rows: QueueItem[];
|
|
282
|
+
/** Failed settlement summaries not yet notified (the caller notifies). */
|
|
283
|
+
readonly failures: readonly string[];
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Build the queue-pane rows for one inbox batch, dropping background-subagent
|
|
287
|
+
* settlement notices (the task browser is their surface) and reporting which
|
|
288
|
+
* FAILED settlements should notify. Pure and injectable so the filter +
|
|
289
|
+
* once-notify semantics are testable without the agent.
|
|
290
|
+
* @param messages - one inbox batch (next-turn or next-step), in order.
|
|
291
|
+
* @param mode - the delivery mode for surviving rows.
|
|
292
|
+
* @param notified - the notify-once guard; failed notices already in it are
|
|
293
|
+
* skipped, and a newly-reported id is ADDED here so a re-render can never
|
|
294
|
+
* double-notify.
|
|
295
|
+
*/
|
|
296
|
+
declare function foldQueueRows(messages: readonly QueueInboxMessage[], mode: 'followup' | 'steer', notified: Set<string>): QueueFoldResult;
|
|
215
297
|
/**
|
|
216
298
|
* Whether a shell command matches a destructive pattern. `rm` is treated
|
|
217
299
|
* specially: any spelling of recursive + force flags (`rm -rf`, `rm -r -f`,
|
|
@@ -237,6 +319,17 @@ declare function runningProfile(argv?: readonly string[], fallback?: string): st
|
|
|
237
319
|
* @returns the resume command line, or undefined without a session.
|
|
238
320
|
*/
|
|
239
321
|
declare function resumeCommand(profile: string, sessionId: string): string | undefined;
|
|
322
|
+
/**
|
|
323
|
+
* A launch-time open-lock refusal: the requested session is held by another
|
|
324
|
+
* live dsh process (or its lock cannot be verified). Unlike a stale/missing
|
|
325
|
+
* session id, this is NOT recoverable by falling back to a fresh session —
|
|
326
|
+
* the user asked for a specific session and must resolve the holder first.
|
|
327
|
+
* Thrown from the resume path and re-thrown past the resume catch so the
|
|
328
|
+
* runner exits with the refusal as the error message.
|
|
329
|
+
*/
|
|
330
|
+
declare class SessionLockRefusedError extends Error {
|
|
331
|
+
constructor(message: string);
|
|
332
|
+
}
|
|
240
333
|
/** One agent's preset composition: the id to record and the setup that installs it. */
|
|
241
334
|
interface AgentComposition {
|
|
242
335
|
/** Preset id for the session header, absent when the deployment composes no roster. */
|
|
@@ -312,4 +405,4 @@ declare function recomposeBlank(ctx: Context, agent: {
|
|
|
312
405
|
*/
|
|
313
406
|
declare function apply(ctx: Context, config: Config): void;
|
|
314
407
|
//#endregion
|
|
315
|
-
export { AgentComposition, Config, InitialCatalogResolution, LOCAL_COMMANDS, RecomposableSession, RecomposeOutcome, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, apply, composeAgent, dangerCommand, forkSeed, inject, name, recomposeBlank, recordedPreset, resolveInitialCatalog, resumeCommand, runningProfile, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint };
|
|
408
|
+
export { AgentComposition, Config, InitialCatalogResolution, LOCAL_COMMANDS, QueueFoldResult, QueueInboxMessage, QueueNoticeSource, RecomposableSession, RecomposeOutcome, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, SessionLockRefusedError, apply, composeAgent, dangerCommand, foldQueueRows, forkSeed, inject, isPlainExitPrompt, isSubagentSettlementNotice, name, recomposeBlank, recordedPreset, resolveInitialCatalog, resumeCommand, runningProfile, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure };
|