mu-agent 0.1.13 → 0.2.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 +47 -0
- package/README.md +5 -3
- package/dist/bundle/chunks/{chunk-WDURT4ZM.js → chunk-AN7MSYCK.js} +1 -1
- package/dist/bundle/chunks/{chunk-3J3HSHLX.js → chunk-BK7M6BDT.js} +3 -3
- package/dist/bundle/chunks/{virtual-modules-TJPHLTRT.js → virtual-modules-U6MRV5BC.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/judge/dist/auth.js +3 -0
- package/judge/dist/mude.js +1338 -0
- package/judge/dist/setup.js +15 -4
- package/judge/manifest.json +139 -71
- package/judge/mu/{chunk-SKGYWHW6.js → chunk-6XRUK3PM.js} +1 -1
- package/judge/mu/{cloud-code-V7FOGB4J.js → cloud-code-XR7SZMJC.js} +1 -1
- package/judge/mu/index.js +501 -214
- package/kyrn/bin/kyrn-doctor +67 -13
- package/kyrn/bin/mu.mjs +143 -9
- package/kyrn/local-judge/mude-requirements.lock.txt +746 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.0] - 2026-10-23
|
|
6
|
+
|
|
7
|
+
**0.2.0 starts the era of mu's own models: `mu judge mude install` turns on mude 1.0 in one command.**
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `mu judge mude install` makes mude 1.0, mu's own decision model optimized for coding, the judge on a Mac with Apple silicon (macOS 14 or later, 8 GB of memory or more). The steps:
|
|
12
|
+
- It downloads the MLX 8-bit edition from huggingface.co/qybaihe/mude-1.0-mlx-8bit at a pinned revision: 31 files, 1.8 GB. Every file is checked against the sha256 pinned in `src/mude/manifest.ts`, and an interrupted download resumes with a range request.
|
|
13
|
+
- It makes a Python 3.13 environment with uv: the machine's own, or a pinned release mu downloads. The packages come from `kyrn/local-judge/mude-requirements.lock.txt` with `--require-hashes`.
|
|
14
|
+
- It starts the package's own System One server on 127.0.0.1:8790 (another free port when that one is taken) with a random key.
|
|
15
|
+
- It puts `mude` first in `tiers`. The key goes in the .env as `MU_JUDGE_MUDE_KEY`.
|
|
16
|
+
- What happens when mude can't answer:
|
|
17
|
+
- By default, a decision it can't answer (its server is down, or a yes/no between 0.2 and 0.8) goes to the judges that were there before. Those are hosted, so what they read leaves the machine. `tool.description` and `tool.injection` also keep going to them (`routes`): mude did worse than Jev on the first in mu's internal benchmark, and the second was not measured.
|
|
18
|
+
- With `--local-only`, mude is the only judge.
|
|
19
|
+
- Other commands: `enable [--local-only | --with-fallback]`, `disable` (back to the judges from before), `start`, `stop`, `status` and `uninstall`. `--json` prints one JSON object per line, for the desktop app.
|
|
20
|
+
- A session starts the server in the background when `tiers`, a route or `MU_JUDGE` names mude, on macOS only; the desktop app's host does too, with Electron as Node. It is shared by every session like Laya's, and uses about 4 GB of memory until stopped.
|
|
21
|
+
- The built-in judge `mude`: `typesafe` at 127.0.0.1:8790, key `MU_JUDGE_MUDE_KEY` (never sent to TypeSafe), 4 s timeout, trusted on every capability.
|
|
22
|
+
- `mu doctor` checks the mude server's `/health` and its key.
|
|
23
|
+
|
|
24
|
+
## [0.1.14] - 2026-10-23
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Spend that no message of a session carries is recorded as a `kyrn.usage` session entry (a custom entry: kept in the file, never sent to the model; format in `kyrn/docs/features/usage-accounting.md`). A reply the watchdog cuts: the aborted request reports no usage, so its output is estimated from the reasoning that had streamed at 3.5 characters per token (the median over 164 reasoning-only MiMo replies on Terminal-Bench 2.1), less any output the provider did report, and priced at the model's output rate (`source: "watchdog-cut"`, `estimated: true`). Each `delegate` or `hive` sub-agent, verifiers included, when it ends: the sums of its messages' usage and cost as it streamed them, plus its own watchdog's estimates, `partial: true` when it was stopped or failed (`source: "subagent"`, with `kind`, `name`, `role`, `status`). On Terminal-Bench 2.1, 9 cuts of about 27k reasoning tokens and one hive at three times its parent's cost were in no session file. The `watchdog.cut` presentation event's `thoughtChars` is now the whole reasoning, not the end kept for the retry.
|
|
29
|
+
- With `"recordState": true`, a decision whose questions are built from its input (one per skill in `skills.disclosure`, per capability, per memory in `memory.worth`, and so on) also keeps those questions in its ledger row (`questions`, redacted like the request). Without them such a row could not be replayed or used to train a judge. Decisions with fixed questions are named by `specId` and `specVersion`, and keep nothing more.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- An interactive turn waits less before the model starts. `skills.disclosure` is asked the moment the message arrives, alongside preflight, as `runtime.atTurnStart` meant it to be: the early question never went out, because an `input` event's context has no `getSystemPromptOptions`, so the skills question waited for preflight's verdict and then for its own. The list now comes from the last turn, or before the first from pi's `/skill:` commands (`features.skills.askEarly`, default true). Every wait before a turn ends 3 s after the message arrived instead of 4 s (`preflight.waitMs`, `catalog.waitMs`, `skills.waitMs`, `memory.waitMs`; the frame's was 3 s already). `tool.admission` holds a long result at most 2 s instead of 4 s (`admission.waitMs`). Measured in the owner's 49 interactive sessions (Jev, reached from China): the skills question added a median 0.7 s to every message; no preflight or skills verdict came between 3 and 4 s (past 3 s they came after 4.3 s and 5.2 s or not at all), and the one capability verdict that did opened nothing (none of 34 did); and 19 of 57 admission calls waited the full 4 s, while the 3 verdicts that came between 2 and 4 s dropped nothing. Replayed on those 67 turns, the wait before the model starts goes from a median 2.7 s to 1.7 s (mean 2.8 s to 2.0 s), and at most 3 s instead of 4 s. Approval, risk, constraint and injection checks wait as before.
|
|
34
|
+
- `turn.continue` in an unattended run (`mu --print`, json mode): a "you said you would" verdict (`promised`) sends the agent back at most once per user message (`features.continuation.unattendedPromised`, default 1; `maxNudges` still caps all nudges together), and not at all when the run that just ended was the agent's answer to a nudge and called no tool (`promisedAfterToolless`, default false). The ending-with-no-message rule and go-ahead nudges are unchanged, and so is an interactive session. `promised` needs a new judge capability, `intent`, which the built-in `laya` profile sets to false: with `laya,jev` it goes to Jev, and with Laya alone no `promised` nudge is sent (`continuation.localPromised: true` asks Laya again). On Terminal-Bench 2.1 (constraints-scheduling) Laya read "Done. Created `/app/meeting_scheduled.ics` …" as a promise twice; the second nudge sent the model searching `/` for test files: 4 extra requests and 51k input tokens.
|
|
35
|
+
- `capability.disclosure` is off by default (`DEFAULT_CONFIG.modes`; the manifest's `defaultMode` is `off`, and the desktop settings show it off). On Terminal-Bench 2.1 it was asked 162 times and never had an effect ("never open" was more accurate than the judge); in 49 interactive sessions it was asked 34 times and opened nothing, while each turn waited for it beside preflight (p50 0.91 s, p90 8.9 s; 6 of 34 answers late or failed). `off` now means: no judge call and no wait at the start of a turn, and packs and MCP servers stay hidden exactly as when the judge opens none. The model opens one with `find_capability`, the user with `/capabilities open`, a pack's command (`/review`, `/commit`) opens its own, and a sub-agent opens what its parent has open (`KYRN_CAPABILITIES_OPEN`, now passed with the decision off too, so a child asks nothing). Before, `off` hid nothing; that is `features.catalog: false` now, which also hands every MCP server to pi at session start (before, it only started the packs). `"modes": { "capability.disclosure": "active" }` in `mu.json`, or the desktop settings, bring the judge's choice back. So that the model knows what it can open without the judge, `find_capability`'s description lists the judged capabilities installed when the session's first turn starts, hidden or open, by id and kind, MCP servers first (`Installed: mcp:linear (MCP server), pack:ast-grep (pack), …`; at most 20, then "and N more"). It is taken once and kept for the session, so opening one never changes the description or the cached prefix; with nothing judged installed the description is as before, and an unattended run still leaves `find_capability` out (`catalog.unattendedHidden`).
|
|
36
|
+
- In the terminal and the desktop app, a call that changes files no longer waits for the checkpoint's scan after it (about 0.1 s a change on a Mac, 0.2 s in a container): the scan runs in the background, and the run ends once the last one has, waiting at most 3 s more. A rewind still waits for it, so a file changed by hand after the run is still told apart from the agent's changes.
|
|
37
|
+
- In the terminal and the desktop app, a chain of read-only shell commands (`pwd && find src -name '*.ts' | head`, `git status --short; git log --oneline -5`) no longer counts as a call that can change files, so a turn that only looks takes no checkpoint snapshot (in a container the first snapshot took a median 0.75-1.7 s). The permission gate and the constraint gate already read such chains as only looking (`isReadOnlyChain`); a chain with any other program, a redirection that writes, or `cd` before `git` still counts as a change.
|
|
38
|
+
- `turn.rewind` waits at most 3 s for its verdict (`features.checkpoint.rewindWaitMs`), not the judge's own timeout (10 s for a hosted judge, 30 s for an `llm:` one). A late verdict carries on, as the fallback did. On Terminal-Bench 2.1 every verdict came in 0.2-1.6 s.
|
|
39
|
+
- With Laya alone, `turn.continue` is no longer asked at the end of a run. Laya is trusted on neither `promised` (`intent`) nor a go-ahead (`meta`, `relate`), so its verdict could only be "end", while the run waited for it up to 3 s (`continuation.waitMs`). Laya also reads these questions with a yes bias: in Terminal-Bench 2.1 it said yes to `asks_go_ahead` 18 of 29 times and to `irreversible` 15 times, where Jev and mude said no on almost every state. Probed with clear cases, it answers them the right way round ("I've completed the task" scores 0.01-0.1 on all three questions), so the answers aren't inverted; it is a weak reader of agent messages. `continuation.localPromised: true` still asks it. Routes set with `/mu route` now count when mu works out which judge answers a decision (also for the batching of `tool.admission` and `tool.injection`).
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- `/login`: a sign-in cancelled with Escape goes back quietly also when the flow rejects with the dialog's abort (GitHub Copilot's), not only with "Login cancelled".
|
|
44
|
+
- An unattended run (`mu --print`, json mode; not a sub-agent) could not reach an MCP server that isn't `"exposure": "always"`: since #81 it leaves `find_capability` out (`catalog.unattendedHidden`) and asks no `capability.disclosure`, and #122 made that the case for `"modes": { "default": "off" }` too. Now `find_capability` stays in such a run when at least one judged MCP server is installed when its first turn starts (`features.catalog.unattendedFindWithMcp`, default true), with the installed list from #122 in its description (`mcp:linear (MCP server)`, …), so the model can open the server within the run. Packs alone don't keep it: a run without a server (Terminal-Bench has none) sends the same first request as before, and no prompt or tool description names `find_capability` there.
|
|
45
|
+
- `mu "- Fix the parser"` (a message that starts with a list item) runs instead of ending with "Unknown option: - Fix the parser". On Terminal-Bench 2.1 one task's instruction starts that way (pytorch-model-recovery), and Harbor's pi command, which mu's bench adapter builds on, puts no `--` before it: that task ended with exit 1 before the agent ran, in pi and in every mu config.
|
|
46
|
+
- With Laya first and a hosted judge behind it (`/mu judge laya,jev`), a long tool output (`tool.admission`) and fetched content (`tool.injection`) went to Jev one chunk or passage per request, as if Laya answered them, though Laya is not trusted on screening and the cascade passes them on. They go in batches now, as with Jev alone: measured on Jev, 16 chunks took 0.44 s and 7.6k tokens in one request, against 1.4 s and 11.6k as 16. Which judge answers comes from the first judge trusted on the question, and `/mu judge` changes it for the rest of the session; before, the setting at start-up stayed.
|
|
47
|
+
- `tool.risk` and the permission confirmation read a flagged command with its line breaks (`riskExcerpt`). Every run of whitespace used to become one space, so in a script `echo done` and an `rm -rf build` on the next line read as one echo. Spaces and tabs still collapse, and blank lines go. A flagged command longer than 1,500 characters (`RISK_COMMAND_CHARS`, 8,000 before) reaches the judge as the excerpt the confirmation shows: the start of the command and every flagged part with the text around it. Each rule that matched keeps at least one part. Whole scripts up to 8,000 characters read worse: on 36 dev `tool.risk` scenarios hidden among read-only commands from real sessions (144 long variants), the cost (10 per false allow, 1 per needless confirmation) went from 87 to 64 with the shipped judge model.
|
|
48
|
+
- `mu setup`'s subscription hint no longer says to start mu and type `/login`: when setup starts mu, `/login` is already open.
|
|
49
|
+
- With the judge off (`"modes": { "default": "off" }`, setup's "Not now"), nothing asks it and nothing names it. The footer status after a message is left out, where it named the judge set up ("Jev 1.13 (free): chat · answer directly · off"). `/status` says `judge: off` and no longer lists `notify.routing`, `input.interjection` and `turn.drift` as `shadow`, since a built-in mode gives way to a default of off (`DecisionEngine.overrides()`). `/doctor` no longer probes the judge with a question, which sent a request to OpenCode and brought up the free Jev's notice. It and `mu doctor` say the judge is off, leave out the Jev key row, and show `browse` as off. A first `mu setup` no longer reports a backup when the only file was the empty `auth.json` pi writes at its first start.
|
|
50
|
+
- A judge provider that ignores the `AbortSignal` can no longer hold a decision past `timeoutMs`. `Judge.evaluate` races the provider's requests against the deadline and fails with a `timeout` `JudgeError`, so the decision takes its fallback as with any late verdict. The built-in providers already stopped at the signal.
|
|
51
|
+
|
|
5
52
|
## [0.1.13] - 2026-10-22
|
|
6
53
|
|
|
7
54
|
### Added
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**A coding agent with a judgment kernel.** It hands its routine decisions to a small, fast judge model, so the main model can keep its attention on the work.
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> Source, docs and the desktop app: [github.com/qybaihe/mu](https://github.com/qybaihe/mu) (README in English, 简体中文, 繁體中文, 日本語 and 한국어).
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ mu
|
|
|
13
13
|
|
|
14
14
|
You need Node.js 22.19 or newer. The package is `mu-agent`; the command is `mu`. It runs on macOS, Linux, Windows and WSL.
|
|
15
15
|
|
|
16
|
-
`mu setup` connects a model from your shell. Paste an API key and mu detects the service from the key's format (
|
|
16
|
+
`mu setup` connects a model from your shell. Paste an API key and mu detects the service from the key's format (OpenAI, Anthropic, Google Gemini, xAI, OpenRouter, OpenCode Zen, DeepSeek, Qwen, Kimi, GLM, SiliconFlow, StepFun), or pick Ollama or your own endpoint. It checks the key with one request, picks a starting model and sets up the judge. To use a ChatGPT, Grok or Google subscription instead, choose it there and mu starts on `/login`. If no model is set up yet, the first `mu` run offers to start setup.
|
|
17
17
|
|
|
18
18
|
Inside mu, `/login` signs in to a provider or a subscription and `/model` switches models. `/help` lists everything. `mu doctor` checks your setup from the shell.
|
|
19
19
|
|
|
@@ -32,10 +32,11 @@ Out of the box, the judge is Jev 1.13, TypeSafe's hosted judge model, free on Op
|
|
|
32
32
|
- **Jev** (hosted): set `TYPESAFE_API_KEY` (TypeSafe), `MU_JUDGE_OPENROUTER_API_KEY` (Jev on OpenRouter), `AI_GATEWAY_API_KEY` (Vercel AI Gateway), `OPENCODE_API_KEY` (OpenCode Zen) or `CLOUDFLARE_API_KEY` with `CLOUDFLARE_ACCOUNT_ID` (Cloudflare Workers AI) in your environment, or add it to `~/.mu/.env` as `KEY=value`. `mu setup` asks for a key and writes it there. mu reads that file as data, never prints it and starts using the key automatically.
|
|
33
33
|
- **Another classifier** from pi's catalog: `/mu judge classifier:<provider>/<model>`, for example Cloudflare's Clef (`clef`, `clef-flash`) or a System One model on OpenRouter, with that provider's key.
|
|
34
34
|
- **CLM** (self-hosted; its encoder needs a GPU): start `clm-serve` from [Contrastive-LM/CLM](https://github.com/Contrastive-LM/CLM), then run `/mu judge clm`. For a server on another machine, add `"judges": { "clm": { "type": "clm", "baseUrl": "http://<host>:8700" } }` to `~/.mu/agent/mu.json`. If the server was started with `CLM_API_KEY`, set the same value in `MU_JUDGE_CLM_API_KEY`. `mu doctor` checks the server.
|
|
35
|
+
- **mude 1.0** (local, a Mac with Apple silicon, macOS 14+), mu's own decision model, optimized for coding: `mu judge mude install` downloads it (1.8 GB), sets it up in `~/.mu/local-judge/mude`, starts its server on 127.0.0.1 and puts it first. What it can't answer goes to the judges you had before, which are hosted; `mu judge mude enable --local-only` keeps everything on your Mac. Its server uses about 4 GB of memory until `mu judge mude stop`.
|
|
35
36
|
- **Laya** (local, macOS on Apple silicon): `mu judge setup` installs it into `~/.mu/local-judge`. It downloads about 930 MB, and only when you run that command.
|
|
36
37
|
- **Any model you already use:** `/mu judge llm:<provider>/<model>`.
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
33 of the 40 decision points act on their verdicts from the start (`active`); `context.compact` and `output.drift` belong to features that are off until you turn them on, `capability.disclosure` and `swarm.patch` are `off`, and `notify.routing`, `input.interjection` and `turn.drift` are in `shadow`. To only record what the judge would do, run `/mu mode default shadow`, or put `"modes": { "default": "shadow" }` in `~/.mu/agent/mu.json`.
|
|
39
40
|
|
|
40
41
|
## Commands
|
|
41
42
|
|
|
@@ -45,6 +46,7 @@ mu "prompt" start a session with this prompt
|
|
|
45
46
|
mu -p "prompt" run one prompt, print the answer and exit
|
|
46
47
|
mu -c | -r continue the last session | pick a session to resume
|
|
47
48
|
mu setup connect a model and choose a judge (see mu setup --help for scripting and services)
|
|
49
|
+
mu judge mude <cmd> mude 1.0 on this Mac: install | enable | disable | start | stop | status | uninstall
|
|
48
50
|
mu judge <cmd> manage the local judge, Laya (macOS on Apple silicon): setup | start | stop | status | run
|
|
49
51
|
mu ledger [n] [--json] print the judge's verdicts from the last n sessions
|
|
50
52
|
mu import <file>... import Claude Code, Codex and ZCode conversations; --list shows them (mu import --help)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{AgentSession,AgentSessionRuntime,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,InteractiveMode,LoginDialogComponent,MCP_CONNECTION_EVENT,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,RpcClient,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,SkillInvocationMessageComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,VIRTUAL_MODEL_STATE_ENTRY,applyHttpProxySettings,buildContextEntries,buildSessionContext,buildSessionProjection,calculateContextTokens,collectEntriesForBranchSummary,compact,configureHttpDispatcher,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createMcpExtension,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defaultModelPerProvider,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,getLatestCompactionEntry,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,parseArgs,parseFrontmatter,parseSessionEntries,parseSkillBlock,prepareBranchEntries,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,runRpcMode,serializeConversation,sessionEntryToContextMessages,setupCli,shouldCompact,stdioRpcTransport,stripFrontmatter,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunk-3J3HSHLX.js";import{DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,formatReadLineRange,formatSize,truncateHead,truncateLine,truncateTail,truncateToVisualLines}from"./chunk-DYTENXHX.js";import{ArminComponent}from"./chunk-FLHKNMLQ.js";import{Container,SelectList,Theme,getAvailableThemes,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunk-LT2C56HV.js";import{ProjectTrustStore,hasTrustRequiringProjectResources,loadMcpConfig}from"./chunk-6Z2347ML.js";import{readStoredCredential}from"./chunk-MF3VB62R.js";import{getPowerShellConfig,getShellConfig}from"./chunk-URBBMV3M.js";import{CONFIG_DIR_NAME,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunk-LHRPMXVI.js";import{__export}from"./chunk-JXWJOIH4.js";var dist_exports={};__export(dist_exports,{AgentSession:()=>AgentSession,AgentSessionRuntime:()=>AgentSessionRuntime,ArminComponent:()=>ArminComponent,AssistantMessageComponent:()=>AssistantMessageComponent,BashExecutionComponent:()=>BashExecutionComponent,BorderedLoader:()=>BorderedLoader,BranchSummaryMessageComponent:()=>BranchSummaryMessageComponent,CONFIG_DIR_NAME:()=>CONFIG_DIR_NAME,CURRENT_SESSION_VERSION:()=>CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent:()=>CompactionSummaryMessageComponent,CredentialSynchronizationError:()=>CredentialSynchronizationError,CustomEditor:()=>CustomEditor,CustomMessageComponent:()=>CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS:()=>DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES:()=>DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES:()=>DEFAULT_MAX_LINES,DefaultPackageManager:()=>DefaultPackageManager,DefaultResourceLoader:()=>DefaultResourceLoader,DynamicBorder:()=>DynamicBorder,ExtensionEditorComponent:()=>ExtensionEditorComponent,ExtensionInputComponent:()=>ExtensionInputComponent,ExtensionRunner:()=>ExtensionRunner,ExtensionSelectorComponent:()=>ExtensionSelectorComponent,FooterComponent:()=>FooterComponent,InteractiveMode:()=>InteractiveMode,LoginDialogComponent:()=>LoginDialogComponent,MCP_CONNECTION_EVENT:()=>MCP_CONNECTION_EVENT,ModelRegistry:()=>ModelRegistry,ModelRuntime:()=>ModelRuntime,ModelSelectorComponent:()=>ModelSelectorComponent,OAuthSelectorComponent:()=>OAuthSelectorComponent,ProjectTrustStore:()=>ProjectTrustStore,RpcClient:()=>RpcClient,SessionManager:()=>SessionManager,SessionSelectorComponent:()=>SessionSelectorComponent,SettingsManager:()=>SettingsManager,SettingsSelectorComponent:()=>SettingsSelectorComponent,ShowImagesSelectorComponent:()=>ShowImagesSelectorComponent,SkillInvocationMessageComponent:()=>SkillInvocationMessageComponent,Theme:()=>Theme,ThemeSelectorComponent:()=>ThemeSelectorComponent,ThinkingSelectorComponent:()=>ThinkingSelectorComponent,ToolExecutionComponent:()=>ToolExecutionComponent,TreeSelectorComponent:()=>TreeSelectorComponent,UserMessageComponent:()=>UserMessageComponent,UserMessageSelectorComponent:()=>UserMessageSelectorComponent,VERSION:()=>VERSION,VIRTUAL_MODEL_STATE_ENTRY:()=>VIRTUAL_MODEL_STATE_ENTRY,applyHttpProxySettings:()=>applyHttpProxySettings,buildContextEntries:()=>buildContextEntries,buildSessionContext:()=>buildSessionContext,buildSessionProjection:()=>buildSessionProjection,calculateContextTokens:()=>calculateContextTokens,collectEntriesForBranchSummary:()=>collectEntriesForBranchSummary,compact:()=>compact,configureHttpDispatcher:()=>configureHttpDispatcher,convertToLlm:()=>convertToLlm,convertToPng:()=>convertToPng,copyToClipboard:()=>copyToClipboard,createAgentSession:()=>createAgentSession,createAgentSessionFromServices:()=>createAgentSessionFromServices,createAgentSessionRuntime:()=>createAgentSessionRuntime,createAgentSessionServices:()=>createAgentSessionServices,createBashTool:()=>createBashTool,createBashToolDefinition:()=>createBashToolDefinition,createCodemodeExtension:()=>createCodemodeExtension,createCodingTools:()=>createCodingTools,createEditTool:()=>createEditTool,createEditToolDefinition:()=>createEditToolDefinition,createEventBus:()=>createEventBus,createExtensionRuntime:()=>createExtensionRuntime,createFindTool:()=>createFindTool,createFindToolDefinition:()=>createFindToolDefinition,createGrepTool:()=>createGrepTool,createGrepToolDefinition:()=>createGrepToolDefinition,createLocalBashOperations:()=>createLocalBashOperations,createLocalPowerShellOperations:()=>createLocalPowerShellOperations,createLsTool:()=>createLsTool,createLsToolDefinition:()=>createLsToolDefinition,createMcpExtension:()=>createMcpExtension,createPowerShellTool:()=>createPowerShellTool,createPowerShellToolDefinition:()=>createPowerShellToolDefinition,createReadOnlyTools:()=>createReadOnlyTools,createReadTool:()=>createReadTool,createReadToolDefinition:()=>createReadToolDefinition,createSyntheticSourceInfo:()=>createSyntheticSourceInfo,createToolSearchExtension:()=>createToolSearchExtension,createWriteTool:()=>createWriteTool,createWriteToolDefinition:()=>createWriteToolDefinition,defaultModelPerProvider:()=>defaultModelPerProvider,defineTool:()=>defineTool,detectSupportedImageMimeTypeFromFile:()=>detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions:()=>discoverAndLoadExtensions,estimateTokens:()=>estimateTokens,findCutPoint:()=>findCutPoint,findTurnStartIndex:()=>findTurnStartIndex,formatDimensionNote:()=>formatDimensionNote,formatReadLineRange:()=>formatReadLineRange,formatSize:()=>formatSize,formatSkillsForPrompt:()=>formatSkillsForPrompt,generateBranchSummary:()=>generateBranchSummary,generateDiffString:()=>generateDiffString,generateSummary:()=>generateSummary,generateSummaryWithUsage:()=>generateSummaryWithUsage,generateUnifiedPatch:()=>generateUnifiedPatch,getAgentDir:()=>getAgentDir,getDocsPath:()=>getDocsPath,getExamplesPath:()=>getExamplesPath,getLanguageFromPath:()=>getLanguageFromPath,getLastAssistantUsage:()=>getLastAssistantUsage,getLatestCompactionEntry:()=>getLatestCompactionEntry,getMarkdownTheme:()=>getMarkdownTheme,getPackageDir:()=>getPackageDir,getPowerShellConfig:()=>getPowerShellConfig,getReadmePath:()=>getReadmePath,getSelectListTheme:()=>getSelectListTheme,getSettingsListTheme:()=>getSettingsListTheme,getShellConfig:()=>getShellConfig,hasTrustRequiringProjectResources:()=>hasTrustRequiringProjectResources,highlightCode:()=>highlightCode,initTheme:()=>initTheme,isBashToolResult:()=>isBashToolResult,isEditToolResult:()=>isEditToolResult,isFindToolResult:()=>isFindToolResult,isGrepToolResult:()=>isGrepToolResult,isLsToolResult:()=>isLsToolResult,isPowerShellToolResult:()=>isPowerShellToolResult,isReadToolResult:()=>isReadToolResult,isToolCallEventType:()=>isToolCallEventType,isWriteToolResult:()=>isWriteToolResult,keyHint:()=>keyHint,keyText:()=>keyText,loadMcpConfig:()=>loadMcpConfig,loadProjectContextFiles:()=>loadProjectContextFiles,loadSkills:()=>loadSkills,loadSkillsFromDir:()=>loadSkillsFromDir,main:()=>main,migrateSessionEntries:()=>migrateSessionEntries,parseArgs:()=>parseArgs,parseFrontmatter:()=>parseFrontmatter,parseSessionEntries:()=>parseSessionEntries,parseSkillBlock:()=>parseSkillBlock,prepareBranchEntries:()=>prepareBranchEntries,rawKeyHint:()=>rawKeyHint,readStoredCredential:()=>readStoredCredential,renderDiff:()=>renderDiff,resizeImage:()=>resizeImage,resolveCliModel:()=>resolveCliModel,resolveModelScopeWithDiagnostics:()=>resolveModelScopeWithDiagnostics,runPrintMode:()=>runPrintMode,runRpcMode:()=>runRpcMode,serializeConversation:()=>serializeConversation,sessionEntryToContextMessages:()=>sessionEntryToContextMessages,setupCli:()=>setupCli,shouldCompact:()=>shouldCompact,stdioRpcTransport:()=>stdioRpcTransport,stripFrontmatter:()=>stripFrontmatter,truncateHead:()=>truncateHead,truncateLine:()=>truncateLine,truncateTail:()=>truncateTail,truncateToVisualLines:()=>truncateToVisualLines,withFileMutationQueue:()=>withFileMutationQueue,wrapRegisteredTool:()=>wrapRegisteredTool,wrapRegisteredTools:()=>wrapRegisteredTools});var SHOW_IMAGES_SELECT_LIST_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},ShowImagesSelectorComponent=class extends Container{selectList;constructor(currentValue,onSelect,onCancel){super();let items=[{value:"yes",label:"Yes",description:"Show images inline in terminal"},{value:"no",label:"No",description:"Show text placeholder instead"}];this.addChild(new DynamicBorder),this.selectList=new SelectList(items,5,getSelectListTheme(),SHOW_IMAGES_SELECT_LIST_LAYOUT),this.selectList.setSelectedIndex(currentValue?0:1),this.selectList.onSelect=item=>{onSelect(item.value==="yes")},this.selectList.onCancel=()=>{onCancel()},this.addChild(this.selectList),this.addChild(new DynamicBorder)}getSelectList(){return this.selectList}};var THEME_SELECT_LIST_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},ThemeSelectorComponent=class extends Container{selectList;onPreview;constructor(currentTheme,onSelect,onCancel,onPreview){super(),this.onPreview=onPreview;let themes=getAvailableThemes(),themeItems=themes.map(name=>({value:name,label:name,description:name===currentTheme?"(current)":void 0}));this.addChild(new DynamicBorder),this.selectList=new SelectList(themeItems,10,getSelectListTheme(),THEME_SELECT_LIST_LAYOUT);let currentIndex=themes.indexOf(currentTheme);currentIndex!==-1&&this.selectList.setSelectedIndex(currentIndex),this.selectList.onSelect=item=>{onSelect(item.value)},this.selectList.onCancel=()=>{onCancel()},this.selectList.onSelectionChange=item=>{this.onPreview(item.value)},this.addChild(this.selectList),this.addChild(new DynamicBorder)}getSelectList(){return this.selectList}};export{ShowImagesSelectorComponent,ThemeSelectorComponent,dist_exports};
|
|
2
|
+
import{AgentSession,AgentSessionRuntime,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,InteractiveMode,LoginDialogComponent,MCP_CONNECTION_EVENT,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,RpcClient,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,SkillInvocationMessageComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,VIRTUAL_MODEL_STATE_ENTRY,applyHttpProxySettings,buildContextEntries,buildSessionContext,buildSessionProjection,calculateContextTokens,collectEntriesForBranchSummary,compact,configureHttpDispatcher,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createMcpExtension,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defaultModelPerProvider,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,getLatestCompactionEntry,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,parseArgs,parseFrontmatter,parseSessionEntries,parseSkillBlock,prepareBranchEntries,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,runRpcMode,serializeConversation,sessionEntryToContextMessages,setupCli,shouldCompact,stdioRpcTransport,stripFrontmatter,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunk-BK7M6BDT.js";import{DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,formatReadLineRange,formatSize,truncateHead,truncateLine,truncateTail,truncateToVisualLines}from"./chunk-DYTENXHX.js";import{ArminComponent}from"./chunk-FLHKNMLQ.js";import{Container,SelectList,Theme,getAvailableThemes,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunk-LT2C56HV.js";import{ProjectTrustStore,hasTrustRequiringProjectResources,loadMcpConfig}from"./chunk-6Z2347ML.js";import{readStoredCredential}from"./chunk-MF3VB62R.js";import{getPowerShellConfig,getShellConfig}from"./chunk-URBBMV3M.js";import{CONFIG_DIR_NAME,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunk-LHRPMXVI.js";import{__export}from"./chunk-JXWJOIH4.js";var dist_exports={};__export(dist_exports,{AgentSession:()=>AgentSession,AgentSessionRuntime:()=>AgentSessionRuntime,ArminComponent:()=>ArminComponent,AssistantMessageComponent:()=>AssistantMessageComponent,BashExecutionComponent:()=>BashExecutionComponent,BorderedLoader:()=>BorderedLoader,BranchSummaryMessageComponent:()=>BranchSummaryMessageComponent,CONFIG_DIR_NAME:()=>CONFIG_DIR_NAME,CURRENT_SESSION_VERSION:()=>CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent:()=>CompactionSummaryMessageComponent,CredentialSynchronizationError:()=>CredentialSynchronizationError,CustomEditor:()=>CustomEditor,CustomMessageComponent:()=>CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS:()=>DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES:()=>DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES:()=>DEFAULT_MAX_LINES,DefaultPackageManager:()=>DefaultPackageManager,DefaultResourceLoader:()=>DefaultResourceLoader,DynamicBorder:()=>DynamicBorder,ExtensionEditorComponent:()=>ExtensionEditorComponent,ExtensionInputComponent:()=>ExtensionInputComponent,ExtensionRunner:()=>ExtensionRunner,ExtensionSelectorComponent:()=>ExtensionSelectorComponent,FooterComponent:()=>FooterComponent,InteractiveMode:()=>InteractiveMode,LoginDialogComponent:()=>LoginDialogComponent,MCP_CONNECTION_EVENT:()=>MCP_CONNECTION_EVENT,ModelRegistry:()=>ModelRegistry,ModelRuntime:()=>ModelRuntime,ModelSelectorComponent:()=>ModelSelectorComponent,OAuthSelectorComponent:()=>OAuthSelectorComponent,ProjectTrustStore:()=>ProjectTrustStore,RpcClient:()=>RpcClient,SessionManager:()=>SessionManager,SessionSelectorComponent:()=>SessionSelectorComponent,SettingsManager:()=>SettingsManager,SettingsSelectorComponent:()=>SettingsSelectorComponent,ShowImagesSelectorComponent:()=>ShowImagesSelectorComponent,SkillInvocationMessageComponent:()=>SkillInvocationMessageComponent,Theme:()=>Theme,ThemeSelectorComponent:()=>ThemeSelectorComponent,ThinkingSelectorComponent:()=>ThinkingSelectorComponent,ToolExecutionComponent:()=>ToolExecutionComponent,TreeSelectorComponent:()=>TreeSelectorComponent,UserMessageComponent:()=>UserMessageComponent,UserMessageSelectorComponent:()=>UserMessageSelectorComponent,VERSION:()=>VERSION,VIRTUAL_MODEL_STATE_ENTRY:()=>VIRTUAL_MODEL_STATE_ENTRY,applyHttpProxySettings:()=>applyHttpProxySettings,buildContextEntries:()=>buildContextEntries,buildSessionContext:()=>buildSessionContext,buildSessionProjection:()=>buildSessionProjection,calculateContextTokens:()=>calculateContextTokens,collectEntriesForBranchSummary:()=>collectEntriesForBranchSummary,compact:()=>compact,configureHttpDispatcher:()=>configureHttpDispatcher,convertToLlm:()=>convertToLlm,convertToPng:()=>convertToPng,copyToClipboard:()=>copyToClipboard,createAgentSession:()=>createAgentSession,createAgentSessionFromServices:()=>createAgentSessionFromServices,createAgentSessionRuntime:()=>createAgentSessionRuntime,createAgentSessionServices:()=>createAgentSessionServices,createBashTool:()=>createBashTool,createBashToolDefinition:()=>createBashToolDefinition,createCodemodeExtension:()=>createCodemodeExtension,createCodingTools:()=>createCodingTools,createEditTool:()=>createEditTool,createEditToolDefinition:()=>createEditToolDefinition,createEventBus:()=>createEventBus,createExtensionRuntime:()=>createExtensionRuntime,createFindTool:()=>createFindTool,createFindToolDefinition:()=>createFindToolDefinition,createGrepTool:()=>createGrepTool,createGrepToolDefinition:()=>createGrepToolDefinition,createLocalBashOperations:()=>createLocalBashOperations,createLocalPowerShellOperations:()=>createLocalPowerShellOperations,createLsTool:()=>createLsTool,createLsToolDefinition:()=>createLsToolDefinition,createMcpExtension:()=>createMcpExtension,createPowerShellTool:()=>createPowerShellTool,createPowerShellToolDefinition:()=>createPowerShellToolDefinition,createReadOnlyTools:()=>createReadOnlyTools,createReadTool:()=>createReadTool,createReadToolDefinition:()=>createReadToolDefinition,createSyntheticSourceInfo:()=>createSyntheticSourceInfo,createToolSearchExtension:()=>createToolSearchExtension,createWriteTool:()=>createWriteTool,createWriteToolDefinition:()=>createWriteToolDefinition,defaultModelPerProvider:()=>defaultModelPerProvider,defineTool:()=>defineTool,detectSupportedImageMimeTypeFromFile:()=>detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions:()=>discoverAndLoadExtensions,estimateTokens:()=>estimateTokens,findCutPoint:()=>findCutPoint,findTurnStartIndex:()=>findTurnStartIndex,formatDimensionNote:()=>formatDimensionNote,formatReadLineRange:()=>formatReadLineRange,formatSize:()=>formatSize,formatSkillsForPrompt:()=>formatSkillsForPrompt,generateBranchSummary:()=>generateBranchSummary,generateDiffString:()=>generateDiffString,generateSummary:()=>generateSummary,generateSummaryWithUsage:()=>generateSummaryWithUsage,generateUnifiedPatch:()=>generateUnifiedPatch,getAgentDir:()=>getAgentDir,getDocsPath:()=>getDocsPath,getExamplesPath:()=>getExamplesPath,getLanguageFromPath:()=>getLanguageFromPath,getLastAssistantUsage:()=>getLastAssistantUsage,getLatestCompactionEntry:()=>getLatestCompactionEntry,getMarkdownTheme:()=>getMarkdownTheme,getPackageDir:()=>getPackageDir,getPowerShellConfig:()=>getPowerShellConfig,getReadmePath:()=>getReadmePath,getSelectListTheme:()=>getSelectListTheme,getSettingsListTheme:()=>getSettingsListTheme,getShellConfig:()=>getShellConfig,hasTrustRequiringProjectResources:()=>hasTrustRequiringProjectResources,highlightCode:()=>highlightCode,initTheme:()=>initTheme,isBashToolResult:()=>isBashToolResult,isEditToolResult:()=>isEditToolResult,isFindToolResult:()=>isFindToolResult,isGrepToolResult:()=>isGrepToolResult,isLsToolResult:()=>isLsToolResult,isPowerShellToolResult:()=>isPowerShellToolResult,isReadToolResult:()=>isReadToolResult,isToolCallEventType:()=>isToolCallEventType,isWriteToolResult:()=>isWriteToolResult,keyHint:()=>keyHint,keyText:()=>keyText,loadMcpConfig:()=>loadMcpConfig,loadProjectContextFiles:()=>loadProjectContextFiles,loadSkills:()=>loadSkills,loadSkillsFromDir:()=>loadSkillsFromDir,main:()=>main,migrateSessionEntries:()=>migrateSessionEntries,parseArgs:()=>parseArgs,parseFrontmatter:()=>parseFrontmatter,parseSessionEntries:()=>parseSessionEntries,parseSkillBlock:()=>parseSkillBlock,prepareBranchEntries:()=>prepareBranchEntries,rawKeyHint:()=>rawKeyHint,readStoredCredential:()=>readStoredCredential,renderDiff:()=>renderDiff,resizeImage:()=>resizeImage,resolveCliModel:()=>resolveCliModel,resolveModelScopeWithDiagnostics:()=>resolveModelScopeWithDiagnostics,runPrintMode:()=>runPrintMode,runRpcMode:()=>runRpcMode,serializeConversation:()=>serializeConversation,sessionEntryToContextMessages:()=>sessionEntryToContextMessages,setupCli:()=>setupCli,shouldCompact:()=>shouldCompact,stdioRpcTransport:()=>stdioRpcTransport,stripFrontmatter:()=>stripFrontmatter,truncateHead:()=>truncateHead,truncateLine:()=>truncateLine,truncateTail:()=>truncateTail,truncateToVisualLines:()=>truncateToVisualLines,withFileMutationQueue:()=>withFileMutationQueue,wrapRegisteredTool:()=>wrapRegisteredTool,wrapRegisteredTools:()=>wrapRegisteredTools});var SHOW_IMAGES_SELECT_LIST_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},ShowImagesSelectorComponent=class extends Container{selectList;constructor(currentValue,onSelect,onCancel){super();let items=[{value:"yes",label:"Yes",description:"Show images inline in terminal"},{value:"no",label:"No",description:"Show text placeholder instead"}];this.addChild(new DynamicBorder),this.selectList=new SelectList(items,5,getSelectListTheme(),SHOW_IMAGES_SELECT_LIST_LAYOUT),this.selectList.setSelectedIndex(currentValue?0:1),this.selectList.onSelect=item=>{onSelect(item.value==="yes")},this.selectList.onCancel=()=>{onCancel()},this.addChild(this.selectList),this.addChild(new DynamicBorder)}getSelectList(){return this.selectList}};var THEME_SELECT_LIST_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},ThemeSelectorComponent=class extends Container{selectList;onPreview;constructor(currentTheme,onSelect,onCancel,onPreview){super(),this.onPreview=onPreview;let themes=getAvailableThemes(),themeItems=themes.map(name=>({value:name,label:name,description:name===currentTheme?"(current)":void 0}));this.addChild(new DynamicBorder),this.selectList=new SelectList(themeItems,10,getSelectListTheme(),THEME_SELECT_LIST_LAYOUT);let currentIndex=themes.indexOf(currentTheme);currentIndex!==-1&&this.selectList.setSelectedIndex(currentIndex),this.selectList.onSelect=item=>{onSelect(item.value)},this.selectList.onCancel=()=>{onCancel()},this.selectList.onSelectionChange=item=>{this.onPreview(item.value)},this.addChild(this.selectList),this.addChild(new DynamicBorder)}getSelectList(){return this.selectList}};export{ShowImagesSelectorComponent,ThemeSelectorComponent,dist_exports};
|