ralph-cli-sandboxed 0.4.0 → 0.4.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 +30 -0
- package/dist/commands/action.js +47 -20
- package/dist/commands/chat.d.ts +1 -1
- package/dist/commands/chat.js +325 -62
- package/dist/commands/config.js +2 -1
- package/dist/commands/daemon.d.ts +2 -5
- package/dist/commands/daemon.js +118 -49
- package/dist/commands/docker.js +110 -73
- package/dist/commands/fix-config.js +2 -1
- package/dist/commands/fix-prd.js +2 -2
- package/dist/commands/help.js +19 -3
- package/dist/commands/init.js +78 -17
- package/dist/commands/listen.js +116 -5
- package/dist/commands/logo.d.ts +5 -0
- package/dist/commands/logo.js +41 -0
- package/dist/commands/notify.js +1 -1
- package/dist/commands/once.js +19 -9
- package/dist/commands/prd.js +20 -2
- package/dist/commands/run.js +111 -27
- package/dist/commands/slack.d.ts +10 -0
- package/dist/commands/slack.js +333 -0
- package/dist/config/responder-presets.json +69 -0
- package/dist/index.js +6 -1
- package/dist/providers/discord.d.ts +82 -0
- package/dist/providers/discord.js +697 -0
- package/dist/providers/slack.d.ts +79 -0
- package/dist/providers/slack.js +715 -0
- package/dist/providers/telegram.d.ts +30 -0
- package/dist/providers/telegram.js +190 -7
- package/dist/responders/claude-code-responder.d.ts +48 -0
- package/dist/responders/claude-code-responder.js +203 -0
- package/dist/responders/cli-responder.d.ts +62 -0
- package/dist/responders/cli-responder.js +298 -0
- package/dist/responders/llm-responder.d.ts +135 -0
- package/dist/responders/llm-responder.js +582 -0
- package/dist/templates/macos-scripts.js +2 -4
- package/dist/templates/prompts.js +4 -2
- package/dist/tui/ConfigEditor.js +42 -5
- package/dist/tui/components/ArrayEditor.js +1 -1
- package/dist/tui/components/EditorPanel.js +10 -6
- package/dist/tui/components/HelpPanel.d.ts +1 -1
- package/dist/tui/components/HelpPanel.js +1 -1
- package/dist/tui/components/JsonSnippetEditor.js +8 -5
- package/dist/tui/components/KeyValueEditor.js +69 -5
- package/dist/tui/components/LLMProvidersEditor.d.ts +22 -0
- package/dist/tui/components/LLMProvidersEditor.js +357 -0
- package/dist/tui/components/ObjectEditor.js +1 -1
- package/dist/tui/components/Preview.js +1 -1
- package/dist/tui/components/RespondersEditor.d.ts +22 -0
- package/dist/tui/components/RespondersEditor.js +437 -0
- package/dist/tui/components/SectionNav.js +27 -3
- package/dist/tui/utils/presets.js +15 -2
- package/dist/utils/chat-client.d.ts +33 -4
- package/dist/utils/chat-client.js +20 -1
- package/dist/utils/config.d.ts +100 -1
- package/dist/utils/config.js +78 -1
- package/dist/utils/daemon-actions.d.ts +19 -0
- package/dist/utils/daemon-actions.js +111 -0
- package/dist/utils/daemon-client.d.ts +21 -0
- package/dist/utils/daemon-client.js +28 -1
- package/dist/utils/llm-client.d.ts +82 -0
- package/dist/utils/llm-client.js +185 -0
- package/dist/utils/message-queue.js +6 -6
- package/dist/utils/notification.d.ts +10 -2
- package/dist/utils/notification.js +111 -4
- package/dist/utils/prd-validator.js +60 -19
- package/dist/utils/prompt.js +22 -12
- package/dist/utils/responder-logger.d.ts +47 -0
- package/dist/utils/responder-logger.js +129 -0
- package/dist/utils/responder-presets.d.ts +92 -0
- package/dist/utils/responder-presets.js +156 -0
- package/dist/utils/responder.d.ts +88 -0
- package/dist/utils/responder.js +207 -0
- package/dist/utils/stream-json.js +6 -6
- package/docs/CHAT-CLIENTS.md +520 -0
- package/docs/CHAT-RESPONDERS.md +785 -0
- package/docs/DEVELOPMENT.md +25 -0
- package/docs/USEFUL_ACTIONS.md +815 -0
- package/docs/chat-architecture.md +251 -0
- package/package.json +14 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slack chat client implementation.
|
|
3
|
+
* Uses @slack/bolt for WebSocket-based real-time messaging via Socket Mode.
|
|
4
|
+
*
|
|
5
|
+
* Required packages (must be installed separately):
|
|
6
|
+
* npm install @slack/bolt @slack/web-api
|
|
7
|
+
*/
|
|
8
|
+
import { ChatClient, ChatCommandHandler, ChatMessage, ChatMessageHandler, SlackSettings, SendMessageOptions } from "../utils/chat-client.js";
|
|
9
|
+
import { ResponderMatch } from "../utils/responder.js";
|
|
10
|
+
/**
|
|
11
|
+
* Callback for handling responder matches.
|
|
12
|
+
* Returns the response text to send back to the channel.
|
|
13
|
+
*/
|
|
14
|
+
export type ResponderHandler = (match: ResponderMatch, message: ChatMessage) => Promise<string | null>;
|
|
15
|
+
export declare class SlackChatClient implements ChatClient {
|
|
16
|
+
readonly provider: "slack";
|
|
17
|
+
private settings;
|
|
18
|
+
private connected;
|
|
19
|
+
private debug;
|
|
20
|
+
private app;
|
|
21
|
+
private webClient;
|
|
22
|
+
private onCommand;
|
|
23
|
+
private onMessage;
|
|
24
|
+
private responderMatcher;
|
|
25
|
+
private respondersConfig;
|
|
26
|
+
private botUserId;
|
|
27
|
+
private threadConversations;
|
|
28
|
+
constructor(settings: SlackSettings, debug?: boolean);
|
|
29
|
+
/**
|
|
30
|
+
* Initialize responder matching from config.
|
|
31
|
+
*/
|
|
32
|
+
private initializeResponders;
|
|
33
|
+
/**
|
|
34
|
+
* Fetch thread context (previous messages in the thread).
|
|
35
|
+
* Returns formatted context string or empty string if not in a thread.
|
|
36
|
+
*/
|
|
37
|
+
private fetchThreadContext;
|
|
38
|
+
/**
|
|
39
|
+
* Execute a responder and return the result.
|
|
40
|
+
*/
|
|
41
|
+
private executeResponder;
|
|
42
|
+
/**
|
|
43
|
+
* Handle a message that might match a responder or continue an existing thread conversation.
|
|
44
|
+
* Returns true if a responder was matched and executed.
|
|
45
|
+
*/
|
|
46
|
+
private handleResponderMessage;
|
|
47
|
+
/**
|
|
48
|
+
* Continue an existing thread conversation with the LLM.
|
|
49
|
+
*/
|
|
50
|
+
private continueThreadConversation;
|
|
51
|
+
/**
|
|
52
|
+
* Check if a message is mentioning the bot.
|
|
53
|
+
*/
|
|
54
|
+
private isBotMentioned;
|
|
55
|
+
/**
|
|
56
|
+
* Remove bot mention from message text.
|
|
57
|
+
*/
|
|
58
|
+
private removeBotMention;
|
|
59
|
+
/**
|
|
60
|
+
* Check if a channel ID is allowed.
|
|
61
|
+
*/
|
|
62
|
+
private isChannelAllowed;
|
|
63
|
+
/**
|
|
64
|
+
* Convert a Slack message event to our ChatMessage format.
|
|
65
|
+
*/
|
|
66
|
+
private toMessage;
|
|
67
|
+
/**
|
|
68
|
+
* Setup event handlers for the Slack app.
|
|
69
|
+
*/
|
|
70
|
+
private setupEventHandlers;
|
|
71
|
+
connect(onCommand: ChatCommandHandler, onMessage?: ChatMessageHandler): Promise<void>;
|
|
72
|
+
sendMessage(chatId: string, text: string, options?: SendMessageOptions): Promise<void>;
|
|
73
|
+
disconnect(): Promise<void>;
|
|
74
|
+
isConnected(): boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Create a Slack chat client from settings.
|
|
78
|
+
*/
|
|
79
|
+
export declare function createSlackClient(settings: SlackSettings, debug?: boolean): ChatClient;
|