@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.
- package/crow_skills/__init__.py +1 -1
- package/crow_skills/cli.py +36 -0
- package/package.json +1 -1
- package/release.json +5 -5
package/crow_skills/__init__.py
CHANGED
package/crow_skills/cli.py
CHANGED
|
@@ -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
package/release.json
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"crow_skills/__init__.py": {
|
|
29
29
|
"executable": false,
|
|
30
30
|
"kind": "file",
|
|
31
|
-
"sha256": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
3014
|
+
"revision": "f98d35baec7b75c3c5e19128bd8e45af7cb8dc19",
|
|
3015
3015
|
"schema_version": 1,
|
|
3016
|
-
"version": "0.42.
|
|
3016
|
+
"version": "0.42.1"
|
|
3017
3017
|
}
|