pantheon-cli 0.2.36 → 0.2.39

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/pantheon.mjs +64 -21
  2. package/package.json +1 -1
package/dist/pantheon.mjs CHANGED
@@ -21695,6 +21695,7 @@ import { join as join2 } from "node:path";
21695
21695
  var SKILL_DIR = "skills";
21696
21696
  var DRAFT_DIR = "draft";
21697
21697
  var MAX_LIVE_SKILLS = 12;
21698
+ var MAX_REVIEW_DRAFTS = 5;
21698
21699
  function skillsDir(root, status = "live") {
21699
21700
  return status === "live" ? join2(root, SKILL_DIR) : join2(root, SKILL_DIR, DRAFT_DIR);
21700
21701
  }
@@ -21793,6 +21794,21 @@ function saveSkill(root, input, status = "draft") {
21793
21794
  "A skill needs a description saying when to use it. That line is all an agent sees before deciding to open it."
21794
21795
  );
21795
21796
  }
21797
+ const canonical = (value) => value.toLowerCase().replace(/^use when\b/i, "").replace(/[^a-z0-9]+/g, " ").trim();
21798
+ for (const existing of [
21799
+ ...listSkills(root, "live"),
21800
+ ...listSkills(root, "draft")
21801
+ ]) {
21802
+ const sameName = existing.name === name;
21803
+ const sameKey = Boolean(input.key && existing.key && input.key === existing.key);
21804
+ const sameTrigger = canonical(existing.when) === canonical(input.when);
21805
+ const sameBody = canonical(existing.body) === canonical(input.body);
21806
+ if (sameName || sameKey || sameTrigger || sameBody) {
21807
+ throw new Error(
21808
+ `This repeats the existing ${existing.status} skill "${existing.name}". Review or retire that one instead of creating another.`
21809
+ );
21810
+ }
21811
+ }
21796
21812
  const dir = skillsDir(root, status);
21797
21813
  mkdirSync(dir, { recursive: true });
