micro-models-agent 2.37.0 → 2.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/README.md +1 -1
- package/dist/assets/app.js +1 -1
- package/dist/assets/js/feed/turn.js +4 -4
- package/dist/assets/js/loader.js +1 -1
- package/dist/assets/js/settings/controls.js +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/i18n/en.json +1 -1
- package/dist/i18n/ru.json +1 -1
- package/dist/main.js +317 -319
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,57 @@ All notable changes to Micro Models Agent (MMA) will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [2.39.0] - 2026-10-09
|
|
8
|
+
|
|
9
|
+
LSP is now a real language-server client instead of a one-shot linter: one warm server
|
|
10
|
+
process per `(server, project root)` with document sync, spec-correct diagnostics and a
|
|
11
|
+
tested JSON-RPC transport. The mascot reacts to LSP, and a native TypeScript engine
|
|
12
|
+
(`tsgo`) is one config key away.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Persistent LSP client** (`src/modules/lsp/{connection,pool,client}.ts`): one server process per `(server, project root)`, kept warm for the session and reused across checks. Documents are synced with `didOpen`/`didChange` (full) / `didClose`; diagnostics are tracked per document version. Before, every `checkFile` (every `write_file`/`edit_file`, every file of `lsp_check`, 5 files of the startup check) spawned `npx -> node -> tsserver` and killed it after one push. The pool is LRU-capped (`LSP_MAX_SERVERS`), reaps idle connections (`LSP_SERVER_IDLE_MS`) and restarts a server that dies on its own; both are internal constants (`src/config/timeouts.ts`).
|
|
17
|
+
- **Spec-correct transport** (`src/modules/lsp/framing.ts`, `uri.ts`, `language.ts`): `Content-Length` framing accepts CRLF **and** LF separators; URIs are percent-encoded/decoded symmetrically (spaces, `#`, `%`, non-ASCII, Windows drives); one language-id table for both the protocol `languageId` and the `lsp.servers` key; client capabilities negotiate `general.positionEncodings`, `publishDiagnostics.versionSupport/relatedInformation`, pull diagnostics (`textDocument/diagnostic`) and `clientInfo`; server->client requests (`workspace/configuration`, `client/registerCapability`) are answered instead of leaving the server hanging.
|
|
18
|
+
- **Native TypeScript engine** (`src/modules/lsp/config.ts`, `src/config/registry-extra.ts`): `lsp.typescriptEngine: "typescript-language-server" | "tsgo"` selects the native TS7 preview (`tsgo --lsp --stdio`, `@typescript/native-preview`) for TS/JS; default stays classic. Surfaced in `/config`, Settings -> Plugins - LSP, and `/lsp status`.
|
|
19
|
+
- **LSP reactions for MMART** (`src/modules/webui/assets/js/loader.ts`, `assets/app.ts`, `styles.css`): new `check` and `warn` face states; `lsp_check` shows `check`, a completed check that found errors (or a `write_file`/`edit_file` with `[LSP errors]`) shows `warn`, and a failed/disabled server shows `error`.
|
|
20
|
+
- **`bun test` coverage for the transport**: `tests/modules/lsp/{framing,uri,language,connection,pool,client}.test.ts` plus `tests/helpers/fake-lsp-server.ts` (an in-memory server: real framing, correlation and timeouts, no child processes).
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **`LspClient.checkFile` returns `CheckResult`** (`{ diagnostics, inconclusive }`): a timeout no longer returns an empty list indistinguishable from "clean". `lsp_check` and the post-write hook say so explicitly; the model is not told "no errors" when the server stayed silent.
|
|
25
|
+
- **`LspModule` reports pool status** in `/lsp status` (warm servers / closed / restarts) and closes every server on `onSessionEnd`.
|
|
26
|
+
- **`severity` is optional per spec** (`src/modules/lsp/types.ts`): an absent severity is treated as an error (`isErrorDiagnostic`), so servers that omit it (or emit `0`, like clangd) are no longer silently dropped.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- **Leaked start timer** (`src/modules/lsp/connection.ts`): the per-spawn start-timeout timer is cleared; previously every check left a pending timeout of up to 30 s.
|
|
31
|
+
- **Structural `KillableProcess` type** (`src/modules/processes/kill-tree.ts`): the parameter accepts any `{ pid?, kill() }`, so the connection passes its own process wrapper without an unsafe cast. `ChildProcess` still satisfies it, so all callers are unchanged.
|
|
32
|
+
|
|
33
|
+
## [2.38.0] - 2026-10-09
|
|
34
|
+
|
|
35
|
+
Harness honesty for read-only work: the loop guard no longer treats "no mutation" as
|
|
36
|
+
"no progress", every forced stop now yields a best-effort final answer instead of a silent
|
|
37
|
+
kill, and the web chat shows why a turn stopped. Frontend seams landed so a future TUI can
|
|
38
|
+
reuse the command registry and session snapshot, and `grep` on Windows was hardened.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- **Host snapshot projection moved to `core`** (`src/core/host-state.ts`): `buildHostState`/`captureUsage`/`liveContextUsage`/`planEventFor`/`UsageSnapshot` lived in `src/modules/webui/host-state.ts`, yet `mma serve` already imported `planEventFor` from there - a structural subset of the web backend acting as a shared contract. `src/modules/webui/host-state.ts` is now a thin web wrapper keeping `WebIndexer`/`WebLsp` and the web-only `i18nStale` probe.
|
|
43
|
+
- **`ReplContext` split into services and IO** (`src/cli/command-context.ts`): the old 20-member interface mixed frontend-agnostic services (config/agent/modules) with single-shot terminal IO (`rl: LineInput`, `output: OutputChannel`), so a TUI that redraws frames could not reuse the command registry. Now `CommandServices` (frontend-agnostic) + `CommandOutput` (2 required methods) + `CommandInput` (3 methods). `ReplContext` is an alias. `/wizard` and `/config reset --all` ask `ctx.input.withInput(...)`/`ctx.input.confirm(...)` instead of touching the terminal; `Spinner` takes only `writeOverlay`.
|
|
44
|
+
- **Declarative slash-command catalog** (`src/core/commands/`): three descriptions drifted silently - the hand-synced `COMMAND_GROUPS` table (29 lines), the REPL registrations, and the web `HELP` list. All 29 commands are now data (`spec.ts`) plus a registry with per-surface availability (`catalog.ts`). Actions are deliberately not unified - terminal prints ANSI, the browser emits plain SSE lines, which is the `CommandOutput` adapter's job. `/help` builds from the catalog; `COMMAND_GROUPS` is deleted. `isAvailable` defaults to terminal + TUI so a future TUI gets the whole registry.
|
|
45
|
+
- **Forced final answer instead of a silent kill** (`src/core/agent.ts`, `tool-batch.ts`): every harness terminal (duplicate budget, failed-batch honest-stop, `maxToolIterations` exhaustion) now makes one tool-less LLM call and accepts the text as the final answer (critic/audit/claim gates skipped, answer persisted to history, tokens/cost counted); `AgentResult.stopReason` carries the trigger. An empty forced answer is still a failure.
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- **Anti-drift guards**: `tests/core/command-catalog.test.ts` asserts the catalog covers exactly the commands the REPL registers (both directions) and that web-marked commands match the real web dispatcher; `tests/cli/repl-help.test.ts` pins the user-visible `/help` output; `tests/cli/command-context.test.ts` locks the surface a new frontend must implement.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- **Read-only tasks are no longer hard-stopped** (`src/core/agent/tool-batch.ts`): the guard treated "no work mutation" as "no progress", so a genuinely read-only turn (analysis) always climbed the streak and was killed at 12 batches before the model could answer (`ses_mv0pirf5_hnmbxj`). Progress is now exact tool-call repetition (new `canonicalArgsKey`, `src/core/agent/canonical-args.ts`), so broad exploration with new files/patterns never trips it.
|
|
54
|
+
- **Web shows why a turn stopped** (`webui/session/{run-agent,forward}.ts`, `assets/js/feed/turn.ts`): the harness reason (`AgentResult.stopReason` / `error`) was dropped on the web path, leaving a generic `turn failed`. It is now forwarded through SSE `turn_end` and rendered.
|
|
55
|
+
- **`grep` with `|` on Windows** (`src/tools/grep-tool.ts`): an npm `.cmd`/`.ps1` `rg` shim runs through `cmd.exe` under Bun, so alternation patterns were read as pipes and the search failed with no JS fallback. Shim/spawn failures (exit 255/9009, shell signature) are now treated as engine-unavailable and fall through to the JS walker.
|
|
56
|
+
- **Stuck-detector read-only nudge removed** (`src/modules/execution/stuck-detector.ts`, `execution-plugin.ts`): the second "no mutation = stuck" heuristic (10 read-only calls → `exec.read_only_loop`, "No write/exec for N tool calls") fired on legitimate read-only analysis. Removed — real loops stay covered by repetition sampling, step iteration, failure streaks and the duplicate-tool budget. Keys `exec.read_only_loop`, `exec.read_only_loop_recovery`, `exec.hint_read_only` dropped (en+ru).
|
|
57
|
+
|
|
7
58
|
## [2.37.0] - 2026-10-09
|
|
8
59
|
|
|
9
60
|
`mma serve` now describes its own API: a live OpenAPI 3.1 document plus a
|
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Most agents (Devin, Cursor, Copilot) are glued to cloud models or pricey APIs
|
|
|
35
35
|
|
|
36
36
|
- **6-state agent loop** (`INIT → THINK → ACT → OBSERVE → OUTPUT → ERROR`) — clean, predictable, debuggable
|
|
37
37
|
- **Context budget management** — per-model budgets with sliding-window compaction that preserves facts, decisions, and errors, keeps a `[Tool ledger]` of what was already read, and calibrates its token estimate against the provider's real `prompt_tokens`
|
|
38
|
-
- **Honest-stop guards** — failed tool batches
|
|
38
|
+
- **Honest-stop guards** — failed tool batches and duplicate-tool loops stop the loop with a truthful status instead of letting a small model grind (honest stop, duplicate-tool budget, forced tool-less final answer)
|
|
39
39
|
- **Hallucination detection** — fact checks (file paths), consistency checks (decision rollbacks), confidence checks, plus claim verification: "created file X" / "output says Y" / "the price is Z" are checked against real tool output
|
|
40
40
|
- **Execution guarantees** — LLM-driven auto-planning (no keyword heuristics), stuck detection, off-track warnings, automatic plan advancement
|
|
41
41
|
|
package/dist/assets/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{msgs as V,inp as S,connStatus as A,setIcon as R,icon as q}from"./js/dom.js";import{api as X,token as P}from"./js/api.js";import{I18N as Y,t as a,loadI18n as Z}from"./js/i18n.js";import{tabs as f,session as p,settings as m,hooks as y}from"./js/store.js";import{routeState as $,mergeUsage as ee,storeSnapshot as B,applyCounters as F,shouldHydrateAutoOpen as te}from"./js/state-sync.js";import{onText as ne,onReasoning as se,onMeta as oe,onPhase as ie,onToolStart as ae,onToolEnd as re,onTurnEnd as de,onErrorEvent as ce,onCommandOutput as le,onLog as fe,onPlan as ue,onQuestion as pe,onRetract as be,showEmptyFeed as E,renderPlan as me,renderUsage as H,renderEnvironment as he,renderWorkspace as we,feedHasContent as ge,loadHistory as ve}from"./js/feed.js";import{openTab as I,updateTabName as Se,renderSessionsDropdown as L,reflectBusy as ye,loadSessions as M,loadCommands as Ee,setTabStatus as v,reconcileTabStatuses as Ie,readSavedTabs as Le}from"./js/session/tabs.js";import{renderSelectors as x,renderSettings as xe,loadConfig as N,loadModels as Te,loadProviders as Ce,loadMemory as ke,loadSkills as _e,loadPlugins as Ae,applyTheme as Re,currentTheme as qe,applyFontSize as Pe,setConnStatus as T,setStaleBar as O}from"./js/settings.js";import{initRail as Be,setPlan as U,railEvent as Fe,applyRailI18n as He}from"./js/rail.js";import{initSidebar as Me,sidebarSessionChanged as Ne,sidebarMapState as Oe,sidebarTraceEvent as C,sidebarTurnEnd as Ue,sidebarBusy as W,sidebarMapIndicator as We,sidebarPullLog as De,sidebarSessionId as je,setSessionLoading as ze,sidebarLspState as Ge,sidebarLspEvent as Je,applySidebarI18n as D,initFiles as Qe,sidebarFilesState as Ke,sidebarFilesChanged as j,sidebarPluginsState as Ve,sidebarPluginsEvent as Xe,initSidebarDrawer as Ye}from"./js/sidebar.js";import{insertIntoDraft as Ze}from"./js/session/composer.js";import{initCursor as $e,createFace as et,setFaceState as k,loaderStateFor as tt,setGreetResolver as nt}from"./js/loader.js";let h=null,w=0;function u(s){w++,k(h,s)}function st(){const s=document.getElementById("composerFace");s&&(h=et("idle","sm"),s.replaceChildren(h))}document.querySelectorAll("[data-collapse]").forEach(s=>{const e=s.querySelector(".arrow");e&&(e.textContent="",e.appendChild(q("chevron-down"))),s.addEventListener("click",()=>{const i=s.nextElementSibling;if(!i)return;const o=i.classList.toggle("collapsed");s.setAttribute("aria-expanded",o?"false":"true");const l=s.querySelector(".arrow");l&&(l.textContent="",l.appendChild(q(o?"chevron-right":"chevron-down")))})});let _=-1;function g(){const s=f.tabs.find(l=>l.id===f.activeTabId)||null,e=s&&s.state||{};p.host=e;const i=e.sessionId||s&&s.id||null;p.activeSessionId=i,f.tabs.length||E(),me(e.plan),U(p.busy&&e?e.plan:null),H(e),typeof e.contextWindow=="number"&&m.config&&m.config.contextWindow!==e.contextWindow&&(m.config.contextWindow=e.contextWindow,x()),he(e),Oe(e),We(e),Ge(),Ke(e),Ve();const o=typeof e.filesRevision=="number"?e.filesRevision:void 0;if(o!==void 0&&o!==_){const l=_===-1;_=o,!l&&o>0&&j()}Ne(i),we(e),L(),ze(!1),O(!!e.i18nStale)}function ot(s){const e=$(s);ye(),Ie(),s.state&&typeof s.state.sessionId=="string"&&Se(s.state.sessionId,s.state.sessionName),e&&g()}async function z(s){const e=s?"/api/state?session="+encodeURIComponent(s):"/api/state",i=await X(e);return i.ok&&i.data?i.data:null}async function G(s){const e=f.tabs.find(o=>o.id===s);if(!e)return;if(e.state){f.activeTabId===s&&g();return}const i=await z(s);i&&(B(i.state),f.activeTabId===s&&(F(i),g()))}async function J(){const s=f.activeTabId,e=await z(s);if(!e||f.activeTabId!==s)return;const i=e.state;if(!s&&i&&i.sessionId&&!f.tabs.some(o=>o.id===i.sessionId)){const o=te(p.sessions,i.sessionId);I(i.sessionId,i.sessionName||String(i.sessionId),"session",o)}B(i),F(e),g()}y.ensureTabState=G,y.renderActive=g;function it(){for(const e of f.tabs)e.kind==="session"&&(e.state=null,G(e.id));J(),M();const s=f.tabs.find(e=>e.id===f.activeTabId);s&&s.kind==="session"&&!ge(s.feed)&&(s.historyLoaded=!1,ve(s))}function at(){const s="/events"+(P?"?token="+encodeURIComponent(P):""),e=new EventSource(s);let i=!1;e.onopen=()=>{i&&(i=!1,T(!1),it())},e.onerror=t=>{t&&typeof t.data=="string"||(i=!0,T(!0))};const o=t=>{try{return JSON.parse(t.data)}catch{return null}},l=t=>!t.sessionId||t.sessionId===je(),d=[["text",t=>ne(t.chunk||"",t.sessionId)],["meta",t=>oe(t.chunk||"",t.sessionId,t.kind)],["reasoning",t=>se(t.chunk||"",t.sessionId)],["phase",t=>ie(t.phase,t.sessionId)],["tool_start",ae],["tool_end",re],["plan",ue],["question",pe],["turn_end",t=>{de(t),l(t)&&(Ue(t.turnSeq),W(!1),De())}],["log",fe],["retract",t=>be(t.reason||"",t.sessionId)]];for(const[t,n]of d)e.addEventListener(t,c=>{const b=o(c);b&&n(b)});for(const t of["tool_start","tool_end","text","plan"])e.addEventListener(t,n=>{const c=o(n);c&&(t==="plan"?U(c):Fe(t,c.name))});const r=[["tool_start","tool_start"],["tool_end","tool_end"],["text","text"],["question","question"],["error","error"]];for(const[t,n]of r)e.addEventListener(t,c=>{const b=o(c);b&&u(tt({type:n,name:typeof b.name=="string"?b.name:""}))});e.addEventListener("phase",t=>{const n=o(t),c=n&&typeof n.phase=="string"?n.phase:"";u(c==="composing"?"type":c==="tool"?"run":"think")}),e.addEventListener("reasoning",()=>u("think")),e.addEventListener("plan",()=>u("plan")),e.addEventListener("turn_end",t=>{const n=o(t);u(n&&n.success===!1&&!n.interrupted?"error":"done");const c=w;window.setTimeout(()=>{c===w&&k(h,"idle")},1500)}),e.addEventListener("retract",()=>u("error")),e.addEventListener("index",()=>u("find")),e.addEventListener("setup_done",()=>u("done")),e.addEventListener("update",t=>{const n=o(t);if(n&&n.phase==="failed"){u("error");return}u("update");const c=w;window.setTimeout(()=>{c===w&&k(h,"idle")},4e3)});for(const t of["text","reasoning","phase","tool_start","plan"])e.addEventListener(t,n=>{const c=o(n);c&&c.sessionId&&v(c.sessionId,"working")});e.addEventListener("question",t=>{const n=o(t);n&&n.sessionId&&v(n.sessionId,"waiting")}),e.addEventListener("turn_end",t=>{const n=o(t);n&&n.sessionId&&v(n.sessionId,n.success===!1&&!n.interrupted?"failed":"idle")});for(const t of["tool_start","tool_end","phase","plan","question","meta","log","retract","index"])e.addEventListener(t,n=>{const c=o(n);c&&l(c)&&C(t,c)});e.addEventListener("text",t=>{const n=o(t);n&&l(n)&&C("text",n)}),e.addEventListener("lsp",t=>{const n=o(t);n&&Je(n)}),e.addEventListener("files",()=>j()),e.addEventListener("plugins",()=>Xe()),e.addEventListener("config",()=>{N()}),e.addEventListener("command",t=>{const n=o(t);n&&typeof n.text=="string"&&le(n.text,n.sessionId)}),e.addEventListener("state",t=>{const n=o(t);n&&(W(!!n.busy),ot(n))}),e.addEventListener("sessions",t=>{const n=o(t);n&&Array.isArray(n.sessions)&&(p.sessions=n.sessions,L())}),e.addEventListener("usage",t=>{const n=o(t);if(!n||!n.usage||typeof n.usage!="object")return;const c=n.usageSessionId||n.sessionId||null;ee(c,n.usage)&&H(p.host)}),e.addEventListener("error",t=>{if(!t.data)return;const n=o(t);n&&(n.sessionId&&v(n.sessionId,"failed"),ce(n),C("error",n))})}function Q(){document.documentElement.lang=Y.locale;const s=(d,r)=>{const t=document.getElementById(d);t&&(t.textContent=r)};s("planHeaderLabel",a("web.sidebar.plan")),s("usageHeaderLabel",a("web.sidebar.session")+" · "+a("web.sidebar.usage")),s("envHeaderLabel",a("web.sidebar.env")),s("settingsTitle",a("web.settings.title")),s("sessActiveHeader",a("web.sessions.active")),s("sessRecentHeader",a("web.sessions.recent")),s("hintEnter",a("web.input.enter")),s("hintShift",a("web.input.shift_enter")),s("hintEsc",a("web.input.esc")),s("hintAttach",a("web.input.attach")),s("bootCap",a("web.loader.boot")),nt(()=>a("web.loader.greet"));const e=h?.querySelector(".mdl-tip");e&&(e.textContent=a("web.loader.greet"));const i={newChat:["plus",a("web.topbar.new_chat")],sessBtn:["menu",a("web.topbar.all_sessions")],toggleSidebar:["panel",a("web.topbar.sidebar")],openSettings:["settings",a("web.topbar.settings")],attachBtn:["image",a("web.attach.title")],closeSettings:["x",a("web.topbar.close")],sessNew:["plus",a("web.sessions.new")],sessRefresh:["refresh",a("web.sessions.refresh")],sessPrev:["chevron-left",a("web.sessbar.prev")],sessNext:["chevron-right",a("web.sessbar.next")],sessClose:["x",a("web.topbar.close")]};Object.keys(i).forEach(d=>{const r=document.getElementById(d);if(!r)return;const[t,n]=i[d];R(r,t,d==="closeSettings"||d==="sessNew"||d==="sessRefresh"?n:null),r.title=n,r.setAttribute("aria-label",n)});const o=document.getElementById("settingsIcon");o&&R(o,"settings",null),S&&(S.placeholder=a("web.input.placeholder"),S.setAttribute("aria-label",a("web.input.placeholder"))),document.querySelectorAll("#setMenu .mi").forEach(d=>{const r=d.dataset.p;r&&(d.textContent=a("web.settings."+r))});const l=document.getElementById("setSearch");l&&(l.setAttribute("placeholder",a("web.settings.search_placeholder")),l.setAttribute("aria-label",a("web.settings.search_placeholder"))),document.querySelectorAll(".content-col .panel").forEach(d=>{const r=d.querySelector("h3"),t=d.id.replace(/^p-/,"");r&&t&&(r.textContent=a("web.settings."+t))}),x(),L(),He(),D(),V.querySelector(".empty")&&E(),A&&!A.hidden&&T(!0),O(void 0,!0)}function rt(s){const e=Le(),i=r=>p.sessions.some(t=>t.id===r),o=r=>{const t=p.sessions.find(n=>n.id===r);return t&&t.name?String(t.name):r},l=(s&&i(s)?s:e.active&&i(e.active)?e.active:e.ids.find(i))||null,d=[];s&&i(s)&&d.push(s),l&&!d.includes(l)&&d.push(l);for(const r of e.ids)i(r)&&!d.includes(r)&&d.push(r);if(d.length){I(d[0],o(d[0]),"session",!0);for(const r of d.slice(1))I(r,o(r),"session",!1,!1)}}async function dt(){$e();const s=new URLSearchParams(location.search).get("session");if(window.MmaSetup)try{if(await window.MmaSetup.maybeOpen()){K();return}}catch{}try{await Z(),await Ee(),Re(qe()),Pe(),Q(),E(),x(),xe(),await N(),Be(m.config&&m.config.ui?m.config.ui.activityRail:void 0),st(),Me(),Ye(),D(),Qe({insertPath:e=>Ze("`"+e+"` ")}),await Te(),await Ce(),await M(),await ke(),await _e(),await Ae(),rt(s);try{await J()}catch(e){console.error("initial refresh failed",e)}}finally{K()}at()}function K(){const s=document.getElementById("bootSplash");!s||s.hidden||(s.classList.add("hide"),window.setTimeout(()=>{s.hidden=!0},500))}y.applyStaticI18n=Q,dt();
|
|
1
|
+
import{msgs as V,inp as S,connStatus as A,setIcon as R,icon as q}from"./js/dom.js";import{api as X,token as P}from"./js/api.js";import{I18N as Y,t as a,loadI18n as Z}from"./js/i18n.js";import{tabs as f,session as b,settings as m,hooks as y}from"./js/store.js";import{routeState as $,mergeUsage as ee,storeSnapshot as B,applyCounters as F,shouldHydrateAutoOpen as te}from"./js/state-sync.js";import{onText as se,onReasoning as ne,onMeta as oe,onPhase as ie,onToolStart as ae,onToolEnd as re,onTurnEnd as de,onErrorEvent as ce,onCommandOutput as le,onLog as fe,onPlan as ue,onQuestion as pe,onRetract as be,showEmptyFeed as E,renderPlan as me,renderUsage as H,renderEnvironment as he,renderWorkspace as ge,feedHasContent as we,loadHistory as ve}from"./js/feed.js";import{openTab as I,updateTabName as Se,renderSessionsDropdown as L,reflectBusy as ye,loadSessions as M,loadCommands as Ee,setTabStatus as v,reconcileTabStatuses as Ie,readSavedTabs as Le}from"./js/session/tabs.js";import{renderSelectors as x,renderSettings as xe,loadConfig as N,loadModels as Te,loadProviders as Ce,loadMemory as ke,loadSkills as _e,loadPlugins as Ae,applyTheme as Re,currentTheme as qe,applyFontSize as Pe,setConnStatus as T,setStaleBar as O}from"./js/settings.js";import{initRail as Be,setPlan as U,railEvent as Fe,applyRailI18n as He}from"./js/rail.js";import{initSidebar as Me,sidebarSessionChanged as Ne,sidebarMapState as Oe,sidebarTraceEvent as C,sidebarTurnEnd as Ue,sidebarBusy as W,sidebarMapIndicator as We,sidebarPullLog as De,sidebarSessionId as je,setSessionLoading as ze,sidebarLspState as Ge,sidebarLspEvent as Je,applySidebarI18n as D,initFiles as Qe,sidebarFilesState as Ke,sidebarFilesChanged as j,sidebarPluginsState as Ve,sidebarPluginsEvent as Xe,initSidebarDrawer as Ye}from"./js/sidebar.js";import{insertIntoDraft as Ze}from"./js/session/composer.js";import{initCursor as $e,createFace as et,setFaceState as k,loaderStateFor as tt,setGreetResolver as st}from"./js/loader.js";let h=null,g=0;function u(n){g++,k(h,n)}function nt(){const n=document.getElementById("composerFace");n&&(h=et("idle","sm"),n.replaceChildren(h))}document.querySelectorAll("[data-collapse]").forEach(n=>{const e=n.querySelector(".arrow");e&&(e.textContent="",e.appendChild(q("chevron-down"))),n.addEventListener("click",()=>{const i=n.nextElementSibling;if(!i)return;const o=i.classList.toggle("collapsed");n.setAttribute("aria-expanded",o?"false":"true");const l=n.querySelector(".arrow");l&&(l.textContent="",l.appendChild(q(o?"chevron-right":"chevron-down")))})});let _=-1;function w(){const n=f.tabs.find(l=>l.id===f.activeTabId)||null,e=n&&n.state||{};b.host=e;const i=e.sessionId||n&&n.id||null;b.activeSessionId=i,f.tabs.length||E(),me(e.plan),U(b.busy&&e?e.plan:null),H(e),typeof e.contextWindow=="number"&&m.config&&m.config.contextWindow!==e.contextWindow&&(m.config.contextWindow=e.contextWindow,x()),he(e),Oe(e),We(e),Ge(),Ke(e),Ve();const o=typeof e.filesRevision=="number"?e.filesRevision:void 0;if(o!==void 0&&o!==_){const l=_===-1;_=o,!l&&o>0&&j()}Ne(i),ge(e),L(),ze(!1),O(!!e.i18nStale)}function ot(n){const e=$(n);ye(),Ie(),n.state&&typeof n.state.sessionId=="string"&&Se(n.state.sessionId,n.state.sessionName),e&&w()}async function z(n){const e=n?"/api/state?session="+encodeURIComponent(n):"/api/state",i=await X(e);return i.ok&&i.data?i.data:null}async function G(n){const e=f.tabs.find(o=>o.id===n);if(!e)return;if(e.state){f.activeTabId===n&&w();return}const i=await z(n);i&&(B(i.state),f.activeTabId===n&&(F(i),w()))}async function J(){const n=f.activeTabId,e=await z(n);if(!e||f.activeTabId!==n)return;const i=e.state;if(!n&&i&&i.sessionId&&!f.tabs.some(o=>o.id===i.sessionId)){const o=te(b.sessions,i.sessionId);I(i.sessionId,i.sessionName||String(i.sessionId),"session",o)}B(i),F(e),w()}y.ensureTabState=G,y.renderActive=w;function it(){for(const e of f.tabs)e.kind==="session"&&(e.state=null,G(e.id));J(),M();const n=f.tabs.find(e=>e.id===f.activeTabId);n&&n.kind==="session"&&!we(n.feed)&&(n.historyLoaded=!1,ve(n))}function at(){const n="/events"+(P?"?token="+encodeURIComponent(P):""),e=new EventSource(n);let i=!1;e.onopen=()=>{i&&(i=!1,T(!1),it())},e.onerror=t=>{t&&typeof t.data=="string"||(i=!0,T(!0))};const o=t=>{try{return JSON.parse(t.data)}catch{return null}},l=t=>!t.sessionId||t.sessionId===je(),d=[["text",t=>se(t.chunk||"",t.sessionId)],["meta",t=>oe(t.chunk||"",t.sessionId,t.kind)],["reasoning",t=>ne(t.chunk||"",t.sessionId)],["phase",t=>ie(t.phase,t.sessionId)],["tool_start",ae],["tool_end",re],["plan",ue],["question",pe],["turn_end",t=>{de(t),l(t)&&(Ue(t.turnSeq),W(!1),De())}],["log",fe],["retract",t=>be(t.reason||"",t.sessionId)]];for(const[t,s]of d)e.addEventListener(t,c=>{const p=o(c);p&&s(p)});for(const t of["tool_start","tool_end","text","plan"])e.addEventListener(t,s=>{const c=o(s);c&&(t==="plan"?U(c):Fe(t,c.name))});const r=[["tool_start","tool_start"],["tool_end","tool_end"],["text","text"],["question","question"],["error","error"]];for(const[t,s]of r)e.addEventListener(t,c=>{const p=o(c);p&&u(tt({type:s,name:typeof p.name=="string"?p.name:"",success:p.success!==!1,...s==="tool_end"&&typeof p.output=="string"?{output:p.output}:{}}))});e.addEventListener("phase",t=>{const s=o(t),c=s&&typeof s.phase=="string"?s.phase:"";u(c==="composing"?"type":c==="tool"?"run":"think")}),e.addEventListener("reasoning",()=>u("think")),e.addEventListener("plan",()=>u("plan")),e.addEventListener("turn_end",t=>{const s=o(t);u(s&&s.success===!1&&!s.interrupted?"error":"done");const c=g;window.setTimeout(()=>{c===g&&k(h,"idle")},1500)}),e.addEventListener("retract",()=>u("error")),e.addEventListener("index",()=>u("find")),e.addEventListener("setup_done",()=>u("done")),e.addEventListener("update",t=>{const s=o(t);if(s&&s.phase==="failed"){u("error");return}u("update");const c=g;window.setTimeout(()=>{c===g&&k(h,"idle")},4e3)});for(const t of["text","reasoning","phase","tool_start","plan"])e.addEventListener(t,s=>{const c=o(s);c&&c.sessionId&&v(c.sessionId,"working")});e.addEventListener("question",t=>{const s=o(t);s&&s.sessionId&&v(s.sessionId,"waiting")}),e.addEventListener("turn_end",t=>{const s=o(t);s&&s.sessionId&&v(s.sessionId,s.success===!1&&!s.interrupted?"failed":"idle")});for(const t of["tool_start","tool_end","phase","plan","question","meta","log","retract","index"])e.addEventListener(t,s=>{const c=o(s);c&&l(c)&&C(t,c)});e.addEventListener("text",t=>{const s=o(t);s&&l(s)&&C("text",s)}),e.addEventListener("lsp",t=>{const s=o(t);s&&Je(s)}),e.addEventListener("files",()=>j()),e.addEventListener("plugins",()=>Xe()),e.addEventListener("config",()=>{N()}),e.addEventListener("command",t=>{const s=o(t);s&&typeof s.text=="string"&&le(s.text,s.sessionId)}),e.addEventListener("state",t=>{const s=o(t);s&&(W(!!s.busy),ot(s))}),e.addEventListener("sessions",t=>{const s=o(t);s&&Array.isArray(s.sessions)&&(b.sessions=s.sessions,L())}),e.addEventListener("usage",t=>{const s=o(t);if(!s||!s.usage||typeof s.usage!="object")return;const c=s.usageSessionId||s.sessionId||null;ee(c,s.usage)&&H(b.host)}),e.addEventListener("error",t=>{if(!t.data)return;const s=o(t);s&&(s.sessionId&&v(s.sessionId,"failed"),ce(s),C("error",s))})}function Q(){document.documentElement.lang=Y.locale;const n=(d,r)=>{const t=document.getElementById(d);t&&(t.textContent=r)};n("planHeaderLabel",a("web.sidebar.plan")),n("usageHeaderLabel",a("web.sidebar.session")+" · "+a("web.sidebar.usage")),n("envHeaderLabel",a("web.sidebar.env")),n("settingsTitle",a("web.settings.title")),n("sessActiveHeader",a("web.sessions.active")),n("sessRecentHeader",a("web.sessions.recent")),n("hintEnter",a("web.input.enter")),n("hintShift",a("web.input.shift_enter")),n("hintEsc",a("web.input.esc")),n("hintAttach",a("web.input.attach")),n("bootCap",a("web.loader.boot")),st(()=>a("web.loader.greet"));const e=h?.querySelector(".mdl-tip");e&&(e.textContent=a("web.loader.greet"));const i={newChat:["plus",a("web.topbar.new_chat")],sessBtn:["menu",a("web.topbar.all_sessions")],toggleSidebar:["panel",a("web.topbar.sidebar")],openSettings:["settings",a("web.topbar.settings")],attachBtn:["image",a("web.attach.title")],closeSettings:["x",a("web.topbar.close")],sessNew:["plus",a("web.sessions.new")],sessRefresh:["refresh",a("web.sessions.refresh")],sessPrev:["chevron-left",a("web.sessbar.prev")],sessNext:["chevron-right",a("web.sessbar.next")],sessClose:["x",a("web.topbar.close")]};Object.keys(i).forEach(d=>{const r=document.getElementById(d);if(!r)return;const[t,s]=i[d];R(r,t,d==="closeSettings"||d==="sessNew"||d==="sessRefresh"?s:null),r.title=s,r.setAttribute("aria-label",s)});const o=document.getElementById("settingsIcon");o&&R(o,"settings",null),S&&(S.placeholder=a("web.input.placeholder"),S.setAttribute("aria-label",a("web.input.placeholder"))),document.querySelectorAll("#setMenu .mi").forEach(d=>{const r=d.dataset.p;r&&(d.textContent=a("web.settings."+r))});const l=document.getElementById("setSearch");l&&(l.setAttribute("placeholder",a("web.settings.search_placeholder")),l.setAttribute("aria-label",a("web.settings.search_placeholder"))),document.querySelectorAll(".content-col .panel").forEach(d=>{const r=d.querySelector("h3"),t=d.id.replace(/^p-/,"");r&&t&&(r.textContent=a("web.settings."+t))}),x(),L(),He(),D(),V.querySelector(".empty")&&E(),A&&!A.hidden&&T(!0),O(void 0,!0)}function rt(n){const e=Le(),i=r=>b.sessions.some(t=>t.id===r),o=r=>{const t=b.sessions.find(s=>s.id===r);return t&&t.name?String(t.name):r},l=(n&&i(n)?n:e.active&&i(e.active)?e.active:e.ids.find(i))||null,d=[];n&&i(n)&&d.push(n),l&&!d.includes(l)&&d.push(l);for(const r of e.ids)i(r)&&!d.includes(r)&&d.push(r);if(d.length){I(d[0],o(d[0]),"session",!0);for(const r of d.slice(1))I(r,o(r),"session",!1,!1)}}async function dt(){$e();const n=new URLSearchParams(location.search).get("session");if(window.MmaSetup)try{if(await window.MmaSetup.maybeOpen()){K();return}}catch{}try{await Z(),await Ee(),Re(qe()),Pe(),Q(),E(),x(),xe(),await N(),Be(m.config&&m.config.ui?m.config.ui.activityRail:void 0),nt(),Me(),Ye(),D(),Qe({insertPath:e=>Ze("`"+e+"` ")}),await Te(),await Ce(),await M(),await ke(),await _e(),await Ae(),rt(n);try{await J()}catch(e){console.error("initial refresh failed",e)}}finally{K()}at()}function K(){const n=document.getElementById("bootSplash");!n||n.hidden||(n.classList.add("hide"),window.setTimeout(()=>{n.hidden=!0},500))}y.applyStaticI18n=Q,dt();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{msgs as
|
|
2
|
-
`).length>12){o.classList.add("collapsed");const
|
|
1
|
+
import{msgs as _,el as i,icon as w,announce as a}from"../dom.js";import{t as d,pluralCount as A}from"../i18n.js";import{streamStateFor as C,tabs as k,session as g}from"../store.js";import{FILE_TOOLS as x,OPENABLE_TOOLS as F,LINK_TOOLS as B,categoryOf as y,labelOf as I,argText as U,formatMs as S,verbosity as b,firstOutputLine as L}from"../format.js";import{copyText as q}from"../../md.js";import{imageCard as P}from"./image-card.js";import{activeFeed as j,liveFeed as D,feedForEvent as h,clearBusy as O,clearEmpty as T,appendTo as f,insertAfter as N,appendActionsRow as $,flushRun as K,scrollToBottom as z}from"./core.js";import{finishMd as E,finishThink as R}from"./stream.js";export function onToolStart(e){const n=h(e.sessionId);if(O(n),!n)return;T(n),E(n),R(n);const o=C(n);o.pendingArgs.set(e.toolCallId,e.args||{});const r=i("div","act "+y(e.name));r.appendChild(i("span","g","◇")),r.appendChild(i("span","lab",I(e.name)));const l=U(e.args);l&&(r.appendChild(i("span","sep","·")),r.appendChild(i("span","args",l)));const t=i("span","ok","");r.appendChild(t),r.classList.add("running"),f(n,r),o.toolNodes.set(e.toolCallId,{status:t,line:r}),y(e.name)!=="recon"&&(o.runReconOnly=!1),o.runCount++}function M(e,n){if(typeof n!="string"||!n)return;const o=i("div","toolout"),r=i("div","code");if(r.textContent=n,o.appendChild(r),n.length>600||n.split(`
|
|
2
|
+
`).length>12){o.classList.add("collapsed");const p="▸ "+A("web.tool.output",n.length),s=i("span","more",p);s.addEventListener("click",()=>{const c=o.classList.toggle("collapsed");s.textContent=c?p:"▾ "+d("web.tool.collapse")}),o.appendChild(s)}const t=e&&e.parentNode?null:D();e&&e.parentNode?e.parentNode.insertBefore(o,e.nextSibling):f(t,o)}function G(e){if(typeof e!="string"||!e)return null;try{const n=new URL(e,location.href);if(n.protocol==="http:"||n.protocol==="https:"||n.protocol==="file:")return n.href}catch{return null}return null}function H(e){const n=String(e??"").replace(/\\/g,"/");try{const o=g&&g.host&&g.host.workspace?String(g.host.workspace).replace(/\\/g,"/").replace(/\/+$/,""):"";if(o&&(n===o||n.indexOf(o+"/")===0)){const r=n===o?"":n.slice(o.length+1);if(r)return r}}catch{}return n}function m(e,n,o,r){const l=h(o);if(!l)return null;if(x.indexOf(e)!==-1){const t=n.path||n.file||n.dir;if(!t)return null;const p=H(t),s=i("div","filerow "+y(e));if(s.appendChild(i("span","g","◇")),s.appendChild(i("span","lab",I(e))),s.appendChild(i("span","sep"," · ")),F.indexOf(e)!==-1){const u=i("a","path",p||String(t));u.href="/api/file?path="+encodeURIComponent(String(t)),u.target="_blank",u.rel="noopener noreferrer",u.title=d("web.card.open_title")+" · "+String(t),s.appendChild(u)}else{const u=i("span","tail",p||String(t));u.title=String(t),s.appendChild(u)}const c=i("button","copy-btn");return c.type="button",c.title=d("web.card.copy_title"),c.setAttribute("aria-label",d("web.card.copy_title")),c.appendChild(w("copy")),c.addEventListener("click",()=>{q(String(t)).then(u=>{if(c.replaceChildren(w(u?"check":"copy")),!u){const v=s.querySelector(".st");v&&(v.textContent=" ⚠")}window.setTimeout(()=>c.replaceChildren(w("copy")),1400)})}),s.appendChild(c),s.appendChild(i("span","st",r===!1?" ✗":r===!0?" ✓":"")),r===!1&&(s.dataset.fail="1"),/\.drawio(\.xml)?$/i.test(String(t))&&b()==="verbose"&&s.appendChild(i("span","detail","↳ "+d("web.card.drawio_hint"))),f(l,s),s}if(B.indexOf(e)!==-1&&n.url){const t=i("div","linkline");t.appendChild(document.createTextNode("↳ "));const p=G(n.url);if(p){const s=i("a","",n.url);s.href=p,s.target="_blank",s.rel="noopener noreferrer",t.appendChild(s);try{const c=new URL(p).hostname;c&&t.appendChild(i("span","dom"," · "+c))}catch{}}else t.appendChild(i("span","",n.url));return f(l,t),t}return null}function J(e){if(!e.success||!Array.isArray(e.images)||!e.images.length)return;const n=h(e.sessionId);if(n)for(const o of e.images){const r=P(String(e.name||""),String(o));r&&f(n,r)}}export function onToolEnd(e){Q(e),J(e)}function Q(e){const n=h(e.sessionId),o=n?C(n):null,r=o?o.toolNodes.get(e.toolCallId):void 0,l=r?r.line:null;if(r&&o){r.line.classList.remove("running");const s=S(e.durationMs);r.status.textContent=e.success?" ✓"+(s?" "+s:""):" ✗"+(s?" "+s:""),e.success||(r.status.classList.add("fail"),o.runFails++,o.runReconOnly=!1),o.toolNodes.delete(e.toolCallId)}const t=(o?o.pendingArgs.get(e.toolCallId):void 0)||{};o&&o.pendingArgs.delete(e.toolCallId);const p=t.path||t.file||t.dir;if(x.indexOf(e.name)!==-1&&p){if(l&&l.parentNode&&l.remove(),b()==="quiet"){if(e.success){const c=m(e.name,t,e.sessionId,e.success);c&&o&&o.runNodes.push(c),o&&(o.runDuration+=typeof e.durationMs=="number"?e.durationMs:0)}else{const c=m(e.name,t,e.sessionId,e.success),u=L(e.output);u&&N(c||l,i("div","detail","↳ "+u)),c&&o&&o.runNodes.push(c)}return}const s=m(e.name,t,e.sessionId,e.success);M(s||l,e.output);return}if(b()==="quiet"){if(e.success){l&&o&&o.runNodes.push(l);const s=m(e.name,t,e.sessionId,e.success);s&&o&&o.runNodes.push(s),o&&(o.runDuration+=typeof e.durationMs=="number"?e.durationMs:0)}else{const s=L(e.output);s&&N(l,i("div","detail","↳ "+s))}return}e.success&&m(e.name,t,e.sessionId,e.success),M(l,e.output)}export function onTurnEnd(e){g.busy=!1;const n=h(e.sessionId);O(n),R(n),E(n),K(n);const o=n?C(n):null;o&&o.toolNodes.forEach(t=>{t&&t.line&&n&&t.line.parentNode===n&&t.line.classList.remove("running")});const r=k.tabs.find(t=>t.id===e.sessionId);if(r&&(r.planCard=null),!n||!o){resetTurnText(n);return}if(e.success===!1){const t=e.error||(e.interrupted?d("web.turn.stopped"):d("web.turn.failed")),p=e.interrupted?"warnline":"errline",s=e.interrupted?"⚠ ":"✗ ";f(n,i("div",p,s+t)),a(t)}else{if(e.stopReason){const p=d("web.turn.stop_"+e.stopReason);f(n,i("div","warnline","⚠ "+p)),a(p)}const t=[];typeof e.toolCalls=="number"&&e.toolCalls>0&&t.push(d("web.turn.tools",{count:e.toolCalls})),typeof e.durationMs=="number"&&t.push(S(e.durationMs)),t.length&&f(n,i("div","metric","⟡ "+t.join(" · "))),a(d("web.turn.end",{count:e.toolCalls||0}))}const l=o.turnRoots.map(t=>t.innerText||t.textContent||"").join(`
|
|
3
3
|
|
|
4
|
-
`);$(n,l,o.turnMd),resetTurnText(n)}export function resetTurnText(e){if(!e)return;const n=C(e);n.turnMd="",n.turnRoots=[]}export function onErrorEvent(e){if(!e||!e.error)return;const n=h(e.sessionId);n&&
|
|
5
|
-
`).forEach(
|
|
4
|
+
`);$(n,l,o.turnMd),resetTurnText(n)}export function resetTurnText(e){if(!e)return;const n=C(e);n.turnMd="",n.turnRoots=[]}export function onErrorEvent(e){if(!e||!e.error)return;const n=h(e.sessionId);n&&f(n,i("div","errline","✗ "+e.error)),a(String(e.error))}export function onCommandOutput(e,n){const o=h(n)||_;T(o),String(e).split(`
|
|
5
|
+
`).forEach(r=>f(o,i("div","cmdout",r))),z()}export function onLog(e){if(!e||typeof e.text!="string"||!e.text||e.diagnostic&&b()!=="verbose")return;const n=h(e.sessionId)||j();if(!n)return;const o=e.level,r=o==="error"?"errline":o==="warn"?"warnline":"detail",l=o==="error"?"✗ ":o==="warn"?"⚠ ":"↳ ",t=i("div",r);t.textContent=l+e.text,f(n,t),(o==="error"||o==="warn")&&a(e.text)}
|
package/dist/assets/js/loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const w={idle:"c-dim track poke blink",think:"c-active st-think blink",read:"c-recon st-read",find:"c-recon st-find squint",web:"c-recon st-web squint",edit:"c-mutate st-edit narrow",type:"c-active st-type narrow",create:"c-mutate st-create",run:"c-exec st-run",tests:"c-exec st-tests",compact:"c-active st-compact",plan:"c-active st-plan",ask:"c-warn st-ask wide",done:"c-ok st-done happy celebrate",error:"c-err st-error sad",stop:"c-dim st-stop sleep",queued:"c-dim st-queued blink",boot:"c-dim st-boot",load:"c-dim st-load",update:"c-ok st-update happy",check:"c-recon st-check squint",warn:"c-warn st-warn squint"},_={read_file:"read",list_dir:"read",file_info:"read",load_skill:"read",session_info:"read",grep:"find",glob:"find",project_map:"find",chunk_query:"find",history:"find",recall:"find",search_history:"find",web_search:"web",web_fetch:"web",download_file:"web",web_browse:"web",write_file:"create",create_dir:"create",define_capability:"create",remember:"create",edit_file:"edit",move_file:"edit",delete_file:"edit",attach_image:"edit",bash:"run",pipeline_run:"run",process_wait:"run",process_kill:"run",browser:"run",subagent:"run",mcp_call:"run",enable_tools:"run",plan:"plan",todo:"plan",verify:"plan",lsp_check:"check",set_thinking:"think",approve:"ask",question:"ask",meet_done:"done"};export function lspOutputSignal(e){return e?e.includes("[LSP check failed")||e.includes("[LSP disabled")?"failed":e.includes("[LSP errors]")?"errors":null:null}export function toolState(e){return _[e]||"run"}export function loaderStateFor(e){switch(e.type){case"turn_end":return e.success===!1?"error":"done";case"error":case"retract":return"error";case"question":return"ask";case"text":return"type";case"tool_start":case"tool_end":{const n=e.name||"";if(n==="lsp_check"&&e.type==="tool_end"&&e.success===!1)return"warn";const t=lspOutputSignal(e.output);if(e.type==="tool_end"){if(t==="errors")return"warn";if(t==="failed")return"error"}return toolState(n)}case"index":return"find";case"setup_done":return"done";case"update":return"update";case"usage":case"state":case"config":case"files":case"sessions":case"plugins":case"log":return"idle";default:return"think"}}export const MMART_NAME="MMART";let h=()=>`Привет! Я ${MMART_NAME}`;export function setGreetResolver(e){h=e}function s(e,n,t){const r=document.createElement(e);return n&&(r.className=n),t!=null&&(r.textContent=t),r}export function createFace(e="think",n=null){const t=s("span");t.setAttribute("aria-hidden","true"),t.dataset.size=n||"";const r=s("span","eyes");r.appendChild(s("i","eye left")),r.appendChild(s("i","eye right"));const o=s("span","orb");o.appendChild(s("i"));const a=s("span","keys");for(let i=0;i<4;i++)a.appendChild(s("i"));const c=s("span","dust");for(let i=0;i<3;i++)c.appendChild(s("i"));return t.append(r,o,a,s("span","grow"),s("span","fly"),c,s("span","q","?"),s("span","spark","✦"),s("span","star"),s("span","mdl-tip")),setFaceState(t,e),t}export function setFaceState(e,n){if(!e)return;const t=e.dataset.size||"";e.className="mdl"+(t?" "+t:"")+" "+w[n],e.dataset.state=n,w[n].includes("track")||(e.style.setProperty("--ex","0px"),e.style.setProperty("--ey","0px"),e.style.setProperty("--tilt","0deg"))}const u=new WeakMap;function b(e){const n=e.querySelector(".mdl-tip");if(!n)return;n.textContent=h(),e.classList.add("show-tip");const t=u.get(e);t!==void 0&&window.clearTimeout(t),u.set(e,window.setTimeout(()=>{e.classList.remove("show-tip"),u.delete(e)},2200))}function p(e){return Array.from(document.querySelectorAll(e))}function x(e,n){for(const t of p(".mdl.track")){const r=t.getBoundingClientRect(),o=r.left+r.width/2,a=r.top+r.height/2,c=e-o,i=n-a,l=Math.hypot(c,i)||1,f=r.width*.16,d=Math.min(1,l/140),y=c/l,m=i/l;t.style.setProperty("--ex",(y*f*d).toFixed(1)+"px"),t.style.setProperty("--ey",(m*f*d).toFixed(1)+"px"),t.style.setProperty("--tilt",(y*6*d).toFixed(2)+"deg")}}function g(){for(const e of p(".mdl.track"))e.style.setProperty("--ex","0px"),e.style.setProperty("--ey","0px"),e.style.setProperty("--tilt","0deg")}function v(e){const n=e.target;return!n||typeof n.closest!="function"?null:n.closest(".mdl.poke")}let k=!1;export function initCursor(){if(k||typeof window>"u")return;k=!0,window.addEventListener("mousemove",n=>x(n.clientX,n.clientY)),window.addEventListener("mouseleave",g);let e=null;window.addEventListener("click",n=>{const t=p(".mdl.poke");if(t.length){for(const o of t)o.classList.remove("blink-once"),o.offsetWidth,o.classList.add("blink-once");e!==null&&window.clearTimeout(e),e=window.setTimeout(()=>{for(const o of t)o.classList.remove("blink-once");e=null},130)}const r=v(n);r&&b(r)})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{el as a,makeToggle as g}from"../dom.js";import{tagsEditor as b,checkboxEditor as p,tableEditor as w}from"./editors.js";export function validateJson(i){const e=String(i??"").trim();if(!e)return{ok:!1,error:"required"};try{return JSON.parse(e),{ok:!0}}catch(t){return{ok:!1,error:t instanceof Error?t.message:"invalid JSON"}}}function u(i,e){const t=a("input");return t.setAttribute("aria-label",i),t.value=e,t}function m(i,e,t){const l=t.optionsSource==="providers"?e.providerOptions||[]:e.modelOptions||[],s=typeof i=="string"?i:"";if(!l.length){const o=u(e.label,s);return o.addEventListener("change",()=>e.post(o.value)),o}const n=a("select");n.setAttribute("aria-label",e.label);const c=a("option","",e.emptyLabel||"—");c.value="",n.appendChild(c);const d=new Set([""]);if(l.forEach(o=>{if(d.has(o))return;d.add(o);const y=a("option","",o);y.value=o,o===s&&(y.selected=!0),n.appendChild(y)}),s&&!d.has(s)){const o=a("option","",s);o.value=s,o.selected=!0,n.appendChild(o)}return n.value=s||"",n.addEventListener("change",()=>e.post(n.value)),n}export function controlFor(i,e,t){if(i.readOnly){const s=a("span","val dim",e==null?"—":String(e));return e!=null&&(s.title=String(e)),s}if(i.valueType==="bool")return g(!!e,s=>(t.post(s),!0));if(i.valueType==="enum"){const s=a("select");return s.setAttribute("aria-label",t.label),(i.enum||[]).forEach(n=>{const c=a("option","",t.enumLabel(n));c.value=n,n===e&&(c.selected=!0),s.appendChild(c)}),s.addEventListener("change",()=>t.post(s.value)),s}if(i.valueType==="int"){const s=u(t.label,e==null?"":String(e));return s.type="number",i.min!=null&&(s.min=String(i.min)),i.max!=null&&(s.max=String(i.max)),i.step!=null&&(s.step=String(i.step)),s.addEventListener("change",()=>t.post(s.value)),s}if(i.valueType==="share"){const s=u(t.label,e==null?"":Math.round(Number(e)*100)+"%");return s.addEventListener("change",()=>t.post(s.value)),s}const r=i.editor;if(r&&r.kind==="select")return m(e,t,r);if(r&&r.kind==="tags"&&(i.valueType==="list"||i.valueType==="json"))return b(e,t,r);if(r&&r.kind==="checkboxes")return p(e,t,r);if(r&&r.kind==="table")return w(e,t,r);if(i.valueType==="list"){const s=Array.isArray(e)?e.join(", "):e==null?"":String(e),n=u(t.label,s);return n.placeholder="a, b, c",n.addEventListener("change",()=>t.post(n.value)),n}if(i.valueType==="json"){const s=a("div","jsonctl"),n=a("textarea");n.setAttribute("aria-label",t.label),n.rows=3,n.value=e==null?"":JSON.stringify(e,null,2);const c=a("div","json-err");return c.hidden=!0,n.addEventListener("input",()=>{const d=validateJson(n.value);c.hidden=d.ok,c.textContent=d.ok?"":String(d.error||"invalid JSON")}),n.addEventListener("change",()=>{validateJson(n.value).ok?t.post(n.value.trim()):n.focus()}),s.appendChild(n),s.appendChild(c),s}const l=u(t.label,e==null?"":String(e));return l.addEventListener("change",()=>t.post(l.value)),l}export const PANEL_SECTIONS={general:[{id:"general.interface",titleKey:"web.settings.sec.general.interface",keys:["locale","ui.verbosity"]},{id:"general.agent",titleKey:"web.settings.sec.general.agent",descKey:"web.settings.sec.general.agent.desc",keys:["maxToolIterations","stuckThreshold","autoPlan","execution.autoAdvance"]},{id:"general.provider",titleKey:"web.settings.sec.general.provider",keys:["provider.fallback"]}],model:[{id:"model.tuning",titleKey:"web.settings.sec.model.tuning",descKey:"web.settings.sec.model.tuning.desc",keys:["provider.maxCompletionTokens","modelLoad.autoLoad","modelLoad.flashAttention","modelLoad.evalBatchSize","modelLoad.offloadKvCacheToGpu"]},{id:"model.capabilities",titleKey:"web.settings.sec.model.capabilities",descKey:"web.settings.sec.model.capabilities.desc",keys:["modelCapabilities"]}],context:[{id:"context.window",titleKey:"web.settings.sec.context.window",descKey:"web.settings.sec.context.window.desc",keys:["contextWindow","contextAuto","contextBudget.systemPrompt","contextBudget.responseReserve"]},{id:"context.compaction",titleKey:"web.settings.sec.context.compaction",descKey:"web.settings.sec.context.compaction.desc",keys:["contextBudget.compactionThreshold","contextBudget.compactionMinLoad","contextBudget.policy","contextBudget.compactionSummary","contextBudget.overflowCooldown","contextBudget.toolResultKeep","contextBudget.calibrationWarmup","contextBudget.ratioFloor"]},{id:"context.instructions",titleKey:"web.settings.sec.context.instructions",descKey:"web.settings.sec.context.instructions.desc",keys:["instructions.summarize"]},{id:"context.indexer",titleKey:"web.settings.sec.context.indexer",descKey:"web.settings.sec.context.indexer.desc",keys:["indexer.maxFiles","indexer.respectGitignore","indexer.mapTokenBudget"]},{id:"context.log",titleKey:"web.settings.sec.context.log",descKey:"web.settings.sec.context.log.desc",keys:["contextLog.enabled","contextLog.redact"]}],reasoning:[{id:"reasoning.display",titleKey:"web.settings.sec.reasoning.display",keys:["showReasoning"]},{id:"reasoning.effort",titleKey:"web.settings.sec.reasoning.effort",descKey:"web.settings.sec.reasoning.effort.desc",keys:["reasoning.mode","reasoning.min","reasoning.max","reasoning.baseline","reasoning.overrideCooldown"]}],agent:[{id:"agent.moe",titleKey:"web.settings.sec.agent.moe",descKey:"web.settings.sec.agent.moe.desc",keys:["moe.enabled","moe.maxReplanCycles","moe.parallelSubtasks","orchestrator.model","orchestrator.provider","orchestrator.contextWindow","experts"]},{id:"agent.critic",titleKey:"web.settings.sec.agent.critic",descKey:"web.settings.sec.agent.critic.desc",keys:["critic.enabled","critic.model","critic.provider","critic.tools","critic.maxCalls","critic.maxRepairCycles","critic.timeoutMs"]},{id:"agent.tools",titleKey:"web.settings.sec.agent.tools",descKey:"web.settings.sec.agent.tools.desc",keys:["tools.enableOnDemand","tools.defaultTags","tools.grepEngine","skills.budget"]},{id:"agent.subagent",titleKey:"web.settings.sec.agent.subagent",descKey:"web.settings.sec.agent.subagent.desc",keys:["subagent.resultMode","subagent.maxSummaryChars","subagent.maxParallelChunkQueries","subagent.stableSystemPrompt","subagent.timeoutMs"]},{id:"agent.hallucination",titleKey:"web.settings.sec.agent.hallucination",descKey:"web.settings.sec.agent.hallucination.desc",keys:["hallucination.judge.enabled"]}],network:[{id:"network.web",titleKey:"web.settings.sec.network.web",descKey:"web.settings.sec.network.web.desc",keys:["webSearch.enabled"]},{id:"network.error",titleKey:"web.settings.sec.network.error",descKey:"web.settings.sec.network.error.desc",keys:["errorWebSearch.enabled","errorWebSearch.threshold","errorWebSearch.maxResults","errorWebSearch.maxQueryChars","errorWebSearch.maxSearchesPerSession","errorWebSearch.requestTimeoutMs"]},{id:"network.service",titleKey:"web.settings.sec.network.service",descKey:"web.settings.sec.network.service.desc",keys:["service.port","service.host","service.token","service.resultRetentionDays","service.idempotencyTtlHours","service.syncWaitMs","service.maxQueueLength","service.callbackTimeoutMs","service.webhookSecret"]}],browser:[{id:"browser.main",titleKey:"web.settings.sec.browser.main",keys:["browser.enabled","browser.headless"]},{id:"browser.limits",titleKey:"web.settings.sec.browser.limits",descKey:"web.settings.sec.browser.limits.desc",keys:["browser.maxElements","browser.maxContentChars","browser.maxConsoleEntries","browser.maxConsoleLineChars"]},{id:"browser.viewport",titleKey:"web.settings.sec.browser.viewport",keys:["browser.viewportWidth","browser.viewportHeight","browser.navigationTimeout"]}],sessions:[{id:"sessions.main",titleKey:"web.settings.sec.sessions.main",descKey:"web.settings.sec.sessions.main.desc",keys:["session.autoSave","session.autoName","session.maxSessions","session.isolateMemory"]},{id:"sessions.isolation",titleKey:"web.settings.sec.sessions.isolation",descKey:"web.settings.sec.sessions.isolation.desc",keys:["sessionIsolation.enabled","sessionIsolation.isolatePlugins","sessionIsolation.isolateTempFiles"]}],ui:[{id:"ui.chat",titleKey:"web.settings.sec.ui.chat",descKey:"web.settings.sec.ui.chat.desc",keys:["ui.fontSize","ui.activityRail","ui.spinner","ui.showContextStats","ui.showCompaction"]},{id:"ui.images",titleKey:"web.settings.sec.ui.images",descKey:"web.settings.sec.ui.images.desc",keys:["images.maxCount","images.maxBytes"]}],security:[{id:"security.switches",titleKey:"web.settings.sec.security.switches",descKey:"web.settings.sec.security.switches.desc",keys:["security.enabled","security.bash.enabled","security.bash.blockDangerousFlags","security.paths.enabled","security.contentScan.enabled","security.network.enabled","security.sessionEncryption.enabled"]},{id:"security.limits",titleKey:"web.settings.sec.security.limits",descKey:"web.settings.sec.security.limits.desc",keys:["security.maxRecursionDepth","security.maxFileOperations","security.rateLimits.maxRequestsPerMinute","security.rateLimits.maxParallelTasks","security.network.requestTimeout","security.network.maxResponseSize"]},{id:"security.bash",titleKey:"web.settings.sec.security.bash",descKey:"web.settings.sec.security.bash.desc",keys:["security.bash.blacklist","security.bash.whitelist","security.bash.dangerousFlags","security.bash.dangerousOperators"]},{id:"security.paths",titleKey:"web.settings.sec.security.paths",descKey:"web.settings.sec.security.paths.desc",keys:["security.paths.denied","security.paths.allowed"]},{id:"security.network",titleKey:"web.settings.sec.security.network",descKey:"web.settings.sec.security.network.desc",keys:["security.network.deniedDomains","security.network.allowedDomains"]},{id:"security.scan",titleKey:"web.settings.sec.security.scan",descKey:"web.settings.sec.security.scan.desc",keys:["security.contentScan.dangerousPatterns"]},{id:"security.audit",titleKey:"web.settings.sec.security.audit",descKey:"web.settings.sec.security.audit.desc",keys:["security.auditNotifier.enabled","security.auditNotifier.filePath","security.auditNotifier.webhookUrl","security.auditNotifier.webhookTimeout","security.auditNotifier.minSeverity","security.auditNotifier.maxRetries","security.auditNotifier.eventTypes"]},{id:"security.encryption",titleKey:"web.settings.sec.security.encryption",descKey:"web.settings.sec.security.encryption.desc",keys:["security.sessionEncryption.encryptHistory","security.sessionEncryption.encryptSessionLog","security.sessionEncryption.keyPath"]}],advanced:[{id:"advanced.diagnostics",titleKey:"web.settings.sec.advanced.diagnostics",descKey:"web.settings.sec.advanced.diagnostics.desc",keys:["logLevel","version"]},{id:"advanced.retry",titleKey:"web.settings.sec.advanced.retry",descKey:"web.settings.sec.advanced.retry.desc",keys:["retry.maxRetries","retry.baseDelay","retry.maxDelay","retry.maxStreamRetries","retry.noDataTimeoutMs"]},{id:"advanced.service",titleKey:"web.settings.sec.advanced.service",descKey:"web.settings.sec.advanced.service.desc",keys:["pricing.enabled","pricing.overrides","updater.enabled","updater.autoInstall","updater.intervalMs"]}],plugins:[{id:"plugins.registry",titleKey:"web.settings.sec.plugins.registry",descKey:"web.settings.sec.plugins.registry.desc",keys:["plugins.disabled","plugins.maxDrafts"]},{id:"plugins.lsp",titleKey:"web.settings.sec.plugins.lsp",descKey:"web.settings.sec.plugins.lsp.desc",keys:["lsp.enabled","lsp.offline"]}]};export function keyToPanel(){const i=new Map;for(const[e,t]of Object.entries(PANEL_SECTIONS))for(const r of t)for(const l of r.keys)i.set(l,e);return i}
|
|
1
|
+
import{el as a,makeToggle as g}from"../dom.js";import{tagsEditor as b,checkboxEditor as p,tableEditor as w}from"./editors.js";export function validateJson(i){const e=String(i??"").trim();if(!e)return{ok:!1,error:"required"};try{return JSON.parse(e),{ok:!0}}catch(t){return{ok:!1,error:t instanceof Error?t.message:"invalid JSON"}}}function u(i,e){const t=a("input");return t.setAttribute("aria-label",i),t.value=e,t}function m(i,e,t){const l=t.optionsSource==="providers"?e.providerOptions||[]:e.modelOptions||[],s=typeof i=="string"?i:"";if(!l.length){const o=u(e.label,s);return o.addEventListener("change",()=>e.post(o.value)),o}const n=a("select");n.setAttribute("aria-label",e.label);const c=a("option","",e.emptyLabel||"—");c.value="",n.appendChild(c);const d=new Set([""]);if(l.forEach(o=>{if(d.has(o))return;d.add(o);const y=a("option","",o);y.value=o,o===s&&(y.selected=!0),n.appendChild(y)}),s&&!d.has(s)){const o=a("option","",s);o.value=s,o.selected=!0,n.appendChild(o)}return n.value=s||"",n.addEventListener("change",()=>e.post(n.value)),n}export function controlFor(i,e,t){if(i.readOnly){const s=a("span","val dim",e==null?"—":String(e));return e!=null&&(s.title=String(e)),s}if(i.valueType==="bool")return g(!!e,s=>(t.post(s),!0));if(i.valueType==="enum"){const s=a("select");return s.setAttribute("aria-label",t.label),(i.enum||[]).forEach(n=>{const c=a("option","",t.enumLabel(n));c.value=n,n===e&&(c.selected=!0),s.appendChild(c)}),s.addEventListener("change",()=>t.post(s.value)),s}if(i.valueType==="int"){const s=u(t.label,e==null?"":String(e));return s.type="number",i.min!=null&&(s.min=String(i.min)),i.max!=null&&(s.max=String(i.max)),i.step!=null&&(s.step=String(i.step)),s.addEventListener("change",()=>t.post(s.value)),s}if(i.valueType==="share"){const s=u(t.label,e==null?"":Math.round(Number(e)*100)+"%");return s.addEventListener("change",()=>t.post(s.value)),s}const r=i.editor;if(r&&r.kind==="select")return m(e,t,r);if(r&&r.kind==="tags"&&(i.valueType==="list"||i.valueType==="json"))return b(e,t,r);if(r&&r.kind==="checkboxes")return p(e,t,r);if(r&&r.kind==="table")return w(e,t,r);if(i.valueType==="list"){const s=Array.isArray(e)?e.join(", "):e==null?"":String(e),n=u(t.label,s);return n.placeholder="a, b, c",n.addEventListener("change",()=>t.post(n.value)),n}if(i.valueType==="json"){const s=a("div","jsonctl"),n=a("textarea");n.setAttribute("aria-label",t.label),n.rows=3,n.value=e==null?"":JSON.stringify(e,null,2);const c=a("div","json-err");return c.hidden=!0,n.addEventListener("input",()=>{const d=validateJson(n.value);c.hidden=d.ok,c.textContent=d.ok?"":String(d.error||"invalid JSON")}),n.addEventListener("change",()=>{validateJson(n.value).ok?t.post(n.value.trim()):n.focus()}),s.appendChild(n),s.appendChild(c),s}const l=u(t.label,e==null?"":String(e));return l.addEventListener("change",()=>t.post(l.value)),l}export const PANEL_SECTIONS={general:[{id:"general.interface",titleKey:"web.settings.sec.general.interface",keys:["locale","ui.verbosity"]},{id:"general.agent",titleKey:"web.settings.sec.general.agent",descKey:"web.settings.sec.general.agent.desc",keys:["maxToolIterations","stuckThreshold","autoPlan","execution.autoAdvance"]},{id:"general.provider",titleKey:"web.settings.sec.general.provider",keys:["provider.fallback"]}],model:[{id:"model.tuning",titleKey:"web.settings.sec.model.tuning",descKey:"web.settings.sec.model.tuning.desc",keys:["provider.maxCompletionTokens","modelLoad.autoLoad","modelLoad.flashAttention","modelLoad.evalBatchSize","modelLoad.offloadKvCacheToGpu"]},{id:"model.capabilities",titleKey:"web.settings.sec.model.capabilities",descKey:"web.settings.sec.model.capabilities.desc",keys:["modelCapabilities"]}],context:[{id:"context.window",titleKey:"web.settings.sec.context.window",descKey:"web.settings.sec.context.window.desc",keys:["contextWindow","contextAuto","contextBudget.systemPrompt","contextBudget.responseReserve"]},{id:"context.compaction",titleKey:"web.settings.sec.context.compaction",descKey:"web.settings.sec.context.compaction.desc",keys:["contextBudget.compactionThreshold","contextBudget.compactionMinLoad","contextBudget.policy","contextBudget.compactionSummary","contextBudget.overflowCooldown","contextBudget.toolResultKeep","contextBudget.calibrationWarmup","contextBudget.ratioFloor"]},{id:"context.instructions",titleKey:"web.settings.sec.context.instructions",descKey:"web.settings.sec.context.instructions.desc",keys:["instructions.summarize"]},{id:"context.indexer",titleKey:"web.settings.sec.context.indexer",descKey:"web.settings.sec.context.indexer.desc",keys:["indexer.maxFiles","indexer.respectGitignore","indexer.mapTokenBudget"]},{id:"context.log",titleKey:"web.settings.sec.context.log",descKey:"web.settings.sec.context.log.desc",keys:["contextLog.enabled","contextLog.redact"]}],reasoning:[{id:"reasoning.display",titleKey:"web.settings.sec.reasoning.display",keys:["showReasoning"]},{id:"reasoning.effort",titleKey:"web.settings.sec.reasoning.effort",descKey:"web.settings.sec.reasoning.effort.desc",keys:["reasoning.mode","reasoning.min","reasoning.max","reasoning.baseline","reasoning.overrideCooldown"]}],agent:[{id:"agent.moe",titleKey:"web.settings.sec.agent.moe",descKey:"web.settings.sec.agent.moe.desc",keys:["moe.enabled","moe.maxReplanCycles","moe.parallelSubtasks","orchestrator.model","orchestrator.provider","orchestrator.contextWindow","experts"]},{id:"agent.critic",titleKey:"web.settings.sec.agent.critic",descKey:"web.settings.sec.agent.critic.desc",keys:["critic.enabled","critic.model","critic.provider","critic.tools","critic.maxCalls","critic.maxRepairCycles","critic.timeoutMs"]},{id:"agent.tools",titleKey:"web.settings.sec.agent.tools",descKey:"web.settings.sec.agent.tools.desc",keys:["tools.enableOnDemand","tools.defaultTags","tools.grepEngine","skills.budget"]},{id:"agent.subagent",titleKey:"web.settings.sec.agent.subagent",descKey:"web.settings.sec.agent.subagent.desc",keys:["subagent.resultMode","subagent.maxSummaryChars","subagent.maxParallelChunkQueries","subagent.stableSystemPrompt","subagent.timeoutMs"]},{id:"agent.hallucination",titleKey:"web.settings.sec.agent.hallucination",descKey:"web.settings.sec.agent.hallucination.desc",keys:["hallucination.judge.enabled"]}],network:[{id:"network.web",titleKey:"web.settings.sec.network.web",descKey:"web.settings.sec.network.web.desc",keys:["webSearch.enabled"]},{id:"network.error",titleKey:"web.settings.sec.network.error",descKey:"web.settings.sec.network.error.desc",keys:["errorWebSearch.enabled","errorWebSearch.threshold","errorWebSearch.maxResults","errorWebSearch.maxQueryChars","errorWebSearch.maxSearchesPerSession","errorWebSearch.requestTimeoutMs"]},{id:"network.service",titleKey:"web.settings.sec.network.service",descKey:"web.settings.sec.network.service.desc",keys:["service.port","service.host","service.token","service.resultRetentionDays","service.idempotencyTtlHours","service.syncWaitMs","service.maxQueueLength","service.callbackTimeoutMs","service.webhookSecret"]}],browser:[{id:"browser.main",titleKey:"web.settings.sec.browser.main",keys:["browser.enabled","browser.headless"]},{id:"browser.limits",titleKey:"web.settings.sec.browser.limits",descKey:"web.settings.sec.browser.limits.desc",keys:["browser.maxElements","browser.maxContentChars","browser.maxConsoleEntries","browser.maxConsoleLineChars"]},{id:"browser.viewport",titleKey:"web.settings.sec.browser.viewport",keys:["browser.viewportWidth","browser.viewportHeight","browser.navigationTimeout"]}],sessions:[{id:"sessions.main",titleKey:"web.settings.sec.sessions.main",descKey:"web.settings.sec.sessions.main.desc",keys:["session.autoSave","session.autoName","session.maxSessions","session.isolateMemory"]},{id:"sessions.isolation",titleKey:"web.settings.sec.sessions.isolation",descKey:"web.settings.sec.sessions.isolation.desc",keys:["sessionIsolation.enabled","sessionIsolation.isolatePlugins","sessionIsolation.isolateTempFiles"]}],ui:[{id:"ui.chat",titleKey:"web.settings.sec.ui.chat",descKey:"web.settings.sec.ui.chat.desc",keys:["ui.fontSize","ui.activityRail","ui.spinner","ui.showContextStats","ui.showCompaction"]},{id:"ui.images",titleKey:"web.settings.sec.ui.images",descKey:"web.settings.sec.ui.images.desc",keys:["images.maxCount","images.maxBytes"]}],security:[{id:"security.switches",titleKey:"web.settings.sec.security.switches",descKey:"web.settings.sec.security.switches.desc",keys:["security.enabled","security.bash.enabled","security.bash.blockDangerousFlags","security.paths.enabled","security.contentScan.enabled","security.network.enabled","security.sessionEncryption.enabled"]},{id:"security.limits",titleKey:"web.settings.sec.security.limits",descKey:"web.settings.sec.security.limits.desc",keys:["security.maxRecursionDepth","security.maxFileOperations","security.rateLimits.maxRequestsPerMinute","security.rateLimits.maxParallelTasks","security.network.requestTimeout","security.network.maxResponseSize"]},{id:"security.bash",titleKey:"web.settings.sec.security.bash",descKey:"web.settings.sec.security.bash.desc",keys:["security.bash.blacklist","security.bash.whitelist","security.bash.dangerousFlags","security.bash.dangerousOperators"]},{id:"security.paths",titleKey:"web.settings.sec.security.paths",descKey:"web.settings.sec.security.paths.desc",keys:["security.paths.denied","security.paths.allowed"]},{id:"security.network",titleKey:"web.settings.sec.security.network",descKey:"web.settings.sec.security.network.desc",keys:["security.network.deniedDomains","security.network.allowedDomains"]},{id:"security.scan",titleKey:"web.settings.sec.security.scan",descKey:"web.settings.sec.security.scan.desc",keys:["security.contentScan.dangerousPatterns"]},{id:"security.audit",titleKey:"web.settings.sec.security.audit",descKey:"web.settings.sec.security.audit.desc",keys:["security.auditNotifier.enabled","security.auditNotifier.filePath","security.auditNotifier.webhookUrl","security.auditNotifier.webhookTimeout","security.auditNotifier.minSeverity","security.auditNotifier.maxRetries","security.auditNotifier.eventTypes"]},{id:"security.encryption",titleKey:"web.settings.sec.security.encryption",descKey:"web.settings.sec.security.encryption.desc",keys:["security.sessionEncryption.encryptHistory","security.sessionEncryption.encryptSessionLog","security.sessionEncryption.keyPath"]}],advanced:[{id:"advanced.diagnostics",titleKey:"web.settings.sec.advanced.diagnostics",descKey:"web.settings.sec.advanced.diagnostics.desc",keys:["logLevel","version"]},{id:"advanced.retry",titleKey:"web.settings.sec.advanced.retry",descKey:"web.settings.sec.advanced.retry.desc",keys:["retry.maxRetries","retry.baseDelay","retry.maxDelay","retry.maxStreamRetries","retry.noDataTimeoutMs"]},{id:"advanced.service",titleKey:"web.settings.sec.advanced.service",descKey:"web.settings.sec.advanced.service.desc",keys:["pricing.enabled","pricing.overrides","updater.enabled","updater.autoInstall","updater.intervalMs"]}],plugins:[{id:"plugins.registry",titleKey:"web.settings.sec.plugins.registry",descKey:"web.settings.sec.plugins.registry.desc",keys:["plugins.disabled","plugins.maxDrafts"]},{id:"plugins.lsp",titleKey:"web.settings.sec.plugins.lsp",descKey:"web.settings.sec.plugins.lsp.desc",keys:["lsp.enabled","lsp.offline","lsp.typescriptEngine"]}]};export function keyToPanel(){const i=new Map;for(const[e,t]of Object.entries(PANEL_SECTIONS))for(const r of t)for(const l of r.keys)i.set(l,e);return i}
|