codebuff 1.0.330 → 1.0.332

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.
Files changed (48) hide show
  1. package/dist/background-process-manager.js +2 -2
  2. package/dist/background-process-manager.js.map +1 -1
  3. package/dist/cli-definitions.js +0 -6
  4. package/dist/cli-definitions.js.map +1 -1
  5. package/dist/cli.d.ts +0 -1
  6. package/dist/cli.js +2 -5
  7. package/dist/cli.js.map +1 -1
  8. package/dist/client.d.ts +2 -2
  9. package/dist/client.js +22 -235
  10. package/dist/client.js.map +1 -1
  11. package/dist/common/actions.d.ts +409 -1497
  12. package/dist/common/actions.d.ts.map +1 -1
  13. package/dist/common/actions.js +5 -31
  14. package/dist/common/actions.js.map +1 -1
  15. package/dist/common/constants/tools.d.ts +0 -2
  16. package/dist/common/constants/tools.d.ts.map +1 -1
  17. package/dist/common/constants/tools.js +0 -3
  18. package/dist/common/constants/tools.js.map +1 -1
  19. package/dist/common/constants.d.ts +0 -5
  20. package/dist/common/constants.d.ts.map +1 -1
  21. package/dist/common/constants.js +1 -15
  22. package/dist/common/constants.js.map +1 -1
  23. package/dist/common/types/agent-state.d.ts +23 -20
  24. package/dist/common/types/agent-state.d.ts.map +1 -1
  25. package/dist/common/types/agent-state.js +17 -10
  26. package/dist/common/types/agent-state.js.map +1 -1
  27. package/dist/common/websockets/websocket-schema.d.ts +748 -2624
  28. package/dist/common/websockets/websocket-schema.d.ts.map +1 -1
  29. package/dist/index.js +7 -12
  30. package/dist/index.js.map +1 -1
  31. package/dist/json-config/hooks.js +2 -2
  32. package/dist/json-config/hooks.js.map +1 -1
  33. package/dist/terminal/base.d.ts +1 -8
  34. package/dist/terminal/base.js +3 -117
  35. package/dist/terminal/base.js.map +1 -1
  36. package/dist/tool-handlers.d.ts +5 -9
  37. package/dist/tool-handlers.js +8 -36
  38. package/dist/tool-handlers.js.map +1 -1
  39. package/dist/types.d.ts +0 -1
  40. package/dist/utils/analytics.js +35 -9
  41. package/dist/utils/analytics.js.map +1 -1
  42. package/dist/utils/tool-renderers.js +0 -6
  43. package/dist/utils/tool-renderers.js.map +1 -1
  44. package/package.json +1 -2
  45. package/dist/code-map/test-langs/test.d.ts +0 -12
  46. package/dist/code-map/test-langs/test.d.ts.map +0 -1
  47. package/dist/code-map/test-langs/test.js +0 -23
  48. package/dist/code-map/test-langs/test.js.map +0 -1
@@ -5,12 +5,12 @@ export declare const FileChangeSchema: z.ZodObject<{
5
5
  content: z.ZodString;
6
6
  }, "strip", z.ZodTypeAny, {
7
7
  path: string;
8
+ type: "patch" | "file";
8
9
  content: string;
9
- type: "file" | "patch";
10
10
  }, {
11
11
  path: string;
12
+ type: "patch" | "file";
12
13
  content: string;
13
- type: "file" | "patch";
14
14
  }>;
15
15
  export type FileChange = z.infer<typeof FileChangeSchema>;
16
16
  export declare const CHANGES: z.ZodArray<z.ZodObject<{
@@ -19,28 +19,14 @@ export declare const CHANGES: z.ZodArray<z.ZodObject<{
19
19
  content: z.ZodString;
20
20
  }, "strip", z.ZodTypeAny, {
21
21
  path: string;
22
+ type: "patch" | "file";
22
23
  content: string;
23
- type: "file" | "patch";
24
24
  }, {
25
25
  path: string;
26
+ type: "patch" | "file";
26
27
  content: string;
27
- type: "file" | "patch";
28
28
  }>, "many">;
29
29
  export type FileChanges = z.infer<typeof CHANGES>;
30
- export declare const ToolCallSchema: z.ZodObject<{
31
- name: z.ZodString;
32
- id: z.ZodString;
33
- input: z.ZodRecord<z.ZodString, z.ZodAny>;
34
- }, "strip", z.ZodTypeAny, {
35
- name: string;
36
- id: string;
37
- input: Record<string, any>;
38
- }, {
39
- name: string;
40
- id: string;
41
- input: Record<string, any>;
42
- }>;
43
- export type ToolCall = z.infer<typeof ToolCallSchema>;
44
30
  export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
45
31
  type: z.ZodLiteral<"prompt">;
46
32
  promptId: z.ZodString;
@@ -268,16 +254,16 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
268
254
  }[] | undefined;
269
255
  }>;
270
256
  toolResults: z.ZodArray<z.ZodObject<{
271
- name: z.ZodString;
257
+ toolName: z.ZodString;
258
+ toolCallId: z.ZodString;
272
259
  result: z.ZodString;
273
- id: z.ZodString;
274
260
  }, "strip", z.ZodTypeAny, {
275
- name: string;
276
- id: string;
261
+ toolName: string;
262
+ toolCallId: string;
277
263
  result: string;
278
264
  }, {
279
- name: string;
280
- id: string;
265
+ toolName: string;
266
+ toolCallId: string;
281
267
  result: string;
282
268
  }>, "many">;
283
269
  model: z.ZodOptional<z.ZodString>;
@@ -330,8 +316,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
330
316
  agentStepsRemaining: number;
331
317
  };
332
318
  toolResults: {
333
- name: string;
334
- id: string;
319
+ toolName: string;
320
+ toolCallId: string;
335
321
  result: string;
336
322
  }[];
337
323
  prompt?: string | undefined;
@@ -385,8 +371,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
385
371
  }[] | undefined;
386
372
  };
387
373
  toolResults: {
388
- name: string;
389
- id: string;
374
+ toolName: string;
375
+ toolCallId: string;
390
376
  result: string;
391
377
  }[];
392
378
  prompt?: string | undefined;
@@ -395,446 +381,90 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
395
381
  model?: string | undefined;
396
382
  repoUrl?: string | undefined;
