@little-samo/samo-ai-sdk 0.1.0-rv8 → 0.1.0
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/README.md +123 -11
- package/dist/dto/entities/agents/agent.d.ts +6 -4
- package/dist/dto/entities/agents/agent.preset.d.ts +1 -1
- package/dist/dto/entities/agents/agent.requests.d.ts +18 -34
- package/dist/dto/entities/agents/agent.requests.js +4 -14
- package/dist/dto/entities/agents/agent.requests.js.map +1 -1
- package/dist/dto/entities/index.d.ts +1 -0
- package/dist/dto/entities/index.js +1 -0
- package/dist/dto/entities/index.js.map +1 -1
- package/dist/dto/entities/users/index.d.ts +0 -1
- package/dist/dto/entities/users/index.js +0 -1
- package/dist/dto/entities/users/index.js.map +1 -1
- package/dist/dto/entities/users/user.d.ts +4 -0
- package/dist/dto/items/item.rankings.d.ts +3 -3
- package/dist/dto/locations/index.d.ts +1 -1
- package/dist/dto/locations/index.js +1 -1
- package/dist/dto/locations/index.js.map +1 -1
- package/dist/dto/locations/location.d.ts +16 -16
- package/dist/dto/locations/location.events.d.ts +5 -6
- package/dist/dto/locations/location.messages.d.ts +1 -2
- package/dist/dto/locations/location.messages.js +0 -15
- package/dist/dto/locations/location.messages.js.map +1 -1
- package/dist/dto/locations/location.preset.d.ts +1 -1
- package/dist/dto/locations/location.requests.d.ts +37 -207
- package/dist/dto/locations/location.requests.js +11 -61
- package/dist/dto/locations/location.requests.js.map +1 -1
- package/dist/models/locations/location.config.d.ts +3 -47
- package/dist/models/locations/location.config.js +21 -38
- package/dist/models/locations/location.config.js.map +1 -1
- package/dist/models/locations/location.constants.d.ts +0 -8
- package/dist/models/locations/location.constants.js +1 -8
- package/dist/models/locations/location.constants.js.map +1 -1
- package/package.json +1 -1
- package/dist/dto/entities/users/user.requests.d.ts +0 -13
- package/dist/dto/entities/users/user.requests.js +0 -13
- package/dist/dto/entities/users/user.requests.js.map +0 -1
- package/dist/dto/locations/location.message.d.ts +0 -13
- package/dist/dto/locations/location.message.js +0 -3
- package/dist/dto/locations/location.message.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,43 +1,155 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<img src="https://media.githubusercontent.com/media/little-samo/CI/master/assets/characters/samo/profile.png" alt="Little Samo Mascot" width="250" />
|
|
3
|
-
<h1>SamoAI
|
|
4
|
-
<p><em>
|
|
3
|
+
<h1>SamoAI Repository Storage</h1>
|
|
4
|
+
<p><em>File system-based repository implementations for <a href="https://github.com/little-samo/SamoAI">@little-samo/samo-ai</a></em></p>
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="#features">Features</a> •
|
|
9
9
|
<a href="#installation">Installation</a> •
|
|
10
|
+
<a href="#usage">Usage</a> •
|
|
11
|
+
<a href="#file-structure">File Structure</a> •
|
|
10
12
|
<a href="#learn-more">Learn More</a> •
|
|
11
13
|
<a href="#license">License</a>
|
|
12
14
|
</p>
|
|
13
15
|
|
|
14
16
|
## Features
|
|
15
17
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- **Request/Response types** for API interactions
|
|
21
|
-
- **Full TypeScript support** with strict type checking
|
|
18
|
+
- File system-based storage for SamoAI entities
|
|
19
|
+
- Persistent memory and state management
|
|
20
|
+
- Support for agents, users, locations, items, and gimmicks
|
|
21
|
+
- TypeScript support with full type safety
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
25
25
|
Install the package using npm:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm install @little-samo/samo-ai-
|
|
28
|
+
npm install @little-samo/samo-ai-repository-storage
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Or using yarn:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
yarn add @little-samo/samo-ai-
|
|
34
|
+
yarn add @little-samo/samo-ai-repository-storage
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
### Basic Setup
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import {
|
|
43
|
+
AgentStorage,
|
|
44
|
+
UserStorage,
|
|
45
|
+
LocationStorage,
|
|
46
|
+
ItemStorage,
|
|
47
|
+
GimmickStorage
|
|
48
|
+
} from '@little-samo/samo-ai-repository-storage';
|
|
49
|
+
import { WorldManager } from '@little-samo/samo-ai';
|
|
50
|
+
|
|
51
|
+
// Initialize storage instances
|
|
52
|
+
const agentStorage = new AgentStorage(
|
|
53
|
+
'./models/agents', // Path to agent model files
|
|
54
|
+
'./states/agents' // Path to agent state files
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const userStorage = new UserStorage(
|
|
58
|
+
'./models/users',
|
|
59
|
+
'./states/users'
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const locationStorage = new LocationStorage(
|
|
63
|
+
'./models/locations',
|
|
64
|
+
'./states/locations'
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const itemStorage = new ItemStorage(
|
|
68
|
+
'./states/items' // Only state path needed for items
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const gimmickStorage = new GimmickStorage(
|
|
72
|
+
'./states/gimmicks' // Only state path needed for gimmicks
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// Initialize with existing data
|
|
76
|
+
await agentStorage.initialize(['samo', 'nyx']); // Load samo.json and nyx.json
|
|
77
|
+
await userStorage.initialize(['lucid']); // Load lucid.json
|
|
78
|
+
await locationStorage.initialize(['empty']);
|
|
79
|
+
await itemStorage.initialize(['agent:1', 'user:1']); // Initialize inventories
|
|
80
|
+
await gimmickStorage.initialize([1]); // Initialize gimmicks for location
|
|
81
|
+
|
|
82
|
+
// Initialize WorldManager with all repositories
|
|
83
|
+
WorldManager.initialize({
|
|
84
|
+
agentRepository: agentStorage,
|
|
85
|
+
gimmickRepository: gimmickStorage,
|
|
86
|
+
itemRepository: itemStorage,
|
|
87
|
+
locationRepository: locationStorage,
|
|
88
|
+
userRepository: userStorage,
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Environment Configuration
|
|
93
|
+
|
|
94
|
+
To use LLM features, you need to configure API keys for the supported platforms. Set the following environment variables:
|
|
95
|
+
|
|
96
|
+
- **OpenAI**: `OPENAI_API_KEY=your_openai_api_key`
|
|
97
|
+
- **Gemini**: `GEMINI_API_KEY=your_gemini_api_key`
|
|
98
|
+
- **Anthropic**: `ANTHROPIC_API_KEY=your_anthropic_api_key`
|
|
99
|
+
|
|
100
|
+
You can set these in several ways:
|
|
101
|
+
|
|
102
|
+
- Set environment variables directly: `OPENAI_API_KEY=sk-... node your-app.js`
|
|
103
|
+
- Use dotenv package with a `.env` file:
|
|
104
|
+
```
|
|
105
|
+
OPENAI_API_KEY=sk-...
|
|
106
|
+
GEMINI_API_KEY=AI...
|
|
107
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
108
|
+
```
|
|
109
|
+
- Set them in your system environment
|
|
110
|
+
|
|
111
|
+
**Note**: Currently, API keys are shared across all users. In a production environment, you would typically store user-specific API keys.
|
|
112
|
+
|
|
113
|
+
## File Structure
|
|
114
|
+
|
|
115
|
+
The storage system expects the following directory structure:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
your-project/
|
|
119
|
+
├── models/
|
|
120
|
+
│ ├── agents/
|
|
121
|
+
│ │ ├── samo.json
|
|
122
|
+
│ │ └── nyx.json
|
|
123
|
+
│ ├── users/
|
|
124
|
+
│ │ └── lucid.json
|
|
125
|
+
│ └── locations/
|
|
126
|
+
│ └── empty.json
|
|
127
|
+
└── states/
|
|
128
|
+
├── agents/
|
|
129
|
+
│ ├── samo.json
|
|
130
|
+
│ └── nyx.json
|
|
131
|
+
├── users/
|
|
132
|
+
│ └── lucid.json
|
|
133
|
+
├── locations/
|
|
134
|
+
│ └── empty.json
|
|
135
|
+
├── items/
|
|
136
|
+
│ ├── items_agent_1.json
|
|
137
|
+
│ └── items_user_1.json
|
|
138
|
+
└── gimmicks/
|
|
139
|
+
└── gimmicks_1.json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
- **models/**: Static entity definitions (agents, users, locations only) - **Must be created manually**
|
|
143
|
+
- **states/**: Dynamic runtime data that changes during execution - **Created automatically if missing**
|
|
144
|
+
- **items/**: Inventory data per entity (format: `items_{entityType}_{entityId}.json`)
|
|
145
|
+
- **gimmicks/**: Gimmick states per location (format: `gimmicks_{locationId}.json`)
|
|
146
|
+
|
|
147
|
+
**Note**: Items and gimmicks don't have model files - they are created and managed entirely through the state files. The `states/` directories will be automatically created during initialization if they don't exist.
|
|
148
|
+
|
|
37
149
|
## Learn More
|
|
38
150
|
|
|
39
151
|
- [SamoAI Core Library](https://github.com/little-samo/SamoAI) - The main SamoAI framework
|
|
40
|
-
- [SamoAI Example CLI](https://github.com/little-samo/SamoAI-Example-CLI) - Example implementation
|
|
152
|
+
- [SamoAI Example CLI](https://github.com/little-samo/SamoAI-Example-CLI) - Example implementation using this storage library
|
|
41
153
|
|
|
42
154
|
## License
|
|
43
155
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { AgentId, UserId } from '@little-samo/samo-ai';
|
|
2
2
|
import { AgentConfig } from '@little-samo/samo-ai-sdk/models';
|
|
3
|
-
|
|
3
|
+
import { EntityDto } from '../entity';
|
|
4
|
+
export interface AgentDto extends EntityDto {
|
|
5
|
+
id: AgentId;
|
|
6
|
+
}
|
|
7
|
+
export interface AgentPrivateDto {
|
|
4
8
|
id: AgentId;
|
|
5
9
|
name: string;
|
|
6
|
-
|
|
10
|
+
username: string | null;
|
|
7
11
|
ownerUserId: UserId;
|
|
8
|
-
}
|
|
9
|
-
export interface AgentPrivateDto extends AgentPublicDto {
|
|
10
12
|
config: AgentConfig;
|
|
11
13
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { AgentConfig } from '@little-samo/samo-ai-sdk/models';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
import { AgentPrivateDto
|
|
2
|
+
import { AgentPrivateDto } from './agent';
|
|
4
3
|
import { AgentPresetDto } from './agent.preset';
|
|
5
4
|
export declare const AgentsPaginationQuerySchema: z.ZodObject<{
|
|
6
5
|
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7
6
|
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
8
7
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
limit: number;
|
|
10
8
|
page: number;
|
|
9
|
+
limit: number;
|
|
11
10
|
}, {
|
|
12
|
-
limit?: number | undefined;
|
|
13
11
|
page?: number | undefined;
|
|
12
|
+
limit?: number | undefined;
|
|
14
13
|
}>;
|
|
15
14
|
export type AgentsPaginationQueryDto = z.infer<typeof AgentsPaginationQuerySchema>;
|
|
16
15
|
export interface AgentsPaginatedResponseDto {
|
|
@@ -22,20 +21,6 @@ export interface AgentsPaginatedResponseDto {
|
|
|
22
21
|
totalPages: number;
|
|
23
22
|
};
|
|
24
23
|
}
|
|
25
|
-
export declare const GetAgentsByIdsQuerySchema: z.ZodObject<{
|
|
26
|
-
agentIds: z.ZodEffects<z.ZodEffects<z.ZodString, bigint[], string>, bigint[], string>;
|
|
27
|
-
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
agentIds: bigint[];
|
|
29
|
-
}, {
|
|
30
|
-
agentIds: string;
|
|
31
|
-
}>;
|
|
32
|
-
export type GetAgentsByIdsQueryDto = z.infer<typeof GetAgentsByIdsQuerySchema>;
|
|
33
|
-
export interface GetAgentPublicsByIdsResponseDto {
|
|
34
|
-
agents: AgentPublicDto[];
|
|
35
|
-
}
|
|
36
|
-
export interface GetAgentPrivatesByIdsResponseDto {
|
|
37
|
-
agents: AgentPrivateDto[];
|
|
38
|
-
}
|
|
39
24
|
export declare const AgentUpdateConfigSchema: z.ZodObject<{
|
|
40
25
|
agentId: z.ZodBigInt;
|
|
41
26
|
config: z.ZodObject<{
|
|
@@ -221,14 +206,13 @@ export declare const AgentUpdateConfigSchema: z.ZodObject<{
|
|
|
221
206
|
}, z.ZodOptional<z.ZodString>, "strip">>>;
|
|
222
207
|
}, z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodObject<{}, "strip", z.ZodOptional<z.ZodString>, z.objectOutputType<{}, z.ZodOptional<z.ZodString>, "strip">, z.objectInputType<{}, z.ZodOptional<z.ZodString>, "strip">>]>, "strip">>>>;
|
|
223
208
|
rules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
224
|
-
}, "
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
210
|
name?: string | undefined;
|
|
211
|
+
avatar?: string | undefined;
|
|
212
|
+
appearance?: string | undefined;
|
|
226
213
|
core?: {
|
|
227
214
|
name: "evaluate_and_actions" | "execute_actions" | "response_every_message";
|
|
228
215
|
} | undefined;
|
|
229
|
-
appearance?: string | undefined;
|
|
230
|
-
rules?: string[] | undefined;
|
|
231
|
-
avatar?: string | undefined;
|
|
232
216
|
llmPreset?: "gemini-low" | "gemini-medium" | "gemini-high" | "openai-low" | "openai-medium" | "anthropic-low" | "anthropic-medium" | "anthropic-high" | "deepseek-low" | "deepseek-medium" | undefined;
|
|
233
217
|
languages?: string[] | undefined;
|
|
234
218
|
timeZone?: string | undefined;
|
|
@@ -290,14 +274,14 @@ export declare const AgentUpdateConfigSchema: z.ZodObject<{
|
|
|
290
274
|
mbti: z.ZodOptional<z.ZodString>;
|
|
291
275
|
}, z.ZodOptional<z.ZodString>, "strip">>>;
|
|
292
276
|
}, z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodObject<{}, "strip", z.ZodOptional<z.ZodString>, z.objectOutputType<{}, z.ZodOptional<z.ZodString>, "strip">, z.objectInputType<{}, z.ZodOptional<z.ZodString>, "strip">>]>, "strip"> | undefined;
|
|
277
|
+
rules?: string[] | undefined;
|
|
293
278
|
}, {
|
|
294
279
|
name?: string | undefined;
|
|
280
|
+
avatar?: string | undefined;
|
|
281
|
+
appearance?: string | undefined;
|
|
295
282
|
core?: {
|
|
296
283
|
name: "evaluate_and_actions" | "execute_actions" | "response_every_message";
|
|
297
284
|
} | undefined;
|
|
298
|
-
appearance?: string | undefined;
|
|
299
|
-
rules?: string[] | undefined;
|
|
300
|
-
avatar?: string | undefined;
|
|
301
285
|
llmPreset?: "gemini-low" | "gemini-medium" | "gemini-high" | "openai-low" | "openai-medium" | "anthropic-low" | "anthropic-medium" | "anthropic-high" | "deepseek-low" | "deepseek-medium" | undefined;
|
|
302
286
|
languages?: string[] | undefined;
|
|
303
287
|
timeZone?: string | undefined;
|
|
@@ -359,17 +343,17 @@ export declare const AgentUpdateConfigSchema: z.ZodObject<{
|
|
|
359
343
|
mbti: z.ZodOptional<z.ZodString>;
|
|
360
344
|
}, z.ZodOptional<z.ZodString>, "strip">>>;
|
|
361
345
|
}, z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodObject<{}, "strip", z.ZodOptional<z.ZodString>, z.objectOutputType<{}, z.ZodOptional<z.ZodString>, "strip">, z.objectInputType<{}, z.ZodOptional<z.ZodString>, "strip">>]>, "strip"> | undefined;
|
|
346
|
+
rules?: string[] | undefined;
|
|
362
347
|
}>;
|
|
363
348
|
}, "strip", z.ZodTypeAny, {
|
|
364
349
|
agentId: bigint;
|
|
365
350
|
config: {
|
|
366
351
|
name?: string | undefined;
|
|
352
|
+
avatar?: string | undefined;
|
|
353
|
+
appearance?: string | undefined;
|
|
367
354
|
core?: {
|
|
368
355
|
name: "evaluate_and_actions" | "execute_actions" | "response_every_message";
|
|
369
356
|
} | undefined;
|
|
370
|
-
appearance?: string | undefined;
|
|
371
|
-
rules?: string[] | undefined;
|
|
372
|
-
avatar?: string | undefined;
|
|
373
357
|
llmPreset?: "gemini-low" | "gemini-medium" | "gemini-high" | "openai-low" | "openai-medium" | "anthropic-low" | "anthropic-medium" | "anthropic-high" | "deepseek-low" | "deepseek-medium" | undefined;
|
|
374
358
|
languages?: string[] | undefined;
|
|
375
359
|
timeZone?: string | undefined;
|
|
@@ -431,17 +415,17 @@ export declare const AgentUpdateConfigSchema: z.ZodObject<{
|
|
|
431
415
|
mbti: z.ZodOptional<z.ZodString>;
|
|
432
416
|
}, z.ZodOptional<z.ZodString>, "strip">>>;
|
|
433
417
|
}, z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodObject<{}, "strip", z.ZodOptional<z.ZodString>, z.objectOutputType<{}, z.ZodOptional<z.ZodString>, "strip">, z.objectInputType<{}, z.ZodOptional<z.ZodString>, "strip">>]>, "strip"> | undefined;
|
|
418
|
+
rules?: string[] | undefined;
|
|
434
419
|
};
|
|
435
420
|
}, {
|
|
436
421
|
agentId: bigint;
|
|
437
422
|
config: {
|
|
438
423
|
name?: string | undefined;
|
|
424
|
+
avatar?: string | undefined;
|
|
425
|
+
appearance?: string | undefined;
|
|
439
426
|
core?: {
|
|
440
427
|
name: "evaluate_and_actions" | "execute_actions" | "response_every_message";
|
|
441
428
|
} | undefined;
|
|
442
|
-
appearance?: string | undefined;
|
|
443
|
-
rules?: string[] | undefined;
|
|
444
|
-
avatar?: string | undefined;
|
|
445
429
|
llmPreset?: "gemini-low" | "gemini-medium" | "gemini-high" | "openai-low" | "openai-medium" | "anthropic-low" | "anthropic-medium" | "anthropic-high" | "deepseek-low" | "deepseek-medium" | undefined;
|
|
446
430
|
languages?: string[] | undefined;
|
|
447
431
|
timeZone?: string | undefined;
|
|
@@ -503,19 +487,19 @@ export declare const AgentUpdateConfigSchema: z.ZodObject<{
|
|
|
503
487
|
mbti: z.ZodOptional<z.ZodString>;
|
|
504
488
|
}, z.ZodOptional<z.ZodString>, "strip">>>;
|
|
505
489
|
}, z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodObject<{}, "strip", z.ZodOptional<z.ZodString>, z.objectOutputType<{}, z.ZodOptional<z.ZodString>, "strip">, z.objectInputType<{}, z.ZodOptional<z.ZodString>, "strip">>]>, "strip"> | undefined;
|
|
490
|
+
rules?: string[] | undefined;
|
|
506
491
|
};
|
|
507
492
|
}>;
|
|
508
493
|
export type AgentUpdateConfigDto = z.infer<typeof AgentUpdateConfigSchema>;
|
|
509
|
-
export type AgentUpdateConfigResponseDto = Partial<AgentConfig>;
|
|
510
494
|
export declare const AgentPresetsPaginationQuerySchema: z.ZodObject<{
|
|
511
495
|
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
512
496
|
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
513
497
|
}, "strip", z.ZodTypeAny, {
|
|
514
|
-
limit: number;
|
|
515
498
|
page: number;
|
|
499
|
+
limit: number;
|
|
516
500
|
}, {
|
|
517
|
-
limit?: number | undefined;
|
|
518
501
|
page?: number | undefined;
|
|
502
|
+
limit?: number | undefined;
|
|
519
503
|
}>;
|
|
520
504
|
export type AgentPresetsPaginationQueryDto = z.infer<typeof AgentPresetsPaginationQuerySchema>;
|
|
521
505
|
export interface AgentPresetsPaginatedResponseDto {
|
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetHelperAgentSchema = exports.CreateAgentFromPresetSchema = exports.AgentPresetsPaginationQuerySchema = exports.AgentUpdateConfigSchema = exports.
|
|
3
|
+
exports.GetHelperAgentSchema = exports.CreateAgentFromPresetSchema = exports.AgentPresetsPaginationQuerySchema = exports.AgentUpdateConfigSchema = exports.AgentsPaginationQuerySchema = void 0;
|
|
4
4
|
const models_1 = require("@little-samo/samo-ai-sdk/models");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
exports.AgentsPaginationQuerySchema = zod_1.z.object({
|
|
7
7
|
page: zod_1.z.coerce.number().int().min(1).optional().default(1),
|
|
8
8
|
limit: zod_1.z.coerce.number().int().min(1).max(100).optional().default(10),
|
|
9
9
|
});
|
|
10
|
-
exports.GetAgentsByIdsQuerySchema = zod_1.z.object({
|
|
11
|
-
agentIds: zod_1.z
|
|
12
|
-
.string()
|
|
13
|
-
.transform((val) => val.split(',').map((id) => BigInt(id.trim())))
|
|
14
|
-
.refine((arr) => arr.length > 0 && arr.length <= 25, {
|
|
15
|
-
message: 'agentIds must contain 1-25 agent IDs',
|
|
16
|
-
}),
|
|
17
|
-
});
|
|
18
10
|
exports.AgentUpdateConfigSchema = zod_1.z.object({
|
|
19
|
-
agentId: zod_1.z.
|
|
20
|
-
config: models_1.AgentConfigSchema.partial()
|
|
21
|
-
.strict()
|
|
22
|
-
.describe('Only the specific configuration fields that need to be updated (name, avatar, core, etc.)'),
|
|
11
|
+
agentId: zod_1.z.bigint(),
|
|
12
|
+
config: models_1.AgentConfigSchema.partial(),
|
|
23
13
|
});
|
|
24
14
|
exports.AgentPresetsPaginationQuerySchema = zod_1.z.object({
|
|
25
15
|
page: zod_1.z.coerce.number().int().min(1).optional().default(1),
|
|
26
16
|
limit: zod_1.z.coerce.number().int().min(1).max(100).optional().default(20),
|
|
27
17
|
});
|
|
28
18
|
exports.CreateAgentFromPresetSchema = zod_1.z.object({
|
|
29
|
-
presetId: zod_1.z.
|
|
19
|
+
presetId: zod_1.z.bigint(),
|
|
30
20
|
});
|
|
31
21
|
exports.GetHelperAgentSchema = zod_1.z.object({
|
|
32
22
|
helperType: zod_1.z.nativeEnum(models_1.AgentHelperType),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.requests.js","sourceRoot":"","sources":["../../../../src/dto/entities/agents/agent.requests.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"agent.requests.js","sourceRoot":"","sources":["../../../../src/dto/entities/agents/agent.requests.ts"],"names":[],"mappings":";;;AAAA,4DAGyC;AACzC,6BAAwB;AAKX,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACtE,CAAC,CAAC;AAgBU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,0BAAiB,CAAC,OAAO,EAAE;CACpC,CAAC,CAAC;AAIU,QAAA,iCAAiC,GAAG,OAAC,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACtE,CAAC,CAAC;AAgBU,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAUU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,UAAU,EAAE,OAAC,CAAC,UAAU,CAAC,wBAAe,CAAC;CAC1C,CAAC,CAAC"}
|
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./agents"), exports);
|
|
18
18
|
__exportStar(require("./users"), exports);
|
|
19
|
+
__exportStar(require("./entity"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB"}
|
|
@@ -15,6 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./user.events"), exports);
|
|
18
|
-
__exportStar(require("./user.requests"), exports);
|
|
19
18
|
__exportStar(require("./user"), exports);
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/entities/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/entities/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,yCAAuB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AgentDto, UserDto } from '../entities';
|
|
2
2
|
export interface ItemRankingDto {
|
|
3
3
|
rank: number;
|
|
4
|
-
ownerAgent?:
|
|
5
|
-
ownerUser?:
|
|
4
|
+
ownerAgent?: AgentDto;
|
|
5
|
+
ownerUser?: UserDto;
|
|
6
6
|
count: number;
|
|
7
7
|
}
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./location.events"), exports);
|
|
18
|
-
__exportStar(require("./location.
|
|
18
|
+
__exportStar(require("./location.messages"), exports);
|
|
19
19
|
__exportStar(require("./location.preset"), exports);
|
|
20
20
|
__exportStar(require("./location.requests"), exports);
|
|
21
21
|
__exportStar(require("./location.states"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/locations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/locations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,sDAAoC;AACpC,oDAAkC;AAClC,sDAAoC;AACpC,oDAAkC;AAClC,6CAA2B"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LocationConfig
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { LocationId } from '@little-samo/samo-ai';
|
|
2
|
+
import { LocationConfig } from '@little-samo/samo-ai-sdk/models';
|
|
3
|
+
import { AgentDto, UserDto } from '../entities';
|
|
4
|
+
import { LocationMessageDto } from './location.messages';
|
|
5
|
+
export interface LocationMessagesDto {
|
|
5
6
|
id: LocationId;
|
|
6
7
|
name: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
users: UserDto[];
|
|
9
|
+
agents: AgentDto[];
|
|
10
|
+
messages: LocationMessageDto[];
|
|
11
|
+
messageCursor?: string;
|
|
11
12
|
}
|
|
12
|
-
export interface
|
|
13
|
+
export interface LocationBasicDto {
|
|
14
|
+
id: LocationId;
|
|
15
|
+
name: string;
|
|
16
|
+
platform: string;
|
|
17
|
+
type: string;
|
|
13
18
|
config: LocationConfig;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
lastMessage: LocationMessageDto | null;
|
|
17
|
-
unreadCount: number;
|
|
18
|
-
agentIds: AgentId[];
|
|
19
|
-
userIds: UserId[];
|
|
20
|
-
gimmickCount: number;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LocationMessageDto } from './location.
|
|
1
|
+
import { UserId } from '@little-samo/samo-ai';
|
|
2
|
+
import { UserDto } from '../entities';
|
|
3
|
+
import { LocationMessageDto } from './location.messages';
|
|
4
4
|
export declare const LocationEventType: {
|
|
5
5
|
readonly AgentExecution: "AgentExecution";
|
|
6
6
|
readonly UserJoin: "UserJoin";
|
|
@@ -10,8 +10,7 @@ export declare const LocationEventType: {
|
|
|
10
10
|
};
|
|
11
11
|
export type LocationEventType = (typeof LocationEventType)[keyof typeof LocationEventType];
|
|
12
12
|
export interface LocationEventDtoBase {
|
|
13
|
-
locationId:
|
|
14
|
-
userIds?: UserId[];
|
|
13
|
+
locationId: number;
|
|
15
14
|
type: LocationEventType;
|
|
16
15
|
}
|
|
17
16
|
export interface LocationRenderingUpdatedEventDto extends LocationEventDtoBase {
|
|
@@ -24,7 +23,7 @@ export interface LocationAgentExecutionEventDto extends LocationEventDtoBase {
|
|
|
24
23
|
}
|
|
25
24
|
export interface LocationUserJoinEventDto extends LocationEventDtoBase {
|
|
26
25
|
type: typeof LocationEventType.UserJoin;
|
|
27
|
-
user:
|
|
26
|
+
user: UserDto;
|
|
28
27
|
}
|
|
29
28
|
export interface LocationUserLeaveEventDto extends LocationEventDtoBase {
|
|
30
29
|
type: typeof LocationEventType.UserLeave;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityId, EntityType
|
|
1
|
+
import { EntityId, EntityType } from '@little-samo/samo-ai';
|
|
2
2
|
export interface LocationMessageDto {
|
|
3
3
|
entityType: EntityType;
|
|
4
4
|
entityId: EntityId;
|
|
@@ -11,4 +11,3 @@ export interface LocationMessageDto {
|
|
|
11
11
|
createdAt: Date;
|
|
12
12
|
updatedAt: Date;
|
|
13
13
|
}
|
|
14
|
-
export declare function convertLocationMessageToDto(message: LocationMessage): LocationMessageDto;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertLocationMessageToDto = convertLocationMessageToDto;
|
|
4
|
-
function convertLocationMessageToDto(message) {
|
|
5
|
-
return {
|
|
6
|
-
entityType: message.entityType,
|
|
7
|
-
entityId: message.entityId,
|
|
8
|
-
name: message.name,
|
|
9
|
-
expression: message.expression,
|
|
10
|
-
message: message.message,
|
|
11
|
-
action: message.action,
|
|
12
|
-
emotion: message.emotion,
|
|
13
|
-
image: message.image,
|
|
14
|
-
createdAt: message.createdAt,
|
|
15
|
-
updatedAt: message.updatedAt,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
3
|
//# sourceMappingURL=location.messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.messages.js","sourceRoot":"","sources":["../../../src/dto/locations/location.messages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"location.messages.js","sourceRoot":"","sources":["../../../src/dto/locations/location.messages.ts"],"names":[],"mappings":""}
|