@join-pantheon/cli 0.33.7 → 0.33.8

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/cli.js CHANGED
@@ -44,7 +44,7 @@ import { recordedAgent, unattendedReadiness } from "./agents.js";
44
44
  import { pickupEstimate } from "./pickup.js";
45
45
  import { loadPolicy, requestReadinessRecheck, unsandboxedAllowed } from "./worker-policy.js";
46
46
  import { alreadyMemberLine, askedLine, configureLines, fetchSeats, inUseLine, offerSeats, seatsForTeam, seatsToMove, startGate, RECOVER_WAITING_EXIT } from "./recover-offer.js";
47
- import { shellArg, teamNameProblem } from "./team-name.js";
47
+ import { hyphenateSpaces, shellArg, teamNameProblem } from "./team-name.js";
48
48
  import { folderRefusalHere, isTemporaryRefusal, projectFolderAnswer } from "./folder-guard.js";
49
49
  import { installService, serviceInstalled, serviceLogFile, uninstallService } from "./service.js";
50
50
  import { LEGACY_TASK_NAME, hostAlive, hostFiles, readHostState, recordedTaskName } from "./win-host.js";
@@ -1499,8 +1499,14 @@ async function main() {
1499
1499
  }
1500
1500
  }
1501
1501
  }
1502
+ let createAs = flag("space");
1502
1503
  if (named && !localTeam && seatsKnown) {
1503
- const bad = teamNameProblem(named);
1504
+ const hyphened = hyphenateSpaces(named);
1505
+ if (hyphened !== named && !teamNameProblem(hyphened)) {
1506
+ console.error(D(` A team name can't have spaces, so "${named}" is created as "${hyphened}".\n`));
1507
+ createAs = hyphened;
1508
+ }
1509
+ const bad = teamNameProblem(createAs);
1504
1510
  if (bad)
1505
1511
  die(bad);
1506
1512
  }
@@ -1512,7 +1518,7 @@ async function main() {
1512
1518
  dataDir: resolveDataDir(flag("data")).dir,
1513
1519
  ttlMinutes: numFlag("ttl", 1440),
1514
1520
  reset: argv.includes("--reset"),
1515
- ...(flag("space") ? { space: flag("space") } : {}),
1521
+ ...(createAs ? { space: createAs } : {}),
1516
1522
  ...(flag("me") ? { me: flag("me") } : {}),
1517
1523
  ...(flag("relay") ? { relay: flag("relay") } : {}),
1518
1524
  ...(setupFlags.preset.wake ? { wake: setupFlags.preset.wake } : {}),
@@ -1677,10 +1683,16 @@ async function main() {
1677
1683
  }
1678
1684
  case "init": {
1679
1685
  const had = argv.includes("--reset") ? null : identity();
1680
- if (flag("space") && !flag("token")) {
1686
+ let initSpace = flag("space");
1687
+ if (initSpace && !flag("token")) {
1681
1688
  const f0 = loadAll();
1682
- if (!(f0 && findMembership(f0, flag("space")))) {
1683
- const bad = teamNameProblem(flag("space"));
1689
+ if (!(f0 && findMembership(f0, initSpace))) {
1690
+ const hyphened = hyphenateSpaces(initSpace);
1691
+ if (hyphened !== initSpace && !teamNameProblem(hyphened)) {
1692
+ console.error(D(` A team name can't have spaces, so "${initSpace}" is created as "${hyphened}".`));
1693
+ initSpace = hyphened;
1694
+ }
1695
+ const bad = teamNameProblem(initSpace);
1684
1696
  if (bad)
1685
1697
  die(bad);
1686
1698
  }
@@ -1688,7 +1700,7 @@ async function main() {
1688
1700
  const kp = had?.publicKey && had.privateKey ? { publicKey: had.publicKey, privateKey: had.privateKey } : newKeypair();
1689
1701
  const cfg = {
1690
1702
  relay: flag("relay", "ws://localhost:8787"),
1691
- space: flag("space", "team"),
1703
+ space: initSpace ?? "team",
1692
1704
  token: flag("token", randomBytes(16).toString("hex")),
1693
1705
  member: flag("me") ?? had?.member ?? process.env.USER ?? "me",
1694
1706
  publicKey: kp.publicKey,
package/dist/team-name.js CHANGED
@@ -27,6 +27,9 @@ export function teamSlug(raw) {
27
27
  .replace(/[-_]+$/, "");
28
28
  return TEAM_NAME.test(s) ? s : "";
29
29
  }
30
+ export function hyphenateSpaces(raw) {
31
+ return raw.trim().replace(/\s+/g, "-");
32
+ }
30
33
  export function teamNameProblem(name, opts = {}) {
31
34
  if (looksLikePlaceholder(name))
32
35
  return PLACEHOLDER_REFUSAL;
package/dist/worker.js CHANGED
@@ -501,7 +501,13 @@ export async function prepareWorktreeAsync(project, scratch, goal, log, branch =
501
501
  }
502
502
  export function branchName(space, goalId, title) {
503
503
  const slug = (title ?? "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40).replace(/-+$/, "");
504
- return `pantheon/${space}/${slug ? `${slug}-${goalId.slice(-4)}` : goalId}`;
504
+ return `pantheon/${branchSpace(space)}/${slug ? `${slug}-${goalId.slice(-4)}` : goalId}`;
505
+ }
506
+ export function branchSpace(space) {
507
+ const fine = /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/.test(space) && !space.includes("..") && !space.endsWith(".") && !/\.lock$/i.test(space);
508
+ if (fine)
509
+ return space;
510
+ return space.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40).replace(/-+$/, "") || "team";
505
511
  }
506
512
  export function commandNote(worktree, rev, log = () => { }) {
507
513
  const repo = repoCommands(worktree, rev);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "format": 1,
3
- "built_at": "2026-10-13T06:04:13.698Z",
3
+ "built_at": "2026-10-13T11:58:59.390Z",
4
4
  "swiftc": "Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101)",
5
5
  "helpers": {
6
6
  "pantheon-tray": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@join-pantheon/cli",
3
- "version": "0.33.7",
3
+ "version": "0.33.8",
4
4
  "description": "Let your coding agent collaborate directly with your teammates' agents — ask, agree an interface, and deliver, without a human relaying messages.",
5
5
  "type": "module",
6
6
  "bin": {