lumiverse-spindle-types 0.4.57 → 0.4.58
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/package.json +1 -1
- package/src/api.ts +79 -0
- package/src/events.ts +2 -0
- package/src/index.ts +9 -0
- package/src/permissions.ts +2 -0
- package/src/spindle-api.ts +23 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -667,6 +667,78 @@ export interface WorldBookEntryCreateDTO {
|
|
|
667
667
|
|
|
668
668
|
export type WorldBookEntryUpdateDTO = WorldBookEntryCreateDTO;
|
|
669
669
|
|
|
670
|
+
// ─── Regex Script DTOs ──────────────────────────────────────────────────
|
|
671
|
+
|
|
672
|
+
export type RegexPlacementDTO = "user_input" | "ai_output" | "world_info" | "reasoning";
|
|
673
|
+
export type RegexScopeDTO = "global" | "character" | "chat";
|
|
674
|
+
export type RegexTargetDTO = "prompt" | "response" | "display";
|
|
675
|
+
export type RegexMacroModeDTO = "none" | "raw" | "escaped";
|
|
676
|
+
|
|
677
|
+
export interface RegexScriptDTO {
|
|
678
|
+
id: string;
|
|
679
|
+
name: string;
|
|
680
|
+
script_id: string;
|
|
681
|
+
find_regex: string;
|
|
682
|
+
replace_string: string;
|
|
683
|
+
flags: string;
|
|
684
|
+
placement: RegexPlacementDTO[];
|
|
685
|
+
scope: RegexScopeDTO;
|
|
686
|
+
scope_id: string | null;
|
|
687
|
+
target: RegexTargetDTO;
|
|
688
|
+
min_depth: number | null;
|
|
689
|
+
max_depth: number | null;
|
|
690
|
+
trim_strings: string[];
|
|
691
|
+
run_on_edit: boolean;
|
|
692
|
+
substitute_macros: RegexMacroModeDTO;
|
|
693
|
+
disabled: boolean;
|
|
694
|
+
sort_order: number;
|
|
695
|
+
description: string;
|
|
696
|
+
folder: string;
|
|
697
|
+
metadata: Record<string, unknown>;
|
|
698
|
+
created_at: number;
|
|
699
|
+
updated_at: number;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
export interface RegexScriptListOptionsDTO {
|
|
703
|
+
scope?: RegexScopeDTO;
|
|
704
|
+
scopeId?: string;
|
|
705
|
+
target?: RegexTargetDTO;
|
|
706
|
+
limit?: number;
|
|
707
|
+
offset?: number;
|
|
708
|
+
userId?: string;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export interface RegexScriptActiveOptionsDTO {
|
|
712
|
+
target: RegexTargetDTO;
|
|
713
|
+
characterId?: string;
|
|
714
|
+
chatId?: string;
|
|
715
|
+
userId?: string;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export interface RegexScriptCreateDTO {
|
|
719
|
+
name: string;
|
|
720
|
+
find_regex: string;
|
|
721
|
+
replace_string?: string;
|
|
722
|
+
flags?: string;
|
|
723
|
+
placement?: RegexPlacementDTO[];
|
|
724
|
+
scope?: RegexScopeDTO;
|
|
725
|
+
scope_id?: string | null;
|
|
726
|
+
target?: RegexTargetDTO;
|
|
727
|
+
min_depth?: number | null;
|
|
728
|
+
max_depth?: number | null;
|
|
729
|
+
trim_strings?: string[];
|
|
730
|
+
run_on_edit?: boolean;
|
|
731
|
+
substitute_macros?: RegexMacroModeDTO;
|
|
732
|
+
disabled?: boolean;
|
|
733
|
+
sort_order?: number;
|
|
734
|
+
description?: string;
|
|
735
|
+
folder?: string;
|
|
736
|
+
metadata?: Record<string, unknown>;
|
|
737
|
+
script_id?: string;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
export type RegexScriptUpdateDTO = Partial<RegexScriptCreateDTO>;
|
|
741
|
+
|
|
670
742
|
// ─── Databank DTOs ───────────────────────────────────────────────────────
|
|
671
743
|
|
|
672
744
|
export type DatabankScopeDTO = "global" | "character" | "chat";
|
|
@@ -1911,6 +1983,13 @@ export type WorkerToHost =
|
|
|
1911
1983
|
| { type: "council_get_available_lumia_items"; requestId: string; userId?: string }
|
|
1912
1984
|
// ─── Activated World Info (gated: "world_books") ───────────────────
|
|
1913
1985
|
| { type: "world_books_get_activated"; requestId: string; chatId: string; userId?: string }
|
|
1986
|
+
// ─── Regex Scripts (gated: "regex_scripts") ────────────────────────
|
|
1987
|
+
| { type: "regex_scripts_list"; requestId: string; scope?: RegexScopeDTO; scopeId?: string; target?: RegexTargetDTO; limit?: number; offset?: number; userId?: string }
|
|
1988
|
+
| { type: "regex_scripts_get"; requestId: string; scriptId: string; userId?: string }
|
|
1989
|
+
| { type: "regex_scripts_get_active"; requestId: string; target: RegexTargetDTO; characterId?: string; chatId?: string; userId?: string }
|
|
1990
|
+
| { type: "regex_scripts_create"; requestId: string; input: RegexScriptCreateDTO; userId?: string }
|
|
1991
|
+
| { type: "regex_scripts_update"; requestId: string; scriptId: string; input: RegexScriptUpdateDTO; userId?: string }
|
|
1992
|
+
| { type: "regex_scripts_delete"; requestId: string; scriptId: string; userId?: string }
|
|
1914
1993
|
// ─── Dry Run (gated: "generation") ────────────────────────────────
|
|
1915
1994
|
| { type: "generate_dry_run"; requestId: string; input: DryRunRequestDTO; userId?: string }
|
|
1916
1995
|
// ─── Chat Memories (gated: "chats") ───────────────────────────────
|
package/src/events.ts
CHANGED
|
@@ -36,6 +36,8 @@ export enum CoreEventType {
|
|
|
36
36
|
CONNECTION_PROFILE_LOADED = "CONNECTION_PROFILE_LOADED",
|
|
37
37
|
MAIN_API_CHANGED = "MAIN_API_CHANGED",
|
|
38
38
|
WORLD_INFO_ACTIVATED = "WORLD_INFO_ACTIVATED",
|
|
39
|
+
REGEX_SCRIPT_CHANGED = "REGEX_SCRIPT_CHANGED",
|
|
40
|
+
REGEX_SCRIPT_DELETED = "REGEX_SCRIPT_DELETED",
|
|
39
41
|
MESSAGE_TAG_INTERCEPTED = "MESSAGE_TAG_INTERCEPTED",
|
|
40
42
|
TOOL_INVOCATION = "TOOL_INVOCATION",
|
|
41
43
|
}
|
package/src/index.ts
CHANGED
|
@@ -42,6 +42,15 @@ export type {
|
|
|
42
42
|
WorldBookEntryDTO,
|
|
43
43
|
WorldBookEntryCreateDTO,
|
|
44
44
|
WorldBookEntryUpdateDTO,
|
|
45
|
+
RegexPlacementDTO,
|
|
46
|
+
RegexScopeDTO,
|
|
47
|
+
RegexTargetDTO,
|
|
48
|
+
RegexMacroModeDTO,
|
|
49
|
+
RegexScriptDTO,
|
|
50
|
+
RegexScriptCreateDTO,
|
|
51
|
+
RegexScriptUpdateDTO,
|
|
52
|
+
RegexScriptListOptionsDTO,
|
|
53
|
+
RegexScriptActiveOptionsDTO,
|
|
45
54
|
DatabankScopeDTO,
|
|
46
55
|
DatabankDocumentStatusDTO,
|
|
47
56
|
DatabankDTO,
|
package/src/permissions.ts
CHANGED
|
@@ -31,6 +31,7 @@ export type SpindlePermission =
|
|
|
31
31
|
| "characters"
|
|
32
32
|
| "chats"
|
|
33
33
|
| "world_books"
|
|
34
|
+
| "regex_scripts"
|
|
34
35
|
| "databanks"
|
|
35
36
|
| "personas"
|
|
36
37
|
| "push_notification"
|
|
@@ -54,6 +55,7 @@ export const ALL_PERMISSIONS: readonly SpindlePermission[] = [
|
|
|
54
55
|
"characters",
|
|
55
56
|
"chats",
|
|
56
57
|
"world_books",
|
|
58
|
+
"regex_scripts",
|
|
57
59
|
"databanks",
|
|
58
60
|
"personas",
|
|
59
61
|
"push_notification",
|
package/src/spindle-api.ts
CHANGED
|
@@ -27,6 +27,11 @@ import type {
|
|
|
27
27
|
WorldBookEntryDTO,
|
|
28
28
|
WorldBookEntryCreateDTO,
|
|
29
29
|
WorldBookEntryUpdateDTO,
|
|
30
|
+
RegexScriptDTO,
|
|
31
|
+
RegexScriptCreateDTO,
|
|
32
|
+
RegexScriptUpdateDTO,
|
|
33
|
+
RegexScriptListOptionsDTO,
|
|
34
|
+
RegexScriptActiveOptionsDTO,
|
|
30
35
|
DatabankDTO,
|
|
31
36
|
DatabankCreateDTO,
|
|
32
37
|
DatabankUpdateDTO,
|
|
@@ -741,6 +746,24 @@ export interface SpindleAPI {
|
|
|
741
746
|
getActivated(chatId: string, userId?: string): Promise<ActivatedWorldInfoEntryDTO[]>;
|
|
742
747
|
};
|
|
743
748
|
|
|
749
|
+
/**
|
|
750
|
+
* Regex Scripts CRUD (permission: "regex_scripts").
|
|
751
|
+
* Full access to regex scripts attached to the user's account, including
|
|
752
|
+
* global, character-scoped, and chat-scoped rules. Same shape Lumiverse uses
|
|
753
|
+
* internally during prompt assembly, response baking, and display rendering.
|
|
754
|
+
* For user-scoped extensions, userId is inferred from the extension owner.
|
|
755
|
+
* For operator-scoped extensions, pass userId to scope to a specific user.
|
|
756
|
+
*/
|
|
757
|
+
regex_scripts: {
|
|
758
|
+
list(options?: RegexScriptListOptionsDTO): Promise<{ data: RegexScriptDTO[]; total: number }>;
|
|
759
|
+
get(scriptId: string, userId?: string): Promise<RegexScriptDTO | null>;
|
|
760
|
+
create(input: RegexScriptCreateDTO, userId?: string): Promise<RegexScriptDTO>;
|
|
761
|
+
update(scriptId: string, input: RegexScriptUpdateDTO, userId?: string): Promise<RegexScriptDTO>;
|
|
762
|
+
delete(scriptId: string, userId?: string): Promise<boolean>;
|
|
763
|
+
/** Resolve the enabled scripts that would actually fire for the given target + character/chat context, merged across global + character + chat scopes and ordered by scope tier then sort_order. */
|
|
764
|
+
getActive(options: RegexScriptActiveOptionsDTO): Promise<RegexScriptDTO[]>;
|
|
765
|
+
};
|
|
766
|
+
|
|
744
767
|
/**
|
|
745
768
|
* Databank CRUD (permission: "databanks").
|
|
746
769
|
* Manage databanks plus the documents they contain.
|