claude-task-worker 0.39.0 → 0.39.1

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 +7 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -523,6 +523,7 @@ __export(herdr_runner_exports, {
523
523
  startHerdrTask: () => startHerdrTask,
524
524
  stopHerdrTask: () => stopHerdrTask,
525
525
  taskTabLabel: () => taskTabLabel,
526
+ toAgentName: () => toAgentName,
526
527
  waitForHerdrTask: () => waitForHerdrTask
527
528
  });
528
529
  async function loadHerdr() {
@@ -531,6 +532,11 @@ async function loadHerdr() {
531
532
  function taskTabLabel(projectName, number) {
532
533
  return `ctw:${projectName}:#${number}`;
533
534
  }
535
+ function toAgentName(label) {
536
+ const sanitized = label.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-+/g, "-").replace(/^[-_]+/, "");
537
+ const withLeadingLetter = /^[a-z]/.test(sanitized) ? sanitized : `ctw-${sanitized}`;
538
+ return withLeadingLetter.slice(0, 32).replace(/[-_]+$/, "");
539
+ }
534
540
  function createCompletionTracker() {
535
541
  return { seenWorking: false, warnedBlocked: false };
536
542
  }
@@ -582,7 +588,7 @@ async function startHerdrTask({
582
588
  if (!ready) {
583
589
  console.warn(`[herdr-runner] pane ${paneId} produced no prompt before the timeout, launching anyway`);
584
590
  }
585
- await mod.agentStart(paneId, { name: label, args, readyTimeoutMs: timing?.agentStartReadyTimeoutMs });
591
+ await mod.agentStart(paneId, { name: toAgentName(label), args, readyTimeoutMs: timing?.agentStartReadyTimeoutMs });
586
592
  } catch (err) {
587
593
  await mod.tabClose(tabId).catch(() => {
588
594
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-task-worker",
3
- "version": "0.39.0",
3
+ "version": "0.39.1",
4
4
  "description": "CLI tool that polls GitHub Issues/PRs and delegates work to Claude CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",