agentwires 0.2.0__py3-none-any.whl
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.
- agentwire/__init__.py +7 -0
- agentwire/__main__.py +4 -0
- agentwire/adapters/__init__.py +78 -0
- agentwire/adapters/claude/__init__.py +0 -0
- agentwire/adapters/claude/adapter.py +1048 -0
- agentwire/adapters/claude/prompts/reading.md +20 -0
- agentwire/adapters/cursor/__init__.py +0 -0
- agentwire/adapters/cursor/adapter.py +613 -0
- agentwire/adapters/cursor/prompts/reading.md +25 -0
- agentwire/adapters/host/__init__.py +9 -0
- agentwire/adapters/host/cursor.py +142 -0
- agentwire/cli.py +1609 -0
- agentwire/core/__init__.py +0 -0
- agentwire/core/auth.py +167 -0
- agentwire/core/channels.py +163 -0
- agentwire/core/context.py +433 -0
- agentwire/core/daemon.py +760 -0
- agentwire/core/exec.py +15 -0
- agentwire/core/gate.py +98 -0
- agentwire/core/identity.py +42 -0
- agentwire/core/journal.py +127 -0
- agentwire/core/launchd.py +81 -0
- agentwire/core/principal.py +140 -0
- agentwire/core/prompts/__init__.py +115 -0
- agentwire/core/prompts/brief/sections.md +18 -0
- agentwire/core/prompts/session-delta.md +76 -0
- agentwire/core/prompts/standing-block/README.md +13 -0
- agentwire/core/prompts/standing-block/base.md +34 -0
- agentwire/core/prompts/standing-block/dossier.md +12 -0
- agentwire/core/prompts/standing-block/inbox.md +29 -0
- agentwire/core/prompts/standing-block/peers.md +58 -0
- agentwire/core/prompts/standing-block/topics.md +44 -0
- agentwire/core/records.py +479 -0
- agentwire/core/remote.py +131 -0
- agentwire/core/route.py +569 -0
- agentwire/core/scan.py +114 -0
- agentwire/core/stats.py +161 -0
- agentwire/core/store.py +917 -0
- agentwire/core/summarizer.py +272 -0
- agentwire/core/surface.py +324 -0
- agentwire/core/sync.py +517 -0
- agentwire/core/tokens.py +92 -0
- agentwire/core/topics.py +683 -0
- agentwire/core/ui.py +10 -0
- agentwire/core/view.py +179 -0
- agentwire/core/wake.py +218 -0
- agentwire/core/words.py +53 -0
- agentwire/extensions/opener/extension.js +207 -0
- agentwire/extensions/opener/package.json +11 -0
- agentwire/web/index.html +912 -0
- agentwire/web/rooms.py +409 -0
- agentwire/web/serve.py +496 -0
- agentwire/web/server.py +890 -0
- agentwire/web/threads.py +323 -0
- agentwires-0.2.0.dist-info/METADATA +638 -0
- agentwires-0.2.0.dist-info/RECORD +58 -0
- agentwires-0.2.0.dist-info/WHEEL +4 -0
- agentwires-0.2.0.dist-info/entry_points.txt +2 -0
agentwire/__init__.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""agentwire — presence and pub/sub for coding-agent sessions.
|
|
2
|
+
|
|
3
|
+
One package: `core` is the store and the verbs, `adapters` know each agent
|
|
4
|
+
system, `web` is the dashboard and the team server, `extensions` are host
|
|
5
|
+
integrations shipped as data. `cli` is the command on PATH.
|
|
6
|
+
"""
|
|
7
|
+
__version__ = "0.2.0"
|
agentwire/__main__.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Consumer adapters.
|
|
2
|
+
|
|
3
|
+
`core/` never imports a consumer. Everything that knows how a particular agent
|
|
4
|
+
system stores its sessions, injects context, or reports a turn lives behind the
|
|
5
|
+
Adapter protocol below. Resolution is by name so a new adapter is a new
|
|
6
|
+
directory, not an edit to this file.
|
|
7
|
+
"""
|
|
8
|
+
import importlib
|
|
9
|
+
import os
|
|
10
|
+
from typing import Protocol, runtime_checkable
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@runtime_checkable
|
|
14
|
+
class Adapter(Protocol):
|
|
15
|
+
"""What core is allowed to ask a consumer.
|
|
16
|
+
|
|
17
|
+
Deliberately says nothing about files, byte offsets or transcripts. A
|
|
18
|
+
session's progress is an OPAQUE watermark that only the adapter interprets:
|
|
19
|
+
Claude Code's is a byte offset into a JSONL file, Cursor's is a count of
|
|
20
|
+
conversation headers in SQLite. Core only ever compares one for equality.
|
|
21
|
+
"""
|
|
22
|
+
NAME: str
|
|
23
|
+
|
|
24
|
+
def present(self) -> bool:
|
|
25
|
+
"""Is this consumer installed on this machine?"""
|
|
26
|
+
|
|
27
|
+
def detect_agent_id(self) -> "str | None": ...
|
|
28
|
+
|
|
29
|
+
def sessions(self, only=None) -> list:
|
|
30
|
+
"""[{id, project, updated_at: float, trackable: bool, watermark}]."""
|
|
31
|
+
|
|
32
|
+
def delta(self, session, since) -> "dict | None":
|
|
33
|
+
"""What changed since `since`.
|
|
34
|
+
|
|
35
|
+
-> {"body": str, "units": int, "note": str, "watermark": any} or None.
|
|
36
|
+
`body` is the consumer-specific "what is new" section of the brief;
|
|
37
|
+
`units` feeds the --min-rows gate; `note` is one log line.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
def reading_guide(self) -> str:
|
|
41
|
+
"""How to read this consumer's sessions; core supplies the contract."""
|
|
42
|
+
def hook_response(self, event, text) -> "dict | None": ...
|
|
43
|
+
def install(self, exe) -> list: ...
|
|
44
|
+
def diagnose(self) -> list: ...
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def active(name=None):
|
|
48
|
+
"""Resolve an adapter by name. With no name, the first tracked consumer —
|
|
49
|
+
there is no default consumer, only whatever `agentwire add` recorded."""
|
|
50
|
+
if not name:
|
|
51
|
+
from agentwire.core import store
|
|
52
|
+
tracked = store.enabled_consumers()
|
|
53
|
+
name = tracked[0] if tracked else "claude"
|
|
54
|
+
try:
|
|
55
|
+
return importlib.import_module(f"agentwire.adapters.{name}.adapter")
|
|
56
|
+
except ModuleNotFoundError as e:
|
|
57
|
+
if getattr(e, "name", "").startswith(f"agentwire.adapters.{name}"):
|
|
58
|
+
raise SystemExit(f"agentwire: unknown consumer {name!r} "
|
|
59
|
+
f"(known: {', '.join(available())})")
|
|
60
|
+
raise
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def detected():
|
|
64
|
+
"""Every adapter whose consumer is actually installed here."""
|
|
65
|
+
out = []
|
|
66
|
+
for name in available():
|
|
67
|
+
try:
|
|
68
|
+
if active(name).present():
|
|
69
|
+
out.append(name)
|
|
70
|
+
except Exception:
|
|
71
|
+
pass
|
|
72
|
+
return out
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def available():
|
|
76
|
+
here = os.path.dirname(__file__)
|
|
77
|
+
return sorted(d for d in os.listdir(here)
|
|
78
|
+
if os.path.isfile(os.path.join(here, d, "adapter.py")))
|
|
File without changes
|