397
383
  }>, z.ZodObject<{
398
- type: z.ZodLiteral<"manager-prompt">;
399
- promptId: z.ZodString;
400
- prompt: z.ZodOptional<z.ZodString>;
401
- agentState: z.ZodObject<{
402
- agentContext: z.ZodString;
403
- fileContext: z.ZodObject<{
404
- projectRoot: z.ZodString;
405
- cwd: z.ZodString;
406
- fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
407
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
408
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
409
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
410
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
411
- gitChanges: z.ZodObject<{
412
- status: z.ZodString;
413
- diff: z.ZodString;
414
- diffCached: z.ZodString;
415
- lastCommitMessages: z.ZodString;
416
- }, "strip", z.ZodTypeAny, {
417
- status: string;
418
- diff: string;
419
- diffCached: string;
420
- lastCommitMessages: string;
421
- }, {
422
- status: string;
423
- diff: string;
424
- diffCached: string;
425
- lastCommitMessages: string;
426
- }>;
427
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
428
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
429
- systemInfo: z.ZodObject<{
430
- platform: z.ZodString;
431
- shell: z.ZodString;
432
- nodeVersion: z.ZodString;
433
- arch: z.ZodString;
434
- homedir: z.ZodString;
435
- cpus: z.ZodNumber;
436
- }, "strip", z.ZodTypeAny, {
437
- platform: string;
438
- shell: string;
439
- nodeVersion: string;
440
- arch: string;
441
- homedir: string;
442
- cpus: number;
443
- }, {
444
- platform: string;
445
- shell: string;
446
- nodeVersion: string;
447
- arch: string;
448
- homedir: string;
449
- cpus: number;
450
- }>;
451
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
452
- path: z.ZodString;
453
- content: z.ZodString;
454
- }, "strip", z.ZodTypeAny, {
455
- path: string;
456
- content: string;
457
- }, {
458
- path: string;
459
- content: string;
460
- }>, "many">, "many">>;
384
+ type: z.ZodLiteral<"read-files-response">;
385
+ files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
386
+ requestId: z.ZodOptional<z.ZodString>;
387
+ }, "strip", z.ZodTypeAny, {
388
+ type: "read-files-response";
389
+ files: Record<string, string | null>;
390
+ requestId?: string | undefined;
391
+ }, {
392
+ type: "read-files-response";
393
+ files: Record<string, string | null>;
394
+ requestId?: string | undefined;
395
+ }>, z.ZodObject<{
396
+ type: z.ZodLiteral<"init">;
397
+ fingerprintId: z.ZodString;
398
+ authToken: z.ZodOptional<z.ZodString>;
399
+ fileContext: z.ZodObject<{
400
+ projectRoot: z.ZodString;
401
+ cwd: z.ZodString;
402
+ fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
403
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
404
+ tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
405
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
406
+ userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
407
+ gitChanges: z.ZodObject<{
408
+ status: z.ZodString;
409
+ diff: z.ZodString;
410
+ diffCached: z.ZodString;
411
+ lastCommitMessages: z.ZodString;
461
412
  }, "strip", z.ZodTypeAny, {
462
- projectRoot: string;
463
- cwd: string;
464
- fileTree: import("./util/file").FileTreeNode[];
465
- fileTokenScores: Record<string, Record<string, number>>;
466
- knowledgeFiles: Record<string, string>;
467
- gitChanges: {
468
- status: string;
469
- diff: string;
470
- diffCached: string;
471
- lastCommitMessages: string;
472
- };
473
- changesSinceLastChat: Record<string, string>;
474
- shellConfigFiles: Record<string, string>;
475
- systemInfo: {
476
- platform: string;
477
- shell: string;
478
- nodeVersion: string;
479
- arch: string;
480
- homedir: string;
481
- cpus: number;
482
- };
483
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
484
- userKnowledgeFiles?: Record<string, string> | undefined;
485
- fileVersions?: {
486
- path: string;
487
- content: string;
488
- }[][] | undefined;
413
+ status: string;
414
+ diff: string;
415
+ diffCached: string;
416
+ lastCommitMessages: string;
489
417
  }, {
490
- projectRoot: string;
491
- cwd: string;
492
- fileTree: import("./util/file").FileTreeNode[];
493
- fileTokenScores: Record<string, Record<string, number>>;
494
- knowledgeFiles: Record<string, string>;
495
- gitChanges: {
496
- status: string;
497
- diff: string;
498
- diffCached: string;
499
- lastCommitMessages: string;
500
- };
501
- changesSinceLastChat: Record<string, string>;
502
- shellConfigFiles: Record<string, string>;
503
- systemInfo: {
504
- platform: string;
505
- shell: string;
506
- nodeVersion: string;
507
- arch: string;
508
- homedir: string;
509
- cpus: number;
510
- };
511
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
512
- userKnowledgeFiles?: Record<string, string> | undefined;
513
- fileVersions?: {
514
- path: string;
515
- content: string;
516
- }[][] | undefined;
418
+ status: string;
419
+ diff: string;
420
+ diffCached: string;
421
+ lastCommitMessages: string;
517
422
  }>;
518
- messageHistory: z.ZodArray<z.ZodIntersection<z.ZodType<import("ai").CoreMessage, z.ZodTypeDef, import("ai").CoreMessage>, z.ZodObject<{
519
- timeToLive: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt">]>>;
423
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
424
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
425
+ systemInfo: z.ZodObject<{
426
+ platform: z.ZodString;
427
+ shell: z.ZodString;
428
+ nodeVersion: z.ZodString;
429
+ arch: z.ZodString;
430
+ homedir: z.ZodString;
431
+ cpus: z.ZodNumber;
520
432
  }, "strip", z.ZodTypeAny, {
521
- timeToLive?: "agentStep" | "userPrompt" | undefined;
433
+ platform: string;
434
+ shell: string;
435
+ nodeVersion: string;
436
+ arch: string;
437
+ homedir: string;
438
+ cpus: number;
522
439
  }, {
523
- timeToLive?: "agentStep" | "userPrompt" | undefined;
524
- }>>, "many">;
525
- agents: z.ZodDefault<z.ZodArray<z.ZodType<{
526
- agentId: string;
527
- agentName: import("./types/agent-state").AgentTemplateName;
528
- agents: import("./types/agent-state").SubagentState[];
529
- messageHistory: import("./types/message").CodebuffMessage[];
530
- }, z.ZodTypeDef, {
531
- agentId: string;
532
- agentName: import("./types/agent-state").AgentTemplateName;
533
- agents: import("./types/agent-state").SubagentState[];
534
- messageHistory: import("./types/message").CodebuffMessage[];
535
- }>, "many">>;
536
- agentStepsRemaining: z.ZodNumber;
440
+ platform: string;
441
+ shell: string;
442
+ nodeVersion: string;
443
+ arch: string;
444
+ homedir: string;
445
+ cpus: number;
446
+ }>;
447
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
448
+ path: z.ZodString;
449
+ content: z.ZodString;
450
+ }, "strip", z.ZodTypeAny, {
451
+ path: string;
452
+ content: string;
453
+ }, {
454
+ path: string;
455
+ content: string;
456
+ }>, "many">, "many">>;
537
457
  }, "strip", z.ZodTypeAny, {
538
- agentContext: string;
539
- fileContext: {
540
- projectRoot: string;
541
- cwd: string;
542
- fileTree: import("./util/file").FileTreeNode[];
543
- fileTokenScores: Record<string, Record<string, number>>;
544
- knowledgeFiles: Record<string, string>;
545
- gitChanges: {
546
- status: string;
547
- diff: string;
548
- diffCached: string;
549
- lastCommitMessages: string;
550
- };
551
- changesSinceLastChat: Record<string, string>;
552
- shellConfigFiles: Record<string, string>;
553
- systemInfo: {
554
- platform: string;
555
- shell: string;
556
- nodeVersion: string;
557
- arch: string;
558
- homedir: string;
559
- cpus: number;
560
- };
561
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
562
- userKnowledgeFiles?: Record<string, string> | undefined;
563
- fileVersions?: {
564
- path: string;
565
- content: string;
566
- }[][] | undefined;
567
- };
568
- messageHistory: (import("ai").CoreMessage & {
569
- timeToLive?: "agentStep" | "userPrompt" | undefined;
570
- })[];
571
- agents: {
572
- agentId: string;
573
- agentName: import("./types/agent-state").AgentTemplateName;
574
- agents: import("./types/agent-state").SubagentState[];
575
- messageHistory: import("./types/message").CodebuffMessage[];
576
- }[];
577
- agentStepsRemaining: number;
578
- }, {
579
- agentContext: string;
580
- fileContext: {
581
- projectRoot: string;
582
- cwd: string;
583
- fileTree: import("./util/file").FileTreeNode[];
584
- fileTokenScores: Record<string, Record<string, number>>;
585
- knowledgeFiles: Record<string, string>;
586
- gitChanges: {
587
- status: string;
588
- diff: string;
589
- diffCached: string;
590
- lastCommitMessages: string;
591
- };
592
- changesSinceLastChat: Record<string, string>;
593
- shellConfigFiles: Record<string, string>;
594
- systemInfo: {
595
- platform: string;
596
- shell: string;
597
- nodeVersion: string;
598
- arch: string;
599
- homedir: string;
600
- cpus: number;
601
- };
602
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
603
- userKnowledgeFiles?: Record<string, string> | undefined;
604
- fileVersions?: {
605
- path: string;
606
- content: string;
607
- }[][] | undefined;
608
- };
609
- messageHistory: (import("ai").CoreMessage & {
610
- timeToLive?: "agentStep" | "userPrompt" | undefined;
611
- })[];
612
- agentStepsRemaining: number;
613
- agents?: {
614
- agentId: string;
615
- agentName: import("./types/agent-state").AgentTemplateName;
616
- agents: import("./types/agent-state").SubagentState[];
617
- messageHistory: import("./types/message").CodebuffMessage[];
618
- }[] | undefined;
619
- }>;
620
- toolResults: z.ZodArray<z.ZodObject<{
621
- name: z.ZodString;
622
- result: z.ZodString;
623
- id: z.ZodString;
624
- }, "strip", z.ZodTypeAny, {
625
- name: string;
626
- id: string;
627
- result: string;
628
- }, {
629
- name: string;
630
- id: string;
631
- result: string;
632
- }>, "many">;
633
- fingerprintId: z.ZodString;
634
- authToken: z.ZodOptional<z.ZodString>;
635
- costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "max", "experimental", "ask"]>>>;
636
- model: z.ZodOptional<z.ZodString>;
637
- cwd: z.ZodOptional<z.ZodString>;
638
- repoName: z.ZodOptional<z.ZodString>;
639
- }, "strip", z.ZodTypeAny, {
640
- type: "manager-prompt";
641
- promptId: string;
642
- fingerprintId: string;
643
- costMode: "max" | "lite" | "normal" | "experimental" | "ask";
644
- agentState: {
645
- agentContext: string;
646
- fileContext: {
647
- projectRoot: string;
648
- cwd: string;
649
- fileTree: import("./util/file").FileTreeNode[];
650
- fileTokenScores: Record<string, Record<string, number>>;
651
- knowledgeFiles: Record<string, string>;
652
- gitChanges: {
653
- status: string;
654
- diff: string;
655
- diffCached: string;
656
- lastCommitMessages: string;
657
- };
658
- changesSinceLastChat: Record<string, string>;
659
- shellConfigFiles: Record<string, string>;
660
- systemInfo: {
661
- platform: string;
662
- shell: string;
663
- nodeVersion: string;
664
- arch: string;
665
- homedir: string;
666
- cpus: number;
667
- };
668
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
669
- userKnowledgeFiles?: Record<string, string> | undefined;
670
- fileVersions?: {
671
- path: string;
672
- content: string;
673
- }[][] | undefined;
674
- };
675
- messageHistory: (import("ai").CoreMessage & {
676
- timeToLive?: "agentStep" | "userPrompt" | undefined;
677
- })[];
678
- agents: {
679
- agentId: string;
680
- agentName: import("./types/agent-state").AgentTemplateName;
681
- agents: import("./types/agent-state").SubagentState[];
682
- messageHistory: import("./types/message").CodebuffMessage[];
683
- }[];
684
- agentStepsRemaining: number;
685
- };
686
- toolResults: {
687
- name: string;
688
- id: string;
689
- result: string;
690
- }[];
691
- cwd?: string | undefined;
692
- prompt?: string | undefined;
693
- authToken?: string | undefined;
694
- model?: string | undefined;
695
- repoName?: string | undefined;
696
- }, {
697
- type: "manager-prompt";
698
- promptId: string;
699
- fingerprintId: string;
700
- agentState: {
701
- agentContext: string;
702
- fileContext: {
703
- projectRoot: string;
704
- cwd: string;
705
- fileTree: import("./util/file").FileTreeNode[];
706
- fileTokenScores: Record<string, Record<string, number>>;
707
- knowledgeFiles: Record<string, string>;
708
- gitChanges: {
709
- status: string;
710
- diff: string;
711
- diffCached: string;
712
- lastCommitMessages: string;
713
- };
714
- changesSinceLastChat: Record<string, string>;
715
- shellConfigFiles: Record<string, string>;
716
- systemInfo: {
717
- platform: string;
718
- shell: string;
719
- nodeVersion: string;
720
- arch: string;
721
- homedir: string;
722
- cpus: number;
723
- };
724
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
725
- userKnowledgeFiles?: Record<string, string> | undefined;
726
- fileVersions?: {
727
- path: string;
728
- content: string;
729
- }[][] | undefined;
730
- };
731
- messageHistory: (import("ai").CoreMessage & {
732
- timeToLive?: "agentStep" | "userPrompt" | undefined;
733
- })[];
734
- agentStepsRemaining: number;
735
- agents?: {
736
- agentId: string;
737
- agentName: import("./types/agent-state").AgentTemplateName;
738
- agents: import("./types/agent-state").SubagentState[];
739
- messageHistory: import("./types/message").CodebuffMessage[];
740
- }[] | undefined;
741
- };
742
- toolResults: {
743
- name: string;
744
- id: string;
745
- result: string;
746
- }[];
747
- cwd?: string | undefined;
748
- prompt?: string | undefined;
749
- authToken?: string | undefined;
750
- costMode?: "max" | "lite" | "normal" | "experimental" | "ask" | undefined;
751
- model?: string | undefined;
752
- repoName?: string | undefined;
753
- }>, z.ZodObject<{
754
- type: z.ZodLiteral<"read-files-response">;
755
- files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
756
- requestId: z.ZodOptional<z.ZodString>;
757
- }, "strip", z.ZodTypeAny, {
758
- type: "read-files-response";
759
- files: Record<string, string | null>;
760
- requestId?: string | undefined;
761
- }, {
762
- type: "read-files-response";
763
- files: Record<string, string | null>;
764
- requestId?: string | undefined;
765
- }>, z.ZodObject<{
766
- type: z.ZodLiteral<"init">;
767
- fingerprintId: z.ZodString;
768
- authToken: z.ZodOptional<z.ZodString>;
769
- fileContext: z.ZodObject<{
770
- projectRoot: z.ZodString;
771
- cwd: z.ZodString;
772
- fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
773
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
774
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
775
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
776
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
777
- gitChanges: z.ZodObject<{
778
- status: z.ZodString;
779
- diff: z.ZodString;
780
- diffCached: z.ZodString;
781
- lastCommitMessages: z.ZodString;
782
- }, "strip", z.ZodTypeAny, {
783
- status: string;
784
- diff: string;
785
- diffCached: string;
786
- lastCommitMessages: string;
787
- }, {
788
- status: string;
789
- diff: string;
790
- diffCached: string;
791
- lastCommitMessages: string;
792
- }>;
793
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
794
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
795
- systemInfo: z.ZodObject<{
796
- platform: z.ZodString;
797
- shell: z.ZodString;
798
- nodeVersion: z.ZodString;
799
- arch: z.ZodString;
800
- homedir: z.ZodString;
801
- cpus: z.ZodNumber;
802
- }, "strip", z.ZodTypeAny, {
803
- platform: string;
804
- shell: string;
805
- nodeVersion: string;
806
- arch: string;
807
- homedir: string;
808
- cpus: number;
809
- }, {
810
- platform: string;
811
- shell: string;
812
- nodeVersion: string;
813
- arch: string;
814
- homedir: string;
815
- cpus: number;
816
- }>;
817
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
818
- path: z.ZodString;
819
- content: z.ZodString;
820
- }, "strip", z.ZodTypeAny, {
821
- path: string;
822
- content: string;
823
- }, {
824
- path: string;
825
- content: string;
826
- }>, "many">, "many">>;
827
- }, "strip", z.ZodTypeAny, {
828
- projectRoot: string;
829
- cwd: string;
830
- fileTree: import("./util/file").FileTreeNode[];
831
- fileTokenScores: Record<string, Record<string, number>>;
832
- knowledgeFiles: Record<string, string>;
833
- gitChanges: {
834
- status: string;
835
- diff: string;
836
- diffCached: string;
837
- lastCommitMessages: string;
458
+ projectRoot: string;
459
+ cwd: string;
460
+ fileTree: import("./util/file").FileTreeNode[];
461
+ fileTokenScores: Record<string, Record<string, number>>;
462
+ knowledgeFiles: Record<string, string>;
463
+ gitChanges: {
464
+ status: string;
465
+ diff: string;
466
+ diffCached: string;
467
+ lastCommitMessages: string;
838
468
  };
839
469
  changesSinceLastChat: Record<string, string>;
840
470
  shellConfigFiles: Record<string, string>;
@@ -884,7 +514,6 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
884
514
  repoUrl: z.ZodOptional<z.ZodString>;
885
515
  }, "strip", z.ZodTypeAny, {
886
516
  type: "init";
887
- fingerprintId: string;
888
517
  fileContext: {
889
518
  projectRoot: string;
890
519
  cwd: string;
@@ -905,959 +534,118 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
905
534
  nodeVersion: string;
906
535
  arch: string;
907
536
  homedir: string;
908
- cpus: number;
909
- };
910
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
911
- userKnowledgeFiles?: Record<string, string> | undefined;
912
- fileVersions?: {
913
- path: string;
914
- content: string;
915
- }[][] | undefined;
916
- };
917
- authToken?: string | undefined;
918
- repoUrl?: string | undefined;
919
- }, {
920
- type: "init";
921
- fingerprintId: string;
922
- fileContext: {
923
- projectRoot: string;
924
- cwd: string;
925
- fileTree: import("./util/file").FileTreeNode[];
926
- fileTokenScores: Record<string, Record<string, number>>;
927
- knowledgeFiles: Record<string, string>;
928
- gitChanges: {
929
- status: string;
930
- diff: string;
931
- diffCached: string;
932
- lastCommitMessages: string;
933
- };
934
- changesSinceLastChat: Record<string, string>;
935
- shellConfigFiles: Record<string, string>;
936
- systemInfo: {
937
- platform: string;
938
- shell: string;
939
- nodeVersion: string;
940
- arch: string;
941
- homedir: string;
942
- cpus: number;
943
- };
944
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
945
- userKnowledgeFiles?: Record<string, string> | undefined;
946
- fileVersions?: {
947
- path: string;
948
- content: string;
949
- }[][] | undefined;
950
- };
951
- authToken?: string | undefined;
952
- repoUrl?: string | undefined;
953
- }>, z.ZodObject<{
954
- type: z.ZodLiteral<"generate-commit-message">;
955
- fingerprintId: z.ZodString;
956
- authToken: z.ZodOptional<z.ZodString>;
957
- stagedChanges: z.ZodString;
958
- }, "strip", z.ZodTypeAny, {
959
- type: "generate-commit-message";
960
- fingerprintId: string;
961
- stagedChanges: string;
962
- authToken?: string | undefined;
963
- }, {
964
- type: "generate-commit-message";
965
- fingerprintId: string;
966
- stagedChanges: string;
967
- authToken?: string | undefined;
968
- }>]>;
969
- export type ClientAction = z.infer<typeof CLIENT_ACTION_SCHEMA>;
970
- export declare const UsageReponseSchema: z.ZodObject<{
971
- type: z.ZodLiteral<"usage-response">;
972
- usage: z.ZodNumber;
973
- remainingBalance: z.ZodNumber;
974
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>;
975
- next_quota_reset: z.ZodNullable<z.ZodDate>;
976
- autoTopupAdded: z.ZodOptional<z.ZodNumber>;
977
- }, "strip", z.ZodTypeAny, {
978
- type: "usage-response";
979
- usage: number;
980
- remainingBalance: number;
981
- next_quota_reset: Date | null;
982
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
983
- autoTopupAdded?: number | undefined;
984
- }, {
985
- type: "usage-response";
986
- usage: number;
987
- remainingBalance: number;
988
- next_quota_reset: Date | null;
989
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
990
- autoTopupAdded?: number | undefined;
991
- }>;
992
- export type UsageResponse = z.infer<typeof UsageReponseSchema>;
993
- export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
994
- type: z.ZodLiteral<"init-response">;
995
- }, Omit<{
996
- type: z.ZodLiteral<"usage-response">;
997
- usage: z.ZodNumber;
998
- remainingBalance: z.ZodNumber;
999
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>;
1000
- next_quota_reset: z.ZodNullable<z.ZodDate>;
1001
- autoTopupAdded: z.ZodOptional<z.ZodNumber>;
1002
- }, "type">>, "strip", z.ZodTypeAny, {
1003
- type: "init-response";
1004
- usage: number;
1005
- remainingBalance: number;
1006
- next_quota_reset: Date | null;
1007
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1008
- autoTopupAdded?: number | undefined;
1009
- }, {
1010
- type: "init-response";
1011
- usage: number;
1012
- remainingBalance: number;
1013
- next_quota_reset: Date | null;
1014
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1015
- autoTopupAdded?: number | undefined;
1016
- }>;
1017
- export type InitResponse = z.infer<typeof InitResponseSchema>;
1018
- export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShape<{
1019
- type: z.ZodLiteral<"response-complete">;
1020
- userInputId: z.ZodString;
1021
- response: z.ZodString;
1022
- changes: z.ZodArray<z.ZodObject<{
1023
- type: z.ZodEnum<["patch", "file"]>;
1024
- path: z.ZodString;
1025
- content: z.ZodString;
1026
- }, "strip", z.ZodTypeAny, {
1027
- path: string;
1028
- content: string;
1029
- type: "file" | "patch";
1030
- }, {
1031
- path: string;
1032
- content: string;
1033
- type: "file" | "patch";
1034
- }>, "many">;
1035
- changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1036
- type: z.ZodEnum<["patch", "file"]>;
1037
- path: z.ZodString;
1038
- content: z.ZodString;
1039
- }, "strip", z.ZodTypeAny, {
1040
- path: string;
1041
- content: string;
1042
- type: "file" | "patch";
1043
- }, {
1044
- path: string;
1045
- content: string;
1046
- type: "file" | "patch";
1047
- }>, "many">;
1048
- addedFileVersions: z.ZodArray<z.ZodObject<{
1049
- path: z.ZodString;
1050
- content: z.ZodString;
1051
- }, "strip", z.ZodTypeAny, {
1052
- path: string;
1053
- content: string;
1054
- }, {
1055
- path: string;
1056
- content: string;
1057
- }>, "many">;
1058
- resetFileVersions: z.ZodBoolean;
1059
- }, {
1060
- usage: z.ZodOptional<z.ZodNumber>;
1061
- remainingBalance: z.ZodOptional<z.ZodNumber>;
1062
- balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>>;
1063
- next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1064
- autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1065
- }>, "strip", z.ZodTypeAny, {
1066
- type: "response-complete";
1067
- userInputId: string;
1068
- response: string;
1069
- changes: {
1070
- path: string;
1071
- content: string;
1072
- type: "file" | "patch";
1073
- }[];
1074
- changesAlreadyApplied: {
1075
- path: string;
1076
- content: string;
1077
- type: "file" | "patch";
1078
- }[];
1079
- addedFileVersions: {
1080
- path: string;
1081
- content: string;
1082
- }[];
1083
- resetFileVersions: boolean;
1084
- usage?: number | undefined;
1085
- remainingBalance?: number | undefined;
1086
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1087
- next_quota_reset?: Date | null | undefined;
1088
- autoTopupAdded?: number | undefined;
1089
- }, {
1090
- type: "response-complete";
1091
- userInputId: string;
1092
- response: string;
1093
- changes: {
1094
- path: string;
1095
- content: string;
1096
- type: "file" | "patch";
1097
- }[];
1098
- changesAlreadyApplied: {
1099
- path: string;
1100
- content: string;
1101
- type: "file" | "patch";
1102
- }[];
1103
- addedFileVersions: {
1104
- path: string;
1105
- content: string;
1106
- }[];
1107
- resetFileVersions: boolean;
1108
- usage?: number | undefined;
1109
- remainingBalance?: number | undefined;
1110
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1111
- next_quota_reset?: Date | null | undefined;
1112
- autoTopupAdded?: number | undefined;
1113
- }>;
1114
- export declare const MessageCostResponseSchema: z.ZodObject<{
1115
- type: z.ZodLiteral<"message-cost-response">;
1116
- promptId: z.ZodString;
1117
- credits: z.ZodNumber;
1118
- }, "strip", z.ZodTypeAny, {
1119
- type: "message-cost-response";
1120
- promptId: string;
1121
- credits: number;
1122
- }, {
1123
- type: "message-cost-response";
1124
- promptId: string;
1125
- credits: number;
1126
- }>;
1127
- export type MessageCostResponse = z.infer<typeof MessageCostResponseSchema>;
1128
- export declare const PromptResponseSchema: z.ZodObject<{
1129
- type: z.ZodLiteral<"prompt-response">;
1130
- promptId: z.ZodString;
1131
- agentState: z.ZodObject<{
1132
- agentContext: z.ZodString;
1133
- fileContext: z.ZodObject<{
1134
- projectRoot: z.ZodString;
1135
- cwd: z.ZodString;
1136
- fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
1137
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1138
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
1139
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1140
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1141
- gitChanges: z.ZodObject<{
1142
- status: z.ZodString;
1143
- diff: z.ZodString;
1144
- diffCached: z.ZodString;
1145
- lastCommitMessages: z.ZodString;
1146
- }, "strip", z.ZodTypeAny, {
1147
- status: string;
1148
- diff: string;
1149
- diffCached: string;
1150
- lastCommitMessages: string;
1151
- }, {
1152
- status: string;
1153
- diff: string;
1154
- diffCached: string;
1155
- lastCommitMessages: string;
1156
- }>;
1157
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1158
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1159
- systemInfo: z.ZodObject<{
1160
- platform: z.ZodString;
1161
- shell: z.ZodString;
1162
- nodeVersion: z.ZodString;
1163
- arch: z.ZodString;
1164
- homedir: z.ZodString;
1165
- cpus: z.ZodNumber;
1166
- }, "strip", z.ZodTypeAny, {
1167
- platform: string;
1168
- shell: string;
1169
- nodeVersion: string;
1170
- arch: string;
1171
- homedir: string;
1172
- cpus: number;
1173
- }, {
1174
- platform: string;
1175
- shell: string;
1176
- nodeVersion: string;
1177
- arch: string;
1178
- homedir: string;
1179
- cpus: number;
1180
- }>;
1181
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
1182
- path: z.ZodString;
1183
- content: z.ZodString;
1184
- }, "strip", z.ZodTypeAny, {
1185
- path: string;
1186
- content: string;
1187
- }, {
1188
- path: string;
1189
- content: string;
1190
- }>, "many">, "many">>;
1191
- }, "strip", z.ZodTypeAny, {
1192
- projectRoot: string;
1193
- cwd: string;
1194
- fileTree: import("./util/file").FileTreeNode[];
1195
- fileTokenScores: Record<string, Record<string, number>>;
1196
- knowledgeFiles: Record<string, string>;
1197
- gitChanges: {
1198
- status: string;
1199
- diff: string;
1200
- diffCached: string;
1201
- lastCommitMessages: string;
1202
- };
1203
- changesSinceLastChat: Record<string, string>;
1204
- shellConfigFiles: Record<string, string>;
1205
- systemInfo: {
1206
- platform: string;
1207
- shell: string;
1208
- nodeVersion: string;
1209
- arch: string;
1210
- homedir: string;
1211
- cpus: number;
1212
- };
1213
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1214
- userKnowledgeFiles?: Record<string, string> | undefined;
1215
- fileVersions?: {
1216
- path: string;
1217
- content: string;
1218
- }[][] | undefined;
1219
- }, {
1220
- projectRoot: string;
1221
- cwd: string;
1222
- fileTree: import("./util/file").FileTreeNode[];
1223
- fileTokenScores: Record<string, Record<string, number>>;
1224
- knowledgeFiles: Record<string, string>;
1225
- gitChanges: {
1226
- status: string;
1227
- diff: string;
1228
- diffCached: string;
1229
- lastCommitMessages: string;
1230
- };
1231
- changesSinceLastChat: Record<string, string>;
1232
- shellConfigFiles: Record<string, string>;
1233
- systemInfo: {
1234
- platform: string;
1235
- shell: string;
1236
- nodeVersion: string;
1237
- arch: string;
1238
- homedir: string;
1239
- cpus: number;
1240
- };
1241
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1242
- userKnowledgeFiles?: Record<string, string> | undefined;
1243
- fileVersions?: {
1244
- path: string;
1245
- content: string;
1246
- }[][] | undefined;
1247
- }>;
1248
- messageHistory: z.ZodArray<z.ZodIntersection<z.ZodType<import("ai").CoreMessage, z.ZodTypeDef, import("ai").CoreMessage>, z.ZodObject<{
1249
- timeToLive: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt">]>>;
1250
- }, "strip", z.ZodTypeAny, {
1251
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1252
- }, {
1253
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1254
- }>>, "many">;
1255
- agents: z.ZodDefault<z.ZodArray<z.ZodType<{
1256
- agentId: string;
1257
- agentName: import("./types/agent-state").AgentTemplateName;
1258
- agents: import("./types/agent-state").SubagentState[];
1259
- messageHistory: import("./types/message").CodebuffMessage[];
1260
- }, z.ZodTypeDef, {
1261
- agentId: string;
1262
- agentName: import("./types/agent-state").AgentTemplateName;
1263
- agents: import("./types/agent-state").SubagentState[];
1264
- messageHistory: import("./types/message").CodebuffMessage[];
1265
- }>, "many">>;
1266
- agentStepsRemaining: z.ZodNumber;
1267
- }, "strip", z.ZodTypeAny, {
1268
- agentContext: string;
1269
- fileContext: {
1270
- projectRoot: string;
1271
- cwd: string;
1272
- fileTree: import("./util/file").FileTreeNode[];
1273
- fileTokenScores: Record<string, Record<string, number>>;
1274
- knowledgeFiles: Record<string, string>;
1275
- gitChanges: {
1276
- status: string;
1277
- diff: string;
1278
- diffCached: string;
1279
- lastCommitMessages: string;
1280
- };
1281
- changesSinceLastChat: Record<string, string>;
1282
- shellConfigFiles: Record<string, string>;
1283
- systemInfo: {
1284
- platform: string;
1285
- shell: string;
1286
- nodeVersion: string;
1287
- arch: string;
1288
- homedir: string;
1289
- cpus: number;
1290
- };
1291
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1292
- userKnowledgeFiles?: Record<string, string> | undefined;
1293
- fileVersions?: {
1294
- path: string;
1295
- content: string;
1296
- }[][] | undefined;
1297
- };
1298
- messageHistory: (import("ai").CoreMessage & {
1299
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1300
- })[];
1301
- agents: {
1302
- agentId: string;
1303
- agentName: import("./types/agent-state").AgentTemplateName;
1304
- agents: import("./types/agent-state").SubagentState[];
1305
- messageHistory: import("./types/message").CodebuffMessage[];
1306
- }[];
1307
- agentStepsRemaining: number;
1308
- }, {
1309
- agentContext: string;
1310
- fileContext: {
1311
- projectRoot: string;
1312
- cwd: string;
1313
- fileTree: import("./util/file").FileTreeNode[];
1314
- fileTokenScores: Record<string, Record<string, number>>;
1315
- knowledgeFiles: Record<string, string>;
1316
- gitChanges: {
1317
- status: string;
1318
- diff: string;
1319
- diffCached: string;
1320
- lastCommitMessages: string;
1321
- };
1322
- changesSinceLastChat: Record<string, string>;
1323
- shellConfigFiles: Record<string, string>;
1324
- systemInfo: {
1325
- platform: string;
1326
- shell: string;
1327
- nodeVersion: string;
1328
- arch: string;
1329
- homedir: string;
1330
- cpus: number;
1331
- };
1332
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1333
- userKnowledgeFiles?: Record<string, string> | undefined;
1334
- fileVersions?: {
1335
- path: string;
1336
- content: string;
1337
- }[][] | undefined;
1338
- };
1339
- messageHistory: (import("ai").CoreMessage & {
1340
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1341
- })[];
1342
- agentStepsRemaining: number;
1343
- agents?: {
1344
- agentId: string;
1345
- agentName: import("./types/agent-state").AgentTemplateName;
1346
- agents: import("./types/agent-state").SubagentState[];
1347
- messageHistory: import("./types/message").CodebuffMessage[];
1348
- }[] | undefined;
1349
- }>;
1350
- toolCalls: z.ZodArray<z.ZodObject<{
1351
- name: z.ZodString;
1352
- parameters: z.ZodRecord<z.ZodString, z.ZodString>;
1353
- id: z.ZodString;
1354
- }, "strip", z.ZodTypeAny, {
1355
- name: string;
1356
- id: string;
1357
- parameters: Record<string, string>;
1358
- }, {
1359
- name: string;
1360
- id: string;
1361
- parameters: Record<string, string>;
1362
- }>, "many">;
1363
- toolResults: z.ZodArray<z.ZodObject<{
1364
- name: z.ZodString;
1365
- result: z.ZodString;
1366
- id: z.ZodString;
1367
- }, "strip", z.ZodTypeAny, {
1368
- name: string;
1369
- id: string;
1370
- result: string;
1371
- }, {
1372
- name: string;
1373
- id: string;
1374
- result: string;
1375
- }>, "many">;
1376
- }, "strip", z.ZodTypeAny, {
1377
- type: "prompt-response";
1378
- promptId: string;
1379
- agentState: {
1380
- agentContext: string;
1381
- fileContext: {
1382
- projectRoot: string;
1383
- cwd: string;
1384
- fileTree: import("./util/file").FileTreeNode[];
1385
- fileTokenScores: Record<string, Record<string, number>>;
1386
- knowledgeFiles: Record<string, string>;
1387
- gitChanges: {
1388
- status: string;
1389
- diff: string;
1390
- diffCached: string;
1391
- lastCommitMessages: string;
1392
- };
1393
- changesSinceLastChat: Record<string, string>;
1394
- shellConfigFiles: Record<string, string>;
1395
- systemInfo: {
1396
- platform: string;
1397
- shell: string;
1398
- nodeVersion: string;
1399
- arch: string;
1400
- homedir: string;
1401
- cpus: number;
1402
- };
1403
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1404
- userKnowledgeFiles?: Record<string, string> | undefined;
1405
- fileVersions?: {
1406
- path: string;
1407
- content: string;
1408
- }[][] | undefined;
1409
- };
1410
- messageHistory: (import("ai").CoreMessage & {
1411
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1412
- })[];
1413
- agents: {
1414
- agentId: string;
1415
- agentName: import("./types/agent-state").AgentTemplateName;
1416
- agents: import("./types/agent-state").SubagentState[];
1417
- messageHistory: import("./types/message").CodebuffMessage[];
1418
- }[];
1419
- agentStepsRemaining: number;
1420
- };
1421
- toolResults: {
1422
- name: string;
1423
- id: string;
1424
- result: string;
1425
- }[];
1426
- toolCalls: {
1427
- name: string;
1428
- id: string;
1429
- parameters: Record<string, string>;
1430
- }[];
1431
- }, {
1432
- type: "prompt-response";
1433
- promptId: string;
1434
- agentState: {
1435
- agentContext: string;
1436
- fileContext: {
1437
- projectRoot: string;
1438
- cwd: string;
1439
- fileTree: import("./util/file").FileTreeNode[];
1440
- fileTokenScores: Record<string, Record<string, number>>;
1441
- knowledgeFiles: Record<string, string>;
1442
- gitChanges: {
1443
- status: string;
1444
- diff: string;
1445
- diffCached: string;
1446
- lastCommitMessages: string;
1447
- };
1448
- changesSinceLastChat: Record<string, string>;
1449
- shellConfigFiles: Record<string, string>;
1450
- systemInfo: {
1451
- platform: string;
1452
- shell: string;
1453
- nodeVersion: string;
1454
- arch: string;
1455
- homedir: string;
1456
- cpus: number;
1457
- };
1458
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1459
- userKnowledgeFiles?: Record<string, string> | undefined;
1460
- fileVersions?: {
1461
- path: string;
1462
- content: string;
1463
- }[][] | undefined;
1464
- };
1465
- messageHistory: (import("ai").CoreMessage & {
1466
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1467
- })[];
1468
- agentStepsRemaining: number;
1469
- agents?: {
1470
- agentId: string;
1471
- agentName: import("./types/agent-state").AgentTemplateName;
1472
- agents: import("./types/agent-state").SubagentState[];
1473
- messageHistory: import("./types/message").CodebuffMessage[];
1474
- }[] | undefined;
1475
- };
1476
- toolResults: {
1477
- name: string;
1478
- id: string;
1479
- result: string;
1480
- }[];
1481
- toolCalls: {
1482
- name: string;
1483
- id: string;
1484
- parameters: Record<string, string>;
1485
- }[];
1486
- }>;
1487
- export type PromptResponse = z.infer<typeof PromptResponseSchema>;
1488
- export declare const ManagerPromptResponseSchema: z.ZodObject<{
1489
- type: z.ZodLiteral<"manager-prompt-response">;
1490
- promptId: z.ZodString;
1491
- agentState: z.ZodObject<{
1492
- agentContext: z.ZodString;
1493
- fileContext: z.ZodObject<{
1494
- projectRoot: z.ZodString;
1495
- cwd: z.ZodString;
1496
- fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
1497
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1498
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
1499
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1500
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1501
- gitChanges: z.ZodObject<{
1502
- status: z.ZodString;
1503
- diff: z.ZodString;
1504
- diffCached: z.ZodString;
1505
- lastCommitMessages: z.ZodString;
1506
- }, "strip", z.ZodTypeAny, {
1507
- status: string;
1508
- diff: string;
1509
- diffCached: string;
1510
- lastCommitMessages: string;
1511
- }, {
1512
- status: string;
1513
- diff: string;
1514
- diffCached: string;
1515
- lastCommitMessages: string;
1516
- }>;
1517
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1518
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1519
- systemInfo: z.ZodObject<{
1520
- platform: z.ZodString;
1521
- shell: z.ZodString;
1522
- nodeVersion: z.ZodString;
1523
- arch: z.ZodString;
1524
- homedir: z.ZodString;
1525
- cpus: z.ZodNumber;
1526
- }, "strip", z.ZodTypeAny, {
1527
- platform: string;
1528
- shell: string;
1529
- nodeVersion: string;
1530
- arch: string;
1531
- homedir: string;
1532
- cpus: number;
1533
- }, {
1534
- platform: string;
1535
- shell: string;
1536
- nodeVersion: string;
1537
- arch: string;
1538
- homedir: string;
1539
- cpus: number;
1540
- }>;
1541
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
1542
- path: z.ZodString;
1543
- content: z.ZodString;
1544
- }, "strip", z.ZodTypeAny, {
1545
- path: string;
1546
- content: string;
1547
- }, {
1548
- path: string;
1549
- content: string;
1550
- }>, "many">, "many">>;
1551
- }, "strip", z.ZodTypeAny, {
1552
- projectRoot: string;
1553
- cwd: string;
1554
- fileTree: import("./util/file").FileTreeNode[];
1555
- fileTokenScores: Record<string, Record<string, number>>;
1556
- knowledgeFiles: Record<string, string>;
1557
- gitChanges: {
1558
- status: string;
1559
- diff: string;
1560
- diffCached: string;
1561
- lastCommitMessages: string;
1562
- };
1563
- changesSinceLastChat: Record<string, string>;
1564
- shellConfigFiles: Record<string, string>;
1565
- systemInfo: {
1566
- platform: string;
1567
- shell: string;
1568
- nodeVersion: string;
1569
- arch: string;
1570
- homedir: string;
1571
- cpus: number;
1572
- };
1573
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1574
- userKnowledgeFiles?: Record<string, string> | undefined;
1575
- fileVersions?: {
1576
- path: string;
1577
- content: string;
1578
- }[][] | undefined;
1579
- }, {
1580
- projectRoot: string;
1581
- cwd: string;
1582
- fileTree: import("./util/file").FileTreeNode[];
1583
- fileTokenScores: Record<string, Record<string, number>>;
1584
- knowledgeFiles: Record<string, string>;
1585
- gitChanges: {
1586
- status: string;
1587
- diff: string;
1588
- diffCached: string;
1589
- lastCommitMessages: string;
1590
- };
1591
- changesSinceLastChat: Record<string, string>;
1592
- shellConfigFiles: Record<string, string>;
1593
- systemInfo: {
1594
- platform: string;
1595
- shell: string;
1596
- nodeVersion: string;
1597
- arch: string;
1598
- homedir: string;
1599
- cpus: number;
1600
- };
1601
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1602
- userKnowledgeFiles?: Record<string, string> | undefined;
1603
- fileVersions?: {
1604
- path: string;
1605
- content: string;
1606
- }[][] | undefined;
1607
- }>;
1608
- messageHistory: z.ZodArray<z.ZodIntersection<z.ZodType<import("ai").CoreMessage, z.ZodTypeDef, import("ai").CoreMessage>, z.ZodObject<{
1609
- timeToLive: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt">]>>;
1610
- }, "strip", z.ZodTypeAny, {
1611
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1612
- }, {
1613
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1614
- }>>, "many">;
1615
- agents: z.ZodDefault<z.ZodArray<z.ZodType<{
1616
- agentId: string;
1617
- agentName: import("./types/agent-state").AgentTemplateName;
1618
- agents: import("./types/agent-state").SubagentState[];
1619
- messageHistory: import("./types/message").CodebuffMessage[];
1620
- }, z.ZodTypeDef, {
1621
- agentId: string;
1622
- agentName: import("./types/agent-state").AgentTemplateName;
1623
- agents: import("./types/agent-state").SubagentState[];
1624
- messageHistory: import("./types/message").CodebuffMessage[];
1625
- }>, "many">>;
1626
- agentStepsRemaining: z.ZodNumber;
1627
- }, "strip", z.ZodTypeAny, {
1628
- agentContext: string;
1629
- fileContext: {
1630
- projectRoot: string;
1631
- cwd: string;
1632
- fileTree: import("./util/file").FileTreeNode[];
1633
- fileTokenScores: Record<string, Record<string, number>>;
1634
- knowledgeFiles: Record<string, string>;
1635
- gitChanges: {
1636
- status: string;
1637
- diff: string;
1638
- diffCached: string;
1639
- lastCommitMessages: string;
1640
- };
1641
- changesSinceLastChat: Record<string, string>;
1642
- shellConfigFiles: Record<string, string>;
1643
- systemInfo: {
1644
- platform: string;
1645
- shell: string;
1646
- nodeVersion: string;
1647
- arch: string;
1648
- homedir: string;
1649
- cpus: number;
1650
- };
1651
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1652
- userKnowledgeFiles?: Record<string, string> | undefined;
1653
- fileVersions?: {
1654
- path: string;
1655
- content: string;
1656
- }[][] | undefined;
1657
- };
1658
- messageHistory: (import("ai").CoreMessage & {
1659
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1660
- })[];
1661
- agents: {
1662
- agentId: string;
1663
- agentName: import("./types/agent-state").AgentTemplateName;
1664
- agents: import("./types/agent-state").SubagentState[];
1665
- messageHistory: import("./types/message").CodebuffMessage[];
1666
- }[];
1667
- agentStepsRemaining: number;
1668
- }, {
1669
- agentContext: string;
1670
- fileContext: {
1671
- projectRoot: string;
1672
- cwd: string;
1673
- fileTree: import("./util/file").FileTreeNode[];
1674
- fileTokenScores: Record<string, Record<string, number>>;
1675
- knowledgeFiles: Record<string, string>;
1676
- gitChanges: {
1677
- status: string;
1678
- diff: string;
1679
- diffCached: string;
1680
- lastCommitMessages: string;
1681
- };
1682
- changesSinceLastChat: Record<string, string>;
1683
- shellConfigFiles: Record<string, string>;
1684
- systemInfo: {
1685
- platform: string;
1686
- shell: string;
1687
- nodeVersion: string;
1688
- arch: string;
1689
- homedir: string;
1690
- cpus: number;
1691
- };
1692
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1693
- userKnowledgeFiles?: Record<string, string> | undefined;
1694
- fileVersions?: {
1695
- path: string;
1696
- content: string;
1697
- }[][] | undefined;
1698
- };
1699
- messageHistory: (import("ai").CoreMessage & {
1700
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1701
- })[];
1702
- agentStepsRemaining: number;
1703
- agents?: {
1704
- agentId: string;
1705
- agentName: import("./types/agent-state").AgentTemplateName;
1706
- agents: import("./types/agent-state").SubagentState[];
1707
- messageHistory: import("./types/message").CodebuffMessage[];
1708
- }[] | undefined;
1709
- }>;
1710
- toolCalls: z.ZodArray<z.ZodObject<{
1711
- name: z.ZodString;
1712
- parameters: z.ZodRecord<z.ZodString, z.ZodString>;
1713
- id: z.ZodString;
1714
- }, "strip", z.ZodTypeAny, {
1715
- name: string;
1716
- id: string;
1717
- parameters: Record<string, string>;
1718
- }, {
1719
- name: string;
1720
- id: string;
1721
- parameters: Record<string, string>;
1722
- }>, "many">;
1723
- toolResults: z.ZodArray<z.ZodObject<{
1724
- name: z.ZodString;
1725
- result: z.ZodString;
1726
- id: z.ZodString;
1727
- }, "strip", z.ZodTypeAny, {
1728
- name: string;
1729
- id: string;
1730
- result: string;
1731
- }, {
1732
- name: string;
1733
- id: string;
1734
- result: string;
1735
- }>, "many">;
1736
- }, "strip", z.ZodTypeAny, {
1737
- type: "manager-prompt-response";
1738
- promptId: string;
1739
- agentState: {
1740
- agentContext: string;
1741
- fileContext: {
1742
- projectRoot: string;
1743
- cwd: string;
1744
- fileTree: import("./util/file").FileTreeNode[];
1745
- fileTokenScores: Record<string, Record<string, number>>;
1746
- knowledgeFiles: Record<string, string>;
1747
- gitChanges: {
1748
- status: string;
1749
- diff: string;
1750
- diffCached: string;
1751
- lastCommitMessages: string;
1752
- };
1753
- changesSinceLastChat: Record<string, string>;
1754
- shellConfigFiles: Record<string, string>;
1755
- systemInfo: {
1756
- platform: string;
1757
- shell: string;
1758
- nodeVersion: string;
1759
- arch: string;
1760
- homedir: string;
1761
- cpus: number;
1762
- };
1763
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1764
- userKnowledgeFiles?: Record<string, string> | undefined;
1765
- fileVersions?: {
1766
- path: string;
1767
- content: string;
1768
- }[][] | undefined;
1769
- };
1770
- messageHistory: (import("ai").CoreMessage & {
1771
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1772
- })[];
1773
- agents: {
1774
- agentId: string;
1775
- agentName: import("./types/agent-state").AgentTemplateName;
1776
- agents: import("./types/agent-state").SubagentState[];
1777
- messageHistory: import("./types/message").CodebuffMessage[];
1778
- }[];
1779
- agentStepsRemaining: number;
1780
- };
1781
- toolResults: {
1782
- name: string;
1783
- id: string;
1784
- result: string;
1785
- }[];
1786
- toolCalls: {
1787
- name: string;
1788
- id: string;
1789
- parameters: Record<string, string>;
1790
- }[];
1791
- }, {
1792
- type: "manager-prompt-response";
1793
- promptId: string;
1794
- agentState: {
1795
- agentContext: string;
1796
- fileContext: {
1797
- projectRoot: string;
1798
- cwd: string;
1799
- fileTree: import("./util/file").FileTreeNode[];
1800
- fileTokenScores: Record<string, Record<string, number>>;
1801
- knowledgeFiles: Record<string, string>;
1802
- gitChanges: {
1803
- status: string;
1804
- diff: string;
1805
- diffCached: string;
1806
- lastCommitMessages: string;
1807
- };
1808
- changesSinceLastChat: Record<string, string>;
1809
- shellConfigFiles: Record<string, string>;
1810
- systemInfo: {
1811
- platform: string;
1812
- shell: string;
1813
- nodeVersion: string;
1814
- arch: string;
1815
- homedir: string;
1816
- cpus: number;
1817
- };
1818
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1819
- userKnowledgeFiles?: Record<string, string> | undefined;
1820
- fileVersions?: {
1821
- path: string;
1822
- content: string;
1823
- }[][] | undefined;
537
+ cpus: number;
1824
538
  };
1825
- messageHistory: (import("ai").CoreMessage & {
1826
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1827
- })[];
1828
- agentStepsRemaining: number;
1829
- agents?: {
1830
- agentId: string;
1831
- agentName: import("./types/agent-state").AgentTemplateName;
1832
- agents: import("./types/agent-state").SubagentState[];
1833
- messageHistory: import("./types/message").CodebuffMessage[];
1834
- }[] | undefined;
539
+ tokenCallers?: Record<string, Record<string, string[]>> | undefined;
540
+ userKnowledgeFiles?: Record<string, string> | undefined;
541
+ fileVersions?: {
542
+ path: string;
543
+ content: string;
544
+ }[][] | undefined;
1835
545
  };
1836
- toolResults: {
1837
- name: string;
1838
- id: string;
1839
- result: string;
1840
- }[];
1841
- toolCalls: {
1842
- name: string;
1843
- id: string;
1844
- parameters: Record<string, string>;
1845
- }[];
1846
- }>;
1847
- export type ManagerPromptResponse = z.infer<typeof ManagerPromptResponseSchema>;
1848
- export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1849
- type: z.ZodLiteral<"response-chunk">;
1850
- userInputId: z.ZodString;
1851
- chunk: z.ZodString;
546
+ fingerprintId: string;
547
+ authToken?: string | undefined;
548
+ repoUrl?: string | undefined;
549
+ }, {
550
+ type: "init";
551
+ fileContext: {
552
+ projectRoot: string;
553
+ cwd: string;
554
+ fileTree: import("./util/file").FileTreeNode[];
555
+ fileTokenScores: Record<string, Record<string, number>>;
556
+ knowledgeFiles: Record<string, string>;
557
+ gitChanges: {
558
+ status: string;
559
+ diff: string;
560
+ diffCached: string;
561
+ lastCommitMessages: string;
562
+ };
563
+ changesSinceLastChat: Record<string, string>;
564
+ shellConfigFiles: Record<string, string>;
565
+ systemInfo: {
566
+ platform: string;
567
+ shell: string;
568
+ nodeVersion: string;
569
+ arch: string;
570
+ homedir: string;
571
+ cpus: number;
572
+ };
573
+ tokenCallers?: Record<string, Record<string, string[]>> | undefined;
574
+ userKnowledgeFiles?: Record<string, string> | undefined;
575
+ fileVersions?: {
576
+ path: string;
577
+ content: string;
578
+ }[][] | undefined;
579
+ };
580
+ fingerprintId: string;
581
+ authToken?: string | undefined;
582
+ repoUrl?: string | undefined;
583
+ }>, z.ZodObject<{
584
+ type: z.ZodLiteral<"generate-commit-message">;
585
+ fingerprintId: z.ZodString;
586
+ authToken: z.ZodOptional<z.ZodString>;
587
+ stagedChanges: z.ZodString;
1852
588
  }, "strip", z.ZodTypeAny, {
1853
- type: "response-chunk";
1854
- userInputId: string;
1855
- chunk: string;
589
+ type: "generate-commit-message";
590
+ fingerprintId: string;
591
+ stagedChanges: string;
592
+ authToken?: string | undefined;
1856
593
  }, {
1857
- type: "response-chunk";
1858
- userInputId: string;
1859
- chunk: string;
1860
- }>, z.ZodObject<z.objectUtil.extendShape<{
594
+ type: "generate-commit-message";
595
+ fingerprintId: string;
596
+ stagedChanges: string;
597
+ authToken?: string | undefined;
598
+ }>]>;
599
+ export type ClientAction = z.infer<typeof CLIENT_ACTION_SCHEMA>;
600
+ export declare const UsageReponseSchema: z.ZodObject<{
601
+ type: z.ZodLiteral<"usage-response">;
602
+ usage: z.ZodNumber;
603
+ remainingBalance: z.ZodNumber;
604
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>;
605
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
606
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
607
+ }, "strip", z.ZodTypeAny, {
608
+ type: "usage-response";
609
+ usage: number;
610
+ remainingBalance: number;
611
+ next_quota_reset: Date | null;
612
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
613
+ autoTopupAdded?: number | undefined;
614
+ }, {
615
+ type: "usage-response";
616
+ usage: number;
617
+ remainingBalance: number;
618
+ next_quota_reset: Date | null;
619
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
620
+ autoTopupAdded?: number | undefined;
621
+ }>;
622
+ export type UsageResponse = z.infer<typeof UsageReponseSchema>;
623
+ export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
624
+ type: z.ZodLiteral<"init-response">;
625
+ }, Omit<{
626
+ type: z.ZodLiteral<"usage-response">;
627
+ usage: z.ZodNumber;
628
+ remainingBalance: z.ZodNumber;
629
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>;
630
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
631
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
632
+ }, "type">>, "strip", z.ZodTypeAny, {
633
+ type: "init-response";
634
+ usage: number;
635
+ remainingBalance: number;
636
+ next_quota_reset: Date | null;
637
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
638
+ autoTopupAdded?: number | undefined;
639
+ }, {
640
+ type: "init-response";
641
+ usage: number;
642
+ remainingBalance: number;
643
+ next_quota_reset: Date | null;
644
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
645
+ autoTopupAdded?: number | undefined;
646
+ }>;
647
+ export type InitResponse = z.infer<typeof InitResponseSchema>;
648
+ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShape<{
1861
649
  type: z.ZodLiteral<"response-complete">;
1862
650
  userInputId: z.ZodString;
1863
651
  response: z.ZodString;
@@ -1867,12 +655,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1867
655
  content: z.ZodString;
1868
656
  }, "strip", z.ZodTypeAny, {
1869
657
  path: string;
658
+ type: "patch" | "file";
1870
659
  content: string;
1871
- type: "file" | "patch";
1872
660
  }, {
1873
661
  path: string;
662
+ type: "patch" | "file";
1874
663
  content: string;
1875
- type: "file" | "patch";
1876
664
  }>, "many">;
