Browse Source

wip: bash

Dax Raad 6 tháng trước cách đây
mục cha
commit
c6344c5714

+ 3 - 3
packages/opencode/src/server/server.ts

@@ -593,10 +593,10 @@ export namespace Server {
         },
       )
       .post(
-        "/session/:id/command",
+        "/session/:id/bash",
         describeRoute({
           description: "Run a bash command",
-          operationId: "session.chat",
+          operationId: "session.bash",
           responses: {
             200: {
               description: "Created message",
@@ -618,7 +618,7 @@ export namespace Server {
         async (c) => {
           const sessionID = c.req.valid("param").id
           const body = c.req.valid("json")
-          const msg = await Session.command({ ...body, sessionID })
+          const msg = await Session.bash({ ...body, sessionID })
           return c.json(msg)
         },
       )

+ 1 - 1
packages/opencode/src/session/index.ts

@@ -1005,7 +1005,7 @@ export namespace Session {
     command: z.string(),
   })
   export type CommandInput = z.infer<typeof CommandInput>
-  export async function command(input: CommandInput) {
+  export async function bash(input: CommandInput) {
     using abort = lock(input.sessionID)
     const msg: MessageV2.Assistant = {
       id: Identifier.ascending("message"),