Commit Graph

31 Commits

Author SHA1 Message Date
Cohee 719539c2ab Improve types and sanitation of macro values 2024-06-26 21:58:57 +03:00
Cohee a030237641 Evaluate macro functions for every instance 2024-06-25 22:44:00 +03:00
Cohee 24ae2b6fa6 Add sanitation of macro values 2024-06-25 22:15:40 +03:00
Cohee 01d38f9218 Additional validation of custom macro keys 2024-06-25 22:02:05 +03:00
Cohee 8dab4ecb06 Add simple custom macros registration 2024-06-25 21:53:10 +03:00
Cohee d8949fddc7 Escape commas in comma-separated random and pick 2024-06-02 15:02:54 +03:00
Cohee b559f2f559 V3 spec (IMPORT ONLY) 2024-06-01 22:07:57 +03:00
Cohee a93777e3b7 (chore) JSDoc comment 2024-05-11 23:38:26 +03:00
Hydroerotic 1f81086a21
Update macros.js 2024-05-11 14:13:03 +03:00
Hydroerotic 432be2ee57
Update macros.js 2024-05-11 13:52:31 +03:00
Cohee fb5d998cd0 Allow all macro in story strings 2024-04-21 14:06:33 +03:00
Cohee 42e1ade148 Add a {{noop}} macro 2024-04-10 01:04:12 +03:00
Cohee 7311997e7a
Merge pull request #2042 from Wolfsblvt/macro-main-system-prompt
Add a main {{systemPrompt}} macro
2024-04-09 10:21:33 +03:00
Wolfsblvt 845409a239 Add a main {{systemPrompt}} macro 2024-04-08 20:05:59 +02:00
Cohee 0c41ab6090 Fix chatIdHash being empty on the first evaluation 2024-04-08 15:10:15 +03:00
Wolfsblvt b027c04066 Remove chat save on pick macro 2024-04-07 20:37:05 +02:00
Wolfsblvt 82a30b6ba5 Fix pick macro rerolling on branches/renames 2024-04-07 04:40:15 +02:00
Wolfsblvt d5cb4f403a Fix currently reswiped messages being returned on macros
- Build one utility function to get the last message id matching a criteria
- Fix all macros referencing last message still returning a now being reswiped message
2024-04-07 00:06:38 +02:00
Wolfsblvt 3632631997 random and pick allow empty items and trim correctly 2024-04-02 01:02:02 +02:00
Wolfsblvt 9b24397f5a Unify {{pick}} and {{random}} regex
- Allow all four possible syntax forms, just to make this easier: {{random:1️⃣:two}}, {{random1️⃣:two}}, {{random::one,two}} and {{random:one,two}}
2024-04-02 00:42:13 +02:00
Cohee 4f6127c8f2 Actually support comma-split syntax in random 2024-04-02 01:16:25 +03:00
Wolfsblvt 70adee3c63 Add {{pick}} macro replacement
- Pick macro that works like random, but is consistent for the chat and context
- Change help text for random to actually utilize the new, preferred syntax
2024-04-01 01:47:56 +02:00
Cohee d997f8dc53 Add {{trim}} macro 2024-03-30 12:26:21 +02:00
Cohee 76cde592ad #1940 Allow both random syntaxes in one message 2024-03-23 00:57:33 +02:00
Cohee 2baea084a1 Add lastCharMessage and lastUserMessage macros 2024-03-17 02:45:22 +02:00
Cohee d311780328 Fix performance in macro substitution 2024-03-16 01:38:23 +02:00
Cohee 5f1e290bda Disallow multiple {{original}} macro substitutions 2024-01-29 00:58:29 +02:00
valadaptive 71f47588cd Pass macro variables in to evaluateMacros
This doesn't cover *all* the variables yet, just the ones that were
previously passed in as arguments. I'll expand this later to separate
the macro parsing from the execution of the functions themselves.
2024-01-27 13:20:44 -05:00
Cohee 9bb404fb34 Add missing arg to JSdoc 2024-01-12 11:48:34 +02:00
Cohee a5edf2696f Fix relative imports 2024-01-12 11:47:00 +02:00
valadaptive 89a999cfd4 Move macro substitution to new module
substituteParams has become a thin wrapper around the new evaluateMacros
function, and will become more of a compatibility shim as refactorings
and rewrites are done.
2024-01-10 22:22:30 -05:00