u-foo 1.8.2 → 1.8.3

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": "u-foo",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "Multi-Agent Workspace Protocol. Just add u. claude → uclaude, codex → ucodex.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://ufoo.dev",
@@ -633,12 +633,9 @@ class AgentLauncher {
633
633
  const explicitNickname = this._originalNickname || "";
634
634
  if (this.agentType === "claude-code" && explicitNickname && wrapper.pty) {
635
635
  try {
636
- // Strip control chars to prevent PTY command injection
637
- const safeNick = explicitNickname.replace(/[\x00-\x1f\x7f]/g, "");
636
+ const safeNick = AgentLauncher._sanitizeNickname(explicitNickname);
638
637
  if (safeNick) {
639
- wrapper.write(`/rename ${safeNick}`);
640
- await new Promise((r) => setTimeout(r, 200));
641
- wrapper.write("\r");
638
+ wrapper.write(`/rename ${safeNick}\r`);
642
639
  await new Promise((r) => setTimeout(r, 400));
643
640
  }
644
641
  } catch (err) {
@@ -912,4 +909,8 @@ class AgentLauncher {
912
909
  }
913
910
  }
914
911
 
912
+ // Exported for testing
913
+ AgentLauncher._sanitizeNickname = (nick) => nick.replace(/[^a-zA-Z0-9_-]/g, "");
914
+ AgentLauncher._findPreviousSession = findPreviousSession;
915
+
915
916
  module.exports = AgentLauncher;