@maincode-ai/matilda-code 0.21.11 → 0.21.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/bundled/mainy/docs/configuration/settings.md +16 -5
  2. package/bundled/mainy/docs/configuration/trusted-folders.md +12 -6
  3. package/chunks/agent-WM63A6NK.js +3 -0
  4. package/chunks/agent-headless-QIUBDKPW.js +3 -0
  5. package/chunks/{anthropicContentGenerator-IYZILRDW.js → anthropicContentGenerator-VKFTAIU3.js} +1 -1
  6. package/chunks/{askUserQuestion-XWHJY3DM.js → askUserQuestion-2QI4NSFJ.js} +1 -1
  7. package/chunks/{ca-EUJBUYX5.js → ca-I2HEEIL7.js} +1 -1
  8. package/chunks/{chunk-MH2P4YXC.js → chunk-27Q5KW3A.js} +2 -2
  9. package/chunks/{chunk-NYEWHSBL.js → chunk-2HTPVSGT.js} +1 -1
  10. package/chunks/{chunk-2HQMJ2IU.js → chunk-2MOGYHWM.js} +1 -1
  11. package/chunks/{chunk-WRQLIPXW.js → chunk-3IRGBRSP.js} +10 -10
  12. package/chunks/{chunk-NIQK6NX3.js → chunk-5C2RJ5RR.js} +1 -1
  13. package/chunks/{chunk-T4P4KEDW.js → chunk-6E766NPX.js} +1 -1
  14. package/chunks/{chunk-QH7736R5.js → chunk-6EQMZNIY.js} +1 -1
  15. package/chunks/{chunk-4FVBPNTZ.js → chunk-6T2GIM76.js} +1 -1
  16. package/chunks/{chunk-25NCTG5H.js → chunk-6Z2MV7ZY.js} +55 -53
  17. package/chunks/chunk-BVOCFLC4.js +56 -0
  18. package/chunks/chunk-CSJTA7NE.js +101 -0
  19. package/chunks/{chunk-SNLH42QJ.js → chunk-CZGZ3KK7.js} +1 -1
  20. package/chunks/{chunk-JXUDKX6D.js → chunk-DE3HKC2W.js} +1 -1
  21. package/chunks/{chunk-4CSSDBOS.js → chunk-DOOFGSRV.js} +10 -10
  22. package/chunks/{chunk-RK2AKQAX.js → chunk-FPO57O66.js} +6 -6
  23. package/chunks/{chunk-ODZOYHIC.js → chunk-GOJCMVJJ.js} +1 -1
  24. package/chunks/{chunk-FFFZ2QMG.js → chunk-GTVCJCHR.js} +1 -1
  25. package/chunks/{chunk-SUH3UUWZ.js → chunk-JCE3JAVC.js} +1 -1
  26. package/chunks/chunk-JRECUFB3.js +2630 -0
  27. package/chunks/chunk-KHHJYBR5.js +9 -0
  28. package/chunks/{chunk-GO2GA2GY.js → chunk-LUNDTQ3G.js} +1 -1
  29. package/chunks/{chunk-5427BPR2.js → chunk-MCQUPLRE.js} +1 -1
  30. package/chunks/{chunk-QN6WSWMM.js → chunk-MO2HXJG5.js} +1 -1
  31. package/chunks/{chunk-ELH4YHJR.js → chunk-PGXQZVLX.js} +1 -1
  32. package/chunks/{chunk-Q55AVE2N.js → chunk-QVCGLQCI.js} +11 -11
  33. package/chunks/{chunk-W5CGKUM4.js → chunk-S3CWEVTS.js} +1 -1
  34. package/chunks/{chunk-YMIF2DMT.js → chunk-VTGICC67.js} +1 -1
  35. package/chunks/chunk-WC2VTVCE.js +27 -0
  36. package/chunks/{chunk-SPW5DXX4.js → chunk-WV3IUPZS.js} +1 -1
  37. package/chunks/{chunk-4YVN5HXG.js → chunk-YJAKOETP.js} +2 -2
  38. package/chunks/{chunk-WHG6N5X2.js → chunk-YRQP3SLC.js} +1 -1
  39. package/chunks/{chunk-GUFIMKF5.js → chunk-YV3PUOBU.js} +1 -1
  40. package/chunks/{computer-use-SXP25RZQ.js → computer-use-WKDNUTLD.js} +1 -1
  41. package/chunks/contextCommand-DAB3HOHY.js +3 -0
  42. package/chunks/{cron-create-2UI4AT4Q.js → cron-create-F2LXM2OA.js} +1 -1
  43. package/chunks/{cron-delete-ZB6BOTFF.js → cron-delete-DE6Q2S2L.js} +1 -1
  44. package/chunks/{cron-list-YYAXNHB6.js → cron-list-IAQEJVV7.js} +1 -1
  45. package/chunks/{de-DNEPG7S7.js → de-AQXFJYZI.js} +1 -1
  46. package/chunks/edit-QQNJZ55P.js +43 -0
  47. package/chunks/{en-NOD6KQNM.js → en-EJLDYIBM.js} +1 -1
  48. package/chunks/{enter-worktree-X47BSJLE.js → enter-worktree-5X5SAMBJ.js} +1 -1
  49. package/chunks/{enterPlanMode-F22ZNTYJ.js → enterPlanMode-HP35SPLN.js} +1 -1
  50. package/chunks/{exit-worktree-XY5UMDHX.js → exit-worktree-SRKZBEYF.js} +1 -1
  51. package/chunks/exitPlanMode-WSPTGGVN.js +120 -0
  52. package/chunks/{fr-2OE5WLJ4.js → fr-6TDHK7F2.js} +1 -1
  53. package/chunks/{geminiContentGenerator-EQEGOXOV.js → geminiContentGenerator-RJ73DQAP.js} +1 -1
  54. package/chunks/{glob-KSBEWI3E.js → glob-QQ6LGKDX.js} +1 -1
  55. package/chunks/{goal-tools-6QTC3UI7.js → goal-tools-C6BSBHCF.js} +1 -1
  56. package/chunks/{grep-6TTPZ524.js → grep-MVCOBUYW.js} +1 -1
  57. package/chunks/{ja-3B6V5KS7.js → ja-GGNJR7AR.js} +1 -1
  58. package/chunks/{keychain-token-storage-54BNK6VH.js → keychain-token-storage-KQK6MNOJ.js} +1 -1
  59. package/chunks/{ls-YWZU3FYL.js → ls-JYJXFSXN.js} +1 -1
  60. package/chunks/{lsp-4CJDKEEC.js → lsp-DYDK6XCS.js} +1 -1
  61. package/chunks/{matildaAgentContentGenerator-OV4U6DJD.js → matildaAgentContentGenerator-YUYS4336.js} +1 -1
  62. package/chunks/{matildaContentGenerator-ETIAWE22.js → matildaContentGenerator-O4Z2QPCP.js} +1 -1
  63. package/chunks/{matildaOAuth2-WOY7ZS43.js → matildaOAuth2-7COTQQR2.js} +1 -1
  64. package/chunks/mcp-client-RXVQU5VI.js +3 -0
  65. package/chunks/monitor-77KXDXPR.js +32 -0
  66. package/chunks/{notebook-edit-TL7CI5EA.js → notebook-edit-TKJD2EQZ.js} +1 -1
  67. package/chunks/{openaiContentGenerator-MGASUFQL.js → openaiContentGenerator-2EALAM3U.js} +1 -1
  68. package/chunks/{pt-KP2JCPUY.js → pt-D6L2QTDM.js} +1 -1
  69. package/chunks/read-file-3KUAH6ND.js +3 -0
  70. package/chunks/ripGrep-U2PLKXMY.js +3 -0
  71. package/chunks/{ru-K7IQQKHC.js → ru-BNJCHDYO.js} +1 -1
  72. package/chunks/{scheduler-TKWPD4LP.js → scheduler-J7VU2V5Y.js} +1 -1
  73. package/chunks/{send-message-OO2HAKCC.js → send-message-P3SMWNEE.js} +1 -1
  74. package/chunks/{serve-ZQX2WBLF.js → serve-FXH6EBQ6.js} +36 -36
  75. package/chunks/shell-PXR2AXDD.js +3 -0
  76. package/chunks/{skill-KDM3UUML.js → skill-HZPFEAPF.js} +1 -1
  77. package/chunks/src-RFAEPLY7.js +3 -0
  78. package/chunks/{symbol-search-ALYOX5JN.js → symbol-search-EAIZPWN7.js} +1 -1
  79. package/chunks/{syntheticOutput-UASKABJH.js → syntheticOutput-432LXITX.js} +1 -1
  80. package/chunks/task-create-Z3QRCMX4.js +3 -0
  81. package/chunks/{task-detach-I67ZE5MX.js → task-detach-XMSJ3HBM.js} +1 -1
  82. package/chunks/{task-list-5BGX4G5N.js → task-list-GXAJW3JP.js} +1 -1
  83. package/chunks/{task-stop-ERI5X4AO.js → task-stop-NTS62FLG.js} +1 -1
  84. package/chunks/{task-update-CD3W556L.js → task-update-AR26UFYZ.js} +1 -1
  85. package/chunks/{team-create-F4KQRGMB.js → team-create-PYXFVIR5.js} +1 -1
  86. package/chunks/{team-delete-5U3GBFKJ.js → team-delete-OMYVUAQU.js} +1 -1
  87. package/chunks/todoWrite-5NZ7CHTC.js +3 -0
  88. package/chunks/{tool-search-JFCD5W5M.js → tool-search-RKZDSRYS.js} +1 -1
  89. package/chunks/tree-sitter-bash-2SWKO5B7.js +3 -0
  90. package/chunks/{web-fetch-REWGIRWQ.js → web-fetch-VW3SVDQ6.js} +13 -13
  91. package/chunks/{web-search-OX2DPEVN.js → web-search-XQUIZARL.js} +1 -1
  92. package/chunks/{workflow-SEFYGBED.js → workflow-YXNXDRWZ.js} +2 -2
  93. package/chunks/{write-file-UAGVBZMC.js → write-file-XDDLTGSG.js} +1 -1
  94. package/cli.js +459 -449
  95. package/locales/ca.js +1 -0
  96. package/locales/de.js +1 -0
  97. package/locales/en.js +1 -0
  98. package/locales/fr.js +1 -0
  99. package/locales/ja.js +1 -0
  100. package/locales/pt.js +1 -0
  101. package/locales/ru.js +1 -0
  102. package/package.json +2 -2
  103. package/sandbox-macos-restrictive-closed.sb +3 -0
  104. package/sandbox-macos-restrictive-open.sb +3 -0
  105. package/sandbox-macos-restrictive-proxied.sb +3 -0
  106. package/chunks/agent-ZFZ4HJQC.js +0 -3
  107. package/chunks/agent-headless-KH2BKLP7.js +0 -3
  108. package/chunks/chunk-GHBKFIHC.js +0 -35
  109. package/chunks/chunk-HWOQNYAO.js +0 -27
  110. package/chunks/chunk-NVM7W7TG.js +0 -101
  111. package/chunks/chunk-QFNFLE2I.js +0 -2625
  112. package/chunks/chunk-XCFLI3OC.js +0 -9
  113. package/chunks/contextCommand-3GN5CAOK.js +0 -3
  114. package/chunks/edit-KX6V4PH3.js +0 -39
  115. package/chunks/exitPlanMode-G3QLIWJ4.js +0 -90
  116. package/chunks/monitor-F4K5HOZX.js +0 -32
  117. package/chunks/read-file-6EAPS2KG.js +0 -3
  118. package/chunks/ripGrep-K6SFFUIE.js +0 -3
  119. package/chunks/shell-AZRK5GIO.js +0 -3
  120. package/chunks/src-SGI6VLOS.js +0 -3
  121. package/chunks/task-create-EBJD55TB.js +0 -3
  122. package/chunks/todoWrite-YGG6AZ3A.js +0 -3
  123. package/chunks/tree-sitter-bash-XNCMPQBK.js +0 -3
