pantheon-cli 0.2.36 → 0.2.37
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/pantheon.mjs +61 -19
- 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) =>
|
|
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
|
|
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. 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
|
}
|
|
@@ -23518,17 +23538,20 @@ 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
|
|
23522
|
-
|
|
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
|
|
23528
|
-
|
|
23529
|
-
|
|
23530
|
-
|
|
23531
|
-
|
|
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.
|
|
23554
|
+
Never write what AGENTS.md or the README already says.
|
|
23532
23555
|
7. Spaces someone shared with you appear in pantheon_list_spaces with an
|
|
23533
23556
|
owner, and resume the same way \u2014 /pantheon-resume preorders, or
|
|
23534
23557
|
/pantheon-resume obirikan/preorders when two spaces share a name.
|
|
@@ -23562,7 +23585,7 @@ MCP tools \u2014 always the pantheon_ prefix
|
|
|
23562
23585
|
pantheon_forget_session delete one archived chat, when capture read the
|
|
23563
23586
|
wrong one. Not undoable \u2014 confirm the id first.
|
|
23564
23587
|
pantheon_skill_review read a space for lessons worth writing down, then
|
|
23565
|
-
save at most
|
|
23588
|
+
save at most five inert, non-repeating drafts
|
|
23566
23589
|
pantheon_get_skill read one skill's guidance
|
|
23567
23590
|
pantheon_save_skill write a skill as a draft, citing the turns it came
|
|
23568
23591
|
from. A draft reaches no agent until promoted.
|
|
@@ -24032,10 +24055,27 @@ function registerTool(server, name, description, schema, handler) {
|
|
|
24032
24055
|
function createPantheonServer(home = defaultHome(), hooks, options = {}) {
|
|
24033
24056
|
const vault = vaultHooks(hooks);
|
|
24034
24057
|
const allowCapture = options.allowCapture !== false;
|
|
24058
|
+
const site = (process.env.NEXT_PUBLIC_APP_URL || "https://pantheon-ui-web.vercel.app").replace(/\/$/, "");
|
|
24035
24059
|
const server = new McpServer(
|
|
24036
24060
|
{
|
|
24037
24061
|
name: "pantheon",
|
|
24038
|
-
|
|
24062
|
+
title: "Pantheon",
|
|
24063
|
+
version: "0.1.0",
|
|
24064
|
+
websiteUrl: site,
|
|
24065
|
+
icons: [
|
|
24066
|
+
{
|
|
24067
|
+
src: `${site}/pantheon-mcp-light.png`,
|
|
24068
|
+
mimeType: "image/png",
|
|
24069
|
+
sizes: ["512x512"],
|
|
24070
|
+
theme: "light"
|
|
24071
|
+
},
|
|
24072
|
+
{
|
|
24073
|
+
src: `${site}/pantheon-mcp-dark.png`,
|
|
24074
|
+
mimeType: "image/png",
|
|
24075
|
+
sizes: ["512x512"],
|
|
24076
|
+
theme: "dark"
|
|
24077
|
+
}
|
|
24078
|
+
]
|
|
24039
24079
|
},
|
|
24040
24080
|
{ instructions: MCP_INSTRUCTIONS }
|
|
24041
24081
|
);
|
|
@@ -24293,7 +24333,7 @@ ${GUIDE}` }]
|
|
|
24293
24333
|
registerTool(
|
|
24294
24334
|
server,
|
|
24295
24335
|
"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.",
|
|
24336
|
+
"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
24337
|
{
|
|
24298
24338
|
space: external_exports.string(),
|
|
24299
24339
|
name: external_exports.string().describe("Short slug, e.g. nextjs-og-images."),
|
|
@@ -24325,7 +24365,7 @@ ${GUIDE}` }]
|
|
|
24325
24365
|
registerTool(
|
|
24326
24366
|
server,
|
|
24327
24367
|
"pantheon_skill_review",
|
|
24328
|
-
|
|
24368
|
+
`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 \u2014 no preamble about which tools you have or what you are about to do.`,
|
|
24329
24369
|
{ space: external_exports.string(), cwd: external_exports.string().optional() },
|
|
24330
24370
|
async ({ space, cwd }) => safe(() => skillReview(home, space, cwd || process.cwd()))
|
|
24331
24371
|
);
|
|
@@ -24625,7 +24665,7 @@ Only then call pantheon_skill_review with that space, passing cwd when the proje
|
|
|
24625
24665
|
|
|
24626
24666
|
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
24667
|
|
|
24628
|
-
Save AT MOST
|
|
24668
|
+
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
24669
|
|
|
24630
24670
|
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
24671
|
|
|
@@ -24715,11 +24755,13 @@ where the work was, which is the part the human asked for, so never fold that
|
|
|
24715
24755
|
into cells.
|
|
24716
24756
|
|
|
24717
24757
|
After \`pantheon_skill_review\`, decide and act: save what is worth writing with
|
|
24718
|
-
\`pantheon_save_skill\` \u2014 at most
|
|
24719
|
-
|
|
24720
|
-
|
|
24721
|
-
|
|
24722
|
-
|
|
24758
|
+
\`pantheon_save_skill\` \u2014 at most five, and often none \u2014 without asking first.
|
|
24759
|
+
Compare its live and draft triggers first; never duplicate an existing lesson
|
|
24760
|
+
under a different name. A draft is inert until the human promotes it on the
|
|
24761
|
+
space page, so that page is where they approve or reject, not the chat. Then
|
|
24762
|
+
report in prose, not a table: the names you saved and what each tells a future
|
|
24763
|
+
agent, one line each. If nothing recurred, say only that; it is the common case
|
|
24764
|
+
and not a failure.
|
|
24723
24765
|
|
|
24724
24766
|
## Do not narrate
|
|
24725
24767
|
|
package/package.json
CHANGED