@averyyy/pi-coding-agent 1.1.0-piclient.3 → 1.2.0-piclient.2

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 (245) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/bundle/chunks/anthropic-messages-Y556A57W.js +6 -0
  3. package/dist/bundle/chunks/azure-openai-responses-ONC234KU.js +2 -0
  4. package/dist/bundle/chunks/{chunk-SJAIFNJC.js → chunk-27EJF7XV.js} +1 -1
  5. package/dist/bundle/chunks/chunk-32OQRHU5.js +7 -0
  6. package/dist/bundle/chunks/{chunk-L2QJRZTO.js → chunk-5UQLMALR.js} +1 -1
  7. package/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
  8. package/dist/bundle/chunks/chunk-FMG3V7LC.js +2 -0
  9. package/dist/bundle/chunks/chunk-KHMP74W7.js +2 -0
  10. package/dist/bundle/chunks/{chunk-LQELYOUU.js → chunk-M6CJGLVS.js} +1 -1
  11. package/dist/bundle/chunks/{chunk-WMAKGH2U.js → chunk-MCRRDQUQ.js} +26 -92
  12. package/dist/bundle/chunks/chunk-OK5HMGJH.js +2 -0
  13. package/dist/bundle/chunks/{chunk-IHNTZDOC.js → chunk-PT5WCDHM.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-JPAIS7JS.js → chunk-QNH5RXIC.js} +2 -2
  15. package/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
  16. package/dist/bundle/chunks/{chunk-YESFPC53.js → chunk-RUVBX4HZ.js} +101 -90
  17. package/dist/bundle/chunks/{chunk-G7JAXKAE.js → chunk-SWXCGFWB.js} +1 -1
  18. package/dist/bundle/chunks/chunk-VBIW3SGN.js +6 -0
  19. package/dist/bundle/chunks/{chunk-M6HKFBHF.js → chunk-VOTHJ3C2.js} +1 -1
  20. package/dist/bundle/chunks/chunk-VZZDG22Y.js +9 -0
  21. package/dist/bundle/chunks/chunk-WALKIYXG.js +82 -0
  22. package/dist/bundle/chunks/chunk-XDNB4NV2.js +130 -0
  23. package/dist/bundle/chunks/{cli-G46DCMLG.js → cli-C7ZYV7NI.js} +3 -3
  24. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-TXNQKF7U.js → cloudflare-workers-ai-system-one-46TPRDI6.js} +1 -1
  25. package/dist/bundle/chunks/codemode-worker.js +17 -9
  26. package/dist/bundle/chunks/easter-egg-3d-JPU5ICBY.js +2 -0
  27. package/dist/bundle/chunks/execute-G3X3GRKI.js +499 -0
  28. package/dist/bundle/chunks/github-copilot.js +1 -1
  29. package/dist/bundle/chunks/google-antigravity.js +75 -0
  30. package/dist/bundle/chunks/google-generative-ai-OPRBPNHR.js +2 -0
  31. package/dist/bundle/chunks/google-vertex-VC2DWOR5.js +2 -0
  32. package/dist/bundle/chunks/mistral-conversations-JJ6S2EPK.js +5 -0
  33. package/dist/bundle/chunks/openai-codex-responses-NQKFQIGV.js +10 -0
  34. package/dist/bundle/chunks/{openai-completions-IIJZEEG4.js → openai-completions-NNHMY5BP.js} +1 -1
  35. package/dist/bundle/chunks/{openai-decisions-7HAB4DS5.js → openai-decisions-SA75ZFFT.js} +1 -1
  36. package/dist/bundle/chunks/openai-responses-XDTCR5JC.js +3 -0
  37. package/dist/bundle/chunks/{pi-messages-YHKPQIHC.js → pi-messages-EMTA6VNL.js} +1 -1
  38. package/dist/bundle/chunks/runtime-RTNZQVM5.js +2 -0
  39. package/dist/bundle/chunks/{typesafe-system-one-JIF5KZZR.js → typesafe-system-one-WHWA7H7I.js} +1 -1
  40. package/dist/bundle/chunks/virtual-modules-PGCF2Z7J.js +2 -0
  41. package/dist/bundle/cli-runtime.js +1 -1
  42. package/dist/bundle/index.js +1 -1
  43. package/dist/bundle/rpc-entry.js +1 -1
  44. package/dist/core/agent-session.d.ts +16 -1
  45. package/dist/core/agent-session.d.ts.map +1 -1
  46. package/dist/core/agent-session.js +135 -87
  47. package/dist/core/agent-session.js.map +1 -1
  48. package/dist/core/auth-storage.d.ts.map +1 -1
  49. package/dist/core/auth-storage.js +20 -13
  50. package/dist/core/auth-storage.js.map +1 -1
  51. package/dist/core/bug-report.d.ts +9 -1
  52. package/dist/core/bug-report.d.ts.map +1 -1
  53. package/dist/core/compaction/utils.d.ts +6 -0
  54. package/dist/core/compaction/utils.d.ts.map +1 -1
  55. package/dist/core/compaction/utils.js +7 -8
  56. package/dist/core/compaction/utils.js.map +1 -1
  57. package/dist/core/extensions/index.d.ts +1 -1
  58. package/dist/core/extensions/index.d.ts.map +1 -1
  59. package/dist/core/extensions/index.js.map +1 -1
  60. package/dist/core/extensions/runner.d.ts +4 -2
  61. package/dist/core/extensions/runner.d.ts.map +1 -1
  62. package/dist/core/extensions/runner.js +2 -3
  63. package/dist/core/extensions/runner.js.map +1 -1
  64. package/dist/core/extensions/types.d.ts +31 -7
  65. package/dist/core/extensions/types.d.ts.map +1 -1
  66. package/dist/core/extensions/types.js.map +1 -1
  67. package/dist/core/key-id-schema.d.ts +6 -0
  68. package/dist/core/key-id-schema.d.ts.map +1 -0
  69. package/dist/core/key-id-schema.js +16 -0
  70. package/dist/core/key-id-schema.js.map +1 -0
  71. package/dist/core/keybindings-schema.d.ts +4 -0
  72. package/dist/core/keybindings-schema.d.ts.map +1 -0
  73. package/dist/core/keybindings-schema.js +16 -0
  74. package/dist/core/keybindings-schema.js.map +1 -0
  75. package/dist/core/keybindings.d.ts +198 -63
  76. package/dist/core/keybindings.d.ts.map +1 -1
  77. package/dist/core/keybindings.js +26 -23
  78. package/dist/core/keybindings.js.map +1 -1
  79. package/dist/core/model-config.d.ts +695 -74
  80. package/dist/core/model-config.d.ts.map +1 -1
  81. package/dist/core/model-config.js +16 -166
  82. package/dist/core/model-config.js.map +1 -1
  83. package/dist/core/model-runtime.d.ts.map +1 -1
  84. package/dist/core/model-runtime.js +11 -4
  85. package/dist/core/model-runtime.js.map +1 -1
  86. package/dist/core/package-manager.d.ts.map +1 -1
  87. package/dist/core/package-manager.js +3 -3
  88. package/dist/core/package-manager.js.map +1 -1
  89. package/dist/core/project-trust.d.ts.map +1 -1
  90. package/dist/core/project-trust.js +2 -1
  91. package/dist/core/project-trust.js.map +1 -1
  92. package/dist/core/remote-catalog-provider.d.ts +12 -1
  93. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  94. package/dist/core/remote-catalog-provider.js +82 -24
  95. package/dist/core/remote-catalog-provider.js.map +1 -1
  96. package/dist/core/resource-loader.d.ts.map +1 -1
  97. package/dist/core/resource-loader.js +5 -1
  98. package/dist/core/resource-loader.js.map +1 -1
  99. package/dist/core/settings-defaults.d.ts +65 -0
  100. package/dist/core/settings-defaults.d.ts.map +1 -0
  101. package/dist/core/settings-defaults.js +66 -0
  102. package/dist/core/settings-defaults.js.map +1 -0
  103. package/dist/core/settings-manager.d.ts +4 -147
  104. package/dist/core/settings-manager.d.ts.map +1 -1
  105. package/dist/core/settings-manager.js +48 -44
  106. package/dist/core/settings-manager.js.map +1 -1
  107. package/dist/core/settings-schema.d.ts +228 -0
  108. package/dist/core/settings-schema.d.ts.map +1 -0
  109. package/dist/core/settings-schema.js +287 -0
  110. package/dist/core/settings-schema.js.map +1 -0
  111. package/dist/core/tools/render-utils.d.ts +18 -0
  112. package/dist/core/tools/render-utils.d.ts.map +1 -1
  113. package/dist/core/tools/render-utils.js +46 -0
  114. package/dist/core/tools/render-utils.js.map +1 -1
  115. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  116. package/dist/core/tools/renderers/bash.js +7 -40
  117. package/dist/core/tools/renderers/bash.js.map +1 -1
  118. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  119. package/dist/extensions/codemode/execute.js +64 -45
  120. package/dist/extensions/codemode/execute.js.map +1 -1
  121. package/dist/extensions/codemode/index.d.ts.map +1 -1
  122. package/dist/extensions/codemode/index.js +2 -1
  123. package/dist/extensions/codemode/index.js.map +1 -1
  124. package/dist/extensions/codemode/renderer.d.ts +2 -2
  125. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  126. package/dist/extensions/codemode/renderer.js +9 -3
  127. package/dist/extensions/codemode/renderer.js.map +1 -1
  128. package/dist/extensions/codemode/tool.d.ts +6 -12
  129. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  130. package/dist/extensions/codemode/tool.js +44 -32
  131. package/dist/extensions/codemode/tool.js.map +1 -1
  132. package/dist/extensions/mcp/cli.js +5 -8
  133. package/dist/extensions/mcp/cli.js.map +1 -1
  134. package/dist/extensions/mcp/index.d.ts.map +1 -1
  135. package/dist/extensions/mcp/index.js +26 -23
  136. package/dist/extensions/mcp/index.js.map +1 -1
  137. package/dist/extensions/mcp/resources.d.ts +0 -6
  138. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  139. package/dist/extensions/mcp/resources.js +1 -1
  140. package/dist/extensions/mcp/resources.js.map +1 -1
  141. package/dist/extensions/mcp/runtime.d.ts +3 -6
  142. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  143. package/dist/extensions/mcp/runtime.js +4 -39
  144. package/dist/extensions/mcp/runtime.js.map +1 -1
  145. package/dist/extensions/mcp/tools.d.ts +2 -3
  146. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  147. package/dist/extensions/mcp/tools.js +62 -6
  148. package/dist/extensions/mcp/tools.js.map +1 -1
  149. package/dist/extensions/tool-search/tool.d.ts +0 -2
  150. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  151. package/dist/extensions/tool-search/tool.js +2 -4
  152. package/dist/extensions/tool-search/tool.js.map +1 -1
  153. package/dist/index.d.ts +1 -1
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js.map +1 -1
  156. package/dist/main.js +3 -3
  157. package/dist/main.js.map +1 -1
  158. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  159. package/dist/modes/interactive/components/settings-selector.js +3 -2
  160. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  161. package/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  162. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  163. package/dist/modes/interactive/components/status-indicator.js +2 -2
  164. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  165. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  166. package/dist/modes/interactive/interactive-mode.js +11 -5
  167. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  168. package/dist/modes/interactive/theme/dark.json +1 -1
  169. package/dist/modes/interactive/theme/light.json +1 -1
  170. package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  171. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  172. package/dist/modes/interactive/theme/theme-schema.js +105 -0
  173. package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  174. package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  175. package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  176. package/dist/modes/interactive/theme/theme-tokens.js +94 -0
  177. package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  178. package/dist/modes/interactive/theme/theme.d.ts +13 -16
  179. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  180. package/dist/modes/interactive/theme/theme.js +21 -29
  181. package/dist/modes/interactive/theme/theme.js.map +1 -1
  182. package/dist/modes/print-mode.d.ts.map +1 -1
  183. package/dist/modes/print-mode.js +4 -0
  184. package/dist/modes/print-mode.js.map +1 -1
  185. package/dist/utils/clipboard.d.ts.map +1 -1
  186. package/dist/utils/clipboard.js +6 -1
  187. package/dist/utils/clipboard.js.map +1 -1
  188. package/docs/cli-integration.md +1 -1
  189. package/docs/cli.md +1 -1
  190. package/docs/codemode.md +1 -1
  191. package/docs/compaction.md +2 -2
  192. package/docs/environment-variables.md +2 -1
  193. package/docs/extensions.md +7 -4
  194. package/docs/keybindings.md +1 -0
  195. package/docs/mcp.md +1 -1
  196. package/docs/models.md +1 -0
  197. package/docs/providers.md +30 -0
  198. package/docs/settings.md +3 -1
  199. package/docs/themes.md +4 -2
  200. package/docs/tui.md +1 -1
  201. package/examples/README.md +0 -3
  202. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  203. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  204. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  205. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  206. package/examples/extensions/gondolin/package-lock.json +2 -2
  207. package/examples/extensions/gondolin/package.json +1 -1
  208. package/examples/extensions/overlay-test.ts +2 -2
  209. package/examples/extensions/plan-mode/index.ts +6 -2
  210. package/examples/extensions/sandbox/package-lock.json +2 -2
  211. package/examples/extensions/sandbox/package.json +1 -1
  212. package/examples/extensions/with-deps/package-lock.json +2 -2
  213. package/examples/extensions/with-deps/package.json +1 -1
  214. package/package.json +9 -20
  215. package/schemas/keybindings.schema.json +397 -0
  216. package/schemas/models.schema.json +1157 -0
  217. package/schemas/settings.schema.json +765 -0
  218. package/schemas/theme.schema.json +365 -0
  219. package/dist/bundle/chunks/anthropic-messages-VWV2LQLU.js +0 -6
  220. package/dist/bundle/chunks/azure-openai-responses-TJZBTKRM.js +0 -2
  221. package/dist/bundle/chunks/chunk-2DXGY63V.js +0 -15
  222. package/dist/bundle/chunks/chunk-4QEUO5LF.js +0 -20
  223. package/dist/bundle/chunks/chunk-JI2MPSJF.js +0 -2
  224. package/dist/bundle/chunks/chunk-MFRJR46A.js +0 -2
  225. package/dist/bundle/chunks/chunk-QEAD7ZDM.js +0 -82
  226. package/dist/bundle/chunks/chunk-XJNJKWWG.js +0 -138
  227. package/dist/bundle/chunks/easter-egg-3d-VPOZMPG6.js +0 -2
  228. package/dist/bundle/chunks/execute-W7LFAU5T.js +0 -490
  229. package/dist/bundle/chunks/google-generative-ai-MU3HY65Y.js +0 -2
  230. package/dist/bundle/chunks/google-vertex-4KLEFGPG.js +0 -2
  231. package/dist/bundle/chunks/mistral-conversations-QSGGIXSP.js +0 -5
  232. package/dist/bundle/chunks/openai-codex-responses-XHPOB5DF.js +0 -10
  233. package/dist/bundle/chunks/openai-responses-27B2XLS7.js +0 -3
  234. package/dist/bundle/chunks/runtime-PVOHGROZ.js +0 -2
  235. package/dist/bundle/chunks/virtual-modules-LVJTWSUG.js +0 -2
  236. package/dist/modes/interactive/theme/theme-json.d.ts +0 -85
  237. package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  238. package/dist/modes/interactive/theme/theme-json.js +0 -132
  239. package/dist/modes/interactive/theme/theme-json.js.map +0 -1
  240. package/dist/modes/interactive/theme/theme-schema.json +0 -361
  241. package/examples/plugins/pi-example-plugin/README.md +0 -38
  242. package/examples/plugins/pi-example-plugin/package.json +0 -10
  243. package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  244. package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
  245. package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
