tarsk 0.3.3 → 0.3.16

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 (43) hide show
  1. package/dist/cli.d.ts +3 -0
  2. package/dist/cli.js +22 -0
  3. package/dist/index.js +3 -2
  4. package/dist/public/assets/{index-DJC-p914.js → index-CLr9LKtA.js} +1679 -1682
  5. package/dist/public/index.html +1 -1
  6. package/node_modules/@neovate/code/LICENSE +21 -0
  7. package/node_modules/@neovate/code/README.md +56 -0
  8. package/node_modules/@neovate/code/dist/cli.mjs +714 -716
  9. package/node_modules/@neovate/code/dist/index.d.ts +0 -373
  10. package/node_modules/@neovate/code/dist/index.mjs +790 -792
  11. package/node_modules/@neovate/code/package.json +138 -2
  12. package/node_modules/@neovate/code/vendor/ripgrep/COPYING +3 -0
  13. package/node_modules/@neovate/code/vendor/ripgrep/arm64-darwin/rg +0 -0
  14. package/node_modules/@neovate/code/vendor/ripgrep/arm64-linux/rg +0 -0
  15. package/node_modules/@neovate/code/vendor/ripgrep/x64-darwin/rg +0 -0
  16. package/node_modules/@neovate/code/vendor/ripgrep/x64-linux/rg +0 -0
  17. package/node_modules/@neovate/code/vendor/ripgrep/x64-win32/rg.exe +0 -0
  18. package/package.json +2 -2
  19. package/dist/managers/ConversationManager.d.ts +0 -83
  20. package/dist/managers/ConversationManager.js +0 -129
  21. package/dist/managers/GitManager.d.ts +0 -133
  22. package/dist/managers/GitManager.js +0 -330
  23. package/dist/managers/MetadataManager.d.ts +0 -139
  24. package/dist/managers/MetadataManager.js +0 -309
  25. package/dist/managers/ModelManager.d.ts +0 -57
  26. package/dist/managers/ModelManager.js +0 -129
  27. package/dist/managers/NeovateExecutor.d.ts +0 -40
  28. package/dist/managers/NeovateExecutor.js +0 -138
  29. package/dist/managers/ProjectManager.d.ts +0 -162
  30. package/dist/managers/ProjectManager.js +0 -353
  31. package/dist/managers/ThreadManager.d.ts +0 -181
  32. package/dist/managers/ThreadManager.js +0 -325
  33. package/dist/model-info-openai.d.ts +0 -17
  34. package/dist/model-info-openai.js +0 -59
  35. package/dist/public/assets/index-B443aj9k.js +0 -8506
  36. package/dist/routes/chat-old.d.ts +0 -21
  37. package/dist/routes/chat-old.js +0 -251
  38. package/dist/routes/projects-old.d.ts +0 -20
  39. package/dist/routes/projects-old.js +0 -297
  40. package/dist/routes/threads-old.d.ts +0 -14
  41. package/dist/routes/threads-old.js +0 -393
  42. package/dist/utils/openai-pricing-scraper.d.ts +0 -17
  43. package/dist/utils/openai-pricing-scraper.js +0 -185
@@ -301,14 +301,6 @@ declare type Config = {
301
301
  * - 'maxOrXhigh': Prefer xhigh if available, otherwise max
302
302
  */
303
303
  thinkingLevel?: 'low' | 'medium' | 'high' | 'max' | 'xhigh' | 'maxOrXhigh';
304
- /**
305
- * Controls whether rewind checkpoints are enabled.
306
- * When enabled, snapshots are created after each AI response to allow
307
- * rewinding to previous states with code restoration.
308
- *
309
- * @default true
310
- */
311
- checkpoints?: boolean;
312
304
  };
313
305
 
314
306
  declare type ConfigGetInput = {
@@ -377,7 +369,6 @@ export declare class Context {
377
369
  argvConfig: Record<string, any>;
378
370
  mcpManager: MCPManager;
379
371
  backgroundTaskManager: BackgroundTaskManager;
380
- fileHistoryManager: FileHistoryManager;
381
372
  skillManager?: SkillManager;
382
373
  messageBus?: MessageBus;
383
374
  agentManager?: AgentManager;
@@ -412,7 +403,6 @@ declare type ContextOpts = {
412
403
  argvConfig: Record<string, any>;
413
404
  mcpManager: MCPManager;
414
405
  backgroundTaskManager: BackgroundTaskManager;
415
- fileHistoryManager: FileHistoryManager;
416
406
  skillManager?: SkillManager;
417
407
  messageBus?: MessageBus;
418
408
  agentManager?: AgentManager;
@@ -476,171 +466,6 @@ declare type EventMessage = BaseMessage & {
476
466
  data: any;
477
467
  };
478
468
 
479
- /**
480
- * Backup metadata for a single file
481
- */
482
- declare type FileBackupMeta = {
483
- /** Backup file name, format: {hash}@v{version}, null means file was deleted */
484
- backupFileName: string | null;
485
- /** Version number (incremental) */
486
- version: number;
487
- /** Backup time */
488
- backupTime: Date;
489
- };
490
-
491
- /**
492
- * File diff content for UI display
493
- */
494
- declare type FileDiff = {
495
- path: string;
496
- oldContent: string;
497
- newContent: string;
498
- };
499
-
500
- declare class FileHistory {
501
- private cwd;
502
- private sessionId;
503
- private backupDir;
504
- private snapshots;
505
- private trackedFiles;
506
- private pendingBackups;
507
- constructor(opts: {
508
- cwd: string;
509
- sessionId: string;
510
- backupRoot?: string;
511
- snapshots?: Snapshot[];
512
- });
513
- /**
514
- * Factory method: Create FileHistory instance from session data
515
- */
516
- static fromSession(opts: {
517
- cwd: string;
518
- sessionId: string;
519
- snapshots: SerializedSnapshot_2[];
520
- backupRoot?: string;
521
- }): FileHistory;
522
- /**
523
- * Add file to tracking list and create immediate backup.
524
- * Accepts either absolute path or relative path (relative to cwd).
525
- *
526
- * This should be called BEFORE the file is modified, so we backup the OLD content.
527
- */
528
- trackFile(filePath: string): void;
529
- /**
530
- * Track a new file (does not exist yet) before it gets created.
531
- * Records backupFileName as null to indicate the file was newly created.
532
- */
533
- trackNewFile(filePath: string): void;
534
- /**
535
- * Check if message has a snapshot
536
- */
537
- hasSnapshot(messageId: string): boolean;
538
- /**
539
- * Generate backup file name: SHA256(relativePath).slice(0,16)@v{version}
540
- */
541
- private generateBackupFileName;
542
- /**
543
- * Detect if file has changed compared to backup (metadata-first)
544
- */
545
- private hasFileChanged;
546
- /**
547
- * Create file backup
548
- */
549
- private createBackup;
550
- /**
551
- * Check if there are pending backups waiting to be snapshotted.
552
- * Use this to determine if a snapshot should be created for this turn.
553
- */
554
- hasPendingBackups(): boolean;
555
- /**
556
- * Create snapshot using pending backups created by trackFile.
557
- * Only files with pending backups (modified this turn) are included.
558
- * Returns null if no files were modified this turn.
559
- */
560
- createSnapshot(messageId: string): Snapshot | null;
561
- /**
562
- * Get all snapshot previews
563
- */
564
- getSnapshotPreviews(): SnapshotPreview_2[];
565
- /**
566
- * Calculate file diff using real line-by-line comparison
567
- */
568
- private calculateDiff;
569
- /**
570
- * Restore single file
571
- */
572
- private restoreFile;
573
- /**
574
- * Rewind to specified message's snapshot.
575
- * Restores files to the state AT the target snapshot, reverting all changes
576
- * made by snapshots after the target.
577
- */
578
- rewindToMessage(messageId: string, dryRun?: boolean): RewindResult_2;
579
- /**
580
- * Read file content safely, returns empty string if file doesn't exist
581
- */
582
- private readFileContent;
583
- /**
584
- * Get file contents for diff display
585
- */
586
- private getFileDiffContents;
587
- /**
588
- * Preview rewind (dry run)
589
- * @param cumulative - If true, calculates changes from this point to current state (for UI display)
590
- * If false, only shows changes in this specific snapshot
591
- */
592
- previewRewind(messageId: string, cumulative?: boolean): RewindResult_2;
593
- }
594
-
595
- declare class FileHistoryManager {
596
- private instances;
597
- private cwd;
598
- private backupRoot;
599
- constructor(opts: FileHistoryManagerOpts);
600
- /**
601
- * Gets or creates a FileHistory instance for the given sessionId.
602
- * If sessionLogPath is provided, attempts to load existing snapshots from session.jsonl.
603
- *
604
- * @param sessionId - Session ID (can be main session or agent session like 'agent-xxx')
605
- * @param sessionLogPath - Optional path to session.jsonl for loading existing snapshots
606
- * @returns FileHistory instance for the session
607
- */
608
- getOrCreate(sessionId: string, sessionLogPath?: string): FileHistory;
609
- /**
610
- * Directly sets a FileHistory instance for a session.
611
- * Used by snapshot.loadFromSession handler.
612
- *
613
- * @param sessionId - Session ID
614
- * @param fileHistory - FileHistory instance to set
615
- */
616
- set(sessionId: string, fileHistory: FileHistory): void;
617
- /**
618
- * Gets a FileHistory instance without creating it.
619
- * Returns undefined if no instance exists.
620
- *
621
- * @param sessionId - Session ID
622
- * @returns FileHistory instance or undefined
623
- */
624
- get(sessionId: string): FileHistory | undefined;
625
- /**
626
- * Clears FileHistory instance(s).
627
- *
628
- * @param sessionId - Optional session ID. If provided, clears only that session.
629
- * If not provided, clears all sessions.
630
- */
631
- clear(sessionId?: string): void;
632
- /**
633
- * Destroys all FileHistory instances.
634
- * Called when the Context is destroyed.
635
- */
636
- destroy(): void;
637
- }
638
-
639
- declare interface FileHistoryManagerOpts {
640
- cwd: string;
641
- backupRoot: string;
642
- }
643
-
644
469
  declare type GitCloneInput = {
645
470
  url: string;
646
471
  destination: string;
@@ -1122,34 +947,6 @@ declare type HandlerMap = {
1122
947
  input: ToolApprovalInput;
1123
948
  output: ToolApprovalOutput;
1124
949
  };
1125
- 'snapshot.trackFile': {
1126
- input: SnapshotTrackFileInput;
1127
- output: SuccessResponse;
1128
- };
1129
- 'snapshot.create': {
1130
- input: SnapshotCreateInput;
1131
- output: SnapshotCreateOutput;
1132
- };
1133
- 'snapshot.list': {
1134
- input: SnapshotListInput;
1135
- output: SnapshotListOutput;
1136
- };
1137
- 'snapshot.has': {
1138
- input: SnapshotHasInput;
1139
- output: SnapshotHasOutput;
1140
- };
1141
- 'snapshot.rewind': {
1142
- input: SnapshotRewindInput;
1143
- output: SnapshotRewindOutput;
1144
- };
1145
- 'snapshot.previewRewind': {
1146
- input: SnapshotPreviewRewindInput;
1147
- output: SnapshotPreviewRewindOutput;
1148
- };
1149
- 'snapshot.loadFromSession': {
1150
- input: SnapshotLoadFromSessionInput;
1151
- output: SuccessResponse;
1152
- };
1153
950
  };
1154
951
 
1155
952
  declare type ImagePart = {
@@ -1528,7 +1325,6 @@ declare class Paths {
1528
1325
  globalConfigDir: string;
1529
1326
  globalProjectDir: string;
1530
1327
  projectConfigDir: string;
1531
- fileHistoryDir: string;
1532
1328
  constructor(opts: {
1533
1329
  productName: string;
1534
1330
  cwd: string;
@@ -2059,29 +1855,6 @@ export declare function resumeSession(sessionId: string, options: SDKSessionOpti
2059
1855
 
2060
1856
  declare type ReturnDisplay = string | DiffViewerReturnDisplay | TodoWriteReturnDisplay | AgentResultReturnDisplay | PlanModeExitReturnDisplay;
2061
1857
 
2062
- declare type RewindResult = {
2063
- success: boolean;
2064
- error?: string;
2065
- filesChanged: string[];
2066
- insertions: number;
2067
- deletions: number;
2068
- };
2069
-
2070
- /**
2071
- * Rewind operation result
2072
- */
2073
- declare type RewindResult_2 = {
2074
- success: boolean;
2075
- error?: string;
2076
- /** List of restored files */
2077
- filesChanged: string[];
2078
- /** Change statistics */
2079
- insertions: number;
2080
- deletions: number;
2081
- /** File diffs for UI display (only in preview mode) */
2082
- fileDiffs?: FileDiff[];
2083
- };
2084
-
2085
1858
  export declare function runNeovate(opts: {
2086
1859
  productName: string;
2087
1860
  productASCIIArt?: string;
@@ -2172,29 +1945,6 @@ export declare type SDKUserMessage = {
2172
1945
  sessionId: string;
2173
1946
  };
2174
1947
 
2175
- declare type SerializedSnapshot = {
2176
- messageId: string;
2177
- timestamp: string;
2178
- trackedFileBackups: Record<string, {
2179
- backupFileName: string | null;
2180
- version: number;
2181
- backupTime: string;
2182
- }>;
2183
- };
2184
-
2185
- /**
2186
- * Serialized snapshot data (for JSONL storage)
2187
- */
2188
- declare type SerializedSnapshot_2 = {
2189
- messageId: string;
2190
- timestamp: string;
2191
- trackedFileBackups: Record<string, {
2192
- backupFileName: string | null;
2193
- version: number;
2194
- backupTime: string;
2195
- }>;
2196
- };
2197
-
2198
1948
  declare type SessionAddMessagesInput = {
2199
1949
  cwd: string;
2200
1950
  sessionId: string;
@@ -2678,129 +2428,6 @@ declare type SlashCommandListOutput = {
2678
2428
  };
2679
2429
  };
2680
2430
 
2681
- /**
2682
- * File state snapshot at a specific message point
2683
- */
2684
- declare type Snapshot = {
2685
- /** Associated message UUID */
2686
- messageId: string;
2687
- /** Snapshot creation time */
2688
- timestamp: Date;
2689
- /** Relative path -> backup metadata mapping */
2690
- trackedFileBackups: Record<string, FileBackupMeta>;
2691
- };
2692
-
2693
- declare type SnapshotCreateInput = {
2694
- cwd: string;
2695
- sessionId: string;
2696
- messageId: string;
2697
- description?: string;
2698
- };
2699
-
2700
- declare type SnapshotCreateOutput = {
2701
- success: boolean;
2702
- data: {
2703
- snapshot: SnapshotPreview | null;
2704
- };
2705
- };
2706
-
2707
- declare type SnapshotHasInput = {
2708
- cwd: string;
2709
- sessionId: string;
2710
- messageId: string;
2711
- };
2712
-
2713
- declare type SnapshotHasOutput = {
2714
- success: boolean;
2715
- data: {
2716
- hasSnapshot: boolean;
2717
- };
2718
- };
2719
-
2720
- declare type SnapshotListInput = {
2721
- cwd: string;
2722
- sessionId: string;
2723
- };
2724
-
2725
- declare type SnapshotListOutput = {
2726
- success: boolean;
2727
- data: {
2728
- snapshots: SnapshotPreview[];
2729
- };
2730
- };
2731
-
2732
- declare type SnapshotLoadFromSessionInput = {
2733
- cwd: string;
2734
- sessionId: string;
2735
- snapshots: SerializedSnapshot[];
2736
- };
2737
-
2738
- declare type SnapshotPreview = {
2739
- messageId: string;
2740
- timestamp: Date;
2741
- fileCount: number;
2742
- changes?: {
2743
- insertions: number;
2744
- deletions: number;
2745
- filesChanged: number;
2746
- };
2747
- };
2748
-
2749
- /**
2750
- * Snapshot preview info (for UI display)
2751
- */
2752
- declare type SnapshotPreview_2 = {
2753
- messageId: string;
2754
- timestamp: Date;
2755
- fileCount: number;
2756
- /** Change statistics relative to previous snapshot */
2757
- changes?: {
2758
- insertions: number;
2759
- deletions: number;
2760
- filesChanged: number;
2761
- };
2762
- };
2763
-
2764
- declare type SnapshotPreviewRewindInput = {
2765
- cwd: string;
2766
- sessionId: string;
2767
- messageId: string;
2768
- cumulative?: boolean;
2769
- };
2770
-
2771
- declare type SnapshotPreviewRewindOutput = {
2772
- success: true;
2773
- data: {
2774
- result: RewindResult;
2775
- };
2776
- } | {
2777
- success: false;
2778
- error: string;
2779
- };
2780
-
2781
- declare type SnapshotRewindInput = {
2782
- cwd: string;
2783
- sessionId: string;
2784
- messageId: string;
2785
- };
2786
-
2787
- declare type SnapshotRewindOutput = {
2788
- success: true;
2789
- data: {
2790
- result: RewindResult;
2791
- };
2792
- } | {
2793
- success: false;
2794
- error: string;
2795
- };
2796
-
2797
- declare type SnapshotTrackFileInput = {
2798
- cwd: string;
2799
- sessionId: string;
2800
- filePath: string;
2801
- isNewFile?: boolean;
2802
- };
2803
-
2804
2431
  declare type Status = Record<string, {
2805
2432
  description?: string;
2806
2433
  items: string[];