dsh-plugin-effort-declare 0.1.0

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 (62) hide show
  1. package/CONTRIBUTING.en.md +57 -0
  2. package/CONTRIBUTING.md +57 -0
  3. package/INSTALL.en.md +62 -0
  4. package/INSTALL.md +62 -0
  5. package/LICENSE +21 -0
  6. package/README.en.md +64 -0
  7. package/README.md +64 -0
  8. package/cordis.patch.yml +5 -0
  9. package/lib/client.js +1237 -0
  10. package/lib/client.js.map +1 -0
  11. package/lib/index.js +6 -0
  12. package/lib/types/client/EffortDeclareSection.d.ts +24 -0
  13. package/lib/types/client/EffortDeclareSection.d.ts.map +1 -0
  14. package/lib/types/client/index.d.ts +15 -0
  15. package/lib/types/client/index.d.ts.map +1 -0
  16. package/lib/types/client/load-drafts.d.ts +20 -0
  17. package/lib/types/client/load-drafts.d.ts.map +1 -0
  18. package/lib/types/client/locales.d.ts +8 -0
  19. package/lib/types/client/locales.d.ts.map +1 -0
  20. package/lib/types/client/schema-ops.d.ts +13 -0
  21. package/lib/types/client/schema-ops.d.ts.map +1 -0
  22. package/lib/types/core/catalog.d.ts +31 -0
  23. package/lib/types/core/catalog.d.ts.map +1 -0
  24. package/lib/types/core/drafts.d.ts +53 -0
  25. package/lib/types/core/drafts.d.ts.map +1 -0
  26. package/lib/types/core/efforts.d.ts +32 -0
  27. package/lib/types/core/efforts.d.ts.map +1 -0
  28. package/lib/types/core/filter.d.ts +28 -0
  29. package/lib/types/core/filter.d.ts.map +1 -0
  30. package/lib/types/core/path-ops.d.ts +40 -0
  31. package/lib/types/core/path-ops.d.ts.map +1 -0
  32. package/lib/types/core/paths.d.ts +16 -0
  33. package/lib/types/core/paths.d.ts.map +1 -0
  34. package/lib/types/core/presets.d.ts +31 -0
  35. package/lib/types/core/presets.d.ts.map +1 -0
  36. package/lib/types/core/validate.d.ts +3 -0
  37. package/lib/types/core/validate.d.ts.map +1 -0
  38. package/lib/types/index.d.ts +10 -0
  39. package/lib/types/index.d.ts.map +1 -0
  40. package/package.json +87 -0
  41. package/src/README.en.md +23 -0
  42. package/src/README.md +23 -0
  43. package/src/client/EffortDeclareSection.tsx +496 -0
  44. package/src/client/README.en.md +27 -0
  45. package/src/client/README.md +27 -0
  46. package/src/client/effort-declare.module.css +278 -0
  47. package/src/client/index.ts +97 -0
  48. package/src/client/load-drafts.ts +83 -0
  49. package/src/client/locales.ts +133 -0
  50. package/src/client/schema-ops.ts +20 -0
  51. package/src/core/README.en.md +27 -0
  52. package/src/core/README.md +27 -0
  53. package/src/core/catalog.ts +61 -0
  54. package/src/core/drafts.ts +137 -0
  55. package/src/core/efforts.ts +119 -0
  56. package/src/core/filter.ts +82 -0
  57. package/src/core/path-ops.ts +65 -0
  58. package/src/core/paths.ts +45 -0
  59. package/src/core/presets.ts +104 -0
  60. package/src/core/validate.ts +7 -0
  61. package/src/css-modules.d.ts +6 -0
  62. package/src/index.ts +11 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","names":["css"],"sources":["../src/core/catalog.ts","../src/core/paths.ts","../src/core/filter.ts","../src/core/path-ops.ts","../src/core/drafts.ts","../src/core/efforts.ts","../src/core/presets.ts","../src/core/validate.ts","../src/client/load-drafts.ts","../src/client/EffortDeclareSection.tsx","../src/client/schema-ops.ts","../src/client/locales.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Canonical thinking levels and openai-completions thinkingFormat names.\n *\n * Levels match `@deepseek-ai/dsh-llm-pi-ai` catalog.ts `THINKING_LEVELS`.\n * Formats match `SUPPORTED_THINKING_FORMATS` in the same file (rc.8).\n * Runtime UI prefers the live settings schema union; these lists are the\n * fallback plus a test pin so a silent drift is a failing test, not a\n * second hand-maintained copy nobody notices.\n */\n\n/** Selectable reasoning levels, in pi-ai escalation order. */\nexport const THINKING_LEVELS = [\n 'off',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n] as const\n\nexport type ThinkingLevel = (typeof THINKING_LEVELS)[number]\n\n/** Thinking levels other than Off; Off has its own tri-state control. */\nexport const THINKING_LEVELS_WITHOUT_OFF = THINKING_LEVELS.filter(\n (level): level is Exclude<ThinkingLevel, 'off'> => level !== 'off',\n)\n\n/**\n * openai-completions thinkingFormat values from llm-pi-ai catalog.ts rc.8.\n * Tests pin this list; the settings page prefers schema union choices.\n */\nexport const FALLBACK_THINKING_FORMATS = [\n 'openai',\n 'deepseek',\n 'openrouter',\n 'together',\n 'zai',\n 'qwen',\n 'chat-template',\n 'qwen-chat-template',\n 'string-thinking',\n 'ant-ling',\n] as const\n\nexport type ThinkingFormat = (typeof FALLBACK_THINKING_FORMATS)[number]\n\n/** Wire protocol this plugin's v1 editor supports. */\nexport const OPENAI_COMPLETIONS = 'openai-completions'\n\n/** Settings namespace this plugin writes. */\nexport const LLM_PI_AI_NS = 'llm-pi-ai'\n\n/** Official DeepSeek adapter namespace — skip. */\nexport const LLM_DEEPSEEK_NS = 'llm-deepseek'\n\n/** Official DeepSeek provider route — skip. */\nexport const DEEPSEEK_OFFICIAL = 'deepseek-official'\n\n/** Any route key walks a dict schema to the same profile node. */\nexport const SCHEMA_PROBE_ROUTE = '\\u0000probe'\n","/**\n * Nested get/has over plain JSON, matching ui-settings SettingsSchemaService\n * for the paths this plugin needs. Kept in-repo so tests do not import a\n * Cordis service.\n */\n\n/** Read a nested value by string keys / array indexes. */\nexport function getPath(value: unknown, path: readonly string[]): unknown {\n let current: unknown = value\n for (const key of path) {\n if (Array.isArray(current)) {\n current = current[Number(key)]\n continue\n }\n if (typeof current !== 'object' || current === null) return undefined\n current = (current as Record<string, unknown>)[key]\n }\n return current\n}\n\n/** Whether the final path key exists, independently of its value. */\nexport function hasPath(value: unknown, path: readonly string[]): boolean {\n if (path.length === 0) return value !== undefined\n const parent = getPath(value, path.slice(0, -1))\n const key = path[path.length - 1] as string\n if (Array.isArray(parent)) return Number(key) < parent.length\n if (typeof parent !== 'object' || parent === null) return false\n return key in parent\n}\n\n/** Plain object (not array, not null). */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/** Structured clone of a JSON object, or `{}` when the source is not one. */\nexport function cloneObject(value: unknown): Record<string, unknown> {\n return isPlainObject(value) ? structuredClone(value) : {}\n}\n\n/** Structured clone of a models array; non-arrays and non-object rows are skipped. */\nexport function cloneModels(value: unknown): Record<string, unknown>[] {\n if (!Array.isArray(value)) return []\n return value.flatMap((row) => (isPlainObject(row) ? [structuredClone(row)] : []))\n}\n","import {\n DEEPSEEK_OFFICIAL,\n LLM_DEEPSEEK_NS,\n LLM_PI_AI_NS,\n OPENAI_COMPLETIONS,\n} from './catalog.ts'\nimport { getPath, isPlainObject } from './paths.ts'\n\n/** Directory row from `llm.providers()` (the fields v1 filtering reads). */\nexport interface ProviderDirectoryEntry {\n provider: string\n displayName?: string\n settingsNs?: string\n settingsPath?: readonly string[]\n declared?: boolean\n active?: boolean\n}\n\n/**\n * Resolve the wire protocol for a route.\n * User/effective `api` wins; then schema default; then openai-completions.\n */\nexport function resolveRouteApi(\n profile: unknown,\n schemaDefault: string | undefined,\n): string {\n if (isPlainObject(profile) && typeof profile.api === 'string' && profile.api.length > 0) {\n return profile.api\n }\n if (schemaDefault !== undefined && schemaDefault.length > 0) return schemaDefault\n return OPENAI_COMPLETIONS\n}\n\nexport interface EditableDecision {\n editable: boolean\n reason?: 'not-pi-ai' | 'official-deepseek' | 'catalog' | 'not-completions'\n}\n\n/**\n * v1 editable routes: hand-declared llm-pi-ai openai-completions.\n * Catalog routes are excluded (writing `models` replaces the whole catalog).\n */\nexport function classifyRoute(\n entry: ProviderDirectoryEntry,\n profile: unknown,\n schemaDefaultApi?: string,\n): EditableDecision {\n if (entry.provider === DEEPSEEK_OFFICIAL || entry.settingsNs === LLM_DEEPSEEK_NS) {\n return { editable: false, reason: 'official-deepseek' }\n }\n if (entry.settingsNs !== LLM_PI_AI_NS) {\n return { editable: false, reason: 'not-pi-ai' }\n }\n if (entry.declared !== true) {\n return { editable: false, reason: 'catalog' }\n }\n const api = resolveRouteApi(profile, schemaDefaultApi)\n if (api !== OPENAI_COMPLETIONS) {\n return { editable: false, reason: 'not-completions' }\n }\n return { editable: true }\n}\n\n/** Profile object at `providers.<route>` from an llm-pi-ai section value. */\nexport function profileAt(\n section: unknown,\n settingsPath: readonly string[] | undefined,\n provider: string,\n): unknown {\n const path = settingsPath !== undefined && settingsPath.length > 0\n ? settingsPath\n : ['providers', provider]\n return getPath(section, path)\n}\n\n/** String choices from a schemastery union node (`type: 'union'`). */\nexport function unionStringChoices(node: unknown): string[] {\n if (!isPlainObject(node) || node.type !== 'union' || !Array.isArray(node.list)) return []\n return node.list\n .map((entry) => (isPlainObject(entry) ? entry.value : undefined))\n .filter((value): value is string => typeof value === 'string')\n}\n","/**\n * Minimal path ops, same one-level-key algorithm as the official\n * ProviderEditor.pathOps: only keys that differ produce a set/unset.\n */\n\nexport type PathOp =\n | { op: 'set'; path: string[]; value: unknown }\n | { op: 'unset'; path: string[] }\n\n/**\n * The minimal path ops carrying `after` over `before`.\n * @param base - path of the edited subtree.\n * @param before - subtree as loaded, or undefined when new.\n * @param after - subtree as edited.\n */\nexport function pathOps(\n base: readonly string[],\n before: unknown,\n after: Record<string, unknown>,\n): PathOp[] {\n const previous = typeof before === 'object' && before !== null && !Array.isArray(before)\n ? before as Record<string, unknown>\n : {}\n const ops: PathOp[] = []\n for (const [key, value] of Object.entries(after)) {\n if (JSON.stringify(previous[key]) === JSON.stringify(value)) continue\n ops.push({ op: 'set', path: [...base, key], value })\n }\n for (const key of Object.keys(previous)) {\n if (!(key in after)) ops.push({ op: 'unset', path: [...base, key] })\n }\n return ops\n}\n\nexport interface SaveSlices {\n /** Profile path from `llm.providers[].settingsPath` (not a hardcoded route id). */\n settingsPath: readonly string[]\n /** Models array before the edit (user layer). */\n beforeModels: unknown\n /** Models array after the edit — every existing row, spread intact. */\n afterModels: unknown[]\n /** Route-level compat before the edit (`undefined` = field absent on user). */\n beforeCompat: unknown\n /**\n * Route-level compat after the edit. `undefined` means leave the field\n * untouched (no compat ops at all).\n */\n afterCompat: Record<string, unknown> | undefined\n}\n\n/**\n * Ops for one route: whole-array `models` replace when the table changed,\n * plus one-level compat path ops. Never replace the `llm-pi-ai` section.\n */\nexport function buildSaveOps(slices: SaveSlices): PathOp[] {\n const base = [...slices.settingsPath]\n const ops: PathOp[] = []\n if (JSON.stringify(slices.beforeModels) !== JSON.stringify(slices.afterModels)) {\n ops.push({ op: 'set', path: [...base, 'models'], value: slices.afterModels })\n }\n if (slices.afterCompat !== undefined) {\n ops.push(...pathOps([...base, 'compat'], slices.beforeCompat, slices.afterCompat))\n }\n return ops\n}\n","/**\n * Route-card draft merge: user-layer slices, namespace revision, dirty preserve.\n * No React — settings UI and tests share these helpers.\n */\nimport { profileAt } from './filter.ts'\nimport { buildSaveOps } from './path-ops.ts'\nimport { cloneModels, cloneObject, isPlainObject } from './paths.ts'\n\n/** Editable llm-pi-ai route as the settings section holds it. */\nexport interface RouteDraft {\n provider: string\n displayName: string\n /** Path inside the llm-pi-ai section (`llm.providers[].settingsPath`). */\n settingsPath: readonly string[]\n /** Namespace revision (one value for the whole llm-pi-ai document). */\n revision: number\n models: Record<string, unknown>[]\n originalModels: Record<string, unknown>[]\n compat: Record<string, unknown>\n originalCompat: Record<string, unknown>\n /** Whether `compat` is present on the user profile (not the effective view). */\n compatPresent: boolean\n}\n\n/** Build a draft from the stored user subtree (never from effective `value`). */\nexport function routeDraftFromUserProfile(args: {\n provider: string\n displayName: string\n settingsPath: readonly string[]\n revision: number\n userProfile: unknown\n}): RouteDraft {\n const { provider, displayName, settingsPath, revision, userProfile } = args\n const models = cloneModels(isPlainObject(userProfile) ? userProfile.models : [])\n const compatPresent = isPlainObject(userProfile) && 'compat' in userProfile && isPlainObject(userProfile.compat)\n const compat = cloneObject(isPlainObject(userProfile) ? userProfile.compat : {})\n return {\n provider,\n displayName,\n settingsPath: [...settingsPath],\n revision,\n models,\n originalModels: cloneModels(models),\n compat,\n originalCompat: cloneObject(compat),\n compatPresent,\n }\n}\n\n/** Dirty iff pathOps would emit something (same comparison as save). */\nexport function draftDirty(draft: RouteDraft): boolean {\n return buildSaveOps({\n settingsPath: draft.settingsPath,\n beforeModels: draft.originalModels,\n afterModels: draft.models,\n beforeCompat: draft.compatPresent ? draft.originalCompat : undefined,\n afterCompat: draft.compat,\n }).length > 0\n}\n\n/** Treat the current models/compat as the committed originals (no-op save). */\nexport function alignDraft(draft: RouteDraft): RouteDraft {\n return {\n ...draft,\n originalModels: cloneModels(draft.models),\n originalCompat: cloneObject(draft.compat),\n compatPresent: Object.keys(draft.compat).length > 0 ? true : draft.compatPresent,\n }\n}\n\n/** Fold a successful mutate view: saved card realigns; every card gets the new revision. */\nexport function applySaveSuccess(\n drafts: readonly RouteDraft[],\n savedProvider: string,\n slice: { user: unknown; revision: number },\n): RouteDraft[] {\n return drafts.map((draft) => {\n if (draft.provider !== savedProvider) {\n return { ...draft, revision: slice.revision }\n }\n const userProfile = profileAt(slice.user, draft.settingsPath, draft.provider)\n return routeDraftFromUserProfile({\n provider: draft.provider,\n displayName: draft.displayName,\n settingsPath: draft.settingsPath,\n revision: slice.revision,\n userProfile,\n })\n })\n}\n\n/**\n * Apply a freshly loaded table. Dirty cards keep models/compat; originals and\n * revision follow the incoming snapshot so a later save is against the new user layer.\n */\nexport function mergeLoadedDrafts(\n current: readonly RouteDraft[],\n incoming: readonly RouteDraft[],\n options: { preserveDirty: boolean },\n): { drafts: RouteDraft[]; conflicted: string[] } {\n const currentByProvider = new Map(current.map(draft => [draft.provider, draft]))\n const conflicted: string[] = []\n const drafts = incoming.map((next) => {\n const prev = currentByProvider.get(next.provider)\n if (prev === undefined || !options.preserveDirty || !draftDirty(prev)) return next\n conflicted.push(next.provider)\n return {\n ...prev,\n displayName: next.displayName,\n settingsPath: next.settingsPath,\n revision: next.revision,\n originalModels: cloneModels(next.originalModels),\n originalCompat: cloneObject(next.originalCompat),\n compatPresent: next.compatPresent,\n }\n })\n return { drafts, conflicted }\n}\n\n/** Increment a generation counter; callers discard stale async settlements. */\nexport function nextGeneration(holder: { current: number }): number {\n holder.current += 1\n return holder.current\n}\n\n/** Whether `generation` is still the latest issued token. */\nexport function generationIsCurrent(holder: { current: number }, generation: number): boolean {\n return holder.current === generation\n}\n\n/** Keep a stored thinkingFormat visible even if the schema union omitted it. */\nexport function thinkingFormatChoices(formats: readonly string[], current: unknown): string[] {\n if (typeof current === 'string' && current.length > 0 && !formats.includes(current)) {\n return [current, ...formats]\n }\n return [...formats]\n}\n","import { THINKING_LEVELS, type ThinkingLevel } from './catalog.ts'\n\n/** Per-model reasoningEfforts dict as stored in llm-pi-ai settings. */\nexport type ReasoningEfforts = Partial<Record<ThinkingLevel, string | null>>\n\n/** Off tri-state. Must not be collapsed into a single checkbox. */\nexport type OffMode = 'absent' | 'empty' | 'value'\n\nexport type ReasoningEffortsField = ReasoningEfforts | false | undefined\n\n/** Read Off's three states from a stored dict. */\nexport function readOff(efforts: ReasoningEfforts | undefined): { mode: OffMode; value: string } {\n if (efforts === undefined || !('off' in efforts) || efforts.off === undefined) {\n return { mode: 'absent', value: 'none' }\n }\n if (efforts.off === null) return { mode: 'empty', value: 'none' }\n return { mode: 'value', value: efforts.off }\n}\n\n/** Write Off's three states onto a dict (does not mutate the input). */\nexport function writeOff(\n efforts: ReasoningEfforts,\n mode: OffMode,\n value: string,\n): ReasoningEfforts {\n const next: ReasoningEfforts = { ...efforts }\n delete next.off\n if (mode === 'empty') next.off = null\n else if (mode === 'value') next.off = value.trim().length > 0 ? value : 'none'\n return next\n}\n\n/** Whether a thinking level (other than Off) is currently declared. */\nexport function hasLevel(efforts: ReasoningEfforts | undefined, level: Exclude<ThinkingLevel, 'off'>): boolean {\n return efforts !== undefined && efforts[level] !== undefined && efforts[level] !== null\n}\n\n/** Toggle a non-off level. New levels default the wire spelling to the key. */\nexport function toggleLevel(\n efforts: ReasoningEfforts,\n level: Exclude<ThinkingLevel, 'off'>,\n enabled: boolean,\n wire?: string,\n): ReasoningEfforts {\n const next: ReasoningEfforts = { ...efforts }\n if (enabled) next[level] = wire !== undefined && wire.length > 0 ? wire : level\n else delete next[level]\n return next\n}\n\n/** Set the wire spelling for a declared non-off level. */\nexport function setWireSpelling(\n efforts: ReasoningEfforts,\n level: Exclude<ThinkingLevel, 'off'>,\n wire: string,\n): ReasoningEfforts {\n if (!hasLevel(efforts, level)) return efforts\n return { ...efforts, [level]: wire }\n}\n\n/**\n * Validate a reasoningEfforts field. Returns an error code; never throws.\n * Absence / `false` are valid (default-off / catalog strip). Empty dict and\n * off-only are rejected by the official resolver.\n */\nexport function validateReasoningEfforts(efforts: unknown): 'empty' | 'off-only' | 'bad-wire' | undefined {\n if (efforts === undefined || efforts === false) return undefined\n if (efforts === null || (typeof efforts === 'object' && !Array.isArray(efforts) && Object.keys(efforts).length === 0)) {\n return 'empty'\n }\n if (typeof efforts !== 'object' || Array.isArray(efforts)) return 'empty'\n const record = efforts as Record<string, unknown>\n const known = new Set<string>(THINKING_LEVELS)\n for (const key of Object.keys(record)) {\n if (!known.has(key)) return 'bad-wire'\n }\n const declared = THINKING_LEVELS.flatMap((level) => {\n if (!(level in record) || record[level] === undefined) return []\n return [[level, record[level]] as const]\n })\n for (const [level, wire] of declared) {\n if (wire === null) {\n if (level !== 'off') return 'bad-wire'\n } else if (typeof wire !== 'string' || wire.length === 0) {\n return 'bad-wire'\n }\n }\n if (!declared.some(([level]) => level !== 'off')) return 'off-only'\n return undefined\n}\n\n/** Drop reasoningEfforts from a model row; keep every other field. */\nexport function clearReasoningEfforts(row: Record<string, unknown>): Record<string, unknown> {\n const next = { ...row }\n delete next.reasoningEfforts\n return next\n}\n\n/** Read reasoningEfforts from a model row. `false` is treated as absent for the editor. */\nexport function readEfforts(row: Record<string, unknown>): ReasoningEfforts | undefined {\n const value = row.reasoningEfforts\n if (value === undefined || value === false || value === null) return undefined\n if (typeof value !== 'object' || Array.isArray(value)) return undefined\n return value as ReasoningEfforts\n}\n\n/** Put a dict (or omit the field) onto a spread row. */\nexport function writeEfforts(\n row: Record<string, unknown>,\n efforts: ReasoningEfforts | undefined,\n): Record<string, unknown> {\n const next = { ...row }\n if (efforts === undefined || Object.keys(efforts).length === 0) {\n delete next.reasoningEfforts\n return next\n }\n next.reasoningEfforts = efforts\n return next\n}\n","import type { ReasoningEfforts } from './efforts.ts'\n\nexport type PresetId = 'deepseek' | 'openai' | 'toggle'\n\nexport interface PresetCompatPatch {\n /**\n * Every preset states all three UI dialect keys. `set` writes the key;\n * `unset` removes it. Unknown extra compat keys are left in place.\n */\n thinkingFormat: 'set' | 'unset'\n thinkingFormatValue?: string\n supportsDeveloperRole: 'set-false' | 'unset'\n supportsReasoningEffort: 'set-false' | 'unset'\n}\n\nexport interface EffortPreset {\n id: PresetId\n efforts: ReasoningEfforts\n compat: PresetCompatPatch\n /** True when selector levels do not change the on-wire request (except Off). */\n warnSameWire: boolean\n}\n\n/** DeepSeek-compatible gateway: explicit thinking.disabled on Off. */\nexport const DEEPSEEK_PRESET: EffortPreset = {\n id: 'deepseek',\n efforts: {\n off: null,\n low: 'low',\n high: 'high',\n max: 'max',\n },\n compat: {\n thinkingFormat: 'set',\n thinkingFormatValue: 'deepseek',\n supportsDeveloperRole: 'set-false',\n supportsReasoningEffort: 'unset',\n },\n warnSameWire: false,\n}\n\n/** OpenAI-compatible gateway: default thinkingFormat (omit the key). */\nexport const OPENAI_PRESET: EffortPreset = {\n id: 'openai',\n efforts: {\n minimal: 'minimal',\n low: 'low',\n medium: 'medium',\n high: 'high',\n },\n compat: {\n thinkingFormat: 'unset',\n supportsDeveloperRole: 'unset',\n supportsReasoningEffort: 'unset',\n },\n warnSameWire: false,\n}\n\n/** On/off only: selector may list levels that are identical on the wire. */\nexport const TOGGLE_PRESET: EffortPreset = {\n id: 'toggle',\n efforts: {\n off: null,\n high: 'high',\n },\n compat: {\n thinkingFormat: 'unset',\n supportsDeveloperRole: 'unset',\n supportsReasoningEffort: 'set-false',\n },\n warnSameWire: true,\n}\n\nexport const PRESETS: Record<PresetId, EffortPreset> = {\n deepseek: DEEPSEEK_PRESET,\n openai: OPENAI_PRESET,\n toggle: TOGGLE_PRESET,\n}\n\n/** Apply a preset's efforts onto every model row (spread, keep other fields). */\nexport function applyPresetEfforts(\n models: readonly Record<string, unknown>[],\n preset: EffortPreset,\n): Record<string, unknown>[] {\n return models.map(row => ({ ...row, reasoningEfforts: { ...preset.efforts } }))\n}\n\n/** Merge a preset's compat patch onto the current route-level compat object. */\nexport function applyPresetCompat(\n compat: Record<string, unknown>,\n preset: EffortPreset,\n): Record<string, unknown> {\n const next = { ...compat }\n const { compat: patch } = preset\n if (patch.thinkingFormat === 'unset') delete next.thinkingFormat\n else if (patch.thinkingFormat === 'set' && patch.thinkingFormatValue !== undefined) {\n next.thinkingFormat = patch.thinkingFormatValue\n }\n if (patch.supportsDeveloperRole === 'unset') delete next.supportsDeveloperRole\n else if (patch.supportsDeveloperRole === 'set-false') next.supportsDeveloperRole = false\n if (patch.supportsReasoningEffort === 'unset') delete next.supportsReasoningEffort\n else if (patch.supportsReasoningEffort === 'set-false') next.supportsReasoningEffort = false\n return next\n}\n","import { validateReasoningEfforts } from './efforts.ts'\n\n/** Per-model client-side check used to show errors without throwing. */\nexport function modelEffortError(row: Record<string, unknown>): 'empty' | 'off-only' | 'bad-wire' | undefined {\n if (!('reasoningEfforts' in row) || row.reasoningEfforts === undefined) return undefined\n return validateReasoningEfforts(row.reasoningEfforts)\n}\n","/**\n * Load editable route drafts from llm.providers + the llm-pi-ai namespace.\n * Drafts come from the user layer; route protocol classification may use effective value.\n */\nimport type { IApiClient, SettingsNamespaceView } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport {\n FALLBACK_THINKING_FORMATS,\n LLM_PI_AI_NS,\n SCHEMA_PROBE_ROUTE,\n} from '../core/catalog.ts'\nimport { routeDraftFromUserProfile, type RouteDraft } from '../core/drafts.ts'\nimport { classifyRoute, profileAt, unionStringChoices } from '../core/filter.ts'\nimport { isPlainObject } from '../core/paths.ts'\nimport type { SchemaOps } from './schema-ops.ts'\n\nfunction schemaDefaultString(node: unknown): string | undefined {\n if (!isPlainObject(node) || !isPlainObject(node.meta)) return undefined\n return typeof node.meta.default === 'string' ? node.meta.default : undefined\n}\n\nexport interface LoadDraftsResult {\n writable: boolean\n formats: string[]\n drafts: RouteDraft[]\n error?: string\n}\n\n/**\n * First paint: `ensure()` (reads only from idle). Never treat ensure as refresh.\n * Callers that must not apply a stale settlement compare generation themselves.\n */\nexport async function loadDrafts(\n api: Pick<IApiClient, 'llm'>,\n describe: Pick<SettingsDescribeFace, 'ensure' | 'getSnapshot'>,\n schema: SchemaOps,\n): Promise<LoadDraftsResult> {\n await describe.ensure()\n const mirrored = describe.getSnapshot()\n if (mirrored.view === undefined) {\n return { writable: false, formats: [...FALLBACK_THINKING_FORMATS], drafts: [], error: mirrored.error ?? undefined }\n }\n const providersResponse = await api.llm.providers({})\n if (!providersResponse.result.ok) {\n return {\n writable: mirrored.view.writable,\n formats: [...FALLBACK_THINKING_FORMATS],\n drafts: [],\n error: providersResponse.result.error.message,\n }\n }\n const namespaces = new Map(mirrored.view.namespaces.map((view: SettingsNamespaceView) => [view.ns, view]))\n const pi = namespaces.get(LLM_PI_AI_NS)\n let formats: string[] = [...FALLBACK_THINKING_FORMATS]\n let schemaDefaultApi: string | undefined\n if (pi !== undefined) {\n try {\n const root = schema.rehydrate(pi.schema)\n const formatNode = schema.nodeAtPath(root, ['providers', SCHEMA_PROBE_ROUTE, 'compat', 'thinkingFormat'])\n const fromSchema = unionStringChoices(formatNode)\n if (fromSchema.length > 0) formats = fromSchema\n schemaDefaultApi = schemaDefaultString(schema.nodeAtPath(root, ['providers', SCHEMA_PROBE_ROUTE, 'api']))\n } catch {\n // Live schema walk is best-effort; fallback list is test-pinned.\n }\n }\n const drafts: RouteDraft[] = []\n for (const entry of providersResponse.result.value.providers) {\n const settingsPath = entry.settingsPath !== undefined && entry.settingsPath.length > 0\n ? [...entry.settingsPath]\n : ['providers', entry.provider]\n const effective = profileAt(pi?.value, settingsPath, entry.provider)\n if (!classifyRoute(entry, effective, schemaDefaultApi).editable) continue\n drafts.push(routeDraftFromUserProfile({\n provider: entry.provider,\n displayName: entry.displayName ?? entry.provider,\n settingsPath,\n revision: pi?.revision ?? 0,\n userProfile: profileAt(pi?.user, settingsPath, entry.provider),\n }))\n }\n return { writable: mirrored.view.writable, formats, drafts }\n}\n","/**\n * Settings section: per-model reasoningEfforts + openai-completions compat\n * for hand-declared llm-pi-ai routes.\n */\nimport { useCallback, useEffect, useRef, useState, type ReactNode } from 'react'\nimport type { IApiClient } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport { LLM_PI_AI_NS, THINKING_LEVELS_WITHOUT_OFF } from '../core/catalog.ts'\nimport {\n alignDraft,\n applySaveSuccess,\n draftDirty,\n generationIsCurrent,\n mergeLoadedDrafts,\n nextGeneration,\n thinkingFormatChoices,\n type RouteDraft,\n} from '../core/drafts.ts'\nimport {\n hasLevel,\n readEfforts,\n readOff,\n setWireSpelling,\n toggleLevel,\n writeEfforts,\n writeOff,\n clearReasoningEfforts,\n} from '../core/efforts.ts'\nimport { applyPresetCompat, applyPresetEfforts, PRESETS, type PresetId } from '../core/presets.ts'\nimport { buildSaveOps } from '../core/path-ops.ts'\nimport { cloneModels, cloneObject } from '../core/paths.ts'\nimport { modelEffortError } from '../core/validate.ts'\nimport { loadDrafts } from './load-drafts.ts'\nimport type { SchemaOps } from './schema-ops.ts'\nimport type { EffortDeclareKey } from './locales.ts'\nimport css from './effort-declare.module.css'\n\nexport type InvalidationSource = 'settings' | 'directory'\n\nexport interface EffortDeclareSectionInjected {\n api: Pick<IApiClient, 'settings' | 'llm'>\n describe: SettingsDescribeFace\n schema: SchemaOps\n t: (key: EffortDeclareKey) => string\n subscribeInvalidate: (listener: (source: InvalidationSource) => void) => () => void\n}\n\nexport interface EffortDeclareSectionProps extends Partial<EffortDeclareSectionInjected> {\n t: (key: EffortDeclareKey) => string\n close: () => void\n}\n\nexport { loadDrafts } from './load-drafts.ts'\n\ntype CardNotice = { kind: 'saved' | 'conflict' | 'error'; text: string }\n\nfunction compatSummary(compat: Record<string, unknown>): string {\n const parts: string[] = []\n if (typeof compat.thinkingFormat === 'string') parts.push(`thinkingFormat=${compat.thinkingFormat}`)\n if (compat.supportsDeveloperRole === false) parts.push('supportsDeveloperRole=false')\n if (compat.supportsReasoningEffort === false) parts.push('supportsReasoningEffort=false')\n return parts.join(' · ')\n}\n\nfunction errorText(code: ReturnType<typeof modelEffortError>, t: (key: EffortDeclareKey) => string): string | undefined {\n if (code === 'empty') return t('errorEmpty')\n if (code === 'off-only') return t('errorOffOnly')\n if (code === 'bad-wire') return t('errorBadWire')\n return undefined\n}\n\nfunction ModelRowEditor(props: {\n row: Record<string, unknown>\n index: number\n radioName: string\n disabled: boolean\n t: (key: EffortDeclareKey) => string\n onChange: (row: Record<string, unknown>) => void\n}): ReactNode {\n const { row, disabled, t, onChange } = props\n const efforts = readEfforts(row) ?? {}\n const off = readOff(readEfforts(row))\n const id = typeof row.id === 'string' ? row.id : ''\n const name = typeof row.name === 'string' ? row.name : ''\n\n const patchEfforts = (next: typeof efforts): void => {\n onChange(writeEfforts(row, Object.keys(next).length === 0 ? undefined : next))\n }\n\n return (\n <div className={css.modelEntry}>\n <div className={css.modelHead}>\n <span className={css.modelId}>{id || t('model')}</span>\n {name !== '' && name !== id ? <span className={css.modelName}>{name}</span> : null}\n <button\n type=\"button\"\n className={css.linkButton}\n disabled={disabled || !('reasoningEfforts' in row)}\n onClick={() => { onChange(clearReasoningEfforts(row)) }}\n >\n {t('clear')}\n </button>\n </div>\n <span className={css.fieldLabel}>{t('levels')}</span>\n <div className={css.levels}>\n {THINKING_LEVELS_WITHOUT_OFF.map((level) => (\n <label key={level} className={css.level}>\n <input\n type=\"checkbox\"\n checked={hasLevel(efforts, level)}\n disabled={disabled}\n onChange={(event) => { patchEfforts(toggleLevel(efforts, level, event.target.checked)) }}\n />\n {level}\n </label>\n ))}\n </div>\n <div className={css.wireRow}>\n <span className={css.fieldLabel}>{t('wire')}</span>\n {THINKING_LEVELS_WITHOUT_OFF.filter(level => hasLevel(efforts, level)).map((level) => (\n <label key={level} className={css.level}>\n {level}\n <input\n className={`${css.input} ${css.wireInput}`}\n type=\"text\"\n value={efforts[level] ?? level}\n disabled={disabled}\n aria-label={`${t('wire')} ${level}`}\n onChange={(event) => { patchEfforts(setWireSpelling(efforts, level, event.target.value)) }}\n />\n </label>\n ))}\n </div>\n <div className={css.offGroup}>\n <span className={css.fieldLabel}>{t('offMode')}</span>\n {(['absent', 'empty', 'value'] as const).map((mode) => (\n <label key={mode} className={css.level}>\n <input\n type=\"radio\"\n name={props.radioName}\n checked={off.mode === mode}\n disabled={disabled}\n onChange={() => { patchEfforts(writeOff(efforts, mode, off.value)) }}\n />\n {mode === 'absent' ? t('offAbsent') : mode === 'empty' ? t('offEmpty') : t('offValue')}\n </label>\n ))}\n {off.mode === 'value'\n ? (\n <input\n className={`${css.input} ${css.wireInput}`}\n type=\"text\"\n value={off.value}\n placeholder={t('offValuePlaceholder')}\n disabled={disabled}\n onChange={(event) => { patchEfforts(writeOff(efforts, 'value', event.target.value)) }}\n />\n )\n : null}\n </div>\n </div>\n )\n}\n\nfunction RouteCard(props: {\n draft: RouteDraft\n formats: readonly string[]\n writable: boolean\n busy: boolean\n reloading: boolean\n notice: CardNotice | undefined\n t: (key: EffortDeclareKey) => string\n onChange: (draft: RouteDraft) => void\n onSave: (draft: RouteDraft) => void\n onCancel: (draft: RouteDraft) => void\n}): ReactNode {\n const { draft, writable, busy, reloading, t, onChange } = props\n const noModels = draft.models.length === 0\n const editDisabled = !writable || busy || noModels\n const saveLocked = editDisabled || reloading\n const formats = thinkingFormatChoices(props.formats, draft.compat.thinkingFormat)\n const summary = compatSummary(draft.compat)\n const sameWire = draft.compat.supportsReasoningEffort === false\n const clientError = draft.models\n .map(row => errorText(modelEffortError(row), t))\n .find(text => text !== undefined)\n const dirty = draftDirty(draft)\n\n const applyPreset = (id: PresetId): void => {\n const preset = PRESETS[id]\n onChange({\n ...draft,\n models: applyPresetEfforts(draft.models, preset),\n compat: applyPresetCompat(draft.compat, preset),\n })\n }\n\n return (\n <li className={css.rowCard}>\n <div className={css.rowHead}>\n <span className={css.rowName}>{draft.displayName}</span>\n <span className={css.rowTag}>{draft.provider}</span>\n </div>\n <p className={css.compatSummary}>\n {t('compatSummary')}\n {summary === '' ? '' : `: ${summary}`}\n </p>\n <div className={css.presetRow}>\n <span className={css.fieldLabel}>{t('presets')}</span>\n <button type=\"button\" className={css.secondaryButton} disabled={editDisabled} onClick={() => { applyPreset('deepseek') }}>\n {t('presetDeepSeek')}\n </button>\n <button type=\"button\" className={css.secondaryButton} disabled={editDisabled} onClick={() => { applyPreset('openai') }}>\n {t('presetOpenAI')}\n </button>\n <button type=\"button\" className={css.secondaryButton} disabled={editDisabled} onClick={() => { applyPreset('toggle') }}>\n {t('presetToggle')}\n </button>\n </div>\n {sameWire ? <p className={css.notice}>{t('presetToggleWarn')}</p> : null}\n {noModels ? <p className={css.notice}>{t('noModels')}</p> : null}\n {draft.models.map((row, index) => (\n <ModelRowEditor\n key={`${String(row.id)}-${String(index)}`}\n row={row}\n index={index}\n radioName={`off-${draft.provider}-${String(index)}`}\n disabled={editDisabled}\n t={t}\n onChange={(next) => {\n const models = draft.models.map((candidate, at) => at === index ? next : candidate)\n onChange({ ...draft, models })\n }}\n />\n ))}\n <details className={css.advanced}>\n <summary>{t('advanced')}</summary>\n <div className={css.advancedBody}>\n <label className={css.fieldLabel}>\n {t('thinkingFormat')}\n <select\n className={`${css.input} ${css.selectInput}`}\n value={typeof draft.compat.thinkingFormat === 'string' ? draft.compat.thinkingFormat : ''}\n disabled={editDisabled}\n onChange={(event) => {\n const compat = { ...draft.compat }\n if (event.target.value === '') delete compat.thinkingFormat\n else compat.thinkingFormat = event.target.value\n onChange({ ...draft, compat })\n }}\n >\n <option value=\"\">{t('thinkingFormatDefault')}</option>\n {formats.map(format => <option key={format} value={format}>{format}</option>)}\n </select>\n </label>\n {draft.compat.supportsDeveloperRole === true\n ? <p className={css.notice}>{t('developerTrueHint')}</p>\n : null}\n <label className={css.check}>\n <input\n type=\"checkbox\"\n checked={draft.compat.supportsDeveloperRole === false}\n disabled={editDisabled}\n onChange={(event) => {\n const compat = { ...draft.compat }\n if (event.target.checked) compat.supportsDeveloperRole = false\n else delete compat.supportsDeveloperRole\n onChange({ ...draft, compat })\n }}\n />\n {t('supportsDeveloperRole')}\n </label>\n <label className={css.check}>\n <input\n type=\"checkbox\"\n checked={draft.compat.supportsReasoningEffort === false}\n disabled={editDisabled}\n onChange={(event) => {\n const compat = { ...draft.compat }\n if (event.target.checked) compat.supportsReasoningEffort = false\n else delete compat.supportsReasoningEffort\n onChange({ ...draft, compat })\n }}\n />\n {t('supportsReasoningEffort')}\n </label>\n </div>\n </details>\n {clientError !== undefined ? <p className={css.error}>{clientError}</p> : null}\n {props.notice?.kind === 'saved' ? <p className={css.savedNotice}>{props.notice.text}</p> : null}\n {props.notice?.kind === 'conflict' || props.notice?.kind === 'error'\n ? <p className={css.error}>{props.notice.text}</p>\n : null}\n <div className={css.actions}>\n <button\n type=\"button\"\n className={css.secondaryButton}\n disabled={busy || !dirty}\n onClick={() => { props.onCancel(draft) }}\n >\n {t('cancel')}\n </button>\n <button\n type=\"button\"\n className={css.primaryButton}\n disabled={saveLocked || !dirty || clientError !== undefined}\n onClick={() => { props.onSave(draft) }}\n >\n {busy ? t('saving') : t('save')}\n </button>\n </div>\n </li>\n )\n}\n\nexport function EffortDeclareSection(props: EffortDeclareSectionProps): ReactNode {\n const t = props.t\n const api = props.api\n const describe = props.describe\n const schema = props.schema\n const [status, setStatus] = useState<'loading' | 'ready' | 'error'>('loading')\n const [error, setError] = useState('')\n const [writable, setWritable] = useState(false)\n const [formats, setFormats] = useState<string[]>([])\n const [drafts, setDrafts] = useState<RouteDraft[]>([])\n const [busyRoute, setBusyRoute] = useState<string | null>(null)\n const [notices, setNotices] = useState<Record<string, CardNotice>>({})\n const generationRef = useRef(0)\n const draftsRef = useRef(drafts)\n draftsRef.current = drafts\n\n const reload = useCallback((preserveDirty: boolean): void => {\n if (api === undefined || describe === undefined || schema === undefined) {\n setStatus('error')\n setError(t('loadError'))\n return\n }\n const generation = nextGeneration(generationRef)\n setStatus('loading')\n setError('')\n void loadDrafts(api, describe, schema).then((result) => {\n if (!generationIsCurrent(generationRef, generation)) return\n setWritable(result.writable)\n if (result.formats.length > 0) setFormats(result.formats)\n if (result.error !== undefined) {\n setStatus('error')\n setError(result.error)\n return\n }\n const merged = mergeLoadedDrafts(draftsRef.current, result.drafts, { preserveDirty })\n setDrafts(merged.drafts)\n if (merged.conflicted.length > 0) {\n setNotices(Object.fromEntries(\n merged.conflicted.map(provider => [provider, { kind: 'conflict' as const, text: t('dirtyConflict') }]),\n ))\n }\n setStatus('ready')\n }, (failure: unknown) => {\n if (!generationIsCurrent(generationRef, generation)) return\n setStatus('error')\n setError(failure instanceof Error ? failure.message : t('loadError'))\n })\n }, [api, describe, schema, t])\n\n useEffect(() => { reload(false) }, [reload])\n\n useEffect(() => {\n if (props.subscribeInvalidate === undefined) return undefined\n return props.subscribeInvalidate(() => { reload(true) })\n }, [props.subscribeInvalidate, reload])\n\n const save = async (draft: RouteDraft): Promise<void> => {\n if (api === undefined || describe === undefined) return\n if (status === 'loading' || busyRoute !== null) return\n const blocking = draft.models\n .map(row => errorText(modelEffortError(row), t))\n .find(text => text !== undefined)\n if (blocking !== undefined) {\n setNotices({ [draft.provider]: { kind: 'error', text: blocking } })\n return\n }\n setBusyRoute(draft.provider)\n setNotices({})\n try {\n const ops = buildSaveOps({\n settingsPath: draft.settingsPath,\n beforeModels: draft.originalModels,\n afterModels: draft.models,\n beforeCompat: draft.compatPresent ? draft.originalCompat : undefined,\n afterCompat: draft.compat,\n })\n if (ops.length === 0) {\n setDrafts(current => current.map(row => row.provider === draft.provider ? alignDraft(row) : row))\n return\n }\n const response = await api.settings.mutate({\n ns: LLM_PI_AI_NS,\n ops,\n expectedRevision: draft.revision,\n })\n if (!response.result.ok) {\n setNotices({\n [draft.provider]: {\n kind: 'error',\n text: response.result.error.code === 'settings-conflict' ? t('conflict') : response.result.error.message,\n },\n })\n return\n }\n const view = response.result.value\n describe.acceptView(view)\n setDrafts(current => applySaveSuccess(current, draft.provider, {\n user: view.user ?? {},\n revision: view.revision,\n }))\n setNotices({ [draft.provider]: { kind: 'saved', text: t('saved') } })\n } catch (failure) {\n setNotices({\n [draft.provider]: {\n kind: 'error',\n text: failure instanceof Error ? failure.message : t('loadError'),\n },\n })\n } finally {\n setBusyRoute(null)\n }\n }\n\n const showLoading = status === 'loading' && drafts.length === 0\n const showEmpty = status === 'ready' && drafts.length === 0\n const showList = drafts.length > 0\n\n return (\n <div className={css.section}>\n <h2 className={css.title}>{t('title')}</h2>\n <p className={css.intro}>{t('intro')}</p>\n {!writable && status === 'ready' ? <p className={css.notice}>{t('readOnly')}</p> : null}\n {showLoading ? <p className={css.intro}>{t('loading')}</p> : null}\n {status === 'error' ? <p className={css.error}>{error}</p> : null}\n {status === 'error'\n ? (\n <button type=\"button\" className={css.secondaryButton} onClick={() => { reload(true) }}>{t('reload')}</button>\n )\n : null}\n {showEmpty\n ? (\n <>\n <p className={css.notice}>{t('empty')}</p>\n <p className={css.intro}>{t('emptyHint')}</p>\n </>\n )\n : null}\n {showList\n ? (\n <ul className={css.rows}>\n {drafts.map(draft => (\n <RouteCard\n key={draft.provider}\n draft={draft}\n formats={formats.length > 0 ? formats : []}\n writable={writable}\n busy={busyRoute === draft.provider}\n reloading={status === 'loading'}\n notice={notices[draft.provider]}\n t={t}\n onChange={(next) => {\n setNotices(current => {\n const copy = { ...current }\n delete copy[next.provider]\n return copy\n })\n setDrafts(current => current.map(row => row.provider === next.provider ? next : row))\n }}\n onSave={(next) => { void save(next) }}\n onCancel={(next) => {\n setNotices(current => {\n const copy = { ...current }\n delete copy[next.provider]\n return copy\n })\n setDrafts(current => current.map(row => row.provider === next.provider\n ? {\n ...row,\n models: cloneModels(row.originalModels),\n compat: cloneObject(row.originalCompat),\n }\n : row))\n }}\n />\n ))}\n </ul>\n )\n : null}\n </div>\n )\n}\n","/**\n * Bind the settings-owned schema service without importing executable\n * helpers from another client plugin (bundle purity).\n */\nexport interface SchemaOps {\n rehydrate: (serialized: unknown) => unknown\n nodeAtPath: (root: unknown, path: readonly string[]) => unknown\n getPath: (value: unknown, path: readonly string[]) => unknown\n hasPath: (value: unknown, path: readonly string[]) => boolean\n}\n\n/** Wrap a live settingsSchema service as plain callbacks. */\nexport function bindSchema(service: SchemaOps): SchemaOps {\n return {\n rehydrate: serialized => service.rehydrate(serialized),\n nodeAtPath: (root, path) => service.nodeAtPath(root, path),\n getPath: (value, path) => service.getPath(value, path),\n hasPath: (value, path) => service.hasPath(value, path),\n }\n}\n","/**\n * Dictionary namespace for the effort-declare settings section.\n */\n\nexport type EffortDeclareKey =\n | 'nav'\n | 'title'\n | 'intro'\n | 'empty'\n | 'emptyHint'\n | 'loadError'\n | 'loading'\n | 'readOnly'\n | 'save'\n | 'saving'\n | 'cancel'\n | 'saved'\n | 'conflict'\n | 'dirtyConflict'\n | 'presets'\n | 'presetDeepSeek'\n | 'presetOpenAI'\n | 'presetToggle'\n | 'presetToggleWarn'\n | 'model'\n | 'levels'\n | 'wire'\n | 'offMode'\n | 'offAbsent'\n | 'offEmpty'\n | 'offValue'\n | 'offValuePlaceholder'\n | 'clear'\n | 'advanced'\n | 'thinkingFormat'\n | 'thinkingFormatDefault'\n | 'supportsDeveloperRole'\n | 'supportsReasoningEffort'\n | 'developerTrueHint'\n | 'compatSummary'\n | 'errorEmpty'\n | 'errorOffOnly'\n | 'errorBadWire'\n | 'noModels'\n | 'reload'\n\nexport const NS = 'plugin-effort-declare'\n\nexport const zh: Record<EffortDeclareKey, string> = {\n nav: '推理档位',\n title: '推理档位声明',\n intro: '本页声明「这模型能选哪些推理档」。对话里的档位选择仍在输入框模型菜单。没声明 = 和现在一样没有 Effort 行。不会改密钥、目录或当次选择。',\n empty: '没有可编辑的手工 openai-completions 路由。',\n emptyHint: '请先到「模型」页添加提供方(llm-pi-ai 手工路由)。官方 DeepSeek 与 catalog 路由不在本页编辑。需要 DSH ≥ 0.1.0-rc.8(providers.declared)。',\n loadError: '无法加载提供方或设置。',\n loading: '正在加载…',\n readOnly: '当前设置为只读,无法保存。',\n save: '保存',\n saving: '保存中…',\n cancel: '取消',\n saved: '已保存。对话选择器会按新的能力声明显示 Effort 行。',\n conflict: '设置已被其他地方改过,请重新加载后再保存。',\n dirtyConflict: '此路由有未保存修改,设置已在其他地方更新。保存会写到最新文档上,或先取消再改。',\n presets: '预设',\n presetDeepSeek: 'DeepSeek 兼容',\n presetOpenAI: 'OpenAI 兼容',\n presetToggle: '仅开/关',\n presetToggleWarn: '选择器里多档在线上没有区别:除 Off 外请求体相同。',\n model: '模型',\n levels: '可选档位',\n wire: '线上拼写',\n offMode: 'Off',\n offAbsent: '无 Off',\n offEmpty: 'Off 且不发参数',\n offValue: 'Off 且发字符串',\n offValuePlaceholder: 'none',\n clear: '清除本模型声明',\n advanced: '高级:协议方言',\n thinkingFormat: 'thinkingFormat',\n thinkingFormatDefault: '默认(openai)',\n supportsDeveloperRole: '系统提示走 system 而不是 developer(supportsDeveloperRole: false)',\n supportsReasoningEffort: '不发 reasoning_effort,只发开关(supportsReasoningEffort: false)',\n developerTrueHint: '当前文档是 supportsDeveloperRole: true。v1 只能强制 false 或缺席;勾选会写成 false,取消勾选会删除该键。',\n compatSummary: '协议',\n errorEmpty: '不能保存空的 reasoningEfforts。请选择档位,或清除声明。',\n errorOffOnly: '不能只开 Off,必须再开一档思考档。',\n errorBadWire: '思考档必须填写线上拼写;只有 Off 可以留空。不能使用未知档位键。',\n noModels: '这条路由还没有 models 列表。请先到「模型」页添加模型。',\n reload: '重新加载',\n}\n\nexport const en: Record<EffortDeclareKey, string> = {\n nav: 'Reasoning efforts',\n title: 'Reasoning effort declarations',\n intro: 'This page declares which reasoning levels a model can offer. The per-turn choice stays in the composer model menu. Undeclared models keep having no Effort row. Keys, catalogs, and the current selection are not edited here.',\n empty: 'No editable hand-declared openai-completions routes.',\n emptyHint: 'Add a provider on the Models page first (an llm-pi-ai hand-declared route). Official DeepSeek and catalog routes are not edited here. Requires DSH ≥ 0.1.0-rc.8 (providers.declared).',\n loadError: 'Could not load providers or settings.',\n loading: 'Loading…',\n readOnly: 'Settings are read-only; saving is disabled.',\n save: 'Save',\n saving: 'Saving…',\n cancel: 'Cancel',\n saved: 'Saved. The composer Effort row follows this capability declaration.',\n conflict: 'Settings changed elsewhere. Reload, then save again.',\n dirtyConflict: 'This route has unsaved edits and settings changed elsewhere. Save writes onto the latest document, or cancel first.',\n presets: 'Presets',\n presetDeepSeek: 'DeepSeek compatible',\n presetOpenAI: 'OpenAI compatible',\n presetToggle: 'On/off only',\n presetToggleWarn: 'Multiple selector levels are identical on the wire except Off.',\n model: 'Model',\n levels: 'Offered levels',\n wire: 'Wire spelling',\n offMode: 'Off',\n offAbsent: 'No Off',\n offEmpty: 'Off, send nothing',\n offValue: 'Off, send a string',\n offValuePlaceholder: 'none',\n clear: 'Clear this model’s declaration',\n advanced: 'Advanced: protocol dialect',\n thinkingFormat: 'thinkingFormat',\n thinkingFormatDefault: 'Default (openai)',\n supportsDeveloperRole: 'Send system prompts as system, not developer (supportsDeveloperRole: false)',\n supportsReasoningEffort: 'Do not send reasoning_effort; switch only (supportsReasoningEffort: false)',\n developerTrueHint: 'The document has supportsDeveloperRole: true. v1 can only force false or omit the key; checking writes false, unchecking deletes the key.',\n compatSummary: 'Protocol',\n errorEmpty: 'Empty reasoningEfforts cannot be saved. Pick levels, or clear the declaration.',\n errorOffOnly: 'Off alone is not enough; declare at least one thinking level.',\n errorBadWire: 'Thinking levels need a wire spelling; only Off may be empty. Unknown effort keys are rejected.',\n noModels: 'This route has no models list yet. Add models on the Models page first.',\n reload: 'Reload',\n}\n","/**\n * dsh-plugin-effort-declare — browser half: settings.section for per-model\n * reasoning effort declarations.\n */\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-api-remotes/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport { EffortDeclareSection } from './EffortDeclareSection.tsx'\nimport type { EffortDeclareSectionInjected, InvalidationSource } from './EffortDeclareSection.tsx'\nimport { bindSchema } from './schema-ops.ts'\nimport { LLM_PI_AI_NS } from '../core/catalog.ts'\nimport { NS, en, zh, type EffortDeclareKey } from './locales.ts'\nimport { cssTagId, cssText } from './effort-declare.module.css'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Effort-declare settings section copy. */\n 'plugin-effort-declare': EffortDeclareKey\n }\n}\n\nexport const inject = ['slots', 'locale', 'connection', 'remote', 'settingsScope', 'settingsSchema']\n\nconst PLUGIN_ID = 'dsh-plugin-effort-declare'\n\nfunction mountPluginCss(): () => void {\n if (typeof document === 'undefined') return () => {}\n const selector = `style[data-plugin-css=${JSON.stringify(cssTagId)}]`\n let tag = document.querySelector(selector) as HTMLStyleElement | null\n if (tag === null) {\n tag = document.createElement('style')\n tag.dataset.plugin = PLUGIN_ID\n tag.dataset.pluginCss = cssTagId\n document.head.appendChild(tag)\n }\n tag.textContent = cssText\n return () => { tag?.remove() }\n}\n\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), `${PLUGIN_ID}: dictionaries`)\n ctx.effect(() => mountPluginCss(), `${PLUGIN_ID}: css`)\n\n const connection = ctx.get('connection') as ConnectionHandle\n const settingsSchema = ctx.settingsSchema\n const schema = bindSchema({\n rehydrate: serialized => settingsSchema.rehydrate(serialized),\n nodeAtPath: (root, path) => settingsSchema.nodeAtPath(\n root as Parameters<typeof settingsSchema.nodeAtPath>[0],\n path,\n ),\n getPath: (value, path) => settingsSchema.getPath(value, path),\n hasPath: (value, path) => settingsSchema.hasPath(value, path),\n })\n const t = ctx.locale.bind(NS) as EffortDeclareSectionInjected['t']\n const describe = ctx.settingsScope.describe()\n const invalidation = new Set<(source: InvalidationSource) => void>()\n\n ctx.effect(() => {\n const emit = (source: InvalidationSource) => {\n for (const listener of invalidation) listener(source)\n }\n const disposers = [\n ctx.remote.$on('settings/document-updated', (ns: string) => {\n if (ns !== LLM_PI_AI_NS) return\n emit('settings')\n }),\n ctx.remote.$on('llm/adapters-updated', () => { emit('directory') }),\n ctx.on('connection/reset', () => { emit('directory') }),\n ]\n return () => {\n for (const dispose of disposers) dispose()\n }\n }, `${PLUGIN_ID}: invalidations`)\n\n const subscribeInvalidate: EffortDeclareSectionInjected['subscribeInvalidate'] = (listener) => {\n invalidation.add(listener)\n return () => { invalidation.delete(listener) }\n }\n\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: 'effort-declare',\n order: 15,\n label: () => t('nav'),\n locale: NS,\n inject: (): EffortDeclareSectionInjected => ({\n api: connection.api,\n describe,\n schema,\n t,\n subscribeInvalidate,\n }),\n }, EffortDeclareSection))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAWA,MAAa,kBAAkB;GAC7B;GACA;GACA;GACA;GACA;GACA;GACA;EACF;;EAKA,MAAa,8BAA8B,gBAAgB,QACxD,UAAkD,UAAU,KAC/D;;;;;EAMA,MAAa,4BAA4B;GACvC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;;EAKA,MAAa,qBAAqB;;EAGlC,MAAa,eAAe;;EAS5B,MAAa,qBAAqB;;;;;;;;;ECrDlC,SAAgB,QAAQ,OAAgB,MAAkC;GACxE,IAAI,UAAmB;GACvB,KAA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,CAAC;KACD,IAAI,OAAO,IAAI,8BAA8B;MAAE,KAAK,WAAW;KAAE,CAAC;KAClE,IAAI,GAAG,0BAA0B;MAAE,KAAK,WAAW;KAAE,CAAC;IACxD;IACA,aAAa;KACX,KAAK,MAAM,WAAW,WAAW,QAAQ;IAC3C;GACF,GAAG,GAAG,UAAU,gBAAgB;GAEhC,MAAM,uBAA4E,aAAa;IAC7F,aAAa,IAAI,QAAQ;IACzB,aAAa;KAAE,aAAa,OAAO,QAAQ;IAAE;GAC/C;GAEA,IAAI,MAAM,OAAO,0BAA0B,IAAI,MAAM,SAAS;IAC5D,MAAM;IACN,IAAI;IACJ,OAAO;IACP,aAAa,EAAE,KAAK;IACpB,QAAQ;IACR,eAA6C;KAC3C,KAAK,WAAW;KAChB;KACA;KACA;KACA;IACF;GACF,GAAG,oBAAoB,CAAC;EAC1B"}
package/lib/index.js ADDED
@@ -0,0 +1,6 @@
1
+ //#region src/index.ts
2
+ const name = "dsh-plugin-effort-declare";
3
+ /** Host apply is intentionally empty in v1. */
4
+ function apply(_ctx) {}
5
+ //#endregion
6
+ export { apply, name };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Settings section: per-model reasoningEfforts + openai-completions compat
3
+ * for hand-declared llm-pi-ai routes.
4
+ */
5
+ import { type ReactNode } from 'react';
6
+ import type { IApiClient } from '@deepseek-ai/dsh-api-remotes/client';
7
+ import type { SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client';
8
+ import type { SchemaOps } from './schema-ops.ts';
9
+ import type { EffortDeclareKey } from './locales.ts';
10
+ export type InvalidationSource = 'settings' | 'directory';
11
+ export interface EffortDeclareSectionInjected {
12
+ api: Pick<IApiClient, 'settings' | 'llm'>;
13
+ describe: SettingsDescribeFace;
14
+ schema: SchemaOps;
15
+ t: (key: EffortDeclareKey) => string;
16
+ subscribeInvalidate: (listener: (source: InvalidationSource) => void) => () => void;
17
+ }
18
+ export interface EffortDeclareSectionProps extends Partial<EffortDeclareSectionInjected> {
19
+ t: (key: EffortDeclareKey) => string;
20
+ close: () => void;
21
+ }
22
+ export { loadDrafts } from './load-drafts.ts';
23
+ export declare function EffortDeclareSection(props: EffortDeclareSectionProps): ReactNode;
24
+ //# sourceMappingURL=EffortDeclareSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EffortDeclareSection.d.ts","sourceRoot":"","sources":["../../../src/client/EffortDeclareSection.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AA2BtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAGpD,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,CAAA;AAEzD,MAAM,WAAW,4BAA4B;IAC3C,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,CAAA;IACzC,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,MAAM,EAAE,SAAS,CAAA;IACjB,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,MAAM,CAAA;IACpC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;CACpF;AAED,MAAM,WAAW,yBAA0B,SAAQ,OAAO,CAAC,4BAA4B,CAAC;IACtF,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,MAAM,CAAA;IACpC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAuQ7C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,SAAS,CAoLhF"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * dsh-plugin-effort-declare — browser half: settings.section for per-model
3
+ * reasoning effort declarations.
4
+ */
5
+ import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
6
+ import { type EffortDeclareKey } from './locales.ts';
7
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
8
+ interface LocaleNamespaceMap {
9
+ /** Effort-declare settings section copy. */
10
+ 'plugin-effort-declare': EffortDeclareKey;
11
+ }
12
+ }
13
+ export declare const inject: string[];
14
+ export declare function apply(ctx: ClientContext): void;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAS3E,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAGhE,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,4CAA4C;QAC5C,uBAAuB,EAAE,gBAAgB,CAAA;KAC1C;CACF;AAED,eAAO,MAAM,MAAM,UAAiF,CAAA;AAkBpG,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAuD9C"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Load editable route drafts from llm.providers + the llm-pi-ai namespace.
3
+ * Drafts come from the user layer; route protocol classification may use effective value.
4
+ */
5
+ import type { IApiClient } from '@deepseek-ai/dsh-api-remotes/client';
6
+ import type { SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client';
7
+ import { type RouteDraft } from '../core/drafts.ts';
8
+ import type { SchemaOps } from './schema-ops.ts';
9
+ export interface LoadDraftsResult {
10
+ writable: boolean;
11
+ formats: string[];
12
+ drafts: RouteDraft[];
13
+ error?: string;
14
+ }
15
+ /**
16
+ * First paint: `ensure()` (reads only from idle). Never treat ensure as refresh.
17
+ * Callers that must not apply a stale settlement compare generation themselves.
18
+ */
19
+ export declare function loadDrafts(api: Pick<IApiClient, 'llm'>, describe: Pick<SettingsDescribeFace, 'ensure' | 'getSnapshot'>, schema: SchemaOps): Promise<LoadDraftsResult>;
20
+ //# sourceMappingURL=load-drafts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-drafts.d.ts","sourceRoot":"","sources":["../../../src/client/load-drafts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,qCAAqC,CAAA;AAC5F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AAMtF,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAOhD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,UAAU,EAAE,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,EAC5B,QAAQ,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,GAAG,aAAa,CAAC,EAC9D,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,gBAAgB,CAAC,CA8C3B"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Dictionary namespace for the effort-declare settings section.
3
+ */
4
+ export type EffortDeclareKey = 'nav' | 'title' | 'intro' | 'empty' | 'emptyHint' | 'loadError' | 'loading' | 'readOnly' | 'save' | 'saving' | 'cancel' | 'saved' | 'conflict' | 'dirtyConflict' | 'presets' | 'presetDeepSeek' | 'presetOpenAI' | 'presetToggle' | 'presetToggleWarn' | 'model' | 'levels' | 'wire' | 'offMode' | 'offAbsent' | 'offEmpty' | 'offValue' | 'offValuePlaceholder' | 'clear' | 'advanced' | 'thinkingFormat' | 'thinkingFormatDefault' | 'supportsDeveloperRole' | 'supportsReasoningEffort' | 'developerTrueHint' | 'compatSummary' | 'errorEmpty' | 'errorOffOnly' | 'errorBadWire' | 'noModels' | 'reload';
5
+ export declare const NS = "plugin-effort-declare";
6
+ export declare const zh: Record<EffortDeclareKey, string>;
7
+ export declare const en: Record<EffortDeclareKey, string>;
8
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,OAAO,GACP,OAAO,GACP,OAAO,GACP,WAAW,GACX,WAAW,GACX,SAAS,GACT,UAAU,GACV,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,UAAU,GACV,eAAe,GACf,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,OAAO,GACP,QAAQ,GACR,MAAM,GACN,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,GACV,qBAAqB,GACrB,OAAO,GACP,UAAU,GACV,gBAAgB,GAChB,uBAAuB,GACvB,uBAAuB,GACvB,yBAAyB,GACzB,mBAAmB,GACnB,eAAe,GACf,YAAY,GACZ,cAAc,GACd,cAAc,GACd,UAAU,GACV,QAAQ,CAAA;AAEZ,eAAO,MAAM,EAAE,0BAA0B,CAAA;AAEzC,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAyC/C,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAyC/C,CAAA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Bind the settings-owned schema service without importing executable
3
+ * helpers from another client plugin (bundle purity).
4
+ */
5
+ export interface SchemaOps {
6
+ rehydrate: (serialized: unknown) => unknown;
7
+ nodeAtPath: (root: unknown, path: readonly string[]) => unknown;
8
+ getPath: (value: unknown, path: readonly string[]) => unknown;
9
+ hasPath: (value: unknown, path: readonly string[]) => boolean;
10
+ }
11
+ /** Wrap a live settingsSchema service as plain callbacks. */
12
+ export declare function bindSchema(service: SchemaOps): SchemaOps;
13
+ //# sourceMappingURL=schema-ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-ops.d.ts","sourceRoot":"","sources":["../../../src/client/schema-ops.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,OAAO,CAAA;IAC3C,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAA;IAC/D,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAA;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAA;CAC9D;AAED,6DAA6D;AAC7D,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAOxD"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Canonical thinking levels and openai-completions thinkingFormat names.
3
+ *
4
+ * Levels match `@deepseek-ai/dsh-llm-pi-ai` catalog.ts `THINKING_LEVELS`.
5
+ * Formats match `SUPPORTED_THINKING_FORMATS` in the same file (rc.8).
6
+ * Runtime UI prefers the live settings schema union; these lists are the
7
+ * fallback plus a test pin so a silent drift is a failing test, not a
8
+ * second hand-maintained copy nobody notices.
9
+ */
10
+ /** Selectable reasoning levels, in pi-ai escalation order. */
11
+ export declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
12
+ export type ThinkingLevel = (typeof THINKING_LEVELS)[number];
13
+ /** Thinking levels other than Off; Off has its own tri-state control. */
14
+ export declare const THINKING_LEVELS_WITHOUT_OFF: ("minimal" | "low" | "medium" | "high" | "xhigh" | "max")[];
15
+ /**
16
+ * openai-completions thinkingFormat values from llm-pi-ai catalog.ts rc.8.
17
+ * Tests pin this list; the settings page prefers schema union choices.
18
+ */
19
+ export declare const FALLBACK_THINKING_FORMATS: readonly ["openai", "deepseek", "openrouter", "together", "zai", "qwen", "chat-template", "qwen-chat-template", "string-thinking", "ant-ling"];
20
+ export type ThinkingFormat = (typeof FALLBACK_THINKING_FORMATS)[number];
21
+ /** Wire protocol this plugin's v1 editor supports. */
22
+ export declare const OPENAI_COMPLETIONS = "openai-completions";
23
+ /** Settings namespace this plugin writes. */
24
+ export declare const LLM_PI_AI_NS = "llm-pi-ai";
25
+ /** Official DeepSeek adapter namespace — skip. */
26
+ export declare const LLM_DEEPSEEK_NS = "llm-deepseek";
27
+ /** Official DeepSeek provider route — skip. */
28
+ export declare const DEEPSEEK_OFFICIAL = "deepseek-official";
29
+ /** Any route key walks a dict schema to the same profile node. */
30
+ export declare const SCHEMA_PROBE_ROUTE = "\0probe";
31
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/core/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8DAA8D;AAC9D,eAAO,MAAM,eAAe,sEAQlB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE5D,yEAAyE;AACzE,eAAO,MAAM,2BAA2B,6DAEvC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,gJAW5B,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvE,sDAAsD;AACtD,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AAEtD,6CAA6C;AAC7C,eAAO,MAAM,YAAY,cAAc,CAAA;AAEvC,kDAAkD;AAClD,eAAO,MAAM,eAAe,iBAAiB,CAAA;AAE7C,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AAEpD,kEAAkE;AAClE,eAAO,MAAM,kBAAkB,YAAgB,CAAA"}
@@ -0,0 +1,53 @@
1
+ /** Editable llm-pi-ai route as the settings section holds it. */
2
+ export interface RouteDraft {
3
+ provider: string;
4
+ displayName: string;
5
+ /** Path inside the llm-pi-ai section (`llm.providers[].settingsPath`). */
6
+ settingsPath: readonly string[];
7
+ /** Namespace revision (one value for the whole llm-pi-ai document). */
8
+ revision: number;
9
+ models: Record<string, unknown>[];
10
+ originalModels: Record<string, unknown>[];
11
+ compat: Record<string, unknown>;
12
+ originalCompat: Record<string, unknown>;
13
+ /** Whether `compat` is present on the user profile (not the effective view). */
14
+ compatPresent: boolean;
15
+ }
16
+ /** Build a draft from the stored user subtree (never from effective `value`). */
17
+ export declare function routeDraftFromUserProfile(args: {
18
+ provider: string;
19
+ displayName: string;
20
+ settingsPath: readonly string[];
21
+ revision: number;
22
+ userProfile: unknown;
23
+ }): RouteDraft;
24
+ /** Dirty iff pathOps would emit something (same comparison as save). */
25
+ export declare function draftDirty(draft: RouteDraft): boolean;
26
+ /** Treat the current models/compat as the committed originals (no-op save). */
27
+ export declare function alignDraft(draft: RouteDraft): RouteDraft;
28
+ /** Fold a successful mutate view: saved card realigns; every card gets the new revision. */
29
+ export declare function applySaveSuccess(drafts: readonly RouteDraft[], savedProvider: string, slice: {
30
+ user: unknown;
31
+ revision: number;
32
+ }): RouteDraft[];
33
+ /**
34
+ * Apply a freshly loaded table. Dirty cards keep models/compat; originals and
35
+ * revision follow the incoming snapshot so a later save is against the new user layer.
36
+ */
37
+ export declare function mergeLoadedDrafts(current: readonly RouteDraft[], incoming: readonly RouteDraft[], options: {
38
+ preserveDirty: boolean;
39
+ }): {
40
+ drafts: RouteDraft[];
41
+ conflicted: string[];
42
+ };
43
+ /** Increment a generation counter; callers discard stale async settlements. */
44
+ export declare function nextGeneration(holder: {
45
+ current: number;
46
+ }): number;
47
+ /** Whether `generation` is still the latest issued token. */
48
+ export declare function generationIsCurrent(holder: {
49
+ current: number;
50
+ }, generation: number): boolean;
51
+ /** Keep a stored thinkingFormat visible even if the schema union omitted it. */
52
+ export declare function thinkingFormatChoices(formats: readonly string[], current: unknown): string[];
53
+ //# sourceMappingURL=drafts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../../src/core/drafts.ts"],"names":[],"mappings":"AAQA,iEAAiE;AACjE,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,0EAA0E;IAC1E,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACjC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,gFAAgF;IAChF,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,iFAAiF;AACjF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;CACrB,GAAG,UAAU,CAgBb;AAED,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAQrD;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAOxD;AAED,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACzC,UAAU,EAAE,CAcd;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,QAAQ,EAAE,SAAS,UAAU,EAAE,EAC/B,OAAO,EAAE;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,GAClC;IAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAkBhD;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAGlE;AAED,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAE5F;AAED,gFAAgF;AAChF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,CAK5F"}
@@ -0,0 +1,32 @@
1
+ import { type ThinkingLevel } from './catalog.ts';
2
+ /** Per-model reasoningEfforts dict as stored in llm-pi-ai settings. */
3
+ export type ReasoningEfforts = Partial<Record<ThinkingLevel, string | null>>;
4
+ /** Off tri-state. Must not be collapsed into a single checkbox. */
5
+ export type OffMode = 'absent' | 'empty' | 'value';
6
+ export type ReasoningEffortsField = ReasoningEfforts | false | undefined;
7
+ /** Read Off's three states from a stored dict. */
8
+ export declare function readOff(efforts: ReasoningEfforts | undefined): {
9
+ mode: OffMode;
10
+ value: string;
11
+ };
12
+ /** Write Off's three states onto a dict (does not mutate the input). */
13
+ export declare function writeOff(efforts: ReasoningEfforts, mode: OffMode, value: string): ReasoningEfforts;
14
+ /** Whether a thinking level (other than Off) is currently declared. */
15
+ export declare function hasLevel(efforts: ReasoningEfforts | undefined, level: Exclude<ThinkingLevel, 'off'>): boolean;
16
+ /** Toggle a non-off level. New levels default the wire spelling to the key. */
17
+ export declare function toggleLevel(efforts: ReasoningEfforts, level: Exclude<ThinkingLevel, 'off'>, enabled: boolean, wire?: string): ReasoningEfforts;
18
+ /** Set the wire spelling for a declared non-off level. */
19
+ export declare function setWireSpelling(efforts: ReasoningEfforts, level: Exclude<ThinkingLevel, 'off'>, wire: string): ReasoningEfforts;
20
+ /**
21
+ * Validate a reasoningEfforts field. Returns an error code; never throws.
22
+ * Absence / `false` are valid (default-off / catalog strip). Empty dict and
23
+ * off-only are rejected by the official resolver.
24
+ */
25
+ export declare function validateReasoningEfforts(efforts: unknown): 'empty' | 'off-only' | 'bad-wire' | undefined;
26
+ /** Drop reasoningEfforts from a model row; keep every other field. */
27
+ export declare function clearReasoningEfforts(row: Record<string, unknown>): Record<string, unknown>;
28
+ /** Read reasoningEfforts from a model row. `false` is treated as absent for the editor. */
29
+ export declare function readEfforts(row: Record<string, unknown>): ReasoningEfforts | undefined;
30
+ /** Put a dict (or omit the field) onto a spread row. */
31
+ export declare function writeEfforts(row: Record<string, unknown>, efforts: ReasoningEfforts | undefined): Record<string, unknown>;
32
+ //# sourceMappingURL=efforts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"efforts.d.ts","sourceRoot":"","sources":["../../../src/core/efforts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAElE,uEAAuE;AACvE,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAA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AED,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,GAAG,SAAS,CAKtF;AAED,wDAAwD;AACxD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,OAAO,EAAE,gBAAgB,GAAG,SAAS,GACpC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB"}
@@ -0,0 +1,28 @@
1
+ /** Directory row from `llm.providers()` (the fields v1 filtering reads). */
2
+ export interface ProviderDirectoryEntry {
3
+ provider: string;
4
+ displayName?: string;
5
+ settingsNs?: string;
6
+ settingsPath?: readonly string[];
7
+ declared?: boolean;
8
+ active?: boolean;
9
+ }
10
+ /**
11
+ * Resolve the wire protocol for a route.
12
+ * User/effective `api` wins; then schema default; then openai-completions.
13
+ */
14
+ export declare function resolveRouteApi(profile: unknown, schemaDefault: string | undefined): string;
15
+ export interface EditableDecision {
16
+ editable: boolean;
17
+ reason?: 'not-pi-ai' | 'official-deepseek' | 'catalog' | 'not-completions';
18
+ }
19
+ /**
20
+ * v1 editable routes: hand-declared llm-pi-ai openai-completions.
21
+ * Catalog routes are excluded (writing `models` replaces the whole catalog).
22
+ */
23
+ export declare function classifyRoute(entry: ProviderDirectoryEntry, profile: unknown, schemaDefaultApi?: string): EditableDecision;
24
+ /** Profile object at `providers.<route>` from an llm-pi-ai section value. */
25
+ export declare function profileAt(section: unknown, settingsPath: readonly string[] | undefined, provider: string): unknown;
26
+ /** String choices from a schemastery union node (`type: 'union'`). */
27
+ export declare function unionStringChoices(node: unknown): string[];
28
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/core/filter.ts"],"names":[],"mappings":"AAQA,4EAA4E;AAC5E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,CAMR;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,GAAG,mBAAmB,GAAG,SAAS,GAAG,iBAAiB,CAAA;CAC3E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,sBAAsB,EAC7B,OAAO,EAAE,OAAO,EAChB,gBAAgB,CAAC,EAAE,MAAM,GACxB,gBAAgB,CAelB;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CACvB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC3C,QAAQ,EAAE,MAAM,GACf,OAAO,CAKT;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CAK1D"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Minimal path ops, same one-level-key algorithm as the official
3
+ * ProviderEditor.pathOps: only keys that differ produce a set/unset.
4
+ */
5
+ export type PathOp = {
6
+ op: 'set';
7
+ path: string[];
8
+ value: unknown;
9
+ } | {
10
+ op: 'unset';
11
+ path: string[];
12
+ };
13
+ /**
14
+ * The minimal path ops carrying `after` over `before`.
15
+ * @param base - path of the edited subtree.
16
+ * @param before - subtree as loaded, or undefined when new.
17
+ * @param after - subtree as edited.
18
+ */
19
+ export declare function pathOps(base: readonly string[], before: unknown, after: Record<string, unknown>): PathOp[];
20
+ export interface SaveSlices {
21
+ /** Profile path from `llm.providers[].settingsPath` (not a hardcoded route id). */
22
+ settingsPath: readonly string[];
23
+ /** Models array before the edit (user layer). */
24
+ beforeModels: unknown;
25
+ /** Models array after the edit — every existing row, spread intact. */
26
+ afterModels: unknown[];
27
+ /** Route-level compat before the edit (`undefined` = field absent on user). */
28
+ beforeCompat: unknown;
29
+ /**
30
+ * Route-level compat after the edit. `undefined` means leave the field
31
+ * untouched (no compat ops at all).
32
+ */
33
+ afterCompat: Record<string, unknown> | undefined;
34
+ }
35
+ /**
36
+ * Ops for one route: whole-array `models` replace when the table changed,
37
+ * plus one-level compat path ops. Never replace the `llm-pi-ai` section.
38
+ */
39
+ export declare function buildSaveOps(slices: SaveSlices): PathOp[];
40
+ //# sourceMappingURL=path-ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-ops.d.ts","sourceRoot":"","sources":["../../../src/core/path-ops.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,MAAM,GACd;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC7C;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAEnC;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,EAAE,CAaV;AAED,MAAM,WAAW,UAAU;IACzB,mFAAmF;IACnF,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B,iDAAiD;IACjD,YAAY,EAAE,OAAO,CAAA;IACrB,uEAAuE;IACvE,WAAW,EAAE,OAAO,EAAE,CAAA;IACtB,+EAA+E;IAC/E,YAAY,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CACjD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,CAUzD"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Nested get/has over plain JSON, matching ui-settings SettingsSchemaService
3
+ * for the paths this plugin needs. Kept in-repo so tests do not import a
4
+ * Cordis service.
5
+ */
6
+ /** Read a nested value by string keys / array indexes. */
7
+ export declare function getPath(value: unknown, path: readonly string[]): unknown;
8
+ /** Whether the final path key exists, independently of its value. */
9
+ export declare function hasPath(value: unknown, path: readonly string[]): boolean;
10
+ /** Plain object (not array, not null). */
11
+ export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
12
+ /** Structured clone of a JSON object, or `{}` when the source is not one. */
13
+ export declare function cloneObject(value: unknown): Record<string, unknown>;
14
+ /** Structured clone of a models array; non-arrays and non-object rows are skipped. */
15
+ export declare function cloneModels(value: unknown): Record<string, unknown>[];
16
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/core/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0DAA0D;AAC1D,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAWxE;AAED,qEAAqE;AACrE,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAOxE;AAED,0CAA0C;AAC1C,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9E;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEnE;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAGrE"}
@@ -0,0 +1,31 @@
1
+ import type { ReasoningEfforts } from './efforts.ts';
2
+ export type PresetId = 'deepseek' | 'openai' | 'toggle';
3
+ export interface PresetCompatPatch {
4
+ /**
5
+ * Every preset states all three UI dialect keys. `set` writes the key;
6
+ * `unset` removes it. Unknown extra compat keys are left in place.
7
+ */
8
+ thinkingFormat: 'set' | 'unset';
9
+ thinkingFormatValue?: string;
10
+ supportsDeveloperRole: 'set-false' | 'unset';
11
+ supportsReasoningEffort: 'set-false' | 'unset';
12
+ }
13
+ export interface EffortPreset {
14
+ id: PresetId;
15
+ efforts: ReasoningEfforts;
16
+ compat: PresetCompatPatch;
17
+ /** True when selector levels do not change the on-wire request (except Off). */
18
+ warnSameWire: boolean;
19
+ }
20
+ /** DeepSeek-compatible gateway: explicit thinking.disabled on Off. */
21
+ export declare const DEEPSEEK_PRESET: EffortPreset;
22
+ /** OpenAI-compatible gateway: default thinkingFormat (omit the key). */
23
+ export declare const OPENAI_PRESET: EffortPreset;
24
+ /** On/off only: selector may list levels that are identical on the wire. */
25
+ export declare const TOGGLE_PRESET: EffortPreset;
26
+ export declare const PRESETS: Record<PresetId, EffortPreset>;
27
+ /** Apply a preset's efforts onto every model row (spread, keep other fields). */
28
+ export declare function applyPresetEfforts(models: readonly Record<string, unknown>[], preset: EffortPreset): Record<string, unknown>[];
29
+ /** Merge a preset's compat patch onto the current route-level compat object. */
30
+ export declare function applyPresetCompat(compat: Record<string, unknown>, preset: EffortPreset): Record<string, unknown>;
31
+ //# sourceMappingURL=presets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/core/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEvD,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,cAAc,EAAE,KAAK,GAAG,OAAO,CAAA;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,qBAAqB,EAAE,WAAW,GAAG,OAAO,CAAA;IAC5C,uBAAuB,EAAE,WAAW,GAAG,OAAO,CAAA;CAC/C;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,QAAQ,CAAA;IACZ,OAAO,EAAE,gBAAgB,CAAA;IACzB,MAAM,EAAE,iBAAiB,CAAA;IACzB,gFAAgF;IAChF,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,sEAAsE;AACtE,eAAO,MAAM,eAAe,EAAE,YAe7B,CAAA;AAED,wEAAwE;AACxE,eAAO,MAAM,aAAa,EAAE,YAc3B,CAAA;AAED,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,YAY3B,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,CAIlD,CAAA;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC1C,MAAM,EAAE,YAAY,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAE3B;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,YAAY,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB"}
@@ -0,0 +1,3 @@
1
+ /** Per-model client-side check used to show errors without throwing. */
2
+ export declare function modelEffortError(row: Record<string, unknown>): 'empty' | 'off-only' | 'bad-wire' | undefined;
3
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/core/validate.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAG5G"}