@@ -0,0 +1,2 @@
1
+ import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
+ import{clampThinkingLevel,getSystemMessageText}from"./chunk-SWXCGFWB.js";var UnsupportedStrictJsonSchemaError=class extends Error{},UNSUPPORTED_STRICT_SCHEMA_KEYS=["$ref","$defs","definitions","allOf","oneOf","patternProperties","dependentSchemas","dependencies","unevaluatedProperties","propertyNames","contains","prefixItems","not","if","then","else"];function isJsonSchemaObject(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isStructuredSchema(schema){if(!isJsonSchemaObject(schema))return!1;let types=typeof schema.type=="string"?[schema.type]:Array.isArray(schema.type)?schema.type:[];return types.includes("object")||types.includes("array")||schema.properties!==void 0||schema.items!==void 0}function schemaAllowsNull(schema){return isJsonSchemaObject(schema)?schema.type==="null"||Array.isArray(schema.type)&&schema.type.includes("null")||schema.const===null||Array.isArray(schema.enum)&&schema.enum.includes(null)?!0:Array.isArray(schema.anyOf)&&schema.anyOf.some(variant=>schemaAllowsNull(variant)):!1}function makeJsonSchemaNodeStrict(schema,isUnsupportedKeyword){if(!isJsonSchemaObject(schema))throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported");for(let key of UNSUPPORTED_STRICT_SCHEMA_KEYS)if(schema[key]!==void 0)throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`);if(isUnsupportedKeyword){for(let[key,value]of Object.entries(schema))if(isUnsupportedKeyword(key,value))throw new UnsupportedStrictJsonSchemaError(`${key}: ${JSON.stringify(value)} is unsupported`)}if(schema.anyOf!==void 0){if(!Array.isArray(schema.anyOf)||schema.anyOf.length===0)throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema");for(let variant of schema.anyOf){if(isStructuredSchema(variant))throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported");makeJsonSchemaNodeStrict(variant,isUnsupportedKeyword)}}if(schema.items!==void 0){if(Array.isArray(schema.items))throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported");makeJsonSchemaNodeStrict(schema.items,isUnsupportedKeyword)}let isObjectSchema=schema.type==="object";if(schema.properties!==void 0&&!isObjectSchema)throw new UnsupportedStrictJsonSchemaError("properties require type object");if(!isObjectSchema)return;if(schema.additionalProperties!==void 0&&schema.additionalProperties!==!1)throw new UnsupportedStrictJsonSchemaError("schema-valued or true additionalProperties is unsupported");if(schema.properties!==void 0&&!isJsonSchemaObject(schema.properties))throw new UnsupportedStrictJsonSchemaError("object properties must be a schema map");if(schema.required!==void 0&&(!Array.isArray(schema.required)||schema.required.some(key=>typeof key!="string")))throw new UnsupportedStrictJsonSchemaError("object required must be a string array");let properties=schema.properties??{},propertyNames=Object.keys(properties),required=new Set(Array.isArray(schema.required)?schema.required:[]);if([...required].some(key=>!propertyNames.includes(key)))throw new UnsupportedStrictJsonSchemaError("required contains an unknown property");for(let[key,property]of Object.entries(properties))makeJsonSchemaNodeStrict(property,isUnsupportedKeyword),!required.has(key)&&!schemaAllowsNull(property)&&(properties[key]={anyOf:[property,{type:"null"}]});schema.required=propertyNames,schema.additionalProperties=!1}function makeStrictJsonSchema(schema,isUnsupportedKeyword){let cloned=structuredClone(schema);if(!isJsonSchemaObject(cloned))throw new UnsupportedStrictJsonSchemaError("root schema must have type object");if(makeJsonSchemaNodeStrict(cloned,isUnsupportedKeyword),cloned.type!=="object")throw new UnsupportedStrictJsonSchemaError("root schema must have type object");return cloned}function getJsonSchemaToolParameters(tool,strict){return strict===!0?makeStrictJsonSchema(tool.parameters):tool.parameters}function getGrammarToolInput(toolName,arguments_,inputProperty){let input=arguments_[inputProperty];if(typeof input!="string")throw new Error(`Grammar tool call "${toolName}" requires argument "${inputProperty}" to be a string.`);return input}function appendGrammarToolInputJsonDelta(buffer,inputProperty,nextInput,close){if(buffer.closed){if(close&&nextInput===buffer.input)return;throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`)}if(!nextInput.startsWith(buffer.input))throw new Error(`grammar tool input for property "${inputProperty}" changed non-monotonically`);let inputDelta=nextInput.slice(buffer.input.length);if(!close&&inputDelta.length===0)return;let delta="";return buffer.started||(delta+=`{${JSON.stringify(inputProperty)}:"`,buffer.started=!0),delta+=JSON.stringify(inputDelta).slice(1,-1),buffer.input=nextInput,close&&(delta+='"}',buffer.closed=!0),delta}function inferGrammarInputProperty(tool){let schema=tool.parameters;if(schema.type!=="object")throw new Error("grammar constrained sampling requires an object parameter schema");if(!Array.isArray(schema.required)||schema.required.length!==1||typeof schema.required[0]!="string")throw new Error("grammar constrained sampling requires exactly one required string property");let inputProperty=schema.required[0];if(!schema.properties?.[inputProperty])throw new Error(`grammar constrained sampling requires a properties entry for ${inputProperty}`);if(schema.properties[inputProperty]?.type!=="string")throw new Error(`grammar constrained sampling property ${inputProperty} must have type string`);return inputProperty}function resolveJsonSchemaStrictSampling(tool,supportsStrictMode,isUnsupportedKeyword){let config=tool.constrainedSampling;if(!(!config||config.type!=="json_schema")){if(supportsStrictMode)try{return makeStrictJsonSchema(tool.parameters,isUnsupportedKeyword),!0}catch(error){if(!(error instanceof UnsupportedStrictJsonSchemaError))throw error;if(config.strict!=="require")return;throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but ${error.message}.`)}if(config.strict==="require")throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`)}}function resolveGrammarConstrainedSampling(tool,supportsOpenAIGrammarTools){let config=tool.constrainedSampling;if(!config||config.type!=="grammar"||!supportsOpenAIGrammarTools)return;let larkDefinition=config.variants.openai_lark,regexDefinition=config.variants.openai_regex,hasLarkDefinition=typeof larkDefinition=="string"&&larkDefinition.trim().length>0,hasRegexDefinition=typeof regexDefinition=="string"&&regexDefinition.trim().length>0;if(!hasLarkDefinition&&!hasRegexDefinition)throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);try{return{format:hasLarkDefinition?"lark":"regex",definition:hasLarkDefinition?larkDefinition:regexDefinition,inputProperty:inferGrammarInputProperty(tool)}}catch(error){let message=error instanceof Error?error.message:String(error);throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: ${message}.`)}}function createGrammarToolInputProperties(tools,supportsOpenAIGrammarTools){let properties=new Map;for(let tool of tools??[]){let grammar=resolveGrammarConstrainedSampling(tool,supportsOpenAIGrammarTools);grammar&&properties.set(tool.name,grammar.inputProperty)}return properties}var CHARS_PER_TOKEN=3.5,ESTIMATED_IMAGE_CHARS=4800;function calculateContextTokens(usage){return usage.totalTokens||usage.input+usage.output+usage.cacheRead+usage.cacheWrite}function safeJsonStringify(value){try{return JSON.stringify(value)??"undefined"}catch{return"[unserializable]"}}function estimateTextAndImageContentChars(content){if(typeof content=="string")return content.length;let chars=0;for(let block of content)chars+=block.type==="text"?block.text.length:ESTIMATED_IMAGE_CHARS;return chars}function estimateTextTokens(text){return Math.ceil(text.length/CHARS_PER_TOKEN)}function estimateTextAndImageContentTokens(content){return Math.ceil(estimateTextAndImageContentChars(content)/CHARS_PER_TOKEN)}function estimateMessageTokens(message){let chars=0;if(message.role==="system")return estimateTextTokens(getSystemMessageText(message))+estimateToolsTokens(message.toolsAdded)+estimateToolsTokens(message.toolsRemoved);if(message.role==="user"||message.role==="toolResult")return estimateTextAndImageContentTokens(message.content);for(let block of message.content)block.type==="text"?chars+=block.text.length:block.type==="thinking"?chars+=block.thinking.length:chars+=block.name.length+safeJsonStringify(block.arguments).length;return Math.ceil(chars/CHARS_PER_TOKEN)}function getLastAssistantUsageInfo(messages){let latestPrefixTimestamp=Number.NEGATIVE_INFINITY,usageInfo;for(let i=0;i<messages.length;i++){let message=messages[i];if(message.role==="assistant"){let assistant=message;assistant.timestamp>=latestPrefixTimestamp&&assistant.stopReason!=="aborted"&&assistant.stopReason!=="error"&&calculateContextTokens(assistant.usage)>0&&(usageInfo={usage:assistant.usage,index:i})}latestPrefixTimestamp=Math.max(latestPrefixTimestamp,message.timestamp)}return usageInfo}function estimateContextTokens(context){let messages="messages"in context?context.messages:context,usageInfo=getLastAssistantUsageInfo(messages);if(usageInfo){let usageTokens=calculateContextTokens(usageInfo.usage),trailingTokens=0;for(let i=usageInfo.index+1;i<messages.length;i++)trailingTokens+=estimateMessageTokens(messages[i]);return{tokens:usageTokens+trailingTokens,usageTokens,trailingTokens,lastUsageIndex:usageInfo.index}}let tokens=0;for(let message of messages)tokens+=estimateMessageTokens(message);return{tokens,usageTokens:0,trailingTokens:tokens,lastUsageIndex:null}}function estimateToolsTokens(tools){return!tools||tools.length===0?0:estimateTextTokens(safeJsonStringify(tools))}var CONTEXT_SAFETY_TOKENS=4096,MIN_MAX_TOKENS=1;function clampMaxTokensToContext(model,context,maxTokens){if(model.contextWindow<=0)return Math.max(MIN_MAX_TOKENS,maxTokens);let available=model.contextWindow-estimateContextTokens(context).tokens-CONTEXT_SAFETY_TOKENS;return Math.min(maxTokens,Math.max(MIN_MAX_TOKENS,available))}function resolveSamplingParams(model,thinkingLevel,requestParams){let effectiveThinkingLevel=clampThinkingLevel(model,thinkingLevel),thinkingLevelParams=model.samplingParamsByThinkingLevel?.[effectiveThinkingLevel];return model.samplingParams||thinkingLevelParams||requestParams?{...model.samplingParams,...thinkingLevelParams,...requestParams}:void 0}function buildBaseOptions(model,context,options,apiKey){let samplingParams=resolveSamplingParams(model,options?.reasoning??"off",options?.samplingParams);return{temperature:options?.temperature,samplingParams,maxTokens:clampMaxTokensToContext(model,context,options?.maxTokens??model.maxTokens),signal:options?.signal,telemetryContext:options?.telemetryContext,apiKey:apiKey||options?.apiKey,fetch:options?.fetch,transport:options?.transport,cacheRetention:options?.cacheRetention,sessionId:options?.sessionId,headers:options?.headers,onPayload:options?.onPayload,onResponse:options?.onResponse,onProviderStreamEvent:options?.onProviderStreamEvent,timeoutMs:options?.timeoutMs,websocketConnectTimeoutMs:options?.websocketConnectTimeoutMs,maxRetries:options?.maxRetries,maxRetryDelayMs:options?.maxRetryDelayMs,metadata:options?.metadata,env:options?.env}}var MIN_ANSWER_TOKENS=1024,DEFAULT_THINKING_BUDGETS={minimal:1024,low:2048,medium:8192,high:16384};function clampReasoning(effort){return effort==="xhigh"||effort==="max"?"high":effort}function thinkingBudgetForLevel(reasoningLevel,customBudgets){let budgets={...DEFAULT_THINKING_BUDGETS,...customBudgets},level=clampReasoning(reasoningLevel);return budgets[level]}function clampThinkingBudgetToAnswerRoom(thinkingBudget,ceiling){return Math.min(thinkingBudget,Math.max(0,ceiling-MIN_ANSWER_TOKENS))}function adjustMaxTokensForThinking(baseMaxTokens,modelMaxTokens,reasoningLevel,customBudgets){let thinkingBudget=thinkingBudgetForLevel(reasoningLevel,customBudgets),maxTokens=baseMaxTokens===void 0?modelMaxTokens:Math.min(baseMaxTokens+thinkingBudget,modelMaxTokens);return maxTokens<=thinkingBudget&&(thinkingBudget=clampThinkingBudgetToAnswerRoom(thinkingBudget,maxTokens)),{maxTokens,thinkingBudget}}var NON_VISION_USER_IMAGE_PLACEHOLDER="(image omitted: model does not support images)",NON_VISION_TOOL_IMAGE_PLACEHOLDER="(tool image omitted: model does not support images)";function replaceImagesWithPlaceholder(content,placeholder){let result=[],previousWasPlaceholder=!1;for(let block of content){if(block.type==="image"){previousWasPlaceholder||result.push({type:"text",text:placeholder}),previousWasPlaceholder=!0;continue}result.push(block),previousWasPlaceholder=block.text===placeholder}return result}function downgradeUnsupportedImages(messages,model){return model.input.includes("image")?messages:messages.map(msg=>msg.role==="user"&&Array.isArray(msg.content)?{...msg,content:replaceImagesWithPlaceholder(msg.content,NON_VISION_USER_IMAGE_PLACEHOLDER)}:msg.role==="toolResult"?{...msg,content:replaceImagesWithPlaceholder(msg.content,NON_VISION_TOOL_IMAGE_PLACEHOLDER)}:msg)}function transformMessages(messages,model,normalizeToolCallId){let toolCallIdMap=new Map,normalizedMessages=messages.map(msg=>msg.content==null?{...msg,content:[]}:msg),transformed=downgradeUnsupportedImages(normalizedMessages,model).map(msg=>{if(msg.role==="system"||msg.role==="user")return msg;if(msg.role==="toolResult"){let normalizedId=toolCallIdMap.get(msg.toolCallId);return normalizedId&&normalizedId!==msg.toolCallId?{...msg,toolCallId:normalizedId}:msg}if(msg.role==="assistant"){let assistantMsg=msg,isSameModel=assistantMsg.provider===model.provider&&assistantMsg.api===model.api&&assistantMsg.model===model.id,transformedContent=assistantMsg.content.flatMap(block=>{if(block.type==="thinking")return block.redacted?isSameModel?block:[]:isSameModel&&block.thinkingSignature?block:!block.thinking||block.thinking.trim()===""?[]:isSameModel?block:{type:"text",text:block.thinking};if(block.type==="text")return isSameModel?block:{type:"text",text:block.text};if(block.type==="toolCall"){let toolCall=block,normalizedToolCall=toolCall;if(!isSameModel&&toolCall.thoughtSignature&&(normalizedToolCall={...toolCall},delete normalizedToolCall.thoughtSignature),!isSameModel&&normalizeToolCallId){let normalizedId=normalizeToolCallId(toolCall.id,model,assistantMsg);normalizedId!==toolCall.id&&(toolCallIdMap.set(toolCall.id,normalizedId),normalizedToolCall={...normalizedToolCall,id:normalizedId})}return normalizedToolCall}return block});return{...assistantMsg,content:transformedContent}}return msg}),result=[],pendingToolCalls=[],existingToolResultIds=new Set,heldSystemMessages=[],closePendingToolCalls=()=>{if(pendingToolCalls.length>0){for(let tc of pendingToolCalls)existingToolResultIds.has(tc.id)||result.push({role:"toolResult",toolCallId:tc.id,toolName:tc.name,content:[{type:"text",text:"No result provided"}],isError:!0,timestamp:Date.now()});pendingToolCalls=[],existingToolResultIds=new Set}result.push(...heldSystemMessages),heldSystemMessages.length=0};for(let i=0;i<transformed.length;i++){let msg=transformed[i];if(msg.role==="assistant"){closePendingToolCalls();let assistantMsg=msg;if(assistantMsg.stopReason==="error"||assistantMsg.stopReason==="aborted")continue;let toolCalls=assistantMsg.content.filter(b=>b.type==="toolCall");toolCalls.length>0&&(pendingToolCalls=toolCalls,existingToolResultIds=new Set),result.push(msg)}else msg.role==="toolResult"?(existingToolResultIds.add(msg.toolCallId),result.push(msg)):msg.role==="system"?pendingToolCalls.length>0?heldSystemMessages.push(msg):result.push(msg):(msg.role==="user"&&closePendingToolCalls(),result.push(msg))}return closePendingToolCalls(),result}export{getJsonSchemaToolParameters,getGrammarToolInput,appendGrammarToolInputJsonDelta,resolveJsonSchemaStrictSampling,resolveGrammarConstrainedSampling,createGrammarToolInputProperties,clampMaxTokensToContext,resolveSamplingParams,buildBaseOptions,thinkingBudgetForLevel,clampThinkingBudgetToAnswerRoom,adjustMaxTokensForThinking,transformMessages};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{mcpNamespace,require_proper_lockfile,validateMcpServerConfig}from"./chunk-2DXGY63V.js";import{CONFIG_DIR_NAME,canonicalizePath,resolvePath,stripBom}from"./chunk-XJNJKWWG.js";import{__toESM}from"./chunk-4L3WN2XY.js";var import_proper_lockfile=__toESM(require_proper_lockfile(),1);import{existsSync,mkdirSync,readFileSync,writeFileSync}from"node:fs";import{homedir}from"node:os";import{dirname,join}from"node:path";var TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES=["settings.json","mcp.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];function normalizeCwd(cwd){return canonicalizePath(resolvePath(cwd))}function findNearestTrustEntry(data,cwd){let currentDir=normalizeCwd(cwd);for(;;){let value=data[currentDir];if(value===!0||value===!1)return{path:currentDir,decision:value};let parentDir=dirname(currentDir);if(parentDir===currentDir)return null;currentDir=parentDir}}function getProjectTrustParentPath(cwd){let trustPath=normalizeCwd(cwd),parentDir=dirname(trustPath);return parentDir===trustPath?void 0:parentDir}function getProjectTrustOptions(cwd,options){let trustPath=normalizeCwd(cwd),trustOptions=[{label:"Trust",trusted:!0,updates:[{path:trustPath,decision:!0}],savedPath:trustPath}],parentPath=getProjectTrustParentPath(cwd);return parentPath!==void 0&&trustOptions.push({label:`Trust parent folder (${parentPath})`,trusted:!0,updates:[{path:parentPath,decision:!0},{path:trustPath,decision:null}],savedPath:parentPath}),options?.includeSessionOnly&&trustOptions.push({label:"Trust (this session only)",trusted:!0,updates:[]}),trustOptions.push({label:"Do not trust",trusted:!1,updates:[{path:trustPath,decision:!1}],savedPath:trustPath}),options?.includeSessionOnly&&trustOptions.push({label:"Do not trust (this session only)",trusted:!1,updates:[]}),trustOptions}function readTrustFile(path){if(!existsSync(path))return{};let parsed;try{parsed=JSON.parse(stripBom(readFileSync(path,"utf-8")))}catch(error){let message=error instanceof Error?error.message:String(error);throw new Error(`Failed to read trust store ${path}: ${message}`)}if(typeof parsed!="object"||parsed===null||Array.isArray(parsed))throw new Error(`Invalid trust store ${path}: expected an object`);let data={};for(let[key,value]of Object.entries(parsed)){if(value!==!0&&value!==!1&&value!==null)throw new Error(`Invalid trust store ${path}: value for ${JSON.stringify(key)} must be true, false, or null`);data[key]=value}return data}function writeTrustFile(path,data){let sorted={};for(let key of Object.keys(data).sort()){let value=data[key];(value===!0||value===!1||value===null)&&(sorted[key]=value)}mkdirSync(dirname(path),{recursive:!0}),writeFileSync(path,`${JSON.stringify(sorted,null,2)}
2
+ import{mcpNamespace,require_proper_lockfile,validateMcpServerConfig}from"./chunk-32OQRHU5.js";import{CONFIG_DIR_NAME,canonicalizePath,resolvePath,stripBom}from"./chunk-VBIW3SGN.js";import{__toESM}from"./chunk-4L3WN2XY.js";var import_proper_lockfile=__toESM(require_proper_lockfile(),1);import{existsSync,mkdirSync,readFileSync,writeFileSync}from"node:fs";import{homedir}from"node:os";import{dirname,join}from"node:path";var TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES=["settings.json","mcp.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];function normalizeCwd(cwd){return canonicalizePath(resolvePath(cwd))}function findNearestTrustEntry(data,cwd){let currentDir=normalizeCwd(cwd);for(;;){let value=data[currentDir];if(value===!0||value===!1)return{path:currentDir,decision:value};let parentDir=dirname(currentDir);if(parentDir===currentDir)return null;currentDir=parentDir}}function getProjectTrustParentPath(cwd){let trustPath=normalizeCwd(cwd),parentDir=dirname(trustPath);return parentDir===trustPath?void 0:parentDir}function getProjectTrustOptions(cwd,options){let trustPath=normalizeCwd(cwd),trustOptions=[{label:"Trust",trusted:!0,updates:[{path:trustPath,decision:!0}],savedPath:trustPath}],parentPath=getProjectTrustParentPath(cwd);return parentPath!==void 0&&trustOptions.push({label:`Trust parent folder (${parentPath})`,trusted:!0,updates:[{path:parentPath,decision:!0},{path:trustPath,decision:null}],savedPath:parentPath}),options?.includeSessionOnly&&trustOptions.push({label:"Trust (this session only)",trusted:!0,updates:[]}),trustOptions.push({label:"Do not trust",trusted:!1,updates:[{path:trustPath,decision:!1}],savedPath:trustPath}),options?.includeSessionOnly&&trustOptions.push({label:"Do not trust (this session only)",trusted:!1,updates:[]}),trustOptions}function readTrustFile(path){if(!existsSync(path))return{};let parsed;try{parsed=JSON.parse(stripBom(readFileSync(path,"utf-8")))}catch(error){let message=error instanceof Error?error.message:String(error);throw new Error(`Failed to read trust store ${path}: ${message}`)}if(typeof parsed!="object"||parsed===null||Array.isArray(parsed))throw new Error(`Invalid trust store ${path}: expected an object`);let data={};for(let[key,value]of Object.entries(parsed)){if(value!==!0&&value!==!1&&value!==null)throw new Error(`Invalid trust store ${path}: value for ${JSON.stringify(key)} must be true, false, or null`);data[key]=value}return data}function writeTrustFile(path,data){let sorted={};for(let key of Object.keys(data).sort()){let value=data[key];(value===!0||value===!1||value===null)&&(sorted[key]=value)}mkdirSync(dirname(path),{recursive:!0}),writeFileSync(path,`${JSON.stringify(sorted,null,2)}
3
3
  `,"utf-8")}function acquireTrustLockSync(path){let trustDir=dirname(path);mkdirSync(trustDir,{recursive:!0});let maxAttempts=10,delayMs=20,lastError;for(let attempt=1;attempt<=maxAttempts;attempt++)try{return import_proper_lockfile.default.lockSync(trustDir,{realpath:!1,lockfilePath:`${path}.lock`})}catch(error){if((typeof error=="object"&&error!==null&&"code"in error?String(error.code):void 0)!=="ELOCKED"||attempt===maxAttempts)throw error;lastError=error;let start=Date.now();for(;Date.now()-start<delayMs;);}throw lastError instanceof Error?lastError:new Error("Failed to acquire trust store lock")}function withTrustFileLock(path,fn){let release=acquireTrustLockSync(path);try{return fn()}finally{release()}}function hasTrustRequiringProjectResources(cwd){let homeDir=canonicalizePath(resolvePath(process.env.HOME||homedir())),userAgentsSkillsDir=join(homeDir,".agents","skills"),currentDir=canonicalizePath(resolvePath(cwd)),configDir=join(currentDir,CONFIG_DIR_NAME);if(TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES.some(entry=>existsSync(join(configDir,entry))))return!0;for(;;){let agentsSkillsDir=join(currentDir,".agents","skills");if(agentsSkillsDir!==userAgentsSkillsDir&&existsSync(agentsSkillsDir))return!0;let parentDir=dirname(currentDir);if(parentDir===currentDir)return!1;currentDir=parentDir}}var ProjectTrustStore=class{trustPath;constructor(agentDir){this.trustPath=join(resolvePath(agentDir),"trust.json")}get(cwd){return this.getEntry(cwd)?.decision??null}getEntry(cwd){return withTrustFileLock(this.trustPath,()=>{let data=readTrustFile(this.trustPath);return findNearestTrustEntry(data,cwd)})}set(cwd,decision){this.setMany([{path:cwd,decision}])}setMany(decisions){withTrustFileLock(this.trustPath,()=>{let data=readTrustFile(this.trustPath);for(let{path,decision}of decisions){let key=normalizeCwd(path);decision===null?delete data[key]:data[key]=decision}writeTrustFile(this.trustPath,data)})}};import{spawn}from"node:child_process";function openBrowser(target){let[cmd,args]=process.platform==="darwin"?["open",[target]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",target]]:["xdg-open",[target]];spawn(cmd,args,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}import{existsSync as existsSync2,mkdirSync as mkdirSync2,readFileSync as readFileSync2,writeFileSync as writeFileSync2}from"node:fs";import{dirname as dirname2,join as join2}from"node:path";var OVERRIDE_KEYS=["enabled","exposure","toolExposure"];function isOverride(value){return value.command===void 0&&value.url===void 0&&value.type===void 0}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function readConfigFile(path,scope,state){let{servers,errors}=state;if(!existsSync2(path))return;let parsed;try{parsed=JSON.parse(readFileSync2(path,"utf8"))}catch(error){errors.push(`${path}: ${error instanceof Error?error.message:String(error)}`);return}if(!isRecord(parsed)||parsed.mcpServers!==void 0&&!isRecord(parsed.mcpServers)){errors.push(`${path}: expected an object with an "mcpServers" object`);return}typeof parsed.autoEnableCodemode=="boolean"?state.autoEnableCodemode=parsed.autoEnableCodemode:parsed.autoEnableCodemode!==void 0&&errors.push(`${path}: autoEnableCodemode must be a boolean`);for(let[name,value]of Object.entries(parsed.mcpServers??{})){if(scope==="project"&&isRecord(value)&&isOverride(value)){let base=servers.get(name),extra=Object.keys(value).filter(key=>!OVERRIDE_KEYS.includes(key));if(!base)errors.push(`${path}: server "${name}" needs "command" or "url", or a global server to override`);else if(extra.length>0)errors.push(`${path}: server "${name}": an override can only set ${OVERRIDE_KEYS.join(", ")}`);else{let config2=validateMcpServerConfig(name,{...base.config,...value});typeof config2=="string"?errors.push(`${path}: ${config2}`):servers.set(name,{...base,config:config2,override:path})}continue}let config=validateMcpServerConfig(name,value);if(typeof config=="string"){errors.push(`${path}: ${config}`);continue}let clash=[...servers.keys()].find(other=>other!==name&&mcpNamespace(other)===mcpNamespace(name));if(clash){errors.push(`${path}: server "${name}" conflicts with "${clash}"`);continue}if(scope==="project"&&"url"in config&&config.auth){errors.push(`${path}: server "${name}": auth is only allowed in the global mcp.json`);continue}servers.set(name,{name,config,source:path,scope})}}function loadMcpConfig(options){let state={servers:new Map,errors:[]};readConfigFile(join2(options.agentDir,"mcp.json"),"global",state);let projectConfig=options.projectTrusted?join2(options.cwd,CONFIG_DIR_NAME,"mcp.json"):void 0;return projectConfig&&readConfigFile(projectConfig,"project",state),{servers:[...state.servers.values()],...state.autoEnableCodemode===void 0?{}:{autoEnableCodemode:state.autoEnableCodemode},errors:state.errors,...projectConfig?{projectConfig}:{}}}function updateMcpServerConfig(path,name,patch,options={}){editMcpServers(path,(servers,parsed)=>{let server=servers?.[name];if(server===void 0&&options.override&&(server={},parsed.mcpServers={...servers,[name]:server}),!isRecord(server))throw new Error(`${path} does not define MCP server "${name}"`);let keepDefaults=isOverride(server);return patch.enabled!==void 0&&(patch.enabled&&!keepDefaults?delete server.enabled:server.enabled=patch.enabled),patch.exposure!==void 0&&(patch.exposure==="codemode"&&!keepDefaults?delete server.exposure:server.exposure=patch.exposure),!0})}function addMcpServerConfig(path,name,config){let replaced=!1;return editMcpServers(path,(servers,parsed)=>{let target=servers??{};return replaced=target[name]!==void 0,target[name]=config,parsed.mcpServers=target,!0}),replaced}function removeMcpServerConfig(path,name){if(!existsSync2(path))return!1;let removed=!1;return editMcpServers(path,servers=>!servers||servers[name]===void 0?!1:(delete servers[name],removed=!0,!0)),removed}function editMcpServers(path,edit){let text=existsSync2(path)?readFileSync2(path,"utf8"):void 0,parsed=text===void 0?{}:JSON.parse(text);if(!isRecord(parsed)||parsed.mcpServers!==void 0&&!isRecord(parsed.mcpServers))throw new Error(`${path}: expected an object with an "mcpServers" object`);let servers=isRecord(parsed.mcpServers)?parsed.mcpServers:void 0;if(!edit(servers,parsed))return;let indent=text&&/^([ \t]+)\S/m.exec(text)?.[1]||" ";mkdirSync2(dirname2(path),{recursive:!0}),writeFileSync2(path,`${JSON.stringify(parsed,null,indent)}
4
4
  `)}export{getProjectTrustOptions,hasTrustRequiringProjectResources,ProjectTrustStore,openBrowser,loadMcpConfig,updateMcpServerConfig,addMcpServerConfig,removeMcpServerConfig};