omp-fabric 1.4.2 → 1.4.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.3
4
+
5
+ ### Added
6
+
7
+ - `/fabric settings` exposes Compaction > Summary model. The entry opens the OMP model picker, so the LCM summary model is chosen from the models OMP actually has rather than typed by hand, and Inherit clears the override back to the active session model. The setting was previously reachable only by hand-editing `compaction.summaryModel` in `fabric.json`, which left reasoning models summarizing transcripts at their own price.
8
+
3
9
  ## 1.4.2
4
10
 
5
11
  ### Fixed
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/ui/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEzE,OAAO,EACL,SAAS,EAST,YAAY,EACZ,KAAK,WAAW,EAIjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,sBAAsB,EAItB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAWL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AA2HtD,eAAO,MAAM,0BAA0B,GACrC,qBAA6C,KAC5C,MAAM,EAMR,CAAC;AAoBF,MAAM,MAAM,4BAA4B,GACpC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AActC,eAAO,MAAM,0BAA0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CACtC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CAoIf"}
@@ -224,7 +224,7 @@ var coerceValue = (id, value, config) => {
224
224
  const current = getPath(config, id);
225
225
  if (typeof current === "boolean" || id === "prewalk.enabled") return value === "true";
226
226
  if (typeof current === "number") return parseFormattedNumericValue(value);
227
- if (id === "approvals.model" || id === "prewalk.model" || id === "agents.model" || id === "agents.claude.model" || id === "agents.veda.model") {
227
+ if (id === "approvals.model" || id === "prewalk.model" || id === "agents.model" || id === "agents.claude.model" || id === "agents.veda.model" || id === "compaction.summaryModel") {
228
228
  return value === INHERIT_VALUE || value === PREWALK_MODEL_UNSET_LABEL ? "" : value;
229
229
  }
230
230
  if (id === "prewalk.thinking" && value === PREWALK_THINKING_INHERIT_LABEL) return "";
@@ -1452,6 +1452,18 @@ var buildFabricSettingsItems = (theme, config, apply, options) => {
1452
1452
  description: "LCM assembles durable hierarchical context; OMP delegates compaction to OMP core.",
1453
1453
  values: COMPACTION_ENGINES
1454
1454
  }),
1455
+ setting(
1456
+ "compaction.summaryModel",
1457
+ "Summary model",
1458
+ config.compaction.summaryModel || INHERIT_VALUE,
1459
+ {
1460
+ description: "Model that writes LCM leaf and condensed summaries. Inherit uses the active session model, so a reasoning model summarizes transcripts at its own price.",
1461
+ submenu: modelPickerSubmenu(theme, options.modelSource, {
1462
+ headerText: "Model that writes LCM leaf and condensed summaries. Pick Inherit to use the active session model.",
1463
+ inheritName: "Use the active session model"
1464
+ })
1465
+ }
1466
+ ),
1455
1467
  setting(
1456
1468
  "compaction.targetContextRatio",
1457
1469
  "Max occupancy",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ui/settings.ts"],
4
- "sourcesContent": ["import type { ExtensionContext, Theme } from \"@oh-my-pi/pi-coding-agent\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport {\n Container,\n type Component,\n Input,\n Key,\n matchesKey,\n SelectList,\n type SelectItem,\n type SelectListLayoutOptions,\n type SelectListTheme,\n SettingsList,\n type SettingItem,\n type SettingsListTheme,\n Spacer,\n Text,\n} from \"@oh-my-pi/pi-tui\";\nimport { ompSymbolTheme } from \"./symbol-theme.js\";\nimport { FabricModelSelector } from \"./fabric-model-selector.js\";\nimport {\n buildClaudeModelSource,\n buildModelSource,\n INHERIT_VALUE,\n modelKey,\n type ModelSource,\n} from \"./model-picker.js\";\nimport {\n clampCompactionRatioThreshold,\n clampCompactionTokenThreshold,\n loadFabricConfigForScope,\n MAX_COMPACTION_RATIO_THRESHOLD,\n MAX_COMPACTION_TOKEN_THRESHOLD,\n maxExecutorMemoryLimitBytes,\n MIN_COMPACTION_RATIO_THRESHOLD,\n MIN_COMPACTION_TOKEN_THRESHOLD,\n QUICKJS_MAX_MEMORY_LIMIT_BYTES,\n saveFabricConfig,\n type FabricConfig,\n type FabricConfigScope,\n} from \"../config.js\";\nimport { THINKING_LEVELS, thinkingLabel } from \"../thinking.js\";\nimport type { CapturedToolCatalog } from \"../capture/catalog.js\";\nimport type { FabricState } from \"../fabric-state.js\";\nimport { resolveAgentDir } from \"../core/agent-dir.js\";\n\nconst SUBMENU_LAYOUT: SelectListLayoutOptions = {\n minPrimaryColumnWidth: 12,\n maxPrimaryColumnWidth: 32,\n};\n\nconst BOOLEANS = [\"true\", \"false\"] as const;\nconst APPROVAL_MODES = [\"allow\", \"ask\", \"auto\", \"deny\"] as const;\nconst RUNNERS = [\"omp\", \"claude\", \"veda\"] as const;\nconst TRANSPORTS = [\"auto\", \"process\", \"tmux\", \"screen\", \"localterm\", \"herdr\"] as const;\nconst WIDGET_MODES = [\"auto\", \"always\", \"hidden\"] as const;\nconst TOOL_DISPLAY_MODES = [\"full\", \"compact\"] as const;\nconst RESULT_FORMATS = [\"auto\", \"yaml\", \"json\", \"text\"] as const;\nconst EXECUTOR_RUNTIMES = [\"quickjs\", \"node-process\", \"bun-process\"] as const;\nconst SCHEMA_MODES = [\"off\", \"audit\", \"enforce\"] as const;\nconst COMPACTION_ENGINES = [\"lcm\", \"omp\"] as const;\nconst COMPACTION_THRESHOLD_SETTING_ID = \"compaction.threshold\";\nconst COMPACTION_DEFAULT_THRESHOLD_LABEL = \"OMP default\";\nconst COMPACTION_PERCENT_OPTION_LABEL = \"Custom percent\u2026\";\nconst COMPACTION_TOKENS_OPTION_LABEL = \"Custom tokens\u2026\";\nconst COMPACTION_PERCENT_MIN = Math.round(MIN_COMPACTION_RATIO_THRESHOLD * 100);\nconst COMPACTION_PERCENT_MAX = Math.round(MAX_COMPACTION_RATIO_THRESHOLD * 100);\nconst clampCompactionPercentThreshold = (value: number): number =>\n Math.round(clampCompactionRatioThreshold(value / 100) * 100);\nconst COMPACTION_TARGET_RATIOS = Array.from(\n { length: 13 },\n (_, index) => String((25 + index * 5) / 100),\n);\nconst ACTOR_SCOPES = [\"project\", \"session\"] as const;\nconst DIFF_INTENSITIES = [\"off\", \"subtle\", \"medium\"] as const;\nconst WORD_EMPHASES = [\"all\", \"smart\", \"off\"] as const;\nconst TOOL_CALL_BACKGROUNDS = [\"on\", \"border\", \"off\"] as const;\nconst PATH_ICON_MODES = [\"unicode\", \"nerd\", \"off\"] as const;\nconst CODE_PREVIEW_EDIT_LINES_ID = \"codePreview.editCollapsedLines\";\nconst CODE_PREVIEW_ALL_LINES = \"All lines\";\nconst SHIKI_THEME_PRESETS = [\n \"auto\",\n \"github-light/github-dark\",\n \"light-plus/dark-plus\",\n \"solarized-light/solarized-dark\",\n \"catppuccin-latte/catppuccin-mocha\",\n \"github-light\",\n \"light-plus\",\n \"solarized-light\",\n \"dark-plus\",\n \"github-dark\",\n \"solarized-dark\",\n \"nord\",\n \"one-dark-pro\",\n] as const;\nconst RISKS = [\"read\", \"write\", \"execute\", \"network\", \"agent\"] as const;\nconst CORE_RISK_TOOLS = [\"read\", \"grep\", \"find\", \"edit\", \"write\", \"bash\"] as const;\nconst CORE_DEFAULT_TOOL_CANDIDATES = [\"read\", \"bash\", \"edit\", \"write\", \"grep\", \"find\"];\nconst BUDGET_VALUES = [0, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10];\nconst TOKEN_VALUES = [0, 50_000, 100_000, 250_000, 500_000, 1_000_000, 2_000_000];\nconst PREWALK_MODEL_UNSET_LABEL = \"Ask each time\";\nconst PREWALK_THINKING_INHERIT_LABEL = \"Agents default\";\nconst PREWALK_MODES = [\"in-place\", \"trajectory\"] as const;\nconst ROOT_ITEM_IDS = [\n \"fullCodeMode\",\n \"executor\",\n \"schema\",\n \"approvals\",\n \"mcp\",\n \"prewalk\",\n \"agents\",\n \"capture\",\n \"ui\",\n \"compaction\",\n \"retention\",\n \"mesh\",\n \"codePreview\",\n] as const;\nconst RELOAD_SECTIONS = new Set([\"mesh\", \"agents\", \"mcp\", \"retention\"]);\nconst SAVE_SCOPE_SHORTCUT = Key.ctrl(\"g\");\n\nconst unique = (values: readonly string[]): string[] => [...new Set(values)];\n\ntype SettingsSubmenu = (currentValue: string, done: (selectedValue?: string) => void) => Component;\n\nconst settingsListTheme = (theme: Theme): SettingsListTheme => ({\n label: (text, selected) => (selected ? theme.fg(\"accent\", text) : text),\n value: (text, selected) => (selected ? theme.fg(\"accent\", text) : theme.fg(\"muted\", text)),\n description: (text) => theme.fg(\"dim\", text),\n cursor: theme.fg(\"accent\", \"\u2192 \"),\n hint: (text) => theme.fg(\"dim\", text),\n});\n\nconst selectListTheme = (theme: Theme): SelectListTheme => ({\n selectedPrefix: (text) => theme.fg(\"accent\", text),\n selectedText: (text) => theme.fg(\"accent\", text),\n description: (text) => theme.fg(\"muted\", text),\n scrollInfo: (text) => theme.fg(\"muted\", text),\n noMatch: (text) => theme.fg(\"muted\", text),\n symbols: ompSymbolTheme,\n});\n\nconst formatDebounce = (ms: number): string =>\n ms === 0 ? \"Off\" : ms < 1_000 ? `${ms}ms` : `${ms / 1_000}s`;\n\nconst formatMs = (ms: number): string =>\n ms < 1_000\n ? `${ms}ms`\n : ms < 60_000\n ? `${ms / 1_000}s`\n : ms < 3_600_000\n ? `${ms / 60_000}m`\n : `${ms / 3_600_000}h`;\n\nconst formatRetention = (ms: number): string =>\n ms >= 24 * 60 * 60 * 1_000 && ms % (24 * 60 * 60 * 1_000) === 0\n ? `${ms / (24 * 60 * 60 * 1_000)}d`\n : formatMs(ms);\n\nconst formatBytes = (bytes: number): string =>\n bytes >= 1024 * 1024 * 1024\n ? `${Number((bytes / (1024 * 1024 * 1024)).toFixed(2))} GB`\n : bytes >= 1024 * 1024\n ? `${Number((bytes / (1024 * 1024)).toFixed(2))} MB`\n : `${Number((bytes / 1024).toFixed(2))} KB`;\n\nexport const executorMemoryLimitOptions = (\n maximumBytes = QUICKJS_MAX_MEMORY_LIMIT_BYTES,\n): number[] => {\n const minimumBytes = 16 * 1024 * 1024;\n const values: number[] = [];\n for (let value = minimumBytes; value <= maximumBytes; value *= 2) values.push(value);\n if (maximumBytes >= minimumBytes && values.at(-1) !== maximumBytes) values.push(maximumBytes);\n return values;\n};\n\nconst formatUsd = (value: number): string =>\n value <= 0 ? \"Off\" : `$${value.toFixed(2)}`;\n\nconst formatTokens = (value: number): string =>\n value <= 0\n ? \"Off\"\n : value >= 1_000_000\n ? `${value / 1_000_000}M`\n : value >= 1_000\n ? `${value / 1_000}k`\n : String(value);\n\nconst formatToolCount = (count: number): string =>\n `${count} ${count === 1 ? \"tool\" : \"tools\"}`;\n\n// The threshold row is a mode selection: OMP default, a window-occupancy\n// percent, or an exact token count. mode: \"default\" clears both maps so OMP's\n// built-in threshold applies.\nexport type CompactionThresholdSelection =\n | { mode: \"default\" }\n | { mode: \"percent\"; value: number }\n | { mode: \"tokens\"; value: number };\n\nconst formatCompactionThreshold = (\n config: FabricConfig,\n modelKey: string,\n): string => {\n const tokens = config.compaction.tokenThresholds[modelKey];\n if (tokens !== undefined) return `${formatTokens(tokens)} tokens`;\n const ratio = config.compaction.thresholds[modelKey];\n return ratio === undefined\n ? COMPACTION_DEFAULT_THRESHOLD_LABEL\n : `${Math.round(ratio * 100)}%`;\n};\n\nexport const compactionThresholdPartial = (\n modelKey: string,\n selection: CompactionThresholdSelection,\n): Record<string, unknown> => ({\n compaction: {\n thresholds: { [modelKey]: selection.mode === \"percent\" ? selection.value : null },\n tokenThresholds: { [modelKey]: selection.mode === \"tokens\" ? selection.value : null },\n },\n});\n\nconst numericOptions = (\n values: readonly number[],\n format: (value: number) => string,\n currentValue: string,\n): SelectItem[] => {\n const options: SelectItem[] = values.map((value) => ({\n value: String(value),\n label: format(value),\n }));\n if (!options.some((option) => option.value === currentValue || option.label === currentValue)) {\n options.unshift({ value: currentValue, label: currentValue });\n }\n return options;\n};\n\nconst getPath = (config: FabricConfig, id: string): unknown => {\n const segments = id.split(\".\");\n let current: unknown = config;\n for (const segment of segments) {\n if (typeof current !== \"object\" || current === null) return undefined;\n current = (current as Record<string, unknown>)[segment];\n }\n return current;\n};\n\nexport const parseBudgetValue = (value: string): number => {\n if (value === \"Off\") return 0;\n const digits = Number.parseFloat(value.replace(/[^0-9.]/g, \"\"));\n return Number.isFinite(digits) ? digits : 0;\n};\n\nexport const parseFormattedNumericValue = (value: string): number => {\n const normalized = value.trim();\n if (normalized === \"Off\") return 0;\n if (normalized.startsWith(\"$\")) return parseBudgetValue(normalized);\n\n const bytes = normalized.match(/^([0-9]+(?:\\.[0-9]+)?) (KB|MB|GB)$/);\n if (bytes) {\n const amount = Number(bytes[1]);\n const units = { KB: 1024, MB: 1024 ** 2, GB: 1024 ** 3 } as const;\n return Math.round(amount * units[bytes[2] as keyof typeof units]);\n }\n\n const duration = normalized.match(/^([0-9]+(?:\\.[0-9]+)?)(ms|s|m|h|d)$/);\n if (duration) {\n const amount = Number(duration[1]);\n const units = { ms: 1, s: 1_000, m: 60_000, h: 3_600_000, d: 86_400_000 } as const;\n return Math.round(amount * units[duration[2] as keyof typeof units]);\n }\n\n const tokens = normalized.match(/^([0-9]+(?:\\.[0-9]+)?)(k|M)$/);\n if (tokens) return Math.round(Number(tokens[1]) * (tokens[2] === \"M\" ? 1_000_000 : 1_000));\n return Number(normalized.replaceAll(\",\", \"\"));\n};\n\nconst coerceValue = (id: string, value: string, config: FabricConfig): unknown => {\n if (id === COMPACTION_THRESHOLD_SETTING_ID) {\n if (value === COMPACTION_DEFAULT_THRESHOLD_LABEL) return { mode: \"default\" };\n const tokens = /^(.+?) tokens$/.exec(value);\n if (tokens?.[1] !== undefined) {\n return {\n mode: \"tokens\",\n value: clampCompactionTokenThreshold(parseFormattedNumericValue(tokens[1])),\n };\n }\n return { mode: \"percent\", value: Number(value.replace(\"%\", \"\")) / 100 };\n }\n if (id === CODE_PREVIEW_EDIT_LINES_ID) {\n if (value === CODE_PREVIEW_ALL_LINES || value === \"all\") return \"all\";\n const parsed = Number.parseInt(value, 10);\n if (Number.isFinite(parsed) && parsed > 0) return parsed;\n const current = getPath(config, id);\n return typeof current === \"number\" ? current : 160;\n }\n const current = getPath(config, id);\n // prewalk.enabled is enabled by default and omitted from normalized\n // configs unless false, so its control still needs an explicit boolean type.\n if (typeof current === \"boolean\" || id === \"prewalk.enabled\") return value === \"true\";\n if (typeof current === \"number\") return parseFormattedNumericValue(value);\n // The model picker stores the canonical \"provider/id\" string, or \"Inherit\"\n // for no override; persist an empty string so normalizeFabricConfig drops it.\n // Agents inherit; prewalk asks interactively when it is armed.\n if (\n id === \"approvals.model\" ||\n id === \"prewalk.model\" ||\n id === \"agents.model\" ||\n id === \"agents.claude.model\" ||\n id === \"agents.veda.model\"\n ) {\n return value === INHERIT_VALUE || value === PREWALK_MODEL_UNSET_LABEL ? \"\" : value;\n }\n if (id === \"prewalk.thinking\" && value === PREWALK_THINKING_INHERIT_LABEL) return \"\";\n if (id === \"agents.thinking\" || id === \"prewalk.thinking\") {\n return THINKING_LEVELS.find((level) => thinkingLabel(level) === value) ?? value;\n }\n return value;\n};\n\nconst buildPartial = (id: string, value: unknown): Record<string, unknown> => {\n const segments = id.split(\".\");\n const root: Record<string, unknown> = {};\n let current: Record<string, unknown> = root;\n for (let index = 0; index < segments.length - 1; index++) {\n const segment = segments[index];\n if (segment === undefined) break;\n const next: Record<string, unknown> = {};\n current[segment] = next;\n current = next;\n }\n const last = segments[segments.length - 1];\n if (last !== undefined) current[last] = value;\n return root;\n};\n\nconst summaryFor = (id: string, config: FabricConfig): string => {\n switch (id) {\n case \"fullCodeMode\":\n return config.fullCodeMode ? \"true\" : \"false\";\n case \"executor\": {\n const refFloors = Object.keys(config.executor.hostCallTimeouts).length;\n return `${config.executor.runtime} \u00B7 ${formatMs(config.executor.timeoutMs)} \u00B7 max ${formatMs(config.executor.maxTimeoutMs)}${refFloors > 0 ? ` \u00B7 ${refFloors} ref floor${refFloors === 1 ? \"\" : \"s\"}` : \"\"}`;\n }\n case \"schema\":\n return config.schema.mode;\n case \"approvals\":\n return config.approvals.execute;\n case \"mcp\":\n return config.mcp.enabled ? \"enabled\" : \"disabled\";\n case \"prewalk\":\n return `${config.prewalk.enabled === false ? \"off \u00B7 \" : \"\"}${config.prewalk.mode} \u00B7 ${config.prewalk.model || PREWALK_MODEL_UNSET_LABEL}${config.prewalk.thinking ? ` \u00B7 ${thinkingLabel(config.prewalk.thinking)}` : \"\"}${config.prewalk.alwaysRearm ? \" \u00B7 repeat\" : \"\"}`;\n case \"codemap\":\n return config.codemap.enabled\n ? `${config.codemap.defaultMaxTokens} tok \u00B7 ${formatMs(config.codemap.maxMs)}`\n : \"disabled\";\n case \"agents\":\n return `${config.agents.runner}/${config.agents.transport}`;\n case \"capture\":\n return config.capture.enabled ? \"enabled\" : \"disabled\";\n case \"ui\":\n return config.ui.widget;\n case \"compaction\":\n return config.compaction.engine;\n case \"retention\":\n return `${formatRetention(config.retention.orphanedTempRunMs)} \u00B7 ${formatRetention(config.retention.oneShotRunMs)} \u00B7 ${formatRetention(config.retention.actorRunArchiveMs)}`;\n case \"mesh\":\n return config.mesh.enabled ? \"enabled\" : \"disabled\";\n case \"codePreview\":\n return config.codePreview.shikiTheme;\n default:\n return \"\";\n }\n};\n\nconst setting = (\n id: string,\n label: string,\n currentValue: string,\n rest: {\n description?: string;\n values?: readonly string[];\n submenu?: SettingsSubmenu;\n } = {},\n): SettingItem => {\n const item: SettingItem = { id, label, currentValue };\n if (rest.description !== undefined) item.description = rest.description;\n if (rest.values !== undefined) item.values = [...rest.values];\n if (rest.submenu !== undefined) item.submenu = rest.submenu;\n return item;\n};\n\nconst numericSubmenu = (\n theme: Theme,\n values: readonly number[],\n format: (value: number) => string,\n title: string,\n description: string,\n): SettingsSubmenu => (currentValue, done) => {\n const options = numericOptions(values, format, currentValue);\n const selectedValue =\n options.find((option) => option.value === currentValue || option.label === currentValue)?.value ??\n currentValue;\n return new SelectSubmenu(\n theme,\n title,\n description,\n options,\n selectedValue,\n (value) => done(options.find((option) => option.value === value)?.label ?? value),\n () => done(),\n );\n};\n\nconst nonNegativeIntegerSubmenu = (\n theme: Theme,\n title: string,\n description: string,\n): SettingsSubmenu => (currentValue, done) =>\n new IntegerInputSubmenu(theme, title, description, currentValue, done, () => done());\n\nconst stringInputSubmenu = (\n theme: Theme,\n title: string,\n description: string,\n): SettingsSubmenu => (currentValue, done) =>\n new StringInputSubmenu(theme, title, description, currentValue, done, () => done());\n\nconst compactionThresholdSubmenu = (theme: Theme): SettingsSubmenu => (currentValue, done) =>\n new CompactionThresholdSubmenu(theme, currentValue, done);\n\nconst stringOptionsSubmenu = (\n theme: Theme,\n values: readonly string[],\n title: string,\n description: string,\n): SettingsSubmenu => (currentValue, done) => {\n const options = values.map((value) => ({ value, label: value }));\n if (!options.some((option) => option.value === currentValue)) {\n options.unshift({ value: currentValue, label: currentValue });\n }\n const selectedValue =\n options.find((option) => option.value === currentValue || option.label === currentValue)\n ?.value ?? currentValue;\n return new SelectSubmenu(\n theme,\n title,\n description,\n options,\n selectedValue,\n (value) => done(value),\n () => done(),\n );\n};\n\nconst listSubmenu = (\n theme: Theme,\n id: string,\n title: string,\n description: string,\n candidates: readonly string[],\n currentList: readonly string[],\n onCommit: (selected: string[]) => void,\n): SettingsSubmenu => {\n const prefix = `${id}.`;\n return (_currentValue, done) => {\n const items = unique([...candidates, ...currentList]).map((name) =>\n setting(`${id}.${name}`, name, currentList.includes(name) ? \"true\" : \"false\", {\n description: `Toggle ${name}.`,\n values: BOOLEANS,\n }),\n );\n const onChange = (_itemId: string, _newValue: string): void => {\n const selected = items\n .filter((item) => item.currentValue === \"true\")\n .map((item) => item.id.slice(prefix.length));\n onCommit(selected);\n };\n return new SectionSubmenu(theme, title, description, items, onChange, () => done(), true);\n };\n};\n\n// Append a \u203A to the label of every item that opens a submenu, so it is\n// obvious which rows drill in (vs. inline value cycling). Mutates in place to\n// preserve the shared item references that listSubmenu updates live.\nconst markDrillIn = (items: SettingItem[]): SettingItem[] => {\n for (const item of items) {\n if (item.submenu && !item.label.endsWith(\"\u203A\")) item.label = `${item.label} \u203A`;\n }\n return items;\n};\n\nconst sectionSubmenu = (\n theme: Theme,\n title: string,\n description: string,\n items: SettingItem[],\n persist: (id: string, value: string) => void,\n): SettingsSubmenu => (_currentValue, done) =>\n // Match the root page: sections get type-to-search filtering too.\n new SectionSubmenu(theme, title, description, markDrillIn(items), persist, () => done(), true);\n\nclass IntegerInputSubmenu extends Container {\n readonly input: Input;\n private readonly validationText: Text;\n\n constructor(\n theme: Theme,\n title: string,\n description: string,\n currentValue: string,\n onSelect: (value: string) => void,\n onCancel: () => void,\n ) {\n super();\n this.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n this.addChild(new Spacer(1));\n\n this.input = new Input();\n this.input.handleInput(currentValue);\n this.input.focused = true;\n this.validationText = new Text(\"\", 0, 0);\n this.input.onSubmit = (value) => {\n const normalized = value.trim();\n const parsed = /^\\d+$/.test(normalized) ? Number(normalized) : Number.NaN;\n if (!Number.isSafeInteger(parsed) || parsed < 0) {\n this.validationText.setText(\n theme.fg(\"error\", \"Enter a non-negative safe integer.\"),\n );\n return;\n }\n onSelect(String(parsed));\n };\n this.input.onEscape = onCancel;\n this.addChild(this.input);\n this.addChild(this.validationText);\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"dim\", \" Enter to save \u00B7 Esc to go back\"), 0, 0));\n }\n\n handleInput(data: string): void {\n this.validationText.setText(\"\");\n this.input.handleInput(data);\n }\n\n render(width: number): readonly string[] {\n this.input.focused = true;\n return super.render(width);\n }\n\n submitRpc(value: string): void {\n this.input.setValue(value);\n this.input.handleInput(\"\\r\");\n }\n}\n\nclass StringInputSubmenu extends Container {\n readonly input: Input;\n\n constructor(\n theme: Theme,\n title: string,\n description: string,\n currentValue: string,\n onSelect: (value: string) => void,\n onCancel: () => void,\n ) {\n super();\n this.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n this.addChild(new Spacer(1));\n\n this.input = new Input();\n this.input.handleInput(currentValue);\n this.input.focused = true;\n this.input.onSubmit = (value) => onSelect(value.trim());\n this.input.onEscape = onCancel;\n this.addChild(this.input);\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"dim\", \" Enter to save \u00B7 Esc to go back\"), 0, 0));\n }\n\n handleInput(data: string): void {\n this.input.handleInput(data);\n }\n\n render(width: number): readonly string[] {\n this.input.focused = true;\n return super.render(width);\n }\n\n submitRpc(value: string): void {\n this.input.setValue(value);\n this.input.handleInput(\"\\r\");\n }\n}\n\nclass SelectSubmenu extends Container {\n readonly selectList: SelectList;\n readonly options: SelectItem[];\n\n constructor(\n theme: Theme,\n title: string,\n description: string | undefined,\n options: SelectItem[],\n currentValue: string,\n onSelect: (value: string) => void,\n onCancel: () => void,\n ) {\n super();\n this.options = options;\n this.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n if (description) {\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n }\n this.addChild(new Spacer(1));\n this.selectList = new SelectList(\n options,\n Math.min(options.length, 10),\n selectListTheme(theme),\n SUBMENU_LAYOUT,\n );\n const index = options.findIndex((option) => option.value === currentValue);\n if (index !== -1) this.selectList.setSelectedIndex(index);\n this.selectList.onSelect = (item) => onSelect(item.value);\n this.selectList.onCancel = onCancel;\n this.addChild(this.selectList);\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"dim\", \" Enter to select \u00B7 Esc to go back\"), 0, 0));\n }\n\n handleInput(data: string): void {\n this.selectList.handleInput(data);\n }\n\n selectRpc(value: string): boolean {\n const option = this.options.find((candidate) => candidate.value === value);\n if (!option) return false;\n this.selectList.onSelect?.(option);\n return true;\n }\n}\n\n// Three-phase threshold picker: the root select offers OMP default plus\n// custom percent / token drill-ins; each drill-in swaps in an integer input\n// and Esc returns to the root select instead of closing the submenu.\nclass CompactionThresholdSubmenu extends Container {\n selectList: SelectList | undefined;\n input: Input | undefined;\n private active!: Container & { handleInput(data: string): void };\n\n constructor(\n private readonly theme: Theme,\n private readonly currentValue: string,\n private readonly done: (selectedValue?: string) => void,\n ) {\n super();\n this.showSelect();\n }\n\n private swap(next: Container & { handleInput(data: string): void }): void {\n this.clear();\n this.addChild(next);\n this.active = next;\n }\n\n private showSelect(): void {\n const options: SelectItem[] = [\n { value: COMPACTION_DEFAULT_THRESHOLD_LABEL, label: COMPACTION_DEFAULT_THRESHOLD_LABEL },\n { value: COMPACTION_PERCENT_OPTION_LABEL, label: COMPACTION_PERCENT_OPTION_LABEL },\n { value: COMPACTION_TOKENS_OPTION_LABEL, label: COMPACTION_TOKENS_OPTION_LABEL },\n ];\n const select = new SelectSubmenu(\n this.theme,\n \"Compaction threshold\",\n \"Percent of the context window that triggers compaction, or an exact token count, entered via the custom options.\",\n options,\n this.currentValue,\n (value) => {\n if (value === COMPACTION_PERCENT_OPTION_LABEL) this.showPercent();\n else if (value === COMPACTION_TOKENS_OPTION_LABEL) this.showTokens();\n else this.done(value);\n },\n () => this.done(),\n );\n this.selectList = select.selectList;\n this.input = undefined;\n this.swap(select);\n }\n\n private showPercent(): void {\n const percent = /^(\\d+)%$/.exec(this.currentValue);\n const inputSubmenu = new IntegerInputSubmenu(\n this.theme,\n \"Compaction percent threshold\",\n `Compaction triggers once context usage reaches this percent of its window (${COMPACTION_PERCENT_MIN}\u2013${COMPACTION_PERCENT_MAX}).`,\n percent?.[1] ?? \"\",\n (value) => this.done(`${clampCompactionPercentThreshold(Number(value))}%`),\n () => this.showSelect(),\n );\n this.selectList = undefined;\n this.input = inputSubmenu.input;\n this.swap(inputSubmenu);\n }\n\n private showTokens(): void {\n const tokens = /^(.+?) tokens$/.exec(this.currentValue);\n const prefilled = tokens?.[1] === undefined\n ? \"\"\n : String(parseFormattedNumericValue(tokens[1]));\n const inputSubmenu = new IntegerInputSubmenu(\n this.theme,\n \"Compaction token threshold\",\n `Compaction triggers once context usage reaches this many tokens (${MIN_COMPACTION_TOKEN_THRESHOLD}\u2013${MAX_COMPACTION_TOKEN_THRESHOLD}).`,\n prefilled,\n (value) => this.done(`${formatTokens(clampCompactionTokenThreshold(Number(value)))} tokens`),\n () => this.showSelect(),\n );\n this.selectList = undefined;\n this.input = inputSubmenu.input;\n this.swap(inputSubmenu);\n }\n\n handleInput(data: string): void {\n this.active.handleInput(data);\n }\n\n completeRpc(selectedValue: string): void {\n this.done(selectedValue);\n }\n}\n\nconst thinkingSubmenu = (\n theme: Theme,\n overrides: {\n title?: string;\n description?: string;\n // Label of an extra first option that clears the override (persists \"\").\n inheritLabel?: string;\n } = {},\n): SettingsSubmenu => (currentValue, done) => {\n const canonicalCurrent =\n THINKING_LEVELS.find((level) => thinkingLabel(level) === currentValue) ?? currentValue;\n const options: SelectItem[] = THINKING_LEVELS.map((level) => ({\n value: level,\n label: thinkingLabel(level),\n }));\n if (overrides.inheritLabel) {\n options.unshift({ value: overrides.inheritLabel, label: overrides.inheritLabel });\n }\n if (!options.some((option) => option.value === canonicalCurrent)) {\n options.unshift({ value: canonicalCurrent, label: currentValue });\n }\n return new SelectSubmenu(\n theme,\n overrides.title ?? \"Default thinking\",\n overrides.description ??\n \"Reasoning effort forwarded to spawned agents and actors when a call does not specify one. The level is clamped to each model's supported levels (next highest if unsupported).\",\n options,\n canonicalCurrent,\n (value) => done(options.find((option) => option.value === value)?.label ?? value),\n () => done(),\n );\n};\n\nconst modelPickerSubmenu = (\n theme: Theme,\n source: ModelSource,\n options: {\n headerText?: string;\n inheritLabel?: string;\n inheritName?: string;\n } = {},\n): SettingsSubmenu => (currentValue, done) => {\n const canonicalCurrent =\n options.inheritLabel && currentValue === options.inheritLabel\n ? INHERIT_VALUE\n : currentValue;\n return new FabricModelSelector({\n theme,\n source,\n currentValue: canonicalCurrent,\n onSelect: (value) =>\n done(\n value === INHERIT_VALUE && options.inheritLabel\n ? options.inheritLabel\n : value,\n ),\n onCancel: () => done(),\n ...(options.headerText ? { headerText: options.headerText } : {}),\n ...(options.inheritLabel ? { inheritLabel: options.inheritLabel } : {}),\n ...(options.inheritName ? { inheritName: options.inheritName } : {}),\n });\n};\n\nclass SectionSubmenu extends Container {\n readonly settingsList: SettingsList;\n readonly items: SettingItem[];\n readonly applyChange: (id: string, newValue: string) => void;\n\n constructor(\n theme: Theme,\n title: string,\n description: string | undefined,\n items: SettingItem[],\n onChange: (id: string, newValue: string) => void,\n onCancel: () => void,\n enableSearch = false,\n ) {\n super();\n this.items = items;\n this.applyChange = onChange;\n this.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n if (description) {\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n }\n this.addChild(new Spacer(1));\n this.settingsList = new SettingsList(\n items,\n Math.min(items.length, 16),\n settingsListTheme(theme),\n onChange,\n onCancel,\n { typeToSearch: enableSearch },\n );\n this.addChild(this.settingsList);\n }\n\n handleInput(data: string): void {\n this.settingsList.handleInput(data);\n }\n}\n\nexport interface FabricSettingsComponentOptions {\n initialSaveScope?: FabricConfigScope;\n projectScopeAvailable?: boolean;\n onSaveScopeChange?: (scope: FabricConfigScope) => void;\n itemsForSaveScope?: (scope: FabricConfigScope) => SettingItem[];\n}\n\nexport class FabricSettingsComponent extends Container {\n settingsList: SettingsList;\n private readonly theme: Theme;\n private readonly saveScopeText: Text;\n private readonly settingsListContainer: Container;\n private readonly projectScopeAvailable: boolean;\n private readonly onChange: (id: string, newValue: string) => void;\n private readonly onCancel: () => void;\n private readonly onSaveScopeChange: (scope: FabricConfigScope) => void;\n private readonly itemsForSaveScope: ((scope: FabricConfigScope) => SettingItem[]) | undefined;\n private saveScope: FabricConfigScope;\n\n constructor(\n theme: Theme,\n items: SettingItem[],\n onChange: (id: string, newValue: string) => void,\n onCancel: () => void,\n options: FabricSettingsComponentOptions = {},\n ) {\n super();\n this.theme = theme;\n this.projectScopeAvailable = options.projectScopeAvailable ?? true;\n this.saveScope = options.initialSaveScope === \"project\" && this.projectScopeAvailable\n ? \"project\"\n : \"global\";\n this.onChange = onChange;\n this.onCancel = onCancel;\n this.onSaveScopeChange = options.onSaveScopeChange ?? (() => {});\n this.itemsForSaveScope = options.itemsForSaveScope;\n this.addChild(new DynamicBorder((text) => theme.fg(\"border\", text)));\n this.saveScopeText = new Text(\"\", 1, 0);\n this.updateSaveScopeText();\n this.addChild(this.saveScopeText);\n this.addChild(new Spacer(1));\n this.settingsListContainer = new Container();\n this.settingsList = this.createSettingsList(items);\n this.settingsListContainer.addChild(this.settingsList);\n this.addChild(this.settingsListContainer);\n this.addChild(new DynamicBorder((text) => theme.fg(\"border\", text)));\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, SAVE_SCOPE_SHORTCUT)) {\n if (!this.projectScopeAvailable) return;\n this.saveScope = this.saveScope === \"project\" ? \"global\" : \"project\";\n this.updateSaveScopeText();\n this.onSaveScopeChange(this.saveScope);\n const nextItems = this.itemsForSaveScope?.(this.saveScope);\n if (nextItems) {\n this.settingsListContainer.clear();\n this.settingsList = this.createSettingsList(nextItems);\n this.settingsListContainer.addChild(this.settingsList);\n }\n return;\n }\n this.settingsList.handleInput(data);\n }\n\n private createSettingsList(items: SettingItem[]): SettingsList {\n return new SettingsList(\n items,\n 10,\n settingsListTheme(this.theme),\n this.onChange,\n this.onCancel,\n { typeToSearch: true },\n );\n }\n\n private updateSaveScopeText(): void {\n const destination = this.saveScope === \"project\"\n ? \"Project overrides (.omp/fabric.json)\"\n : \"Global defaults (<active OMP agent dir>/fabric.json)\";\n const hint = !this.projectScopeAvailable\n ? \" \u00B7 project scope unavailable for untrusted projects\"\n : this.saveScope === \"global\"\n ? \" \u00B7 Ctrl+G switches scope \u00B7 project overrides may remain active here\"\n : \" \u00B7 Ctrl+G switches scope\";\n this.saveScopeText.setText(\n this.theme.fg(\"muted\", \"Editing: \") +\n this.theme.fg(\"accent\", destination) +\n this.theme.fg(\"dim\", hint),\n );\n }\n}\n\nexport const populateClaudeModelSource = async (\n source: ModelSource,\n load: () => Promise<Parameters<typeof buildClaudeModelSource>[0]>,\n): Promise<void> => {\n const loaded = buildClaudeModelSource(await load());\n source.models.splice(0, source.models.length, ...loaded.models);\n source.lastUsed = loaded.lastUsed;\n};\n\nexport const buildFabricSettingsItems = (\n theme: Theme,\n config: FabricConfig,\n apply: (id: string, value: unknown) => void,\n options: {\n keepVisibleCandidates: readonly string[];\n toolCandidates?: readonly string[];\n modelSource: ModelSource;\n claudeModelSource?: ModelSource;\n activeModelKey?: string;\n },\n): SettingItem[] => {\n const persist = (id: string, newValue: string): void =>\n apply(id, coerceValue(id, newValue, config));\n const envFullCode = process.env.OMP_FABRIC_FULL_CODE_MODE;\n const fullCodeDescription = envFullCode\n ? \"Fabric owns OMP core tools (read, bash, edit, write, grep, find, ls) via fabric_exec. Currently overridden by the OMP_FABRIC_FULL_CODE_MODE environment variable.\"\n : \"Fabric owns OMP core tools (read, bash, edit, write, grep, find, ls) via fabric_exec. Disable to keep native tools model-facing (orchestration-only mode).\";\n const executorMemoryDescription = (): string =>\n config.executor.runtime === \"quickjs\"\n ? \"Maximum QuickJS heap size. WASM32 limits this to less than 4 GiB.\"\n : config.executor.runtime === \"bun-process\"\n ? \"Heap target for the disposable Bun process. Bun ignores V8 heap flags, so this limit is not enforced.\"\n : \"V8 old-generation heap limit for the disposable Node process. Large allocations may destabilize the system.\";\n\n const defaultToolsItem = setting(\n \"agents.defaultTools\",\n \"Default tools\",\n formatToolCount(config.agents.defaultTools.length),\n { description: \"OMP core tools exposed to spawned agents by default.\" },\n );\n defaultToolsItem.submenu = listSubmenu(\n theme,\n \"agents.defaultTools\",\n \"Default tools\",\n \"OMP core tools exposed to spawned agents by default.\",\n CORE_DEFAULT_TOOL_CANDIDATES,\n config.agents.defaultTools,\n (selected) => {\n apply(\"agents.defaultTools\", selected);\n defaultToolsItem.currentValue = formatToolCount(selected.length);\n },\n );\n\n const keepVisibleItem = setting(\n \"capture.keepVisible\",\n \"Keep visible\",\n formatToolCount(config.capture.keepVisible.length),\n { description: \"Captured tool names that stay model-visible despite hideFromModel.\" },\n );\n keepVisibleItem.submenu = listSubmenu(\n theme,\n \"capture.keepVisible\",\n \"Keep visible\",\n \"Captured tool names that stay model-visible despite hideFromModel.\",\n options.keepVisibleCandidates,\n config.capture.keepVisible,\n (selected) => {\n apply(\"capture.keepVisible\", selected);\n keepVisibleItem.currentValue = formatToolCount(selected.length);\n },\n );\n const includeToolsItem = setting(\n \"capture.includeTools\",\n \"Include tools\",\n formatToolCount(config.capture.includeTools.length),\n { description: \"Explicitly keep registered tools visible; unavailable names are ignored.\" },\n );\n includeToolsItem.submenu = listSubmenu(\n theme,\n \"capture.includeTools\",\n \"Include tools\",\n \"Explicit include overrides capture hiding. Explicit excludes still win.\",\n options.toolCandidates ?? [],\n config.capture.includeTools,\n (selected) => {\n apply(\"capture.includeTools\", selected);\n includeToolsItem.currentValue = formatToolCount(selected.length);\n },\n );\n const excludeToolsItem = setting(\n \"capture.excludeTools\",\n \"Exclude tools\",\n formatToolCount(config.capture.excludeTools.length),\n { description: \"Hide selected registered tools from the model; excludes win over includes.\" },\n );\n excludeToolsItem.submenu = listSubmenu(\n theme,\n \"capture.excludeTools\",\n \"Exclude tools\",\n \"Explicit exclude wins when a tool appears in both lists.\",\n options.toolCandidates ?? [],\n config.capture.excludeTools,\n (selected) => {\n apply(\"capture.excludeTools\", selected);\n excludeToolsItem.currentValue = formatToolCount(selected.length);\n },\n );\n\n const items = [\n setting(\"fullCodeMode\", \"Full code mode\", config.fullCodeMode ? \"true\" : \"false\", {\n description: fullCodeDescription,\n values: BOOLEANS,\n }),\n setting(\"executor\", \"Executor\", summaryFor(\"executor\", config), {\n description: \"Runtime and resource limits for fabric_exec programs.\",\n submenu: sectionSubmenu(\n theme,\n \"Executor\",\n \"Runtime and resource limits for fabric_exec programs.\",\n [\n setting(\"executor.runtime\", \"Runtime\", config.executor.runtime, {\n description:\n config.schema.mode === \"enforce\"\n ? \"Schema enforce mode requires the isolated QuickJS runtime.\"\n : \"QuickJS is isolated and limited by WASM32. Node/Bun processes support larger heaps but are an unsafe trusted-code escape hatch, not a security sandbox.\",\n values: config.schema.mode === \"enforce\" ? [\"quickjs\"] : EXECUTOR_RUNTIMES,\n }),\n setting(\"executor.timeoutMs\", \"Timeout\", formatMs(config.executor.timeoutMs), {\n description: `Default wall-clock time for a single fabric_exec program. A per-invocation timeoutMs or a matching executor.hostCallTimeouts ref can raise it up to the ${formatMs(config.executor.maxTimeoutMs)} policy maximum.`,\n submenu: numericSubmenu(\n theme,\n [15_000, 30_000, 60_000, 120_000, 300_000, 600_000],\n formatMs,\n \"Executor timeout\",\n `Default wall-clock time for a single fabric_exec program (policy max ${formatMs(config.executor.maxTimeoutMs)}).`,\n ),\n }),\n setting(\n \"executor.maxTimeoutMs\",\n \"Policy max\",\n formatMs(config.executor.maxTimeoutMs),\n {\n description:\n \"Ceiling for every executor deadline: per-invocation timeoutMs requests and executor.hostCallTimeouts ref floors are capped at this value. Values above it are normalized on load.\",\n submenu: numericSubmenu(\n theme,\n [300_000, 600_000, 900_000, 1_800_000, 3_600_000],\n formatMs,\n \"Executor policy maximum\",\n \"Ceiling for every executor deadline, including per-invocation requests and per-ref floors.\",\n ),\n },\n ),\n setting(\n \"executor.hostCallTimeouts\",\n \"Per-ref floors\",\n Object.keys(config.executor.hostCallTimeouts).length > 0\n ? Object.keys(config.executor.hostCallTimeouts)\n .map((ref) => `${ref}=${formatMs(config.executor.hostCallTimeouts[ref] ?? 0)}`)\n .join(\", \")\n : \"none\",\n {\n description:\n \"Exact-ref deadline floors for known long-running host calls (configured in the Fabric config file), e.g. \\\"extensions.subagent\\\": 3600000.\",\n },\n ),\n setting(\n \"executor.memoryLimitBytes\",\n \"Memory limit\",\n formatBytes(config.executor.memoryLimitBytes),\n {\n description: executorMemoryDescription(),\n submenu: (currentValue, done) =>\n numericSubmenu(\n theme,\n executorMemoryLimitOptions(maxExecutorMemoryLimitBytes(config.executor.runtime)),\n formatBytes,\n \"Executor memory limit\",\n executorMemoryDescription(),\n )(currentValue, done),\n },\n ),\n setting(\"executor.maxOutputChars\", \"Max output chars\", config.executor.maxOutputChars.toLocaleString(), {\n description: \"Character cap applied to the final fabric_exec return value shown to the model.\",\n submenu: numericSubmenu(\n theme,\n [20_000, 50_000, 100_000, 200_000, 500_000],\n (n) => n.toLocaleString(),\n \"Max output chars\",\n \"Character cap applied to the final fabric_exec return value shown to the model.\",\n ),\n }),\n setting(\"executor.resultFormat\", \"Result format\", config.executor.resultFormat, {\n description:\n \"Default formatting for fabric_exec return values. Auto renders structured values as syntax-highlighted YAML; each call can override this.\",\n values: RESULT_FORMATS,\n }),\n setting(\n \"executor.maxNestedResultChars\",\n \"Max nested result chars\",\n config.executor.maxNestedResultChars.toLocaleString(),\n {\n description: \"Character cap applied to results returned by nested tool calls inside the sandbox.\",\n submenu: numericSubmenu(\n theme,\n [500_000, 1_000_000, 2_000_000, 5_000_000, 10_000_000],\n (n) => n.toLocaleString(),\n \"Max nested result chars\",\n \"Character cap applied to results returned by nested tool calls inside the sandbox.\",\n ),\n },\n ),\n ],\n persist,\n ),\n }),\n setting(\"schema\", \"Schema\", summaryFor(\"schema\", config), {\n description: \"Typed evidence loop and local-file transaction channel. Enforcement is locked per session; mode changes take effect in the next session.\",\n submenu: sectionSubmenu(\n theme,\n \"Schema\",\n \"Typed evidence loop and local-file transaction channel. In enforce mode, protected-workspace mutations require schema.hypothesize \u2192 schema.verify \u2192 schema.commit inside one fabric_exec call.\",\n [\n setting(\"schema.mode\", \"Mode\", config.schema.mode, {\n description:\n \"off (default) leaves the control plane ungated. audit records would_block events for actions enforce would deny. enforce admits only the schema transaction channel for protected-workspace changes and forces the QuickJS runtime. Takes effect in the next session.\",\n values: SCHEMA_MODES,\n }),\n setting(\"schema.certificateTtlMs\", \"Certificate TTL\", formatMs(config.schema.certificateTtlMs), {\n description: \"How long a schema.verify certificate stays valid. Clamped to 1s\u201310min.\",\n submenu: numericSubmenu(\n theme,\n [1_000, 5_000, 10_000, 30_000, 60_000, 120_000, 300_000, 600_000],\n formatMs,\n \"Certificate TTL\",\n \"How long a schema.verify certificate stays valid. Clamped to 1s\u201310min.\",\n ),\n }),\n setting(\"schema.maxFiles\", \"Max files\", String(config.schema.maxFiles), {\n description: \"Maximum files in one schema.commit transaction. Clamped to 1\u20131000.\",\n submenu: numericSubmenu(\n theme,\n [1, 5, 10, 25, 50, 100, 250, 500, 1000],\n (n) => String(n),\n \"Max files\",\n \"Maximum files in one schema.commit transaction. Clamped to 1\u20131000.\",\n ),\n }),\n setting(\"schema.maxBytes\", \"Max bytes\", formatBytes(config.schema.maxBytes), {\n description: \"Maximum total bytes written by one schema.commit transaction. Clamped to 1 KiB\u2013100 MiB.\",\n submenu: numericSubmenu(\n theme,\n [1_048_576, 5_242_880, 10_485_760, 52_428_800, 104_857_600],\n formatBytes,\n \"Max bytes\",\n \"Maximum total bytes written by one schema.commit transaction. Clamped to 1 KiB\u2013100 MiB.\",\n ),\n }),\n ],\n persist,\n ),\n }),\n setting(\"approvals\", \"Approvals\", summaryFor(\"approvals\", config), {\n description: \"Per-action approval policy for Fabric and model-requested native tool calls.\",\n submenu: sectionSubmenu(\n theme,\n \"Approvals\",\n \"Approval policy for Fabric and model-requested native tool calls. Auto routes each call through a dedicated safety classifier and escalates uncertain actions to you.\",\n [\n setting(\"approvals.model\", \"Auto model\", config.approvals.model || INHERIT_VALUE, {\n description:\n \"OMP model used as the auto-mode safety classifier. Inherit uses the active session model. The classifier has no executable tools and returns a structured allow-or-escalate verdict.\",\n submenu: modelPickerSubmenu(\n theme,\n options.modelSource,\n {\n headerText:\n \"Safety classifier for auto approval policies. Pick Inherit to use the active OMP session model.\",\n inheritName: \"Use the active OMP session model\",\n },\n ),\n }),\n setting(\"approvals.read\", \"Read\", config.approvals.read, {\n description: \"Approval policy for read operations. Read is normally safe to leave allowed.\",\n values: APPROVAL_MODES,\n }),\n setting(\"approvals.write\", \"Write\", config.approvals.write, {\n description: \"Approval policy for write and edit operations. Auto classifies each call.\",\n values: APPROVAL_MODES,\n }),\n setting(\"approvals.execute\", \"Execute\", config.approvals.execute, {\n description: \"Approval policy for shell execution. Auto classifies each command.\",\n values: APPROVAL_MODES,\n }),\n setting(\"approvals.network\", \"Network\", config.approvals.network, {\n description: \"Approval policy for network operations. Auto classifies each destination and payload.\",\n values: APPROVAL_MODES,\n }),\n setting(\"approvals.agent\", \"Agent\", config.approvals.agent, {\n description: \"Approval policy for agent and actor operations. Auto classifies each request.\",\n values: APPROVAL_MODES,\n }),\n ],\n persist,\n ),\n }),\n setting(\"mcp\", \"MCP\", summaryFor(\"mcp\", config), {\n description: \"Model Context Protocol provider discovery and invocation.\",\n submenu: sectionSubmenu(\n theme,\n \"MCP\",\n \"Model Context Protocol provider discovery and invocation.\",\n [\n setting(\"mcp.enabled\", \"Enabled\", config.mcp.enabled ? \"true\" : \"false\", {\n description: \"Enable the MCP provider inside fabric_exec.\",\n values: BOOLEANS,\n }),\n setting(\"mcp.disableOAuth\", \"Disable OAuth\", config.mcp.disableOAuth ? \"true\" : \"false\", {\n description: \"Skip MCP OAuth flows.\",\n values: BOOLEANS,\n }),\n setting(\"mcp.allowDynamicServers\", \"Dynamic servers\", config.mcp.allowDynamicServers ? \"true\" : \"false\", {\n description: \"Allow servers to be added at runtime via the MCP protocol.\",\n values: BOOLEANS,\n }),\n setting(\"mcp.callTimeoutMs\", \"Call timeout\", formatMs(config.mcp.callTimeoutMs), {\n description: \"Timeout for individual MCP tool calls.\",\n submenu: numericSubmenu(\n theme,\n [15_000, 30_000, 60_000, 120_000, 300_000],\n formatMs,\n \"MCP call timeout\",\n \"Timeout for individual MCP tool calls.\",\n ),\n }),\n setting(\"mcp.cache.enabled\", \"Descriptor cache\", config.mcp.cache.enabled ? \"true\" : \"false\", {\n description: \"Cache MCP tool metadata across sessions keyed by mcporter config; discovery no longer spawns every server.\",\n values: BOOLEANS,\n }),\n setting(\"mcp.cache.revalidate\", \"Revalidate on start\", config.mcp.cache.revalidate, {\n description: \"Background re-listing at session start: changed servers only, all servers, or off.\",\n values: [\"changed\", \"all\", \"off\"],\n }),\n setting(\"mcp.cache.revalidateBudgetMs\", \"Revalidate budget\", formatMs(config.mcp.cache.revalidateBudgetMs), {\n description: \"Wall-clock budget for the session-start background MCP revalidation.\",\n submenu: numericSubmenu(\n theme,\n [15_000, 30_000, 60_000, 120_000, 300_000],\n formatMs,\n \"MCP revalidate budget\",\n \"Wall-clock budget for the session-start background MCP revalidation.\",\n ),\n }),\n ],\n persist,\n ),\n }),\n setting(\"prewalk\", \"Prewalk\", summaryFor(\"prewalk\", config), {\n description: \"Continue Main in place or opt into a child trajectory handoff at the completed fabric_exec boundary.\",\n submenu: sectionSubmenu(\n theme,\n \"Prewalk\",\n \"Automatic continuation at the completed outer fabric_exec boundary.\",\n [\n setting(\"prewalk.enabled\", \"Enabled\", config.prewalk.enabled === false ? \"false\" : \"true\", {\n description:\n \"Master switch for prewalk. When off, manual arming, session auto-arm, and boundary claims are all inert until re-enabled. Same effect as /fabric prewalk --disable and --enable; a live arm is cancelled on disable.\",\n values: BOOLEANS,\n }),\n setting(\"prewalk.mode\", \"Mode\", config.prewalk.mode, {\n description:\n \"In-place temporarily switches Main to the executor, queues a hidden continuation, then returns to Main's previous model. Trajectory moves the session snapshot to a visible child executor, then queues a hidden verify-and-summarize continuation for Main when it finishes.\",\n values: PREWALK_MODES,\n }),\n setting(\n \"prewalk.alwaysRearm\",\n \"Always re-arm\",\n config.prewalk.alwaysRearm ? \"true\" : \"false\",\n {\n description:\n \"Arm prewalk automatically at every session start and again after each completed handoff until /fabric prewalk --off cancels it for the session. Auto-arm needs prewalk.model (provider/model). Read-only turns never disarm prewalk.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"prewalk.detectShellWrites\",\n \"Detect shell writes\",\n config.prewalk.detectShellWrites ? \"true\" : \"false\",\n {\n description:\n \"Filesystem fallback trigger: when an armed task ran a successful omp.bash in fabric_exec without an audited omp.edit / omp.write / schema.commit, claim the handoff if file stats drifted from baseline, so shell heredocs, sed -i, or formatter-binary writes also reach the executor.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"prewalk.compactOnReturn\",\n \"Compact on return\",\n config.prewalk.compactOnReturn ? \"true\" : \"false\",\n {\n description:\n \"After an in-place continuation settles, compact the session with the configured compaction engine just before Main's boundary model is restored, so Main re-ingests a compacted transcript rather than the executor's full scratch work.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"prewalk.handoffRetirement\",\n \"Retire planning reads\",\n config.prewalk.handoffRetirement ? \"true\" : \"false\",\n {\n description:\n \"Once the executor handoff is live, replace the planner's stale successful read / grep / find / ls results with a compact marker naming the tool and target, so the executor does not re-ingest exploration it will not use. Failed results, mutating tools, user messages, and the most recent reads are never retired.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"prewalk.handoffRetirementKeep\",\n \"Keep recent reads\",\n String(config.prewalk.handoffRetirementKeep),\n {\n description:\n \"How many of the most recent read-only results stay untouched when retiring, so the executor still sees what the planner just looked at.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Keep recent reads\",\n \"Most-recent read-only results never retired. Enter any integer from 0 to 64.\",\n ),\n },\n ),\n setting(\n \"prewalk.thinking\",\n \"Thinking\",\n config.prewalk.thinking\n ? thinkingLabel(config.prewalk.thinking)\n : PREWALK_THINKING_INHERIT_LABEL,\n {\n description:\n \"Reasoning effort for the trajectory child executor. Agents default inherits Agents \u203A Default thinking; in-place keeps Main's session level. The level is clamped to each model's supported levels.\",\n submenu: thinkingSubmenu(theme, {\n title: \"Prewalk thinking\",\n description:\n \"Reasoning effort for the trajectory child executor. Agents default uses the Agents section's Default thinking; in-place keeps Main's session level. Clamped to each model's supported levels (next highest if unsupported).\",\n inheritLabel: PREWALK_THINKING_INHERIT_LABEL,\n }),\n },\n ),\n setting(\n \"prewalk.model\",\n \"Executor model\",\n config.prewalk.model || PREWALK_MODEL_UNSET_LABEL,\n {\n description:\n \"OMP provider/model used by /fabric prewalk. In-place selects it for Main; trajectory uses it for the child executor. Ask each time is interactive only.\",\n submenu: modelPickerSubmenu(\n theme,\n options.modelSource,\n {\n headerText:\n \"Executor model for automatic /fabric prewalk continuation. Pick Ask each time to open the model picker for every prewalk.\",\n inheritLabel: PREWALK_MODEL_UNSET_LABEL,\n inheritName: \"Open the model picker whenever prewalk is armed\",\n },\n ),\n },\n ),\n ],\n persist,\n ),\n }),\n setting(\"codemap\", \"Code map\", summaryFor(\"codemap\", config), {\n description: \"Structural repo map and git co-change ranking under an explicit token budget.\",\n submenu: sectionSubmenu(\n theme,\n \"Code map\",\n \"Symbol index and co-change ranking exposed to fabric_exec as codemap.*.\",\n [\n setting(\"codemap.enabled\", \"Enabled\", config.codemap.enabled ? \"true\" : \"false\", {\n description:\n \"Expose codemap.map and codemap.cascade inside fabric_exec. The index is built with the host's native ast-grep binding and cached per workspace root.\",\n values: BOOLEANS,\n }),\n setting(\n \"codemap.defaultMaxTokens\",\n \"Default budget\",\n String(config.codemap.defaultMaxTokens),\n {\n description:\n \"Token ceiling applied to codemap.map when the call does not pass maxTokens. The map is ranked before the budget is spent, so a small ceiling still returns the most relevant files.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Code map budget\",\n \"Token ceiling for codemap.map when a call omits maxTokens. Enter any integer from 200 to 200000.\",\n ),\n },\n ),\n setting(\"codemap.maxFiles\", \"Max files\", String(config.codemap.maxFiles), {\n description: \"Upper bound on files enumerated for one index build.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Code map file ceiling\",\n \"Files enumerated for one index build. Enter any integer from 1 to 1000000.\",\n ),\n }),\n setting(\"codemap.maxSymbols\", \"Max symbols\", String(config.codemap.maxSymbols), {\n description: \"Upper bound on symbols retained for one index build.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Code map symbol ceiling\",\n \"Symbols retained for one index build. Enter any integer from 1 to 5000000.\",\n ),\n }),\n setting(\"codemap.maxMs\", \"Time budget\", formatMs(config.codemap.maxMs), {\n description:\n \"Wall-clock ceiling for one index build. A session directory that is not a project can otherwise crawl for minutes; when the budget bites the map returns what it has with truncated set.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Code map time budget\",\n \"Milliseconds allowed for one index build. Enter any integer from 1000 to 600000.\",\n ),\n }),\n setting(\n \"codemap.cascadeCommits\",\n \"Cascade history\",\n String(config.codemap.cascadeCommits),\n {\n description:\n \"How many recent commits codemap.cascade scans when ranking co-change. Merge commits and bulk commits are excluded so vendored or generated sweeps do not create false affinity.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Cascade history\",\n \"Commits scanned when ranking co-change. Enter any integer from 10 to 20000.\",\n ),\n },\n ),\n setting(\"codemap.cascadeLimit\", \"Cascade results\", String(config.codemap.cascadeLimit), {\n description: \"Maximum related files returned by codemap.cascade.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Cascade results\",\n \"Related files returned by codemap.cascade. Enter any integer from 1 to 200.\",\n ),\n }),\n ],\n persist,\n ),\n }),\n setting(\"agents\", \"Agents\", summaryFor(\"agents\", config), {\n description: \"One-shot child agents spawned from inside fabric_exec.\",\n submenu: sectionSubmenu(\n theme,\n \"Agents\",\n \"One-shot child agents spawned from inside fabric_exec.\",\n [\n setting(\"agents.enabled\", \"Enabled\", config.agents.enabled ? \"true\" : \"false\", {\n description: \"Enable agent spawning via workflow.agent() and agents.run().\",\n values: BOOLEANS,\n }),\n setting(\"agents.runner\", \"Default runner\", config.agents.runner, {\n description: \"Execution harness used when agents.run/create does not specify runner.\",\n values: RUNNERS,\n }),\n setting(\"agents.transport\", \"Transport\", config.agents.transport, {\n description: \"Preferred transport for spawned agents.\",\n values: TRANSPORTS,\n }),\n setting(\"agents.model\", \"Default model\", config.agents.model || INHERIT_VALUE, {\n description:\n \"Model forwarded to OMP-backed agents and actors when a call does not specify one. Pick Inherit to use the host session's default. Order matches pi-model-sort (most recently used first).\",\n submenu: modelPickerSubmenu(\n theme,\n options.modelSource,\n ),\n }),\n setting(\n \"agents.claude.model\",\n \"Claude model\",\n config.agents.claude.model || INHERIT_VALUE,\n {\n description:\n \"Claude Code model used by Claude-backed agents and actors. Models are enumerated from the installed claude runtime; Inherit uses Claude Code's default.\",\n submenu: modelPickerSubmenu(\n theme,\n options.claudeModelSource ?? { models: [], lastUsed: {} },\n {\n headerText:\n \"Default model for Claude-backed Fabric agents and actors. Pick Inherit to use Claude Code's runtime default.\",\n inheritName: \"Use Claude Code's runtime default model\",\n },\n ),\n },\n ),\n setting(\"agents.veda.backend\", \"Veda backend\", config.agents.veda.backend, {\n description:\n \"External backend driven by the Veda CLI: agy, codex, claude-code, droid, pi, or a backend registered by the installed Veda build.\",\n submenu: stringInputSubmenu(\n theme,\n \"Veda backend\",\n \"External CLI backend the Veda runner drives for agent runs.\",\n ),\n }),\n setting(\"agents.veda.persona\", \"Veda persona\", config.agents.veda.persona, {\n description:\n \"Veda persona: navigator-plan, navigator-chat, reviewer, worker, or a custom persona under ~/.config/veda/personas/<name>/AGENTS.md.\",\n submenu: stringInputSubmenu(\n theme,\n \"Veda persona\",\n \"Persona controlling the Veda agent's behavior. Leave as navigator-chat for the default.\",\n ),\n }),\n setting(\"agents.veda.model\", \"Veda model\", config.agents.veda.model || INHERIT_VALUE, {\n description:\n \"Default model forwarded to the Veda backend when a call does not specify one. Leave empty for the backend default.\",\n submenu: stringInputSubmenu(\n theme,\n \"Veda model\",\n \"Model or alias forwarded to the Veda backend. Empty uses the backend default.\",\n ),\n }),\n setting(\"agents.thinking\", \"Default thinking\", thinkingLabel(config.agents.thinking), {\n description:\n \"Reasoning effort forwarded to spawned agents and actors when a call does not specify one. Clamped to each model's supported levels (next highest if unsupported).\",\n submenu: thinkingSubmenu(theme),\n }),\n setting(\"agents.maxConcurrent\", \"Max concurrent\", String(config.agents.maxConcurrent), {\n description: \"Maximum number of agents that may run at the same time.\",\n submenu: numericSubmenu(\n theme,\n [1, 2, 4, 8, 16, 32],\n String,\n \"Agent concurrency\",\n \"Maximum number of agents that may run at the same time.\",\n ),\n }),\n setting(\"agents.maxPerExecution\", \"Max per execution\", String(config.agents.maxPerExecution), {\n description: \"Maximum number of agent calls allowed within a single fabric_exec program.\",\n submenu: numericSubmenu(\n theme,\n [10, 25, 50, 100, 200, 500],\n String,\n \"Agents per execution\",\n \"Maximum number of agent calls allowed within a single fabric_exec program.\",\n ),\n }),\n setting(\"agents.maxDepth\", \"Max depth\", String(config.agents.maxDepth), {\n description:\n \"Maximum nesting depth for child agent calls. Enter any non-negative integer; 0 disables child spawning.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Agent depth\",\n \"Maximum nesting depth for child agent calls. Enter any non-negative integer; 0 disables child spawning.\",\n ),\n }),\n setting(\"agents.budgetUsd\", \"Recursion budget\", formatUsd(config.agents.budgetUsd), {\n description:\n \"Maximum USD spend for agent work across the whole recursion tree. 0 disables the budget.\",\n submenu: numericSubmenu(\n theme,\n BUDGET_VALUES,\n formatUsd,\n \"Recursion budget\",\n \"Maximum USD spend for agent work across the whole recursion tree. 0 disables the budget.\",\n ),\n }),\n setting(\"agents.sessionExport\", \"Usage export\", config.agents.sessionExport ? \"true\" : \"false\", {\n description:\n \"Write usage-only OMP-format session files (tokens/cost, never transcript content) for every agent run so tokscale and ccusage can track Fabric subagents.\",\n values: BOOLEANS,\n }),\n setting(\"agents.sessionExportDir\", \"Usage export dir\", config.agents.sessionExportDir || \"<active OMP agent dir> (co-hosted, hidden .fabric namespace)\", {\n description:\n \"Root of the export store; sessions land under <dir>/sessions/.fabric/. Default reuses OMP's own agent dir (tokscale/ccusage count it with zero setup; OMP's resume picker never sees the hidden namespace). OMP_FABRIC_AGENT_DIR overrides.\",\n submenu: stringInputSubmenu(\n theme,\n \"Usage export dir\",\n \"Root of the export store; OMP_FABRIC_AGENT_DIR overrides this value.\",\n ),\n }),\n setting(\"agents.maxTokensPerChild\", \"Token limit\", formatTokens(config.agents.maxTokensPerChild), {\n description:\n \"Maximum cumulative tokens a single agent may use before it is terminated (0 disables). Caps a runaway child before the host session compacts.\",\n submenu: numericSubmenu(\n theme,\n TOKEN_VALUES,\n formatTokens,\n \"Agent token limit\",\n \"Maximum cumulative tokens a single agent may use before it is terminated (0 disables).\",\n ),\n }),\n setting(\"agents.timeoutMs\", \"Timeout\", formatMs(config.agents.timeoutMs), {\n description: \"Default wall-clock timeout and minimum for per-call agent timeouts.\",\n submenu: numericSubmenu(\n theme,\n [\n 60_000,\n 120_000,\n 300_000,\n 600_000,\n 1_800_000,\n 3_600_000,\n 7_200_000,\n 14_400_000,\n 28_800_000,\n 86_400_000,\n ],\n formatMs,\n \"Agent timeout\",\n \"Default wall-clock timeout and minimum for per-call agent timeouts.\",\n ),\n }),\n setting(\"agents.extensions\", \"Extensions\", config.agents.extensions ? \"true\" : \"false\", {\n description: \"Allow agents to load registered extensions.\",\n values: BOOLEANS,\n }),\n defaultToolsItem,\n setting(\"agents.retainRuns\", \"Retain runs\", config.agents.retainRuns ? \"true\" : \"false\", {\n description: \"Keep completed agent run artifacts for later inspection.\",\n values: BOOLEANS,\n }),\n setting(\"agents.notifyOnComplete\", \"Notify on complete\", config.agents.notifyOnComplete ? \"true\" : \"false\", {\n description: \"Post a message when a background agent completes.\",\n values: BOOLEANS,\n }),\n ],\n persist,\n ),\n }),\n setting(\"capture\", \"Capture\", summaryFor(\"capture\", config), {\n description: \"Registered tool capture and model visibility policy.\",\n submenu: sectionSubmenu(\n theme,\n \"Capture\",\n \"Registered tool capture and model visibility policy.\",\n [\n setting(\"capture.enabled\", \"Enabled\", config.capture.enabled ? \"true\" : \"false\", {\n description: \"Capture registered extension tools so they are callable from fabric_exec.\",\n values: BOOLEANS,\n }),\n setting(\"capture.hideFromModel\", \"Hide from model\", config.capture.hideFromModel ? \"true\" : \"false\", {\n description: \"Hide captured tools from the parent model's tool schema.\",\n values: BOOLEANS,\n }),\n setting(\"capture.defaultRisk\", \"Default risk\", config.capture.defaultRisk, {\n description: \"Approval risk level applied to registered tools without an explicit override.\",\n values: RISKS,\n }),\n keepVisibleItem,\n ...CORE_RISK_TOOLS.map((tool) =>\n setting(`capture.risks.${tool}`, `${tool} risk`, config.capture.risks[tool] ?? config.capture.defaultRisk, {\n description: `Approval risk level for the ${tool} tool on native and captured paths.`,\n values: RISKS,\n }),\n ),\n includeToolsItem,\n excludeToolsItem,\n ],\n persist,\n ),\n }),\n setting(\"ui\", \"UI\", summaryFor(\"ui\", config), {\n description: \"Fabric activity widget and dashboard.\",\n submenu: sectionSubmenu(\n theme,\n \"UI\",\n \"Fabric activity widget and dashboard.\",\n [\n setting(\"ui.enabled\", \"Enabled\", config.ui.enabled ? \"true\" : \"false\", {\n description: \"Show the Fabric activity widget and dashboard.\",\n values: BOOLEANS,\n }),\n setting(\"ui.widget\", \"Widget\", config.ui.widget, {\n description: \"When to show the activity widget above the editor.\",\n values: WIDGET_MODES,\n }),\n setting(\"ui.toolDisplay\", \"Tool display\", config.ui.toolDisplay, {\n description:\n \"Show full Fabric TypeScript or a compact intent-and-tools transcript; the tool-expand key (ctrl+o) expands a compact card to full.\",\n values: TOOL_DISPLAY_MODES,\n }),\n setting(\n \"ui.showAgentToolPreview\",\n \"Agent tool preview\",\n config.ui.showAgentToolPreview ? \"true\" : \"false\",\n {\n description:\n \"Show spawned agent/actor tool trees \u2014 including recursive descendants \u2014 in Fabric tool-call previews.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"ui.updateDebounceMs\",\n \"Update debounce\",\n formatDebounce(config.ui.updateDebounceMs),\n {\n description: \"One global coalescing window for live card updates \u2014 nested calls, progress, agent previews.\",\n submenu: numericSubmenu(\n theme,\n [0, 16, 50, 100, 150, 250, 500, 1000],\n formatDebounce,\n \"Update debounce\",\n \"One global coalescing window for live card updates \u2014 nested calls, progress, agent previews. Off emits every update.\",\n ),\n },\n ),\n setting(\"ui.maxRows\", \"Max rows\", String(config.ui.maxRows), {\n description: \"Maximum rows rendered by the activity widget.\",\n submenu: numericSubmenu(\n theme,\n [1, 2, 3, 5, 6, 8, 10, 15, 20],\n String,\n \"Widget max rows\",\n \"Maximum rows rendered by the activity widget.\",\n ),\n }),\n setting(\"ui.refreshMs\", \"Refresh interval\", formatMs(config.ui.refreshMs), {\n description: \"Refresh interval for the activity widget.\",\n submenu: numericSubmenu(\n theme,\n [100, 250, 500, 1000, 2000],\n formatMs,\n \"Widget refresh interval\",\n \"Refresh interval for the activity widget.\",\n ),\n }),\n setting(\"ui.eventHistory\", \"Event history\", String(config.ui.eventHistory), {\n description: \"Number of mesh events kept in the dashboard history.\",\n submenu: numericSubmenu(\n theme,\n [20, 40, 80, 120, 200, 500],\n String,\n \"Event history\",\n \"Number of mesh events kept in the dashboard history.\",\n ),\n }),\n setting(\"update.check\", \"Update notice\", config.update.check ? \"true\" : \"false\", {\n description:\n \"Show a status line when a newer omp-fabric is published on npm. One npm registry request per day, cached under the agent dir.\",\n values: BOOLEANS,\n }),\n ],\n persist,\n ),\n }),\n setting(\"compaction\", \"Compaction\", summaryFor(\"compaction\", config), {\n description: \"Compaction engine used at session compaction boundaries.\",\n submenu: sectionSubmenu(\n theme,\n \"Compaction\",\n \"Choose LCM context compaction or OMP core model-driven compaction.\",\n [\n ...(options.activeModelKey\n ? [setting(\n COMPACTION_THRESHOLD_SETTING_ID,\n \"Threshold\",\n formatCompactionThreshold(config, options.activeModelKey),\n {\n description:\n `Context usage that triggers compaction for ${options.activeModelKey}, as a percent of its window or an exact token count.`,\n submenu: compactionThresholdSubmenu(theme),\n },\n )]\n : []),\n setting(\"compaction.engine\", \"Engine\", config.compaction.engine, {\n description:\n \"LCM assembles durable hierarchical context; OMP delegates compaction to OMP core.\",\n values: COMPACTION_ENGINES,\n }),\n setting(\n \"compaction.targetContextRatio\",\n \"Max occupancy\",\n String(config.compaction.targetContextRatio),\n {\n description:\n \"Hard post-compaction occupancy ceiling used by LCM context assembly.\",\n values: COMPACTION_TARGET_RATIOS,\n },\n ),\n ],\n persist,\n ),\n }),\n setting(\"retention\", \"Retention\", summaryFor(\"retention\", config), {\n description: \"Age-based cleanup for inactive Fabric run artifacts.\",\n submenu: sectionSubmenu(\n theme,\n \"Retention\",\n \"Cleanup only removes dead temporary roots and terminal run artifacts. Active runs and actor session.jsonl files are never modified.\",\n [\n setting(\n \"retention.orphanedTempRunMs\",\n \"Orphaned temp runs\",\n formatRetention(config.retention.orphanedTempRunMs),\n {\n description: \"Remove temporary run roots this long after their owner process dies.\",\n submenu: numericSubmenu(\n theme,\n [3_600_000, 3 * 3_600_000, 6 * 3_600_000, 12 * 3_600_000, 24 * 3_600_000],\n formatRetention,\n \"Orphaned temp runs\",\n \"Remove temporary run roots this long after their owner process dies.\",\n ),\n },\n ),\n setting(\n \"retention.oneShotRunMs\",\n \"One-shot runs\",\n formatRetention(config.retention.oneShotRunMs),\n {\n description: \"Retain completed one-shot agent run artifacts for this duration.\",\n submenu: numericSubmenu(\n theme,\n [6 * 3_600_000, 12 * 3_600_000, 24 * 3_600_000, 2 * 86_400_000, 3 * 86_400_000, 7 * 86_400_000],\n formatRetention,\n \"One-shot runs\",\n \"Retain completed one-shot agent run artifacts for this duration.\",\n ),\n },\n ),\n setting(\n \"retention.actorRunArchiveMs\",\n \"Actor run archives\",\n formatRetention(config.retention.actorRunArchiveMs),\n {\n description: \"Retain terminal actor run archives for this duration; the latest run is always preserved.\",\n submenu: numericSubmenu(\n theme,\n [86_400_000, 3 * 86_400_000, 7 * 86_400_000, 14 * 86_400_000, 30 * 86_400_000, 90 * 86_400_000],\n formatRetention,\n \"Actor run archives\",\n \"Retain terminal actor run archives for this duration; the latest run is always preserved.\",\n ),\n },\n ),\n ],\n persist,\n ),\n }),\n setting(\"mesh\", \"Mesh\", summaryFor(\"mesh\", config), {\n description: \"Durable mesh coordination store and actors.\",\n submenu: sectionSubmenu(\n theme,\n \"Mesh\",\n \"Durable mesh coordination store and actors.\",\n [\n setting(\"mesh.enabled\", \"Enabled\", config.mesh.enabled ? \"true\" : \"false\", {\n description: \"Enable the durable mesh store and actor providers.\",\n values: BOOLEANS,\n }),\n setting(\"mesh.actorScope\", \"Actor scope\", config.mesh.actorScope, {\n description:\n 'Default storage for newly created actors. Each agents.create call may choose project or session independently; project actors are shared, while session actors follow the root OMP session and its participant agents.',\n values: ACTOR_SCOPES,\n }),\n setting(\"mesh.maxReadEvents\", \"Max read events\", String(config.mesh.maxReadEvents), {\n description: \"Maximum events returned by a single mesh read.\",\n submenu: numericSubmenu(\n theme,\n [100, 200, 500, 1000, 5000],\n String,\n \"Max read events\",\n \"Maximum events returned by a single mesh read.\",\n ),\n }),\n setting(\"mesh.actorPollMs\", \"Actor poll fallback\", formatMs(config.mesh.actorPollMs), {\n description: \"Fallback polling interval when mesh filesystem notifications are unavailable.\",\n submenu: numericSubmenu(\n theme,\n [50, 100, 250, 500, 1000],\n formatMs,\n \"Actor poll fallback\",\n \"Fallback polling interval when mesh filesystem notifications are unavailable.\",\n ),\n }),\n setting(\"mesh.actorQueueLimit\", \"Actor queue limit\", String(config.mesh.actorQueueLimit), {\n description: \"Maximum messages queued per actor mailbox.\",\n submenu: numericSubmenu(\n theme,\n [4, 8, 16, 32, 64, 128],\n String,\n \"Actor queue limit\",\n \"Maximum messages queued per actor mailbox.\",\n ),\n }),\n setting(\"mesh.actorContextEntries\", \"Actor context entries\", String(config.mesh.actorContextEntries), {\n description: \"Transcript entries forwarded to actors as context.\",\n submenu: numericSubmenu(\n theme,\n [3, 5, 10, 14, 20, 50],\n String,\n \"Actor context entries\",\n \"Transcript entries forwarded to actors as context.\",\n ),\n }),\n setting(\"mesh.eventContextChars\", \"Event context chars\", config.mesh.eventContextChars.toLocaleString(), {\n description: \"Character cap applied to host events dispatched to actors.\",\n submenu: numericSubmenu(\n theme,\n [10_000, 20_000, 40_000, 80_000, 160_000],\n (n) => n.toLocaleString(),\n \"Event context chars\",\n \"Character cap applied to host events dispatched to actors.\",\n ),\n }),\n ],\n persist,\n ),\n }),\n setting(\"codePreview\", \"Code previews\", summaryFor(\"codePreview\", config), {\n description: \"Core tool previews, diffs, and Shiki syntax highlighting.\",\n submenu: sectionSubmenu(\n theme,\n \"Code previews\",\n \"Core tool previews, diffs, and Shiki syntax highlighting. Persisted to fabric.json codePreview.\",\n [\n setting(\"codePreview.shikiTheme\", \"Shiki theme\", config.codePreview.shikiTheme, {\n description:\n \"\\\"auto\\\" follows OMP's resolved light/dark variant; \\\"<light>/<dark>\\\" pins both; any other value fixes one theme.\",\n submenu: stringOptionsSubmenu(\n theme,\n SHIKI_THEME_PRESETS,\n \"Shiki theme\",\n \"\\\"auto\\\" follows OMP's light/dark switching (github-light/dark-plus); \\\"<light>/<dark>\\\" pins both variants.\",\n ),\n }),\n setting(\"codePreview.syntaxHighlighting\", \"Syntax highlighting\", config.codePreview.syntaxHighlighting ? \"true\" : \"false\", {\n description: \"Highlight code in previews with Shiki.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.diffIntensity\", \"Diff background\", config.codePreview.diffIntensity, {\n description: \"Full-row background tint for added and removed diff lines.\",\n values: DIFF_INTENSITIES,\n }),\n setting(\"codePreview.wordEmphasis\", \"Word emphasis\", config.codePreview.wordEmphasis, {\n description: \"Highlight changed words inside added and removed diff lines.\",\n values: WORD_EMPHASES,\n }),\n setting(\"codePreview.toolCallBackground\", \"Tool call background\", config.codePreview.toolCallBackground, {\n description: \"Background treatment for tool call frames.\",\n values: TOOL_CALL_BACKGROUNDS,\n }),\n setting(\"codePreview.toolCallTiming\", \"Tool call timing\", config.codePreview.toolCallTiming ? \"true\" : \"false\", {\n description: \"Show per-call duration on tool frames.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.pathIcons\", \"Path icons\", config.codePreview.pathIcons, {\n description: \"Icon set for path tree previews.\",\n values: PATH_ICON_MODES,\n }),\n setting(\"codePreview.readCollapsedLines\", \"Read lines\", String(config.codePreview.readCollapsedLines), {\n description: \"Collapsed read preview budget.\",\n submenu: numericSubmenu(theme, [3, 5, 10, 15, 20, 30], String, \"Read lines\", \"Collapsed read preview budget.\"),\n }),\n setting(\"codePreview.writeCollapsedLines\", \"Write lines\", String(config.codePreview.writeCollapsedLines), {\n description: \"Collapsed write preview budget.\",\n submenu: numericSubmenu(theme, [3, 5, 10, 15, 20, 30], String, \"Write lines\", \"Collapsed write preview budget.\"),\n }),\n setting(\n CODE_PREVIEW_EDIT_LINES_ID,\n \"Edit diff lines\",\n config.codePreview.editCollapsedLines === \"all\"\n ? CODE_PREVIEW_ALL_LINES\n : String(config.codePreview.editCollapsedLines),\n {\n description: \"Collapsed edit diff budget, or every diff line.\",\n submenu: stringOptionsSubmenu(\n theme,\n [\"10\", \"40\", \"80\", \"160\", \"320\", CODE_PREVIEW_ALL_LINES],\n \"Edit diff lines\",\n \"Collapsed edit diff budget, or every diff line.\",\n ),\n },\n ),\n setting(\"codePreview.grepCollapsedLines\", \"Grep lines\", String(config.codePreview.grepCollapsedLines), {\n description: \"Collapsed grep result budget.\",\n submenu: numericSubmenu(theme, [5, 10, 15, 25, 40], String, \"Grep lines\", \"Collapsed grep result budget.\"),\n }),\n setting(\"codePreview.pathListCollapsedLines\", \"Path list lines\", String(config.codePreview.pathListCollapsedLines), {\n description: \"Collapsed find/ls path tree budget.\",\n submenu: numericSubmenu(theme, [10, 20, 40, 80], String, \"Path list lines\", \"Collapsed find/ls path tree budget.\"),\n }),\n setting(\"codePreview.readContentPreview\", \"Read preview\", config.codePreview.readContentPreview ? \"true\" : \"false\", {\n description: \"Show file content previews for read calls.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.writeContentPreview\", \"Write preview\", config.codePreview.writeContentPreview ? \"true\" : \"false\", {\n description: \"Show content previews for write calls.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.editDiffPreview\", \"Edit diff preview\", config.codePreview.editDiffPreview ? \"true\" : \"false\", {\n description: \"Show diffs for edit calls.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.grepResultPreview\", \"Grep results\", config.codePreview.grepResultPreview ? \"true\" : \"false\", {\n description: \"Show grouped grep result previews.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.findResultPreview\", \"Find results\", config.codePreview.findResultPreview ? \"true\" : \"false\", {\n description: \"Show find result path trees.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.lsResultPreview\", \"Ls results\", config.codePreview.lsResultPreview ? \"true\" : \"false\", {\n description: \"Show ls result path trees.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.readLineNumbers\", \"Read line numbers\", config.codePreview.readLineNumbers ? \"true\" : \"false\", {\n description: \"Show line-number gutters in read previews.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.bashResultPreview\", \"Bash results\", config.codePreview.bashResultPreview ? \"true\" : \"false\", {\n description: \"Show bash output previews.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.bashWarnings\", \"Bash warnings\", config.codePreview.bashWarnings ? \"true\" : \"false\", {\n description: \"Annotate risky bash commands.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.secretWarnings\", \"Secret warnings\", config.codePreview.secretWarnings ? \"true\" : \"false\", {\n description: \"Flag suspected secrets in previews.\",\n values: BOOLEANS,\n }),\n ],\n persist,\n ),\n }),\n ];\n return markDrillIn(items);\n};\n\nconst RPC_BACK = \"\u2190 Back\";\nconst RPC_DONE = \"Done\";\nconst RPC_SWITCH_SCOPE = \"Switch save scope\";\n\ntype RpcChoice = {\n value: string;\n label: string;\n description?: string;\n current?: boolean;\n};\n\nconst rpcTitle = (path: string, description?: string): string =>\n description ? `${path}\\n${description}` : path;\n\nconst cleanSettingLabel = (label: string): string => label.replace(/\\s+\u203A$/, \"\");\n\nconst rpcSettingRow = (item: SettingItem): string => {\n const label = cleanSettingLabel(item.label);\n const current = item.currentValue ? ` \u00B7 ${item.currentValue}` : \"\";\n return item.description\n ? `${label}${current} \u2014 ${item.description}`\n : `${label}${current}`;\n};\n\nconst rpcChoiceRow = (choice: RpcChoice): string => {\n const current = choice.current ? \" \u00B7 Current\" : \"\";\n return choice.description\n ? `${choice.label}${current} \u2014 ${choice.description}`\n : `${choice.label}${current}`;\n};\n\nconst selectRpcChoice = async (\n context: ExtensionContext,\n title: string,\n choices: RpcChoice[],\n): Promise<string | undefined> => {\n const rows = choices.map(rpcChoiceRow);\n const selected = await context.ui.select(title, rows);\n if (selected === undefined) return undefined;\n const index = rows.indexOf(selected);\n return index < 0 ? undefined : choices[index]?.value;\n};\n\nconst browseRpcSettings = async (\n context: ExtensionContext,\n path: string,\n description: string | undefined,\n items: SettingItem[],\n onChange: (id: string, newValue: string) => void,\n): Promise<void> => {\n while (true) {\n const rows = items.map(rpcSettingRow);\n const selected = await context.ui.select(rpcTitle(path, description), [...rows, RPC_BACK]);\n if (selected === undefined || selected === RPC_BACK) return;\n const index = rows.indexOf(selected);\n const item = index < 0 ? undefined : items[index];\n if (!item) continue;\n await editRpcSetting(context, `${path} \u203A ${cleanSettingLabel(item.label)}`, item, onChange);\n }\n};\n\nconst editRpcSetting = async (\n context: ExtensionContext,\n path: string,\n item: SettingItem,\n onChange: (id: string, newValue: string) => void,\n): Promise<void> => {\n if (!item.submenu) {\n const values = item.values ?? [];\n if (values.length === 0) {\n context.ui.notify(`${cleanSettingLabel(item.label)} is read-only`, \"info\");\n return;\n }\n const selected = await selectRpcChoice(\n context,\n rpcTitle(path, item.description),\n unique([item.currentValue, ...values]).map((value) => ({\n value,\n label: value,\n current: value === item.currentValue,\n })),\n );\n if (selected === undefined) return;\n item.currentValue = selected;\n onChange(item.id, selected);\n return;\n }\n\n let completed = false;\n let selectedValue: string | undefined;\n const component = item.submenu(item.currentValue, (value) => {\n completed = true;\n selectedValue = value;\n });\n\n if (component instanceof SectionSubmenu) {\n await browseRpcSettings(\n context,\n path,\n item.description,\n component.items,\n (id, value) => {\n const child = component.items.find((candidate) => candidate.id === id);\n if (child) child.currentValue = value;\n component.applyChange(id, value);\n },\n );\n return;\n }\n\n if (component instanceof SelectSubmenu) {\n const selected = await selectRpcChoice(\n context,\n rpcTitle(path, item.description),\n component.options.map((option) => ({\n value: option.value,\n label: option.label,\n ...(option.description ? { description: option.description } : {}),\n current: option.value === item.currentValue || option.label === item.currentValue,\n })),\n );\n if (selected === undefined || !component.selectRpc(selected)) return;\n } else if (component instanceof IntegerInputSubmenu) {\n while (!completed) {\n const value = await context.ui.input(rpcTitle(path, item.description), component.input.getValue());\n if (value === undefined) return;\n if (!/^\\d+$/.test(value.trim()) || !Number.isSafeInteger(Number(value.trim()))) {\n context.ui.notify(\"Enter a non-negative safe integer.\", \"warning\");\n continue;\n }\n component.submitRpc(value);\n }\n } else if (component instanceof StringInputSubmenu) {\n const value = await context.ui.input(rpcTitle(path, item.description), component.input.getValue());\n if (value === undefined) return;\n component.submitRpc(value);\n } else if (component instanceof CompactionThresholdSubmenu) {\n const selected = await selectRpcChoice(\n context,\n rpcTitle(path, item.description),\n [\n { value: COMPACTION_DEFAULT_THRESHOLD_LABEL, label: COMPACTION_DEFAULT_THRESHOLD_LABEL, current: item.currentValue === COMPACTION_DEFAULT_THRESHOLD_LABEL },\n { value: COMPACTION_PERCENT_OPTION_LABEL, label: COMPACTION_PERCENT_OPTION_LABEL, current: item.currentValue.endsWith(\"%\") },\n { value: COMPACTION_TOKENS_OPTION_LABEL, label: COMPACTION_TOKENS_OPTION_LABEL, current: item.currentValue.endsWith(\" tokens\") },\n ],\n );\n if (selected === undefined) return;\n if (selected === COMPACTION_DEFAULT_THRESHOLD_LABEL) {\n component.completeRpc(selected);\n } else {\n const percent = /^(\\d+)%$/.exec(item.currentValue)?.[1] ?? \"\";\n const tokenText = /^(.+?) tokens$/.exec(item.currentValue)?.[1];\n const placeholder = selected === COMPACTION_PERCENT_OPTION_LABEL\n ? percent\n : tokenText === undefined ? \"\" : String(parseFormattedNumericValue(tokenText));\n const input = await context.ui.input(rpcTitle(path, item.description), placeholder);\n if (input === undefined || !/^\\d+$/.test(input.trim())) return;\n const numeric = Number(input.trim());\n component.completeRpc(\n selected === COMPACTION_PERCENT_OPTION_LABEL\n ? `${clampCompactionPercentThreshold(numeric)}%`\n : `${formatTokens(clampCompactionTokenThreshold(numeric))} tokens`,\n );\n }\n } else if (component instanceof FabricModelSelector) {\n const selected = await selectRpcChoice(\n context,\n rpcTitle(path, item.description),\n component.rpcChoices().map((choice) => ({\n value: choice.value,\n label: choice.label,\n description: choice.description,\n current: choice.current,\n })),\n );\n if (selected === undefined || !component.selectRpc(selected)) return;\n } else {\n context.ui.notify(`${cleanSettingLabel(item.label)} requires terminal UI`, \"warning\");\n return;\n }\n\n if (!completed || selectedValue === undefined) return;\n item.currentValue = selectedValue;\n onChange(item.id, selectedValue);\n};\n\nconst openRpcFabricSettings = async (\n context: ExtensionContext,\n options: {\n projectScopeAvailable: boolean;\n getScope: () => FabricConfigScope;\n setScope: (scope: FabricConfigScope) => void;\n itemsForScope: (scope: FabricConfigScope) => SettingItem[];\n persist: (id: string, value: string) => void;\n },\n): Promise<void> => {\n while (true) {\n const scope = options.getScope();\n const items = options.itemsForScope(scope);\n const rows = items.map(rpcSettingRow);\n const scopeDestination = scope === \"project\"\n ? \"Project overrides (.omp/fabric.json)\"\n : \"Global defaults (<active OMP agent dir>/fabric.json)\";\n const controls = [\n ...(options.projectScopeAvailable ? [`${RPC_SWITCH_SCOPE} \u00B7 ${scope === \"project\" ? \"Global defaults\" : \"Project overrides\"}`] : []),\n RPC_DONE,\n ];\n const selected = await context.ui.select(\n rpcTitle(\"Fabric settings\", `Editing: ${scopeDestination}`),\n [...rows, ...controls],\n );\n if (selected === undefined || selected === RPC_DONE) return;\n if (selected.startsWith(RPC_SWITCH_SCOPE)) {\n options.setScope(scope === \"project\" ? \"global\" : \"project\");\n continue;\n }\n const index = rows.indexOf(selected);\n const item = index < 0 ? undefined : items[index];\n if (!item) continue;\n await editRpcSetting(context, `Fabric settings \u203A ${cleanSettingLabel(item.label)}`, item, options.persist);\n }\n};\n\nexport interface FabricSettingsDeps {\n state: FabricState;\n applyFabricMode: () => void;\n capturedTools: CapturedToolCatalog;\n onConfigApplied?: (id: string) => void;\n}\n\nexport async function openFabricSettings(\n context: ExtensionContext,\n deps: FabricSettingsDeps,\n): Promise<void> {\n await deps.state.ensure(context);\n const agentDir = resolveAgentDir();\n const projectTrusted = context.isProjectTrusted();\n const configLocation = { cwd: context.cwd, agentDir, projectTrusted };\n let saveScope: FabricConfigScope = \"global\";\n let settingsConfig = loadFabricConfigForScope(configLocation, saveScope);\n let rootComponent: FabricSettingsComponent | undefined;\n const changedSections = new Set<string>();\n let dirty = false;\n\n const activeModelKey = context.model\n ? modelKey(context.model.provider, context.model.id)\n : undefined;\n const apply = (id: string, value: unknown): void => {\n const partial = id === COMPACTION_THRESHOLD_SETTING_ID && activeModelKey\n ? compactionThresholdPartial(activeModelKey, value as CompactionThresholdSelection)\n : buildPartial(id, value);\n try {\n saveFabricConfig(\n { cwd: context.cwd, agentDir, projectTrusted, scope: saveScope },\n partial,\n );\n } catch (error) {\n context.ui.notify(\n `Failed to save Fabric settings: ${error instanceof Error ? error.message : String(error)}`,\n \"error\",\n );\n return;\n }\n deps.state.reloadConfig(context);\n Object.assign(settingsConfig, loadFabricConfigForScope(configLocation, saveScope));\n deps.onConfigApplied?.(id);\n dirty = true;\n changedSections.add(id.split(\".\")[0] ?? id);\n const list = rootComponent?.settingsList;\n if (list) for (const rootId of ROOT_ITEM_IDS) list.updateValue(rootId, summaryFor(rootId, settingsConfig));\n };\n\n const persist = (id: string, newValue: string): void =>\n apply(id, coerceValue(id, newValue, settingsConfig));\n\n const keepVisibleCandidates = unique([\n \"fabric_exec\",\n ...deps.capturedTools.list().map((tool) => tool.name),\n ]);\n const modelSource = buildModelSource(context.modelRegistry, agentDir);\n const configuredClaudeModel = deps.state.config.agents.claude.model;\n const claudeModelSource: ModelSource = {\n models: configuredClaudeModel\n ? [{ provider: \"claude\", id: configuredClaudeModel.replace(/^claude\\//, \"\") }]\n : [],\n lastUsed: {},\n };\n void populateClaudeModelSource(\n claudeModelSource,\n () => deps.state.agents.claudeModels(),\n ).catch((error: unknown) => {\n if (deps.state.config.agents.runner === \"claude\") {\n context.ui.notify(\n `Claude model discovery failed: ${error instanceof Error ? error.message : String(error)}`,\n \"warning\",\n );\n }\n });\n\n const toolCandidates = keepVisibleCandidates;\n const itemsForScope = (scope: FabricConfigScope, theme: Theme): SettingItem[] => {\n settingsConfig = loadFabricConfigForScope(configLocation, scope);\n return buildFabricSettingsItems(theme, settingsConfig, apply, {\n keepVisibleCandidates,\n toolCandidates,\n modelSource,\n claudeModelSource,\n ...(activeModelKey ? { activeModelKey } : {}),\n });\n };\n\n if (context.mode === \"rpc\") {\n await openRpcFabricSettings(context, {\n projectScopeAvailable: projectTrusted,\n getScope: () => saveScope,\n setScope: (scope) => {\n saveScope = scope;\n },\n itemsForScope: (scope) => itemsForScope(scope, context.ui.theme),\n persist,\n });\n } else if (context.mode !== \"tui\") {\n context.ui.notify(\"Fabric settings require an interactive UI\", \"warning\");\n return;\n } else {\n await context.ui.custom<void>(\n (tui, theme, _keybindings, done) => {\n const component = new FabricSettingsComponent(\n theme,\n itemsForScope(saveScope, theme),\n persist,\n () => done(),\n {\n initialSaveScope: saveScope,\n projectScopeAvailable: projectTrusted,\n onSaveScopeChange: (scope) => {\n saveScope = scope;\n tui.requestRender();\n },\n itemsForSaveScope: (scope) => itemsForScope(scope, theme),\n },\n );\n rootComponent = component;\n return component;\n },\n );\n }\n\n if (dirty) {\n deps.applyFabricMode();\n const needsReload = [...changedSections].some((section) => RELOAD_SECTIONS.has(section));\n if (needsReload) {\n context.ui.notify(\n \"Fabric settings saved. Run /fabric reload to apply mesh, agent, and MCP changes.\",\n \"info\",\n );\n } else if (changedSections.has(\"schema\")) {\n context.ui.notify(\n \"Fabric settings saved. Schema changes take effect in the next session.\",\n \"info\",\n );\n } else {\n context.ui.notify(\"Fabric settings saved.\", \"info\");\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AA6BP,IAAM,iBAA0C;AAAA,EAC9C,uBAAuB;AAAA,EACvB,uBAAuB;AACzB;AAEA,IAAM,WAAW,CAAC,QAAQ,OAAO;AACjC,IAAM,iBAAiB,CAAC,SAAS,OAAO,QAAQ,MAAM;AACtD,IAAM,UAAU,CAAC,OAAO,UAAU,MAAM;AACxC,IAAM,aAAa,CAAC,QAAQ,WAAW,QAAQ,UAAU,aAAa,OAAO;AAC7E,IAAM,eAAe,CAAC,QAAQ,UAAU,QAAQ;AAChD,IAAM,qBAAqB,CAAC,QAAQ,SAAS;AAC7C,IAAM,iBAAiB,CAAC,QAAQ,QAAQ,QAAQ,MAAM;AACtD,IAAM,oBAAoB,CAAC,WAAW,gBAAgB,aAAa;AACnE,IAAM,eAAe,CAAC,OAAO,SAAS,SAAS;AAC/C,IAAM,qBAAqB,CAAC,OAAO,KAAK;AACxC,IAAM,kCAAkC;AACxC,IAAM,qCAAqC;AAC3C,IAAM,kCAAkC;AACxC,IAAM,iCAAiC;AACvC,IAAM,yBAAyB,KAAK,MAAM,iCAAiC,GAAG;AAC9E,IAAM,yBAAyB,KAAK,MAAM,iCAAiC,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from \"./dynamic-border.js\";\nimport {\n Container,\n type Component,\n Input,\n Key,\n matchesKey,\n SelectList,\n type SelectItem,\n type SelectListLayoutOptions,\n type SelectListTheme,\n SettingsList,\n type SettingItem,\n type SettingsListTheme,\n Spacer,\n Text,\n} from \"@oh-my-pi/pi-tui\";\nimport { ompSymbolTheme } from \"./symbol-theme.js\";\nimport { FabricModelSelector } from \"./fabric-model-selector.js\";\nimport {\n buildClaudeModelSource,\n buildModelSource,\n INHERIT_VALUE,\n modelKey,\n type ModelSource,\n} from \"./model-picker.js\";\nimport {\n clampCompactionRatioThreshold,\n clampCompactionTokenThreshold,\n loadFabricConfigForScope,\n MAX_COMPACTION_RATIO_THRESHOLD,\n MAX_COMPACTION_TOKEN_THRESHOLD,\n maxExecutorMemoryLimitBytes,\n MIN_COMPACTION_RATIO_THRESHOLD,\n MIN_COMPACTION_TOKEN_THRESHOLD,\n QUICKJS_MAX_MEMORY_LIMIT_BYTES,\n saveFabricConfig,\n type FabricConfig,\n type FabricConfigScope,\n} from \"../config.js\";\nimport { THINKING_LEVELS, thinkingLabel } from \"../thinking.js\";\nimport type { CapturedToolCatalog } from \"../capture/catalog.js\";\nimport type { FabricState } from \"../fabric-state.js\";\nimport { resolveAgentDir } from \"../core/agent-dir.js\";\n\nconst SUBMENU_LAYOUT: SelectListLayoutOptions = {\n minPrimaryColumnWidth: 12,\n maxPrimaryColumnWidth: 32,\n};\n\nconst BOOLEANS = [\"true\", \"false\"] as const;\nconst APPROVAL_MODES = [\"allow\", \"ask\", \"auto\", \"deny\"] as const;\nconst RUNNERS = [\"omp\", \"claude\", \"veda\"] as const;\nconst TRANSPORTS = [\"auto\", \"process\", \"tmux\", \"screen\", \"localterm\", \"herdr\"] as const;\nconst WIDGET_MODES = [\"auto\", \"always\", \"hidden\"] as const;\nconst TOOL_DISPLAY_MODES = [\"full\", \"compact\"] as const;\nconst RESULT_FORMATS = [\"auto\", \"yaml\", \"json\", \"text\"] as const;\nconst EXECUTOR_RUNTIMES = [\"quickjs\", \"node-process\", \"bun-process\"] as const;\nconst SCHEMA_MODES = [\"off\", \"audit\", \"enforce\"] as const;\nconst COMPACTION_ENGINES = [\"lcm\", \"omp\"] as const;\nconst COMPACTION_THRESHOLD_SETTING_ID = \"compaction.threshold\";\nconst COMPACTION_DEFAULT_THRESHOLD_LABEL = \"OMP default\";\nconst COMPACTION_PERCENT_OPTION_LABEL = \"Custom percent\u2026\";\nconst COMPACTION_TOKENS_OPTION_LABEL = \"Custom tokens\u2026\";\nconst COMPACTION_PERCENT_MIN = Math.round(MIN_COMPACTION_RATIO_THRESHOLD * 100);\nconst COMPACTION_PERCENT_MAX = Math.round(MAX_COMPACTION_RATIO_THRESHOLD * 100);\nconst clampCompactionPercentThreshold = (value: number): number =>\n Math.round(clampCompactionRatioThreshold(value / 100) * 100);\nconst COMPACTION_TARGET_RATIOS = Array.from(\n { length: 13 },\n (_, index) => String((25 + index * 5) / 100),\n);\nconst ACTOR_SCOPES = [\"project\", \"session\"] as const;\nconst DIFF_INTENSITIES = [\"off\", \"subtle\", \"medium\"] as const;\nconst WORD_EMPHASES = [\"all\", \"smart\", \"off\"] as const;\nconst TOOL_CALL_BACKGROUNDS = [\"on\", \"border\", \"off\"] as const;\nconst PATH_ICON_MODES = [\"unicode\", \"nerd\", \"off\"] as const;\nconst CODE_PREVIEW_EDIT_LINES_ID = \"codePreview.editCollapsedLines\";\nconst CODE_PREVIEW_ALL_LINES = \"All lines\";\nconst SHIKI_THEME_PRESETS = [\n \"auto\",\n \"github-light/github-dark\",\n \"light-plus/dark-plus\",\n \"solarized-light/solarized-dark\",\n \"catppuccin-latte/catppuccin-mocha\",\n \"github-light\",\n \"light-plus\",\n \"solarized-light\",\n \"dark-plus\",\n \"github-dark\",\n \"solarized-dark\",\n \"nord\",\n \"one-dark-pro\",\n] as const;\nconst RISKS = [\"read\", \"write\", \"execute\", \"network\", \"agent\"] as const;\nconst CORE_RISK_TOOLS = [\"read\", \"grep\", \"find\", \"edit\", \"write\", \"bash\"] as const;\nconst CORE_DEFAULT_TOOL_CANDIDATES = [\"read\", \"bash\", \"edit\", \"write\", \"grep\", \"find\"];\nconst BUDGET_VALUES = [0, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10];\nconst TOKEN_VALUES = [0, 50_000, 100_000, 250_000, 500_000, 1_000_000, 2_000_000];\nconst PREWALK_MODEL_UNSET_LABEL = \"Ask each time\";\nconst PREWALK_THINKING_INHERIT_LABEL = \"Agents default\";\nconst PREWALK_MODES = [\"in-place\", \"trajectory\"] as const;\nconst ROOT_ITEM_IDS = [\n \"fullCodeMode\",\n \"executor\",\n \"schema\",\n \"approvals\",\n \"mcp\",\n \"prewalk\",\n \"agents\",\n \"capture\",\n \"ui\",\n \"compaction\",\n \"retention\",\n \"mesh\",\n \"codePreview\",\n] as const;\nconst RELOAD_SECTIONS = new Set([\"mesh\", \"agents\", \"mcp\", \"retention\"]);\nconst SAVE_SCOPE_SHORTCUT = Key.ctrl(\"g\");\n\nconst unique = (values: readonly string[]): string[] => [...new Set(values)];\n\ntype SettingsSubmenu = (currentValue: string, done: (selectedValue?: string) => void) => Component;\n\nconst settingsListTheme = (theme: Theme): SettingsListTheme => ({\n label: (text, selected) => (selected ? theme.fg(\"accent\", text) : text),\n value: (text, selected) => (selected ? theme.fg(\"accent\", text) : theme.fg(\"muted\", text)),\n description: (text) => theme.fg(\"dim\", text),\n cursor: theme.fg(\"accent\", \"\u2192 \"),\n hint: (text) => theme.fg(\"dim\", text),\n});\n\nconst selectListTheme = (theme: Theme): SelectListTheme => ({\n selectedPrefix: (text) => theme.fg(\"accent\", text),\n selectedText: (text) => theme.fg(\"accent\", text),\n description: (text) => theme.fg(\"muted\", text),\n scrollInfo: (text) => theme.fg(\"muted\", text),\n noMatch: (text) => theme.fg(\"muted\", text),\n symbols: ompSymbolTheme,\n});\n\nconst formatDebounce = (ms: number): string =>\n ms === 0 ? \"Off\" : ms < 1_000 ? `${ms}ms` : `${ms / 1_000}s`;\n\nconst formatMs = (ms: number): string =>\n ms < 1_000\n ? `${ms}ms`\n : ms < 60_000\n ? `${ms / 1_000}s`\n : ms < 3_600_000\n ? `${ms / 60_000}m`\n : `${ms / 3_600_000}h`;\n\nconst formatRetention = (ms: number): string =>\n ms >= 24 * 60 * 60 * 1_000 && ms % (24 * 60 * 60 * 1_000) === 0\n ? `${ms / (24 * 60 * 60 * 1_000)}d`\n : formatMs(ms);\n\nconst formatBytes = (bytes: number): string =>\n bytes >= 1024 * 1024 * 1024\n ? `${Number((bytes / (1024 * 1024 * 1024)).toFixed(2))} GB`\n : bytes >= 1024 * 1024\n ? `${Number((bytes / (1024 * 1024)).toFixed(2))} MB`\n : `${Number((bytes / 1024).toFixed(2))} KB`;\n\nexport const executorMemoryLimitOptions = (\n maximumBytes = QUICKJS_MAX_MEMORY_LIMIT_BYTES,\n): number[] => {\n const minimumBytes = 16 * 1024 * 1024;\n const values: number[] = [];\n for (let value = minimumBytes; value <= maximumBytes; value *= 2) values.push(value);\n if (maximumBytes >= minimumBytes && values.at(-1) !== maximumBytes) values.push(maximumBytes);\n return values;\n};\n\nconst formatUsd = (value: number): string =>\n value <= 0 ? \"Off\" : `$${value.toFixed(2)}`;\n\nconst formatTokens = (value: number): string =>\n value <= 0\n ? \"Off\"\n : value >= 1_000_000\n ? `${value / 1_000_000}M`\n : value >= 1_000\n ? `${value / 1_000}k`\n : String(value);\n\nconst formatToolCount = (count: number): string =>\n `${count} ${count === 1 ? \"tool\" : \"tools\"}`;\n\n// The threshold row is a mode selection: OMP default, a window-occupancy\n// percent, or an exact token count. mode: \"default\" clears both maps so OMP's\n// built-in threshold applies.\nexport type CompactionThresholdSelection =\n | { mode: \"default\" }\n | { mode: \"percent\"; value: number }\n | { mode: \"tokens\"; value: number };\n\nconst formatCompactionThreshold = (\n config: FabricConfig,\n modelKey: string,\n): string => {\n const tokens = config.compaction.tokenThresholds[modelKey];\n if (tokens !== undefined) return `${formatTokens(tokens)} tokens`;\n const ratio = config.compaction.thresholds[modelKey];\n return ratio === undefined\n ? COMPACTION_DEFAULT_THRESHOLD_LABEL\n : `${Math.round(ratio * 100)}%`;\n};\n\nexport const compactionThresholdPartial = (\n modelKey: string,\n selection: CompactionThresholdSelection,\n): Record<string, unknown> => ({\n compaction: {\n thresholds: { [modelKey]: selection.mode === \"percent\" ? selection.value : null },\n tokenThresholds: { [modelKey]: selection.mode === \"tokens\" ? selection.value : null },\n },\n});\n\nconst numericOptions = (\n values: readonly number[],\n format: (value: number) => string,\n currentValue: string,\n): SelectItem[] => {\n const options: SelectItem[] = values.map((value) => ({\n value: String(value),\n label: format(value),\n }));\n if (!options.some((option) => option.value === currentValue || option.label === currentValue)) {\n options.unshift({ value: currentValue, label: currentValue });\n }\n return options;\n};\n\nconst getPath = (config: FabricConfig, id: string): unknown => {\n const segments = id.split(\".\");\n let current: unknown = config;\n for (const segment of segments) {\n if (typeof current !== \"object\" || current === null) return undefined;\n current = (current as Record<string, unknown>)[segment];\n }\n return current;\n};\n\nexport const parseBudgetValue = (value: string): number => {\n if (value === \"Off\") return 0;\n const digits = Number.parseFloat(value.replace(/[^0-9.]/g, \"\"));\n return Number.isFinite(digits) ? digits : 0;\n};\n\nexport const parseFormattedNumericValue = (value: string): number => {\n const normalized = value.trim();\n if (normalized === \"Off\") return 0;\n if (normalized.startsWith(\"$\")) return parseBudgetValue(normalized);\n\n const bytes = normalized.match(/^([0-9]+(?:\\.[0-9]+)?) (KB|MB|GB)$/);\n if (bytes) {\n const amount = Number(bytes[1]);\n const units = { KB: 1024, MB: 1024 ** 2, GB: 1024 ** 3 } as const;\n return Math.round(amount * units[bytes[2] as keyof typeof units]);\n }\n\n const duration = normalized.match(/^([0-9]+(?:\\.[0-9]+)?)(ms|s|m|h|d)$/);\n if (duration) {\n const amount = Number(duration[1]);\n const units = { ms: 1, s: 1_000, m: 60_000, h: 3_600_000, d: 86_400_000 } as const;\n return Math.round(amount * units[duration[2] as keyof typeof units]);\n }\n\n const tokens = normalized.match(/^([0-9]+(?:\\.[0-9]+)?)(k|M)$/);\n if (tokens) return Math.round(Number(tokens[1]) * (tokens[2] === \"M\" ? 1_000_000 : 1_000));\n return Number(normalized.replaceAll(\",\", \"\"));\n};\n\nconst coerceValue = (id: string, value: string, config: FabricConfig): unknown => {\n if (id === COMPACTION_THRESHOLD_SETTING_ID) {\n if (value === COMPACTION_DEFAULT_THRESHOLD_LABEL) return { mode: \"default\" };\n const tokens = /^(.+?) tokens$/.exec(value);\n if (tokens?.[1] !== undefined) {\n return {\n mode: \"tokens\",\n value: clampCompactionTokenThreshold(parseFormattedNumericValue(tokens[1])),\n };\n }\n return { mode: \"percent\", value: Number(value.replace(\"%\", \"\")) / 100 };\n }\n if (id === CODE_PREVIEW_EDIT_LINES_ID) {\n if (value === CODE_PREVIEW_ALL_LINES || value === \"all\") return \"all\";\n const parsed = Number.parseInt(value, 10);\n if (Number.isFinite(parsed) && parsed > 0) return parsed;\n const current = getPath(config, id);\n return typeof current === \"number\" ? current : 160;\n }\n const current = getPath(config, id);\n // prewalk.enabled is enabled by default and omitted from normalized\n // configs unless false, so its control still needs an explicit boolean type.\n if (typeof current === \"boolean\" || id === \"prewalk.enabled\") return value === \"true\";\n if (typeof current === \"number\") return parseFormattedNumericValue(value);\n // The model picker stores the canonical \"provider/id\" string, or \"Inherit\"\n // for no override; persist an empty string so normalizeFabricConfig drops it.\n // Agents inherit; prewalk asks interactively when it is armed.\n if (\n id === \"approvals.model\" ||\n id === \"prewalk.model\" ||\n id === \"agents.model\" ||\n id === \"agents.claude.model\" ||\n id === \"agents.veda.model\" ||\n id === \"compaction.summaryModel\"\n ) {\n return value === INHERIT_VALUE || value === PREWALK_MODEL_UNSET_LABEL ? \"\" : value;\n }\n if (id === \"prewalk.thinking\" && value === PREWALK_THINKING_INHERIT_LABEL) return \"\";\n if (id === \"agents.thinking\" || id === \"prewalk.thinking\") {\n return THINKING_LEVELS.find((level) => thinkingLabel(level) === value) ?? value;\n }\n return value;\n};\n\nconst buildPartial = (id: string, value: unknown): Record<string, unknown> => {\n const segments = id.split(\".\");\n const root: Record<string, unknown> = {};\n let current: Record<string, unknown> = root;\n for (let index = 0; index < segments.length - 1; index++) {\n const segment = segments[index];\n if (segment === undefined) break;\n const next: Record<string, unknown> = {};\n current[segment] = next;\n current = next;\n }\n const last = segments[segments.length - 1];\n if (last !== undefined) current[last] = value;\n return root;\n};\n\nconst summaryFor = (id: string, config: FabricConfig): string => {\n switch (id) {\n case \"fullCodeMode\":\n return config.fullCodeMode ? \"true\" : \"false\";\n case \"executor\": {\n const refFloors = Object.keys(config.executor.hostCallTimeouts).length;\n return `${config.executor.runtime} \u00B7 ${formatMs(config.executor.timeoutMs)} \u00B7 max ${formatMs(config.executor.maxTimeoutMs)}${refFloors > 0 ? ` \u00B7 ${refFloors} ref floor${refFloors === 1 ? \"\" : \"s\"}` : \"\"}`;\n }\n case \"schema\":\n return config.schema.mode;\n case \"approvals\":\n return config.approvals.execute;\n case \"mcp\":\n return config.mcp.enabled ? \"enabled\" : \"disabled\";\n case \"prewalk\":\n return `${config.prewalk.enabled === false ? \"off \u00B7 \" : \"\"}${config.prewalk.mode} \u00B7 ${config.prewalk.model || PREWALK_MODEL_UNSET_LABEL}${config.prewalk.thinking ? ` \u00B7 ${thinkingLabel(config.prewalk.thinking)}` : \"\"}${config.prewalk.alwaysRearm ? \" \u00B7 repeat\" : \"\"}`;\n case \"codemap\":\n return config.codemap.enabled\n ? `${config.codemap.defaultMaxTokens} tok \u00B7 ${formatMs(config.codemap.maxMs)}`\n : \"disabled\";\n case \"agents\":\n return `${config.agents.runner}/${config.agents.transport}`;\n case \"capture\":\n return config.capture.enabled ? \"enabled\" : \"disabled\";\n case \"ui\":\n return config.ui.widget;\n case \"compaction\":\n return config.compaction.engine;\n case \"retention\":\n return `${formatRetention(config.retention.orphanedTempRunMs)} \u00B7 ${formatRetention(config.retention.oneShotRunMs)} \u00B7 ${formatRetention(config.retention.actorRunArchiveMs)}`;\n case \"mesh\":\n return config.mesh.enabled ? \"enabled\" : \"disabled\";\n case \"codePreview\":\n return config.codePreview.shikiTheme;\n default:\n return \"\";\n }\n};\n\nconst setting = (\n id: string,\n label: string,\n currentValue: string,\n rest: {\n description?: string;\n values?: readonly string[];\n submenu?: SettingsSubmenu;\n } = {},\n): SettingItem => {\n const item: SettingItem = { id, label, currentValue };\n if (rest.description !== undefined) item.description = rest.description;\n if (rest.values !== undefined) item.values = [...rest.values];\n if (rest.submenu !== undefined) item.submenu = rest.submenu;\n return item;\n};\n\nconst numericSubmenu = (\n theme: Theme,\n values: readonly number[],\n format: (value: number) => string,\n title: string,\n description: string,\n): SettingsSubmenu => (currentValue, done) => {\n const options = numericOptions(values, format, currentValue);\n const selectedValue =\n options.find((option) => option.value === currentValue || option.label === currentValue)?.value ??\n currentValue;\n return new SelectSubmenu(\n theme,\n title,\n description,\n options,\n selectedValue,\n (value) => done(options.find((option) => option.value === value)?.label ?? value),\n () => done(),\n );\n};\n\nconst nonNegativeIntegerSubmenu = (\n theme: Theme,\n title: string,\n description: string,\n): SettingsSubmenu => (currentValue, done) =>\n new IntegerInputSubmenu(theme, title, description, currentValue, done, () => done());\n\nconst stringInputSubmenu = (\n theme: Theme,\n title: string,\n description: string,\n): SettingsSubmenu => (currentValue, done) =>\n new StringInputSubmenu(theme, title, description, currentValue, done, () => done());\n\nconst compactionThresholdSubmenu = (theme: Theme): SettingsSubmenu => (currentValue, done) =>\n new CompactionThresholdSubmenu(theme, currentValue, done);\n\nconst stringOptionsSubmenu = (\n theme: Theme,\n values: readonly string[],\n title: string,\n description: string,\n): SettingsSubmenu => (currentValue, done) => {\n const options = values.map((value) => ({ value, label: value }));\n if (!options.some((option) => option.value === currentValue)) {\n options.unshift({ value: currentValue, label: currentValue });\n }\n const selectedValue =\n options.find((option) => option.value === currentValue || option.label === currentValue)\n ?.value ?? currentValue;\n return new SelectSubmenu(\n theme,\n title,\n description,\n options,\n selectedValue,\n (value) => done(value),\n () => done(),\n );\n};\n\nconst listSubmenu = (\n theme: Theme,\n id: string,\n title: string,\n description: string,\n candidates: readonly string[],\n currentList: readonly string[],\n onCommit: (selected: string[]) => void,\n): SettingsSubmenu => {\n const prefix = `${id}.`;\n return (_currentValue, done) => {\n const items = unique([...candidates, ...currentList]).map((name) =>\n setting(`${id}.${name}`, name, currentList.includes(name) ? \"true\" : \"false\", {\n description: `Toggle ${name}.`,\n values: BOOLEANS,\n }),\n );\n const onChange = (_itemId: string, _newValue: string): void => {\n const selected = items\n .filter((item) => item.currentValue === \"true\")\n .map((item) => item.id.slice(prefix.length));\n onCommit(selected);\n };\n return new SectionSubmenu(theme, title, description, items, onChange, () => done(), true);\n };\n};\n\n// Append a \u203A to the label of every item that opens a submenu, so it is\n// obvious which rows drill in (vs. inline value cycling). Mutates in place to\n// preserve the shared item references that listSubmenu updates live.\nconst markDrillIn = (items: SettingItem[]): SettingItem[] => {\n for (const item of items) {\n if (item.submenu && !item.label.endsWith(\"\u203A\")) item.label = `${item.label} \u203A`;\n }\n return items;\n};\n\nconst sectionSubmenu = (\n theme: Theme,\n title: string,\n description: string,\n items: SettingItem[],\n persist: (id: string, value: string) => void,\n): SettingsSubmenu => (_currentValue, done) =>\n // Match the root page: sections get type-to-search filtering too.\n new SectionSubmenu(theme, title, description, markDrillIn(items), persist, () => done(), true);\n\nclass IntegerInputSubmenu extends Container {\n readonly input: Input;\n private readonly validationText: Text;\n\n constructor(\n theme: Theme,\n title: string,\n description: string,\n currentValue: string,\n onSelect: (value: string) => void,\n onCancel: () => void,\n ) {\n super();\n this.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n this.addChild(new Spacer(1));\n\n this.input = new Input();\n this.input.handleInput(currentValue);\n this.input.focused = true;\n this.validationText = new Text(\"\", 0, 0);\n this.input.onSubmit = (value) => {\n const normalized = value.trim();\n const parsed = /^\\d+$/.test(normalized) ? Number(normalized) : Number.NaN;\n if (!Number.isSafeInteger(parsed) || parsed < 0) {\n this.validationText.setText(\n theme.fg(\"error\", \"Enter a non-negative safe integer.\"),\n );\n return;\n }\n onSelect(String(parsed));\n };\n this.input.onEscape = onCancel;\n this.addChild(this.input);\n this.addChild(this.validationText);\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"dim\", \" Enter to save \u00B7 Esc to go back\"), 0, 0));\n }\n\n handleInput(data: string): void {\n this.validationText.setText(\"\");\n this.input.handleInput(data);\n }\n\n render(width: number): readonly string[] {\n this.input.focused = true;\n return super.render(width);\n }\n\n submitRpc(value: string): void {\n this.input.setValue(value);\n this.input.handleInput(\"\\r\");\n }\n}\n\nclass StringInputSubmenu extends Container {\n readonly input: Input;\n\n constructor(\n theme: Theme,\n title: string,\n description: string,\n currentValue: string,\n onSelect: (value: string) => void,\n onCancel: () => void,\n ) {\n super();\n this.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n this.addChild(new Spacer(1));\n\n this.input = new Input();\n this.input.handleInput(currentValue);\n this.input.focused = true;\n this.input.onSubmit = (value) => onSelect(value.trim());\n this.input.onEscape = onCancel;\n this.addChild(this.input);\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"dim\", \" Enter to save \u00B7 Esc to go back\"), 0, 0));\n }\n\n handleInput(data: string): void {\n this.input.handleInput(data);\n }\n\n render(width: number): readonly string[] {\n this.input.focused = true;\n return super.render(width);\n }\n\n submitRpc(value: string): void {\n this.input.setValue(value);\n this.input.handleInput(\"\\r\");\n }\n}\n\nclass SelectSubmenu extends Container {\n readonly selectList: SelectList;\n readonly options: SelectItem[];\n\n constructor(\n theme: Theme,\n title: string,\n description: string | undefined,\n options: SelectItem[],\n currentValue: string,\n onSelect: (value: string) => void,\n onCancel: () => void,\n ) {\n super();\n this.options = options;\n this.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n if (description) {\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n }\n this.addChild(new Spacer(1));\n this.selectList = new SelectList(\n options,\n Math.min(options.length, 10),\n selectListTheme(theme),\n SUBMENU_LAYOUT,\n );\n const index = options.findIndex((option) => option.value === currentValue);\n if (index !== -1) this.selectList.setSelectedIndex(index);\n this.selectList.onSelect = (item) => onSelect(item.value);\n this.selectList.onCancel = onCancel;\n this.addChild(this.selectList);\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"dim\", \" Enter to select \u00B7 Esc to go back\"), 0, 0));\n }\n\n handleInput(data: string): void {\n this.selectList.handleInput(data);\n }\n\n selectRpc(value: string): boolean {\n const option = this.options.find((candidate) => candidate.value === value);\n if (!option) return false;\n this.selectList.onSelect?.(option);\n return true;\n }\n}\n\n// Three-phase threshold picker: the root select offers OMP default plus\n// custom percent / token drill-ins; each drill-in swaps in an integer input\n// and Esc returns to the root select instead of closing the submenu.\nclass CompactionThresholdSubmenu extends Container {\n selectList: SelectList | undefined;\n input: Input | undefined;\n private active!: Container & { handleInput(data: string): void };\n\n constructor(\n private readonly theme: Theme,\n private readonly currentValue: string,\n private readonly done: (selectedValue?: string) => void,\n ) {\n super();\n this.showSelect();\n }\n\n private swap(next: Container & { handleInput(data: string): void }): void {\n this.clear();\n this.addChild(next);\n this.active = next;\n }\n\n private showSelect(): void {\n const options: SelectItem[] = [\n { value: COMPACTION_DEFAULT_THRESHOLD_LABEL, label: COMPACTION_DEFAULT_THRESHOLD_LABEL },\n { value: COMPACTION_PERCENT_OPTION_LABEL, label: COMPACTION_PERCENT_OPTION_LABEL },\n { value: COMPACTION_TOKENS_OPTION_LABEL, label: COMPACTION_TOKENS_OPTION_LABEL },\n ];\n const select = new SelectSubmenu(\n this.theme,\n \"Compaction threshold\",\n \"Percent of the context window that triggers compaction, or an exact token count, entered via the custom options.\",\n options,\n this.currentValue,\n (value) => {\n if (value === COMPACTION_PERCENT_OPTION_LABEL) this.showPercent();\n else if (value === COMPACTION_TOKENS_OPTION_LABEL) this.showTokens();\n else this.done(value);\n },\n () => this.done(),\n );\n this.selectList = select.selectList;\n this.input = undefined;\n this.swap(select);\n }\n\n private showPercent(): void {\n const percent = /^(\\d+)%$/.exec(this.currentValue);\n const inputSubmenu = new IntegerInputSubmenu(\n this.theme,\n \"Compaction percent threshold\",\n `Compaction triggers once context usage reaches this percent of its window (${COMPACTION_PERCENT_MIN}\u2013${COMPACTION_PERCENT_MAX}).`,\n percent?.[1] ?? \"\",\n (value) => this.done(`${clampCompactionPercentThreshold(Number(value))}%`),\n () => this.showSelect(),\n );\n this.selectList = undefined;\n this.input = inputSubmenu.input;\n this.swap(inputSubmenu);\n }\n\n private showTokens(): void {\n const tokens = /^(.+?) tokens$/.exec(this.currentValue);\n const prefilled = tokens?.[1] === undefined\n ? \"\"\n : String(parseFormattedNumericValue(tokens[1]));\n const inputSubmenu = new IntegerInputSubmenu(\n this.theme,\n \"Compaction token threshold\",\n `Compaction triggers once context usage reaches this many tokens (${MIN_COMPACTION_TOKEN_THRESHOLD}\u2013${MAX_COMPACTION_TOKEN_THRESHOLD}).`,\n prefilled,\n (value) => this.done(`${formatTokens(clampCompactionTokenThreshold(Number(value)))} tokens`),\n () => this.showSelect(),\n );\n this.selectList = undefined;\n this.input = inputSubmenu.input;\n this.swap(inputSubmenu);\n }\n\n handleInput(data: string): void {\n this.active.handleInput(data);\n }\n\n completeRpc(selectedValue: string): void {\n this.done(selectedValue);\n }\n}\n\nconst thinkingSubmenu = (\n theme: Theme,\n overrides: {\n title?: string;\n description?: string;\n // Label of an extra first option that clears the override (persists \"\").\n inheritLabel?: string;\n } = {},\n): SettingsSubmenu => (currentValue, done) => {\n const canonicalCurrent =\n THINKING_LEVELS.find((level) => thinkingLabel(level) === currentValue) ?? currentValue;\n const options: SelectItem[] = THINKING_LEVELS.map((level) => ({\n value: level,\n label: thinkingLabel(level),\n }));\n if (overrides.inheritLabel) {\n options.unshift({ value: overrides.inheritLabel, label: overrides.inheritLabel });\n }\n if (!options.some((option) => option.value === canonicalCurrent)) {\n options.unshift({ value: canonicalCurrent, label: currentValue });\n }\n return new SelectSubmenu(\n theme,\n overrides.title ?? \"Default thinking\",\n overrides.description ??\n \"Reasoning effort forwarded to spawned agents and actors when a call does not specify one. The level is clamped to each model's supported levels (next highest if unsupported).\",\n options,\n canonicalCurrent,\n (value) => done(options.find((option) => option.value === value)?.label ?? value),\n () => done(),\n );\n};\n\nconst modelPickerSubmenu = (\n theme: Theme,\n source: ModelSource,\n options: {\n headerText?: string;\n inheritLabel?: string;\n inheritName?: string;\n } = {},\n): SettingsSubmenu => (currentValue, done) => {\n const canonicalCurrent =\n options.inheritLabel && currentValue === options.inheritLabel\n ? INHERIT_VALUE\n : currentValue;\n return new FabricModelSelector({\n theme,\n source,\n currentValue: canonicalCurrent,\n onSelect: (value) =>\n done(\n value === INHERIT_VALUE && options.inheritLabel\n ? options.inheritLabel\n : value,\n ),\n onCancel: () => done(),\n ...(options.headerText ? { headerText: options.headerText } : {}),\n ...(options.inheritLabel ? { inheritLabel: options.inheritLabel } : {}),\n ...(options.inheritName ? { inheritName: options.inheritName } : {}),\n });\n};\n\nclass SectionSubmenu extends Container {\n readonly settingsList: SettingsList;\n readonly items: SettingItem[];\n readonly applyChange: (id: string, newValue: string) => void;\n\n constructor(\n theme: Theme,\n title: string,\n description: string | undefined,\n items: SettingItem[],\n onChange: (id: string, newValue: string) => void,\n onCancel: () => void,\n enableSearch = false,\n ) {\n super();\n this.items = items;\n this.applyChange = onChange;\n this.addChild(new Text(theme.bold(theme.fg(\"accent\", title)), 0, 0));\n if (description) {\n this.addChild(new Spacer(1));\n this.addChild(new Text(theme.fg(\"muted\", description), 0, 0));\n }\n this.addChild(new Spacer(1));\n this.settingsList = new SettingsList(\n items,\n Math.min(items.length, 16),\n settingsListTheme(theme),\n onChange,\n onCancel,\n { typeToSearch: enableSearch },\n );\n this.addChild(this.settingsList);\n }\n\n handleInput(data: string): void {\n this.settingsList.handleInput(data);\n }\n}\n\nexport interface FabricSettingsComponentOptions {\n initialSaveScope?: FabricConfigScope;\n projectScopeAvailable?: boolean;\n onSaveScopeChange?: (scope: FabricConfigScope) => void;\n itemsForSaveScope?: (scope: FabricConfigScope) => SettingItem[];\n}\n\nexport class FabricSettingsComponent extends Container {\n settingsList: SettingsList;\n private readonly theme: Theme;\n private readonly saveScopeText: Text;\n private readonly settingsListContainer: Container;\n private readonly projectScopeAvailable: boolean;\n private readonly onChange: (id: string, newValue: string) => void;\n private readonly onCancel: () => void;\n private readonly onSaveScopeChange: (scope: FabricConfigScope) => void;\n private readonly itemsForSaveScope: ((scope: FabricConfigScope) => SettingItem[]) | undefined;\n private saveScope: FabricConfigScope;\n\n constructor(\n theme: Theme,\n items: SettingItem[],\n onChange: (id: string, newValue: string) => void,\n onCancel: () => void,\n options: FabricSettingsComponentOptions = {},\n ) {\n super();\n this.theme = theme;\n this.projectScopeAvailable = options.projectScopeAvailable ?? true;\n this.saveScope = options.initialSaveScope === \"project\" && this.projectScopeAvailable\n ? \"project\"\n : \"global\";\n this.onChange = onChange;\n this.onCancel = onCancel;\n this.onSaveScopeChange = options.onSaveScopeChange ?? (() => {});\n this.itemsForSaveScope = options.itemsForSaveScope;\n this.addChild(new DynamicBorder((text) => theme.fg(\"border\", text)));\n this.saveScopeText = new Text(\"\", 1, 0);\n this.updateSaveScopeText();\n this.addChild(this.saveScopeText);\n this.addChild(new Spacer(1));\n this.settingsListContainer = new Container();\n this.settingsList = this.createSettingsList(items);\n this.settingsListContainer.addChild(this.settingsList);\n this.addChild(this.settingsListContainer);\n this.addChild(new DynamicBorder((text) => theme.fg(\"border\", text)));\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, SAVE_SCOPE_SHORTCUT)) {\n if (!this.projectScopeAvailable) return;\n this.saveScope = this.saveScope === \"project\" ? \"global\" : \"project\";\n this.updateSaveScopeText();\n this.onSaveScopeChange(this.saveScope);\n const nextItems = this.itemsForSaveScope?.(this.saveScope);\n if (nextItems) {\n this.settingsListContainer.clear();\n this.settingsList = this.createSettingsList(nextItems);\n this.settingsListContainer.addChild(this.settingsList);\n }\n return;\n }\n this.settingsList.handleInput(data);\n }\n\n private createSettingsList(items: SettingItem[]): SettingsList {\n return new SettingsList(\n items,\n 10,\n settingsListTheme(this.theme),\n this.onChange,\n this.onCancel,\n { typeToSearch: true },\n );\n }\n\n private updateSaveScopeText(): void {\n const destination = this.saveScope === \"project\"\n ? \"Project overrides (.omp/fabric.json)\"\n : \"Global defaults (<active OMP agent dir>/fabric.json)\";\n const hint = !this.projectScopeAvailable\n ? \" \u00B7 project scope unavailable for untrusted projects\"\n : this.saveScope === \"global\"\n ? \" \u00B7 Ctrl+G switches scope \u00B7 project overrides may remain active here\"\n : \" \u00B7 Ctrl+G switches scope\";\n this.saveScopeText.setText(\n this.theme.fg(\"muted\", \"Editing: \") +\n this.theme.fg(\"accent\", destination) +\n this.theme.fg(\"dim\", hint),\n );\n }\n}\n\nexport const populateClaudeModelSource = async (\n source: ModelSource,\n load: () => Promise<Parameters<typeof buildClaudeModelSource>[0]>,\n): Promise<void> => {\n const loaded = buildClaudeModelSource(await load());\n source.models.splice(0, source.models.length, ...loaded.models);\n source.lastUsed = loaded.lastUsed;\n};\n\nexport const buildFabricSettingsItems = (\n theme: Theme,\n config: FabricConfig,\n apply: (id: string, value: unknown) => void,\n options: {\n keepVisibleCandidates: readonly string[];\n toolCandidates?: readonly string[];\n modelSource: ModelSource;\n claudeModelSource?: ModelSource;\n activeModelKey?: string;\n },\n): SettingItem[] => {\n const persist = (id: string, newValue: string): void =>\n apply(id, coerceValue(id, newValue, config));\n const envFullCode = process.env.OMP_FABRIC_FULL_CODE_MODE;\n const fullCodeDescription = envFullCode\n ? \"Fabric owns OMP core tools (read, bash, edit, write, grep, find, ls) via fabric_exec. Currently overridden by the OMP_FABRIC_FULL_CODE_MODE environment variable.\"\n : \"Fabric owns OMP core tools (read, bash, edit, write, grep, find, ls) via fabric_exec. Disable to keep native tools model-facing (orchestration-only mode).\";\n const executorMemoryDescription = (): string =>\n config.executor.runtime === \"quickjs\"\n ? \"Maximum QuickJS heap size. WASM32 limits this to less than 4 GiB.\"\n : config.executor.runtime === \"bun-process\"\n ? \"Heap target for the disposable Bun process. Bun ignores V8 heap flags, so this limit is not enforced.\"\n : \"V8 old-generation heap limit for the disposable Node process. Large allocations may destabilize the system.\";\n\n const defaultToolsItem = setting(\n \"agents.defaultTools\",\n \"Default tools\",\n formatToolCount(config.agents.defaultTools.length),\n { description: \"OMP core tools exposed to spawned agents by default.\" },\n );\n defaultToolsItem.submenu = listSubmenu(\n theme,\n \"agents.defaultTools\",\n \"Default tools\",\n \"OMP core tools exposed to spawned agents by default.\",\n CORE_DEFAULT_TOOL_CANDIDATES,\n config.agents.defaultTools,\n (selected) => {\n apply(\"agents.defaultTools\", selected);\n defaultToolsItem.currentValue = formatToolCount(selected.length);\n },\n );\n\n const keepVisibleItem = setting(\n \"capture.keepVisible\",\n \"Keep visible\",\n formatToolCount(config.capture.keepVisible.length),\n { description: \"Captured tool names that stay model-visible despite hideFromModel.\" },\n );\n keepVisibleItem.submenu = listSubmenu(\n theme,\n \"capture.keepVisible\",\n \"Keep visible\",\n \"Captured tool names that stay model-visible despite hideFromModel.\",\n options.keepVisibleCandidates,\n config.capture.keepVisible,\n (selected) => {\n apply(\"capture.keepVisible\", selected);\n keepVisibleItem.currentValue = formatToolCount(selected.length);\n },\n );\n const includeToolsItem = setting(\n \"capture.includeTools\",\n \"Include tools\",\n formatToolCount(config.capture.includeTools.length),\n { description: \"Explicitly keep registered tools visible; unavailable names are ignored.\" },\n );\n includeToolsItem.submenu = listSubmenu(\n theme,\n \"capture.includeTools\",\n \"Include tools\",\n \"Explicit include overrides capture hiding. Explicit excludes still win.\",\n options.toolCandidates ?? [],\n config.capture.includeTools,\n (selected) => {\n apply(\"capture.includeTools\", selected);\n includeToolsItem.currentValue = formatToolCount(selected.length);\n },\n );\n const excludeToolsItem = setting(\n \"capture.excludeTools\",\n \"Exclude tools\",\n formatToolCount(config.capture.excludeTools.length),\n { description: \"Hide selected registered tools from the model; excludes win over includes.\" },\n );\n excludeToolsItem.submenu = listSubmenu(\n theme,\n \"capture.excludeTools\",\n \"Exclude tools\",\n \"Explicit exclude wins when a tool appears in both lists.\",\n options.toolCandidates ?? [],\n config.capture.excludeTools,\n (selected) => {\n apply(\"capture.excludeTools\", selected);\n excludeToolsItem.currentValue = formatToolCount(selected.length);\n },\n );\n\n const items = [\n setting(\"fullCodeMode\", \"Full code mode\", config.fullCodeMode ? \"true\" : \"false\", {\n description: fullCodeDescription,\n values: BOOLEANS,\n }),\n setting(\"executor\", \"Executor\", summaryFor(\"executor\", config), {\n description: \"Runtime and resource limits for fabric_exec programs.\",\n submenu: sectionSubmenu(\n theme,\n \"Executor\",\n \"Runtime and resource limits for fabric_exec programs.\",\n [\n setting(\"executor.runtime\", \"Runtime\", config.executor.runtime, {\n description:\n config.schema.mode === \"enforce\"\n ? \"Schema enforce mode requires the isolated QuickJS runtime.\"\n : \"QuickJS is isolated and limited by WASM32. Node/Bun processes support larger heaps but are an unsafe trusted-code escape hatch, not a security sandbox.\",\n values: config.schema.mode === \"enforce\" ? [\"quickjs\"] : EXECUTOR_RUNTIMES,\n }),\n setting(\"executor.timeoutMs\", \"Timeout\", formatMs(config.executor.timeoutMs), {\n description: `Default wall-clock time for a single fabric_exec program. A per-invocation timeoutMs or a matching executor.hostCallTimeouts ref can raise it up to the ${formatMs(config.executor.maxTimeoutMs)} policy maximum.`,\n submenu: numericSubmenu(\n theme,\n [15_000, 30_000, 60_000, 120_000, 300_000, 600_000],\n formatMs,\n \"Executor timeout\",\n `Default wall-clock time for a single fabric_exec program (policy max ${formatMs(config.executor.maxTimeoutMs)}).`,\n ),\n }),\n setting(\n \"executor.maxTimeoutMs\",\n \"Policy max\",\n formatMs(config.executor.maxTimeoutMs),\n {\n description:\n \"Ceiling for every executor deadline: per-invocation timeoutMs requests and executor.hostCallTimeouts ref floors are capped at this value. Values above it are normalized on load.\",\n submenu: numericSubmenu(\n theme,\n [300_000, 600_000, 900_000, 1_800_000, 3_600_000],\n formatMs,\n \"Executor policy maximum\",\n \"Ceiling for every executor deadline, including per-invocation requests and per-ref floors.\",\n ),\n },\n ),\n setting(\n \"executor.hostCallTimeouts\",\n \"Per-ref floors\",\n Object.keys(config.executor.hostCallTimeouts).length > 0\n ? Object.keys(config.executor.hostCallTimeouts)\n .map((ref) => `${ref}=${formatMs(config.executor.hostCallTimeouts[ref] ?? 0)}`)\n .join(\", \")\n : \"none\",\n {\n description:\n \"Exact-ref deadline floors for known long-running host calls (configured in the Fabric config file), e.g. \\\"extensions.subagent\\\": 3600000.\",\n },\n ),\n setting(\n \"executor.memoryLimitBytes\",\n \"Memory limit\",\n formatBytes(config.executor.memoryLimitBytes),\n {\n description: executorMemoryDescription(),\n submenu: (currentValue, done) =>\n numericSubmenu(\n theme,\n executorMemoryLimitOptions(maxExecutorMemoryLimitBytes(config.executor.runtime)),\n formatBytes,\n \"Executor memory limit\",\n executorMemoryDescription(),\n )(currentValue, done),\n },\n ),\n setting(\"executor.maxOutputChars\", \"Max output chars\", config.executor.maxOutputChars.toLocaleString(), {\n description: \"Character cap applied to the final fabric_exec return value shown to the model.\",\n submenu: numericSubmenu(\n theme,\n [20_000, 50_000, 100_000, 200_000, 500_000],\n (n) => n.toLocaleString(),\n \"Max output chars\",\n \"Character cap applied to the final fabric_exec return value shown to the model.\",\n ),\n }),\n setting(\"executor.resultFormat\", \"Result format\", config.executor.resultFormat, {\n description:\n \"Default formatting for fabric_exec return values. Auto renders structured values as syntax-highlighted YAML; each call can override this.\",\n values: RESULT_FORMATS,\n }),\n setting(\n \"executor.maxNestedResultChars\",\n \"Max nested result chars\",\n config.executor.maxNestedResultChars.toLocaleString(),\n {\n description: \"Character cap applied to results returned by nested tool calls inside the sandbox.\",\n submenu: numericSubmenu(\n theme,\n [500_000, 1_000_000, 2_000_000, 5_000_000, 10_000_000],\n (n) => n.toLocaleString(),\n \"Max nested result chars\",\n \"Character cap applied to results returned by nested tool calls inside the sandbox.\",\n ),\n },\n ),\n ],\n persist,\n ),\n }),\n setting(\"schema\", \"Schema\", summaryFor(\"schema\", config), {\n description: \"Typed evidence loop and local-file transaction channel. Enforcement is locked per session; mode changes take effect in the next session.\",\n submenu: sectionSubmenu(\n theme,\n \"Schema\",\n \"Typed evidence loop and local-file transaction channel. In enforce mode, protected-workspace mutations require schema.hypothesize \u2192 schema.verify \u2192 schema.commit inside one fabric_exec call.\",\n [\n setting(\"schema.mode\", \"Mode\", config.schema.mode, {\n description:\n \"off (default) leaves the control plane ungated. audit records would_block events for actions enforce would deny. enforce admits only the schema transaction channel for protected-workspace changes and forces the QuickJS runtime. Takes effect in the next session.\",\n values: SCHEMA_MODES,\n }),\n setting(\"schema.certificateTtlMs\", \"Certificate TTL\", formatMs(config.schema.certificateTtlMs), {\n description: \"How long a schema.verify certificate stays valid. Clamped to 1s\u201310min.\",\n submenu: numericSubmenu(\n theme,\n [1_000, 5_000, 10_000, 30_000, 60_000, 120_000, 300_000, 600_000],\n formatMs,\n \"Certificate TTL\",\n \"How long a schema.verify certificate stays valid. Clamped to 1s\u201310min.\",\n ),\n }),\n setting(\"schema.maxFiles\", \"Max files\", String(config.schema.maxFiles), {\n description: \"Maximum files in one schema.commit transaction. Clamped to 1\u20131000.\",\n submenu: numericSubmenu(\n theme,\n [1, 5, 10, 25, 50, 100, 250, 500, 1000],\n (n) => String(n),\n \"Max files\",\n \"Maximum files in one schema.commit transaction. Clamped to 1\u20131000.\",\n ),\n }),\n setting(\"schema.maxBytes\", \"Max bytes\", formatBytes(config.schema.maxBytes), {\n description: \"Maximum total bytes written by one schema.commit transaction. Clamped to 1 KiB\u2013100 MiB.\",\n submenu: numericSubmenu(\n theme,\n [1_048_576, 5_242_880, 10_485_760, 52_428_800, 104_857_600],\n formatBytes,\n \"Max bytes\",\n \"Maximum total bytes written by one schema.commit transaction. Clamped to 1 KiB\u2013100 MiB.\",\n ),\n }),\n ],\n persist,\n ),\n }),\n setting(\"approvals\", \"Approvals\", summaryFor(\"approvals\", config), {\n description: \"Per-action approval policy for Fabric and model-requested native tool calls.\",\n submenu: sectionSubmenu(\n theme,\n \"Approvals\",\n \"Approval policy for Fabric and model-requested native tool calls. Auto routes each call through a dedicated safety classifier and escalates uncertain actions to you.\",\n [\n setting(\"approvals.model\", \"Auto model\", config.approvals.model || INHERIT_VALUE, {\n description:\n \"OMP model used as the auto-mode safety classifier. Inherit uses the active session model. The classifier has no executable tools and returns a structured allow-or-escalate verdict.\",\n submenu: modelPickerSubmenu(\n theme,\n options.modelSource,\n {\n headerText:\n \"Safety classifier for auto approval policies. Pick Inherit to use the active OMP session model.\",\n inheritName: \"Use the active OMP session model\",\n },\n ),\n }),\n setting(\"approvals.read\", \"Read\", config.approvals.read, {\n description: \"Approval policy for read operations. Read is normally safe to leave allowed.\",\n values: APPROVAL_MODES,\n }),\n setting(\"approvals.write\", \"Write\", config.approvals.write, {\n description: \"Approval policy for write and edit operations. Auto classifies each call.\",\n values: APPROVAL_MODES,\n }),\n setting(\"approvals.execute\", \"Execute\", config.approvals.execute, {\n description: \"Approval policy for shell execution. Auto classifies each command.\",\n values: APPROVAL_MODES,\n }),\n setting(\"approvals.network\", \"Network\", config.approvals.network, {\n description: \"Approval policy for network operations. Auto classifies each destination and payload.\",\n values: APPROVAL_MODES,\n }),\n setting(\"approvals.agent\", \"Agent\", config.approvals.agent, {\n description: \"Approval policy for agent and actor operations. Auto classifies each request.\",\n values: APPROVAL_MODES,\n }),\n ],\n persist,\n ),\n }),\n setting(\"mcp\", \"MCP\", summaryFor(\"mcp\", config), {\n description: \"Model Context Protocol provider discovery and invocation.\",\n submenu: sectionSubmenu(\n theme,\n \"MCP\",\n \"Model Context Protocol provider discovery and invocation.\",\n [\n setting(\"mcp.enabled\", \"Enabled\", config.mcp.enabled ? \"true\" : \"false\", {\n description: \"Enable the MCP provider inside fabric_exec.\",\n values: BOOLEANS,\n }),\n setting(\"mcp.disableOAuth\", \"Disable OAuth\", config.mcp.disableOAuth ? \"true\" : \"false\", {\n description: \"Skip MCP OAuth flows.\",\n values: BOOLEANS,\n }),\n setting(\"mcp.allowDynamicServers\", \"Dynamic servers\", config.mcp.allowDynamicServers ? \"true\" : \"false\", {\n description: \"Allow servers to be added at runtime via the MCP protocol.\",\n values: BOOLEANS,\n }),\n setting(\"mcp.callTimeoutMs\", \"Call timeout\", formatMs(config.mcp.callTimeoutMs), {\n description: \"Timeout for individual MCP tool calls.\",\n submenu: numericSubmenu(\n theme,\n [15_000, 30_000, 60_000, 120_000, 300_000],\n formatMs,\n \"MCP call timeout\",\n \"Timeout for individual MCP tool calls.\",\n ),\n }),\n setting(\"mcp.cache.enabled\", \"Descriptor cache\", config.mcp.cache.enabled ? \"true\" : \"false\", {\n description: \"Cache MCP tool metadata across sessions keyed by mcporter config; discovery no longer spawns every server.\",\n values: BOOLEANS,\n }),\n setting(\"mcp.cache.revalidate\", \"Revalidate on start\", config.mcp.cache.revalidate, {\n description: \"Background re-listing at session start: changed servers only, all servers, or off.\",\n values: [\"changed\", \"all\", \"off\"],\n }),\n setting(\"mcp.cache.revalidateBudgetMs\", \"Revalidate budget\", formatMs(config.mcp.cache.revalidateBudgetMs), {\n description: \"Wall-clock budget for the session-start background MCP revalidation.\",\n submenu: numericSubmenu(\n theme,\n [15_000, 30_000, 60_000, 120_000, 300_000],\n formatMs,\n \"MCP revalidate budget\",\n \"Wall-clock budget for the session-start background MCP revalidation.\",\n ),\n }),\n ],\n persist,\n ),\n }),\n setting(\"prewalk\", \"Prewalk\", summaryFor(\"prewalk\", config), {\n description: \"Continue Main in place or opt into a child trajectory handoff at the completed fabric_exec boundary.\",\n submenu: sectionSubmenu(\n theme,\n \"Prewalk\",\n \"Automatic continuation at the completed outer fabric_exec boundary.\",\n [\n setting(\"prewalk.enabled\", \"Enabled\", config.prewalk.enabled === false ? \"false\" : \"true\", {\n description:\n \"Master switch for prewalk. When off, manual arming, session auto-arm, and boundary claims are all inert until re-enabled. Same effect as /fabric prewalk --disable and --enable; a live arm is cancelled on disable.\",\n values: BOOLEANS,\n }),\n setting(\"prewalk.mode\", \"Mode\", config.prewalk.mode, {\n description:\n \"In-place temporarily switches Main to the executor, queues a hidden continuation, then returns to Main's previous model. Trajectory moves the session snapshot to a visible child executor, then queues a hidden verify-and-summarize continuation for Main when it finishes.\",\n values: PREWALK_MODES,\n }),\n setting(\n \"prewalk.alwaysRearm\",\n \"Always re-arm\",\n config.prewalk.alwaysRearm ? \"true\" : \"false\",\n {\n description:\n \"Arm prewalk automatically at every session start and again after each completed handoff until /fabric prewalk --off cancels it for the session. Auto-arm needs prewalk.model (provider/model). Read-only turns never disarm prewalk.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"prewalk.detectShellWrites\",\n \"Detect shell writes\",\n config.prewalk.detectShellWrites ? \"true\" : \"false\",\n {\n description:\n \"Filesystem fallback trigger: when an armed task ran a successful omp.bash in fabric_exec without an audited omp.edit / omp.write / schema.commit, claim the handoff if file stats drifted from baseline, so shell heredocs, sed -i, or formatter-binary writes also reach the executor.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"prewalk.compactOnReturn\",\n \"Compact on return\",\n config.prewalk.compactOnReturn ? \"true\" : \"false\",\n {\n description:\n \"After an in-place continuation settles, compact the session with the configured compaction engine just before Main's boundary model is restored, so Main re-ingests a compacted transcript rather than the executor's full scratch work.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"prewalk.handoffRetirement\",\n \"Retire planning reads\",\n config.prewalk.handoffRetirement ? \"true\" : \"false\",\n {\n description:\n \"Once the executor handoff is live, replace the planner's stale successful read / grep / find / ls results with a compact marker naming the tool and target, so the executor does not re-ingest exploration it will not use. Failed results, mutating tools, user messages, and the most recent reads are never retired.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"prewalk.handoffRetirementKeep\",\n \"Keep recent reads\",\n String(config.prewalk.handoffRetirementKeep),\n {\n description:\n \"How many of the most recent read-only results stay untouched when retiring, so the executor still sees what the planner just looked at.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Keep recent reads\",\n \"Most-recent read-only results never retired. Enter any integer from 0 to 64.\",\n ),\n },\n ),\n setting(\n \"prewalk.thinking\",\n \"Thinking\",\n config.prewalk.thinking\n ? thinkingLabel(config.prewalk.thinking)\n : PREWALK_THINKING_INHERIT_LABEL,\n {\n description:\n \"Reasoning effort for the trajectory child executor. Agents default inherits Agents \u203A Default thinking; in-place keeps Main's session level. The level is clamped to each model's supported levels.\",\n submenu: thinkingSubmenu(theme, {\n title: \"Prewalk thinking\",\n description:\n \"Reasoning effort for the trajectory child executor. Agents default uses the Agents section's Default thinking; in-place keeps Main's session level. Clamped to each model's supported levels (next highest if unsupported).\",\n inheritLabel: PREWALK_THINKING_INHERIT_LABEL,\n }),\n },\n ),\n setting(\n \"prewalk.model\",\n \"Executor model\",\n config.prewalk.model || PREWALK_MODEL_UNSET_LABEL,\n {\n description:\n \"OMP provider/model used by /fabric prewalk. In-place selects it for Main; trajectory uses it for the child executor. Ask each time is interactive only.\",\n submenu: modelPickerSubmenu(\n theme,\n options.modelSource,\n {\n headerText:\n \"Executor model for automatic /fabric prewalk continuation. Pick Ask each time to open the model picker for every prewalk.\",\n inheritLabel: PREWALK_MODEL_UNSET_LABEL,\n inheritName: \"Open the model picker whenever prewalk is armed\",\n },\n ),\n },\n ),\n ],\n persist,\n ),\n }),\n setting(\"codemap\", \"Code map\", summaryFor(\"codemap\", config), {\n description: \"Structural repo map and git co-change ranking under an explicit token budget.\",\n submenu: sectionSubmenu(\n theme,\n \"Code map\",\n \"Symbol index and co-change ranking exposed to fabric_exec as codemap.*.\",\n [\n setting(\"codemap.enabled\", \"Enabled\", config.codemap.enabled ? \"true\" : \"false\", {\n description:\n \"Expose codemap.map and codemap.cascade inside fabric_exec. The index is built with the host's native ast-grep binding and cached per workspace root.\",\n values: BOOLEANS,\n }),\n setting(\n \"codemap.defaultMaxTokens\",\n \"Default budget\",\n String(config.codemap.defaultMaxTokens),\n {\n description:\n \"Token ceiling applied to codemap.map when the call does not pass maxTokens. The map is ranked before the budget is spent, so a small ceiling still returns the most relevant files.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Code map budget\",\n \"Token ceiling for codemap.map when a call omits maxTokens. Enter any integer from 200 to 200000.\",\n ),\n },\n ),\n setting(\"codemap.maxFiles\", \"Max files\", String(config.codemap.maxFiles), {\n description: \"Upper bound on files enumerated for one index build.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Code map file ceiling\",\n \"Files enumerated for one index build. Enter any integer from 1 to 1000000.\",\n ),\n }),\n setting(\"codemap.maxSymbols\", \"Max symbols\", String(config.codemap.maxSymbols), {\n description: \"Upper bound on symbols retained for one index build.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Code map symbol ceiling\",\n \"Symbols retained for one index build. Enter any integer from 1 to 5000000.\",\n ),\n }),\n setting(\"codemap.maxMs\", \"Time budget\", formatMs(config.codemap.maxMs), {\n description:\n \"Wall-clock ceiling for one index build. A session directory that is not a project can otherwise crawl for minutes; when the budget bites the map returns what it has with truncated set.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Code map time budget\",\n \"Milliseconds allowed for one index build. Enter any integer from 1000 to 600000.\",\n ),\n }),\n setting(\n \"codemap.cascadeCommits\",\n \"Cascade history\",\n String(config.codemap.cascadeCommits),\n {\n description:\n \"How many recent commits codemap.cascade scans when ranking co-change. Merge commits and bulk commits are excluded so vendored or generated sweeps do not create false affinity.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Cascade history\",\n \"Commits scanned when ranking co-change. Enter any integer from 10 to 20000.\",\n ),\n },\n ),\n setting(\"codemap.cascadeLimit\", \"Cascade results\", String(config.codemap.cascadeLimit), {\n description: \"Maximum related files returned by codemap.cascade.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Cascade results\",\n \"Related files returned by codemap.cascade. Enter any integer from 1 to 200.\",\n ),\n }),\n ],\n persist,\n ),\n }),\n setting(\"agents\", \"Agents\", summaryFor(\"agents\", config), {\n description: \"One-shot child agents spawned from inside fabric_exec.\",\n submenu: sectionSubmenu(\n theme,\n \"Agents\",\n \"One-shot child agents spawned from inside fabric_exec.\",\n [\n setting(\"agents.enabled\", \"Enabled\", config.agents.enabled ? \"true\" : \"false\", {\n description: \"Enable agent spawning via workflow.agent() and agents.run().\",\n values: BOOLEANS,\n }),\n setting(\"agents.runner\", \"Default runner\", config.agents.runner, {\n description: \"Execution harness used when agents.run/create does not specify runner.\",\n values: RUNNERS,\n }),\n setting(\"agents.transport\", \"Transport\", config.agents.transport, {\n description: \"Preferred transport for spawned agents.\",\n values: TRANSPORTS,\n }),\n setting(\"agents.model\", \"Default model\", config.agents.model || INHERIT_VALUE, {\n description:\n \"Model forwarded to OMP-backed agents and actors when a call does not specify one. Pick Inherit to use the host session's default. Order matches pi-model-sort (most recently used first).\",\n submenu: modelPickerSubmenu(\n theme,\n options.modelSource,\n ),\n }),\n setting(\n \"agents.claude.model\",\n \"Claude model\",\n config.agents.claude.model || INHERIT_VALUE,\n {\n description:\n \"Claude Code model used by Claude-backed agents and actors. Models are enumerated from the installed claude runtime; Inherit uses Claude Code's default.\",\n submenu: modelPickerSubmenu(\n theme,\n options.claudeModelSource ?? { models: [], lastUsed: {} },\n {\n headerText:\n \"Default model for Claude-backed Fabric agents and actors. Pick Inherit to use Claude Code's runtime default.\",\n inheritName: \"Use Claude Code's runtime default model\",\n },\n ),\n },\n ),\n setting(\"agents.veda.backend\", \"Veda backend\", config.agents.veda.backend, {\n description:\n \"External backend driven by the Veda CLI: agy, codex, claude-code, droid, pi, or a backend registered by the installed Veda build.\",\n submenu: stringInputSubmenu(\n theme,\n \"Veda backend\",\n \"External CLI backend the Veda runner drives for agent runs.\",\n ),\n }),\n setting(\"agents.veda.persona\", \"Veda persona\", config.agents.veda.persona, {\n description:\n \"Veda persona: navigator-plan, navigator-chat, reviewer, worker, or a custom persona under ~/.config/veda/personas/<name>/AGENTS.md.\",\n submenu: stringInputSubmenu(\n theme,\n \"Veda persona\",\n \"Persona controlling the Veda agent's behavior. Leave as navigator-chat for the default.\",\n ),\n }),\n setting(\"agents.veda.model\", \"Veda model\", config.agents.veda.model || INHERIT_VALUE, {\n description:\n \"Default model forwarded to the Veda backend when a call does not specify one. Leave empty for the backend default.\",\n submenu: stringInputSubmenu(\n theme,\n \"Veda model\",\n \"Model or alias forwarded to the Veda backend. Empty uses the backend default.\",\n ),\n }),\n setting(\"agents.thinking\", \"Default thinking\", thinkingLabel(config.agents.thinking), {\n description:\n \"Reasoning effort forwarded to spawned agents and actors when a call does not specify one. Clamped to each model's supported levels (next highest if unsupported).\",\n submenu: thinkingSubmenu(theme),\n }),\n setting(\"agents.maxConcurrent\", \"Max concurrent\", String(config.agents.maxConcurrent), {\n description: \"Maximum number of agents that may run at the same time.\",\n submenu: numericSubmenu(\n theme,\n [1, 2, 4, 8, 16, 32],\n String,\n \"Agent concurrency\",\n \"Maximum number of agents that may run at the same time.\",\n ),\n }),\n setting(\"agents.maxPerExecution\", \"Max per execution\", String(config.agents.maxPerExecution), {\n description: \"Maximum number of agent calls allowed within a single fabric_exec program.\",\n submenu: numericSubmenu(\n theme,\n [10, 25, 50, 100, 200, 500],\n String,\n \"Agents per execution\",\n \"Maximum number of agent calls allowed within a single fabric_exec program.\",\n ),\n }),\n setting(\"agents.maxDepth\", \"Max depth\", String(config.agents.maxDepth), {\n description:\n \"Maximum nesting depth for child agent calls. Enter any non-negative integer; 0 disables child spawning.\",\n submenu: nonNegativeIntegerSubmenu(\n theme,\n \"Agent depth\",\n \"Maximum nesting depth for child agent calls. Enter any non-negative integer; 0 disables child spawning.\",\n ),\n }),\n setting(\"agents.budgetUsd\", \"Recursion budget\", formatUsd(config.agents.budgetUsd), {\n description:\n \"Maximum USD spend for agent work across the whole recursion tree. 0 disables the budget.\",\n submenu: numericSubmenu(\n theme,\n BUDGET_VALUES,\n formatUsd,\n \"Recursion budget\",\n \"Maximum USD spend for agent work across the whole recursion tree. 0 disables the budget.\",\n ),\n }),\n setting(\"agents.sessionExport\", \"Usage export\", config.agents.sessionExport ? \"true\" : \"false\", {\n description:\n \"Write usage-only OMP-format session files (tokens/cost, never transcript content) for every agent run so tokscale and ccusage can track Fabric subagents.\",\n values: BOOLEANS,\n }),\n setting(\"agents.sessionExportDir\", \"Usage export dir\", config.agents.sessionExportDir || \"<active OMP agent dir> (co-hosted, hidden .fabric namespace)\", {\n description:\n \"Root of the export store; sessions land under <dir>/sessions/.fabric/. Default reuses OMP's own agent dir (tokscale/ccusage count it with zero setup; OMP's resume picker never sees the hidden namespace). OMP_FABRIC_AGENT_DIR overrides.\",\n submenu: stringInputSubmenu(\n theme,\n \"Usage export dir\",\n \"Root of the export store; OMP_FABRIC_AGENT_DIR overrides this value.\",\n ),\n }),\n setting(\"agents.maxTokensPerChild\", \"Token limit\", formatTokens(config.agents.maxTokensPerChild), {\n description:\n \"Maximum cumulative tokens a single agent may use before it is terminated (0 disables). Caps a runaway child before the host session compacts.\",\n submenu: numericSubmenu(\n theme,\n TOKEN_VALUES,\n formatTokens,\n \"Agent token limit\",\n \"Maximum cumulative tokens a single agent may use before it is terminated (0 disables).\",\n ),\n }),\n setting(\"agents.timeoutMs\", \"Timeout\", formatMs(config.agents.timeoutMs), {\n description: \"Default wall-clock timeout and minimum for per-call agent timeouts.\",\n submenu: numericSubmenu(\n theme,\n [\n 60_000,\n 120_000,\n 300_000,\n 600_000,\n 1_800_000,\n 3_600_000,\n 7_200_000,\n 14_400_000,\n 28_800_000,\n 86_400_000,\n ],\n formatMs,\n \"Agent timeout\",\n \"Default wall-clock timeout and minimum for per-call agent timeouts.\",\n ),\n }),\n setting(\"agents.extensions\", \"Extensions\", config.agents.extensions ? \"true\" : \"false\", {\n description: \"Allow agents to load registered extensions.\",\n values: BOOLEANS,\n }),\n defaultToolsItem,\n setting(\"agents.retainRuns\", \"Retain runs\", config.agents.retainRuns ? \"true\" : \"false\", {\n description: \"Keep completed agent run artifacts for later inspection.\",\n values: BOOLEANS,\n }),\n setting(\"agents.notifyOnComplete\", \"Notify on complete\", config.agents.notifyOnComplete ? \"true\" : \"false\", {\n description: \"Post a message when a background agent completes.\",\n values: BOOLEANS,\n }),\n ],\n persist,\n ),\n }),\n setting(\"capture\", \"Capture\", summaryFor(\"capture\", config), {\n description: \"Registered tool capture and model visibility policy.\",\n submenu: sectionSubmenu(\n theme,\n \"Capture\",\n \"Registered tool capture and model visibility policy.\",\n [\n setting(\"capture.enabled\", \"Enabled\", config.capture.enabled ? \"true\" : \"false\", {\n description: \"Capture registered extension tools so they are callable from fabric_exec.\",\n values: BOOLEANS,\n }),\n setting(\"capture.hideFromModel\", \"Hide from model\", config.capture.hideFromModel ? \"true\" : \"false\", {\n description: \"Hide captured tools from the parent model's tool schema.\",\n values: BOOLEANS,\n }),\n setting(\"capture.defaultRisk\", \"Default risk\", config.capture.defaultRisk, {\n description: \"Approval risk level applied to registered tools without an explicit override.\",\n values: RISKS,\n }),\n keepVisibleItem,\n ...CORE_RISK_TOOLS.map((tool) =>\n setting(`capture.risks.${tool}`, `${tool} risk`, config.capture.risks[tool] ?? config.capture.defaultRisk, {\n description: `Approval risk level for the ${tool} tool on native and captured paths.`,\n values: RISKS,\n }),\n ),\n includeToolsItem,\n excludeToolsItem,\n ],\n persist,\n ),\n }),\n setting(\"ui\", \"UI\", summaryFor(\"ui\", config), {\n description: \"Fabric activity widget and dashboard.\",\n submenu: sectionSubmenu(\n theme,\n \"UI\",\n \"Fabric activity widget and dashboard.\",\n [\n setting(\"ui.enabled\", \"Enabled\", config.ui.enabled ? \"true\" : \"false\", {\n description: \"Show the Fabric activity widget and dashboard.\",\n values: BOOLEANS,\n }),\n setting(\"ui.widget\", \"Widget\", config.ui.widget, {\n description: \"When to show the activity widget above the editor.\",\n values: WIDGET_MODES,\n }),\n setting(\"ui.toolDisplay\", \"Tool display\", config.ui.toolDisplay, {\n description:\n \"Show full Fabric TypeScript or a compact intent-and-tools transcript; the tool-expand key (ctrl+o) expands a compact card to full.\",\n values: TOOL_DISPLAY_MODES,\n }),\n setting(\n \"ui.showAgentToolPreview\",\n \"Agent tool preview\",\n config.ui.showAgentToolPreview ? \"true\" : \"false\",\n {\n description:\n \"Show spawned agent/actor tool trees \u2014 including recursive descendants \u2014 in Fabric tool-call previews.\",\n values: BOOLEANS,\n },\n ),\n setting(\n \"ui.updateDebounceMs\",\n \"Update debounce\",\n formatDebounce(config.ui.updateDebounceMs),\n {\n description: \"One global coalescing window for live card updates \u2014 nested calls, progress, agent previews.\",\n submenu: numericSubmenu(\n theme,\n [0, 16, 50, 100, 150, 250, 500, 1000],\n formatDebounce,\n \"Update debounce\",\n \"One global coalescing window for live card updates \u2014 nested calls, progress, agent previews. Off emits every update.\",\n ),\n },\n ),\n setting(\"ui.maxRows\", \"Max rows\", String(config.ui.maxRows), {\n description: \"Maximum rows rendered by the activity widget.\",\n submenu: numericSubmenu(\n theme,\n [1, 2, 3, 5, 6, 8, 10, 15, 20],\n String,\n \"Widget max rows\",\n \"Maximum rows rendered by the activity widget.\",\n ),\n }),\n setting(\"ui.refreshMs\", \"Refresh interval\", formatMs(config.ui.refreshMs), {\n description: \"Refresh interval for the activity widget.\",\n submenu: numericSubmenu(\n theme,\n [100, 250, 500, 1000, 2000],\n formatMs,\n \"Widget refresh interval\",\n \"Refresh interval for the activity widget.\",\n ),\n }),\n setting(\"ui.eventHistory\", \"Event history\", String(config.ui.eventHistory), {\n description: \"Number of mesh events kept in the dashboard history.\",\n submenu: numericSubmenu(\n theme,\n [20, 40, 80, 120, 200, 500],\n String,\n \"Event history\",\n \"Number of mesh events kept in the dashboard history.\",\n ),\n }),\n setting(\"update.check\", \"Update notice\", config.update.check ? \"true\" : \"false\", {\n description:\n \"Show a status line when a newer omp-fabric is published on npm. One npm registry request per day, cached under the agent dir.\",\n values: BOOLEANS,\n }),\n ],\n persist,\n ),\n }),\n setting(\"compaction\", \"Compaction\", summaryFor(\"compaction\", config), {\n description: \"Compaction engine used at session compaction boundaries.\",\n submenu: sectionSubmenu(\n theme,\n \"Compaction\",\n \"Choose LCM context compaction or OMP core model-driven compaction.\",\n [\n ...(options.activeModelKey\n ? [setting(\n COMPACTION_THRESHOLD_SETTING_ID,\n \"Threshold\",\n formatCompactionThreshold(config, options.activeModelKey),\n {\n description:\n `Context usage that triggers compaction for ${options.activeModelKey}, as a percent of its window or an exact token count.`,\n submenu: compactionThresholdSubmenu(theme),\n },\n )]\n : []),\n setting(\"compaction.engine\", \"Engine\", config.compaction.engine, {\n description:\n \"LCM assembles durable hierarchical context; OMP delegates compaction to OMP core.\",\n values: COMPACTION_ENGINES,\n }),\n setting(\n \"compaction.summaryModel\",\n \"Summary model\",\n config.compaction.summaryModel || INHERIT_VALUE,\n {\n description:\n \"Model that writes LCM leaf and condensed summaries. Inherit uses the active session model, so a reasoning model summarizes transcripts at its own price.\",\n submenu: modelPickerSubmenu(theme, options.modelSource, {\n headerText:\n \"Model that writes LCM leaf and condensed summaries. Pick Inherit to use the active session model.\",\n inheritName: \"Use the active session model\",\n }),\n },\n ),\n setting(\n \"compaction.targetContextRatio\",\n \"Max occupancy\",\n String(config.compaction.targetContextRatio),\n {\n description:\n \"Hard post-compaction occupancy ceiling used by LCM context assembly.\",\n values: COMPACTION_TARGET_RATIOS,\n },\n ),\n ],\n persist,\n ),\n }),\n setting(\"retention\", \"Retention\", summaryFor(\"retention\", config), {\n description: \"Age-based cleanup for inactive Fabric run artifacts.\",\n submenu: sectionSubmenu(\n theme,\n \"Retention\",\n \"Cleanup only removes dead temporary roots and terminal run artifacts. Active runs and actor session.jsonl files are never modified.\",\n [\n setting(\n \"retention.orphanedTempRunMs\",\n \"Orphaned temp runs\",\n formatRetention(config.retention.orphanedTempRunMs),\n {\n description: \"Remove temporary run roots this long after their owner process dies.\",\n submenu: numericSubmenu(\n theme,\n [3_600_000, 3 * 3_600_000, 6 * 3_600_000, 12 * 3_600_000, 24 * 3_600_000],\n formatRetention,\n \"Orphaned temp runs\",\n \"Remove temporary run roots this long after their owner process dies.\",\n ),\n },\n ),\n setting(\n \"retention.oneShotRunMs\",\n \"One-shot runs\",\n formatRetention(config.retention.oneShotRunMs),\n {\n description: \"Retain completed one-shot agent run artifacts for this duration.\",\n submenu: numericSubmenu(\n theme,\n [6 * 3_600_000, 12 * 3_600_000, 24 * 3_600_000, 2 * 86_400_000, 3 * 86_400_000, 7 * 86_400_000],\n formatRetention,\n \"One-shot runs\",\n \"Retain completed one-shot agent run artifacts for this duration.\",\n ),\n },\n ),\n setting(\n \"retention.actorRunArchiveMs\",\n \"Actor run archives\",\n formatRetention(config.retention.actorRunArchiveMs),\n {\n description: \"Retain terminal actor run archives for this duration; the latest run is always preserved.\",\n submenu: numericSubmenu(\n theme,\n [86_400_000, 3 * 86_400_000, 7 * 86_400_000, 14 * 86_400_000, 30 * 86_400_000, 90 * 86_400_000],\n formatRetention,\n \"Actor run archives\",\n \"Retain terminal actor run archives for this duration; the latest run is always preserved.\",\n ),\n },\n ),\n ],\n persist,\n ),\n }),\n setting(\"mesh\", \"Mesh\", summaryFor(\"mesh\", config), {\n description: \"Durable mesh coordination store and actors.\",\n submenu: sectionSubmenu(\n theme,\n \"Mesh\",\n \"Durable mesh coordination store and actors.\",\n [\n setting(\"mesh.enabled\", \"Enabled\", config.mesh.enabled ? \"true\" : \"false\", {\n description: \"Enable the durable mesh store and actor providers.\",\n values: BOOLEANS,\n }),\n setting(\"mesh.actorScope\", \"Actor scope\", config.mesh.actorScope, {\n description:\n 'Default storage for newly created actors. Each agents.create call may choose project or session independently; project actors are shared, while session actors follow the root OMP session and its participant agents.',\n values: ACTOR_SCOPES,\n }),\n setting(\"mesh.maxReadEvents\", \"Max read events\", String(config.mesh.maxReadEvents), {\n description: \"Maximum events returned by a single mesh read.\",\n submenu: numericSubmenu(\n theme,\n [100, 200, 500, 1000, 5000],\n String,\n \"Max read events\",\n \"Maximum events returned by a single mesh read.\",\n ),\n }),\n setting(\"mesh.actorPollMs\", \"Actor poll fallback\", formatMs(config.mesh.actorPollMs), {\n description: \"Fallback polling interval when mesh filesystem notifications are unavailable.\",\n submenu: numericSubmenu(\n theme,\n [50, 100, 250, 500, 1000],\n formatMs,\n \"Actor poll fallback\",\n \"Fallback polling interval when mesh filesystem notifications are unavailable.\",\n ),\n }),\n setting(\"mesh.actorQueueLimit\", \"Actor queue limit\", String(config.mesh.actorQueueLimit), {\n description: \"Maximum messages queued per actor mailbox.\",\n submenu: numericSubmenu(\n theme,\n [4, 8, 16, 32, 64, 128],\n String,\n \"Actor queue limit\",\n \"Maximum messages queued per actor mailbox.\",\n ),\n }),\n setting(\"mesh.actorContextEntries\", \"Actor context entries\", String(config.mesh.actorContextEntries), {\n description: \"Transcript entries forwarded to actors as context.\",\n submenu: numericSubmenu(\n theme,\n [3, 5, 10, 14, 20, 50],\n String,\n \"Actor context entries\",\n \"Transcript entries forwarded to actors as context.\",\n ),\n }),\n setting(\"mesh.eventContextChars\", \"Event context chars\", config.mesh.eventContextChars.toLocaleString(), {\n description: \"Character cap applied to host events dispatched to actors.\",\n submenu: numericSubmenu(\n theme,\n [10_000, 20_000, 40_000, 80_000, 160_000],\n (n) => n.toLocaleString(),\n \"Event context chars\",\n \"Character cap applied to host events dispatched to actors.\",\n ),\n }),\n ],\n persist,\n ),\n }),\n setting(\"codePreview\", \"Code previews\", summaryFor(\"codePreview\", config), {\n description: \"Core tool previews, diffs, and Shiki syntax highlighting.\",\n submenu: sectionSubmenu(\n theme,\n \"Code previews\",\n \"Core tool previews, diffs, and Shiki syntax highlighting. Persisted to fabric.json codePreview.\",\n [\n setting(\"codePreview.shikiTheme\", \"Shiki theme\", config.codePreview.shikiTheme, {\n description:\n \"\\\"auto\\\" follows OMP's resolved light/dark variant; \\\"<light>/<dark>\\\" pins both; any other value fixes one theme.\",\n submenu: stringOptionsSubmenu(\n theme,\n SHIKI_THEME_PRESETS,\n \"Shiki theme\",\n \"\\\"auto\\\" follows OMP's light/dark switching (github-light/dark-plus); \\\"<light>/<dark>\\\" pins both variants.\",\n ),\n }),\n setting(\"codePreview.syntaxHighlighting\", \"Syntax highlighting\", config.codePreview.syntaxHighlighting ? \"true\" : \"false\", {\n description: \"Highlight code in previews with Shiki.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.diffIntensity\", \"Diff background\", config.codePreview.diffIntensity, {\n description: \"Full-row background tint for added and removed diff lines.\",\n values: DIFF_INTENSITIES,\n }),\n setting(\"codePreview.wordEmphasis\", \"Word emphasis\", config.codePreview.wordEmphasis, {\n description: \"Highlight changed words inside added and removed diff lines.\",\n values: WORD_EMPHASES,\n }),\n setting(\"codePreview.toolCallBackground\", \"Tool call background\", config.codePreview.toolCallBackground, {\n description: \"Background treatment for tool call frames.\",\n values: TOOL_CALL_BACKGROUNDS,\n }),\n setting(\"codePreview.toolCallTiming\", \"Tool call timing\", config.codePreview.toolCallTiming ? \"true\" : \"false\", {\n description: \"Show per-call duration on tool frames.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.pathIcons\", \"Path icons\", config.codePreview.pathIcons, {\n description: \"Icon set for path tree previews.\",\n values: PATH_ICON_MODES,\n }),\n setting(\"codePreview.readCollapsedLines\", \"Read lines\", String(config.codePreview.readCollapsedLines), {\n description: \"Collapsed read preview budget.\",\n submenu: numericSubmenu(theme, [3, 5, 10, 15, 20, 30], String, \"Read lines\", \"Collapsed read preview budget.\"),\n }),\n setting(\"codePreview.writeCollapsedLines\", \"Write lines\", String(config.codePreview.writeCollapsedLines), {\n description: \"Collapsed write preview budget.\",\n submenu: numericSubmenu(theme, [3, 5, 10, 15, 20, 30], String, \"Write lines\", \"Collapsed write preview budget.\"),\n }),\n setting(\n CODE_PREVIEW_EDIT_LINES_ID,\n \"Edit diff lines\",\n config.codePreview.editCollapsedLines === \"all\"\n ? CODE_PREVIEW_ALL_LINES\n : String(config.codePreview.editCollapsedLines),\n {\n description: \"Collapsed edit diff budget, or every diff line.\",\n submenu: stringOptionsSubmenu(\n theme,\n [\"10\", \"40\", \"80\", \"160\", \"320\", CODE_PREVIEW_ALL_LINES],\n \"Edit diff lines\",\n \"Collapsed edit diff budget, or every diff line.\",\n ),\n },\n ),\n setting(\"codePreview.grepCollapsedLines\", \"Grep lines\", String(config.codePreview.grepCollapsedLines), {\n description: \"Collapsed grep result budget.\",\n submenu: numericSubmenu(theme, [5, 10, 15, 25, 40], String, \"Grep lines\", \"Collapsed grep result budget.\"),\n }),\n setting(\"codePreview.pathListCollapsedLines\", \"Path list lines\", String(config.codePreview.pathListCollapsedLines), {\n description: \"Collapsed find/ls path tree budget.\",\n submenu: numericSubmenu(theme, [10, 20, 40, 80], String, \"Path list lines\", \"Collapsed find/ls path tree budget.\"),\n }),\n setting(\"codePreview.readContentPreview\", \"Read preview\", config.codePreview.readContentPreview ? \"true\" : \"false\", {\n description: \"Show file content previews for read calls.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.writeContentPreview\", \"Write preview\", config.codePreview.writeContentPreview ? \"true\" : \"false\", {\n description: \"Show content previews for write calls.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.editDiffPreview\", \"Edit diff preview\", config.codePreview.editDiffPreview ? \"true\" : \"false\", {\n description: \"Show diffs for edit calls.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.grepResultPreview\", \"Grep results\", config.codePreview.grepResultPreview ? \"true\" : \"false\", {\n description: \"Show grouped grep result previews.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.findResultPreview\", \"Find results\", config.codePreview.findResultPreview ? \"true\" : \"false\", {\n description: \"Show find result path trees.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.lsResultPreview\", \"Ls results\", config.codePreview.lsResultPreview ? \"true\" : \"false\", {\n description: \"Show ls result path trees.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.readLineNumbers\", \"Read line numbers\", config.codePreview.readLineNumbers ? \"true\" : \"false\", {\n description: \"Show line-number gutters in read previews.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.bashResultPreview\", \"Bash results\", config.codePreview.bashResultPreview ? \"true\" : \"false\", {\n description: \"Show bash output previews.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.bashWarnings\", \"Bash warnings\", config.codePreview.bashWarnings ? \"true\" : \"false\", {\n description: \"Annotate risky bash commands.\",\n values: BOOLEANS,\n }),\n setting(\"codePreview.secretWarnings\", \"Secret warnings\", config.codePreview.secretWarnings ? \"true\" : \"false\", {\n description: \"Flag suspected secrets in previews.\",\n values: BOOLEANS,\n }),\n ],\n persist,\n ),\n }),\n ];\n return markDrillIn(items);\n};\n\nconst RPC_BACK = \"\u2190 Back\";\nconst RPC_DONE = \"Done\";\nconst RPC_SWITCH_SCOPE = \"Switch save scope\";\n\ntype RpcChoice = {\n value: string;\n label: string;\n description?: string;\n current?: boolean;\n};\n\nconst rpcTitle = (path: string, description?: string): string =>\n description ? `${path}\\n${description}` : path;\n\nconst cleanSettingLabel = (label: string): string => label.replace(/\\s+\u203A$/, \"\");\n\nconst rpcSettingRow = (item: SettingItem): string => {\n const label = cleanSettingLabel(item.label);\n const current = item.currentValue ? ` \u00B7 ${item.currentValue}` : \"\";\n return item.description\n ? `${label}${current} \u2014 ${item.description}`\n : `${label}${current}`;\n};\n\nconst rpcChoiceRow = (choice: RpcChoice): string => {\n const current = choice.current ? \" \u00B7 Current\" : \"\";\n return choice.description\n ? `${choice.label}${current} \u2014 ${choice.description}`\n : `${choice.label}${current}`;\n};\n\nconst selectRpcChoice = async (\n context: ExtensionContext,\n title: string,\n choices: RpcChoice[],\n): Promise<string | undefined> => {\n const rows = choices.map(rpcChoiceRow);\n const selected = await context.ui.select(title, rows);\n if (selected === undefined) return undefined;\n const index = rows.indexOf(selected);\n return index < 0 ? undefined : choices[index]?.value;\n};\n\nconst browseRpcSettings = async (\n context: ExtensionContext,\n path: string,\n description: string | undefined,\n items: SettingItem[],\n onChange: (id: string, newValue: string) => void,\n): Promise<void> => {\n while (true) {\n const rows = items.map(rpcSettingRow);\n const selected = await context.ui.select(rpcTitle(path, description), [...rows, RPC_BACK]);\n if (selected === undefined || selected === RPC_BACK) return;\n const index = rows.indexOf(selected);\n const item = index < 0 ? undefined : items[index];\n if (!item) continue;\n await editRpcSetting(context, `${path} \u203A ${cleanSettingLabel(item.label)}`, item, onChange);\n }\n};\n\nconst editRpcSetting = async (\n context: ExtensionContext,\n path: string,\n item: SettingItem,\n onChange: (id: string, newValue: string) => void,\n): Promise<void> => {\n if (!item.submenu) {\n const values = item.values ?? [];\n if (values.length === 0) {\n context.ui.notify(`${cleanSettingLabel(item.label)} is read-only`, \"info\");\n return;\n }\n const selected = await selectRpcChoice(\n context,\n rpcTitle(path, item.description),\n unique([item.currentValue, ...values]).map((value) => ({\n value,\n label: value,\n current: value === item.currentValue,\n })),\n );\n if (selected === undefined) return;\n item.currentValue = selected;\n onChange(item.id, selected);\n return;\n }\n\n let completed = false;\n let selectedValue: string | undefined;\n const component = item.submenu(item.currentValue, (value) => {\n completed = true;\n selectedValue = value;\n });\n\n if (component instanceof SectionSubmenu) {\n await browseRpcSettings(\n context,\n path,\n item.description,\n component.items,\n (id, value) => {\n const child = component.items.find((candidate) => candidate.id === id);\n if (child) child.currentValue = value;\n component.applyChange(id, value);\n },\n );\n return;\n }\n\n if (component instanceof SelectSubmenu) {\n const selected = await selectRpcChoice(\n context,\n rpcTitle(path, item.description),\n component.options.map((option) => ({\n value: option.value,\n label: option.label,\n ...(option.description ? { description: option.description } : {}),\n current: option.value === item.currentValue || option.label === item.currentValue,\n })),\n );\n if (selected === undefined || !component.selectRpc(selected)) return;\n } else if (component instanceof IntegerInputSubmenu) {\n while (!completed) {\n const value = await context.ui.input(rpcTitle(path, item.description), component.input.getValue());\n if (value === undefined) return;\n if (!/^\\d+$/.test(value.trim()) || !Number.isSafeInteger(Number(value.trim()))) {\n context.ui.notify(\"Enter a non-negative safe integer.\", \"warning\");\n continue;\n }\n component.submitRpc(value);\n }\n } else if (component instanceof StringInputSubmenu) {\n const value = await context.ui.input(rpcTitle(path, item.description), component.input.getValue());\n if (value === undefined) return;\n component.submitRpc(value);\n } else if (component instanceof CompactionThresholdSubmenu) {\n const selected = await selectRpcChoice(\n context,\n rpcTitle(path, item.description),\n [\n { value: COMPACTION_DEFAULT_THRESHOLD_LABEL, label: COMPACTION_DEFAULT_THRESHOLD_LABEL, current: item.currentValue === COMPACTION_DEFAULT_THRESHOLD_LABEL },\n { value: COMPACTION_PERCENT_OPTION_LABEL, label: COMPACTION_PERCENT_OPTION_LABEL, current: item.currentValue.endsWith(\"%\") },\n { value: COMPACTION_TOKENS_OPTION_LABEL, label: COMPACTION_TOKENS_OPTION_LABEL, current: item.currentValue.endsWith(\" tokens\") },\n ],\n );\n if (selected === undefined) return;\n if (selected === COMPACTION_DEFAULT_THRESHOLD_LABEL) {\n component.completeRpc(selected);\n } else {\n const percent = /^(\\d+)%$/.exec(item.currentValue)?.[1] ?? \"\";\n const tokenText = /^(.+?) tokens$/.exec(item.currentValue)?.[1];\n const placeholder = selected === COMPACTION_PERCENT_OPTION_LABEL\n ? percent\n : tokenText === undefined ? \"\" : String(parseFormattedNumericValue(tokenText));\n const input = await context.ui.input(rpcTitle(path, item.description), placeholder);\n if (input === undefined || !/^\\d+$/.test(input.trim())) return;\n const numeric = Number(input.trim());\n component.completeRpc(\n selected === COMPACTION_PERCENT_OPTION_LABEL\n ? `${clampCompactionPercentThreshold(numeric)}%`\n : `${formatTokens(clampCompactionTokenThreshold(numeric))} tokens`,\n );\n }\n } else if (component instanceof FabricModelSelector) {\n const selected = await selectRpcChoice(\n context,\n rpcTitle(path, item.description),\n component.rpcChoices().map((choice) => ({\n value: choice.value,\n label: choice.label,\n description: choice.description,\n current: choice.current,\n })),\n );\n if (selected === undefined || !component.selectRpc(selected)) return;\n } else {\n context.ui.notify(`${cleanSettingLabel(item.label)} requires terminal UI`, \"warning\");\n return;\n }\n\n if (!completed || selectedValue === undefined) return;\n item.currentValue = selectedValue;\n onChange(item.id, selectedValue);\n};\n\nconst openRpcFabricSettings = async (\n context: ExtensionContext,\n options: {\n projectScopeAvailable: boolean;\n getScope: () => FabricConfigScope;\n setScope: (scope: FabricConfigScope) => void;\n itemsForScope: (scope: FabricConfigScope) => SettingItem[];\n persist: (id: string, value: string) => void;\n },\n): Promise<void> => {\n while (true) {\n const scope = options.getScope();\n const items = options.itemsForScope(scope);\n const rows = items.map(rpcSettingRow);\n const scopeDestination = scope === \"project\"\n ? \"Project overrides (.omp/fabric.json)\"\n : \"Global defaults (<active OMP agent dir>/fabric.json)\";\n const controls = [\n ...(options.projectScopeAvailable ? [`${RPC_SWITCH_SCOPE} \u00B7 ${scope === \"project\" ? \"Global defaults\" : \"Project overrides\"}`] : []),\n RPC_DONE,\n ];\n const selected = await context.ui.select(\n rpcTitle(\"Fabric settings\", `Editing: ${scopeDestination}`),\n [...rows, ...controls],\n );\n if (selected === undefined || selected === RPC_DONE) return;\n if (selected.startsWith(RPC_SWITCH_SCOPE)) {\n options.setScope(scope === \"project\" ? \"global\" : \"project\");\n continue;\n }\n const index = rows.indexOf(selected);\n const item = index < 0 ? undefined : items[index];\n if (!item) continue;\n await editRpcSetting(context, `Fabric settings \u203A ${cleanSettingLabel(item.label)}`, item, options.persist);\n }\n};\n\nexport interface FabricSettingsDeps {\n state: FabricState;\n applyFabricMode: () => void;\n capturedTools: CapturedToolCatalog;\n onConfigApplied?: (id: string) => void;\n}\n\nexport async function openFabricSettings(\n context: ExtensionContext,\n deps: FabricSettingsDeps,\n): Promise<void> {\n await deps.state.ensure(context);\n const agentDir = resolveAgentDir();\n const projectTrusted = context.isProjectTrusted();\n const configLocation = { cwd: context.cwd, agentDir, projectTrusted };\n let saveScope: FabricConfigScope = \"global\";\n let settingsConfig = loadFabricConfigForScope(configLocation, saveScope);\n let rootComponent: FabricSettingsComponent | undefined;\n const changedSections = new Set<string>();\n let dirty = false;\n\n const activeModelKey = context.model\n ? modelKey(context.model.provider, context.model.id)\n : undefined;\n const apply = (id: string, value: unknown): void => {\n const partial = id === COMPACTION_THRESHOLD_SETTING_ID && activeModelKey\n ? compactionThresholdPartial(activeModelKey, value as CompactionThresholdSelection)\n : buildPartial(id, value);\n try {\n saveFabricConfig(\n { cwd: context.cwd, agentDir, projectTrusted, scope: saveScope },\n partial,\n );\n } catch (error) {\n context.ui.notify(\n `Failed to save Fabric settings: ${error instanceof Error ? error.message : String(error)}`,\n \"error\",\n );\n return;\n }\n deps.state.reloadConfig(context);\n Object.assign(settingsConfig, loadFabricConfigForScope(configLocation, saveScope));\n deps.onConfigApplied?.(id);\n dirty = true;\n changedSections.add(id.split(\".\")[0] ?? id);\n const list = rootComponent?.settingsList;\n if (list) for (const rootId of ROOT_ITEM_IDS) list.updateValue(rootId, summaryFor(rootId, settingsConfig));\n };\n\n const persist = (id: string, newValue: string): void =>\n apply(id, coerceValue(id, newValue, settingsConfig));\n\n const keepVisibleCandidates = unique([\n \"fabric_exec\",\n ...deps.capturedTools.list().map((tool) => tool.name),\n ]);\n const modelSource = buildModelSource(context.modelRegistry, agentDir);\n const configuredClaudeModel = deps.state.config.agents.claude.model;\n const claudeModelSource: ModelSource = {\n models: configuredClaudeModel\n ? [{ provider: \"claude\", id: configuredClaudeModel.replace(/^claude\\//, \"\") }]\n : [],\n lastUsed: {},\n };\n void populateClaudeModelSource(\n claudeModelSource,\n () => deps.state.agents.claudeModels(),\n ).catch((error: unknown) => {\n if (deps.state.config.agents.runner === \"claude\") {\n context.ui.notify(\n `Claude model discovery failed: ${error instanceof Error ? error.message : String(error)}`,\n \"warning\",\n );\n }\n });\n\n const toolCandidates = keepVisibleCandidates;\n const itemsForScope = (scope: FabricConfigScope, theme: Theme): SettingItem[] => {\n settingsConfig = loadFabricConfigForScope(configLocation, scope);\n return buildFabricSettingsItems(theme, settingsConfig, apply, {\n keepVisibleCandidates,\n toolCandidates,\n modelSource,\n claudeModelSource,\n ...(activeModelKey ? { activeModelKey } : {}),\n });\n };\n\n if (context.mode === \"rpc\") {\n await openRpcFabricSettings(context, {\n projectScopeAvailable: projectTrusted,\n getScope: () => saveScope,\n setScope: (scope) => {\n saveScope = scope;\n },\n itemsForScope: (scope) => itemsForScope(scope, context.ui.theme),\n persist,\n });\n } else if (context.mode !== \"tui\") {\n context.ui.notify(\"Fabric settings require an interactive UI\", \"warning\");\n return;\n } else {\n await context.ui.custom<void>(\n (tui, theme, _keybindings, done) => {\n const component = new FabricSettingsComponent(\n theme,\n itemsForScope(saveScope, theme),\n persist,\n () => done(),\n {\n initialSaveScope: saveScope,\n projectScopeAvailable: projectTrusted,\n onSaveScopeChange: (scope) => {\n saveScope = scope;\n tui.requestRender();\n },\n itemsForSaveScope: (scope) => itemsForScope(scope, theme),\n },\n );\n rootComponent = component;\n return component;\n },\n );\n }\n\n if (dirty) {\n deps.applyFabricMode();\n const needsReload = [...changedSections].some((section) => RELOAD_SECTIONS.has(section));\n if (needsReload) {\n context.ui.notify(\n \"Fabric settings saved. Run /fabric reload to apply mesh, agent, and MCP changes.\",\n \"info\",\n );\n } else if (changedSections.has(\"schema\")) {\n context.ui.notify(\n \"Fabric settings saved. Schema changes take effect in the next session.\",\n \"info\",\n );\n } else {\n context.ui.notify(\"Fabric settings saved.\", \"info\");\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AA6BP,IAAM,iBAA0C;AAAA,EAC9C,uBAAuB;AAAA,EACvB,uBAAuB;AACzB;AAEA,IAAM,WAAW,CAAC,QAAQ,OAAO;AACjC,IAAM,iBAAiB,CAAC,SAAS,OAAO,QAAQ,MAAM;AACtD,IAAM,UAAU,CAAC,OAAO,UAAU,MAAM;AACxC,IAAM,aAAa,CAAC,QAAQ,WAAW,QAAQ,UAAU,aAAa,OAAO;AAC7E,IAAM,eAAe,CAAC,QAAQ,UAAU,QAAQ;AAChD,IAAM,qBAAqB,CAAC,QAAQ,SAAS;AAC7C,IAAM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mB,CAAC,UAAU,cAAc,OAAO,KAAK;AAAA,UAC1D;AAAA,QACF;AACA,wBAAgB;AAChB,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO;AACT,SAAK,gBAAgB;AACrB,UAAM,cAAc,CAAC,GAAG,eAAe,EAAE,KAAK,CAAC,YAAY,gBAAgB,IAAI,OAAO,CAAC;AACvF,QAAI,aAAa;AACf,cAAQ,GAAG;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,IACF,WAAW,gBAAgB,IAAI,QAAQ,GAAG;AACxC,cAAQ,GAAG;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,IACF,OAAO;AACL,cAAQ,GAAG,OAAO,0BAA0B,MAAM;AAAA,IACpD;AAAA,EACF;AACF;",
6
6
  "names": ["modelKey", "current"]
7
7
  }
@@ -34,7 +34,7 @@ The selected-session reconciler stores a source generation/checkpoint and resume
34
34
 
35
35
  ## Summary maintenance
36
36
 
37
- The dedicated model is selected from `compaction.summaryModel` through OMP's public model registry and session-aware resolver. The active session model is the fallback when the dedicated route is unavailable. Leaf and condensed prompts XML-fence transcript evidence and treat it as untrusted data.
37
+ The dedicated model is selected from `compaction.summaryModel` through OMP's public model registry and session-aware resolver. Pick it in `/fabric settings` under Compaction > Summary model, which lists the models OMP has available and offers Inherit to fall back to the active session model. The active session model is the fallback when the dedicated route is unavailable. Leaf and condensed prompts XML-fence transcript evidence and treat it as untrusted data.
38
38
 
39
39
  Maintenance defaults are bounded to 32 model calls, 2,000,000 input tokens, and 128,000 output tokens per project per UTC day, with a nested 16-call session limit. One project model job runs at a time. Jobs use 30-second leases renewed every 10 seconds, 60-second call limits, exponential retry backoff capped at 15 minutes, and three attempts. A failed call does not publish a ready node or increment usage counters.
40
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-fabric",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "A programmable tool and agent runtime for Oh My Pi (OMP)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",