21798
21814
  writeFileSync(
@@ -23150,7 +23166,11 @@ function skillReview(home, space, cwd) {
23150
23166
  const { slug, root } = resolveForRead(home, space, { create: false });
23151
23167
  const sessions = sessionDirs(root).slice(0, SKILL_SCAN_SESSIONS).map((session) => ({ id: session.id, turns: readSessionTurns(session.dir) }));
23152
23168
  const live = skillRefs(root);
23153
- const drafts = listSkills(root, "draft").map((skill) => skill.name);
23169
+ const drafts = listSkills(root, "draft").map((skill) => ({
23170
+ name: skill.name,
23171
+ when: skill.when,
23172
+ sessions: skill.sessions
23173
+ }));
23154
23174
  const corrections = [];
23155
23175
  const routines = /* @__PURE__ */ new Map();
23156
23176
  let turns = 0;
@@ -23222,7 +23242,7 @@ function reviewNote(input) {
23222
23242
  "Tool output is not archived from every client, so the strongest evidence \u2014 what a command actually printed when it failed \u2014 usually exists only in the conversation you are having now. Weigh that alongside these."
23223
23243
  );
23224
23244
  parts.push(
23225
- `Save at most two drafts, and save none if nothing here recurred: this space is using ${input.slots} of ${MAX_LIVE_SKILLS} live slots and every promoted skill costs context on every future resume. Do not ask first \u2014 drafts are inert until the human approves them on the space page. Call pantheon_save_skill with evidence citing the session and turn each claim came from.`
23245
+ `Save at most ${MAX_REVIEW_DRAFTS} drafts, and save none if nothing here recurred: this space is using ${input.slots} of ${MAX_LIVE_SKILLS} live slots and every promoted skill costs context on every future resume. If no draft is justified, say only "Nothing worth creating a skill for." Compare each lesson against both live and draft skill triggers and do not restate one under a different name; the save also refuses repeated names, candidate keys, triggers, and bodies. Do not ask first \u2014 drafts are inert until the human approves them on the space page. Call pantheon_save_skill with evidence citing the session and turn each claim came from.`
23226
23246
  );
23227
23247
  return parts.join(" ");
23228
23248
  }
@@ -23471,7 +23491,7 @@ Grounding \u2014 never break these:
23471
23491
  - Never invent a slug yourself. The human's typed name is the only new-space source.
23472
23492
  - If pantheon_* tools are missing or fail, say "Pantheon MCP is not connected" and stop. Do not guess.
23473
23493
  - /pantheon-spaces \u2192 call pantheon_list_spaces, then show only those slugs.
23474
- - /pantheon-skills \u2192 call pantheon_skill_review, then save what it justifies with pantheon_save_skill without asking first: a draft is inert until the human promotes it on the space page, so that is where they approve or reject. Never nominate a skill without the review, and cite the turns any claim rests on. Saving none is a normal, common outcome \u2014 say so plainly rather than finding something to fill the silence.
23494
+ - /pantheon-skills \u2192 call pantheon_skill_review, then save what it justifies with pantheon_save_skill without asking first: a draft is inert until the human promotes it on the space page, so that is where they approve or reject. Never nominate a skill without the review, and cite the turns any claim rests on. If none is justified, say only "Nothing worth creating a skill for."
23475
23495
  - Do not narrate a command. No preamble about which tools you can see, whether MCP is connected, or what you are about to do \u2014 run it and report what happened. A call that actually failed is worth one line.
23476
23496
  - Files you generated (PDFs, letters, CVs, spreadsheets) must go in artifacts as base64. Handoff is rejected if the chat names a .pdf and you omit it.
23477
23497
  - After resume, the packet covers the whole space but is still a summary of it. Before you tell the human something was not carried over, call pantheon_search (it reads tool calls too) and pantheon_get_turns on any id from the sessions list.
@@ -23518,17 +23538,21 @@ Tutorial
23518
23538
  Missing context is nearly always unsearched, not unsaved.
23519
23539
  6. Write down what the project learned: /pantheon-skills <space>
23520
23540
  \u2192 pantheon_skill_review
23521
- A skill is guidance every later resume of that space carries, so it is
23522
- how a lesson outlives the chat that taught it. The tool returns signals,
23541
+ A skill gives every later resume its name and trigger, then the agent
23542
+ fetches the body when the work matches. That is how a lesson outlives the
23543
+ chat that taught it without spending its whole body on every conversation.
23544
+ The tool returns signals,
23523
23545
  not findings \u2014 corrections the human repeated, commands run across
23524
23546
  several conversations \u2014 and you weigh them against THIS chat, where the
23525
23547
  errors you actually hit are still visible. Most clients never archive
23526
23548
  what a tool printed, so that is evidence only you hold.
23527
- Save at most two as drafts, citing the turns each came from. No need to
23528
- ask: a draft reaches no agent until it is promoted on the space page,
23529
- which is where it is approved or rejected. None is the ordinary answer:
23530
- a live skill is loaded into every future resume, so an unread one is a
23531
- permanent tax. Never write what AGENTS.md or the README already says.
23549
+ Save at most five as drafts, citing the turns each came from. Compare the
23550
+ live and draft triggers first, and never repeat an existing lesson under
23551
+ another name. No need to ask: a draft reaches no agent until it is
23552
+ promoted on the space page, which is where it is approved or rejected.
23553
+ None is the ordinary answer: every live skill spends resume context. Say
23554
+ "Nothing worth creating a skill for." when no draft is justified.
23555
+ Never write what AGENTS.md or the README already says.
23532
23556
  7. Spaces someone shared with you appear in pantheon_list_spaces with an
23533
23557
  owner, and resume the same way \u2014 /pantheon-resume preorders, or
23534
23558
  /pantheon-resume obirikan/preorders when two spaces share a name.
@@ -23562,7 +23586,7 @@ MCP tools \u2014 always the pantheon_ prefix
23562
23586
  pantheon_forget_session delete one archived chat, when capture read the
23563
23587
  wrong one. Not undoable \u2014 confirm the id first.
23564
23588
  pantheon_skill_review read a space for lessons worth writing down, then
23565
- save at most two inert drafts \u2014 or none, which is usual
23589
+ save at most five inert, non-repeating drafts
23566
23590
  pantheon_get_skill read one skill's guidance
23567
23591
  pantheon_save_skill write a skill as a draft, citing the turns it came
23568
23592
  from. A draft reaches no agent until promoted.
@@ -24032,10 +24056,27 @@ function registerTool(server, name, description, schema, handler) {
24032
24056
  function createPantheonServer(home = defaultHome(), hooks, options = {}) {
24033
24057
  const vault = vaultHooks(hooks);
24034
24058
  const allowCapture = options.allowCapture !== false;
24059
+ const site = (process.env.NEXT_PUBLIC_APP_URL || "https://pantheon-ui-web.vercel.app").replace(/\/$/, "");
24035
24060
  const server = new McpServer(
24036
24061
  {
24037
24062
  name: "pantheon",
24038
- version: "0.1.0"
24063
+ title: "Pantheon",
24064
+ version: "0.1.0",
24065
+ websiteUrl: site,
24066
+ icons: [
24067
+ {
24068
+ src: `${site}/pantheon-mcp-light.png`,
24069
+ mimeType: "image/png",
24070
+ sizes: ["512x512"],
24071
+ theme: "light"
24072
+ },
24073
+ {
24074
+ src: `${site}/pantheon-mcp-dark.png`,
24075
+ mimeType: "image/png",
24076
+ sizes: ["512x512"],
24077
+ theme: "dark"
24078
+ }
24079
+ ]
24039
24080
  },
24040
24081
  { instructions: MCP_INSTRUCTIONS }
24041
24082
  );
@@ -24293,7 +24334,7 @@ ${GUIDE}` }]
24293
24334
  registerTool(
24294
24335
  server,
24295
24336
  "pantheon_save_skill",
24296
- "Write a skill into a Pantheon space as a DRAFT for the human to review on the space page. Call this after pantheon_skill_review when something genuinely recurred, when pantheon_handoff returned a skillCandidate, or when the human asks for a skill \u2014 but never speculatively, because an unread skill costs every future agent context for nothing. A draft needs no permission: it is inert until promoted, and the space page is where it is approved or rejected. Ground every instruction in the cited evidence: say what failed, what fixed it, and cite session and turn. Do not restate anything already in AGENTS.md or the README.",
24337
+ "Write a skill into a Pantheon space as a DRAFT for the human to review on the space page. Call this after pantheon_skill_review when something genuinely recurred, when pantheon_handoff returned a skillCandidate, or when the human asks for a skill \u2014 but never speculatively, because an unread skill costs every future agent context for nothing. A draft needs no permission: it is inert until promoted, and the space page is where it is approved or rejected. Compare the review's live and draft triggers first; repeated names, candidate keys, triggers, and bodies are refused. Ground every instruction in the cited evidence: say what failed, what fixed it, and cite session and turn. Do not restate anything already in AGENTS.md or the README.",
24297
24338
  {
24298
24339
  space: external_exports.string(),
24299
24340
  name: external_exports.string().describe("Short slug, e.g. nextjs-og-images."),
@@ -24325,7 +24366,7 @@ ${GUIDE}` }]
24325
24366
  registerTool(
24326
24367
  server,
24327
24368
  "pantheon_skill_review",
24328
- "Review a Pantheon space for lessons worth writing down as a skill. Trigger: /pantheon-skills <space>. Returns what this space already has, how many of its live slots are spent, and the recurring signals its archive still holds: times the human corrected an agent, commands run across several conversations, and any deterministic candidates. These are raw material, not findings \u2014 read the turns with pantheon_get_turns before believing any of them. Judge the conversation you are having now as well, and weigh it heavily: most clients never archive what a tool printed, so a failure you hit in this chat is evidence that exists nowhere else. Then save AT MOST TWO with pantheon_save_skill, and save none if nothing genuinely recurred \u2014 none is the ordinary answer and a space with no skills is healthier than one with skills nobody reads. Never write a skill for something AGENTS.md or the README already says. Do not ask permission first: a saved skill is a draft and no agent is ever given it until the human promotes it on the space page, which is where they approve or reject. Cite evidence with the turns you read. Report only the names you saved and what each tells a future agent, in a line or two \u2014 no preamble about which tools you have or what you are about to do.",
24369
+ `Review a Pantheon space for lessons worth writing down as a skill. Trigger: /pantheon-skills <space>. Returns what this space already has \u2014 live and draft names with their triggers \u2014 how many live slots are spent, and the recurring signals its archive still holds: times the human corrected an agent, commands run across several conversations, and any deterministic candidates. These are raw material, not findings \u2014 read the turns with pantheon_get_turns before believing any of them. Judge the conversation you are having now as well, and weigh it heavily: most clients never archive what a tool printed, so a failure you hit in this chat is evidence that exists nowhere else. Then save AT MOST ${MAX_REVIEW_DRAFTS} with pantheon_save_skill, and save none if nothing genuinely recurred \u2014 none is the ordinary answer and a space with no skills is healthier than one with skills nobody reads. Do not repeat an existing live or draft lesson under different wording, and never write a skill for something AGENTS.md or the README already says. Do not ask permission first: a saved skill is a draft and no agent is ever given it until the human promotes it on the space page, which is where they approve or reject. Cite evidence with the turns you read. Report only the names you saved and what each tells a future agent, in a line or two. If no draft is justified, say only "Nothing worth creating a skill for." No preamble about which tools you have or what you are about to do.`,
24329
24370
  { space: external_exports.string(), cwd: external_exports.string().optional() },
24330
24371
  async ({ space, cwd }) => safe(() => skillReview(home, space, cwd || process.cwd()))
24331
24372
  );
@@ -24625,11 +24666,11 @@ Only then call pantheon_skill_review with that space, passing cwd when the proje
24625
24666
 
24626
24667
  Judge THIS conversation too, and weigh it heavily. Most clients never write down what a tool printed, so a failure you hit in this chat is evidence that exists nowhere else \u2014 a command that failed until you found the flag, a correction the human had to repeat, an approach that turned out to be wrong. That is the material only you have.
24627
24668
 
24628
- Save AT MOST TWO, and save none if nothing genuinely recurred. None is the ordinary answer: a live skill is loaded into every future resume of this space, so an unread one is a permanent tax. Never write one for something AGENTS.md or the README already says \u2014 the review tells you which commands are already documented \u2014 or for a restatement of what the code plainly does.
24669
+ Save AT MOST FIVE, and save none if nothing genuinely recurred. Compare every lesson against the live and draft names and triggers in the review; never restate one under a different name. The save also refuses repeated names, candidate keys, triggers, and bodies. None is the ordinary answer: every live skill adds its name and trigger to future resumes, so an unread one is a permanent tax. Never write one for something AGENTS.md or the README already says \u2014 the review tells you which commands are already documented \u2014 or for a restatement of what the code plainly does.
24629
24670
 
24630
24671
  Write them with pantheon_save_skill yourself, without asking permission first. A saved skill is a draft and is inert: no agent is ever given it until the human promotes it on the space page, so that page is where they approve or reject, not this chat. Cite evidence with the sessions and turns you actually read \u2014 the vault checks those ids and refuses the save if one does not exist. Call pantheon_dismiss_skill with its key for any deterministic candidate you decided against, so it stops being offered.
24631
24672
 
24632
- Report in one or two lines: the names you saved and what each one tells a future agent. If you saved nothing, say only that nothing recurred.
24673
+ Report in one or two lines: the names you saved and what each one tells a future agent. If you saved nothing, say only "Nothing worth creating a skill for."
24633
24674
 
24634
24675
  ${quiet}`
24635
24676
  },
@@ -24715,11 +24756,13 @@ where the work was, which is the part the human asked for, so never fold that
24715
24756
  into cells.
24716
24757
 
24717
24758
  After \`pantheon_skill_review\`, decide and act: save what is worth writing with
24718
- \`pantheon_save_skill\` \u2014 at most two, and often none \u2014 without asking first. A
24719
- draft is inert until the human promotes it on the space page, so that page is
24720
- where they approve or reject, not the chat. Then report in prose, not a table:
24721
- the names you saved and what each tells a future agent, one line each. If nothing
24722
- recurred, say only that; it is the common case and not a failure.
24759
+ \`pantheon_save_skill\` \u2014 at most five, and often none \u2014 without asking first.
24760
+ Compare its live and draft triggers first; never duplicate an existing lesson
24761
+ under a different name. A draft is inert until the human promotes it on the
24762
+ space page, so that page is where they approve or reject, not the chat. Then
24763
+ report in prose, not a table: the names you saved and what each tells a future
24764
+ agent, one line each. If you save nothing, say only "Nothing worth creating a
24765
+ skill for." It is the common case and not a failure.
24723
24766
 
24724
24767
  ## Do not narrate
24725
24768
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-cli",
3
- "version": "0.2.36",
3
+ "version": "0.2.39",
4
4
  "description": "Carry agent conscience between AI coding agents. Hand off a conversation in one agent, resume it in another.",
5
5
  "license": "MIT",
6
6
  "type": "module",