@ai-matrx/coding-sessions 0.1.166 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/engine/index.cjs +273 -59
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +1 -1
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.js +269 -58
- package/dist/engine/index.js.map +1 -1
- package/dist/{index-CDeDKQHe.d.cts → index-Bbe11HoB.d.cts} +108 -3
- package/dist/{index-CDeDKQHe.d.ts → index-Bbe11HoB.d.ts} +108 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +47 -6
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +37 -0
- package/dist/react/index.d.ts +37 -0
- package/dist/react/index.js +47 -6
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.cjs +241 -57
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +241 -57
- package/dist/server/index.js.map +1 -1
- package/dist/sessions/index.cjs +360 -0
- package/dist/sessions/index.cjs.map +1 -0
- package/dist/sessions/index.d.cts +71 -0
- package/dist/sessions/index.d.ts +71 -0
- package/dist/sessions/index.js +337 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/titles-DjxUb0ji.d.cts +48 -0
- package/dist/titles-DjxUb0ji.d.ts +48 -0
- package/dist/ui/assets/index-BqzTnRFe.css +2 -0
- package/dist/ui/assets/{index-7eK8XQtL.js → index-U98AY8r-.js} +17 -17
- package/dist/ui/index.html +2 -2
- package/package.json +13 -3
- package/dist/ui/assets/index-BqpVx_My.css +0 -2
|
@@ -2,6 +2,10 @@ import { JsonValue } from '@ai-matrx/agents/portable';
|
|
|
2
2
|
import { CredentialsPort } from '@ai-matrx/data';
|
|
3
3
|
import { McpHttpReply } from '@ai-matrx/agents/portable/mcp';
|
|
4
4
|
|
|
5
|
+
/** Where a title came from, strongest first. */
|
|
6
|
+
declare const TITLE_PRECEDENCE: readonly ["override", "app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"];
|
|
7
|
+
type TitleSource = (typeof TITLE_PRECEDENCE)[number];
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* The public contract of `@ai-matrx/coding-sessions`, shared by the engine
|
|
7
11
|
* (Node), the local host (Node) and the UI (browser). Pure types — nothing here
|
|
@@ -129,7 +133,22 @@ interface DiscoveredSession {
|
|
|
129
133
|
provider: CodingProvider;
|
|
130
134
|
providerSessionId: string;
|
|
131
135
|
cwd: string | null;
|
|
136
|
+
/**
|
|
137
|
+
* The chat's own title by the one rule (`./sessions`): the coding app's title when the owner of
|
|
138
|
+
* the apps' index supplied it (title hints), else the transcript's. Never the person's rename —
|
|
139
|
+
* that is applied once, by the screen, from the preferences.
|
|
140
|
+
*/
|
|
132
141
|
title: string;
|
|
142
|
+
/** Where `title` came from (`TITLE_PRECEDENCE`). */
|
|
143
|
+
titleSource?: TitleSource | "unknown" | undefined;
|
|
144
|
+
/** The app's title is still on its way (hints not loaded yet); `title` is the transcript's for now. */
|
|
145
|
+
titlePending?: boolean | undefined;
|
|
146
|
+
/** Archived in the app (hidden by default, like Code › Chats). */
|
|
147
|
+
archived?: boolean | undefined;
|
|
148
|
+
/** A scheduled or automated run (hidden by default). */
|
|
149
|
+
scheduled?: boolean | undefined;
|
|
150
|
+
/** The app lists it but its conversation file is gone: why. Shown, cannot be taken over. */
|
|
151
|
+
unavailable?: string | null | undefined;
|
|
133
152
|
updatedAt: string;
|
|
134
153
|
/** Where it was started, when the provider records it ("cli", "vscode", "exec", …). */
|
|
135
154
|
source: string | null;
|
|
@@ -244,6 +263,11 @@ type TranscriptItem = {
|
|
|
244
263
|
id: string;
|
|
245
264
|
text: string;
|
|
246
265
|
};
|
|
266
|
+
interface TitleStatus {
|
|
267
|
+
owner: boolean;
|
|
268
|
+
pending: boolean;
|
|
269
|
+
problem: string | null;
|
|
270
|
+
}
|
|
247
271
|
/** Everything the engine pushes to a listener. */
|
|
248
272
|
type CodingEvent = {
|
|
249
273
|
type: "session";
|
|
@@ -254,6 +278,10 @@ type CodingEvent = {
|
|
|
254
278
|
} | {
|
|
255
279
|
type: "preferences";
|
|
256
280
|
preferences: Record<string, ChatPreference>;
|
|
281
|
+
}
|
|
282
|
+
/** The apps' titles changed (or finished loading): re-read the discovered chats. */
|
|
283
|
+
| {
|
|
284
|
+
type: "titles";
|
|
257
285
|
} | {
|
|
258
286
|
type: "item";
|
|
259
287
|
sessionId: string;
|
|
@@ -409,6 +437,10 @@ interface CodingSessionsApi {
|
|
|
409
437
|
discoverSessions(options?: {
|
|
410
438
|
limit?: number;
|
|
411
439
|
}): Promise<DiscoveredSession[]>;
|
|
440
|
+
/** Where the apps' own titles stand: an owner supplies them (`owner`), still loading, or failing (`problem`, shown with Retry). */
|
|
441
|
+
titleStatus(): Promise<TitleStatus>;
|
|
442
|
+
/** Ask the owner of the apps' titles again (the Retry). */
|
|
443
|
+
retryTitles(): Promise<void>;
|
|
412
444
|
recentFolders(): Promise<RecentFolder[]>;
|
|
413
445
|
listSessions(): Promise<CodingSession[]>;
|
|
414
446
|
listRuns(sessionId: string): Promise<RunRecord[]>;
|
|
@@ -573,17 +605,34 @@ declare const DEFAULT_SUPABASE_URL = "https://db.matrxserver.com";
|
|
|
573
605
|
* few newest, and a transcript read is capped with the cap announced.
|
|
574
606
|
*/
|
|
575
607
|
|
|
608
|
+
interface CodexHome {
|
|
609
|
+
/** `<CODEX_HOME>/sessions` (dated folders of rollouts). */
|
|
610
|
+
sessions: string;
|
|
611
|
+
/** `<CODEX_HOME>/archived_sessions` (rollouts Codex archived; flat). */
|
|
612
|
+
archived: string;
|
|
613
|
+
/** `<CODEX_HOME>/session_index.jsonl` (the app's thread names). */
|
|
614
|
+
index: string;
|
|
615
|
+
}
|
|
576
616
|
interface ProviderHomes {
|
|
577
617
|
claudeProjects: string;
|
|
578
|
-
|
|
579
|
-
|
|
618
|
+
/** The claude-accounts holder's copies (`<vault>/<id>/transcript.jsonl`): a held chat's history when its own file is gone. */
|
|
619
|
+
claudeVault?: string | undefined;
|
|
620
|
+
/** Every Codex home to read (main first). The owner of the apps' index names them (Matrx 2: the Codex source's homes). */
|
|
621
|
+
codex: CodexHome[];
|
|
580
622
|
}
|
|
623
|
+
declare function codexHome(dir: string): CodexHome;
|
|
581
624
|
declare function defaultProviderHomes(home?: string): ProviderHomes;
|
|
582
625
|
interface DiscoverOptions {
|
|
583
626
|
limit?: number | undefined;
|
|
584
627
|
homes?: ProviderHomes | undefined;
|
|
585
628
|
/** Processes that are OUR runs (never "live elsewhere"). */
|
|
586
629
|
excludePids?: ReadonlySet<number> | undefined;
|
|
630
|
+
/**
|
|
631
|
+
* The apps' own titles from the owner of their index (`provider:id` → title). Given → the apps'
|
|
632
|
+
* files are not read here at all (Codex thread names come from it); absent → the standalone host
|
|
633
|
+
* reads Codex's `session_index.jsonl` itself.
|
|
634
|
+
*/
|
|
635
|
+
appTitles?: ReadonlyMap<string, string> | undefined;
|
|
587
636
|
}
|
|
588
637
|
/** Fresh "is it live elsewhere?" for one session (the preview and the takeover confirm). */
|
|
589
638
|
declare function sessionActivity(provider: CodingProvider, providerSessionId: string, options?: {
|
|
@@ -601,6 +650,46 @@ declare function findSessionFile(provider: CodingProvider, providerSessionId: st
|
|
|
601
650
|
*/
|
|
602
651
|
declare function readSessionFile(provider: CodingProvider, file: string, endOffset?: number | undefined, maxBytes?: number): Promise<SessionHistory>;
|
|
603
652
|
|
|
653
|
+
/**
|
|
654
|
+
* TITLE HINTS — the port through which the owner of the coding apps' index (Matrx 2's core, which
|
|
655
|
+
* reads Claude's records, Codex's database and the rest through its own `fs`/`exec` owners) tells
|
|
656
|
+
* this package what each chat is called and whether the app hides it. The package never walks the
|
|
657
|
+
* apps' records itself: it reads transcripts (titles by the transcript rules, content search,
|
|
658
|
+
* activity) and overlays these hints as they arrive. Pure: browser-safe types and helpers.
|
|
659
|
+
*/
|
|
660
|
+
|
|
661
|
+
type HintProvider = "claude" | "codex";
|
|
662
|
+
interface TitleHint {
|
|
663
|
+
/** The app's title (pre-override: the person's rename is applied by whoever draws the row). */
|
|
664
|
+
title: string;
|
|
665
|
+
/** Where the owner's title came from; "unknown" when the owner did not say (shown as such, never guessed). */
|
|
666
|
+
source: TitleSource | "unknown";
|
|
667
|
+
/** The app hides it: archived in the app (shown behind a toggle). */
|
|
668
|
+
archived?: boolean | undefined;
|
|
669
|
+
/** A scheduled or automated run (shown behind a toggle). */
|
|
670
|
+
scheduled?: boolean | undefined;
|
|
671
|
+
/** Listed by the app but its conversation file is gone: why (it is shown, never dropped). */
|
|
672
|
+
unavailable?: string | null | undefined;
|
|
673
|
+
/** Last activity the app records (ms), for chats only the app knows. */
|
|
674
|
+
lastActiveMs?: number | null | undefined;
|
|
675
|
+
}
|
|
676
|
+
interface TitleHints {
|
|
677
|
+
/** The hints now, keyed `titleHintKey()`; null while the owner's index is still loading. Never waits. */
|
|
678
|
+
current(): ReadonlyMap<string, TitleHint> | null;
|
|
679
|
+
/** Called after the hints change (a rename in the app, a new chat, the first load, a failure). */
|
|
680
|
+
subscribe(listener: () => void): () => void;
|
|
681
|
+
/** Why the apps' titles could not be had right now (shown with a Retry), or null. */
|
|
682
|
+
problem?(): string | null;
|
|
683
|
+
/** Ask the owner again now (the Retry). */
|
|
684
|
+
retry?(): void;
|
|
685
|
+
}
|
|
686
|
+
declare function titleHintKey(provider: HintProvider, sessionId: string): string;
|
|
687
|
+
/** A hints port the host fills by hand (tests, or an owner that pushes whole snapshots). */
|
|
688
|
+
declare function createTitleHintsStore(): TitleHints & {
|
|
689
|
+
set(hints: ReadonlyMap<string, TitleHint> | null): void;
|
|
690
|
+
setProblem(problem: string | null): void;
|
|
691
|
+
};
|
|
692
|
+
|
|
604
693
|
/**
|
|
605
694
|
* THE CLEAN ENVIRONMENT — built from an ALLOWLIST, never a denylist.
|
|
606
695
|
*
|
|
@@ -682,6 +771,8 @@ interface SearchOptions {
|
|
|
682
771
|
homes?: ProviderHomes | undefined;
|
|
683
772
|
cursor?: number | undefined;
|
|
684
773
|
limit?: number | undefined;
|
|
774
|
+
/** The apps' own titles (`provider:id` → title) from the owner of their index; absent → Codex's index is read here. */
|
|
775
|
+
appTitles?: ReadonlyMap<string, string> | undefined;
|
|
685
776
|
/** Stop reading after this long and hand back a cursor. Default 3.5 s. */
|
|
686
777
|
budgetMs?: number | undefined;
|
|
687
778
|
}
|
|
@@ -724,6 +815,12 @@ declare class PreferenceStore {
|
|
|
724
815
|
get(key: string): ChatPreference | null;
|
|
725
816
|
/** Merge `patch`; a null/false/empty field is removed, an empty preference deleted. */
|
|
726
817
|
set(key: string, patch: ChatPreference): Record<string, ChatPreference>;
|
|
818
|
+
/**
|
|
819
|
+
* Move a preference to the chat's lasting key (`session:<id>` → `<provider>:<id>` once the
|
|
820
|
+
* provider's id is known), so a rename made early is the one rename everywhere. A preference
|
|
821
|
+
* already under the lasting key wins field by field.
|
|
822
|
+
*/
|
|
823
|
+
rekey(from: string, to: string): boolean;
|
|
727
824
|
private persist;
|
|
728
825
|
flush(): Promise<void>;
|
|
729
826
|
}
|
|
@@ -780,9 +877,17 @@ interface CodingSessionsEngineOptions {
|
|
|
780
877
|
* are unaffected.
|
|
781
878
|
*/
|
|
782
879
|
agents?: CodingSessionsAgentsOptions | undefined;
|
|
880
|
+
/**
|
|
881
|
+
* What the coding apps' own records say each chat is called (and archived / scheduled / file
|
|
882
|
+
* gone), from the owner of the apps' index — Matrx 2's core. Never waited for; absent → titles
|
|
883
|
+
* come from the transcripts alone (the standalone host).
|
|
884
|
+
*/
|
|
885
|
+
titleHints?: TitleHints | undefined;
|
|
783
886
|
}
|
|
784
887
|
interface CodingSessionsEngine extends CodingSessionsApi {
|
|
785
888
|
subscribe(listener: (event: CodingEvent) => void): () => void;
|
|
889
|
+
/** Where the providers keep their sessions, learned after start (Matrx 2: Codex homes from its core). */
|
|
890
|
+
setHomes(homes: ProviderHomes): void;
|
|
786
891
|
/** Stop every live run and wait for the index to be written. */
|
|
787
892
|
dispose(): Promise<void>;
|
|
788
893
|
readonly dataDir: string;
|
|
@@ -799,4 +904,4 @@ interface CodingSessionsEngine extends CodingSessionsApi {
|
|
|
799
904
|
declare function describeProviderStatus(provider: CodingProvider, probe: Record<string, unknown> | undefined, lastProblem?: ProviderProblem | null, quota?: QuotaWindow[]): ProviderStatus;
|
|
800
905
|
declare function createCodingSessionsEngine(options?: CodingSessionsEngineOptions): Promise<CodingSessionsEngine>;
|
|
801
906
|
|
|
802
|
-
export {
|
|
907
|
+
export { findSessionFile as A, isAllowedEnvName as B, type CodingSessionsMethod as C, DEFAULT_SERVER_URL as D, EFFORT_LEVELS as E, listProcesses as F, readSessionFile as G, searchLocalChats as H, sessionActivity as I, snippetAround as J, titleHintKey as K, PreferenceStore as P, RAW_TRANSCRIPT_MAX_BYTES as R, type TitleHint as T, type CodingSessionsApi as a, type CodingEvent as b, type CodingSessionsEngine as c, type CodingSessionsEngineOptions as d, type CodingSessionsAgentsOptions as e, type CodexHome as f, DEFAULT_SUPABASE_URL as g, type ProviderHomes as h, type RawBackupPolicy as i, type RawBackupSink as j, type RunStatus as k, type TitleHints as l, buildCleanEnv as m, claudeDefaults as n, codexDefaults as o, codexHome as p, createAiMatrxRawBackupSink as q, createCodingSessionsEngine as r, createRawBackupScheduler as s, createTitleHintsStore as t, defaultProviderHomes as u, describeActivity as v, describeProviderStatus as w, discoverLocalSessions as x, endsWithOpenToolCall as y, findDrivingProcess as z };
|
|
@@ -2,6 +2,10 @@ import { JsonValue } from '@ai-matrx/agents/portable';
|
|
|
2
2
|
import { CredentialsPort } from '@ai-matrx/data';
|
|
3
3
|
import { McpHttpReply } from '@ai-matrx/agents/portable/mcp';
|
|
4
4
|
|
|
5
|
+
/** Where a title came from, strongest first. */
|
|
6
|
+
declare const TITLE_PRECEDENCE: readonly ["override", "app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"];
|
|
7
|
+
type TitleSource = (typeof TITLE_PRECEDENCE)[number];
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* The public contract of `@ai-matrx/coding-sessions`, shared by the engine
|
|
7
11
|
* (Node), the local host (Node) and the UI (browser). Pure types — nothing here
|
|
@@ -129,7 +133,22 @@ interface DiscoveredSession {
|
|
|
129
133
|
provider: CodingProvider;
|
|
130
134
|
providerSessionId: string;
|
|
131
135
|
cwd: string | null;
|
|
136
|
+
/**
|
|
137
|
+
* The chat's own title by the one rule (`./sessions`): the coding app's title when the owner of
|
|
138
|
+
* the apps' index supplied it (title hints), else the transcript's. Never the person's rename —
|
|
139
|
+
* that is applied once, by the screen, from the preferences.
|
|
140
|
+
*/
|
|
132
141
|
title: string;
|
|
142
|
+
/** Where `title` came from (`TITLE_PRECEDENCE`). */
|
|
143
|
+
titleSource?: TitleSource | "unknown" | undefined;
|
|
144
|
+
/** The app's title is still on its way (hints not loaded yet); `title` is the transcript's for now. */
|
|
145
|
+
titlePending?: boolean | undefined;
|
|
146
|
+
/** Archived in the app (hidden by default, like Code › Chats). */
|
|
147
|
+
archived?: boolean | undefined;
|
|
148
|
+
/** A scheduled or automated run (hidden by default). */
|
|
149
|
+
scheduled?: boolean | undefined;
|
|
150
|
+
/** The app lists it but its conversation file is gone: why. Shown, cannot be taken over. */
|
|
151
|
+
unavailable?: string | null | undefined;
|
|
133
152
|
updatedAt: string;
|
|
134
153
|
/** Where it was started, when the provider records it ("cli", "vscode", "exec", …). */
|
|
135
154
|
source: string | null;
|
|
@@ -244,6 +263,11 @@ type TranscriptItem = {
|
|
|
244
263
|
id: string;
|
|
245
264
|
text: string;
|
|
246
265
|
};
|
|
266
|
+
interface TitleStatus {
|
|
267
|
+
owner: boolean;
|
|
268
|
+
pending: boolean;
|
|
269
|
+
problem: string | null;
|
|
270
|
+
}
|
|
247
271
|
/** Everything the engine pushes to a listener. */
|
|
248
272
|
type CodingEvent = {
|
|
249
273
|
type: "session";
|
|
@@ -254,6 +278,10 @@ type CodingEvent = {
|
|
|
254
278
|
} | {
|
|
255
279
|
type: "preferences";
|
|
256
280
|
preferences: Record<string, ChatPreference>;
|
|
281
|
+
}
|
|
282
|
+
/** The apps' titles changed (or finished loading): re-read the discovered chats. */
|
|
283
|
+
| {
|
|
284
|
+
type: "titles";
|
|
257
285
|
} | {
|
|
258
286
|
type: "item";
|
|
259
287
|
sessionId: string;
|
|
@@ -409,6 +437,10 @@ interface CodingSessionsApi {
|
|
|
409
437
|
discoverSessions(options?: {
|
|
410
438
|
limit?: number;
|
|
411
439
|
}): Promise<DiscoveredSession[]>;
|
|
440
|
+
/** Where the apps' own titles stand: an owner supplies them (`owner`), still loading, or failing (`problem`, shown with Retry). */
|
|
441
|
+
titleStatus(): Promise<TitleStatus>;
|
|
442
|
+
/** Ask the owner of the apps' titles again (the Retry). */
|
|
443
|
+
retryTitles(): Promise<void>;
|
|
412
444
|
recentFolders(): Promise<RecentFolder[]>;
|
|
413
445
|
listSessions(): Promise<CodingSession[]>;
|
|
414
446
|
listRuns(sessionId: string): Promise<RunRecord[]>;
|
|
@@ -573,17 +605,34 @@ declare const DEFAULT_SUPABASE_URL = "https://db.matrxserver.com";
|
|
|
573
605
|
* few newest, and a transcript read is capped with the cap announced.
|
|
574
606
|
*/
|
|
575
607
|
|
|
608
|
+
interface CodexHome {
|
|
609
|
+
/** `<CODEX_HOME>/sessions` (dated folders of rollouts). */
|
|
610
|
+
sessions: string;
|
|
611
|
+
/** `<CODEX_HOME>/archived_sessions` (rollouts Codex archived; flat). */
|
|
612
|
+
archived: string;
|
|
613
|
+
/** `<CODEX_HOME>/session_index.jsonl` (the app's thread names). */
|
|
614
|
+
index: string;
|
|
615
|
+
}
|
|
576
616
|
interface ProviderHomes {
|
|
577
617
|
claudeProjects: string;
|
|
578
|
-
|
|
579
|
-
|
|
618
|
+
/** The claude-accounts holder's copies (`<vault>/<id>/transcript.jsonl`): a held chat's history when its own file is gone. */
|
|
619
|
+
claudeVault?: string | undefined;
|
|
620
|
+
/** Every Codex home to read (main first). The owner of the apps' index names them (Matrx 2: the Codex source's homes). */
|
|
621
|
+
codex: CodexHome[];
|
|
580
622
|
}
|
|
623
|
+
declare function codexHome(dir: string): CodexHome;
|
|
581
624
|
declare function defaultProviderHomes(home?: string): ProviderHomes;
|
|
582
625
|
interface DiscoverOptions {
|
|
583
626
|
limit?: number | undefined;
|
|
584
627
|
homes?: ProviderHomes | undefined;
|
|
585
628
|
/** Processes that are OUR runs (never "live elsewhere"). */
|
|
586
629
|
excludePids?: ReadonlySet<number> | undefined;
|
|
630
|
+
/**
|
|
631
|
+
* The apps' own titles from the owner of their index (`provider:id` → title). Given → the apps'
|
|
632
|
+
* files are not read here at all (Codex thread names come from it); absent → the standalone host
|
|
633
|
+
* reads Codex's `session_index.jsonl` itself.
|
|
634
|
+
*/
|
|
635
|
+
appTitles?: ReadonlyMap<string, string> | undefined;
|
|
587
636
|
}
|
|
588
637
|
/** Fresh "is it live elsewhere?" for one session (the preview and the takeover confirm). */
|
|
589
638
|
declare function sessionActivity(provider: CodingProvider, providerSessionId: string, options?: {
|
|
@@ -601,6 +650,46 @@ declare function findSessionFile(provider: CodingProvider, providerSessionId: st
|
|
|
601
650
|
*/
|
|
602
651
|
declare function readSessionFile(provider: CodingProvider, file: string, endOffset?: number | undefined, maxBytes?: number): Promise<SessionHistory>;
|
|
603
652
|
|
|
653
|
+
/**
|
|
654
|
+
* TITLE HINTS — the port through which the owner of the coding apps' index (Matrx 2's core, which
|
|
655
|
+
* reads Claude's records, Codex's database and the rest through its own `fs`/`exec` owners) tells
|
|
656
|
+
* this package what each chat is called and whether the app hides it. The package never walks the
|
|
657
|
+
* apps' records itself: it reads transcripts (titles by the transcript rules, content search,
|
|
658
|
+
* activity) and overlays these hints as they arrive. Pure: browser-safe types and helpers.
|
|
659
|
+
*/
|
|
660
|
+
|
|
661
|
+
type HintProvider = "claude" | "codex";
|
|
662
|
+
interface TitleHint {
|
|
663
|
+
/** The app's title (pre-override: the person's rename is applied by whoever draws the row). */
|
|
664
|
+
title: string;
|
|
665
|
+
/** Where the owner's title came from; "unknown" when the owner did not say (shown as such, never guessed). */
|
|
666
|
+
source: TitleSource | "unknown";
|
|
667
|
+
/** The app hides it: archived in the app (shown behind a toggle). */
|
|
668
|
+
archived?: boolean | undefined;
|
|
669
|
+
/** A scheduled or automated run (shown behind a toggle). */
|
|
670
|
+
scheduled?: boolean | undefined;
|
|
671
|
+
/** Listed by the app but its conversation file is gone: why (it is shown, never dropped). */
|
|
672
|
+
unavailable?: string | null | undefined;
|
|
673
|
+
/** Last activity the app records (ms), for chats only the app knows. */
|
|
674
|
+
lastActiveMs?: number | null | undefined;
|
|
675
|
+
}
|
|
676
|
+
interface TitleHints {
|
|
677
|
+
/** The hints now, keyed `titleHintKey()`; null while the owner's index is still loading. Never waits. */
|
|
678
|
+
current(): ReadonlyMap<string, TitleHint> | null;
|
|
679
|
+
/** Called after the hints change (a rename in the app, a new chat, the first load, a failure). */
|
|
680
|
+
subscribe(listener: () => void): () => void;
|
|
681
|
+
/** Why the apps' titles could not be had right now (shown with a Retry), or null. */
|
|
682
|
+
problem?(): string | null;
|
|
683
|
+
/** Ask the owner again now (the Retry). */
|
|
684
|
+
retry?(): void;
|
|
685
|
+
}
|
|
686
|
+
declare function titleHintKey(provider: HintProvider, sessionId: string): string;
|
|
687
|
+
/** A hints port the host fills by hand (tests, or an owner that pushes whole snapshots). */
|
|
688
|
+
declare function createTitleHintsStore(): TitleHints & {
|
|
689
|
+
set(hints: ReadonlyMap<string, TitleHint> | null): void;
|
|
690
|
+
setProblem(problem: string | null): void;
|
|
691
|
+
};
|
|
692
|
+
|
|
604
693
|
/**
|
|
605
694
|
* THE CLEAN ENVIRONMENT — built from an ALLOWLIST, never a denylist.
|
|
606
695
|
*
|
|
@@ -682,6 +771,8 @@ interface SearchOptions {
|
|
|
682
771
|
homes?: ProviderHomes | undefined;
|
|
683
772
|
cursor?: number | undefined;
|
|
684
773
|
limit?: number | undefined;
|
|
774
|
+
/** The apps' own titles (`provider:id` → title) from the owner of their index; absent → Codex's index is read here. */
|
|
775
|
+
appTitles?: ReadonlyMap<string, string> | undefined;
|
|
685
776
|
/** Stop reading after this long and hand back a cursor. Default 3.5 s. */
|
|
686
777
|
budgetMs?: number | undefined;
|
|
687
778
|
}
|
|
@@ -724,6 +815,12 @@ declare class PreferenceStore {
|
|
|
724
815
|
get(key: string): ChatPreference | null;
|
|
725
816
|
/** Merge `patch`; a null/false/empty field is removed, an empty preference deleted. */
|
|
726
817
|
set(key: string, patch: ChatPreference): Record<string, ChatPreference>;
|
|
818
|
+
/**
|
|
819
|
+
* Move a preference to the chat's lasting key (`session:<id>` → `<provider>:<id>` once the
|
|
820
|
+
* provider's id is known), so a rename made early is the one rename everywhere. A preference
|
|
821
|
+
* already under the lasting key wins field by field.
|
|
822
|
+
*/
|
|
823
|
+
rekey(from: string, to: string): boolean;
|
|
727
824
|
private persist;
|
|
728
825
|
flush(): Promise<void>;
|
|
729
826
|
}
|
|
@@ -780,9 +877,17 @@ interface CodingSessionsEngineOptions {
|
|
|
780
877
|
* are unaffected.
|
|
781
878
|
*/
|
|
782
879
|
agents?: CodingSessionsAgentsOptions | undefined;
|
|
880
|
+
/**
|
|
881
|
+
* What the coding apps' own records say each chat is called (and archived / scheduled / file
|
|
882
|
+
* gone), from the owner of the apps' index — Matrx 2's core. Never waited for; absent → titles
|
|
883
|
+
* come from the transcripts alone (the standalone host).
|
|
884
|
+
*/
|
|
885
|
+
titleHints?: TitleHints | undefined;
|
|
783
886
|
}
|
|
784
887
|
interface CodingSessionsEngine extends CodingSessionsApi {
|
|
785
888
|
subscribe(listener: (event: CodingEvent) => void): () => void;
|
|
889
|
+
/** Where the providers keep their sessions, learned after start (Matrx 2: Codex homes from its core). */
|
|
890
|
+
setHomes(homes: ProviderHomes): void;
|
|
786
891
|
/** Stop every live run and wait for the index to be written. */
|
|
787
892
|
dispose(): Promise<void>;
|
|
788
893
|
readonly dataDir: string;
|
|
@@ -799,4 +904,4 @@ interface CodingSessionsEngine extends CodingSessionsApi {
|
|
|
799
904
|
declare function describeProviderStatus(provider: CodingProvider, probe: Record<string, unknown> | undefined, lastProblem?: ProviderProblem | null, quota?: QuotaWindow[]): ProviderStatus;
|
|
800
905
|
declare function createCodingSessionsEngine(options?: CodingSessionsEngineOptions): Promise<CodingSessionsEngine>;
|
|
801
906
|
|
|
802
|
-
export {
|
|
907
|
+
export { findSessionFile as A, isAllowedEnvName as B, type CodingSessionsMethod as C, DEFAULT_SERVER_URL as D, EFFORT_LEVELS as E, listProcesses as F, readSessionFile as G, searchLocalChats as H, sessionActivity as I, snippetAround as J, titleHintKey as K, PreferenceStore as P, RAW_TRANSCRIPT_MAX_BYTES as R, type TitleHint as T, type CodingSessionsApi as a, type CodingEvent as b, type CodingSessionsEngine as c, type CodingSessionsEngineOptions as d, type CodingSessionsAgentsOptions as e, type CodexHome as f, DEFAULT_SUPABASE_URL as g, type ProviderHomes as h, type RawBackupPolicy as i, type RawBackupSink as j, type RunStatus as k, type TitleHints as l, buildCleanEnv as m, claudeDefaults as n, codexDefaults as o, codexHome as p, createAiMatrxRawBackupSink as q, createCodingSessionsEngine as r, createRawBackupScheduler as s, createTitleHintsStore as t, defaultProviderHomes as u, describeActivity as v, describeProviderStatus as w, discoverLocalSessions as x, endsWithOpenToolCall as y, findDrivingProcess as z };
|