@little-samo/samo-ai-sdk 0.1.0-rv2 → 0.1.0-rv3

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.
@@ -1,13 +1,10 @@
1
1
  import { AgentId, UserId } from '@little-samo/samo-ai';
2
2
  import { AgentConfig } from '@little-samo/samo-ai-sdk/models';
3
- import { EntityDto } from '../entity';
4
- export interface AgentDto extends EntityDto {
5
- id: AgentId;
6
- }
7
- export interface AgentPrivateDto {
3
+ export interface AgentPublicDto {
8
4
  id: AgentId;
9
5
  name: string;
10
- username: string | null;
11
6
  ownerUserId: UserId;
7
+ }
8
+ export interface AgentPrivateDto extends AgentPublicDto {
12
9
  config: AgentConfig;
13
10
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { AgentPrivateDto } from './agent';
2
+ import { AgentPrivateDto, AgentPublicDto } from './agent';
3
3
  import { AgentPresetDto } from './agent.preset';
4
4
  export declare const AgentsPaginationQuerySchema: z.ZodObject<{
5
5
  page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
@@ -21,6 +21,20 @@ export interface AgentsPaginatedResponseDto {
21
21
  totalPages: number;
22
22
  };
23
23
  }
24
+ export declare const GetAgentsByIdsQuerySchema: z.ZodObject<{
25
+ agentIds: z.ZodEffects<z.ZodEffects<z.ZodString, bigint[], string>, bigint[], string>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ agentIds: bigint[];
28
+ }, {
29
+ agentIds: string;
30
+ }>;
31
+ export type GetAgentsByIdsQueryDto = z.infer<typeof GetAgentsByIdsQuerySchema>;
32
+ export interface GetAgentPublicsByIdsResponseDto {
33
+ agents: AgentPublicDto[];
34
+ }
35
+ export interface GetAgentPrivatesByIdsResponseDto {
36
+ agents: AgentPrivateDto[];
37
+ }
24
38
  export declare const AgentUpdateConfigSchema: z.ZodObject<{
25
39
  agentId: z.ZodBigInt;
26
40
  config: z.ZodObject<{
@@ -1,14 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetHelperAgentSchema = exports.CreateAgentFromPresetSchema = exports.AgentPresetsPaginationQuerySchema = exports.AgentUpdateConfigSchema = exports.AgentsPaginationQuerySchema = void 0;
3
+ exports.GetHelperAgentSchema = exports.CreateAgentFromPresetSchema = exports.AgentPresetsPaginationQuerySchema = exports.AgentUpdateConfigSchema = exports.GetAgentsByIdsQuerySchema = 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
+ });
10
18
  exports.AgentUpdateConfigSchema = zod_1.z.object({
11
- agentId: zod_1.z.bigint(),
19
+ agentId: zod_1.z.coerce.bigint(),
12
20
  config: models_1.AgentConfigSchema.partial(),
13
21
  });
14
22
  exports.AgentPresetsPaginationQuerySchema = zod_1.z.object({
@@ -16,7 +24,7 @@ exports.AgentPresetsPaginationQuerySchema = zod_1.z.object({
16
24
  limit: zod_1.z.coerce.number().int().min(1).max(100).optional().default(20),
17
25
  });
18
26
  exports.CreateAgentFromPresetSchema = zod_1.z.object({
19
- presetId: zod_1.z.bigint(),
27
+ presetId: zod_1.z.coerce.bigint(),
20
28
  });
21
29
  exports.GetHelperAgentSchema = zod_1.z.object({
22
30
  helperType: zod_1.z.nativeEnum(models_1.AgentHelperType),
@@ -1 +1 @@
1
- {"version":3,"file":"agent.requests.js","sourceRoot":"","sources":["../../../../src/dto/entities/agents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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,CAAC,MAAM,EAAE;CAC5B,CAAC,CAAC;AAUU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,UAAU,EAAE,OAAC,CAAC,UAAU,CAAC,wBAAe,CAAC;CAC1C,CAAC,CAAC"}
@@ -1,3 +1,2 @@
1
1
  export * from './agents';
2
2
  export * from './users';
3
- export * from './entity';
@@ -16,5 +16,4 @@ 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);
20
19
  //# 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;AACxB,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB"}
@@ -1,2 +1,3 @@
1
1
  export * from './user.events';
2
+ export * from './user.requests';
2
3
  export * from './user';
@@ -15,5 +15,6 @@ 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);
18
19
  __exportStar(require("./user"), exports);
19
20
  //# 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,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/entities/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,yCAAuB"}
@@ -1,8 +1,4 @@
1
1
  import { UserId } from '@little-samo/samo-ai';
2
- import { EntityDto } from '../entity';
3
- export interface UserDto extends EntityDto {
4
- id: UserId;
5
- }
6
2
  export interface UserPublicDto {
7
3
  id: UserId;
8
4
  username: string | null;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { UserPublicDto } from './user';
3
+ export declare const GetUsersByIdsQuerySchema: z.ZodObject<{
4
+ userIds: z.ZodEffects<z.ZodEffects<z.ZodString, bigint[], string>, bigint[], string>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ userIds: bigint[];
7
+ }, {
8
+ userIds: string;
9
+ }>;
10
+ export type GetUsersByIdsQueryDto = z.infer<typeof GetUsersByIdsQuerySchema>;
11
+ export interface GetUserPublicsByIdsResponseDto {
12
+ users: UserPublicDto[];
13
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUsersByIdsQuerySchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.GetUsersByIdsQuerySchema = zod_1.z.object({
6
+ userIds: zod_1.z
7
+ .string()
8
+ .transform((val) => val.split(',').map((id) => BigInt(id.trim())))
9
+ .refine((arr) => arr.length > 0 && arr.length <= 25, {
10
+ message: 'userIds must contain 1-25 user IDs',
11
+ }),
12
+ });
13
+ //# sourceMappingURL=user.requests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.requests.js","sourceRoot":"","sources":["../../../../src/dto/entities/users/user.requests.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAIX,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SACjE,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE;QACnD,OAAO,EAAE,oCAAoC;KAC9C,CAAC;CACL,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
- import { AgentDto, UserDto } from '../entities';
1
+ import { AgentPublicDto, UserPublicDto } from '../entities';
2
2
  export interface ItemRankingDto {
3
3
  rank: number;
4
- ownerAgent?: AgentDto;
5
- ownerUser?: UserDto;
4
+ ownerAgent?: AgentPublicDto;
5
+ ownerUser?: UserPublicDto;
6
6
  count: number;
7
7
  }
@@ -1,12 +1,8 @@
1
1
  import { LocationId } from '@little-samo/samo-ai';
2
2
  import { LocationConfig } from '@little-samo/samo-ai-sdk/models';
3
- import { AgentDto, UserDto } from '../entities';
4
3
  import { LocationMessageDto } from './location.messages';
5
4
  export interface LocationMessagesDto {
6
5
  id: LocationId;
7
- name: string;
8
- users: UserDto[];
9
- agents: AgentDto[];
10
6
  messages: LocationMessageDto[];
11
7
  messageCursor?: string;
12
8
  }
@@ -1,5 +1,5 @@
1
1
  import { UserId } from '@little-samo/samo-ai';
2
- import { UserDto } from '../entities';
2
+ import { UserPublicDto } from '../entities';
3
3
  import { LocationMessageDto } from './location.messages';
4
4
  export declare const LocationEventType: {
5
5
  readonly AgentExecution: "AgentExecution";
@@ -11,6 +11,7 @@ export declare const LocationEventType: {
11
11
  export type LocationEventType = (typeof LocationEventType)[keyof typeof LocationEventType];
12
12
  export interface LocationEventDtoBase {
13
13
  locationId: number;
14
+ userIds?: UserId[];
14
15
  type: LocationEventType;
15
16
  }
16
17
  export interface LocationRenderingUpdatedEventDto extends LocationEventDtoBase {
@@ -23,7 +24,7 @@ export interface LocationAgentExecutionEventDto extends LocationEventDtoBase {
23
24
  }
24
25
  export interface LocationUserJoinEventDto extends LocationEventDtoBase {
25
26
  type: typeof LocationEventType.UserJoin;
26
- user: UserDto;
27
+ user: UserPublicDto;
27
28
  }
28
29
  export interface LocationUserLeaveEventDto extends LocationEventDtoBase {
29
30
  type: typeof LocationEventType.UserLeave;
@@ -1,4 +1,4 @@
1
- import { EntityId, EntityType } from '@little-samo/samo-ai';
1
+ import { EntityId, EntityType, LocationMessage } from '@little-samo/samo-ai';
2
2
  export interface LocationMessageDto {
3
3
  entityType: EntityType;
4
4
  entityId: EntityId;
@@ -11,3 +11,4 @@ export interface LocationMessageDto {
11
11
  createdAt: Date;
12
12
  updatedAt: Date;
13
13
  }
14
+ export declare function convertLocationMessageToDto(message: LocationMessage): LocationMessageDto;
@@ -1,3 +1,18 @@
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
+ }
3
18
  //# 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":";;AAeA,kEAeC;AAfD,SAAgB,2BAA2B,CACzC,OAAwB;IAExB,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC;AACJ,CAAC"}
@@ -2,26 +2,64 @@ import { z } from 'zod';
2
2
  import { LocationBasicDto } from './location';
3
3
  import { LocationMessageDto } from './location.messages';
4
4
  import { LocationPresetDto } from './location.preset';
5
- export declare const LocationsPaginationQuerySchema: z.ZodObject<{
6
- page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7
- limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
5
+ export declare const UserLocationsQuerySchema: z.ZodObject<{
6
+ cursor: z.ZodOptional<z.ZodString>;
7
+ limit: z.ZodDefault<z.ZodNumber>;
8
8
  }, "strip", z.ZodTypeAny, {
9
- page: number;
10
9
  limit: number;
10
+ cursor?: string | undefined;
11
11
  }, {
12
- page?: number | undefined;
13
12
  limit?: number | undefined;
13
+ cursor?: string | undefined;
14
14
  }>;
15
- export type LocationsPaginationQueryDto = z.infer<typeof LocationsPaginationQuerySchema>;
16
- export interface LocationsPaginatedResponseDto {
17
- data: LocationBasicDto[];
15
+ export type UserLocationsQueryDto = z.infer<typeof UserLocationsQuerySchema>;
16
+ export interface UserLocationItemDto {
17
+ location: LocationBasicDto;
18
+ lastMessage: LocationMessageDto | null;
19
+ unreadCount: number;
20
+ }
21
+ export interface UserLocationsResponseDto {
22
+ data: UserLocationItemDto[];
18
23
  meta: {
19
24
  total: number;
20
- page: number;
21
- limit: number;
22
- totalPages: number;
25
+ nextCursor?: string;
23
26
  };
24
27
  }
28
+ export declare const MarkLocationAsReadParamsSchema: z.ZodObject<{
29
+ locationId: z.ZodEffects<z.ZodString, bigint, string>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ locationId: bigint;
32
+ }, {
33
+ locationId: string;
34
+ }>;
35
+ export type MarkLocationAsReadParamsDto = z.infer<typeof MarkLocationAsReadParamsSchema>;
36
+ export declare const LocationUnreadCountParamsSchema: z.ZodObject<{
37
+ locationId: z.ZodEffects<z.ZodString, bigint, string>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ locationId: bigint;
40
+ }, {
41
+ locationId: string;
42
+ }>;
43
+ export type LocationUnreadCountParamsDto = z.infer<typeof LocationUnreadCountParamsSchema>;
44
+ export interface LocationUnreadCountResponseDto {
45
+ unreadCount: number;
46
+ }
47
+ export declare const LocationsUnreadCountQuerySchema: z.ZodObject<{
48
+ locationIds: z.ZodEffects<z.ZodEffects<z.ZodString, bigint[], string>, bigint[], string>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ locationIds: bigint[];
51
+ }, {
52
+ locationIds: string;
53
+ }>;
54
+ export type LocationsUnreadCountQueryDto = z.infer<typeof LocationsUnreadCountQuerySchema>;
55
+ export interface LocationUnreadCountItemDto {
56
+ locationId: bigint;
57
+ unreadCount: number;
58
+ lastMessage: LocationMessageDto | null;
59
+ }
60
+ export interface LocationsUnreadCountResponseDto {
61
+ data: LocationUnreadCountItemDto[];
62
+ }
25
63
  export interface LocationMessagesResponseDto {
26
64
  messages: LocationMessageDto[];
27
65
  cursor?: string;
@@ -1,27 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetLocationHelperLocationSchema = exports.GetAgentHelperLocationSchema = exports.LocationUpdateConfigSchema = exports.CreateLocationFromPresetSchema = exports.LocationPresetsPaginationQuerySchema = exports.LocationsPaginationQuerySchema = void 0;
3
+ exports.GetLocationHelperLocationSchema = exports.GetAgentHelperLocationSchema = exports.LocationUpdateConfigSchema = exports.CreateLocationFromPresetSchema = exports.LocationPresetsPaginationQuerySchema = exports.LocationsUnreadCountQuerySchema = exports.LocationUnreadCountParamsSchema = exports.MarkLocationAsReadParamsSchema = exports.UserLocationsQuerySchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const location_config_1 = require("../../models/locations/location.config");
6
- exports.LocationsPaginationQuerySchema = zod_1.z.object({
7
- page: zod_1.z.coerce.number().int().min(1).optional().default(1),
8
- limit: zod_1.z.coerce.number().int().min(1).max(100).optional().default(10),
6
+ exports.UserLocationsQuerySchema = zod_1.z.object({
7
+ cursor: zod_1.z.string().optional().describe('Pagination cursor for next page'),
8
+ limit: zod_1.z.coerce
9
+ .number()
10
+ .min(1)
11
+ .max(10)
12
+ .default(10)
13
+ .describe('Number of locations to return'),
14
+ });
15
+ exports.MarkLocationAsReadParamsSchema = zod_1.z.object({
16
+ locationId: zod_1.z.string().transform((val) => BigInt(val)),
17
+ });
18
+ exports.LocationUnreadCountParamsSchema = zod_1.z.object({
19
+ locationId: zod_1.z.string().transform((val) => BigInt(val)),
20
+ });
21
+ exports.LocationsUnreadCountQuerySchema = zod_1.z.object({
22
+ locationIds: zod_1.z
23
+ .string()
24
+ .transform((val) => val.split(',').map((id) => BigInt(id.trim())))
25
+ .refine((arr) => arr.length > 0 && arr.length <= 10, {
26
+ message: 'locationIds must contain 1-10 location IDs',
27
+ }),
9
28
  });
10
29
  exports.LocationPresetsPaginationQuerySchema = zod_1.z.object({
11
30
  page: zod_1.z.coerce.number().int().min(1).optional().default(1),
12
31
  limit: zod_1.z.coerce.number().int().min(1).max(100).optional().default(20),
13
32
  });
14
33
  exports.CreateLocationFromPresetSchema = zod_1.z.object({
15
- presetId: zod_1.z.bigint(),
34
+ presetId: zod_1.z.coerce.bigint(),
16
35
  });
17
36
  exports.LocationUpdateConfigSchema = zod_1.z.object({
18
- locationId: zod_1.z.bigint(),
19
- config: location_config_1.LocationConfigSchema.partial(),
37
+ locationId: zod_1.z.coerce.bigint().describe('ID of the location to update'),
38
+ config: location_config_1.LocationConfigSchema.partial().describe('Only the specific configuration fields that need to be updated (name, environment, core, description, etc.)'),
20
39
  });
21
40
  exports.GetAgentHelperLocationSchema = zod_1.z.object({
22
- agentId: zod_1.z.bigint(),
41
+ agentId: zod_1.z.coerce.bigint(),
23
42
  });
24
43
  exports.GetLocationHelperLocationSchema = zod_1.z.object({
25
- locationId: zod_1.z.bigint(),
44
+ locationId: zod_1.z.coerce.bigint(),
26
45
  });
27
46
  //# sourceMappingURL=location.requests.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"location.requests.js","sourceRoot":"","sources":["../../../src/dto/locations/location.requests.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,4EAA8E;AAMjE,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,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;AAqBU,QAAA,oCAAoC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3D,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CA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E,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE;CAC5B,CAAC,CAAC;AAUU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACtE,MAAM,EAAE,sCAAoB,CAAC,OAAO,EAAE,CAAC,QAAQ,CAC7C,6GAA6G,CAC9G;CACF,CAAC,CAAC;AAMU,QAAA,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IACnD,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE;CAC3B,CAAC,CAAC;AAUU,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACtD,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE;CAC9B,CAAC,CAAC"}
@@ -69,12 +69,12 @@ export declare const LocationConfigSchema: z.ZodObject<{
69
69
  }, "strip", z.ZodTypeAny, {
70
70
  name: string;
71
71
  description: string;
72
+ environment: "CHAT" | "WEB_BROWSER";
72
73
  core: {
73
74
  name: "round_robin" | "update_forever" | "update_once";
74
75
  sequential?: boolean | undefined;
75
76
  };
76
77
  rules: string[];
77
- environment: "CHAT" | "WEB_BROWSER";
78
78
  canvases: {
79
79
  name: string;
80
80
  description: string;
@@ -89,12 +89,12 @@ export declare const LocationConfigSchema: z.ZodObject<{
89
89
  }, {
90
90
  name: string;
91
91
  description: string;
92
+ environment: "CHAT" | "WEB_BROWSER";
92
93
  core: {
93
94
  name: "round_robin" | "update_forever" | "update_once";
94
95
  sequential?: boolean | undefined;
95
96
  };
96
97
  rules: string[];
97
- environment: "CHAT" | "WEB_BROWSER";
98
98
  canvases: {
99
99
  name: string;
100
100
  description: string;
@@ -108,4 +108,3 @@ export declare const LocationConfigSchema: z.ZodObject<{
108
108
  thumbnail?: string | undefined;
109
109
  }>;
110
110
  export type LocationConfig = z.infer<typeof LocationConfigSchema>;
111
- export declare const DEFAULT_LOCATION_CONFIG: LocationConfig;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_LOCATION_CONFIG = exports.LocationConfigSchema = exports.LocationConfigCanvasSchema = exports.LocationConfigCoreSchema = exports.LocationEnvironmentSchema = void 0;
3
+ exports.LocationConfigSchema = exports.LocationConfigCanvasSchema = exports.LocationConfigCoreSchema = exports.LocationEnvironmentSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const location_constants_1 = require("./location.constants");
6
6
  exports.LocationEnvironmentSchema = zod_1.z.union([
@@ -55,21 +55,4 @@ exports.LocationConfigSchema = zod_1.z.object({
55
55
  .max(4)
56
56
  .describe('Private agent canvases for individual agent use, separate per location context'),
57
57
  });
58
- exports.DEFAULT_LOCATION_CONFIG = {
59
- name: 'Empty Location',
60
- environment: location_constants_1.LocationEnvironment.CHAT,
61
- core: {
62
- name: 'round_robin',
63
- },
64
- description: '',
65
- rules: [],
66
- canvases: [],
67
- agentCanvases: [
68
- {
69
- name: 'plan',
70
- description: 'Your private workspace for strategic thinking and task management. **Use this canvas CONSISTENTLY for any task requiring multiple steps, long-term tracking, or persistent information.** Break down complex goals into actionable steps (Plan-Do-Check-Act cycle recommended: 1. Outline steps, 2. Execute first step(s), 3. Check progress/results, 4. Adjust plan). Draft sequences of actions, list required resources, track progress, and refine strategies here before using tools. Keep it updated and organized to ensure effective execution.',
71
- maxLength: 1000,
72
- },
73
- ],
74
- };
75
58
  //# sourceMappingURL=location.config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"location.config.js","sourceRoot":"","sources":["../../../src/models/locations/location.config.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,6DAA2D;AAE9C,QAAA,yBAAyB,GAAG,OAAC,CAAC,KAAK,CAAC;IAC/C,OAAC;SACE,OAAO,CAAC,wCAAmB,CAAC,IAAI,CAAC;SACjC,QAAQ,CACP,oEAAoE,CACrE;IACH,OAAC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D,CAChE;IAED,IAAI,EAAE,gCAAwB,CAAC,QAAQ,CACrC,sFAAsF,CACvF;IACD,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CACP,kFAAkF,CACnF;IAEH,KAAK,EAAE,OAAC;SACL,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SAC1B,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,CACP,iFAAiF,CAClF;IAEH,QAAQ,EAAE,OAAC;SACR,KAAK,CAAC,kCAA0B,CAAC;SACjC,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,iFAAiF,CAClF;IACH,aAAa,EAAE,OAAC;SACb,KAAK,CAAC,kCAA0B,CAAC;SACjC,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,gFAAgF,CACjF;CACJ,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAmB;IACrD,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,wCAAmB,CAAC,IAAI;IAErC,IAAI,EAAE;QACJ,IAAI,EAAE,aAAa;KACpB;IACD,WAAW,EAAE,EAAE;IAEf,KAAK,EAAE,EAAE;IAET,QAAQ,EAAE,EAAE;IACZ,aAAa,EAAE;QACb;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EACT,yhBAAyhB;YAC3hB,SAAS,EAAE,IAAI;SAChB;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"location.config.js","sourceRoot":"","sources":["../../../src/models/locations/location.config.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,6DAA2D;AAE9C,QAAA,yBAAyB,GAAG,OAAC,CAAC,KAAK,CAAC;IAC/C,OAAC;SACE,OAAO,CAAC,wCAAmB,CAAC,IAAI,CAAC;SACjC,QAAQ,CACP,oEAAoE,CACrE;IACH,OAAC;SACE,OAAO,CAAC,wCAAmB,CAAC,WAAW,CAAC;SACxC,QAAQ,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sF,CACvF;IACD,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CACP,kFAAkF,CACnF;IAEH,KAAK,EAAE,OAAC;SACL,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SAC1B,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,CACP,iFAAiF,CAClF;IAEH,QAAQ,EAAE,OAAC;SACR,KAAK,CAAC,kCAA0B,CAAC;SACjC,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,iFAAiF,CAClF;IACH,aAAa,EAAE,OAAC;SACb,KAAK,CAAC,kCAA0B,CAAC;SACjC,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,gFAAgF,CACjF;CACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@little-samo/samo-ai-sdk",
3
- "version": "0.1.0-rv2",
3
+ "version": "0.1.0-rv3",
4
4
  "description": "SamoAI SDK",
5
5
  "license": "MIT",
6
6
  "repository": {