Ver Fonte

chore: generate

opencode-agent[bot] há 2 meses atrás
pai
commit
51b10b128e

+ 1 - 3
packages/tui/src/component/dialog-model.tsx

@@ -88,9 +88,7 @@ export function DialogModel(props: { providerID?: string }) {
       filter((option) => {
         if (!showSections) return true
         if (
-          favorites.some(
-            (item) => item.providerID === option.value.providerID && item.modelID === option.value.modelID,
-          )
+          favorites.some((item) => item.providerID === option.value.providerID && item.modelID === option.value.modelID)
         )
           return false
         if (

+ 4 - 5
packages/tui/src/context/data.tsx

@@ -555,11 +555,10 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
         result.location.reference.refresh(),
         result.location.command.refresh(),
         result.location.skill.refresh(),
-      ])
-        .then((settled) => {
-          for (const failure of settled.filter((item) => item.status === "rejected"))
-            console.error("Failed to refresh default location data", failure.reason)
-        })
+      ]).then((settled) => {
+        for (const failure of settled.filter((item) => item.status === "rejected"))
+          console.error("Failed to refresh default location data", failure.reason)
+      })
     })
 
     return result

+ 3 - 1
packages/tui/src/context/local.tsx

@@ -231,7 +231,9 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
           }
         }
 
-        const model = models().find((item) => item.enabled && providers().some((provider) => provider.id === item.providerID))
+        const model = models().find(
+          (item) => item.enabled && providers().some((provider) => provider.id === item.providerID),
+        )
         if (!model) return undefined
         return {
           providerID: model.providerID,

+ 1 - 2
packages/tui/src/feature-plugins/home/footer.tsx

@@ -17,8 +17,7 @@ function Directory(props: { api: TuiPluginApi }) {
     const selected = destination?.destination()
     const directory = !selected || selected.type === "new" ? data.location.default().directory : selected.directory
     const out = abbreviateHome(directory, paths.home)
-    const branch =
-      directory === (props.api.state.path.directory || paths.cwd) ? props.api.state.vcs?.branch : undefined
+    const branch = directory === (props.api.state.path.directory || paths.cwd) ? props.api.state.vcs?.branch : undefined
     if (branch) return out + ":" + branch
     return out
   })

+ 1 - 3
packages/tui/test/cli/tui/data.test.tsx

@@ -46,9 +46,7 @@ test("refreshes resources into reactive getters", async () => {
     if (url.pathname === "/api/agent")
       return json({
         location,
-        data: [
-          { id: "build", request: { headers: {}, body: {} }, mode: "primary", hidden: false, permissions: [] },
-        ],
+        data: [{ id: "build", request: { headers: {}, body: {} }, mode: "primary", hidden: false, permissions: [] }],
       })
     return undefined
   })

+ 1 - 2
packages/tui/test/fixture/tui-sdk.ts

@@ -59,8 +59,7 @@ export function createFetch(override?: FetchHandler) {
     if (url.pathname === "/config/providers") return json({ providers: {}, default: {} })
     if (url.pathname === "/experimental/console") return json({ consoleManagedProviders: [], switchableOrgCount: 0 })
     if (url.pathname === "/path") return json({ home: "", state: "", config: "", worktree, directory })
-    if (url.pathname === "/api/location")
-      return json({ directory, project: { id: "proj_test", directory: worktree } })
+    if (url.pathname === "/api/location") return json({ directory, project: { id: "proj_test", directory: worktree } })
     if (["/api/agent", "/api/model", "/api/provider", "/api/command", "/api/skill"].includes(url.pathname))
       return json({
         location: { directory, project: { id: "proj_test", directory: worktree } },