@@ -118,6 +118,7 @@ Settings are organized into categories. Most settings should be placed within th
118
118
  | `ui.showThinkingTrace` | boolean | Show the full reasoning trace in thinking blocks instead of the collapsed one-line summary. Toggle with `Ctrl+Q` during a session or via the Settings dialog. The setting persists across sessions. | `false` |
119
119
  | `ui.shellOutputMaxLines` | number | Max number of shell output lines shown inline. Set to `0` to disable the cap and show full output. Hidden lines are surfaced via the `+N lines` indicator. Errors, `!`-prefix user-initiated commands, confirming tools, and focused embedded shells always show full output. | `5` |
120
120
  | `ui.maxFps` | number | Cap on terminal render rate (frames per second). Higher values (e.g. `144`) reduce input-to-render latency on high-refresh displays at the cost of more CPU. Values `<= 0` are ignored (treated as the default). Requires restart. | `60` |
121
+ | `ui.maxHistoryItems` | number | Max number of messages kept in the on-screen history of a session; once exceeded, the oldest messages are dropped from view and a trim notice marks the cut. Set to `0` (or a negative value) for unlimited. Bounds memory use and per-message render cost on long sessions. The full transcript always remains on disk (see `/export`) and is unaffected. Only applies with fullscreen rendering (`ui.useTerminalBuffer`) enabled. | `2000` |
121
122
  | `ui.enableWelcomeBack` | boolean | Show welcome back dialog when returning to a project with conversation history. When enabled, Matilda Code will automatically detect if you're returning to a project with a previously generated project summary (`.matilda/PROJECT_SUMMARY.md`) and show a dialog allowing you to continue your previous conversation or start fresh. If you choose **Start new chat session**, that choice is remembered for the current project until the project summary changes. This feature integrates with the `/summary` command and quit confirmation dialog. | `true` |
122
123
  | `ui.accessibility.enableLoadingPhrases` | boolean | Enable loading phrases (disable for accessibility). | `true` |
123
124
  | `ui.accessibility.screenReader` | boolean | Enables screen reader mode, which adjusts the TUI for better compatibility with screen readers. | `false` |
@@ -150,7 +151,7 @@ Settings are organized into categories. Most settings should be placed within th
150
151
  | `model.maxToolCalls` | number | Cumulative tool-call budget for a run (counts every executed tool, success or failure; `structured_output` under `--json-schema` is exempt). `-1` means unlimited; `0` means "no tool calls allowed". Capped at 1,000,000 to catch typos. Overridable via `--max-tool-calls`. Aborts with exit code 55 when exceeded. | `-1` |
