@yitom/agy-acp-map 0.1.7 → 0.1.8

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.
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/agy-acp-win-x64.exe
3
- size: 86638080 bytes
4
- sha256: 4b22437f28bb0b65797110f6b47623dfaf8c98dea06593cb1cc4a0769c2c9d80
3
+ size: 86638592 bytes
4
+ sha256: 04f1c91b9f04b9971c5054925401246c5e2ce70cb34f2c0668ca1527a4f91930
Binary file
package/dist/bin.js CHANGED
@@ -12451,6 +12451,14 @@ class SessionHistoryStore {
12451
12451
  fs7.appendFileSync(this.filePath(sessionId), payload, "utf8");
12452
12452
  }
12453
12453
  read(sessionId) {
12454
+ return this.readUpTo(sessionId, Infinity);
12455
+ }
12456
+ firstUserText(sessionId) {
12457
+ const records = this.readUpTo(sessionId, 50);
12458
+ const first = records.find((r) => r.role === "user" && r.text.trim());
12459
+ return first ? first.text : null;
12460
+ }
12461
+ readUpTo(sessionId, maxLines) {
12454
12462
  const file = this.filePath(sessionId);
12455
12463
  if (!fs7.existsSync(file))
12456
12464
  return [];
@@ -12461,9 +12469,12 @@ class SessionHistoryStore {
12461
12469
  return [];
12462
12470
  }
12463
12471
  const records = [];
12472
+ let lines = 0;
12464
12473
  for (const line of raw.split(/\r?\n/)) {
12465
12474
  if (!line.trim())
12466
12475
  continue;
12476
+ if (++lines > maxLines)
12477
+ break;
12467
12478
  try {
12468
12479
  const parsed = JSON.parse(line);
12469
12480
  if (isRecord2(parsed) && parsed.sessionId === sessionId) {
@@ -12488,7 +12499,7 @@ class SessionHistoryStore {
12488
12499
  var AGENT_INFO = {
12489
12500
  name: "agy-acp",
12490
12501
  title: "agy ACP (stream-json)",
12491
- version: "0.1.7"
12502
+ version: "0.1.8"
12492
12503
  };
12493
12504
  var BRIDGE_CAPABILITIES = {
12494
12505
  prompt: true,
@@ -12967,6 +12978,13 @@ class AgySessionCore {
12967
12978
  }
12968
12979
  const discovery = await this.getDiscovery();
12969
12980
  this.applyCatalogDefaults(session, discovery);
12981
+ if (!session.title) {
12982
+ try {
12983
+ const first = this.historyStore.firstUserText(sessionId);
12984
+ if (first && first.trim())
12985
+ session.title = deriveTitle(first);
12986
+ } catch {}
12987
+ }
12970
12988
  this.persistSession(session);
12971
12989
  if (opts?.warmup !== false) {
12972
12990
  this.warmupSession(sessionId);
package/dist/index.js CHANGED
@@ -12238,6 +12238,14 @@ class SessionHistoryStore {
12238
12238
  fs7.appendFileSync(this.filePath(sessionId), payload, "utf8");
12239
12239
  }
12240
12240
  read(sessionId) {
12241
+ return this.readUpTo(sessionId, Infinity);
12242
+ }
12243
+ firstUserText(sessionId) {
12244
+ const records = this.readUpTo(sessionId, 50);
12245
+ const first = records.find((r) => r.role === "user" && r.text.trim());
12246
+ return first ? first.text : null;
12247
+ }
12248
+ readUpTo(sessionId, maxLines) {
12241
12249
  const file = this.filePath(sessionId);
12242
12250
  if (!fs7.existsSync(file))
12243
12251
  return [];
@@ -12248,9 +12256,12 @@ class SessionHistoryStore {
12248
12256
  return [];
12249
12257
  }
12250
12258
  const records = [];
12259
+ let lines = 0;
12251
12260
  for (const line of raw.split(/\r?\n/)) {
12252
12261
  if (!line.trim())
12253
12262
  continue;
12263
+ if (++lines > maxLines)
12264
+ break;
12254
12265
  try {
12255
12266
  const parsed = JSON.parse(line);
12256
12267
  if (isRecord2(parsed) && parsed.sessionId === sessionId) {
@@ -12275,7 +12286,7 @@ class SessionHistoryStore {
12275
12286
  var AGENT_INFO = {
12276
12287
  name: "agy-acp",
12277
12288
  title: "agy ACP (stream-json)",
12278
- version: "0.1.7"
12289
+ version: "0.1.8"
12279
12290
  };
12280
12291
  var BRIDGE_CAPABILITIES = {
12281
12292
  prompt: true,
@@ -12767,6 +12778,13 @@ class AgySessionCore {
12767
12778
  }
12768
12779
  const discovery = await this.getDiscovery();
12769
12780
  this.applyCatalogDefaults(session, discovery);
12781
+ if (!session.title) {
12782
+ try {
12783
+ const first = this.historyStore.firstUserText(sessionId);
12784
+ if (first && first.trim())
12785
+ session.title = deriveTitle(first);
12786
+ } catch {}
12787
+ }
12770
12788
  this.persistSession(session);
12771
12789
  if (opts?.warmup !== false) {
12772
12790
  this.warmupSession(sessionId);
@@ -29,5 +29,11 @@ export declare class SessionHistoryStore {
29
29
  appendTurn(sessionId: string, userText: string, assistantText?: string): void;
30
30
  /** Read valid records and ignore incomplete/corrupt trailing lines. */
31
31
  read(sessionId: string): SessionHistoryRecord[];
32
+ /**
33
+ * First user prompt text for backfilling list titles. Stops at the first
34
+ * valid user record instead of parsing the whole journal.
35
+ */
36
+ firstUserText(sessionId: string): string | null;
37
+ private readUpTo;
32
38
  delete(sessionId: string): void;
33
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yitom/agy-acp-map",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },