@neovate/code 0.20.2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -212,6 +212,8 @@ declare type ContextOpts = {
212
212
  plugins: (string | Plugin_2)[];
213
213
  };
214
214
 
215
+ export declare function createSession(options: SDKSessionOptions): Promise<SDKSession>;
216
+
215
217
  declare interface CreateTaskInput {
216
218
  command: string;
217
219
  pid: number;
@@ -1210,6 +1212,9 @@ declare type ProjectWorkspacesMergeOutput = {
1210
1212
  error?: string;
1211
1213
  };
1212
1214
 
1215
+ declare function prompt_2(message: string, options: SDKSessionOptions): Promise<SDKResultMessage>;
1216
+ export { prompt_2 as prompt }
1217
+
1213
1218
  declare interface PromptCommand extends BaseSlashCommand {
1214
1219
  type: 'prompt';
1215
1220
  progressMessage?: string;
@@ -1302,6 +1307,8 @@ declare type ResponseMessage = BaseMessage & {
1302
1307
  error?: any;
1303
1308
  };
1304
1309
 
1310
+ export declare function resumeSession(sessionId: string, options: SDKSessionOptions): Promise<SDKSession>;
1311
+
1305
1312
  declare type ReturnDisplay = string | DiffViewerReturnDisplay | TodoReadReturnDisplay | TodoWriteReturnDisplay;
1306
1313
 
1307
1314
  export declare function runNeovate(opts: {
@@ -1312,6 +1319,52 @@ export declare function runNeovate(opts: {
1312
1319
  upgrade?: UpgradeOptions;
1313
1320
  }): Promise<void>;
1314
1321
 
1322
+ export declare type SDKMessage = NormalizedMessage | SDKSystemMessage | SDKResultMessage;
1323
+
1324
+ declare type SDKResultMessage = {
1325
+ type: 'result';
1326
+ subtype: 'success' | 'error';
1327
+ isError: boolean;
1328
+ content: string;
1329
+ sessionId: string;
1330
+ __result?: any;
1331
+ usage?: {
1332
+ input_tokens: number;
1333
+ output_tokens: number;
1334
+ };
1335
+ };
1336
+
1337
+ export declare interface SDKSession {
1338
+ readonly sessionId: string;
1339
+ send(message: string | SDKUserMessage): Promise<void>;
1340
+ receive(): AsyncGenerator<SDKMessage, void>;
1341
+ close(): void;
1342
+ [Symbol.asyncDispose](): Promise<void>;
1343
+ }
1344
+
1345
+ export declare type SDKSessionOptions = {
1346
+ model: string;
1347
+ cwd?: string;
1348
+ productName?: string;
1349
+ };
1350
+
1351
+ declare type SDKSystemMessage = {
1352
+ type: 'system';
1353
+ subtype: 'init';
1354
+ sessionId: string;
1355
+ model: string;
1356
+ cwd: string;
1357
+ tools: string[];
1358
+ };
1359
+
1360
+ export declare type SDKUserMessage = {
1361
+ type: 'user';
1362
+ message: UserContent;
1363
+ parentUuid: string | null;
1364
+ uuid: string;
1365
+ sessionId: string;
1366
+ };
1367
+
1315
1368
  declare type SessionAddMessagesInput = {
1316
1369
  cwd: string;
1317
1370
  sessionId: string;