1877
665
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1878
666
  type: z.ZodEnum<["patch", "file"]>;
@@ -1880,12 +668,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1880
668
  content: z.ZodString;
1881
669
  }, "strip", z.ZodTypeAny, {
1882
670
  path: string;
671
+ type: "patch" | "file";
1883
672
  content: string;
1884
- type: "file" | "patch";
1885
673
  }, {
1886
674
  path: string;
675
+ type: "patch" | "file";
1887
676
  content: string;
1888
- type: "file" | "patch";
1889
677
  }>, "many">;
1890
678
  addedFileVersions: z.ZodArray<z.ZodObject<{
1891
679
  path: z.ZodString;
@@ -1910,13 +698,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1910
698
  response: string;
1911
699
  changes: {
1912
700
  path: string;
701
+ type: "patch" | "file";
1913
702
  content: string;
1914
- type: "file" | "patch";
1915
703
  }[];
1916
704
  changesAlreadyApplied: {
1917
705
  path: string;
706
+ type: "patch" | "file";
1918
707
  content: string;
1919
- type: "file" | "patch";
1920
708
  }[];
1921
709
  addedFileVersions: {
1922
710
  path: string;
@@ -1934,13 +722,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1934
722
  response: string;
1935
723
  changes: {
1936
724
  path: string;
725
+ type: "patch" | "file";
1937
726
  content: string;
1938
- type: "file" | "patch";
1939
727
  }[];
1940
728
  changesAlreadyApplied: {
1941
729
  path: string;
730
+ type: "patch" | "file";
1942
731
  content: string;
1943
- type: "file" | "patch";
1944
732
  }[];
1945
733
  addedFileVersions: {
1946
734
  path: string;
@@ -1952,7 +740,22 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1952
740
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1953
741
  next_quota_reset?: Date | null | undefined;
1954
742
  autoTopupAdded?: number | undefined;
1955
- }>, z.ZodObject<{
743
+ }>;
744
+ export declare const MessageCostResponseSchema: z.ZodObject<{
745
+ type: z.ZodLiteral<"message-cost-response">;
746
+ promptId: z.ZodString;
747
+ credits: z.ZodNumber;
748
+ }, "strip", z.ZodTypeAny, {
749
+ type: "message-cost-response";
750
+ promptId: string;
751
+ credits: number;
752
+ }, {
753
+ type: "message-cost-response";
754
+ promptId: string;
755
+ credits: number;
756
+ }>;
757
+ export type MessageCostResponse = z.infer<typeof MessageCostResponseSchema>;
758
+ export declare const PromptResponseSchema: z.ZodObject<{
1956
759
  type: z.ZodLiteral<"prompt-response">;
1957
760
  promptId: z.ZodString;
1958
761
  agentState: z.ZodObject<{
@@ -2175,29 +978,29 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2175
978
  }[] | undefined;
2176
979
  }>;
2177
980
  toolCalls: z.ZodArray<z.ZodObject<{
2178
- name: z.ZodString;
2179
- parameters: z.ZodRecord<z.ZodString, z.ZodString>;
2180
- id: z.ZodString;
981
+ toolName: z.ZodString;
982
+ args: z.ZodRecord<z.ZodString, z.ZodString>;
983
+ toolCallId: z.ZodString;
2181
984
  }, "strip", z.ZodTypeAny, {
2182
- name: string;
2183
- id: string;
2184
- parameters: Record<string, string>;
985
+ toolName: string;
986
+ args: Record<string, string>;
987
+ toolCallId: string;
2185
988
  }, {
2186
- name: string;
2187
- id: string;
2188
- parameters: Record<string, string>;
989
+ toolName: string;
990
+ args: Record<string, string>;
991
+ toolCallId: string;
2189
992
  }>, "many">;
2190
993
  toolResults: z.ZodArray<z.ZodObject<{
2191
- name: z.ZodString;
994
+ toolName: z.ZodString;
995
+ toolCallId: z.ZodString;
2192
996
  result: z.ZodString;
2193
- id: z.ZodString;
2194
997
  }, "strip", z.ZodTypeAny, {
2195
- name: string;
2196
- id: string;
998
+ toolName: string;
999
+ toolCallId: string;
2197
1000
  result: string;
2198
1001
  }, {
2199
- name: string;
2200
- id: string;
1002
+ toolName: string;
1003
+ toolCallId: string;
2201
1004
  result: string;
2202
1005
  }>, "many">;
2203
1006
  }, "strip", z.ZodTypeAny, {
@@ -2246,14 +1049,14 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2246
1049
  agentStepsRemaining: number;
2247
1050
  };
2248
1051
  toolResults: {
2249
- name: string;
2250
- id: string;
1052
+ toolName: string;
1053
+ toolCallId: string;
2251
1054
  result: string;
2252
1055
  }[];
2253
1056
  toolCalls: {
2254
- name: string;
2255
- id: string;
2256
- parameters: Record<string, string>;
1057
+ toolName: string;
1058
+ args: Record<string, string>;
1059
+ toolCallId: string;
2257
1060
  }[];
2258
1061
  }, {
2259
1062
  type: "prompt-response";
@@ -2301,17 +1104,126 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2301
1104
  }[] | undefined;
