pidge-cli 0.8.0 → 0.8.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.
Files changed (2) hide show
  1. package/bin/pidge.js +8 -5
  2. package/package.json +1 -1
package/bin/pidge.js CHANGED
@@ -267,7 +267,7 @@ function fetchT(url, opts = {}, timeoutMs = 30000) {
267
267
  // The server advertises its manifest version on every response. When it's newer
268
268
  // than what this CLI shipped knowing, nudge ONCE on stderr — the agent re-reads
269
269
  // the manifest (whats_new) and learns the new capabilities without polling.
270
- const KNOWN_MANIFEST_VERSION = 25;
270
+ const KNOWN_MANIFEST_VERSION = 26;
271
271
  let newsWarned = false;
272
272
  function checkManifestNews(res) {
273
273
  const v = parseInt(res.headers.get('x-pidge-manifest-version') || '0', 10);
@@ -698,8 +698,11 @@ async function fetchWhoami(base = BASE, token = TOKEN) {
698
698
 
699
699
  // doctor: validate the setup WITHOUT exposing secrets. Narration on stderr,
700
700
  // a compact machine-readable line on stdout. Exit 0 healthy / 2 broken.
701
- async function runDoctor(base = BASE, token = TOKEN) {
702
- const source = token === TOKEN ? tokenSource() : CONFIG_FILE; // post-setup call passes the fresh token
701
+ async function runDoctor(base = BASE, token = TOKEN, sourceLabel = null) {
702
+ // sourceLabel is passed by setup (it knows exactly where the key went
703
+ // a per-agent file, the shared file, or NOWHERE for --print); the bare
704
+ // `doctor` command computes it from the env/file precedence.
705
+ const source = sourceLabel || (token === TOKEN ? tokenSource() : CONFIG_FILE);
703
706
  if (!token) {
704
707
  console.error('pidge doctor: NO TOKEN — set PIDGE_TOKEN, or onboard with `pidge setup --claim <code>` (the human copies the code from the Pidge app)');
705
708
  process.exit(2);
@@ -801,7 +804,7 @@ async function runSetup() {
801
804
  console.log(`export PIDGE_URL=${finalBase}`);
802
805
  console.log(`export PIDGE_TOKEN=${data.key}`);
803
806
  console.error(`pidge: canal "${channelName}" — modo POR-AGENTE (nada gravado em disco). Cole as duas linhas no ambiente de lançamento DESTE agente (systemd/launcher/cron/profile). Cada agente tem a SUA chave; perdeu, é só pegar outro código no app e re-rodar (a chave do canal é a MESMA). NÃO rode --print de dentro de um agente — a chave apareceria no contexto dele.`);
804
- await runDoctor(finalBase, data.key);
807
+ await runDoctor(finalBase, data.key, 'fresh claim (per-agent env — not stored on disk)');
805
808
  return;
806
809
  }
807
810
 
@@ -813,7 +816,7 @@ async function runSetup() {
813
816
  console.error(`pidge: canal "${channelName}" configurado — chave em ${CONFIG_FILE} (chmod 600, nunca exibida)`);
814
817
  if (!AGENT_ID)
815
818
  console.error('pidge: este é o arquivo COMPARTILHADO (single-agent). Vai rodar 2+ agentes nesta máquina? Dê a cada um PIDGE_AGENT=<id> no launch (arquivo isolado por agente) — senão eles enviam como o mesmo canal.');
816
- await runDoctor(finalBase, data.key);
819
+ await runDoctor(finalBase, data.key, CONFIG_FILE);
817
820
  }
818
821
 
819
822
  // skill install (#110e): persistent Pidge knowledge for Claude Code agents —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pidge-cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
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",