فهرست منبع

feat: add optional messageID to ShellInput (#20657)

Noam Bressler 5 ماه پیش
والد
کامیت
291a857fb8
3فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 2 1
      packages/opencode/src/session/prompt.ts
  2. 2 0
      packages/sdk/js/src/v2/gen/sdk.gen.ts
  3. 1 0
      packages/sdk/js/src/v2/gen/types.gen.ts

+ 2 - 1
packages/opencode/src/session/prompt.ts

@@ -756,7 +756,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
         }
         const model = input.model ?? agent.model ?? (yield* lastModel(input.sessionID))
         const userMsg: MessageV2.User = {
-          id: MessageID.ascending(),
+          id: input.messageID ?? MessageID.ascending(),
           sessionID: input.sessionID,
           time: { created: Date.now() },
           role: "user",
@@ -1827,6 +1827,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
 
   export const ShellInput = z.object({
     sessionID: SessionID.zod,
+    messageID: MessageID.zod.optional(),
     agent: z.string(),
     model: z
       .object({

+ 2 - 0
packages/sdk/js/src/v2/gen/sdk.gen.ts

@@ -2231,6 +2231,7 @@ export class Session2 extends HeyApiClient {
       sessionID: string
       directory?: string
       workspace?: string
+      messageID?: string
       agent?: string
       model?: {
         providerID: string
@@ -2248,6 +2249,7 @@ export class Session2 extends HeyApiClient {
             { in: "path", key: "sessionID" },
             { in: "query", key: "directory" },
             { in: "query", key: "workspace" },
+            { in: "body", key: "messageID" },
             { in: "body", key: "agent" },
             { in: "body", key: "model" },
             { in: "body", key: "command" },

+ 1 - 0
packages/sdk/js/src/v2/gen/types.gen.ts

@@ -3815,6 +3815,7 @@ export type SessionCommandResponse = SessionCommandResponses[keyof SessionComman
 
 export type SessionShellData = {
   body?: {
+    messageID?: string
     agent: string
     model?: {
       providerID: string