Explorar o código

chore: generate

opencode-agent[bot] hai 5 meses
pai
achega
9b09a7e766

+ 5 - 9
packages/opencode/src/session/summary.ts

@@ -123,8 +123,7 @@ export namespace SessionSummary {
         yield* bus.publish(Session.Event.Diff, { sessionID: input.sessionID, diff: diffs })
 
         const messages = all.filter(
-          (m) =>
-            m.info.id === input.messageID || (m.info.role === "assistant" && m.info.parentID === input.messageID),
+          (m) => m.info.id === input.messageID || (m.info.role === "assistant" && m.info.parentID === input.messageID),
         )
         const target = messages.find((m) => m.info.id === input.messageID)
         if (!target || target.info.role !== "user") return
@@ -133,13 +132,10 @@ export namespace SessionSummary {
         yield* sessions.updateMessage(target.info)
       })
 
-      const diff = Effect.fn("SessionSummary.diff")(function* (input: {
-        sessionID: SessionID
-        messageID?: MessageID
-      }) {
-        const diffs = yield* storage.read<Snapshot.FileDiff[]>(["session_diff", input.sessionID]).pipe(
-          Effect.catch(() => Effect.succeed([] as Snapshot.FileDiff[])),
-        )
+      const diff = Effect.fn("SessionSummary.diff")(function* (input: { sessionID: SessionID; messageID?: MessageID }) {
+        const diffs = yield* storage
+          .read<Snapshot.FileDiff[]>(["session_diff", input.sessionID])
+          .pipe(Effect.catch(() => Effect.succeed([] as Snapshot.FileDiff[])))
         const next = diffs.map((item) => {
           const file = unquoteGitPath(item.file)
           if (file === item.file) return item

+ 1 - 3
packages/opencode/test/format/format.test.ts

@@ -64,9 +64,7 @@ describe("Format", () => {
     ),
   )
 
-  it.live("service initializes without error", () =>
-    provideTmpdirInstance(() => Format.Service.use(() => Effect.void)),
-  )
+  it.live("service initializes without error", () => provideTmpdirInstance(() => Format.Service.use(() => Effect.void)))
 
   it.live("status() initializes formatter state per directory", () =>
     Effect.gen(function* () {

+ 8 - 1
packages/opencode/test/session/revert-compact.test.ts

@@ -59,7 +59,14 @@ function tool(sessionID: string, messageID: string) {
     type: "tool" as const,
     tool: "bash",
     callID: "call-1",
-    state: { status: "completed" as const, input: {}, output: "done", title: "", metadata: {}, time: { start: 0, end: 1 } },
+    state: {
+      status: "completed" as const,
+      input: {},
+      output: "done",
+      title: "",
+      metadata: {},
+      time: { start: 0, end: 1 },
+    },
   })
 }
 

+ 41 - 41
packages/sdk/openapi.json

@@ -7040,44 +7040,6 @@
   },
   "components": {
     "schemas": {
-      "Event.installation.updated": {
-        "type": "object",
-        "properties": {
-          "type": {
-            "type": "string",
-            "const": "installation.updated"
-          },
-          "properties": {
-            "type": "object",
-            "properties": {
-              "version": {
-                "type": "string"
-              }
-            },
-            "required": ["version"]
-          }
-        },
-        "required": ["type", "properties"]
-      },
-      "Event.installation.update-available": {
-        "type": "object",
-        "properties": {
-          "type": {
-            "type": "string",
-            "const": "installation.update-available"
-          },
-          "properties": {
-            "type": "object",
-            "properties": {
-              "version": {
-                "type": "string"
-              }
-            },
-            "required": ["version"]
-          }
-        },
-        "required": ["type", "properties"]
-      },
       "Project": {
         "type": "object",
         "properties": {
@@ -7154,6 +7116,44 @@
         },
         "required": ["type", "properties"]
       },
+      "Event.installation.updated": {
+        "type": "object",
+        "properties": {
+          "type": {
+            "type": "string",
+            "const": "installation.updated"
+          },
+          "properties": {
+            "type": "object",
+            "properties": {
+              "version": {
+                "type": "string"
+              }
+            },
+            "required": ["version"]
+          }
+        },
+        "required": ["type", "properties"]
+      },
+      "Event.installation.update-available": {
+        "type": "object",
+        "properties": {
+          "type": {
+            "type": "string",
+            "const": "installation.update-available"
+          },
+          "properties": {
+            "type": "object",
+            "properties": {
+              "version": {
+                "type": "string"
+              }
+            },
+            "required": ["version"]
+          }
+        },
+        "required": ["type", "properties"]
+      },
       "Event.server.instance.disposed": {
         "type": "object",
         "properties": {
@@ -9734,13 +9734,13 @@
       "Event": {
         "anyOf": [
           {
-            "$ref": "#/components/schemas/Event.installation.updated"
+            "$ref": "#/components/schemas/Event.project.updated"
           },
           {
-            "$ref": "#/components/schemas/Event.installation.update-available"
+            "$ref": "#/components/schemas/Event.installation.updated"
           },
           {
-            "$ref": "#/components/schemas/Event.project.updated"
+            "$ref": "#/components/schemas/Event.installation.update-available"
           },
           {
             "$ref": "#/components/schemas/Event.server.instance.disposed"