diff --git a/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_mixed_nested_struct_and_vector.exp b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_mixed_nested_struct_and_vector.exp new file mode 100644 index 0000000000..68c4c49cca --- /dev/null +++ b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_mixed_nested_struct_and_vector.exp @@ -0,0 +1,4 @@ +processed 1 task + +task 0 'publish'. lines 1-86: +status EXECUTED diff --git a/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_mixed_nested_struct_and_vector.mvir b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_mixed_nested_struct_and_vector.mvir new file mode 100644 index 0000000000..25f606e8e4 --- /dev/null +++ b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_mixed_nested_struct_and_vector.mvir @@ -0,0 +1,86 @@ +//# publish +module 0x11.TestModule1 { + import 0x1.string; + import 0x2.table; + import 0x1.option; + + struct Media has store, copy, drop { + id: string.String, + url: string.String, + title: string.String, + source: string.String, + description: string.String, + text: string.String, + contentType: string.String, + } + + struct Content has store, copy, drop { + text: string.String, + action: option.Option, + source: option.Option, + url: option.Option, + inReplyTo: option.Option, + attachments: vector, + } + + struct Memory has store, copy, drop { + id: string.String, + userId: string.String, + agentId: string.String, + createdAt: option.Option, + content: Self.Content, + character: string.String, + embedding: vector, + roomId: string.String, + unique: bool, + similarity: option.Option, + } + + struct MessageTemplate has store, copy, drop{ + user: string.String, + content: Self.Content, + } + + struct MemoryStore has key { + agent_account: address, + store: table.Table, + } + + struct Style has store, copy, drop { + all: vector, + chat: vector, + post: vector, + } + + struct Character has key { + /// Optional UUID for the character. + id: option.Option, + name: string.String, + username: string.String, + plugins: vector, + clients: vector, + modelProvider: string.String, + imageModelProvider: option.Option, + imageVisionModelProvider: option.Option, + modelEndpointOverride: option.Option, + system: string.String, + bio: vector, + lore: vector, + messageExamples: vector>, + postExamples: vector, + topics: vector, + style: Self.Style, + adjectives: vector, + knowledge: vector, + } + + metadata { + data_struct { + 0x11::TestModule1::Media -> true; + 0x11::TestModule1::Content -> true; + 0x11::TestModule1::Memory -> true; + 0x11::TestModule1::Style -> true; + 0x11::TestModule1::MessageTemplate -> true; + } + } +} diff --git a/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_struct.exp b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_struct.exp new file mode 100644 index 0000000000..8f7c83bcc3 --- /dev/null +++ b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_struct.exp @@ -0,0 +1,4 @@ +processed 1 task + +task 0 'publish'. lines 1-51: +status EXECUTED diff --git a/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_struct.mvir b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_struct.mvir new file mode 100644 index 0000000000..586fee48e1 --- /dev/null +++ b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_struct.mvir @@ -0,0 +1,51 @@ +//# publish +module 0x11.TestModule1 { + import 0x1.string; + import 0x2.table; + import 0x1.option; + + struct Media has store, copy, drop { + id: string.String, + url: string.String, + title: string.String, + source: string.String, + description: string.String, + text: string.String, + contentType: string.String, + } + + struct Content has store, copy, drop { + text: string.String, + action: option.Option, + source: option.Option, + url: option.Option, + inReplyTo: option.Option, + attachments: vector, + } + + struct Memory has store, copy, drop { + id: string.String, + userId: string.String, + agentId: string.String, + createdAt: option.Option, + content: Self.Content, + character: string.String, + embedding: vector, + roomId: string.String, + unique: bool, + similarity: option.Option, + } + + struct MemoryStore has key { + agent_account: address, + store: table.Table, + } + + metadata { + data_struct { + 0x11::TestModule1::Media -> true; + 0x11::TestModule1::Content -> true; + 0x11::TestModule1::Memory -> true; + } + } +} diff --git a/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_vector.exp b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_vector.exp new file mode 100644 index 0000000000..257877ea4b --- /dev/null +++ b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_vector.exp @@ -0,0 +1,4 @@ +processed 1 task + +task 0 'publish'. lines 1-67: +status EXECUTED diff --git a/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_vector.mvir b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_vector.mvir new file mode 100644 index 0000000000..8a0b4c2a43 --- /dev/null +++ b/crates/rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_vector.mvir @@ -0,0 +1,67 @@ +//# publish +module 0x11.TestModule1 { + import 0x1.string; + import 0x2.table; + import 0x1.option; + + struct Style has store, copy, drop { + all: vector, + chat: vector, + post: vector, + } + + struct Media has store, copy, drop { + id: string.String, + url: string.String, + title: string.String, + source: string.String, + description: string.String, + text: string.String, + contentType: string.String, + } + + struct Content has store, copy, drop { + text: string.String, + action: option.Option, + source: option.Option, + url: option.Option, + inReplyTo: option.Option, + attachments: vector, + } + + struct MessageTemplate has store, copy, drop{ + user: string.String, + content: Self.Content, + } + + struct Character has key { + /// Optional UUID for the character. + id: option.Option, + name: string.String, + username: string.String, + plugins: vector, + clients: vector, + modelProvider: string.String, + imageModelProvider: option.Option, + imageVisionModelProvider: option.Option, + modelEndpointOverride: option.Option, + system: string.String, + bio: vector, + lore: vector, + messageExamples: vector>, + postExamples: vector, + topics: vector, + style: Self.Style, + adjectives: vector, + knowledge: vector, + } + + metadata { + data_struct { + 0x11::TestModule1::Style -> true; + 0x11::TestModule1::Content -> true; + 0x11::TestModule1::Media -> true; + 0x11::TestModule1::MessageTemplate -> true; + } + } +}