pidge-cli 0.15.2 → 0.15.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.3 — #33 fix: the self-heal marker no longer corrupts the skill
4
+
5
+ The 0.15.2 marker was written as the FIRST line of `SKILL.md`, ABOVE the opening `---`. A
6
+ SKILL.md whose first line isn't `---` fails Claude Code's YAML frontmatter parse: the skill
7
+ still appears, but with a GARBAGE description (the HTML comment leaks in as the description and
8
+ the real `name`/`description` are lost) — so the agent's Claude Code never learns WHEN to use
9
+ Pidge. Verified on a live headless `claude` run: a marker-first probe skill loaded with its
10
+ description showing `<!-- pidge-skill … -->` instead of its real text, while an identical
11
+ `---`-first control loaded correctly.
12
+
13
+ - **fix:** the marker now rides a `# pidge-skill rev=R manifest=N` YAML COMMENT INSIDE the
14
+ frontmatter (a `#` comment is valid YAML and invisible to `name`/`description`), so the
15
+ frontmatter opens on line 1 and parses cleanly while the marker still travels with the file.
16
+ - **fix:** `ensureSkillFresh()` reads the marker from its new in-frontmatter position and still
17
+ tolerates the old line-1 `<!-- … -->` marker, so a 0.15.2 install is detected as stale.
18
+ - **fix:** `SKILL_REVISION` bumped 1 → 2, so every 0.15.2 install (all rev=1, all broken) is
19
+ seen as stale and self-heals into the corrected format on the next command — zero human action.
20
+
3
21
  ## 0.15.2 — #280 the skill self-heals
4
22
 
5
23
  #280 — the local skill self-heals: any pidge command silently refreshes
package/bin/pidge.js CHANGED
@@ -566,7 +566,10 @@ const KNOWN_MANIFEST_VERSION = 46;
566
566
  // (the non-generated prose in installSkill) changes — an existing install whose
567
567
  // baked marker is older than this self-heals on its next pidge command, so an
568
568
  // onboarded agent always runs the latest skill without any human action. Start at 1.
569
- const SKILL_REVISION = 1;
569
+ // Bumped to 2 in 0.15.3 so every 0.15.2 install (which baked the marker ABOVE the `---`,
570
+ // corrupting the skill's description) is detected as stale and self-heals into the fixed
571
+ // in-frontmatter format on the next command. Bump this whenever the hand-authored spine moves.
572
+ const SKILL_REVISION = 2;
570
573
  const NAG_TTL_MS = 24 * 60 * 60 * 1000; // #241: at most one nag per 24 h
571
574
  let newsWarned = false;
572
575
  // #280: the self-heal runs at most ONCE per process (one regeneration, even when
@@ -638,9 +641,15 @@ async function ensureSkillFresh(serverManifestVersion) {
638
641
  // Resolve the path the SAME way installSkill does (cwd-relative).
639
642
  const file = path.join(process.cwd(), '.claude', 'skills', 'pidge', 'SKILL.md');
640
643
  if (!fs.existsSync(file)) return; // don't auto-create — only refresh an existing skill
641
- const firstLine = fs.readFileSync(file, 'utf8').split('\n', 1)[0] || '';
642
- const revM = firstLine.match(/rev=(\d+)/);
643
- const manM = firstLine.match(/manifest=(\d+)/);
644
+ // #33 fix: the marker now rides a `# pidge-skill rev=N manifest=M` YAML comment INSIDE
645
+ // the frontmatter (0.15.3+); pre-0.15.3 installs put `<!-- pidge-skill … -->` as line 1.
646
+ // Scan for the marker line either way — the token `pidge-skill` appears ONLY there in a
647
+ // generated skill — so a stale OLD-format install is still detected and healed into the
648
+ // corrected format (its garbage-description bug repaired) on the next command.
649
+ const content = fs.readFileSync(file, 'utf8');
650
+ const markerLine = content.split('\n').find((l) => l.includes('pidge-skill')) || '';
651
+ const revM = markerLine.match(/rev=(\d+)/);
652
+ const manM = markerLine.match(/manifest=(\d+)/);
644
653
  const installedRev = revM ? parseInt(revM[1], 10) : 0;
645
654
  const installedManifest = manM ? parseInt(manM[1], 10) : 0;
646
655
  const stale = SKILL_REVISION > installedRev || (serverManifestVersion || 0) > installedManifest;
@@ -1765,10 +1774,17 @@ async function installSkill(base = BASE, token = TOKEN) {
1765
1774
  const profileTable = (m.profiles && m.profiles.decision_table) || [];
1766
1775
  const notes = m.notes || [];
1767
1776
  const exits = (m.cli && m.cli.output) || '';
1768
- const skill = `<!-- pidge-skill rev=${SKILL_REVISION} manifest=${m.manifest_version} -->
1769
- ---
1777
+ // #33 fix (0.15.3): the self-heal marker rides a `# pidge-skill …` YAML COMMENT INSIDE
1778
+ // the frontmatter — it MUST NOT precede the opening `---`. A SKILL.md whose first line
1779
+ // isn't `---` fails the YAML frontmatter parse, so Claude Code loads the skill with a
1780
+ // GARBAGE description (the HTML comment leaked in as the description, the real one lost)
1781
+ // — proven on a live headless run. A `#` comment line is valid YAML and invisible to
1782
+ // name/description, so the marker survives without corrupting the load. ensureSkillFresh
1783
+ // reads it from this position (and still tolerates the old line-1 marker to heal it).
1784
+ const skill = `---
1770
1785
  name: pidge
1771
1786
  description: Send rich, actionable iPhone notifications to your human and get their decision back (Pidge). Every send is a TYPE (message/important/urgent/event/live) plus an OPTIONAL response (buttons + send-and-go vs wait). Use when finishing long tasks, needing a decision/approval, sending updates with substance, or anything time-anchored. Also covers reading the human's replies back.
1787
+ # pidge-skill rev=${SKILL_REVISION} manifest=${m.manifest_version}
1772
1788
  ---
1773
1789
 
1774
1790
  # Pidge — notify your human, get answers back
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pidge-cli",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Send rich, actionable iPhone notifications to a human and block until they answer. Built for AI agents.",
5
5
  "keywords": [
6
6
  "pidge",