@toddzheng024/dscode-bundle 0.7.11 → 0.7.13

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 (154) hide show
  1. package/THIRD_PARTY_NOTICES.md +3 -3
  2. package/cordis.patch.yml +1 -1
  3. package/package.json +5 -4
  4. package/plugins/i18n/messages.mjs +6 -6
  5. package/plugins/session-metrics/view.mjs +16 -5
  6. package/plugins/tui-tools/index.mjs +14 -1
  7. package/vendor/tui/lib/app.mjs +6674 -0
  8. package/vendor/tui/lib/approval.mjs +122 -0
  9. package/vendor/tui/lib/attachments.mjs +218 -0
  10. package/vendor/tui/lib/authorization-panel.mjs +242 -0
  11. package/vendor/tui/lib/authorization.mjs +111 -0
  12. package/vendor/tui/lib/commands.mjs +123 -0
  13. package/vendor/tui/lib/dscode/chat.mjs +64 -0
  14. package/vendor/tui/lib/dscode/flags.mjs +32 -0
  15. package/vendor/tui/lib/dscode/model-search.mjs +68 -0
  16. package/vendor/tui/lib/dscode/paste.mjs +87 -0
  17. package/vendor/tui/lib/dscode/telemetry.mjs +82 -0
  18. package/vendor/tui/lib/dscode/welcome.mjs +100 -0
  19. package/vendor/tui/lib/editor-keys.mjs +346 -0
  20. package/vendor/tui/lib/editor.mjs +50 -0
  21. package/vendor/tui/lib/fork.mjs +24 -0
  22. package/vendor/tui/lib/git-workflow.mjs +278 -0
  23. package/vendor/tui/{types/history.d.ts → lib/history.mjs} +69 -26
  24. package/vendor/tui/{types/i18n.d.ts → lib/i18n.mjs} +23 -15
  25. package/vendor/tui/lib/index.mjs +2198 -0
  26. package/vendor/tui/lib/input-split.mjs +170 -0
  27. package/vendor/tui/lib/internals.mjs +90 -0
  28. package/vendor/tui/lib/invariant.mjs +22 -0
  29. package/vendor/tui/lib/kernel-panels.mjs +1265 -0
  30. package/vendor/tui/lib/keyboard.mjs +283 -0
  31. package/vendor/tui/lib/language-panel.mjs +41 -0
  32. package/vendor/tui/lib/locales/en.mjs +495 -0
  33. package/vendor/tui/lib/locales/zh.mjs +495 -0
  34. package/vendor/tui/lib/mentions.mjs +150 -0
  35. package/vendor/tui/lib/model-capabilities.mjs +245 -0
  36. package/vendor/tui/lib/models.mjs +215 -0
  37. package/vendor/tui/{types/panel-accent.d.ts → lib/panel-accent.mjs} +11 -7
  38. package/vendor/tui/lib/permissions.mjs +45 -0
  39. package/vendor/tui/lib/plugin-inventory.mjs +27 -0
  40. package/vendor/tui/lib/presets.mjs +46 -0
  41. package/vendor/tui/lib/provider-settings.mjs +600 -0
  42. package/vendor/tui/lib/questions.mjs +116 -0
  43. package/vendor/tui/lib/rainbow.mjs +181 -0
  44. package/vendor/tui/lib/render/animations.mjs +665 -0
  45. package/vendor/tui/lib/render/editor.mjs +437 -0
  46. package/vendor/tui/lib/render/export.mjs +119 -0
  47. package/vendor/tui/lib/render/fuzzy.mjs +79 -0
  48. package/vendor/tui/lib/render/ime-cursor.mjs +135 -0
  49. package/vendor/tui/lib/render/inspector.mjs +93 -0
  50. package/vendor/tui/lib/render/lines.mjs +538 -0
  51. package/vendor/tui/lib/render/markdown.mjs +592 -0
  52. package/vendor/tui/lib/render/projection.mjs +1862 -0
  53. package/vendor/tui/lib/render/status.mjs +591 -0
  54. package/vendor/tui/lib/render/text.mjs +157 -0
  55. package/vendor/tui/lib/render/tool-detail.mjs +187 -0
  56. package/vendor/tui/lib/render/tool-preview.mjs +79 -0
  57. package/vendor/tui/lib/render/usage.mjs +336 -0
  58. package/vendor/tui/lib/render/width.mjs +191 -0
  59. package/vendor/tui/lib/session-directory.mjs +329 -0
  60. package/vendor/tui/lib/session-query.mjs +184 -0
  61. package/vendor/tui/lib/session-switch.mjs +51 -0
  62. package/vendor/tui/lib/settings-file.mjs +75 -0
  63. package/vendor/tui/lib/skills.mjs +119 -0
  64. package/vendor/tui/lib/startup.mjs +111 -0
  65. package/vendor/tui/lib/store.mjs +129 -0
  66. package/vendor/tui/lib/subagents.mjs +200 -0
  67. package/vendor/tui/lib/terminal-title.mjs +186 -0
  68. package/vendor/tui/lib/theme-panel.mjs +60 -0
  69. package/vendor/tui/lib/theme.mjs +379 -0
  70. package/vendor/tui/lib/update-panel.mjs +239 -0
  71. package/vendor/tui/lib/update.mjs +101 -0
  72. package/vendor/tui/lib/version.mjs +105 -0
  73. package/vendor/tui/lib/whale-glyph.mjs +20 -0
  74. package/vendor/tui/LICENSE +0 -21
  75. package/vendor/tui/devtools-CdTl3MNy.mjs +0 -3643
  76. package/vendor/tui/dscode-email/cli.mjs +0 -32
  77. package/vendor/tui/dscode-email/contacts.mjs +0 -36
  78. package/vendor/tui/dscode-email/gmail-oauth.mjs +0 -69
  79. package/vendor/tui/dscode-email/gmail-store.mjs +0 -2
  80. package/vendor/tui/dscode-email/gmail.mjs +0 -194
  81. package/vendor/tui/dscode-email/imap.mjs +0 -136
  82. package/vendor/tui/dscode-email/inbox.d.mts +0 -25
  83. package/vendor/tui/dscode-email/inbox.mjs +0 -76
  84. package/vendor/tui/dscode-email/smtp.mjs +0 -69
  85. package/vendor/tui/dscode-email/store.mjs +0 -32
  86. package/vendor/tui/dscode-providers/catalog.mjs +0 -136
  87. package/vendor/tui/dscode-providers/effort.mjs +0 -35
  88. package/vendor/tui/dscode-providers/openrouter-account.mjs +0 -171
  89. package/vendor/tui/index.mjs +0 -44483
  90. package/vendor/tui/invariant.mjs +0 -21
  91. package/vendor/tui/rolldown-runtime-CMFfr-1z.mjs +0 -26
  92. package/vendor/tui/session-query.mjs +0 -150
  93. package/vendor/tui/startup.mjs +0 -109
  94. package/vendor/tui/theme-7u5Qo3dF.mjs +0 -1265
  95. package/vendor/tui/types/app.d.ts +0 -348
  96. package/vendor/tui/types/approval.d.ts +0 -59
  97. package/vendor/tui/types/attachments.d.ts +0 -52
  98. package/vendor/tui/types/authorization-panel.d.ts +0 -22
  99. package/vendor/tui/types/authorization.d.ts +0 -36
  100. package/vendor/tui/types/commands.d.ts +0 -52
  101. package/vendor/tui/types/editor-keys.d.ts +0 -105
  102. package/vendor/tui/types/editor.d.ts +0 -6
  103. package/vendor/tui/types/fork.d.ts +0 -8
  104. package/vendor/tui/types/git-workflow.d.ts +0 -121
  105. package/vendor/tui/types/index.d.ts +0 -223
  106. package/vendor/tui/types/input-split.d.ts +0 -54
  107. package/vendor/tui/types/internals.d.ts +0 -26
  108. package/vendor/tui/types/invariant.d.ts +0 -15
  109. package/vendor/tui/types/kernel-panels.d.ts +0 -245
  110. package/vendor/tui/types/keyboard.d.ts +0 -80
  111. package/vendor/tui/types/language-panel.d.ts +0 -12
  112. package/vendor/tui/types/locales/en.d.ts +0 -450
  113. package/vendor/tui/types/locales/zh.d.ts +0 -9
  114. package/vendor/tui/types/mentions.d.ts +0 -85
  115. package/vendor/tui/types/model-capabilities.d.ts +0 -82
  116. package/vendor/tui/types/models.d.ts +0 -133
  117. package/vendor/tui/types/permissions.d.ts +0 -27
  118. package/vendor/tui/types/plugin-inventory.d.ts +0 -11
  119. package/vendor/tui/types/presets.d.ts +0 -22
  120. package/vendor/tui/types/provider-settings.d.ts +0 -239
  121. package/vendor/tui/types/questions.d.ts +0 -54
  122. package/vendor/tui/types/rainbow.d.ts +0 -69
  123. package/vendor/tui/types/render/animations.d.ts +0 -307
  124. package/vendor/tui/types/render/editor.d.ts +0 -163
  125. package/vendor/tui/types/render/export.d.ts +0 -9
  126. package/vendor/tui/types/render/fuzzy.d.ts +0 -21
  127. package/vendor/tui/types/render/ime-cursor.d.ts +0 -60
  128. package/vendor/tui/types/render/inspector.d.ts +0 -62
  129. package/vendor/tui/types/render/lines.d.ts +0 -86
  130. package/vendor/tui/types/render/markdown.d.ts +0 -29
  131. package/vendor/tui/types/render/projection.d.ts +0 -587
  132. package/vendor/tui/types/render/status.d.ts +0 -196
  133. package/vendor/tui/types/render/text.d.ts +0 -64
  134. package/vendor/tui/types/render/tool-detail.d.ts +0 -94
  135. package/vendor/tui/types/render/tool-preview.d.ts +0 -28
  136. package/vendor/tui/types/render/usage.d.ts +0 -113
  137. package/vendor/tui/types/render/width.d.ts +0 -29
  138. package/vendor/tui/types/session-directory.d.ts +0 -190
  139. package/vendor/tui/types/session-query.d.ts +0 -92
  140. package/vendor/tui/types/session-switch.d.ts +0 -17
  141. package/vendor/tui/types/settings-file.d.ts +0 -41
  142. package/vendor/tui/types/skills.d.ts +0 -47
  143. package/vendor/tui/types/startup.d.ts +0 -65
  144. package/vendor/tui/types/store.d.ts +0 -58
  145. package/vendor/tui/types/subagents.d.ts +0 -70
  146. package/vendor/tui/types/terminal-title.d.ts +0 -66
  147. package/vendor/tui/types/theme-panel.d.ts +0 -24
  148. package/vendor/tui/types/theme.d.ts +0 -434
  149. package/vendor/tui/types/update-panel.d.ts +0 -49
  150. package/vendor/tui/types/update.d.ts +0 -75
  151. package/vendor/tui/types/version.d.ts +0 -19
  152. package/vendor/tui/types/whale-glyph.d.ts +0 -6
  153. /package/vendor/tui/{dscode-clipboard-image → lib/dscode/clipboard-image}/clipboard-image.swift +0 -0
  154. /package/vendor/tui/{dscode-clipboard-image → lib/dscode/clipboard-image}/index.mjs +0 -0
