@elizaos/plugin-bluesky 2.0.0-beta.1 → 2.0.3-beta.2
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 +88 -160
- package/package.json +14 -7
- package/dist/browser/index.browser.js +0 -72
- package/dist/browser/index.browser.js.map +0 -10
- package/dist/browser/index.d.ts +0 -2
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.node.cjs +0 -1555
- package/dist/cjs/index.node.js.map +0 -20
- package/dist/index.d.ts +0 -2
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.node.js +0 -1510
- package/dist/node/index.node.js.map +0 -20
package/README.md
CHANGED
|
@@ -1,203 +1,131 @@
|
|
|
1
1
|
# @elizaos/plugin-bluesky
|
|
2
2
|
|
|
3
|
-
BlueSky plugin for elizaOS
|
|
3
|
+
BlueSky (AT Protocol) client plugin for elizaOS. Adds BlueSky social capabilities to any Eliza agent: public-feed posting, direct messages, and notification polling.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What it does
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **Profile Management**: Access user profiles and timelines
|
|
13
|
-
- **Automated Posting**: Schedule and automate post creation
|
|
7
|
+
- **Public posts** — create, like, repost, delete posts; read and search the timeline.
|
|
8
|
+
- **Direct messages** — send and receive DMs via `chat.bsky` (AT Protocol chat API).
|
|
9
|
+
- **Notifications** — poll mentions, replies, follows, likes, reposts, and quotes; emit elizaOS events for each.
|
|
10
|
+
- **Automated posting** — optional randomized posting loop driven by configurable intervals.
|
|
11
|
+
- **Multi-account** — configure multiple BlueSky handles per agent.
|
|
14
12
|
|
|
15
13
|
## Installation
|
|
16
14
|
|
|
17
|
-
### TypeScript/JavaScript
|
|
18
|
-
|
|
19
15
|
```bash
|
|
20
|
-
npm install @elizaos/plugin-bluesky
|
|
21
|
-
# or
|
|
22
16
|
bun add @elizaos/plugin-bluesky
|
|
23
17
|
```
|
|
24
|
-
## Configuration
|
|
25
|
-
|
|
26
|
-
### Environment Variables
|
|
27
|
-
|
|
28
|
-
Required:
|
|
29
18
|
|
|
30
|
-
|
|
31
|
-
- `BLUESKY_PASSWORD`: Your app password (generate at https://bsky.app/settings/app-passwords)
|
|
19
|
+
## Enabling the plugin
|
|
32
20
|
|
|
33
|
-
|
|
34
|
-
| Variable | Description | Default |
|
|
35
|
-
|----------|-------------|---------|
|
|
36
|
-
| `BLUESKY_SERVICE` | BlueSky service URL | `https://bsky.social` |
|
|
37
|
-
| `BLUESKY_DRY_RUN` | Simulate operations without executing | `false` |
|
|
38
|
-
| `BLUESKY_POLL_INTERVAL` | Notification polling interval (seconds) | `60` |
|
|
39
|
-
| `BLUESKY_ENABLE_POSTING` | Enable automated posting | `true` |
|
|
40
|
-
| `BLUESKY_ENABLE_DMS` | Enable direct messaging | `true` |
|
|
41
|
-
| `BLUESKY_POST_INTERVAL_MIN` | Minimum post interval (seconds) | `1800` |
|
|
42
|
-
| `BLUESKY_POST_INTERVAL_MAX` | Maximum post interval (seconds) | `3600` |
|
|
43
|
-
| `BLUESKY_ENABLE_ACTION_PROCESSING` | Enable action processing | `true` |
|
|
44
|
-
| `BLUESKY_ACTION_INTERVAL` | Action processing interval (seconds) | `120` |
|
|
45
|
-
| `BLUESKY_POST_IMMEDIATELY` | Post immediately on startup | `false` |
|
|
46
|
-
| `BLUESKY_MAX_ACTIONS_PROCESSING` | Max actions per batch | `5` |
|
|
21
|
+
Add `blueSkyPlugin` to your agent's plugin list:
|
|
47
22
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
### TypeScript
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
23
|
+
```ts
|
|
53
24
|
import { blueSkyPlugin } from "@elizaos/plugin-bluesky";
|
|
54
25
|
|
|
55
|
-
// Add to your elizaOS agent
|
|
56
26
|
const agent = createAgent({
|
|
57
27
|
plugins: [blueSkyPlugin],
|
|
58
28
|
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The plugin is opt-in: if `BLUESKY_HANDLE` and `BLUESKY_PASSWORD` are not set (or `BLUESKY_ENABLED=false`), it starts but does nothing.
|
|
32
|
+
|
|
33
|
+
## Required configuration
|
|
34
|
+
|
|
35
|
+
| Variable | Description |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `BLUESKY_HANDLE` | Your BlueSky handle, e.g. `agent.bsky.social` |
|
|
38
|
+
| `BLUESKY_PASSWORD` | App password — generate at https://bsky.app/settings/app-passwords |
|
|
39
|
+
|
|
40
|
+
## Optional configuration
|
|
41
|
+
|
|
42
|
+
| Variable | Default | Description |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| `BLUESKY_ENABLED` | inferred | Explicit `true`/`false` override |
|
|
45
|
+
| `BLUESKY_SERVICE` | `https://bsky.social` | PDS URL (for self-hosted instances) |
|
|
46
|
+
| `BLUESKY_DRY_RUN` | `false` | Log operations without sending to the API |
|
|
47
|
+
| `BLUESKY_POLL_INTERVAL` | `60` | Notification poll interval (seconds) |
|
|
48
|
+
| `BLUESKY_ENABLE_POSTING` | `true` | Enable automated posting loop |
|
|
49
|
+
| `BLUESKY_POST_INTERVAL_MIN` | `1800` | Minimum seconds between auto-posts |
|
|
50
|
+
| `BLUESKY_POST_INTERVAL_MAX` | `3600` | Maximum seconds between auto-posts |
|
|
51
|
+
| `BLUESKY_POST_IMMEDIATELY` | `false` | Post immediately on startup |
|
|
52
|
+
| `BLUESKY_ENABLE_ACTION_PROCESSING` | `true` | Process mention/reply response cycle |
|
|
53
|
+
| `BLUESKY_ACTION_INTERVAL` | `120` | Action-processing cycle interval (seconds) |
|
|
54
|
+
| `BLUESKY_MAX_ACTIONS_PROCESSING` | `5` | Max notifications handled per cycle |
|
|
55
|
+
| `BLUESKY_ENABLE_DMS` | `true` | Enable DM connector |
|
|
56
|
+
| `BLUESKY_MAX_POST_LENGTH` | `300` | Character cap (AT Protocol max is 300) |
|
|
57
|
+
| `BLUESKY_ACCOUNTS` | — | JSON for multi-handle configuration (see below) |
|
|
58
|
+
| `BLUESKY_DEFAULT_ACCOUNT_ID` | `"default"` | Which account to use as the default |
|
|
59
|
+
|
|
60
|
+
## Multi-account configuration
|
|
61
|
+
|
|
62
|
+
Pass `BLUESKY_ACCOUNTS` as a JSON array or object to configure multiple handles:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
[
|
|
66
|
+
{ "accountId": "main", "handle": "main.bsky.social", "password": "app-password-1" },
|
|
67
|
+
{ "accountId": "alt", "handle": "alt.bsky.social", "password": "app-password-2" }
|
|
68
|
+
]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Or set it in `character.settings.bluesky.accounts` with the same shape.
|
|
72
|
+
|
|
73
|
+
## Events
|
|
74
|
+
|
|
75
|
+
The plugin emits these elizaOS events that your handlers can subscribe to:
|
|
59
76
|
|
|
60
|
-
|
|
61
|
-
|
|
77
|
+
| Event | When |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `bluesky.mention_received` | Agent is mentioned or replied to |
|
|
80
|
+
| `bluesky.follow_received` | Agent receives a new follower |
|
|
81
|
+
| `bluesky.like_received` | An agent post is liked |
|
|
82
|
+
| `bluesky.repost_received` | An agent post is reposted |
|
|
83
|
+
| `bluesky.quote_received` | An agent post is quoted |
|
|
84
|
+
| `bluesky.should_respond` | Mention/reply enters the action-processing cycle |
|
|
85
|
+
| `bluesky.create_post` | Automated posting timer fires |
|
|
86
|
+
|
|
87
|
+
## Using BlueSkyClient directly
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { BlueSkyClient } from "@elizaos/plugin-bluesky";
|
|
62
91
|
|
|
63
92
|
const client = new BlueSkyClient({
|
|
64
93
|
service: "https://bsky.social",
|
|
65
|
-
handle: "
|
|
94
|
+
handle: "agent.bsky.social",
|
|
66
95
|
password: "your-app-password",
|
|
96
|
+
dryRun: false,
|
|
67
97
|
});
|
|
68
98
|
|
|
69
99
|
await client.authenticate();
|
|
70
|
-
const post = await client.sendPost({ content: { text: "Hello BlueSky!" } });
|
|
71
|
-
```
|
|
72
|
-
## Features
|
|
73
100
|
|
|
74
|
-
|
|
101
|
+
// Post
|
|
102
|
+
const post = await client.sendPost({ content: { text: "Hello from elizaOS!" } });
|
|
75
103
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
content: { text: "Hello BlueSky!" },
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// Reply to a post
|
|
83
|
-
const reply = await client.sendPost({
|
|
84
|
-
content: { text: "This is a reply!" },
|
|
104
|
+
// Reply
|
|
105
|
+
await client.sendPost({
|
|
106
|
+
content: { text: "Replying!" },
|
|
85
107
|
replyTo: { uri: post.uri, cid: post.cid },
|
|
86
108
|
});
|
|
87
109
|
|
|
88
|
-
// Like
|
|
110
|
+
// Like / repost / delete
|
|
89
111
|
await client.likePost(post.uri, post.cid);
|
|
90
|
-
|
|
91
|
-
// Repost
|
|
92
112
|
await client.repost(post.uri, post.cid);
|
|
93
|
-
|
|
94
|
-
// Delete a post
|
|
95
113
|
await client.deletePost(post.uri);
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Direct Messages
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
101
|
-
// Get conversations
|
|
102
|
-
const { conversations } = await client.getConversations();
|
|
103
|
-
|
|
104
|
-
// Get messages from a conversation
|
|
105
|
-
const { messages } = await client.getMessages(convoId);
|
|
106
|
-
|
|
107
|
-
// Send a message
|
|
108
|
-
const message = await client.sendMessage({
|
|
109
|
-
convoId: "conversation-id",
|
|
110
|
-
message: { text: "Hello!" },
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
// Timeline and search
|
|
116
|
+
const timeline = await client.getTimeline({ limit: 50 });
|
|
117
|
+
const results = await client.searchPosts({ query: "elizaOS", limit: 25 });
|
|
115
118
|
|
|
116
|
-
|
|
117
|
-
// Get notifications
|
|
119
|
+
// Notifications
|
|
118
120
|
const { notifications } = await client.getNotifications(50);
|
|
119
|
-
|
|
120
|
-
// Mark as read
|
|
121
121
|
await client.updateSeenNotifications();
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Timeline
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
// Get timeline
|
|
128
|
-
const timeline = await client.getTimeline({ limit: 50 });
|
|
129
|
-
|
|
130
|
-
for (const item of timeline.feed) {
|
|
131
|
-
console.log(`@${item.post.author.handle}: ${item.post.record.text}`);
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Profiles
|
|
136
|
-
|
|
137
|
-
```typescript
|
|
138
|
-
// Get a profile
|
|
139
|
-
const profile = await client.getProfile("user.bsky.social");
|
|
140
|
-
console.log(`${profile.displayName} - ${profile.followersCount} followers`);
|
|
141
|
-
```
|
|
142
122
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
| Event | Description |
|
|
148
|
-
| -------------------------- | ------------------------------- |
|
|
149
|
-
| `bluesky.mention_received` | Agent was mentioned in a post |
|
|
150
|
-
| `bluesky.follow_received` | Agent received a new follower |
|
|
151
|
-
| `bluesky.like_received` | Agent's post was liked |
|
|
152
|
-
| `bluesky.repost_received` | Agent's post was reposted |
|
|
153
|
-
| `bluesky.quote_received` | Agent's post was quoted |
|
|
154
|
-
| `bluesky.should_respond` | Trigger for response generation |
|
|
155
|
-
| `bluesky.create_post` | Trigger for automated posting |
|
|
156
|
-
|
|
157
|
-
## Development
|
|
158
|
-
|
|
159
|
-
### TypeScript
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
cd typescript
|
|
163
|
-
bun install
|
|
164
|
-
bun run build
|
|
165
|
-
npx vitest
|
|
166
|
-
```
|
|
167
|
-
## Architecture
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
plugin-bluesky/
|
|
171
|
-
├── typescript/ # TypeScript implementation
|
|
172
|
-
│ ├── index.ts # Main plugin export
|
|
173
|
-
│ ├── client.ts # BlueSky API client
|
|
174
|
-
│ ├── types/ # Type definitions
|
|
175
|
-
│ ├── services/ # Service implementations
|
|
176
|
-
│ ├── managers/ # Agent manager
|
|
177
|
-
│ └── utils/ # Configuration utilities
|
|
178
|
-
├── python/ # Python implementation
|
|
179
|
-
│ ├── elizaos_plugin_bluesky/
|
|
180
|
-
│ │ ├── __init__.py # Package exports
|
|
181
|
-
│ │ ├── client.py # BlueSky API client
|
|
182
|
-
│ │ ├── config.py # Configuration
|
|
183
|
-
│ │ ├── types.py # Type definitions
|
|
184
|
-
│ │ └── errors.py # Error types
|
|
185
|
-
│ └── tests/ # Test suite
|
|
186
|
-
├── rust/ # Rust implementation
|
|
187
|
-
│ ├── src/
|
|
188
|
-
│ │ ├── lib.rs # Library root
|
|
189
|
-
│ │ ├── client.rs # BlueSky API client
|
|
190
|
-
│ │ ├── config.rs # Configuration
|
|
191
|
-
│ │ ├── types.rs # Type definitions
|
|
192
|
-
│ │ └── error.rs # Error types
|
|
193
|
-
│ └── tests/ # Integration tests
|
|
194
|
-
└── package.json # Root package configuration
|
|
123
|
+
// DMs (requires chat.bsky access)
|
|
124
|
+
const { conversations } = await client.getConversations();
|
|
125
|
+
const { messages } = await client.getMessages(conversations[0].id);
|
|
126
|
+
await client.sendMessage({ convoId: conversations[0].id, message: { text: "Hello!" } });
|
|
195
127
|
```
|
|
196
128
|
|
|
197
129
|
## License
|
|
198
130
|
|
|
199
|
-
MIT
|
|
200
|
-
|
|
201
|
-
## Contributing
|
|
202
|
-
|
|
203
|
-
Contributions are welcome! Please ensure your changes maintain feature parity across all three language implementations.
|
|
131
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-bluesky",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-beta.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cjs/index.node.cjs",
|
|
@@ -28,6 +28,12 @@
|
|
|
28
28
|
"default": "./dist/node/index.node.js"
|
|
29
29
|
},
|
|
30
30
|
"default": "./dist/node/index.node.js"
|
|
31
|
+
},
|
|
32
|
+
"./*.css": "./dist/*.css",
|
|
33
|
+
"./*": {
|
|
34
|
+
"types": "./dist/*.d.ts",
|
|
35
|
+
"import": "./dist/*.js",
|
|
36
|
+
"default": "./dist/*.js"
|
|
31
37
|
}
|
|
32
38
|
},
|
|
33
39
|
"files": [
|
|
@@ -42,7 +48,7 @@
|
|
|
42
48
|
"dev": "bun --hot build.ts",
|
|
43
49
|
"clean": "rm -rf dist .turbo",
|
|
44
50
|
"test": "vitest run",
|
|
45
|
-
"typecheck": "
|
|
51
|
+
"typecheck": "tsgo --noEmit",
|
|
46
52
|
"lint": "bunx @biomejs/biome check --write --unsafe .",
|
|
47
53
|
"lint:check": "bunx @biomejs/biome check .",
|
|
48
54
|
"format": "bunx @biomejs/biome format --write .",
|
|
@@ -51,10 +57,10 @@
|
|
|
51
57
|
"dependencies": {
|
|
52
58
|
"@atproto/api": "^0.19.0",
|
|
53
59
|
"@atproto/identity": "^0.4.4",
|
|
54
|
-
"@atproto/lexicon": "^0.
|
|
55
|
-
"@atproto/syntax": "^0.
|
|
60
|
+
"@atproto/lexicon": "^0.7.2",
|
|
61
|
+
"@atproto/syntax": "^0.6.1",
|
|
56
62
|
"@atproto/xrpc": "^0.7.0",
|
|
57
|
-
"@elizaos/core": "2.0.
|
|
63
|
+
"@elizaos/core": "2.0.3-beta.2",
|
|
58
64
|
"lru-cache": "^11.1.0",
|
|
59
65
|
"zod": "^4.4.3"
|
|
60
66
|
},
|
|
@@ -64,7 +70,7 @@
|
|
|
64
70
|
"typescript": "^6.0.3"
|
|
65
71
|
},
|
|
66
72
|
"peerDependencies": {
|
|
67
|
-
"@elizaos/core": "2.0.
|
|
73
|
+
"@elizaos/core": "2.0.3-beta.2"
|
|
68
74
|
},
|
|
69
75
|
"resolutions": {
|
|
70
76
|
"@noble/hashes": "2.2.0"
|
|
@@ -193,5 +199,6 @@
|
|
|
193
199
|
"browser": "Browser-compatible build available via exports.browser",
|
|
194
200
|
"node": "Node.js build available via exports.node"
|
|
195
201
|
}
|
|
196
|
-
}
|
|
202
|
+
},
|
|
203
|
+
"gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
|
|
197
204
|
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// types/index.ts
|
|
2
|
-
import * as zod from "zod";
|
|
3
|
-
var z2 = zod.z ?? zod;
|
|
4
|
-
var BLUESKY_SERVICE_URL = "https://bsky.social";
|
|
5
|
-
var BLUESKY_MAX_POST_LENGTH = 300;
|
|
6
|
-
var BLUESKY_POLL_INTERVAL = 60;
|
|
7
|
-
var BLUESKY_POST_INTERVAL_MIN = 1800;
|
|
8
|
-
var BLUESKY_POST_INTERVAL_MAX = 3600;
|
|
9
|
-
var BLUESKY_ACTION_INTERVAL = 120;
|
|
10
|
-
var BLUESKY_MAX_ACTIONS = 5;
|
|
11
|
-
var BLUESKY_CHAT_SERVICE_DID = "did:web:api.bsky.chat";
|
|
12
|
-
var BLUESKY_SERVICE_NAME = "bluesky";
|
|
13
|
-
var AT_PROTOCOL_HANDLE_REGEX = /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;
|
|
14
|
-
var CACHE_TTL = {
|
|
15
|
-
PROFILE: 3600000,
|
|
16
|
-
TIMELINE: 300000,
|
|
17
|
-
POST: 1800000,
|
|
18
|
-
NOTIFICATIONS: 300000,
|
|
19
|
-
CONVERSATIONS: 300000
|
|
20
|
-
};
|
|
21
|
-
var CACHE_SIZE = {
|
|
22
|
-
PROFILE: 1000,
|
|
23
|
-
TIMELINE: 500,
|
|
24
|
-
POST: 1e4,
|
|
25
|
-
NOTIFICATIONS: 1000,
|
|
26
|
-
CONVERSATIONS: 100
|
|
27
|
-
};
|
|
28
|
-
var BlueSkyConfigSchema = z2.object({
|
|
29
|
-
handle: z2.string().regex(AT_PROTOCOL_HANDLE_REGEX, "Invalid handle format"),
|
|
30
|
-
password: z2.string().min(1),
|
|
31
|
-
service: z2.string().url().default(BLUESKY_SERVICE_URL),
|
|
32
|
-
dryRun: z2.boolean().default(false),
|
|
33
|
-
pollInterval: z2.number().positive().default(BLUESKY_POLL_INTERVAL),
|
|
34
|
-
enablePost: z2.boolean().default(true),
|
|
35
|
-
postIntervalMin: z2.number().positive().default(BLUESKY_POST_INTERVAL_MIN),
|
|
36
|
-
postIntervalMax: z2.number().positive().default(BLUESKY_POST_INTERVAL_MAX),
|
|
37
|
-
enableActionProcessing: z2.boolean().default(true),
|
|
38
|
-
actionInterval: z2.number().positive().default(BLUESKY_ACTION_INTERVAL),
|
|
39
|
-
postImmediately: z2.boolean().default(false),
|
|
40
|
-
maxActionsProcessing: z2.number().positive().default(BLUESKY_MAX_ACTIONS),
|
|
41
|
-
enableDMs: z2.boolean().default(true)
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
class BlueSkyError extends Error {
|
|
45
|
-
code;
|
|
46
|
-
status;
|
|
47
|
-
constructor(message, code, status) {
|
|
48
|
-
super(message);
|
|
49
|
-
this.code = code;
|
|
50
|
-
this.status = status;
|
|
51
|
-
this.name = "BlueSkyError";
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
CACHE_TTL,
|
|
56
|
-
CACHE_SIZE,
|
|
57
|
-
BlueSkyError,
|
|
58
|
-
BlueSkyConfigSchema,
|
|
59
|
-
BlueSkyConfig,
|
|
60
|
-
BLUESKY_SERVICE_URL,
|
|
61
|
-
BLUESKY_SERVICE_NAME,
|
|
62
|
-
BLUESKY_POST_INTERVAL_MIN,
|
|
63
|
-
BLUESKY_POST_INTERVAL_MAX,
|
|
64
|
-
BLUESKY_POLL_INTERVAL,
|
|
65
|
-
BLUESKY_MAX_POST_LENGTH,
|
|
66
|
-
BLUESKY_MAX_ACTIONS,
|
|
67
|
-
BLUESKY_CHAT_SERVICE_DID,
|
|
68
|
-
BLUESKY_ACTION_INTERVAL,
|
|
69
|
-
AT_PROTOCOL_HANDLE_REGEX
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
//# debugId=028253F8E0BBFEA764756E2164756E21
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../types/index.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { IAgentRuntime } from \"@elizaos/core\";\nimport * as zod from \"zod\";\n\nconst z = zod.z ?? zod;\n\nexport const BLUESKY_SERVICE_URL = \"https://bsky.social\";\nexport const BLUESKY_MAX_POST_LENGTH = 300;\nexport const BLUESKY_POLL_INTERVAL = 60;\nexport const BLUESKY_POST_INTERVAL_MIN = 1800;\nexport const BLUESKY_POST_INTERVAL_MAX = 3600;\nexport const BLUESKY_ACTION_INTERVAL = 120;\nexport const BLUESKY_MAX_ACTIONS = 5;\nexport const BLUESKY_CHAT_SERVICE_DID = \"did:web:api.bsky.chat\";\nexport const BLUESKY_SERVICE_NAME = \"bluesky\";\n\nexport const AT_PROTOCOL_HANDLE_REGEX =\n\t/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;\n\nexport const CACHE_TTL = {\n\tPROFILE: 3600000,\n\tTIMELINE: 300000,\n\tPOST: 1800000,\n\tNOTIFICATIONS: 300000,\n\tCONVERSATIONS: 300000,\n} as const;\n\nexport const CACHE_SIZE = {\n\tPROFILE: 1000,\n\tTIMELINE: 500,\n\tPOST: 10000,\n\tNOTIFICATIONS: 1000,\n\tCONVERSATIONS: 100,\n} as const;\n\nexport const BlueSkyConfigSchema = z.object({\n\thandle: z.string().regex(AT_PROTOCOL_HANDLE_REGEX, \"Invalid handle format\"),\n\tpassword: z.string().min(1),\n\tservice: z.string().url().default(BLUESKY_SERVICE_URL),\n\tdryRun: z.boolean().default(false),\n\tpollInterval: z.number().positive().default(BLUESKY_POLL_INTERVAL),\n\tenablePost: z.boolean().default(true),\n\tpostIntervalMin: z.number().positive().default(BLUESKY_POST_INTERVAL_MIN),\n\tpostIntervalMax: z.number().positive().default(BLUESKY_POST_INTERVAL_MAX),\n\tenableActionProcessing: z.boolean().default(true),\n\tactionInterval: z.number().positive().default(BLUESKY_ACTION_INTERVAL),\n\tpostImmediately: z.boolean().default(false),\n\tmaxActionsProcessing: z.number().positive().default(BLUESKY_MAX_ACTIONS),\n\tenableDMs: z.boolean().default(true),\n});\n\nexport type BlueSkyConfig = zod.infer<typeof BlueSkyConfigSchema>;\n\nexport interface BlueSkyProfile {\n\tdid: string;\n\thandle: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tavatar?: string;\n\tbanner?: string;\n\tfollowersCount?: number;\n\tfollowsCount?: number;\n\tpostsCount?: number;\n\tindexedAt?: string;\n\tcreatedAt?: string;\n}\n\nexport interface PostFacet {\n\tindex: { byteStart: number; byteEnd: number };\n\tfeatures: Array<{\n\t\t$type?: string;\n\t\t[key: string]: string | number | boolean | object | null | undefined;\n\t}>;\n}\n\nexport interface PostEmbed {\n\t$type: string;\n\t[key: string]: string | number | boolean | object | null | undefined;\n}\n\nexport interface PostRecord {\n\t$type: string;\n\ttext: string;\n\tfacets?: PostFacet[];\n\tembed?: PostEmbed;\n\tcreatedAt: string;\n}\n\nexport interface BlueSkyPost {\n\turi: string;\n\tcid: string;\n\tauthor: BlueSkyProfile;\n\trecord: PostRecord;\n\tembed?: PostEmbed;\n\treplyCount?: number;\n\trepostCount?: number;\n\tlikeCount?: number;\n\tquoteCount?: number;\n\tindexedAt: string;\n}\n\nexport interface TimelineRequest {\n\talgorithm?: string;\n\tlimit?: number;\n\tcursor?: string;\n}\n\nexport interface TimelineFeedItem {\n\tpost: BlueSkyPost;\n\treply?: {\n\t\troot: BlueSkyPost;\n\t\tparent: BlueSkyPost;\n\t};\n\treason?: Record<\n\t\tstring,\n\t\tstring | number | boolean | object | null | undefined\n\t>;\n}\n\nexport interface TimelineResponse {\n\tcursor?: string;\n\tfeed: TimelineFeedItem[];\n}\n\nexport interface CreatePostRequest {\n\tcontent: {\n\t\ttext: string;\n\t\tfacets?: PostFacet[];\n\t\tembed?: PostEmbed;\n\t};\n\treplyTo?: { uri: string; cid: string };\n}\n\nexport type NotificationReason =\n\t| \"mention\"\n\t| \"reply\"\n\t| \"follow\"\n\t| \"like\"\n\t| \"repost\"\n\t| \"quote\";\n\nexport interface BlueSkyNotification {\n\turi: string;\n\tcid: string;\n\tauthor: BlueSkyProfile;\n\treason: NotificationReason;\n\treasonSubject?: string;\n\trecord: Record<string, string | number | boolean | object | null | undefined>;\n\tisRead: boolean;\n\tindexedAt: string;\n}\n\nexport interface BlueSkyMessage {\n\tid: string;\n\trev: string;\n\ttext?: string;\n\tembed?: PostEmbed;\n\tsender: { did: string };\n\tsentAt: string;\n}\n\nexport interface BlueSkyConversation {\n\tid: string;\n\trev: string;\n\tmembers: Array<{\n\t\tdid: string;\n\t\thandle?: string;\n\t\tdisplayName?: string;\n\t\tavatar?: string;\n\t}>;\n\tlastMessage?: BlueSkyMessage;\n\tunreadCount: number;\n\tmuted: boolean;\n}\n\nexport interface SendMessageRequest {\n\tconvoId: string;\n\tmessage: { text?: string; embed?: PostEmbed };\n}\n\nexport interface BlueSkySession {\n\tdid: string;\n\thandle: string;\n\temail?: string;\n\taccessJwt: string;\n\trefreshJwt: string;\n}\n\nexport class BlueSkyError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly code: string,\n\t\tpublic readonly status?: number,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"BlueSkyError\";\n\t}\n}\n\nexport interface ATProtocolPostRecord {\n\t$type: string;\n\ttext: string;\n\tfacets?: PostFacet[];\n\tembed?: PostEmbed;\n\tcreatedAt: string;\n\t[k: string]:\n\t\t| string\n\t\t| PostFacet[]\n\t\t| PostEmbed\n\t\t| number\n\t\t| boolean\n\t\t| null\n\t\t| undefined;\n}\n\nexport interface ATProtocolProfileViewExtended {\n\tdid: string;\n\thandle: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tavatar?: string;\n\tbanner?: string;\n\tfollowersCount?: number;\n\tfollowsCount?: number;\n\tpostsCount?: number;\n\tindexedAt?: string;\n\tcreatedAt?: string;\n\t[k: string]: string | number | undefined;\n}\n\nexport interface BlueSkyEventPayload {\n\truntime: IAgentRuntime;\n\tsource: \"bluesky\";\n\taccountId?: string;\n}\n\nexport interface BlueSkyNotificationEventPayload extends BlueSkyEventPayload {\n\tnotification: BlueSkyNotification;\n}\n\nexport interface BlueSkyCreatePostEventPayload extends BlueSkyEventPayload {\n\tautomated: boolean;\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";AACA;AAEA,IAAM,KAAQ,SAAK;AAEZ,IAAM,sBAAsB;AAC5B,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAC9B,IAAM,4BAA4B;AAClC,IAAM,4BAA4B;AAClC,IAAM,0BAA0B;AAChC,IAAM,sBAAsB;AAC5B,IAAM,2BAA2B;AACjC,IAAM,uBAAuB;AAE7B,IAAM,2BACZ;AAEM,IAAM,YAAY;AAAA,EACxB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,eAAe;AAAA,EACf,eAAe;AAChB;AAEO,IAAM,aAAa;AAAA,EACzB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,eAAe;AAAA,EACf,eAAe;AAChB;AAEO,IAAM,sBAAsB,GAAE,OAAO;AAAA,EAC3C,QAAQ,GAAE,OAAO,EAAE,MAAM,0BAA0B,uBAAuB;AAAA,EAC1E,UAAU,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC1B,SAAS,GAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,mBAAmB;AAAA,EACrD,QAAQ,GAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EACjC,cAAc,GAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,qBAAqB;AAAA,EACjE,YAAY,GAAE,QAAQ,EAAE,QAAQ,IAAI;AAAA,EACpC,iBAAiB,GAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,yBAAyB;AAAA,EACxE,iBAAiB,GAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,yBAAyB;AAAA,EACxE,wBAAwB,GAAE,QAAQ,EAAE,QAAQ,IAAI;AAAA,EAChD,gBAAgB,GAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,uBAAuB;AAAA,EACrE,iBAAiB,GAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EAC1C,sBAAsB,GAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,mBAAmB;AAAA,EACvE,WAAW,GAAE,QAAQ,EAAE,QAAQ,IAAI;AACpC,CAAC;AAAA;AA2IM,MAAM,qBAAqB,MAAM;AAAA,EAGtB;AAAA,EACA;AAAA,EAHjB,WAAW,CACV,SACgB,MACA,QACf;AAAA,IACD,MAAM,OAAO;AAAA,IAHG;AAAA,IACA;AAAA,IAGhB,KAAK,OAAO;AAAA;AAEd;",
|
|
8
|
-
"debugId": "028253F8E0BBFEA764756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/browser/index.d.ts
DELETED
package/dist/cjs/index.d.ts
DELETED