@xiaoso/dsh-tool-plus 0.1.9 → 0.1.10-beta.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/README.en.md +12 -5
- package/README.md +11 -4
- package/THIRD_PARTY_NOTICES.md +36 -0
- package/lib/client.js +377 -906
- package/lib/index.mjs +885 -1087
- package/lib/{scrapers-mhvFrvjH.mjs → scrapers-DSArdJ6N.mjs} +1 -1
- package/lib/types/client/ToolPlusSection.d.ts +3 -3
- package/lib/types/client/forms.d.ts +6 -6
- package/lib/types/client/index.d.ts +29 -12
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/preset-panel.d.ts +54 -42
- package/lib/types/config/settings.d.ts +202 -21
- package/lib/types/host/browser-probe-rpc.d.ts +2 -1
- package/lib/types/host/preset-host.d.ts +103 -0
- package/lib/types/host/preset-rpc.d.ts +37 -72
- package/lib/types/presets/compare.d.ts +14 -37
- package/lib/types/presets/conflicts.d.ts +59 -0
- package/lib/types/presets/delta.d.ts +23 -18
- package/lib/types/presets/plan.d.ts +55 -0
- package/lib/types/presets/rows.d.ts +84 -0
- package/lib/types/presets/status.d.ts +56 -47
- package/lib/types/tools/bash/background.d.ts +20 -5
- package/lib/types/tools/bash/streaming-output.d.ts +4 -2
- package/lib/types/tools/shared/browser-rpc-channel.d.ts +84 -42
- package/lib/types/web/client/labels.d.ts +1 -1
- package/lib/types/web/client/row-utils.d.ts +26 -1
- package/lib/{utils-eiUz9n8I.mjs → utils-DA8R1_Q8.mjs} +1 -1
- package/package.json +166 -151
- package/presets/tool-plus-ptc.patch.yml +164 -0
- package/presets/tool-plus-standard.patch.yml +158 -0
- package/lib/types/client/BashPlusCard.d.ts +0 -53
- package/lib/types/presets/install.d.ts +0 -44
- package/lib/types/presets/paths.d.ts +0 -41
- package/lib/types/presets/rewrite.d.ts +0 -86
- package/presets/install-presets.mjs +0 -143
- package/presets/package.json +0 -42
- package/presets/tool-plus-ptc/agent.cordis.yml +0 -284
- package/presets/tool-plus-ptc/preset.yml +0 -3
- package/presets/tool-plus-standard/agent.cordis.yml +0 -269
- package/presets/tool-plus-standard/preset.yml +0 -3
|
@@ -3,7 +3,7 @@ __installBunShim();
|
|
|
3
3
|
import { n as fs_promises_shim_exports } from "./fs-promises-shim-Bx0fpxuk.mjs";
|
|
4
4
|
import { $ as isEnoent, B as USER_AGENT, C as warn, G as getDocsRsCacheDir, N as $env, c as combineSignals, j as formatNumber, k as formatBytes, l as exec, s as Snowflake, y as parseFrontmatter } from "./src-DUUqyo9y.mjs";
|
|
5
5
|
import { W as tryParseJson } from "./utils-BMmwLB0f.mjs";
|
|
6
|
-
import { a as fetchBinary, c as getParallelExtractContent, i as convertWithMarkit, l as ensureTool, m as settings, n as asRecord, o as extractWithParallel, r as asString, s as findParallelApiKey, t as asNumber } from "./utils-
|
|
6
|
+
import { a as fetchBinary, c as getParallelExtractContent, i as convertWithMarkit, l as ensureTool, m as settings, n as asRecord, o as extractWithParallel, r as asString, s as findParallelApiKey, t as asNumber } from "./utils-DA8R1_Q8.mjs";
|
|
7
7
|
import { n as isRecord } from "./type-guards-CttAANEx.mjs";
|
|
8
8
|
import { r as throwIfAborted, t as ToolAbortError } from "./tool-errors-DoyxivAR.mjs";
|
|
9
9
|
import { c as getLocalizedText, d as looksLikeHtml, i as decodeHtmlEntities, l as htmlToBasicMarkdown, o as formatIsoDate, r as buildResult, s as formatMediaDuration, u as loadPage } from "./types-DT9vgZ3S.mjs";
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { type ReactNode } from 'react';
|
|
29
29
|
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
30
|
-
import type {
|
|
30
|
+
import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
31
31
|
import { type ToolSettingsValue } from './forms.ts';
|
|
32
|
-
/** Registration-side face: the
|
|
32
|
+
/** Registration-side face: the `tool-plus` entry's shared configuration form. */
|
|
33
33
|
export interface ToolPlusSectionInjected {
|
|
34
|
-
|
|
34
|
+
form: ConfigForm<ToolSettingsValue>;
|
|
35
35
|
}
|
|
36
36
|
/** Props the renderer binds for the section (owner + locale + injected face). */
|
|
37
37
|
export type ToolPlusSectionProps = PropsRuntime<'settings.section'> & PropsLocale<'tool-plus'> & InjectFace<ToolPlusSectionInjected>;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* the same fields with the same defaults.
|
|
7
7
|
* @module @xiaoso/dsh-tool-plus/client
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
9
|
+
import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
10
|
+
import type { SettingsFormShell } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
11
11
|
import type { ToolPlusField } from '../config/fields.ts';
|
|
12
12
|
import { type NumberControl, type SelectControl, type ToggleControl } from './rows.tsx';
|
|
13
13
|
/** The flat settings document shape this form edits. */
|
|
@@ -21,7 +21,7 @@ export interface ToolFormGroup {
|
|
|
21
21
|
}
|
|
22
22
|
/** The form state a settings surface renders. */
|
|
23
23
|
export interface ToolForm {
|
|
24
|
-
shell:
|
|
24
|
+
shell: SettingsFormShell;
|
|
25
25
|
/** Controls grouped by `ToolPlusField.group`, in first-appearance order. */
|
|
26
26
|
groups: ToolFormGroup[];
|
|
27
27
|
actions: {
|
|
@@ -34,9 +34,9 @@ export interface ToolForm {
|
|
|
34
34
|
onToggle: (field: string, checked: boolean) => void;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* Stage edits over the
|
|
38
|
-
* @param scope -
|
|
37
|
+
* Stage edits over the shared configuration form; only a Save writes the document.
|
|
38
|
+
* @param scope - the `tool-plus` entry's shared configuration form (`ctx.configForms`).
|
|
39
39
|
* @param fields - the fields this surface edits (single-source table slice).
|
|
40
40
|
* @returns the form state and its write actions.
|
|
41
41
|
*/
|
|
42
|
-
export declare function useToolForm(scope:
|
|
42
|
+
export declare function useToolForm(scope: ConfigForm<ToolSettingsValue>, fields: readonly ToolPlusField[]): ToolForm;
|
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tool-plus settings
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* namespace of the same name — binds that namespace's settings scope for
|
|
6
|
-
* reads and writes, and registers the card's locale dictionaries.
|
|
2
|
+
* Tool-plus settings surface, browser half: the plugin's own Settings
|
|
3
|
+
* navigation page and the binding of the `tool-plus` namespace it reads and
|
|
4
|
+
* writes.
|
|
7
5
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* dsh 0.1.7 replaced the settings surface contract this file used to speak:
|
|
7
|
+
*
|
|
8
|
+
* - `ctx.settingsScope.bind(...)` (the removed `SettingsScope` binder) is now
|
|
9
|
+
* `ctx.configForms.get(ns)` — the settings domain's shared configuration
|
|
10
|
+
* form for one Host entry, keyed by the settings namespace (the entry's own
|
|
11
|
+
* id, which this package spells `tool-plus` because a client package must
|
|
12
|
+
* not depend on the Host package that registers it);
|
|
13
|
+
* - the keyed `settings.plugin.item` card slot is gone. Its 0.1.7
|
|
14
|
+
* replacement — a tab inside the official Plugins section
|
|
15
|
+
* (`settings.plugins.tab`) — is deliberately NOT used: this plugin already
|
|
16
|
+
* ships a full Settings page of its own (`settings.section`, id
|
|
17
|
+
* `tool-plus`) that carries every tool's configuration, so a second entry
|
|
18
|
+
* point inside the Plugins page would only duplicate it and split the one
|
|
19
|
+
* form across two surfaces;
|
|
20
|
+
* - the page registers through `configForms.whileServed([ns], ...)`, so a
|
|
21
|
+
* deployment whose Host does not serve the `tool-plus` namespace shows no
|
|
22
|
+
* trace of it (the official rule: a page for a namespace nobody serves is
|
|
23
|
+
* never dispatched).
|
|
24
|
+
*
|
|
25
|
+
* The navigation page (`settings.section`, id `tool-plus`) keeps its order
|
|
26
|
+
* right after the Plugins section. Only officially exported APIs are used (the
|
|
27
|
+
* `dsh-client-ui-slots` slot registry, the `dsh-client-locale` dictionary
|
|
28
|
+
* registration, the `dsh-client-ui-settings` configuration forms, and this
|
|
29
|
+
* package's own section component).
|
|
13
30
|
*
|
|
14
31
|
* @module @xiaoso/dsh-tool-plus/client
|
|
15
32
|
*/
|
|
@@ -20,10 +37,10 @@ import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
|
20
37
|
* spells the same value the Host plugin registers (src/config/settings.ts).
|
|
21
38
|
*/
|
|
22
39
|
export declare const BASH_PLUS_CLIENT_NS = "tool-plus";
|
|
23
|
-
/** Required services (cordis fiber inject): slots + locale + the
|
|
40
|
+
/** Required services (cordis fiber inject): slots + locale + the shared configuration forms. */
|
|
24
41
|
export declare const inject: string[];
|
|
25
42
|
/**
|
|
26
|
-
* Mount the tool-plus settings
|
|
43
|
+
* Mount the tool-plus settings page.
|
|
27
44
|
* @param ctx - the browser plugin context.
|
|
28
45
|
*/
|
|
29
46
|
export declare function apply(ctx: ClientContext): void;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* a compile error (the official registration enforces bilingual balance).
|
|
6
6
|
* @module @xiaoso/dsh-tool-plus/client
|
|
7
7
|
*/
|
|
8
|
-
export type BashPlusLocaleKey = 'title' | 'description' | 'nav' | 'pageTitle' | 'pageDescription' | 'tabWeb' | 'tabBash' | 'tabRead' | 'tabWriteEdit' | 'tabGrep' | 'tabGlob' | 'tabAstGrep' | 'tabAstEdit' | 'tabReadImage' | 'groupCards' | 'groupTiming' | 'groupOutput' | 'groupTruncation' | 'groupBehavior' | 'groupReading' | 'groupSummary' | 'groupImages' | 'groupEditMode' | 'groupGuard' | 'groupGrep' | 'groupSearchDefaults' | 'groupFetch' | 'groupAst' | 'groupPresets' | 'presetNoteBroken' | 'presetNoteUnrecognized' | 'presetPickPreset' | 'presetPickTemplate' | 'presetToolOk' | 'presetToolWarn' | 'presetToolError' | 'presetToolLoading' | 'presetCompareOk' | 'presetCompareWarn' | 'presetCompareError' | 'presetCompareLoading' | 'presetDiffOpen' | 'presetDiffTitle' | 'presetDiffHint' | 'presetDiffClose' | 'presetDiffColumnPath' | 'presetDiffColumnYours' | 'presetDiffColumnTemplate' | 'presetDiffAbsent' | 'presetDiffWholeRow' | 'presetDiffEmpty' | 'presetActionUpdate' | 'presetActionUpdateHint' | 'presetActionUpdateNothing' | '
|
|
8
|
+
export type BashPlusLocaleKey = 'title' | 'description' | 'nav' | 'pageTitle' | 'pageDescription' | 'tabWeb' | 'tabBash' | 'tabRead' | 'tabWriteEdit' | 'tabGrep' | 'tabGlob' | 'tabAstGrep' | 'tabAstEdit' | 'tabReadImage' | 'groupCards' | 'groupTiming' | 'groupOutput' | 'groupTruncation' | 'groupBehavior' | 'groupReading' | 'groupSummary' | 'groupImages' | 'groupEditMode' | 'groupGuard' | 'groupGrep' | 'groupSearchDefaults' | 'groupFetch' | 'groupAst' | 'groupPresets' | 'presetNoteBroken' | 'presetNoteUnrecognized' | 'presetNoteNoRow' | 'presetNoteOther' | 'presetNoteCustomized' | 'presetNoteNoProfile' | 'presetNoteLegacy' | 'presetPickPreset' | 'presetPickTemplate' | 'presetToolOk' | 'presetToolWarn' | 'presetToolError' | 'presetToolLoading' | 'presetCompareOk' | 'presetCompareWarn' | 'presetCompareError' | 'presetCompareLoading' | 'presetDiffOpen' | 'presetDiffTitle' | 'presetDiffHint' | 'presetDiffClose' | 'presetDiffColumnPath' | 'presetDiffColumnYours' | 'presetDiffColumnTemplate' | 'presetDiffAbsent' | 'presetDiffWholeRow' | 'presetDiffEmpty' | 'presetActionUpdate' | 'presetActionUpdateHint' | 'presetActionUpdateNothing' | 'presetActionAlign' | 'presetActionAlignHint' | 'presetActionRevert' | 'presetActionRevertHint' | 'presetActionWorking' | 'presetPendingRows' | 'presetPendingBroken' | 'presetConfirmTitle' | 'presetConfirmAlign' | 'presetConfirmAlignEdits' | 'presetConfirmRevert' | 'presetConfirmYes' | 'presetConfirmNo' | 'presetResultDone' | 'presetResultRows' | 'presetResultNoChange' | 'presetResultFailed' | 'presetResultAlignDone' | 'presetResultAlignNoChange' | 'presetResultRevertDone' | 'presetResultRevertNoChange' | 'presetFailUnknown' | 'presetResultBackup' | 'presetEntryCommand' | 'presetEntryPwsh' | 'presetEntryFiles' | 'presetEntrySearch' | 'presetListSeparator' | 'presetLoading' | 'presetUnavailable' | 'presetEmpty' | 'noConfigTitle' | 'noConfigHint' | 'readSummarizeEnabled' | 'readSummarizeEnabledHint' | 'readSummarizeProse' | 'readSummarizeProseHint' | 'readSummarizeMinBodyLines' | 'readSummarizeMinBodyLinesHint' | 'readSummarizeMinCommentLines' | 'readSummarizeMinCommentLinesHint' | 'readSummarizeMinTotalLines' | 'readSummarizeMinTotalLinesHint' | 'readSummarizeUnfoldUntil' | 'readSummarizeUnfoldUntilHint' | 'readSummarizeUnfoldLimit' | 'readSummarizeUnfoldLimitHint' | 'editBlockAutoGenerated' | 'editBlockAutoGeneratedHint' | 'readDefaultLimit' | 'readDefaultLimitHint' | 'readLineNumbers' | 'readLineNumbersHint' | 'readRenderMarkdown' | 'readRenderMarkdownHint' | 'readConcurrentSafe' | 'readConcurrentSafeHint' | 'editMode' | 'editModeHint' | 'editFuzzyMatch' | 'editFuzzyMatchHint' | 'editFuzzyThreshold' | 'editFuzzyThresholdHint' | 'editEnforceSeenLines' | 'editEnforceSeenLinesHint' | 'grepContextBefore' | 'grepContextBeforeHint' | 'grepContextAfter' | 'grepContextAfterHint' | 'grepCaseDefault' | 'grepCaseDefaultHint' | 'grepGitignoreDefault' | 'grepGitignoreDefaultHint' | 'globGitignoreDefault' | 'globGitignoreDefaultHint' | 'globHiddenDefault' | 'globHiddenDefaultHint' | 'astGrepEnabled' | 'astGrepEnabledHint' | 'astEditEnabled' | 'astEditEnabledHint' | 'optReplace' | 'optPatch' | 'optHashline' | 'optApplyPatch' | 'fetchEnabled' | 'fetchEnabledHint' | 'fetchMaxTimeoutSeconds' | 'fetchMaxTimeoutSecondsHint' | 'fetchReader' | 'fetchReaderHint' | 'browserReaderEnabled' | 'browserReaderEnabledHint' | 'browserProbe' | 'browserProbeHint' | 'browserProbeRunning' | 'browserProbeNone' | 'browserProbeFailed' | 'browserProbeUnavailable' | 'optReaderAuto' | 'optReaderNative' | 'optReaderTrafilatura' | 'optReaderLynx' | 'optReaderParallel' | 'optReaderJina' | 'optReaderBrowser' | 'imagesAutoResize' | 'imagesAutoResizeHint' | 'imagesBlockImages' | 'imagesBlockImagesHint' | 'imagesExcludeWebp' | 'imagesExcludeWebpHint' | 'imagesInputMaxBytes' | 'imagesInputMaxBytesHint' | 'imagesResizeMaxSide' | 'imagesResizeMaxSideHint' | 'imagesResizeMaxBytes' | 'imagesResizeMaxBytesHint' | 'imagesResizeMinSide' | 'imagesResizeMinSideHint' | 'imagesResizeJpegQuality' | 'imagesResizeJpegQualityHint' | 'autoBackgroundMs' | 'autoBackgroundMsHint' | 'defaultTimeoutMs' | 'defaultTimeoutMsHint' | 'maxTimeoutMs' | 'maxTimeoutMsHint' | 'maxBackgroundJobs' | 'maxBackgroundJobsHint' | 'outputMaxBytes' | 'outputMaxBytesHint' | 'outputSinkTailBytes' | 'outputSinkTailBytesHint' | 'outputSinkHeadBytes' | 'outputSinkHeadBytesHint' | 'minimizerEnabled' | 'minimizerEnabledHint' | 'enableRunInBackground' | 'enableRunInBackgroundHint' | 'interceptorEnabled' | 'interceptorEnabledHint' | 'nonInteractiveEnv' | 'nonInteractiveEnvHint' | 'snapshotEnabled' | 'snapshotEnabledHint' | 'rmSafe' | 'rmSafeHint' | 'rmSafeStatusInjected' | 'rmSafeStatusInjectedUnverified' | 'rmSafeStatusFailed' | 'rmSafeReasonSnapshotUnavailable' | 'rmSafeReasonCliMissing' | 'rmSafeReasonSnapshotWriteFailed' | 'rmSafeReasonRuntimeNotEffective' | 'useShellCommandWrapper' | 'useShellCommandWrapperHint' | 'webCards' | 'webCardsHint' | 'outputTruncateStrategy' | 'outputTruncateStrategyHint' | 'outputTruncateTriggerBytes' | 'outputTruncateTriggerBytesHint' | 'outputTruncateTriggerLines' | 'outputTruncateTriggerLinesHint' | 'outputTruncateByteMode' | 'outputTruncateByteModeHint' | 'outputTruncateByteHeadBytes' | 'outputTruncateByteHeadBytesHint' | 'outputTruncateByteTailBytes' | 'outputTruncateByteTailBytesHint' | 'outputTruncateLineMode' | 'outputTruncateLineModeHint' | 'outputTruncateLineHeadLines' | 'outputTruncateLineHeadLinesHint' | 'outputTruncateLineTailLines' | 'outputTruncateLineTailLinesHint' | 'optBytes' | 'optLines' | 'optHead' | 'optTail' | 'optMiddle' | 'overridden' | 'reset' | 'readOnly' | 'expand' | 'collapse' | 'save' | 'saving' | 'discard' | 'unsaved' | 'saveFailed' | 'invalidNumber' | 'appliesTo';
|
|
9
9
|
/** Simplified Chinese copy. */
|
|
10
10
|
export declare const zh: Record<BashPlusLocaleKey, string>;
|
|
11
11
|
/** English copy. */
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 预设面板的纯映射层:把 `presets/status` / `presets/apply`
|
|
3
|
-
*
|
|
4
|
-
* `tests/unit/preset-panel.spec.ts` 单独覆盖,UI(`PresetPanel.tsx`)只做渲染。
|
|
2
|
+
* 预设面板的纯映射层:把 `presets/status` / `presets/apply` / `presets/compare`
|
|
3
|
+
* 的返回值翻成本地化文案、可用动作与差异摘要。零 React、零 DOM、零 I/O ——
|
|
4
|
+
* 由 `tests/unit/preset-panel.spec.ts` 单独覆盖,UI(`PresetPanel.tsx`)只做渲染。
|
|
5
|
+
*
|
|
6
|
+
* 语义基线(dsh 0.1.7 起,别再按旧目录机制理解):
|
|
7
|
+
* - 预设是 profile 配置里的一条 `@deepseek-ai/dsh-agent-preset` 声明行;
|
|
8
|
+
* - "没被改动过" = 这一行在 profile 补丁里**没有** `config`(`customized === false`);
|
|
9
|
+
* - 三个动作:`upgrade` 只禁冲突行、`align` 用所选模板整份替换 plugins、
|
|
10
|
+
* `revert` 删掉覆盖回落到随包声明;
|
|
11
|
+
* - 本插件只**声明**两个预设({@link BUNDLED_PRESET_IDS});别的 preset 归别人,
|
|
12
|
+
* 面板最多替它修冲突行,不改它的内容。
|
|
5
13
|
*
|
|
6
|
-
* 契约来源:`docs/superpowers/specs/2026-09-17-preset-upgrade-design.md` §4.2/§7。
|
|
7
14
|
* 类型与端点名直接取自共享契约模块 `src/tools/shared/browser-rpc-channel.ts`
|
|
8
15
|
* (两半同一个来源,客户端这一侧不复制一份会漂移的定义)。
|
|
9
16
|
* @module @xiaoso/dsh-tool-plus/client/preset-panel
|
|
@@ -14,15 +21,15 @@ import type { BashPlusLocaleKey } from './locales.ts';
|
|
|
14
21
|
export { BUNDLED_PRESET_IDS };
|
|
15
22
|
/** 端点名(共享契约常量,见模块注释)。 */
|
|
16
23
|
export { PRESET_ACTION_ENDPOINT, PRESET_COMPARE_ENDPOINT, PRESET_STATUS_ENDPOINT };
|
|
17
|
-
/**
|
|
24
|
+
/** 预设来源:本插件声明的 / 别人声明的。 */
|
|
18
25
|
export type PresetSource = PresetSourceValue;
|
|
19
26
|
/** 一个预设的完整状态(`presets/status` 的一项)。 */
|
|
20
27
|
export type PresetStatus = PresetStatusValue;
|
|
21
28
|
/** `presets/status` 的返回值。 */
|
|
22
29
|
export type PresetStatusResult = PresetStatusListValue;
|
|
23
|
-
/** 一个预设动作:`upgrade`
|
|
30
|
+
/** 一个预设动作:`upgrade` 只禁冲突行;`align` 整份对齐模板;`revert` 回落到随包声明。 */
|
|
24
31
|
export type PresetAction = PresetActionValue;
|
|
25
|
-
/**
|
|
32
|
+
/** 与随包声明的一处具体差异。 */
|
|
26
33
|
export type PresetDelta = PresetDeltaValue;
|
|
27
34
|
/** 可选模板(面板"对比模板"下拉的一项)。 */
|
|
28
35
|
export type PresetTemplate = PresetTemplateValue;
|
|
@@ -32,22 +39,17 @@ export type PresetCompare = PresetCompareValue;
|
|
|
32
39
|
export type PresetActionChange = PresetChangeValue;
|
|
33
40
|
/** `presets/apply` 的返回值。 */
|
|
34
41
|
export type PresetActionResult = PresetActionResultValue;
|
|
35
|
-
/**
|
|
36
|
-
* roster 缺席我们随包的两份时补出「未安装」行(不改变 roster 原有顺序,
|
|
37
|
-
* 补出的行按 {@link BUNDLED_PRESET_IDS} 顺序排在前面)。
|
|
38
|
-
*/
|
|
39
|
-
export declare function mergeBundledPresets(presets: readonly PresetStatus[]): PresetStatus[];
|
|
40
42
|
/**
|
|
41
43
|
* 下拉里一次只看一个预设时的默认选中项:随包的那份({@link BUNDLED_PRESET_IDS}
|
|
42
44
|
* 的第一项)在场就选它,否则退清单第一项;空清单返回 undefined。
|
|
43
45
|
*/
|
|
44
46
|
export declare function initialPresetId(presets: readonly PresetStatus[]): string | undefined;
|
|
45
47
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
+
* 当前选中项在重拉状态后可能已经消失(声明被移除、roster 变化):仍在场就保留,
|
|
49
|
+
* 否则回落到 {@link initialPresetId},避免下拉指向一个不存在的选项。
|
|
48
50
|
*/
|
|
49
51
|
export declare function resolveSelectedPresetId(presets: readonly PresetStatus[], current: string | undefined): string | undefined;
|
|
50
|
-
/** 下拉选项文案:优先展示 name
|
|
52
|
+
/** 下拉选项文案:优先展示 name(声明里的显示名),缺了就退 id。 */
|
|
51
53
|
export declare function presetOptionLabel(preset: PresetStatus): string;
|
|
52
54
|
/**
|
|
53
55
|
* 状态点色调:绿 = 正常(不用管),黄 = 有需要处理的东西,红 = 读不到/无法比较。
|
|
@@ -69,13 +71,13 @@ export interface PresetIndicator {
|
|
|
69
71
|
export declare function presetToolIndicator(t: (key: BashPlusLocaleKey) => string, compare: PresetCompareValue | null): PresetIndicator;
|
|
70
72
|
/**
|
|
71
73
|
* 状态点 ②(完整比较):这份预设的内容与我们选中的模板差多少 ——
|
|
72
|
-
*
|
|
74
|
+
* 不只是工具开关,整份插件行列表都算。
|
|
73
75
|
* @param t - 文案表。
|
|
74
76
|
* @param compare - 当前比较结果;尚未返回时给"正在比较"的黄点。
|
|
75
77
|
* @returns 状态点。
|
|
76
78
|
*/
|
|
77
79
|
export declare function presetCompareIndicator(t: (key: BashPlusLocaleKey) => string, compare: PresetCompareValue | null): PresetIndicator;
|
|
78
|
-
/**
|
|
80
|
+
/** 差异弹窗的一行:路径 + 两侧的值(缺失/整行用本地化占位)。 */
|
|
79
81
|
export interface PresetDiffRow {
|
|
80
82
|
path: string;
|
|
81
83
|
/** 这份预设的值。 */
|
|
@@ -84,7 +86,7 @@ export interface PresetDiffRow {
|
|
|
84
86
|
template: string;
|
|
85
87
|
}
|
|
86
88
|
/**
|
|
87
|
-
* 差异弹窗的行:把比较结果翻成"路径 /
|
|
89
|
+
* 差异弹窗的行:把比较结果翻成"路径 / 两份各自的值"三列。
|
|
88
90
|
* 值缺失或整行差异都给出占位词,让用户一眼看出哪边没有。
|
|
89
91
|
* @param t - 文案表。
|
|
90
92
|
* @param compare - 当前比较结果。
|
|
@@ -94,10 +96,10 @@ export declare function presetDiffRows(t: (key: BashPlusLocaleKey) => string, co
|
|
|
94
96
|
/** 模板下拉的选项文案:优先显示模板自报的名字,缺了退 id。 */
|
|
95
97
|
export declare function presetTemplateLabel(template: PresetTemplate): string;
|
|
96
98
|
/**
|
|
97
|
-
*
|
|
98
|
-
* `tool-plus-ptc
|
|
99
|
-
* `tool-plus-standard`,别按目录名排序撞上 ptc
|
|
100
|
-
*
|
|
99
|
+
* 选中的模板:①手动选过且仍在场就用它;②否则选与当前预设**同名**的那份
|
|
100
|
+
* (`tool-plus-ptc` 就该比 `tool-plus-ptc`);③再退随包的第一份
|
|
101
|
+
* (`BUNDLED_PRESET_IDS[0]`,即 `tool-plus-standard`,别按目录名排序撞上 ptc);
|
|
102
|
+
* ④最后退清单第一项。清单为空返回 undefined。
|
|
101
103
|
* @param templates - 可选模板清单。
|
|
102
104
|
* @param current - 当前选中的模板 id。
|
|
103
105
|
* @param presetId - 当前选中的预设 id(同名模板优先)。
|
|
@@ -105,62 +107,72 @@ export declare function presetTemplateLabel(template: PresetTemplate): string;
|
|
|
105
107
|
*/
|
|
106
108
|
export declare function resolveSelectedTemplateId(templates: readonly PresetTemplate[], current: string | undefined, presetId: string | undefined): string | undefined;
|
|
107
109
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
+
* 补充说明行:为什么读不到、这个 preset 归谁、以及"你改过它"这件事。
|
|
111
|
+
* 差异不在这里铺开 —— 它进了「查看差异」弹窗,正文只留状态点与必要解释。
|
|
110
112
|
* @param t - 文案表。
|
|
111
113
|
* @param status - 该预设的状态。
|
|
114
|
+
* @param writable - 本部署有没有可编辑的 profile。
|
|
112
115
|
* @returns 要渲染的说明行(可能为空)。
|
|
113
116
|
*/
|
|
114
|
-
export declare function presetNotes(t: (key: BashPlusLocaleKey) => string, status: PresetStatus): string[];
|
|
117
|
+
export declare function presetNotes(t: (key: BashPlusLocaleKey) => string, status: PresetStatus, writable?: boolean): string[];
|
|
115
118
|
/**
|
|
116
119
|
* 该预设可执行的动作,按渲染顺序。
|
|
117
120
|
*
|
|
118
|
-
* -
|
|
119
|
-
* -
|
|
120
|
-
*
|
|
121
|
-
* -
|
|
121
|
+
* - 本部署没有可编辑 profile(`writable === false`)→ 一个动作都不给;
|
|
122
|
+
* - 这一行不可寻址(`entryId` 缺席)→ 一个动作都不给(写了也没地方落);
|
|
123
|
+
* - **别人的** preset → 只给 `upgrade`(我们只该修冲突行,不该替别人重写内容);
|
|
124
|
+
* - **我们的** preset → `upgrade` + `align`;有覆盖时再加 `revert`;
|
|
125
|
+
* - 内容不可识别时 `upgrade` 没有意义(它要逐行判定),只给 `align` / `revert`。
|
|
122
126
|
* @param status - 该预设的状态。
|
|
127
|
+
* @param writable - 本部署有没有可编辑的 profile。
|
|
123
128
|
* @returns 动作清单。
|
|
124
129
|
*/
|
|
125
|
-
export declare function presetActions(status: PresetStatus): PresetAction[];
|
|
126
|
-
/**
|
|
130
|
+
export declare function presetActions(status: PresetStatus, writable?: boolean): PresetAction[];
|
|
131
|
+
/** 动作按钮文案。 */
|
|
127
132
|
export declare function presetActionText(t: (key: BashPlusLocaleKey) => string, action: PresetAction): string;
|
|
133
|
+
/** 需要二次确认的动作:两个会动到用户已有内容的动作。 */
|
|
134
|
+
export declare function presetActionNeedsConfirm(action: PresetAction): boolean;
|
|
128
135
|
/**
|
|
129
136
|
* 动作按钮的悬浮说明:讲清这个按钮**具体会做什么**,以及当前状态下有没有意义。
|
|
130
137
|
* 用户要求"一眼看出含义":需要更新时说清改哪几行,不需要更新时也要明说无需更新。
|
|
131
138
|
* @param t - 文案表。
|
|
132
139
|
* @param action - 该按钮的动作。
|
|
133
140
|
* @param status - 该预设状态(决定"要不要更新")。
|
|
134
|
-
* @param templateLabel -
|
|
141
|
+
* @param templateLabel - 当前所选模板的显示名(对齐提示里点名它是哪份)。
|
|
135
142
|
* @returns 悬浮提示文案。
|
|
136
143
|
*/
|
|
137
144
|
export declare function presetActionHint(t: (key: BashPlusLocaleKey) => string, action: PresetAction, status: PresetStatus, templateLabel: string): string;
|
|
138
145
|
/** 冲突行 id → 面向使用者的名字列表(保序、不去重)。 */
|
|
139
146
|
export declare function presetConflictNames(t: (key: BashPlusLocaleKey) => string, conflicts: readonly string[]): string[];
|
|
140
147
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* 用的是**哪份模板**:重置的来源是用户在「对比模板」里选的那份。
|
|
148
|
+
* 二次确认文案。两个动作都会动到用户可能已经改过的内容,所以必须说清后果,
|
|
149
|
+
* 并且**点名写入位置**——这是本插件唯一会改用户 profile 配置的地方。
|
|
144
150
|
* @param t - 文案表。
|
|
145
151
|
* @param status - 该预设状态。
|
|
152
|
+
* @param action - 待确认的动作。
|
|
146
153
|
* @param templateLabel - 所选模板的显示名。
|
|
147
154
|
* @returns 确认文案。
|
|
148
155
|
*/
|
|
149
|
-
export declare function presetConfirmText(t: (key: BashPlusLocaleKey) => string, status: PresetStatus, templateLabel: string): string;
|
|
156
|
+
export declare function presetConfirmText(t: (key: BashPlusLocaleKey) => string, status: PresetStatus, action: PresetAction, templateLabel: string): string;
|
|
150
157
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
158
|
+
* 执行前摘要:**当前状态**下有什么需要处理的。没事可做时返回 null
|
|
159
|
+
* (不渲染这一行)——用户明确要求去掉"工具行都已禁用,无需调整。"这种没有
|
|
160
|
+
* 信息量的状态句。
|
|
153
161
|
* @param t - 文案表。
|
|
154
162
|
* @param status - 该预设状态。
|
|
155
163
|
* @returns 摘要文案,或 null(无需渲染)。
|
|
156
164
|
*/
|
|
157
165
|
export declare function presetPendingText(t: (key: BashPlusLocaleKey) => string, status: PresetStatus): string | null;
|
|
158
166
|
/**
|
|
159
|
-
*
|
|
167
|
+
* 执行后结果:成功(改了几处、改了哪几处)/ 无变化 / 失败原因。
|
|
160
168
|
* 多行文本,`\n` 分段;调用方的结果行按 `white-space: pre-wrap` 渲染。
|
|
161
169
|
*
|
|
162
|
-
* `action` 必须传:宿主只在 `upgrade` 时返回逐行改动(`
|
|
163
|
-
* `changes`
|
|
164
|
-
* "调整了 0 处"这种假话。
|
|
170
|
+
* `action` 必须传:宿主只在 `upgrade` 时返回逐行改动(`align` 是整份替换、
|
|
171
|
+
* `revert` 是删覆盖,两者的 `changes` 恒为空),所以它们不能套用"调整了 N 行"
|
|
172
|
+
* 的句式 —— 否则会渲染成"调整了 0 处"这种假话。
|
|
173
|
+
* @param t - 文案表。
|
|
174
|
+
* @param result - 宿主返回的执行结果。
|
|
175
|
+
* @param action - 刚执行的动作。
|
|
176
|
+
* @returns 结果文案。
|
|
165
177
|
*/
|
|
166
178
|
export declare function presetResultText(t: (key: BashPlusLocaleKey) => string, result: PresetActionResult, action: PresetAction): string;
|
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Plugin-owned settings surface for the ported bash tool: the `
|
|
3
|
-
* namespace, a FLAT settings schema (OMP `bash*`-style scalar keys — the
|
|
4
|
-
* client
|
|
5
|
-
* nested {@link RuntimeConfig} the runtime consumes, and the
|
|
6
|
-
* consumer wiring. Keeping the whole config-export surface
|
|
7
|
-
* ported OMP runtime stay pristine — the entry only calls
|
|
2
|
+
* Plugin-owned settings surface for the ported bash tool: the `tool-plus`
|
|
3
|
+
* namespace, a FLAT settings schema (OMP `bash*`-style scalar keys — the shared
|
|
4
|
+
* client configuration form writes scalar fields only), its defaults, the
|
|
5
|
+
* mapping onto the nested {@link RuntimeConfig} the runtime consumes, and the
|
|
6
|
+
* optional-settings consumer wiring. Keeping the whole config-export surface
|
|
7
|
+
* here lets the ported OMP runtime stay pristine — the entry only calls
|
|
8
8
|
* {@link installBashPlusSettings} and re-exports this module's `Config`.
|
|
9
9
|
* @module @xiaoso/dsh-tool-plus/settings
|
|
10
10
|
*/
|
|
11
11
|
import type { Context } from '@deepseek-ai/cordis';
|
|
12
12
|
import z from '@deepseek-ai/schemastery';
|
|
13
13
|
import type { MinimizerConfig } from '../tools/bash/types.ts';
|
|
14
|
+
/**
|
|
15
|
+
* The Loader commits a settings write into this plugin's live config
|
|
16
|
+
* references and announces the changed paths on the owning fiber
|
|
17
|
+
* (`@deepseek-ai/cordis-plugin-loader` declares this event). The declaration
|
|
18
|
+
* lives in the Loader package, which a business plugin does not depend on, so
|
|
19
|
+
* the one event this module consumes is spelled here — copied verbatim from the
|
|
20
|
+
* Loader's own declaration, so a future signature change fails loudly here
|
|
21
|
+
* instead of silently missing the notification.
|
|
22
|
+
*/
|
|
23
|
+
declare module '@deepseek-ai/cordis' {
|
|
24
|
+
interface Events {
|
|
25
|
+
/**
|
|
26
|
+
* Volatile config values were committed into the running fiber without a remount; dispatched to the owning fiber only.
|
|
27
|
+
* @param paths - changed config paths as key arrays; every value is committed before dispatch.
|
|
28
|
+
* @mode emit
|
|
29
|
+
*/
|
|
30
|
+
'loader/volatile-update'(paths: readonly (readonly string[])[]): void;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
14
33
|
/** Truncation strategy for background→foreground completion messages (OMP config parity). */
|
|
15
34
|
export type OutputTruncateStrategy = 'bytes' | 'lines';
|
|
16
35
|
/** Retention mode for a truncated completion message: head, tail, or middle (head+tail). */
|
|
@@ -125,8 +144,9 @@ export declare const DEFAULT_AUTO_BACKGROUND_MS = 60000;
|
|
|
125
144
|
export declare const DEFAULT_MAX_BACKGROUND_JOBS = 15;
|
|
126
145
|
/**
|
|
127
146
|
* Plugin settings, one scalar key per option — every field is writable through
|
|
128
|
-
* the client `
|
|
129
|
-
*
|
|
147
|
+
* the shared client configuration form (`ctx.configForms.get('tool-plus')`
|
|
148
|
+
* `.set`/`.unset`). Defaults live in the {@link Config} schema and in
|
|
149
|
+
* {@link resolveConfig}.
|
|
130
150
|
*/
|
|
131
151
|
export interface Config {
|
|
132
152
|
enableRunInBackground?: boolean;
|
|
@@ -193,28 +213,189 @@ export interface Config {
|
|
|
193
213
|
imagesResizeJpegQuality?: number;
|
|
194
214
|
}
|
|
195
215
|
/**
|
|
196
|
-
* Runtime configuration schema for the plugin
|
|
197
|
-
*
|
|
216
|
+
* Runtime configuration schema for the plugin, in the dsh 0.1.7 settings shape:
|
|
217
|
+
* EVERY field is declared `.volatile()`, because a settings namespace is the
|
|
218
|
+
* plugin's own entry and `SettingsForms.describe()` serves exactly the fields
|
|
219
|
+
* whose schema declares them live. {@link resolveConfig} maps the flat surface
|
|
220
|
+
* onto {@link RuntimeConfig}.
|
|
221
|
+
*
|
|
222
|
+
* The annotation is deliberately inferred rather than written as `z<Config>`:
|
|
223
|
+
* the schema's parsed output is {@link LiveConfig} (one stable reference per
|
|
224
|
+
* field), while {@link Config} stays the plain settings DOCUMENT the browser
|
|
225
|
+
* edits and the specs pass in.
|
|
226
|
+
*/
|
|
227
|
+
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
228
|
+
enableRunInBackground: z<boolean, boolean, "volatile-defined">;
|
|
229
|
+
autoBackgroundMs: z<number, number, "volatile-defined">;
|
|
230
|
+
defaultTimeoutMs: z<number, number, "volatile-defined">;
|
|
231
|
+
maxTimeoutMs: z<number, number, "volatile-defined">;
|
|
232
|
+
outputMaxBytes: z<number, number, "volatile-defined">;
|
|
233
|
+
outputSinkTailBytes: z<number, number, "volatile-defined">;
|
|
234
|
+
outputSinkHeadBytes: z<number, number, "volatile-defined">;
|
|
235
|
+
minimizerEnabled: z<boolean, boolean, "volatile-defined">;
|
|
236
|
+
interceptorEnabled: z<boolean, boolean, "volatile-defined">;
|
|
237
|
+
nonInteractiveEnv: z<boolean, boolean, "volatile-defined">;
|
|
238
|
+
snapshotEnabled: z<boolean, boolean, "volatile-defined">;
|
|
239
|
+
rmSafe: z<boolean, boolean, "volatile-defined">;
|
|
240
|
+
useShellCommandWrapper: z<boolean, boolean, "volatile-defined">;
|
|
241
|
+
webCards: z<boolean, boolean, "volatile-defined">;
|
|
242
|
+
maxBackgroundJobs: z<number, number, "volatile-defined">;
|
|
243
|
+
outputTruncateStrategy: z<"lines" | "bytes", "lines" | "bytes", "volatile-defined">;
|
|
244
|
+
outputTruncateTriggerBytes: z<number, number, "volatile-defined">;
|
|
245
|
+
outputTruncateTriggerLines: z<number, number, "volatile-defined">;
|
|
246
|
+
outputTruncateByteMode: z<"middle" | "head" | "tail", "middle" | "head" | "tail", "volatile-defined">;
|
|
247
|
+
outputTruncateByteHeadBytes: z<number, number, "volatile-defined">;
|
|
248
|
+
outputTruncateByteTailBytes: z<number, number, "volatile-defined">;
|
|
249
|
+
outputTruncateLineMode: z<"middle" | "head" | "tail", "middle" | "head" | "tail", "volatile-defined">;
|
|
250
|
+
outputTruncateLineHeadLines: z<number, number, "volatile-defined">;
|
|
251
|
+
outputTruncateLineTailLines: z<number, number, "volatile-defined">;
|
|
252
|
+
editBlockAutoGenerated: z<boolean, boolean, "volatile-defined">;
|
|
253
|
+
readSummarizeEnabled: z<boolean, boolean, "volatile-defined">;
|
|
254
|
+
readSummarizeProse: z<boolean, boolean, "volatile-defined">;
|
|
255
|
+
readSummarizeMinBodyLines: z<number, number, "volatile-defined">;
|
|
256
|
+
readSummarizeMinCommentLines: z<number, number, "volatile-defined">;
|
|
257
|
+
readSummarizeMinTotalLines: z<number, number, "volatile-defined">;
|
|
258
|
+
readSummarizeUnfoldUntil: z<number, number, "volatile-defined">;
|
|
259
|
+
readSummarizeUnfoldLimit: z<number, number, "volatile-defined">;
|
|
260
|
+
editMode: z<"replace" | "patch" | "hashline" | "apply_patch", "replace" | "patch" | "hashline" | "apply_patch", "volatile-defined">;
|
|
261
|
+
editFuzzyMatch: z<boolean, boolean, "volatile-defined">;
|
|
262
|
+
editFuzzyThreshold: z<number, number, "volatile-defined">;
|
|
263
|
+
editEnforceSeenLines: z<boolean, boolean, "volatile-defined">;
|
|
264
|
+
readDefaultLimit: z<number, number, "volatile-defined">;
|
|
265
|
+
readLineNumbers: z<boolean, boolean, "volatile-defined">;
|
|
266
|
+
readRenderMarkdown: z<boolean, boolean, "volatile-defined">;
|
|
267
|
+
readConcurrentSafe: z<boolean, boolean, "volatile-defined">;
|
|
268
|
+
grepContextBefore: z<number, number, "volatile-defined">;
|
|
269
|
+
grepContextAfter: z<number, number, "volatile-defined">;
|
|
270
|
+
grepCaseDefault: z<boolean, boolean, "volatile-defined">;
|
|
271
|
+
grepGitignoreDefault: z<boolean, boolean, "volatile-defined">;
|
|
272
|
+
globGitignoreDefault: z<boolean, boolean, "volatile-defined">;
|
|
273
|
+
globHiddenDefault: z<boolean, boolean, "volatile-defined">;
|
|
274
|
+
astGrepEnabled: z<boolean, boolean, "volatile-defined">;
|
|
275
|
+
astEditEnabled: z<boolean, boolean, "volatile-defined">;
|
|
276
|
+
fetchEnabled: z<boolean, boolean, "volatile-defined">;
|
|
277
|
+
fetchMaxTimeoutSeconds: z<number, number, "volatile-defined">;
|
|
278
|
+
fetchReader: z<"trafilatura" | "lynx" | "auto" | "native" | "parallel" | "jina" | "browser", "trafilatura" | "lynx" | "auto" | "native" | "parallel" | "jina" | "browser", "volatile-defined">;
|
|
279
|
+
browserReaderEnabled: z<boolean, boolean, "volatile-defined">;
|
|
280
|
+
imagesAutoResize: z<boolean, boolean, "volatile-defined">;
|
|
281
|
+
imagesBlockImages: z<boolean, boolean, "volatile-defined">;
|
|
282
|
+
imagesExcludeWebp: z<boolean, boolean, "volatile-defined">;
|
|
283
|
+
imagesInputMaxBytes: z<number, number, "volatile-defined">;
|
|
284
|
+
imagesResizeMaxSide: z<number, number, "volatile-defined">;
|
|
285
|
+
imagesResizeMaxBytes: z<number, number, "volatile-defined">;
|
|
286
|
+
imagesResizeMinSide: z<number, number, "volatile-defined">;
|
|
287
|
+
imagesResizeJpegQuality: z<number, number, "volatile-defined">;
|
|
288
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
289
|
+
enableRunInBackground: z<boolean, boolean, "volatile-defined">;
|
|
290
|
+
autoBackgroundMs: z<number, number, "volatile-defined">;
|
|
291
|
+
defaultTimeoutMs: z<number, number, "volatile-defined">;
|
|
292
|
+
maxTimeoutMs: z<number, number, "volatile-defined">;
|
|
293
|
+
outputMaxBytes: z<number, number, "volatile-defined">;
|
|
294
|
+
outputSinkTailBytes: z<number, number, "volatile-defined">;
|
|
295
|
+
outputSinkHeadBytes: z<number, number, "volatile-defined">;
|
|
296
|
+
minimizerEnabled: z<boolean, boolean, "volatile-defined">;
|
|
297
|
+
interceptorEnabled: z<boolean, boolean, "volatile-defined">;
|
|
298
|
+
nonInteractiveEnv: z<boolean, boolean, "volatile-defined">;
|
|
299
|
+
snapshotEnabled: z<boolean, boolean, "volatile-defined">;
|
|
300
|
+
rmSafe: z<boolean, boolean, "volatile-defined">;
|
|
301
|
+
useShellCommandWrapper: z<boolean, boolean, "volatile-defined">;
|
|
302
|
+
webCards: z<boolean, boolean, "volatile-defined">;
|
|
303
|
+
maxBackgroundJobs: z<number, number, "volatile-defined">;
|
|
304
|
+
outputTruncateStrategy: z<"lines" | "bytes", "lines" | "bytes", "volatile-defined">;
|
|
305
|
+
outputTruncateTriggerBytes: z<number, number, "volatile-defined">;
|
|
306
|
+
outputTruncateTriggerLines: z<number, number, "volatile-defined">;
|
|
307
|
+
outputTruncateByteMode: z<"middle" | "head" | "tail", "middle" | "head" | "tail", "volatile-defined">;
|
|
308
|
+
outputTruncateByteHeadBytes: z<number, number, "volatile-defined">;
|
|
309
|
+
outputTruncateByteTailBytes: z<number, number, "volatile-defined">;
|
|
310
|
+
outputTruncateLineMode: z<"middle" | "head" | "tail", "middle" | "head" | "tail", "volatile-defined">;
|
|
311
|
+
outputTruncateLineHeadLines: z<number, number, "volatile-defined">;
|
|
312
|
+
outputTruncateLineTailLines: z<number, number, "volatile-defined">;
|
|
313
|
+
editBlockAutoGenerated: z<boolean, boolean, "volatile-defined">;
|
|
314
|
+
readSummarizeEnabled: z<boolean, boolean, "volatile-defined">;
|
|
315
|
+
readSummarizeProse: z<boolean, boolean, "volatile-defined">;
|
|
316
|
+
readSummarizeMinBodyLines: z<number, number, "volatile-defined">;
|
|
317
|
+
readSummarizeMinCommentLines: z<number, number, "volatile-defined">;
|
|
318
|
+
readSummarizeMinTotalLines: z<number, number, "volatile-defined">;
|
|
319
|
+
readSummarizeUnfoldUntil: z<number, number, "volatile-defined">;
|
|
320
|
+
readSummarizeUnfoldLimit: z<number, number, "volatile-defined">;
|
|
321
|
+
editMode: z<"replace" | "patch" | "hashline" | "apply_patch", "replace" | "patch" | "hashline" | "apply_patch", "volatile-defined">;
|
|
322
|
+
editFuzzyMatch: z<boolean, boolean, "volatile-defined">;
|
|
323
|
+
editFuzzyThreshold: z<number, number, "volatile-defined">;
|
|
324
|
+
editEnforceSeenLines: z<boolean, boolean, "volatile-defined">;
|
|
325
|
+
readDefaultLimit: z<number, number, "volatile-defined">;
|
|
326
|
+
readLineNumbers: z<boolean, boolean, "volatile-defined">;
|
|
327
|
+
readRenderMarkdown: z<boolean, boolean, "volatile-defined">;
|
|
328
|
+
readConcurrentSafe: z<boolean, boolean, "volatile-defined">;
|
|
329
|
+
grepContextBefore: z<number, number, "volatile-defined">;
|
|
330
|
+
grepContextAfter: z<number, number, "volatile-defined">;
|
|
331
|
+
grepCaseDefault: z<boolean, boolean, "volatile-defined">;
|
|
332
|
+
grepGitignoreDefault: z<boolean, boolean, "volatile-defined">;
|
|
333
|
+
globGitignoreDefault: z<boolean, boolean, "volatile-defined">;
|
|
334
|
+
globHiddenDefault: z<boolean, boolean, "volatile-defined">;
|
|
335
|
+
astGrepEnabled: z<boolean, boolean, "volatile-defined">;
|
|
336
|
+
astEditEnabled: z<boolean, boolean, "volatile-defined">;
|
|
337
|
+
fetchEnabled: z<boolean, boolean, "volatile-defined">;
|
|
338
|
+
fetchMaxTimeoutSeconds: z<number, number, "volatile-defined">;
|
|
339
|
+
fetchReader: z<"trafilatura" | "lynx" | "auto" | "native" | "parallel" | "jina" | "browser", "trafilatura" | "lynx" | "auto" | "native" | "parallel" | "jina" | "browser", "volatile-defined">;
|
|
340
|
+
browserReaderEnabled: z<boolean, boolean, "volatile-defined">;
|
|
341
|
+
imagesAutoResize: z<boolean, boolean, "volatile-defined">;
|
|
342
|
+
imagesBlockImages: z<boolean, boolean, "volatile-defined">;
|
|
343
|
+
imagesExcludeWebp: z<boolean, boolean, "volatile-defined">;
|
|
344
|
+
imagesInputMaxBytes: z<number, number, "volatile-defined">;
|
|
345
|
+
imagesResizeMaxSide: z<number, number, "volatile-defined">;
|
|
346
|
+
imagesResizeMaxBytes: z<number, number, "volatile-defined">;
|
|
347
|
+
imagesResizeMinSide: z<number, number, "volatile-defined">;
|
|
348
|
+
imagesResizeJpegQuality: z<number, number, "volatile-defined">;
|
|
349
|
+
}>>, "plain">;
|
|
350
|
+
/**
|
|
351
|
+
* Live entry config: what the Loader hands `apply` for this entry, and what
|
|
352
|
+
* {@link installBashPlusSettings} re-reads after a settings write commits. One
|
|
353
|
+
* stable reference per schema field — read it through `.get()`, never as a
|
|
354
|
+
* plain value.
|
|
198
355
|
*/
|
|
199
|
-
export
|
|
356
|
+
export type LiveConfig = ReturnType<typeof Config>;
|
|
200
357
|
/**
|
|
201
358
|
* Resolve the flat settings (composition entry or the settings document) to
|
|
202
359
|
* the nested runtime config the ported OMP runtime consumes. A direct mount
|
|
203
360
|
* (`ctx.plugin`) skips the Loader's schema parse, so the `?? default` pass
|
|
204
361
|
* mirrors the schema; the settings namespace resolution rides the same path.
|
|
205
|
-
*
|
|
362
|
+
* Accepts both shapes a caller can hold: the Loader's live entry config (one
|
|
363
|
+
* reference per field) and a plain settings document.
|
|
364
|
+
* @param input - the entry's live config, or a plain (possibly partial) document.
|
|
206
365
|
* @returns the fully-defaulted nested runtime config.
|
|
207
366
|
*/
|
|
208
|
-
export declare function resolveConfig(
|
|
367
|
+
export declare function resolveConfig(input: Config | LiveConfig): RuntimeConfig;
|
|
209
368
|
/**
|
|
210
|
-
* Install the optional-settings consumer wiring for this plugin
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
369
|
+
* Install the optional-settings consumer wiring for this plugin, in the dsh
|
|
370
|
+
* 0.1.7 shape.
|
|
371
|
+
*
|
|
372
|
+
* 0.1.7 deleted the namespace-registration API (`SettingsForms` no longer has
|
|
373
|
+
* `installSection`): a settings namespace is not something a plugin installs
|
|
374
|
+
* any more — it IS the plugin's own profile entry, and the service serves
|
|
375
|
+
* exactly the Config fields whose schema declares them live
|
|
376
|
+
* ({@link Config} declares every field `.volatile()`). The plugin therefore
|
|
377
|
+
* keeps one authoritative source, its own entry config:
|
|
378
|
+
*
|
|
379
|
+
* - the Loader merges the composition layers and the profile override before
|
|
380
|
+
* `apply` runs, so the entry already carries the effective settings;
|
|
381
|
+
* - a settings write is committed INTO that entry's live references without a
|
|
382
|
+
* remount, and the Loader then announces the changed paths on this fiber
|
|
383
|
+
* (`loader/volatile-update`) — which is the signal for refreshing
|
|
384
|
+
* registration facts (the `editMode`-sensitive descriptions and the AST
|
|
385
|
+
* switches), exactly as the settings docs prescribe.
|
|
386
|
+
*
|
|
387
|
+
* The plugin ships its own settings pages in the browser half, so it owns its
|
|
388
|
+
* page policy: `configure({ auto: false })` tells the settings service not to
|
|
389
|
+
* auto-generate a schema page for this entry. That call rides an optional
|
|
390
|
+
* `ctx.inject(['settings'], ...)` child, so the plugin runs unchanged in a
|
|
391
|
+
* deployment that composes no settings service at all.
|
|
392
|
+
*
|
|
393
|
+
* Mirrors the official bash-local pattern (`packages/shell/bash-local`): the
|
|
394
|
+
* business plugin reads its own Config references and registers only its page
|
|
395
|
+
* policy; nothing re-registers the namespace.
|
|
216
396
|
* @param ctx - plugin context owning the wiring.
|
|
217
|
-
* @param entry -
|
|
397
|
+
* @param entry - the entry's config as the Loader resolved it (live references
|
|
398
|
+
* over the composition layers and the profile override), or a plain document.
|
|
218
399
|
* @param onSource - receives a thunk of the currently authoritative runtime config.
|
|
219
400
|
*/
|
|
220
|
-
export declare function installBashPlusSettings(ctx: Context, entry: Config, onSource: (current: () => RuntimeConfig) => void): void;
|
|
401
|
+
export declare function installBashPlusSettings(ctx: Context, entry: Config | LiveConfig, onSource: (current: () => RuntimeConfig) => void): void;
|