@@ -1,82 +0,0 @@
1
- /**
2
- * Same-id reasoning-capability inheritance for hand-declared pi-ai routes:
3
- * the model catalog inherits capabilities by route key, not by model id, so a
4
- * relay route listing `gpt-5.5` reads nothing from the installed `openai`
5
- * catalog entry and materializes as `reasoning: false` until its settings
6
- * entry declares `reasoningEfforts`. This adapter closes that gap without
7
- * touching upstream: whenever a pi-ai profile's model entry carries no
8
- * declaration and its live row advertises no efforts, but the same model id
9
- * is declared (in a sibling settings entry) or advertised (on another route)
10
- * elsewhere, the declaration is materialized into settings — verbatim from a
11
- * sibling declaration when one exists, otherwise as an identity level map
12
- * (`off` maps to null, every other level to its own name), which is the
13
- * correct wire spelling for OpenAI-compatible relays. Writes ride the same
14
- * `settings.mutate` path as the provider panel, so the upstream
15
- * `assertServiceable` gate still rejects anything invalid atomically.
16
- *
17
- * @module @deepseek-ai/dsh-tui/model-capabilities
18
- */
19
- import type { Context } from '@deepseek-ai/cordis';
20
- import { type ModelRow } from './models.ts';
21
- /** A notice sink structurally compatible with the app bridge's `notify`. */
22
- export type CapabilityNotice = (text: string, tone?: 'info' | 'warning' | 'error') => void;
23
- /** One pi-ai provider profile as stored in settings, addressed for mutation. */
24
- export interface CapabilityProfileSource {
25
- /** Settings namespace owning the profile (`llm-pi-ai`). */
26
- readonly settingsNs: string;
27
- /** Path from the section root to this provider's profile. */
28
- readonly settingsPath: readonly string[];
29
- /** Revision of the owning section at read time. */
30
- readonly revision: number;
31
- /** Raw model entries, exactly as stored (declaration fields included). */
32
- readonly models: readonly Record<string, unknown>[];
33
- }
34
- /** One planned per-provider models rewrite. */
35
- export interface CapabilitySyncPlan {
36
- /** Provider route the plan targets. */
37
- readonly provider: string;
38
- /** Settings namespace owning the profile. */
39
- readonly settingsNs: string;
40
- /** Path from the section root to the provider profile. */
41
- readonly settingsPath: readonly string[];
42
- /** Raw model entries, exactly as stored (declaration fields included). */
43
- readonly models: readonly Record<string, unknown>[];
44
- /** Fingerprint of the source models array this plan was derived from. */
45
- readonly sourceFingerprint: string;
46
- /** Document revision of the owning section when the plan was derived. */
47
- readonly sourceRevision: number;
48
- /** Model ids that gained a declaration, notice-facing. */
49
- readonly inherited: readonly string[];
50
- /** `provider/model` labels the declarations came from, notice-facing. */
51
- readonly sources: readonly string[];
52
- }
53
- /**
54
- * Plan the reasoning declarations to materialize. A model entry inherits
55
- * when it declares nothing (`reasoningEfforts` absent — a dict or `false` is
56
- * an explicit choice and is never touched) and its live row advertises no
57
- * efforts; the donor is the first sibling settings declaration for the same
58
- * id, copied verbatim so dialect wire spellings survive, otherwise the first
59
- * other-route row advertising efforts for that id, mapped by identity.
60
- * Entries never lose fields and keep their key order; a provider appears in
61
- * the result only when at least one entry changes.
62
- * @param input - the live model rows and the raw pi-ai profiles from settings.
63
- * @returns one plan per provider with at least one inheritance.
64
- */
65
- export declare function planCapabilitySync(input: {
66
- readonly rows: readonly ModelRow[];
67
- readonly profiles: ReadonlyMap<string, CapabilityProfileSource>;
68
- }): readonly CapabilitySyncPlan[];
69
- /**
70
- * Materialize same-id reasoning declarations once per provider. Reads the
71
- * configurable directory, the redacted settings document, and the live model
72
- * rows; plans; then writes each provider's merged models array through
73
- * `settings.mutate` under a fresh revision (writes bump the section
74
- * revision, so per-plan revisions are re-read). Every failure converges to a
75
- * single-line notice — the caller's promise never rejects and the session
76
- * keeps running on the previous configuration.
77
- * @param ctx - context carrying the `llm` and `settings` services (optional).
78
- * @param notify - the app bridge's notice sink, when one is live.
79
- */
80
- export declare function syncModelCapabilities(ctx: Context, notify?: CapabilityNotice): Promise<void>;
81
- /** Test seam: forget the applied-write fingerprints. */
82
- export declare function resetCapabilitySyncState(): void;
@@ -1,133 +0,0 @@
1
- /**
2
- * Model directory for the `/model` panel: the in-process equivalent of the
3
- * web host's model catalog (`buildModelCatalog`), reading the advisory
4
- * `ctx.llm` registry directly. Catalog membership is advisory — a route
5
- * serving a model it stopped advertising stays usable — so selection never
6
- * fails on catalog absence alone.
7
- *
8
- * @module @deepseek-ai/dsh-tui/models
9
- */
10
- import type { Context } from '@deepseek-ai/cordis';
11
- import type { ModelSelection } from '@deepseek-ai/dsh-agent';
12
- import type { SessionEvent } from '@deepseek-ai/dsh-session';
13
- import { type LlmCallConfig, type LlmModelReasoningInfo, type ModelModality } from '@deepseek-ai/dsh-llm';
14
- /** Display metadata for one adapter-owned reasoning effort (mirrors `LlmReasoningEffortInfo`). */
15
- export interface ModelReasoningEffort {
16
- /** Opaque value accepted by the model's `GenerateOptions.reasoningEffort`. */
17
- id: string;
18
- /** Human-readable effort name for selectors. */
19
- name: string;
20
- /** Optional user-facing distinction from otherwise similar efforts. */
21
- description?: string;
22
- }
23
- /** Selectable reasoning efforts for one model (mirrors `LlmModelReasoningInfo`). */
24
- export interface ModelReasoning {
25
- /** Supported efforts in adapter-preferred display order. */
26
- efforts: readonly ModelReasoningEffort[];
27
- /** Adapter-configured default materialized when callers omit an effort. */
28
- defaultEffort?: string;
29
- }
30
- /** One selectable row in the `/model` panel. */
31
- export interface ModelRow {
32
- /** Registered provider route. */
33
- provider: string;
34
- /** Display name of the provider route. */
35
- providerName: string;
36
- /** Provider-owned model id. */
37
- model: string;
38
- /** Human-readable model name. */
39
- modelName: string;
40
- /** Request modalities advertised for this exact route; absent means unknown. */
41
- inputModalities?: readonly ModelModality[];
42
- /** Adapter-owned selectable reasoning levels when the model exposes any. */
43
- reasoning?: ModelReasoning;
44
- }
45
- /** The resolved directory: rows plus per-provider discovery failures. */
46
- export interface ModelDirectory {
47
- /** Advisory rows, provider-major in registry order. */
48
- rows: readonly ModelRow[];
49
- /** Provider ids whose model listing failed; those providers contribute no rows. */
50
- failures: readonly string[];
51
- /**
52
- * `provider/model` labels whose per-model capability lookup failed. Those
53
- * rows still appear (advisory degrade, mirroring the web catalog), but
54
- * without an effort picker — a picker caller must not misread the absence
55
- * as "this model exposes no reasoning" (e.g. deepseek-v4-flash always
56
- * advertises off/high/max unless thinking is disabled). Optional for
57
- * callers that shape a directory by hand; {@link loadModelDirectory}
58
- * always populates it (empty when nothing failed).
59
- */
60
- reasoningFailures?: readonly string[];
61
- }
62
- /** Map an adapter's reasoning capability onto the panel's plain-id shape. */
63
- export declare function mapReasoning(reasoning: LlmModelReasoningInfo): ModelReasoning;
64
- /**
65
- * Resolve the effective model selection for one live session, in the
66
- * documented precedence: the in-process explicit pick, then the session's
67
- * last `request/header` config, then the deployment default.
68
- * @param picked - the explicit selection made in this process, when any.
69
- * @param logged - the last logged request header config, when any.
70
- * @param defaults - the deployment default selection.
71
- * @returns the effective selection, carrying a reasoning effort when one is in force.
72
- */
73
- export declare function resolveEffectiveSelection(picked: ModelSelection | undefined, logged: {
74
- provider: string;
75
- model: string;
76
- reasoningEffort?: string;
77
- } | undefined, defaults: ModelSelection): ModelSelection;
78
- /**
79
- * The session log's unconsumed explicit model selection (the resume layer of
80
- * the documented precedence). `model/selection` events are log-only facts the
81
- * web host's session-controller appends when its user picks a model for the
82
- * NEXT request; a request header assembling exactly that selection retires
83
- * it, while a header for different values (another route forced the request)
84
- * leaves it armed. Seeding the resumed pick from here restores a selection
85
- * that was made but never sent — the request header alone would answer with
86
- * the older model.
87
- * @param events - the full persisted event list of the resumed session.
88
- * @returns the still-pending selection, when one exists.
89
- */
90
- export declare function pendingModelSelection(events: readonly SessionEvent[]): ModelSelection | undefined;
91
- /**
92
- * Build the selection one `/model` pick applies, rejecting an effort the
93
- * row does not advertise. The row is the picker's source of truth, so a
94
- * stale directory cannot smuggle an unsupported effort into the next step
95
- * (the request pipeline would reject it before network I/O regardless). The
96
- * empty string is the picker's "provider default" sentinel — an explicit
97
- * choice to leave the effort to the model's own default, exactly like an
98
- * absent effort.
99
- * @param row - the picked model row.
100
- * @param effortId - the chosen advertised effort, '' or undefined for the model default.
101
- * @returns the selection the runner records for the next assembled step.
102
- */
103
- export declare function buildModelSelection(row: ModelRow, effortId?: string): ModelSelection;
104
- /** Display label for one applied selection: `provider/model` or `provider/model@effort`. */
105
- export declare function modelSelectionLabel(selection: ModelSelection): string;
106
- /**
107
- * Apply one model selection onto a resolved request config — the exact
108
- * semantics of the kernel's `installModelSelection` request listener,
109
- * extracted so the TUI can mirror it for subagent-origin requests: children
110
- * spawned by the subagent tool inherit the parent's CREATE-TIME AgentOptions,
111
- * which a mid-session /model switch never touches, so delegated work would
112
- * otherwise keep running on the launch-time route. An absent effort strips
113
- * any inherited effort (restoring the selected model's provider default),
114
- * matching the kernel listener field-for-field.
115
- * @param resolved - the config the inner chain produced.
116
- * @param selection - the selection to enforce.
117
- * @returns the overridden config.
118
- */
119
- export declare function applyModelSelectionToConfig(resolved: LlmCallConfig, selection: ModelSelection): LlmCallConfig;
120
- /**
121
- * Load the selectable model directory from the live `ctx.llm` registry.
122
- * Providers are listed synchronously; each provider's models are discovered
123
- * with a bounded parallel fan-out whose failures degrade to that provider
124
- * contributing no rows (mirrors the web catalog's per-provider failures).
125
- * Each row's reasoning levels are resolved per exact model like the web
126
- * catalog (`buildModelCatalog`); a single model's capability lookup failure
127
- * degrades to that row having no effort picker rather than hiding the model,
128
- * and the failure rides `reasoningFailures` so the caller can tell "no
129
- * advertised reasoning" from "capability lookup failed".
130
- * @param ctx - context carrying the `llm` service.
131
- * @returns the resolved directory; empty rows when `llm` is unavailable.
132
- */
133
- export declare function loadModelDirectory(ctx: Context): Promise<ModelDirectory>;
@@ -1,27 +0,0 @@
1
- /** Permission-preset policy for pending and active TUI sessions. */
2
- import type { Context } from '@deepseek-ai/cordis';
3
- import type { PermissionPresetService } from '@deepseek-ai/dsh-permission-presets';
4
- import type { Session } from '@deepseek-ai/dsh-session';
5
- /** One selectable permission preset row for the /permission panel. */
6
- export interface PermissionRow {
7
- readonly id: string;
8
- readonly description?: string;
9
- }
10
- /** Public compatibility alias for the official upstream permission service. */
11
- export type PermissionPresetsService = PermissionPresetService;
12
- /** Read the optional Harness service without importing its runtime package. */
13
- export declare function permissionPresetsFrom(ctx: Context): PermissionPresetsService | undefined;
14
- /** Effective label for either an active session or the not-yet-created first one. */
15
- export declare function effectivePermission(service: PermissionPresetsService, session: Session | undefined, pending: string | undefined): string;
16
- /** Validate a preset and write it only when a durable session already exists. */
17
- export declare function selectPermission(service: PermissionPresetsService, session: Session | undefined, preset: string): string;
18
- /** Cycle table order from the active, pending, or configured-default value. */
19
- export declare function cyclePermission(service: PermissionPresetsService, session: Session | undefined, pending: string | undefined): string;
20
- /** Materialize a pre-session choice after Harness creates the first session. */
21
- export declare function applyPendingPermission(service: PermissionPresetsService, session: Session, pending: string | undefined): void;
22
- /**
23
- * List every switchable preset for the /permission panel, table order kept.
24
- * Description lookup failures degrade to an undocumented row, never a failed
25
- * panel load — `optionOf` rejects names its table no longer knows.
26
- */
27
- export declare function listPermissionRows(service: PermissionPresetsService): readonly PermissionRow[];
@@ -1,11 +0,0 @@
1
- /** Read-only projection of Cordis Loader entries for /plugin. */
2
- import type { Context } from '@deepseek-ai/cordis';
3
- export type PluginPhase = 'pending' | 'loading' | 'active' | 'failed' | 'unloading' | null;
4
- export interface PluginRow {
5
- readonly entryId: string;
6
- readonly moduleName: string;
7
- readonly enabled: boolean;
8
- readonly phase: PluginPhase;
9
- }
10
- /** Snapshot the live Loader; group-only rows are composition containers, not plugins. */
11
- export declare function listPluginRows(ctx: Context): PluginRow[];
@@ -1,22 +0,0 @@
1
- /** Agent-preset policy kept independent from the Ink surface. */
2
- import type { Context } from '@deepseek-ai/cordis';
3
- import type { Agent } from '@deepseek-ai/dsh-agent';
4
- import type { AgentPreset, AgentPresets } from '@deepseek-ai/dsh-agent-presets';
5
- import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
6
- /** One discoverable agent composition. */
7
- export type PresetRow = AgentPreset;
8
- /** Public compatibility alias for the official upstream service type. */
9
- export type AgentPresetsService = AgentPresets;
10
- /** Read an optional Cordis service without requiring its package at build time. */
11
- export declare function agentPresetsFrom(ctx: Context): AgentPresetsService | undefined;
12
- /** A preset may change only before the first durable turn begins. */
13
- export declare function isBlankSession(events: readonly SessionEvent[]): boolean;
14
- /** Translate a preset id recorded before an upstream rename to its current id. */
15
- export declare function normalizePresetId(id: string): string;
16
- export declare function normalizePresetId(id: string | undefined): string | undefined;
17
- /** Latest logged selection wins; legacy sessions deliberately fall back to standard. */
18
- export declare function resolvePreset(session: Pick<Session, 'header' | 'snapshotEvents'>): string;
19
- /** Resolve a pre-session choice, or recompose an active blank Agent. */
20
- export declare function selectPreset(service: AgentPresetsService, agent: Agent | undefined, presetId: string): Promise<PresetRow>;
21
- /** Recompose atomically from the caller's perspective, logging only success. */
22
- export declare function switchPreset(service: AgentPresetsService, agent: Agent, presetId: string): Promise<PresetRow>;
@@ -1,239 +0,0 @@
1
- /**
2
- * Provider settings adapter for the TUI `/model` provider-management panel:
3
- * the same-process equivalent of the web host's Models page join
4
- * (`packages/client/ui-settings-models`), reading the advisory `ctx.llm`
5
- * registry, the redacted `ctx.settings` descriptors, and the value-free
6
- * `ctx.credentials` facts directly. Secrets never cross this module: settings
7
- * are read with `redactSecrets: true`, credentials are only ever described
8
- * (never resolved), and every message is single-line without embedding key
9
- * data.
10
- *
11
- * @module @deepseek-ai/dsh-tui/provider-settings
12
- */
13
- import type { Context } from '@deepseek-ai/cordis';
14
- /**
15
- * The conventional credential reference for a provider route: `<ROUTE>_API_KEY`
16
- * with the route uppercased and every non-alphanumeric run collapsed to one
17
- * underscore — the exact derivation the official Models page uses
18
- * (`deriveKeyRef` in `ui-settings-models`), so a key saved here is found there.
19
- * @param provider - provider route id (e.g. `pi-ai`, `minimax-cn`).
20
- * @returns the derived reference name (e.g. `PI_AI_API_KEY`).
21
- */
22
- export declare function deriveCredentialRef(provider: string): string;
23
- /** Value-free facts about one credential reference — never the value. */
24
- export interface ProviderCredentialFacts {
25
- /** Whether the reference currently resolves to a stored value. */
26
- readonly configured: boolean;
27
- /** Source layer supplying the value; absent while unconfigured. */
28
- readonly source?: string;
29
- /** Whether a write through this panel would currently succeed. */
30
- readonly writable: boolean;
31
- }
32
- /**
33
- * One row's credential state: value-free facts once the reference was
34
- * described, a bounded error when that describe failed (the row itself is
35
- * never dropped), or `undefined` when the row names no reference to describe —
36
- * an unmanaged active provider, a dormant route, or a profile authenticating
37
- * through the provider's own path.
38
- */
39
- export type ProviderCredentialView = ({
40
- readonly kind: 'facts';
41
- } & ProviderCredentialFacts) | {
42
- readonly kind: 'error';
43
- readonly message: string;
44
- };
45
- /** One explicit model enabled for a provider profile. */
46
- export interface ProviderModelSettings {
47
- readonly id: string;
48
- readonly name?: string;
49
- readonly contextWindow?: number;
50
- readonly maxTokens?: number;
51
- /**
52
- * Remaining entry fields the editor does not model (`reasoningEfforts`,
53
- * `compat`, `input`, …), carried verbatim so a save preserves them.
54
- * Populated by {@link loadProviderSettings}; never contains the four
55
- * modelled keys.
56
- */
57
- readonly extras?: Readonly<Record<string, unknown>>;
58
- }
59
- /** The small, portable subset of a provider profile the terminal edits. */
60
- export interface ProviderConfiguration {
61
- readonly baseURL?: string;
62
- /**
63
- * Wire protocol the stored profile names (e.g. `openai-responses`), when it
64
- * names one. Load-only: the editor never writes it, but endpoint discovery
65
- * passes it so the listing speaks the same protocol as real requests.
66
- */
67
- readonly api?: string;
68
- readonly models: readonly ProviderModelSettings[];
69
- }
70
- /** One model an endpoint reported about itself (mirrors `LlmDiscoveredModel`). */
71
- export interface DiscoveredModelView {
72
- /** Model id the endpoint accepts. */
73
- readonly id: string;
74
- /** Human-readable name when the endpoint supplies one. */
75
- readonly name?: string;
76
- /** Context window when disclosed; adoption still owes it if absent. */
77
- readonly contextWindow?: number;
78
- /** Output cap when disclosed. */
79
- readonly maxTokens?: number;
80
- }
81
- /**
82
- * The seven canonical reasoning levels a reasoningEfforts key may name -
83
- * pi-ai's THINKING_LEVELS. A pi-ai upgrade that adds or removes one fails
84
- * upstream's own drift gate; this mirror exists so the terminal editor can
85
- * validate drafts without importing the pi-ai package.
86
- */
87
- export declare const REASONING_EFFORT_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
88
- /**
89
- * One stored reasoningEfforts declaration: a display-level to wire-value map
90
- * (null sends no reasoning parameter), an explicit false disabling the
91
- * picker, or undefined leaving the entry to inherit.
92
- */
93
- export type ReasoningEffortsValue = Record<string, string | null> | false | undefined;
94
- /** Whether a raw extras value is a declared efforts dict (non-empty, non-false). */
95
- export declare function isDeclaredReasoningEfforts(value: unknown): value is Record<string, string | null>;
96
- /**
97
- * Parse the setup page's compact efforts draft into a storable declaration.
98
- * Grammar: empty = clear back to inherit; the single token "false" = disable
99
- * the picker; otherwise space-separated level:wire pairs where level is one
100
- * of REASONING_EFFORT_LEVELS and wire is any non-empty string or the literal
101
- * "null" (send no parameter).
102
- */
103
- export declare function parseReasoningEffortsDraft(draft: string): {
104
- readonly ok: true;
105
- readonly value: ReasoningEffortsValue;
106
- } | {
107
- readonly ok: false;
108
- readonly error: string;
109
- };
110
- /** Serialize a stored declaration back to the compact draft form (stored key order preserved). */
111
- export declare function serializeReasoningEfforts(value: unknown): string;
112
- /**
113
- * One provider row in the TUI provider-management panel: the configurable
114
- * directory entry joined with its settings profile and credential facts.
115
- * Every mutation below addresses this row, and the caller passes the row back
116
- * after re-loading so the revision/ref facts are current.
117
- */
118
- export interface ProviderTargetView {
119
- /** Provider route id (`GenerateOptions.provider`). */
120
- readonly provider: string;
121
- /** Human-readable provider name. */
122
- readonly displayName: string;
123
- /** Whether an adapter currently serves this route. */
124
- readonly active: boolean;
125
- /** User-settings namespace whose section configures this provider; '' when unmanaged. */
126
- readonly settingsNs: string;
127
- /** Path from that section's root to this provider's profile; [] when the whole section is the profile. */
128
- readonly settingsPath: readonly string[];
129
- /** Revision of the owning settings section at load (0 when no namespace resolved). */
130
- readonly settingsRevision: number;
131
- /** Whether the resolved profile exists (the whole section, or at `settingsPath`). */
132
- readonly configured: boolean;
133
- /** Whether only the user settings layer carries the profile, so removal restores the base. */
134
- readonly removable: boolean;
135
- /** The credential reference the resolved profile names, when one does. */
136
- readonly credentialRef?: string;
137
- /** The conventional reference a save uses for a dormant or ref-less profile. */
138
- readonly suggestedRef: string;
139
- /** Credential facts, a bounded describe error, or undefined when there is no ref to describe. */
140
- readonly credential: ProviderCredentialView | undefined;
141
- /** Endpoint and explicit model overrides visible to the provider editor. */
142
- readonly configuration: ProviderConfiguration;
143
- /** The owning adapter reports this route as hand-declared (absent when it draws no distinction). */
144
- readonly declared?: boolean;
145
- /**
146
- * Configuration diagnostic the adapter reported for this route (catalog or
147
- * profile damage): the row stays listed and repairable instead of the whole
148
- * provider vanishing; absent when the route reads clean.
149
- */
150
- readonly diagnostic?: string;
151
- }
152
- /** The resolved provider/settings/credential join. */
153
- export interface ProviderSettingsDirectory {
154
- /** Provider rows: configurable-directory order first, active-unmanaged rows after. */
155
- readonly rows: readonly ProviderTargetView[];
156
- /** Whether the settings provider accepts writes (mirrors the web page's flag). */
157
- readonly writable: boolean;
158
- /** Non-fatal join failures (settings/directory reads), for a degradation notice. */
159
- readonly failures: readonly string[];
160
- }
161
- /** Subscribe to the same provider-directory invalidations as the official Web Models page. */
162
- export declare function subscribeProviderSettings(ctx: Context, listener: () => void): () => void;
163
- /** A single-line, bounded error from the provider-management adapter. */
164
- export declare class ProviderSettingsError extends Error {
165
- constructor(message: string);
166
- }
167
- /**
168
- * Join the configurable-provider directory, the redacted settings
169
- * namespaces, and the referenced credentials into panel rows, web-parity:
170
- * - directory entries merge with `listProviders()` to mark each live or
171
- * dormant, and routes registered without a directory declaration appear as
172
- * read-only/unmanaged rows (no settings address);
173
- * - a whole-section entry is configured whenever its namespace resolves;
174
- * a path-addressed one only when the profile resolves there;
175
- * - a row is removable when the user layer alone carries its profile;
176
- * - only refs named by resolved profiles are described, and a per-ref failure
177
- * degrades to that row's bounded error instead of losing it.
178
- * Absent `settings`/`credentials` services are tolerated the same way.
179
- * @param ctx - context carrying the `llm` service (settings/credentials optional).
180
- * @returns the resolved directory; empty rows when `llm` is unavailable.
181
- */
182
- export declare function loadProviderSettings(ctx: Context): Promise<ProviderSettingsDirectory>;
183
- /**
184
- * Store a provider API key, web-parity: validate with `normalizeApiKey`
185
- * (single-line, actionable errors that never echo the key), materialize the
186
- * profile/`apiKeyEnv` through `settings.mutate` first when the resolved
187
- * profile names no reference (dormant route or ref-less profile), then store
188
- * under the trusted named ref or the derived conventional ref. An existing
189
- * whole-section DeepSeek whose resolved profile already names
190
- * `DEEPSEEK_API_KEY` needs no settings mutation. Env-supplied read-only keys
191
- * are refused before any service call.
192
- * @param ctx - context carrying `settings` (when materializing) and `credentials`.
193
- * @param target - the joined row to write through.
194
- * @param rawKey - the key exactly as typed; surrounding whitespace is trimmed.
195
- * @throws {@link ProviderSettingsError} with a single-line, key-free message.
196
- */
197
- export declare function saveProviderCredential(ctx: Context, target: ProviderTargetView, rawKey: string): Promise<void>;
198
- /** Save the endpoint and an explicit model allow-list without rebuilding the profile. */
199
- export declare function saveProviderConfiguration(ctx: Context, target: ProviderTargetView, configuration: ProviderConfiguration): Promise<void>;
200
- /**
201
- * Interrogate a provider endpoint for the models it really serves, through
202
- * the model-discovery capability the provider's settings namespace
203
- * registered — the same pipe the official Web Models page uses. The request
204
- * is a draft: a typed key forces direct endpoint interrogation (gateway
205
- * truth), while an empty key lets the harness resolve the route's stored
206
- * credential; with neither baseURL nor route the adapter answers from its
207
- * own knowledge.
208
- * @param ctx - context carrying the `llm` service (optional discovery).
209
- * @param target - provider row whose settings namespace serves the draft.
210
- * @param request - typed key and/or endpoint override for this one probe.
211
- * @param signal - caller cancellation (panel navigation aborts the probe).
212
- * @returns the advertised models in endpoint order, deduplicated.
213
- */
214
- export declare function discoverProviderModels(ctx: Context, target: ProviderTargetView, request: {
215
- readonly apiKey?: string;
216
- readonly baseURL?: string;
217
- }, signal?: AbortSignal): Promise<readonly DiscoveredModelView[]>;
218
- /**
219
- * Remove the currently named credential without touching the provider
220
- * profile. Only the resolved profile's own reference is unset; a dormant or
221
- * ref-less row (nothing to remove), an already-absent key, and an
222
- * env-supplied read-only key are rejected safely before any service call.
223
- * @param ctx - context carrying the `credentials` service.
224
- * @param target - the joined row whose named credential to unset.
225
- * @throws {@link ProviderSettingsError} with a single-line, key-free message.
226
- */
227
- export declare function unsetProviderCredential(ctx: Context, target: ProviderTargetView): Promise<void>;
228
- /**
229
- * Remove a user-added provider profile, web-parity: only `removable` rows may
230
- * be removed; a page-managed credential — the derived ref, configured and
231
- * writable — is unset first (so a second-step failure leaves the row visible
232
- * and the operation retryable), then `settings.mutate` unsets
233
- * `target.settingsPath`. Both steps are idempotent. A hand-named credential
234
- * ref may be shared elsewhere and is left alone.
235
- * @param ctx - context carrying `credentials` and `settings`.
236
- * @param target - the joined row to remove.
237
- * @throws {@link ProviderSettingsError} with a single-line, key-free message.
238
- */
239
- export declare function removeProviderSettings(ctx: Context, target: ProviderTargetView): Promise<void>;
@@ -1,54 +0,0 @@
1
- /**
2
- * The terminal ask_user_question answerer: one `user-questions/request`
3
- * waterfall listener that drives a FIFO queue — one question request on
4
- * screen at a time, everything else waiting — then resolves the collected
5
- * answers back into the waterfall. Mirrors the approval answerer's claim/
6
- * defer split: only agents this TUI owns are answered, every other request
7
- * falls through to the next answerer.
8
- *
9
- * Plan reviews (`exit_plan_mode`) arrive through the same waterfall with an
10
- * `intent: { kind: 'plan-review' }` — the renderer highlights the approve
11
- * option; the answer encoding is identical either way.
12
- *
13
- * @module @deepseek-ai/dsh-code/questions
14
- */
15
- import type { Context } from '@deepseek-ai/cordis';
16
- import type { Agent } from '@deepseek-ai/dsh-agent';
17
- import { type AskUserQuestionAnswer, type AskUserQuestionRequest } from '@deepseek-ai/dsh-user-questions';
18
- /** One question request waiting on the human, with its settle channels. */
19
- export interface PendingQuestion {
20
- /** The request the renderer walks through question by question. */
21
- request: AskUserQuestionRequest;
22
- /** Resolve the provider promise with the collected answers. */
23
- resolve(answers: AskUserQuestionAnswer): void;
24
- /** Reject the provider promise as aborted (also used for Esc cancel). */
25
- reject(error: Error): void;
26
- /** Detach the request's abort listener once the question settles (internal). */
27
- detachAbort?(): void;
28
- }
29
- /** The pending-question snapshot the renderer subscribes to. */
30
- export interface QuestionSnapshot {
31
- /** The active request, or undefined when nothing is being asked. */
32
- pending: PendingQuestion | undefined;
33
- }
34
- /** Store the pending question lands in; the renderer reads, the provider writes. */
35
- export interface QuestionStore {
36
- /** Subscribe to pending-state changes; returns the unsubscribe function. */
37
- subscribe(listener: () => void): () => void;
38
- /** Read the current snapshot (identity-stable between changes). */
39
- getSnapshot(): QuestionSnapshot;
40
- /** Submit the collected answers for the active request and advance the queue. */
41
- submit(pending: PendingQuestion, answers: AskUserQuestionAnswer): void;
42
- /** Cancel the active request (Esc) — rejects ASK_ABORTED and advances the queue. */
43
- cancel(pending: PendingQuestion): void;
44
- }
45
- /**
46
- * Mount the `user-questions/request` answerer over a FIFO queue.
47
- * @param ctx - plugin context whose event bus carries the waterfall.
48
- * @param owns - agents this terminal answers for; every other request is
49
- * deferred back into the waterfall (`next()`), so sibling answerers stay
50
- * usable. Agent-less asks are claimed: this TUI is the only human surface
51
- * in the process.
52
- * @returns the store the renderer subscribes to.
53
- */
54
- export declare function mountQuestionProvider(ctx: Context, owns: (agent: Agent) => boolean): QuestionStore;
@@ -1,69 +0,0 @@
1
- /**
2
- * The rainbow theme's per-launch roll: a seeded shuffle over a twelve-color
3
- * bright-tier spectrum that fills every palette role, the status-bar tone map
4
- * (adjacent tones in canonical on-screen order never share a color, the
5
- * row1/row2 boundary included), the panel accent ring, and full-spectrum
6
- * flow anchors with a random phase. The roll happens once per launch and
7
- * stays stable for the whole run; setting RAINBOW_SEED=<uint32> pins it for
8
- * reproduction (the /theme notification prints the seed of the current roll).
9
- *
10
- * All pool colors clear AA body text (≥4.5:1) on a black terminal by a wide
11
- * margin (11-17:1); diff rows pair a bright hue with its own 22% dark tint
12
- * so the foreground stays 7.7-10.2:1 on its background.
13
- *
14
- * @module @deepseek-ai/dsh-tui/rainbow
15
- */
16
- import type { StatusTone } from './render/status.ts';
17
- import type { RgbTriple, ThemePalette } from './theme.ts';
18
- /**
19
- * The bright-tier spectrum: twelve Tailwind *-300 hues covering red through
20
- * fuchsia, every one ≥11:1 on black. The roll samples this pool by shuffle;
21
- * nothing outside it is ever painted.
22
- */
23
- export declare const RAINBOW_POOL: readonly RgbTriple[];
24
- /** One per-launch carnival roll: everything the rainbow theme paints from. */
25
- export interface RainbowRoll {
26
- /** The seed this roll came from (print it to reproduce). */
27
- readonly seed: number;
28
- /** The full 15-token palette for this launch. */
29
- readonly palette: ThemePalette;
30
- /** The four-color panel ring (random order and start). */
31
- readonly ring: readonly RgbTriple[];
32
- /** Status-tone → color: adjacent tones in {@link TONE_ORDER} never match. */
33
- readonly toneColors: Readonly<Record<StatusTone, RgbTriple>>;
34
- /** Full-spectrum flow anchors in hue order (a different subset every launch). */
35
- readonly flowAnchors: readonly RgbTriple[];
36
- /** Random phase offset into the flow lap, milliseconds. */
37
- readonly flowPhaseMs: number;
38
- }
39
- /** Parse a RAINBOW_SEED value: a non-negative decimal uint32, else nothing. */
40
- export declare function parseRainbowSeed(value: string | undefined): number | undefined;
41
- /**
42
- * One parsed `/rainbow` argument: empty means a fresh random roll; a
43
- * decimal uint32 pins that seed; anything else is a usage error.
44
- * @param argument - the raw text after `/rainbow`.
45
- * @returns `{ seed }`, `'random'`, or `'usage'`.
46
- */
47
- export declare function parseRainbowArgument(argument: string): {
48
- seed: number;
49
- } | 'random' | 'usage';
50
- /**
51
- * Build the roll for one seed: pure and deterministic, so tests pin exact
52
- * outcomes and RAINBOW_SEED reproduces a lucky launch exactly.
53
- * @param seed - the uint32 seed to roll from.
54
- * @returns the complete carnival roll.
55
- */
56
- export declare function rollRainbow(seed: number): RainbowRoll;
57
- /** The memoized per-launch roll; computed once, stable for the whole run. */
58
- export declare function rainbowRoll(): RainbowRoll;
59
- /**
60
- * Replace the memoized roll: omit the seed for a fresh random one, or pass
61
- * a uint32 to pin it. `/rainbow` uses this so a mid-session reroll actually
62
- * recolors; {@link setTheme}(`'rainbow'`) must run afterwards so the
63
- * palette accessor picks the new values up.
64
- * @param seed - the seed to pin, or undefined for a new random roll.
65
- * @returns the roll now in force.
66
- */
67
- export declare function rerollRainbow(seed?: number): RainbowRoll;
68
- /** The current roll's seed as display copy (also the RAINBOW_SEED value). */
69
- export declare function rainbowSeedLabel(): string;