@theokit/gateway-discord 0.2.1 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 70ce856: Export `splitForDiscord` from the package entry.
8
+
9
+ Seven of the eight packages that ship a splitter already re-exported it; `gateway-discord` was
10
+ the one that did not, which made Discord the only platform whose splitter an outside caller
11
+ could not reach. That matters now rather than as tidiness: B-019 puts the channel presenter
12
+ OUTSIDE these packages and forbids it from splitting, so a caller that must not re-split has to
13
+ be able to call the one the adapter already uses.
14
+
15
+ Additive — no existing export changes.
16
+
3
17
  ## 0.2.1
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -224,5 +224,6 @@ function escapeMarkdown(text) {
224
224
  }
225
225
 
226
226
  exports.DiscordAdapter = DiscordAdapter;
227
+ exports.splitForDiscord = splitForDiscord;
227
228
  //# sourceMappingURL=index.cjs.map
228
229
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -68,4 +68,18 @@ declare class DiscordAdapter extends BasePlatformAdapter {
68
68
  deliver(event: MessageEvent): Promise<"ok" | "no_handler" | "handler_threw">;
69
69
  }
70
70
 
71
- export { DiscordAdapter, type DiscordAdapterOptions };
71
+ /**
72
+ * Discord's 2000-char per-message hard limit. Split agent responses on safe
73
+ * boundaries before sending (T6.1).
74
+ *
75
+ * Thin wrapper over core `chunkText` (roadmap M1). Telegram family (minus
76
+ * markdown balancing): 2000 hard cap, 1900 soft window, `\n\n` → `\n` → window
77
+ * boundary preference, newline-only leading strip, no surrogate guard. Output
78
+ * is byte-identical to the previous implementation (pinned by
79
+ * `tests/split.test.ts`).
80
+ *
81
+ * @internal
82
+ */
83
+ declare function splitForDiscord(text: string): string[];
84
+
85
+ export { DiscordAdapter, type DiscordAdapterOptions, splitForDiscord };
package/dist/index.d.ts CHANGED
@@ -68,4 +68,18 @@ declare class DiscordAdapter extends BasePlatformAdapter {
68
68
  deliver(event: MessageEvent): Promise<"ok" | "no_handler" | "handler_threw">;
69
69
  }
70
70
 
71
- export { DiscordAdapter, type DiscordAdapterOptions };
71
+ /**
72
+ * Discord's 2000-char per-message hard limit. Split agent responses on safe
73
+ * boundaries before sending (T6.1).
74
+ *
75
+ * Thin wrapper over core `chunkText` (roadmap M1). Telegram family (minus
76
+ * markdown balancing): 2000 hard cap, 1900 soft window, `\n\n` → `\n` → window
77
+ * boundary preference, newline-only leading strip, no surrogate guard. Output
78
+ * is byte-identical to the previous implementation (pinned by
79
+ * `tests/split.test.ts`).
80
+ *
81
+ * @internal
82
+ */
83
+ declare function splitForDiscord(text: string): string[];
84
+
85
+ export { DiscordAdapter, type DiscordAdapterOptions, splitForDiscord };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BasePlatformAdapter, chunkText } from '@theokit/gateway';
1
+ import { chunkText, BasePlatformAdapter } from '@theokit/gateway';
2
2
  import { GatewayIntentBits, Client, Events, DiscordAPIError } from 'discord.js';
3
3
 
4
4
  // src/adapter.ts
@@ -221,6 +221,6 @@ function escapeMarkdown(text) {
221
221
  return text.replace(/([\\*_`~])/g, "\\$1");
222
222
  }
223
223
 
224
- export { DiscordAdapter };
224
+ export { DiscordAdapter, splitForDiscord };
225
225
  //# sourceMappingURL=index.js.map
226
226
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/gateway-discord",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Discord (discord.js) platform adapter for @theokit/gateway. ADRs D171, D179.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -25,7 +25,8 @@
25
25
  "types": "./dist/index.d.cts",
26
26
  "default": "./dist/index.cjs"
27
27
  }
28
- }
28
+ },
29
+ "./package.json": "./package.json"
29
30
  },
30
31
  "files": [
31
32
  "dist",
@@ -47,12 +48,27 @@
47
48
  "typescript": "5.9.3",
48
49
  "vitest": "^4.1.11",
49
50
  "zod": "^4.0.0",
50
- "@theokit/gateway": "0.9.0"
51
+ "@theokit/gateway": "0.10.0"
51
52
  },
52
53
  "publishConfig": {
53
54
  "access": "public",
54
55
  "provenance": true
55
56
  },
57
+ "sideEffects": false,
58
+ "bugs": {
59
+ "url": "https://github.com/usetheokit/theokit-gateways/issues"
60
+ },
61
+ "homepage": "https://github.com/usetheokit/theokit-gateways/tree/main/packages/gateway-discord#readme",
62
+ "keywords": [
63
+ "theokit",
64
+ "gateway",
65
+ "discord",
66
+ "discord.js",
67
+ "platform",
68
+ "adapter",
69
+ "adrs",
70
+ "d171"
71
+ ],
56
72
  "scripts": {
57
73
  "build": "tsup",
58
74
  "typecheck": "tsc --noEmit",