Quellcode durchsuchen

chore: generate

opencode-agent[bot] vor 1 Monat
Ursprung
Commit
436cd39d14
2 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen
  1. 4 2
      packages/codemode/src/tool-runtime.ts
  2. 4 5
      packages/opencode/src/tool/registry.ts

+ 4 - 2
packages/codemode/src/tool-runtime.ts

@@ -467,7 +467,9 @@ export const discoveryPlan = <R>(
       : complete
         ? "Execute JavaScript in a confined runtime. Inside this program, `tools` contains only the host-provided tools listed below; surrounding agent tools are not available unless listed here."
         : "Execute JavaScript in a confined runtime. Inside this program, `tools` contains only the host-provided tools listed or searchable below; surrounding agent tools are not available unless listed here.",
-    ...(empty ? [] : ["Do not infer or normalize tool names; use only exact signatures shown below or returned by search."]),
+    ...(empty
+      ? []
+      : ["Do not infer or normalize tool names; use only exact signatures shown below or returned by search."]),
   ]
 
   // The search step exists only when search is advertised (PARTIAL catalog); a COMPLETE
@@ -481,7 +483,7 @@ export const discoveryPlan = <R>(
         ...(complete
           ? [
               "1. Pick a tool from the list under `## Available tools` - each line is the exact call signature; use it as-is rather than guessing segments.",
-              '2. Call it using the exact signature shown; bracket notation and quotes are part of the path.',
+              "2. Call it using the exact signature shown; bracket notation and quotes are part of the path.",
               '3. Parse text results: `const data = typeof res === "string" ? JSON.parse(res) : res` - most tools return JSON as a string.',
               "4. Return only the fields you need: `return { <field>: data.<field> }` - raw payloads get truncated and waste context.",
             ]

+ 4 - 5
packages/opencode/src/tool/registry.ts

@@ -280,10 +280,7 @@ const layer = Layer.effect(
       const ruleset = Permission.merge(input.agent.permission, input.permission ?? [])
       const tools = Permission.visibleTools(yield* mcp.tools(), ruleset)
       if (Object.keys(tools).length === 0) return
-      return codeMode.describeCatalog(
-        tools,
-        Object.keys(yield* mcp.clients()).map(McpCatalog.sanitize),
-      )
+      return codeMode.describeCatalog(tools, Object.keys(yield* mcp.clients()).map(McpCatalog.sanitize))
     })
 
     const tools: Interface["tools"] = Effect.fn("ToolRegistry.tools")(function* (input) {
@@ -300,7 +297,9 @@ const layer = Layer.effect(
         return true
       })
 
-      const codeModeDescription = filtered.some((tool) => tool.id === "execute") ? yield* describeCodeMode(input) : undefined
+      const codeModeDescription = filtered.some((tool) => tool.id === "execute")
+        ? yield* describeCodeMode(input)
+        : undefined
       const visible = filtered.filter((tool) => tool.id !== "execute" || codeModeDescription)
 
       return yield* Effect.forEach(