@join-pantheon/cli 0.36.0 → 0.37.0-rc.2

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/managed.js CHANGED
@@ -238,32 +238,17 @@ export function runtimeNodeFit(layout, node, newest, relay, os = platform()) {
238
238
  share: "runtime Node too old for the newest release",
239
239
  };
240
240
  }
241
- export function joinInstructions(invite, relay, installers = true) {
242
- const link = quotableInvite(invite);
243
- const steps = [];
244
- const sh = link && installers ? installerLine(relay, "sh", ["join", link]) : null;
245
- const win = link && installers ? installerLine(relay, "windows", ["join", link]) : null;
246
- if (sh)
247
- steps.push({ label: "Mac or Linux (Terminal):", lines: [sh] });
248
- if (win)
249
- steps.push({ label: "Windows (Command Prompt or PowerShell):", lines: [win] });
250
- steps.push({
251
- label: steps.length ? "Already have Node.js 22.13 or newer? This works too:" : "With Node.js 22.13 or newer (nodejs.org):",
252
- lines: ["npm i -g @join-pantheon/cli", link ? `pantheon join '${link}'` : `pantheon join ${invite}`],
253
- });
254
- const joinLine = link ? `pantheon join '${link}'` : `pantheon join ${invite}`;
255
- return {
256
- intro: "You're invited to my Pantheon team. Paste the line for your computer into a terminal:",
257
- steps,
258
- agent: {
259
- label: "Or ask your coding agent (Claude Code, Codex, Cursor) to run:",
260
- lines: ["npm i -g @join-pantheon/cli", `${joinLine} --json`],
261
- note: "This needs Node.js 22.13 or newer. If join exits with code 10, you need to sign in once, and it says how.",
262
- },
263
- outro: sh || win
264
- ? "It installs Pantheon (with its own Node, no admin rights), asks for your email, sends you a 6-digit code (check spam if it does not arrive), and sets up the coding agents on your computer."
265
- : "`pantheon join` asks for your email, sends you a 6-digit code (check spam if it does not arrive), and sets up the coding agents on your computer.",
266
- };
241
+ export async function relayInstallerVersion(relay, timeoutMs = 4000) {
242
+ const base = installerBase(relay);
243
+ if (!base)
244
+ return null;
245
+ try {
246
+ const r = await fetch(`${base}/install.sh`, { method: "HEAD", signal: AbortSignal.timeout(timeoutMs) });
247
+ return r.status === 200 ? r.headers.get("x-pantheon-installs") : null;
248
+ }
249
+ catch {
250
+ return null;
251
+ }
267
252
  }
268
253
  export async function relayServesInstaller(relay, timeoutMs = 4000) {
269
254
  const base = installerBase(relay);
package/dist/mcp.js CHANGED
@@ -101,7 +101,19 @@ function versionNote() {
101
101
  : `This window runs pantheon ${VERSION} while ${installed} is installed, and the old copy cannot reconnect. ` +
102
102
  `Tell your human: reconnect the pantheon MCP server in this window (/mcp → pantheon → Reconnect) or quit and reopen the window. The relay itself is not the problem.`;
103
103
  }
104
+ export const SELFTEST_ENV = "PANTHEON_MCP_SELFTEST";
105
+ async function runSelfTest(word) {
106
+ const server = new McpServer({ name: "pantheon", version: VERSION });
107
+ server.registerTool("pantheon_status", {
108
+ title: "Pantheon status",
109
+ description: "Pantheon's setup check: call this once and repeat its answer exactly.",
110
+ }, async () => ({ content: [{ type: "text", text: `PANTHEON_CHECK ${word}` }] }));
111
+ await server.connect(new StdioServerTransport());
112
+ }
104
113
  export async function runMcp() {
114
+ const selfTest = process.env[SELFTEST_ENV];
115
+ if (selfTest && /^[A-Za-z0-9]{8,64}$/.test(selfTest))
116
+ return runSelfTest(selfTest);
105
117
  const res = resolveFor(process.cwd(), { strict: true });
106
118
  const cfg = res.cfg && res.cfg.space ? res.cfg : null;
107
119
  if (cfg && res.autoBound && res.repo && cfg.spaceId) {
@@ -124,15 +136,15 @@ export async function runMcp() {
124
136
  : res.reason === "stale"
125
137
  ? `This repo (${where}) is bound to a pantheon team this machine is no longer a member of.\n\n` +
126
138
  "Ask your human to run `pantheon use <team> --here` to rebind it, or `pantheon join <invite>` to rejoin."
127
- : "pantheon is installed but not joined to any space yet.\n\n" +
139
+ : "pantheon is installed but not on a team yet.\n\n" +
128
140
  "Ask your human to run one of:\n" +
129
- " pantheon start — create a space and get an invite link to share\n" +
130
- " pantheon join <invite> — accept a teammate's invite link\n\n" +
141
+ " pantheon start — create a team and get an invite to send\n" +
142
+ " pantheon join <invite> — join a teammate's team with their invite\n\n" +
131
143
  "Until then there are no peers to talk to. Carry on working locally.";
132
144
  const idle = new McpServer({ name: "pantheon", version: VERSION }, { instructions: res.reason === "unbound" || res.reason === "stale"
133
145
  ? "pantheon is installed but this folder is not bound to one of this machine's teams. Tell your human to run `pantheon use <team> --here` from this repo. Do not try to coordinate with peers until then. " +
134
146
  "A person on the team, or their agent or worker, is reached only through Pantheon once this folder is bound; your agent's own agent tools never reach them."
135
- : "pantheon is installed but this machine has not joined a space yet. Tell your human to run `pantheon start` (to create a space) or `pantheon join <invite>` (to accept one)." });
147
+ : "pantheon is installed but this machine is not on a team yet. Tell your human to run `pantheon start` (to create a team) or `pantheon join <invite>` (to join one)." });
136
148
  idle.registerTool("pantheon_status", {
137
149
  title: "Pantheon status",
138
150
  description: "Whether this folder is bound to a pantheon team.",
@@ -400,6 +412,11 @@ export async function runMcp() {
400
412
  peers.length
401
413
  ? `peers: ${peers.map((p) => `${p.id} [${p.online ? "online" : "offline"}, ${p.agent}${reach(p)}]`).join(" ")}`
402
414
  : `peers: none yet — you are the only delegate here. Your human's colleague needs to run 'pantheon join'.`,
415
+ ...(() => {
416
+ const day = Date.now() - 86_400_000;
417
+ const fresh = (client.members ?? []).filter((e) => e.admitted && !e.revoked_at && e.member !== cfg.member && (e.joined_at ?? 0) > day).map((e) => e.member);
418
+ return fresh.length ? [`new teammate${fresh.length === 1 ? "" : "s"} (joined today): ${fresh.join(", ")} — offer your human a first small hand-off`] : [];
419
+ })(),
403
420
  open.length
404
421
  ? `open goals:\n${open.map((g) => ` ${g.id} ${g.state} ${g.acts}/${g.budget} acts "${g.title}"${goalTrustNote(g)} members: ${g.members.join(",")}${deadlineLabel(g.deadline)}${goalKindLabel(asSeen(g))}`).join("\n")}`
405
422
  : `open goals: none`,
package/dist/notice.js CHANGED
@@ -213,4 +213,19 @@ export function composePassedOver(r, focus, now = Date.now()) {
213
213
  ...(focus ? { focus } : {}),
214
214
  };
215
215
  }
216
+ export function composeJoined(names, team) {
217
+ const who = names.length === 1 ? names[0] : `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
218
+ return {
219
+ kind: "delivery",
220
+ who: team,
221
+ heading: fit(`${who} joined ${team}`, BUDGET.heading),
222
+ context: "",
223
+ body: fit(names.length === 1
224
+ ? `Try your first hand-off: ask your agent to hand ${names[0]} something small.`
225
+ : "Try your first hand-off: ask your agent to hand one of them something small.", BUDGET.body),
226
+ ttl: 30,
227
+ sound: false,
228
+ tag: `joined_${team.replace(/[^A-Za-z0-9_]/g, "_")}`.slice(0, 60),
229
+ };
230
+ }
216
231
  //# sourceMappingURL=notice.js.map
package/dist/notifier.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { invitesSent, markKnown, newMembers } from "./invites-sent.js";
1
2
  import { showWindowsNotice } from "./notice-windows.js";
2
3
  import { showLinuxNotice } from "./notice-linux.js";
3
4
  import { spawn } from "node:child_process";
@@ -9,7 +10,7 @@ import { fileURLToPath } from "node:url";
9
10
  import { PantheonClient } from "./client.js";
10
11
  import { CONFIG_DIR } from "./config.js";
11
12
  import { loadProfile } from "./profile.js";
12
- import { APP_TOOLS, CLAUDE_APP_CHOSEN, composeDecision, composeDelivery, composePassedOver, composeWakeAsk, neverAlerts, passedOverNotice, TOOL_LABELS } from "./notice.js";
13
+ import { APP_TOOLS, CLAUDE_APP_CHOSEN, composeDecision, composeDelivery, composeJoined, composePassedOver, composeWakeAsk, neverAlerts, passedOverNotice, TOOL_LABELS } from "./notice.js";
13
14
  import { loadPolicy } from "./worker-policy.js";
14
15
  import { withoutAgentMarkers } from "./setup-changes.js";
15
16
  import { wakeAlerted } from "./continued.js";
@@ -21,6 +22,7 @@ import { obligationSignature, StatusNudger } from "./status-nudge.js";
21
22
  import { clientState, ConnectionReport } from "./conn-report.js";
22
23
  import { removalFor, removalHolds, removalRefusal, removalWords, removedLine, removedNotice, takeTold } from "./removed.js";
23
24
  export const DEFAULT_REMINDER_MS = 4 * 60 * 60 * 1_000;
25
+ export const JOIN_BATCH_MS = 20_000;
24
26
  export const PASSED_OVER_EVERY_MS = 3_600_000;
25
27
  export const MAX_REMINDERS = 4;
26
28
  const DAY_MS = 24 * 60 * 60 * 1_000;
@@ -275,6 +277,10 @@ export class HumanNotifier {
275
277
  cliTools.start();
276
278
  this.opts.log(`notifier online as ${this.cfg.member}`);
277
279
  this.opts.log(` reminders after ${Math.round(this.opts.reminderMs / 60_000)} minutes, then doubling to daily, ${MAX_REMINDERS} at most — after that a decision waits on pantheon brief and the menu bar`);
280
+ const team = this.cfg.spaceId ?? this.cfg.space;
281
+ const joined = new Set();
282
+ const settled = new Set();
283
+ let joinedSince = 0;
278
284
  try {
279
285
  let removedSaid = false;
280
286
  while (!this.stopped) {
@@ -352,6 +358,44 @@ export class HumanNotifier {
352
358
  if (dirty || !existsSync(stateFile))
353
359
  writeState(stateFile, state);
354
360
  const arrived = await client.next(pollMs);
361
+ try {
362
+ const members = client.members ?? [];
363
+ const admitted = members.filter((e) => e.admitted && !e.revoked_at).map((e) => e.member);
364
+ if (admitted.length) {
365
+ const fresh = (this.opts.newMembers ?? newMembers)(team, admitted, this.cfg.member).filter((m) => !settled.has(m) && !joined.has(m));
366
+ if (fresh.length) {
367
+ const look = this.opts.invitesSent ?? invitesSent;
368
+ const sent = new Set([...look(this.cfg.space), ...(this.cfg.spaceId ? look(this.cfg.spaceId) : [])]);
369
+ const quiet = [];
370
+ for (const m of fresh) {
371
+ const fp = members.find((e) => e.member === m)?.invite_fp;
372
+ if (fp && sent.has(fp)) {
373
+ if (!joined.size)
374
+ joinedSince = now();
375
+ joined.add(m);
376
+ }
377
+ else {
378
+ quiet.push(m);
379
+ settled.add(m);
380
+ }
381
+ }
382
+ if (quiet.length)
383
+ (this.opts.markKnown ?? markKnown)(team, quiet);
384
+ }
385
+ }
386
+ if (joined.size && now() - joinedSince >= (this.opts.joinBatchMs ?? JOIN_BATCH_MS)) {
387
+ const names = [...joined];
388
+ joined.clear();
389
+ for (const m of names)
390
+ settled.add(m);
391
+ if (prefs.decisions) {
392
+ const ok = await send(withLabel(composeJoined(names, this.cfg.space)));
393
+ this.opts.log(ok ? `> joined alert: ${names.join(", ")}` : `! could not show the joined alert for ${names.join(", ")}`);
394
+ }
395
+ (this.opts.markKnown ?? markKnown)(team, names);
396
+ }
397
+ }
398
+ catch { }
355
399
  if (prefs.decisions) {
356
400
  for (const r of arrived) {
357
401
  if (!passedOverNotice(r, this.cfg.member) || state.notified_at[`act:${r.id}`])
@@ -0,0 +1,217 @@
1
+ import { installerBase, installerLine, quotableInvite } from "./managed.js";
2
+ export const INVITE = "{invite}";
3
+ export const FLAG_SIGNIN_SINCE = "0.37.0";
4
+ export const INVITE_PATTERN = "^[A-Za-z0-9._~:/?#@!&()*+,;=%\\[\\]-]+$";
5
+ export const AGENTS_NAMED = "Claude Code, Codex, Cursor, GitHub Copilot or Kiro";
6
+ export const INSTALL_CHANGES = [
7
+ "Installs Pantheon in your home folder (~/.pantheon), with its own Node.js. No admin rights.",
8
+ "Adds Pantheon to the coding agents it finds (Claude Code, Codex, Cursor, GitHub Copilot, Kiro) and pre-approves Pantheon's own tools there, so your agent is not asked each time it uses one.",
9
+ "Starts a background helper when you log in. By default a teammate's request can start your agent while you're away: it works in a separate copy of the repo and delivers on its own branch for you to review, and in a repo it may run your tests, commit and push that branch. Claude Code's runs are sandboxed; Codex, Cursor and Copilot runs are not.",
10
+ "Shows desktop alerts for the decisions that are yours (and a menu bar on a Mac).",
11
+ "Change any of it later with `pantheon setup`, or remove it all with `pantheon uninstall`.",
12
+ ];
13
+ export function atLeast(version, floor) {
14
+ if (!version)
15
+ return false;
16
+ const m = /^v?(\d+)\.(\d+)\.(\d+)(-[^+]*)?/.exec(version.trim());
17
+ const f = /^(\d+)\.(\d+)\.(\d+)/.exec(floor);
18
+ if (!m)
19
+ return false;
20
+ for (let i = 1; i <= 3; i++) {
21
+ const a = Number(m[i]), b = Number(f[i]);
22
+ if (a !== b)
23
+ return a > b;
24
+ }
25
+ return !m[4];
26
+ }
27
+ const baseOf = (o) => (o.serves === false ? null : installerBase(o.relay));
28
+ const q = (a) => (/^[A-Za-z0-9._/:=@%+{}-]+$/.test(a) ? a : `'${a}'`);
29
+ export function steps(invite, o) {
30
+ const arg = invite === INVITE ? STAND_IN : invite ? (quotableInvite(invite) ?? invite) : null;
31
+ const built = stepsFor(arg, o);
32
+ if (invite !== INVITE)
33
+ return built;
34
+ const swap = (t) => t.split(STAND_IN).join(INVITE);
35
+ return { person: built.person.map((p) => ({ label: p.label, line: swap(p.line) })), npm: built.npm.map(swap), agent: swap(built.agent) };
36
+ }
37
+ const STAND_IN = "https://www.joinpantheon.network/join/TEAM#INVITE0STAND0IN";
38
+ function stepsFor(invite, o) {
39
+ const base = baseOf(o);
40
+ const cmd = invite ? ["join", invite] : ["start"];
41
+ const person = [];
42
+ const sh = base ? installerLine(o.relay, "sh", cmd) : null;
43
+ const win = base ? installerLine(o.relay, "windows", cmd) : null;
44
+ if (sh)
45
+ person.push({ label: "Mac or Linux (Terminal):", line: sh });
46
+ if (win)
47
+ person.push({ label: "Windows (Command Prompt or PowerShell):", line: win });
48
+ const npm = ["npm install -g @join-pantheon/cli", `pantheon ${cmd.map(q).join(" ")}`];
49
+ return { person, npm, agent: agentRequest(invite, o) };
50
+ }
51
+ export function agentRequest(invite, o) {
52
+ const base = invite === null || quotableInvite(invite) === invite ? baseOf(o) : null;
53
+ const what = invite ? "join my teammate's Pantheon team" : "set up Pantheon and start a team";
54
+ const intro = `Help me ${what}. Pantheon is a command-line tool (npm: @join-pantheon/cli, site: joinpantheon.network) that lets coding agents like you hand work to each other across people.`;
55
+ const verb = invite ? `join ${q(invite)}` : "start";
56
+ const psVerb = invite ? `join ${invite}` : "start";
57
+ if (base && atLeast(o.installs, FLAG_SIGNIN_SINCE)) {
58
+ const flags = "--email <my email> --username <my username>";
59
+ return [
60
+ intro,
61
+ `First ask me for my email and for the username my teammates will see (it can't be changed later).${invite ? " Don't open the invite link: it holds a one-time secret, and the installer takes it as it is." : ""}`,
62
+ `On a Mac or Linux: download the installer and read it before running it — curl -fsSL ${base}/install.sh -o pantheon-install.sh — then run: sh pantheon-install.sh ${verb} ${flags}`,
63
+ `On Windows: curl.exe -fsSL ${base}/install.ps1 -o pantheon-install.ps1, read it, then run: powershell -NoProfile -Command "Set-Item Env:PANTHEON_ARGS '${psVerb} ${flags}'; Get-Content -Raw pantheon-install.ps1 | iex"`,
64
+ `It emails me a 6-digit code (it may land in spam). Ask me for it, then run the exact command it prints next (it names Pantheon by its full path, since this shell may not find \`pantheon\` yet), with the code in place of <the 6-digit code>. In Codex, allow network access when asked.`,
65
+ "What it changes, to tell me before running it:",
66
+ ...INSTALL_CHANGES.slice(0, 3).map((c) => `- ${c}`),
67
+ ].join("\n");
68
+ }
69
+ return [
70
+ intro,
71
+ `It needs Node.js 22.13 or newer. Run: npm install -g @join-pantheon/cli — then: pantheon ${verb} --json`,
72
+ `If it exits with code 10, I need to sign in once: give me the line it prints to run in a terminal of my own, and run it again after.${invite ? " Don't open the invite link: it holds a one-time secret." : ""}`,
73
+ ].join("\n");
74
+ }
75
+ export function inviteBlock(invite, o) {
76
+ const s = steps(invite, o);
77
+ const lines = [
78
+ { text: "You're invited to my Pantheon team. It lets our coding agents hand work to each other. Paste the line for your computer into a terminal:" },
79
+ ];
80
+ for (const p of s.person) {
81
+ lines.push({ text: p.label }, { text: p.line, command: true });
82
+ }
83
+ lines.push({ text: s.person.length ? "Already have Node.js 22.13 or newer? This works too:" : "With Node.js 22.13 or newer (nodejs.org):" });
84
+ for (const l of s.npm)
85
+ lines.push({ text: l, command: true });
86
+ lines.push({ text: "It asks for your email and sends you a 6-digit code (check spam if it doesn't arrive), then connects the coding agents on your computer." });
87
+ lines.push({ text: `Or paste this to your coding agent (${AGENTS_NAMED}):` });
88
+ for (const l of s.agent.split("\n"))
89
+ lines.push({ text: l, command: true });
90
+ return { heading: "Forward this to your teammate:", lines };
91
+ }
92
+ export function onboardJson(o) {
93
+ return {
94
+ version: o.version,
95
+ installs: o.installs,
96
+ invite_placeholder: INVITE,
97
+ invite_pattern: INVITE_PATTERN,
98
+ start: steps(null, o),
99
+ join: steps(INVITE, o),
100
+ changes: INSTALL_CHANGES,
101
+ agents: AGENTS_NAMED,
102
+ };
103
+ }
104
+ const fence = (lines) => lines.map((l) => ` ${l}`).join("\n");
105
+ const quote = (text) => text.split("\n").map((l) => `> ${l}`).join("\n>\n");
106
+ export function joinMd(o) {
107
+ const s = steps(INVITE, o);
108
+ return `# Joining a Pantheon team
109
+
110
+ <!-- Generated from src/onboard-copy.ts (npm run gen:copy). Edit there, not here. -->
111
+
112
+ Someone invited you to their team on Pantheon. **Pantheon** connects the coding
113
+ agents of people who work together (${AGENTS_NAMED}), so one person's agent can
114
+ ask another's a question, hand over work, and bring decisions to the right person.
115
+ It is a command-line tool published on npm as \`@join-pantheon/cli\`.
116
+
117
+ You need: a Mac, Linux or Windows computer, the invite your teammate sent
118
+ (\`https://www.joinpantheon.network/join/<team>#<code>\`, single use, 24 hours), and
119
+ your work email for a 6-digit sign-in code. There is no password.
120
+
121
+ ## In a terminal: one line
122
+
123
+ Open a terminal in the folder you work in (a clone of the team's repo if you have
124
+ one) and paste the line for your computer, with your invite in place of \`${INVITE}\`.
125
+
126
+ ${s.person.map((p) => `**${p.label.replace(/:$/, "")}:**\n\n${fence([p.line])}`).join("\n\n")}
127
+
128
+ With Node.js 22.13 or newer you can use npm instead:
129
+
130
+ ${fence(s.npm)}
131
+
132
+ It asks for your email, sends a 6-digit code (check spam), and connects the coding
133
+ agents on your computer. When it says it is ready, quit and reopen your coding agent
134
+ once.
135
+
136
+ ## From a coding agent
137
+
138
+ Paste this to your coding agent:
139
+
140
+ ${quote(s.agent)}
141
+
142
+ ## What it changes
143
+
144
+ ${INSTALL_CHANGES.map((c) => `- ${c}`).join("\n")}
145
+ `;
146
+ }
147
+ export function onboardMd(o) {
148
+ const s = steps(null, o);
149
+ return `# Setting up Pantheon
150
+
151
+ <!-- Generated from src/onboard-copy.ts (npm run gen:copy). Edit there, not here. -->
152
+
153
+ **Pantheon** connects the coding agents of people who work together (${AGENTS_NAMED}),
154
+ so one person's agent can ask another's a question, hand over work, and bring
155
+ decisions to the right person. It is a command-line tool published on npm as
156
+ \`@join-pantheon/cli\`. Invited to a team already? Use the line in your invite.
157
+
158
+ ## In a terminal: one line
159
+
160
+ ${s.person.map((p) => `**${p.label.replace(/:$/, "")}:**\n\n${fence([p.line])}`).join("\n\n")}
161
+
162
+ With Node.js 22.13 or newer you can use npm instead:
163
+
164
+ ${fence(s.npm)}
165
+
166
+ It asks for your email and a 6-digit code, creates your team, and connects the
167
+ coding agents on your computer. Then \`pantheon invite\` gives you a block to
168
+ forward to each teammate.
169
+
170
+ ## Two rules before starting a team
171
+
172
+ - **The team's name is the person's.** Ask them for it; never invent one, and never
173
+ run a placeholder from an example. \`pantheon start\` refuses anything in \`<…>\`,
174
+ \`{…}\` or \`[…]\`, "team name", "your-team" and the like.
175
+ - **Someone who already has an account may already have a team.** After signing in,
176
+ run \`pantheon recover\`, then start: it lists the teams they have a seat in, and
177
+ \`pantheon recover <team>\` moves that seat to this computer. That is their team,
178
+ not a new one; run \`pantheon start\` only for a team they do not have yet. Without
179
+ a terminal, \`start\` with no \`--space\` refuses while such a seat exists and names
180
+ the \`recover\` line; \`--new-team\` creates a new team anyway. \`pantheon recover
181
+ <team>\` exits 3 when the move waits for a teammate to confirm it.
182
+
183
+ ## From a coding agent
184
+
185
+ Paste this to your coding agent:
186
+
187
+ ${quote(s.agent)}
188
+
189
+ ## What it changes
190
+
191
+ ${INSTALL_CHANGES.map((c) => `- ${c}`).join("\n")}
192
+ `;
193
+ }
194
+ export const README_START = "<!-- getting-started:start (generated from src/onboard-copy.ts — npm run gen:copy) -->";
195
+ export const README_END = "<!-- getting-started:end -->";
196
+ export function readmeStart(o) {
197
+ const s = steps(null, o);
198
+ return `${README_START}
199
+ ## Getting started
200
+
201
+ Paste one line into a terminal on your own computer. It brings its own Node.js,
202
+ needs no admin rights, asks for your email and a 6-digit code, creates your team
203
+ and connects the coding agents it finds.
204
+
205
+ ${s.person.map((p) => `${p.label}\n\n${fence([p.line])}`).join("\n\n")}
206
+
207
+ With Node.js 22.13 or newer: \`${s.npm.join("` then `")}\`.
208
+ Invited to a team? Use the line in your invite (\`pantheon join <invite>\`).
209
+ Then \`pantheon invite\` gives you a block to forward to each teammate.
210
+
211
+ What it changes:
212
+
213
+ ${INSTALL_CHANGES.map((c) => `- ${c}`).join("\n")}
214
+ ${README_END}`;
215
+ }
216
+ export const HOSTED_COPY = { relay: "wss://relay.joinpantheon.network", installs: FLAG_SIGNIN_SINCE };
217
+ //# sourceMappingURL=onboard-copy.js.map
package/dist/profile.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { existsSync, mkdirSync, renameSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { CONFIG_DIR } from "./config.js";
4
- import { isCatchAllDomain } from "./protocol.js";
4
+ import { isCatchAllDomain, TeamSetupSchema } from "./protocol.js";
5
5
  import { readStateText } from "./file-lock.js";
6
6
  export const AGENT_SURFACES = ["codex", "claude-code", "cursor", "copilot", "kiro"];
7
7
  export const SURFACE_BUNDLE_IDS = {
@@ -169,6 +169,7 @@ function sanitizeSpaces(raw) {
169
169
  ...(o.responsibilities ? { responsibilities: cleanList(o.responsibilities) } : {}),
170
170
  ...(o.authority && typeof o.authority === "object" ? { authority: Object.fromEntries(Object.entries(o.authority).filter(([, m]) => m === "human_required" || m === "agent_can_decide")) } : {}),
171
171
  ...(o.decision_keywords ? { decision_keywords: cleanKeywords(o.decision_keywords) } : {}),
172
+ ...(TeamSetupSchema.safeParse(o.team_setup).success ? { team_setup: TeamSetupSchema.parse(o.team_setup) } : {}),
172
173
  };
173
174
  }
174
175
  return out;
@@ -228,6 +229,7 @@ export function organizationProfile(profile, ...forSpace) {
228
229
  decision_keywords: cleanKeywords(team.decision_keywords),
229
230
  capabilities: cleanList(profile.capabilities),
230
231
  delegations: cleanDelegations(profile.delegations),
232
+ ...(spaceOverride(profile, ...forSpace)?.team_setup ? { team_setup: spaceOverride(profile, ...forSpace).team_setup } : {}),
231
233
  updated_at: profile.updated_at,
232
234
  };
233
235
  }
package/dist/protocol.js CHANGED
@@ -153,6 +153,15 @@ export const Hello = z.object({
153
153
  delegate: DelegateCertSchema.optional(),
154
154
  upkeep: z.boolean().optional(),
155
155
  });
156
+ export const TeamSetupSchema = z.object({
157
+ team: z.string().min(1).max(80),
158
+ mode: z.enum(["here", "autopilot"]),
159
+ wake: z.enum(["anyone", "approved", "no"]),
160
+ commands: z.boolean(),
161
+ alerts: z.string().min(1).max(32),
162
+ at: z.number().int().nonnegative(),
163
+ sig: z.string().min(1).max(200),
164
+ });
156
165
  export const OrganizationProfileSchema = z.object({
157
166
  version: z.literal(1),
158
167
  member: z.string().min(1).max(48),
@@ -168,6 +177,7 @@ export const OrganizationProfileSchema = z.object({
168
177
  starts_at: z.number().int().nonnegative(),
169
178
  expires_at: z.number().int().positive(),
170
179
  })).max(32).optional(),
180
+ team_setup: TeamSetupSchema.optional(),
171
181
  updated_at: z.number().int().nonnegative(),
172
182
  });
173
183
  export const PublishProfile = z.object({
@@ -1,3 +1,4 @@
1
+ import { recordInviteSent } from "./invites-sent.js";
1
2
  import { execFileSync } from "node:child_process";
2
3
  import { randomBytes } from "node:crypto";
3
4
  import { createServer } from "node:net";
@@ -526,9 +527,10 @@ export async function start(opts) {
526
527
  warnings.push(`this repo was bound to "${name}"; it now belongs to "${c.space}" — agents opened here speak in "${c.space}" from now on (pantheon use ${name} --here moves it back)`);
527
528
  }
528
529
  }
529
- opts.log(` space ${c.space} ${reuse ? "— reconnected" : "— created, you own it"}${repo ? ` ${repo.origin ?? "local repo"} → bound to it` : folderBound ? ` this folder → bound to it` : ""}`);
530
+ opts.log(` team ${c.space} ${reuse ? "— reconnected" : "— created, you own it"}${repo ? ` ${repo.origin ?? "local repo"} → bound to it` : folderBound ? ` this folder → bound to it` : ""}`);
530
531
  const mayWake = opts.wake ? opts.wake === "anyone" : wakeDefault(loadProfile(c));
531
532
  const inv = await client.makeInvite(mayWake, opts.ttlMinutes);
533
+ recordInviteSent(c.spaceId ?? c.space, inv.url);
532
534
  invite = toInvite({ ...c, token: inv.url });
533
535
  inviteMayWake = mayWake;
534
536
  claimed = true;
@@ -551,7 +553,7 @@ export async function start(opts) {
551
553
  }
552
554
  else if (nameTaken && !opts.space) {
553
555
  const alt = teamSlug(`${cfg.space}-${cfg.member}`) || cfg.space;
554
- opts.log(` space "${cfg.space}" is already another team's space on this relay — using "${alt}"`);
556
+ opts.log(` team "${cfg.space}" is already another team's space on this relay — using "${alt}"`);
555
557
  cfg = { ...cfg, space: alt };
556
558
  try {
557
559
  await claim(cfg);