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.
Files changed (58) hide show
  1. agentwire/__init__.py +7 -0
  2. agentwire/__main__.py +4 -0
  3. agentwire/adapters/__init__.py +78 -0
  4. agentwire/adapters/claude/__init__.py +0 -0
  5. agentwire/adapters/claude/adapter.py +1048 -0
  6. agentwire/adapters/claude/prompts/reading.md +20 -0
  7. agentwire/adapters/cursor/__init__.py +0 -0
  8. agentwire/adapters/cursor/adapter.py +613 -0
  9. agentwire/adapters/cursor/prompts/reading.md +25 -0
  10. agentwire/adapters/host/__init__.py +9 -0
  11. agentwire/adapters/host/cursor.py +142 -0
  12. agentwire/cli.py +1609 -0
  13. agentwire/core/__init__.py +0 -0
  14. agentwire/core/auth.py +167 -0
  15. agentwire/core/channels.py +163 -0
  16. agentwire/core/context.py +433 -0
  17. agentwire/core/daemon.py +760 -0
  18. agentwire/core/exec.py +15 -0
  19. agentwire/core/gate.py +98 -0
  20. agentwire/core/identity.py +42 -0
  21. agentwire/core/journal.py +127 -0
  22. agentwire/core/launchd.py +81 -0
  23. agentwire/core/principal.py +140 -0
  24. agentwire/core/prompts/__init__.py +115 -0
  25. agentwire/core/prompts/brief/sections.md +18 -0
  26. agentwire/core/prompts/session-delta.md +76 -0
  27. agentwire/core/prompts/standing-block/README.md +13 -0
  28. agentwire/core/prompts/standing-block/base.md +34 -0
  29. agentwire/core/prompts/standing-block/dossier.md +12 -0
  30. agentwire/core/prompts/standing-block/inbox.md +29 -0
  31. agentwire/core/prompts/standing-block/peers.md +58 -0
  32. agentwire/core/prompts/standing-block/topics.md +44 -0
  33. agentwire/core/records.py +479 -0
  34. agentwire/core/remote.py +131 -0
  35. agentwire/core/route.py +569 -0
  36. agentwire/core/scan.py +114 -0
  37. agentwire/core/stats.py +161 -0
  38. agentwire/core/store.py +917 -0
  39. agentwire/core/summarizer.py +272 -0
  40. agentwire/core/surface.py +324 -0
  41. agentwire/core/sync.py +517 -0
  42. agentwire/core/tokens.py +92 -0
  43. agentwire/core/topics.py +683 -0
  44. agentwire/core/ui.py +10 -0
  45. agentwire/core/view.py +179 -0
  46. agentwire/core/wake.py +218 -0
  47. agentwire/core/words.py +53 -0
  48. agentwire/extensions/opener/extension.js +207 -0
  49. agentwire/extensions/opener/package.json +11 -0
  50. agentwire/web/index.html +912 -0
  51. agentwire/web/rooms.py +409 -0
  52. agentwire/web/serve.py +496 -0
  53. agentwire/web/server.py +890 -0
  54. agentwire/web/threads.py +323 -0
  55. agentwires-0.2.0.dist-info/METADATA +638 -0
  56. agentwires-0.2.0.dist-info/RECORD +58 -0
  57. agentwires-0.2.0.dist-info/WHEEL +4 -0
  58. 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,4 @@
1
+ """`python -m agentwire` behaves exactly like the `agentwire` command."""
2
+ from agentwire.cli import run
3
+
4
+ run()
@@ -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