@andespindola/crow-skills 0.42.0 → 0.42.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.
@@ -1,3 +1,3 @@
1
1
  """Portable, local-first installer for the crow-skills catalogue."""
2
2
 
3
- __version__ = "0.42.0"
3
+ __version__ = "0.42.1"
@@ -617,10 +617,46 @@ def sender_owner(args, home, cwd):
617
617
  found = broadcast_owner(args, home, cwd)
618
618
  if found:
619
619
  return found
620
+ # No live session yet is NOT proof of a human: an agent dispatched a moment
621
+ # ago (`claude -p`, `codex exec`) can reply before its hook registers it, and
622
+ # labelling that reply "owner" made the cockpit paint an agent's answer as if
623
+ # the owner had typed it. If an agent CLI is among our ancestors, it is the
624
+ # sender; only a caller with no agent above it is the owner's own console.
625
+ host, pid = agent_ancestor(ancestors())
626
+ if host:
627
+ return {"key": broadcast.session_key(host, "pid-" + str(pid), None), "host": host,
628
+ "session": None, "detected": "ancestor"}
620
629
  return {"key": broadcast.session_key(OWNER_HOST, OWNER_HOST, None), "host": OWNER_HOST,
621
630
  "session": None, "detected": "owner"}
622
631
 
623
632
 
633
+ def process_name(pid):
634
+ """Executable name of a process (best effort), e.g. "claude" for /opt/homebrew/bin/claude.
635
+ A Node-launched CLI (`node /…/bin/codex …`) is named after its script, not after node."""
636
+ try:
637
+ import subprocess
638
+ done = subprocess.run(["ps", "-o", "command=", "-p", str(pid)], capture_output=True, text=True, timeout=2)
639
+ except (OSError, subprocess.SubprocessError):
640
+ return None
641
+ words = done.stdout.split()
642
+ if not words:
643
+ return None
644
+ name = os.path.basename(words[0])
645
+ if name in ("node", "nodejs", "bun", "deno", "python", "python3") and len(words) > 1:
646
+ name = os.path.basename(words[1])
647
+ return name
648
+
649
+
650
+ def agent_ancestor(chain, name_of=None):
651
+ """(host, pid) of the nearest ancestor that is an agent CLI, or (None, None)."""
652
+ name_of = name_of or process_name
653
+ for pid in chain:
654
+ name = name_of(pid)
655
+ if name in hook.HOSTS:
656
+ return name, pid
657
+ return None, None
658
+
659
+
624
660
  def broadcast_owner(args, home, cwd):
625
661
  """The session that runs this command: --session/--host, else the live session whose CLI pid is an ancestor."""
626
662
  live = broadcast.live_sessions(home)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andespindola/crow-skills",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "description": "Versioned, complementary agent skills with a protected multi-agent installer",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
package/release.json CHANGED
@@ -28,7 +28,7 @@
28
28
  "crow_skills/__init__.py": {
29
29
  "executable": false,
30
30
  "kind": "file",
31
- "sha256": "cc22b033e337c6505136dfdc04478f822c369b3850860373aebb585270382924"
31
+ "sha256": "508a8a4ccc423b6861a1074b693e8618273fce2f5311cb69365d87240cccdfea"
32
32
  },
33
33
  "crow_skills/__main__.py": {
34
34
  "executable": false,
@@ -58,7 +58,7 @@
58
58
  "crow_skills/cli.py": {
59
59
  "executable": false,
60
60
  "kind": "file",
61
- "sha256": "255e5cb064e4104f67e1068e2d7713dbe766eac0ae27c4b00a0fda2529cd0805"
61
+ "sha256": "49fdfaf34107e1caadb73bb87bcaec6445491b1b70b8f9c8bfcb3c2e28030839"
62
62
  },
63
63
  "crow_skills/demands.py": {
64
64
  "executable": false,
@@ -153,7 +153,7 @@
153
153
  "package.json": {
154
154
  "executable": false,
155
155
  "kind": "file",
156
- "sha256": "afa1a3a959d9d575eaa972ec78a5a549f90735bb57c002a3b6b787788bdf4fa6"
156
+ "sha256": "be1082db4d2ebace84a0854f2346ed7315306e31c46f3baa5bcb487fb9066fe7"
157
157
  },
158
158
  "skills/crow-accessibility/SKILL.md": {
159
159
  "executable": false,
@@ -3011,7 +3011,7 @@
3011
3011
  "sha256": "7dd3660097c3afeadb58357939b51da518a4da7cf2d7e684c2618b22f6c4a87b"
3012
3012
  }
3013
3013
  },
3014
- "revision": "7942e9c653f8bc5d6b45ed6f2d16691cb4d0eb53",
3014
+ "revision": "f98d35baec7b75c3c5e19128bd8e45af7cb8dc19",
3015
3015
  "schema_version": 1,
3016
- "version": "0.42.0"
3016
+ "version": "0.42.1"
3017
3017
  }