2302
1105
  };
2303
1106
  toolResults: {
2304
- name: string;
2305
- id: string;
1107
+ toolName: string;
1108
+ toolCallId: string;
2306
1109
  result: string;
2307
1110
  }[];
2308
1111
  toolCalls: {
2309
- name: string;
2310
- id: string;
2311
- parameters: Record<string, string>;
1112
+ toolName: string;
1113
+ args: Record<string, string>;
1114
+ toolCallId: string;
1115
+ }[];
1116
+ }>;
1117
+ export type PromptResponse = z.infer<typeof PromptResponseSchema>;
1118
+ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1119
+ type: z.ZodLiteral<"response-chunk">;
1120
+ userInputId: z.ZodString;
1121
+ chunk: z.ZodString;
1122
+ }, "strip", z.ZodTypeAny, {
1123
+ type: "response-chunk";
1124
+ userInputId: string;
1125
+ chunk: string;
1126
+ }, {
1127
+ type: "response-chunk";
1128
+ userInputId: string;
1129
+ chunk: string;
1130
+ }>, z.ZodObject<z.objectUtil.extendShape<{
1131
+ type: z.ZodLiteral<"response-complete">;
1132
+ userInputId: z.ZodString;
1133
+ response: z.ZodString;
1134
+ changes: z.ZodArray<z.ZodObject<{
1135
+ type: z.ZodEnum<["patch", "file"]>;
1136
+ path: z.ZodString;
1137
+ content: z.ZodString;
1138
+ }, "strip", z.ZodTypeAny, {
1139
+ path: string;
1140
+ type: "patch" | "file";
1141
+ content: string;
1142
+ }, {
1143
+ path: string;
1144
+ type: "patch" | "file";
1145
+ content: string;
1146
+ }>, "many">;
1147
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1148
+ type: z.ZodEnum<["patch", "file"]>;
1149
+ path: z.ZodString;
1150
+ content: z.ZodString;
1151
+ }, "strip", z.ZodTypeAny, {
1152
+ path: string;
1153
+ type: "patch" | "file";
1154
+ content: string;
1155
+ }, {
1156
+ path: string;
1157
+ type: "patch" | "file";
1158
+ content: string;
1159
+ }>, "many">;
1160
+ addedFileVersions: z.ZodArray<z.ZodObject<{
1161
+ path: z.ZodString;
1162
+ content: z.ZodString;
1163
+ }, "strip", z.ZodTypeAny, {
1164
+ path: string;
1165
+ content: string;
1166
+ }, {
1167
+ path: string;
1168
+ content: string;
1169
+ }>, "many">;
1170
+ resetFileVersions: z.ZodBoolean;
1171
+ }, {
1172
+ usage: z.ZodOptional<z.ZodNumber>;
1173
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
1174
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>>;
1175
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1176
+ autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1177
+ }>, "strip", z.ZodTypeAny, {
1178
+ type: "response-complete";
1179
+ userInputId: string;
1180
+ response: string;
1181
+ changes: {
1182
+ path: string;
1183
+ type: "patch" | "file";
1184
+ content: string;
1185
+ }[];
1186
+ changesAlreadyApplied: {
1187
+ path: string;
1188
+ type: "patch" | "file";
1189
+ content: string;
1190
+ }[];
1191
+ addedFileVersions: {
1192
+ path: string;
1193
+ content: string;
1194
+ }[];
1195
+ resetFileVersions: boolean;
1196
+ usage?: number | undefined;
1197
+ remainingBalance?: number | undefined;
1198
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1199
+ next_quota_reset?: Date | null | undefined;
1200
+ autoTopupAdded?: number | undefined;
1201
+ }, {
1202
+ type: "response-complete";
1203
+ userInputId: string;
1204
+ response: string;
1205
+ changes: {
1206
+ path: string;
1207
+ type: "patch" | "file";
1208
+ content: string;
1209
+ }[];
1210
+ changesAlreadyApplied: {
1211
+ path: string;
1212
+ type: "patch" | "file";
1213
+ content: string;
1214
+ }[];
1215
+ addedFileVersions: {
1216
+ path: string;
1217
+ content: string;
2312
1218
  }[];
1219
+ resetFileVersions: boolean;
1220
+ usage?: number | undefined;
1221
+ remainingBalance?: number | undefined;
1222
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1223
+ next_quota_reset?: Date | null | undefined;
1224
+ autoTopupAdded?: number | undefined;
2313
1225
  }>, z.ZodObject<{
2314
- type: z.ZodLiteral<"manager-prompt-response">;
1226
+ type: z.ZodLiteral<"prompt-response">;
2315
1227
  promptId: z.ZodString;
2316
1228
  agentState: z.ZodObject<{
2317
1229
  agentContext: z.ZodString;
@@ -2533,33 +1445,33 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2533
1445
  }[] | undefined;
2534
1446
  }>;
