@jsonstudio/rcc 0.89.3 → 0.89.164

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 (270) hide show
  1. package/README.md +240 -179
  2. package/config/modules.json +1 -11
  3. package/dist/build-info.js +2 -2
  4. package/dist/build-info.js.map +1 -1
  5. package/dist/client/gemini-cli/gemini-cli-protocol-client.d.ts +16 -0
  6. package/dist/client/gemini-cli/gemini-cli-protocol-client.js +56 -0
  7. package/dist/client/gemini-cli/gemini-cli-protocol-client.js.map +1 -0
  8. package/dist/client/openai/chat-protocol-client.js.map +1 -1
  9. package/dist/config/modules.json +1 -11
  10. package/dist/core/provider-health-manager.d.ts +17 -0
  11. package/dist/core/provider-health-manager.js +66 -0
  12. package/dist/core/provider-health-manager.js.map +1 -0
  13. package/dist/error-handling/route-error-hub.d.ts +48 -0
  14. package/dist/error-handling/route-error-hub.js +131 -0
  15. package/dist/error-handling/route-error-hub.js.map +1 -0
  16. package/dist/index.js +26 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/modules/llmswitch/bridge.d.ts +2 -0
  19. package/dist/modules/llmswitch/bridge.js +17 -0
  20. package/dist/modules/llmswitch/bridge.js.map +1 -1
  21. package/dist/modules/pipeline/utils/colored-logger.d.ts +14 -0
  22. package/dist/modules/pipeline/utils/colored-logger.js +48 -0
  23. package/dist/modules/pipeline/utils/colored-logger.js.map +1 -0
  24. package/dist/modules/pipeline/utils/debug-logger.d.ts +2 -0
  25. package/dist/modules/pipeline/utils/debug-logger.js +36 -0
  26. package/dist/modules/pipeline/utils/debug-logger.js.map +1 -1
  27. package/dist/providers/auth/gemini-cli-userinfo-helper.d.ts +53 -0
  28. package/dist/providers/auth/gemini-cli-userinfo-helper.js +152 -0
  29. package/dist/providers/auth/gemini-cli-userinfo-helper.js.map +1 -0
  30. package/dist/providers/auth/oauth-auth.js +3 -2
  31. package/dist/providers/auth/oauth-auth.js.map +1 -1
  32. package/dist/providers/auth/oauth-lifecycle.js +21 -20
  33. package/dist/providers/auth/oauth-lifecycle.js.map +1 -1
  34. package/dist/providers/auth/oauth-logger.d.ts +1 -0
  35. package/dist/providers/auth/oauth-logger.js +21 -0
  36. package/dist/providers/auth/oauth-logger.js.map +1 -0
  37. package/dist/providers/compat/compat-directory-loader.js +2 -55
  38. package/dist/providers/compat/compat-directory-loader.js.map +1 -1
  39. package/dist/providers/compat/compatibility-factory.d.ts +4 -4
  40. package/dist/providers/compat/compatibility-factory.js +108 -0
  41. package/dist/providers/compat/compatibility-factory.js.map +1 -1
  42. package/dist/providers/compat/glm/glm-compatibility.d.ts +2 -2
  43. package/dist/providers/compat/glm/glm-compatibility.js +7 -7
  44. package/dist/providers/compat/glm/glm-compatibility.js.map +1 -1
  45. package/dist/providers/compat/glm/index.js +0 -6
  46. package/dist/providers/compat/glm/index.js.map +1 -1
  47. package/dist/providers/compat/iflow/iflow-compatibility.d.ts +1 -1
  48. package/dist/providers/compat/iflow/iflow-compatibility.js +6 -6
  49. package/dist/providers/compat/iflow/iflow-compatibility.js.map +1 -1
  50. package/dist/providers/compat/index.d.ts +0 -6
  51. package/dist/providers/compat/index.js +0 -7
  52. package/dist/providers/compat/index.js.map +1 -1
  53. package/dist/providers/compat/lmstudio-compatibility.d.ts +2 -2
  54. package/dist/providers/compat/lmstudio-compatibility.js +4 -4
  55. package/dist/providers/compat/lmstudio-compatibility.js.map +1 -1
  56. package/dist/providers/compat/passthrough-compatibility.d.ts +1 -1
  57. package/dist/providers/compat/passthrough-compatibility.js +3 -3
  58. package/dist/providers/compat/passthrough-compatibility.js.map +1 -1
  59. package/dist/providers/compat/profiles/chat/glm/index.d.ts +6 -0
  60. package/dist/providers/compat/profiles/chat/glm/index.js +6 -0
  61. package/dist/providers/compat/profiles/chat/glm/index.js.map +1 -0
  62. package/dist/providers/compat/profiles/chat/iflow/index.d.ts +6 -0
  63. package/dist/providers/compat/profiles/chat/iflow/index.js +6 -0
  64. package/dist/providers/compat/profiles/chat/iflow/index.js.map +1 -0
  65. package/dist/providers/compat/profiles/chat/lmstudio/index.d.ts +6 -0
  66. package/dist/providers/compat/profiles/chat/lmstudio/index.js +6 -0
  67. package/dist/providers/compat/profiles/chat/lmstudio/index.js.map +1 -0
  68. package/dist/providers/compat/profiles/chat/qwen/index.d.ts +6 -0
  69. package/dist/providers/compat/profiles/chat/qwen/index.js +6 -0
  70. package/dist/providers/compat/profiles/chat/qwen/index.js.map +1 -0
  71. package/dist/providers/compat/profiles/compat/passthrough/index.d.ts +6 -0
  72. package/dist/providers/compat/profiles/compat/passthrough/index.js +6 -0
  73. package/dist/providers/compat/profiles/compat/passthrough/index.js.map +1 -0
  74. package/dist/providers/compat/profiles/responses/c4m/index.d.ts +6 -0
  75. package/dist/providers/compat/profiles/responses/c4m/index.js +6 -0
  76. package/dist/providers/compat/profiles/responses/c4m/index.js.map +1 -0
  77. package/dist/providers/compat/profiles/responses/default/index.d.ts +6 -0
  78. package/dist/providers/compat/profiles/responses/default/index.js +6 -0
  79. package/dist/providers/compat/profiles/responses/default/index.js.map +1 -0
  80. package/dist/providers/compat/profiles/responses/fai/index.d.ts +6 -0
  81. package/dist/providers/compat/profiles/responses/fai/index.js +6 -0
  82. package/dist/providers/compat/profiles/responses/fai/index.js.map +1 -0
  83. package/dist/providers/compat/profiles/responses/fc/index.d.ts +6 -0
  84. package/dist/providers/compat/profiles/responses/fc/index.js +6 -0
  85. package/dist/providers/compat/profiles/responses/fc/index.js.map +1 -0
  86. package/dist/providers/compat/qwen/index.js +0 -6
  87. package/dist/providers/compat/qwen/index.js.map +1 -1
  88. package/dist/providers/compat/qwen-compatibility.d.ts +2 -2
  89. package/dist/providers/compat/qwen-compatibility.js +4 -4
  90. package/dist/providers/compat/qwen-compatibility.js.map +1 -1
  91. package/dist/providers/compat/register-compat-module.d.ts +8 -0
  92. package/dist/providers/compat/register-compat-module.js +53 -0
  93. package/dist/providers/compat/register-compat-module.js.map +1 -0
  94. package/dist/providers/compat/responses/c4m-responses-compatibility.d.ts +6 -2
  95. package/dist/providers/compat/responses/c4m-responses-compatibility.js +85 -3
  96. package/dist/providers/compat/responses/c4m-responses-compatibility.js.map +1 -1
  97. package/dist/providers/compat/standard-compatibility-utils.js +45 -15
  98. package/dist/providers/compat/standard-compatibility-utils.js.map +1 -1
  99. package/dist/providers/core/api/provider-config.d.ts +1 -1
  100. package/dist/providers/core/api/provider-types.d.ts +3 -1
  101. package/dist/providers/core/api/provider-types.js +1 -0
  102. package/dist/providers/core/api/provider-types.js.map +1 -1
  103. package/dist/providers/core/config/service-profiles.js +5 -2
  104. package/dist/providers/core/config/service-profiles.js.map +1 -1
  105. package/dist/providers/core/runtime/base-provider.d.ts +3 -0
  106. package/dist/providers/core/runtime/base-provider.js +101 -6
  107. package/dist/providers/core/runtime/base-provider.js.map +1 -1
  108. package/dist/providers/core/runtime/gemini-cli-http-provider.d.ts +34 -0
  109. package/dist/providers/core/runtime/gemini-cli-http-provider.js +152 -0
  110. package/dist/providers/core/runtime/gemini-cli-http-provider.js.map +1 -0
  111. package/dist/providers/core/runtime/http-transport-provider.d.ts +1 -0
  112. package/dist/providers/core/runtime/http-transport-provider.js +178 -123
  113. package/dist/providers/core/runtime/http-transport-provider.js.map +1 -1
  114. package/dist/providers/core/runtime/provider-factory.d.ts +1 -1
  115. package/dist/providers/core/runtime/provider-factory.js +8 -0
  116. package/dist/providers/core/runtime/provider-factory.js.map +1 -1
  117. package/dist/providers/core/runtime/provider-runtime-metadata.d.ts +1 -0
  118. package/dist/providers/core/runtime/provider-runtime-metadata.js.map +1 -1
  119. package/dist/providers/core/runtime/responses-provider.d.ts +7 -0
  120. package/dist/providers/core/runtime/responses-provider.js +228 -12
  121. package/dist/providers/core/runtime/responses-provider.js.map +1 -1
  122. package/dist/providers/core/strategies/oauth-auth-code-flow.js +10 -9
  123. package/dist/providers/core/strategies/oauth-auth-code-flow.js.map +1 -1
  124. package/dist/providers/core/strategies/oauth-device-flow.js +10 -9
  125. package/dist/providers/core/strategies/oauth-device-flow.js.map +1 -1
  126. package/dist/providers/core/utils/provider-error-reporter.js +63 -15
  127. package/dist/providers/core/utils/provider-error-reporter.js.map +1 -1
  128. package/dist/providers/core/utils/provider-type-utils.d.ts +1 -1
  129. package/dist/providers/core/utils/provider-type-utils.js +6 -1
  130. package/dist/providers/core/utils/provider-type-utils.js.map +1 -1
  131. package/dist/providers/core/utils/snapshot-writer.d.ts +10 -0
  132. package/dist/providers/core/utils/snapshot-writer.js +85 -0
  133. package/dist/providers/core/utils/snapshot-writer.js.map +1 -1
  134. package/dist/providers/mock/mock-provider-runtime.js +44 -0
  135. package/dist/providers/mock/mock-provider-runtime.js.map +1 -1
  136. package/dist/providers/profile/provider-profile-loader.js +26 -19
  137. package/dist/providers/profile/provider-profile-loader.js.map +1 -1
  138. package/dist/providers/profile/provider-profile.d.ts +2 -2
  139. package/dist/server/handlers/chat-handler.js +9 -3
  140. package/dist/server/handlers/chat-handler.js.map +1 -1
  141. package/dist/server/handlers/handler-utils.d.ts +7 -1
  142. package/dist/server/handlers/handler-utils.js +64 -52
  143. package/dist/server/handlers/handler-utils.js.map +1 -1
  144. package/dist/server/handlers/messages-handler.js +9 -3
  145. package/dist/server/handlers/messages-handler.js.map +1 -1
  146. package/dist/server/handlers/responses-handler.js +21 -13
  147. package/dist/server/handlers/responses-handler.js.map +1 -1
  148. package/dist/server/runtime/http-server/colored-logger.d.ts +1 -0
  149. package/dist/server/runtime/http-server/colored-logger.js +33 -0
  150. package/dist/server/runtime/http-server/colored-logger.js.map +1 -0
  151. package/dist/server/runtime/http-server/index.d.ts +3 -0
  152. package/dist/server/runtime/http-server/index.js +76 -19
  153. package/dist/server/runtime/http-server/index.js.map +1 -1
  154. package/dist/server/runtime/http-server/provider-utils.d.ts +3 -1
  155. package/dist/server/runtime/http-server/provider-utils.js +12 -2
  156. package/dist/server/runtime/http-server/provider-utils.js.map +1 -1
  157. package/dist/server/runtime/http-server/request-executor.js +6 -2
  158. package/dist/server/runtime/http-server/request-executor.js.map +1 -1
  159. package/dist/server/runtime/http-server/routes.js +31 -11
  160. package/dist/server/runtime/http-server/routes.js.map +1 -1
  161. package/dist/server/runtime/http-server/types.d.ts +2 -1
  162. package/dist/utils/error-center-payload.d.ts +7 -0
  163. package/dist/utils/error-center-payload.js +67 -0
  164. package/dist/utils/error-center-payload.js.map +1 -0
  165. package/dist/utils/error-handler-registry.d.ts +7 -0
  166. package/dist/utils/error-handler-registry.js +44 -12
  167. package/dist/utils/error-handler-registry.js.map +1 -1
  168. package/node_modules/@jsonstudio/llms/dist/conversion/codecs/responses-openai-codec.js +16 -1
  169. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-glm.json +17 -0
  170. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-iflow.json +36 -0
  171. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-lmstudio.json +37 -0
  172. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-qwen.json +18 -0
  173. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/responses-c4m.json +45 -0
  174. package/node_modules/@jsonstudio/llms/dist/conversion/config/compat-profiles.json +38 -0
  175. package/node_modules/@jsonstudio/llms/dist/conversion/config/sample-config.json +314 -0
  176. package/node_modules/@jsonstudio/llms/dist/conversion/config/version-switch.json +150 -0
  177. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-engine.d.ts +4 -0
  178. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-engine.js +667 -0
  179. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-profile-store.d.ts +2 -0
  180. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-profile-store.js +76 -0
  181. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-types.d.ts +62 -0
  182. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-types.js +1 -0
  183. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline.d.ts +2 -0
  184. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline.js +110 -29
  185. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.d.ts +14 -0
  186. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.js +23 -0
  187. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.js +34 -0
  188. package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process.js +4 -1
  189. package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/provider-response.js +26 -0
  190. package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge.d.ts +1 -0
  191. package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge.js +71 -0
  192. package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-conversation-store.d.ts +35 -0
  193. package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-conversation-store.js +64 -19
  194. package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-filter-pipeline.d.ts +21 -0
  195. package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-filter-pipeline.js +138 -22
  196. package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-governor.d.ts +21 -0
  197. package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-governor.js +116 -1
  198. package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-mapping.js +52 -2
  199. package/node_modules/@jsonstudio/llms/dist/filters/config/openai-openai.fieldmap.json +18 -0
  200. package/node_modules/@jsonstudio/llms/dist/filters/special/request-tools-normalize.js +20 -1
  201. package/node_modules/@jsonstudio/llms/dist/guidance/index.js +6 -2
  202. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap.js +16 -7
  203. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/classifier.js +40 -37
  204. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/default-thinking-keywords.d.ts +1 -0
  205. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/default-thinking-keywords.js +13 -0
  206. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine.d.ts +39 -0
  207. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine.js +52 -11
  208. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/features.js +340 -11
  209. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/token-counter.d.ts +2 -0
  210. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/token-counter.js +105 -0
  211. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/types.d.ts +8 -0
  212. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/types.js +2 -2
  213. package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/response-builder.d.ts +2 -0
  214. package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/response-builder.js +53 -11
  215. package/node_modules/@jsonstudio/llms/dist/test-output/virtual-router/results.json +1 -0
  216. package/node_modules/@jsonstudio/llms/dist/test-output/virtual-router/summary.json +12 -0
  217. package/node_modules/@jsonstudio/llms/dist/tools/tool-registry.js +4 -3
  218. package/node_modules/@jsonstudio/llms/package.json +3 -3
  219. package/package.json +11 -9
  220. package/scripts/analyze-routing-classifier.mjs +166 -0
  221. package/scripts/analyze-routing-samples.mjs +216 -0
  222. package/scripts/analyze-thinking-keywords.mjs +17 -2
  223. package/scripts/build-core.mjs +8 -0
  224. package/scripts/classify-sample-tools.mjs +252 -0
  225. package/scripts/ensure-llmswitch-mode.mjs +95 -0
  226. package/scripts/gen-build-info.mjs +58 -4
  227. package/scripts/install-global.sh +1 -1
  228. package/scripts/install-release.sh +7 -0
  229. package/scripts/mock-provider/run-regressions.mjs +60 -14
  230. package/scripts/tests/apply-patch-loop.mjs +100 -9
  231. package/scripts/tests/golden-provider-cycle.mjs +12 -1
  232. package/scripts/tests/responses-provider-dry-run.mjs +15 -1
  233. package/scripts/tests/virtual-router-health.mjs +12 -5
  234. package/scripts/tools/capture-provider-goldens.mjs +75 -25
  235. package/scripts/tools/responses-golden-dry-run.mjs +17 -1
  236. package/scripts/tools/responses-provider-replay.mjs +17 -1
  237. package/scripts/tools/sync-ci-goldens.mjs +131 -0
  238. package/scripts/verification/samples/openai-chat-list-local-files.json +19 -796
  239. package/scripts/verify-e2e-toolcall.mjs +52 -0
  240. package/dist/providers/compat/config/index.d.ts +0 -1
  241. package/dist/providers/compat/config/index.js +0 -5
  242. package/dist/providers/compat/config/index.js.map +0 -1
  243. package/dist/providers/compat/iflow/index.d.ts +0 -27
  244. package/dist/providers/compat/iflow/index.js +0 -32
  245. package/dist/providers/compat/iflow/index.js.map +0 -1
  246. package/dist/providers/compat/lmstudio/index.d.ts +0 -4
  247. package/dist/providers/compat/lmstudio/index.js +0 -10
  248. package/dist/providers/compat/lmstudio/index.js.map +0 -1
  249. package/dist/providers/compat/passthrough/index.d.ts +0 -4
  250. package/dist/providers/compat/passthrough/index.js +0 -9
  251. package/dist/providers/compat/passthrough/index.js.map +0 -1
  252. package/dist/providers/compat/responses/index.d.ts +0 -1
  253. package/dist/providers/compat/responses/index.js +0 -8
  254. package/dist/providers/compat/responses/index.js.map +0 -1
  255. package/dist/providers/core/composite/compat/anthropic.d.ts +0 -3
  256. package/dist/providers/core/composite/compat/anthropic.js +0 -7
  257. package/dist/providers/core/composite/compat/anthropic.js.map +0 -1
  258. package/dist/providers/core/composite/compat/gemini.d.ts +0 -3
  259. package/dist/providers/core/composite/compat/gemini.js +0 -7
  260. package/dist/providers/core/composite/compat/gemini.js.map +0 -1
  261. package/dist/providers/core/composite/compat/openai-compat-aggregator.d.ts +0 -9
  262. package/dist/providers/core/composite/compat/openai-compat-aggregator.js +0 -135
  263. package/dist/providers/core/composite/compat/openai-compat-aggregator.js.map +0 -1
  264. package/dist/providers/core/composite/compat/responses.d.ts +0 -3
  265. package/dist/providers/core/composite/compat/responses.js +0 -91
  266. package/dist/providers/core/composite/compat/responses.js.map +0 -1
  267. package/dist/providers/core/composite/provider-composite.d.ts +0 -50
  268. package/dist/providers/core/composite/provider-composite.js +0 -235
  269. package/dist/providers/core/composite/provider-composite.js.map +0 -1
  270. package/scripts/tests/apply-patch-loop.mjs.bak +0 -363
