risupack 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +93 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -94,19 +94,80 @@ Use the following manifest structure.
94
94
  {
95
95
  "bundle": true,
96
96
  "lowLevelAccess": true,
97
- "lua": "triggers/main.lua",
98
- "type": "start"
97
+ "lua": "triggers/main.lua"
99
98
  }
100
99
  ],
101
100
  "version": "1.0.0"
102
101
  }
103
102
  ```
104
103
 
105
- Use `{ "content": "..." }` instead of a file path only when a `CSS`, `toggles`, or lorebook source must remain inline.
104
+ ## Manifest fields
105
+
106
+ - `name`: Required non-empty module name.
107
+ - `namespace`: RisuAI module namespace.
108
+ - `version`: Packaged module version.
109
+ - `description`: Packaged module description.
110
+ - `creator`: Package creator name.
111
+ - `license`: Package license identifier or text.
112
+ - `tags`: Array of package tags. Defaults to an empty array.
113
+ - `output`: Output path used when the CLI output argument is omitted. Defaults to `../dist/<sanitized-name>.charx` relative to the manifest directory.
114
+ - `CSS`: Custom CSS source.
115
+ - `toggles`: Module toggle source.
116
+ - `icon`: Main module icon path. The builder supplies an empty default icon when omitted.
117
+ - `hideIcon`: Hides the module icon in chat when `true`. Defaults to `false`.
118
+ - `lowLevelAccess`: Enables module-level low-level access when `true`. Defaults to `false`.
119
+ - `folders`: Lorebook folder names to create even when no lorebook entry references them.
120
+ - `assets`: Additional packaged assets.
121
+ - `lorebook`: Lorebook entries.
122
+ - `regex`: Regex entries in execution order.
123
+ - `triggers`: Lua trigger entries.
124
+
125
+ ## Source values
126
+
127
+ `CSS`, `toggles`, and lorebook sources accept a path string, a file object, or inline content.
128
+
129
+ ```json
130
+ {
131
+ "CSS": "styles/main.html",
132
+ "toggles": { "file": "toggles.txt" },
133
+ "lorebook": [
134
+ {
135
+ "comment": "inline",
136
+ "content": "Inline lorebook content"
137
+ }
138
+ ]
139
+ }
140
+ ```
141
+
142
+ When a source object contains both `content` and `file`, `content` takes precedence. A bundled Lua lorebook requires `file`.
143
+
144
+ ## Lorebook entries
145
+
146
+ - `file`: Lorebook source path. Required unless `content` is provided.
147
+ - `content`: Inline lorebook source.
148
+ - `comment`: Lorebook name. Defaults to the source file basename.
149
+ - `alwaysActive`: Enables constant activation. Defaults to `false`.
150
+ - `activationPercent`: RisuAI activation percentage.
151
+ - `folder`: Display folder name. The builder creates referenced folders automatically.
152
+ - `insertOrder`: Lorebook insertion order. Defaults to `100`.
153
+ - `key`: Comma-separated primary activation keys. Defaults to an empty string.
154
+ - `secondaryKey`: Comma-separated secondary activation keys. Defaults to an empty string.
155
+ - `selective`: Enables secondary-key matching. Defaults to `false`.
156
+ - `mode`: RisuAI lorebook mode. Defaults to `normal`.
157
+ - `useRegex`: Treats activation keys as regular expressions when `true`. Defaults to `false`.
158
+ - `extentions`: RisuAI-specific lorebook extension values. Use this exact spelling.
159
+ - `bundle`: Bundles the Lua source and its `require()` dependencies when `true`. Defaults to `false`.
160
+ - `bundleOutput`: Optional path for retaining the bundled Lua artifact.
106
161
 
107
162
  ## Lua triggers
108
163
 
109
- Set trigger `lua` to the unbundled entry file. Omit `bundle` or set `bundle` to `true` to let the CharX builder invoke the Lua bundler and embed the bundled code.
164
+ Define Lua triggers with `lua`. Do not specify `effect`, `conditions`, or `type` for Lua triggers.
165
+
166
+ - `lua`: Unbundled Lua entry file. Required.
167
+ - `bundle`: Bundles the entry file and its `require()` dependencies. Defaults to `true`.
168
+ - `bundleOutput`: Optional path for retaining the bundled Lua artifact.
169
+ - `comment`: Trigger name. Defaults to an empty string.
170
+ - `lowLevelAccess`: Enables low-level access for the trigger.
110
171
 
111
172
  Omit `bundleOutput` for normal CharX builds. The builder uses a temporary output and removes it after packaging. Set `bundleOutput` only when a standalone bundled Lua artifact is required.
112
173
 
@@ -134,6 +195,27 @@ Use the frontmatter keys `ableFlag`, `comment`, `flag`, and `type`. Omit `flag`
134
195
 
135
196
  List regex file paths in execution order in the manifest `regex` array.
136
197
 
198
+ Regex entries accept a file path, a file object, or an inline object.
199
+
200
+ ```json
201
+ {
202
+ "regex": [
203
+ "regex/display.md",
204
+ { "file": "regex/request.md" },
205
+ {
206
+ "ableFlag": true,
207
+ "comment": "Inline",
208
+ "flag": "gs",
209
+ "in": "input pattern",
210
+ "out": "replacement",
211
+ "type": "editdisplay"
212
+ }
213
+ ]
214
+ }
215
+ ```
216
+
217
+ Inline regex entries require string values for both `in` and `out`. `ableFlag` defaults to `true`, `comment` defaults to an empty string, and `type` defaults to `editdisplay`.
218
+
137
219
  ## Lorebooks
138
220
 
139
221
  Include Markdown prompts in the manifest `lorebook` array.
@@ -144,7 +226,13 @@ Set lorebook `bundle` to `true` when RisuAI must receive bundled Lua as lorebook
144
226
 
145
227
  ## Assets
146
228
 
147
- List additional packaged files in the manifest `assets` array. Set `file` and the RisuAI lookup `name`. Set `extension` only when the file extension cannot be inferred from `file`.
229
+ List additional packaged files in the manifest `assets` array.
230
+
231
+ - `file`: Asset source path. Required.
232
+ - `name`: RisuAI asset lookup name. Defaults to the source filename without its extension.
233
+ - `extension`: Packaged extension without a leading dot. Defaults to the source file extension and accepts lowercase letters and digits.
234
+
235
+ Archive entry names replace unsupported characters and add numeric suffixes to resolve collisions.
148
236
 
149
237
  ## Programmatic API
150
238
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "risupack",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Command-line tools for packing and unpacking RisuAI modules",
5
5
  "license": "AGPL-3.0-only",
6
6
  "bin": {