2020117-agent 0.5.2 → 0.6.0
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/README.md +2 -3
- package/dist/agent.d.ts +0 -16
- package/dist/agent.js +1 -1141
- package/dist/nostr.d.ts +2 -0
- package/dist/nostr.js +19 -0
- package/dist/session.js +16 -179
- package/dist/swarm.d.ts +1 -2
- package/package.json +2 -5
- package/dist/api.d.ts +0 -108
- package/dist/api.js +0 -316
- package/dist/cashu.d.ts +0 -75
- package/dist/cashu.js +0 -116
package/README.md
CHANGED
|
@@ -85,7 +85,6 @@ Environment variables also work: `AGENT=my-agent DVM_KIND=5100 2020117-agent`
|
|
|
85
85
|
import { createProcessor } from '2020117-agent/processor'
|
|
86
86
|
import { SwarmNode } from '2020117-agent/swarm'
|
|
87
87
|
import { collectPayment } from '2020117-agent/clink'
|
|
88
|
-
import { hasApiKey, registerService } from '2020117-agent/api'
|
|
89
88
|
```
|
|
90
89
|
|
|
91
90
|
## How It Works
|
|
@@ -100,13 +99,13 @@ import { hasApiKey, registerService } from '2020117-agent/api'
|
|
|
100
99
|
│ Kind 6xxx result) │
|
|
101
100
|
│ │
|
|
102
101
|
Hyperswarm DHT ◄──┤ P2P Sessions │──► Lightning Payments
|
|
103
|
-
(encrypted TCP) │ (session → HTTP │ (
|
|
102
|
+
(encrypted TCP) │ (session → HTTP │ (NWC / Invoice)
|
|
104
103
|
│ tunnel → result) │
|
|
105
104
|
└─────────────────────────┘
|
|
106
105
|
```
|
|
107
106
|
|
|
108
107
|
- **Relay channel** (primary): Subscribes to DVM requests (Kind 5xxx) via Nostr relay. Accepts by publishing Kind 7000, submits results via Kind 6xxx. Fully decentralized — no HTTP API dependency.
|
|
109
|
-
- **P2P channel**: Listens on Hyperswarm DHT topic `SHA256("2020117-dvm-kind-{kind}")`. Interactive sessions with per-minute billing (
|
|
108
|
+
- **P2P channel**: Listens on Hyperswarm DHT topic `SHA256("2020117-dvm-kind-{kind}")`. Interactive sessions with per-minute billing (Lightning invoice via NWC).
|
|
110
109
|
- Both channels share a single capacity counter — the agent never overloads.
|
|
111
110
|
|
|
112
111
|
## Development
|
package/dist/agent.d.ts
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Agent Runtime — Nostr-native daemon that handles:
|
|
4
|
-
* 1. DVM requests via relay subscription (Kind 5xxx → process → Kind 6xxx result)
|
|
5
|
-
* 2. P2P sessions (Hyperswarm + Lightning invoice per-minute billing)
|
|
6
|
-
*
|
|
7
|
-
* All agents sign Nostr events with their own private key and publish directly
|
|
8
|
-
* to relays. The platform API is only used for read operations (pipeline sub-tasks).
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* AGENT=translator DVM_KIND=5302 OLLAMA_MODEL=qwen2.5:0.5b npm run agent
|
|
12
|
-
* AGENT=my-agent DVM_KIND=5100 MAX_JOBS=5 npm run agent
|
|
13
|
-
* AGENT=broker DVM_KIND=5302 PROCESSOR=none SUB_KIND=5100 npm run agent
|
|
14
|
-
* AGENT=custom DVM_KIND=5100 PROCESSOR=exec:./my-model.sh npm run agent
|
|
15
|
-
* AGENT=remote DVM_KIND=5100 PROCESSOR=http://localhost:8080 npm run agent
|
|
16
|
-
*/
|
|
17
1
|
export {};
|