@imvu/bot 0.0.0-stage → 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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC7B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAS/E"}
package/dist/parse.js ADDED
@@ -0,0 +1,19 @@
1
+ /** Parse `!name arg "two words"`, or return null when `text` is not a command. */
2
+ export function parseCommand(text, prefix) {
3
+ const trimmed = text.trim();
4
+ if (!prefix || !trimmed.startsWith(prefix))
5
+ return null;
6
+ const body = trimmed.slice(prefix.length);
7
+ const match = /^(\S+)\s*([\s\S]*)$/.exec(body);
8
+ if (!match)
9
+ return null;
10
+ return { name: match[1].toLowerCase(), args: splitArgs(match[2]), argText: match[2] };
11
+ }
12
+ function splitArgs(text) {
13
+ const args = [];
14
+ const pattern = /"([^"]*)"|'([^']*)'|(\S+)/g;
15
+ for (const match of text.matchAll(pattern))
16
+ args.push(match[1] ?? match[2] ?? match[3]);
17
+ return args;
18
+ }
19
+ //# sourceMappingURL=parse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AASA,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,MAAc;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAExD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACvF,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC9B,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,OAAO,GAAG,4BAA4B,CAAC;IAC7C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,OAAO,IAAI,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
- "name": "@imvu/bot",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@imvu/bot",
3
+ "version": "0.1.1",
4
+ "description": "Build IMVU chat bots: commands, permissions, rate limiting and rejoining on top of @imvu/client.",
5
+ "author": "dhkatz",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "files": [
17
+ "dist",
18
+ "src",
19
+ "README.md"
20
+ ],
21
+ "sideEffects": false,
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/dhkatz/imvu.js.git",
25
+ "directory": "packages/bot"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc -b",
32
+ "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
33
+ "test": "vitest run"
34
+ },
35
+ "dependencies": {
36
+ "@imvu/client": "^0.2.0"
37
+ },
38
+ "homepage": "https://dhkatz.github.io/imvu.js/packages/bot/",
39
+ "bugs": {
40
+ "url": "https://github.com/dhkatz/imvu.js/issues"
41
+ },
42
+ "engines": {
43
+ "node": ">=22"
44
+ }
45
+ }