@henryqw/pi-herdr-rename 2.1.8 → 2.1.9

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/README.md CHANGED
@@ -30,7 +30,7 @@ Requires Pi Coding Agent 0.84.3+.
30
30
 
31
31
  First real user prompt generates a title in the background after Pi expands skill and prompt-template shorthand. It does not delay main reply. Extension-injected prompts, empty prompts, and image-only input are ignored.
32
32
 
33
- Shared [`pi-task-models` config](../pi-task-models#config) at `~/.pi/agent/config/pi-task-models.json` routes task `pi-herdr-rename/rename` to the `fast` profile by default.
33
+ Shared [`pi-task-models` config](../pi-task-models#config) at `~/.pi/agent/config/pi-task-models.json` can explicitly override the local `pi-herdr-rename/rename` declaration, which defaults to `fast`.
34
34
 
35
35
  Display titles are natural task phrases, preferably three or four words and always at most four words and 20 characters. Model classification stays internal: `refactor: update task logic` displays as `Update task logic` and maps to Git branch `refactor/update-task-logic`.
36
36
 
@@ -6,7 +6,9 @@ import {
6
6
  import { createHerdrClient, withWorktreeLock } from "@henryqw/pi-herdr";
7
7
  import {
8
8
  readTaskModelsConfig,
9
+ registerModelTask,
9
10
  resolveConfiguredTaskRoutes,
11
+ type ModelTask,
10
12
  type ResolvedTaskRoute,
11
13
  type TaskRouteError,
12
14
  } from "@henryqw/pi-task-models";
@@ -18,7 +20,12 @@ const MAX_CONTEXT_CHARS = 2_000;
18
20
  const DISPLAY_MAX_WORDS = 4;
19
21
  const DISPLAY_MAX_CHARS = 20;
20
22
  const SEMANTIC_TYPE_MAX_CHARS = 12;
21
- const RENAME_TASK = "pi-herdr-rename/rename";
23
+ export const RENAME_TASK = {
24
+ id: "pi-herdr-rename/rename",
25
+ label: "Conversation rename",
26
+ purpose: "Generate a short conversation title.",
27
+ defaultProfile: "fast",
28
+ } as const satisfies ModelTask;
22
29
  const TITLE_STATE_TYPE = "pi-herdr-rename/title";
23
30
  const HERDR_DEFAULT_WORKTREE_NAME = /^(?:worktree[-/])?(?:brave|calm|clear|green|lucky|quiet|rapid|silver)-(?:river|cloud|field|forest|harbor|meadow|stone|valley)-[0-9a-f]{4}$/;
24
31
  const SEMANTIC_BRANCH = /^[a-z][a-z0-9-]{0,11}\/[a-z0-9]+(?:-[a-z0-9]+)*$/;
@@ -207,6 +214,7 @@ async function generateTitle(text: string, ctx: ExtensionContext, signal: AbortS
207
214
  }
208
215
 
209
216
  export default function herdrRenameExtension(pi: ExtensionAPI): void {
217
+ registerModelTask(pi, RENAME_TASK);
210
218
  const herdr = createHerdrClient<{ signal: AbortSignal }>(pi.exec.bind(pi));
211
219
  let latestUserText: string | undefined;
212
220
  let automaticStarted = false;
@@ -342,7 +350,7 @@ export default function herdrRenameExtension(pi: ExtensionAPI): void {
342
350
  latestUserText = latestSessionUserText(ctx);
343
351
  try {
344
352
  const taskModels = readTaskModelsConfig();
345
- const profileName = taskModels.tasks[RENAME_TASK];
353
+ const profileName = taskModels.tasks[RENAME_TASK.id] ?? RENAME_TASK.defaultProfile;
346
354
  if (!taskModels.profiles[profileName]) {
347
355
  ctx.ui.notify(`Configure rename task profile ${profileName} with /task-models.`, "warning");
348
356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-herdr-rename",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "Generate short Pi display titles and rename the current Herdr location.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -45,6 +45,6 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@henryqw/pi-herdr": "^0.3.0",
48
- "@henryqw/pi-task-models": "^1.0.0"
48
+ "@henryqw/pi-task-models": "^3.0.0"
49
49
  }
50
50
  }