2535
1447
  toolCalls: z.ZodArray<z.ZodObject<{
2536
- name: z.ZodString;
2537
- parameters: z.ZodRecord<z.ZodString, z.ZodString>;
2538
- id: z.ZodString;
1448
+ toolName: z.ZodString;
1449
+ args: z.ZodRecord<z.ZodString, z.ZodString>;
1450
+ toolCallId: z.ZodString;
2539
1451
  }, "strip", z.ZodTypeAny, {
2540
- name: string;
2541
- id: string;
2542
- parameters: Record<string, string>;
1452
+ toolName: string;
1453
+ args: Record<string, string>;
1454
+ toolCallId: string;
2543
1455
  }, {
2544
- name: string;
2545
- id: string;
2546
- parameters: Record<string, string>;
1456
+ toolName: string;
1457
+ args: Record<string, string>;
1458
+ toolCallId: string;
2547
1459
  }>, "many">;
2548
1460
  toolResults: z.ZodArray<z.ZodObject<{
2549
- name: z.ZodString;
1461
+ toolName: z.ZodString;
1462
+ toolCallId: z.ZodString;
2550
1463
  result: z.ZodString;
2551
- id: z.ZodString;
2552
1464
  }, "strip", z.ZodTypeAny, {
2553
- name: string;
2554
- id: string;
1465
+ toolName: string;
1466
+ toolCallId: string;
2555
1467
  result: string;
2556
1468
  }, {
2557
- name: string;
2558
- id: string;
1469
+ toolName: string;
1470
+ toolCallId: string;
2559
1471
  result: string;
2560
1472
  }>, "many">;
2561
1473
  }, "strip", z.ZodTypeAny, {
2562
- type: "manager-prompt-response";
1474
+ type: "prompt-response";
2563
1475
  promptId: string;
2564
1476
  agentState: {
2565
1477
  agentContext: string;
@@ -2604,17 +1516,17 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2604
1516
  agentStepsRemaining: number;
2605
1517
  };
2606
1518
  toolResults: {
2607
- name: string;
2608
- id: string;
1519
+ toolName: string;
1520
+ toolCallId: string;
2609
1521
  result: string;
2610
1522
  }[];
2611
1523
  toolCalls: {
2612
- name: string;
2613
- id: string;
2614
- parameters: Record<string, string>;
1524
+ toolName: string;
1525
+ args: Record<string, string>;
1526
+ toolCallId: string;
2615
1527
  }[];
2616
1528
  }, {
2617
- type: "manager-prompt-response";
1529
+ type: "prompt-response";
2618
1530
  promptId: string;
2619
1531
  agentState: {
2620
1532
  agentContext: string;
@@ -2659,14 +1571,14 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2659
1571
  }[] | undefined;
2660
1572
  };
2661
1573
  toolResults: {
2662
- name: string;
2663
- id: string;
1574
+ toolName: string;
1575
+ toolCallId: string;
2664
1576
  result: string;
2665
1577
  }[];
2666
1578
  toolCalls: {
2667
- name: string;
2668
- id: string;
2669
- parameters: Record<string, string>;
1579
+ toolName: string;
1580
+ args: Record<string, string>;
1581
+ toolCallId: string;
2670
1582
  }[];
2671
1583
  }>, z.ZodObject<{
2672
1584
  type: z.ZodLiteral<"read-files">;
@@ -2685,17 +1597,17 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2685
1597
  userInputId: z.ZodString;
2686
1598
  response: z.ZodString;
2687
1599
  data: z.ZodObject<{
2688
- name: z.ZodString;
2689
- id: z.ZodString;
2690
- input: z.ZodRecord<z.ZodString, z.ZodAny>;
1600
+ toolName: z.ZodString;
1601
+ args: z.ZodRecord<z.ZodString, z.ZodString>;
1602
+ toolCallId: z.ZodString;
2691
1603
  }, "strip", z.ZodTypeAny, {
2692
- name: string;
2693
- id: string;
2694
- input: Record<string, any>;
1604
+ toolName: string;
1605
+ args: Record<string, string>;
1606
+ toolCallId: string;
2695
1607
  }, {
2696
- name: string;
2697
- id: string;
2698
- input: Record<string, any>;
1608
+ toolName: string;
1609
+ args: Record<string, string>;
1610
+ toolCallId: string;
2699
1611
  }>;
2700
1612
  changes: z.ZodArray<z.ZodObject<{
2701
1613
  type: z.ZodEnum<["patch", "file"]>;
@@ -2703,12 +1615,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2703
1615
  content: z.ZodString;
2704
1616
  }, "strip", z.ZodTypeAny, {
2705
1617
  path: string;
1618
+ type: "patch" | "file";
2706
1619
  content: string;
2707
- type: "file" | "patch";
2708
1620
  }, {
2709
1621
  path: string;
1622
+ type: "patch" | "file";
2710
1623
  content: string;
2711
- type: "file" | "patch";
2712
1624
  }>, "many">;
2713
1625
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2714
1626
  type: z.ZodEnum<["patch", "file"]>;
@@ -2716,12 +1628,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2716
1628
  content: z.ZodString;
2717
1629
  }, "strip", z.ZodTypeAny, {
2718
1630
  path: string;
1631
+ type: "patch" | "file";
2719
1632
  content: string;
2720
- type: "file" | "patch";
2721
1633
  }, {
2722
1634
  path: string;
1635
+ type: "patch" | "file";
2723
1636
  content: string;
2724
- type: "file" | "patch";
2725
1637
  }>, "many">;