@@ -1,32 +1,33 @@
1
1
  {
2
- "name": "codex-openai-chat-list-local-files",
3
- "source": "/Users/fanzhang/.routecodex/codex-samples/openai-chat/req_req-v2-1764647061405-dcjhgdfzt_client-request.json",
2
+ "name": "install-verify-chat-shell-ls",
3
+ "source": "synthetic",
4
4
  "endpoint": "/v1/chat/completions",
5
5
  "payload": {
6
- "model": "gpt-5",
6
+ "model": "glm-4.6",
7
+ "temperature": 0,
8
+ "stream": false,
9
+ "tool_choice": {
10
+ "type": "function",
11
+ "function": {
12
+ "name": "shell"
13
+ }
14
+ },
7
15
  "messages": [
8
16
  {
9
17
  "role": "system",
10
- "content": "You are a coding agent running in the Codex CLI, a terminal-based coding assistant. Codex CLI is an open source project led by OpenAI. You are expected to be precise, safe, and helpful.\n\nYour capabilities:\n\n- Receive user prompts and other context provided by the harness, such as files in the workspace.\n- Communicate with the user by streaming thinking & responses, and by making & updating plans.\n- Emit function calls to run terminal commands and apply patches. Depending on how this specific run is configured, you can request that these function calls be escalated to the user for approval before running. More on this in the \"Sandbox and approvals\" section.\n\nWithin this context, Codex refers to the open-source agentic coding interface (not the old Codex language model built by OpenAI).\n\n# How you work\n\n## Personality\n\nYour default personality and tone is concise, direct, and friendly. You communicate efficiently, always keeping the user clearly informed about ongoing actions without unnecessary detail. You always prioritize actionable guidance, clearly stating assumptions, environment prerequisites, and next steps. Unless explicitly asked, you avoid excessively verbose explanations about your work.\n\n# AGENTS.md spec\n- Repos often contain AGENTS.md files. These files can appear anywhere within the repository.\n- These files are a way for humans to give you (the agent) instructions or tips for working within the container.\n- Some examples might be: coding conventions, info about how code is organized, or instructions for how to run or test code.\n- Instructions in AGENTS.md files:\n - The scope of an AGENTS.md file is the entire directory tree rooted at the folder that contains it.\n - For every file you touch in the final patch, you must obey instructions in any AGENTS.md file whose scope includes that file.\n - Instructions about code style, structure, naming, etc. apply only to code within the AGENTS.md file's scope, unless the file states otherwise.\n - More-deeply-nested AGENTS.md files take precedence in the case of conflicting instructions.\n - Direct system/developer/user instructions (as part of a prompt) take precedence over AGENTS.md instructions.\n- The contents of the AGENTS.md file at the root of the repo and any directories from the CWD up to the root are included with the developer message and don't need to be re-read. When working in a subdirectory of CWD, or a directory outside the CWD, check for any AGENTS.md files that may be applicable.\n\n## Responsiveness\n\n### Preamble messages\n\nBefore making tool calls, send a brief preamble to the user explaining what you’re about to do. When sending preamble messages, follow these principles and examples:\n\n- **Logically group related actions**: if you’re about to run several related commands, describe them together in one preamble rather than sending a separate note for each.\n- **Keep it concise**: be no more than 1-2 sentences, focused on immediate, tangible next steps. (8–12 words for quick updates).\n- **Build on prior context**: if this is not your first tool call, use the preamble message to connect the dots with what’s been done so far and create a sense of momentum and clarity for the user to understand your next actions.\n- **Keep your tone light, friendly and curious**: add small touches of personality in preambles feel collaborative and engaging.\n- **Exception**: Avoid adding a preamble for every trivial read (e.g., `cat` a single file) unless it’s part of a larger grouped action.\n\n**Examples:**\n\n- “I’ve explored the repo; now checking the API route definitions.”\n- “Next, I’ll patch the config and update the related tests.”\n- “I’m about to scaffold the CLI commands and helper functions.”\n- “Ok cool, so I’ve wrapped my head around the repo. Now digging into the API routes.”\n- “Config’s looking tidy. Next up is patching helpers to keep things in sync.”\n- “Finished poking at the DB gateway. I will now chase down error handling.”\n- “Alright, build pipeline order is interesting. Checking how it reports failures.”\n- “Spotted a clever caching util; now hunting where it gets used.”\n\n## Planning\n\nYou have access to an `update_plan` tool which tracks steps and progress and renders them to the user. Using the tool helps demonstrate that you've understood the task and convey how you're approaching it. Plans can help to make complex, ambiguous, or multi-phase work clearer and more collaborative for the user. A good plan should break the task into meaningful, logically ordered steps that are easy to verify as you go.\n\nNote that plans are not for padding out simple work with filler steps or stating the obvious. The content of your plan should not involve doing anything that you aren't capable of doing (i.e. don't try to test things that you can't test). Do not use plans for simple or single-step queries that you can just do or answer immediately.\n\nDo not repeat the full contents of the plan after an `update_plan` call — the harness already displays it. Instead, summarize the change made and highlight any important context or next step.\n\nBefore running a command, consider whether or not you have completed the previous step, and make sure to mark it as completed before moving on to the next step. It may be the case that you complete all steps in your plan after a single pass of implementation. If this is the case, you can simply mark all the planned steps as completed. Sometimes, you may need to change plans in the middle of a task: call `update_plan` with the updated plan and make sure to provide an `explanation` of the rationale when doing so.\n\nUse a plan when:\n\n- The task is non-trivial and will require multiple actions over a long time horizon.\n- There are logical phases or dependencies where sequencing matters.\n- The work has ambiguity that benefits from outlining high-level goals.\n- You want intermediate checkpoints for feedback and validation.\n- When the user asked you to do more than one thing in a single prompt\n- The user has asked you to use the plan tool (aka \"TODOs\")\n- You generate additional steps while working, and plan to do them before yielding to the user\n\n### Examples\n\n**High-quality plans**\n\nExample 1:\n\n1. Add CLI entry with file args\n2. Parse Markdown via CommonMark library\n3. Apply semantic HTML template\n4. Handle code blocks, images, links\n5. Add error handling for invalid files\n\nExample 2:\n\n1. Define CSS variables for colors\n2. Add toggle with localStorage state\n3. Refactor components to use variables\n4. Verify all views for readability\n5. Add smooth theme-change transition\n\nExample 3:\n\n1. Set up Node.js + WebSocket server\n2. Add join/leave broadcast events\n3. Implement messaging with timestamps\n4. Add usernames + mention highlighting\n5. Persist messages in lightweight DB\n6. Add typing indicators + unread count\n\n**Low-quality plans**\n\nExample 1:\n\n1. Create CLI tool\n2. Add Markdown parser\n3. Convert to HTML\n\nExample 2:\n\n1. Add dark mode toggle\n2. Save preference\n3. Make styles look good\n\nExample 3:\n\n1. Create single-file HTML game\n2. Run quick sanity check\n3. Summarize usage instructions\n\nIf you need to write a plan, only write high quality plans, not low quality ones.\n\n## Task execution\n\nYou are a coding agent. Please keep going until the query is completely resolved, before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved. Autonomously resolve the query to the best of your ability, using the tools available to you, before coming back to the user. Do NOT guess or make up an answer.\n\nYou MUST adhere to the following criteria when solving queries:\n\n- Working on the repo(s) in the current environment is allowed, even if they are proprietary.\n- Analyzing code for vulnerabilities is allowed.\n- Showing user code and tool call details is allowed.\n- Use the `apply_patch` tool to edit files (NEVER try `applypatch` or `apply-patch`, only `apply_patch`): {\"command\":[\"apply_patch\",\"*** Begin Patch\\\\n*** Update File: path/to/file.py\\\\n@@ def example():\\\\n- pass\\\\n+ return 123\\\\n*** End Patch\"]}\n\nIf completing the user's task requires writing or modifying files, your code and final answer should follow these coding guidelines, though user instructions (i.e. AGENTS.md) may override these guidelines:\n\n- Fix the problem at the root cause rather than applying surface-level patches, when possible.\n- Avoid unneeded complexity in your solution.\n- Do not attempt to fix unrelated bugs or broken tests. It is not your responsibility to fix them. (You may mention them to the user in your final message though.)\n- Update documentation as necessary.\n- Keep changes consistent with the style of the existing codebase. Changes should be minimal and focused on the task.\n- Use `git log` and `git blame` to search the history of the codebase if additional context is required.\n- NEVER add copyright or license headers unless specifically requested.\n- Do not waste tokens by re-reading files after calling `apply_patch` on them. The tool call will fail if it didn't work. The same goes for making folders, deleting folders, etc.\n- Do not `git commit` your changes or create new git branches unless explicitly requested.\n- Do not add inline comments within code unless explicitly requested.\n- Do not use one-letter variable names unless explicitly requested.\n- NEVER output inline citations like \"【F:README.md†L5-L14】\" in your outputs. The CLI is not able to render these so they will just be broken in the UI. Instead, if you output valid filepaths, users will be able to click on them to open the files in their editor.\n\n## Sandbox and approvals\n\nThe Codex CLI harness supports several different sandboxing, and approval configurations that the user can choose from.\n\nFilesystem sandboxing prevents you from editing files without user approval. The options are:\n\n- **read-only**: You can only read files.\n- **workspace-write**: You can read files. You can write to files in your workspace folder, but not outside it.\n- **danger-full-access**: No filesystem sandboxing.\n\nNetwork sandboxing prevents you from accessing network without approval. Options are\n\n- **restricted**\n- **enabled**\n\nApprovals are your mechanism to get user consent to perform more privileged actions. Although they introduce friction to the user because your work is paused until the user responds, you should leverage them to accomplish your important work. Do not let these settings or the sandbox deter you from attempting to accomplish the user's task. Approval options are\n\n- **untrusted**: The harness will escalate most commands for user approval, apart from a limited allowlist of safe \"read\" commands.\n- **on-failure**: The harness will allow all commands to run in the sandbox (if enabled), and failures will be escalated to the user for approval to run again without the sandbox.\n- **on-request**: Commands will be run in the sandbox by default, and you can specify in your tool call if you want to escalate a command to run without sandboxing. (Note that this mode is not always available. If it is, you'll see parameters for it in the `shell` command description.)\n- **never**: This is a non-interactive mode where you may NEVER ask the user for approval to run commands. Instead, you must always persist and work around constraints to solve the task for the user. You MUST do your utmost best to finish the task and validate your work before yielding. If this mode is pared with `danger-full-access`, take advantage of it to deliver the best outcome for the user. Further, in this mode, your default testing philosophy is overridden: Even if you don't see local patterns for testing, you may add tests and scripts to validate your work. Just remove them before yielding.\n\nWhen you are running with approvals `on-request`, and sandboxing enabled, here are scenarios where you'll need to request approval:\n\n- You need to run a command that writes to a directory that requires it (e.g. running tests that write to /tmp)\n- You need to run a GUI app (e.g., open/xdg-open/osascript) to open browsers or files.\n- You are running sandboxed and need to run a command that requires network access (e.g. installing packages)\n- If you run a command that is important to solving the user's query, but it fails because of sandboxing, rerun the command with approval.\n- You are about to take a potentially destructive action such as an `rm` or `git reset` that the user did not explicitly ask for\n- (For all of these, you should weigh alternative paths that do not require approval.)\n\nNote that when sandboxing is set to read-only, you'll need to request approval for any command that isn't a read.\n\nYou will be told what filesystem sandboxing, network sandboxing, and approval mode are active in a developer or user message. If you are not told about this, assume that you are running with workspace-write, network sandboxing ON, and approval on-failure.\n\n## Validating your work\n\nIf the codebase has tests or the ability to build or run, consider using them to verify that your work is complete. \n\nWhen testing, your philosophy should be to start as specific as possible to the code you changed so that you can catch issues efficiently, then make your way to broader tests as you build confidence. If there's no test for the code you changed, and if the adjacent patterns in the codebases show that there's a logical place for you to add a test, you may do so. However, do not add tests to codebases with no tests.\n\nSimilarly, once you're confident in correctness, you can suggest or use formatting commands to ensure that your code is well formatted. If there are issues you can iterate up to 3 times to get formatting right, but if you still can't manage it's better to save the user time and present them a correct solution where you call out the formatting in your final message. If the codebase does not have a formatter configured, do not add one.\n\nFor all of testing, running, building, and formatting, do not attempt to fix unrelated bugs. It is not your responsibility to fix them. (You may mention them to the user in your final message though.)\n\nBe mindful of whether to run validation commands proactively. In the absence of behavioral guidance:\n\n- When running in non-interactive approval modes like **never** or **on-failure**, proactively run tests, lint and do whatever you need to ensure you've completed the task.\n- When working in interactive approval modes like **untrusted**, or **on-request**, hold off on running tests or lint commands until the user is ready for you to finalize your output, because these commands take time to run and slow down iteration. Instead suggest what you want to do next, and let the user confirm first.\n- When working on test-related tasks, such as adding tests, fixing tests, or reproducing a bug to verify behavior, you may proactively run tests regardless of approval mode. Use your judgement to decide whether this is a test-related task.\n\n## Ambition vs. precision\n\nFor tasks that have no prior context (i.e. the user is starting something brand new), you should feel free to be ambitious and demonstrate creativity with your implementation.\n\nIf you're operating in an existing codebase, you should make sure you do exactly what the user asks with surgical precision. Treat the surrounding codebase with respect, and don't overstep (i.e. changing filenames or variables unnecessarily). You should balance being sufficiently ambitious and proactive when completing tasks of this nature.\n\nYou should use judicious initiative to decide on the right level of detail and complexity to deliver based on the user's needs. This means showing good judgment that you're capable of doing the right extras without gold-plating. This might be demonstrated by high-value, creative touches when scope of the task is vague; while being surgical and targeted when scope is tightly specified.\n\n## Sharing progress updates\n\nFor especially longer tasks that you work on (i.e. requiring many tool calls, or a plan with multiple steps), you should provide progress updates back to the user at reasonable intervals. These updates should be structured as a concise sentence or two (no more than 8-10 words long) recapping progress so far in plain language: this update demonstrates your understanding of what needs to be done, progress so far (i.e. files explores, subtasks complete), and where you're going next.\n\nBefore doing large chunks of work that may incur latency as experienced by the user (i.e. writing a new file), you should send a concise message to the user with an update indicating what you're about to do to ensure they know what you're spending time on. Don't start editing or writing large files before informing the user what you are doing and why.\n\nThe messages you send before tool calls should describe what is immediately about to be done next in very concise language. If there was previous work done, this preamble message should also include a note about the work done so far to bring the user along.\n\n## Presenting your work and final message\n\nYour final message should read naturally, like an update from a concise teammate. For casual conversation, brainstorming tasks, or quick questions from the user, respond in a friendly, conversational tone. You should ask questions, suggest ideas, and adapt to the user’s style. If you've finished a large amount of work, when describing what you've done to the user, you should follow the final answer formatting guidelines to communicate substantive changes. You don't need to add structured formatting for one-word answers, greetings, or purely conversational exchanges.\n\nYou can skip heavy formatting for single, simple actions or confirmations. In these cases, respond in plain sentences with any relevant next step or quick option. Reserve multi-section structured responses for results that need grouping or explanation.\n\nThe user is working on the same computer as you, and has access to your work. As such there's no need to show the full contents of large files you have already written unless the user explicitly asks for them. Similarly, if you've created or modified files using `apply_patch`, there's no need to tell users to \"save the file\" or \"copy the code into a file\"—just reference the file path.\n\nIf there's something that you think you could help with as a logical next step, concisely ask the user if they want you to do so. Good examples of this are running tests, committing changes, or building out the next logical component. If there’s something that you couldn't do (even with approval) but that the user might want to do (such as verifying changes by running the app), include those instructions succinctly.\n\nBrevity is very important as a default. You should be very concise (i.e. no more than 10 lines), but can relax this requirement for tasks where additional detail and comprehensiveness is important for the user's understanding.\n\n### Final answer structure and style guidelines\n\nYou are producing plain text that will later be styled by the CLI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.\n\n**Section Headers**\n\n- Use only when they improve clarity — they are not mandatory for every answer.\n- Choose descriptive names that fit the content\n- Keep headers short (1–3 words) and in `**Title Case**`. Always start headers with `**` and end with `**`\n- Leave no blank line before the first bullet under a header.\n- Section headers should only be used where they genuinely improve scanability; avoid fragmenting the answer.\n\n**Bullets**\n\n- Use `-` followed by a space for every bullet.\n- Merge related points when possible; avoid a bullet for every trivial detail.\n- Keep bullets to one line unless breaking for clarity is unavoidable.\n- Group into short lists (4–6 bullets) ordered by importance.\n- Use consistent keyword phrasing and formatting across sections.\n\n**Monospace**\n\n- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``).\n- Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.\n- Never mix monospace and bold markers; choose one based on whether it’s a keyword (`**`) or inline code/path (`` ` ``).\n\n**File References**\nWhen referencing files in your response, make sure to include the relevant start line and always follow the below rules:\n * Use inline code to make file paths clickable.\n * Each reference should have a stand alone path. Even if it's the same file.\n * Accepted: absolute, workspace‑relative, a/ or b/ diff prefixes, or bare filename/suffix.\n * Line/column (1‑based, optional): :line[:column] or #Lline[Ccolumn] (column defaults to 1).\n * Do not use URIs like file://, vscode://, or https://.\n * Do not provide range of lines\n * Examples: src/app.ts, src/app.ts:42, b/server/index.js#L10, C:\\repo\\project\\main.rs:12:5\n\n**Structure**\n\n- Place related bullets together; don’t mix unrelated concepts in the same section.\n- Order sections from general → specific → supporting info.\n- For subsections (e.g., “Binaries” under “Rust Workspace”), introduce with a bolded keyword bullet, then list items under it.\n- Match structure to complexity:\n - Multi-part or detailed results → use clear headers and grouped bullets.\n - Simple results → minimal headers, possibly just a short list or paragraph.\n\n**Tone**\n\n- Keep the voice collaborative and natural, like a coding partner handing off work.\n- Be concise and factual — no filler or conversational commentary and avoid unnecessary repetition\n- Use present tense and active voice (e.g., “Runs tests” not “This will run tests”).\n- Keep descriptions self-contained; don’t refer to “above” or “below”.\n- Use parallel structure in lists for consistency.\n\n**Don’t**\n\n- Don’t use literal words “bold” or “monospace” in the content.\n- Don’t nest bullets or create deep hierarchies.\n- Don’t output ANSI escape codes directly — the CLI renderer applies them.\n- Don’t cram unrelated keywords into a single bullet; split for clarity.\n- Don’t let keyword lists run long — wrap or reformat for scanability.\n\nGenerally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what’s needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable.\n\nFor casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting.\n\n# Tool Guidelines\n\n## Shell commands\n\nWhen using the shell, you must adhere to the following guidelines:\n\n- When searching for text or files, prefer using `rg` or `rg --files` respectively because `rg` is much faster than alternatives like `grep`. (If the `rg` command is not found, then use alternatives.)\n- Read files in chunks with a max chunk size of 250 lines. Do not use python scripts to attempt to output larger chunks of a file. Command line output will be truncated after 10 kilobytes or 256 lines of output, regardless of the command used.\n\n## `update_plan`\n\nA tool named `update_plan` is available to you. You can use it to keep an up‑to‑date, step‑by‑step plan for the task.\n\nTo create a new plan, call `update_plan` with a short list of 1‑sentence steps (no more than 5-7 words each) with a `status` for each step (`pending`, `in_progress`, or `completed`).\n\nWhen steps have been completed, use `update_plan` to mark each finished step as `completed` and the next step you are working on as `in_progress`. There should always be exactly one `in_progress` step until everything is done. You can mark multiple items as complete in a single `update_plan` call.\n\nIf all steps are complete, ensure you call `update_plan` to mark all steps as `completed`.\n\n## `apply_patch`\n\nUse the `apply_patch` shell command to edit files.\nYour patch language is a stripped‑down, file‑oriented diff format designed to be easy to parse and safe to apply. You can think of it as a high‑level envelope:\n\n*** Begin Patch\n[ one or more file sections ]\n*** End Patch\n\nWithin that envelope, you get a sequence of file operations.\nYou MUST include a header to specify the action you are taking.\nEach operation starts with one of three headers:\n\n*** Add File: <path> - create a new file. Every following line is a + line (the initial contents).\n*** Delete File: <path> - remove an existing file. Nothing follows.\n*** Update File: <path> - patch an existing file in place (optionally with a rename).\n\nMay be immediately followed by *** Move to: <new path> if you want to rename the file.\nThen one or more “hunks”, each introduced by @@ (optionally followed by a hunk header).\nWithin a hunk each line starts with:\n\nFor instructions on [context_before] and [context_after]:\n- By default, show 3 lines of code immediately above and 3 lines immediately below each change. If a change is within 3 lines of a previous change, do NOT duplicate the first change’s [context_after] lines in the second change’s [context_before] lines.\n- If 3 lines of context is insufficient to uniquely identify the snippet of code within the file, use the @@ operator to indicate the class or function to which the snippet belongs. For instance, we might have:\n@@ class BaseClass\n[3 lines of pre-context]\n- [old_code]\n+ [new_code]\n[3 lines of post-context]\n\n- If a code block is repeated so many times in a class or function such that even a single `@@` statement and 3 lines of context cannot uniquely identify the snippet of code, you can use multiple `@@` statements to jump to the right context. For instance:\n\n@@ class BaseClass\n@@ \t def method():\n[3 lines of pre-context]\n- [old_code]\n+ [new_code]\n[3 lines of post-context]\n\nThe full grammar definition is below:\nPatch := Begin { FileOp } End\nBegin := \"*** Begin Patch\" NEWLINE\nEnd := \"*** End Patch\" NEWLINE\nFileOp := AddFile | DeleteFile | UpdateFile\nAddFile := \"*** Add File: \" path NEWLINE { \"+\" line NEWLINE }\nDeleteFile := \"*** Delete File: \" path NEWLINE\nUpdateFile := \"*** Update File: \" path NEWLINE [ MoveTo ] { Hunk }\nMoveTo := \"*** Move to: \" newPath NEWLINE\nHunk := \"@@\" [ header ] NEWLINE { HunkLine } [ \"*** End of File\" NEWLINE ]\nHunkLine := (\" \" | \"-\" | \"+\") text NEWLINE\n\nA full patch can combine several operations:\n\n*** Begin Patch\n*** Add File: hello.txt\n+Hello world\n*** Update File: src/app.py\n*** Move to: src/main.py\n@@ def greet():\n-print(\"Hi\")\n+print(\"Hello, world!\")\n*** Delete File: obsolete.txt\n*** End Patch\n\nIt is important to remember:\n\n- You must include a header with your intended action (Add/Delete/Update)\n- You must prefix new lines with `+` even when creating a new file\n- File references can only be relative, NEVER ABSOLUTE.\n\nYou can invoke apply_patch like:\n\n```\nshell {\"command\":[\"apply_patch\",\"*** Begin Patch\\n*** Add File: hello.txt\\n+Hello, world!\\n*** End Patch\\n\"]}\n```\n"
11
- },
12
- {
13
- "role": "user",
14
- "content": "# AGENTS.md instructions for /Users/fanzhang/Documents/github/uvcmirror\n\n<INSTRUCTIONS>\n# AGENTS 指南\n\n1. **函数化 & 模块化** \n - 所有业务逻辑必须拆分为清晰的函数/模块,严禁在 `main` 或控制器中堆砌扁平代码。 \n - 每个模块暴露明确的 API,便于追踪调用路径和单元测试。 \n2. **调用路径可追踪** \n - 在关键入口增加结构化日志(`tracing`),记录函数名、调用参数与结果,确保 dev 版本能够追踪完整执行路径。 \n - 对关键流程可生成快照/trace(例如将请求上下文写入调试文件)以便复现问题。 \n3. **日志与快照策略** \n - dev 构建启用 verbose 日志与简易快照输出;release 构建默认关闭快照,只保留必要日志。 \n - 快照命名包含时间戳 + 函数名,避免相互覆盖;日志需包含 correlation id(例如 session_id)。 \n4. **审查要求** \n - PR/代码提交前必须检查是否违反上面约束;如需临时放宽需在 `AGENTS.md` 记录原因与期限。 \n\n</INSTRUCTIONS>"
15
- },
16
- {
17
- "role": "user",
18
- "content": "<environment_context>\n <cwd>/Users/fanzhang/Documents/github/uvcmirror</cwd>\n <approval_policy>on-request</approval_policy>\n <sandbox_mode>workspace-write</sandbox_mode>\n <network_access>restricted</network_access>\n <shell>zsh</shell>\n</environment_context>"
18
+ "content": "You are a safety-checked coding assistant whose tools only include a sandboxed shell. Whenever the user requests a directory listing you MUST call the `shell` tool with the exact command `ls -la`. After the tool finishes, summarize the first few entries in plain Chinese."
19
19
  },
20
20
  {
21
21
  "role": "user",
22
- "content": "列出本地文件"
22
+ "content": "请调用 shell 工具运行 `ls -la` 查看工作目录,然后把前几行告诉我。"
23
23
  }
24
24
  ],
25
- "stream": true,
26
25
  "tools": [
27
26
  {
28
27
  "type": "function",
29
28
  "function": {
29
+ "name": "shell",
30
+ "description": "执行安全的 shell 命令,只允许类似 ls 的只读操作。",
30
31
  "parameters": {
31
32
  "type": "object",
32
33
  "properties": {
@@ -35,797 +36,19 @@
35
36
  "items": {
36
37
  "type": "string"
37
38
  },
38
- "description": "The command to execute"
39
- },
40
- "justification": {
41
- "type": "string",
42
- "description": "Only set if with_escalated_permissions is true. 1-sentence explanation of why we want to run this command."
43
- },
44
- "timeout_ms": {
45
- "type": "number",
46
- "description": "The timeout for the command in milliseconds"
47
- },
48
- "with_escalated_permissions": {
49
- "type": "boolean",
50
- "description": "Whether to request escalated permissions. Set to true if command needs to be run without sandbox restrictions"
39
+ "description": "要执行的命令数组,例如 [\"bash\", \"-lc\", \"ls -la\"]"
51
40
  },
52
41
  "workdir": {
53
42
  "type": "string",
54
- "description": "The working directory to execute the command in"
43
+ "description": "可选工作目录"
55
44
  }
56
45
  },
57
46
  "required": [
58
47
  "command"
59
- ],
60
- "additionalProperties": false
61
- },
62
- "name": "shell",
63
- "description": "Runs a shell command and returns its output.\n- The arguments to `shell` will be passed to execvp(). Most terminal commands should be prefixed with [\"bash\", \"-lc\"].\n- Always set the `workdir` param when using the shell function. Do not use `cd` unless absolutely necessary.",
64
- "strict": false
65
- }
66
- },
67
- {
68
- "type": "function",
69
- "function": {
70
- "parameters": {
71
- "type": "object",
72
- "properties": {
73
- "cursor": {
74
- "type": "string",
75
- "description": "Opaque cursor returned by a previous list_mcp_resources call for the same server."
76
- },
77
- "server": {
78
- "type": "string",
79
- "description": "Optional MCP server name. When omitted, lists resources from every configured server."
80
- }
81
- },
82
- "additionalProperties": false
83
- },
84
- "name": "list_mcp_resources",
85
- "description": "Lists resources provided by MCP servers. Resources allow servers to share data that provides context to language models, such as files, database schemas, or application-specific information. Prefer resources over web search when possible.",
86
- "strict": false
87
- }
88
- },
89
- {
90
- "type": "function",
91
- "function": {
92
- "parameters": {
93
- "type": "object",
94
- "properties": {
95
- "cursor": {
96
- "type": "string",
97
- "description": "Opaque cursor returned by a previous list_mcp_resource_templates call for the same server."
98
- },
99
- "server": {
100
- "type": "string",
101
- "description": "Optional MCP server name. When omitted, lists resource templates from all configured servers."
102
- }
103
- },
104
- "additionalProperties": false
105
- },
106
- "name": "list_mcp_resource_templates",
107
- "description": "Lists resource templates provided by MCP servers. Parameterized resource templates allow servers to share data that takes parameters and provides context to language models, such as files, database schemas, or application-specific information. Prefer resource templates over web search when possible.",
108
- "strict": false
109
- }
110
- },
111
- {
112
- "type": "function",
113
- "function": {
114
- "parameters": {
115
- "type": "object",
116
- "properties": {
117
- "server": {
118
- "type": "string",
119
- "description": "MCP server name exactly as configured. Must match the 'server' field returned by list_mcp_resources."
120
- },
121
- "uri": {
122
- "type": "string",
123
- "description": "Resource URI to read. Must be one of the URIs returned by list_mcp_resources."
124
- }
125
- },
126
- "required": [
127
- "server",
128
- "uri"
129
- ],
130
- "additionalProperties": false
131
- },
132
- "name": "read_mcp_resource",
133
- "description": "Read a specific resource from an MCP server given the server name and resource URI.",
134
- "strict": false
135
- }
136
- },
137
- {
138
- "type": "function",
139
- "function": {
140
- "parameters": {
141
- "type": "object",
142
- "properties": {
143
- "explanation": {
144
- "type": "string"
145
- },
146
- "plan": {
147
- "type": "array",
148
- "items": {
149
- "type": "object",
150
- "properties": {
151
- "status": {
152
- "type": "string",
153
- "description": "One of: pending, in_progress, completed"
154
- },
155
- "step": {
156
- "type": "string"
157
- }
158
- },
159
- "required": [
160
- "step",
161
- "status"
162
- ],
163
- "additionalProperties": false
164
- },
165
- "description": "The list of steps"
166
- }
167
- },
168
- "required": [
169
- "plan"
170
- ],
171
- "additionalProperties": false
172
- },
173
- "name": "update_plan",
174
- "description": "Updates the task plan.\nProvide an optional explanation and a list of plan items, each with a step and status.\nAt most one step can be in_progress at a time.\n",
175
- "strict": false
176
- }
177
- },
178
- {
179
- "type": "function",
180
- "function": {
181
- "parameters": {
182
- "type": "object",
183
- "properties": {
184
- "path": {
185
- "type": "string",
186
- "description": "Local filesystem path to an image file"
187
- }
188
- },
189
- "required": [
190
- "path"
191
- ],
192
- "additionalProperties": false
193
- },
194
- "name": "view_image",
195
- "description": "Attach a local image (by filesystem path) to the conversation context for this turn.",
196
- "strict": false
197
- }
198
- },
199
- {
200
- "type": "function",
201
- "function": {
202
- "parameters": {
203
- "type": "object",
204
- "properties": {
205
- "dblClick": {
206
- "type": "boolean",
207
- "description": "Set to true for double clicks. Default is false."
208
- },
209
- "uid": {
210
- "type": "string",
211
- "description": "The uid of an element on the page from the page content snapshot"
212
- }
213
- },
214
- "required": [
215
- "uid"
216
- ]
217
- },
218
- "name": "mcp__chrome-devtools__click",
219
- "description": "Clicks on the provided element",
220
- "strict": false
221
- }
222
- },
223
- {
224
- "type": "function",
225
- "function": {
226
- "parameters": {
227
- "type": "object",
228
- "properties": {
229
- "pageIdx": {
230
- "type": "number",
231
- "description": "The index of the page to close. Call list_pages to list pages."
232
- }
233
- },
234
- "required": [
235
- "pageIdx"
236
- ]
237
- },
238
- "name": "mcp__chrome-devtools__close_page",
239
- "description": "Closes the page by its index. The last open page cannot be closed.",
240
- "strict": false
241
- }
242
- },
243
- {
244
- "type": "function",
245
- "function": {
246
- "parameters": {
247
- "type": "object",
248
- "properties": {
249
- "from_uid": {
250
- "type": "string",
251
- "description": "The uid of the element to drag"
252
- },
253
- "to_uid": {
254
- "type": "string",
255
- "description": "The uid of the element to drop into"
256
- }
257
- },
258
- "required": [
259
- "from_uid",
260
- "to_uid"
261
- ]
262
- },
263
- "name": "mcp__chrome-devtools__drag",
264
- "description": "Drag an element onto another element",
265
- "strict": false
266
- }
267
- },
268
- {
269
- "type": "function",
270
- "function": {
271
- "parameters": {
272
- "type": "object",
273
- "properties": {
274
- "cpuThrottlingRate": {
275
- "type": "number",
276
- "description": "Represents the CPU slowdown factor. Set the rate to 1 to disable throttling. If omitted, throttling remains unchanged."
277
- },
278
- "networkConditions": {
279
- "type": "string",
280
- "description": "Throttle network. Set to \"No emulation\" to disable. If omitted, conditions remain unchanged."
281
- }
282
- }
283
- },
284
- "name": "mcp__chrome-devtools__emulate",
285
- "description": "Emulates various features on the selected page.",
286
- "strict": false
287
- }
288
- },
289
- {
290
- "type": "function",
291
- "function": {
292
- "parameters": {
293
- "type": "object",
294
- "properties": {
295
- "args": {
296
- "type": "array",
297
- "items": {
298
- "type": "object",
299
- "properties": {
300
- "uid": {
301
- "type": "string",
302
- "description": "The uid of an element on the page from the page content snapshot"
303
- }
304
- },
305
- "required": [
306
- "uid"
307
- ],
308
- "additionalProperties": false
309
- },
310
- "description": "An optional list of arguments to pass to the function."
311
- },
312
- "function": {
313
- "type": "string",
314
- "description": "A JavaScript function declaration to be executed by the tool in the currently selected page.\nExample without arguments: `() => {\n return document.title\n}` or `async () => {\n return await fetch(\"example.com\")\n}`.\nExample with arguments: `(el) => {\n return el.innerText;\n}`\n"
315
- }
316
- },
317
- "required": [
318
- "function"
319
- ]
320
- },
321
- "name": "mcp__chrome-devtools__evaluate_script",
322
- "description": "Evaluate a JavaScript function inside the currently selected page. Returns the response as JSON\nso returned values have to JSON-serializable.",
323
- "strict": false
324
- }
325
- },
326
- {
327
- "type": "function",
328
- "function": {
329
- "parameters": {
330
- "type": "object",
331
- "properties": {
332
- "uid": {
333
- "type": "string",
334
- "description": "The uid of an element on the page from the page content snapshot"
335
- },
336
- "value": {
337
- "type": "string",
338
- "description": "The value to fill in"
339
- }
340
- },
341
- "required": [
342
- "uid",
343
- "value"
344
- ]
345
- },
346
- "name": "mcp__chrome-devtools__fill",
347
- "description": "Type text into a input, text area or select an option from a <select> element.",
348
- "strict": false
349
- }
350
- },
351
- {
352
- "type": "function",
353
- "function": {
354
- "parameters": {
355
- "type": "object",
356
- "properties": {
357
- "elements": {
358
- "type": "array",
359
- "items": {
360
- "type": "object",
361
- "properties": {
362
- "uid": {
363
- "type": "string",
364
- "description": "The uid of the element to fill out"
365
- },
366
- "value": {
367
- "type": "string",
368
- "description": "Value for the element"
369
- }
370
- },
371
- "required": [
372
- "uid",
373
- "value"
374
- ],
375
- "additionalProperties": false
376
- },
377
- "description": "Elements from snapshot to fill out."
378
- }
379
- },
380
- "required": [
381
- "elements"
382
- ]
383
- },
384
- "name": "mcp__chrome-devtools__fill_form",
385
- "description": "Fill out multiple form elements at once",
386
- "strict": false
387
- }
388
- },
389
- {
390
- "type": "function",
391
- "function": {
392
- "parameters": {
393
- "type": "object",
394
- "properties": {
395
- "msgid": {
396
- "type": "number",
397
- "description": "The msgid of a console message on the page from the listed console messages"
398
- }
399
- },
400
- "required": [
401
- "msgid"
402
- ]
403
- },
404
- "name": "mcp__chrome-devtools__get_console_message",
405
- "description": "Gets a console message by its ID. You can get all messages by calling list_console_messages.",
406
- "strict": false
407
- }
408
- },
409
- {
410
- "type": "function",
411
- "function": {
412
- "parameters": {
413
- "type": "object",
414
- "properties": {
415
- "reqid": {
416
- "type": "number",
417
- "description": "The reqid of the network request. If omitted returns the currently selected request in the DevTools Network panel."
418
- }
419
- }
420
- },
421
- "name": "mcp__chrome-devtools__get_network_request",
422
- "description": "Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel.",
423
- "strict": false
424
- }
425
- },
426
- {
427
- "type": "function",
428
- "function": {
429
- "parameters": {
430
- "type": "object",
431
- "properties": {
432
- "action": {
433
- "type": "string",
434
- "description": "Whether to dismiss or accept the dialog"
435
- },
436
- "promptText": {
437
- "type": "string",
438
- "description": "Optional prompt text to enter into the dialog."
439
- }
440
- },
441
- "required": [
442
- "action"
443
- ]
444
- },
445
- "name": "mcp__chrome-devtools__handle_dialog",
446
- "description": "If a browser dialog was opened, use this command to handle it",
447
- "strict": false
448
- }
449
- },
450
- {
451
- "type": "function",
452
- "function": {
453
- "parameters": {
454
- "type": "object",
455
- "properties": {
456
- "uid": {
457
- "type": "string",
458
- "description": "The uid of an element on the page from the page content snapshot"
459
- }
460
- },
461
- "required": [
462
- "uid"
463
- ]
464
- },
465
- "name": "mcp__chrome-devtools__hover",
466
- "description": "Hover over the provided element",
467
- "strict": false
468
- }
469
- },
470
- {
471
- "type": "function",
472
- "function": {
473
- "parameters": {
474
- "type": "object",
475
- "properties": {
476
- "includePreservedMessages": {
477
- "type": "boolean",
478
- "description": "Set to true to return the preserved messages over the last 3 navigations."
479
- },
480
- "pageIdx": {
481
- "type": "number",
482
- "description": "Page number to return (0-based). When omitted, returns the first page."
483
- },
484
- "pageSize": {
485
- "type": "number",
486
- "description": "Maximum number of messages to return. When omitted, returns all requests."
487
- },
488
- "types": {
489
- "type": "array",
490
- "items": {
491
- "type": "string"
492
- },
493
- "description": "Filter messages to only return messages of the specified resource types. When omitted or empty, returns all messages."
494
- }
495
- }
496
- },
497
- "name": "mcp__chrome-devtools__list_console_messages",
498
- "description": "List all console messages for the currently selected page since the last navigation.",
499
- "strict": false
500
- }
501
- },
502
- {
503
- "type": "function",
504
- "function": {
505
- "parameters": {
506
- "type": "object",
507
- "properties": {
508
- "includePreservedRequests": {
509
- "type": "boolean",
510
- "description": "Set to true to return the preserved requests over the last 3 navigations."
511
- },
512
- "pageIdx": {
513
- "type": "number",
514
- "description": "Page number to return (0-based). When omitted, returns the first page."
515
- },
516
- "pageSize": {
517
- "type": "number",
518
- "description": "Maximum number of requests to return. When omitted, returns all requests."
519
- },
520
- "resourceTypes": {
521
- "type": "array",
522
- "items": {
523
- "type": "string"
524
- },
525
- "description": "Filter requests to only return requests of the specified resource types. When omitted or empty, returns all requests."
526
- }
527
- }
528
- },
529
- "name": "mcp__chrome-devtools__list_network_requests",
530
- "description": "List all requests for the currently selected page since the last navigation.",
531
- "strict": false
532
- }
533
- },
534
- {
535
- "type": "function",
536
- "function": {
537
- "parameters": {
538
- "type": "object",
539
- "properties": {}
540
- },
541
- "name": "mcp__chrome-devtools__list_pages",
542
- "description": "Get a list of pages open in the browser.",
543
- "strict": false
544
- }
545
- },
546
- {
547
- "type": "function",
548
- "function": {
549
- "parameters": {
550
- "type": "object",
551
- "properties": {
552
- "ignoreCache": {
553
- "type": "boolean",
554
- "description": "Whether to ignore cache on reload."
555
- },
556
- "timeout": {
557
- "type": "number",
558
- "description": "Maximum wait time in milliseconds. If set to 0, the default timeout will be used."
559
- },
560
- "type": {
561
- "type": "string",
562
- "description": "Navigate the page by URL, back or forward in history, or reload."
563
- },
564
- "url": {
565
- "type": "string",
566
- "description": "Target URL (only type=url)"
567
- }
568
- }
569
- },
570
- "name": "mcp__chrome-devtools__navigate_page",
571
- "description": "Navigates the currently selected page to a URL.",
572
- "strict": false
573
- }
574
- },
575
- {
576
- "type": "function",
577
- "function": {
578
- "parameters": {
579
- "type": "object",
580
- "properties": {
581
- "timeout": {
582
- "type": "number",
583
- "description": "Maximum wait time in milliseconds. If set to 0, the default timeout will be used."
584
- },
585
- "url": {
586
- "type": "string",
587
- "description": "URL to load in a new page."
588
- }
589
- },
590
- "required": [
591
- "url"
592
- ]
593
- },
594
- "name": "mcp__chrome-devtools__new_page",
595
- "description": "Creates a new page",
596
- "strict": false
597
- }
598
- },
599
- {
600
- "type": "function",
601
- "function": {
602
- "parameters": {
603
- "type": "object",
604
- "properties": {
605
- "insightName": {
606
- "type": "string",
607
- "description": "The name of the Insight you want more information on. For example: \"DocumentLatency\" or \"LCPBreakdown\""
608
- },
609
- "insightSetId": {
610
- "type": "string",
611
- "description": "The id for the specific insight set. Only use the ids given in the \"Available insight sets\" list."
612
- }
613
- },
614
- "required": [
615
- "insightSetId",
616
- "insightName"
617
- ]
618
- },
619
- "name": "mcp__chrome-devtools__performance_analyze_insight",
620
- "description": "Provides more detailed information on a specific Performance Insight of an insight set that was highlighted in the results of a trace recording.",
621
- "strict": false
622
- }
623
- },
624
- {
625
- "type": "function",
626
- "function": {
627
- "parameters": {
628
- "type": "object",
629
- "properties": {
630
- "autoStop": {
631
- "type": "boolean",
632
- "description": "Determines if the trace recording should be automatically stopped."
633
- },
634
- "reload": {
635
- "type": "boolean",
636
- "description": "Determines if, once tracing has started, the page should be automatically reloaded."
637
- }
638
- },
639
- "required": [
640
- "reload",
641
- "autoStop"
642
- ]
643
- },
644
- "name": "mcp__chrome-devtools__performance_start_trace",
645
- "description": "Starts a performance trace recording on the selected page. This can be used to look for performance problems and insights to improve the performance of the page. It will also report Core Web Vital (CWV) scores for the page.",
646
- "strict": false
647
- }
648
- },
649
- {
650
- "type": "function",
651
- "function": {
652
- "parameters": {
653
- "type": "object",
654
- "properties": {}
655
- },
656
- "name": "mcp__chrome-devtools__performance_stop_trace",
657
- "description": "Stops the active performance trace recording on the selected page.",
658
- "strict": false
659
- }
660
- },
661
- {
662
- "type": "function",
663
- "function": {
664
- "parameters": {
665
- "type": "object",
666
- "properties": {
667
- "key": {
668
- "type": "string",
669
- "description": "A key or a combination (e.g., \"Enter\", \"Control+A\", \"Control++\", \"Control+Shift+R\"). Modifiers: Control, Shift, Alt, Meta"
670
- }
671
- },
672
- "required": [
673
- "key"
674
- ]
675
- },
676
- "name": "mcp__chrome-devtools__press_key",
677
- "description": "Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations).",
678
- "strict": false
679
- }
680
- },
681
- {
682
- "type": "function",
683
- "function": {
684
- "parameters": {
685
- "type": "object",
686
- "properties": {
687
- "height": {
688
- "type": "number",
689
- "description": "Page height"
690
- },
691
- "width": {
692
- "type": "number",
693
- "description": "Page width"
694
- }
695
- },
696
- "required": [
697
- "width",
698
- "height"
699
- ]
700
- },
701
- "name": "mcp__chrome-devtools__resize_page",
702
- "description": "Resizes the selected page's window so that the page has specified dimension",
703
- "strict": false
704
- }
705
- },
706
- {
707
- "type": "function",
708
- "function": {
709
- "parameters": {
710
- "type": "object",
711
- "properties": {
712
- "pageIdx": {
713
- "type": "number",
714
- "description": "The index of the page to select. Call list_pages to list pages."
715
- }
716
- },
717
- "required": [
718
- "pageIdx"
719
- ]
720
- },
721
- "name": "mcp__chrome-devtools__select_page",
722
- "description": "Select a page as a context for future tool calls.",
723
- "strict": false
724
- }
725
- },
726
- {
727
- "type": "function",
728
- "function": {
729
- "parameters": {
730
- "type": "object",
731
- "properties": {
732
- "filePath": {
733
- "type": "string",
734
- "description": "The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response."
735
- },
736
- "format": {
737
- "type": "string",
738
- "description": "Type of format to save the screenshot as. Default is \"png\""
739
- },
740
- "fullPage": {
741
- "type": "boolean",
742
- "description": "If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid."
743
- },
744
- "quality": {
745
- "type": "number",
746
- "description": "Compression quality for JPEG and WebP formats (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format."
747
- },
748
- "uid": {
749
- "type": "string",
750
- "description": "The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot."
751
- }
752
- }
753
- },
754
- "name": "mcp__chrome-devtools__take_screenshot",
755
- "description": "Take a screenshot of the page or element.",
756
- "strict": false
757
- }
758
- },
759
- {
760
- "type": "function",
761
- "function": {
762
- "parameters": {
763
- "type": "object",
764
- "properties": {
765
- "filePath": {
766
- "type": "string",
767
- "description": "The absolute path, or a path relative to the current working directory, to save the snapshot to instead of attaching it to the response."
768
- },
769
- "verbose": {
770
- "type": "boolean",
771
- "description": "Whether to include all possible information available in the full a11y tree. Default is false."
772
- }
773
- }
774
- },
775
- "name": "mcp__chrome-devtools__take_snapshot",
776
- "description": "Take a text snapshot of the currently selected page based on the a11y tree. The snapshot lists page elements along with a unique\nidentifier (uid). Always use the latest snapshot. Prefer taking a snapshot over taking a screenshot. The snapshot indicates the element selected\nin the DevTools Elements panel (if any).",
777
- "strict": false
778
- }
779
- },
780
- {
781
- "type": "function",
782
- "function": {
783
- "parameters": {
784
- "type": "object",
785
- "properties": {
786
- "filePath": {
787
- "type": "string",
788
- "description": "The local path of the file to upload"
789
- },
790
- "uid": {
791
- "type": "string",
792
- "description": "The uid of the file input element or an element that will open file chooser on the page from the page content snapshot"
793
- }
794
- },
795
- "required": [
796
- "uid",
797
- "filePath"
798
- ]
799
- },
800
- "name": "mcp__chrome-devtools__upload_file",
801
- "description": "Upload a file through a provided element.",
802
- "strict": false
803
- }
804
- },
805
- {
806
- "type": "function",
807
- "function": {
808
- "parameters": {
809
- "type": "object",
810
- "properties": {
811
- "text": {
812
- "type": "string",
813
- "description": "Text to appear on the page"
814
- },
815
- "timeout": {
816
- "type": "number",
817
- "description": "Maximum wait time in milliseconds. If set to 0, the default timeout will be used."
818
- }
819
- },
820
- "required": [
821
- "text"
822
48
  ]
823
- },
824
- "name": "mcp__chrome-devtools__wait_for",
825
- "description": "Wait for the specified text to appear on the selected page.",
826
- "strict": false
49
+ }
827
50
  }
828
51
  }
829
52
  ]
830
53
  }
831
- }
54
+ }