@elizaos/plugin-bluesky 2.0.0-alpha.7 → 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 ADDED
@@ -0,0 +1,131 @@
1
+ # @elizaos/plugin-bluesky
2
+
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
+
5
+ ## What it does
6
+
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.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ bun add @elizaos/plugin-bluesky
17
+ ```
18
+
19
+ ## Enabling the plugin
20
+
21
+ Add `blueSkyPlugin` to your agent's plugin list:
22
+
23
+ ```ts
24
+ import { blueSkyPlugin } from "@elizaos/plugin-bluesky";
25
+
26
+ const agent = createAgent({
27
+ plugins: [blueSkyPlugin],
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:
76
+
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";
91
+
92
+ const client = new BlueSkyClient({
93
+ service: "https://bsky.social",
94
+ handle: "agent.bsky.social",
95
+ password: "your-app-password",
96
+ dryRun: false,
97
+ });
98
+
99
+ await client.authenticate();
100
+
101
+ // Post
102
+ const post = await client.sendPost({ content: { text: "Hello from elizaOS!" } });
103
+
104
+ // Reply
105
+ await client.sendPost({
106
+ content: { text: "Replying!" },
107
+ replyTo: { uri: post.uri, cid: post.cid },
108
+ });
109
+
110
+ // Like / repost / delete
111
+ await client.likePost(post.uri, post.cid);
112
+ await client.repost(post.uri, post.cid);
113
+ await client.deletePost(post.uri);
114
+
115
+ // Timeline and search
116
+ const timeline = await client.getTimeline({ limit: 50 });
117
+ const results = await client.searchPosts({ query: "elizaOS", limit: 25 });
118
+
119
+ // Notifications
120
+ const { notifications } = await client.getNotifications(50);
121
+ await client.updateSeenNotifications();
122
+
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!" } });
127
+ ```
128
+
129
+ ## License
130
+
131
+ MIT
package/package.json CHANGED
@@ -1,191 +1,204 @@
1
1
  {
2
- "name": "@elizaos/plugin-bluesky",
3
- "version": "2.0.0-alpha.7",
4
- "description": "",
5
- "type": "module",
6
- "main": "dist/cjs/index.node.cjs",
7
- "module": "dist/node/index.node.js",
8
- "types": "dist/node/index.d.ts",
9
- "browser": "dist/browser/index.browser.js",
10
- "sideEffects": false,
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/elizaos/elizaos.git"
14
- },
15
- "exports": {
16
- "./package.json": "./package.json",
17
- ".": {
18
- "types": "./dist/node/index.d.ts",
19
- "browser": {
20
- "types": "./dist/browser/index.d.ts",
21
- "import": "./dist/browser/index.browser.js",
22
- "default": "./dist/browser/index.browser.js"
23
- },
24
- "node": {
25
- "types": "./dist/node/index.d.ts",
26
- "import": "./dist/node/index.node.js",
27
- "require": "./dist/cjs/index.node.cjs",
28
- "default": "./dist/node/index.node.js"
29
- },
30
- "default": "./dist/node/index.node.js"
31
- }
32
- },
33
- "files": [
34
- "dist"
35
- ],
36
- "keywords": [],
37
- "author": "elizaOS",
38
- "license": "MIT",
39
- "scripts": {
40
- "build": "bun run build.ts",
41
- "build:ts": "bun run build.ts",
42
- "dev": "bun --hot build.ts",
43
- "clean": "rm -rf dist .turbo node_modules",
44
- "test": "vitest run --passWithNoTests",
45
- "typecheck": "tsc --noEmit",
46
- "lint": "bunx @biomejs/biome check --write --unsafe .",
47
- "lint:check": "bunx @biomejs/biome check .",
48
- "format": "bunx @biomejs/biome format --write .",
49
- "format:check": "bunx @biomejs/biome format ."
50
- },
51
- "dependencies": {
52
- "@atproto/api": "^0.13.14",
53
- "@atproto/identity": "^0.4.4",
54
- "@atproto/lexicon": "^0.4.11",
55
- "@atproto/syntax": "^0.3.2",
56
- "@atproto/xrpc": "^0.6.4",
57
- "@elizaos/core": "2.0.0-alpha.3",
58
- "lru-cache": "^11.1.0",
59
- "zod": "^4.3.6"
60
- },
61
- "devDependencies": {
62
- "@biomejs/biome": "^2.3.11",
63
- "@types/node": "^25.0.3",
64
- "typescript": "^5.9.3"
65
- },
66
- "peerDependencies": {
67
- "@elizaos/core": "2.0.0-alpha.3"
68
- },
69
- "publishConfig": {
70
- "access": "public"
71
- },
72
- "agentConfig": {
73
- "pluginType": "elizaos:client:1.0.0",
74
- "pluginParameters": {
75
- "BLUESKY_ENABLED": {
76
- "type": "boolean",
77
- "description": "Enables or disables the BlueSky plugin.",
78
- "required": false,
79
- "default": true,
80
- "sensitive": false
81
- },
82
- "BLUESKY_DRY_RUN": {
83
- "type": "boolean",
84
- "description": "Enables or disables dry run mode when interacting with BlueSky; when true, operations are simulated but not executed.",
85
- "required": false,
86
- "default": false,
87
- "sensitive": false
88
- },
89
- "BLUESKY_HANDLE": {
90
- "type": "string",
91
- "description": "The BlueSky handle (username) for the agent account.",
92
- "required": true,
93
- "sensitive": false
94
- },
95
- "BLUESKY_PASSWORD": {
96
- "type": "string",
97
- "description": "The app password for authentication with BlueSky.",
98
- "required": true,
99
- "sensitive": true
100
- },
101
- "BLUESKY_SERVICE": {
102
- "type": "string",
103
- "description": "The BlueSky service URL (PDS instance).",
104
- "required": false,
105
- "default": "https://bsky.social",
106
- "sensitive": false
107
- },
108
- "BLUESKY_MAX_POST_LENGTH": {
109
- "type": "number",
110
- "description": "Maximum number of characters allowed in a BlueSky post.",
111
- "required": false,
112
- "default": 300,
113
- "sensitive": false
114
- },
115
- "BLUESKY_POLL_INTERVAL": {
116
- "type": "number",
117
- "description": "Polling interval in seconds for BlueSky operations such as fetching new notifications.",
118
- "required": false,
119
- "default": 60,
120
- "sensitive": false
121
- },
122
- "BLUESKY_ENABLE_POSTING": {
123
- "type": "boolean",
124
- "description": "Enables or disables the ability to post to BlueSky.",
125
- "required": false,
126
- "default": true,
127
- "sensitive": false
128
- },
129
- "BLUESKY_POST_INTERVAL_MIN": {
130
- "type": "number",
131
- "description": "Minimum interval in seconds between automated posts.",
132
- "required": false,
133
- "default": 1800,
134
- "sensitive": false
135
- },
136
- "BLUESKY_POST_INTERVAL_MAX": {
137
- "type": "number",
138
- "description": "Maximum interval in seconds between automated posts.",
139
- "required": false,
140
- "default": 3600,
141
- "sensitive": false
142
- },
143
- "BLUESKY_ENABLE_ACTION_PROCESSING": {
144
- "type": "boolean",
145
- "description": "Turns on or off automated action processing for BlueSky events.",
146
- "required": false,
147
- "default": true,
148
- "sensitive": false
149
- },
150
- "BLUESKY_ACTION_INTERVAL": {
151
- "type": "number",
152
- "description": "Interval in seconds between action-processing cycles.",
153
- "required": false,
154
- "default": 120,
155
- "sensitive": false
156
- },
157
- "BLUESKY_POST_IMMEDIATELY": {
158
- "type": "boolean",
159
- "description": "If true, posts are published immediately instead of waiting for a schedule.",
160
- "required": false,
161
- "default": false,
162
- "sensitive": false
163
- },
164
- "BLUESKY_MAX_ACTIONS_PROCESSING": {
165
- "type": "number",
166
- "description": "Maximum number of BlueSky actions to process in a single batch.",
167
- "required": false,
168
- "default": 5,
169
- "sensitive": false
170
- },
171
- "BLUESKY_ENABLE_DMS": {
172
- "type": "boolean",
173
- "description": "Enable processing of direct messages via the chat.bsky API.",
174
- "required": false,
175
- "default": true,
176
- "sensitive": false
177
- }
178
- }
179
- },
180
- "milady": {
181
- "platforms": [
182
- "browser",
183
- "node"
184
- ],
185
- "runtime": "both",
186
- "platformDetails": {
187
- "browser": "Browser-compatible build available via exports.browser",
188
- "node": "Node.js build available via exports.node"
189
- }
190
- }
2
+ "name": "@elizaos/plugin-bluesky",
3
+ "version": "2.0.3-beta.2",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "dist/cjs/index.node.cjs",
7
+ "module": "dist/node/index.node.js",
8
+ "types": "dist/node/index.d.ts",
9
+ "browser": "dist/browser/index.browser.js",
10
+ "sideEffects": false,
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/elizaos/elizaos.git"
14
+ },
15
+ "exports": {
16
+ "./package.json": "./package.json",
17
+ ".": {
18
+ "types": "./dist/node/index.d.ts",
19
+ "browser": {
20
+ "types": "./dist/browser/index.d.ts",
21
+ "import": "./dist/browser/index.browser.js",
22
+ "default": "./dist/browser/index.browser.js"
23
+ },
24
+ "node": {
25
+ "types": "./dist/node/index.d.ts",
26
+ "import": "./dist/node/index.node.js",
27
+ "require": "./dist/cjs/index.node.cjs",
28
+ "default": "./dist/node/index.node.js"
29
+ },
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"
37
+ }
38
+ },
39
+ "files": [
40
+ "dist"
41
+ ],
42
+ "keywords": [],
43
+ "author": "elizaOS",
44
+ "license": "MIT",
45
+ "scripts": {
46
+ "build": "bun run build.ts",
47
+ "build:ts": "bun run build.ts",
48
+ "dev": "bun --hot build.ts",
49
+ "clean": "rm -rf dist .turbo",
50
+ "test": "vitest run",
51
+ "typecheck": "tsgo --noEmit",
52
+ "lint": "bunx @biomejs/biome check --write --unsafe .",
53
+ "lint:check": "bunx @biomejs/biome check .",
54
+ "format": "bunx @biomejs/biome format --write .",
55
+ "format:check": "bunx @biomejs/biome format ."
56
+ },
57
+ "dependencies": {
58
+ "@atproto/api": "^0.19.0",
59
+ "@atproto/identity": "^0.4.4",
60
+ "@atproto/lexicon": "^0.7.2",
61
+ "@atproto/syntax": "^0.6.1",
62
+ "@atproto/xrpc": "^0.7.0",
63
+ "@elizaos/core": "2.0.3-beta.2",
64
+ "lru-cache": "^11.1.0",
65
+ "zod": "^4.4.3"
66
+ },
67
+ "devDependencies": {
68
+ "@biomejs/biome": "^2.4.14",
69
+ "@types/node": "^25.0.3",
70
+ "typescript": "^6.0.3"
71
+ },
72
+ "peerDependencies": {
73
+ "@elizaos/core": "2.0.3-beta.2"
74
+ },
75
+ "resolutions": {
76
+ "@noble/hashes": "2.2.0"
77
+ },
78
+ "overrides": {
79
+ "@noble/hashes": "2.2.0"
80
+ },
81
+ "publishConfig": {
82
+ "access": "public"
83
+ },
84
+ "agentConfig": {
85
+ "pluginType": "elizaos:client:1.0.0",
86
+ "pluginParameters": {
87
+ "BLUESKY_ENABLED": {
88
+ "type": "boolean",
89
+ "description": "Enables or disables the BlueSky plugin.",
90
+ "required": false,
91
+ "default": true,
92
+ "sensitive": false
93
+ },
94
+ "BLUESKY_DRY_RUN": {
95
+ "type": "boolean",
96
+ "description": "Enables or disables dry run mode when interacting with BlueSky; when true, operations are simulated but not executed.",
97
+ "required": false,
98
+ "default": false,
99
+ "sensitive": false
100
+ },
101
+ "BLUESKY_HANDLE": {
102
+ "type": "string",
103
+ "description": "The BlueSky handle (username) for the agent account.",
104
+ "required": true,
105
+ "sensitive": false
106
+ },
107
+ "BLUESKY_PASSWORD": {
108
+ "type": "string",
109
+ "description": "The app password for authentication with BlueSky.",
110
+ "required": true,
111
+ "sensitive": true
112
+ },
113
+ "BLUESKY_SERVICE": {
114
+ "type": "string",
115
+ "description": "The BlueSky service URL (PDS instance).",
116
+ "required": false,
117
+ "default": "https://bsky.social",
118
+ "sensitive": false
119
+ },
120
+ "BLUESKY_MAX_POST_LENGTH": {
121
+ "type": "number",
122
+ "description": "Maximum number of characters allowed in a BlueSky post.",
123
+ "required": false,
124
+ "default": 300,
125
+ "sensitive": false
126
+ },
127
+ "BLUESKY_POLL_INTERVAL": {
128
+ "type": "number",
129
+ "description": "Polling interval in seconds for BlueSky operations such as fetching new notifications.",
130
+ "required": false,
131
+ "default": 60,
132
+ "sensitive": false
133
+ },
134
+ "BLUESKY_ENABLE_POSTING": {
135
+ "type": "boolean",
136
+ "description": "Enables or disables the ability to post to BlueSky.",
137
+ "required": false,
138
+ "default": true,
139
+ "sensitive": false
140
+ },
141
+ "BLUESKY_POST_INTERVAL_MIN": {
142
+ "type": "number",
143
+ "description": "Minimum interval in seconds between automated posts.",
144
+ "required": false,
145
+ "default": 1800,
146
+ "sensitive": false
147
+ },
148
+ "BLUESKY_POST_INTERVAL_MAX": {
149
+ "type": "number",
150
+ "description": "Maximum interval in seconds between automated posts.",
151
+ "required": false,
152
+ "default": 3600,
153
+ "sensitive": false
154
+ },
155
+ "BLUESKY_ENABLE_ACTION_PROCESSING": {
156
+ "type": "boolean",
157
+ "description": "Turns on or off automated action processing for BlueSky events.",
158
+ "required": false,
159
+ "default": true,
160
+ "sensitive": false
161
+ },
162
+ "BLUESKY_ACTION_INTERVAL": {
163
+ "type": "number",
164
+ "description": "Interval in seconds between action-processing cycles.",
165
+ "required": false,
166
+ "default": 120,
167
+ "sensitive": false
168
+ },
169
+ "BLUESKY_POST_IMMEDIATELY": {
170
+ "type": "boolean",
171
+ "description": "If true, posts are published immediately instead of waiting for a schedule.",
172
+ "required": false,
173
+ "default": false,
174
+ "sensitive": false
175
+ },
176
+ "BLUESKY_MAX_ACTIONS_PROCESSING": {
177
+ "type": "number",
178
+ "description": "Maximum number of BlueSky actions to process in a single batch.",
179
+ "required": false,
180
+ "default": 5,
181
+ "sensitive": false
182
+ },
183
+ "BLUESKY_ENABLE_DMS": {
184
+ "type": "boolean",
185
+ "description": "Enable processing of direct messages via the chat.bsky API.",
186
+ "required": false,
187
+ "default": true,
188
+ "sensitive": false
189
+ }
190
+ }
191
+ },
192
+ "eliza": {
193
+ "platforms": [
194
+ "browser",
195
+ "node"
196
+ ],
197
+ "runtime": "both",
198
+ "platformDetails": {
199
+ "browser": "Browser-compatible build available via exports.browser",
200
+ "node": "Node.js build available via exports.node"
201
+ }
202
+ },
203
+ "gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
191
204
  }
@@ -1,70 +0,0 @@
1
- // types/index.ts
2
- import { z } from "zod";
3
- var BLUESKY_SERVICE_URL = "https://bsky.social";
4
- var BLUESKY_MAX_POST_LENGTH = 300;
5
- var BLUESKY_POLL_INTERVAL = 60;
6
- var BLUESKY_POST_INTERVAL_MIN = 1800;
7
- var BLUESKY_POST_INTERVAL_MAX = 3600;
8
- var BLUESKY_ACTION_INTERVAL = 120;
9
- var BLUESKY_MAX_ACTIONS = 5;
10
- var BLUESKY_CHAT_SERVICE_DID = "did:web:api.bsky.chat";
11
- var BLUESKY_SERVICE_NAME = "bluesky";
12
- 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])?$/;
13
- var CACHE_TTL = {
14
- PROFILE: 3600000,
15
- TIMELINE: 300000,
16
- POST: 1800000,
17
- NOTIFICATIONS: 300000,
18
- CONVERSATIONS: 300000
19
- };
20
- var CACHE_SIZE = {
21
- PROFILE: 1000,
22
- TIMELINE: 500,
23
- POST: 1e4,
24
- NOTIFICATIONS: 1000,
25
- CONVERSATIONS: 100
26
- };
27
- var BlueSkyConfigSchema = z.object({
28
- handle: z.string().regex(AT_PROTOCOL_HANDLE_REGEX, "Invalid handle format"),
29
- password: z.string().min(1),
30
- service: z.string().url().default(BLUESKY_SERVICE_URL),
31
- dryRun: z.boolean().default(false),
32
- pollInterval: z.number().positive().default(BLUESKY_POLL_INTERVAL),
33
- enablePost: z.boolean().default(true),
34
- postIntervalMin: z.number().positive().default(BLUESKY_POST_INTERVAL_MIN),
35
- postIntervalMax: z.number().positive().default(BLUESKY_POST_INTERVAL_MAX),
36
- enableActionProcessing: z.boolean().default(true),
37
- actionInterval: z.number().positive().default(BLUESKY_ACTION_INTERVAL),
38
- postImmediately: z.boolean().default(false),
39
- maxActionsProcessing: z.number().positive().default(BLUESKY_MAX_ACTIONS),
40
- enableDMs: z.boolean().default(true)
41
- });
42
-
43
- class BlueSkyError extends Error {
44
- code;
45
- status;
46
- constructor(message, code, status) {
47
- super(message);
48
- this.code = code;
49
- this.status = status;
50
- this.name = "BlueSkyError";
51
- }
52
- }
53
- export {
54
- CACHE_TTL,
55
- CACHE_SIZE,
56
- BlueSkyError,
57
- BlueSkyConfigSchema,
58
- BLUESKY_SERVICE_URL,
59
- BLUESKY_SERVICE_NAME,
60
- BLUESKY_POST_INTERVAL_MIN,
61
- BLUESKY_POST_INTERVAL_MAX,
62
- BLUESKY_POLL_INTERVAL,
63
- BLUESKY_MAX_POST_LENGTH,
64
- BLUESKY_MAX_ACTIONS,
65
- BLUESKY_CHAT_SERVICE_DID,
66
- BLUESKY_ACTION_INTERVAL,
67
- AT_PROTOCOL_HANDLE_REGEX
68
- };
69
-
70
- //# debugId=AB54F736CEC6763B64756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../types/index.ts"],
4
- "sourcesContent": [
5
- "import type { IAgentRuntime } from \"@elizaos/core\";\nimport { z } from \"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 = z.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}\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;AAEO,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,EAAE,OAAO;AAAA,EAC3C,QAAQ,EAAE,OAAO,EAAE,MAAM,0BAA0B,uBAAuB;AAAA,EAC1E,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,mBAAmB;AAAA,EACrD,QAAQ,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EACjC,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,qBAAqB;AAAA,EACjE,YAAY,EAAE,QAAQ,EAAE,QAAQ,IAAI;AAAA,EACpC,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,yBAAyB;AAAA,EACxE,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,yBAAyB;AAAA,EACxE,wBAAwB,EAAE,QAAQ,EAAE,QAAQ,IAAI;AAAA,EAChD,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,uBAAuB;AAAA,EACrE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EAC1C,sBAAsB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,mBAAmB;AAAA,EACvE,WAAW,EAAE,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": "AB54F736CEC6763B64756E2164756E21",
9
- "names": []
10
- }
@@ -1,2 +0,0 @@
1
- export * from "./index.browser";
2
- export { default } from "./index.browser";
@@ -1,2 +0,0 @@
1
- export * from "./index.node";
2
- export { default } from "./index.node";