@minimax-ai/code 0.3.6 → 0.3.7
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 +18 -0
- package/CHANGELOG.zh-CN.md +13 -0
- package/README.md +20 -8
- package/README.zh-CN.md +15 -5
- package/chunks/{application-NV4X3RV4.js → application-LFPFVITL.js} +1 -1
- package/chunks/{auth-command-AYTFOBP7.js → auth-command-ZZXFBWOS.js} +1 -1
- package/chunks/{chunk-VBDTVEVF.js → chunk-5MDJKLXG.js} +1 -1
- package/chunks/{chunk-ISF4HEC4.js → chunk-ACTS7L64.js} +1 -1
- package/chunks/{chunk-EJS4KRR2.js → chunk-E3Y7YZFG.js} +1 -1
- package/chunks/{chunk-TJUTHJIS.js → chunk-MQKRH5EW.js} +2 -2
- package/chunks/{chunk-RWIFT2VZ.js → chunk-NW6DSOE3.js} +2 -2
- package/chunks/{chunk-BN5ADI2D.js → chunk-RTN2VVTR.js} +403 -403
- package/chunks/{chunk-G7PNCKMS.js → chunk-RXHPXCVW.js} +1 -1
- package/chunks/chunk-SEVVS6ZS.js +5 -0
- package/chunks/{chunk-KXO2REWJ.js → chunk-UQHSY5YK.js} +1 -1
- package/chunks/{chunk-ZXOZXMWQ.js → chunk-WMOPXI4T.js} +7 -7
- package/chunks/{chunk-RM42PCDV.js → chunk-XO2KLR35.js} +17 -17
- package/chunks/{data-dir-2ZJFRWW6.js → data-dir-BYKXIBNJ.js} +1 -1
- package/chunks/{dist-S32WQUVY.js → dist-2YKPF46H.js} +1 -1
- package/chunks/{install-source-O2EK6H3D.js → install-source-6JLUO3MG.js} +1 -1
- package/chunks/{launcher-FVXKFL4F.js → launcher-N4XF6G4T.js} +147 -146
- package/chunks/{lifecycle-E2PPZ25G.js → lifecycle-2Z6U4ZFY.js} +1 -1
- package/chunks/{main-5I5LJBKT.js → main-LM42U7RA.js} +3 -3
- package/chunks/{plugin-command-P3VM77DS.js → plugin-command-ENLMEUEV.js} +1 -1
- package/chunks/{provider-command-GUP4G3TR.js → provider-command-SHDAR5N3.js} +1 -1
- package/chunks/{run-acp-command-2YNDWCTK.js → run-acp-command-IIRG3KK2.js} +2 -2
- package/chunks/{run-exec-command-O7SOL3RW.js → run-exec-command-CWJBGPN7.js} +1 -1
- package/chunks/{update-JJ5EYXC6.js → update-HTLJYRQR.js} +1 -1
- package/cli.js +2 -2
- package/package.json +1 -1
- package/verify-native-install.mjs +3 -3
- package/chunks/chunk-J63OB7U2.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,24 @@ This changelog covers important changes that directly affect MCode TUI users. It
|
|
|
7
7
|
|
|
8
8
|
Internal refactors, test-only changes, and changes limited to other product surfaces are excluded.
|
|
9
9
|
|
|
10
|
+
## 0.3.7 · 2026-09-07
|
|
11
|
+
|
|
12
|
+
### Improved
|
|
13
|
+
|
|
14
|
+
- Long sessions search and render more smoothly, with cached search indexes and stable Markdown,
|
|
15
|
+
fewer history replays during terminal resizing, and clearer tool retry summaries.
|
|
16
|
+
- The default status line warns when remaining context reaches 25% or less. Explicitly configuring
|
|
17
|
+
`context-remaining` keeps valid usage visible; narrow terminals prioritize essential status.
|
|
18
|
+
- Terminal notifications support focus-aware policies and configurable delivery methods, with improved
|
|
19
|
+
compatibility for cmux. Composer keyboard hints follow the current platform.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Improved shared login recovery when switching accounts, cancelling login, or starting offline,
|
|
24
|
+
including concurrent credential renewal and delayed logout synchronization.
|
|
25
|
+
- Installation and repair guidance now preserves the selected package, version, and registry and
|
|
26
|
+
explains how to restore native SQLite dependencies when npm 12 blocks installation scripts.
|
|
27
|
+
|
|
10
28
|
## 0.3.6 · 2026-09-07
|
|
11
29
|
|
|
12
30
|
### Fixed
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -8,6 +8,19 @@ TUI 正式版中用户能直接感知的重要变化。收录范围以 TUI 用
|
|
|
8
8
|
|
|
9
9
|
仅内部重构、测试调整,或只影响其他产品界面且不改变 TUI 行为的变化不记录。
|
|
10
10
|
|
|
11
|
+
## 0.3.7 · 2026-09-07
|
|
12
|
+
|
|
13
|
+
### 改进
|
|
14
|
+
|
|
15
|
+
- 长会话搜索和渲染更流畅:缓存搜索索引和稳定的 Markdown 内容,减少调整终端尺寸时的历史重绘,并更清晰地展示工具重试摘要。
|
|
16
|
+
- 默认状态栏在剩余上下文不超过 25% 时提示;显式配置 `context-remaining` 可持续显示有效用量,窄屏优先保留关键状态。
|
|
17
|
+
- 终端通知支持按焦点状态和发送方式配置,改善 cmux 兼容性;输入框快捷键提示适配当前平台。
|
|
18
|
+
|
|
19
|
+
### 修复
|
|
20
|
+
|
|
21
|
+
- 改善切换账号、取消登录和离线启动时的共享登录恢复,处理并发凭据续期与延迟登出同步。
|
|
22
|
+
- 安装和修复指引保留选定的包名、版本和 registry,并说明 npm 12 阻止安装脚本时如何恢复原生 SQLite 依赖。
|
|
23
|
+
|
|
11
24
|
## 0.3.6 · 2026-09-07
|
|
12
25
|
|
|
13
26
|
### 问题修复
|
package/README.md
CHANGED
|
@@ -268,21 +268,33 @@ npm install -g @minimax-ai/code --allow-scripts=@minimax-ai/code,better-sqlite3
|
|
|
268
268
|
</details>
|
|
269
269
|
|
|
270
270
|
<details>
|
|
271
|
-
<summary>
|
|
271
|
+
<summary>npm 12 blocks installation scripts, or startup reports a missing native SQLite dependency</summary>
|
|
272
272
|
|
|
273
|
-
npm 12 blocks unapproved installation scripts by default.
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
npm 12 blocks unapproved installation scripts by default. If `npm warn install-scripts` lists
|
|
274
|
+
MCode's `postinstall` and `better-sqlite3`'s `install` as blocked, SQLite may be unavailable even
|
|
275
|
+
when npm reports `added` or `changed packages`. Startup may report `Could not locate the bindings
|
|
276
|
+
file`, a missing `better_sqlite3.node`, or an outer `migration_failed` error.
|
|
276
277
|
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
For official Shell/PowerShell installations, rerun the original installer command. The installer
|
|
279
|
+
and `/update` handle the required script options and native dependencies. If MCode cannot start,
|
|
280
|
+
repair it with the installer first.
|
|
281
|
+
|
|
282
|
+
For `npm install -g` installations, prefer the repair command printed in the startup error.
|
|
283
|
+
Use the following command when installing `latest`:
|
|
279
284
|
|
|
280
285
|
```bash
|
|
281
|
-
npm install -g @minimax-ai/code --registry=https://registry.npmjs.org/ --foreground-scripts --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3
|
|
286
|
+
npm install -g @minimax-ai/code@latest --registry=https://registry.npmjs.org/ --foreground-scripts --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3
|
|
282
287
|
```
|
|
283
288
|
|
|
289
|
+
Keep the package name, version, and registry from the original installation command. For a Preview
|
|
290
|
+
or pinned installation, retain the exact version instead of switching to `latest`. List the same
|
|
291
|
+
MCode package name and `better-sqlite3` in `--allow-scripts`. Setting `--ignore-scripts=false` alone
|
|
292
|
+
does not approve scripts in npm 12; `--include=optional` ensures the SQLite dependency is installed.
|
|
293
|
+
|
|
284
294
|
Start `mcode` after `[MCode] Native SQLite check passed.` appears. This repairs native dependencies
|
|
285
|
-
in the installation directory and preserves existing configuration and Sessions.
|
|
295
|
+
in the installation directory and preserves existing configuration and Sessions. If it still fails,
|
|
296
|
+
provide the complete new installation log and the output of `node --version` and `npm --version`
|
|
297
|
+
to investigate download, build, or runtime errors.
|
|
286
298
|
|
|
287
299
|
</details>
|
|
288
300
|
|
package/README.zh-CN.md
CHANGED
|
@@ -228,18 +228,28 @@ npm install -g @minimax-ai/code --allow-scripts=@minimax-ai/code,better-sqlite3
|
|
|
228
228
|
</details>
|
|
229
229
|
|
|
230
230
|
<details>
|
|
231
|
-
<summary>SQLite
|
|
231
|
+
<summary>npm 12 安装脚本被阻止,或启动时提示 SQLite 原生依赖缺失</summary>
|
|
232
232
|
|
|
233
|
-
npm 12
|
|
234
|
-
|
|
233
|
+
npm 12 默认阻止未经授权的安装脚本。如果安装日志出现 `npm warn install-scripts`,并列出 MCode 的
|
|
234
|
+
`postinstall` 和 `better-sqlite3` 的 `install` 被阻止,即使 npm 显示 `added` 或 `changed packages`,
|
|
235
|
+
SQLite 原生模块也可能没有准备好。启动时可能提示 `Could not locate the bindings file`、缺少
|
|
236
|
+
`better_sqlite3.node`,或外层的 `migration_failed`。
|
|
235
237
|
|
|
236
|
-
|
|
238
|
+
通过官方 Shell/PowerShell 安装器安装的用户,重跑原安装命令即可。安装器和 `/update` 会处理所需的
|
|
239
|
+
脚本参数与原生依赖;如果 MCode 已无法启动,先重跑安装器修复。
|
|
240
|
+
|
|
241
|
+
通过 `npm install -g` 安装的用户,优先执行启动错误中给出的修复命令。下面的命令适用于安装 `latest`:
|
|
237
242
|
|
|
238
243
|
```bash
|
|
239
|
-
npm install -g @minimax-ai/code --registry=https://registry.npmjs.org/ --foreground-scripts --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3
|
|
244
|
+
npm install -g @minimax-ai/code@latest --registry=https://registry.npmjs.org/ --foreground-scripts --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3
|
|
240
245
|
```
|
|
241
246
|
|
|
247
|
+
保留原安装命令的包名、版本和 registry;安装 Preview 或指定版本时,沿用原来的精确版本,避免切换到
|
|
248
|
+
`latest`。`--allow-scripts` 中填写相同的 MCode 包名及 `better-sqlite3`。只加
|
|
249
|
+
`--ignore-scripts=false` 不能代替 npm 12 的脚本授权;`--include=optional` 确保安装 SQLite 依赖。
|
|
250
|
+
|
|
242
251
|
看到 `[MCode] Native SQLite check passed.` 后再启动 `mcode`。此操作修复安装目录中的原生依赖,保留已有配置和会话。
|
|
252
|
+
若仍失败,提供本次完整安装日志,以及 `node --version` 和 `npm --version` 的输出,以继续排查下载、编译或运行时错误。
|
|
243
253
|
|
|
244
254
|
</details>
|
|
245
255
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{c as a}from"./chunk-
|
|
2
|
+
import{c as a}from"./chunk-WMOPXI4T.js";import"./chunk-C3JRMX7L.js";import"./chunk-UQHSY5YK.js";import"./chunk-NW6DSOE3.js";import"./chunk-O6RIRKRN.js";import"./chunk-HQ2U4QVQ.js";import"./chunk-MMRA4VD2.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";export{a as McodeUpdateApplication};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{a as o,b as p,c as u}from"./chunk-
|
|
2
|
+
import{a as o,b as p,c as u}from"./chunk-RXHPXCVW.js";import"./chunk-ACTS7L64.js";import{d as n}from"./chunk-5MDJKLXG.js";import"./chunk-SEVVS6ZS.js";import"./chunk-XO2KLR35.js";import"./chunk-ZITT4GJK.js";import"./chunk-MMRA4VD2.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";async function f(e={}){let t=e.createApplication?e.createApplication(e.region):await c(e.region,e.prepareDataDir),a=e.writeError??(r=>process.stderr.write(r));return(await t.login(r=>{let i=p(r.verificationUriComplete??r.verificationUri);if(a(`Open: ${i}
|
|
3
3
|
Code: ${r.userCode}
|
|
4
4
|
Waiting for authorization\u2026
|
|
5
5
|
`),e.openBrowser===!1)return;(e.openExternalTarget??o(process.cwd()))(i).catch(()=>{a(`Couldn't open the default browser. Open the authorization URL above manually.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{
|
|
2
|
+
import{k as i,m as D}from"./chunk-SEVVS6ZS.js";import{$ as a,p as n}from"./chunk-XO2KLR35.js";function o(t,r=n,e=a){return r(void 0,e())}function u(){return o(i())}function m(t){let r=t.MINIMAX_DATA_DIR?.trim();return r||t.MAVIS_DATA_DIR?.trim()||void 0}function f(t=process.env,r=u){return m(t)??r()}function v(t=u,r=process.env){return f(r,t)}function p(t={}){let r=(t.getBuildEnv??i)(),e=v(t.getDefaultDataDir??(()=>o(r)),t.environment??process.env);return(t.configureRuntimeEnvironment??D)({dataDir:e}),Promise.resolve(e)}export{o as a,f as b,v as c,p as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{b as i,c as n,d as o,
|
|
2
|
+
import{b as i,c as n,d as o,h as a,i as r}from"./chunk-SEVVS6ZS.js";function s(t){let e=i({dataDir:t.dataDir,buildEnv:t.buildEnv,region:t.region}),u=t.oauthClient??h(t.oauthEndpoints),d=r({authHome:e.namespaceHome});return new a({namespace:e,oauthClient:u,credentialStore:d,initialize:()=>n(e)})}function h(t){if(!t)throw new TypeError("Shared MCode OAuth requires explicit device authorization, token, and revocation endpoints.");return new o(t)}export{s as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{c as d,i as f}from"./chunk-
|
|
2
|
+
import{c as d,i as f}from"./chunk-MQKRH5EW.js";var h=/<(?:deliver[-_]assets|media|publish[_-]artifact|preview_card|genui-|mavis-widget|mavis-thinking|mavis-progress|think|final|permission-(?:ask|response)|questionnaire-(?:ask|response))\b|^\s*preview_cards?:\s*$/imu;function L(t){let n=k(t);return n.assets.length===0?n.text:[n.text,T(n.assets)].filter(Boolean).join(`
|
|
3
3
|
|
|
4
4
|
`)}function k(t){if(!t||!h.test(t))return{text:t,assets:[]};let n=d(t),e=[],s=[],r="\uE000mcode-protected";for(;t.includes(r);)r+="-";let i=!1,o=n.map(a=>{if(a.type==="protected"){let c=e.push(a.content)-1;return`${r}-${c}\uE001`}return h.test(a.content)?(i=!0,A(a.content,s)):a.content}).join("");if(!i)return{text:t,assets:[]};let u=_(o);e.forEach((a,c)=>{u=u.replace(`${r}-${c}\uE001`,a)});let l=[...new Map(s.map(a=>[a.path.trim(),a])).values()];return{text:u,assets:l.map(a=>({path:a.path.trim(),...a.name?.trim()?{name:a.name.trim()}:{}}))}}function A(t,n){let e=t;return e=p(e,"mavis-thinking"),e=p(e,"think"),e=w(e,"mavis-progress"),e=p(e,"permission-ask"),e=p(e,"permission-response"),e=p(e,"questionnaire-ask"),e=p(e,"questionnaire-response"),e=e.replace(/<\/?final\b[^>]*>/giu,""),e=y(e),e=$(e),e=D(e),e=E(e),e=I(e,n),e=e.replace(/<\/?(?:deliver-assets|deliver_assets)\b[^>]*>/giu,"file attachment").replace(/<media\b[^>]*\/?>/giu,"file attachment").replace(/<media\b[^>]*$/iu,""),e}function p(t,n){let e=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu"),s=t,r=t.replace(e,"");for(;r!==s;)s=r,r=r.replace(e,"");return r}function w(t,n){let e=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu"),s=t,r=t.replace(e,(i,o)=>o.trim());for(;r!==s;)s=r,r=r.replace(e,(i,o)=>o.trim());return r}function y(t){let n=/<mavis-widget\b([^>]*)>([\s\S]*?)<\/mavis-widget\s*>/giu,e=t.replace(n,(s,r,i)=>{let o=/<mavis-fallback\b[^>]*>([\s\S]*?)<\/mavis-fallback\s*>/iu.exec(i)?.[1];return o?.trim()?o.trim():v(g(r))});return e=e.replace(/<mavis-widget\b([^>]*)>[\s\S]*$/iu,(s,r)=>v(g(r))),e.replace(/<mavis-widget\b[^>]*$/iu,"Interactive content is loading\u2026")}function v(t){let n=t.kind?.trim(),e=t.title?.trim();return n&&e?`Interactive ${n}: ${e} (open in Desktop).`:e?`Interactive content: ${e} (open in Desktop).`:"Interactive content available in Desktop."}function $(t){let n=/<genui-([\w-]+)\b([^>]*)>[\s\S]*?<\/genui-\1\s*>/giu,e=/<genui-([\w-]+)\b([^>]*?)\/\s*>/giu,s=t.replace(n,(r,i,o)=>b(i,g(o)));return s=s.replace(e,(r,i,o)=>b(i,g(o))),s.replace(/<genui-[\w-]*\b[^>]*$/iu,"Interactive content is loading\u2026")}function b(t,n){if(t.toLocaleLowerCase()==="mcp-auth"){let e=n.label?.trim()||n["server-id"]?.trim();return e?`MCP authorization required: ${e} (open in Desktop).`:"MCP authorization required (open in Desktop)."}if(t.toLocaleLowerCase()==="agent-team-recommendation"){let e=n.status?.trim().toLocaleLowerCase();return e==="accepted"?"Team recommendation accepted.":e==="skipped"?"Team recommendation skipped.":"Team recommendation available in Desktop."}return"Interactive content available in Desktop."}function g(t){let n={},e=/([\w-]+)\s*=\s*(["'])(.*?)\2/gu,s;for(;(s=e.exec(t))!==null;){let r=s[1],i=s[3];r&&i!==void 0&&(n[r]=C(i))}return n}function D(t){let n=/<(deliver-assets|deliver_assets)\b[^>]*>\s*<\/\1\s*>/giu,e=t,s=t.replace(n,"");for(;s!==e;)e=s,s=s.replace(n,"");return s}function C(t){return t.replace(/"/gu,'"').replace(/'|'/gu,"'").replace(/</gu,"<").replace(/>/gu,">").replace(/&/gu,"&")}function E(t){let n=/<\/?(deliver-assets|deliver_assets)\b[^>]*>/giu,e=[],s;for(;(s=n.exec(t))!==null;)e.push({start:s.index,end:n.lastIndex,name:s[1]?.toLocaleLowerCase()??"",closing:s[0].startsWith("</")});if(e.length===0)return t;let r=[],i=new Set;if(e.forEach((l,a)=>{if(!l.closing){r.push(a);return}for(let c=r.length-1;c>=0;c-=1){let m=r[c];if(!(m===void 0||e[m]?.name!==l.name)){r.splice(c,1),i.add(m),i.add(a);return}}}),i.size===e.length)return t;let o=0,u="";return e.forEach((l,a)=>{u+=t.slice(o,l.start),u+=i.has(a)?t.slice(l.start,l.end):"file attachment",o=l.end}),u+t.slice(o)}function I(t,n){let e=t;for(let s=0;s<3;s+=1){let r=f(e),i=R(r);if(i.assets.length===0)break;n.push(...i.assets),e=i.text}return e}function R(t){let n=[],e=[];for(let s of t)s.type==="deliver-assets"||s.type==="image-gallery"?e.push(...s.items):s.content.trim()&&n.push(s.content.trim());return{text:n.join(`
|
|
5
5
|
|