pantheon-cli 0.2.32 → 0.2.36
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 +213 -59
- package/package.json +1 -1
package/dist/pantheon.mjs
CHANGED
|
@@ -22596,9 +22596,13 @@ function missingGeneratedFiles(turns, artifacts = []) {
|
|
|
22596
22596
|
}
|
|
22597
22597
|
var PACKET_TURNS = 14;
|
|
22598
22598
|
var PACKET_TURN_CHARS = 400;
|
|
22599
|
-
|
|
22599
|
+
var PACKET_ARTIFACTS = 40;
|
|
22600
|
+
var PACKET_STORY = 4;
|
|
22601
|
+
var PACKET_STORY_CHARS = 2400;
|
|
22602
|
+
var PACKET_SESSIONS = 20;
|
|
22603
|
+
function sessionLine(session, current, mark = "\u2190 this packet") {
|
|
22600
22604
|
const detail = [session.source, session.updatedAt && `updated ${session.updatedAt}`].filter(Boolean).join(", ");
|
|
22601
|
-
return `- ${session.id} \u2014 ${session.turns} turns${detail ? ` (${detail})` : ""}${current ?
|
|
22605
|
+
return `- ${session.id} \u2014 ${session.turns} turns${detail ? ` (${detail})` : ""}${current ? ` ${mark}` : ""}`;
|
|
22602
22606
|
}
|
|
22603
22607
|
function fullHistory(slug, turns, sessionId, sessions) {
|
|
22604
22608
|
const total = sessions.reduce((sum, session) => sum + session.turns, 0) || turns;
|
|
@@ -22622,6 +22626,56 @@ function fullHistory(slug, turns, sessionId, sessions) {
|
|
|
22622
22626
|
);
|
|
22623
22627
|
return lines;
|
|
22624
22628
|
}
|
|
22629
|
+
function recentTurns(root, limit) {
|
|
22630
|
+
const picked = [];
|
|
22631
|
+
for (const session of sessionDirs(root)) {
|
|
22632
|
+
if (picked.length >= limit) break;
|
|
22633
|
+
const spoken = readSessionTurns(session.dir).filter((turn) => turn.text.trim());
|
|
22634
|
+
for (let i = spoken.length - 1; i >= 0 && picked.length < limit; i -= 1) {
|
|
22635
|
+
picked.push({ sessionId: session.id, spoken: spoken.length, turn: spoken[i] });
|
|
22636
|
+
}
|
|
22637
|
+
}
|
|
22638
|
+
return picked.reverse();
|
|
22639
|
+
}
|
|
22640
|
+
function turnLines(picked) {
|
|
22641
|
+
const lines = [];
|
|
22642
|
+
let session = "";
|
|
22643
|
+
for (const item of picked) {
|
|
22644
|
+
if (item.sessionId !== session) {
|
|
22645
|
+
session = item.sessionId;
|
|
22646
|
+
if (lines.length) lines.push("");
|
|
22647
|
+
lines.push(`From ${item.sessionId} (${item.spoken} spoken turns):`);
|
|
22648
|
+
}
|
|
22649
|
+
lines.push(
|
|
22650
|
+
`- [${item.turn.id}] ${item.turn.role}: ${item.turn.text.replace(/\s+/g, " ").slice(0, PACKET_TURN_CHARS)}`
|
|
22651
|
+
);
|
|
22652
|
+
}
|
|
22653
|
+
return lines;
|
|
22654
|
+
}
|
|
22655
|
+
function spaceArtifacts(root) {
|
|
22656
|
+
const groups = [];
|
|
22657
|
+
let total = 0;
|
|
22658
|
+
let listed = 0;
|
|
22659
|
+
let sessions = 0;
|
|
22660
|
+
for (const session of sessionDirs(root)) {
|
|
22661
|
+
const dir = join3(session.dir, "artifacts");
|
|
22662
|
+
if (!existsSync3(dir)) continue;
|
|
22663
|
+
const names = [];
|
|
22664
|
+
let held = 0;
|
|
22665
|
+
for (const name of readdirSync3(dir)) {
|
|
22666
|
+
if (name.startsWith(".")) continue;
|
|
22667
|
+
total += 1;
|
|
22668
|
+
held += 1;
|
|
22669
|
+
if (listed < PACKET_ARTIFACTS) {
|
|
22670
|
+
names.push(name);
|
|
22671
|
+
listed += 1;
|
|
22672
|
+
}
|
|
22673
|
+
}
|
|
22674
|
+
if (held) sessions += 1;
|
|
22675
|
+
if (names.length) groups.push({ sessionId: session.id, names });
|
|
22676
|
+
}
|
|
22677
|
+
return { groups, total, listed, sessions };
|
|
22678
|
+
}
|
|
22625
22679
|
function distill(input) {
|
|
22626
22680
|
const { space, source, turns, summary, artifacts, sessionId, sessions } = input;
|
|
22627
22681
|
const spoken = turns.filter((turn) => turn.text.trim());
|
|
@@ -22650,6 +22704,65 @@ function distill(input) {
|
|
|
22650
22704
|
return `${lines.filter((line) => line !== null).join("\n")}
|
|
22651
22705
|
`;
|
|
22652
22706
|
}
|
|
22707
|
+
function spaceDistill(input) {
|
|
22708
|
+
const { root, space, source, turns, summary, sessionId, sessions, earlier } = input;
|
|
22709
|
+
const slug = slugify(space);
|
|
22710
|
+
const total = sessions.reduce((sum, session) => sum + session.turns, 0) || turns.length;
|
|
22711
|
+
const toolCalls = turns.reduce((sum, turn) => sum + (turn.toolCalls?.length || 0), 0);
|
|
22712
|
+
const files2 = spaceArtifacts(root);
|
|
22713
|
+
const picked = recentTurns(root, PACKET_TURNS);
|
|
22714
|
+
const lines = [
|
|
22715
|
+
`# Handoff: ${space}`,
|
|
22716
|
+
`Space: ${total} turns across ${sessions.length} session${sessions.length === 1 ? "" : "s"} \xB7 ${files2.total} stored file${files2.total === 1 ? "" : "s"} \xB7 ${nowIso()}`,
|
|
22717
|
+
`Latest: ${source || "unknown"} \xB7 ${turns.length} turns \xB7 ${toolCalls} tool calls \xB7 ${sessionId}`,
|
|
22718
|
+
"",
|
|
22719
|
+
"## Packet",
|
|
22720
|
+
summary?.trim() || "Continue from the stored archive. This packet is a pointer, not the conversation \u2014 read the full transcript before assuming context."
|
|
22721
|
+
];
|
|
22722
|
+
if (earlier.length) {
|
|
22723
|
+
lines.push("", "## Earlier packets");
|
|
22724
|
+
for (const item of [...earlier].reverse()) {
|
|
22725
|
+
lines.push("", `### ${item.at}`, item.packet);
|
|
22726
|
+
}
|
|
22727
|
+
}
|
|
22728
|
+
lines.push("", "## Artifacts");
|
|
22729
|
+
if (files2.total) {
|
|
22730
|
+
lines.push(
|
|
22731
|
+
`${files2.total} stored across ${files2.sessions} session${files2.sessions === 1 ? "" : "s"}. Fetch with pantheon_get_artifact (space, session_id, name).`
|
|
22732
|
+
);
|
|
22733
|
+
for (const group of files2.groups) {
|
|
22734
|
+
lines.push("", `From ${group.sessionId}:`, ...group.names.map((name) => `- ${name}`));
|
|
22735
|
+
}
|
|
22736
|
+
if (files2.total > files2.listed) {
|
|
22737
|
+
lines.push("", `\u2026and ${files2.total - files2.listed} more not listed here.`);
|
|
22738
|
+
}
|
|
22739
|
+
} else {
|
|
22740
|
+
lines.push("- (none stored in this space)");
|
|
22741
|
+
}
|
|
22742
|
+
lines.push(
|
|
22743
|
+
"",
|
|
22744
|
+
picked.length ? `## Last ${picked.length} spoken turns` : "## Last spoken turns",
|
|
22745
|
+
...picked.length ? turnLines(picked) : ["- (nothing spoken yet)"],
|
|
22746
|
+
"",
|
|
22747
|
+
...spaceHistory(slug, sessions, sessionId),
|
|
22748
|
+
""
|
|
22749
|
+
);
|
|
22750
|
+
return `${lines.filter((line) => line !== null).join("\n")}
|
|
22751
|
+
`;
|
|
22752
|
+
}
|
|
22753
|
+
function spaceHistory(slug, sessions, latest) {
|
|
22754
|
+
const shown = sessions.slice(0, PACKET_SESSIONS);
|
|
22755
|
+
const hidden = sessions.length - shown.length;
|
|
22756
|
+
return [
|
|
22757
|
+
"## Full history",
|
|
22758
|
+
`Every session is archived verbatim, tool calls included, under spaces/${slug}/sessions/<id>/transcript.jsonl.`,
|
|
22759
|
+
...shown.map((session) => sessionLine(session, session.id === latest, "\u2190 ended last")),
|
|
22760
|
+
...hidden ? [`\u2026and ${hidden} older session${hidden === 1 ? "" : "s"}, listed in full by pantheon_resume.`] : [],
|
|
22761
|
+
"",
|
|
22762
|
+
`Search the whole space before deciding something is missing: pantheon_search (space: ${slug}, query: "<topic>") \u2014 it reads tool calls as well as messages.`,
|
|
22763
|
+
`Then pantheon_get_turns (space, session_id, from, to) for a range, or pantheon_get_session for one session end to end.`
|
|
22764
|
+
];
|
|
22765
|
+
}
|
|
22653
22766
|
function ensureSpace(home, name) {
|
|
22654
22767
|
const slug = slugify(name);
|
|
22655
22768
|
const root = spaceDir(home, slug);
|
|
@@ -22863,6 +22976,7 @@ function writeHandoff(home, input) {
|
|
|
22863
22976
|
const source = input.source || captured?.session.source;
|
|
22864
22977
|
const sessionId = captured ? captured.session.key : input.append ? latestSessionId(root) || void 0 : void 0;
|
|
22865
22978
|
const session = writeSession(root, source, turns, artifacts, sessionId);
|
|
22979
|
+
const sessions = sessionSummaries(root);
|
|
22866
22980
|
const packet = distill({
|
|
22867
22981
|
space: input.space,
|
|
22868
22982
|
source,
|
|
@@ -22870,10 +22984,24 @@ function writeHandoff(home, input) {
|
|
|
22870
22984
|
summary: input.summary,
|
|
22871
22985
|
artifacts: session.artifacts,
|
|
22872
22986
|
sessionId: session.sessionId,
|
|
22873
|
-
sessions
|
|
22987
|
+
sessions
|
|
22874
22988
|
});
|
|
22875
|
-
writeFileSync2(join3(root, "handoff.md"), packet);
|
|
22876
22989
|
writeFileSync2(join3(root, "handoffs", `${stamp()}.md`), packet);
|
|
22990
|
+
writeFileSync2(
|
|
22991
|
+
join3(root, "handoff.md"),
|
|
22992
|
+
spaceDistill({
|
|
22993
|
+
root,
|
|
22994
|
+
space: input.space,
|
|
22995
|
+
source,
|
|
22996
|
+
turns: session.turns,
|
|
22997
|
+
summary: input.summary,
|
|
22998
|
+
sessionId: session.sessionId,
|
|
22999
|
+
sessions,
|
|
23000
|
+
// Written after the stamped copy above so that copy is the one excluded
|
|
23001
|
+
// as "current" rather than the handoff before it.
|
|
23002
|
+
earlier: readStory(root, PACKET_STORY, PACKET_STORY_CHARS)
|
|
23003
|
+
})
|
|
23004
|
+
);
|
|
22877
23005
|
if (input.facts?.length) {
|
|
22878
23006
|
const extra = input.facts.map((fact) => `- ${fact.trim()}`).join("\n");
|
|
22879
23007
|
appendFileSync(join3(root, "memory.md"), `${extra}
|
|
@@ -22999,13 +23127,13 @@ function packetBody(markdown) {
|
|
|
22999
23127
|
function unstamp(name) {
|
|
23000
23128
|
return name.replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z$/, "T$1:$2:$3.$4Z");
|
|
23001
23129
|
}
|
|
23002
|
-
function readStory(root) {
|
|
23130
|
+
function readStory(root, packets = STORY_PACKETS, chars = STORY_CHARS) {
|
|
23003
23131
|
const dir = join3(root, "handoffs");
|
|
23004
23132
|
if (!existsSync3(dir)) return [];
|
|
23005
23133
|
const files2 = readdirSync3(dir).filter((name) => name.endsWith(".md")).sort();
|
|
23006
|
-
const prior = files2.slice(0, -1).slice(-
|
|
23134
|
+
const prior = files2.slice(0, -1).slice(-packets);
|
|
23007
23135
|
const out = [];
|
|
23008
|
-
let budget =
|
|
23136
|
+
let budget = chars;
|
|
23009
23137
|
for (const name of [...prior].reverse()) {
|
|
23010
23138
|
if (budget <= 0) break;
|
|
23011
23139
|
const packet = packetBody(readText(join3(dir, name)));
|
|
@@ -23094,7 +23222,7 @@ function reviewNote(input) {
|
|
|
23094
23222
|
"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."
|
|
23095
23223
|
);
|
|
23096
23224
|
parts.push(
|
|
23097
|
-
`
|
|
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.`
|
|
23098
23226
|
);
|
|
23099
23227
|
return parts.join(" ");
|
|
23100
23228
|
}
|
|
@@ -23140,7 +23268,7 @@ function resumeNote(sessions, turns, story, skills) {
|
|
|
23140
23268
|
];
|
|
23141
23269
|
if (sessions.length > 1) {
|
|
23142
23270
|
parts.push(
|
|
23143
|
-
"The packet
|
|
23271
|
+
"The packet covers the space \u2014 its totals, its stored files, its most recent turns wherever they happened, and the summaries of earlier handoffs \u2014 but it is still a summary. Every id in sessions works with pantheon_get_session and pantheon_get_turns."
|
|
23144
23272
|
);
|
|
23145
23273
|
}
|
|
23146
23274
|
if (story) {
|
|
@@ -23343,9 +23471,10 @@ Grounding \u2014 never break these:
|
|
|
23343
23471
|
- Never invent a slug yourself. The human's typed name is the only new-space source.
|
|
23344
23472
|
- If pantheon_* tools are missing or fail, say "Pantheon MCP is not connected" and stop. Do not guess.
|
|
23345
23473
|
- /pantheon-spaces \u2192 call pantheon_list_spaces, then show only those slugs.
|
|
23346
|
-
- /pantheon-skills \u2192 call pantheon_skill_review
|
|
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.
|
|
23475
|
+
- 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.
|
|
23347
23476
|
- 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.
|
|
23348
|
-
- After resume, the packet
|
|
23477
|
+
- 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.
|
|
23349
23478
|
- Shared spaces belong to someone else and are read-only. Resume, search and the get_* tools work on them exactly as on your own. Handoff, park, remember and save_skill are refused \u2014 do not retry with a different spelling, tell the human it is read-only and offer to write to a space they own. A bare name is enough when only one space matches; write owner/space when two do.
|
|
23350
23479
|
`;
|
|
23351
23480
|
var GUIDE = `pantheon \u2014 agent conscience
|
|
@@ -23395,10 +23524,11 @@ Tutorial
|
|
|
23395
23524
|
several conversations \u2014 and you weigh them against THIS chat, where the
|
|
23396
23525
|
errors you actually hit are still visible. Most clients never archive
|
|
23397
23526
|
what a tool printed, so that is evidence only you hold.
|
|
23398
|
-
|
|
23399
|
-
|
|
23400
|
-
|
|
23401
|
-
|
|
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.
|
|
23402
23532
|
7. Spaces someone shared with you appear in pantheon_list_spaces with an
|
|
23403
23533
|
owner, and resume the same way \u2014 /pantheon-resume preorders, or
|
|
23404
23534
|
/pantheon-resume obirikan/preorders when two spaces share a name.
|
|
@@ -23432,7 +23562,7 @@ MCP tools \u2014 always the pantheon_ prefix
|
|
|
23432
23562
|
pantheon_forget_session delete one archived chat, when capture read the
|
|
23433
23563
|
wrong one. Not undoable \u2014 confirm the id first.
|
|
23434
23564
|
pantheon_skill_review read a space for lessons worth writing down, then
|
|
23435
|
-
|
|
23565
|
+
save at most two inert drafts \u2014 or none, which is usual
|
|
23436
23566
|
pantheon_get_skill read one skill's guidance
|
|
23437
23567
|
pantheon_save_skill write a skill as a draft, citing the turns it came
|
|
23438
23568
|
from. A draft reaches no agent until promoted.
|
|
@@ -23478,10 +23608,12 @@ function saveMachineConfig(config2, credentials) {
|
|
|
23478
23608
|
}
|
|
23479
23609
|
|
|
23480
23610
|
// ../core/src/vault.ts
|
|
23481
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
23482
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync4, unlinkSync, writeFileSync as writeFileSync4 } from "node:fs";
|
|
23611
|
+
import { execFile, execFileSync as execFileSync2 } from "node:child_process";
|
|
23612
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync4, rmSync as rmSync3, unlinkSync, writeFileSync as writeFileSync4 } from "node:fs";
|
|
23483
23613
|
import { homedir as homedir4, tmpdir } from "node:os";
|
|
23484
23614
|
import { dirname, join as join5, resolve as resolve2 } from "node:path";
|
|
23615
|
+
import { promisify } from "node:util";
|
|
23616
|
+
var execFileAsync = promisify(execFile);
|
|
23485
23617
|
function gitEnv(extra = {}) {
|
|
23486
23618
|
return {
|
|
23487
23619
|
...process.env,
|
|
@@ -23648,7 +23780,7 @@ async function syncVault(home, opts = {}) {
|
|
|
23648
23780
|
}
|
|
23649
23781
|
|
|
23650
23782
|
// ../core/src/shares.ts
|
|
23651
|
-
import { existsSync as existsSync6, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync5, rmSync as
|
|
23783
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync5, rmSync as rmSync4, writeFileSync as writeFileSync5 } from "node:fs";
|
|
23652
23784
|
import { dirname as dirname2, join as join6 } from "node:path";
|
|
23653
23785
|
function ledgerPath(root) {
|
|
23654
23786
|
return join6(root, "manifest.json");
|
|
@@ -23696,7 +23828,7 @@ async function pullShares(home, options = {}) {
|
|
|
23696
23828
|
};
|
|
23697
23829
|
}
|
|
23698
23830
|
if (!shares.length) {
|
|
23699
|
-
if (existsSync6(root))
|
|
23831
|
+
if (existsSync6(root)) rmSync4(root, { recursive: true, force: true });
|
|
23700
23832
|
return { ok: true, spaces: 0, fetched: 0 };
|
|
23701
23833
|
}
|
|
23702
23834
|
mkdirSync5(root, { recursive: true });
|
|
@@ -23742,9 +23874,9 @@ async function pullShares(home, options = {}) {
|
|
|
23742
23874
|
for (const owner of dirNames(root)) {
|
|
23743
23875
|
for (const slug of dirNames(join6(root, owner))) {
|
|
23744
23876
|
if (keep.has(`${owner}/${slug}`)) continue;
|
|
23745
|
-
|
|
23877
|
+
rmSync4(join6(root, owner, slug), { recursive: true, force: true });
|
|
23746
23878
|
}
|
|
23747
|
-
if (!dirNames(join6(root, owner)).length)
|
|
23879
|
+
if (!dirNames(join6(root, owner)).length) rmSync4(join6(root, owner), { recursive: true, force: true });
|
|
23748
23880
|
}
|
|
23749
23881
|
writeFileSync5(ledgerPath(root), `${JSON.stringify(next, null, 2)}
|
|
23750
23882
|
`);
|
|
@@ -23766,11 +23898,11 @@ function prune(base, dir, wanted) {
|
|
|
23766
23898
|
const full = join6(dir, entry.name);
|
|
23767
23899
|
if (entry.isDirectory()) {
|
|
23768
23900
|
prune(base, full, wanted);
|
|
23769
|
-
if (!readdirSync4(full).length)
|
|
23901
|
+
if (!readdirSync4(full).length) rmSync4(full, { recursive: true, force: true });
|
|
23770
23902
|
continue;
|
|
23771
23903
|
}
|
|
23772
23904
|
const relative2 = full.slice(base.length + 1).split("\\").join("/");
|
|
23773
|
-
if (!wanted.has(relative2))
|
|
23905
|
+
if (!wanted.has(relative2)) rmSync4(full, { force: true });
|
|
23774
23906
|
}
|
|
23775
23907
|
}
|
|
23776
23908
|
function dirNames(root) {
|
|
@@ -23936,7 +24068,7 @@ ${GUIDE}` }]
|
|
|
23936
24068
|
registerTool(
|
|
23937
24069
|
server,
|
|
23938
24070
|
"pantheon_resume",
|
|
23939
|
-
"Pull the vault, then load a Pantheon conscience: the latest handoff packet, durable memory, packets from earlier handoffs (story), every archived session with its turn count (sessions), and stored artifact names. Trigger: /pantheon-resume <space>. If the space name is missing or empty, this tool lists live spaces \u2014 show that list and ask which conscience. The packet
|
|
24071
|
+
"Pull the vault, then load a Pantheon conscience: the latest handoff packet, durable memory, packets from earlier handoffs (story), every archived session with its turn count (sessions), and stored artifact names. Trigger: /pantheon-resume <space>. If the space name is missing or empty, this tool lists live spaces \u2014 show that list and ask which conscience. The packet covers the whole space \u2014 totals, stored files, the most recent turns wherever they happened, and summaries of earlier handoffs \u2014 but it is a summary, not the conversation: when the human asks about anything it does not cover, call pantheon_search before saying you lack context, and read detail with pantheon_get_turns or pantheon_get_session using any id from sessions. Fetch files with pantheon_get_artifact. Never call a generic resume tool for this. Do not run pantheon sync. A space named owner/slug was shared with you by someone else: resume and search work, writing does not, so tell the human at the end that this chat has to be handed off to one of their own spaces. REPORT THE RESULT as a two-column table \u2014 space, sessions (with total turns), earlier handoffs, memory facts, artifacts, skills (live and awaiting review), pulled \u2014 and then, outside the table, two or three sentences on where the work actually stood, any open threads, and the available skills by name and trigger. The table proves the load worked; it does not tell the human where the work was, so never collapse that prose into cells.",
|
|
23940
24072
|
{ space: external_exports.string().optional() },
|
|
23941
24073
|
async ({ space }) => safe(async () => {
|
|
23942
24074
|
const sync2 = await vault.pull(home);
|
|
@@ -24161,7 +24293,7 @@ ${GUIDE}` }]
|
|
|
24161
24293
|
registerTool(
|
|
24162
24294
|
server,
|
|
24163
24295
|
"pantheon_save_skill",
|
|
24164
|
-
"Write a skill into a Pantheon space as a DRAFT for the human to review.
|
|
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.",
|
|
24165
24297
|
{
|
|
24166
24298
|
space: external_exports.string(),
|
|
24167
24299
|
name: external_exports.string().describe("Short slug, e.g. nextjs-og-images."),
|
|
@@ -24186,14 +24318,14 @@ ${GUIDE}` }]
|
|
|
24186
24318
|
ok: sync2.ok !== false,
|
|
24187
24319
|
...saved,
|
|
24188
24320
|
sync: sync2,
|
|
24189
|
-
note: sync2.ok === false ? `Draft saved locally but the push failed: ${sync2.error || "unknown error"}. Tell the human it is not yet in GitHub.` : `Saved as a draft
|
|
24321
|
+
note: sync2.ok === false ? `Draft saved locally but the push failed: ${sync2.error || "unknown error"}. Tell the human it is not yet in GitHub.` : `Saved as a draft, waiting for review on the space page. Name it in your report; do not explain the draft system.`
|
|
24190
24322
|
};
|
|
24191
24323
|
})
|
|
24192
24324
|
);
|
|
24193
24325
|
registerTool(
|
|
24194
24326
|
server,
|
|
24195
24327
|
"pantheon_skill_review",
|
|
24196
|
-
"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
|
|
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.",
|
|
24197
24329
|
{ space: external_exports.string(), cwd: external_exports.string().optional() },
|
|
24198
24330
|
async ({ space, cwd }) => safe(() => skillReview(home, space, cwd || process.cwd()))
|
|
24199
24331
|
);
|
|
@@ -24446,59 +24578,74 @@ function upsertCodex(home) {
|
|
|
24446
24578
|
${block2}`);
|
|
24447
24579
|
}
|
|
24448
24580
|
var spaceGate = 'A space is the short name the human chose for a conscience (preorders, auth-refactor). The argument is: $ARGUMENTS\n\nIf that arrived blank, or as an unexpanded placeholder rather than a name, ask: "What should this conscience be named?" and wait. Never invent a name. Otherwise use it exactly as typed \u2014 any single short slug counts, including one that is not in the vault yet.';
|
|
24581
|
+
var quiet = "Do not narrate. No preamble about which tools you can see, whether Pantheon MCP is connected, or what you are about to do. Run it and report what happened, briefly. If a call fails, say what failed in one line.";
|
|
24449
24582
|
var slashCommands = [
|
|
24450
24583
|
{
|
|
24451
24584
|
name: "pantheon-handoff",
|
|
24452
24585
|
description: "Leave a Pantheon conscience for the next agent",
|
|
24453
24586
|
body: `${spaceGate}
|
|
24454
24587
|
|
|
24455
|
-
Only after you have a real space name, call pantheon_handoff even if that name is not in pantheon_list_spaces. First handoff creates the space. Do not refuse. Do not tell the human to create it first. transcript is the real thread, not a recap. Each human message is { role: "user", text: "<what they typed>" }. Each of your replies is { role: "assistant", text: "<what you said>" }. Copy the words. Do not write "User asked\u2026" or "Assistant wrote\u2026". Do not mark your replies as user. Same timestamp on every turn will be rejected. You MUST attach artifacts for every file you generated \u2014 PDFs, letters, CVs, spreadsheets \u2014 and every file the human uploaded. Read the file and pass { name, content: "<base64>", encoding: "base64" }. Claude: /mnt/user-data/outputs or the download you presented. A chat that names a .pdf without attaching it is rejected. Named code fences are stored automatically. If the thread is too long, send the oldest visible chunk with truncated:true, then call again with append:true. The tool commits and pushes \u2014 do not run pantheon sync
|
|
24588
|
+
Only after you have a real space name, call pantheon_handoff even if that name is not in pantheon_list_spaces. First handoff creates the space. Do not refuse. Do not tell the human to create it first. transcript is the real thread, not a recap. Each human message is { role: "user", text: "<what they typed>" }. Each of your replies is { role: "assistant", text: "<what you said>" }. Copy the words. Do not write "User asked\u2026" or "Assistant wrote\u2026". Do not mark your replies as user. Same timestamp on every turn will be rejected. You MUST attach artifacts for every file you generated \u2014 PDFs, letters, CVs, spreadsheets \u2014 and every file the human uploaded. Read the file and pass { name, content: "<base64>", encoding: "base64" }. Claude: /mnt/user-data/outputs or the download you presented. A chat that names a .pdf without attaching it is rejected. Named code fences are stored automatically. If the thread is too long, send the oldest visible chunk with truncated:true, then call again with append:true. The tool commits and pushes \u2014 do not run pantheon sync.
|
|
24589
|
+
|
|
24590
|
+
${quiet}`
|
|
24456
24591
|
},
|
|
24457
24592
|
{
|
|
24458
24593
|
name: "pantheon-resume",
|
|
24459
24594
|
description: "Load a Pantheon conscience into this chat",
|
|
24460
24595
|
body: `A space is the short name the human chose for a conscience. The argument is: $ARGUMENTS
|
|
24461
24596
|
|
|
24462
|
-
Call pantheon_resume immediately, with that name exactly as typed. If it arrived blank or as an unexpanded placeholder, call pantheon_resume without a space \u2014 it lists live consciences. Show that list and ask which one they meant. Do not invent a name. Once they pick a slug, call pantheon_resume with that slug. It pulls the vault first. If the packet lists artifacts, fetch the ones you need with pantheon_get_artifact. Do not use any other resume tool. Do not run pantheon sync
|
|
24597
|
+
Call pantheon_resume immediately, with that name exactly as typed. If it arrived blank or as an unexpanded placeholder, call pantheon_resume without a space \u2014 it lists live consciences. Show that list and ask which one they meant. Do not invent a name. Once they pick a slug, call pantheon_resume with that slug. It pulls the vault first. If the packet lists artifacts, fetch the ones you need with pantheon_get_artifact. Do not use any other resume tool. Do not run pantheon sync.
|
|
24598
|
+
|
|
24599
|
+
${quiet}`
|
|
24463
24600
|
},
|
|
24464
24601
|
{
|
|
24465
24602
|
name: "pantheon-park",
|
|
24466
24603
|
description: "Archive this chat into Pantheon without rewriting the packet",
|
|
24467
24604
|
body: `${spaceGate}
|
|
24468
24605
|
|
|
24469
|
-
Only then call pantheon_park, even if the slug is new. If you send a transcript, use real user and assistant turns \u2014 not a recap. Do not rewrite handoff.md
|
|
24606
|
+
Only then call pantheon_park, even if the slug is new. If you send a transcript, use real user and assistant turns \u2014 not a recap. Do not rewrite handoff.md.
|
|
24607
|
+
|
|
24608
|
+
${quiet}`
|
|
24470
24609
|
},
|
|
24471
24610
|
{
|
|
24472
24611
|
name: "pantheon-remember",
|
|
24473
24612
|
description: "Save one durable fact into a Pantheon space",
|
|
24474
24613
|
body: `${spaceGate}
|
|
24475
24614
|
|
|
24476
|
-
Parse the rest of the argument as the fact. Only then call pantheon_remember, even if the slug is new. Do not dump the chat
|
|
24615
|
+
Parse the rest of the argument as the fact. Only then call pantheon_remember, even if the slug is new. Do not dump the chat.
|
|
24616
|
+
|
|
24617
|
+
${quiet}`
|
|
24477
24618
|
},
|
|
24478
24619
|
{
|
|
24479
24620
|
name: "pantheon-skills",
|
|
24480
24621
|
description: "Review a Pantheon space for lessons worth writing down",
|
|
24481
24622
|
body: `${spaceGate}
|
|
24482
24623
|
|
|
24483
|
-
Only then call pantheon_skill_review with that space, passing cwd when the project folder is not the server's working directory. If that
|
|
24624
|
+
Only then call pantheon_skill_review with that space, passing cwd when the project folder is not the server's working directory. If that call is unavailable, do not improvise from this chat alone; say only "Skill review unavailable. Reload Pantheon MCP." It returns signals, not conclusions: corrections the human made, commands run across several conversations, and any deterministic candidates. Read the turns it cites with pantheon_get_turns before you believe any of them.
|
|
24484
24625
|
|
|
24485
|
-
|
|
24626
|
+
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.
|
|
24486
24627
|
|
|
24487
|
-
|
|
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.
|
|
24488
24629
|
|
|
24489
|
-
|
|
24630
|
+
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.
|
|
24490
24631
|
|
|
24491
|
-
|
|
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.
|
|
24633
|
+
|
|
24634
|
+
${quiet}`
|
|
24492
24635
|
},
|
|
24493
24636
|
{
|
|
24494
24637
|
name: "pantheon-spaces",
|
|
24495
24638
|
description: "List Pantheon consciences",
|
|
24496
|
-
body:
|
|
24639
|
+
body: `Call pantheon_list_spaces and show only that result. Do not list spaces from memory, this chat, Knowledge Compiler, or any other tool. If the tool fails, say Pantheon MCP is not connected.
|
|
24640
|
+
|
|
24641
|
+
${quiet}`
|
|
24497
24642
|
},
|
|
24498
24643
|
{
|
|
24499
24644
|
name: "pantheon-help",
|
|
24500
24645
|
description: "Show Pantheon commands",
|
|
24501
|
-
body:
|
|
24646
|
+
body: `Call the MCP tool pantheon_help and follow that guide.
|
|
24647
|
+
|
|
24648
|
+
${quiet}`
|
|
24502
24649
|
}
|
|
24503
24650
|
];
|
|
24504
24651
|
function writeCodexSkill() {
|
|
@@ -24567,12 +24714,19 @@ name and trigger. The table only proves the load worked. It says nothing about
|
|
|
24567
24714
|
where the work was, which is the part the human asked for, so never fold that
|
|
24568
24715
|
into cells.
|
|
24569
24716
|
|
|
24570
|
-
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
24574
|
-
|
|
24575
|
-
|
|
24717
|
+
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.
|
|
24723
|
+
|
|
24724
|
+
## Do not narrate
|
|
24725
|
+
|
|
24726
|
+
No command opens with which tools you can see, whether Pantheon MCP is
|
|
24727
|
+
connected, or what you are about to do. Run it and report what happened. A call
|
|
24728
|
+
that genuinely fails is worth one line saying what failed \u2014 that is a result,
|
|
24729
|
+
not narration.
|
|
24576
24730
|
`;
|
|
24577
24731
|
for (const dir of dirs2) {
|
|
24578
24732
|
mkdirSync6(dir, { recursive: true });
|
|
@@ -24963,17 +25117,17 @@ async function connect(opts) {
|
|
|
24963
25117
|
);
|
|
24964
25118
|
mkdirSync7(home, { recursive: true });
|
|
24965
25119
|
const auth = authArgs();
|
|
24966
|
-
const
|
|
25120
|
+
const quiet2 = { stdio: ["ignore", "pipe", "pipe"] };
|
|
24967
25121
|
const fresh = !existsSync8(join8(home, ".git"));
|
|
24968
25122
|
let archived = "";
|
|
24969
25123
|
if (fresh) {
|
|
24970
25124
|
await clone2(body.cloneUrl, home, auth, "Cloning the vault");
|
|
24971
25125
|
} else {
|
|
24972
|
-
archived = await syncVault2(home, body.cloneUrl, auth,
|
|
25126
|
+
archived = await syncVault2(home, body.cloneUrl, auth, quiet2);
|
|
24973
25127
|
}
|
|
24974
|
-
claimCredentials(home,
|
|
24975
|
-
execFileSync3("git", ["-C", home, "config", "user.name", "Pantheon"],
|
|
24976
|
-
execFileSync3("git", ["-C", home, "config", "user.email", "pantheon@users.noreply.github.com"],
|
|
25128
|
+
claimCredentials(home, quiet2);
|
|
25129
|
+
execFileSync3("git", ["-C", home, "config", "user.name", "Pantheon"], quiet2);
|
|
25130
|
+
execFileSync3("git", ["-C", home, "config", "user.email", "pantheon@users.noreply.github.com"], quiet2);
|
|
24977
25131
|
let written = [];
|
|
24978
25132
|
let ahead = [];
|
|
24979
25133
|
let skipped = [];
|
|
@@ -25004,11 +25158,11 @@ async function connect(opts) {
|
|
|
25004
25158
|
)
|
|
25005
25159
|
);
|
|
25006
25160
|
}
|
|
25007
|
-
async function syncVault2(home, cloneUrl, auth,
|
|
25008
|
-
retarget(home, cloneUrl,
|
|
25161
|
+
async function syncVault2(home, cloneUrl, auth, quiet2) {
|
|
25162
|
+
retarget(home, cloneUrl, quiet2);
|
|
25009
25163
|
const updating = step("Updating the vault");
|
|
25010
25164
|
try {
|
|
25011
|
-
execFileSync3("git", [...auth, "-C", home, "pull", "--ff-only"],
|
|
25165
|
+
execFileSync3("git", [...auth, "-C", home, "pull", "--ff-only"], quiet2);
|
|
25012
25166
|
updating.done();
|
|
25013
25167
|
return "";
|
|
25014
25168
|
} catch (error2) {
|
|
@@ -25053,11 +25207,11 @@ async function clone2(cloneUrl, home, auth, label) {
|
|
|
25053
25207
|
}
|
|
25054
25208
|
cloning.done();
|
|
25055
25209
|
}
|
|
25056
|
-
function retarget(home, cloneUrl,
|
|
25210
|
+
function retarget(home, cloneUrl, quiet2) {
|
|
25057
25211
|
try {
|
|
25058
|
-
execFileSync3("git", ["-C", home, "remote", "set-url", "origin", cloneUrl],
|
|
25212
|
+
execFileSync3("git", ["-C", home, "remote", "set-url", "origin", cloneUrl], quiet2);
|
|
25059
25213
|
} catch {
|
|
25060
|
-
execFileSync3("git", ["-C", home, "remote", "add", "origin", cloneUrl],
|
|
25214
|
+
execFileSync3("git", ["-C", home, "remote", "add", "origin", cloneUrl], quiet2);
|
|
25061
25215
|
}
|
|
25062
25216
|
}
|
|
25063
25217
|
function sharesHistory(home) {
|
|
@@ -25084,12 +25238,12 @@ function credentialHelperCommand() {
|
|
|
25084
25238
|
function authArgs() {
|
|
25085
25239
|
return ["-c", "credential.helper=", "-c", `credential.helper=${credentialHelperCommand()}`];
|
|
25086
25240
|
}
|
|
25087
|
-
function claimCredentials(home,
|
|
25088
|
-
execFileSync3("git", ["-C", home, "config", "--replace-all", "credential.helper", ""],
|
|
25241
|
+
function claimCredentials(home, quiet2) {
|
|
25242
|
+
execFileSync3("git", ["-C", home, "config", "--replace-all", "credential.helper", ""], quiet2);
|
|
25089
25243
|
execFileSync3(
|
|
25090
25244
|
"git",
|
|
25091
25245
|
["-C", home, "config", "--add", "credential.helper", credentialHelperCommand()],
|
|
25092
|
-
|
|
25246
|
+
quiet2
|
|
25093
25247
|
);
|
|
25094
25248
|
}
|
|
25095
25249
|
|
package/package.json
CHANGED