Files
metabuilder/packages/irc_webchat/scripts/functions.json
johndoe6345789 8c8f8cce8a feat: Add JSON Script Example and Lua Test Framework
- Created a new package for JSON Script Example with comprehensive examples demonstrating the full JSON script specification.
- Added permissions for viewing, executing, and modifying examples in the JSON Script Example package.
- Implemented functions for various expressions, statements, operators, and control flow in the JSON Script Example.
- Developed a Storybook configuration for showcasing JSON Script Examples with interactive components.
- Established a styles token file for consistent styling across the JSON Script Example package.
- Introduced a new Lua Test Framework package with components for running and displaying test results.
- Defined permissions for executing and viewing Lua test results, along with configuration and debugging capabilities.
- Implemented a comprehensive set of functions for the Lua testing framework, including assertions and mocks.
- Created Storybook stories for the Lua Test Framework to demonstrate the test runner and results display.
- Added a styles token file for the Lua Test Framework to ensure a cohesive design.
2026-01-02 16:42:39 +00:00

171 lines
4.3 KiB
JSON

{
"$schema": "https://metabuilder.dev/schemas/json-script.schema.json",
"schemaVersion": "2.2.0",
"package": "irc_webchat",
"description": "IRC Webchat message handling and command processing functions",
"functions": [
{
"id": "irc_send_message",
"name": "sendMessage",
"exported": true,
"description": "Send a chat message to a channel",
"category": "commands",
"luaScript": "send_message.lua",
"parameters": [
{
"name": "channelId",
"type": "string",
"description": "Channel identifier"
},
{
"name": "username",
"type": "string",
"description": "Username of the sender"
},
{
"name": "userId",
"type": "string",
"description": "User identifier"
},
{
"name": "message",
"type": "string",
"description": "Message content to send"
}
],
"returns": {
"type": "ChatMessage",
"description": "Chat message object"
}
},
{
"id": "irc_handle_command",
"name": "handleCommand",
"exported": true,
"description": "Process IRC commands like /help, /users, /clear, /me",
"category": "commands",
"luaScript": "handle_command.lua",
"parameters": [
{
"name": "command",
"type": "string",
"description": "IRC command string (e.g., /help, /users, /clear, /me <action>)"
},
{
"name": "channelId",
"type": "string",
"description": "Channel identifier"
},
{
"name": "username",
"type": "string",
"description": "Current username"
},
{
"name": "onlineUsers",
"type": "array",
"description": "List of online usernames"
}
],
"returns": {
"type": "IRCMessage",
"description": "Response message object"
}
},
{
"id": "irc_format_time",
"name": "formatTime",
"exported": true,
"description": "Format timestamps for display in HH:MM AM/PM format",
"category": "formatting",
"luaScript": "format_time.lua",
"parameters": [
{
"name": "timestamp",
"type": "number",
"description": "Unix timestamp in milliseconds"
}
],
"returns": {
"type": "string",
"description": "Formatted time string in HH:MM AM/PM format"
}
},
{
"id": "irc_user_join",
"name": "userJoin",
"exported": true,
"description": "Handle user joining a channel",
"category": "events",
"luaScript": "user_join.lua",
"parameters": [
{
"name": "channelId",
"type": "string",
"description": "Channel identifier"
},
{
"name": "username",
"type": "string",
"description": "Username of the user joining"
},
{
"name": "userId",
"type": "string",
"description": "User identifier of the user joining"
}
],
"returns": {
"type": "JoinMessage",
"description": "Join notification message object"
}
},
{
"id": "irc_user_leave",
"name": "userLeave",
"exported": true,
"description": "Handle user leaving a channel",
"category": "events",
"luaScript": "user_leave.lua",
"parameters": [
{
"name": "channelId",
"type": "string",
"description": "Channel identifier"
},
{
"name": "username",
"type": "string",
"description": "Username of the user leaving"
},
{
"name": "userId",
"type": "string",
"description": "User identifier of the user leaving"
}
],
"returns": {
"type": "LeaveMessage",
"description": "Leave notification message object"
}
},
{
"id": "irc_init",
"name": "init",
"exported": false,
"description": "Lifecycle hooks for installation and removal",
"category": "lifecycle",
"luaScript": "init.lua"
}
],
"exports": {
"functions": [
"sendMessage",
"handleCommand",
"formatTime",
"userJoin",
"userLeave"
]
}
}