@localhostdevs/sdk 0.3.3 → 0.3.4

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 CHANGED
@@ -1,118 +1,118 @@
1
- # @localhostdevs/sdk
2
-
3
- The JavaScript SDK for building bots on **[localhostdevs](https://localhostdevs.com)** — run your app on your own laptop and publish it as a command-driven bot that anyone can use through a chat-style interface.
4
-
5
- > Pre-1.0: API surface may break in minor versions (`0.x → 0.y`). Once the platform launches with external users, we'll cut a 1.0 that promises stability.
6
-
7
- ## Install
8
-
9
- ```bash
10
- npm install @localhostdevs/sdk
11
- ```
12
-
13
- ## Quickstart
14
-
15
- After creating a bot in the [dashboard](https://localhostdevs.com/dashboard/bots) and copying your API key, write this to `app.js`:
16
-
17
- ```js
18
- import { Bot } from '@localhostdevs/sdk';
19
-
20
- const bot = new Bot({
21
- id: 'price-bot', // your bot's handle (matches the @handle on the marketplace)
22
- // apiKey: process.env.LHD_API_KEY, // optional; auto-read from env if unset
23
- });
24
-
25
- bot.cmd('ping', async (ctx) => {
26
- await ctx.reply({ text: 'pong' });
27
- });
28
-
29
- bot.cmd('echo', async (ctx) => {
30
- await ctx.reply({ text: `echo: ${JSON.stringify(ctx.args)}` });
31
- });
32
-
33
- await bot.connect();
34
- console.log('bot online — waiting for commands');
35
- ```
36
-
37
- Then:
38
-
39
- ```bash
40
- LHD_API_KEY=<your bot's API key from the dashboard> node app.js
41
- ```
42
-
43
- The bot stays online for as long as the process runs. The gateway keeps the connection healthy via heartbeats; consumers see your bot as **online** while it's connected.
44
-
45
- ## API
46
-
47
- ### `new Bot(opts)`
48
-
49
- | Option | Type | Default | Notes |
50
- | -------------------- | ------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
51
- | `id` | `string` (required) | — | Your bot's handle. Lowercase letters / digits / dashes. |
52
- | `apiKey` | `string` (required) | `process.env.LHD_API_KEY` | Per-bot API key from the dashboard. The gateway validates it and scopes you to your own bot only. |
53
- | `serverUrl` | `string` | `wss://bot-api.localhostdevs.com/bot` (override with `LHD_SERVER_URL`) | Production gateway is baked in — most users leave this alone. Only override for local dev or self-hosted gateways. |
54
- | `idempotencyLruSize` | `number` | `1024` | How many recent message IDs to remember for deduplication. |
55
-
56
- ### `bot.cmd(name, handler)`
57
-
58
- Register a handler for a command. Must be called before `connect()`. Handler receives a `CommandContext`:
59
-
60
- ```ts
61
- bot.cmd('greet', async (ctx) => {
62
- // ctx.args: parsed args from the consumer
63
- // ctx.command: 'greet'
64
- // ctx.msgId: unique id for this invocation
65
-
66
- await ctx.reply({ text: `Hello, ${ctx.args.name ?? 'world'}!` });
67
-
68
- // ctx.reply also supports:
69
- // data: any — structured payload alongside text
70
- // dispatch: { to, command, args } — chain to another bot (max depth 5)
71
- });
72
- ```
73
-
74
- ### `await bot.connect()`
75
-
76
- Open the WebSocket to the gateway, authenticate, and start receiving commands. Resolves after the gateway sends `HELLO` (the SDK is ready for traffic).
77
-
78
- ### `await bot.disconnect()`
79
-
80
- Close the WebSocket cleanly.
81
-
82
- ## Idempotency
83
-
84
- Every command from the gateway carries a `msgId`. The SDK deduplicates redelivered messages via a fixed-size LRU keyed by `msgId`. If the gateway happens to deliver the same command twice, your handler runs once.
85
-
86
- ## Online / offline status
87
-
88
- The gateway pings the bot every 30 seconds and the SDK responds. If the gateway stops hearing from you for >60 seconds it marks the bot offline. Reconnect simply by starting the process again.
89
-
90
- ## Bot-to-bot composition
91
-
92
- A reply can carry a `dispatch` directive to chain a command to another bot:
93
-
94
- ```js
95
- bot.cmd('summary', async (ctx) => {
96
- await ctx.reply({
97
- text: 'fetching price first…',
98
- dispatch: { to: 'price-bot', command: 'price', args: { ticker: 'AAPL' } },
99
- });
100
- });
101
- ```
102
-
103
- Chains run up to depth 5 with loop detection. The original consumer pays for every step.
104
-
105
- ## Migrating from v0.2 → v0.3 (gateway pivot)
106
-
107
- v0.3 is a breaking change vs v0.2 — the SDK no longer talks to NATS directly. It opens a WebSocket to the managed gateway and auths with a per-bot API key:
108
-
109
- | Was (v0.2) | Now (v0.3) |
110
- | -------------------------------------- | ------------------------------ |
111
- | `new Bot({ id, natsUrl: 'nats://…' })` | `new Bot({ id, apiKey: '…' })` |
112
- | `LHD_NATS_TOKEN=… node app.js` | `LHD_API_KEY=… node app.js` |
113
-
114
- Drop the `natsUrl` and `natsToken` options entirely — the SDK figures out the right gateway URL on its own. Use your bot's **per-bot API key** from the dashboard (not the old shared broker token).
115
-
116
- ## License
117
-
118
- MIT
1
+ # @localhostdevs/sdk
2
+
3
+ The JavaScript SDK for building bots on **[localhostdevs](https://localhostdevs.com)** — run your app on your own laptop and publish it as a command-driven bot that anyone can use through a chat-style interface.
4
+
5
+ > Pre-1.0: API surface may break in minor versions (`0.x → 0.y`). Once the platform launches with external users, we'll cut a 1.0 that promises stability.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @localhostdevs/sdk
11
+ ```
12
+
13
+ ## Quickstart
14
+
15
+ After creating a bot in the [dashboard](https://localhostdevs.com/dashboard/bots) and copying your API key, write this to `app.js`:
16
+
17
+ ```js
18
+ import { Bot } from '@localhostdevs/sdk';
19
+
20
+ const bot = new Bot({
21
+ id: 'price-bot', // your bot's handle (matches the @handle on the marketplace)
22
+ // apiKey: process.env.LHD_API_KEY, // optional; auto-read from env if unset
23
+ });
24
+
25
+ bot.cmd('ping', async (ctx) => {
26
+ await ctx.reply({ text: 'pong' });
27
+ });
28
+
29
+ bot.cmd('echo', async (ctx) => {
30
+ await ctx.reply({ text: `echo: ${JSON.stringify(ctx.args)}` });
31
+ });
32
+
33
+ await bot.connect();
34
+ console.log('bot online — waiting for commands');
35
+ ```
36
+
37
+ Then:
38
+
39
+ ```bash
40
+ LHD_API_KEY=<your bot's API key from the dashboard> node app.js
41
+ ```
42
+
43
+ The bot stays online for as long as the process runs. The gateway keeps the connection healthy via heartbeats; consumers see your bot as **online** while it's connected.
44
+
45
+ ## API
46
+
47
+ ### `new Bot(opts)`
48
+
49
+ | Option | Type | Default | Notes |
50
+ | -------------------- | ------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
51
+ | `id` | `string` (required) | — | Your bot's handle. Lowercase letters / digits / dashes. |
52
+ | `apiKey` | `string` (required) | `process.env.LHD_API_KEY` | Per-bot API key from the dashboard. The gateway validates it and scopes you to your own bot only. |
53
+ | `serverUrl` | `string` | `wss://bot-api.localhostdevs.com/bot` (override with `LHD_SERVER_URL`) | Production gateway is baked in — most users leave this alone. Only override for local dev or self-hosted gateways. |
54
+ | `idempotencyLruSize` | `number` | `1024` | How many recent message IDs to remember for deduplication. |
55
+
56
+ ### `bot.cmd(name, handler)`
57
+
58
+ Register a handler for a command. Must be called before `connect()`. Handler receives a `CommandContext`:
59
+
60
+ ```ts
61
+ bot.cmd('greet', async (ctx) => {
62
+ // ctx.args: parsed args from the consumer
63
+ // ctx.command: 'greet'
64
+ // ctx.msgId: unique id for this invocation
65
+
66
+ await ctx.reply({ text: `Hello, ${ctx.args.name ?? 'world'}!` });
67
+
68
+ // ctx.reply also supports:
69
+ // data: any — structured payload alongside text
70
+ // dispatch: { to, command, args } — chain to another bot (max depth 5)
71
+ });
72
+ ```
73
+
74
+ ### `await bot.connect()`
75
+
76
+ Open the WebSocket to the gateway, authenticate, and start receiving commands. Resolves after the gateway sends `HELLO` (the SDK is ready for traffic).
77
+
78
+ ### `await bot.disconnect()`
79
+
80
+ Close the WebSocket cleanly.
81
+
82
+ ## Idempotency
83
+
84
+ Every command from the gateway carries a `msgId`. The SDK deduplicates redelivered messages via a fixed-size LRU keyed by `msgId`. If the gateway happens to deliver the same command twice, your handler runs once.
85
+
86
+ ## Online / offline status
87
+
88
+ The gateway pings the bot every 30 seconds and the SDK responds. If the gateway stops hearing from you for >60 seconds it marks the bot offline. Reconnect simply by starting the process again.
89
+
90
+ ## Bot-to-bot composition
91
+
92
+ A reply can carry a `dispatch` directive to chain a command to another bot:
93
+
94
+ ```js
95
+ bot.cmd('summary', async (ctx) => {
96
+ await ctx.reply({
97
+ text: 'fetching price first…',
98
+ dispatch: { to: 'price-bot', command: 'price', args: { ticker: 'AAPL' } },
99
+ });
100
+ });
101
+ ```
102
+
103
+ Chains run up to depth 5 with loop detection. The original consumer pays for every step.
104
+
105
+ ## Migrating from v0.2 → v0.3 (gateway pivot)
106
+
107
+ v0.3 is a breaking change vs v0.2 — the SDK no longer talks to NATS directly. It opens a WebSocket to the managed gateway and auths with a per-bot API key:
108
+
109
+ | Was (v0.2) | Now (v0.3) |
110
+ | -------------------------------------- | ------------------------------ |
111
+ | `new Bot({ id, natsUrl: 'nats://…' })` | `new Bot({ id, apiKey: '…' })` |
112
+ | `LHD_NATS_TOKEN=… node app.js` | `LHD_API_KEY=… node app.js` |
113
+
114
+ Drop the `natsUrl` and `natsToken` options entirely — the SDK figures out the right gateway URL on its own. Use your bot's **per-bot API key** from the dashboard (not the old shared broker token).
115
+
116
+ ## License
117
+
118
+ MIT
package/dist/bot.d.ts CHANGED
@@ -28,11 +28,15 @@ export declare class Bot {
28
28
  private resolveApiKey;
29
29
  /** Close the gateway connection. Stops auto-reconnect. */
30
30
  disconnect(): Promise<void>;
31
+ /** Built-in handler for the `commands` introspection command. Lists every
32
+ * user-registered handler so callers can discover what a bot supports.
33
+ * Users can override by calling cmd('commands', ...) themselves. */
34
+ private replyWithCommandList;
31
35
  private dispatch;
32
36
  private makeContext;
33
37
  private isDuplicate;
34
38
  private recordSeen;
35
39
  }
36
- export declare const SDK_PACKAGE_VERSION = "0.3.1";
40
+ export declare const SDK_PACKAGE_VERSION = "0.3.4";
37
41
  export { nanoid };
38
42
  //# sourceMappingURL=bot.d.ts.map
package/dist/bot.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../src/bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,KAAK,EAAE,UAAU,EAAkB,cAAc,EAAa,MA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,QAAQ,CAAC,IAAI,CAA0B;IAC/C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAC1C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,YAAY,CAAuB;gBAE/B,IAAI,EAAE,UAAU;IAc5B,yEAAyE;IACzE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAWhD,2FAA2F;IACrF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAU9B,iFAAiF;YACnE,aAAa;IAyB3B,OAAO,CAAC,iBAAiB;YAcX,YAAY;IAe1B;;;;;OAKG;YACW,aAAa;IAoB3B,0DAA0D;IACpD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAYjC;;yEAEqE;IACrE,OAAO,CAAC,oBAAoB;YAUd,QAAQ;IAiDtB,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,UAAU;CAQnB;AAKD,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAG3C,OAAO,EAAE,MAAM,EAAE,CAAC"}
package/dist/bot.js CHANGED
@@ -156,16 +156,59 @@ export class Bot {
156
156
  this.transport = null;
157
157
  }
158
158
  }
159
+ /** Built-in handler for the `commands` introspection command. Lists every
160
+ * user-registered handler so callers can discover what a bot supports.
161
+ * Users can override by calling cmd('commands', ...) themselves. */
162
+ replyWithCommandList(ctx) {
163
+ const userCommands = [...this.handlers.keys()].filter((c) => c !== 'commands');
164
+ userCommands.sort();
165
+ const list = userCommands.length ? userCommands.join(', ') : '(none)';
166
+ return ctx.reply({
167
+ text: `Available commands: ${list}`,
168
+ data: { commands: userCommands },
169
+ });
170
+ }
159
171
  async dispatch(cmd) {
160
172
  if (this.isDuplicate(cmd.msgId))
161
173
  return;
162
174
  this.recordSeen(cmd.msgId);
163
175
  const handler = this.handlers.get(cmd.command);
176
+ const ctx = this.makeContext(cmd);
177
+ // Built-in `commands` fallback — only used if the bot didn't register
178
+ // its own. Lets every bot answer "what can you do?" without ceremony.
179
+ if (!handler && cmd.command === 'commands') {
180
+ try {
181
+ await this.replyWithCommandList(ctx);
182
+ }
183
+ catch (err) {
184
+ logError('built-in commands handler error:', err);
185
+ }
186
+ return;
187
+ }
164
188
  if (!handler) {
165
- // Unknown command — drop. v1 is silent; future work could publish an error reply.
189
+ // Unknown command — reply with a structured "not found" instead of
190
+ // silently dropping. Callers were timing out on every typo, which is
191
+ // worse UX than a fast error.
192
+ const userCommands = [...this.handlers.keys()].filter((c) => c !== 'commands');
193
+ userCommands.sort();
194
+ const hint = userCommands.length
195
+ ? `Try one of: ${userCommands.join(', ')} (or 'commands' to list).`
196
+ : "This bot hasn't registered any commands yet.";
197
+ try {
198
+ await ctx.reply({
199
+ text: `Command not found: ${cmd.command}. ${hint}`,
200
+ data: {
201
+ error: 'command_not_found',
202
+ command: cmd.command,
203
+ available: userCommands,
204
+ },
205
+ });
206
+ }
207
+ catch (err) {
208
+ logError('command-not-found reply failed:', err);
209
+ }
166
210
  return;
167
211
  }
168
- const ctx = this.makeContext(cmd);
169
212
  try {
170
213
  await handler(ctx);
171
214
  }
@@ -208,7 +251,7 @@ export class Bot {
208
251
  // Internal version constant — exported so the transport can stamp IDENTIFY frames.
209
252
  // Pre-1.0: breaking changes are allowed in minor bumps (0.x). We're staying in
210
253
  // 0.x until the platform launches with external users.
211
- export const SDK_PACKAGE_VERSION = '0.3.1';
254
+ export const SDK_PACKAGE_VERSION = '0.3.4';
212
255
  // Re-export nanoid so demo scripts can use the same id generator the SDK expects.
213
256
  export { nanoid };
214
257
  //# sourceMappingURL=bot.js.map
package/dist/bot.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bot.js","sourceRoot":"","sources":["../src/bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE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SDK for building bots on localhostdevs — run your app on your laptop, publish it as a command-driven bot.",
5
- "keywords": [
6
- "localhostdevs",
7
- "bot",
8
- "websocket",
9
- "chatops",
10
- "cli",
11
- "sdk"
12
- ],
13
- "homepage": "https://github.com/jugod0/localhostdevs-sdk",
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/jugod0/localhostdevs-sdk.git"
17
- },
18
- "bugs": {
19
- "url": "https://github.com/jugod0/localhostdevs-sdk/issues"
20
- },
21
- "license": "MIT",
22
- "type": "module",
23
- "main": "./dist/index.js",
24
- "types": "./dist/index.d.ts",
25
- "exports": {
26
- ".": {
27
- "types": "./dist/index.d.ts",
28
- "import": "./dist/index.js",
29
- "default": "./dist/index.js"
30
- }
31
- },
32
- "files": [
33
- "dist",
34
- "README.md"
35
- ],
36
- "engines": {
37
- "node": ">=20"
38
- },
39
- "scripts": {
40
- "build": "tsc -p tsconfig.build.json",
41
- "typecheck": "tsc --noEmit",
42
- "test": "vitest run",
43
- "prepare": "npm run build",
44
- "prepublishOnly": "npm run build"
45
- },
46
- "dependencies": {
47
- "nanoid": "^5.1.11",
48
- "ws": "^8.18.0"
49
- },
50
- "devDependencies": {
51
- "@types/node": "^22.19.19",
52
- "@types/ws": "^8.5.13",
53
- "tsx": "^4.21.0",
54
- "typescript": "^5.9.3",
55
- "vitest": "^2.1.9"
56
- },
57
- "publishConfig": {
58
- "access": "public"
59
- }
60
- }
1
+ {
2
+ "name": "@localhostdevs/sdk",
3
+ "version": "0.3.4",
4
+ "description": "JavaScript SDK for building bots on localhostdevs — run your app on your laptop, publish it as a command-driven bot.",
5
+ "keywords": [
6
+ "localhostdevs",
7
+ "bot",
8
+ "websocket",
9
+ "chatops",
10
+ "cli",
11
+ "sdk"
12
+ ],
13
+ "homepage": "https://github.com/jugod0/localhostdevs-sdk",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/jugod0/localhostdevs-sdk.git"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/jugod0/localhostdevs-sdk/issues"
20
+ },
21
+ "license": "MIT",
22
+ "type": "module",
23
+ "main": "./dist/index.js",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js",
29
+ "default": "./dist/index.js"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "README.md"
35
+ ],
36
+ "engines": {
37
+ "node": ">=20"
38
+ },
39
+ "scripts": {
40
+ "build": "tsc -p tsconfig.build.json",
41
+ "typecheck": "tsc --noEmit",
42
+ "test": "vitest run",
43
+ "prepare": "npm run build",
44
+ "prepublishOnly": "npm run build"
45
+ },
46
+ "dependencies": {
47
+ "nanoid": "^5.1.11",
48
+ "ws": "^8.18.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^22.19.19",
52
+ "@types/ws": "^8.5.13",
53
+ "tsx": "^4.21.0",
54
+ "typescript": "^5.9.3",
55
+ "vitest": "^2.1.9"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public"
59
+ }
60
+ }