151
152
  | `model.generationConfig` | object | Advanced overrides passed to the underlying content generator. Supports request controls such as `timeout`, `maxRetries`, `enableCacheControl`, `splitToolMedia` (default `true`; splits tool-returned media — including images read by the built-in read_file — into a follow-up user message instead of the spec-violating `role: "tool"` message, so strict OpenAI-compatible servers like doubao / new-api / LM Studio can see it; set `false` to restore the legacy embed-in-tool behavior), `contextWindowSize` (override model's context window size), `modalities` (override auto-detected input modalities), `customHeaders` (custom HTTP headers for API requests), and `extra_body` (additional body parameters for OpenAI-compatible API requests only), along with fine-tuning knobs under `samplingParams` (for example `temperature`, `top_p`, `max_tokens`). Leave unset to rely on provider defaults. | `undefined` |
152
153
  | `model.chatCompression.contextPercentageThreshold` | number | **REMOVED.** Auto-compaction now uses a three-tier threshold ladder (warn / auto / hard) computed internally from the model's context window via the `computeThresholds()` function — no longer user-configurable. Setting this field in `settings.json` is silently ignored (no startup warning). There is currently no replacement for "disable compression entirely" — reactive overflow recovery remains the safety net at the API layer if compression itself fails. (See PR #4345 / `docs/design/auto-compaction-threshold-redesign.md` for the redesign rationale.) | `N/A` |
153
- | `model.chatCompression.maxRecentFilesToRetain` | number | Number of most-recently-touched files whose current content is restored (embedded if small, otherwise referenced by path) into history after auto-compaction. `0` restores none. Env override: `MATILDA_COMPACT_MAX_RECENT_FILES`. | `5` |
154
+ | `model.chatCompression.maxRecentFilesToRetain` | number | **REMOVED.** Compaction no longer restores file contents; it lists the files the session read and changed by path, and the model reads what it needs. Setting this field in `settings.json` or `MATILDA_COMPACT_MAX_RECENT_FILES` is silently ignored. | `N/A` |
154
155
  | `model.chatCompression.maxRecentImagesToRetain` | number | Number of most-recent images (tool screenshots / user pastes) restored into history after auto-compaction. `0` restores none. Env override: `MATILDA_COMPACT_MAX_RECENT_IMAGES`. | `3` |
155
156
  | `model.chatCompression.enableScreenshotTrigger` | boolean | When `true`, auto-compaction also fires once the number of tool-returned images accumulated in history reaches `screenshotTriggerThreshold`, independent of token usage — aimed at computer-use sessions where frequent screenshots dilute model attention. Counts only images returned inside tool results, not user-pasted images. Env override: `MATILDA_COMPACT_SCREENSHOT_TRIGGER` (`1`/`true`/`0`/`false`). | `true` |
156
157
  | `model.chatCompression.screenshotTriggerThreshold` | number | Tool-returned image count at or above which the screenshot trigger fires (only when `enableScreenshotTrigger`). Compaction resets the count — surviving images are re-embedded as top-level parts, which the trigger doesn't count — so it won't immediately re-fire. Env override: `MATILDA_COMPACT_SCREENSHOT_THRESHOLD`. | `50` |
@@ -442,7 +443,7 @@ LSP server configuration is done through `.lsp.json` files in your project root
442
443
 
443
444
  | Setting | Type | Description | Default |
444
445
  | ------------------------------ | ------- | ------------------------------------------------- | ----------- |
445
- | `security.folderTrust.enabled` | boolean | Setting to track whether Folder trust is enabled. | `false` |
446
+ | `security.folderTrust.enabled` | boolean | Setting to track whether Folder trust is enabled. | `true` |
446
447
  | `security.auth.selectedType` | string | The currently selected authentication type. | `undefined` |
447
448
  | `security.auth.enforcedType` | string | The required auth type (useful for enterprises). | `undefined` |
448
449
  | `security.auth.useExternal` | boolean | Whether to use an external authentication flow. | `undefined` |
@@ -453,7 +454,7 @@ LSP server configuration is done through `.lsp.json` files in your project root
453
454
  | ------------------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
454
455
  | `advanced.autoConfigureMemory` | boolean | Automatically configure Node.js memory limits. | `false` |
455
456
  | `advanced.dnsResolutionOrder` | string | The DNS resolution order. | `undefined` |
456
- | `advanced.excludedEnvVars` | array of strings | Environment variables to exclude from project context. Specifies environment variables that should be excluded from being loaded from project `.env` files. This prevents project-specific environment variables (like `DEBUG=true`) from interfering with the CLI behavior. Variables from `.matilda/.env` files are never excluded. | `["DEBUG","DEBUG_MODE"]` |
457
+ | `advanced.excludedEnvVars` | array of strings | Environment variables to exclude from project `.env` files. Configurable exclusions do not apply to `.matilda/.env` files; bootstrap and policy variables remain protected across all project environment sources. | `["DEBUG","DEBUG_MODE"]` |
457
458
  | `advanced.bugCommand` | object | Configuration for the bug report command. Overrides the default URL for the `/bug` command. Properties: `urlTemplate` (string): A URL that can contain `{title}` and `{info}` placeholders. Example: `"bugCommand": { "urlTemplate": "https://bug.example.com/new?title={title}&info={info}" }` | `undefined` |
458
459
  | `plansDirectory` | string | Custom directory for approved Plan Mode files. Relative paths are resolved from the project root, and the resolved path must stay within the project root. If unset, plan files are stored in `~/.matilda/plans`. **Requires restart.** If the directory is inside the project root, add it to `.gitignore` to avoid committing plan files. | `undefined` |
459
460
 
@@ -466,6 +467,14 @@ How much a Goal may do on its own after you create it, or resume one whose budge
466
467
  | `goal.tokenBudget` | number | Tokens a Goal may spend on its own. `-1` means unlimited. | `30000000` |
467
468
  | `goal.turnBudget` | number | Goal turns that may finish before the Goal stops and asks. `-1` means unlimited. | `50` |
468
469
 
470
+ #### planGate
471
+
472
+ Settings for the plan approval gate that reviews plans before autonomous execution (leaving plan mode under an autonomous approval mode). Optional and advanced.
473
+
474
+ | Setting | Type | Description | Default |
475
+ | -------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
476
+ | `planGate.systemOneTriage` | boolean | Screen plans with the System One evaluation endpoint (`matilda-jev`, `POST /api/systemone` on the session's Matilda Core origin) before the full gate review. An approve verdict skips the full review; an approve-with-comments verdict runs the review as advisory notes and approves; a reject verdict — or any evaluation failure — falls back to the full reviewer agent. Auth reuses the session credential: a signed-in Matilda account works as-is, while a raw `MATILDA_API_KEY` (`mc_live_…`) requires the `api:systemone` scope. Set `false` for the single-agent gate. | `true` |
477
+
469
478
  #### mcpServers
470
479
 
471
480
  Configures connections to one or more Model-Context Protocol (MCP) servers for discovering and using custom tools. Matilda Code attempts to connect to each configured MCP server to discover available tools. If multiple MCP servers expose a tool with the same name, the tool names will be prefixed with the server alias you defined in the configuration (e.g., `serverAlias__actualToolName`) to avoid conflicts. Note that the system might strip certain schema properties from MCP tool definitions for compatibility. At least one of `command`, `url`, or `httpUrl` must be provided. If multiple are specified, the order of precedence is `httpUrl`, then `url`, then `command`.
@@ -583,7 +592,9 @@ For authentication-related variables (like `OPENAI_*`) and the recommended `.mat
583
592
 
584
593
  > [!tip]
585
594
  >
586
- > **Environment Variable Exclusion:** Some environment variables (like `DEBUG` and `DEBUG_MODE`) are automatically excluded from project `.env` files by default to prevent interference with the CLI behavior. Variables from `.matilda/.env` files are never excluded. You can customize this behavior using the `advanced.excludedEnvVars`setting in your `settings.json` file.
595
+ > **Environment Variable Exclusion:** Some environment variables (like `DEBUG` and `DEBUG_MODE`) are automatically excluded from project `.env` files by default to prevent interference with the CLI behavior. The configurable exclusions do not apply to `.matilda/.env` files. Bootstrap and policy variables remain protected in all project environment sources. You can customize this behavior using the `advanced.excludedEnvVars`setting in your `settings.json` file.
596
+
597
+ Project `.env`, project `.matilda/.env` and workspace `settings.env` cannot configure sandbox startup, IDE helper connections, simple mode, interpreter startup, global state paths or workspace consent. Configure these inputs in the launch environment or user settings instead. User-level initial environment values are preserved; hot reload leaves bootstrap values fixed. Ordinary project provider and gateway variables continue to load in trusted workspaces.
587
598
 
588
599
  ### Environment Variables Table
589
600
 
@@ -601,7 +612,7 @@ For authentication-related variables (like `OPENAI_*`) and the recommended `.mat
601
612
  | `MATILDA_SANDBOX` | Alternative to the `sandbox` setting in `settings.json`. | Accepts `true`, `false`, `docker`, `podman`, or a custom command string. |
602
613
  | `MATILDA_SANDBOX_IMAGE` | Overrides sandbox image selection for Docker/Podman. | Takes precedence over `tools.sandboxImage`. |
603
614
  | `SEATBELT_PROFILE` | (macOS specific) Switches the Seatbelt (`sandbox-exec`) profile on macOS. | `permissive-open`: (Default) Restricts writes to the project folder (and a few other folders, see `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) but allows other operations. `strict`: Uses a strict profile that declines operations by default. `<profile_name>`: Uses a custom profile. To define a custom profile, create a file named `sandbox-macos-<profile_name>.sb` in your project's `.matilda/` directory (e.g., `my-project/.matilda/sandbox-macos-custom.sb`). |
604
- | `DEBUG` or `DEBUG_MODE` | (often used by underlying libraries or the CLI itself) Set to `true` or `1` to enable verbose debug logging, which can be helpful for troubleshooting. | **Note:** These variables are automatically excluded from project `.env` files by default to prevent interference with the CLI behavior. Use `.matilda/.env` files if you need to set these for Matilda Code specifically. |
615
+ | `DEBUG` or `DEBUG_MODE` | (often used by underlying libraries or the CLI itself) Set to `true` or `1` to enable verbose debug logging, which can be helpful for troubleshooting. | **Note:** These variables are excluded from project environment sources. Set them in the launch environment or user-level `.matilda/.env` to configure Matilda Code. |
605
616
  | `NO_COLOR` | Set to any value to disable all color output in the CLI. | |
606
617
  | `FORCE_HYPERLINK` | Override the OSC 8 clickable-link detection in the markdown renderer. Set to `1` (or any non-zero value, or empty string) to force-enable, `0` to force-disable. Honors `NO_COLOR` / `MATILDA_DISABLE_HYPERLINKS` opt-outs above it. | Use this to opt into OSC 8 inside `tmux` / GNU `screen` (auto-detection refuses by default because the host terminal's capabilities are hidden behind the multiplexer). Requires `set -g allow-passthrough on` on tmux 3.3+. Also enables Hyper, which isn't auto-detected. |
607
618
  | `MATILDA_DISABLE_HYPERLINKS` | Set to `1` to hard-disable OSC 8 clickable hyperlinks in the markdown renderer even on terminals that auto-detect as capable. | Useful when a terminal advertises support but breaks on long URLs, or when piping output through an intermediary that mangles escape sequences. The renderer falls back to plain `label (url)` rendering. |
@@ -1,18 +1,18 @@
1
1
  # Trusted Folders
2
2
 
3
- The Trusted Folders feature is a security setting that gives you control over which projects can use the full capabilities of the Matilda Code. It prevents potentially malicious code from running by asking you to approve a folder before the CLI loads any project-specific configurations from it.
3
+ The Trusted Folders feature is a security setting that gives you control over which projects can use the full capabilities of the Matilda Code. It asks you to approve a folder before the CLI admits its workspace settings and project hooks.
4
4
 
5
- ## Enabling the Feature
5
+ ## Default Policy
6
6
 
7
- The Trusted Folders feature is **disabled by default**. To use it, you must first enable it in your settings.
7
+ Folder trust is **enabled by default** for interactive CLI sessions. An unknown folder uses the existing trust dialog before its workspace settings and project hooks are admitted.
8
8
 
9
- Add the following to your user `settings.json` file:
9
+ To disable folder trust explicitly, add the following to your user `settings.json` file:
10
10
 
11
11
  ```json
12
12
  {
13
13
  "security": {
14
14
  "folderTrust": {
15
- "enabled": true
15
+ "enabled": false
16
16
  }
17
17
  }
18
18
  }
@@ -28,13 +28,15 @@ Once the feature is enabled, the first time you run the Matilda Code from a fold
28
28
 
29
29
  Your choice is saved in a central file (`~/.matilda/trustedFolders.json`), so you will only be asked once per folder.
30
30
 
31
+ Explicit headless requests, including `-p` and piped input, retain implicit consent for unknown folders. Desktop uses its approved workspace and additional-directory manifest. These runtime decisions do not rewrite saved trust rules, and explicit rejections still apply. Generic ACP requests do not receive blanket consent.
32
+
31
33
  ## Why Trust Matters: The Impact of an Untrusted Workspace
32
34
 
33
35
  When a folder is **untrusted**, the Matilda Code runs in a restricted "safe mode" to protect you. In this mode, the following features are disabled:
34
36
 
35
37
  1. **Workspace Settings are Ignored**: The CLI will **not** load the `.matilda/settings.json` file from the project. This prevents the loading of custom tools and other potentially dangerous configurations.
36
38
 
37
- 2. **Environment Variables are Ignored**: The CLI will **not** load any `.env` files from the project.
39
+ 2. **Project Environment Files Need Trust**: Unknown and rejected folders do not load project `.env` files. User-level environment files remain available.
38
40
 
39
41
  3. **Extension Management is Restricted**: You **cannot install, update, or uninstall** extensions.
40
42
 
@@ -44,6 +46,8 @@ When a folder is **untrusted**, the Matilda Code runs in a restricted "safe mode
44
46
 
45
47
  Granting trust to a folder unlocks the full functionality of the Matilda Code for that workspace.
46
48
 
49
+ Even in trusted folders, project `.env`, `.matilda/.env` and workspace `settings.env` cannot change process bootstrap or policy variables, including `NODE_OPTIONS`, `NODE_PATH`, `BASH_ENV`, `LD_PRELOAD`, `PATH`, storage locations, trust-file locations and Desktop directory consent. Ordinary variables, including gateway `*_BASE_URL` values, remain available. User-level files keep their initial loading behavior.
50
+
47
51
  ## Managing Your Trust Settings
48
52
 
49
53
  If you need to change a decision or see all your settings, you have a couple of options:
@@ -59,3 +63,5 @@ For advanced users, it's helpful to know the exact order of operations for how t
59
63
  1. **IDE Trust Signal**: If you are using the [IDE Integration](../ide-integration/ide-integration), the CLI first asks the IDE if the workspace is trusted. The IDE's response takes highest priority.
60
64
 
61
65
  2. **Local Trust File**: If the IDE is not connected, the CLI checks the central `~/.matilda/trustedFolders.json` file.
66
+
67
+ 3. **Runtime Consent**: If no saved decision exists, explicit headless use or Desktop's approved-directory manifest can grant trust for that runtime. Other unknown folders remain unresolved until the interactive choice.
@@ -0,0 +1,3 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{$g as e,Xg as a,Yg as b,Zg as c,_g as d,ah as f}from"./chunk-JRECUFB3.js";import"./chunk-M53RP3YP.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-2HTPVSGT.js";import"./chunk-MO2HXJG5.js";import"./chunk-2MOGYHWM.js";import"./chunk-S3CWEVTS.js";import"./chunk-TISQNFB5.js";import"./chunk-47XR7IMP.js";import"./chunk-MTMU7JYZ.js";import"./chunk-QKYGQLWC.js";import"./chunk-WV3IUPZS.js";import"./chunk-RNKDFE2S.js";import"./chunk-BVOCFLC4.js";import"./chunk-MCQUPLRE.js";import"./chunk-CZGZ3KK7.js";import"./chunk-HYVP4472.js";import"./chunk-WC2VTVCE.js";import"./chunk-KHHJYBR5.js";import"./chunk-6EQMZNIY.js";import"./chunk-DOOFGSRV.js";import"./chunk-DE3HKC2W.js";import"./chunk-GTVCJCHR.js";import"./chunk-QVCGLQCI.js";import"./chunk-VI74YQQO.js";import"./chunk-YV3PUOBU.js";import"./chunk-3IRGBRSP.js";import"./chunk-DC7LAFZZ.js";import"./chunk-4F4DA5UI.js";import"./chunk-3YLXGE6T.js";import"./chunk-JCE3JAVC.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-SDTWBD62.js";import"./chunk-6Z2MV7ZY.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-PGXQZVLX.js";import"./chunk-LUNDTQ3G.js";import"./chunk-YRQP3SLC.js";import"./chunk-6E766NPX.js";import"./chunk-27Q5KW3A.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{f as AgentTool,b as TOOL_REGISTRY_REBUILT,e as createApprovalModeOverride,c as hasRebuiltToolRegistry,d as rebuildToolRegistryOnOverride,a as resolveSubagentApprovalMode};
@@ -0,0 +1,3 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{vg as a,wg as b,xg as c}from"./chunk-JRECUFB3.js";import"./chunk-M53RP3YP.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-2HTPVSGT.js";import"./chunk-MO2HXJG5.js";import"./chunk-2MOGYHWM.js";import"./chunk-S3CWEVTS.js";import"./chunk-TISQNFB5.js";import"./chunk-47XR7IMP.js";import"./chunk-MTMU7JYZ.js";import"./chunk-QKYGQLWC.js";import"./chunk-WV3IUPZS.js";import"./chunk-RNKDFE2S.js";import"./chunk-BVOCFLC4.js";import"./chunk-MCQUPLRE.js";import"./chunk-CZGZ3KK7.js";import"./chunk-HYVP4472.js";import"./chunk-WC2VTVCE.js";import"./chunk-KHHJYBR5.js";import"./chunk-6EQMZNIY.js";import"./chunk-DOOFGSRV.js";import"./chunk-DE3HKC2W.js";import"./chunk-GTVCJCHR.js";import"./chunk-QVCGLQCI.js";import"./chunk-VI74YQQO.js";import"./chunk-YV3PUOBU.js";import"./chunk-3IRGBRSP.js";import"./chunk-DC7LAFZZ.js";import"./chunk-4F4DA5UI.js";import"./chunk-3YLXGE6T.js";import"./chunk-JCE3JAVC.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-SDTWBD62.js";import"./chunk-6Z2MV7ZY.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-PGXQZVLX.js";import"./chunk-LUNDTQ3G.js";import"./chunk-YRQP3SLC.js";import"./chunk-6E766NPX.js";import"./chunk-27Q5KW3A.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{c as AgentHeadless,a as ContextState,b as templateString};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as xr,b as Tr}from"./chunk-QN6Y6NPA.js";import{a as M,b as rt,c as Se,d as Pn}from"./chunk-4Q2SNBUH.js";import{a as En}from"./chunk-ODZOYHIC.js";import{c as An,f as we}from"./chunk-GUFIMKF5.js";import{b as _n,c as wn,d as Sn,g as nt,o as Cn,t as xn,v as Tn}from"./chunk-SUH3UUWZ.js";import{b as ee,e as tt}from"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{f as kn}from"./chunk-SDTWBD62.js";import{ba as bn}from"./chunk-MH2P4YXC.js";import{a as Cr}from"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as c}from"./chunk-GZPNIYVZ.js";import{a as et,d as _e,f as jt}from"./chunk-OWGSC52X.js";var jn=_e((oo,Ln)=>{"use strict";c();var Or=et("util"),Br=Cr();Ln.exports=function(r){if(typeof r=="number")return r;var e=Br(r);if(e===void 0){var t=new Error(Or.format("humanize-ms(%j) result undefined",r));console.warn(t.stack)}return e}});var ct=_e((ao,qn)=>{"use strict";c();qn.exports={CURRENT_ID:Symbol("agentkeepalive#currentId"),CREATE_ID:Symbol("agentkeepalive#createId"),INIT_SOCKET:Symbol("agentkeepalive#initSocket"),CREATE_HTTPS_CONNECTION:Symbol("agentkeepalive#createHttpsConnection"),SOCKET_CREATED_TIME:Symbol("agentkeepalive#socketCreatedTime"),SOCKET_NAME:Symbol("agentkeepalive#socketName"),SOCKET_REQUEST_COUNT:Symbol("agentkeepalive#socketRequestCount"),SOCKET_REQUEST_FINISHED_COUNT:Symbol("agentkeepalive#socketRequestFinishedCount")}});var Kt=_e((uo,$n)=>{"use strict";c();var Lr=et("http").Agent,$t=jn(),P=et("util").debuglog("agentkeepalive"),{INIT_SOCKET:Dn,CURRENT_ID:ut,CREATE_ID:Nn,SOCKET_CREATED_TIME:Un,SOCKET_NAME:R,SOCKET_REQUEST_COUNT:v,SOCKET_REQUEST_FINISHED_COUNT:j}=ct(),Ht=1,Gt=parseInt(process.version.split(".",1)[0].substring(1));Gt>=11&&Gt<=12?Ht=2:Gt>=13&&(Ht=3);function ke(r){console.log("[agentkeepalive:deprecated] %s",r)}var Jt=class extends Lr{constructor(e){e=e||{},e.keepAlive=e.keepAlive!==!1,e.freeSocketTimeout===void 0&&(e.freeSocketTimeout=4e3),e.keepAliveTimeout&&(ke("options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"),e.freeSocketTimeout=e.keepAliveTimeout,delete e.keepAliveTimeout),e.freeSocketKeepAliveTimeout&&(ke("options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"),e.freeSocketTimeout=e.freeSocketKeepAliveTimeout,delete e.freeSocketKeepAliveTimeout),e.timeout===void 0&&(e.timeout=Math.max(e.freeSocketTimeout*2,8e3)),e.timeout=$t(e.timeout),e.freeSocketTimeout=$t(e.freeSocketTimeout),e.socketActiveTTL=e.socketActiveTTL?$t(e.socketActiveTTL):0,super(e),this[ut]=0,this.createSocketCount=0,this.createSocketCountLastCheck=0,this.createSocketErrorCount=0,this.createSocketErrorCountLastCheck=0,this.closeSocketCount=0,this.closeSocketCountLastCheck=0,this.errorSocketCount=0,this.errorSocketCountLastCheck=0,this.requestCount=0,this.requestCountLastCheck=0,this.timeoutSocketCount=0,this.timeoutSocketCountLastCheck=0,this.on("free",t=>{let n=this.calcSocketTimeout(t);n>0&&t.timeout!==n&&t.setTimeout(n)})}get freeSocketKeepAliveTimeout(){return ke("agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead"),this.options.freeSocketTimeout}get timeout(){return ke("agent.timeout is deprecated, please use agent.options.timeout instead"),this.options.timeout}get socketActiveTTL(){return ke("agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead"),this.options.socketActiveTTL}calcSocketTimeout(e){let t=this.options.freeSocketTimeout,n=this.options.socketActiveTTL;if(n){let s=Date.now()-e[Un],o=n-s;if(o<=0)return o;t&&o<t&&(t=o)}if(t)return e.freeSocketTimeout||e.freeSocketKeepAliveTimeout||t}keepSocketAlive(e){let t=super.keepSocketAlive(e);if(!t)return t;let n=this.calcSocketTimeout(e);return typeof n>"u"?!0:n<=0?(P("%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s",e[R],e[v],e[j],n),!1):(e.timeout!==n&&e.setTimeout(n),!0)}reuseSocket(...e){super.reuseSocket(...e);let t=e[0],n=e[1];n.reusedSocket=!0;let s=this.options.timeout;Ce(t)!==s&&(t.setTimeout(s),P("%s reset timeout to %sms",t[R],s)),t[v]++,P("%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms",t[R],t[v],t[j],Ce(t))}[Nn](){let e=this[ut]++;return this[ut]===Number.MAX_SAFE_INTEGER&&(this[ut]=0),e}[Dn](e,t){t.timeout&&(Ce(e)||e.setTimeout(t.timeout)),this.options.keepAlive&&e.setNoDelay(!0),this.createSocketCount++,this.options.socketActiveTTL&&(e[Un]=Date.now()),e[R]=`sock[${this[Nn]()}#${t._agentKey}]`.split("-----BEGIN",1)[0],e[v]=1,e[j]=0,jr(this,e,t)}createConnection(e,t){let n=!1,s=(i,a)=>{if(!n){if(n=!0,i)return this.createSocketErrorCount++,t(i);this[Dn](a,e),t(i,a)}},o=super.createConnection(e,s);return o&&s(null,o),o}get statusChanged(){let e=this.createSocketCount!==this.createSocketCountLastCheck||this.createSocketErrorCount!==this.createSocketErrorCountLastCheck||this.closeSocketCount!==this.closeSocketCountLastCheck||this.errorSocketCount!==this.errorSocketCountLastCheck||this.timeoutSocketCount!==this.timeoutSocketCountLastCheck||this.requestCount!==this.requestCountLastCheck;return e&&(this.createSocketCountLastCheck=this.createSocketCount,this.createSocketErrorCountLastCheck=this.createSocketErrorCount,this.closeSocketCountLastCheck=this.closeSocketCount,this.errorSocketCountLastCheck=this.errorSocketCount,this.timeoutSocketCountLastCheck=this.timeoutSocketCount,this.requestCountLastCheck=this.requestCount),e}getCurrentStatus(){return{createSocketCount:this.createSocketCount,createSocketErrorCount:this.createSocketErrorCount,closeSocketCount:this.closeSocketCount,errorSocketCount:this.errorSocketCount,timeoutSocketCount:this.timeoutSocketCount,requestCount:this.requestCount,freeSockets:Wt(this.freeSockets),sockets:Wt(this.sockets),requests:Wt(this.requests)}}};function Ce(r){return r.timeout||r._idleTimeout}function jr(r,e,t){P("%s create, timeout %sms",e[R],Ce(e));function n(){if(!e._httpMessage&&e[v]===1)return;e[j]++,r.requestCount++,P("%s(requests: %s, finished: %s) free",e[R],e[v],e[j]);let u=r.getName(t);e.writable&&r.requests[u]&&r.requests[u].length&&(e[v]++,P("%s(requests: %s, finished: %s) will be reuse on agent free event",e[R],e[v],e[j]))}e.on("free",n);function s(u){P("%s(requests: %s, finished: %s) close, isError: %s",e[R],e[v],e[j],u),r.closeSocketCount++}e.on("close",s);function o(){let u=e.listeners("timeout").length,l=Ce(e),y=e._httpMessage,g=y&&y.listeners("timeout").length||0;P("%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s",e[R],e[v],e[j],l,u,Ht,!!y,g),P.enabled&&P("timeout listeners: %s",e.listeners("timeout").map(_=>_.name).join(", ")),r.timeoutSocketCount++;let h=r.getName(t);if(r.freeSockets[h]&&r.freeSockets[h].indexOf(e)!==-1)e.destroy(),r.removeSocket(e,t),P("%s is free, destroy quietly",e[R]);else if(g===0){let _=new Error("Socket timeout");_.code="ERR_SOCKET_TIMEOUT",_.timeout=l,e.destroy(_),r.removeSocket(e,t),P("%s destroy with timeout error",e[R])}}e.on("timeout",o);function i(u){let l=e.listeners("error").length;P("%s(requests: %s, finished: %s) error: %s, listenerCount: %s",e[R],e[v],e[j],u,l),r.errorSocketCount++,l===1&&(P("%s emit uncaught error event",e[R]),e.removeListener("error",i),e.emit("error",u))}e.on("error",i);function a(){P("%s(requests: %s, finished: %s) agentRemove",e[R],e[v],e[j]),e.removeListener("close",s),e.removeListener("error",i),e.removeListener("free",n),e.removeListener("timeout",o),e.removeListener("agentRemove",a)}e.on("agentRemove",a)}$n.exports=Jt;function Wt(r){let e={};for(let t in r)e[t]=r[t].length;return e}});var Hn=_e((fo,Wn)=>{"use strict";c();var Xt=et("https").Agent,qr=Kt(),{INIT_SOCKET:Dr,CREATE_HTTPS_CONNECTION:Gn}=ct(),xe=class extends qr{constructor(e){super(e),this.defaultPort=443,this.protocol="https:",this.maxCachedSessions=this.options.maxCachedSessions,this.maxCachedSessions===void 0&&(this.maxCachedSessions=100),this._sessionCache={map:{},list:[]}}createConnection(e,t){let n=this[Gn](e,t);return this[Dr](n,e),n}};xe.prototype[Gn]=Xt.prototype.createConnection;["getName","_getSession","_cacheSession","_evictSession"].forEach(function(r){typeof Xt.prototype[r]=="function"&&(xe.prototype[r]=Xt.prototype[r])});Wn.exports=xe});var Kn=_e((po,Te)=>{"use strict";c();var Jn=Kt();Te.exports=Jn;Te.exports.HttpAgent=Jn;Te.exports.HttpsAgent=Hn();Te.exports.constants=ct()});c();c();c();c();c();var te="0.36.3";c();c();c();var Rn=!1,ne,qt,Ar,Er,Pr,Mn,Rr,st,Dt,vn,Nt,ot,In;function Fn(r,e={auto:!1}){if(Rn)throw new Error(`you must \`import '@anthropic-ai/sdk/shims/${r.kind}'\` before importing anything else from @anthropic-ai/sdk`);if(ne)throw new Error(`can't \`import '@anthropic-ai/sdk/shims/${r.kind}'\` after \`import '@anthropic-ai/sdk/shims/${ne}'\``);Rn=e.auto,ne=r.kind,qt=r.fetch,Ar=r.Request,Er=r.Response,Pr=r.Headers,Mn=r.FormData,Rr=r.Blob,st=r.File,Dt=r.ReadableStream,vn=r.getMultipartRequestOptions,Nt=r.getDefaultAgent,ot=r.fileFromPath,In=r.isFsReadStream}c();var X=jt(xr(),1);c();c();import{inspect as Ir}from"util";c();var On=r=>r instanceof rt;c();import{deprecate as vr}from"util";var Bn=vr(()=>{},'Constructor "entries" argument is not spec-compliant and will be removed in next major release.');var B=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},it,L,Ut,at=class{constructor(e){it.add(this),L.set(this,new Map),e&&(Bn(),e.forEach(({name:t,value:n,fileName:s})=>this.append(t,n,s)))}static[(L=new WeakMap,it=new WeakSet,Symbol.hasInstance)](e){return!!(e&&M(e.constructor)&&e[Symbol.toStringTag]==="FormData"&&M(e.append)&&M(e.set)&&M(e.get)&&M(e.getAll)&&M(e.has)&&M(e.delete)&&M(e.entries)&&M(e.values)&&M(e.keys)&&M(e[Symbol.iterator])&&M(e.forEach))}append(e,t,n){B(this,it,"m",Ut).call(this,{name:e,fileName:n,append:!0,rawValue:t,argsLength:arguments.length})}set(e,t,n){B(this,it,"m",Ut).call(this,{name:e,fileName:n,append:!1,rawValue:t,argsLength:arguments.length})}get(e){let t=B(this,L,"f").get(String(e));return t?t[0]:null}getAll(e){let t=B(this,L,"f").get(String(e));return t?t.slice():[]}has(e){return B(this,L,"f").has(String(e))}delete(e){B(this,L,"f").delete(String(e))}*keys(){for(let e of B(this,L,"f").keys())yield e}*entries(){for(let e of this.keys()){let t=this.getAll(e);for(let n of t)yield[e,n]}}*values(){for(let[,e]of this)yield e}[(Ut=function({name:t,rawValue:n,append:s,fileName:o,argsLength:i}){let a=s?"append":"set";if(i<2)throw new TypeError(`Failed to execute '${a}' on 'FormData': 2 arguments required, but only ${i} present.`);t=String(t);let u;if(Pn(n))u=o===void 0?n:new Se([n],o,{type:n.type,lastModified:n.lastModified});else if(On(n))u=new Se([n],o===void 0?"blob":o,{type:n.type});else{if(o)throw new TypeError(`Failed to execute '${a}' on 'FormData': parameter 2 is not of type 'Blob'.`);u=String(n)}let l=B(this,L,"f").get(t);if(!l)return void B(this,L,"f").set(t,[u]);if(!s)return void B(this,L,"f").set(t,[u]);l.push(u)},Symbol.iterator)](){return this.entries()}forEach(e,t){for(let[n,s]of this)e.call(t,s,n,this)}get[Symbol.toStringTag](){return"FormData"}[Ir.custom](){return this[Symbol.toStringTag]}};var Zt=jt(Kn(),1),Yn=jt(Tr(),1);import{ReadStream as Kr}from"node:fs";c();c();c();var Xn="abcdefghijklmnopqrstuvwxyz0123456789";function Nr(){let r=16,e="";for(;r--;)e+=Xn[Math.random()*Xn.length<<0];return e}var zn=Nr;c();var Ur=r=>Object.prototype.toString.call(r).slice(8,-1).toLowerCase();function $r(r){if(Ur(r)!=="object")return!1;let e=Object.getPrototypeOf(r);return e==null?!0:(e.constructor&&e.constructor.toString())===Object.toString()}var zt=$r;c();var Gr=r=>String(r).replace(/\r|\n/g,(e,t,n)=>e==="\r"&&n[t+1]!==`
3
+ import{a as xr,b as Tr}from"./chunk-QN6Y6NPA.js";import{a as M,b as rt,c as Se,d as Pn}from"./chunk-4Q2SNBUH.js";import{a as En}from"./chunk-GOJCMVJJ.js";import{c as An,f as we}from"./chunk-YV3PUOBU.js";import{b as _n,c as wn,d as Sn,g as nt,o as Cn,t as xn,v as Tn}from"./chunk-JCE3JAVC.js";import{b as ee,e as tt}from"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{f as kn}from"./chunk-SDTWBD62.js";import{ba as bn}from"./chunk-27Q5KW3A.js";import{a as Cr}from"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as c}from"./chunk-GZPNIYVZ.js";import{a as et,d as _e,f as jt}from"./chunk-OWGSC52X.js";var jn=_e((oo,Ln)=>{"use strict";c();var Or=et("util"),Br=Cr();Ln.exports=function(r){if(typeof r=="number")return r;var e=Br(r);if(e===void 0){var t=new Error(Or.format("humanize-ms(%j) result undefined",r));console.warn(t.stack)}return e}});var ct=_e((ao,qn)=>{"use strict";c();qn.exports={CURRENT_ID:Symbol("agentkeepalive#currentId"),CREATE_ID:Symbol("agentkeepalive#createId"),INIT_SOCKET:Symbol("agentkeepalive#initSocket"),CREATE_HTTPS_CONNECTION:Symbol("agentkeepalive#createHttpsConnection"),SOCKET_CREATED_TIME:Symbol("agentkeepalive#socketCreatedTime"),SOCKET_NAME:Symbol("agentkeepalive#socketName"),SOCKET_REQUEST_COUNT:Symbol("agentkeepalive#socketRequestCount"),SOCKET_REQUEST_FINISHED_COUNT:Symbol("agentkeepalive#socketRequestFinishedCount")}});var Kt=_e((uo,$n)=>{"use strict";c();var Lr=et("http").Agent,$t=jn(),P=et("util").debuglog("agentkeepalive"),{INIT_SOCKET:Dn,CURRENT_ID:ut,CREATE_ID:Nn,SOCKET_CREATED_TIME:Un,SOCKET_NAME:R,SOCKET_REQUEST_COUNT:v,SOCKET_REQUEST_FINISHED_COUNT:j}=ct(),Ht=1,Gt=parseInt(process.version.split(".",1)[0].substring(1));Gt>=11&&Gt<=12?Ht=2:Gt>=13&&(Ht=3);function ke(r){console.log("[agentkeepalive:deprecated] %s",r)}var Jt=class extends Lr{constructor(e){e=e||{},e.keepAlive=e.keepAlive!==!1,e.freeSocketTimeout===void 0&&(e.freeSocketTimeout=4e3),e.keepAliveTimeout&&(ke("options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"),e.freeSocketTimeout=e.keepAliveTimeout,delete e.keepAliveTimeout),e.freeSocketKeepAliveTimeout&&(ke("options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"),e.freeSocketTimeout=e.freeSocketKeepAliveTimeout,delete e.freeSocketKeepAliveTimeout),e.timeout===void 0&&(e.timeout=Math.max(e.freeSocketTimeout*2,8e3)),e.timeout=$t(e.timeout),e.freeSocketTimeout=$t(e.freeSocketTimeout),e.socketActiveTTL=e.socketActiveTTL?$t(e.socketActiveTTL):0,super(e),this[ut]=0,this.createSocketCount=0,this.createSocketCountLastCheck=0,this.createSocketErrorCount=0,this.createSocketErrorCountLastCheck=0,this.closeSocketCount=0,this.closeSocketCountLastCheck=0,this.errorSocketCount=0,this.errorSocketCountLastCheck=0,this.requestCount=0,this.requestCountLastCheck=0,this.timeoutSocketCount=0,this.timeoutSocketCountLastCheck=0,this.on("free",t=>{let n=this.calcSocketTimeout(t);n>0&&t.timeout!==n&&t.setTimeout(n)})}get freeSocketKeepAliveTimeout(){return ke("agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead"),this.options.freeSocketTimeout}get timeout(){return ke("agent.timeout is deprecated, please use agent.options.timeout instead"),this.options.timeout}get socketActiveTTL(){return ke("agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead"),this.options.socketActiveTTL}calcSocketTimeout(e){let t=this.options.freeSocketTimeout,n=this.options.socketActiveTTL;if(n){let s=Date.now()-e[Un],o=n-s;if(o<=0)return o;t&&o<t&&(t=o)}if(t)return e.freeSocketTimeout||e.freeSocketKeepAliveTimeout||t}keepSocketAlive(e){let t=super.keepSocketAlive(e);if(!t)return t;let n=this.calcSocketTimeout(e);return typeof n>"u"?!0:n<=0?(P("%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s",e[R],e[v],e[j],n),!1):(e.timeout!==n&&e.setTimeout(n),!0)}reuseSocket(...e){super.reuseSocket(...e);let t=e[0],n=e[1];n.reusedSocket=!0;let s=this.options.timeout;Ce(t)!==s&&(t.setTimeout(s),P("%s reset timeout to %sms",t[R],s)),t[v]++,P("%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms",t[R],t[v],t[j],Ce(t))}[Nn](){let e=this[ut]++;return this[ut]===Number.MAX_SAFE_INTEGER&&(this[ut]=0),e}[Dn](e,t){t.timeout&&(Ce(e)||e.setTimeout(t.timeout)),this.options.keepAlive&&e.setNoDelay(!0),this.createSocketCount++,this.options.socketActiveTTL&&(e[Un]=Date.now()),e[R]=`sock[${this[Nn]()}#${t._agentKey}]`.split("-----BEGIN",1)[0],e[v]=1,e[j]=0,jr(this,e,t)}createConnection(e,t){let n=!1,s=(i,a)=>{if(!n){if(n=!0,i)return this.createSocketErrorCount++,t(i);this[Dn](a,e),t(i,a)}},o=super.createConnection(e,s);return o&&s(null,o),o}get statusChanged(){let e=this.createSocketCount!==this.createSocketCountLastCheck||this.createSocketErrorCount!==this.createSocketErrorCountLastCheck||this.closeSocketCount!==this.closeSocketCountLastCheck||this.errorSocketCount!==this.errorSocketCountLastCheck||this.timeoutSocketCount!==this.timeoutSocketCountLastCheck||this.requestCount!==this.requestCountLastCheck;return e&&(this.createSocketCountLastCheck=this.createSocketCount,this.createSocketErrorCountLastCheck=this.createSocketErrorCount,this.closeSocketCountLastCheck=this.closeSocketCount,this.errorSocketCountLastCheck=this.errorSocketCount,this.timeoutSocketCountLastCheck=this.timeoutSocketCount,this.requestCountLastCheck=this.requestCount),e}getCurrentStatus(){return{createSocketCount:this.createSocketCount,createSocketErrorCount:this.createSocketErrorCount,closeSocketCount:this.closeSocketCount,errorSocketCount:this.errorSocketCount,timeoutSocketCount:this.timeoutSocketCount,requestCount:this.requestCount,freeSockets:Wt(this.freeSockets),sockets:Wt(this.sockets),requests:Wt(this.requests)}}};function Ce(r){return r.timeout||r._idleTimeout}function jr(r,e,t){P("%s create, timeout %sms",e[R],Ce(e));function n(){if(!e._httpMessage&&e[v]===1)return;e[j]++,r.requestCount++,P("%s(requests: %s, finished: %s) free",e[R],e[v],e[j]);let u=r.getName(t);e.writable&&r.requests[u]&&r.requests[u].length&&(e[v]++,P("%s(requests: %s, finished: %s) will be reuse on agent free event",e[R],e[v],e[j]))}e.on("free",n);function s(u){P("%s(requests: %s, finished: %s) close, isError: %s",e[R],e[v],e[j],u),r.closeSocketCount++}e.on("close",s);function o(){let u=e.listeners("timeout").length,l=Ce(e),y=e._httpMessage,g=y&&y.listeners("timeout").length||0;P("%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s",e[R],e[v],e[j],l,u,Ht,!!y,g),P.enabled&&P("timeout listeners: %s",e.listeners("timeout").map(_=>_.name).join(", ")),r.timeoutSocketCount++;let h=r.getName(t);if(r.freeSockets[h]&&r.freeSockets[h].indexOf(e)!==-1)e.destroy(),r.removeSocket(e,t),P("%s is free, destroy quietly",e[R]);else if(g===0){let _=new Error("Socket timeout");_.code="ERR_SOCKET_TIMEOUT",_.timeout=l,e.destroy(_),r.removeSocket(e,t),P("%s destroy with timeout error",e[R])}}e.on("timeout",o);function i(u){let l=e.listeners("error").length;P("%s(requests: %s, finished: %s) error: %s, listenerCount: %s",e[R],e[v],e[j],u,l),r.errorSocketCount++,l===1&&(P("%s emit uncaught error event",e[R]),e.removeListener("error",i),e.emit("error",u))}e.on("error",i);function a(){P("%s(requests: %s, finished: %s) agentRemove",e[R],e[v],e[j]),e.removeListener("close",s),e.removeListener("error",i),e.removeListener("free",n),e.removeListener("timeout",o),e.removeListener("agentRemove",a)}e.on("agentRemove",a)}$n.exports=Jt;function Wt(r){let e={};for(let t in r)e[t]=r[t].length;return e}});var Hn=_e((fo,Wn)=>{"use strict";c();var Xt=et("https").Agent,qr=Kt(),{INIT_SOCKET:Dr,CREATE_HTTPS_CONNECTION:Gn}=ct(),xe=class extends qr{constructor(e){super(e),this.defaultPort=443,this.protocol="https:",this.maxCachedSessions=this.options.maxCachedSessions,this.maxCachedSessions===void 0&&(this.maxCachedSessions=100),this._sessionCache={map:{},list:[]}}createConnection(e,t){let n=this[Gn](e,t);return this[Dr](n,e),n}};xe.prototype[Gn]=Xt.prototype.createConnection;["getName","_getSession","_cacheSession","_evictSession"].forEach(function(r){typeof Xt.prototype[r]=="function"&&(xe.prototype[r]=Xt.prototype[r])});Wn.exports=xe});var Kn=_e((po,Te)=>{"use strict";c();var Jn=Kt();Te.exports=Jn;Te.exports.HttpAgent=Jn;Te.exports.HttpsAgent=Hn();Te.exports.constants=ct()});c();c();c();c();c();var te="0.36.3";c();c();c();var Rn=!1,ne,qt,Ar,Er,Pr,Mn,Rr,st,Dt,vn,Nt,ot,In;function Fn(r,e={auto:!1}){if(Rn)throw new Error(`you must \`import '@anthropic-ai/sdk/shims/${r.kind}'\` before importing anything else from @anthropic-ai/sdk`);if(ne)throw new Error(`can't \`import '@anthropic-ai/sdk/shims/${r.kind}'\` after \`import '@anthropic-ai/sdk/shims/${ne}'\``);Rn=e.auto,ne=r.kind,qt=r.fetch,Ar=r.Request,Er=r.Response,Pr=r.Headers,Mn=r.FormData,Rr=r.Blob,st=r.File,Dt=r.ReadableStream,vn=r.getMultipartRequestOptions,Nt=r.getDefaultAgent,ot=r.fileFromPath,In=r.isFsReadStream}c();var X=jt(xr(),1);c();c();import{inspect as Ir}from"util";c();var On=r=>r instanceof rt;c();import{deprecate as vr}from"util";var Bn=vr(()=>{},'Constructor "entries" argument is not spec-compliant and will be removed in next major release.');var B=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},it,L,Ut,at=class{constructor(e){it.add(this),L.set(this,new Map),e&&(Bn(),e.forEach(({name:t,value:n,fileName:s})=>this.append(t,n,s)))}static[(L=new WeakMap,it=new WeakSet,Symbol.hasInstance)](e){return!!(e&&M(e.constructor)&&e[Symbol.toStringTag]==="FormData"&&M(e.append)&&M(e.set)&&M(e.get)&&M(e.getAll)&&M(e.has)&&M(e.delete)&&M(e.entries)&&M(e.values)&&M(e.keys)&&M(e[Symbol.iterator])&&M(e.forEach))}append(e,t,n){B(this,it,"m",Ut).call(this,{name:e,fileName:n,append:!0,rawValue:t,argsLength:arguments.length})}set(e,t,n){B(this,it,"m",Ut).call(this,{name:e,fileName:n,append:!1,rawValue:t,argsLength:arguments.length})}get(e){let t=B(this,L,"f").get(String(e));return t?t[0]:null}getAll(e){let t=B(this,L,"f").get(String(e));return t?t.slice():[]}has(e){return B(this,L,"f").has(String(e))}delete(e){B(this,L,"f").delete(String(e))}*keys(){for(let e of B(this,L,"f").keys())yield e}*entries(){for(let e of this.keys()){let t=this.getAll(e);for(let n of t)yield[e,n]}}*values(){for(let[,e]of this)yield e}[(Ut=function({name:t,rawValue:n,append:s,fileName:o,argsLength:i}){let a=s?"append":"set";if(i<2)throw new TypeError(`Failed to execute '${a}' on 'FormData': 2 arguments required, but only ${i} present.`);t=String(t);let u;if(Pn(n))u=o===void 0?n:new Se([n],o,{type:n.type,lastModified:n.lastModified});else if(On(n))u=new Se([n],o===void 0?"blob":o,{type:n.type});else{if(o)throw new TypeError(`Failed to execute '${a}' on 'FormData': parameter 2 is not of type 'Blob'.`);u=String(n)}let l=B(this,L,"f").get(t);if(!l)return void B(this,L,"f").set(t,[u]);if(!s)return void B(this,L,"f").set(t,[u]);l.push(u)},Symbol.iterator)](){return this.entries()}forEach(e,t){for(let[n,s]of this)e.call(t,s,n,this)}get[Symbol.toStringTag](){return"FormData"}[Ir.custom](){return this[Symbol.toStringTag]}};var Zt=jt(Kn(),1),Yn=jt(Tr(),1);import{ReadStream as Kr}from"node:fs";c();c();c();var Xn="abcdefghijklmnopqrstuvwxyz0123456789";function Nr(){let r=16,e="";for(;r--;)e+=Xn[Math.random()*Xn.length<<0];return e}var zn=Nr;c();var Ur=r=>Object.prototype.toString.call(r).slice(8,-1).toLowerCase();function $r(r){if(Ur(r)!=="object")return!1;let e=Object.getPrototypeOf(r);return e==null?!0:(e.constructor&&e.constructor.toString())===Object.toString()}var zt=$r;c();var Gr=r=>String(r).replace(/\r|\n/g,(e,t,n)=>e==="\r"&&n[t+1]!==`
4
4
  `||e===`
5
5
  `&&n[t-1]!=="\r"?`\r
6
6
  `:e),Vt=Gr;c();var Wr=r=>String(r).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),Qt=Wr;c();c();var Hr=r=>typeof r=="function",U=Hr;var re=r=>!!(r&&typeof r=="object"&&U(r.constructor)&&r[Symbol.toStringTag]==="File"&&U(r.stream)&&r.name!=null&&r.size!=null&&r.lastModified!=null);c();var Vn=r=>!!(r&&U(r.constructor)&&r[Symbol.toStringTag]==="FormData"&&U(r.append)&&U(r.getAll)&&U(r.entries)&&U(r[Symbol.iterator]));var Ae=function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},w=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},lt,K,Ee,ft,Pe,se,Re,Me,ht,Yt,Jr={enableAdditionalHeaders:!1},dt=class{constructor(e,t,n){if(lt.add(this),K.set(this,`\r
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as r}from"./chunk-ILBTI4K5.js";import"./chunk-47XR7IMP.js";import{g as m,i as h,p as f,q as g}from"./chunk-T4P4KEDW.js";import{ba as d}from"./chunk-MH2P4YXC.js";import"./chunk-FWDMPRKU.js";import{b as p}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";p();var a=d("ASK_USER_QUESTION"),b=`Use this tool when you need to ask the user questions during execution. This allows you to:
3
+ import{a as r}from"./chunk-ILBTI4K5.js";import"./chunk-47XR7IMP.js";import{g as m,i as h,p as f,q as g}from"./chunk-6E766NPX.js";import{ba as d}from"./chunk-27Q5KW3A.js";import"./chunk-FWDMPRKU.js";import{b as p}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";p();var a=d("ASK_USER_QUESTION"),b=`Use this tool when you need to ask the user questions during execution. This allows you to:
4
4
  1. Gather user preferences or requirements
5
5
  2. Clarify ambiguous instructions
6
6
  3. Get decisions on implementation choices as you work