@swarmroom/shared 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.
@@ -0,0 +1,17 @@
1
+ export declare const MDNS_SERVICE_TYPE = "_swarmroom._tcp";
2
+ export declare const DEFAULT_PORT = 3000;
3
+ export declare const HEARTBEAT_INTERVAL_MS = 30000;
4
+ export declare const STALE_TIMEOUT_MS = 90000;
5
+ export declare const MAX_MESSAGE_SIZE_BYTES = 1048576;
6
+ export declare const WS_RECONNECT_DELAY_MS = 3000;
7
+ export declare const MCP_TOOL_NAMES: {
8
+ readonly LIST_AGENTS: "list_agents";
9
+ readonly GET_AGENT_INFO: "get_agent_info";
10
+ readonly SEND_MESSAGE: "send_message";
11
+ readonly GET_MESSAGES: "get_messages";
12
+ readonly QUERY_AGENT: "query_agent";
13
+ readonly LIST_TEAMS: "list_teams";
14
+ readonly LIST_PROJECTS: "list_projects";
15
+ };
16
+ export declare const DAEMON_KEY = "__daemon__";
17
+ export declare const DAEMON_SPAWN_COOLDOWN_MS = 60000;
@@ -0,0 +1,17 @@
1
+ export const MDNS_SERVICE_TYPE = '_swarmroom._tcp';
2
+ export const DEFAULT_PORT = 3000;
3
+ export const HEARTBEAT_INTERVAL_MS = 30_000;
4
+ export const STALE_TIMEOUT_MS = 90_000;
5
+ export const MAX_MESSAGE_SIZE_BYTES = 1_048_576; // 1MB
6
+ export const WS_RECONNECT_DELAY_MS = 3_000;
7
+ export const MCP_TOOL_NAMES = {
8
+ LIST_AGENTS: 'list_agents',
9
+ GET_AGENT_INFO: 'get_agent_info',
10
+ SEND_MESSAGE: 'send_message',
11
+ GET_MESSAGES: 'get_messages',
12
+ QUERY_AGENT: 'query_agent',
13
+ LIST_TEAMS: 'list_teams',
14
+ LIST_PROJECTS: 'list_projects',
15
+ };
16
+ export const DAEMON_KEY = '__daemon__';
17
+ export const DAEMON_SPAWN_COOLDOWN_MS = 60_000;
@@ -0,0 +1,8 @@
1
+ export { MDNS_SERVICE_TYPE, DEFAULT_PORT, HEARTBEAT_INTERVAL_MS, STALE_TIMEOUT_MS, MAX_MESSAGE_SIZE_BYTES, WS_RECONNECT_DELAY_MS, MCP_TOOL_NAMES, DAEMON_KEY, DAEMON_SPAWN_COOLDOWN_MS, } from './constants.js';
2
+ export { type AgentStatus, type Skill, type AgentCard, type Agent, type RegisterAgentRequest, type HeartbeatRequest, AgentStatusSchema, SkillSchema, AgentCardSchema, AgentSchema, RegisterAgentRequestSchema, HeartbeatRequestSchema, } from './types/agent.js';
3
+ export { type MessageType, type SenderType, type Message, type SendMessageRequest, type GetMessagesQuery, MessageTypeSchema, SenderTypeSchema, MessageSchema, SendMessageRequestSchema, GetMessagesQuerySchema, } from './types/message.js';
4
+ export { type Team, type CreateTeamRequest, TeamSchema, CreateTeamRequestSchema, } from './types/team.js';
5
+ export { type ProjectGroup, type CreateProjectRequest, ProjectGroupSchema, CreateProjectRequestSchema, } from './types/project.js';
6
+ export { type WSMessageType, type WSMessage, WSMessageTypeSchema, WSMessageSchema, } from './types/ws.js';
7
+ export { type ApiResponse, type PaginatedResponse, ApiResponseSchema, PaginatedResponseSchema, } from './types/api.js';
8
+ export { type AgentWakeupConfig, type DaemonConfig, type MessageUndeliveredPayload, AgentWakeupConfigSchema, DaemonConfigSchema, MessageUndeliveredPayloadSchema, } from './types/daemon.js';
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export { MDNS_SERVICE_TYPE, DEFAULT_PORT, HEARTBEAT_INTERVAL_MS, STALE_TIMEOUT_MS, MAX_MESSAGE_SIZE_BYTES, WS_RECONNECT_DELAY_MS, MCP_TOOL_NAMES, DAEMON_KEY, DAEMON_SPAWN_COOLDOWN_MS, } from './constants.js';
2
+ export { AgentStatusSchema, SkillSchema, AgentCardSchema, AgentSchema, RegisterAgentRequestSchema, HeartbeatRequestSchema, } from './types/agent.js';
3
+ export { MessageTypeSchema, SenderTypeSchema, MessageSchema, SendMessageRequestSchema, GetMessagesQuerySchema, } from './types/message.js';
4
+ export { TeamSchema, CreateTeamRequestSchema, } from './types/team.js';
5
+ export { ProjectGroupSchema, CreateProjectRequestSchema, } from './types/project.js';
6
+ export { WSMessageTypeSchema, WSMessageSchema, } from './types/ws.js';
7
+ export { ApiResponseSchema, PaginatedResponseSchema, } from './types/api.js';
8
+ export { AgentWakeupConfigSchema, DaemonConfigSchema, MessageUndeliveredPayloadSchema, } from './types/daemon.js';
@@ -0,0 +1,82 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentStatusSchema: z.ZodEnum<{
3
+ online: "online";
4
+ offline: "offline";
5
+ busy: "busy";
6
+ idle: "idle";
7
+ }>;
8
+ export declare const SkillSchema: z.ZodObject<{
9
+ id: z.ZodString;
10
+ name: z.ZodString;
11
+ description: z.ZodString;
12
+ tags: z.ZodArray<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ export declare const AgentCardSchema: z.ZodObject<{
15
+ name: z.ZodString;
16
+ description: z.ZodString;
17
+ version: z.ZodString;
18
+ url: z.ZodString;
19
+ skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
20
+ id: z.ZodString;
21
+ name: z.ZodString;
22
+ description: z.ZodString;
23
+ tags: z.ZodArray<z.ZodString>;
24
+ }, z.core.$strip>>>;
25
+ teams: z.ZodDefault<z.ZodArray<z.ZodString>>;
26
+ projectGroups: z.ZodDefault<z.ZodArray<z.ZodString>>;
27
+ }, z.core.$strip>;
28
+ export declare const AgentSchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ name: z.ZodString;
31
+ displayName: z.ZodString;
32
+ url: z.ZodString;
33
+ status: z.ZodEnum<{
34
+ online: "online";
35
+ offline: "offline";
36
+ busy: "busy";
37
+ idle: "idle";
38
+ }>;
39
+ agentCard: z.ZodOptional<z.ZodObject<{
40
+ name: z.ZodString;
41
+ description: z.ZodString;
42
+ version: z.ZodString;
43
+ url: z.ZodString;
44
+ skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
45
+ id: z.ZodString;
46
+ name: z.ZodString;
47
+ description: z.ZodString;
48
+ tags: z.ZodArray<z.ZodString>;
49
+ }, z.core.$strip>>>;
50
+ teams: z.ZodDefault<z.ZodArray<z.ZodString>>;
51
+ projectGroups: z.ZodDefault<z.ZodArray<z.ZodString>>;
52
+ }, z.core.$strip>>;
53
+ createdAt: z.ZodString;
54
+ lastHeartbeat: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>;
56
+ export declare const RegisterAgentRequestSchema: z.ZodObject<{
57
+ name: z.ZodString;
58
+ url: z.ZodString;
59
+ agentCard: z.ZodOptional<z.ZodObject<{
60
+ name: z.ZodString;
61
+ description: z.ZodString;
62
+ version: z.ZodString;
63
+ url: z.ZodString;
64
+ skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
65
+ id: z.ZodString;
66
+ name: z.ZodString;
67
+ description: z.ZodString;
68
+ tags: z.ZodArray<z.ZodString>;
69
+ }, z.core.$strip>>>;
70
+ teams: z.ZodDefault<z.ZodArray<z.ZodString>>;
71
+ projectGroups: z.ZodDefault<z.ZodArray<z.ZodString>>;
72
+ }, z.core.$strip>>;
73
+ teamIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
+ }, z.core.$strip>;
75
+ export declare const HeartbeatRequestSchema: z.ZodObject<{
76
+ status: z.ZodOptional<z.ZodEnum<{
77
+ online: "online";
78
+ offline: "offline";
79
+ busy: "busy";
80
+ idle: "idle";
81
+ }>>;
82
+ }, z.core.$strip>;
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ export const AgentStatusSchema = z.enum([
3
+ 'online',
4
+ 'offline',
5
+ 'busy',
6
+ 'idle',
7
+ ]);
8
+ export const SkillSchema = z.object({
9
+ id: z.string(),
10
+ name: z.string(),
11
+ description: z.string(),
12
+ tags: z.array(z.string()),
13
+ });
14
+ export const AgentCardSchema = z.object({
15
+ name: z.string(),
16
+ description: z.string(),
17
+ version: z.string(),
18
+ url: z.string(),
19
+ skills: z.array(SkillSchema).default([]),
20
+ teams: z.array(z.string()).default([]),
21
+ projectGroups: z.array(z.string()).default([]),
22
+ });
23
+ export const AgentSchema = z.object({
24
+ id: z.string().uuid(),
25
+ name: z.string(),
26
+ displayName: z.string(),
27
+ url: z.string(),
28
+ status: AgentStatusSchema,
29
+ agentCard: AgentCardSchema.optional(),
30
+ createdAt: z.string(),
31
+ lastHeartbeat: z.string().optional(),
32
+ });
33
+ export const RegisterAgentRequestSchema = z.object({
34
+ name: z.string(),
35
+ url: z.string(),
36
+ agentCard: AgentCardSchema.optional(),
37
+ teamIds: z.array(z.string()).optional(),
38
+ });
39
+ export const HeartbeatRequestSchema = z.object({
40
+ status: AgentStatusSchema.optional(),
41
+ });
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export declare const ApiResponseSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
3
+ success: z.ZodBoolean;
4
+ data: z.ZodOptional<T>;
5
+ error: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export declare const PaginatedResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
8
+ success: z.ZodBoolean;
9
+ data: z.ZodArray<T>;
10
+ total: z.ZodNumber;
11
+ limit: z.ZodNumber;
12
+ offset: z.ZodNumber;
13
+ error: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>;
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export const ApiResponseSchema = (dataSchema) => z.object({
3
+ success: z.boolean(),
4
+ data: dataSchema.optional(),
5
+ error: z.string().optional(),
6
+ });
7
+ export const PaginatedResponseSchema = (itemSchema) => z.object({
8
+ success: z.boolean(),
9
+ data: z.array(itemSchema),
10
+ total: z.number(),
11
+ limit: z.number(),
12
+ offset: z.number(),
13
+ error: z.string().optional(),
14
+ });
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+ export declare const MessageTypeSchema: z.ZodEnum<{
3
+ notification: "notification";
4
+ query: "query";
5
+ response: "response";
6
+ broadcast: "broadcast";
7
+ }>;
8
+ export declare const SenderTypeSchema: z.ZodEnum<{
9
+ agent: "agent";
10
+ person: "person";
11
+ }>;
12
+ export declare const MessageSchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ from: z.ZodString;
15
+ to: z.ZodString;
16
+ senderType: z.ZodEnum<{
17
+ agent: "agent";
18
+ person: "person";
19
+ }>;
20
+ content: z.ZodString;
21
+ type: z.ZodEnum<{
22
+ notification: "notification";
23
+ query: "query";
24
+ response: "response";
25
+ broadcast: "broadcast";
26
+ }>;
27
+ replyTo: z.ZodOptional<z.ZodString>;
28
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
29
+ read: z.ZodDefault<z.ZodBoolean>;
30
+ createdAt: z.ZodString;
31
+ }, z.core.$strip>;
32
+ export declare const SendMessageRequestSchema: z.ZodObject<{
33
+ from: z.ZodString;
34
+ to: z.ZodString;
35
+ senderType: z.ZodDefault<z.ZodEnum<{
36
+ agent: "agent";
37
+ person: "person";
38
+ }>>;
39
+ content: z.ZodString;
40
+ type: z.ZodDefault<z.ZodEnum<{
41
+ notification: "notification";
42
+ query: "query";
43
+ response: "response";
44
+ broadcast: "broadcast";
45
+ }>>;
46
+ replyTo: z.ZodOptional<z.ZodString>;
47
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
48
+ }, z.core.$strip>;
49
+ export declare const GetMessagesQuerySchema: z.ZodObject<{
50
+ agentId: z.ZodString;
51
+ since: z.ZodOptional<z.ZodString>;
52
+ limit: z.ZodDefault<z.ZodNumber>;
53
+ type: z.ZodOptional<z.ZodEnum<{
54
+ notification: "notification";
55
+ query: "query";
56
+ response: "response";
57
+ broadcast: "broadcast";
58
+ }>>;
59
+ }, z.core.$strip>;
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ export const MessageTypeSchema = z.enum([
3
+ 'notification',
4
+ 'query',
5
+ 'response',
6
+ 'broadcast',
7
+ ]);
8
+ export const SenderTypeSchema = z.enum([
9
+ 'agent',
10
+ 'person',
11
+ ]);
12
+ export const MessageSchema = z.object({
13
+ id: z.string().uuid(),
14
+ from: z.string(),
15
+ to: z.string(),
16
+ senderType: SenderTypeSchema,
17
+ content: z.string(),
18
+ type: MessageTypeSchema,
19
+ replyTo: z.string().optional(),
20
+ metadata: z.record(z.string(), z.unknown()).optional(),
21
+ read: z.boolean().default(false),
22
+ createdAt: z.string(),
23
+ });
24
+ export const SendMessageRequestSchema = z.object({
25
+ from: z.string(),
26
+ to: z.string(),
27
+ senderType: SenderTypeSchema.default('agent'),
28
+ content: z.string(),
29
+ type: MessageTypeSchema.default('notification'),
30
+ replyTo: z.string().optional(),
31
+ metadata: z.record(z.string(), z.unknown()).optional(),
32
+ });
33
+ export const GetMessagesQuerySchema = z.object({
34
+ agentId: z.string(),
35
+ since: z.string().optional(),
36
+ limit: z.number().int().positive().default(50),
37
+ type: MessageTypeSchema.optional(),
38
+ });
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const ProjectGroupSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ name: z.ZodString;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ agentIds: z.ZodArray<z.ZodString>;
7
+ createdAt: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export declare const CreateProjectRequestSchema: z.ZodObject<{
10
+ name: z.ZodString;
11
+ description: z.ZodOptional<z.ZodString>;
12
+ agentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
+ }, z.core.$strip>;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export const ProjectGroupSchema = z.object({
3
+ id: z.string(),
4
+ name: z.string(),
5
+ description: z.string().optional(),
6
+ agentIds: z.array(z.string()),
7
+ createdAt: z.string(),
8
+ });
9
+ export const CreateProjectRequestSchema = z.object({
10
+ name: z.string(),
11
+ description: z.string().optional(),
12
+ agentIds: z.array(z.string()).optional(),
13
+ });
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const TeamSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ name: z.ZodString;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ agentIds: z.ZodArray<z.ZodString>;
7
+ createdAt: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export declare const CreateTeamRequestSchema: z.ZodObject<{
10
+ name: z.ZodString;
11
+ description: z.ZodOptional<z.ZodString>;
12
+ agentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
+ }, z.core.$strip>;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export const TeamSchema = z.object({
3
+ id: z.string(),
4
+ name: z.string(),
5
+ description: z.string().optional(),
6
+ agentIds: z.array(z.string()),
7
+ createdAt: z.string(),
8
+ });
9
+ export const CreateTeamRequestSchema = z.object({
10
+ name: z.string(),
11
+ description: z.string().optional(),
12
+ agentIds: z.array(z.string()).optional(),
13
+ });
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ export declare const WSMessageTypeSchema: z.ZodEnum<{
3
+ register: "register";
4
+ message: "message";
5
+ agent_online: "agent_online";
6
+ agent_offline: "agent_offline";
7
+ heartbeat: "heartbeat";
8
+ error: "error";
9
+ message_undelivered: "message_undelivered";
10
+ }>;
11
+ export declare const WSMessageSchema: z.ZodObject<{
12
+ type: z.ZodEnum<{
13
+ register: "register";
14
+ message: "message";
15
+ agent_online: "agent_online";
16
+ agent_offline: "agent_offline";
17
+ heartbeat: "heartbeat";
18
+ error: "error";
19
+ message_undelivered: "message_undelivered";
20
+ }>;
21
+ payload: z.ZodUnknown;
22
+ timestamp: z.ZodString;
23
+ }, z.core.$strip>;
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export const WSMessageTypeSchema = z.enum([
3
+ 'register',
4
+ 'message',
5
+ 'agent_online',
6
+ 'agent_offline',
7
+ 'heartbeat',
8
+ 'error',
9
+ 'message_undelivered',
10
+ ]);
11
+ export const WSMessageSchema = z.object({
12
+ type: WSMessageTypeSchema,
13
+ payload: z.unknown(),
14
+ timestamp: z.string(),
15
+ });
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { AgentStatusSchema, SkillSchema, AgentCardSchema, AgentSchema, RegisterAgentRequestSchema, HeartbeatRequestSchema } from '../schemas/agent.js';
3
+ export type AgentStatus = z.infer<typeof AgentStatusSchema>;
4
+ export type Skill = z.infer<typeof SkillSchema>;
5
+ export type AgentCard = z.infer<typeof AgentCardSchema>;
6
+ export type Agent = z.infer<typeof AgentSchema>;
7
+ export type RegisterAgentRequest = z.infer<typeof RegisterAgentRequestSchema>;
8
+ export type HeartbeatRequest = z.infer<typeof HeartbeatRequestSchema>;
9
+ export { AgentStatusSchema, SkillSchema, AgentCardSchema, AgentSchema, RegisterAgentRequestSchema, HeartbeatRequestSchema, };
@@ -0,0 +1,2 @@
1
+ import { AgentStatusSchema, SkillSchema, AgentCardSchema, AgentSchema, RegisterAgentRequestSchema, HeartbeatRequestSchema, } from '../schemas/agent.js';
2
+ export { AgentStatusSchema, SkillSchema, AgentCardSchema, AgentSchema, RegisterAgentRequestSchema, HeartbeatRequestSchema, };
@@ -0,0 +1,15 @@
1
+ import { ApiResponseSchema, PaginatedResponseSchema } from '../schemas/api.js';
2
+ export type ApiResponse<T> = {
3
+ success: boolean;
4
+ data?: T;
5
+ error?: string;
6
+ };
7
+ export type PaginatedResponse<T> = {
8
+ success: boolean;
9
+ data: T[];
10
+ total: number;
11
+ limit: number;
12
+ offset: number;
13
+ error?: string;
14
+ };
15
+ export { ApiResponseSchema, PaginatedResponseSchema, };
@@ -0,0 +1,2 @@
1
+ import { ApiResponseSchema, PaginatedResponseSchema, } from '../schemas/api.js';
2
+ export { ApiResponseSchema, PaginatedResponseSchema, };
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentWakeupConfigSchema: z.ZodObject<{
3
+ headlessWakeup: z.ZodDefault<z.ZodBoolean>;
4
+ command: z.ZodString;
5
+ args: z.ZodArray<z.ZodString>;
6
+ workdir: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export type AgentWakeupConfig = z.infer<typeof AgentWakeupConfigSchema>;
9
+ export declare const DaemonConfigSchema: z.ZodObject<{
10
+ hubUrl: z.ZodDefault<z.ZodString>;
11
+ agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
12
+ headlessWakeup: z.ZodDefault<z.ZodBoolean>;
13
+ command: z.ZodString;
14
+ args: z.ZodArray<z.ZodString>;
15
+ workdir: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>>>;
17
+ }, z.core.$strip>;
18
+ export type DaemonConfig = z.infer<typeof DaemonConfigSchema>;
19
+ export declare const MessageUndeliveredPayloadSchema: z.ZodObject<{
20
+ recipientAgentId: z.ZodString;
21
+ recipientAgentName: z.ZodString;
22
+ message: z.ZodUnknown;
23
+ }, z.core.$strip>;
24
+ export type MessageUndeliveredPayload = z.infer<typeof MessageUndeliveredPayloadSchema>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ // Config for a single agent's wakeup settings
3
+ export const AgentWakeupConfigSchema = z.object({
4
+ headlessWakeup: z.boolean().default(false),
5
+ command: z.string(), // e.g., "claude", "opencode", "gemini"
6
+ args: z.array(z.string()), // e.g., ["-p", "{message}"]
7
+ workdir: z.string().optional(), // Working directory for spawned process; defaults to daemon start cwd
8
+ });
9
+ // Full daemon configuration
10
+ export const DaemonConfigSchema = z.object({
11
+ hubUrl: z.string().default('http://localhost:3000'),
12
+ agents: z.record(z.string(), AgentWakeupConfigSchema).default({}),
13
+ });
14
+ // Payload for message_undelivered WS event
15
+ export const MessageUndeliveredPayloadSchema = z.object({
16
+ recipientAgentId: z.string(),
17
+ recipientAgentName: z.string(),
18
+ message: z.unknown(),
19
+ });
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { MessageTypeSchema, SenderTypeSchema, MessageSchema, SendMessageRequestSchema, GetMessagesQuerySchema } from '../schemas/message.js';
3
+ export type MessageType = z.infer<typeof MessageTypeSchema>;
4
+ export type SenderType = z.infer<typeof SenderTypeSchema>;
5
+ export type Message = z.infer<typeof MessageSchema>;
6
+ export type SendMessageRequest = z.infer<typeof SendMessageRequestSchema>;
7
+ export type GetMessagesQuery = z.infer<typeof GetMessagesQuerySchema>;
8
+ export { MessageTypeSchema, SenderTypeSchema, MessageSchema, SendMessageRequestSchema, GetMessagesQuerySchema, };
@@ -0,0 +1,2 @@
1
+ import { MessageTypeSchema, SenderTypeSchema, MessageSchema, SendMessageRequestSchema, GetMessagesQuerySchema, } from '../schemas/message.js';
2
+ export { MessageTypeSchema, SenderTypeSchema, MessageSchema, SendMessageRequestSchema, GetMessagesQuerySchema, };
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ import { ProjectGroupSchema, CreateProjectRequestSchema } from '../schemas/project.js';
3
+ export type ProjectGroup = z.infer<typeof ProjectGroupSchema>;
4
+ export type CreateProjectRequest = z.infer<typeof CreateProjectRequestSchema>;
5
+ export { ProjectGroupSchema, CreateProjectRequestSchema, };
@@ -0,0 +1,2 @@
1
+ import { ProjectGroupSchema, CreateProjectRequestSchema, } from '../schemas/project.js';
2
+ export { ProjectGroupSchema, CreateProjectRequestSchema, };
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ import { TeamSchema, CreateTeamRequestSchema } from '../schemas/team.js';
3
+ export type Team = z.infer<typeof TeamSchema>;
4
+ export type CreateTeamRequest = z.infer<typeof CreateTeamRequestSchema>;
5
+ export { TeamSchema, CreateTeamRequestSchema, };
@@ -0,0 +1,2 @@
1
+ import { TeamSchema, CreateTeamRequestSchema, } from '../schemas/team.js';
2
+ export { TeamSchema, CreateTeamRequestSchema, };
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ import { WSMessageTypeSchema, WSMessageSchema } from '../schemas/ws.js';
3
+ export type WSMessageType = z.infer<typeof WSMessageTypeSchema>;
4
+ export type WSMessage = z.infer<typeof WSMessageSchema>;
5
+ export { WSMessageTypeSchema, WSMessageSchema, };
@@ -0,0 +1,2 @@
1
+ import { WSMessageTypeSchema, WSMessageSchema, } from '../schemas/ws.js';
2
+ export { WSMessageTypeSchema, WSMessageSchema, };
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@swarmroom/shared",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Shared types, schemas, and constants for SwarmRoom",
6
+ "keywords": ["swarmroom", "shared", "types", "schemas"],
7
+ "license": "MIT",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/visual-z/swarm.git",
14
+ "directory": "packages/shared"
15
+ },
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "exports": {
19
+ ".": "./dist/index.js",
20
+ "./dist/*": "./dist/*"
21
+ },
22
+ "files": ["dist", "README.md", "LICENSE"],
23
+ "scripts": {
24
+ "build": "tsc",
25
+ "dev": "tsc --watch",
26
+ "prepublishOnly": "npm run build"
27
+ },
28
+ "dependencies": {
29
+ "zod": "^4.3.6"
30
+ }
31
+ }