@ai-matrx/coding-sessions 0.2.0 → 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.
Files changed (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/engine/index.cjs +54 -10
  3. package/dist/engine/index.cjs.map +1 -1
  4. package/dist/engine/index.d.cts +1 -1
  5. package/dist/engine/index.d.ts +1 -1
  6. package/dist/engine/index.js +54 -10
  7. package/dist/engine/index.js.map +1 -1
  8. package/dist/{index-29t7n472.d.cts → index-Bbe11HoB.d.cts} +30 -3
  9. package/dist/{index-29t7n472.d.ts → index-Bbe11HoB.d.ts} +30 -3
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +12 -3
  12. package/dist/index.d.ts +12 -3
  13. package/dist/index.js.map +1 -1
  14. package/dist/react/index.cjs +34 -5
  15. package/dist/react/index.cjs.map +1 -1
  16. package/dist/react/index.d.cts +15 -1
  17. package/dist/react/index.d.ts +15 -1
  18. package/dist/react/index.js +34 -5
  19. package/dist/react/index.js.map +1 -1
  20. package/dist/server/index.cjs +44 -9
  21. package/dist/server/index.cjs.map +1 -1
  22. package/dist/server/index.d.cts +2 -2
  23. package/dist/server/index.d.ts +2 -2
  24. package/dist/server/index.js +44 -9
  25. package/dist/server/index.js.map +1 -1
  26. package/dist/sessions/index.cjs +26 -1
  27. package/dist/sessions/index.cjs.map +1 -1
  28. package/dist/sessions/index.d.cts +13 -5
  29. package/dist/sessions/index.d.ts +13 -5
  30. package/dist/sessions/index.js +26 -1
  31. package/dist/sessions/index.js.map +1 -1
  32. package/dist/{titles-eCnA5sY7.d.cts → titles-DjxUb0ji.d.cts} +8 -1
  33. package/dist/{titles-eCnA5sY7.d.ts → titles-DjxUb0ji.d.ts} +8 -1
  34. package/dist/ui/assets/index-BqzTnRFe.css +2 -0
  35. package/dist/ui/assets/{index-SuRr0-D2.js → index-U98AY8r-.js} +17 -17
  36. package/dist/ui/index.html +2 -2
  37. package/package.json +3 -3
  38. package/dist/ui/assets/index-BqpVx_My.css +0 -2
@@ -140,7 +140,7 @@ interface DiscoveredSession {
140
140
  */
141
141
  title: string;
142
142
  /** Where `title` came from (`TITLE_PRECEDENCE`). */
143
- titleSource?: TitleSource | undefined;
143
+ titleSource?: TitleSource | "unknown" | undefined;
144
144
  /** The app's title is still on its way (hints not loaded yet); `title` is the transcript's for now. */
145
145
  titlePending?: boolean | undefined;
146
146
  /** Archived in the app (hidden by default, like Code › Chats). */
@@ -263,6 +263,11 @@ type TranscriptItem = {
263
263
  id: string;
264
264
  text: string;
265
265
  };
266
+ interface TitleStatus {
267
+ owner: boolean;
268
+ pending: boolean;
269
+ problem: string | null;
270
+ }
266
271
  /** Everything the engine pushes to a listener. */
267
272
  type CodingEvent = {
268
273
  type: "session";
@@ -432,6 +437,10 @@ interface CodingSessionsApi {
432
437
  discoverSessions(options?: {
433
438
  limit?: number;
434
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>;
435
444
  recentFolders(): Promise<RecentFolder[]>;
436
445
  listSessions(): Promise<CodingSession[]>;
437
446
  listRuns(sessionId: string): Promise<RunRecord[]>;
@@ -606,6 +615,8 @@ interface CodexHome {
606
615
  }
607
616
  interface ProviderHomes {
608
617
  claudeProjects: string;
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;
609
620
  /** Every Codex home to read (main first). The owner of the apps' index names them (Matrx 2: the Codex source's homes). */
610
621
  codex: CodexHome[];
611
622
  }
@@ -616,6 +627,12 @@ interface DiscoverOptions {
616
627
  homes?: ProviderHomes | undefined;
617
628
  /** Processes that are OUR runs (never "live elsewhere"). */
618
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;
619
636
  }
620
637
  /** Fresh "is it live elsewhere?" for one session (the preview and the takeover confirm). */
621
638
  declare function sessionActivity(provider: CodingProvider, providerSessionId: string, options?: {
@@ -645,7 +662,8 @@ type HintProvider = "claude" | "codex";
645
662
  interface TitleHint {
646
663
  /** The app's title (pre-override: the person's rename is applied by whoever draws the row). */
647
664
  title: string;
648
- source: TitleSource;
665
+ /** Where the owner's title came from; "unknown" when the owner did not say (shown as such, never guessed). */
666
+ source: TitleSource | "unknown";
649
667
  /** The app hides it: archived in the app (shown behind a toggle). */
650
668
  archived?: boolean | undefined;
651
669
  /** A scheduled or automated run (shown behind a toggle). */
@@ -658,13 +676,18 @@ interface TitleHint {
658
676
  interface TitleHints {
659
677
  /** The hints now, keyed `titleHintKey()`; null while the owner's index is still loading. Never waits. */
660
678
  current(): ReadonlyMap<string, TitleHint> | null;
661
- /** Called after the hints change (a rename in the app, a new chat, the first load). */
679
+ /** Called after the hints change (a rename in the app, a new chat, the first load, a failure). */
662
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;
663
685
  }
664
686
  declare function titleHintKey(provider: HintProvider, sessionId: string): string;
665
687
  /** A hints port the host fills by hand (tests, or an owner that pushes whole snapshots). */
666
688
  declare function createTitleHintsStore(): TitleHints & {
667
689
  set(hints: ReadonlyMap<string, TitleHint> | null): void;
690
+ setProblem(problem: string | null): void;
668
691
  };
669
692
 
670
693
  /**
@@ -748,6 +771,8 @@ interface SearchOptions {
748
771
  homes?: ProviderHomes | undefined;
749
772
  cursor?: number | undefined;
750
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;
751
776
  /** Stop reading after this long and hand back a cursor. Default 3.5 s. */
752
777
  budgetMs?: number | undefined;
753
778
  }
@@ -861,6 +886,8 @@ interface CodingSessionsEngineOptions {
861
886
  }
862
887
  interface CodingSessionsEngine extends CodingSessionsApi {
863
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;
864
891
  /** Stop every live run and wait for the index to be written. */
865
892
  dispose(): Promise<void>;
866
893
  readonly dataDir: string;
@@ -140,7 +140,7 @@ interface DiscoveredSession {
140
140
  */
141
141
  title: string;
142
142
  /** Where `title` came from (`TITLE_PRECEDENCE`). */
143
- titleSource?: TitleSource | undefined;
143
+ titleSource?: TitleSource | "unknown" | undefined;
144
144
  /** The app's title is still on its way (hints not loaded yet); `title` is the transcript's for now. */
145
145
  titlePending?: boolean | undefined;
146
146
  /** Archived in the app (hidden by default, like Code › Chats). */
@@ -263,6 +263,11 @@ type TranscriptItem = {
263
263
  id: string;
264
264
  text: string;
265
265
  };
266
+ interface TitleStatus {
267
+ owner: boolean;
268
+ pending: boolean;
269
+ problem: string | null;
270
+ }
266
271
  /** Everything the engine pushes to a listener. */
267
272
  type CodingEvent = {
268
273
  type: "session";
@@ -432,6 +437,10 @@ interface CodingSessionsApi {
432
437
  discoverSessions(options?: {
433
438
  limit?: number;
434
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>;
435
444
  recentFolders(): Promise<RecentFolder[]>;
436
445
  listSessions(): Promise<CodingSession[]>;
437
446
  listRuns(sessionId: string): Promise<RunRecord[]>;
@@ -606,6 +615,8 @@ interface CodexHome {
606
615
  }
607
616
  interface ProviderHomes {
608
617
  claudeProjects: string;
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;
609
620
  /** Every Codex home to read (main first). The owner of the apps' index names them (Matrx 2: the Codex source's homes). */
610
621
  codex: CodexHome[];
611
622
  }
@@ -616,6 +627,12 @@ interface DiscoverOptions {
616
627
  homes?: ProviderHomes | undefined;
617
628
  /** Processes that are OUR runs (never "live elsewhere"). */
618
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;
619
636
  }
620
637
  /** Fresh "is it live elsewhere?" for one session (the preview and the takeover confirm). */
621
638
  declare function sessionActivity(provider: CodingProvider, providerSessionId: string, options?: {
@@ -645,7 +662,8 @@ type HintProvider = "claude" | "codex";
645
662
  interface TitleHint {
646
663
  /** The app's title (pre-override: the person's rename is applied by whoever draws the row). */
647
664
  title: string;
648
- source: TitleSource;
665
+ /** Where the owner's title came from; "unknown" when the owner did not say (shown as such, never guessed). */
666
+ source: TitleSource | "unknown";
649
667
  /** The app hides it: archived in the app (shown behind a toggle). */
650
668
  archived?: boolean | undefined;
651
669
  /** A scheduled or automated run (shown behind a toggle). */
@@ -658,13 +676,18 @@ interface TitleHint {
658
676
  interface TitleHints {
659
677
  /** The hints now, keyed `titleHintKey()`; null while the owner's index is still loading. Never waits. */
660
678
  current(): ReadonlyMap<string, TitleHint> | null;
661
- /** Called after the hints change (a rename in the app, a new chat, the first load). */
679
+ /** Called after the hints change (a rename in the app, a new chat, the first load, a failure). */
662
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;
663
685
  }
664
686
  declare function titleHintKey(provider: HintProvider, sessionId: string): string;
665
687
  /** A hints port the host fills by hand (tests, or an owner that pushes whole snapshots). */
666
688
  declare function createTitleHintsStore(): TitleHints & {
667
689
  set(hints: ReadonlyMap<string, TitleHint> | null): void;
690
+ setProblem(problem: string | null): void;
668
691
  };
669
692
 
670
693
  /**
@@ -748,6 +771,8 @@ interface SearchOptions {
748
771
  homes?: ProviderHomes | undefined;
749
772
  cursor?: number | undefined;
750
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;
751
776
  /** Stop reading after this long and hand back a cursor. Default 3.5 s. */
752
777
  budgetMs?: number | undefined;
753
778
  }
@@ -861,6 +886,8 @@ interface CodingSessionsEngineOptions {
861
886
  }
862
887
  interface CodingSessionsEngine extends CodingSessionsApi {
863
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;
864
891
  /** Stop every live run and wait for the index to be written. */
865
892
  dispose(): Promise<void>;
866
893
  readonly dataDir: string;