@clawcrony/claw-crony 1.0.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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -0
  3. package/dist/index.d.ts +17 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +720 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/agent-card.d.ts +4 -0
  8. package/dist/src/agent-card.d.ts.map +1 -0
  9. package/dist/src/agent-card.js +61 -0
  10. package/dist/src/agent-card.js.map +1 -0
  11. package/dist/src/audit.d.ts +36 -0
  12. package/dist/src/audit.d.ts.map +1 -0
  13. package/dist/src/audit.js +88 -0
  14. package/dist/src/audit.js.map +1 -0
  15. package/dist/src/client.d.ts +53 -0
  16. package/dist/src/client.d.ts.map +1 -0
  17. package/dist/src/client.js +322 -0
  18. package/dist/src/client.js.map +1 -0
  19. package/dist/src/executor.d.ts +34 -0
  20. package/dist/src/executor.d.ts.map +1 -0
  21. package/dist/src/executor.js +994 -0
  22. package/dist/src/executor.js.map +1 -0
  23. package/dist/src/file-security.d.ts +63 -0
  24. package/dist/src/file-security.d.ts.map +1 -0
  25. package/dist/src/file-security.js +350 -0
  26. package/dist/src/file-security.js.map +1 -0
  27. package/dist/src/hub-match.d.ts +73 -0
  28. package/dist/src/hub-match.d.ts.map +1 -0
  29. package/dist/src/hub-match.js +120 -0
  30. package/dist/src/hub-match.js.map +1 -0
  31. package/dist/src/hub-registration.d.ts +24 -0
  32. package/dist/src/hub-registration.d.ts.map +1 -0
  33. package/dist/src/hub-registration.js +242 -0
  34. package/dist/src/hub-registration.js.map +1 -0
  35. package/dist/src/internal/envelope.d.ts +33 -0
  36. package/dist/src/internal/envelope.d.ts.map +1 -0
  37. package/dist/src/internal/envelope.js +152 -0
  38. package/dist/src/internal/envelope.js.map +1 -0
  39. package/dist/src/internal/idempotency.d.ts +48 -0
  40. package/dist/src/internal/idempotency.d.ts.map +1 -0
  41. package/dist/src/internal/idempotency.js +82 -0
  42. package/dist/src/internal/idempotency.js.map +1 -0
  43. package/dist/src/internal/metrics.d.ts +38 -0
  44. package/dist/src/internal/metrics.d.ts.map +1 -0
  45. package/dist/src/internal/metrics.js +83 -0
  46. package/dist/src/internal/metrics.js.map +1 -0
  47. package/dist/src/internal/outbox.d.ts +49 -0
  48. package/dist/src/internal/outbox.d.ts.map +1 -0
  49. package/dist/src/internal/outbox.js +149 -0
  50. package/dist/src/internal/outbox.js.map +1 -0
  51. package/dist/src/internal/routing.d.ts +28 -0
  52. package/dist/src/internal/routing.d.ts.map +1 -0
  53. package/dist/src/internal/routing.js +57 -0
  54. package/dist/src/internal/routing.js.map +1 -0
  55. package/dist/src/internal/security.d.ts +53 -0
  56. package/dist/src/internal/security.d.ts.map +1 -0
  57. package/dist/src/internal/security.js +122 -0
  58. package/dist/src/internal/security.js.map +1 -0
  59. package/dist/src/internal/transport.d.ts +49 -0
  60. package/dist/src/internal/transport.d.ts.map +1 -0
  61. package/dist/src/internal/transport.js +207 -0
  62. package/dist/src/internal/transport.js.map +1 -0
  63. package/dist/src/internal/types-internal.d.ts +95 -0
  64. package/dist/src/internal/types-internal.d.ts.map +1 -0
  65. package/dist/src/internal/types-internal.js +9 -0
  66. package/dist/src/internal/types-internal.js.map +1 -0
  67. package/dist/src/peer-health.d.ts +47 -0
  68. package/dist/src/peer-health.d.ts.map +1 -0
  69. package/dist/src/peer-health.js +169 -0
  70. package/dist/src/peer-health.js.map +1 -0
  71. package/dist/src/peer-retry.d.ts +16 -0
  72. package/dist/src/peer-retry.d.ts.map +1 -0
  73. package/dist/src/peer-retry.js +75 -0
  74. package/dist/src/peer-retry.js.map +1 -0
  75. package/dist/src/queueing-executor.d.ts +23 -0
  76. package/dist/src/queueing-executor.d.ts.map +1 -0
  77. package/dist/src/queueing-executor.js +179 -0
  78. package/dist/src/queueing-executor.js.map +1 -0
  79. package/dist/src/routing-rules.d.ts +53 -0
  80. package/dist/src/routing-rules.d.ts.map +1 -0
  81. package/dist/src/routing-rules.js +130 -0
  82. package/dist/src/routing-rules.js.map +1 -0
  83. package/dist/src/task-cleanup.d.ts +21 -0
  84. package/dist/src/task-cleanup.d.ts.map +1 -0
  85. package/dist/src/task-cleanup.js +77 -0
  86. package/dist/src/task-cleanup.js.map +1 -0
  87. package/dist/src/task-store.d.ts +16 -0
  88. package/dist/src/task-store.d.ts.map +1 -0
  89. package/dist/src/task-store.js +80 -0
  90. package/dist/src/task-store.js.map +1 -0
  91. package/dist/src/telemetry.d.ts +88 -0
  92. package/dist/src/telemetry.d.ts.map +1 -0
  93. package/dist/src/telemetry.js +235 -0
  94. package/dist/src/telemetry.js.map +1 -0
  95. package/dist/src/transport-fallback.d.ts +29 -0
  96. package/dist/src/transport-fallback.d.ts.map +1 -0
  97. package/dist/src/transport-fallback.js +81 -0
  98. package/dist/src/transport-fallback.js.map +1 -0
  99. package/dist/src/types.d.ts +160 -0
  100. package/dist/src/types.d.ts.map +1 -0
  101. package/dist/src/types.js +7 -0
  102. package/dist/src/types.js.map +1 -0
  103. package/openclaw.plugin.json +272 -0
  104. package/package.json +56 -0
  105. package/skill/SKILL.md +230 -0
  106. package/skill/references/tools-md-template.md +57 -0
  107. package/skill/scripts/a2a-send.mjs +357 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ccccl8
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # Claw Crony
2
+
3
+ OpenClaw A2A v0.3.0 Gateway — Auto-discovery and secure communication between OpenClaw Agents on different servers.
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
+ [![A2A v0.3.0](https://img.shields.io/badge/A2A-v0.3.0-green.svg)](https://github.com/google/A2A)
7
+
8
+ ## Key Features
9
+
10
+ - **A2A Protocol v0.3.0** — JSON-RPC / REST / gRPC with automatic fallback
11
+ - **Hub Matchmaking** — Auto-match peer Agents by skills with token exchange
12
+ - **Smart Routing** — Auto-select targets by message patterns, tags, or peer skills
13
+ - **Secure Auth** — Bearer Token + zero-downtime multi-token rotation
14
+ - **Resilience** — Health checks + exponential backoff + circuit breaker
15
+ - **File Transfer** — URI / base64 / MIME whitelist + SSRF protection
16
+ - **Observability** — JSONL audit logs + Telemetry metrics endpoint
17
+
18
+ ## Hub Server
19
+
20
+ Default Hub: `https://www.factormining.cn`
21
+
22
+ After installation, the plugin auto-registers with the Hub (requires `registrationEnabled: true`). Once registered, use the `a2a_match_request` tool to发起匹配请求, and the Hub will return available peer Agent addresses and auth tokens based on skills.
23
+
24
+ A2A service port: **18800** (default)
25
+
26
+ ## Quick Start
27
+
28
+ ```bash
29
+ # Clone
30
+ git clone https://github.com/ccccl8/claw-crony.git
31
+ cd claw-crony
32
+ npm install
33
+
34
+ # Register and enable
35
+ openclaw plugins install .
36
+ openclaw gateway restart
37
+
38
+ # Verify
39
+ curl -s http://localhost:18800/.well-known/agent-card.json
40
+ ```
41
+
42
+ ## Adding a Peer
43
+
44
+ ```bash
45
+ openclaw config set plugins.entries.claw-crony.config.peers '[{
46
+ "name": "Peer Name",
47
+ "agentCardUrl": "http://<peerIP>:18800/.well-known/agent-card.json",
48
+ "auth": { "type": "bearer", "token": "<peerToken>" }
49
+ }]'
50
+ openclaw gateway restart
51
+ ```
52
+
53
+ ## Hub Matchmaking (a2a_match_request)
54
+
55
+ 发起匹配请求 to the Hub, which automatically finds registered Agents with the required skills:
56
+
57
+ ```bash
58
+ # Agent calls a2a_match_request tool with params:
59
+ # { skills: ["chat"], description?: "optional description" }
60
+ #
61
+ # Returns: provider address + yourToken + peerToken
62
+ # Both sides configure each other as peers using the returned tokens to communicate
63
+ ```
64
+
65
+ For detailed configuration steps, see [CONFIG.md](CONFIG.md).
66
+
67
+ ## Endpoints
68
+
69
+ | Endpoint | Method | Description |
70
+ |----------|--------|-------------|
71
+ | `/.well-known/agent-card.json` | GET | Agent Card (discovery) |
72
+ | `/a2a/jsonrpc` | POST | A2A JSON-RPC |
73
+ | `/a2a/rest` | POST | A2A REST transport |
74
+ | `/a2a/metrics` | GET | Telemetry snapshot (when enabled) |
75
+
76
+ ## License
77
+
78
+ MIT License
79
+
80
+ ## Acknowledgments
81
+
82
+ This project is based on [win4r/openclaw-a2a-gateway](https://github.com/win4r/openclaw-a2a-gateway), MIT License.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A2A Gateway plugin endpoints:
3
+ * - /.well-known/agent.json (Agent Card discovery)
4
+ * - /a2a/jsonrpc (JSON-RPC transport)
5
+ * - /a2a/rest (REST transport)
6
+ * - gRPC on port+1 (gRPC transport)
7
+ */
8
+ import type { GatewayConfig, OpenClawPluginApi } from "./src/types.js";
9
+ export declare function parseConfig(raw: unknown, resolvePath?: (nextPath: string) => string): GatewayConfig;
10
+ declare const plugin: {
11
+ id: string;
12
+ name: string;
13
+ description: string;
14
+ register(api: OpenClawPluginApi): void;
15
+ };
16
+ export default plugin;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2BH,OAAO,KAAK,EAEV,aAAa,EAGb,iBAAiB,EAGlB,MAAM,gBAAgB,CAAC;AAmHxB,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,aAAa,CAgHnG;AAUD,QAAA,MAAM,MAAM;;;;kBAKI,iBAAiB;CAokBhC,CAAC;AAEF,eAAe,MAAM,CAAC"}