@join-pantheon/cli 0.37.3 → 0.38.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.
package/README.md CHANGED
@@ -410,7 +410,15 @@ peer's machine was answered in **31 seconds with no human involved**, and:
410
410
  stop it even when both are installed; `pantheon doctor` starts it once and says what failed and the
411
411
  likely fix, and teammates are told "its Linux sandbox can't start". Pantheon never runs commands
412
412
  outside the sandbox instead
413
- - one run at a time, capped at 12/hour by default
413
+ - one run at a time, capped at 12/hour by default, and at **12 runs per goal in 24 hours** so two
414
+ agents answering each other cannot use up your plan on one thread (`pantheon policy set goal-runs
415
+ <1-100>`); past it, that goal's requests and replies wait for you and are taken again once the
416
+ window frees — the teammate is told, nothing is dropped
417
+ - Claude Code runs use **Sonnet**, not the model you chose for your own windows (often Opus):
418
+ `pantheon policy set model <name|own|default>` (own = your own default). Codex, Cursor, Copilot
419
+ and Kiro keep their own default unless you name one with `--agent <id>`
420
+ - replies to questions your agent sent several teammates at once (a check-in) are handled in one run
421
+ as they come in, not one run each
414
422
  - each run may take **60 minutes** by default; one still going then is stopped (with everything it
415
423
  started), tried once more in the same worktree, then handed to you with the limit named. Set it
