@agentclientprotocol/codex-acp 2.2.1 → 2.2.2

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 (2) hide show
  1. package/dist/index.js +12 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -27917,13 +27917,19 @@ var ACPSessionConnection = class {
27917
27917
  // src/SessionTitle.ts
27918
27918
  var MAX_SESSION_TITLE_LENGTH = 256;
27919
27919
  function normalizeSessionTitle(title) {
27920
- const normalized = title?.replace(/\s+/g, " ").trim() ?? "";
27921
- if (normalized.length === 0) return null;
27922
- if (normalized.length <= MAX_SESSION_TITLE_LENGTH) return normalized;
27920
+ const normalized = collapseSessionTitle(title);
27921
+ if (normalized === null || normalized.length <= MAX_SESSION_TITLE_LENGTH) return normalized;
27923
27922
  let cut = normalized.slice(0, MAX_SESSION_TITLE_LENGTH - 1);
27924
27923
  if (/[\uD800-\uDBFF]$/.test(cut)) cut = cut.slice(0, -1);
27925
27924
  return `${cut.trimEnd()}\u2026`;
27926
27925
  }
27926
+ function listedSessionTitle(thread) {
27927
+ return collapseSessionTitle(thread.name) ?? collapseSessionTitle(thread.title) ?? collapseSessionTitle(thread.summary) ?? collapseSessionTitle(thread.preview);
27928
+ }
27929
+ function collapseSessionTitle(title) {
27930
+ const collapsed = title?.replace(/\s+/g, " ").trim() ?? "";
27931
+ return collapsed.length === 0 ? null : collapsed;
27932
+ }
27927
27933
 
27928
27934
  // src/TokenCount.ts
27929
27935
  function toTokenCount(usage) {
@@ -34372,7 +34378,7 @@ var package_default = {
34372
34378
  publishConfig: {
34373
34379
  access: "public"
34374
34380
  },
34375
- version: "2.2.1",
34381
+ version: "2.2.2",
34376
34382
  description: "",
34377
34383
  main: "dist/index.js",
34378
34384
  bin: {
@@ -35704,7 +35710,7 @@ var CodexAcpClient = class _CodexAcpClient {
35704
35710
  const mapThreadToSession = (thread) => ({
35705
35711
  sessionId: thread.id,
35706
35712
  cwd: thread.cwd,
35707
- title: normalizeSessionTitle(thread.name ?? thread.preview),
35713
+ title: listedSessionTitle(thread),
35708
35714
  updatedAt: new Date(thread.updatedAt * 1e3).toISOString()
35709
35715
  });
35710
35716
  let sessions = listResponse.data.map(mapThreadToSession);
@@ -40364,7 +40370,7 @@ function sessionIndexSessionInfo(thread, archived, activity) {
40364
40370
  return {
40365
40371
  sessionId: thread.id,
40366
40372
  cwd: thread.cwd,
40367
- title: normalizeSessionTitle(thread.name ?? thread.preview),
40373
+ title: listedSessionTitle(thread),
40368
40374
  // Codex moves `Thread.updatedAt` for every rollout write of the user or the agent: the last activity of any
40369
40375
  // kind. The list is ordered by `lastPromptAt ?? updatedAt` instead. Known deviation from #2161: Codex also
40370
40376
  // moves it on `thread/unarchive`, which sets the rollout mtime to now (thread-store unarchive_thread.rs).
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.2.1",
6
+ "version": "2.2.2",
7
7
  "description": "",
8
8
  "main": "dist/index.js",
9
9
  "bin": {