2726
1638
  addedFileVersions: z.ZodArray<z.ZodObject<{
2727
1639
  path: z.ZodString;
@@ -2740,13 +1652,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2740
1652
  response: string;
2741
1653
  changes: {
2742
1654
  path: string;
1655
+ type: "patch" | "file";
2743
1656
  content: string;
2744
- type: "file" | "patch";
2745
1657
  }[];
2746
1658
  changesAlreadyApplied: {
2747
1659
  path: string;
1660
+ type: "patch" | "file";
2748
1661
  content: string;
2749
- type: "file" | "patch";
2750
1662
  }[];
2751
1663
  addedFileVersions: {
2752
1664
  path: string;
@@ -2754,9 +1666,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2754
1666
  }[];
2755
1667
  resetFileVersions: boolean;
2756
1668
  data: {
2757
- name: string;
2758
- id: string;
2759
- input: Record<string, any>;
1669
+ toolName: string;
1670
+ args: Record<string, string>;
1671
+ toolCallId: string;
2760
1672
  };
2761
1673
  }, {
2762
1674
  type: "tool-call";
@@ -2764,13 +1676,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2764
1676
  response: string;
2765
1677
  changes: {
2766
1678
  path: string;
1679
+ type: "patch" | "file";
2767
1680
  content: string;
2768
- type: "file" | "patch";
2769
1681
  }[];
2770
1682
  changesAlreadyApplied: {
2771
1683
  path: string;
1684
+ type: "patch" | "file";
2772
1685
  content: string;
2773
- type: "file" | "patch";
2774
1686
  }[];
2775
1687
  addedFileVersions: {
2776
1688
  path: string;
@@ -2778,9 +1690,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2778
1690
  }[];
2779
1691
  resetFileVersions: boolean;
2780
1692
  data: {
2781
- name: string;
2782
- id: string;
2783
- input: Record<string, any>;
1693
+ toolName: string;
1694
+ args: Record<string, string>;
1695
+ toolCallId: string;
2784
1696
  };
2785
1697
  }>, z.ZodObject<{
2786
1698
  type: z.ZodLiteral<"terminal-command-result">;