416
424
  on your machine with `pantheon policy set run-minutes <5-180>` (read at the next run, so the
@@ -643,7 +651,7 @@ never in a prompt: a prompt can be argued out of its instructions.
643
651
  | Invites | single-use, expiring | a leaked link is inert once redeemed or timed out |
644
652
  | Claims | one session per obligation | parallel Conductor workspaces cannot duplicate work |
645
653
  | Wake rights | `pantheon wake allow`, per machine; `--may-wake`, per member for the team | under "anyone" (the default): every peer the team lets wake; under "approved": only those you also approved here. Checked by the worker before a run starts, and by the relay at its claim |
646
- | Run budget | 12/hour, 1 concurrent, 60 minutes each | a peer cannot drain your tokens; `pantheon policy set run-minutes` (5–180) |
654
+ | Run budget | 12/hour, 12 per goal a day, 1 concurrent, 60 minutes each, Sonnet for Claude Code | a peer cannot drain your tokens; `pantheon policy set run-minutes` (5–180), `goal-runs` (1–100), `model` |
647
655
  | Personas | tighten-only | a persona file — even one a teammate committed — can lower caps and turn bash off, never the reverse |
648
656
  | Signed acts | every act and goal, ed25519, since 0.31 | checked on each receiving machine against the key it pinned for the sender: the relay cannot forge, alter, re-file or replay a teammate's request without that machine noticing, and a worker runs only requests that check out. A teammate's changed key is held back until you confirm it (`pantheon trust`) |
649
657
  | Worktree hygiene | no secrets on disk | credentials reach a woken run through its environment only; run scratch files are git-excluded |
@@ -8,6 +8,7 @@ export const FOUNDER_DEFS = {
8
8
  handoffs: "Requests one agent sent to another in the week.",
9
9
  answered: "Of this week's hand-offs, the share already answered or delivered by someone they were asked of.",
10
10
  answerTime: "Half of this week's answered hand-offs were answered faster than this.",
11
+ pickedUp: "Of this week's hand-offs, the share that someone it was asked of claimed or replied to within 5 minutes. A request that sits unseen is the first thing people notice. Never picked up means over an hour old with nothing from anyone it was asked of.",
11
12
  byWorker: "Of this week's answered hand-offs, the share a person's worker answered unattended. A person answered the rest in their own session.",
12
13
  decisions: "Escalations and decision requests raised this week that only a person can settle; how many are settled, and the median wait of those.",
13
14
  delivered: "Work handed back as delivered this week. The relay accepts a delivery only with a branch and a commit.",
@@ -85,11 +86,13 @@ export function founderSections(f, h, now) {
85
86
  </section>`;
86
87
  const ans = [rate(v.answered[0], v.asks[0]), rate(v.answered[1], v.asks[1])];
87
88
  const wk = [rate(v.byWorker[0], v.answered[0]), rate(v.byWorker[1], v.answered[1])];
89
+ const pk = [rate(v.quick[0], v.asks[0]), rate(v.quick[1], v.asks[1])];
88
90
  const value = `<section class="sec fsec" id="value" aria-labelledby="h-value">
89
91
  <div class="sechead"><h2 id="h-value">Is it delivering value</h2><p>agents hand off, people decide: this week, against last week</p></div>
90
- <div class="mgrid five">
92
+ <div class="mgrid">
91
93
  ${metric({ key: "answered", title: "Hand-offs answered", value: ans[0] === null ? "none asked" : `${ans[0]}%`, sub: `${v.answered[0]} of ${plural(v.asks[0], "hand-off")}`, delta: ans[0] === null ? "" : delta(ans[0], ans[1], { unit: "pts", better: "up" }) })}
92
94
  ${metric({ key: "answerTime", title: "Median time to answer", value: v.medianAnswerMs[0] === null ? "none yet" : dur(v.medianAnswerMs[0]), delta: v.medianAnswerMs[0] === null ? "" : delta(v.medianAnswerMs[0], v.medianAnswerMs[1], { unit: "ms", better: "down" }) })}
95
+ ${metric({ key: "pickedUp", title: "Picked up within 5 minutes", value: pk[0] === null ? "none asked" : `${pk[0]}%`, sub: v.asks[0] ? `${v.quick[0]} of ${plural(v.asks[0], "hand-off")}${v.unpicked[0] ? ` · ${v.unpicked[0]} never picked up` : ""}` : "", delta: pk[0] === null ? "" : delta(pk[0], pk[1], { unit: "pts", better: "up" }) })}
93
96
  ${metric({ key: "byWorker", title: "Answered by a worker", value: wk[0] === null ? "none yet" : `${wk[0]}%`, sub: v.answered[0] ? `${v.byWorker[0]} by a worker · ${v.byPerson[0]} by a person` : "", delta: wk[0] === null ? "" : delta(wk[0], wk[1], { unit: "pts" }) })}
94
97
  ${metric({ key: "decisions", title: "Decisions that reached a person", value: String(v.decisions[0]), sub: v.decisions[0] ? `${v.decided[0]} settled${v.medianDecisionMs[0] !== null ? `, median wait ${dur(v.medianDecisionMs[0])}` : ""}${v.decisions[0] - v.decided[0] ? ` · ${v.decisions[0] - v.decided[0]} still waiting` : ""}` : "none raised", delta: delta(v.decisions[0], v.decisions[1]) })}
95
98
  ${metric({ key: "delivered", title: "Deliveries", value: String(v.delivered[0]), sub: "each with a branch and a commit", delta: delta(v.delivered[0], v.delivered[1], { better: "up" }) })}
@@ -131,7 +134,7 @@ export function founderSections(f, h, now) {
131
134
  return `${healthSection(h, now)}${usage}${value}${growth}${retention}${plansSec}`;
132
135
  }
133
136
  export function definitionsSection() {
134
- const order = [["week", "This week"], ["activeTeams", "Weekly active teams"], ["activePeople", "Weekly active people"], ["handoffs", "Hand-offs"], ["answered", "Hand-offs answered"], ["answerTime", "Median time to answer"], ["byWorker", "Answered by a worker"], ["decisions", "Decisions that reached a person"], ["delivered", "Deliveries"], ["newTeams", "New teams"], ["newPeople", "New people"], ["activation", "First hand-off within 7 days"], ["funnel", "Sign-up to first hand-off"], ["wow", "Still active a week later"], ["fourWeek", "Still active 4 weeks later"], ["quiet", "Went quiet"], ["plans", "Plans"], ["relay", "The relay"], ["waiting", "Decisions waiting on a person"], ["workers", "Workers that can't take requests"], ["behind", "Machines behind on version"]];
137
+ const order = [["week", "This week"], ["activeTeams", "Weekly active teams"], ["activePeople", "Weekly active people"], ["handoffs", "Hand-offs"], ["answered", "Hand-offs answered"], ["answerTime", "Median time to answer"], ["pickedUp", "Picked up within 5 minutes"], ["byWorker", "Answered by a worker"], ["decisions", "Decisions that reached a person"], ["delivered", "Deliveries"], ["newTeams", "New teams"], ["newPeople", "New people"], ["activation", "First hand-off within 7 days"], ["funnel", "Sign-up to first hand-off"], ["wow", "Still active a week later"], ["fourWeek", "Still active 4 weeks later"], ["quiet", "Went quiet"], ["plans", "Plans"], ["relay", "The relay"], ["waiting", "Decisions waiting on a person"], ["workers", "Workers that can't take requests"], ["behind", "Machines behind on version"]];
135
138
  return `<section class="sec" id="definitions" aria-labelledby="h-defs">
136
139
  <div class="sechead"><h2 id="h-defs">What these mean</h2><p>built only from what the relay already keeps: no tracking was added</p></div>
137
140
  <div class="card pad"><dl class="defs">${order.map(([k, t]) => `<div><dt>${esc(t)}</dt><dd id="def-${k}">${esc(FOUNDER_DEFS[k])}</dd></div>`).join("")}</dl></div>
@@ -257,6 +257,7 @@ export function renderOverview(d) {
257
257
  const F = d.founder ?? null;
258
258
  const nav = secbar([
259
259
  ...(F ? [{ id: "health", label: "Health", n: null }, { id: "usage", label: "Usage" }, { id: "value", label: "Value" }, { id: "growth", label: "Growth" }, { id: "retention", label: "Retention" }, { id: "plans", label: "Plans" }] : []),
260
+ ...(d.installs ? [{ id: "installs", label: "Downloads" }] : []),
260
261
  { id: "teams", label: "Teams", n: T.length }, { id: "people", label: "People", n: d.accounts.total }, { id: "audit", label: "Audit" },
261
262
  ], "Overview sections");
262
263
  return page({
@@ -265,7 +266,7 @@ export function renderOverview(d) {
265
266
  <main id="main">
266
267
  ${d.done ? `<div class="flash" role="status">${esc(d.done)}</div>` : ""}
267
268
  <div class="sechead" style="margin-top:22px;margin-bottom:0"><h1>What's going on</h1><p>this week is the last 7 days in UTC, today included</p></div>
268
- ${F ? founderSections(F, fh, d.now) : `<div class="health" aria-label="Relay health">
269
+ ${F ? founderSections(F, fh, d.now) : ""}${d.installs ? installsSection(d.installs) : ""}${F ? "" : `<div class="health" aria-label="Relay health">
269
270
  <span><span class="dot"></span>Relay <b>${esc(h.version)}</b>, up ${up}${h.hold ? ` · upgrades held at <b>${esc(h.hold)}</b>` : ""}</span>
270
271
  ${h.loopP99 !== null ? `<span>Loop delay p99 <b>${Math.round(h.loopP99)} ms</b></span>` : ""}
271
272
  <span>${h.storage ? `<span class="dot bad"></span>Disk <b>failing: ${esc(h.storage)}</b>` : `Disk <b>writing normally</b>`}</span>
@@ -558,7 +559,7 @@ export function rightNow(o, m, now, asker) {
558
559
  return o.claimed.by === "worker" ? `${who}'s worker is working on it now (started ${when(o.claimed.at, "time")})` : `Claimed by ${who}'s agent window ${when(o.claimed.at, "time")}`;
559
560
  if (!m)
560
561
  return `${who} is not on this team any more`;
561
- const where = m.online ? `${who} is online${m.windows ? "" : " in a worker only"}` : `${who} is offline${seen}`;
562
+ const where = m.online ? `${who} is online${m.windows ? "" : (m.workerOn ?? !!m.worker) ? " in a worker only" : ", with nothing set up to take requests while away"}` : `${who} is offline${seen}`;
562
563
  if (o.human)
563
564
  return `Waits for ${who} to decide, since ${when(o.since, "time")}. ${where}`;
564
565
  if (o.handedBackAt)
@@ -573,6 +574,8 @@ export function rightNow(o, m, now, asker) {
573
574
  return `${who}'s worker is busy with something else`;
574
575
  if (m.online && !m.windows && m.worker)
575
576
  return `${who}'s worker is ${esc(m.worker.state)} and has not taken it yet`;
577
+ if (m.online && !m.windows && !(m.workerOn ?? !!m.worker))
578
+ return `${who}'s computer is on, but nothing there is set up to take requests while ${who} is away`;
576
579
  if (m.online)
577
580
  return m.busy ? `${who}'s session is mid-turn; it reaches the agent after this turn` : `Delivered to ${who}'s session, not picked up yet`;
578
581
  return `${who} is offline${seen}${m.worker ? "" : ", with no worker connected"}`;
@@ -817,4 +820,28 @@ export function renderGoal(d) {
817
820
  ${inlineReadScript(d.nonce)}`,
818
821
  });
819
822
  }
823
+ export function installsSection(s) {
824
+ const rows = (xs, none) => xs.length
825
+ ? `<table class="rt"><tbody>${xs.map((x) => `<tr><td class="span">${esc(x.name)}</td><td class="r num">${x.n}</td></tr>`).join("")}</tbody></table>`
826
+ : `<p class="none" style="padding:4px 18px 14px">${none}</p>`;
827
+ const place = (e) => [e.city, e.region, e.country_name ?? e.country].filter(Boolean).map((x) => esc(String(x))).join(", ") || "unknown";
828
+ const tag = (e) => e.bot ? "bot" : e.datacenter ? "server" : e.method === "HEAD" ? "check only" : "";
829
+ const days = s.days.map((d) => `<tr><td>${esc(d.day)}</td><td class="r num">${d.downloads}</td><td class="r num">${d.networks}</td><td class="r num">${d.sh}</td><td class="r num">${d.ps1}</td></tr>`).join("");
830
+ return `<section class="sec fsec" id="installs" aria-labelledby="h-installs">
831
+ <div class="sechead"><h2 id="h-installs">Installer downloads</h2><p>install.sh and install.ps1 from this relay, last 30 days. Bots, servers and HEAD checks are left out of the counts.</p></div>
832
+ <div class="mgrid">
833
+ <div class="metric"><span class="l">Downloads</span><div class="v">${s.total30}</div><div class="s">from ${plural(s.networks30, "network")}</div><span class="trend">${spark(s.days.map((d) => d.downloads), 112, 28)}<span class="vh">Daily, oldest first: ${s.days.map((d) => d.downloads).join(", ")}.</span></span></div>
834
+ <div class="metric"><span class="l">Set up from the same network</span><div class="v">${s.signedIn30}</div><div class="s">${s.networks30 ? `${pct(s.signedIn30, s.networks30)}% of networks that downloaded connected a computer within a day` : "no downloads yet"}</div></div>
835
+ <div class="metric"><span class="l">Left out</span><div class="v">${s.excluded30.bots + s.excluded30.datacenter + s.excluded30.head}</div><div class="s">${s.excluded30.bots} bots · ${s.excluded30.datacenter} servers (our checks, CI) · ${s.excluded30.head} checks only</div></div>
836
+ </div>
837
+ <div class="mgrid" style="margin-top:14px">
838
+ <div class="card"><div class="fhead">By day (last ${s.days.length})</div><div class="scroll"><table class="rt"><thead><tr><th>Day</th><th class="r">Downloads</th><th class="r">Networks</th><th class="r">Mac/Linux</th><th class="r">Windows</th></tr></thead><tbody>${days}</tbody></table></div></div>
839
+ <div class="card"><div class="fhead">Countries</div>${rows(s.countries, s.geo ? "No downloads yet." : "Places appear once the location database is on (PANTHEON_GEOIP=dbip).")}</div>
840
+ <div class="card"><div class="fhead">Cities</div>${rows(s.cities, s.geo ? "No downloads yet." : "Places appear once the location database is on (PANTHEON_GEOIP=dbip).")}</div>
841
+ </div>
842
+ <div class="card" style="margin-top:14px"><div class="fhead">How they were fetched</div>${rows(s.clients, "No downloads yet.")}</div>
843
+ <div class="card" style="margin-top:14px"><div class="fhead">Latest downloads</div><div class="scroll"><table class="rt"><thead><tr><th>When</th><th>File</th><th>Where</th><th>Network</th><th>Client</th><th></th></tr></thead><tbody>${s.recent.map((e) => `<tr><td>${when(e.at, "full")}</td><td class="mono">${esc(e.file)}</td><td>${place(e)}</td><td>${esc(e.org ?? "")}</td><td>${esc(e.client)}${e.os ? ` · ${esc(e.os)}` : ""}</td><td class="muted">${tag(e)}</td></tr>`).join("") || `<tr><td colspan="6" class="empty">No downloads yet.</td></tr>`}</tbody></table></div></div>
844
+ ${s.geo ? `<p class="note">IP geolocation by <a href="https://db-ip.com">DB-IP</a>, read on this relay; no address is kept or sent anywhere.</p>` : ""}
845
+ </section>`;
846
+ }
820
847
  //# sourceMappingURL=admin-pages.js.map
@@ -10,6 +10,7 @@ import { CONFIG_DIR } from "./config.js";
10
10
  import { proxyEnvFor } from "./network.js";
11
11
  import { agentSpawn } from "./which.js";
12
12
  import { agentBaseEnv } from "./worker.js";
13
+ import { claudeRouting, effectiveRunModel, loadPolicy } from "./worker-policy.js";
13
14
  export const CHECK_TIMEOUT_MS = 60_000;
14
15
  export const CHECK_PROMPT = "This is Pantheon's setup check. Call the pantheon_status tool once, then reply with exactly the text it returned and nothing else.";
15
16
  function runIt(s, cwd, timeoutMs) {
@@ -86,9 +87,17 @@ export async function checkAgent(cfg, deps) {
86
87
  const token = backend.id === "claude-code" ? claudeTokenForRun() : null;
87
88
  const features = backend.id === "claude-code" ? (deps.claudeFeatures ?? detectClaudeFeatures)(binary) : null;
88
89
  const home = homedir();
90
+ const routing = backend.id === "claude-code" ? claudeRouting() : null;
91
+ const model = deps.model !== undefined ? deps.model : (() => { try {
92
+ return effectiveRunModel(backend.id, loadPolicy(), routing).model;
93
+ }
94
+ catch {
95
+ return effectiveRunModel(backend.id, null, routing).model;
96
+ } })();
89
97
  const s = headlessSpawn({
90
98
  backend, binary, prompt: CHECK_PROMPT, worktree: work, cfg, branch: "pantheon-check", allowBash: false, selfTest: word, runHome,
91
99
  ...(token ? { claudeToken: token } : {}),
100
+ ...(model ? { model } : {}),
92
101
  ...(features ? { claude: { features, pantheonHome: CONFIG_DIR, home, userSettings: join(home, ".claude", "settings.json") } } : {}),
93
102
  });
94
103
  materializeSpawnFiles(work, s, runHome);
package/dist/agents.js CHANGED
@@ -737,6 +737,10 @@ export function headlessSpawn(opts) {
737
737
  notes.push("no --settings on this Claude Code: no deny rules and no sandbox — the command list is not a boundary");
738
738
  }
739
739
  }
740
+ if (opts.model && (f.model || f.unknown))
741
+ extra.push("--model", opts.model);
742
+ else if (opts.model)
743
+ notes.push(`no --model on this Claude Code: the run uses the person's own default model, not ${opts.model}`);
740
744
  if (rulesOnArgv.length) {
741
745
  const fixed = claudeCommandRules().length;
742
746
  let used = 0;
@@ -775,6 +779,7 @@ export function headlessSpawn(opts) {
775
779
  ? ["--approve-for-me"]
776
780
  : ["--sandbox", "read-only"]),
777
781
  "--skip-git-repo-check",
782
+ ...(opts.model ? ["--model", opts.model] : []),
778
783
  "--ignore-user-config",
779
784
  "-c", `mcp_servers.pantheon.command=${str(entry.command)}`,
780
785
  "-c", `mcp_servers.pantheon.args=${list(entry.args)}`,
@@ -798,6 +803,7 @@ export function headlessSpawn(opts) {
798
803
  "-p", opts.prompt, "-s",
799
804
  "--no-auto-update", "--no-ask-user", "--disable-builtin-mcps",
800
805
  "--disable-mcp-server", "pantheon",
806
+ ...(opts.model ? ["--model", opts.model] : []),
801
807
  ...(opts.allowBash ? ["--allow-all-tools"] : [`--allow-tool=${COPILOT_WORKER_SERVER}`, "--allow-tool=write"]),
802
808
  ],
803
809
  env: { ...procEnv, COPILOT_HOME: home },
@@ -818,7 +824,7 @@ export function headlessSpawn(opts) {
818
824
  const settings = join(kiroHome(), "settings", "cli.json");
819
825
  return {
820
826
  command: opts.binary,
821
- args: ["chat", "--no-interactive", "--agent", agentName, "--require-mcp-startup", "--wrap", "never", opts.prompt],
827
+ args: ["chat", "--no-interactive", "--agent", agentName, "--require-mcp-startup", "--wrap", "never", ...(opts.model ? ["--model", opts.model] : []), opts.prompt],
822
828
  env: { ...procEnv, KIRO_HOME: home, KIRO_NO_AUTO_UPDATE: "1" },
823
829
  writeFiles: [{
824
830
  path: join(home, "agents", `${KIRO_WORKER_AGENT}.json`),
@@ -842,6 +848,7 @@ export function headlessSpawn(opts) {
842
848
  "--output-format", "text",
843
849
  "--trust",
844
850
  "--approve-mcps",
851
+ ...(opts.model ? ["--model", opts.model] : []),
845
852
  ...(opts.allowBash ? ["--force"] : []),
846
853
  ],
847
854
  env: procEnv,
@@ -17,6 +17,7 @@ export function parseClaudeHelp(help, version = null) {
17
17
  settingSources: /(^|\s)--setting-sources\b/m.test(help),
18
18
  disallowedTools: /(^|\s)--disallowed-?tools\b/im.test(help),
19
19
  addDir: /(^|\s)--add-dir\b/m.test(help),
20
+ model: /(^|\s)--model\b/m.test(help),
20
21
  };
21
22
  }
22
23
  export function versionAtLeast(a, b) {