@staff0rd/assist 0.477.0 → 0.479.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/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.477.0",
9
+ version: "0.479.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -28568,20 +28568,29 @@ function buildPrompt3(prompt) {
28568
28568
  }
28569
28569
 
28570
28570
  // src/commands/sessions/daemon/runSessionTitleGeneration.ts
28571
- function runSessionTitleGeneration(session, prompt, notify2) {
28571
+ function runSessionTitleGeneration(session, prompt, notify2, fallback) {
28572
28572
  if (session.generatedTitle || session.titleGenerationStarted) return;
28573
28573
  session.titleGenerationStarted = true;
28574
28574
  void generateSessionTitle(prompt).then((generated) => {
28575
- session.generatedTitle = generated ?? singleLine(prompt);
28575
+ const title = generated ?? fallback;
28576
+ if (!title) {
28577
+ daemonLog(
28578
+ `session ${session.id} title generation failed; keeping placeholder title`
28579
+ );
28580
+ return;
28581
+ }
28582
+ session.generatedTitle = title;
28576
28583
  daemonLog(
28577
- generated ? `session ${session.id} generated title: ${generated}` : `session ${session.id} title generation failed; falling back to "${session.generatedTitle}"`
28584
+ generated ? `session ${session.id} generated title: ${generated}` : `session ${session.id} title generation failed; falling back to "${title}"`
28578
28585
  );
28579
28586
  notify2();
28580
28587
  }).catch((error) => {
28581
28588
  daemonLog(`session ${session.id} title generation errored: ${error}`);
28582
28589
  });
28583
28590
  }
28584
- function singleLine(prompt) {
28591
+
28592
+ // src/commands/sessions/daemon/singleLineTitle.ts
28593
+ function singleLineTitle(prompt) {
28585
28594
  return prompt.replace(/\s+/g, " ").trim().slice(0, SESSION_TITLE_MAX_LENGTH);
28586
28595
  }
28587
28596
 
@@ -28591,7 +28600,7 @@ function startSessionTitleGeneration(session, notify2) {
28591
28600
  return;
28592
28601
  const prompt = sessionTitlePrompt(session);
28593
28602
  if (!prompt) return;
28594
- runSessionTitleGeneration(session, prompt, notify2);
28603
+ runSessionTitleGeneration(session, prompt, notify2, singleLineTitle(prompt));
28595
28604
  }
28596
28605
 
28597
28606
  // src/commands/sessions/daemon/emitSessionOutput.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.477.0",
3
+ "version": "0.479.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {