@pentoshi/clai 3.8.34 → 3.8.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/adapters/current-store-adapter.js +2 -2
- package/dist/app/adapters/current-store-adapter.js.map +1 -1
- package/dist/app/controllers/session-controller.d.ts +6 -2
- package/dist/app/controllers/session-controller.js +19 -21
- package/dist/app/controllers/session-controller.js.map +1 -1
- package/dist/app/controllers/session-persistence.d.ts +16 -0
- package/dist/app/controllers/session-persistence.js +55 -0
- package/dist/app/controllers/session-persistence.js.map +1 -0
- package/dist/app/ports/persistence-port.d.ts +7 -0
- package/dist/prompts/embedded.js +2 -2
- package/dist/prompts/embedded.js.map +1 -1
- package/dist/prompts/system.agent.md +5 -5
- package/dist/prompts/system.ask.md +1 -1
- package/dist/store/history.d.ts +15 -8
- package/dist/store/history.js +357 -159
- package/dist/store/history.js.map +1 -1
- package/dist/tools/jobs.js +32 -2
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/pentest-workflows.js +22 -1
- package/dist/tools/pentest-workflows.js.map +1 -1
- package/dist/tui-v2/app/commands/picker-commands.js +1 -0
- package/dist/tui-v2/app/commands/picker-commands.js.map +1 -1
- package/dist/tui-v2/app/plan-lifecycle.js +10 -4
- package/dist/tui-v2/app/plan-lifecycle.js.map +1 -1
- package/dist/tui-v2/bootstrap/lifecycle.d.ts +13 -1
- package/dist/tui-v2/bootstrap/lifecycle.js +18 -3
- package/dist/tui-v2/bootstrap/lifecycle.js.map +1 -1
- package/dist/version.generated.d.ts +2 -2
- package/dist/version.generated.js +2 -2
- package/package.json +1 -1
package/dist/store/history.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ export interface PersistedContextUsage {
|
|
|
11
11
|
}
|
|
12
12
|
export interface HistoryRecord {
|
|
13
13
|
id: string;
|
|
14
|
+
/** Unique writer generation, compared before the per-writer revision. */
|
|
15
|
+
writerGeneration?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Monotonic whole-snapshot revision within one writer generation. Unlike
|
|
18
|
+
* updatedAt, this records capture order rather than I/O completion order.
|
|
19
|
+
*/
|
|
20
|
+
revision?: number | undefined;
|
|
14
21
|
name?: string | undefined;
|
|
15
22
|
createdAt: string;
|
|
16
23
|
updatedAt: string;
|
|
@@ -45,7 +52,12 @@ export interface ToolCallRecord {
|
|
|
45
52
|
exitCode?: number | undefined;
|
|
46
53
|
output: string;
|
|
47
54
|
}
|
|
48
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Compare snapshots by writer generation, then capture revision. Legacy rows
|
|
57
|
+
* without a generation retain revision/timestamp fallback for compatibility.
|
|
58
|
+
*/
|
|
59
|
+
export declare function compareHistoryFreshness(left: HistoryRecord, right: HistoryRecord): number;
|
|
60
|
+
/** Keep the newest captured version of each session id. */
|
|
49
61
|
export declare function dedupeHistoryById(records: readonly HistoryRecord[]): HistoryRecord[];
|
|
50
62
|
export declare function sortHistoryByUpdatedDesc(records: readonly HistoryRecord[]): HistoryRecord[];
|
|
51
63
|
/**
|
|
@@ -66,19 +78,14 @@ export declare function recoverOrphanedHistory(): Promise<{
|
|
|
66
78
|
recovered: number;
|
|
67
79
|
sources: string[];
|
|
68
80
|
}>;
|
|
69
|
-
export declare function saveSession(messages: ChatMessage[], name?: string | undefined, transcript?: TranscriptItem[] | undefined, contextUsage?: PersistedContextUsage | undefined): Promise<HistoryRecord>;
|
|
70
|
-
export declare function upsertSession(id: string, messages: ChatMessage[], name?: string | undefined, transcript?: TranscriptItem[] | undefined, contextUsage?: PersistedContextUsage | undefined): Promise<HistoryRecord>;
|
|
81
|
+
export declare function saveSession(messages: ChatMessage[], name?: string | undefined, transcript?: TranscriptItem[] | undefined, contextUsage?: PersistedContextUsage | undefined, revision?: number | undefined, writerGeneration?: string | undefined): Promise<HistoryRecord>;
|
|
82
|
+
export declare function upsertSession(id: string, messages: ChatMessage[], name?: string | undefined, transcript?: TranscriptItem[] | undefined, contextUsage?: PersistedContextUsage | undefined, revision?: number | undefined, writerGeneration?: string | undefined): Promise<HistoryRecord>;
|
|
71
83
|
export declare function saveToolCall(sessionId: string, call: ToolCall, result: ToolResult): Promise<ToolCallRecord>;
|
|
72
84
|
export declare function listSessions(limit?: number, options?: {
|
|
73
85
|
recovery?: "blocking" | "background";
|
|
74
86
|
}): Promise<HistoryRecord[]>;
|
|
75
87
|
export declare function getSession(sessionId: string): Promise<HistoryRecord | undefined>;
|
|
76
88
|
export declare function getHistoryPath(): string;
|
|
77
|
-
/**
|
|
78
|
-
* Clear active history after archiving a full snapshot. Never unrecoverably
|
|
79
|
-
* destroys chats — a timestamped copy is written under history-backups/ and
|
|
80
|
-
* the previous active file is moved into history-archive.jsonl.
|
|
81
|
-
*/
|
|
82
89
|
export declare function clearAllHistory(): Promise<{
|
|
83
90
|
cleared: boolean;
|
|
84
91
|
detail: string;
|