@theokit/gateway-discord 0.2.0 → 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,38 @@
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
+
17
+ ## 0.2.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 1e215ab: The peer floor on `@theokit/gateway` is `>=0.9.0`, which is what these packages have needed since
22
+ they gained `deliver`.
23
+
24
+ `deliver` and `runHandler` arrived in the core at 0.9.0, and the previous release shipped these
25
+ adapters still declaring `>=0.6.0` — a floor `dep-check` had already proven false by building the
26
+ workspace against it: TS4113 on the override, TS2551 on `runHandler`, in all ten packages.
27
+
28
+ It could not be corrected in that release. `dep-check`'s install check packs an adapter and installs
29
+ it the way a consumer would, and until 0.9.0 was on npm no consumer could resolve a package asking
30
+ for it — the check was right about the world as it stood. The floor is raised here, against a
31
+ registry where the version it names exists.
32
+
33
+ Between the two releases a consumer installing against an older core got a build error rather than a
34
+ resolution error: the same failure, later and less clearly. That window is closed.
35
+
3
36
  ## 0.2.0
4
37
 
5
38
  ### Minor 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.0",
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",
@@ -35,7 +36,7 @@
35
36
  "CHANGELOG.md"
36
37
  ],
37
38
  "peerDependencies": {
38
- "@theokit/gateway": ">=0.6.0 <1.0.0",
39
+ "@theokit/gateway": ">=0.9.0 <1.0.0",
39
40
  "discord.js": "^14.16.0"
40
41
  },
41
42
  "devDependencies": {
@@ -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",