@agi-cli/server 0.1.127 → 0.1.128

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agi-cli/server",
3
- "version": "0.1.127",
3
+ "version": "0.1.128",
4
4
  "description": "HTTP API server for AGI CLI",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -29,8 +29,8 @@
29
29
  "typecheck": "tsc --noEmit"
30
30
  },
31
31
  "dependencies": {
32
- "@agi-cli/sdk": "0.1.127",
33
- "@agi-cli/database": "0.1.127",
32
+ "@agi-cli/sdk": "0.1.128",
33
+ "@agi-cli/database": "0.1.128",
34
34
  "drizzle-orm": "^0.44.5",
35
35
  "hono": "^4.9.9",
36
36
  "zod": "^4.1.8"
@@ -305,9 +305,10 @@ async function generateSessionTitle(args: {
305
305
  const promptText = String(content ?? '').slice(0, 2000);
306
306
 
307
307
  const titlePrompt = [
308
- "Create a short, descriptive session title from the user's request.",
309
- 'Max 6–8 words. No quotes. No trailing punctuation.',
310
- 'Avoid generic phrases like "help me"; be specific.',
308
+ 'Generate a brief title (6-8 words) summarizing what the user wants to do.',
309
+ 'Rules: Plain text only. No markdown, no quotes, no punctuation, no emojis.',
310
+ 'Focus on the core task or topic. Be specific but concise.',
311
+ 'Examples: "Fix TypeScript build errors", "Add dark mode toggle", "Refactor auth middleware"',
311
312
  ].join(' ');
312
313
 
313
314
  // Build system prompt and messages
@@ -409,8 +410,17 @@ async function generateSessionTitle(args: {
409
410
 
410
411
  function sanitizeTitle(raw: string): string {
411
412
  let s = raw.trim();
413
+ s = s.replace(/^#+\s*/, '');
414
+ s = s.replace(/\*\*([^*]+)\*\*/g, '$1');
415
+ s = s.replace(/\*([^*]+)\*/g, '$1');
416
+ s = s.replace(/__([^_]+)__/g, '$1');
417
+ s = s.replace(/_([^_]+)_/g, '$1');
418
+ s = s.replace(/`([^`]+)`/g, '$1');
419
+ s = s.replace(/~~([^~]+)~~/g, '$1');
420
+ s = s.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1');
412
421
  s = s.replace(/^["']|["']$/g, '');
413
- s = s.replace(/[.!?]+$/, '');
422
+ s = s.replace(/^[-–—•*]\s*/, '');
423
+ s = s.replace(/[.!?:;,]+$/, '');
414
424
  s = s.replace(/\s+/g, ' ');
415
425
  if (s.length > 80) s = s.slice(0, 80).trim();
416
426
  return s;
@@ -424,7 +434,7 @@ async function touchSessionLastActive(args: {
424
434
  try {
425
435
  await db
426
436
  .update(sessions)
427
- .set({ updatedAt: Date.now() })
437
+ .set({ lastActiveAt: Date.now() })
428
438
  .where(eq(sessions.id, sessionId))
429
439
  .run();
430
440
  } catch (err) {