@hybridaione/hybridclaw 0.2.7 → 0.2.8
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 +23 -0
- package/README.md +8 -9
- package/config.example.json +2 -0
- package/container/package-lock.json +2 -2
- package/container/package.json +1 -1
- package/container/src/index.ts +13 -0
- package/container/src/tools.ts +442 -38
- package/container/src/types.ts +1 -0
- package/dist/channels/discord/prompt-adapter.d.ts +3 -0
- package/dist/channels/discord/prompt-adapter.d.ts.map +1 -0
- package/dist/channels/discord/prompt-adapter.js +26 -0
- package/dist/channels/discord/prompt-adapter.js.map +1 -0
- package/dist/channels/discord/runtime.d.ts.map +1 -1
- package/dist/channels/discord/runtime.js +41 -6
- package/dist/channels/discord/runtime.js.map +1 -1
- package/dist/channels/discord/send-permissions.d.ts +19 -0
- package/dist/channels/discord/send-permissions.d.ts.map +1 -0
- package/dist/channels/discord/send-permissions.js +112 -0
- package/dist/channels/discord/send-permissions.js.map +1 -0
- package/dist/channels/discord/tool-actions.d.ts +7 -1
- package/dist/channels/discord/tool-actions.d.ts.map +1 -1
- package/dist/channels/discord/tool-actions.js +256 -17
- package/dist/channels/discord/tool-actions.js.map +1 -1
- package/dist/channels/prompt-adapters.d.ts +14 -0
- package/dist/channels/prompt-adapters.d.ts.map +1 -0
- package/dist/channels/prompt-adapters.js +35 -0
- package/dist/channels/prompt-adapters.js.map +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -0
- package/dist/config.js.map +1 -1
- package/dist/gateway-service.d.ts.map +1 -1
- package/dist/gateway-service.js +2 -1
- package/dist/gateway-service.js.map +1 -1
- package/dist/gateway.js +17 -2
- package/dist/gateway.js.map +1 -1
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +27 -8
- package/dist/health.js.map +1 -1
- package/dist/hybridai-models.d.ts.map +1 -1
- package/dist/hybridai-models.js +42 -4
- package/dist/hybridai-models.js.map +1 -1
- package/dist/prompt-hooks.d.ts +3 -0
- package/dist/prompt-hooks.d.ts.map +1 -1
- package/dist/prompt-hooks.js +44 -1
- package/dist/prompt-hooks.js.map +1 -1
- package/dist/runtime-config.d.ts +8 -0
- package/dist/runtime-config.d.ts.map +1 -1
- package/dist/runtime-config.js +34 -1
- package/dist/runtime-config.js.map +1 -1
- package/docs/index.html +10 -10
- package/package.json +1 -1
- package/src/channels/discord/prompt-adapter.ts +34 -0
- package/src/channels/discord/runtime.ts +55 -12
- package/src/channels/discord/send-permissions.ts +196 -0
- package/src/channels/discord/tool-actions.ts +1036 -19
- package/src/channels/prompt-adapters.ts +55 -0
- package/src/config.ts +4 -0
- package/src/container-runner.ts +33 -6
- package/src/gateway-service.ts +4 -4
- package/src/gateway.ts +26 -3
- package/src/health.ts +63 -17
- package/src/prompt-hooks.ts +50 -4
- package/src/runtime-config.ts +76 -1
- package/src/types.ts +1 -0
- package/tests/channel-message-tool-hints.test.ts +64 -0
- package/tests/container.message-tool-normalization.test.ts +204 -0
- package/tests/discord.send-permissions.test.ts +171 -0
- package/tests/discord.tool-action-aliases.test.ts +28 -0
- package/tests/discord.tool-actions-channel-lookup.test.ts +166 -0
- package/tests/discord.tool-actions-member-lookup.test.ts +186 -0
- package/tests/discord.tool-actions-send.test.ts +439 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
No unreleased changes.
|
|
6
6
|
|
|
7
|
+
## [0.2.8](https://github.com/HybridAIOne/hybridclaw/tree/v0.2.8)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Discord send policy controls**: Added runtime config for `discord.sendPolicy` (`open|allowlist|disabled`) with global/channel/guild/user/role allowlist checks for outbound sends.
|
|
12
|
+
- **Channel-aware prompt adapters**: Added channel-specific message-tool hint adapters (including Discord action/component guidance) injected into system prompts.
|
|
13
|
+
- **Expanded Discord message actions**: Added `react`, `quote-reply`, `edit`, `delete`, `pin`, `unpin`, `thread-create`, and `thread-reply` actions to the `message` tool path.
|
|
14
|
+
- **Message-tool regression coverage**: Added focused unit coverage for action aliases, target normalization, member/channel lookup behavior, send-policy checks, and channel hint injection.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Message-tool intent guidance**: System prompt guidance now includes explicit send/post/DM/notify triggers, send parameter guidance (`to` + message), and reply suppression token handling for tool-only sends.
|
|
19
|
+
- **Action alias + target normalization**: Message action normalization now supports natural aliases (`dm`, `post`, `reply`, `respond`, `history`, `fetch`, `lookup`, `whois`) and normalizes Discord prefixes/mentions.
|
|
20
|
+
- **Tool description enrichment**: `message` tool descriptions now emphasize natural-language intent phrases and enumerate current/other configured Discord channels with supported actions.
|
|
21
|
+
- **Single-call DM targeting**: `send` now resolves user targets inline (IDs, mentions, usernames/display names with guild context), including fallback via `user`/`username` when no explicit channel target is passed.
|
|
22
|
+
- **Discord action API flexibility**: `/api/discord/action` now accepts normalized aliases and extended send payload fields (`components`, `contextChannelId`, threading/message mutation fields).
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **Structured target-resolution errors**: Member/user lookup failures now return structured JSON errors with disambiguation candidates and actionable hints.
|
|
27
|
+
- **Ambiguous target handling**: Added `resolveAmbiguous` support (`error|best`) to allow safe candidate return or best-match auto-resolution for member/user lookups.
|
|
28
|
+
- **Duplicate send-reply leakage**: Gateway chat responses now strip the message-send silent reply token and normalize final user-visible success text.
|
|
29
|
+
|
|
7
30
|
## [0.2.7](https://github.com/HybridAIOne/hybridclaw/tree/v0.2.7)
|
|
8
31
|
|
|
9
32
|
### Added
|
package/README.md
CHANGED
|
@@ -11,17 +11,16 @@ npm install -g @hybridaione/hybridclaw
|
|
|
11
11
|
hybridclaw onboarding
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Latest release: [v0.2.
|
|
14
|
+
Latest release: [v0.2.8](https://github.com/HybridAIOne/hybridclaw/releases/tag/v0.2.8)
|
|
15
15
|
|
|
16
|
-
## Release highlights (v0.2.
|
|
16
|
+
## Release highlights (v0.2.8)
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- CLI container readiness checks now resolve the package install root to avoid non-root invocation failures.
|
|
18
|
+
- Discord `message` tool now supports richer actions (`send`, `read`, `member-info`, `channel-info`, `react`, `quote-reply`, `edit`, `delete`, `pin`, `unpin`, `thread-create`, `thread-reply`).
|
|
19
|
+
- Send intent handling is more natural: aliases like `dm`, `post`, `reply`, `respond`, `history`, `fetch`, `lookup`, and `whois` normalize automatically.
|
|
20
|
+
- Single-call DM routing is now supported for user targets (`user`/`username`, `@mentions`, IDs), including inline resolution when no explicit `channelId` is provided.
|
|
21
|
+
- Message-tool descriptions now include intent phrases and enumerate configured channels so isolated/cron runs can discover available Discord targets.
|
|
22
|
+
- Discord send governance gained runtime allowlist controls via `discord.sendPolicy` plus channel/guild/user/role checks.
|
|
23
|
+
- Lookup failures now return structured errors with disambiguation candidates and optional `resolveAmbiguous=best` auto-pick behavior.
|
|
25
24
|
|
|
26
25
|
## HybridAI Advantage
|
|
27
26
|
|
package/config.example.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hybridclaw-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "hybridclaw-agent",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.8",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@mozilla/readability": "^0.6.0",
|
|
12
12
|
"agent-browser": "^0.15.1",
|
package/container/package.json
CHANGED
package/container/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from './token-usage.js';
|
|
24
24
|
import {
|
|
25
25
|
executeTool,
|
|
26
|
+
getMessageToolDescription,
|
|
26
27
|
getPendingSideEffects,
|
|
27
28
|
resetSideEffects,
|
|
28
29
|
setGatewayContext,
|
|
@@ -940,6 +941,16 @@ function resolveTools(input: ContainerInput): ToolDefinition[] {
|
|
|
940
941
|
);
|
|
941
942
|
tools = tools.filter((tool) => !blocked.has(tool.function.name));
|
|
942
943
|
}
|
|
944
|
+
tools = tools.map((tool) => {
|
|
945
|
+
if (tool.function.name !== 'message') return tool;
|
|
946
|
+
return {
|
|
947
|
+
...tool,
|
|
948
|
+
function: {
|
|
949
|
+
...tool.function,
|
|
950
|
+
description: getMessageToolDescription(input.channelId),
|
|
951
|
+
},
|
|
952
|
+
};
|
|
953
|
+
});
|
|
943
954
|
// Sort alphabetically for deterministic tool ordering (request/cache stability)
|
|
944
955
|
tools.sort((a, b) => a.function.name.localeCompare(b.function.name));
|
|
945
956
|
return tools;
|
|
@@ -979,6 +990,7 @@ async function main(): Promise<void> {
|
|
|
979
990
|
firstInput.gatewayBaseUrl,
|
|
980
991
|
firstInput.gatewayApiToken,
|
|
981
992
|
firstInput.channelId,
|
|
993
|
+
firstInput.configuredDiscordChannels,
|
|
982
994
|
);
|
|
983
995
|
setModelContext(
|
|
984
996
|
firstInput.baseUrl,
|
|
@@ -1074,6 +1086,7 @@ async function main(): Promise<void> {
|
|
|
1074
1086
|
input.gatewayBaseUrl,
|
|
1075
1087
|
input.gatewayApiToken,
|
|
1076
1088
|
input.channelId,
|
|
1089
|
+
input.configuredDiscordChannels,
|
|
1077
1090
|
);
|
|
1078
1091
|
setModelContext(input.baseUrl, apiKey, input.model, input.chatbotId);
|
|
1079
1092
|
setMediaContext(input.media);
|